cosey 0.6.20 → 0.6.22
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.
|
@@ -71,8 +71,7 @@ var stdin_default = defineComponent((props, {
|
|
|
71
71
|
style: {
|
|
72
72
|
display: "flex",
|
|
73
73
|
flexWrap: "wrap",
|
|
74
|
-
columnGap: "30px"
|
|
75
|
-
rowGap: "12px"
|
|
74
|
+
columnGap: "30px"
|
|
76
75
|
}
|
|
77
76
|
}), () => convertedOptions.value.map((item, index) => renderCheckbox(item, index)));
|
|
78
77
|
return componentProps.value.indeterminate ? h(stdin_default$1, {
|
package/package.json
CHANGED
package/utils/message-box.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { type ElMessageBoxOptions } from 'element-plus';
|
|
|
2
2
|
import { type VNode } from 'vue';
|
|
3
3
|
export declare function warningConfirm(message: string | VNode | (() => VNode), options?: ElMessageBoxOptions): CustomPromise<unknown>;
|
|
4
4
|
declare class CustomPromise<T> extends Promise<T> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
_onFulfilled: ((value: any) => any | PromiseLike<any>) | undefined | null;
|
|
6
|
+
_onRejected: ((reason?: any) => any | PromiseLike<any>) | undefined | null;
|
|
7
|
+
_resolve: null | ((value: any | PromiseLike<any>) => void);
|
|
8
|
+
_reject: null | ((reason?: any) => void);
|
|
8
9
|
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void);
|
|
9
|
-
then<TResult1 = T, TResult2 = never>(
|
|
10
|
-
catch<TResult = never>(
|
|
11
|
-
finally(
|
|
10
|
+
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
11
|
+
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
12
|
+
finally(onFinally?: (() => void) | undefined | null): Promise<T>;
|
|
12
13
|
}
|
|
13
14
|
export {};
|
package/utils/message-box.js
CHANGED
|
@@ -22,41 +22,52 @@ function warningConfirm(message, options) {
|
|
|
22
22
|
if (action === "confirm") {
|
|
23
23
|
instance.confirmButtonLoading = true;
|
|
24
24
|
try {
|
|
25
|
-
await promise.
|
|
25
|
+
const res = await promise._onFulfilled?.(void 0);
|
|
26
|
+
promise._resolve?.(res);
|
|
26
27
|
done();
|
|
27
28
|
} catch (err) {
|
|
28
|
-
promise.
|
|
29
|
+
promise._onRejected?.(err);
|
|
30
|
+
promise._reject?.(err);
|
|
29
31
|
} finally {
|
|
30
32
|
instance.confirmButtonLoading = false;
|
|
31
33
|
}
|
|
32
34
|
} else {
|
|
33
35
|
done();
|
|
34
|
-
promise.
|
|
36
|
+
promise._onRejected?.(void 0);
|
|
37
|
+
promise._reject?.();
|
|
35
38
|
}
|
|
36
|
-
promise.onfinally?.();
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
return promise;
|
|
40
42
|
}
|
|
41
43
|
class CustomPromise extends Promise {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
_onFulfilled;
|
|
45
|
+
_onRejected;
|
|
46
|
+
_resolve = null;
|
|
47
|
+
_reject = null;
|
|
45
48
|
constructor(executor) {
|
|
46
49
|
super(executor);
|
|
47
50
|
}
|
|
48
|
-
then(
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
return
|
|
51
|
+
then(onFulfilled, onRejected) {
|
|
52
|
+
this._onFulfilled = onFulfilled;
|
|
53
|
+
this._onRejected = onRejected;
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
this._resolve = resolve;
|
|
56
|
+
this._reject = reject;
|
|
57
|
+
});
|
|
52
58
|
}
|
|
53
|
-
catch(
|
|
54
|
-
this.
|
|
55
|
-
return super.catch(onrejected);
|
|
59
|
+
catch(onRejected) {
|
|
60
|
+
return this.then(null, onRejected);
|
|
56
61
|
}
|
|
57
|
-
finally(
|
|
58
|
-
this.
|
|
59
|
-
|
|
62
|
+
finally(onFinally) {
|
|
63
|
+
return this.then(
|
|
64
|
+
() => {
|
|
65
|
+
onFinally?.();
|
|
66
|
+
},
|
|
67
|
+
() => {
|
|
68
|
+
onFinally?.();
|
|
69
|
+
}
|
|
70
|
+
);
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
|