@finema/core 2.36.0 → 2.36.1
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 -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/date_time_field.types.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +2 -1
- 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 +2 -1
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputMonth/index.vue +2 -1
- 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/InputNumber/index.vue +20 -20
- 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 +41 -38
- 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/InputToggle/index.vue +17 -17
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
- 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 +2 -2
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>
|
|
@@ -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>
|
|
@@ -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,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FieldWrapper v-bind="wrapperProps">
|
|
3
3
|
<Datepicker
|
|
4
|
-
:teleport="true"
|
|
5
4
|
:model-value="innerValue"
|
|
6
5
|
:disabled="wrapperProps.disabled"
|
|
7
6
|
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
@@ -15,6 +14,7 @@
|
|
|
15
14
|
:min-time="minTime"
|
|
16
15
|
:max-time="maxTime"
|
|
17
16
|
:start-time="startTime"
|
|
17
|
+
:teleport="teleport"
|
|
18
18
|
:required="required"
|
|
19
19
|
:flow="['calendar', 'time']"
|
|
20
20
|
@update:model-value="onInput"
|
|
@@ -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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Datepicker
|
|
4
4
|
ref="datepicker"
|
|
5
5
|
v-model="innerValueRef"
|
|
6
|
-
:teleport="
|
|
6
|
+
:teleport="teleport"
|
|
7
7
|
:disabled="wrapperProps.disabled"
|
|
8
8
|
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
9
9
|
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
@@ -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;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<FieldWrapper v-bind="wrapperProps">
|
|
3
3
|
<Datepicker
|
|
4
4
|
v-model="value"
|
|
5
|
-
:teleport="
|
|
5
|
+
:teleport="teleport"
|
|
6
6
|
:disabled="wrapperProps.disabled"
|
|
7
7
|
:cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
|
|
8
8
|
:select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
|
|
@@ -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;
|
|
@@ -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>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<SelectMenu
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:items="options"
|
|
6
|
-
multiple
|
|
7
|
-
:placeholder="wrapperProps.placeholder"
|
|
8
|
-
:disabled="wrapperProps.disabled"
|
|
9
|
-
:loading="loading"
|
|
10
|
-
:search-input="searchInput"
|
|
11
|
-
:selected-icon="selectedIcon"
|
|
12
|
-
value-key="value"
|
|
13
|
-
label-key="label"
|
|
14
|
-
:icon="icon"
|
|
15
|
-
:ui="ui"
|
|
16
|
-
:ignore-filter="!!$attrs.onSearch"
|
|
17
|
-
@update:model-value="onChange"
|
|
18
|
-
@update:searchTerm="onSearch"
|
|
19
|
-
>
|
|
20
|
-
<template #default="{ modelValue }">
|
|
21
|
-
<div
|
|
22
|
-
v-if="!ArrayHelper.isEmpty(value)"
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<SelectMenu
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:items="options"
|
|
6
|
+
multiple
|
|
7
|
+
:placeholder="wrapperProps.placeholder"
|
|
8
|
+
:disabled="wrapperProps.disabled"
|
|
9
|
+
:loading="loading"
|
|
10
|
+
:search-input="searchInput"
|
|
11
|
+
:selected-icon="selectedIcon"
|
|
12
|
+
value-key="value"
|
|
13
|
+
label-key="label"
|
|
14
|
+
:icon="icon"
|
|
15
|
+
:ui="ui"
|
|
16
|
+
:ignore-filter="!!$attrs.onSearch"
|
|
17
|
+
@update:model-value="onChange"
|
|
18
|
+
@update:searchTerm="onSearch"
|
|
19
|
+
>
|
|
20
|
+
<template #default="{ modelValue }">
|
|
21
|
+
<div
|
|
22
|
+
v-if="!ArrayHelper.isEmpty(value)"
|
|
23
23
|
:class="theme.tagsWrapper({
|
|
24
24
|
class: [ui?.tagsWrapper]
|
|
25
|
-
})"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
29
|
-
:key="_value"
|
|
25
|
+
})"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
29
|
+
:key="_value"
|
|
30
30
|
:class="theme.tagsItem({
|
|
31
31
|
class: [ui?.tagsItem]
|
|
32
|
-
})"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
32
|
+
})"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
35
|
:class="theme.tagsItemText({
|
|
36
36
|
class: [ui?.tagsItemText]
|
|
37
|
-
})"
|
|
38
|
-
>
|
|
39
|
-
{{ options.find((item) => item.value === _value)?.label || _value }}
|
|
40
|
-
<Icon
|
|
37
|
+
})"
|
|
38
|
+
>
|
|
39
|
+
{{ options.find((item) => item.value === _value)?.label || _value }}
|
|
40
|
+
<Icon
|
|
41
41
|
:name="theme.tagsItemDeleteIcon({
|
|
42
42
|
class: [ui?.tagsItemDeleteIcon]
|
|
43
|
-
})"
|
|
43
|
+
})"
|
|
44
44
|
:class="theme.tagsItemDelete({
|
|
45
45
|
class: [ui?.tagsItemDelete]
|
|
46
|
-
})"
|
|
47
|
-
@click.stop="handleDelete(_value)"
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
</SelectMenu>
|
|
54
|
-
</FieldWrapper>
|
|
46
|
+
})"
|
|
47
|
+
@click.stop="handleDelete(_value)"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
</SelectMenu>
|
|
54
|
+
</FieldWrapper>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script setup>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<InputTags
|
|
4
|
-
:model-value="value"
|
|
5
|
-
:disabled="wrapperProps.disabled"
|
|
6
|
-
:leading-icon="leadingIcon"
|
|
7
|
-
:max-length="maxLength"
|
|
8
|
-
:varant="variant"
|
|
9
|
-
:delete-icon="deleteIcon"
|
|
10
|
-
:size="size"
|
|
11
|
-
:trailing-icon="trailingIcon"
|
|
12
|
-
:loading="loading"
|
|
13
|
-
:loading-icon="loadingIcon"
|
|
14
|
-
:name="name"
|
|
15
|
-
:placeholder="wrapperProps.placeholder"
|
|
16
|
-
:autofocus="!!autoFocus"
|
|
17
|
-
:icon="icon"
|
|
18
|
-
:readonly="readonly"
|
|
19
|
-
:ui="ui"
|
|
20
|
-
@update:model-value="onChange"
|
|
21
|
-
@addTag="onAdd"
|
|
22
|
-
@removeTag="onRemove"
|
|
23
|
-
/>
|
|
24
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<InputTags
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:leading-icon="leadingIcon"
|
|
7
|
+
:max-length="maxLength"
|
|
8
|
+
:varant="variant"
|
|
9
|
+
:delete-icon="deleteIcon"
|
|
10
|
+
:size="size"
|
|
11
|
+
:trailing-icon="trailingIcon"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
:loading-icon="loadingIcon"
|
|
14
|
+
:name="name"
|
|
15
|
+
:placeholder="wrapperProps.placeholder"
|
|
16
|
+
:autofocus="!!autoFocus"
|
|
17
|
+
:icon="icon"
|
|
18
|
+
:readonly="readonly"
|
|
19
|
+
:ui="ui"
|
|
20
|
+
@update:model-value="onChange"
|
|
21
|
+
@addTag="onAdd"
|
|
22
|
+
@removeTag="onRemove"
|
|
23
|
+
/>
|
|
24
|
+
</FieldWrapper>
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
@@ -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>
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<Datepicker
|
|
4
|
-
v-model="innerValue"
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
14
|
-
:
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:
|
|
25
|
-
:
|
|
26
|
-
:
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<Datepicker
|
|
4
|
+
v-model="innerValue"
|
|
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
|
+
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"
|
|
27
28
|
:ui="{
|
|
28
29
|
base: 'cursor-pointer select-none',
|
|
29
30
|
trailingIcon: 'cursor-pointer'
|
|
30
|
-
}"
|
|
31
|
-
/>
|
|
32
|
-
</template>
|
|
33
|
-
<template #clear-icon="{ clear }">
|
|
34
|
-
<Icon
|
|
35
|
-
:name="clearIcon"
|
|
31
|
+
}"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
<template #clear-icon="{ clear }">
|
|
35
|
+
<Icon
|
|
36
|
+
:name="clearIcon"
|
|
36
37
|
:class="theme.clearIcon({
|
|
37
38
|
class: [ui?.clearIcon]
|
|
38
|
-
})"
|
|
39
|
-
@click.stop="clear"
|
|
40
|
-
/>
|
|
41
|
-
</template>
|
|
42
|
-
</Datepicker>
|
|
43
|
-
</FieldWrapper>
|
|
39
|
+
})"
|
|
40
|
+
@click.stop="clear"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
43
|
+
</Datepicker>
|
|
44
|
+
</FieldWrapper>
|
|
44
45
|
</template>
|
|
45
46
|
|
|
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,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>
|