pukaad-ui-lib 1.70.0 → 1.71.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.70.0",
4
+ "version": "1.71.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  <template #footer="{ meta }">
40
40
  <div class="flex justify-end gap-[16px] items-center">
41
- <Button type="outline" @click="onClose"> ยกเลิก </Button>
41
+ <Button variant="outline" @click="onClose"> ยกเลิก </Button>
42
42
  <Button type="submit" color="primary" :disabled="!meta.valid">
43
43
  ยืนยัน
44
44
  </Button>
@@ -82,14 +82,7 @@ watch(isDrawerOpen, (newVal) => {
82
82
  const onClose = async () => {
83
83
  const isModified = JSON.stringify(form.value) !== JSON.stringify(props.item);
84
84
  if (isModified) {
85
- const { isConfirmed } = await $alert.show({
86
- type: "warning",
87
- title: "\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?",
88
- description: "\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01 \u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E25\u0E30\u0E17\u0E34\u0E49\u0E07\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?",
89
- confirmText: "\u0E25\u0E30\u0E17\u0E34\u0E49\u0E07",
90
- cancelText: "\u0E41\u0E01\u0E49\u0E44\u0E02\u0E15\u0E48\u0E2D",
91
- showCancelBtn: true
92
- });
85
+ const isConfirmed = await $alert.confirmUnsavedChanges();
93
86
  if (isConfirmed) {
94
87
  isDrawerOpen.value = false;
95
88
  }
@@ -13,6 +13,11 @@ export interface AlertResponse {
13
13
  }
14
14
  export declare class Alert {
15
15
  show(options?: AlertOptions): Promise<AlertResponse>;
16
+ /**
17
+ * แสดง alert ยืนยันการออกจากหน้าที่มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก
18
+ * @returns Promise<boolean> - true ถ้าผู้ใช้กด "ละทิ้ง", false ถ้ากด "แก้ไขต่อ"
19
+ */
20
+ confirmUnsavedChanges(): Promise<boolean>;
16
21
  }
17
22
  declare const _default: import("nuxt/app").Plugin<{
18
23
  alert: Alert;
@@ -106,6 +106,21 @@ export class Alert {
106
106
  app.mount(div);
107
107
  });
108
108
  }
109
+ /**
110
+ * แสดง alert ยืนยันการออกจากหน้าที่มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก
111
+ * @returns Promise<boolean> - true ถ้าผู้ใช้กด "ละทิ้ง", false ถ้ากด "แก้ไขต่อ"
112
+ */
113
+ async confirmUnsavedChanges() {
114
+ const result = await this.show({
115
+ type: "warning",
116
+ title: "\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?",
117
+ description: "\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01 \u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E25\u0E30\u0E17\u0E34\u0E49\u0E07\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48 ?",
118
+ confirmText: "\u0E25\u0E30\u0E17\u0E34\u0E49\u0E07",
119
+ cancelText: "\u0E41\u0E01\u0E49\u0E44\u0E02\u0E15\u0E48\u0E2D",
120
+ showCancelBtn: true
121
+ });
122
+ return result.isConfirmed;
123
+ }
109
124
  }
110
125
  export default defineNuxtPlugin(() => {
111
126
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.70.0",
3
+ "version": "1.71.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",