x-essential-lib 0.1.9 → 0.1.11
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/index.d.ts +11 -9
- package/dist/index.js +211 -210
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,7 @@ import { RouteLocationNormalized, NavigationGuardNext } from 'vue-router'
|
|
|
3
3
|
|
|
4
4
|
export declare const XConfirmDlg: DefineComponent<
|
|
5
5
|
{
|
|
6
|
-
modelValue:
|
|
7
|
-
type: Boolean
|
|
8
|
-
required: true
|
|
9
|
-
}
|
|
6
|
+
modelValue: Boolean
|
|
10
7
|
},
|
|
11
8
|
{
|
|
12
9
|
'update:modelValue'(value: boolean): void
|
|
@@ -29,10 +26,7 @@ export declare const XMessage: DefineComponent<{}, {}, unknown>
|
|
|
29
26
|
|
|
30
27
|
export declare const XPromptDlg: DefineComponent<
|
|
31
28
|
{
|
|
32
|
-
modelValue:
|
|
33
|
-
type: Boolean
|
|
34
|
-
required: true
|
|
35
|
-
}
|
|
29
|
+
modelValue: Boolean
|
|
36
30
|
},
|
|
37
31
|
{
|
|
38
32
|
'update:modelValue'(value: boolean): void
|
|
@@ -40,7 +34,15 @@ export declare const XPromptDlg: DefineComponent<
|
|
|
40
34
|
unknown
|
|
41
35
|
>
|
|
42
36
|
|
|
43
|
-
export declare const XWaitDlg: DefineComponent<
|
|
37
|
+
export declare const XWaitDlg: DefineComponent<
|
|
38
|
+
{
|
|
39
|
+
modelValue: Boolean
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
'update:modelValue'(value: boolean): void
|
|
43
|
+
},
|
|
44
|
+
unknown
|
|
45
|
+
>
|
|
44
46
|
|
|
45
47
|
export declare function useColor(): {
|
|
46
48
|
primaryColor: ComputedRef<string>
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-a8f3d91f]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-a8f3d91f]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-a8f3d91f]{transform-origin:20px 20px;animation:lds-spinner-a8f3d91f 1.2s linear infinite}.lds-spinner div[data-v-a8f3d91f]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-a8f3d91f]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-a8f3d91f]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-a8f3d91f]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-a8f3d91f]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-a8f3d91f]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-a8f3d91f]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-a8f3d91f]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-a8f3d91f]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-a8f3d91f]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-a8f3d91f{0%{opacity:1}to{opacity:0}}.x-cont[data-v-70ed4b89]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { VBtn as ue, VCard as de, VCardActions as pe, VCardText as fe, VCardTitle as me, VDialog as ve, VForm as ge, VTextField as he } from "vuetify/lib/components/index.mjs";
|
|
3
|
+
import { getCurrentInstance as _e, inject as K, computed as d, defineComponent as q, useModel as z, ref as h, onMounted as R, onBeforeUnmount as W, watch as F, resolveComponent as m, openBlock as k, createBlock as A, withKeys as N, withModifiers as P, withCtx as v, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as U, normalizeStyle as ye, pushScopeId as xe, popScopeId as we, createElementVNode as g, reactive as be, Fragment as Ce, renderList as ke, unref as Ve } from "vue";
|
|
4
|
+
function Se(e) {
|
|
4
5
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
|
|
5
6
|
var o = e.get(n);
|
|
6
7
|
o ? o.push(t) : e.set(n, [t]);
|
|
@@ -16,58 +17,58 @@ function _e(e) {
|
|
|
16
17
|
});
|
|
17
18
|
} };
|
|
18
19
|
}
|
|
19
|
-
const c =
|
|
20
|
-
async function
|
|
20
|
+
const c = Se();
|
|
21
|
+
async function Ye(e) {
|
|
21
22
|
return new Promise((n) => {
|
|
22
23
|
setTimeout(n, e);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
async function
|
|
26
|
+
async function H(e, n, t) {
|
|
26
27
|
const o = Date.now();
|
|
27
28
|
return new Promise((a) => {
|
|
28
|
-
const
|
|
29
|
-
e() ? a(!0) : n && Date.now() - o > n ? a(!1) : setTimeout(
|
|
29
|
+
const r = async () => {
|
|
30
|
+
e() ? a(!0) : n && Date.now() - o > n ? a(!1) : setTimeout(r, t ?? 30);
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
r();
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function $() {
|
|
35
36
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
37
|
+
if ($.cache.has(e))
|
|
38
|
+
return $.cache.get(e);
|
|
38
39
|
const n = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
39
|
-
return
|
|
40
|
+
return $.cache.set(e, n), n;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
$.cache = /* @__PURE__ */ new Map();
|
|
42
43
|
function Y(e, n) {
|
|
43
|
-
const t =
|
|
44
|
+
const t = _e();
|
|
44
45
|
if (!t)
|
|
45
46
|
throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
|
|
46
47
|
return t;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function De() {
|
|
49
50
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
|
|
50
51
|
const n = Y(e).type;
|
|
51
|
-
return
|
|
52
|
+
return $((n == null ? void 0 : n.aliasName) || (n == null ? void 0 : n.name));
|
|
52
53
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
const e = K(
|
|
54
|
+
const qe = Symbol.for("vuetify:locale");
|
|
55
|
+
function X() {
|
|
56
|
+
const e = K(qe);
|
|
56
57
|
if (!e)
|
|
57
58
|
throw new Error("[Vuetify] Could not find injected locale instance");
|
|
58
59
|
return e;
|
|
59
60
|
}
|
|
60
|
-
const
|
|
61
|
-
function
|
|
62
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
63
|
-
const t = K(
|
|
61
|
+
const Te = Symbol.for("vuetify:display");
|
|
62
|
+
function Ie() {
|
|
63
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : De();
|
|
64
|
+
const t = K(Te);
|
|
64
65
|
if (!t)
|
|
65
66
|
throw new Error("Could not find Vuetify display injection");
|
|
66
67
|
const o = d(() => {
|
|
67
68
|
if (!e.mobileBreakpoint)
|
|
68
69
|
return t.mobile.value;
|
|
69
|
-
const
|
|
70
|
-
return t.width.value <
|
|
70
|
+
const r = typeof e.mobileBreakpoint == "number" ? e.mobileBreakpoint : t.thresholds.value[e.mobileBreakpoint];
|
|
71
|
+
return t.width.value < r;
|
|
71
72
|
}), a = d(() => n ? {
|
|
72
73
|
[`${n}--mobile`]: o.value
|
|
73
74
|
} : {});
|
|
@@ -77,57 +78,57 @@ function be() {
|
|
|
77
78
|
mobile: o
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
81
|
+
const Be = Symbol.for("vuetify:theme");
|
|
82
|
+
function Z() {
|
|
82
83
|
Y("useTheme");
|
|
83
|
-
const e = K(
|
|
84
|
+
const e = K(Be, null);
|
|
84
85
|
if (!e)
|
|
85
86
|
throw new Error("Could not find Vuetify theme injection");
|
|
86
87
|
return e;
|
|
87
88
|
}
|
|
88
|
-
const
|
|
89
|
+
const Me = /* @__PURE__ */ q({
|
|
89
90
|
__name: "index",
|
|
90
91
|
props: {
|
|
91
|
-
modelValue: { type: Boolean
|
|
92
|
+
modelValue: { type: Boolean },
|
|
92
93
|
modelModifiers: {}
|
|
93
94
|
},
|
|
94
95
|
emits: ["update:modelValue"],
|
|
95
96
|
setup(e) {
|
|
96
|
-
const n =
|
|
97
|
+
const n = X(), t = z(e, "modelValue"), o = h(""), a = h(""), r = h(), l = h(), s = d(() => {
|
|
97
98
|
var u;
|
|
98
|
-
return ((u =
|
|
99
|
+
return ((u = r.value) == null ? void 0 : u.color) ?? "primary";
|
|
99
100
|
}), f = d(() => {
|
|
100
101
|
var u;
|
|
101
|
-
return ((u =
|
|
102
|
+
return ((u = r.value) == null ? void 0 : u.text) ?? n.t("cancel");
|
|
102
103
|
}), p = d(() => {
|
|
103
104
|
var u;
|
|
104
|
-
return ((u =
|
|
105
|
-
}),
|
|
105
|
+
return ((u = l.value) == null ? void 0 : u.color) ?? "primary";
|
|
106
|
+
}), V = d(() => {
|
|
106
107
|
var u;
|
|
107
|
-
return ((u =
|
|
108
|
+
return ((u = l.value) == null ? void 0 : u.text) ?? n.t("confirm");
|
|
108
109
|
});
|
|
109
|
-
let
|
|
110
|
+
let T = 0, S = !1;
|
|
110
111
|
const E = (u) => {
|
|
111
|
-
o.value = u.title, a.value = u.text,
|
|
112
|
+
o.value = u.title, a.value = u.text, r.value = u.cancel, l.value = u.confirm, T = u.seq, S = !1, t.value = !0;
|
|
112
113
|
};
|
|
113
114
|
R(() => {
|
|
114
115
|
c.on("confirmDlg", E);
|
|
115
|
-
}),
|
|
116
|
+
}), W(() => {
|
|
116
117
|
c.off("confirmDlg", E);
|
|
117
118
|
});
|
|
118
119
|
const O = () => {
|
|
119
|
-
t.value = !1, S || (c.emit("confirmDlgResult" +
|
|
120
|
+
t.value = !1, S || (c.emit("confirmDlgResult" + T, !0), S = !0);
|
|
120
121
|
};
|
|
121
|
-
return
|
|
122
|
-
!u && !S && (c.emit("confirmDlgResult" +
|
|
122
|
+
return F(t, (u) => {
|
|
123
|
+
!u && !S && (c.emit("confirmDlgResult" + T, !1), S = !0);
|
|
123
124
|
}), (u, x) => {
|
|
124
|
-
const
|
|
125
|
-
return
|
|
125
|
+
const D = m("v-card-title"), j = m("v-card-text"), I = m("v-btn"), i = m("v-card-actions"), y = m("v-card"), L = m("v-dialog");
|
|
126
|
+
return k(), A(L, {
|
|
126
127
|
modelValue: t.value,
|
|
127
128
|
"onUpdate:modelValue": x[1] || (x[1] = (B) => t.value = B),
|
|
128
129
|
onKeydown: [
|
|
129
|
-
x[2] || (x[2] =
|
|
130
|
-
|
|
130
|
+
x[2] || (x[2] = N(P((B) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
131
|
+
N(P(O, ["stop", "prevent"]), ["enter"])
|
|
131
132
|
],
|
|
132
133
|
transition: "dialog-top-transition",
|
|
133
134
|
"max-width": "600px"
|
|
@@ -135,37 +136,37 @@ const Ce = /* @__PURE__ */ V({
|
|
|
135
136
|
default: v(() => [
|
|
136
137
|
_(y, null, {
|
|
137
138
|
default: v(() => [
|
|
138
|
-
_(
|
|
139
|
+
_(D, null, {
|
|
139
140
|
default: v(() => [
|
|
140
|
-
|
|
141
|
+
C(b(o.value), 1)
|
|
141
142
|
]),
|
|
142
143
|
_: 1
|
|
143
144
|
}),
|
|
144
|
-
_(
|
|
145
|
+
_(j, null, {
|
|
145
146
|
default: v(() => [
|
|
146
|
-
|
|
147
|
+
C(b(a.value), 1)
|
|
147
148
|
]),
|
|
148
149
|
_: 1
|
|
149
150
|
}),
|
|
150
151
|
_(i, { class: "d-flex justify-end" }, {
|
|
151
152
|
default: v(() => [
|
|
152
|
-
_(
|
|
153
|
+
_(I, {
|
|
153
154
|
onClick: x[0] || (x[0] = (B) => t.value = !1),
|
|
154
155
|
color: s.value,
|
|
155
156
|
variant: "text"
|
|
156
157
|
}, {
|
|
157
158
|
default: v(() => [
|
|
158
|
-
|
|
159
|
+
C(b(f.value), 1)
|
|
159
160
|
]),
|
|
160
161
|
_: 1
|
|
161
162
|
}, 8, ["color"]),
|
|
162
|
-
_(
|
|
163
|
+
_(I, {
|
|
163
164
|
onClick: O,
|
|
164
165
|
color: p.value,
|
|
165
166
|
variant: "text"
|
|
166
167
|
}, {
|
|
167
168
|
default: v(() => [
|
|
168
|
-
|
|
169
|
+
C(b(V.value), 1)
|
|
169
170
|
]),
|
|
170
171
|
_: 1
|
|
171
172
|
}, 8, ["color"])
|
|
@@ -180,7 +181,7 @@ const Ce = /* @__PURE__ */ V({
|
|
|
180
181
|
}, 8, ["modelValue", "onKeydown"]);
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
}),
|
|
184
|
+
}), $e = (e) => (xe("data-v-a8f3d91f"), e = e(), we(), e), Pe = /* @__PURE__ */ $e(() => /* @__PURE__ */ g("div", { class: "lds-spinner" }, [
|
|
184
185
|
/* @__PURE__ */ g("div"),
|
|
185
186
|
/* @__PURE__ */ g("div"),
|
|
186
187
|
/* @__PURE__ */ g("div"),
|
|
@@ -193,9 +194,9 @@ const Ce = /* @__PURE__ */ V({
|
|
|
193
194
|
/* @__PURE__ */ g("div"),
|
|
194
195
|
/* @__PURE__ */ g("div"),
|
|
195
196
|
/* @__PURE__ */ g("div")
|
|
196
|
-
], -1)),
|
|
197
|
-
|
|
198
|
-
],
|
|
197
|
+
], -1)), Re = [
|
|
198
|
+
Pe
|
|
199
|
+
], Ae = /* @__PURE__ */ q({
|
|
199
200
|
__name: "index",
|
|
200
201
|
props: {
|
|
201
202
|
zIndex: {
|
|
@@ -204,21 +205,21 @@ const Ce = /* @__PURE__ */ V({
|
|
|
204
205
|
}
|
|
205
206
|
},
|
|
206
207
|
setup(e) {
|
|
207
|
-
const n =
|
|
208
|
+
const n = Z(), t = e, o = d(() => ({
|
|
208
209
|
background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
209
210
|
zIndex: t.zIndex
|
|
210
211
|
}));
|
|
211
|
-
return (a,
|
|
212
|
+
return (a, r) => (k(), U("div", {
|
|
212
213
|
class: "x-cont",
|
|
213
|
-
style:
|
|
214
|
-
},
|
|
214
|
+
style: ye(o.value)
|
|
215
|
+
}, Re, 4));
|
|
215
216
|
}
|
|
216
217
|
}), ee = (e, n) => {
|
|
217
218
|
const t = e.__vccOpts || e;
|
|
218
219
|
for (const [o, a] of n)
|
|
219
220
|
t[o] = a;
|
|
220
221
|
return t;
|
|
221
|
-
},
|
|
222
|
+
}, Ee = /* @__PURE__ */ ee(Ae, [["__scopeId", "data-v-a8f3d91f"]]), Oe = /* @__PURE__ */ q({
|
|
222
223
|
__name: "item",
|
|
223
224
|
props: {
|
|
224
225
|
id: {
|
|
@@ -240,38 +241,38 @@ const Ce = /* @__PURE__ */ V({
|
|
|
240
241
|
},
|
|
241
242
|
emits: ["timeout"],
|
|
242
243
|
setup(e, { emit: n }) {
|
|
243
|
-
const t = e, o = h(!0), a = n,
|
|
244
|
-
let
|
|
244
|
+
const t = e, o = h(!0), a = n, r = d(() => {
|
|
245
|
+
let l = "";
|
|
245
246
|
switch (t.type) {
|
|
246
247
|
case "error":
|
|
247
|
-
|
|
248
|
+
l = "cancel";
|
|
248
249
|
break;
|
|
249
250
|
case "info":
|
|
250
|
-
|
|
251
|
+
l = "info";
|
|
251
252
|
break;
|
|
252
253
|
case "success":
|
|
253
|
-
|
|
254
|
+
l = "check-circle";
|
|
254
255
|
break;
|
|
255
256
|
case "warning":
|
|
256
|
-
|
|
257
|
+
l = "error";
|
|
257
258
|
break;
|
|
258
259
|
}
|
|
259
|
-
return
|
|
260
|
+
return l;
|
|
260
261
|
});
|
|
261
262
|
return R(() => {
|
|
262
263
|
setTimeout(() => {
|
|
263
264
|
a("timeout", t.id);
|
|
264
265
|
}, t.timeout);
|
|
265
|
-
}),
|
|
266
|
-
|
|
267
|
-
}), (
|
|
266
|
+
}), F(o, (l) => {
|
|
267
|
+
l || a("timeout", t.id);
|
|
268
|
+
}), (l, s) => {
|
|
268
269
|
const f = m("v-alert");
|
|
269
|
-
return
|
|
270
|
+
return k(), A(f, {
|
|
270
271
|
modelValue: o.value,
|
|
271
272
|
"onUpdate:modelValue": s[0] || (s[0] = (p) => o.value = p),
|
|
272
273
|
class: "mt-2",
|
|
273
274
|
type: e.type,
|
|
274
|
-
icon:
|
|
275
|
+
icon: r.value,
|
|
275
276
|
text: e.text,
|
|
276
277
|
"max-width": "90%",
|
|
277
278
|
width: "500px",
|
|
@@ -281,34 +282,34 @@ const Ce = /* @__PURE__ */ V({
|
|
|
281
282
|
}, null, 8, ["modelValue", "type", "icon", "text"]);
|
|
282
283
|
};
|
|
283
284
|
}
|
|
284
|
-
}),
|
|
285
|
+
}), je = /* @__PURE__ */ q({
|
|
285
286
|
__name: "index",
|
|
286
287
|
setup(e) {
|
|
287
|
-
const n =
|
|
288
|
+
const n = be({ items: [] });
|
|
288
289
|
R(() => {
|
|
289
290
|
c.on("message", t);
|
|
290
|
-
}),
|
|
291
|
+
}), W(() => {
|
|
291
292
|
c.off("message", t);
|
|
292
293
|
});
|
|
293
294
|
const t = (s) => {
|
|
294
|
-
|
|
295
|
+
r(s.type, s.text, s.timeout);
|
|
295
296
|
}, o = (s) => {
|
|
296
|
-
|
|
297
|
+
l(s);
|
|
297
298
|
};
|
|
298
299
|
let a = 0;
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
n.items.push({ id:
|
|
302
|
-
},
|
|
300
|
+
const r = (s, f, p) => {
|
|
301
|
+
const V = a++;
|
|
302
|
+
n.items.push({ id: V, type: s, text: f, timeout: p });
|
|
303
|
+
}, l = (s) => {
|
|
303
304
|
const f = n.items.findIndex((p) => p.id === s);
|
|
304
305
|
f >= 0 && n.items.splice(f, 1);
|
|
305
306
|
};
|
|
306
|
-
return (s, f) => (
|
|
307
|
-
onClick: f[0] || (f[0] =
|
|
307
|
+
return (s, f) => (k(), U("div", {
|
|
308
|
+
onClick: f[0] || (f[0] = P(() => {
|
|
308
309
|
}, ["stop"])),
|
|
309
310
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
310
311
|
}, [
|
|
311
|
-
(
|
|
312
|
+
(k(!0), U(Ce, null, ke(n.items, (p) => (k(), A(Oe, {
|
|
312
313
|
onTimeout: o,
|
|
313
314
|
id: p.id,
|
|
314
315
|
type: p.type,
|
|
@@ -318,15 +319,15 @@ const Ce = /* @__PURE__ */ V({
|
|
|
318
319
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
319
320
|
]));
|
|
320
321
|
}
|
|
321
|
-
}),
|
|
322
|
+
}), Ne = /* @__PURE__ */ ee(je, [["__scopeId", "data-v-70ed4b89"]]), We = /* @__PURE__ */ q({
|
|
322
323
|
__name: "index",
|
|
323
324
|
props: {
|
|
324
|
-
modelValue: { type: Boolean
|
|
325
|
+
modelValue: { type: Boolean },
|
|
325
326
|
modelModifiers: {}
|
|
326
327
|
},
|
|
327
328
|
emits: ["update:modelValue"],
|
|
328
329
|
setup(e) {
|
|
329
|
-
const n =
|
|
330
|
+
const n = X(), t = z(e, "modelValue"), o = h(""), a = h(""), r = h(), l = h(), s = h(), f = h(""), p = h(), V = h(), T = d(() => {
|
|
330
331
|
var i;
|
|
331
332
|
return ((i = p.value) == null ? void 0 : i.color) ?? "primary";
|
|
332
333
|
}), S = d(() => {
|
|
@@ -334,34 +335,34 @@ const Ce = /* @__PURE__ */ V({
|
|
|
334
335
|
return ((i = p.value) == null ? void 0 : i.text) ?? n.t("cancel");
|
|
335
336
|
}), E = d(() => {
|
|
336
337
|
var i;
|
|
337
|
-
return ((i =
|
|
338
|
+
return ((i = V.value) == null ? void 0 : i.color) ?? "primary";
|
|
338
339
|
}), O = d(() => {
|
|
339
340
|
var i;
|
|
340
|
-
return ((i =
|
|
341
|
+
return ((i = V.value) == null ? void 0 : i.text) ?? n.t("confirm");
|
|
341
342
|
}), u = h();
|
|
342
|
-
let x = 0,
|
|
343
|
-
const
|
|
343
|
+
let x = 0, D = !1;
|
|
344
|
+
const j = async (i) => {
|
|
344
345
|
var y;
|
|
345
|
-
o.value = i.title, a.value = i.text,
|
|
346
|
+
o.value = i.title, a.value = i.text, r.value = i.label, l.value = i.placeholder, s.value = i.rules, f.value = i.value, p.value = i.cancel, V.value = i.confirm, x = i.seq, D = !1, t.value = !0, await H(() => u.value !== void 0, 1e3), (y = u.value) == null || y.focus();
|
|
346
347
|
};
|
|
347
348
|
R(() => {
|
|
348
|
-
c.on("promptDlg",
|
|
349
|
-
}),
|
|
350
|
-
c.off("promptDlg",
|
|
349
|
+
c.on("promptDlg", j);
|
|
350
|
+
}), W(() => {
|
|
351
|
+
c.off("promptDlg", j);
|
|
351
352
|
});
|
|
352
|
-
const
|
|
353
|
-
t.value = !1,
|
|
353
|
+
const I = () => {
|
|
354
|
+
t.value = !1, D || (c.emit("promptDlgResult" + x, f.value ?? ""), D = !0);
|
|
354
355
|
};
|
|
355
|
-
return
|
|
356
|
-
!i && !
|
|
356
|
+
return F(t, (i) => {
|
|
357
|
+
!i && !D && (c.emit("promptDlgResult" + x, void 0), D = !0);
|
|
357
358
|
}), (i, y) => {
|
|
358
|
-
const L = m("v-card-title"), B = m("v-card-text"),
|
|
359
|
-
return
|
|
359
|
+
const L = m("v-card-title"), B = m("v-card-text"), le = m("v-text-field"), re = m("v-form"), G = m("v-btn"), se = m("v-card-actions"), ie = m("v-card"), ce = m("v-dialog");
|
|
360
|
+
return k(), A(ce, {
|
|
360
361
|
modelValue: t.value,
|
|
361
362
|
"onUpdate:modelValue": y[2] || (y[2] = (M) => t.value = M),
|
|
362
363
|
onKeydown: [
|
|
363
|
-
y[3] || (y[3] =
|
|
364
|
-
|
|
364
|
+
y[3] || (y[3] = N(P((M) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
365
|
+
N(P(I, ["stop", "prevent"]), ["enter"])
|
|
365
366
|
],
|
|
366
367
|
transition: "dialog-top-transition",
|
|
367
368
|
"max-width": "600px"
|
|
@@ -371,23 +372,23 @@ const Ce = /* @__PURE__ */ V({
|
|
|
371
372
|
default: v(() => [
|
|
372
373
|
_(L, null, {
|
|
373
374
|
default: v(() => [
|
|
374
|
-
|
|
375
|
+
C(b(o.value), 1)
|
|
375
376
|
]),
|
|
376
377
|
_: 1
|
|
377
378
|
}),
|
|
378
379
|
_(B, null, {
|
|
379
380
|
default: v(() => [
|
|
380
|
-
|
|
381
|
+
C(b(a.value), 1)
|
|
381
382
|
]),
|
|
382
383
|
_: 1
|
|
383
384
|
}),
|
|
384
|
-
_(
|
|
385
|
+
_(re, { class: "mx-3" }, {
|
|
385
386
|
default: v(() => [
|
|
386
|
-
_(
|
|
387
|
+
_(le, {
|
|
387
388
|
modelValue: f.value,
|
|
388
389
|
"onUpdate:modelValue": y[0] || (y[0] = (M) => f.value = M),
|
|
389
|
-
label:
|
|
390
|
-
placeholder:
|
|
390
|
+
label: r.value,
|
|
391
|
+
placeholder: l.value,
|
|
391
392
|
rules: s.value,
|
|
392
393
|
ref_key: "target",
|
|
393
394
|
ref: u
|
|
@@ -397,23 +398,23 @@ const Ce = /* @__PURE__ */ V({
|
|
|
397
398
|
}),
|
|
398
399
|
_(se, { class: "d-flex justify-end" }, {
|
|
399
400
|
default: v(() => [
|
|
400
|
-
_(
|
|
401
|
+
_(G, {
|
|
401
402
|
onClick: y[1] || (y[1] = (M) => t.value = !1),
|
|
402
|
-
color:
|
|
403
|
+
color: T.value,
|
|
403
404
|
variant: "text"
|
|
404
405
|
}, {
|
|
405
406
|
default: v(() => [
|
|
406
|
-
|
|
407
|
+
C(b(S.value), 1)
|
|
407
408
|
]),
|
|
408
409
|
_: 1
|
|
409
410
|
}, 8, ["color"]),
|
|
410
|
-
_(
|
|
411
|
-
onClick:
|
|
411
|
+
_(G, {
|
|
412
|
+
onClick: I,
|
|
412
413
|
color: E.value,
|
|
413
414
|
variant: "text"
|
|
414
415
|
}, {
|
|
415
416
|
default: v(() => [
|
|
416
|
-
|
|
417
|
+
C(b(O.value), 1)
|
|
417
418
|
]),
|
|
418
419
|
_: 1
|
|
419
420
|
}, 8, ["color"])
|
|
@@ -428,37 +429,42 @@ const Ce = /* @__PURE__ */ V({
|
|
|
428
429
|
}, 8, ["modelValue", "onKeydown"]);
|
|
429
430
|
};
|
|
430
431
|
}
|
|
431
|
-
}),
|
|
432
|
+
}), Le = { class: "mx-auto my-auto" }, Ue = { class: "d-flex align-center justify-center w-100 h-100" }, Ke = /* @__PURE__ */ q({
|
|
432
433
|
__name: "index",
|
|
434
|
+
props: {
|
|
435
|
+
modelValue: { type: Boolean },
|
|
436
|
+
modelModifiers: {}
|
|
437
|
+
},
|
|
438
|
+
emits: ["update:modelValue"],
|
|
433
439
|
setup(e) {
|
|
434
|
-
const n =
|
|
440
|
+
const n = X(), t = z(e, "modelValue"), o = () => {
|
|
435
441
|
t.value = !0;
|
|
436
442
|
}, a = () => {
|
|
437
443
|
t.value = !1;
|
|
438
444
|
};
|
|
439
445
|
return R(() => {
|
|
440
446
|
c.on("openWaitDlg", o), c.on("closeWaitDlg", a);
|
|
441
|
-
}),
|
|
447
|
+
}), W(() => {
|
|
442
448
|
c.off("openWaitDlg", o), c.off("closeWaitDlg", a);
|
|
443
|
-
}), (
|
|
449
|
+
}), (r, l) => {
|
|
444
450
|
const s = m("v-card"), f = m("v-dialog");
|
|
445
|
-
return
|
|
446
|
-
|
|
447
|
-
"onUpdate:modelValue":
|
|
451
|
+
return k(), A(f, {
|
|
452
|
+
modelValue: t.value,
|
|
453
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => t.value = p),
|
|
448
454
|
persistent: "",
|
|
449
455
|
"no-click-animation": "",
|
|
450
456
|
fullscreen: ""
|
|
451
457
|
}, {
|
|
452
458
|
default: v(() => [
|
|
453
|
-
g("div",
|
|
459
|
+
g("div", Le, [
|
|
454
460
|
_(s, {
|
|
455
461
|
width: "300px",
|
|
456
462
|
height: "80px",
|
|
457
463
|
loading: ""
|
|
458
464
|
}, {
|
|
459
465
|
default: v(() => [
|
|
460
|
-
g("div",
|
|
461
|
-
g("span", null, b(
|
|
466
|
+
g("div", Ue, [
|
|
467
|
+
g("span", null, b(Ve(n).t("waitingResponse")), 1)
|
|
462
468
|
])
|
|
463
469
|
]),
|
|
464
470
|
_: 1
|
|
@@ -466,72 +472,72 @@ const Ce = /* @__PURE__ */ V({
|
|
|
466
472
|
])
|
|
467
473
|
]),
|
|
468
474
|
_: 1
|
|
469
|
-
}, 8, ["
|
|
475
|
+
}, 8, ["modelValue"]);
|
|
470
476
|
};
|
|
471
477
|
}
|
|
472
478
|
});
|
|
473
|
-
function
|
|
474
|
-
const e =
|
|
479
|
+
function et() {
|
|
480
|
+
const e = Z(), n = d(() => e.global.current.value.colors.primary), t = d(() => e.global.current.value.colors.secondary), o = d(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), a = d(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = d(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = d(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = d(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
475
481
|
return {
|
|
476
482
|
primaryColor: n,
|
|
477
483
|
secondaryColor: t,
|
|
478
484
|
backgroundColor0: o,
|
|
479
485
|
backgroundColor1: a,
|
|
480
|
-
backgroundColor2:
|
|
481
|
-
highlightColor:
|
|
486
|
+
backgroundColor2: r,
|
|
487
|
+
highlightColor: l,
|
|
482
488
|
borderColor: s
|
|
483
489
|
};
|
|
484
490
|
}
|
|
485
|
-
function
|
|
486
|
-
const e =
|
|
487
|
-
return { dark: t, routeTransName: o, sysBarAvail: a, compactWidth:
|
|
491
|
+
function ze() {
|
|
492
|
+
const e = Z(), { width: n } = Ie(), t = d(() => e.current.value.dark), o = h(""), a = d(() => !!window.cordova), r = d(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
493
|
+
return { dark: t, routeTransName: o, sysBarAvail: a, compactWidth: r };
|
|
488
494
|
}
|
|
489
|
-
let
|
|
495
|
+
let J = Date.now();
|
|
490
496
|
function te() {
|
|
491
497
|
const e = Date.now();
|
|
492
|
-
return e -
|
|
498
|
+
return e - J > 500 ? (J = e, !0) : !1;
|
|
493
499
|
}
|
|
494
|
-
let
|
|
500
|
+
let Fe = 0;
|
|
495
501
|
function ne() {
|
|
496
|
-
return ++
|
|
502
|
+
return ++Fe;
|
|
497
503
|
}
|
|
498
|
-
async function
|
|
504
|
+
async function tt(e) {
|
|
499
505
|
if (!te())
|
|
500
506
|
return;
|
|
501
507
|
let n = !1, t;
|
|
502
|
-
const o = (
|
|
503
|
-
t =
|
|
508
|
+
const o = (r) => {
|
|
509
|
+
t = r, n = !0;
|
|
504
510
|
}, a = ne();
|
|
505
|
-
return c.on("confirmDlgResult" + a, o), c.emit("confirmDlg", { ...e, seq: a }), await
|
|
511
|
+
return c.on("confirmDlgResult" + a, o), c.emit("confirmDlg", { ...e, seq: a }), await H(() => n), c.off("confirmDlgResult" + a, o), t;
|
|
506
512
|
}
|
|
507
|
-
async function
|
|
513
|
+
async function nt(e) {
|
|
508
514
|
if (!te())
|
|
509
515
|
return;
|
|
510
516
|
let n = !1, t;
|
|
511
|
-
const o = (
|
|
512
|
-
t =
|
|
517
|
+
const o = (r) => {
|
|
518
|
+
t = r, n = !0;
|
|
513
519
|
}, a = ne();
|
|
514
|
-
return c.on("promptDlgResult" + a, o), c.emit("promptDlg", { ...e, seq: a }), await
|
|
520
|
+
return c.on("promptDlgResult" + a, o), c.emit("promptDlg", { ...e, seq: a }), await H(() => n), c.off("promptDlgResult" + a, o), t;
|
|
515
521
|
}
|
|
516
|
-
function
|
|
522
|
+
function ot() {
|
|
517
523
|
c.emit("openWaitDlg");
|
|
518
524
|
}
|
|
519
|
-
function
|
|
525
|
+
function at() {
|
|
520
526
|
c.emit("closeWaitDlg");
|
|
521
527
|
}
|
|
522
|
-
function
|
|
528
|
+
function lt(e, n) {
|
|
523
529
|
c.emit("message", { type: "error", text: e, timeout: n });
|
|
524
530
|
}
|
|
525
|
-
function
|
|
531
|
+
function rt(e, n) {
|
|
526
532
|
c.emit("message", { type: "info", text: e, timeout: n });
|
|
527
533
|
}
|
|
528
|
-
function
|
|
534
|
+
function st(e, n) {
|
|
529
535
|
c.emit("message", { type: "success", text: e, timeout: n });
|
|
530
536
|
}
|
|
531
|
-
function
|
|
537
|
+
function it(e, n) {
|
|
532
538
|
c.emit("message", { type: "warning", text: e, timeout: n });
|
|
533
539
|
}
|
|
534
|
-
function
|
|
540
|
+
function ct(e) {
|
|
535
541
|
var o, a;
|
|
536
542
|
if (!window.appAppear) {
|
|
537
543
|
window.appAppear = !0;
|
|
@@ -542,7 +548,7 @@ function et(e) {
|
|
|
542
548
|
t.add("app-reset");
|
|
543
549
|
}, 0));
|
|
544
550
|
}
|
|
545
|
-
const oe = require("js-cookie"),
|
|
551
|
+
const oe = require("js-cookie"), He = [
|
|
546
552
|
{ path: "/passport/login", level: 0 },
|
|
547
553
|
{ path: "/passport/loginAccount", level: 1 },
|
|
548
554
|
{ path: "/passport/register", level: 1 },
|
|
@@ -565,15 +571,15 @@ const oe = require("js-cookie"), We = [
|
|
|
565
571
|
function ae(e) {
|
|
566
572
|
let n, t = 0;
|
|
567
573
|
const o = e.split("/");
|
|
568
|
-
return
|
|
569
|
-
const
|
|
570
|
-
let
|
|
571
|
-
for (let s = 0; s < o.length && !(s >=
|
|
572
|
-
|
|
573
|
-
|
|
574
|
+
return He.forEach((a) => {
|
|
575
|
+
const r = a.path.split("/");
|
|
576
|
+
let l = 0;
|
|
577
|
+
for (let s = 0; s < o.length && !(s >= r.length || o[s] !== r[s]); s++)
|
|
578
|
+
l++;
|
|
579
|
+
l >= t && (n = a, t = l);
|
|
574
580
|
}), n;
|
|
575
581
|
}
|
|
576
|
-
function
|
|
582
|
+
function Q(e) {
|
|
577
583
|
if (e === "/")
|
|
578
584
|
return { app: "", path: "/", level: -1 };
|
|
579
585
|
const n = ae(e);
|
|
@@ -583,83 +589,78 @@ function J(e) {
|
|
|
583
589
|
return console.assert(t.length >= 2), { app: t[1], path: n.path, level: n.level };
|
|
584
590
|
}
|
|
585
591
|
function w(e, n) {
|
|
586
|
-
const t =
|
|
592
|
+
const t = Q(e), o = Q(n);
|
|
587
593
|
console.info("~~~~before route change~~~~", t, o);
|
|
588
|
-
const a = t.app === o.app,
|
|
594
|
+
const a = t.app === o.app, r = t.path === o.path, l = t.level >= o.level;
|
|
589
595
|
if (a) {
|
|
590
|
-
const { routeTransName: s } =
|
|
591
|
-
|
|
596
|
+
const { routeTransName: s } = ze();
|
|
597
|
+
r ? s.value = "" : s.value = l ? "inner-left" : "inner-right";
|
|
592
598
|
} else
|
|
593
|
-
window.routeExtras = { forward:
|
|
599
|
+
window.routeExtras = { forward: l };
|
|
594
600
|
}
|
|
595
|
-
function
|
|
601
|
+
function Xe() {
|
|
596
602
|
return !!oe.get("accessToken");
|
|
597
603
|
}
|
|
598
|
-
function
|
|
604
|
+
function Ze() {
|
|
599
605
|
return !!oe.get("activeOrg");
|
|
600
606
|
}
|
|
601
|
-
function
|
|
602
|
-
const o =
|
|
603
|
-
if (!
|
|
607
|
+
function ut(e, n, t) {
|
|
608
|
+
const o = Xe(), a = Ze(), r = ae(e.path);
|
|
609
|
+
if (!r) {
|
|
604
610
|
t();
|
|
605
611
|
return;
|
|
606
612
|
}
|
|
607
|
-
if (
|
|
613
|
+
if (r.requiredState === "auth")
|
|
608
614
|
if (o)
|
|
609
615
|
if (a) {
|
|
610
|
-
const
|
|
611
|
-
w(
|
|
616
|
+
const l = "/main";
|
|
617
|
+
w(l, n.path), t({ path: l });
|
|
612
618
|
} else
|
|
613
619
|
w(e.path, n.path), t();
|
|
614
620
|
else {
|
|
615
|
-
const
|
|
616
|
-
w(
|
|
621
|
+
const l = "/passport/login";
|
|
622
|
+
w(l, n.path), t({ path: l });
|
|
617
623
|
}
|
|
618
|
-
else if (
|
|
624
|
+
else if (r.requiredState === "org")
|
|
619
625
|
if (o)
|
|
620
626
|
if (a)
|
|
621
627
|
w(e.path, n.path), t();
|
|
622
628
|
else {
|
|
623
|
-
const
|
|
624
|
-
w(
|
|
629
|
+
const l = "/org/joinOrCreate";
|
|
630
|
+
w(l, n.path), t({ path: l });
|
|
625
631
|
}
|
|
626
632
|
else {
|
|
627
|
-
const
|
|
628
|
-
w(
|
|
633
|
+
const l = "/passport/login";
|
|
634
|
+
w(l, n.path), t({ path: l });
|
|
629
635
|
}
|
|
630
636
|
else if (o)
|
|
631
637
|
if (a) {
|
|
632
|
-
const
|
|
633
|
-
w(
|
|
638
|
+
const l = "/main";
|
|
639
|
+
w(l, n.path), t({ path: l });
|
|
634
640
|
} else {
|
|
635
|
-
const
|
|
636
|
-
w(
|
|
641
|
+
const l = "/org/joinOrCreate";
|
|
642
|
+
w(l, n.path), t({ path: l });
|
|
637
643
|
}
|
|
638
644
|
else
|
|
639
645
|
w(e.path, n.path), t();
|
|
640
646
|
}
|
|
641
|
-
const
|
|
642
|
-
e.component("x-confirm-dlg",
|
|
643
|
-
},
|
|
647
|
+
const Ge = (e) => {
|
|
648
|
+
e.component("v-btn", ue), e.component("v-card", de), e.component("v-card-actions", pe), e.component("v-card-text", fe), e.component("v-card-title", me), e.component("v-dialog", ve), e.component("v-form", ge), e.component("v-text-field", he), e.component("x-confirm-dlg", Me), e.component("x-loading", Ee), e.component("x-message", Ne), e.component("x-prompt-dlg", We), e.component("x-wait-dlg", Ke);
|
|
649
|
+
}, dt = { install: Ge };
|
|
644
650
|
export {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
Fe as openWaitDlg,
|
|
661
|
-
ze as useColor,
|
|
662
|
-
Ee as useSystem,
|
|
663
|
-
Ke as waitMs,
|
|
664
|
-
X as waitUtil
|
|
651
|
+
ct as appAppear,
|
|
652
|
+
at as closeWaitDlg,
|
|
653
|
+
dt as default,
|
|
654
|
+
lt as messageError,
|
|
655
|
+
rt as messageInfo,
|
|
656
|
+
st as messageSuccess,
|
|
657
|
+
it as messageWarning,
|
|
658
|
+
ut as onBeforeEach,
|
|
659
|
+
tt as openConfirmDlg,
|
|
660
|
+
nt as openPromptDlg,
|
|
661
|
+
ot as openWaitDlg,
|
|
662
|
+
et as useColor,
|
|
663
|
+
ze as useSystem,
|
|
664
|
+
Ye as waitMs,
|
|
665
|
+
H as waitUtil
|
|
665
666
|
};
|