@finema/core 2.59.1 → 2.60.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.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.vue +13 -18
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputDateTime/index.vue +55 -63
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +66 -82
- package/dist/runtime/components/Form/InputMonth/index.vue +51 -52
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelect/index.vue +38 -46
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -62
- package/dist/runtime/components/Form/InputTags/index.d.vue.ts +0 -2
- package/dist/runtime/components/Form/InputTags/index.vue +25 -179
- package/dist/runtime/components/Form/InputTags/index.vue.d.ts +0 -2
- package/dist/runtime/components/Form/InputTags/types.d.ts +3 -5
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputTime/index.vue +38 -39
- 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/Form/types.d.ts +1 -3
- package/dist/runtime/components/Form/types.js +0 -1
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Log/index.vue +17 -17
- 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 +1 -5
- package/dist/runtime/components/Table/ColumnText.vue +1 -1
- package/dist/runtime/components/Table/ColumnText.vue.d.ts +1 -5
- package/dist/runtime/components/Table/Pagination.vue +46 -46
- package/dist/runtime/components/Table/Simple.vue +17 -17
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- package/dist/runtime/theme/selectMenu.js +2 -2
- package/dist/runtime/utils/TimeHelper.d.ts +5 -15
- package/dist/runtime/utils/TimeHelper.js +11 -34
- package/package.json +1 -1
- package/dist/runtime/components/Form/InputCheckboxGroup/index.d.vue.ts +0 -8
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +0 -60
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue.d.ts +0 -8
- package/dist/runtime/components/Form/InputCheckboxGroup/types.d.ts +0 -21
- package/dist/runtime/components/Form/InputCheckboxGroup/types.js +0 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -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>
|
|
@@ -27,7 +27,6 @@ import FormInputSearch from "./InputSearch/index.vue";
|
|
|
27
27
|
import FormInputNumber from "./InputNumber/index.vue";
|
|
28
28
|
import FormInputToggle from "./InputToggle/index.vue";
|
|
29
29
|
import FormInputCheckbox from "./InputCheckbox/index.vue";
|
|
30
|
-
import FormInputCheckboxGroup from "./InputCheckboxGroup/index.vue";
|
|
31
30
|
import FormInputSelect from "./InputSelect/index.vue";
|
|
32
31
|
import FormInputSelectMultiple from "./InputSelectMultiple/index.vue";
|
|
33
32
|
import FormInputComponent from "./InputComponent/index.vue";
|
|
@@ -71,10 +70,6 @@ const componentMap = {
|
|
|
71
70
|
component: FormInputCheckbox,
|
|
72
71
|
props: {}
|
|
73
72
|
},
|
|
74
|
-
[INPUT_TYPES.CHECKBOX_GROUP]: {
|
|
75
|
-
component: FormInputCheckboxGroup,
|
|
76
|
-
props: {}
|
|
77
|
-
},
|
|
78
73
|
[INPUT_TYPES.SELECT]: {
|
|
79
74
|
component: FormInputSelect,
|
|
80
75
|
props: {}
|
|
@@ -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,63 +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
|
-
:
|
|
17
|
-
:
|
|
18
|
-
:
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
:
|
|
39
|
-
|
|
40
|
-
:
|
|
41
|
-
:
|
|
42
|
-
:placeholder="wrapperProps.placeholder"
|
|
43
|
-
: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"
|
|
44
42
|
:ui="{
|
|
45
43
|
base: 'cursor-pointer select-none',
|
|
46
44
|
trailingIcon: 'cursor-pointer'
|
|
47
|
-
}"
|
|
48
|
-
/>
|
|
49
|
-
</template>
|
|
50
|
-
<template #clear-icon="{ clear }">
|
|
51
|
-
<Icon
|
|
52
|
-
:name="clearIcon"
|
|
45
|
+
}"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
<template #clear-icon="{ clear }">
|
|
49
|
+
<Icon
|
|
50
|
+
:name="clearIcon"
|
|
53
51
|
:class="theme.clearIcon({
|
|
54
52
|
class: [ui?.clearIcon]
|
|
55
|
-
})"
|
|
56
|
-
@click.stop="clear"
|
|
57
|
-
/>
|
|
58
|
-
</template>
|
|
59
|
-
</Datepicker>
|
|
60
|
-
</FieldWrapper>
|
|
53
|
+
})"
|
|
54
|
+
@click.stop="clear"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
</Datepicker>
|
|
58
|
+
</FieldWrapper>
|
|
61
59
|
</template>
|
|
62
60
|
|
|
63
61
|
<script setup>
|
|
@@ -121,19 +119,13 @@ onMounted(() => {
|
|
|
121
119
|
});
|
|
122
120
|
const format = (date) => {
|
|
123
121
|
if (props.disabledTime) {
|
|
124
|
-
return TimeHelper.displayDate(date
|
|
125
|
-
autoTimezone: true
|
|
126
|
-
});
|
|
122
|
+
return TimeHelper.displayDate(date);
|
|
127
123
|
}
|
|
128
|
-
return TimeHelper.displayDateTime(date
|
|
129
|
-
autoTimezone: true
|
|
130
|
-
});
|
|
124
|
+
return TimeHelper.displayDateTime(date);
|
|
131
125
|
};
|
|
132
126
|
const onInput = (_value) => {
|
|
133
127
|
if (props.disabledTime && !props.isReturnISO) {
|
|
134
|
-
value.value = TimeHelper.
|
|
135
|
-
autoTimezone: true
|
|
136
|
-
}) ?? void 0;
|
|
128
|
+
value.value = TimeHelper.getDateFormTime(_value);
|
|
137
129
|
} else {
|
|
138
130
|
value.value = _value;
|
|
139
131
|
}
|
|
@@ -1,74 +1,72 @@
|
|
|
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
|
-
:
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
: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"
|
|
46
45
|
:ui="{
|
|
47
46
|
base: 'cursor-pointer select-none',
|
|
48
47
|
trailingIcon: 'cursor-pointer'
|
|
49
|
-
}"
|
|
50
|
-
/>
|
|
51
|
-
</template>
|
|
52
|
-
<template #clear-icon="{ clear }">
|
|
53
|
-
<Icon
|
|
54
|
-
:name="clearIcon"
|
|
48
|
+
}"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
<template #clear-icon="{ clear }">
|
|
52
|
+
<Icon
|
|
53
|
+
:name="clearIcon"
|
|
55
54
|
:class="theme.clearIcon({
|
|
56
55
|
class: [ui?.clearIcon]
|
|
57
|
-
})"
|
|
58
|
-
@click.stop="clear"
|
|
59
|
-
/>
|
|
60
|
-
</template>
|
|
61
|
-
</Datepicker>
|
|
62
|
-
</FieldWrapper>
|
|
56
|
+
})"
|
|
57
|
+
@click.stop="clear"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
</Datepicker>
|
|
61
|
+
</FieldWrapper>
|
|
63
62
|
</template>
|
|
64
63
|
|
|
65
64
|
<script setup>
|
|
66
65
|
import Datepicker from "@vuepic/vue-datepicker";
|
|
67
66
|
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
68
|
-
import { ref, useFieldHOC, useAppConfig, computed, useUiConfig, watch, onMounted
|
|
67
|
+
import { TimeHelper, ref, useFieldHOC, useAppConfig, computed, useUiConfig, watch, onMounted } from "#imports";
|
|
69
68
|
import "@vuepic/vue-datepicker/dist/main.css";
|
|
70
69
|
import { dateTimeTheme } from "#core/theme/dateTime";
|
|
71
|
-
import { toZonedTime } from "date-fns-tz";
|
|
72
70
|
const emits = defineEmits(["change"]);
|
|
73
71
|
const props = defineProps({
|
|
74
72
|
isDisabledMultiCalendar: { type: Boolean, required: false },
|
|
@@ -105,18 +103,18 @@ const {
|
|
|
105
103
|
const innerValueRef = ref([]);
|
|
106
104
|
const initializeValue = () => {
|
|
107
105
|
const currentValue = value.value;
|
|
108
|
-
if (currentValue
|
|
109
|
-
const start =
|
|
110
|
-
const end =
|
|
106
|
+
if (currentValue) {
|
|
107
|
+
const start = typeof currentValue.start === "string" ? new Date(currentValue.start) : currentValue.start;
|
|
108
|
+
const end = typeof currentValue.end === "string" ? new Date(currentValue.end) : currentValue.end;
|
|
111
109
|
innerValueRef.value = [start, end];
|
|
112
110
|
} else {
|
|
113
111
|
innerValueRef.value = [];
|
|
114
112
|
}
|
|
115
113
|
};
|
|
116
114
|
watch(value, (newValue) => {
|
|
117
|
-
if (newValue && newValue.start) {
|
|
118
|
-
const start =
|
|
119
|
-
const end =
|
|
115
|
+
if (newValue && (newValue.start || newValue.end)) {
|
|
116
|
+
const start = typeof newValue.start === "string" ? new Date(newValue.start) : newValue.start;
|
|
117
|
+
const end = typeof newValue.end === "string" ? new Date(newValue.end) : newValue.end;
|
|
120
118
|
innerValueRef.value = [start, end];
|
|
121
119
|
} else if (!newValue) {
|
|
122
120
|
innerValueRef.value = [];
|
|
@@ -129,25 +127,11 @@ onMounted(() => {
|
|
|
129
127
|
});
|
|
130
128
|
const format = (date) => {
|
|
131
129
|
if (props.disabledTime) {
|
|
132
|
-
return date.length > 0
|
|
133
|
-
autoTimezone: true
|
|
134
|
-
}) + " - " + TimeHelper.displayDate(date[1] || date[0], {
|
|
135
|
-
autoTimezone: true
|
|
136
|
-
}) : "";
|
|
130
|
+
return date.length > 0 ? TimeHelper.displayDate(date[0]) + " - " + TimeHelper.displayDate(date[1] ?? date[0]) : "";
|
|
137
131
|
}
|
|
138
|
-
return date.length > 0
|
|
139
|
-
autoTimezone: true
|
|
140
|
-
}) + " - " + TimeHelper.displayDateTime(date[1] || date[0], {
|
|
141
|
-
autoTimezone: true
|
|
142
|
-
}) : "";
|
|
132
|
+
return date.length > 0 ? TimeHelper.displayDateTime(date[0]) + " - " + TimeHelper.displayDateTime(date[1] ?? date[0]) : "";
|
|
143
133
|
};
|
|
144
134
|
const onInput = (_value) => {
|
|
145
|
-
const formattedDates = _value.map((d) => {
|
|
146
|
-
const year = d.getFullYear();
|
|
147
|
-
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
148
|
-
const day = String(d.getDate()).padStart(2, "0");
|
|
149
|
-
return `${year}-${month}-${day}`;
|
|
150
|
-
});
|
|
151
135
|
if (_value === null || _value === void 0) {
|
|
152
136
|
value.value = void 0;
|
|
153
137
|
emits("change", void 0);
|
|
@@ -155,8 +139,8 @@ const onInput = (_value) => {
|
|
|
155
139
|
}
|
|
156
140
|
if (props.disabledTime && !props.isReturnISO) {
|
|
157
141
|
value.value = {
|
|
158
|
-
start:
|
|
159
|
-
end:
|
|
142
|
+
start: TimeHelper.getDateFormTime(_value[0]),
|
|
143
|
+
end: TimeHelper.getDateFormTime(_value[1] || _value[0])
|
|
160
144
|
};
|
|
161
145
|
} else {
|
|
162
146
|
value.value = {
|
|
@@ -1,61 +1,60 @@
|
|
|
1
1
|
<template>
|
|
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
|
-
:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:readonly="true"
|
|
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"
|
|
41
40
|
:ui="{
|
|
42
41
|
base: 'cursor-pointer select-none',
|
|
43
42
|
trailingIcon: 'cursor-pointer'
|
|
44
|
-
}"
|
|
45
|
-
/>
|
|
46
|
-
</template>
|
|
47
|
-
<template #clear-icon="{ clear }">
|
|
48
|
-
<Icon
|
|
49
|
-
v-if="value && !wrapperProps.disabled && !wrapperProps.required"
|
|
50
|
-
:name="clearIcon"
|
|
43
|
+
}"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
46
|
+
<template #clear-icon="{ clear }">
|
|
47
|
+
<Icon
|
|
48
|
+
v-if="value && !wrapperProps.disabled && !wrapperProps.required"
|
|
49
|
+
:name="clearIcon"
|
|
51
50
|
:class="theme.clearIcon({
|
|
52
51
|
class: [ui?.clearIcon]
|
|
53
|
-
})"
|
|
54
|
-
@click.stop="clear"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
</Datepicker>
|
|
58
|
-
</FieldWrapper>
|
|
52
|
+
})"
|
|
53
|
+
@click.stop="clear"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
</Datepicker>
|
|
57
|
+
</FieldWrapper>
|
|
59
58
|
</template>
|
|
60
59
|
|
|
61
60
|
<script setup>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<InputNumber
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:disabled="wrapperProps.disabled"
|
|
6
|
-
:name="name"
|
|
7
|
-
:placeholder="wrapperProps.placeholder"
|
|
8
|
-
:autofocus="!!autoFocus"
|
|
9
|
-
:readonly="readonly"
|
|
10
|
-
:orientation="orientation"
|
|
11
|
-
:increment-disabled="incrementDisabled"
|
|
12
|
-
:decrement-disabled="decrementDisabled"
|
|
13
|
-
:min="min"
|
|
14
|
-
:max="max"
|
|
15
|
-
:step="step"
|
|
16
|
-
:disable-wheel-change="disableWheelChange"
|
|
17
|
-
:format-options="formatOptions"
|
|
18
|
-
:ui="ui"
|
|
19
|
-
@update:model-value="onChange"
|
|
20
|
-
/>
|
|
21
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<InputNumber
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:name="name"
|
|
7
|
+
:placeholder="wrapperProps.placeholder"
|
|
8
|
+
:autofocus="!!autoFocus"
|
|
9
|
+
:readonly="readonly"
|
|
10
|
+
:orientation="orientation"
|
|
11
|
+
:increment-disabled="incrementDisabled"
|
|
12
|
+
:decrement-disabled="decrementDisabled"
|
|
13
|
+
:min="min"
|
|
14
|
+
:max="max"
|
|
15
|
+
:step="step"
|
|
16
|
+
:disable-wheel-change="disableWheelChange"
|
|
17
|
+
:format-options="formatOptions"
|
|
18
|
+
:ui="ui"
|
|
19
|
+
@update:model-value="onChange"
|
|
20
|
+
/>
|
|
21
|
+
</FieldWrapper>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup>
|