@finema/core 3.23.2 → 3.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +22 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +3 -14
  4. package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
  5. package/dist/runtime/components/Dialog/index.vue +11 -10
  6. package/dist/runtime/components/Empty.d.vue.ts +1 -1
  7. package/dist/runtime/components/Empty.vue +16 -12
  8. package/dist/runtime/components/Empty.vue.d.ts +1 -1
  9. package/dist/runtime/components/FlexDeck/index.vue +85 -92
  10. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  11. package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
  12. package/dist/runtime/components/Form/Fields.vue +17 -11
  13. package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
  14. package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
  15. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
  16. package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
  17. package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
  18. package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
  19. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
  20. package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
  21. package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
  22. package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
  23. package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
  24. package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
  25. package/dist/runtime/components/Form/InputRating/index.vue +1 -5
  26. package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
  27. package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
  28. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
  29. package/dist/runtime/components/Form/InputTags/index.vue +55 -59
  30. package/dist/runtime/components/Form/InputText/index.vue +122 -133
  31. package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
  32. package/dist/runtime/components/Form/InputTime/index.d.vue.ts +1 -0
  33. package/dist/runtime/components/Form/InputTime/index.vue +66 -63
  34. package/dist/runtime/components/Form/InputTime/index.vue.d.ts +1 -0
  35. package/dist/runtime/components/Form/InputTime/types.d.ts +2 -0
  36. package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
  37. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
  38. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
  39. package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
  40. package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
  41. package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
  42. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
  43. package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
  44. package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
  45. package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
  46. package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
  47. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  48. package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
  49. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  50. package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
  51. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  52. package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
  53. package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
  54. package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
  55. package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
  56. package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
  57. package/dist/runtime/components/Form/index.vue +5 -5
  58. package/dist/runtime/components/Image.vue +22 -28
  59. package/dist/runtime/components/Loader.d.vue.ts +1 -1
  60. package/dist/runtime/components/Loader.vue +10 -7
  61. package/dist/runtime/components/Loader.vue.d.ts +1 -1
  62. package/dist/runtime/components/Log/LogItem.vue +1 -3
  63. package/dist/runtime/components/Log/index.vue +1 -3
  64. package/dist/runtime/components/Table/Base.vue +117 -137
  65. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  66. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  67. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  68. package/dist/runtime/components/Table/ColumnText.vue +10 -10
  69. package/dist/runtime/components/Table/Pagination.vue +71 -77
  70. package/dist/runtime/components/Table/Simple.vue +19 -19
  71. package/dist/runtime/components/Table/index.vue +36 -42
  72. package/dist/runtime/composables/loaderList.js +1 -3
  73. package/dist/runtime/composables/loaderPage.js +156 -133
  74. package/dist/runtime/composables/useConfig.js +1 -1
  75. package/dist/runtime/composables/useDialog.js +1 -3
  76. package/dist/runtime/composables/useForm.d.ts +1 -1
  77. package/dist/runtime/composables/useForm.js +1 -3
  78. package/dist/runtime/composables/useTable.js +2 -14
  79. package/dist/runtime/helpers/apiBaseHelper.js +6 -24
  80. package/dist/runtime/helpers/apiListHelper.js +2 -5
  81. package/dist/runtime/helpers/apiObjectHelper.js +2 -5
  82. package/dist/runtime/helpers/apiPageHelper.js +19 -38
  83. package/dist/runtime/helpers/componentHelper.js +2 -6
  84. package/dist/runtime/helpers/uploadCore.js +1 -4
  85. package/dist/runtime/locale/index.js +1 -4
  86. package/dist/runtime/server/tsconfig.json +3 -3
  87. package/dist/runtime/styles/main.css +1 -1
  88. package/package.json +39 -26
@@ -1,63 +1,63 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Popover
4
- v-model:open="showSuggestions"
5
- :dismissible="false"
6
- :ui="{ content: 'w-(--reka-popper-anchor-width)' }"
7
- >
8
- <template #anchor>
9
- <InputTags
10
- :model-value="value"
11
- :disabled="wrapperProps.disabled"
12
- :leading-icon="leadingIcon"
13
- :max-length="maxLength"
14
- :variant="variant"
15
- :delete-icon="deleteIcon"
16
- :size="size"
17
- :trailing-icon="trailingIcon"
18
- :loading="loading"
19
- :loading-icon="loadingIcon"
20
- :name="name"
21
- :placeholder="wrapperProps.placeholder"
22
- :autofocus="!!autoFocus"
23
- :icon="icon"
24
- :readonly="readonly"
25
- :ui="ui"
26
- @update:model-value="onChange"
27
- @addTag="onAdd"
28
- @removeTag="onRemove"
29
- @focus="onFocus"
30
- @blur="onBlur"
31
- @keydown="onKeydown"
32
- @input="onInput"
33
- />
34
- </template>
35
-
36
- <template #content>
37
- <div
38
- v-if="showSuggestions && filteredSuggestions.length > 0"
39
- ref="suggestionsContainerRef"
40
- :class="theme.suggestionsContainer()"
41
- >
42
- <div
43
- v-for="(suggestion, index) in filteredSuggestions"
44
- :key="suggestion"
45
- :ref="(el) => setSuggestionItemRef(el, index)"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Popover
4
+ v-model:open="showSuggestions"
5
+ :dismissible="false"
6
+ :ui="{ content: 'w-(--reka-popper-anchor-width)' }"
7
+ >
8
+ <template #anchor>
9
+ <InputTags
10
+ :model-value="value"
11
+ :disabled="wrapperProps.disabled"
12
+ :leading-icon="leadingIcon"
13
+ :max-length="maxLength"
14
+ :variant="variant"
15
+ :delete-icon="deleteIcon"
16
+ :size="size"
17
+ :trailing-icon="trailingIcon"
18
+ :loading="loading"
19
+ :loading-icon="loadingIcon"
20
+ :name="name"
21
+ :placeholder="wrapperProps.placeholder"
22
+ :autofocus="!!autoFocus"
23
+ :icon="icon"
24
+ :readonly="readonly"
25
+ :ui="ui"
26
+ @update:model-value="onChange"
27
+ @addTag="onAdd"
28
+ @removeTag="onRemove"
29
+ @focus="onFocus"
30
+ @blur="onBlur"
31
+ @keydown="onKeydown"
32
+ @input="onInput"
33
+ />
34
+ </template>
35
+
36
+ <template #content>
37
+ <div
38
+ v-if="showSuggestions && filteredSuggestions.length > 0"
39
+ ref="suggestionsContainerRef"
40
+ :class="theme.suggestionsContainer()"
41
+ >
42
+ <div
43
+ v-for="(suggestion, index) in filteredSuggestions"
44
+ :key="suggestion"
45
+ :ref="(el) => setSuggestionItemRef(el, index)"
46
46
  :class="[
47
47
  theme.suggestionItem(),
48
48
  {
49
49
  [theme.suggestionItemActive()]: index === selectedSuggestionIndex
50
50
  }
51
- ]"
52
- @mousedown.prevent="selectSuggestion(suggestion, index)"
53
- @mouseenter="selectedSuggestionIndex = index"
54
- >
55
- {{ suggestion }}
56
- </div>
57
- </div>
58
- </template>
59
- </Popover>
60
- </FieldWrapper>
51
+ ]"
52
+ @mousedown.prevent="selectSuggestion(suggestion, index)"
53
+ @mouseenter="selectedSuggestionIndex = index"
54
+ >
55
+ {{ suggestion }}
56
+ </div>
57
+ </div>
58
+ </template>
59
+ </Popover>
60
+ </FieldWrapper>
61
61
  </template>
62
62
 
63
63
  <script setup>
@@ -94,11 +94,7 @@ const props = defineProps({
94
94
  containerUi: { type: null, required: false }
95
95
  });
96
96
  const theme = computed(() => useUiConfig(inputTheme, "input")());
97
- const {
98
- value,
99
- wrapperProps,
100
- handleChange
101
- } = useFieldHOC(props);
97
+ const { value, wrapperProps, handleChange } = useFieldHOC(props);
102
98
  const showSuggestions = ref(false);
103
99
  const selectedSuggestionIndex = ref(-1);
104
100
  const suggestionsContainerRef = ref();
@@ -1,92 +1,89 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <div class="relative">
4
- <Input
5
- v-if="type === 'password'"
6
- ref="inputRef"
7
- v-maska="activeMaskOptions"
8
- :model-value="value"
9
- :disabled="wrapperProps.disabled"
10
- :leading-icon="leadingIcon"
11
- :trailing-icon="trailingIcon"
12
- :loading="loading"
13
- :loading-icon="loadingIcon"
14
- :name="name"
15
- :placeholder="wrapperProps.placeholder"
16
- :type="isShowPassword ? 'text' : 'password'"
17
- :autofocus="!!autoFocus"
18
- :icon="icon"
19
- :readonly="readonly"
20
- :ui="defu(ui, { icon: { trailing: { pointer: '' } } })"
21
- @update:model-value="onChange"
22
- @focus="onFocus"
23
- @blur="onBlur"
24
- @keydown="onKeydown"
25
- >
26
- <template #trailing>
27
- <Button
28
- color="neutral"
29
- variant="link"
30
- :icon="isShowPassword ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
31
- :padded="false"
32
- @click="isShowPassword = !isShowPassword"
33
- />
34
- </template>
35
- </Input>
36
- <Popover
37
- v-else
38
- v-model:open="showSuggestions"
39
- :dismissible="false"
40
- :ui="{ content: 'w-(--reka-popper-anchor-width)' }"
41
- >
42
- <template #anchor>
43
- <Input
44
- ref="inputRef"
45
- v-maska="activeMaskOptions"
46
- :model-value="value"
47
- :disabled="wrapperProps.disabled"
48
- :leading-icon="leadingIcon"
49
- :trailing-icon="trailingIcon"
50
- :loading="loading"
51
- :loading-icon="loadingIcon"
52
- :name="name"
53
- :placeholder="wrapperProps.placeholder"
54
- :type="type"
55
- :autofocus="!!autoFocus"
56
- :icon="icon"
57
- :readonly="readonly"
58
- :ui="ui"
59
- @update:model-value="onChange"
60
- @focus="onFocus"
61
- @blur="onBlur"
62
- @keydown="onKeydown"
63
- />
64
- </template>
65
-
66
- <template #content>
67
- <div
68
- v-if="showSuggestions && filteredSuggestions.length > 0"
69
- ref="suggestionsContainerRef"
70
- :class="theme.suggestionsContainer()"
71
- >
72
- <div
73
- v-for="(suggestion, index) in filteredSuggestions"
74
- :key="suggestion"
75
- :ref="(el) => setSuggestionItemRef(el, index)"
76
- :class="[
77
- theme.suggestionItem(),
78
- { [theme.suggestionItemActive()]: index === selectedSuggestionIndex }
79
- ]"
80
- @mousedown.prevent="selectSuggestion(suggestion, index)"
81
- @mouseenter="selectedSuggestionIndex = index"
82
- >
83
- {{ suggestion }}
84
- </div>
85
- </div>
86
- </template>
87
- </Popover>
88
- </div>
89
- </FieldWrapper>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <div class="relative">
4
+ <Input
5
+ v-if="type === 'password'"
6
+ ref="inputRef"
7
+ v-maska="activeMaskOptions"
8
+ :model-value="value"
9
+ :disabled="wrapperProps.disabled"
10
+ :leading-icon="leadingIcon"
11
+ :trailing-icon="trailingIcon"
12
+ :loading="loading"
13
+ :loading-icon="loadingIcon"
14
+ :name="name"
15
+ :placeholder="wrapperProps.placeholder"
16
+ :type="isShowPassword ? 'text' : 'password'"
17
+ :autofocus="!!autoFocus"
18
+ :icon="icon"
19
+ :readonly="readonly"
20
+ :ui="defu(ui, { icon: { trailing: { pointer: '' } } })"
21
+ @update:model-value="onChange"
22
+ @focus="onFocus"
23
+ @blur="onBlur"
24
+ @keydown="onKeydown"
25
+ >
26
+ <template #trailing>
27
+ <Button
28
+ color="neutral"
29
+ variant="link"
30
+ :icon="isShowPassword ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
31
+ :padded="false"
32
+ @click="isShowPassword = !isShowPassword"
33
+ />
34
+ </template>
35
+ </Input>
36
+ <Popover
37
+ v-else
38
+ v-model:open="showSuggestions"
39
+ :dismissible="false"
40
+ :ui="{ content: 'w-(--reka-popper-anchor-width)' }"
41
+ >
42
+ <template #anchor>
43
+ <Input
44
+ ref="inputRef"
45
+ v-maska="activeMaskOptions"
46
+ :model-value="value"
47
+ :disabled="wrapperProps.disabled"
48
+ :leading-icon="leadingIcon"
49
+ :trailing-icon="trailingIcon"
50
+ :loading="loading"
51
+ :loading-icon="loadingIcon"
52
+ :name="name"
53
+ :placeholder="wrapperProps.placeholder"
54
+ :type="type"
55
+ :autofocus="!!autoFocus"
56
+ :icon="icon"
57
+ :readonly="readonly"
58
+ :ui="ui"
59
+ @update:model-value="onChange"
60
+ @focus="onFocus"
61
+ @blur="onBlur"
62
+ @keydown="onKeydown"
63
+ />
64
+ </template>
65
+
66
+ <template #content>
67
+ <div
68
+ v-if="showSuggestions && filteredSuggestions.length > 0"
69
+ ref="suggestionsContainerRef"
70
+ :class="theme.suggestionsContainer()"
71
+ >
72
+ <div
73
+ v-for="(suggestion, index) in filteredSuggestions"
74
+ :key="suggestion"
75
+ :ref="(el) => setSuggestionItemRef(el, index)"
76
+ :class="[theme.suggestionItem(), { [theme.suggestionItemActive()]: index === selectedSuggestionIndex }]"
77
+ @mousedown.prevent="selectSuggestion(suggestion, index)"
78
+ @mouseenter="selectedSuggestionIndex = index"
79
+ >
80
+ {{ suggestion }}
81
+ </div>
82
+ </div>
83
+ </template>
84
+ </Popover>
85
+ </div>
86
+ </FieldWrapper>
90
87
  </template>
91
88
 
92
89
  <script setup>
@@ -128,11 +125,7 @@ const props = defineProps({
128
125
  containerUi: { type: null, required: false }
129
126
  });
130
127
  const theme = computed(() => useUiConfig(inputTheme, "input")());
131
- const {
132
- value,
133
- wrapperProps,
134
- handleChange
135
- } = useFieldHOC(props);
128
+ const { value, wrapperProps, handleChange } = useFieldHOC(props);
136
129
  const isShowPassword = ref(false);
137
130
  const inputRef = ref();
138
131
  const showSuggestions = ref(false);
@@ -158,9 +151,7 @@ const filteredSuggestions = computed(() => {
158
151
  return props.suggestions || [];
159
152
  }
160
153
  const inputValue = value.value.toLowerCase();
161
- return props.suggestions.filter(
162
- (suggestion) => suggestion.toLowerCase().includes(inputValue)
163
- );
154
+ return props.suggestions.filter((suggestion) => suggestion.toLowerCase().includes(inputValue));
164
155
  });
165
156
  const onFocus = () => {
166
157
  if (props.suggestions && props.suggestions.length > 0) {
@@ -246,44 +237,42 @@ const scrollToSuggestionByIndex = (index) => {
246
237
  }
247
238
  }
248
239
  };
249
- const activeMaskOptions = computed(
250
- () => {
251
- if (props.maskOptions && Object.keys(props.maskOptions).length > 0) {
252
- if (typeof props.maskOptions.mask === "string" && Object.keys(props.maskOptions).length === 1) {
253
- return props.maskOptions.mask;
254
- }
255
- return props.maskOptions;
256
- }
257
- const options = {};
258
- let hasIndividualProps = false;
259
- if (props.mask !== void 0) {
260
- options.mask = props.mask;
261
- hasIndividualProps = true;
262
- }
263
- if (props.maskTokens !== void 0) {
264
- options.tokens = props.maskTokens;
265
- hasIndividualProps = true;
240
+ const activeMaskOptions = computed(() => {
241
+ if (props.maskOptions && Object.keys(props.maskOptions).length > 0) {
242
+ if (typeof props.maskOptions.mask === "string" && Object.keys(props.maskOptions).length === 1) {
243
+ return props.maskOptions.mask;
266
244
  }
267
- if (props.maskEager !== void 0) {
268
- options.eager = props.maskEager;
269
- hasIndividualProps = true;
270
- }
271
- if (props.maskReversed !== void 0) {
272
- options.reversed = props.maskReversed;
273
- hasIndividualProps = true;
274
- }
275
- if (props.maskTokensReplace !== void 0) {
276
- options.tokensReplace = props.maskTokensReplace;
277
- hasIndividualProps = true;
278
- }
279
- if (hasIndividualProps) {
280
- const keys = Object.keys(options);
281
- if (keys.length === 1 && keys[0] === "mask" && typeof options.mask === "string") {
282
- return options.mask;
283
- }
284
- return options;
245
+ return props.maskOptions;
246
+ }
247
+ const options = {};
248
+ let hasIndividualProps = false;
249
+ if (props.mask !== void 0) {
250
+ options.mask = props.mask;
251
+ hasIndividualProps = true;
252
+ }
253
+ if (props.maskTokens !== void 0) {
254
+ options.tokens = props.maskTokens;
255
+ hasIndividualProps = true;
256
+ }
257
+ if (props.maskEager !== void 0) {
258
+ options.eager = props.maskEager;
259
+ hasIndividualProps = true;
260
+ }
261
+ if (props.maskReversed !== void 0) {
262
+ options.reversed = props.maskReversed;
263
+ hasIndividualProps = true;
264
+ }
265
+ if (props.maskTokensReplace !== void 0) {
266
+ options.tokensReplace = props.maskTokensReplace;
267
+ hasIndividualProps = true;
268
+ }
269
+ if (hasIndividualProps) {
270
+ const keys = Object.keys(options);
271
+ if (keys.length === 1 && keys[0] === "mask" && typeof options.mask === "string") {
272
+ return options.mask;
285
273
  }
286
- return void 0;
274
+ return options;
287
275
  }
288
- );
276
+ return void 0;
277
+ });
289
278
  </script>
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Textarea
4
- :model-value="value"
5
- :disabled="wrapperProps.disabled"
6
- :name="name"
7
- :resize="resize"
8
- :placeholder="wrapperProps.placeholder"
9
- :autofocus="!!autoFocus"
10
- :autoresize="autoresize"
11
- :rows="rows"
12
- :maxrows="maxrows"
13
- :loading="loading"
14
- :loading-icon="loadingIcon"
15
- :readonly="readonly"
16
- :ui="ui"
17
- @update:model-value="onChange"
18
- />
19
- </FieldWrapper>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Textarea
4
+ :model-value="value"
5
+ :disabled="wrapperProps.disabled"
6
+ :name="name"
7
+ :resize="resize"
8
+ :placeholder="wrapperProps.placeholder"
9
+ :autofocus="!!autoFocus"
10
+ :autoresize="autoresize"
11
+ :rows="rows"
12
+ :maxrows="maxrows"
13
+ :loading="loading"
14
+ :loading-icon="loadingIcon"
15
+ :readonly="readonly"
16
+ :ui="ui"
17
+ @update:model-value="onChange"
18
+ />
19
+ </FieldWrapper>
20
20
  </template>
21
21
 
22
22
  <script setup>
@@ -46,11 +46,7 @@ const props = defineProps({
46
46
  ui: { type: null, required: false },
47
47
  containerUi: { type: null, required: false }
48
48
  });
49
- const {
50
- value,
51
- wrapperProps,
52
- handleChange
53
- } = useFieldHOC(props);
49
+ const { value, wrapperProps, handleChange } = useFieldHOC(props);
54
50
  const onChange = (value2) => {
55
51
  handleChange(value2);
56
52
  emits("change", value2);
@@ -5,6 +5,7 @@ declare const __VLS_export: import("vue").DefineComponent<ITimeFieldProps, {}, {
5
5
  }, string, import("vue").PublicProps, Readonly<ITimeFieldProps> & Readonly<{
6
6
  onChange?: ((...args: any[]) => any) | undefined;
7
7
  }>, {
8
+ step: number;
8
9
  clearIcon: string;
9
10
  teleport: boolean | string | HTMLElement;
10
11
  enableSeconds: boolean;
@@ -1,47 +1,51 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- v-model="innerValue"
5
- :teleport="teleport"
6
- :disabled="wrapperProps.disabled"
7
- :cancel-text="messages.common.cancel"
8
- :select-text="messages.common.select"
9
- :locale="appConfig.core?.locale"
10
- time-picker
11
- :placeholder="wrapperProps.placeholder"
12
- :format="format"
13
- :min-time="minTime"
14
- :max-time="maxTime"
15
- :start-time="startTime"
16
- :required="required"
17
- :enable-seconds="enableSeconds"
18
- @update:model-value="onChange"
19
- >
20
- <template #dp-input="{ value: innerValue }">
21
- <Input
22
- :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
23
- type="text"
24
- :disabled="wrapperProps.disabled"
25
- :model-value="innerValue"
26
- :placeholder="wrapperProps.placeholder"
27
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ v-model="innerValue"
5
+ :teleport="teleport"
6
+ :disabled="wrapperProps.disabled"
7
+ :cancel-text="messages.common.cancel"
8
+ :select-text="messages.common.select"
9
+ :locale="appConfig.core?.locale"
10
+ time-picker
11
+ :placeholder="wrapperProps.placeholder"
12
+ :format="format"
13
+ :min-time="minTime"
14
+ :max-time="maxTime"
15
+ :start-time="startTime"
16
+ :required="required"
17
+ :enable-seconds="enableSeconds"
18
+ :minutes-grid-increment="step"
19
+ :minutes-increment="step"
20
+ @update:model-value="onChange"
21
+ >
22
+ <template #dp-input="{ value: innerValue }">
23
+ <Input
24
+ :trailing-icon="innerValue ? void 0 : 'i-heroicons-clock'"
25
+ type="text"
26
+ :disabled="wrapperProps.disabled"
27
+ :model-value="innerValue"
28
+ :placeholder="wrapperProps.placeholder"
29
+ :readonly="true"
28
30
  :ui="{
29
31
  base: 'cursor-pointer select-none',
30
32
  trailingIcon: 'cursor-pointer'
31
- }"
32
- />
33
- </template>
34
- <template #clear-icon="{ clear }">
35
- <Icon
36
- :name="clearIcon"
37
- :class="theme.clearIcon({
38
- class: [ui?.clearIcon]
39
- })"
40
- @click.stop="clear"
41
- />
42
- </template>
43
- </Datepicker>
44
- </FieldWrapper>
33
+ }"
34
+ />
35
+ </template>
36
+ <template #clear-icon="{ clear }">
37
+ <Icon
38
+ :name="clearIcon"
39
+ :class="
40
+ theme.clearIcon({
41
+ class: [ui?.clearIcon]
42
+ })
43
+ "
44
+ @click.stop="clear"
45
+ />
46
+ </template>
47
+ </Datepicker>
48
+ </FieldWrapper>
45
49
  </template>
46
50
 
47
51
  <script setup>
@@ -60,6 +64,7 @@ const props = defineProps({
60
64
  format: { type: String, required: false },
61
65
  enableSeconds: { type: Boolean, required: false, default: false },
62
66
  teleport: { type: [Boolean, String], required: false, skipCheck: true, default: true },
67
+ step: { type: Number, required: false, default: 1 },
63
68
  form: { type: Object, required: false },
64
69
  name: { type: String, required: true },
65
70
  errorMessage: { type: String, required: false },
@@ -79,11 +84,7 @@ const props = defineProps({
79
84
  const appConfig = useAppConfig();
80
85
  const innerValue = ref(void 0);
81
86
  const theme = computed(() => useUiConfig(dateTimeTheme, "dateTime")());
82
- const {
83
- value,
84
- wrapperProps,
85
- handleChange
86
- } = useFieldHOC(props);
87
+ const { value, wrapperProps, handleChange } = useFieldHOC(props);
87
88
  const onChange = (value2) => {
88
89
  let timeText = void 0;
89
90
  if (value2) {
@@ -95,23 +96,25 @@ const onChange = (value2) => {
95
96
  handleChange(timeText);
96
97
  emits("change", timeText);
97
98
  };
98
- watch(value, (newValue) => {
99
- if (newValue) {
100
- const timeParts = newValue.split(":");
101
- innerValue.value = {
102
- hours: Number.parseInt(timeParts[0] || "0", 10),
103
- minutes: Number.parseInt(timeParts[1] || "0", 10),
104
- ...props.enableSeconds && timeParts[2] ? {
105
- seconds: Number.parseInt(timeParts[2], 10)
106
- } : {}
107
- };
108
- } else {
109
- innerValue.value = void 0;
99
+ watch(
100
+ value,
101
+ (newValue) => {
102
+ if (newValue) {
103
+ const timeParts = newValue.split(":");
104
+ innerValue.value = {
105
+ hours: Number.parseInt(timeParts[0] || "0", 10),
106
+ minutes: Number.parseInt(timeParts[1] || "0", 10),
107
+ ...props.enableSeconds && timeParts[2] ? {
108
+ seconds: Number.parseInt(timeParts[2], 10)
109
+ } : {}
110
+ };
111
+ } else {
112
+ innerValue.value = void 0;
113
+ }
114
+ },
115
+ {
116
+ immediate: true
110
117
  }
111
- }, {
112
- immediate: true
113
- });
114
- const {
115
- messages
116
- } = useCoreMessages();
118
+ );
119
+ const { messages } = useCoreMessages();
117
120
  </script>
@@ -5,6 +5,7 @@ declare const __VLS_export: import("vue").DefineComponent<ITimeFieldProps, {}, {
5
5
  }, string, import("vue").PublicProps, Readonly<ITimeFieldProps> & Readonly<{
6
6
  onChange?: ((...args: any[]) => any) | undefined;
7
7
  }>, {
8
+ step: number;
8
9
  clearIcon: string;
9
10
  teleport: boolean | string | HTMLElement;
10
11
  enableSeconds: boolean;
@@ -12,6 +12,8 @@ export interface ITimeFieldProps extends IFieldProps {
12
12
  format?: string;
13
13
  enableSeconds?: boolean;
14
14
  teleport?: boolean | string | HTMLElement;
15
+ /** Minute granularity (e.g. 15 restricts the minute grid/arrows to :00/:15/:30/:45). Defaults to 1. */
16
+ step?: number;
15
17
  }
16
18
  export type ITimeField = IFormFieldBase<INPUT_TYPES.TIME, ITimeFieldProps, {
17
19
  change?: (value: string) => void;