@finema/core 2.36.0 → 2.37.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/Form/InputDateTime/date_time_field.types.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +53 -52
- package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +56 -55
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputMonth/index.vue +51 -50
- package/dist/runtime/components/Form/InputMonth/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputMonth/types.d.ts +1 -0
- package/dist/runtime/components/Form/InputTime/index.vue +7 -4
- package/dist/runtime/components/Form/InputTime/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputTime/types.d.ts +1 -0
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +51 -50
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +1 -0
- package/dist/runtime/components/Form/fileState/useUploadState.js +2 -1
- package/dist/runtime/components/Form/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -13,6 +13,7 @@ export interface IDateTimeFieldProps extends IFieldProps {
|
|
|
13
13
|
minTime?: ITimeOption;
|
|
14
14
|
maxTime?: ITimeOption;
|
|
15
15
|
isReturnISO?: boolean;
|
|
16
|
+
teleport?: boolean | string | HTMLElement;
|
|
16
17
|
}
|
|
17
18
|
export type IDateTimeField = IFormFieldBase<INPUT_TYPES.DATE_TIME | INPUT_TYPES.DATE, IDateTimeFieldProps, {
|
|
18
19
|
change: (value: string) => void;
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
:
|
|
5
|
-
:
|
|
6
|
-
:
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
14
|
-
:
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
:
|
|
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>
|
|
@@ -73,6 +73,7 @@ const props = defineProps({
|
|
|
73
73
|
minTime: { type: Object, required: false },
|
|
74
74
|
maxTime: { type: Object, required: false },
|
|
75
75
|
isReturnISO: { type: Boolean, required: false },
|
|
76
|
+
teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
|
|
76
77
|
form: { type: Object, required: false },
|
|
77
78
|
name: { type: String, required: true },
|
|
78
79
|
errorMessage: { type: String, required: false },
|
|
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
|
|
|
2
2
|
import type { IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<IDateTimeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IDateTimeFieldProps> & Readonly<{}>, {
|
|
4
4
|
clearIcon: string;
|
|
5
|
+
teleport: boolean | string | HTMLElement;
|
|
5
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
7
|
export default _default;
|
|
@@ -11,6 +11,7 @@ export interface IDateTimeRangeResponse {
|
|
|
11
11
|
}
|
|
12
12
|
export interface IDateTimeRangeFieldProps extends IDateTimeFieldProps {
|
|
13
13
|
isDisabledMultiCalendar?: boolean;
|
|
14
|
+
teleport?: boolean | string | HTMLElement;
|
|
14
15
|
}
|
|
15
16
|
export type IDateTimeRangeField = IFormFieldBase<INPUT_TYPES.DATE_RANGE | INPUT_TYPES.DATE_TIME_RANGE, IDateTimeRangeFieldProps, {
|
|
16
17
|
change: (value: IDateTimeRangeResponse) => void;
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
ref="datepicker"
|
|
5
|
-
v-model="innerValueRef"
|
|
6
|
-
: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>
|
|
@@ -69,6 +69,7 @@ import "@vuepic/vue-datepicker/dist/main.css";
|
|
|
69
69
|
import { dateTimeTheme } from "#core/theme/dateTime";
|
|
70
70
|
const props = defineProps({
|
|
71
71
|
isDisabledMultiCalendar: { type: Boolean, required: false },
|
|
72
|
+
teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
|
|
72
73
|
clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
|
|
73
74
|
disabledTime: { type: Boolean, required: false },
|
|
74
75
|
minDate: { type: [Date, String], required: false },
|
|
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
|
|
|
2
2
|
import type { IDateTimeRangeFieldProps } from './date_range_time_field.types.js';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<IDateTimeRangeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IDateTimeRangeFieldProps> & Readonly<{}>, {
|
|
4
4
|
clearIcon: string;
|
|
5
|
+
teleport: boolean | string | HTMLElement;
|
|
5
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
7
|
export default _default;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
v-model="value"
|
|
5
|
-
: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
|
-
<template
|
|
20
|
-
v-if="appConfig.core?.is_thai_year"
|
|
21
|
-
#year="{ year }"
|
|
22
|
-
>
|
|
23
|
-
{{ year + 543 }}
|
|
24
|
-
</template>
|
|
25
|
-
<template
|
|
26
|
-
v-if="appConfig.core?.is_thai_year"
|
|
27
|
-
#year-overlay-value="{ value }"
|
|
28
|
-
>
|
|
29
|
-
{{ value + 543 }}
|
|
30
|
-
</template>
|
|
31
|
-
<template #dp-input>
|
|
32
|
-
<Input
|
|
33
|
-
:trailing-icon="!wrapperProps.required && value ? void 0 : 'i-heroicons-calendar-days'"
|
|
34
|
-
type="text"
|
|
35
|
-
:disabled="wrapperProps.disabled"
|
|
36
|
-
:model-value="formatDisplay(value)"
|
|
37
|
-
:placeholder="wrapperProps.placeholder"
|
|
38
|
-
:readonly="true"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
v-model="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
|
+
<template
|
|
20
|
+
v-if="appConfig.core?.is_thai_year"
|
|
21
|
+
#year="{ year }"
|
|
22
|
+
>
|
|
23
|
+
{{ year + 543 }}
|
|
24
|
+
</template>
|
|
25
|
+
<template
|
|
26
|
+
v-if="appConfig.core?.is_thai_year"
|
|
27
|
+
#year-overlay-value="{ value }"
|
|
28
|
+
>
|
|
29
|
+
{{ value + 543 }}
|
|
30
|
+
</template>
|
|
31
|
+
<template #dp-input>
|
|
32
|
+
<Input
|
|
33
|
+
:trailing-icon="!wrapperProps.required && value ? void 0 : 'i-heroicons-calendar-days'"
|
|
34
|
+
type="text"
|
|
35
|
+
:disabled="wrapperProps.disabled"
|
|
36
|
+
:model-value="formatDisplay(value)"
|
|
37
|
+
:placeholder="wrapperProps.placeholder"
|
|
38
|
+
:readonly="true"
|
|
39
39
|
:ui="{
|
|
40
40
|
base: 'cursor-pointer select-none',
|
|
41
41
|
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"
|
|
42
|
+
}"
|
|
43
|
+
/>
|
|
44
|
+
</template>
|
|
45
|
+
<template #clear-icon="{ clear }">
|
|
46
|
+
<Icon
|
|
47
|
+
v-if="value && !wrapperProps.disabled && !wrapperProps.required"
|
|
48
|
+
:name="clearIcon"
|
|
49
49
|
:class="theme.clearIcon({
|
|
50
50
|
class: [ui?.clearIcon]
|
|
51
|
-
})"
|
|
52
|
-
@click.stop="clear"
|
|
53
|
-
/>
|
|
54
|
-
</template>
|
|
55
|
-
</Datepicker>
|
|
56
|
-
</FieldWrapper>
|
|
51
|
+
})"
|
|
52
|
+
@click.stop="clear"
|
|
53
|
+
/>
|
|
54
|
+
</template>
|
|
55
|
+
</Datepicker>
|
|
56
|
+
</FieldWrapper>
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<script setup>
|
|
@@ -69,6 +69,7 @@ const props = defineProps({
|
|
|
69
69
|
clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
|
|
70
70
|
minDate: { type: [Date, String], required: false },
|
|
71
71
|
maxDate: { type: [Date, String], required: false },
|
|
72
|
+
teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
|
|
72
73
|
form: { type: Object, required: false },
|
|
73
74
|
name: { type: String, required: true },
|
|
74
75
|
errorMessage: { type: String, required: false },
|
|
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
|
|
|
2
2
|
import type { IMonthFieldProps } from '#core/components/Form/InputMonth/types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<IMonthFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IMonthFieldProps> & Readonly<{}>, {
|
|
4
4
|
clearIcon: string;
|
|
5
|
+
teleport: boolean | string | HTMLElement;
|
|
5
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
7
|
export default _default;
|
|
@@ -3,6 +3,7 @@ export interface IMonthFieldProps extends IFieldProps {
|
|
|
3
3
|
clearIcon?: string;
|
|
4
4
|
minDate?: Date | string;
|
|
5
5
|
maxDate?: Date | string;
|
|
6
|
+
teleport?: boolean | string | HTMLElement;
|
|
6
7
|
}
|
|
7
8
|
export type IMonthField = IFormFieldBase<INPUT_TYPES.MONTH, IMonthFieldProps, {
|
|
8
9
|
change: (value: string) => void;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
<FieldWrapper v-bind="wrapperProps">
|
|
3
3
|
<Datepicker
|
|
4
4
|
v-model="innerValue"
|
|
5
|
+
:teleport="teleport"
|
|
5
6
|
:disabled="wrapperProps.disabled"
|
|
6
|
-
cancel-text="
|
|
7
|
-
select-text="
|
|
8
|
-
locale="
|
|
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"
|
|
9
10
|
time-picker
|
|
10
11
|
:placeholder="wrapperProps.placeholder"
|
|
11
12
|
:format="format"
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
<script setup>
|
|
47
48
|
import Datepicker from "@vuepic/vue-datepicker";
|
|
48
49
|
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
49
|
-
import { computed, ref, useFieldHOC, useUiConfig, watch } from "#imports";
|
|
50
|
+
import { computed, ref, useFieldHOC, useUiConfig, watch, useAppConfig } from "#imports";
|
|
50
51
|
import "@vuepic/vue-datepicker/dist/main.css";
|
|
51
52
|
import { dateTimeTheme } from "#core/theme/dateTime";
|
|
52
53
|
const emits = defineEmits(["change"]);
|
|
@@ -57,6 +58,7 @@ const props = defineProps({
|
|
|
57
58
|
startTime: { type: Object, required: false },
|
|
58
59
|
format: { type: String, required: false },
|
|
59
60
|
enableSeconds: { type: Boolean, required: false, default: false },
|
|
61
|
+
teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
|
|
60
62
|
form: { type: Object, required: false },
|
|
61
63
|
name: { type: String, required: true },
|
|
62
64
|
errorMessage: { type: String, required: false },
|
|
@@ -72,6 +74,7 @@ const props = defineProps({
|
|
|
72
74
|
help: { type: String, required: false },
|
|
73
75
|
ui: { type: null, required: false }
|
|
74
76
|
});
|
|
77
|
+
const appConfig = useAppConfig();
|
|
75
78
|
const innerValue = ref(void 0);
|
|
76
79
|
const theme = computed(() => useUiConfig(dateTimeTheme, "dateTime")());
|
|
77
80
|
const {
|
|
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<ITimeFieldProps, void, {},
|
|
|
6
6
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
8
|
clearIcon: string;
|
|
9
|
+
teleport: boolean | string | HTMLElement;
|
|
9
10
|
enableSeconds: boolean;
|
|
10
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
12
|
export default _default;
|
|
@@ -11,6 +11,7 @@ export interface ITimeFieldProps extends IFieldProps {
|
|
|
11
11
|
startTime?: ITimeOption;
|
|
12
12
|
format?: string;
|
|
13
13
|
enableSeconds?: boolean;
|
|
14
|
+
teleport?: boolean | string | HTMLElement;
|
|
14
15
|
}
|
|
15
16
|
export type ITimeField = IFormFieldBase<INPUT_TYPES.TIME, ITimeFieldProps, {
|
|
16
17
|
change: (value: string) => void;
|
|
@@ -1,54 +1,54 @@
|
|
|
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
|
-
<!-- Loading State -->
|
|
19
|
-
<LoadingState
|
|
20
|
-
v-if="uploadState.isUploading.value"
|
|
21
|
-
:theme="theme"
|
|
22
|
-
:selected-file="uploadState.selectedFile.value"
|
|
23
|
-
:percent="uploadState.percent.value"
|
|
24
|
-
:uploading-label="uploadingLabel"
|
|
25
|
-
/>
|
|
26
|
-
|
|
27
|
-
<!-- Success State -->
|
|
28
|
-
<SuccessState
|
|
29
|
-
v-if="uploadState.isSuccess.value"
|
|
30
|
-
:theme="theme"
|
|
31
|
-
:value="value"
|
|
32
|
-
:disabled="wrapperProps.disabled"
|
|
33
|
-
:readonly="wrapperProps.readonly"
|
|
34
|
-
@preview="uploadState.handlePreview"
|
|
35
|
-
@download="handleDownloadFile"
|
|
36
|
-
@delete="uploadState.handleDeleteFile"
|
|
37
|
-
/>
|
|
38
|
-
|
|
39
|
-
<!-- Failed State -->
|
|
40
|
-
<FailedState
|
|
41
|
-
v-if="uploadState.isError.value"
|
|
42
|
-
:theme="theme"
|
|
43
|
-
:selected-file="uploadState.selectedFile.value"
|
|
44
|
-
:upload-failed-label="uploadFailedLabel"
|
|
45
|
-
:retry-label="retryLabel"
|
|
46
|
-
@retry="uploadState.handleRetryUpload"
|
|
47
|
-
@delete="uploadState.handleDeleteFile"
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</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"
|
|
13
|
+
:select-file-sub-label="selectFileSubLabel"
|
|
14
|
+
:placeholder="placeholder"
|
|
15
|
+
@open-file="uploadState.handleOpenFile"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<!-- Loading State -->
|
|
19
|
+
<LoadingState
|
|
20
|
+
v-if="uploadState.isUploading.value"
|
|
21
|
+
:theme="theme"
|
|
22
|
+
:selected-file="uploadState.selectedFile.value"
|
|
23
|
+
:percent="uploadState.percent.value"
|
|
24
|
+
:uploading-label="uploadingLabel"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<!-- Success State -->
|
|
28
|
+
<SuccessState
|
|
29
|
+
v-if="uploadState.isSuccess.value"
|
|
30
|
+
:theme="theme"
|
|
31
|
+
:value="value"
|
|
32
|
+
:disabled="wrapperProps.disabled"
|
|
33
|
+
:readonly="wrapperProps.readonly"
|
|
34
|
+
@preview="uploadState.handlePreview"
|
|
35
|
+
@download="handleDownloadFile"
|
|
36
|
+
@delete="uploadState.handleDeleteFile"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<!-- Failed State -->
|
|
40
|
+
<FailedState
|
|
41
|
+
v-if="uploadState.isError.value"
|
|
42
|
+
:theme="theme"
|
|
43
|
+
:selected-file="uploadState.selectedFile.value"
|
|
44
|
+
:upload-failed-label="uploadFailedLabel"
|
|
45
|
+
:retry-label="retryLabel"
|
|
46
|
+
@retry="uploadState.handleRetryUpload"
|
|
47
|
+
@delete="uploadState.handleDeleteFile"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</FieldWrapper>
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
@@ -71,6 +71,7 @@ const props = defineProps({
|
|
|
71
71
|
responsePath: { type: String, required: false, default: "path" },
|
|
72
72
|
responseName: { type: String, required: false, default: "name" },
|
|
73
73
|
responseSize: { type: String, required: false, default: "size" },
|
|
74
|
+
responseID: { type: String, required: false, default: "id" },
|
|
74
75
|
accept: { type: [Array, String], required: false },
|
|
75
76
|
maxSize: { type: Number, required: false },
|
|
76
77
|
selectFileLabel: { type: String, required: false, default: "\u0E04\u0E25\u0E34\u0E01\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C" },
|
|
@@ -19,5 +19,6 @@ declare const _default: import("vue").DefineComponent<IUploadDropzoneAutoProps,
|
|
|
19
19
|
responsePath: string;
|
|
20
20
|
responseName: string;
|
|
21
21
|
responseSize: string;
|
|
22
|
+
responseID: string;
|
|
22
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
24
|
export default _default;
|
|
@@ -150,7 +150,8 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
|
|
|
150
150
|
url: _get(upload.data.value, props.responseURL),
|
|
151
151
|
path: _get(upload.data.value, props.responsePath),
|
|
152
152
|
name: _get(upload.data.value, props.responseName) || selectedFile.value?.name,
|
|
153
|
-
size: Number(_get(upload.data.value, props.responseSize) || selectedFile.value?.size)
|
|
153
|
+
size: Number(_get(upload.data.value, props.responseSize) || selectedFile.value?.size),
|
|
154
|
+
id: _get(upload.data.value, props.responseID)
|
|
154
155
|
};
|
|
155
156
|
value.value = fileValue;
|
|
156
157
|
emits("success", fileValue);
|