pukaad-ui-lib 1.86.0 → 1.88.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.86.0",
4
+ "version": "1.88.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 ||= [];
@@ -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;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  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;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -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,79 @@
1
+ import { defineNuxtPlugin } from "nuxt/app";
2
+ import dayjs from "dayjs";
3
+ import * as buddhistEraPlugin from "dayjs/plugin/buddhistEra";
4
+ import "dayjs/locale/th";
5
+ const buddhistEra = buddhistEraPlugin.default || buddhistEraPlugin;
6
+ dayjs.extend(buddhistEra);
7
+ dayjs.locale("th");
8
+ export class Convert {
9
+ /**
10
+ * Convert date to Thai Buddhist Era
11
+ * @example convertDate("2026-01-20") => "20 มกราคม 2569"
12
+ */
13
+ convertDate(date) {
14
+ if (!date) return "-";
15
+ const d = dayjs(date);
16
+ if (!d.isValid()) return "-";
17
+ return d.format("D MMMM BBBB");
18
+ }
19
+ /**
20
+ * Convert datetime to Thai Buddhist Era with comma separator
21
+ * @example convertDateTime("2026-01-20T13:30:00") => "20 มกราคม 2569, 13:30 น."
22
+ */
23
+ convertDateTime(date) {
24
+ if (!date) return "-";
25
+ const d = dayjs(date);
26
+ if (!d.isValid()) return "-";
27
+ return d.format("D MMMM BBBB, HH:mm \u0E19.");
28
+ }
29
+ /**
30
+ * Convert date to short format
31
+ * @example convertShortDate("2026-01-20") => "20/01/69"
32
+ */
33
+ convertShortDate(date) {
34
+ if (!date) return "-";
35
+ const d = dayjs(date);
36
+ if (!d.isValid()) return "-";
37
+ return d.format("DD/MM/BB");
38
+ }
39
+ /**
40
+ * Convert time only
41
+ * @example convertTime("2026-01-20T13:30:00") => "13:30 น."
42
+ */
43
+ convertTime(date) {
44
+ if (!date) return "-";
45
+ const d = dayjs(date);
46
+ if (!d.isValid()) return "-";
47
+ return d.format("HH:mm \u0E19.");
48
+ }
49
+ /**
50
+ * Convert number to Thai format
51
+ * @example convertNumber(1500000) => "1.5 ล้าน"
52
+ */
53
+ convertNumber(num) {
54
+ if (num >= 1e6) {
55
+ const value = Math.floor(num / 1e6 * 10) / 10;
56
+ return value.toString().replace(/\.0$/, "") + " \u0E25\u0E49\u0E32\u0E19";
57
+ }
58
+ if (num >= 1e5) {
59
+ const value = Math.floor(num / 1e5 * 10) / 10;
60
+ return value.toString().replace(/\.0$/, "") + " \u0E41\u0E2A\u0E19";
61
+ }
62
+ if (num >= 1e4) {
63
+ const value = Math.floor(num / 1e4 * 10) / 10;
64
+ return value.toString().replace(/\.0$/, "") + " \u0E2B\u0E21\u0E37\u0E48\u0E19";
65
+ }
66
+ if (num >= 1e3) {
67
+ const value = Math.floor(num / 1e3 * 10) / 10;
68
+ return value.toString().replace(/\.0$/, "") + " \u0E1E\u0E31\u0E19";
69
+ }
70
+ return num.toString();
71
+ }
72
+ }
73
+ export default defineNuxtPlugin(() => {
74
+ return {
75
+ provide: {
76
+ convert: new Convert()
77
+ }
78
+ };
79
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.86.0",
3
+ "version": "1.88.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
- });