From 8c7315ba31d43fbb1562e0faa1c1c3f7ef3759a6 Mon Sep 17 00:00:00 2001 From: Fan Pei Date: Tue, 12 Mar 2024 23:01:19 +0900 Subject: [PATCH] feat(client): use browser native UI on date editing (#275) --- .../inspector/InspectorDataField/EditInput.vue | 8 +++++++- .../devtools-kit/__tests__/component/format.test.ts | 2 ++ .../devtools-kit/src/core/component/state/custom.ts | 13 +++++++++++++ .../devtools-kit/src/core/component/state/format.ts | 4 ++++ .../src/core/component/state/replacer.ts | 4 ++-- .../devtools-kit/src/core/component/types/custom.ts | 2 +- packages/ui/src/components/Input.vue | 6 +++--- packages/ui/storybook/Input.story.vue | 5 ++++- 8 files changed, 36 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/inspector/InspectorDataField/EditInput.vue b/packages/client/src/components/inspector/InspectorDataField/EditInput.vue index 68a1c3d3..2f9969ab 100644 --- a/packages/client/src/components/inspector/InspectorDataField/EditInput.vue +++ b/packages/client/src/components/inspector/InspectorDataField/EditInput.vue @@ -19,6 +19,12 @@ const emit = defineEmits<{ 'update:modelValue': [value: string] }>() +const inputType = computed(() => { + if (props.customType === 'date') + return 'datetime-local' + return '' +}) + // TODO: keyboard shortcut, esc to cancel, enter to submit // and show tooltip on button when hovering @@ -52,7 +58,7 @@ watch(value, checkWarning())