pukaad-ui-lib 1.7.0 → 1.8.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-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-select-province.vue +35 -17
- package/dist/runtime/components/ui/card/Card.vue +3 -6
- package/dist/runtime/components/ui/command/index.d.ts +0 -6
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
36
36
|
id: string;
|
|
37
37
|
name: string;
|
|
38
38
|
description: string;
|
|
39
|
+
limit: number;
|
|
39
40
|
options: AutocompleteOption[] | string[] | number[];
|
|
40
41
|
placeholder: string;
|
|
41
|
-
limit: number;
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
44
44
|
showCounter: boolean;
|
|
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
36
36
|
id: string;
|
|
37
37
|
name: string;
|
|
38
38
|
description: string;
|
|
39
|
+
limit: number;
|
|
39
40
|
options: AutocompleteOption[] | string[] | number[];
|
|
40
41
|
placeholder: string;
|
|
41
|
-
limit: number;
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
44
44
|
showCounter: boolean;
|
|
@@ -30,23 +30,35 @@
|
|
|
30
30
|
@click="selectProvince(province.value)"
|
|
31
31
|
>
|
|
32
32
|
<Card
|
|
33
|
-
class="
|
|
33
|
+
class="relative overflow-hidden bg-mercury w-[140px] h-[180px]"
|
|
34
34
|
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
<!-- No image state -->
|
|
36
|
+
<template v-if="province.image_cover_url === null">
|
|
37
|
+
<div class="font-medium">
|
|
38
|
+
{{ province.label }}
|
|
39
|
+
</div>
|
|
40
|
+
<div
|
|
41
|
+
class="flex flex-col items-center justify-center gap-[4px] h-full mt-2"
|
|
42
|
+
>
|
|
43
|
+
<Icon name="lucide:image" size="28" />
|
|
44
|
+
<div class="text-gray">ไม่มีรูป</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<!-- Has image state -->
|
|
49
|
+
<template v-else>
|
|
50
|
+
<img
|
|
51
|
+
:src="
|
|
52
|
+
province.image_cover_url || 'https://placehold.co/140x180?text=Place+Photo'
|
|
53
|
+
"
|
|
54
|
+
class="w-[140px] h-[180px] object-cover"
|
|
55
|
+
/>
|
|
56
|
+
<div
|
|
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
|
+
>
|
|
59
|
+
{{ province.label }}
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
50
62
|
</Card>
|
|
51
63
|
</ShadCarouselItem>
|
|
52
64
|
</ShadCarouselContent>
|
|
@@ -101,7 +113,8 @@ const fetchProvinces = async () => {
|
|
|
101
113
|
provinces.value = data.filter((p) => p.is_active === true).map((p) => ({
|
|
102
114
|
value: String(p.id),
|
|
103
115
|
label: p.name_th,
|
|
104
|
-
image_cover_url: p.image_cover_url ?? null
|
|
116
|
+
image_cover_url: p.image_cover_url ?? null,
|
|
117
|
+
domain: p.domain ?? null
|
|
105
118
|
}));
|
|
106
119
|
}
|
|
107
120
|
} catch (error) {
|
|
@@ -115,6 +128,11 @@ const selectedLabel = computed(() => {
|
|
|
115
128
|
const selectProvince = (value) => {
|
|
116
129
|
modelValue.value = value;
|
|
117
130
|
open.value = false;
|
|
131
|
+
const selected = provinces.value.find((p) => p.value === value);
|
|
132
|
+
if (selected?.domain) {
|
|
133
|
+
const url = selected.domain.startsWith("http") ? selected.domain : `https://${selected.domain}`;
|
|
134
|
+
window.location.href = url;
|
|
135
|
+
}
|
|
118
136
|
};
|
|
119
137
|
onMounted(() => {
|
|
120
138
|
fetchProvinces();
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Form v-slot="{ meta }" @submit="onSubmit">
|
|
3
|
-
<div
|
|
4
|
-
data-slot="card"
|
|
5
|
-
:class="
|
|
3
|
+
<div data-slot="card" :class="
|
|
6
4
|
cn(
|
|
7
|
-
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl
|
|
5
|
+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-4',
|
|
8
6
|
props.class
|
|
9
7
|
)
|
|
10
|
-
"
|
|
11
|
-
>
|
|
8
|
+
">
|
|
12
9
|
<slot name="default" :meta="meta" />
|
|
13
10
|
</div>
|
|
14
11
|
</Form>
|
|
@@ -19,7 +19,6 @@ export declare const useCommand: <T extends {
|
|
|
19
19
|
groups: Set<string>;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
modelValue: Ref<unknown>;
|
|
23
22
|
} | null | undefined = {
|
|
24
23
|
allItems: Ref<Map<string, string>>;
|
|
25
24
|
allGroups: Ref<Map<string, Set<string>>>;
|
|
@@ -31,7 +30,6 @@ export declare const useCommand: <T extends {
|
|
|
31
30
|
groups: Set<string>;
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
|
-
modelValue: Ref<unknown>;
|
|
35
33
|
}>(fallback?: T | undefined) => T extends null ? {
|
|
36
34
|
allItems: Ref<Map<string, string>>;
|
|
37
35
|
allGroups: Ref<Map<string, Set<string>>>;
|
|
@@ -43,7 +41,6 @@ export declare const useCommand: <T extends {
|
|
|
43
41
|
groups: Set<string>;
|
|
44
42
|
};
|
|
45
43
|
};
|
|
46
|
-
modelValue: Ref<unknown>;
|
|
47
44
|
} | null : {
|
|
48
45
|
allItems: Ref<Map<string, string>>;
|
|
49
46
|
allGroups: Ref<Map<string, Set<string>>>;
|
|
@@ -55,7 +52,6 @@ export declare const useCommand: <T extends {
|
|
|
55
52
|
groups: Set<string>;
|
|
56
53
|
};
|
|
57
54
|
};
|
|
58
|
-
modelValue: Ref<unknown>;
|
|
59
55
|
}, provideCommandContext: (contextValue: {
|
|
60
56
|
allItems: Ref<Map<string, string>>;
|
|
61
57
|
allGroups: Ref<Map<string, Set<string>>>;
|
|
@@ -67,7 +63,6 @@ export declare const useCommand: <T extends {
|
|
|
67
63
|
groups: Set<string>;
|
|
68
64
|
};
|
|
69
65
|
};
|
|
70
|
-
modelValue: Ref<unknown>;
|
|
71
66
|
}) => {
|
|
72
67
|
allItems: Ref<Map<string, string>>;
|
|
73
68
|
allGroups: Ref<Map<string, Set<string>>>;
|
|
@@ -79,7 +74,6 @@ export declare const useCommand: <T extends {
|
|
|
79
74
|
groups: Set<string>;
|
|
80
75
|
};
|
|
81
76
|
};
|
|
82
|
-
modelValue: Ref<unknown>;
|
|
83
77
|
};
|
|
84
78
|
export declare const useCommandGroup: <T extends {
|
|
85
79
|
id?: string;
|