pukaad-ui-lib 1.86.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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/image/image-cropper.d.vue.ts +2 -2
- package/dist/runtime/components/image/image-cropper.vue.d.ts +2 -2
- 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-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/plugins/convert.d.ts +34 -0
- package/dist/runtime/plugins/convert.js +78 -0
- package/package.json +1 -1
- package/dist/runtime/plugins/format.d.ts +0 -9
- package/dist/runtime/plugins/format.js +0 -29
package/dist/module.json
CHANGED
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/
|
|
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;
|
|
@@ -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;
|
|
40
39
|
options: AutocompleteOption[] | string[] | number[];
|
|
41
40
|
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;
|
|
40
39
|
options: AutocompleteOption[] | string[] | number[];
|
|
41
40
|
placeholder: string;
|
|
41
|
+
limit: number;
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
44
44
|
showCounter: boolean;
|
|
@@ -18,8 +18,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
18
18
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
name: string;
|
|
21
|
-
limit: number;
|
|
22
21
|
placeholder: string;
|
|
22
|
+
limit: number;
|
|
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
|
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
name: string;
|
|
21
|
-
limit: number;
|
|
22
21
|
placeholder: string;
|
|
22
|
+
limit: number;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -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,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
|
-
});
|