pukaad-ui-lib 1.341.0 → 1.343.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/runtime/assets/css/core.css +1 -1
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-suggest.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-suggest.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/components/modal/modal-province-domain.d.vue.ts +3 -2
- package/dist/runtime/components/modal/modal-province-domain.vue +40 -31
- package/dist/runtime/components/modal/modal-province-domain.vue.d.ts +3 -2
- package/dist/runtime/composables/useProvinceRedirect.d.ts +4 -0
- package/dist/runtime/composables/useProvinceRedirect.js +8 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";@import "tw-animate-css";@import "./system.css";@import "./scroll-bar.css";@custom-variant dark (&:is(.dark *));@theme inline{--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary-foreground:var(--primary-foreground);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring);--color-red:var(--red);--color-error:var(--error);--color-success:var(--success);--color-green:var(--green);--color-warning:var(--warning);--color-yellow:var(--yellow);--color-pink:var(--pink);--color-primary:var(--primary);--color-secondary:var(--secondary);--color-info:var(--info);--color-info-foreground:var(--info-foreground);--color-black:var(--black);--color-dark:var(--dark);--color-gray:var(--gray);--color-cloud:var(--cloud);--color-mercury:var(--mercury);--color-green-light:var(--green-light);--color-red-light:var(--red-light);--color-yellow-light:var(--yellow-light);--color-bright:var(--bright);--color-silver:var(--silver);--color-smoke:var(--smoke);--z-index-announce-tool:10;--z-index-navbar:11;--z-index-dropdown:12;--z-index-overlay:13;--z-index-loading:14;--z-index-drawer:15;--z-index-modal:16;--z-index-toast:100;--z-index-loading-page:101}:root{--radius:0.625rem;--red:#b71c1c;--
|
|
1
|
+
@import "tailwindcss";@import "tw-animate-css";@import "./system.css";@import "./scroll-bar.css";@custom-variant dark (&:is(.dark *));@theme inline{--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary-foreground:var(--primary-foreground);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring);--color-red:var(--red);--color-error:var(--error);--color-success:var(--success);--color-green:var(--green);--color-warning:var(--warning);--color-yellow:var(--yellow);--color-pink:var(--pink);--color-primary:var(--primary);--color-secondary:var(--secondary);--color-info:var(--info);--color-info-foreground:var(--info-foreground);--color-black:var(--black);--color-dark:var(--dark);--color-gray:var(--gray);--color-cloud:var(--cloud);--color-mercury:var(--mercury);--color-green-light:var(--green-light);--color-red-light:var(--red-light);--color-yellow-light:var(--yellow-light);--color-bright:var(--bright);--color-silver:var(--silver);--color-smoke:var(--smoke);--z-index-announce-tool:10;--z-index-navbar:11;--z-index-dropdown:12;--z-index-overlay:13;--z-index-loading:14;--z-index-drawer:15;--z-index-modal:16;--z-index-toast:100;--z-index-loading-page:101}:root{--radius:0.625rem;--red:#b71c1c;--success:#43a047;--green:#1b5e20;--warning:#f9a825;--yellow:#fbc02d;--info:#e3f2fd;--info-foreground:var(--primary);--black:#212121;--dark:#424242;--gray:#616161;--cloud:#c4c4c4;--mercury:#e0e0e0;--green-light:#e3f5e3;--red-light:#fde3e3;--yellow-light:#fef3c7;--bright:#f5f5f5;--silver:#f7f7f7;--smoke:#fafafa;--white:#fff;--pink:#ffe6f4;--background:var(--white);--foreground:var(--black);--card:var(--background);--card-foreground:var(--foreground);--popover:var(--background);--popover-foreground:var(--foreground);--primary:#1976b8;--primary-foreground:var(--white);--secondary:#22a7ef;--secondary-foreground:var(--white);--muted:oklch(0.97 0 0);--muted-foreground:var(--cloud);--accent:oklch(0.97 0 0);--accent-foreground:oklch(0.205 0 0);--destructive:#d32f2f;--destructive-foreground:var(--white);--border:var(--color-mercury);--input:var(--color-mercury);--ring:var(--mercury);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--sidebar:oklch(0.985 0 0);--sidebar-foreground:var(--foreground);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:var(--color-mercury);--sidebar-ring:var(--color-mercury)}.dark{--background:oklch(0.145 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.145 0 0);--card-foreground:oklch(0.985 0 0);--popover:oklch(0.145 0 0);--popover-foreground:oklch(0.985 0 0);--primary:oklch(0.985 0 0);--primary-foreground:oklch(0.205 0 0);--secondary:oklch(0.269 0 0);--secondary-foreground:oklch(0.985 0 0);--muted:oklch(0.269 0 0);--muted-foreground:oklch(0.708 0 0);--accent:oklch(0.269 0 0);--accent-foreground:oklch(0.985 0 0);--destructive:oklch(0.396 0.141 25.723);--destructive-foreground:oklch(0.637 0.237 25.331);--border:oklch(0.269 0 0);--input:oklch(0.269 0 0);--ring:oklch(0.439 0 0);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(0.269 0 0);--sidebar-ring:oklch(0.439 0 0)}@layer base{*{@apply border-border outline-ring/50}body{@apply bg-background text-foreground}}
|
|
@@ -51,8 +51,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
51
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
52
52
|
description: string;
|
|
53
53
|
labelKey: string;
|
|
54
|
-
limit: number;
|
|
55
54
|
placeholder: string;
|
|
55
|
+
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
58
58
|
showCounter: boolean;
|
|
@@ -51,8 +51,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
51
51
|
options: AutocompleteOption[] | string[] | number[];
|
|
52
52
|
description: string;
|
|
53
53
|
labelKey: string;
|
|
54
|
-
limit: number;
|
|
55
54
|
placeholder: string;
|
|
55
|
+
limit: number;
|
|
56
56
|
disabledErrorMessage: boolean;
|
|
57
57
|
disabledBorder: boolean;
|
|
58
58
|
showCounter: boolean;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
limit: number;
|
|
16
15
|
placeholder: string;
|
|
16
|
+
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
14
|
options: InputSelectItem[];
|
|
15
|
-
limit: number;
|
|
16
15
|
placeholder: string;
|
|
16
|
+
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -21,8 +21,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
|
-
limit: number;
|
|
25
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -21,8 +21,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
21
21
|
required: boolean;
|
|
22
22
|
description: string;
|
|
23
23
|
labelKey: string;
|
|
24
|
-
limit: number;
|
|
25
24
|
placeholder: string;
|
|
25
|
+
limit: number;
|
|
26
26
|
disabledErrorMessage: boolean;
|
|
27
27
|
disabledBorder: boolean;
|
|
28
28
|
showCounter: boolean;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
limit: number;
|
|
30
29
|
placeholder: string;
|
|
30
|
+
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
}>, {
|
|
27
27
|
name: string;
|
|
28
28
|
state: "user" | "admin";
|
|
29
|
-
limit: number;
|
|
30
29
|
placeholder: string;
|
|
30
|
+
limit: number;
|
|
31
31
|
ignore: string[];
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Province } from "#pukaad-ui/runtime/composables/useThaiAddress";
|
|
1
2
|
import type { ModalProviceDomainProps } from "#pukaad-ui/types/components/modal/modal-province-domain";
|
|
2
3
|
type __VLS_Props = ModalProviceDomainProps;
|
|
3
4
|
type __VLS_ModelProps = {
|
|
@@ -7,10 +8,10 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
9
|
"update:modelValue": (value: boolean) => any;
|
|
9
10
|
} & {
|
|
10
|
-
|
|
11
|
+
complete: (province: Province) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
13
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
13
|
-
|
|
14
|
+
onComplete?: ((province: Province) => any) | undefined;
|
|
14
15
|
}>, {
|
|
15
16
|
confirmedText: string;
|
|
16
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Modal
|
|
3
3
|
title="เลือกจังหวัดที่คุณต้องการใช้งาน"
|
|
4
|
-
|
|
4
|
+
description="เลือกจังหวัดที่คุณต้องการจัดการข้อมูลธุรกิจ
|
|
5
|
+
เพื่อให้เข้าถึงเครื่องมือและข้อมูลในพื้นที่ได้ถูกต้อง"
|
|
6
|
+
class="w-[425px]"
|
|
5
7
|
v-model="modelValue"
|
|
6
8
|
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
full-width
|
|
15
|
-
placeholder="เลือกจังหวัด"
|
|
16
|
-
v-model="selected"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
9
|
+
<InputCombobox
|
|
10
|
+
placeholder="เลือกจังหวัด"
|
|
11
|
+
label="จังหวัด"
|
|
12
|
+
:options="provinceOptions"
|
|
13
|
+
v-model="selected"
|
|
14
|
+
placeholder-search="ค้นหาจังหวัด"
|
|
15
|
+
/>
|
|
19
16
|
<template #footer>
|
|
20
|
-
<Button
|
|
17
|
+
<Button
|
|
18
|
+
class="w-full"
|
|
19
|
+
color="primary"
|
|
20
|
+
:disabled="!selected"
|
|
21
|
+
@click="onNext"
|
|
22
|
+
>
|
|
21
23
|
{{ props.confirmedText }}
|
|
22
24
|
</Button>
|
|
23
25
|
</template>
|
|
@@ -25,31 +27,38 @@
|
|
|
25
27
|
</template>
|
|
26
28
|
|
|
27
29
|
<script setup>
|
|
28
|
-
import { ref } from "vue";
|
|
29
|
-
|
|
30
|
+
import { ref, computed, onMounted } from "vue";
|
|
31
|
+
import {
|
|
32
|
+
useThaiAddress
|
|
33
|
+
} from "#pukaad-ui/runtime/composables/useThaiAddress";
|
|
34
|
+
const emit = defineEmits(["complete"]);
|
|
30
35
|
const props = defineProps({
|
|
31
36
|
confirmedText: { type: String, required: false, default: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19" }
|
|
32
37
|
});
|
|
38
|
+
const { loadProvinces } = useThaiAddress();
|
|
33
39
|
const selected = ref("");
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
label:
|
|
41
|
-
value:
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
]);
|
|
40
|
+
const provincesData = ref([]);
|
|
41
|
+
const activeProvinces = computed(
|
|
42
|
+
() => provincesData.value.filter((province) => province.is_active)
|
|
43
|
+
);
|
|
44
|
+
const provinceOptions = computed(
|
|
45
|
+
() => activeProvinces.value.map((province) => ({
|
|
46
|
+
label: province.name_th,
|
|
47
|
+
value: String(province.id)
|
|
48
|
+
}))
|
|
49
|
+
);
|
|
50
|
+
onMounted(async () => {
|
|
51
|
+
provincesData.value = await loadProvinces();
|
|
52
|
+
});
|
|
48
53
|
const modelValue = defineModel({ type: Boolean, ...{
|
|
49
54
|
default: false
|
|
50
55
|
} });
|
|
51
56
|
const onNext = () => {
|
|
52
|
-
|
|
57
|
+
const province = activeProvinces.value.find(
|
|
58
|
+
(p) => String(p.id) === selected.value
|
|
59
|
+
);
|
|
60
|
+
if (!province) return;
|
|
61
|
+
emit("complete", province);
|
|
53
62
|
modelValue.value = false;
|
|
54
63
|
};
|
|
55
64
|
</script>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Province } from "#pukaad-ui/runtime/composables/useThaiAddress";
|
|
1
2
|
import type { ModalProviceDomainProps } from "#pukaad-ui/types/components/modal/modal-province-domain";
|
|
2
3
|
type __VLS_Props = ModalProviceDomainProps;
|
|
3
4
|
type __VLS_ModelProps = {
|
|
@@ -7,10 +8,10 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
9
|
"update:modelValue": (value: boolean) => any;
|
|
9
10
|
} & {
|
|
10
|
-
|
|
11
|
+
complete: (province: Province) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
13
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
13
|
-
|
|
14
|
+
onComplete?: ((province: Province) => any) | undefined;
|
|
14
15
|
}>, {
|
|
15
16
|
confirmedText: string;
|
|
16
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { navigateTo } from "#imports";
|
|
2
|
+
export function useProvinceRedirect() {
|
|
3
|
+
const goToProvinceDomain = (province, path = "") => {
|
|
4
|
+
if (!province?.domain) return;
|
|
5
|
+
return navigateTo(`//${province.domain}${path}`, { external: true });
|
|
6
|
+
};
|
|
7
|
+
return { goToProvinceDomain };
|
|
8
|
+
}
|