pukaad-ui-lib 1.111.0 → 1.112.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/components/input/input-file.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-file.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-select-province.d.vue.ts +23 -6
- package/dist/runtime/components/input/input-select-province.vue +23 -48
- package/dist/runtime/components/input/input-select-province.vue.d.ts +23 -6
- package/dist/runtime/components/input/input-textarea.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-textarea.vue.d.ts +1 -1
- package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.d.vue.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
fullHeight: boolean;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
accept: string;
|
|
31
30
|
disabledErrorMessage: boolean;
|
|
31
|
+
accept: string;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
fullHeight: boolean;
|
|
28
28
|
name: string;
|
|
29
29
|
limit: number;
|
|
30
|
-
accept: string;
|
|
31
30
|
disabledErrorMessage: boolean;
|
|
31
|
+
accept: string;
|
|
32
32
|
labelIcon: string;
|
|
33
33
|
disabledDrop: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
interface Province {
|
|
2
|
+
id: number;
|
|
3
|
+
name_th: string;
|
|
4
|
+
name_en: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
image_cover_url: string | null;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
items?: Province[];
|
|
10
|
+
itemsPopular?: Province[];
|
|
11
|
+
};
|
|
1
12
|
type __VLS_ModelProps = {
|
|
2
|
-
modelValue?:
|
|
13
|
+
modelValue?: Province;
|
|
3
14
|
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
}
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
select: (province: Province) => any;
|
|
18
|
+
"update:modelValue": (value: Province | undefined) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
onSelect?: ((province: Province) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: Province | undefined) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
items: Province[];
|
|
24
|
+
itemsPopular: Province[];
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
26
|
declare const _default: typeof __VLS_export;
|
|
10
27
|
export default _default;
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
<ShadCarousel>
|
|
25
25
|
<ShadCarouselContent>
|
|
26
26
|
<ShadCarouselItem
|
|
27
|
-
v-for="province in
|
|
28
|
-
:key="province.
|
|
27
|
+
v-for="province in itemsPopular"
|
|
28
|
+
:key="province.id"
|
|
29
29
|
class="flex cursor-pointer basis-1/3.5"
|
|
30
|
-
@click="selectProvince(province
|
|
30
|
+
@click="selectProvince(province)"
|
|
31
31
|
>
|
|
32
32
|
<Card
|
|
33
33
|
class="relative overflow-hidden bg-mercury w-[140px] h-[180px]"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<!-- No image state -->
|
|
36
36
|
<template v-if="province.image_cover_url === null">
|
|
37
37
|
<div class="font-medium">
|
|
38
|
-
{{ province.
|
|
38
|
+
{{ province.name_th }}
|
|
39
39
|
</div>
|
|
40
40
|
<div
|
|
41
41
|
class="flex flex-col items-center justify-center gap-[4px] h-full mt-2"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
<div
|
|
57
57
|
class="absolute top-0 left-0 right-0 p-2 font-medium text-white bg-gradient-to-b from-black/70 to-transparent"
|
|
58
58
|
>
|
|
59
|
-
{{ province.
|
|
59
|
+
{{ province.name_th }}
|
|
60
60
|
</div>
|
|
61
61
|
</template>
|
|
62
62
|
</Card>
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
<ShadCommandGroup>
|
|
71
71
|
<ShadCommandItem
|
|
72
72
|
v-for="province in filteredProvinces"
|
|
73
|
-
:key="province.
|
|
74
|
-
:value="province.
|
|
75
|
-
@select="selectProvince(province
|
|
73
|
+
:key="province.id"
|
|
74
|
+
:value="province.name_th"
|
|
75
|
+
@select="selectProvince(province)"
|
|
76
76
|
class="flex items-center justify-between"
|
|
77
77
|
>
|
|
78
78
|
<span>
|
|
79
|
-
{{ province.
|
|
79
|
+
{{ province.name_th }}
|
|
80
80
|
</span>
|
|
81
81
|
<Icon
|
|
82
|
-
v-if="modelValue === province.
|
|
82
|
+
v-if="modelValue?.id === province.id"
|
|
83
83
|
name="lucide:check"
|
|
84
84
|
class="h-4 w-4"
|
|
85
85
|
/>
|
|
@@ -96,51 +96,26 @@
|
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<script setup>
|
|
99
|
-
import { ref, computed
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
import { ref, computed } from "vue";
|
|
100
|
+
const props = defineProps({
|
|
101
|
+
items: { type: Array, required: false, default: () => [] },
|
|
102
|
+
itemsPopular: { type: Array, required: false, default: () => [] }
|
|
103
|
+
});
|
|
104
|
+
const emit = defineEmits(["select"]);
|
|
105
|
+
const modelValue = defineModel({ type: Object });
|
|
103
106
|
const open = ref(false);
|
|
104
107
|
const search = ref("");
|
|
105
|
-
const provinces = ref([]);
|
|
106
|
-
const fetchProvinces = async () => {
|
|
107
|
-
try {
|
|
108
|
-
const response = await $fetch(
|
|
109
|
-
`${BASE_URL_API}/api/master/address/provinces`,
|
|
110
|
-
{ credentials: "include" }
|
|
111
|
-
);
|
|
112
|
-
const data = response.data ?? response;
|
|
113
|
-
if (data && Array.isArray(data)) {
|
|
114
|
-
provinces.value = data.filter((p) => p.is_active === true).map((p) => ({
|
|
115
|
-
value: String(p.id),
|
|
116
|
-
label: p.name_th,
|
|
117
|
-
image_cover_url: p.image_cover_url ?? null,
|
|
118
|
-
domain: p.domain ?? null
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.error("Failed to fetch provinces:", error);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
108
|
const selectedLabel = computed(() => {
|
|
126
|
-
|
|
127
|
-
return found?.label || "";
|
|
109
|
+
return modelValue.value?.name_th || "";
|
|
128
110
|
});
|
|
129
111
|
const filteredProvinces = computed(() => {
|
|
130
|
-
if (!search.value) return
|
|
112
|
+
if (!search.value) return props.items;
|
|
131
113
|
const query = search.value.toLowerCase();
|
|
132
|
-
return
|
|
114
|
+
return props.items.filter((p) => p.name_th.toLowerCase().includes(query));
|
|
133
115
|
});
|
|
134
|
-
const selectProvince = (
|
|
135
|
-
modelValue.value =
|
|
116
|
+
const selectProvince = (province) => {
|
|
117
|
+
modelValue.value = province;
|
|
136
118
|
open.value = false;
|
|
137
|
-
|
|
138
|
-
if (selected?.domain) {
|
|
139
|
-
const url = selected.domain.startsWith("http") ? selected.domain : `https://${selected.domain}`;
|
|
140
|
-
window.location.href = url;
|
|
141
|
-
}
|
|
119
|
+
emit("select", province);
|
|
142
120
|
};
|
|
143
|
-
onMounted(() => {
|
|
144
|
-
fetchProvinces();
|
|
145
|
-
});
|
|
146
121
|
</script>
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
interface Province {
|
|
2
|
+
id: number;
|
|
3
|
+
name_th: string;
|
|
4
|
+
name_en: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
image_cover_url: string | null;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
items?: Province[];
|
|
10
|
+
itemsPopular?: Province[];
|
|
11
|
+
};
|
|
1
12
|
type __VLS_ModelProps = {
|
|
2
|
-
modelValue?:
|
|
13
|
+
modelValue?: Province;
|
|
3
14
|
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
}
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
select: (province: Province) => any;
|
|
18
|
+
"update:modelValue": (value: Province | undefined) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
onSelect?: ((province: Province) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: Province | undefined) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
items: Province[];
|
|
24
|
+
itemsPopular: Province[];
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
26
|
declare const _default: typeof __VLS_export;
|
|
10
27
|
export default _default;
|
|
@@ -45,11 +45,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
45
45
|
name: string;
|
|
46
46
|
disabled: boolean;
|
|
47
47
|
limit: number;
|
|
48
|
-
resize: "none" | "both" | "horizontal" | "vertical";
|
|
49
48
|
disabledErrorMessage: boolean;
|
|
50
49
|
disabledBorder: boolean;
|
|
51
50
|
showCounter: boolean;
|
|
52
51
|
readonly: boolean;
|
|
52
|
+
resize: "none" | "both" | "horizontal" | "vertical";
|
|
53
53
|
rows: number;
|
|
54
54
|
heightScroll: boolean;
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -45,11 +45,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
45
45
|
name: string;
|
|
46
46
|
disabled: boolean;
|
|
47
47
|
limit: number;
|
|
48
|
-
resize: "none" | "both" | "horizontal" | "vertical";
|
|
49
48
|
disabledErrorMessage: boolean;
|
|
50
49
|
disabledBorder: boolean;
|
|
51
50
|
showCounter: boolean;
|
|
52
51
|
readonly: boolean;
|
|
52
|
+
resize: "none" | "both" | "horizontal" | "vertical";
|
|
53
53
|
rows: number;
|
|
54
54
|
heightScroll: boolean;
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -59,7 +59,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
59
59
|
'aria-colindex'?: (string | number) | undefined;
|
|
60
60
|
'aria-colspan'?: (string | number) | undefined;
|
|
61
61
|
'aria-controls'?: string | undefined | undefined;
|
|
62
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
62
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
63
63
|
'aria-describedby'?: string | undefined | undefined;
|
|
64
64
|
'aria-details'?: string | undefined | undefined;
|
|
65
65
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -253,7 +253,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
253
253
|
'aria-colindex'?: (string | number) | undefined;
|
|
254
254
|
'aria-colspan'?: (string | number) | undefined;
|
|
255
255
|
'aria-controls'?: string | undefined | undefined;
|
|
256
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
256
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
257
257
|
'aria-describedby'?: string | undefined | undefined;
|
|
258
258
|
'aria-details'?: string | undefined | undefined;
|
|
259
259
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -59,7 +59,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
59
59
|
'aria-colindex'?: (string | number) | undefined;
|
|
60
60
|
'aria-colspan'?: (string | number) | undefined;
|
|
61
61
|
'aria-controls'?: string | undefined | undefined;
|
|
62
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
62
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
63
63
|
'aria-describedby'?: string | undefined | undefined;
|
|
64
64
|
'aria-details'?: string | undefined | undefined;
|
|
65
65
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -253,7 +253,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
253
253
|
'aria-colindex'?: (string | number) | undefined;
|
|
254
254
|
'aria-colspan'?: (string | number) | undefined;
|
|
255
255
|
'aria-controls'?: string | undefined | undefined;
|
|
256
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
256
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
257
257
|
'aria-describedby'?: string | undefined | undefined;
|
|
258
258
|
'aria-details'?: string | undefined | undefined;
|
|
259
259
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -61,7 +61,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
61
61
|
'aria-colindex'?: (string | number) | undefined;
|
|
62
62
|
'aria-colspan'?: (string | number) | undefined;
|
|
63
63
|
'aria-controls'?: string | undefined | undefined;
|
|
64
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
64
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
65
65
|
'aria-describedby'?: string | undefined | undefined;
|
|
66
66
|
'aria-details'?: string | undefined | undefined;
|
|
67
67
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -257,7 +257,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
257
257
|
'aria-colindex'?: (string | number) | undefined;
|
|
258
258
|
'aria-colspan'?: (string | number) | undefined;
|
|
259
259
|
'aria-controls'?: string | undefined | undefined;
|
|
260
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
260
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
261
261
|
'aria-describedby'?: string | undefined | undefined;
|
|
262
262
|
'aria-details'?: string | undefined | undefined;
|
|
263
263
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -61,7 +61,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
61
61
|
'aria-colindex'?: (string | number) | undefined;
|
|
62
62
|
'aria-colspan'?: (string | number) | undefined;
|
|
63
63
|
'aria-controls'?: string | undefined | undefined;
|
|
64
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
64
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
65
65
|
'aria-describedby'?: string | undefined | undefined;
|
|
66
66
|
'aria-details'?: string | undefined | undefined;
|
|
67
67
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -257,7 +257,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
257
257
|
'aria-colindex'?: (string | number) | undefined;
|
|
258
258
|
'aria-colspan'?: (string | number) | undefined;
|
|
259
259
|
'aria-controls'?: string | undefined | undefined;
|
|
260
|
-
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "
|
|
260
|
+
'aria-current'?: "time" | "page" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
261
261
|
'aria-describedby'?: string | undefined | undefined;
|
|
262
262
|
'aria-details'?: string | undefined | undefined;
|
|
263
263
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|