@ticatec/uniface-element 0.1.19 → 0.1.20

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.
@@ -10,20 +10,26 @@
10
10
  export let content$style: string = '';
11
11
  export let closeHandler: () => void;
12
12
  export let enableConfirm: boolean = true;
13
- export let confirmHandler: MouseClickHandler;
13
+ export let confirmHandler: (()=>Promise<void>) | null = null;
14
14
  export let confirmText: string | null = null;
15
15
 
16
16
  let confirmAction: ButtonAction = {
17
17
  label: confirmText??i18n.getText('uniface.btnConfirm', 'OK'),
18
18
  type: "primary",
19
19
  disabled: enableConfirm,
20
- handler: confirmHandler
20
+ handler: async ()=> {
21
+ let result = await confirmHandler?.();
22
+ if (result && result==true) { //返回true自动关闭
23
+ closeHandler?.();
24
+ }
25
+
26
+ }
21
27
  }
22
28
 
23
29
  let actions: ButtonActions = [confirmAction];
24
30
 
25
31
  $: {
26
- confirmAction.disabled = !enableConfirm;
32
+ confirmAction.disabled = confirmHandler==null && !enableConfirm;
27
33
  actions = [...actions];
28
34
  }
29
35
 
@@ -1,4 +1,4 @@
1
- import type { DialogCloseConfirm, MouseClickHandler } from "..";
1
+ import type { DialogCloseConfirm } from "..";
2
2
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
3
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
4
  $$bindings?: Bindings;
@@ -23,7 +23,7 @@ declare const CommonDialog: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Pr
23
23
  content$style?: string;
24
24
  closeHandler: () => void;
25
25
  enableConfirm?: boolean;
26
- confirmHandler: MouseClickHandler;
26
+ confirmHandler?: (() => Promise<void>) | null;
27
27
  confirmText?: string | null;
28
28
  }, {
29
29
  default: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "uniface web elements",
5
5
  "scripts": {
6
6
  "dev": "vite dev",