pukaad-ui-lib 1.88.0 → 1.90.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/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 → convert.client.d.ts} +2 -1
- package/dist/runtime/plugins/{convert.js → convert.client.js} +16 -12
- package/package.json +1 -1
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/convert"));
|
|
84
|
+
addPlugin(resolver.resolve("./runtime/plugins/convert.client"));
|
|
85
85
|
addPlugin(resolver.resolve("./runtime/plugins/quill.client"));
|
|
86
86
|
_nuxt.hook("nitro:config", (nitroConfig) => {
|
|
87
87
|
nitroConfig.publicAssets ||= [];
|
|
@@ -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;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from "nuxt/app";
|
|
2
|
-
|
|
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");
|
|
2
|
+
let dayjsInstance;
|
|
8
3
|
export class Convert {
|
|
4
|
+
dayjs;
|
|
5
|
+
constructor(djs) {
|
|
6
|
+
this.dayjs = djs;
|
|
7
|
+
}
|
|
9
8
|
/**
|
|
10
9
|
* Convert date to Thai Buddhist Era
|
|
11
10
|
* @example convertDate("2026-01-20") => "20 มกราคม 2569"
|
|
12
11
|
*/
|
|
13
12
|
convertDate(date) {
|
|
14
13
|
if (!date) return "-";
|
|
15
|
-
const d = dayjs(date);
|
|
14
|
+
const d = this.dayjs(date);
|
|
16
15
|
if (!d.isValid()) return "-";
|
|
17
16
|
return d.format("D MMMM BBBB");
|
|
18
17
|
}
|
|
@@ -22,7 +21,7 @@ export class Convert {
|
|
|
22
21
|
*/
|
|
23
22
|
convertDateTime(date) {
|
|
24
23
|
if (!date) return "-";
|
|
25
|
-
const d = dayjs(date);
|
|
24
|
+
const d = this.dayjs(date);
|
|
26
25
|
if (!d.isValid()) return "-";
|
|
27
26
|
return d.format("D MMMM BBBB, HH:mm \u0E19.");
|
|
28
27
|
}
|
|
@@ -32,7 +31,7 @@ export class Convert {
|
|
|
32
31
|
*/
|
|
33
32
|
convertShortDate(date) {
|
|
34
33
|
if (!date) return "-";
|
|
35
|
-
const d = dayjs(date);
|
|
34
|
+
const d = this.dayjs(date);
|
|
36
35
|
if (!d.isValid()) return "-";
|
|
37
36
|
return d.format("DD/MM/BB");
|
|
38
37
|
}
|
|
@@ -42,7 +41,7 @@ export class Convert {
|
|
|
42
41
|
*/
|
|
43
42
|
convertTime(date) {
|
|
44
43
|
if (!date) return "-";
|
|
45
|
-
const d = dayjs(date);
|
|
44
|
+
const d = this.dayjs(date);
|
|
46
45
|
if (!d.isValid()) return "-";
|
|
47
46
|
return d.format("HH:mm \u0E19.");
|
|
48
47
|
}
|
|
@@ -70,10 +69,15 @@ export class Convert {
|
|
|
70
69
|
return num.toString();
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
export default defineNuxtPlugin(() => {
|
|
72
|
+
export default defineNuxtPlugin(async () => {
|
|
73
|
+
const dayjs = (await import("dayjs")).default;
|
|
74
|
+
const buddhistEra = (await import("dayjs/plugin/buddhistEra")).default;
|
|
75
|
+
const localeTh = (await import("dayjs/locale/th")).default;
|
|
76
|
+
dayjs.extend(buddhistEra);
|
|
77
|
+
dayjs.locale("th");
|
|
74
78
|
return {
|
|
75
79
|
provide: {
|
|
76
|
-
convert: new Convert()
|
|
80
|
+
convert: new Convert(dayjs)
|
|
77
81
|
}
|
|
78
82
|
};
|
|
79
83
|
});
|