@finema/core 2.40.4 → 2.41.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/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/Dialog/index.vue +0 -3
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.vue +13 -13
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputComponent/index.vue +1 -1
- package/dist/runtime/components/Form/InputDateTime/index.vue +54 -52
- package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +5 -1
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +58 -55
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue.d.ts +5 -1
- package/dist/runtime/components/Form/InputMonth/index.vue +56 -50
- package/dist/runtime/components/Form/InputMonth/index.vue.d.ts +5 -1
- package/dist/runtime/components/Form/InputMonth/types.d.ts +4 -1
- package/dist/runtime/components/Form/InputNumber/index.vue +27 -27
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
- package/dist/runtime/components/Form/InputTags/index.vue +23 -23
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputTime/index.vue +38 -38
- package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +50 -50
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Log/index.vue +17 -17
- package/dist/runtime/components/Table/Base.vue +67 -67
- 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 +1 -1
- package/dist/runtime/components/Table/Simple.vue +20 -20
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import { useHead } from "#imports";
|
|
|
18
18
|
import { useCoreConfig } from "#core/composables/useConfig";
|
|
19
19
|
import DevToolsWindow from "#core/components/DevToolsWindow/index.vue";
|
|
20
20
|
defineProps({
|
|
21
|
-
toaster: { type: null, required: false }
|
|
21
|
+
toaster: { type: [Object, null], required: false }
|
|
22
22
|
});
|
|
23
23
|
const coreConfig = useCoreConfig();
|
|
24
24
|
useHead({
|
|
@@ -85,9 +85,6 @@ const getIcon = computed(() => {
|
|
|
85
85
|
if (propsSafe.value.icon) {
|
|
86
86
|
return propsSafe.value.icon;
|
|
87
87
|
}
|
|
88
|
-
if (propsSafe.value.isConfirm) {
|
|
89
|
-
return icons.iconConfirm;
|
|
90
|
-
}
|
|
91
88
|
switch (propsSafe.value.type) {
|
|
92
89
|
case DialogType.SUCCESS:
|
|
93
90
|
return icons.iconSuccess;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FormField
|
|
3
|
-
:label="label"
|
|
4
|
-
:name="name"
|
|
5
|
-
:description="description"
|
|
6
|
-
:hint="hint"
|
|
7
|
-
:data-testid="name"
|
|
8
|
-
:help="help"
|
|
9
|
-
:error="errorMessage"
|
|
10
|
-
:required="!!required"
|
|
11
|
-
:ui="containerUi"
|
|
12
|
-
>
|
|
13
|
-
<slot />
|
|
14
|
-
</FormField>
|
|
2
|
+
<FormField
|
|
3
|
+
:label="label"
|
|
4
|
+
:name="name"
|
|
5
|
+
:description="description"
|
|
6
|
+
:hint="hint"
|
|
7
|
+
:data-testid="name"
|
|
8
|
+
:help="help"
|
|
9
|
+
:error="errorMessage"
|
|
10
|
+
:required="!!required"
|
|
11
|
+
:ui="containerUi"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</FormField>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="[theme.base({
|
|
4
4
|
class: [$props.class, ui?.base]
|
|
5
|
-
})]"
|
|
6
|
-
>
|
|
7
|
-
<component
|
|
8
|
-
:is="componentMap[option.type]?.component"
|
|
9
|
-
v-for="option in options.filter((item) => !item.isHide)"
|
|
10
|
-
:key="option.props.name"
|
|
11
|
-
:class="option.class"
|
|
12
|
-
:form="form"
|
|
5
|
+
})]"
|
|
6
|
+
>
|
|
7
|
+
<component
|
|
8
|
+
:is="componentMap[option.type]?.component"
|
|
9
|
+
v-for="option in options.filter((item) => !item.isHide)"
|
|
10
|
+
:key="option.props.name"
|
|
11
|
+
:class="option.class"
|
|
12
|
+
:form="form"
|
|
13
13
|
v-bind="{
|
|
14
14
|
...getFieldBinding(option),
|
|
15
15
|
...componentMap[option.type]?.props
|
|
16
|
-
}"
|
|
17
|
-
v-on="option.on ?? {}"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
16
|
+
}"
|
|
17
|
+
v-on="option.on ?? {}"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<Checkbox
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:label="label"
|
|
12
|
-
:description="description"
|
|
13
|
-
:required="required"
|
|
14
|
-
:variant="variant"
|
|
15
|
-
:indicator="indicator"
|
|
16
|
-
:ui="ui"
|
|
17
|
-
@update:modelValue="onChange"
|
|
18
|
-
/>
|
|
19
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Checkbox
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:label="label"
|
|
12
|
+
:description="description"
|
|
13
|
+
:required="required"
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:indicator="indicator"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
@update:modelValue="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</FieldWrapper>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
:model-value="innerValue"
|
|
5
|
-
:disabled="wrapperProps.disabled"
|
|
6
|
-
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
7
|
-
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
8
|
-
:locale="appConfig.core?.locale"
|
|
9
|
-
:enable-time-picker="!disabledTime"
|
|
10
|
-
:placeholder="wrapperProps.placeholder"
|
|
11
|
-
:format="format"
|
|
12
|
-
:min-date="minDate"
|
|
13
|
-
:max-date="maxDate"
|
|
14
|
-
:min-time="minTime"
|
|
15
|
-
:max-time="maxTime"
|
|
16
|
-
:start-time="startTime"
|
|
17
|
-
:teleport="teleport"
|
|
18
|
-
:required="required"
|
|
19
|
-
:flow="['calendar', 'time']"
|
|
20
|
-
@update:model-value="onInput"
|
|
21
|
-
>
|
|
22
|
-
<template
|
|
23
|
-
v-if="appConfig.core?.is_thai_year"
|
|
24
|
-
#year="{ value }"
|
|
25
|
-
>
|
|
26
|
-
{{ value + 543 }}
|
|
27
|
-
</template>
|
|
28
|
-
<template
|
|
29
|
-
v-if="appConfig.core?.is_thai_year"
|
|
30
|
-
#year-overlay-value="{ value }"
|
|
31
|
-
>
|
|
32
|
-
{{ value + 543 }}
|
|
33
|
-
</template>
|
|
34
|
-
<template #dp-input="{ value: innerValue }">
|
|
35
|
-
<Input
|
|
36
|
-
:trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
|
|
37
|
-
type="text"
|
|
38
|
-
:disabled="wrapperProps.disabled"
|
|
39
|
-
:model-value="innerValue"
|
|
40
|
-
:placeholder="wrapperProps.placeholder"
|
|
41
|
-
:readonly="true"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
:model-value="innerValue"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
7
|
+
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
8
|
+
:locale="appConfig.core?.locale"
|
|
9
|
+
:enable-time-picker="!disabledTime"
|
|
10
|
+
:placeholder="wrapperProps.placeholder"
|
|
11
|
+
:format="format"
|
|
12
|
+
:min-date="minDate"
|
|
13
|
+
:max-date="maxDate"
|
|
14
|
+
:min-time="minTime"
|
|
15
|
+
:max-time="maxTime"
|
|
16
|
+
:start-time="startTime"
|
|
17
|
+
:teleport="teleport"
|
|
18
|
+
:required="required"
|
|
19
|
+
:flow="['calendar', 'time']"
|
|
20
|
+
@update:model-value="onInput"
|
|
21
|
+
>
|
|
22
|
+
<template
|
|
23
|
+
v-if="appConfig.core?.is_thai_year"
|
|
24
|
+
#year="{ value }"
|
|
25
|
+
>
|
|
26
|
+
{{ value + 543 }}
|
|
27
|
+
</template>
|
|
28
|
+
<template
|
|
29
|
+
v-if="appConfig.core?.is_thai_year"
|
|
30
|
+
#year-overlay-value="{ value }"
|
|
31
|
+
>
|
|
32
|
+
{{ value + 543 }}
|
|
33
|
+
</template>
|
|
34
|
+
<template #dp-input="{ value: innerValue }">
|
|
35
|
+
<Input
|
|
36
|
+
:trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
|
|
37
|
+
type="text"
|
|
38
|
+
:disabled="wrapperProps.disabled"
|
|
39
|
+
:model-value="innerValue"
|
|
40
|
+
:placeholder="wrapperProps.placeholder"
|
|
41
|
+
:readonly="true"
|
|
42
42
|
:ui="{
|
|
43
43
|
base: 'cursor-pointer select-none',
|
|
44
44
|
trailingIcon: 'cursor-pointer'
|
|
45
|
-
}"
|
|
46
|
-
/>
|
|
47
|
-
</template>
|
|
48
|
-
<template #clear-icon="{ clear }">
|
|
49
|
-
<Icon
|
|
50
|
-
:name="clearIcon"
|
|
45
|
+
}"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
<template #clear-icon="{ clear }">
|
|
49
|
+
<Icon
|
|
50
|
+
:name="clearIcon"
|
|
51
51
|
:class="theme.clearIcon({
|
|
52
52
|
class: [ui?.clearIcon]
|
|
53
|
-
})"
|
|
54
|
-
@click.stop="clear"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</Datepicker>
|
|
58
|
-
</FieldWrapper>
|
|
53
|
+
})"
|
|
54
|
+
@click.stop="clear"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
</Datepicker>
|
|
58
|
+
</FieldWrapper>
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<script setup>
|
|
@@ -64,6 +64,7 @@ import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
|
64
64
|
import { computed, TimeHelper, useAppConfig, useFieldHOC, useUiConfig, ref, watch, onMounted } from "#imports";
|
|
65
65
|
import "@vuepic/vue-datepicker/dist/main.css";
|
|
66
66
|
import { dateTimeTheme } from "#core/theme/dateTime";
|
|
67
|
+
const emits = defineEmits(["change"]);
|
|
67
68
|
const props = defineProps({
|
|
68
69
|
clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
|
|
69
70
|
disabledTime: { type: Boolean, required: false },
|
|
@@ -128,5 +129,6 @@ const onInput = (_value) => {
|
|
|
128
129
|
} else {
|
|
129
130
|
value.value = _value;
|
|
130
131
|
}
|
|
132
|
+
emits("change", value.value);
|
|
131
133
|
};
|
|
132
134
|
</script>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
2
2
|
import type { IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<IDateTimeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
declare const _default: import("vue").DefineComponent<IDateTimeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
change: (...args: any[]) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<IDateTimeFieldProps> & Readonly<{
|
|
6
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
}>, {
|
|
4
8
|
clearIcon: string;
|
|
5
9
|
teleport: boolean | string | HTMLElement;
|
|
6
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
ref="datepicker"
|
|
5
|
-
v-model="innerValueRef"
|
|
6
|
-
:teleport="teleport"
|
|
7
|
-
:disabled="wrapperProps.disabled"
|
|
8
|
-
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
9
|
-
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
10
|
-
:locale="appConfig.core?.locale"
|
|
11
|
-
:format="format"
|
|
12
|
-
:enable-time-picker="!disabledTime"
|
|
13
|
-
:placeholder="wrapperProps.placeholder"
|
|
14
|
-
:min-date="minDate"
|
|
15
|
-
:max-date="maxDate"
|
|
16
|
-
:min-time="minTime"
|
|
17
|
-
:max-time="maxTime"
|
|
18
|
-
:start-time="startTime"
|
|
19
|
-
:multi-calendars="!isDisabledMultiCalendar"
|
|
20
|
-
:required="required"
|
|
21
|
-
time-picker-inline
|
|
22
|
-
range
|
|
23
|
-
:flow="['calendar', 'time']"
|
|
24
|
-
@update:model-value="onInput"
|
|
25
|
-
>
|
|
26
|
-
<template
|
|
27
|
-
v-if="appConfig.core?.is_thai_year"
|
|
28
|
-
#year="{ value }"
|
|
29
|
-
>
|
|
30
|
-
{{ value + 543 }}
|
|
31
|
-
</template>
|
|
32
|
-
<template
|
|
33
|
-
v-if="appConfig.core?.is_thai_year"
|
|
34
|
-
#year-overlay-value="{ value }"
|
|
35
|
-
>
|
|
36
|
-
{{ value + 543 }}
|
|
37
|
-
</template>
|
|
38
|
-
<template #dp-input="{ value: innerValue }">
|
|
39
|
-
<Input
|
|
40
|
-
:trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
|
|
41
|
-
type="text"
|
|
42
|
-
:model-value="innerValue"
|
|
43
|
-
:placeholder="wrapperProps.placeholder"
|
|
44
|
-
:readonly="true"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
ref="datepicker"
|
|
5
|
+
v-model="innerValueRef"
|
|
6
|
+
:teleport="teleport"
|
|
7
|
+
:disabled="wrapperProps.disabled"
|
|
8
|
+
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
9
|
+
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
10
|
+
:locale="appConfig.core?.locale"
|
|
11
|
+
:format="format"
|
|
12
|
+
:enable-time-picker="!disabledTime"
|
|
13
|
+
:placeholder="wrapperProps.placeholder"
|
|
14
|
+
:min-date="minDate"
|
|
15
|
+
:max-date="maxDate"
|
|
16
|
+
:min-time="minTime"
|
|
17
|
+
:max-time="maxTime"
|
|
18
|
+
:start-time="startTime"
|
|
19
|
+
:multi-calendars="!isDisabledMultiCalendar"
|
|
20
|
+
:required="required"
|
|
21
|
+
time-picker-inline
|
|
22
|
+
range
|
|
23
|
+
:flow="['calendar', 'time']"
|
|
24
|
+
@update:model-value="onInput"
|
|
25
|
+
>
|
|
26
|
+
<template
|
|
27
|
+
v-if="appConfig.core?.is_thai_year"
|
|
28
|
+
#year="{ value }"
|
|
29
|
+
>
|
|
30
|
+
{{ value + 543 }}
|
|
31
|
+
</template>
|
|
32
|
+
<template
|
|
33
|
+
v-if="appConfig.core?.is_thai_year"
|
|
34
|
+
#year-overlay-value="{ value }"
|
|
35
|
+
>
|
|
36
|
+
{{ value + 543 }}
|
|
37
|
+
</template>
|
|
38
|
+
<template #dp-input="{ value: innerValue }">
|
|
39
|
+
<Input
|
|
40
|
+
:trailing-icon="innerValue ? void 0 : 'i-heroicons-calendar-days'"
|
|
41
|
+
type="text"
|
|
42
|
+
:model-value="innerValue"
|
|
43
|
+
:placeholder="wrapperProps.placeholder"
|
|
44
|
+
:readonly="true"
|
|
45
45
|
:ui="{
|
|
46
46
|
base: 'cursor-pointer select-none',
|
|
47
47
|
trailingIcon: 'cursor-pointer'
|
|
48
|
-
}"
|
|
49
|
-
/>
|
|
50
|
-
</template>
|
|
51
|
-
<template #clear-icon="{ clear }">
|
|
52
|
-
<Icon
|
|
53
|
-
:name="clearIcon"
|
|
48
|
+
}"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
<template #clear-icon="{ clear }">
|
|
52
|
+
<Icon
|
|
53
|
+
:name="clearIcon"
|
|
54
54
|
:class="theme.clearIcon({
|
|
55
55
|
class: [ui?.clearIcon]
|
|
56
|
-
})"
|
|
57
|
-
@click.stop="clear"
|
|
58
|
-
/>
|
|
59
|
-
</template>
|
|
60
|
-
</Datepicker>
|
|
61
|
-
</FieldWrapper>
|
|
56
|
+
})"
|
|
57
|
+
@click.stop="clear"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
</Datepicker>
|
|
61
|
+
</FieldWrapper>
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
64
|
<script setup>
|
|
@@ -67,6 +67,7 @@ import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
|
67
67
|
import { TimeHelper, ref, useFieldHOC, useAppConfig, computed, useUiConfig, watch, onMounted } from "#imports";
|
|
68
68
|
import "@vuepic/vue-datepicker/dist/main.css";
|
|
69
69
|
import { dateTimeTheme } from "#core/theme/dateTime";
|
|
70
|
+
const emits = defineEmits(["change"]);
|
|
70
71
|
const props = defineProps({
|
|
71
72
|
isDisabledMultiCalendar: { type: Boolean, required: false },
|
|
72
73
|
teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
|
|
@@ -133,6 +134,7 @@ const format = (date) => {
|
|
|
133
134
|
const onInput = (_value) => {
|
|
134
135
|
if (_value === null || _value === void 0) {
|
|
135
136
|
value.value = void 0;
|
|
137
|
+
emits("change", void 0);
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
138
140
|
if (props.disabledTime && !props.isReturnISO) {
|
|
@@ -146,5 +148,6 @@ const onInput = (_value) => {
|
|
|
146
148
|
end: _value[1] || _value[0]
|
|
147
149
|
};
|
|
148
150
|
}
|
|
151
|
+
emits("change", value.value);
|
|
149
152
|
};
|
|
150
153
|
</script>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
2
2
|
import type { IDateTimeRangeFieldProps } from './date_range_time_field.types.js';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<IDateTimeRangeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
declare const _default: import("vue").DefineComponent<IDateTimeRangeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
change: (...args: any[]) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<IDateTimeRangeFieldProps> & Readonly<{
|
|
6
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
}>, {
|
|
4
8
|
clearIcon: string;
|
|
5
9
|
teleport: boolean | string | HTMLElement;
|
|
6
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
|
|
5
|
-
:teleport="teleport"
|
|
6
|
-
:disabled="wrapperProps.disabled"
|
|
7
|
-
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
8
|
-
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
9
|
-
:locale="appConfig.core?.locale"
|
|
10
|
-
:format="appConfig.core?.month_format"
|
|
11
|
-
month-picker
|
|
12
|
-
:placeholder="wrapperProps.placeholder"
|
|
13
|
-
:min-date="minDate"
|
|
14
|
-
:max-date="maxDate"
|
|
15
|
-
:required="wrapperProps.required"
|
|
16
|
-
:clearable="true"
|
|
17
|
-
:always-clearable="true"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
:
|
|
38
|
-
:
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:teleport="teleport"
|
|
6
|
+
:disabled="wrapperProps.disabled"
|
|
7
|
+
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
8
|
+
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
9
|
+
:locale="appConfig.core?.locale"
|
|
10
|
+
:format="appConfig.core?.month_format"
|
|
11
|
+
month-picker
|
|
12
|
+
:placeholder="wrapperProps.placeholder"
|
|
13
|
+
:min-date="minDate"
|
|
14
|
+
:max-date="maxDate"
|
|
15
|
+
:required="wrapperProps.required"
|
|
16
|
+
:clearable="true"
|
|
17
|
+
:always-clearable="true"
|
|
18
|
+
@update:model-value="onInput"
|
|
19
|
+
>
|
|
20
|
+
<template
|
|
21
|
+
v-if="appConfig.core?.is_thai_year"
|
|
22
|
+
#year="{ year }"
|
|
23
|
+
>
|
|
24
|
+
{{ year + 543 }}
|
|
25
|
+
</template>
|
|
26
|
+
<template
|
|
27
|
+
v-if="appConfig.core?.is_thai_year"
|
|
28
|
+
#year-overlay-value="{ value }"
|
|
29
|
+
>
|
|
30
|
+
{{ value + 543 }}
|
|
31
|
+
</template>
|
|
32
|
+
<template #dp-input>
|
|
33
|
+
<Input
|
|
34
|
+
:trailing-icon="!wrapperProps.required && value ? void 0 : 'i-heroicons-calendar-days'"
|
|
35
|
+
type="text"
|
|
36
|
+
:disabled="wrapperProps.disabled"
|
|
37
|
+
:model-value="formatDisplay(value)"
|
|
38
|
+
:placeholder="wrapperProps.placeholder"
|
|
39
|
+
:readonly="true"
|
|
39
40
|
:ui="{
|
|
40
41
|
base: 'cursor-pointer select-none',
|
|
41
42
|
trailingIcon: 'cursor-pointer'
|
|
42
|
-
}"
|
|
43
|
-
/>
|
|
44
|
-
</template>
|
|
45
|
-
<template #clear-icon="{ clear }">
|
|
46
|
-
<Icon
|
|
47
|
-
v-if="value && !wrapperProps.disabled && !wrapperProps.required"
|
|
48
|
-
:name="clearIcon"
|
|
43
|
+
}"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
46
|
+
<template #clear-icon="{ clear }">
|
|
47
|
+
<Icon
|
|
48
|
+
v-if="value && !wrapperProps.disabled && !wrapperProps.required"
|
|
49
|
+
:name="clearIcon"
|
|
49
50
|
:class="theme.clearIcon({
|
|
50
51
|
class: [ui?.clearIcon]
|
|
51
|
-
})"
|
|
52
|
-
@click.stop="clear"
|
|
53
|
-
/>
|
|
54
|
-
</template>
|
|
55
|
-
</Datepicker>
|
|
56
|
-
</FieldWrapper>
|
|
52
|
+
})"
|
|
53
|
+
@click.stop="clear"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
</Datepicker>
|
|
57
|
+
</FieldWrapper>
|
|
57
58
|
</template>
|
|
58
59
|
|
|
59
60
|
<script setup>
|
|
@@ -65,6 +66,7 @@ import { dateTimeTheme } from "#core/theme/dateTime";
|
|
|
65
66
|
import { format } from "date-fns-tz";
|
|
66
67
|
import * as locales from "date-fns/locale";
|
|
67
68
|
import { addYears } from "date-fns";
|
|
69
|
+
const emits = defineEmits(["change"]);
|
|
68
70
|
const props = defineProps({
|
|
69
71
|
clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
|
|
70
72
|
minDate: { type: [Date, String], required: false },
|
|
@@ -103,4 +105,8 @@ const formatDisplay = (date) => {
|
|
|
103
105
|
}
|
|
104
106
|
return format(newDateStr, appConfig.core?.month_format, options);
|
|
105
107
|
};
|
|
108
|
+
const onInput = (date) => {
|
|
109
|
+
value.value = date;
|
|
110
|
+
emits("change", value.value);
|
|
111
|
+
};
|
|
106
112
|
</script>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
2
2
|
import type { IMonthFieldProps } from '#core/components/Form/InputMonth/types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<IMonthFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
declare const _default: import("vue").DefineComponent<IMonthFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
change: (...args: any[]) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<IMonthFieldProps> & Readonly<{
|
|
6
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
}>, {
|
|
4
8
|
clearIcon: string;
|
|
5
9
|
teleport: boolean | string | HTMLElement;
|
|
6
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,5 +6,8 @@ export interface IMonthFieldProps extends IFieldProps {
|
|
|
6
6
|
teleport?: boolean | string | HTMLElement;
|
|
7
7
|
}
|
|
8
8
|
export type IMonthField = IFormFieldBase<INPUT_TYPES.MONTH, IMonthFieldProps, {
|
|
9
|
-
change: (value:
|
|
9
|
+
change: (value: {
|
|
10
|
+
year: number;
|
|
11
|
+
month: number;
|
|
12
|
+
} | undefined) => void;
|
|
10
13
|
}>;
|