pukaad-ui-lib 1.313.0 → 1.314.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.313.0",
4
+ "version": "1.314.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
+ background: boolean;
68
+ modal: boolean;
67
69
  responsive: boolean;
68
70
  restore: boolean;
69
71
  checkCrossOrigin: boolean;
70
72
  checkOrientation: boolean;
71
73
  crossorigin: "" | "anonymous" | "use-credentials";
72
- modal: boolean;
73
74
  guides: boolean;
74
75
  highlight: boolean;
75
- background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -49,11 +49,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
49
49
  label: string;
50
50
  required: boolean;
51
51
  name: string;
52
- gap: string;
53
52
  placeholder: string;
54
53
  labelDetail: string;
55
54
  placeholderDetail: string;
56
55
  requiredDetail: boolean;
56
+ gap: string;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
58
  declare const _default: typeof __VLS_export;
59
59
  export default _default;
@@ -49,11 +49,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
49
49
  label: string;
50
50
  required: boolean;
51
51
  name: string;
52
- gap: string;
53
52
  placeholder: string;
54
53
  labelDetail: string;
55
54
  placeholderDetail: string;
56
55
  requiredDetail: boolean;
56
+ gap: string;
57
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
58
  declare const _default: typeof __VLS_export;
59
59
  export default _default;
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  name: string;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
41
41
  disabledDrop: boolean;
42
42
  column: boolean;
@@ -35,8 +35,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
35
  fullHeight: boolean;
36
36
  name: string;
37
37
  limit: number;
38
- accept: string;
39
38
  disabledErrorMessage: boolean;
39
+ accept: string;
40
40
  labelIcon: string;
41
41
  disabledDrop: boolean;
42
42
  column: boolean;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
22
22
  }>, {
23
23
  id: string;
24
24
  name: string;
25
- disabledForgotPassword: boolean;
26
25
  new: boolean;
26
+ disabledForgotPassword: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -1,41 +1,10 @@
1
1
  <template>
2
- <div class="inline-flex items-center gap-0">
3
- <svg
4
- v-for="n in 5"
5
- :key="n"
6
- :width="props.size"
7
- :height="props.size"
8
- viewBox="4 2 16.42 20.21"
9
- xmlns="http://www.w3.org/2000/svg"
10
- :style="{
11
- cursor: props.readonly ? 'default' : 'pointer',
12
- marginRight: n < 5 ? '2px' : '0'
13
- }"
14
- @click="!props.readonly && onSelect(n)"
15
- >
16
- <defs>
17
- <!-- ใช้ clipPath แทน linearGradient เพื่อหลีกเลี่ยง Vue set offset บน SVGStopElement (read-only property) -->
18
- <clipPath :id="`star-clip-${uid}-${n}`" clipPathUnits="objectBoundingBox">
19
- <rect x="0" y="0" :width="getFill(n) / 100" height="1" />
20
- </clipPath>
21
- </defs>
22
- <!-- ดาวพื้นหลัง (สีเทา) -->
23
- <polygon
24
- points="12,17.27,16.15,19.78,17.64,18.7,16.54,13.98,20.21,10.8,19.64,9.05,14.81,8.64,12.92,4.18,11.08,4.18,9.19,8.63,4.36,9.04,3.79,10.8,7.46,13.98,6.36,18.7,7.85,19.78,12,17.27"
25
- :fill="props.backgroundColor"
26
- :stroke="props.borderSize > 0 ? props.borderColor : 'none'"
27
- :stroke-width="props.borderSize"
28
- stroke-linejoin="round"
29
- />
30
- <!-- ดาว active (clip ตาม % ที่เติม) -->
31
- <polygon
32
- points="12,17.27,16.15,19.78,17.64,18.7,16.54,13.98,20.21,10.8,19.64,9.05,14.81,8.64,12.92,4.18,11.08,4.18,9.19,8.63,4.36,9.04,3.79,10.8,7.46,13.98,6.36,18.7,7.85,19.78,12,17.27"
33
- :fill="props.activeColor"
34
- :clip-path="`url(#star-clip-${uid}-${n})`"
35
- stroke="none"
36
- />
37
- </svg>
38
- </div>
2
+ <!-- v-html เพื่อหลีกเลี่ยง Vue patch SVG attributes เป็น DOM property (read-only getter bug) -->
3
+ <div
4
+ class="inline-flex items-center gap-0"
5
+ v-html="starsHtml"
6
+ @click="handleClick"
7
+ />
39
8
  </template>
40
9
 
41
10
  <script setup>
@@ -59,8 +28,33 @@ const getFill = (n) => {
59
28
  if (val < n - 1) return 0;
60
29
  return Math.round((val - (n - 1)) * 100);
61
30
  };
62
- const onSelect = (value) => {
63
- emit("update:modelValue", value);
64
- emit("select", value);
31
+ const POINTS = "12,17.27,16.15,19.78,17.64,18.7,16.54,13.98,20.21,10.8,19.64,9.05,14.81,8.64,12.92,4.18,11.08,4.18,9.19,8.63,4.36,9.04,3.79,10.8,7.46,13.98,6.36,18.7,7.85,19.78,12,17.27";
32
+ const starsHtml = computed(
33
+ () => Array.from({ length: 5 }, (_, i) => {
34
+ const n = i + 1;
35
+ const w = getFill(n) / 100;
36
+ const cursor = props.readonly ? "default" : "pointer";
37
+ const margin = n < 5 ? "margin-right:2px" : "";
38
+ const stroke = props.borderSize > 0 ? `stroke="${props.borderColor}" stroke-width="${props.borderSize}" stroke-linejoin="round"` : `stroke="none"`;
39
+ return `<svg width="${props.size}" height="${props.size}" viewBox="4 2 16.42 20.21" xmlns="http://www.w3.org/2000/svg" style="cursor:${cursor};${margin}" data-star="${n}">
40
+ <defs>
41
+ <clipPath id="sc-${uid}-${n}" clipPathUnits="objectBoundingBox">
42
+ <rect x="0" y="0" width="${w}" height="1"/>
43
+ </clipPath>
44
+ </defs>
45
+ <polygon points="${POINTS}" fill="${props.backgroundColor}" ${stroke}/>
46
+ <polygon points="${POINTS}" fill="${props.activeColor}" clip-path="url(#sc-${uid}-${n})" stroke="none"/>
47
+ </svg>`;
48
+ }).join("")
49
+ );
50
+ const handleClick = (e) => {
51
+ if (props.readonly) return;
52
+ const svg = e.target.closest("svg[data-star]");
53
+ if (!svg) return;
54
+ const n = Number(svg.getAttribute("data-star"));
55
+ if (n >= 1 && n <= 5) {
56
+ emit("update:modelValue", n);
57
+ emit("select", n);
58
+ }
65
59
  };
66
60
  </script>
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  }) => any) | undefined;
25
25
  }>, {
26
26
  title: string;
27
- confirmText: string;
28
27
  disabledForgotPassword: boolean;
28
+ confirmText: string;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
30
  declare const _default: typeof __VLS_export;
31
31
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
32
32
  }>, {
33
33
  title: string;
34
34
  mode: "login" | "secure";
35
- confirmText: string;
36
35
  disabledForgotPassword: boolean;
36
+ confirmText: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const _default: typeof __VLS_export;
39
39
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.313.0",
3
+ "version": "1.314.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",