pukaad-ui-lib 1.85.0 → 1.87.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.85.0",
4
+ "version": "1.87.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -81,7 +81,7 @@ const module$1 = defineNuxtModule({
81
81
  addPlugin(resolver.resolve("./runtime/plugins/loadingPage"));
82
82
  addPlugin(resolver.resolve("./runtime/plugins/alert"));
83
83
  addPlugin(resolver.resolve("./runtime/plugins/toast"));
84
- addPlugin(resolver.resolve("./runtime/plugins/format"));
84
+ addPlugin(resolver.resolve("./runtime/plugins/convert"));
85
85
  addPlugin(resolver.resolve("./runtime/plugins/quill.client"));
86
86
  _nuxt.hook("nitro:config", (nitroConfig) => {
87
87
  nitroConfig.publicAssets ||= [];
@@ -156,5 +156,5 @@ onUnmounted(() => {
156
156
  </script>
157
157
 
158
158
  <style scoped>
159
- .quill-wrapper{border-bottom:1px solid #e8e8e8}.quill-wrapper :deep(.ql-toolbar.ql-snow){background-color:#f5f5f5;border:none;border-radius:8px}.quill-wrapper :deep(.ql-container.ql-snow){border:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px;overflow:hidden}.quill-wrapper :deep(.ql-editor){font-family:Sarabun-Regular;font-size:16px;margin-top:8px;min-height:var(--height)!important;padding:4px 12px}.quill-wrapper :deep(.ql-editor.ql-blank:before){color:#c4c4c4;content:attr(data-placeholder);font-size:16px;font-style:normal}.quill-wrapper.drag-not-allowed :deep(.ql-editor){background-color:#fef2f2;border:2px dashed #ef4444;cursor:not-allowed}
159
+ .quill-wrapper{border-bottom:1px solid #e8e8e8}.quill-wrapper :deep(.ql-toolbar.ql-snow){background-color:#f5f5f5;border:none;border-radius:8px}.quill-wrapper :deep(.ql-container.ql-snow){border:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px;overflow:hidden}.quill-wrapper :deep(.ql-editor){font-family:Sarabun-Regular;font-size:16px;margin-top:8px;max-height:var(--height)!important;min-height:var(--height)!important;overflow-y:auto;padding:4px 12px}.quill-wrapper :deep(.ql-editor.ql-blank:before){color:#c4c4c4;content:attr(data-placeholder);font-size:16px;font-style:normal}.quill-wrapper.drag-not-allowed :deep(.ql-editor){background-color:#fef2f2;border:2px dashed #ef4444;cursor:not-allowed}
160
160
  </style>
@@ -27,8 +27,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
27
27
  label: string;
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
  label: string;
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>;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  }>, {
19
19
  id: string;
20
20
  name: string;
21
- disabledForgotPassword: boolean;
22
21
  new: boolean;
22
+ disabledForgotPassword: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
18
18
  }>, {
19
19
  id: string;
20
20
  name: string;
21
- disabledForgotPassword: boolean;
22
21
  new: boolean;
22
+ disabledForgotPassword: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  export default _default;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  color: InputSliderColor;
13
13
  fullWidth: boolean;
14
14
  label: string;
15
- step: number;
16
15
  max: number;
17
16
  min: number;
17
+ step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -12,9 +12,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  color: InputSliderColor;
13
13
  fullWidth: boolean;
14
14
  label: string;
15
- step: number;
16
15
  max: number;
17
16
  min: number;
17
+ step: number;
18
18
  lineHeight: number | string;
19
19
  appearance: boolean;
20
20
  thumbSize: number | string;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  onClose?: (() => 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
  onClose?: (() => 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;
@@ -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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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") | "date" | "step" | "location" | undefined;
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;
@@ -0,0 +1,34 @@
1
+ import "dayjs/locale/th";
2
+ export declare class Convert {
3
+ /**
4
+ * Convert date to Thai Buddhist Era
5
+ * @example convertDate("2026-01-20") => "20 มกราคม 2569"
6
+ */
7
+ convertDate(date: string | Date | null | undefined): string;
8
+ /**
9
+ * Convert datetime to Thai Buddhist Era with comma separator
10
+ * @example convertDateTime("2026-01-20T13:30:00") => "20 มกราคม 2569, 13:30 น."
11
+ */
12
+ convertDateTime(date: string | Date | null | undefined): string;
13
+ /**
14
+ * Convert date to short format
15
+ * @example convertShortDate("2026-01-20") => "20/01/69"
16
+ */
17
+ convertShortDate(date: string | Date | null | undefined): string;
18
+ /**
19
+ * Convert time only
20
+ * @example convertTime("2026-01-20T13:30:00") => "13:30 น."
21
+ */
22
+ convertTime(date: string | Date | null | undefined): string;
23
+ /**
24
+ * Convert number to Thai format
25
+ * @example convertNumber(1500000) => "1.5 ล้าน"
26
+ */
27
+ convertNumber(num: number): string;
28
+ }
29
+ declare const _default: import("nuxt/app").Plugin<{
30
+ convert: Convert;
31
+ }> & import("nuxt/app").ObjectPlugin<{
32
+ convert: Convert;
33
+ }>;
34
+ export default _default;
@@ -0,0 +1,78 @@
1
+ import { defineNuxtPlugin } from "nuxt/app";
2
+ import dayjs from "dayjs";
3
+ import buddhistEra from "dayjs/plugin/buddhistEra";
4
+ import "dayjs/locale/th";
5
+ dayjs.extend(buddhistEra);
6
+ dayjs.locale("th");
7
+ export class Convert {
8
+ /**
9
+ * Convert date to Thai Buddhist Era
10
+ * @example convertDate("2026-01-20") => "20 มกราคม 2569"
11
+ */
12
+ convertDate(date) {
13
+ if (!date) return "-";
14
+ const d = dayjs(date);
15
+ if (!d.isValid()) return "-";
16
+ return d.format("D MMMM BBBB");
17
+ }
18
+ /**
19
+ * Convert datetime to Thai Buddhist Era with comma separator
20
+ * @example convertDateTime("2026-01-20T13:30:00") => "20 มกราคม 2569, 13:30 น."
21
+ */
22
+ convertDateTime(date) {
23
+ if (!date) return "-";
24
+ const d = dayjs(date);
25
+ if (!d.isValid()) return "-";
26
+ return d.format("D MMMM BBBB, HH:mm \u0E19.");
27
+ }
28
+ /**
29
+ * Convert date to short format
30
+ * @example convertShortDate("2026-01-20") => "20/01/69"
31
+ */
32
+ convertShortDate(date) {
33
+ if (!date) return "-";
34
+ const d = dayjs(date);
35
+ if (!d.isValid()) return "-";
36
+ return d.format("DD/MM/BB");
37
+ }
38
+ /**
39
+ * Convert time only
40
+ * @example convertTime("2026-01-20T13:30:00") => "13:30 น."
41
+ */
42
+ convertTime(date) {
43
+ if (!date) return "-";
44
+ const d = dayjs(date);
45
+ if (!d.isValid()) return "-";
46
+ return d.format("HH:mm \u0E19.");
47
+ }
48
+ /**
49
+ * Convert number to Thai format
50
+ * @example convertNumber(1500000) => "1.5 ล้าน"
51
+ */
52
+ convertNumber(num) {
53
+ if (num >= 1e6) {
54
+ const value = Math.floor(num / 1e6 * 10) / 10;
55
+ return value.toString().replace(/\.0$/, "") + " \u0E25\u0E49\u0E32\u0E19";
56
+ }
57
+ if (num >= 1e5) {
58
+ const value = Math.floor(num / 1e5 * 10) / 10;
59
+ return value.toString().replace(/\.0$/, "") + " \u0E41\u0E2A\u0E19";
60
+ }
61
+ if (num >= 1e4) {
62
+ const value = Math.floor(num / 1e4 * 10) / 10;
63
+ return value.toString().replace(/\.0$/, "") + " \u0E2B\u0E21\u0E37\u0E48\u0E19";
64
+ }
65
+ if (num >= 1e3) {
66
+ const value = Math.floor(num / 1e3 * 10) / 10;
67
+ return value.toString().replace(/\.0$/, "") + " \u0E1E\u0E31\u0E19";
68
+ }
69
+ return num.toString();
70
+ }
71
+ }
72
+ export default defineNuxtPlugin(() => {
73
+ return {
74
+ provide: {
75
+ convert: new Convert()
76
+ }
77
+ };
78
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.85.0",
3
+ "version": "1.87.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,9 +0,0 @@
1
- export declare class Format {
2
- number(num: number): string;
3
- }
4
- declare const _default: import("nuxt/app").Plugin<{
5
- format: Format;
6
- }> & import("nuxt/app").ObjectPlugin<{
7
- format: Format;
8
- }>;
9
- export default _default;
@@ -1,29 +0,0 @@
1
- import { defineNuxtPlugin } from "nuxt/app";
2
- export class Format {
3
- number(num) {
4
- if (num >= 1e6) {
5
- const value = Math.floor(num / 1e6 * 10) / 10;
6
- return value.toString().replace(/\.0$/, "") + " \u0E25\u0E49\u0E32\u0E19";
7
- }
8
- if (num >= 1e5) {
9
- const value = Math.floor(num / 1e5 * 10) / 10;
10
- return value.toString().replace(/\.0$/, "") + " \u0E41\u0E2A\u0E19";
11
- }
12
- if (num >= 1e4) {
13
- const value = Math.floor(num / 1e4 * 10) / 10;
14
- return value.toString().replace(/\.0$/, "") + " \u0E2B\u0E21\u0E37\u0E48\u0E19";
15
- }
16
- if (num >= 1e3) {
17
- const value = Math.floor(num / 1e3 * 10) / 10;
18
- return value.toString().replace(/\.0$/, "") + " \u0E1E\u0E31\u0E19";
19
- }
20
- return num.toString();
21
- }
22
- }
23
- export default defineNuxtPlugin(() => {
24
- return {
25
- provide: {
26
- format: new Format()
27
- }
28
- };
29
- });