@schwarzdavid/ui-kit 0.0.1-alpha.4 → 0.0.1-alpha.6
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/style.css +1 -1
- package/dist/ui-kit.d.ts +29 -4
- package/dist/ui-kit.js +314 -265
- package/package.json +12 -12
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.toast-entry[data-v-
|
|
1
|
+
.toast-entry[data-v-4c652270]{pointer-events:all}.toast-entry[data-v-4c652270] .v-alert__prepend{align-self:center}.toast-outlet[data-v-ba5c8268]{position:fixed;z-index:9999;bottom:8px;right:8px;left:8px;display:flex;flex-direction:column;row-gap:8px;pointer-events:none}.toast-outlet--desktop[data-v-ba5c8268]{left:unset;max-width:500px;width:100%}.fade-move[data-v-ba5c8268],.fade-enter-active[data-v-ba5c8268],.fade-leave-active[data-v-ba5c8268]{transition:all .3s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-ba5c8268],.fade-leave-to[data-v-ba5c8268]{opacity:0;transform:translate(50%) scaleY(.5)}.fade-leave-active[data-v-ba5c8268]{position:absolute}.info-dialog-card[data-v-48bbcd24]>.v-card-text{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-card[data-v-aa6b77b6]>.v-card-item{padding-left:16px!important;padding-right:16px!important}.prompt-dialog-toolbar-slot[data-v-aa6b77b6]{display:contents}.confirm-dialog-card[data-v-e571516e]>.v-card-text{padding-left:16px!important;padding-right:16px!important}
|
package/dist/ui-kit.d.ts
CHANGED
|
@@ -99,6 +99,20 @@ export declare interface LoadingComposable<A extends LoadingAction> {
|
|
|
99
99
|
action(...args: Parameters<A>): Promise<Awaited<ReturnType<A>>>;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
declare interface PluginDialogOptions {
|
|
103
|
+
confirm: {
|
|
104
|
+
confirmCta: ConfirmDialogCta;
|
|
105
|
+
rejectCta: ConfirmDialogCta;
|
|
106
|
+
};
|
|
107
|
+
info: {
|
|
108
|
+
defaultCta: InfoDialogBaseCta;
|
|
109
|
+
};
|
|
110
|
+
prompt: {
|
|
111
|
+
abortCta: PromptDialogCta;
|
|
112
|
+
saveCta: PromptDialogCta;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
102
116
|
declare interface PluginLoadingOptions {
|
|
103
117
|
delay: number | false;
|
|
104
118
|
overlay: boolean;
|
|
@@ -106,6 +120,12 @@ declare interface PluginLoadingOptions {
|
|
|
106
120
|
|
|
107
121
|
declare interface PluginOptions {
|
|
108
122
|
loading: PluginLoadingOptions;
|
|
123
|
+
dialog: PluginDialogOptions;
|
|
124
|
+
toast: PluginToastOptions;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare interface PluginToastOptions {
|
|
128
|
+
timeout: number;
|
|
109
129
|
}
|
|
110
130
|
|
|
111
131
|
export declare type PromptDialogComponent<T> = ComponentPublicInstance<PromptDialogComponentProps<T>, any, any, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, PromptDialogComponentEmits<T>>;
|
|
@@ -140,10 +160,15 @@ export declare enum PromptDialogSize {
|
|
|
140
160
|
}
|
|
141
161
|
|
|
142
162
|
export declare interface ToastComposable {
|
|
143
|
-
info(message: string): Promise<void>;
|
|
144
|
-
warn(message: string): Promise<void>;
|
|
145
|
-
error(message: string): Promise<void>;
|
|
146
|
-
success(message: string): Promise<void>;
|
|
163
|
+
info(message: string, options?: Partial<ToastOptions>): Promise<void>;
|
|
164
|
+
warn(message: string, options?: Partial<ToastOptions>): Promise<void>;
|
|
165
|
+
error(message: string, options?: Partial<ToastOptions>): Promise<void>;
|
|
166
|
+
success(message: string, options?: Partial<ToastOptions>): Promise<void>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export declare interface ToastOptions {
|
|
170
|
+
timeout: number;
|
|
171
|
+
translateMessage: boolean;
|
|
147
172
|
}
|
|
148
173
|
|
|
149
174
|
export declare const UiKitOutlet: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
package/dist/ui-kit.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { VAlert as
|
|
3
|
-
import { merge as
|
|
4
|
-
import { useI18n as
|
|
1
|
+
import { ref as x, readonly as H, markRaw as le, defineComponent as I, openBlock as m, createElementBlock as L, Fragment as O, renderList as X, unref as s, createBlock as g, resolveDynamicComponent as B, mergeProps as G, computed as p, onMounted as ge, createSlots as _e, withCtx as d, createElementVNode as j, toDisplayString as K, createVNode as i, getCurrentInstance as ye, inject as re, TransitionGroup as Ce, normalizeClass as ue, isRef as Te, createTextVNode as te, createCommentVNode as k, normalizeProps as se, toValue as ne } from "vue";
|
|
2
|
+
import { VAlert as be, VIcon as xe, VOverlay as we, VProgressCircular as he, VDialog as Y, VCard as J, VCardTitle as ie, VBtn as V, VCardText as ce, VCardActions as Z, VToolbar as Ae, VToolbarTitle as Ve, VSpacer as ae, VDivider as Ie } from "vuetify/components";
|
|
3
|
+
import { merge as D } from "lodash";
|
|
4
|
+
import { useI18n as Ee } from "vue-i18n";
|
|
5
5
|
const v = [];
|
|
6
6
|
for (let e = 0; e < 256; ++e)
|
|
7
7
|
v.push((e + 256).toString(16).slice(1));
|
|
8
|
-
function
|
|
8
|
+
function ke(e, t = 0) {
|
|
9
9
|
return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
|
|
10
10
|
}
|
|
11
11
|
let q;
|
|
12
|
-
const
|
|
13
|
-
function
|
|
12
|
+
const De = new Uint8Array(16);
|
|
13
|
+
function Re() {
|
|
14
14
|
if (!q) {
|
|
15
15
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
16
16
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
17
17
|
q = crypto.getRandomValues.bind(crypto);
|
|
18
18
|
}
|
|
19
|
-
return q(
|
|
19
|
+
return q(De);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const Ue = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: Ue };
|
|
22
22
|
function de(e, t, n) {
|
|
23
23
|
if (oe.randomUUID && !t && !e)
|
|
24
24
|
return oe.randomUUID();
|
|
25
25
|
e = e || {};
|
|
26
|
-
const a = e.random || (e.rng ||
|
|
27
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
26
|
+
const a = e.random || (e.rng || Re)();
|
|
27
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ke(a);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const N = x([]);
|
|
30
30
|
function me() {
|
|
31
31
|
function e() {
|
|
32
32
|
let a;
|
|
33
33
|
for (; ; )
|
|
34
|
-
if (a = de(), !
|
|
34
|
+
if (a = de(), !N.value.some((o) => o.id === a))
|
|
35
35
|
return a;
|
|
36
36
|
}
|
|
37
37
|
function t(a) {
|
|
38
|
-
const o = e(),
|
|
38
|
+
const o = e(), r = le({ ...a, id: o, resolve: (c) => {
|
|
39
39
|
n(o), a.resolve(c);
|
|
40
40
|
}, reject: (c) => {
|
|
41
41
|
n(o), a.reject(c);
|
|
42
42
|
} });
|
|
43
|
-
return
|
|
43
|
+
return N.value.push(r), r;
|
|
44
44
|
}
|
|
45
45
|
function n(a) {
|
|
46
|
-
const o = typeof a == "string" ? a : a.id, l =
|
|
47
|
-
l >= 0 &&
|
|
46
|
+
const o = typeof a == "string" ? a : a.id, l = N.value.findIndex((u) => u.id === o);
|
|
47
|
+
l >= 0 && N.value.splice(l, 1);
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
queue:
|
|
50
|
+
queue: H(N),
|
|
51
51
|
addToQueue: t,
|
|
52
52
|
removeFromQueue: n
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
const Le = /* @__PURE__ */
|
|
55
|
+
const Le = /* @__PURE__ */ I({
|
|
56
56
|
__name: "DialogOutlet",
|
|
57
57
|
setup(e) {
|
|
58
58
|
const { queue: t } = me();
|
|
59
|
-
return (n, a) => (m(!0),
|
|
59
|
+
return (n, a) => (m(!0), L(O, null, X(s(t), (o) => (m(), g(B(o.component), G({
|
|
60
60
|
key: o.id,
|
|
61
61
|
ref_for: !0
|
|
62
62
|
}, o.props, {
|
|
@@ -64,91 +64,114 @@ const Le = /* @__PURE__ */ A({
|
|
|
64
64
|
onReject: o.reject
|
|
65
65
|
}), null, 16, ["onResolve", "onReject"]))), 128));
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
68
|
-
function
|
|
67
|
+
}), S = x([]);
|
|
68
|
+
function ee() {
|
|
69
69
|
function e() {
|
|
70
70
|
let a;
|
|
71
71
|
for (; ; )
|
|
72
|
-
if (a = de(), !
|
|
72
|
+
if (a = de(), !S.value.some((o) => o.id === a))
|
|
73
73
|
return a;
|
|
74
74
|
}
|
|
75
75
|
function t(a) {
|
|
76
|
-
const o = e(),
|
|
76
|
+
const o = e(), u = le({ ...a, id: o, resolve: () => {
|
|
77
77
|
n(o), a.resolve();
|
|
78
78
|
} });
|
|
79
|
-
return
|
|
79
|
+
return S.value.unshift(u), u;
|
|
80
80
|
}
|
|
81
81
|
function n(a) {
|
|
82
|
-
const o = typeof a == "string" ? a : a.id, l =
|
|
83
|
-
l >= 0 &&
|
|
82
|
+
const o = typeof a == "string" ? a : a.id, l = S.value.findIndex((u) => u.id === o);
|
|
83
|
+
l >= 0 && S.value.splice(l, 1);
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
|
-
queue:
|
|
86
|
+
queue: H(S),
|
|
87
87
|
addToQueue: t,
|
|
88
88
|
removeFromQueue: n
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
var y = /* @__PURE__ */ ((e) => (e.SUCCESS = "success", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e))(y || {});
|
|
92
|
+
const Oe = /* @__PURE__ */ I({
|
|
92
93
|
__name: "ToastEntry",
|
|
93
94
|
props: {
|
|
94
95
|
entry: {}
|
|
95
96
|
},
|
|
96
97
|
setup(e) {
|
|
97
|
-
const t =
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
const t = {
|
|
99
|
+
[y.ERROR]: "mdi-alert-circle-outline",
|
|
100
|
+
[y.SUCCESS]: "mdi-check-circle-outline",
|
|
101
|
+
[y.INFO]: "mdi-information-outline",
|
|
102
|
+
[y.WARNING]: "mdi-alert-circle-outline"
|
|
103
|
+
}, n = {
|
|
104
|
+
[y.ERROR]: "error",
|
|
105
|
+
[y.SUCCESS]: "success",
|
|
106
|
+
[y.INFO]: "primary",
|
|
107
|
+
[y.WARNING]: "warning"
|
|
108
|
+
}, a = e, o = ee(), l = x(-1), u = p(() => t[a.entry.type]), r = p(() => n[a.entry.type]);
|
|
109
|
+
function c() {
|
|
110
|
+
window.clearTimeout(l.value), o.removeFromQueue(a.entry.id);
|
|
100
111
|
}
|
|
101
112
|
return ge(() => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
}), (
|
|
113
|
+
l.value = window.setTimeout(() => {
|
|
114
|
+
c();
|
|
115
|
+
}, a.entry.timeout);
|
|
116
|
+
}), (_, w) => (m(), g(s(be), {
|
|
106
117
|
theme: "dark",
|
|
107
118
|
class: "toast-entry",
|
|
108
119
|
closable: "",
|
|
109
|
-
"onClick:close":
|
|
110
|
-
|
|
120
|
+
"onClick:close": c,
|
|
121
|
+
density: "compact"
|
|
122
|
+
}, _e({
|
|
111
123
|
default: d(() => [
|
|
112
|
-
K(
|
|
124
|
+
j("span", null, K(_.entry.message), 1)
|
|
113
125
|
]),
|
|
114
|
-
_:
|
|
115
|
-
}
|
|
126
|
+
_: 2
|
|
127
|
+
}, [
|
|
128
|
+
u.value ? {
|
|
129
|
+
name: "prepend",
|
|
130
|
+
fn: d(() => [
|
|
131
|
+
i(s(xe), {
|
|
132
|
+
icon: u.value,
|
|
133
|
+
color: r.value
|
|
134
|
+
}, null, 8, ["icon", "color"])
|
|
135
|
+
]),
|
|
136
|
+
key: "0"
|
|
137
|
+
} : void 0
|
|
138
|
+
]), 1024));
|
|
116
139
|
}
|
|
117
140
|
}), $ = (e, t) => {
|
|
118
141
|
const n = e.__vccOpts || e;
|
|
119
142
|
for (const [a, o] of t)
|
|
120
143
|
n[a] = o;
|
|
121
144
|
return n;
|
|
122
|
-
}, je = /* @__PURE__ */ $(
|
|
123
|
-
function
|
|
145
|
+
}, je = /* @__PURE__ */ $(Oe, [["__scopeId", "data-v-4c652270"]]);
|
|
146
|
+
function Q() {
|
|
124
147
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
125
|
-
if (
|
|
148
|
+
if (Q.cache.has(e)) return Q.cache.get(e);
|
|
126
149
|
const t = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
127
|
-
return
|
|
150
|
+
return Q.cache.set(e, t), t;
|
|
128
151
|
}
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
const n =
|
|
152
|
+
Q.cache = /* @__PURE__ */ new Map();
|
|
153
|
+
function Pe(e, t) {
|
|
154
|
+
const n = ye();
|
|
132
155
|
if (!n)
|
|
133
156
|
throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
|
|
134
157
|
return n;
|
|
135
158
|
}
|
|
136
|
-
function
|
|
159
|
+
function Ne() {
|
|
137
160
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
|
|
138
|
-
const t =
|
|
139
|
-
return
|
|
161
|
+
const t = Pe(e).type;
|
|
162
|
+
return Q((t == null ? void 0 : t.aliasName) || (t == null ? void 0 : t.name));
|
|
140
163
|
}
|
|
141
|
-
const
|
|
164
|
+
const Se = Symbol.for("vuetify:display");
|
|
142
165
|
function pe() {
|
|
143
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
144
|
-
const n = re(
|
|
166
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne();
|
|
167
|
+
const n = re(Se);
|
|
145
168
|
if (!n) throw new Error("Could not find Vuetify display injection");
|
|
146
|
-
const a =
|
|
169
|
+
const a = p(() => {
|
|
147
170
|
if (e.mobile != null) return e.mobile;
|
|
148
171
|
if (!e.mobileBreakpoint) return n.mobile.value;
|
|
149
172
|
const l = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : n.thresholds.value[e.mobileBreakpoint];
|
|
150
173
|
return n.width.value < l;
|
|
151
|
-
}), o =
|
|
174
|
+
}), o = p(() => t ? {
|
|
152
175
|
[`${t}--mobile`]: a.value
|
|
153
176
|
} : {});
|
|
154
177
|
return {
|
|
@@ -157,45 +180,45 @@ function pe() {
|
|
|
157
180
|
mobile: a
|
|
158
181
|
};
|
|
159
182
|
}
|
|
160
|
-
const
|
|
183
|
+
const Qe = /* @__PURE__ */ I({
|
|
161
184
|
__name: "ToastOutlet",
|
|
162
185
|
setup(e) {
|
|
163
|
-
const { queue: t } =
|
|
186
|
+
const { queue: t } = ee(), { mobile: n } = pe(), a = p(() => n.value ? "" : "toast-outlet--desktop");
|
|
164
187
|
function o(l) {
|
|
165
|
-
const { width:
|
|
166
|
-
l instanceof HTMLElement && (l.style.width = `${
|
|
188
|
+
const { width: u } = l.getBoundingClientRect();
|
|
189
|
+
l instanceof HTMLElement && (l.style.width = `${u.toFixed()}px`);
|
|
167
190
|
}
|
|
168
|
-
return (l,
|
|
191
|
+
return (l, u) => (m(), g(Ce, {
|
|
169
192
|
name: "fade",
|
|
170
193
|
tag: "div",
|
|
171
194
|
class: ue(["toast-outlet", a.value]),
|
|
172
195
|
onBeforeLeave: o
|
|
173
196
|
}, {
|
|
174
197
|
default: d(() => [
|
|
175
|
-
(m(!0),
|
|
176
|
-
key:
|
|
177
|
-
entry:
|
|
198
|
+
(m(!0), L(O, null, X(s(t), (r) => (m(), g(je, {
|
|
199
|
+
key: r.id,
|
|
200
|
+
entry: r
|
|
178
201
|
}, null, 8, ["entry"]))), 128))
|
|
179
202
|
]),
|
|
180
203
|
_: 1
|
|
181
204
|
}, 8, ["class"]));
|
|
182
205
|
}
|
|
183
|
-
}),
|
|
206
|
+
}), $e = /* @__PURE__ */ $(Qe, [["__scopeId", "data-v-ba5c8268"]]), Fe = x(!1);
|
|
184
207
|
function fe() {
|
|
185
|
-
return
|
|
208
|
+
return Fe;
|
|
186
209
|
}
|
|
187
|
-
const
|
|
210
|
+
const Me = /* @__PURE__ */ I({
|
|
188
211
|
__name: "LoadingOverlay",
|
|
189
212
|
setup(e) {
|
|
190
213
|
const t = fe();
|
|
191
|
-
return (n, a) => (m(), g(
|
|
192
|
-
modelValue:
|
|
193
|
-
"onUpdate:modelValue": a[0] || (a[0] = (o) =>
|
|
214
|
+
return (n, a) => (m(), g(s(we), {
|
|
215
|
+
modelValue: s(t),
|
|
216
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => Te(t) ? t.value = o : null),
|
|
194
217
|
persistent: "",
|
|
195
218
|
class: "d-flex align-center justify-center"
|
|
196
219
|
}, {
|
|
197
220
|
default: d(() => [
|
|
198
|
-
s(
|
|
221
|
+
i(s(he), {
|
|
199
222
|
indeterminate: "",
|
|
200
223
|
color: "primary",
|
|
201
224
|
size: "100"
|
|
@@ -204,30 +227,30 @@ const $e = /* @__PURE__ */ A({
|
|
|
204
227
|
_: 1
|
|
205
228
|
}, 8, ["modelValue"]));
|
|
206
229
|
}
|
|
207
|
-
}),
|
|
230
|
+
}), st = /* @__PURE__ */ I({
|
|
208
231
|
__name: "UiKitOutlet",
|
|
209
232
|
setup(e) {
|
|
210
|
-
return (t, n) => (m(),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
233
|
+
return (t, n) => (m(), L(O, null, [
|
|
234
|
+
i(Le),
|
|
235
|
+
i($e),
|
|
236
|
+
i(Me)
|
|
214
237
|
], 64));
|
|
215
238
|
}
|
|
216
|
-
}),
|
|
239
|
+
}), T = /* @__PURE__ */ I({
|
|
217
240
|
__name: "MaybeTranslation",
|
|
218
241
|
props: {
|
|
219
242
|
content: {},
|
|
220
243
|
translate: { type: Boolean, default: !0 }
|
|
221
244
|
},
|
|
222
245
|
setup(e) {
|
|
223
|
-
const { t } =
|
|
224
|
-
return (n, a) => n.translate ? (m(),
|
|
225
|
-
K(
|
|
226
|
-
], 64)) : (m(),
|
|
227
|
-
K(
|
|
246
|
+
const { t } = Ee({ useScope: "global" });
|
|
247
|
+
return (n, a) => n.translate ? (m(), L(O, { key: 0 }, [
|
|
248
|
+
te(K(s(t)(n.content)), 1)
|
|
249
|
+
], 64)) : (m(), L(O, { key: 1 }, [
|
|
250
|
+
te(K(n.content), 1)
|
|
228
251
|
], 64));
|
|
229
252
|
}
|
|
230
|
-
}),
|
|
253
|
+
}), Be = { class: "d-flex justify-space-between pr-2 py-2" }, Ge = 650, We = /* @__PURE__ */ I({
|
|
231
254
|
__name: "InfoDialog",
|
|
232
255
|
props: {
|
|
233
256
|
data: {}
|
|
@@ -240,86 +263,86 @@ const $e = /* @__PURE__ */ A({
|
|
|
240
263
|
value: null
|
|
241
264
|
};
|
|
242
265
|
let l = null;
|
|
243
|
-
const
|
|
266
|
+
const u = x(!0), r = p(() => Object.hasOwn(n.data, "content") ? {
|
|
244
267
|
content: n.data.content,
|
|
245
268
|
translateContent: n.data.translateContent
|
|
246
|
-
} : null), c =
|
|
269
|
+
} : null), c = p(() => Object.hasOwn(n.data, "component") ? {
|
|
247
270
|
component: n.data.component,
|
|
248
271
|
props: n.data.props
|
|
249
|
-
} : null), _ =
|
|
250
|
-
function
|
|
251
|
-
|
|
272
|
+
} : null), _ = p(() => n.data.defaultCta === !1 ? null : D({}, o, n.data.defaultCta));
|
|
273
|
+
function w(f) {
|
|
274
|
+
R(f) ? f.action() : h(f.value);
|
|
252
275
|
}
|
|
253
|
-
function
|
|
254
|
-
return Object.hasOwn(
|
|
276
|
+
function R(f) {
|
|
277
|
+
return Object.hasOwn(f, "action");
|
|
255
278
|
}
|
|
256
|
-
function
|
|
257
|
-
l =
|
|
279
|
+
function h(f = null) {
|
|
280
|
+
l = f, u.value = !1;
|
|
258
281
|
}
|
|
259
|
-
function
|
|
282
|
+
function U() {
|
|
260
283
|
a("resolve", l);
|
|
261
284
|
}
|
|
262
|
-
return (
|
|
263
|
-
modelValue:
|
|
264
|
-
"onUpdate:modelValue":
|
|
265
|
-
"max-width":
|
|
266
|
-
onAfterLeave:
|
|
285
|
+
return (f, A) => (m(), g(s(Y), {
|
|
286
|
+
modelValue: u.value,
|
|
287
|
+
"onUpdate:modelValue": A[1] || (A[1] = (C) => u.value = C),
|
|
288
|
+
"max-width": f.data.width ?? Ge,
|
|
289
|
+
onAfterLeave: U
|
|
267
290
|
}, {
|
|
268
291
|
default: d(() => [
|
|
269
|
-
s(
|
|
292
|
+
i(s(J), { class: "info-dialog-card" }, {
|
|
270
293
|
default: d(() => [
|
|
271
|
-
|
|
272
|
-
s(
|
|
294
|
+
j("div", Be, [
|
|
295
|
+
i(s(ie), null, {
|
|
273
296
|
default: d(() => [
|
|
274
|
-
|
|
275
|
-
translate:
|
|
276
|
-
content:
|
|
297
|
+
i(T, {
|
|
298
|
+
translate: f.data.translateTitle,
|
|
299
|
+
content: f.data.title
|
|
277
300
|
}, null, 8, ["translate", "content"])
|
|
278
301
|
]),
|
|
279
302
|
_: 1
|
|
280
303
|
}),
|
|
281
|
-
s(
|
|
304
|
+
i(s(V), {
|
|
282
305
|
icon: "$close",
|
|
283
306
|
variant: "text",
|
|
284
|
-
onClick:
|
|
307
|
+
onClick: A[0] || (A[0] = (C) => h(null))
|
|
285
308
|
})
|
|
286
309
|
]),
|
|
287
|
-
|
|
310
|
+
r.value ? (m(), g(s(ce), { key: 0 }, {
|
|
288
311
|
default: d(() => [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
translate:
|
|
292
|
-
content:
|
|
312
|
+
j("p", null, [
|
|
313
|
+
i(T, {
|
|
314
|
+
translate: r.value.translateContent,
|
|
315
|
+
content: r.value.content
|
|
293
316
|
}, null, 8, ["translate", "content"])
|
|
294
317
|
])
|
|
295
318
|
]),
|
|
296
319
|
_: 1
|
|
297
320
|
})) : k("", !0),
|
|
298
321
|
c.value ? (m(), g(B(c.value.component), se(G({ key: 1 }, c.value.props)), null, 16)) : k("", !0),
|
|
299
|
-
s(
|
|
322
|
+
i(s(Z), { class: "justify-end" }, {
|
|
300
323
|
default: d(() => [
|
|
301
|
-
(m(!0),
|
|
302
|
-
key:
|
|
324
|
+
(m(!0), L(O, null, X(f.data.additionalCta ?? [], (C, b) => (m(), g(s(V), {
|
|
325
|
+
key: b,
|
|
303
326
|
color: "primary",
|
|
304
327
|
variant: "text",
|
|
305
|
-
onClick: () =>
|
|
328
|
+
onClick: () => w(C)
|
|
306
329
|
}, {
|
|
307
330
|
default: d(() => [
|
|
308
|
-
|
|
309
|
-
translate:
|
|
310
|
-
content:
|
|
331
|
+
i(T, {
|
|
332
|
+
translate: C.translateText,
|
|
333
|
+
content: C.text
|
|
311
334
|
}, null, 8, ["translate", "content"])
|
|
312
335
|
]),
|
|
313
336
|
_: 2
|
|
314
337
|
}, 1032, ["onClick"]))), 128)),
|
|
315
|
-
_.value ? (m(), g(
|
|
338
|
+
_.value ? (m(), g(s(V), {
|
|
316
339
|
key: 0,
|
|
317
340
|
color: "primary",
|
|
318
341
|
variant: "elevated",
|
|
319
|
-
onClick:
|
|
342
|
+
onClick: h
|
|
320
343
|
}, {
|
|
321
344
|
default: d(() => [
|
|
322
|
-
|
|
345
|
+
i(T, {
|
|
323
346
|
translate: _.value.translateText,
|
|
324
347
|
content: _.value.text
|
|
325
348
|
}, null, 8, ["translate", "content"])
|
|
@@ -336,9 +359,9 @@ const $e = /* @__PURE__ */ A({
|
|
|
336
359
|
_: 1
|
|
337
360
|
}, 8, ["modelValue", "max-width"]));
|
|
338
361
|
}
|
|
339
|
-
}),
|
|
340
|
-
var
|
|
341
|
-
const
|
|
362
|
+
}), ze = /* @__PURE__ */ $(We, [["__scopeId", "data-v-48bbcd24"]]);
|
|
363
|
+
var E = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.LARGE = "lg", e))(E || {});
|
|
364
|
+
const qe = /* @__PURE__ */ I({
|
|
342
365
|
__name: "PromptDialog",
|
|
343
366
|
props: {
|
|
344
367
|
data: {}
|
|
@@ -346,94 +369,94 @@ const ze = /* @__PURE__ */ A({
|
|
|
346
369
|
emits: ["resolve", "reject"],
|
|
347
370
|
setup(e, { emit: t }) {
|
|
348
371
|
const n = e, a = t, o = {
|
|
349
|
-
[
|
|
350
|
-
[
|
|
372
|
+
[E.SMALL]: 650,
|
|
373
|
+
[E.LARGE]: 1200
|
|
351
374
|
}, l = {
|
|
352
375
|
text: "APP.CANCEL",
|
|
353
376
|
translateText: !0
|
|
354
|
-
},
|
|
377
|
+
}, u = {
|
|
355
378
|
text: "APP.SAVE",
|
|
356
379
|
translateText: !0
|
|
357
|
-
},
|
|
358
|
-
function
|
|
359
|
-
c.value = ne(n.data.initialValue) ?? null,
|
|
380
|
+
}, r = x(!0), c = x(ne(n.data.initialValue) ?? null), _ = x(null), { mobile: w } = pe(), R = p(() => n.data.required && !c.value), h = p(() => o[n.data.size ?? E.SMALL]), U = p(() => n.data.size === E.LARGE ? w.value : !1), f = p(() => D({}, l, n.data.abortCta)), A = p(() => D({}, u, n.data.saveCta)), C = p(() => n.data.size === E.LARGE ? "secondary" : "primary");
|
|
381
|
+
function b() {
|
|
382
|
+
c.value = ne(n.data.initialValue) ?? null, r.value = !1;
|
|
360
383
|
}
|
|
361
384
|
function F() {
|
|
362
|
-
|
|
385
|
+
r.value = !1;
|
|
363
386
|
}
|
|
364
|
-
function
|
|
387
|
+
function W() {
|
|
365
388
|
if (n.data.required && !c.value) {
|
|
366
389
|
a("reject");
|
|
367
390
|
return;
|
|
368
391
|
}
|
|
369
392
|
a("resolve", c.value);
|
|
370
393
|
}
|
|
371
|
-
return (
|
|
372
|
-
modelValue:
|
|
373
|
-
"onUpdate:modelValue": M[1] || (M[1] = (
|
|
374
|
-
"max-width":
|
|
375
|
-
fullscreen:
|
|
376
|
-
scrollable:
|
|
377
|
-
onAfterLeave:
|
|
394
|
+
return (P, M) => (m(), g(s(Y), {
|
|
395
|
+
modelValue: r.value,
|
|
396
|
+
"onUpdate:modelValue": M[1] || (M[1] = (z) => r.value = z),
|
|
397
|
+
"max-width": h.value,
|
|
398
|
+
fullscreen: U.value,
|
|
399
|
+
scrollable: P.data.size === s(E).LARGE,
|
|
400
|
+
onAfterLeave: W
|
|
378
401
|
}, {
|
|
379
402
|
default: d(() => [
|
|
380
|
-
s(
|
|
403
|
+
i(s(J), { class: "prompt-dialog-card" }, {
|
|
381
404
|
default: d(() => [
|
|
382
|
-
s(
|
|
405
|
+
i(s(Ae), { color: "primary" }, {
|
|
383
406
|
default: d(() => [
|
|
384
|
-
s(
|
|
407
|
+
i(s(Ve), null, {
|
|
385
408
|
default: d(() => [
|
|
386
|
-
|
|
387
|
-
translate:
|
|
388
|
-
content:
|
|
409
|
+
i(T, {
|
|
410
|
+
translate: P.data.translateTitle,
|
|
411
|
+
content: P.data.title
|
|
389
412
|
}, null, 8, ["translate", "content"])
|
|
390
413
|
]),
|
|
391
414
|
_: 1
|
|
392
415
|
}),
|
|
393
|
-
s(
|
|
394
|
-
|
|
416
|
+
i(s(ae)),
|
|
417
|
+
j("div", {
|
|
395
418
|
ref_key: "toolbar",
|
|
396
419
|
ref: _,
|
|
397
420
|
class: "prompt-dialog-toolbar-slot"
|
|
398
421
|
}, null, 512),
|
|
399
|
-
s(
|
|
422
|
+
i(s(V), {
|
|
400
423
|
icon: "mdi-close",
|
|
401
|
-
onClick:
|
|
424
|
+
onClick: b
|
|
402
425
|
})
|
|
403
426
|
]),
|
|
404
427
|
_: 1
|
|
405
428
|
}),
|
|
406
|
-
_.value ? (m(), g(B(
|
|
429
|
+
_.value ? (m(), g(B(P.data.component), G({ key: 0 }, P.data.props, {
|
|
407
430
|
modelValue: c.value,
|
|
408
|
-
"onUpdate:modelValue": M[0] || (M[0] = (
|
|
431
|
+
"onUpdate:modelValue": M[0] || (M[0] = (z) => c.value = z),
|
|
409
432
|
toolbar: _.value
|
|
410
433
|
}), null, 16, ["modelValue", "toolbar"])) : k("", !0),
|
|
411
|
-
s(
|
|
412
|
-
s(
|
|
434
|
+
i(s(Ie)),
|
|
435
|
+
i(s(Z), null, {
|
|
413
436
|
default: d(() => [
|
|
414
|
-
s(
|
|
415
|
-
s(
|
|
416
|
-
color:
|
|
417
|
-
onClick:
|
|
437
|
+
i(s(ae)),
|
|
438
|
+
i(s(V), {
|
|
439
|
+
color: C.value,
|
|
440
|
+
onClick: b
|
|
418
441
|
}, {
|
|
419
442
|
default: d(() => [
|
|
420
|
-
|
|
421
|
-
translate:
|
|
422
|
-
content:
|
|
443
|
+
i(T, {
|
|
444
|
+
translate: f.value.translateText,
|
|
445
|
+
content: f.value.text
|
|
423
446
|
}, null, 8, ["translate", "content"])
|
|
424
447
|
]),
|
|
425
448
|
_: 1
|
|
426
449
|
}, 8, ["color"]),
|
|
427
|
-
s(
|
|
450
|
+
i(s(V), {
|
|
428
451
|
variant: "elevated",
|
|
429
|
-
color:
|
|
430
|
-
disabled:
|
|
452
|
+
color: C.value,
|
|
453
|
+
disabled: R.value,
|
|
431
454
|
onClick: F
|
|
432
455
|
}, {
|
|
433
456
|
default: d(() => [
|
|
434
|
-
|
|
435
|
-
translate:
|
|
436
|
-
content:
|
|
457
|
+
i(T, {
|
|
458
|
+
translate: A.value.translateText,
|
|
459
|
+
content: A.value.text
|
|
437
460
|
}, null, 8, ["translate", "content"])
|
|
438
461
|
]),
|
|
439
462
|
_: 1
|
|
@@ -448,7 +471,7 @@ const ze = /* @__PURE__ */ A({
|
|
|
448
471
|
_: 1
|
|
449
472
|
}, 8, ["modelValue", "max-width", "fullscreen", "scrollable"]));
|
|
450
473
|
}
|
|
451
|
-
}),
|
|
474
|
+
}), Ke = /* @__PURE__ */ $(qe, [["__scopeId", "data-v-aa6b77b6"]]), He = { class: "d-flex justify-space-between pr-2 py-2" }, Xe = 550, Ye = /* @__PURE__ */ I({
|
|
452
475
|
__name: "ConfirmDialog",
|
|
453
476
|
props: {
|
|
454
477
|
data: {}
|
|
@@ -462,57 +485,57 @@ const ze = /* @__PURE__ */ A({
|
|
|
462
485
|
text: "common.no",
|
|
463
486
|
translateText: !0
|
|
464
487
|
};
|
|
465
|
-
let
|
|
466
|
-
const
|
|
488
|
+
let u = !1;
|
|
489
|
+
const r = x(!0), c = p(() => Object.hasOwn(n.data, "content") ? {
|
|
467
490
|
content: n.data.content,
|
|
468
491
|
translateContent: n.data.translateContent
|
|
469
|
-
} : null), _ =
|
|
492
|
+
} : null), _ = p(() => Object.hasOwn(n.data, "component") ? {
|
|
470
493
|
component: n.data.component,
|
|
471
494
|
props: n.data.props
|
|
472
|
-
} : null),
|
|
473
|
-
function
|
|
474
|
-
|
|
495
|
+
} : null), w = p(() => D({}, o, n.data.confirmCta)), R = p(() => D({}, l, n.data.rejectCta)), h = p(() => n.data.highlightCta ?? "confirm"), U = p(() => n.data.level ?? "primary");
|
|
496
|
+
function f() {
|
|
497
|
+
r.value = !1;
|
|
475
498
|
}
|
|
476
|
-
function
|
|
477
|
-
|
|
499
|
+
function A() {
|
|
500
|
+
u = !0, r.value = !1;
|
|
478
501
|
}
|
|
479
|
-
function
|
|
480
|
-
if (n.data.throwOnReject && !
|
|
502
|
+
function C() {
|
|
503
|
+
if (n.data.throwOnReject && !u) {
|
|
481
504
|
a("reject");
|
|
482
505
|
return;
|
|
483
506
|
}
|
|
484
|
-
a("resolve",
|
|
507
|
+
a("resolve", u);
|
|
485
508
|
}
|
|
486
|
-
return (
|
|
487
|
-
modelValue:
|
|
488
|
-
"onUpdate:modelValue": F[0] || (F[0] = (
|
|
489
|
-
persistent: !!
|
|
490
|
-
"max-width":
|
|
491
|
-
onAfterLeave:
|
|
509
|
+
return (b, F) => (m(), g(s(Y), {
|
|
510
|
+
modelValue: r.value,
|
|
511
|
+
"onUpdate:modelValue": F[0] || (F[0] = (W) => r.value = W),
|
|
512
|
+
persistent: !!b.data.permanent,
|
|
513
|
+
"max-width": b.data.maxWidth ?? Xe,
|
|
514
|
+
onAfterLeave: C
|
|
492
515
|
}, {
|
|
493
516
|
default: d(() => [
|
|
494
|
-
s(
|
|
517
|
+
i(s(J), { class: "confirm-dialog-card" }, {
|
|
495
518
|
default: d(() => [
|
|
496
|
-
|
|
497
|
-
s(
|
|
519
|
+
j("div", He, [
|
|
520
|
+
i(s(ie), null, {
|
|
498
521
|
default: d(() => [
|
|
499
|
-
|
|
500
|
-
translate:
|
|
501
|
-
content:
|
|
522
|
+
i(T, {
|
|
523
|
+
translate: b.data.translateTitle,
|
|
524
|
+
content: b.data.title
|
|
502
525
|
}, null, 8, ["translate", "content"])
|
|
503
526
|
]),
|
|
504
527
|
_: 1
|
|
505
528
|
}),
|
|
506
|
-
|
|
529
|
+
b.data.permanent ? k("", !0) : (m(), g(s(V), {
|
|
507
530
|
key: 0,
|
|
508
531
|
icon: "$close",
|
|
509
532
|
variant: "text",
|
|
510
|
-
onClick:
|
|
533
|
+
onClick: f
|
|
511
534
|
}))
|
|
512
535
|
]),
|
|
513
|
-
c.value ? (m(), g(
|
|
536
|
+
c.value ? (m(), g(s(ce), { key: 0 }, {
|
|
514
537
|
default: d(() => [
|
|
515
|
-
|
|
538
|
+
i(T, {
|
|
516
539
|
translate: c.value.translateContent,
|
|
517
540
|
content: c.value.content
|
|
518
541
|
}, null, 8, ["translate", "content"])
|
|
@@ -520,33 +543,33 @@ const ze = /* @__PURE__ */ A({
|
|
|
520
543
|
_: 1
|
|
521
544
|
})) : k("", !0),
|
|
522
545
|
_.value ? (m(), g(B(_.value.component), se(G({ key: 1 }, _.value.props)), null, 16)) : k("", !0),
|
|
523
|
-
s(
|
|
546
|
+
i(s(Z), { class: "justify-end" }, {
|
|
524
547
|
default: d(() => [
|
|
525
|
-
|
|
526
|
-
class: ue(["d-flex align-center",
|
|
548
|
+
j("div", {
|
|
549
|
+
class: ue(["d-flex align-center", h.value === "confirm" ? "" : "flex-row-reverse"])
|
|
527
550
|
}, [
|
|
528
|
-
s(
|
|
529
|
-
variant:
|
|
530
|
-
color:
|
|
531
|
-
onClick:
|
|
551
|
+
i(s(V), {
|
|
552
|
+
variant: h.value === "reject" ? "elevated" : "text",
|
|
553
|
+
color: U.value,
|
|
554
|
+
onClick: f
|
|
532
555
|
}, {
|
|
533
556
|
default: d(() => [
|
|
534
|
-
|
|
535
|
-
translate:
|
|
536
|
-
content:
|
|
557
|
+
i(T, {
|
|
558
|
+
translate: R.value.translateText,
|
|
559
|
+
content: R.value.text
|
|
537
560
|
}, null, 8, ["translate", "content"])
|
|
538
561
|
]),
|
|
539
562
|
_: 1
|
|
540
563
|
}, 8, ["variant", "color"]),
|
|
541
|
-
s(
|
|
542
|
-
variant:
|
|
543
|
-
color:
|
|
544
|
-
onClick:
|
|
564
|
+
i(s(V), {
|
|
565
|
+
variant: h.value === "confirm" ? "elevated" : "text",
|
|
566
|
+
color: U.value,
|
|
567
|
+
onClick: A
|
|
545
568
|
}, {
|
|
546
569
|
default: d(() => [
|
|
547
|
-
|
|
548
|
-
translate:
|
|
549
|
-
content:
|
|
570
|
+
i(T, {
|
|
571
|
+
translate: w.value.translateText,
|
|
572
|
+
content: w.value.text
|
|
550
573
|
}, null, 8, ["translate", "content"])
|
|
551
574
|
]),
|
|
552
575
|
_: 1
|
|
@@ -562,51 +585,51 @@ const ze = /* @__PURE__ */ A({
|
|
|
562
585
|
_: 1
|
|
563
586
|
}, 8, ["modelValue", "persistent", "max-width"]));
|
|
564
587
|
}
|
|
565
|
-
}),
|
|
566
|
-
function
|
|
588
|
+
}), Je = /* @__PURE__ */ $(Ye, [["__scopeId", "data-v-e571516e"]]);
|
|
589
|
+
function it() {
|
|
567
590
|
const e = me();
|
|
568
591
|
function t(o, l) {
|
|
569
|
-
let
|
|
570
|
-
return typeof o == "string" ?
|
|
592
|
+
let u;
|
|
593
|
+
return typeof o == "string" ? u = {
|
|
571
594
|
title: o,
|
|
572
595
|
content: l ?? ""
|
|
573
|
-
} :
|
|
596
|
+
} : u = o, new Promise((r) => {
|
|
574
597
|
const c = {
|
|
575
|
-
component:
|
|
576
|
-
props: { data:
|
|
577
|
-
resolve:
|
|
598
|
+
component: ze,
|
|
599
|
+
props: { data: u },
|
|
600
|
+
resolve: r,
|
|
578
601
|
reject: () => {
|
|
579
|
-
|
|
602
|
+
r(null);
|
|
580
603
|
}
|
|
581
604
|
};
|
|
582
605
|
e.addToQueue(c);
|
|
583
606
|
});
|
|
584
607
|
}
|
|
585
608
|
function n(o) {
|
|
586
|
-
return new Promise((l,
|
|
587
|
-
const
|
|
588
|
-
component:
|
|
609
|
+
return new Promise((l, u) => {
|
|
610
|
+
const r = {
|
|
611
|
+
component: Ke,
|
|
589
612
|
props: { data: o },
|
|
590
613
|
resolve: l,
|
|
591
|
-
reject:
|
|
614
|
+
reject: u
|
|
592
615
|
};
|
|
593
|
-
e.addToQueue(
|
|
616
|
+
e.addToQueue(r);
|
|
594
617
|
});
|
|
595
618
|
}
|
|
596
|
-
function a(o, l,
|
|
597
|
-
let
|
|
598
|
-
return typeof o == "string" && typeof l == "string" && (
|
|
619
|
+
function a(o, l, u) {
|
|
620
|
+
let r = o;
|
|
621
|
+
return typeof o == "string" && typeof l == "string" && (r = {
|
|
599
622
|
title: o,
|
|
600
623
|
content: l,
|
|
601
|
-
level:
|
|
624
|
+
level: u
|
|
602
625
|
}), new Promise((c, _) => {
|
|
603
|
-
const
|
|
604
|
-
component:
|
|
605
|
-
props: { data:
|
|
626
|
+
const w = {
|
|
627
|
+
component: Je,
|
|
628
|
+
props: { data: r },
|
|
606
629
|
resolve: c,
|
|
607
630
|
reject: _
|
|
608
631
|
};
|
|
609
|
-
e.addToQueue(
|
|
632
|
+
e.addToQueue(w);
|
|
610
633
|
});
|
|
611
634
|
}
|
|
612
635
|
return {
|
|
@@ -615,46 +638,46 @@ function ut() {
|
|
|
615
638
|
confirm: a
|
|
616
639
|
};
|
|
617
640
|
}
|
|
618
|
-
var
|
|
619
|
-
function
|
|
620
|
-
const e =
|
|
621
|
-
function t(l) {
|
|
641
|
+
var Ze = /* @__PURE__ */ ((e) => (e.DEFAULT = "primary", e.WARNING = "warning", e.DANGER = "error", e))(Ze || {});
|
|
642
|
+
function ct() {
|
|
643
|
+
const e = ee();
|
|
644
|
+
function t(l, u) {
|
|
622
645
|
return new Promise((r) => {
|
|
623
646
|
e.addToQueue({
|
|
624
647
|
message: l,
|
|
625
648
|
resolve: r,
|
|
626
649
|
timeout: 4e3,
|
|
627
|
-
type:
|
|
650
|
+
type: y.INFO
|
|
628
651
|
});
|
|
629
652
|
});
|
|
630
653
|
}
|
|
631
|
-
function n(l) {
|
|
654
|
+
function n(l, u) {
|
|
632
655
|
return new Promise((r) => {
|
|
633
656
|
e.addToQueue({
|
|
634
657
|
message: l,
|
|
635
658
|
resolve: r,
|
|
636
659
|
timeout: 4e3,
|
|
637
|
-
type:
|
|
660
|
+
type: y.WARNING
|
|
638
661
|
});
|
|
639
662
|
});
|
|
640
663
|
}
|
|
641
|
-
function a(l) {
|
|
664
|
+
function a(l, u) {
|
|
642
665
|
return new Promise((r) => {
|
|
643
666
|
e.addToQueue({
|
|
644
667
|
message: l,
|
|
645
668
|
resolve: r,
|
|
646
669
|
timeout: 4e3,
|
|
647
|
-
type:
|
|
670
|
+
type: y.ERROR
|
|
648
671
|
});
|
|
649
672
|
});
|
|
650
673
|
}
|
|
651
|
-
function o(l) {
|
|
674
|
+
function o(l, u) {
|
|
652
675
|
return new Promise((r) => {
|
|
653
676
|
e.addToQueue({
|
|
654
677
|
message: l,
|
|
655
678
|
resolve: r,
|
|
656
679
|
timeout: 4e3,
|
|
657
|
-
type:
|
|
680
|
+
type: y.SUCCESS
|
|
658
681
|
});
|
|
659
682
|
});
|
|
660
683
|
}
|
|
@@ -665,37 +688,63 @@ function st() {
|
|
|
665
688
|
success: o
|
|
666
689
|
};
|
|
667
690
|
}
|
|
668
|
-
const
|
|
691
|
+
const et = () => ({
|
|
669
692
|
loading: {
|
|
670
693
|
delay: 2e3,
|
|
671
694
|
overlay: !1
|
|
695
|
+
},
|
|
696
|
+
dialog: {
|
|
697
|
+
info: {
|
|
698
|
+
defaultCta: {
|
|
699
|
+
text: ""
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
confirm: {
|
|
703
|
+
confirmCta: {
|
|
704
|
+
text: ""
|
|
705
|
+
},
|
|
706
|
+
rejectCta: {
|
|
707
|
+
text: ""
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
prompt: {
|
|
711
|
+
abortCta: {
|
|
712
|
+
text: ""
|
|
713
|
+
},
|
|
714
|
+
saveCta: {
|
|
715
|
+
text: ""
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
toast: {
|
|
720
|
+
timeout: 4e3
|
|
672
721
|
}
|
|
673
722
|
}), ve = "plugin:@schwarzdavid/ui-kit";
|
|
674
|
-
function
|
|
675
|
-
const n =
|
|
723
|
+
function tt(e, t) {
|
|
724
|
+
const n = D(et(), t);
|
|
676
725
|
e.provide(ve, n);
|
|
677
726
|
}
|
|
678
|
-
function
|
|
727
|
+
function nt(e) {
|
|
679
728
|
const t = re(ve);
|
|
680
729
|
if (!t)
|
|
681
730
|
throw new Error("UIKit Plugin not installed");
|
|
682
|
-
return
|
|
731
|
+
return D({}, t, e);
|
|
683
732
|
}
|
|
684
|
-
function
|
|
733
|
+
function at(e) {
|
|
685
734
|
return e ? new Promise((t) => {
|
|
686
735
|
setTimeout(() => {
|
|
687
736
|
t();
|
|
688
737
|
}, e);
|
|
689
738
|
}) : Promise.resolve();
|
|
690
739
|
}
|
|
691
|
-
function
|
|
692
|
-
const { loading: { delay: n, overlay: a } } =
|
|
693
|
-
async function
|
|
740
|
+
function dt(e, t = {}) {
|
|
741
|
+
const { loading: { delay: n, overlay: a } } = nt({ loading: t }), o = x(!1), l = fe();
|
|
742
|
+
async function u(...r) {
|
|
694
743
|
o.value = !0, a && (l.value = !0);
|
|
695
744
|
try {
|
|
696
745
|
const [c] = await Promise.all([
|
|
697
|
-
e(...
|
|
698
|
-
|
|
746
|
+
e(...r),
|
|
747
|
+
at(n)
|
|
699
748
|
]);
|
|
700
749
|
return c;
|
|
701
750
|
} catch (c) {
|
|
@@ -704,20 +753,20 @@ function it(e, t = {}) {
|
|
|
704
753
|
o.value = !1, a && (l.value = !1);
|
|
705
754
|
}
|
|
706
755
|
}
|
|
707
|
-
return { loading:
|
|
756
|
+
return { loading: H(o), action: u };
|
|
708
757
|
}
|
|
709
|
-
function
|
|
758
|
+
function mt(e) {
|
|
710
759
|
return (t) => {
|
|
711
|
-
|
|
760
|
+
tt(t, e);
|
|
712
761
|
};
|
|
713
762
|
}
|
|
714
763
|
export {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
764
|
+
Ze as ConfirmDialogLevel,
|
|
765
|
+
E as PromptDialogSize,
|
|
766
|
+
st as UiKitOutlet,
|
|
767
|
+
mt as createUIKit,
|
|
768
|
+
it as useDialog,
|
|
769
|
+
dt as useLoading,
|
|
721
770
|
fe as useLoadingOverlay,
|
|
722
|
-
|
|
771
|
+
ct as useToast
|
|
723
772
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schwarzdavid/ui-kit",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"preview": "vite preview",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
|
43
43
|
"@laynezh/vite-plugin-lib-assets": "^0.5.24",
|
|
44
44
|
"@mdi/font": "^7.4.47",
|
|
45
|
-
"@storybook/addon-essentials": "^8.4.
|
|
46
|
-
"@storybook/addon-interactions": "^8.4.
|
|
47
|
-
"@storybook/addon-links": "^8.4.
|
|
48
|
-
"@storybook/addon-onboarding": "^8.4.
|
|
49
|
-
"@storybook/blocks": "^8.4.
|
|
50
|
-
"@storybook/manager-api": "^8.4.
|
|
51
|
-
"@storybook/test": "^8.4.
|
|
52
|
-
"@storybook/theming": "^8.4.
|
|
53
|
-
"@storybook/vue3": "^8.4.
|
|
54
|
-
"@storybook/vue3-vite": "^8.4.
|
|
45
|
+
"@storybook/addon-essentials": "^8.4.6",
|
|
46
|
+
"@storybook/addon-interactions": "^8.4.6",
|
|
47
|
+
"@storybook/addon-links": "^8.4.6",
|
|
48
|
+
"@storybook/addon-onboarding": "^8.4.6",
|
|
49
|
+
"@storybook/blocks": "^8.4.6",
|
|
50
|
+
"@storybook/manager-api": "^8.4.6",
|
|
51
|
+
"@storybook/test": "^8.4.6",
|
|
52
|
+
"@storybook/theming": "^8.4.6",
|
|
53
|
+
"@storybook/vue3": "^8.4.6",
|
|
54
|
+
"@storybook/vue3-vite": "^8.4.6",
|
|
55
55
|
"@stylistic/eslint-plugin": "^2.10.1",
|
|
56
56
|
"@tsconfig/node20": "^20.1.4",
|
|
57
57
|
"@types/jsdom": "^21.1.7",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"jsdom": "^25.0.1",
|
|
69
69
|
"pinia": "^2.2.6",
|
|
70
70
|
"sass": "^1.80.6",
|
|
71
|
-
"storybook": "^8.4.
|
|
71
|
+
"storybook": "^8.4.6",
|
|
72
72
|
"type-fest": "^4.29.0",
|
|
73
73
|
"typescript": "~5.6.3",
|
|
74
74
|
"typescript-eslint": "^8.13.0",
|