@finema/core 2.59.2 → 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/theme/table.js +1 -1
- 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 -59
- 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
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="
|
|
4
4
|
theme.paginationContainer({
|
|
5
5
|
class: [ui?.paginationContainer]
|
|
6
6
|
})
|
|
7
|
-
"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
10
|
:class="
|
|
11
11
|
theme.paginationInfoWrapper({
|
|
12
12
|
class: [ui?.paginationInfoWrapper]
|
|
13
13
|
})
|
|
14
|
-
"
|
|
15
|
-
>
|
|
16
|
-
<USelect
|
|
17
|
-
v-if="options.pageOptions && !options.isHideLimitSelect"
|
|
18
|
-
size="lg"
|
|
19
|
-
trailing="รายการ"
|
|
14
|
+
"
|
|
15
|
+
>
|
|
16
|
+
<USelect
|
|
17
|
+
v-if="options.pageOptions && !options.isHideLimitSelect"
|
|
18
|
+
size="lg"
|
|
19
|
+
trailing="รายการ"
|
|
20
20
|
:class="
|
|
21
21
|
theme.paginationLimitSelect({
|
|
22
22
|
class: [ui?.paginationLimitSelect, 'cursor-pointer']
|
|
23
23
|
})
|
|
24
|
-
"
|
|
25
|
-
:items="pageLimitItems"
|
|
26
|
-
:model-value="pageLimit"
|
|
27
|
-
@update:modelValue="emits('pageLimitChange', $event)"
|
|
28
|
-
>
|
|
29
|
-
<template #default="{ modelValue }">
|
|
30
|
-
<p
|
|
24
|
+
"
|
|
25
|
+
:items="pageLimitItems"
|
|
26
|
+
:model-value="pageLimit"
|
|
27
|
+
@update:modelValue="emits('pageLimitChange', $event)"
|
|
28
|
+
>
|
|
29
|
+
<template #default="{ modelValue }">
|
|
30
|
+
<p
|
|
31
31
|
:class="
|
|
32
32
|
theme.paginationLimitSelectLabel({
|
|
33
33
|
class: [ui?.paginationLimitSelectLabel]
|
|
34
34
|
})
|
|
35
|
-
"
|
|
36
|
-
>
|
|
37
|
-
{{ modelValue }} รายการ
|
|
38
|
-
</p>
|
|
39
|
-
</template>
|
|
40
|
-
</USelect>
|
|
41
|
-
<p
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
{{ modelValue }} รายการ
|
|
38
|
+
</p>
|
|
39
|
+
</template>
|
|
40
|
+
</USelect>
|
|
41
|
+
<p
|
|
42
42
|
:class="
|
|
43
43
|
theme.paginationInfo({
|
|
44
44
|
class: [ui?.paginationInfo, '']
|
|
45
45
|
})
|
|
46
|
-
"
|
|
47
|
-
>
|
|
48
|
-
<span v-if="options.pageOptions">{{ pageBetween }} จากทั้งหมด {{ totalCountWithComma }}</span>
|
|
49
|
-
<span v-else>ทั้งหมด {{ options.rawData.length }} รายการ</span>
|
|
50
|
-
</p>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<UPagination
|
|
54
|
-
v-if="options.pageOptions && options.pageOptions.totalPage > 1"
|
|
55
|
-
:page="page"
|
|
56
|
-
:default-page="options.pageOptions?.currentPage || 1"
|
|
57
|
-
:items-per-page="options.pageOptions.limit"
|
|
58
|
-
:total="options.pageOptions.totalCount"
|
|
59
|
-
:to="options.isRouteChange ? to : void 0"
|
|
60
|
-
show-edges
|
|
61
|
-
variant="outline"
|
|
62
|
-
color="neutral"
|
|
63
|
-
active-color="neutral"
|
|
64
|
-
active-variant="subtle"
|
|
65
|
-
@update:page="emits('pageChange', $event)"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
46
|
+
"
|
|
47
|
+
>
|
|
48
|
+
<span v-if="options.pageOptions">{{ pageBetween }} จากทั้งหมด {{ totalCountWithComma }}</span>
|
|
49
|
+
<span v-else>ทั้งหมด {{ options.rawData.length }} รายการ</span>
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<UPagination
|
|
54
|
+
v-if="options.pageOptions && options.pageOptions.totalPage > 1"
|
|
55
|
+
:page="page"
|
|
56
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
57
|
+
:items-per-page="options.pageOptions.limit"
|
|
58
|
+
:total="options.pageOptions.totalCount"
|
|
59
|
+
:to="options.isRouteChange ? to : void 0"
|
|
60
|
+
show-edges
|
|
61
|
+
variant="outline"
|
|
62
|
+
color="neutral"
|
|
63
|
+
active-color="neutral"
|
|
64
|
+
active-variant="subtle"
|
|
65
|
+
@update:page="emits('pageChange', $event)"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
70
|
<script setup>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Base
|
|
3
|
-
v-bind="$attrs"
|
|
2
|
+
<Base
|
|
3
|
+
v-bind="$attrs"
|
|
4
4
|
:options="{
|
|
5
5
|
...options,
|
|
6
6
|
pageOptions,
|
|
7
7
|
isHideLimitSelect: true
|
|
8
|
-
}"
|
|
9
|
-
:ui="ui"
|
|
10
|
-
:raw-data="itemsByPage"
|
|
11
|
-
@page-change="onPageChange"
|
|
12
|
-
>
|
|
13
|
-
<template
|
|
14
|
-
v-for="(_, slot) of $slots"
|
|
15
|
-
#[slot]="slotProps"
|
|
16
|
-
>
|
|
17
|
-
<slot
|
|
18
|
-
:name="slot"
|
|
19
|
-
v-bind="slotProps || {}"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
22
|
-
</Base>
|
|
8
|
+
}"
|
|
9
|
+
:ui="ui"
|
|
10
|
+
:raw-data="itemsByPage"
|
|
11
|
+
@page-change="onPageChange"
|
|
12
|
+
>
|
|
13
|
+
<template
|
|
14
|
+
v-for="(_, slot) of $slots"
|
|
15
|
+
#[slot]="slotProps"
|
|
16
|
+
>
|
|
17
|
+
<slot
|
|
18
|
+
:name="slot"
|
|
19
|
+
v-bind="slotProps || {}"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
</Base>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script setup>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";@import "@nuxt/ui";@plugin "@tailwindcss/typography";@source inline("prose");@theme{--font-sans:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif;--font-display:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif}:root{--ui-text:var(--ui-color-neutral-800);--color-main:#1570ef;--color-main-50:#
|
|
1
|
+
@import "tailwindcss";@import "@nuxt/ui";@plugin "@tailwindcss/typography";@source inline("prose");@theme{--font-sans:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif;--font-display:"Noto Sans Thai","Noto Sans Thai Looped","Public Sans",sans-serif}:root{--ui-text:var(--ui-color-neutral-800);--color-main:#1570ef;--color-main-50:#ebeeff;--color-main-100:#d1e9ff;--color-main-200:#b2ddff;--color-main-300:#84caff;--color-main-400:#53b1fd;--color-main-500:#1570ef;--color-main-600:#1570ef;--color-main-700:#175cd3;--color-main-800:#1849a9;--color-main-900:#194185;--color-main-950:#102a56;--color-warning:#f79009;--color-warning-50:#fffaeb;--color-warning-100:#fef0c7;--color-warning-200:#fedf89;--color-warning-300:#fec84b;--color-warning-400:#fdb022;--color-warning-500:#f79009;--color-warning-600:#dc6803;--color-warning-700:#b54708;--color-warning-800:#93370d;--color-warning-900:#7a2e0e;--color-warning-950:#4e1d09;--color-success:#17b26a;--color-success-50:#ecfdf3;--color-success-100:#dcfae6;--color-success-200:#abefc6;--color-success-300:#75e0a7;--color-success-400:#47cd89;--color-success-500:#17b26a;--color-success-600:#079455;--color-success-700:#067647;--color-success-800:#085d3a;--color-success-900:#074d31;--color-success-950:#053321;--color-error:#e11d48;--color-error-50:#fef2f2;--color-error-100:#fee2e2;--color-error-200:#f0899f;--color-error-300:#eb6582;--color-error-400:#e64065;--color-error-500:#e11d48;--color-error-600:#af1738;--color-error-700:#7e1028;--color-error-800:#4c0a18;--color-error-900:#1a0308;--color-error-950:#010000;--color-info:#2563eb;--color-info-50:#dde9ff;--color-info-100:#c8dfff;--color-info-200:#a1c4ff;--color-info-300:#7aa9ff;--color-info-400:#538eff;--color-info-500:#2563eb;--color-info-600:#1a4aaf;--color-info-700:#0f318a;--color-info-800:#081f65;--color-info-900:#020b3a;--color-info-950:#000;--color-white:#fff;--color-white-50:#fff;--color-white-100:#fff;--color-white-200:#fff;--color-white-300:#fff;--color-white-400:#fff;--color-white-500:#fff;--color-white-600:#e3e3e3;--color-white-700:#c7c7c7;--color-white-800:#ababab;--color-white-900:#8f8f8f;--color-white-950:#818181}html{@apply text-sm lg:text-base;font-family:Noto Sans Thai,Noto Sans Thai Looped,Public Sans,sans-serif}::-webkit-scrollbar{-webkit-appearance:none;height:10px;width:10px}::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:4px;box-shadow:0 0 1px hsla(0,0%,100%,.5)}:root{--dp-font-family:inherit!important}.dp__theme_light{--dp-primary-color:var(--color-main)!important;--dp-primary-disabled-color:var(--color-main-200)!important}.dp__outer_menu_wrap{@apply ring-1 ring-gray-200}[role=dialog]{pointer-events:auto!important}#__nuxt,body,html{@apply w-full h-full}.dp__main{display:block!important}.dp__menu{border:none!important}.dp__pointer{height:44px!important}.dp__outer_menu_wrap{box-shadow:none!important}.dp--menu-wrapper{@apply ring-1 ring-slate-300}
|
|
@@ -7,10 +7,10 @@ export const selectMenuTheme = {
|
|
|
7
7
|
clearIcon: "size-6 bg-gray-400 hover:bg-gray-400/75",
|
|
8
8
|
item: "cursor-pointer max-sm:h-14",
|
|
9
9
|
tagsWrapper: "flex flex-wrap gap-x-2 gap-y-1",
|
|
10
|
-
tagsItem: "px-1.5 py-0.5 rounded-sm inline-flex items-center gap-0.5
|
|
10
|
+
tagsItem: "px-1.5 py-0.5 rounded-sm inline-flex items-center gap-0.5 bg-primary text-white data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
11
11
|
tagsItemText: "flex items-center gap-x-1 text-sm",
|
|
12
12
|
tagsItemDelete: [
|
|
13
|
-
"inline-flex items-center
|
|
13
|
+
"inline-flex items-center text-white disabled:pointer-events-none",
|
|
14
14
|
"transition-colors cursor-pointer"
|
|
15
15
|
],
|
|
16
16
|
tagsItemDeleteIcon: "ph:x"
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
export declare class TimeHelper {
|
|
2
2
|
static thaiFormat: (dateStr: Date, formatStr: string, forceThai?: boolean) => string;
|
|
3
|
-
static displayDate: (time: string | Date | null | undefined
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static
|
|
7
|
-
|
|
8
|
-
}) => string | null;
|
|
9
|
-
static displayDateThai: (time: string | Date | null | undefined, options?: {
|
|
10
|
-
autoTimezone?: boolean;
|
|
11
|
-
}) => string | null;
|
|
12
|
-
static displayDateTimeThai: (time: string | Date | null | undefined, options?: {
|
|
13
|
-
autoTimezone?: boolean;
|
|
14
|
-
}) => string | null;
|
|
15
|
-
static displayDateRange: (startDate: Date | string | null | undefined, endDate: Date | string | null | undefined, options?: {
|
|
16
|
-
autoTimezone?: boolean;
|
|
17
|
-
}) => {
|
|
3
|
+
static displayDate: (time: string | Date | null | undefined) => string | null;
|
|
4
|
+
static displayDateTime: (time: string | Date | null | undefined) => string | null;
|
|
5
|
+
static displayDateThai: (time: string | Date | null | undefined) => string | null;
|
|
6
|
+
static displayDateTimeThai: (time: string | Date | null | undefined) => string | null;
|
|
7
|
+
static displayDateRange: (startDate: Date | string | null | undefined, endDate: Date | string | null | undefined) => {
|
|
18
8
|
startDate: Date | string | null;
|
|
19
9
|
endDate: Date | string | null;
|
|
20
10
|
};
|
|
@@ -10,6 +10,7 @@ const timeFormat = useCoreConfig().time_format;
|
|
|
10
10
|
const isThaiYear = useCoreConfig().is_thai_year;
|
|
11
11
|
const isThaiMonth = useCoreConfig().is_thai_month;
|
|
12
12
|
const timeZone = useCoreConfig().time_zone;
|
|
13
|
+
const locale = useCoreConfig().locale;
|
|
13
14
|
const getTime = (time) => {
|
|
14
15
|
return isDate(time) ? time : new Date(time);
|
|
15
16
|
};
|
|
@@ -25,55 +26,39 @@ export class TimeHelper {
|
|
|
25
26
|
}
|
|
26
27
|
return formatInTimeZone(newDateStr, timeZone, formatStr, options);
|
|
27
28
|
};
|
|
28
|
-
static displayDate = (time
|
|
29
|
+
static displayDate = (time) => {
|
|
29
30
|
if (!time) {
|
|
30
31
|
return null;
|
|
31
32
|
}
|
|
32
33
|
const parsedTime = getTime(time);
|
|
33
|
-
|
|
34
|
-
const newTime2 = format(parsedTime, dateFormatDisplay);
|
|
35
|
-
return isValid(parsedTime) ? newTime2 : time;
|
|
36
|
-
}
|
|
37
|
-
const newTime = TimeHelper.thaiFormat(parsedTime, dateFormatDisplay);
|
|
34
|
+
const newTime = locale === "th" ? TimeHelper.thaiFormat(parsedTime, dateFormatDisplay) : format(parsedTime, dateFormatDisplay);
|
|
38
35
|
return isValid(parsedTime) ? newTime : time;
|
|
39
36
|
};
|
|
40
|
-
static displayDateTime = (time
|
|
37
|
+
static displayDateTime = (time) => {
|
|
41
38
|
if (!time) {
|
|
42
39
|
return null;
|
|
43
40
|
}
|
|
44
41
|
const parsedTime = getTime(time);
|
|
45
|
-
|
|
46
|
-
const newTime2 = format(parsedTime, dateTimeFormatDisplay);
|
|
47
|
-
return isValid(parsedTime) ? newTime2 : time;
|
|
48
|
-
}
|
|
49
|
-
const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay);
|
|
42
|
+
const newTime = locale === "th" ? TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay) : format(parsedTime, dateTimeFormatDisplay);
|
|
50
43
|
return isValid(parsedTime) ? newTime : time;
|
|
51
44
|
};
|
|
52
|
-
static displayDateThai = (time
|
|
45
|
+
static displayDateThai = (time) => {
|
|
53
46
|
if (!time) {
|
|
54
47
|
return null;
|
|
55
48
|
}
|
|
56
49
|
const parsedTime = getTime(time);
|
|
57
|
-
|
|
58
|
-
const newTime2 = format(parsedTime, dateFormat);
|
|
59
|
-
return isValid(parsedTime) ? newTime2 : time;
|
|
60
|
-
}
|
|
61
|
-
const newTime = TimeHelper.thaiFormat(parsedTime, dateFormat, true);
|
|
50
|
+
const newTime = TimeHelper.thaiFormat(parsedTime, dateFormatDisplay, true);
|
|
62
51
|
return isValid(parsedTime) ? newTime : time;
|
|
63
52
|
};
|
|
64
|
-
static displayDateTimeThai = (time
|
|
53
|
+
static displayDateTimeThai = (time) => {
|
|
65
54
|
if (!time) {
|
|
66
55
|
return null;
|
|
67
56
|
}
|
|
68
57
|
const parsedTime = getTime(time);
|
|
69
|
-
|
|
70
|
-
const newTime2 = format(parsedTime, dateTimeFormat);
|
|
71
|
-
return isValid(parsedTime) ? newTime2 : time;
|
|
72
|
-
}
|
|
73
|
-
const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormat, true);
|
|
58
|
+
const newTime = TimeHelper.thaiFormat(parsedTime, dateTimeFormatDisplay, true);
|
|
74
59
|
return isValid(parsedTime) ? newTime : time;
|
|
75
60
|
};
|
|
76
|
-
static displayDateRange = (startDate, endDate
|
|
61
|
+
static displayDateRange = (startDate, endDate) => {
|
|
77
62
|
if (!startDate || !endDate) {
|
|
78
63
|
return {
|
|
79
64
|
startDate: startDate || null,
|
|
@@ -82,14 +67,6 @@ export class TimeHelper {
|
|
|
82
67
|
}
|
|
83
68
|
const parsedStartDate = getTime(startDate);
|
|
84
69
|
const parsedEndDate = getTime(endDate);
|
|
85
|
-
if (options?.autoTimezone) {
|
|
86
|
-
const newTimeStartDate = format(parsedStartDate, dateFormatDisplay);
|
|
87
|
-
const newTimeEndDate = format(parsedEndDate, dateFormatDisplay);
|
|
88
|
-
return {
|
|
89
|
-
startDate: isValid(parsedStartDate) ? newTimeStartDate : startDate,
|
|
90
|
-
endDate: isValid(parsedEndDate) ? newTimeEndDate : endDate
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
70
|
const newStartDate = TimeHelper.thaiFormat(parsedStartDate, dateFormatDisplay);
|
|
94
71
|
const newEndDate = TimeHelper.thaiFormat(parsedEndDate, dateFormatDisplay);
|
|
95
72
|
return {
|
|
@@ -129,7 +106,7 @@ export class TimeHelper {
|
|
|
129
106
|
return null;
|
|
130
107
|
}
|
|
131
108
|
const parsedTime = getTime(time);
|
|
132
|
-
const newTime =
|
|
109
|
+
const newTime = format(parsedTime, customFormat);
|
|
133
110
|
return isValid(parsedTime) ? newTime : time;
|
|
134
111
|
};
|
|
135
112
|
static getDateFormTimeWithLocal = (time, customFormat = dateFormat) => {
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ICheckboxGroupFieldProps } from '#core/components/Form/InputCheckboxGroup/types';
|
|
2
|
-
declare const __VLS_export: import("vue").DefineComponent<ICheckboxGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
-
change: (...args: any[]) => void;
|
|
4
|
-
}, string, import("vue").PublicProps, Readonly<ICheckboxGroupFieldProps> & Readonly<{
|
|
5
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
6
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<CheckboxGroup
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:label="label"
|
|
12
|
-
:items="options"
|
|
13
|
-
:description="description"
|
|
14
|
-
:required="required"
|
|
15
|
-
:variant="variant"
|
|
16
|
-
:indicator="indicator"
|
|
17
|
-
:value-key="valueKey"
|
|
18
|
-
:orientation="orientation"
|
|
19
|
-
:ui="ui"
|
|
20
|
-
@update:modelValue="onChange"
|
|
21
|
-
/>
|
|
22
|
-
</FieldWrapper>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script setup>
|
|
26
|
-
import { useFieldHOC } from "#core/composables/useForm";
|
|
27
|
-
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
28
|
-
const emits = defineEmits(["change"]);
|
|
29
|
-
const props = defineProps({
|
|
30
|
-
label: { type: String, required: false },
|
|
31
|
-
description: { type: String, required: false },
|
|
32
|
-
variant: { type: String, required: false },
|
|
33
|
-
orientation: { type: String, required: false },
|
|
34
|
-
indicator: { type: String, required: false },
|
|
35
|
-
options: { type: Array, required: true },
|
|
36
|
-
valueKey: { type: String, required: false },
|
|
37
|
-
form: { type: Object, required: false },
|
|
38
|
-
name: { type: String, required: true },
|
|
39
|
-
errorMessage: { type: String, required: false },
|
|
40
|
-
hint: { type: String, required: false },
|
|
41
|
-
rules: { type: null, required: false },
|
|
42
|
-
autoFocus: { type: Boolean, required: false },
|
|
43
|
-
placeholder: { type: String, required: false },
|
|
44
|
-
disabled: { type: Boolean, required: false },
|
|
45
|
-
readonly: { type: Boolean, required: false },
|
|
46
|
-
required: { type: Boolean, required: false },
|
|
47
|
-
help: { type: String, required: false },
|
|
48
|
-
ui: { type: null, required: false }
|
|
49
|
-
});
|
|
50
|
-
const {
|
|
51
|
-
value,
|
|
52
|
-
wrapperProps,
|
|
53
|
-
handleChange
|
|
54
|
-
} = useFieldHOC(props);
|
|
55
|
-
const onChange = (value2) => {
|
|
56
|
-
handleChange(value2);
|
|
57
|
-
emits("change", value2);
|
|
58
|
-
};
|
|
59
|
-
</script>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ICheckboxGroupFieldProps } from '#core/components/Form/InputCheckboxGroup/types';
|
|
2
|
-
declare const __VLS_export: import("vue").DefineComponent<ICheckboxGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
-
change: (...args: any[]) => void;
|
|
4
|
-
}, string, import("vue").PublicProps, Readonly<ICheckboxGroupFieldProps> & Readonly<{
|
|
5
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
6
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
|
|
2
|
-
import type { IOption } from '#core/types/common';
|
|
3
|
-
export type CheckboxOption = IOption & {
|
|
4
|
-
label?: string;
|
|
5
|
-
value?: any;
|
|
6
|
-
description?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
class?: any;
|
|
9
|
-
};
|
|
10
|
-
export interface ICheckboxGroupFieldProps extends IFieldProps {
|
|
11
|
-
label?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
variant?: 'list' | 'card' | 'table';
|
|
14
|
-
orientation?: 'horizontal' | 'vertical';
|
|
15
|
-
indicator?: 'start' | 'end' | 'hidden';
|
|
16
|
-
options: CheckboxOption[];
|
|
17
|
-
valueKey?: string;
|
|
18
|
-
}
|
|
19
|
-
export type ICheckboxGroupField = IFormFieldBase<INPUT_TYPES.CHECKBOX_GROUP, ICheckboxGroupFieldProps, {
|
|
20
|
-
change?: (value: any) => void;
|
|
21
|
-
}>;
|
|
File without changes
|