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