@marianmeres/stuic 1.25.0 → 1.27.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/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +2 -2
- package/dist/components/AlertConfirmPrompt/acp-icons.js +1 -1
- package/dist/components/AlertConfirmPrompt/alert-confirm-prompt.d.ts +3 -3
- package/dist/components/AlertConfirmPrompt/alert-confirm-prompt.js +6 -3
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ export class AlertConfirmPromptConfig {
|
|
|
66
66
|
spinnerBox: `
|
|
67
67
|
absolute inset-0 flex justify-center items-center
|
|
68
68
|
rounded-lg
|
|
69
|
-
bg-white/
|
|
69
|
+
bg-white/75
|
|
70
70
|
`.trim()
|
|
71
71
|
};
|
|
72
72
|
// main userland configuration
|
|
@@ -474,5 +474,5 @@ $:
|
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
.rotating-cw {
|
|
477
|
-
animation: rotating-cw 0.
|
|
477
|
+
animation: rotating-cw 0.6s linear infinite;
|
|
478
478
|
}</style>
|
|
@@ -130,5 +130,5 @@ export const acpDefaultIcons = {
|
|
|
130
130
|
success: () => iconFeatherCheckCircle({}),
|
|
131
131
|
warn: () => iconFeatherAlertCircle({}),
|
|
132
132
|
error: () => iconFeatherXOctagon({}),
|
|
133
|
-
spinner: () => iconFeatherRotateCw({ size: 32, class: 'opacity-
|
|
133
|
+
spinner: () => iconFeatherRotateCw({ size: 32, class: 'opacity-50' }),
|
|
134
134
|
};
|
|
@@ -50,7 +50,7 @@ export declare const createAlertConfirmPromptStore: () => {
|
|
|
50
50
|
confirm: (onOk: FnOnOK, o?: Partial<Dialog>) => void;
|
|
51
51
|
prompt: (onOk: FnOnOK, o?: Partial<Dialog>) => void;
|
|
52
52
|
};
|
|
53
|
-
export declare const createAlert: (acp: ReturnType<typeof createAlertConfirmPromptStore>) => (message: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
54
|
-
export declare const createConfirm: (acp: ReturnType<typeof createAlertConfirmPromptStore>) => (message: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
55
|
-
export declare const createPrompt: (acp: ReturnType<typeof createAlertConfirmPromptStore>) => (message: string, defaultValue?: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
53
|
+
export declare const createAlert: (acp: ReturnType<typeof createAlertConfirmPromptStore>, defaults?: Partial<Dialog>) => (message: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
54
|
+
export declare const createConfirm: (acp: ReturnType<typeof createAlertConfirmPromptStore>, defaults?: Partial<Dialog>) => (message: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
55
|
+
export declare const createPrompt: (acp: ReturnType<typeof createAlertConfirmPromptStore>, defaults?: Partial<Dialog>) => (message: string, defaultValue?: string, o?: Partial<Dialog>) => Promise<unknown>;
|
|
56
56
|
export {};
|
|
@@ -80,9 +80,10 @@ export const createAlertConfirmPromptStore = () => {
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
// sugar helpers to patch the native window.alert/confirm/prompt
|
|
83
|
-
export const createAlert = (acp) =>
|
|
83
|
+
export const createAlert = (acp, defaults) =>
|
|
84
84
|
// allowing to add the custom param outside of the native signature
|
|
85
85
|
(message, o) => new Promise((resolve) => acp.alert({
|
|
86
|
+
...(defaults || {}),
|
|
86
87
|
onOk: () => {
|
|
87
88
|
acp.close();
|
|
88
89
|
resolve(undefined);
|
|
@@ -94,12 +95,13 @@ export const createAlert = (acp) =>
|
|
|
94
95
|
},
|
|
95
96
|
...(o || {}),
|
|
96
97
|
}));
|
|
97
|
-
export const createConfirm = (acp) =>
|
|
98
|
+
export const createConfirm = (acp, defaults) =>
|
|
98
99
|
// allowing to add the custom param outside of the native signature
|
|
99
100
|
(message, o) => new Promise((resolve) => acp.confirm(() => {
|
|
100
101
|
acp.close();
|
|
101
102
|
resolve(true);
|
|
102
103
|
}, {
|
|
104
|
+
...(defaults || {}),
|
|
103
105
|
content: message,
|
|
104
106
|
onCancel: () => {
|
|
105
107
|
acp.close();
|
|
@@ -111,12 +113,13 @@ export const createConfirm = (acp) =>
|
|
|
111
113
|
},
|
|
112
114
|
...(o || {}),
|
|
113
115
|
}));
|
|
114
|
-
export const createPrompt = (acp) =>
|
|
116
|
+
export const createPrompt = (acp, defaults) =>
|
|
115
117
|
// allowing to add the custom param outside of the native signature
|
|
116
118
|
(message, defaultValue = '', o) => new Promise((resolve) => acp.prompt((value) => {
|
|
117
119
|
acp.close();
|
|
118
120
|
resolve(value);
|
|
119
121
|
}, {
|
|
122
|
+
...(defaults || {}),
|
|
120
123
|
content: message,
|
|
121
124
|
value: defaultValue,
|
|
122
125
|
onCancel: () => {
|