@finema/core 3.22.0 → 3.23.2
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/dist/module.d.mts +2 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +16 -2
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/DevToolsWindow/index.vue +1 -1
- package/dist/runtime/components/Dialog/index.d.vue.ts +1 -4
- package/dist/runtime/components/Dialog/index.vue +9 -10
- package/dist/runtime/components/Dialog/index.vue.d.ts +1 -4
- package/dist/runtime/components/Empty.d.vue.ts +0 -1
- package/dist/runtime/components/Empty.vue +6 -2
- package/dist/runtime/components/Empty.vue.d.ts +0 -1
- package/dist/runtime/components/FlexDeck/index.vue +86 -81
- package/dist/runtime/components/Form/FieldWrapper.vue +14 -14
- package/dist/runtime/components/Form/Fields.vue +10 -10
- package/dist/runtime/components/Form/InputCheckbox/index.vue +20 -19
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +2 -1
- package/dist/runtime/components/Form/InputComponent/index.vue +2 -1
- package/dist/runtime/components/Form/InputCurrency/index.vue +51 -50
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTime/index.vue +69 -64
- package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +62 -57
- package/dist/runtime/components/Form/InputMonth/index.vue +10 -5
- package/dist/runtime/components/Form/InputMonth/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputNumber/index.vue +22 -21
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +2 -1
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +2 -1
- package/dist/runtime/components/Form/InputSearch/index.vue +7 -2
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -111
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +120 -119
- package/dist/runtime/components/Form/InputTags/index.vue +56 -55
- package/dist/runtime/components/Form/InputText/index.vue +88 -87
- package/dist/runtime/components/Form/InputTextarea/index.vue +20 -19
- package/dist/runtime/components/Form/InputTime/index.vue +45 -40
- package/dist/runtime/components/Form/InputTime/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputToggle/index.vue +19 -18
- package/dist/runtime/components/Form/InputUploadDropzone/index.d.vue.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +40 -35
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue.d.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +2 -2
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +63 -58
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +69 -60
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadImageAuto/index.d.vue.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +63 -58
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue.d.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +18 -18
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +65 -65
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +43 -42
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +37 -33
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.d.vue.ts +4 -4
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +79 -75
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue.d.ts +4 -4
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.d.vue.ts +2 -2
- package/dist/runtime/components/Form/fileState/SuccessState.vue +8 -4
- package/dist/runtime/components/Form/fileState/SuccessState.vue.d.ts +2 -2
- package/dist/runtime/components/Form/fileState/useFilePicker.d.ts +34 -0
- package/dist/runtime/components/Form/fileState/useFilePicker.js +48 -0
- package/dist/runtime/components/Form/fileState/useFileState.d.ts +7 -9
- package/dist/runtime/components/Form/fileState/useFileState.js +40 -120
- package/dist/runtime/components/Form/fileState/useUploadImageState.d.ts +7 -8
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +28 -300
- package/dist/runtime/components/Form/fileState/useUploadState.d.ts +11 -7
- package/dist/runtime/components/Form/fileState/useUploadState.js +58 -131
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.d.ts +12 -18
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +89 -222
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Form/types.d.ts +2 -0
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -0
- package/dist/runtime/components/Loader.vue.d.ts +1 -0
- package/dist/runtime/components/Table/Base.d.vue.ts +15 -1
- package/dist/runtime/components/Table/Base.vue +118 -118
- package/dist/runtime/components/Table/Base.vue.d.ts +15 -1
- 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.d.vue.ts +2 -3
- package/dist/runtime/components/Table/ColumnText.vue +11 -11
- package/dist/runtime/components/Table/ColumnText.vue.d.ts +2 -3
- package/dist/runtime/components/Table/Pagination.vue +70 -67
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.d.vue.ts +1 -1
- package/dist/runtime/components/Table/index.vue +37 -33
- package/dist/runtime/components/Table/index.vue.d.ts +1 -1
- package/dist/runtime/composables/loaderList.d.ts +2 -1
- package/dist/runtime/composables/loaderList.js +2 -1
- package/dist/runtime/composables/loaderObject.d.ts +2 -1
- package/dist/runtime/composables/loaderObject.js +2 -1
- package/dist/runtime/composables/loaderPage.js +194 -344
- package/dist/runtime/composables/useConfig.js +4 -3
- package/dist/runtime/composables/useDialog.js +5 -1
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -1
- package/dist/runtime/composables/useMessages.d.ts +10 -0
- package/dist/runtime/composables/useMessages.js +10 -0
- package/dist/runtime/helpers/apiPageHelper.d.ts +0 -1
- package/dist/runtime/helpers/uploadCore.d.ts +54 -0
- package/dist/runtime/helpers/uploadCore.js +84 -0
- package/dist/runtime/i18n/valibot.d.ts +5 -68
- package/dist/runtime/i18n/valibot.js +33 -29
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +42 -0
- package/dist/runtime/locale/index.d.ts +7 -0
- package/dist/runtime/locale/index.js +8 -0
- package/dist/runtime/locale/th.d.ts +43 -0
- package/dist/runtime/locale/th.js +42 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/utils/ParamHelper.js +1 -1
- package/dist/runtime/utils/StringHelper.js +1 -4
- package/dist/runtime/utils/TimeHelper.js +2 -2
- package/dist/runtime/utils/lodash.js +2 -2
- package/package.json +20 -12
|
@@ -1,92 +1,92 @@
|
|
|
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)"
|
|
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
76
|
:class="[
|
|
77
77
|
theme.suggestionItem(),
|
|
78
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>
|
|
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>
|
|
90
90
|
</template>
|
|
91
91
|
|
|
92
92
|
<script setup>
|
|
@@ -124,7 +124,8 @@ const props = defineProps({
|
|
|
124
124
|
readonly: { type: Boolean, required: false },
|
|
125
125
|
required: { type: Boolean, required: false },
|
|
126
126
|
help: { type: String, required: false },
|
|
127
|
-
ui: { type: null, required: false }
|
|
127
|
+
ui: { type: null, required: false },
|
|
128
|
+
containerUi: { type: null, required: false }
|
|
128
129
|
});
|
|
129
130
|
const theme = computed(() => useUiConfig(inputTheme, "input")());
|
|
130
131
|
const {
|
|
@@ -193,7 +194,7 @@ const onKeydown = (event) => {
|
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
196
|
event.preventDefault();
|
|
196
|
-
if (selectedSuggestionIndex.value
|
|
197
|
+
if (filteredSuggestions.value[selectedSuggestionIndex.value] !== void 0) {
|
|
197
198
|
selectSuggestion(filteredSuggestions.value[selectedSuggestionIndex.value], selectedSuggestionIndex.value);
|
|
198
199
|
}
|
|
199
200
|
break;
|
|
@@ -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>
|
|
@@ -43,7 +43,8 @@ const props = defineProps({
|
|
|
43
43
|
readonly: { type: Boolean, required: false },
|
|
44
44
|
required: { type: Boolean, required: false },
|
|
45
45
|
help: { type: String, required: false },
|
|
46
|
-
ui: { type: null, required: false }
|
|
46
|
+
ui: { type: null, required: false },
|
|
47
|
+
containerUi: { type: null, required: false }
|
|
47
48
|
});
|
|
48
49
|
const {
|
|
49
50
|
value,
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
v-model="innerValue"
|
|
5
|
-
:teleport="teleport"
|
|
6
|
-
:disabled="wrapperProps.disabled"
|
|
7
|
-
:cancel-text="
|
|
8
|
-
:select-text="
|
|
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"
|
|
31
|
+
}"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
<template #clear-icon="{ clear }">
|
|
35
|
+
<Icon
|
|
36
|
+
:name="clearIcon"
|
|
37
37
|
:class="theme.clearIcon({
|
|
38
38
|
class: [ui?.clearIcon]
|
|
39
|
-
})"
|
|
40
|
-
@click.stop="clear"
|
|
41
|
-
/>
|
|
42
|
-
</template>
|
|
43
|
-
</Datepicker>
|
|
44
|
-
</FieldWrapper>
|
|
39
|
+
})"
|
|
40
|
+
@click.stop="clear"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
43
|
+
</Datepicker>
|
|
44
|
+
</FieldWrapper>
|
|
45
45
|
</template>
|
|
46
46
|
|
|
47
47
|
<script setup>
|
|
48
|
-
import
|
|
48
|
+
import { useCoreMessages } from "#core/composables/useMessages";
|
|
49
|
+
import Datepicker, {} from "@vuepic/vue-datepicker";
|
|
49
50
|
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
50
51
|
import { computed, ref, useFieldHOC, useUiConfig, watch, useAppConfig } from "#imports";
|
|
51
52
|
import "@vuepic/vue-datepicker/dist/main.css";
|
|
@@ -72,7 +73,8 @@ const props = defineProps({
|
|
|
72
73
|
readonly: { type: Boolean, required: false },
|
|
73
74
|
required: { type: Boolean, required: false },
|
|
74
75
|
help: { type: String, required: false },
|
|
75
|
-
ui: { type: null, required: false }
|
|
76
|
+
ui: { type: null, required: false },
|
|
77
|
+
containerUi: { type: null, required: false }
|
|
76
78
|
});
|
|
77
79
|
const appConfig = useAppConfig();
|
|
78
80
|
const innerValue = ref(void 0);
|
|
@@ -109,4 +111,7 @@ watch(value, (newValue) => {
|
|
|
109
111
|
}, {
|
|
110
112
|
immediate: true
|
|
111
113
|
});
|
|
114
|
+
const {
|
|
115
|
+
messages
|
|
116
|
+
} = useCoreMessages();
|
|
112
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>
|
|
@@ -38,7 +38,8 @@ const props = defineProps({
|
|
|
38
38
|
readonly: { type: Boolean, required: false },
|
|
39
39
|
required: { type: Boolean, required: false },
|
|
40
40
|
help: { type: String, required: false },
|
|
41
|
-
ui: { type: null, required: false }
|
|
41
|
+
ui: { type: null, required: false },
|
|
42
|
+
containerUi: { type: null, required: false }
|
|
42
43
|
});
|
|
43
44
|
const {
|
|
44
45
|
value,
|
|
@@ -5,9 +5,6 @@ declare const __VLS_export: import("vue").DefineComponent<IUploadDropzoneProps,
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<IUploadDropzoneProps> & Readonly<{
|
|
6
6
|
onDelete?: (() => any) | undefined;
|
|
7
7
|
onChange?: ((value: File | undefined) => any) | undefined;
|
|
8
|
-
}>, {
|
|
9
|
-
selectFileLabel: string;
|
|
10
|
-
selectFileSubLabel: string;
|
|
11
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
9
|
declare const _default: typeof __VLS_export;
|
|
13
10
|
export default _default;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<div
|
|
4
|
-
ref="dropzoneRef"
|
|
5
|
-
:class="theme.base()"
|
|
6
|
-
>
|
|
7
|
-
<div :class="theme.wrapper()">
|
|
8
|
-
<!-- Empty State -->
|
|
9
|
-
<EmptyState
|
|
10
|
-
v-if="uploadState.isEmpty.value"
|
|
11
|
-
:theme="theme"
|
|
12
|
-
:select-file-label="selectFileLabel"
|
|
13
|
-
:select-file-sub-label="selectFileSubLabel"
|
|
14
|
-
:placeholder="placeholder"
|
|
15
|
-
@open-file="uploadState.handleOpenFile"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<!-- Success State -->
|
|
19
|
-
<SuccessState
|
|
20
|
-
v-if="uploadState.isSuccess.value"
|
|
21
|
-
:theme="theme"
|
|
22
|
-
:value="value"
|
|
23
|
-
:disabled="wrapperProps.disabled"
|
|
24
|
-
:readonly="wrapperProps.readonly"
|
|
25
|
-
@preview="uploadState.handlePreview"
|
|
26
|
-
@download="handleDownloadFile"
|
|
27
|
-
@delete="uploadState.handleDeleteFile"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<div
|
|
4
|
+
ref="dropzoneRef"
|
|
5
|
+
:class="theme.base()"
|
|
6
|
+
>
|
|
7
|
+
<div :class="theme.wrapper()">
|
|
8
|
+
<!-- Empty State -->
|
|
9
|
+
<EmptyState
|
|
10
|
+
v-if="uploadState.isEmpty.value"
|
|
11
|
+
:theme="theme"
|
|
12
|
+
:select-file-label="selectFileLabel ?? messages.upload.selectFile"
|
|
13
|
+
:select-file-sub-label="selectFileSubLabel ?? messages.upload.dropHere"
|
|
14
|
+
:placeholder="placeholder"
|
|
15
|
+
@open-file="uploadState.handleOpenFile"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<!-- Success State -->
|
|
19
|
+
<SuccessState
|
|
20
|
+
v-if="uploadState.isSuccess.value"
|
|
21
|
+
:theme="theme"
|
|
22
|
+
:value="value"
|
|
23
|
+
:disabled="wrapperProps.disabled"
|
|
24
|
+
:readonly="wrapperProps.readonly"
|
|
25
|
+
@preview="uploadState.handlePreview"
|
|
26
|
+
@download="handleDownloadFile"
|
|
27
|
+
@delete="uploadState.handleDeleteFile"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</FieldWrapper>
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script setup>
|
|
@@ -40,12 +40,13 @@ import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
|
40
40
|
import { useFieldHOC } from "#core/composables/useForm";
|
|
41
41
|
import { uploadFileDropzoneTheme } from "#core/theme/uploadFileDropzone";
|
|
42
42
|
import { useUiConfig } from "#core/composables/useConfig";
|
|
43
|
+
import { useCoreMessages } from "#core/composables/useMessages";
|
|
43
44
|
const emits = defineEmits(["change", "delete"]);
|
|
44
45
|
const props = defineProps({
|
|
45
46
|
accept: { type: [Array, String], required: false },
|
|
46
47
|
maxSize: { type: Number, required: false },
|
|
47
|
-
selectFileLabel: { type: String, required: false
|
|
48
|
-
selectFileSubLabel: { type: String, required: false
|
|
48
|
+
selectFileLabel: { type: String, required: false },
|
|
49
|
+
selectFileSubLabel: { type: String, required: false },
|
|
49
50
|
form: { type: Object, required: false },
|
|
50
51
|
name: { type: String, required: true },
|
|
51
52
|
errorMessage: { type: String, required: false },
|
|
@@ -59,8 +60,12 @@ const props = defineProps({
|
|
|
59
60
|
readonly: { type: Boolean, required: false },
|
|
60
61
|
required: { type: Boolean, required: false },
|
|
61
62
|
help: { type: String, required: false },
|
|
62
|
-
ui: { type: null, required: false }
|
|
63
|
+
ui: { type: null, required: false },
|
|
64
|
+
containerUi: { type: null, required: false }
|
|
63
65
|
});
|
|
66
|
+
const {
|
|
67
|
+
messages
|
|
68
|
+
} = useCoreMessages();
|
|
64
69
|
const {
|
|
65
70
|
wrapperProps,
|
|
66
71
|
handleChange: onChange,
|
|
@@ -71,7 +76,7 @@ const acceptedFileTypes = computed(
|
|
|
71
76
|
() => typeof props.accept === "string" ? props.accept : props.accept?.join(",")
|
|
72
77
|
);
|
|
73
78
|
const dropzoneRef = useTemplateRef("dropzoneRef");
|
|
74
|
-
const uploadState = useFileState(
|
|
79
|
+
const uploadState = useFileState({
|
|
75
80
|
props,
|
|
76
81
|
emits,
|
|
77
82
|
onChange,
|
|
@@ -80,7 +85,7 @@ const uploadState = useFileState(
|
|
|
80
85
|
acceptedFileTypes,
|
|
81
86
|
wrapperProps,
|
|
82
87
|
dropzoneRef
|
|
83
|
-
);
|
|
88
|
+
});
|
|
84
89
|
useWatchChange(() => value.value, (newValue) => {
|
|
85
90
|
if (typeof newValue === "object" && newValue !== null) {
|
|
86
91
|
onChange(newValue);
|
|
@@ -5,9 +5,6 @@ declare const __VLS_export: import("vue").DefineComponent<IUploadDropzoneProps,
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<IUploadDropzoneProps> & Readonly<{
|
|
6
6
|
onDelete?: (() => any) | undefined;
|
|
7
7
|
onChange?: ((value: File | undefined) => any) | undefined;
|
|
8
|
-
}>, {
|
|
9
|
-
selectFileLabel: string;
|
|
10
|
-
selectFileSubLabel: string;
|
|
11
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
9
|
declare const _default: typeof __VLS_export;
|
|
13
10
|
export default _default;
|
|
@@ -6,6 +6,6 @@ export interface IUploadDropzoneProps extends IFieldProps {
|
|
|
6
6
|
selectFileSubLabel?: string;
|
|
7
7
|
}
|
|
8
8
|
export type IUploadDropzoneField = IFormFieldBase<INPUT_TYPES.UPLOAD_DROPZONE, IUploadDropzoneProps, {
|
|
9
|
-
change
|
|
10
|
-
delete
|
|
9
|
+
change?: (value: File | undefined) => void;
|
|
10
|
+
delete?: () => void;
|
|
11
11
|
}>;
|
|
@@ -9,11 +9,6 @@ declare const __VLS_export: import("vue").DefineComponent<IUploadDropzoneAutoPro
|
|
|
9
9
|
onDelete?: (() => any) | undefined;
|
|
10
10
|
onChange?: ((value: File | undefined) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
selectFileLabel: string;
|
|
13
|
-
selectFileSubLabel: string;
|
|
14
|
-
uploadingLabel: string;
|
|
15
|
-
uploadFailedLabel: string;
|
|
16
|
-
retryLabel: string;
|
|
17
12
|
bodyKey: string;
|
|
18
13
|
responseURL: string;
|
|
19
14
|
responsePath: string;
|