@finema/core 3.23.2 → 3.24.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.
- package/README.md +22 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.vue +11 -10
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue +16 -12
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +85 -92
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +17 -11
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
- package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
- package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
- package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +1 -5
- package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
- package/dist/runtime/components/Form/InputTags/index.vue +55 -59
- package/dist/runtime/components/Form/InputText/index.vue +122 -133
- package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
- package/dist/runtime/components/Form/InputTime/index.vue +63 -63
- package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
- package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
- package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +22 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +1 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.vue +117 -137
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +71 -77
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +36 -42
- package/dist/runtime/composables/loaderList.js +1 -3
- package/dist/runtime/composables/loaderPage.js +156 -133
- package/dist/runtime/composables/useConfig.js +1 -1
- package/dist/runtime/composables/useDialog.js +1 -3
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -3
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.js +1 -4
- package/dist/runtime/locale/index.js +1 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- 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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
|
252
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
|
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);
|
|
@@ -1,47 +1,49 @@
|
|
|
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
|
+
@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"
|
|
28
28
|
:ui="{
|
|
29
29
|
base: 'cursor-pointer select-none',
|
|
30
30
|
trailingIcon: 'cursor-pointer'
|
|
31
|
-
}"
|
|
32
|
-
/>
|
|
33
|
-
</template>
|
|
34
|
-
<template #clear-icon="{ clear }">
|
|
35
|
-
<Icon
|
|
36
|
-
:name="clearIcon"
|
|
37
|
-
:class="
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
}"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
<template #clear-icon="{ clear }">
|
|
35
|
+
<Icon
|
|
36
|
+
:name="clearIcon"
|
|
37
|
+
:class="
|
|
38
|
+
theme.clearIcon({
|
|
39
|
+
class: [ui?.clearIcon]
|
|
40
|
+
})
|
|
41
|
+
"
|
|
42
|
+
@click.stop="clear"
|
|
43
|
+
/>
|
|
44
|
+
</template>
|
|
45
|
+
</Datepicker>
|
|
46
|
+
</FieldWrapper>
|
|
45
47
|
</template>
|
|
46
48
|
|
|
47
49
|
<script setup>
|
|
@@ -79,11 +81,7 @@ const props = defineProps({
|
|
|
79
81
|
const appConfig = useAppConfig();
|
|
80
82
|
const innerValue = ref(void 0);
|
|
81
83
|
const theme = computed(() => useUiConfig(dateTimeTheme, "dateTime")());
|
|
82
|
-
const {
|
|
83
|
-
value,
|
|
84
|
-
wrapperProps,
|
|
85
|
-
handleChange
|
|
86
|
-
} = useFieldHOC(props);
|
|
84
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
87
85
|
const onChange = (value2) => {
|
|
88
86
|
let timeText = void 0;
|
|
89
87
|
if (value2) {
|
|
@@ -95,23 +93,25 @@ const onChange = (value2) => {
|
|
|
95
93
|
handleChange(timeText);
|
|
96
94
|
emits("change", timeText);
|
|
97
95
|
};
|
|
98
|
-
watch(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
watch(
|
|
97
|
+
value,
|
|
98
|
+
(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;
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
immediate: true
|
|
110
114
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
const {
|
|
115
|
-
messages
|
|
116
|
-
} = useCoreMessages();
|
|
115
|
+
);
|
|
116
|
+
const { messages } = useCoreMessages();
|
|
117
117
|
</script>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<Switch
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:ui="ui"
|
|
12
|
-
:label="label"
|
|
13
|
-
:description="description"
|
|
14
|
-
:loading="loading"
|
|
15
|
-
:loading-icon="loadingIcon"
|
|
16
|
-
@update:modelValue="onChange"
|
|
17
|
-
/>
|
|
18
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Switch
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:ui="ui"
|
|
12
|
+
:label="label"
|
|
13
|
+
:description="description"
|
|
14
|
+
:loading="loading"
|
|
15
|
+
:loading-icon="loadingIcon"
|
|
16
|
+
@update:modelValue="onChange"
|
|
17
|
+
/>
|
|
18
|
+
</FieldWrapper>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup>
|
|
@@ -41,10 +41,7 @@ const props = defineProps({
|
|
|
41
41
|
ui: { type: null, required: false },
|
|
42
42
|
containerUi: { type: null, required: false }
|
|
43
43
|
});
|
|
44
|
-
const {
|
|
45
|
-
value,
|
|
46
|
-
wrapperProps
|
|
47
|
-
} = useFieldHOC(props);
|
|
44
|
+
const { value, wrapperProps } = useFieldHOC(props);
|
|
48
45
|
const onChange = (bool) => {
|
|
49
46
|
emit("change", bool);
|
|
50
47
|
value.value = bool;
|