pukaad-ui-lib 1.341.0 → 1.342.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.341.0",
4
+ "version": "1.342.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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;--error:var(--red);--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}}
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}}
@@ -50,8 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  required: boolean;
51
51
  options: AutocompleteOption[] | string[] | number[];
52
52
  description: string;
53
- labelKey: string;
54
53
  limit: number;
54
+ labelKey: string;
55
55
  placeholder: string;
56
56
  disabledErrorMessage: boolean;
57
57
  disabledBorder: boolean;
@@ -50,8 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
50
50
  required: boolean;
51
51
  options: AutocompleteOption[] | string[] | number[];
52
52
  description: string;
53
- labelKey: string;
54
53
  limit: number;
54
+ labelKey: string;
55
55
  placeholder: string;
56
56
  disabledErrorMessage: boolean;
57
57
  disabledBorder: boolean;
@@ -55,8 +55,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
55
55
  }>, {
56
56
  pageSize: number;
57
57
  name: string;
58
- labelKey: string;
59
58
  limit: number;
59
+ labelKey: string;
60
60
  valueKey: string;
61
61
  multiple: boolean;
62
62
  placeholderSearch: string;
@@ -55,8 +55,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
55
55
  }>, {
56
56
  pageSize: number;
57
57
  name: string;
58
- labelKey: string;
59
58
  limit: number;
59
+ labelKey: string;
60
60
  valueKey: string;
61
61
  multiple: boolean;
62
62
  placeholderSearch: string;
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
20
20
  name: string;
21
21
  required: boolean;
22
22
  description: string;
23
- labelKey: string;
24
23
  limit: number;
24
+ labelKey: string;
25
25
  placeholder: string;
26
26
  disabledErrorMessage: boolean;
27
27
  disabledBorder: boolean;
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
20
20
  name: string;
21
21
  required: boolean;
22
22
  description: string;
23
- labelKey: string;
24
23
  limit: number;
24
+ labelKey: string;
25
25
  placeholder: string;
26
26
  disabledErrorMessage: boolean;
27
27
  disabledBorder: boolean;
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
46
46
  resize: "none" | "both" | "horizontal" | "vertical";
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
- rows: number;
50
49
  limit: number;
50
+ rows: number;
51
51
  disabledErrorMessage: boolean;
52
52
  disabledBorder: boolean;
53
53
  showCounter: boolean;
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
46
46
  resize: "none" | "both" | "horizontal" | "vertical";
47
47
  fullHeight: boolean;
48
48
  fullWidth: boolean;
49
- rows: number;
50
49
  limit: number;
50
+ rows: number;
51
51
  disabledErrorMessage: boolean;
52
52
  disabledBorder: boolean;
53
53
  showCounter: boolean;
@@ -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
- confirmed: (value: string) => any;
11
+ confirmed: (province: Province) => any;
11
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
13
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
- onConfirmed?: ((value: string) => any) | undefined;
14
+ onConfirmed?: ((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
- :column-gap="24"
4
+ description="เลือกจังหวัดที่คุณต้องการจัดการข้อมูลธุรกิจ
5
+ เพื่อให้เข้าถึงเครื่องมือและข้อมูลในพื้นที่ได้ถูกต้อง"
6
+ class="w-[425px]"
5
7
  v-model="modelValue"
6
8
  >
7
- <div class="flex flex-col gap-[16px] w-full">
8
- <div class="flex flex-col font-body-large text-center">
9
- <div>เลือกจังหวัดที่คุณต้องการจัดการข้อมูลธุรกิจ</div>
10
- <div>เพื่อให้เข้าถึงเครื่องมือและข้อมูลในพื้นที่ได้ถูกต้อง</div>
11
- </div>
12
- <InputAutocomplete
13
- :items="provinces"
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 full-width color="primary" :disabled="!selected" @click="onNext">
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";
30
+ import { ref, computed, onMounted } from "vue";
31
+ import {
32
+ useThaiAddress
33
+ } from "#pukaad-ui/runtime/composables/useThaiAddress";
29
34
  const emit = defineEmits(["confirmed"]);
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 provinces = ref([
35
- {
36
- label: "\u0E01\u0E23\u0E38\u0E07\u0E40\u0E17\u0E1E\u0E21\u0E2B\u0E32\u0E19\u0E04\u0E23",
37
- value: "https://www.someting_eie.com"
38
- },
39
- {
40
- label: "\u0E1A\u0E38\u0E23\u0E35\u0E23\u0E31\u0E21\u0E22\u0E4C",
41
- value: "https://www.someting_eie.com"
42
- },
43
- {
44
- label: "\u0E01\u0E23\u0E30\u0E1A\u0E35\u0E48",
45
- value: "\u0E01\u0E23\u0E30\u0E1A\u0E35\u0E48"
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
- emit("confirmed", selected.value);
57
+ const province = activeProvinces.value.find(
58
+ (p) => String(p.id) === selected.value
59
+ );
60
+ if (!province) return;
61
+ emit("confirmed", 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
- confirmed: (value: string) => any;
11
+ confirmed: (province: Province) => any;
11
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
13
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
- onConfirmed?: ((value: string) => any) | undefined;
14
+ onConfirmed?: ((province: Province) => any) | undefined;
14
15
  }>, {
15
16
  confirmedText: string;
16
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,4 @@
1
+ import type { Province } from "./useThaiAddress.js";
2
+ export declare function useProvinceRedirect(): {
3
+ goToProvinceDomain: (province: Province, path?: string) => any;
4
+ };
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.341.0",
3
+ "version": "1.342.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",