ra-element 0.0.7 → 0.0.8
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/ra-element.css +1 -1
- package/dist/ra-element.es.js +186 -181
- package/dist/ra-element.umd.js +4 -4
- package/docs/ra-button.md +9 -0
- package/docs/ra-dialog.md +7 -0
- package/package.json +5 -3
package/dist/ra-element.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { getCurrentInstance as G, inject as R, ref as _, computed as w, unref as l, shallowRef as
|
|
1
|
+
import { getCurrentInstance as G, inject as R, ref as _, computed as w, unref as l, shallowRef as Ft, watchEffect as st, readonly as at, getCurrentScope as Mt, onScopeDispose as it, isRef as lt, warn as kt, defineComponent as N, createElementBlock as q, openBlock as M, mergeProps as Ie, renderSlot as C, createElementVNode as Q, onMounted as oe, onBeforeUnmount as ve, provide as ct, watch as K, nextTick as Se, createBlock as te, Teleport as xt, createVNode as ee, h as Rt, normalizeStyle as ut, normalizeClass as B, createCommentVNode as fe, toDisplayString as jt, withCtx as P, resolveDynamicComponent as Bt, useSlots as zt, Transition as Kt, withDirectives as Ut, createSlots as dt, vShow as Vt } from "vue";
|
|
2
2
|
const Yt = Symbol(), ue = "el", Ht = "is-", U = (e, t, n, o, r) => {
|
|
3
3
|
let s = `${e}-${t}`;
|
|
4
4
|
return n && (s += `-${n}`), o && (s += `__${o}`), r && (s += `--${r}`), s;
|
|
5
|
-
}, Gt = Symbol("namespaceContextKey"),
|
|
5
|
+
}, Gt = Symbol("namespaceContextKey"), ft = (e) => {
|
|
6
6
|
const t = G() ? R(Gt, _(ue)) : _(ue);
|
|
7
7
|
return w(() => l(t) || ue);
|
|
8
|
-
},
|
|
9
|
-
const n =
|
|
8
|
+
}, me = (e, t) => {
|
|
9
|
+
const n = ft();
|
|
10
10
|
return {
|
|
11
11
|
namespace: n,
|
|
12
12
|
b: (a = "") => U(n.value, e, a, "", ""),
|
|
@@ -43,14 +43,14 @@ const Yt = Symbol(), ue = "el", Ht = "is-", U = (e, t, n, o, r) => {
|
|
|
43
43
|
**/
|
|
44
44
|
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
45
45
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
46
|
-
const
|
|
47
|
-
}, Wt = Object.prototype.hasOwnProperty,
|
|
46
|
+
const _e = () => {
|
|
47
|
+
}, Wt = Object.prototype.hasOwnProperty, Me = (e, t) => Wt.call(e, t), Jt = (e) => typeof e == "function", ye = (e) => typeof e == "string", pt = (e) => e !== null && typeof e == "object", Xt = (e) => {
|
|
48
48
|
const t = /* @__PURE__ */ Object.create(null);
|
|
49
49
|
return (n) => t[n] || (t[n] = e(n));
|
|
50
50
|
}, Zt = /-(\w)/g, qt = Xt(
|
|
51
51
|
(e) => e.replace(Zt, (t, n) => n ? n.toUpperCase() : "")
|
|
52
52
|
);
|
|
53
|
-
var Qt = typeof global == "object" && global && global.Object === Object && global, en = typeof self == "object" && self && self.Object === Object && self, $e = Qt || en || Function("return this")(), W = $e.Symbol,
|
|
53
|
+
var Qt = typeof global == "object" && global && global.Object === Object && global, en = typeof self == "object" && self && self.Object === Object && self, $e = Qt || en || Function("return this")(), W = $e.Symbol, vt = Object.prototype, tn = vt.hasOwnProperty, nn = vt.toString, Z = W ? W.toStringTag : void 0;
|
|
54
54
|
function on(e) {
|
|
55
55
|
var t = tn.call(e, Z), n = e[Z];
|
|
56
56
|
try {
|
|
@@ -65,46 +65,46 @@ var rn = Object.prototype, sn = rn.toString;
|
|
|
65
65
|
function an(e) {
|
|
66
66
|
return sn.call(e);
|
|
67
67
|
}
|
|
68
|
-
var ln = "[object Null]", cn = "[object Undefined]",
|
|
69
|
-
function
|
|
70
|
-
return e == null ? e === void 0 ? cn : ln :
|
|
68
|
+
var ln = "[object Null]", cn = "[object Undefined]", ke = W ? W.toStringTag : void 0;
|
|
69
|
+
function mt(e) {
|
|
70
|
+
return e == null ? e === void 0 ? cn : ln : ke && ke in Object(e) ? on(e) : an(e);
|
|
71
71
|
}
|
|
72
72
|
function un(e) {
|
|
73
73
|
return e != null && typeof e == "object";
|
|
74
74
|
}
|
|
75
75
|
var dn = "[object Symbol]";
|
|
76
76
|
function Pe(e) {
|
|
77
|
-
return typeof e == "symbol" || un(e) &&
|
|
77
|
+
return typeof e == "symbol" || un(e) && mt(e) == dn;
|
|
78
78
|
}
|
|
79
79
|
function fn(e, t) {
|
|
80
80
|
for (var n = -1, o = e == null ? 0 : e.length, r = Array(o); ++n < o; )
|
|
81
81
|
r[n] = t(e[n], n, e);
|
|
82
82
|
return r;
|
|
83
83
|
}
|
|
84
|
-
var Ne = Array.isArray,
|
|
85
|
-
function
|
|
84
|
+
var Ne = Array.isArray, xe = W ? W.prototype : void 0, Re = xe ? xe.toString : void 0;
|
|
85
|
+
function yt(e) {
|
|
86
86
|
if (typeof e == "string")
|
|
87
87
|
return e;
|
|
88
88
|
if (Ne(e))
|
|
89
|
-
return fn(e,
|
|
89
|
+
return fn(e, yt) + "";
|
|
90
90
|
if (Pe(e))
|
|
91
91
|
return Re ? Re.call(e) : "";
|
|
92
92
|
var t = e + "";
|
|
93
93
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function ht(e) {
|
|
96
96
|
var t = typeof e;
|
|
97
97
|
return e != null && (t == "object" || t == "function");
|
|
98
98
|
}
|
|
99
99
|
var pn = "[object AsyncFunction]", vn = "[object Function]", mn = "[object GeneratorFunction]", yn = "[object Proxy]";
|
|
100
100
|
function hn(e) {
|
|
101
|
-
if (!
|
|
101
|
+
if (!ht(e))
|
|
102
102
|
return !1;
|
|
103
|
-
var t =
|
|
103
|
+
var t = mt(e);
|
|
104
104
|
return t == vn || t == mn || t == pn || t == yn;
|
|
105
105
|
}
|
|
106
|
-
var
|
|
107
|
-
var e = /[^.]+$/.exec(
|
|
106
|
+
var Ce = $e["__core-js_shared__"], je = function() {
|
|
107
|
+
var e = /[^.]+$/.exec(Ce && Ce.keys && Ce.keys.IE_PROTO || "");
|
|
108
108
|
return e ? "Symbol(src)_1." + e : "";
|
|
109
109
|
}();
|
|
110
110
|
function gn(e) {
|
|
@@ -128,7 +128,7 @@ var Cn = /[\\^$.*+?()[\]{}|]/g, Tn = /^\[object .+?Constructor\]$/, wn = Functio
|
|
|
128
128
|
"^" + On.call(In).replace(Cn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
129
129
|
);
|
|
130
130
|
function Pn(e) {
|
|
131
|
-
if (!
|
|
131
|
+
if (!ht(e) || gn(e))
|
|
132
132
|
return !1;
|
|
133
133
|
var t = hn(e) ? $n : Tn;
|
|
134
134
|
return t.test(_n(e));
|
|
@@ -136,7 +136,7 @@ function Pn(e) {
|
|
|
136
136
|
function Nn(e, t) {
|
|
137
137
|
return e?.[t];
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function gt(e, t) {
|
|
140
140
|
var n = Nn(e, t);
|
|
141
141
|
return Pn(n) ? n : void 0;
|
|
142
142
|
}
|
|
@@ -150,20 +150,20 @@ function Fn(e, t) {
|
|
|
150
150
|
var n = typeof e;
|
|
151
151
|
return n == "number" || n == "symbol" || n == "boolean" || e == null || Pe(e) ? !0 : An.test(e) || !Dn.test(e) || t != null && e in Object(t);
|
|
152
152
|
}
|
|
153
|
-
var ne =
|
|
154
|
-
function
|
|
153
|
+
var ne = gt(Object, "create");
|
|
154
|
+
function Mn() {
|
|
155
155
|
this.__data__ = ne ? ne(null) : {}, this.size = 0;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function kn(e) {
|
|
158
158
|
var t = this.has(e) && delete this.__data__[e];
|
|
159
159
|
return this.size -= t ? 1 : 0, t;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
161
|
+
var xn = "__lodash_hash_undefined__", Rn = Object.prototype, jn = Rn.hasOwnProperty;
|
|
162
162
|
function Bn(e) {
|
|
163
163
|
var t = this.__data__;
|
|
164
164
|
if (ne) {
|
|
165
165
|
var n = t[e];
|
|
166
|
-
return n ===
|
|
166
|
+
return n === xn ? void 0 : n;
|
|
167
167
|
}
|
|
168
168
|
return jn.call(t, e) ? t[e] : void 0;
|
|
169
169
|
}
|
|
@@ -184,15 +184,15 @@ function V(e) {
|
|
|
184
184
|
this.set(o[0], o[1]);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
V.prototype.clear =
|
|
188
|
-
V.prototype.delete =
|
|
187
|
+
V.prototype.clear = Mn;
|
|
188
|
+
V.prototype.delete = kn;
|
|
189
189
|
V.prototype.get = Bn;
|
|
190
190
|
V.prototype.has = Un;
|
|
191
191
|
V.prototype.set = Yn;
|
|
192
192
|
function Hn() {
|
|
193
193
|
this.__data__ = [], this.size = 0;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function he(e, t) {
|
|
196
196
|
for (var n = e.length; n--; )
|
|
197
197
|
if (Ln(e[n][0], t))
|
|
198
198
|
return n;
|
|
@@ -200,21 +200,21 @@ function ye(e, t) {
|
|
|
200
200
|
}
|
|
201
201
|
var Gn = Array.prototype, Wn = Gn.splice;
|
|
202
202
|
function Jn(e) {
|
|
203
|
-
var t = this.__data__, n =
|
|
203
|
+
var t = this.__data__, n = he(t, e);
|
|
204
204
|
if (n < 0)
|
|
205
205
|
return !1;
|
|
206
206
|
var o = t.length - 1;
|
|
207
207
|
return n == o ? t.pop() : Wn.call(t, n, 1), --this.size, !0;
|
|
208
208
|
}
|
|
209
209
|
function Xn(e) {
|
|
210
|
-
var t = this.__data__, n =
|
|
210
|
+
var t = this.__data__, n = he(t, e);
|
|
211
211
|
return n < 0 ? void 0 : t[n][1];
|
|
212
212
|
}
|
|
213
213
|
function Zn(e) {
|
|
214
|
-
return
|
|
214
|
+
return he(this.__data__, e) > -1;
|
|
215
215
|
}
|
|
216
216
|
function qn(e, t) {
|
|
217
|
-
var n = this.__data__, o =
|
|
217
|
+
var n = this.__data__, o = he(n, e);
|
|
218
218
|
return o < 0 ? (++this.size, n.push([e, t])) : n[o][1] = t, this;
|
|
219
219
|
}
|
|
220
220
|
function X(e) {
|
|
@@ -229,7 +229,7 @@ X.prototype.delete = Jn;
|
|
|
229
229
|
X.prototype.get = Xn;
|
|
230
230
|
X.prototype.has = Zn;
|
|
231
231
|
X.prototype.set = qn;
|
|
232
|
-
var Qn =
|
|
232
|
+
var Qn = gt($e, "Map");
|
|
233
233
|
function eo() {
|
|
234
234
|
this.size = 0, this.__data__ = {
|
|
235
235
|
hash: new V(),
|
|
@@ -241,22 +241,22 @@ function to(e) {
|
|
|
241
241
|
var t = typeof e;
|
|
242
242
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function ge(e, t) {
|
|
245
245
|
var n = e.__data__;
|
|
246
246
|
return to(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
|
|
247
247
|
}
|
|
248
248
|
function no(e) {
|
|
249
|
-
var t =
|
|
249
|
+
var t = ge(this, e).delete(e);
|
|
250
250
|
return this.size -= t ? 1 : 0, t;
|
|
251
251
|
}
|
|
252
252
|
function oo(e) {
|
|
253
|
-
return
|
|
253
|
+
return ge(this, e).get(e);
|
|
254
254
|
}
|
|
255
255
|
function ro(e) {
|
|
256
|
-
return
|
|
256
|
+
return ge(this, e).has(e);
|
|
257
257
|
}
|
|
258
258
|
function so(e, t) {
|
|
259
|
-
var n =
|
|
259
|
+
var n = ge(this, e), o = n.size;
|
|
260
260
|
return n.set(e, t), this.size += n.size == o ? 0 : 1, this;
|
|
261
261
|
}
|
|
262
262
|
function Y(e) {
|
|
@@ -299,7 +299,7 @@ var co = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
|
|
|
299
299
|
}), t;
|
|
300
300
|
});
|
|
301
301
|
function po(e) {
|
|
302
|
-
return e == null ? "" :
|
|
302
|
+
return e == null ? "" : yt(e);
|
|
303
303
|
}
|
|
304
304
|
function vo(e, t) {
|
|
305
305
|
return Ne(e) ? e : Fn(e, t) ? [e] : fo(po(e));
|
|
@@ -330,7 +330,7 @@ function go(e) {
|
|
|
330
330
|
function bo(e) {
|
|
331
331
|
return e == null;
|
|
332
332
|
}
|
|
333
|
-
const Eo = (e) => e === void 0, _o = (e) => typeof e == "boolean",
|
|
333
|
+
const Eo = (e) => e === void 0, _o = (e) => typeof e == "boolean", bt = (e) => typeof e == "number", Be = (e) => typeof Element > "u" ? !1 : e instanceof Element, Co = (e) => ye(e) ? !Number.isNaN(Number(e)) : !1;
|
|
334
334
|
var To = Object.defineProperty, wo = Object.defineProperties, So = Object.getOwnPropertyDescriptors, ze = Object.getOwnPropertySymbols, Oo = Object.prototype.hasOwnProperty, Io = Object.prototype.propertyIsEnumerable, Ke = (e, t, n) => t in e ? To(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, $o = (e, t) => {
|
|
335
335
|
for (var n in t || (t = {}))
|
|
336
336
|
Oo.call(t, n) && Ke(e, n, t[n]);
|
|
@@ -341,7 +341,7 @@ var To = Object.defineProperty, wo = Object.defineProperties, So = Object.getOwn
|
|
|
341
341
|
}, Po = (e, t) => wo(e, So(t));
|
|
342
342
|
function No(e, t) {
|
|
343
343
|
var n;
|
|
344
|
-
const o =
|
|
344
|
+
const o = Ft();
|
|
345
345
|
return st(() => {
|
|
346
346
|
o.value = e();
|
|
347
347
|
}, Po($o({}, t), {
|
|
@@ -349,13 +349,13 @@ function No(e, t) {
|
|
|
349
349
|
})), at(o);
|
|
350
350
|
}
|
|
351
351
|
var Ue;
|
|
352
|
-
const
|
|
353
|
-
|
|
352
|
+
const k = typeof window < "u";
|
|
353
|
+
k && ((Ue = window?.navigator) != null && Ue.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
354
354
|
function Lo(e) {
|
|
355
355
|
return typeof e == "function" ? e() : l(e);
|
|
356
356
|
}
|
|
357
357
|
function Do(e) {
|
|
358
|
-
return
|
|
358
|
+
return Mt() ? (it(e), !0) : !1;
|
|
359
359
|
}
|
|
360
360
|
function Ve(e, t, n = {}) {
|
|
361
361
|
const {
|
|
@@ -373,41 +373,41 @@ function Ve(e, t, n = {}) {
|
|
|
373
373
|
r.value = !1, s = null, e(...y);
|
|
374
374
|
}, Lo(t));
|
|
375
375
|
}
|
|
376
|
-
return o && (r.value = !0,
|
|
376
|
+
return o && (r.value = !0, k && f()), Do(m), {
|
|
377
377
|
isPending: at(r),
|
|
378
378
|
start: f,
|
|
379
379
|
stop: m
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
|
-
class
|
|
382
|
+
class Et extends Error {
|
|
383
383
|
constructor(t) {
|
|
384
384
|
super(t), this.name = "ElementPlusError";
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
function Ao(e, t) {
|
|
388
|
-
throw new
|
|
388
|
+
throw new Et(`[${e}] ${t}`);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function be(e, t) {
|
|
391
391
|
if (process.env.NODE_ENV !== "production") {
|
|
392
|
-
const n =
|
|
392
|
+
const n = ye(e) ? new Et(`[${e}] ${t}`) : e;
|
|
393
393
|
console.warn(n);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
const Ye = {
|
|
397
397
|
current: 0
|
|
398
|
-
}, He = _(0), Fo = 2e3, Ge = Symbol("elZIndexContextKey"),
|
|
399
|
-
const t = G() ? R(Ge, Ye) : Ye, n = G() ? R(
|
|
398
|
+
}, He = _(0), Fo = 2e3, Ge = Symbol("elZIndexContextKey"), Mo = Symbol("zIndexContextKey"), ko = (e) => {
|
|
399
|
+
const t = G() ? R(Ge, Ye) : Ye, n = G() ? R(Mo, void 0) : void 0, o = w(() => {
|
|
400
400
|
const u = l(n);
|
|
401
|
-
return
|
|
401
|
+
return bt(u) ? u : Fo;
|
|
402
402
|
}), r = w(() => o.value + He.value), s = () => (t.current++, He.value = t.current, r.value);
|
|
403
|
-
return !
|
|
403
|
+
return !k && !R(Ge) && be("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
404
404
|
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), {
|
|
405
405
|
initialZIndex: o,
|
|
406
406
|
currentZIndex: r,
|
|
407
407
|
nextZIndex: s
|
|
408
408
|
};
|
|
409
409
|
};
|
|
410
|
-
var
|
|
410
|
+
var xo = {
|
|
411
411
|
name: "en",
|
|
412
412
|
el: {
|
|
413
413
|
breadcrumb: {
|
|
@@ -598,24 +598,24 @@ const Ro = (e) => (t, n) => jo(t, n, l(e)), jo = (e, t, n) => ho(n, e, e).replac
|
|
|
598
598
|
};
|
|
599
599
|
}, zo = Symbol("localeContextKey"), Ko = (e) => {
|
|
600
600
|
const t = R(zo, _());
|
|
601
|
-
return Bo(w(() => t.value ||
|
|
602
|
-
},
|
|
603
|
-
if (!
|
|
601
|
+
return Bo(w(() => t.value || xo));
|
|
602
|
+
}, _t = "__epPropKey", J = (e) => e, Uo = (e) => pt(e) && !!e[_t], Vo = (e, t) => {
|
|
603
|
+
if (!pt(e) || Uo(e))
|
|
604
604
|
return e;
|
|
605
605
|
const { values: n, required: o, default: r, type: s, validator: u } = e, f = {
|
|
606
606
|
type: s,
|
|
607
607
|
required: !!o,
|
|
608
608
|
validator: n || u ? (y) => {
|
|
609
609
|
let h = !1, v = [];
|
|
610
|
-
if (n && (v = Array.from(n),
|
|
610
|
+
if (n && (v = Array.from(n), Me(e, "default") && v.push(r), h || (h = v.includes(y))), u && (h || (h = u(y))), !h && v.length > 0) {
|
|
611
611
|
const b = [...new Set(v)].map((E) => JSON.stringify(E)).join(", ");
|
|
612
|
-
|
|
612
|
+
kt(`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${b}], got value ${JSON.stringify(y)}.`);
|
|
613
613
|
}
|
|
614
614
|
return h;
|
|
615
615
|
} : void 0,
|
|
616
|
-
[
|
|
616
|
+
[_t]: !0
|
|
617
617
|
};
|
|
618
|
-
return
|
|
618
|
+
return Me(e, "default") && (f.default = r), f;
|
|
619
619
|
}, re = (e) => go(Object.entries(e).map(([t, n]) => [
|
|
620
620
|
t,
|
|
621
621
|
Vo(n, t)
|
|
@@ -627,26 +627,26 @@ function Yo(e, t = void 0) {
|
|
|
627
627
|
return (r = (o = n.value) == null ? void 0 : o[e]) != null ? r : t;
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
|
-
const
|
|
630
|
+
const Ct = "update:modelValue";
|
|
631
631
|
var se = (e, t) => {
|
|
632
632
|
const n = e.__vccOpts || e;
|
|
633
633
|
for (const [o, r] of t)
|
|
634
634
|
n[o] = r;
|
|
635
635
|
return n;
|
|
636
636
|
};
|
|
637
|
-
const Ho = "utils/dom/style",
|
|
637
|
+
const Ho = "utils/dom/style", Tt = (e = "") => e.split(" ").filter((t) => !!t.trim()), Je = (e, t) => {
|
|
638
638
|
if (!e || !t)
|
|
639
639
|
return !1;
|
|
640
640
|
if (t.includes(" "))
|
|
641
641
|
throw new Error("className should not contain space.");
|
|
642
642
|
return e.classList.contains(t);
|
|
643
643
|
}, Go = (e, t) => {
|
|
644
|
-
!e || !t.trim() || e.classList.add(...
|
|
644
|
+
!e || !t.trim() || e.classList.add(...Tt(t));
|
|
645
645
|
}, Wo = (e, t) => {
|
|
646
|
-
!e || !t.trim() || e.classList.remove(...
|
|
646
|
+
!e || !t.trim() || e.classList.remove(...Tt(t));
|
|
647
647
|
}, Jo = (e, t) => {
|
|
648
648
|
var n;
|
|
649
|
-
if (!
|
|
649
|
+
if (!k || !e || !t)
|
|
650
650
|
return "";
|
|
651
651
|
let o = qt(t);
|
|
652
652
|
o === "float" && (o = "cssFloat");
|
|
@@ -660,19 +660,19 @@ const Ho = "utils/dom/style", Ct = (e = "") => e.split(" ").filter((t) => !!t.tr
|
|
|
660
660
|
return e.style[o];
|
|
661
661
|
}
|
|
662
662
|
};
|
|
663
|
-
function
|
|
663
|
+
function pe(e, t = "px") {
|
|
664
664
|
if (!e)
|
|
665
665
|
return "";
|
|
666
|
-
if (
|
|
666
|
+
if (bt(e) || Co(e))
|
|
667
667
|
return `${e}${t}`;
|
|
668
|
-
if (
|
|
668
|
+
if (ye(e))
|
|
669
669
|
return e;
|
|
670
|
-
|
|
670
|
+
be(Ho, "binding value must be a string or number");
|
|
671
671
|
}
|
|
672
672
|
let ae;
|
|
673
673
|
const Xo = (e) => {
|
|
674
674
|
var t;
|
|
675
|
-
if (!
|
|
675
|
+
if (!k)
|
|
676
676
|
return 0;
|
|
677
677
|
if (ae !== void 0)
|
|
678
678
|
return ae;
|
|
@@ -701,14 +701,14 @@ const Xo = (e) => {
|
|
|
701
701
|
...qo,
|
|
702
702
|
props: Zo,
|
|
703
703
|
setup(e) {
|
|
704
|
-
const t = e, n =
|
|
704
|
+
const t = e, n = me("icon"), o = w(() => {
|
|
705
705
|
const { size: r, color: s } = t;
|
|
706
706
|
return !r && !s ? {} : {
|
|
707
|
-
fontSize: Eo(r) ? void 0 :
|
|
707
|
+
fontSize: Eo(r) ? void 0 : pe(r),
|
|
708
708
|
"--color": s
|
|
709
709
|
};
|
|
710
710
|
});
|
|
711
|
-
return (r, s) => (
|
|
711
|
+
return (r, s) => (M(), q("i", Ie({
|
|
712
712
|
class: l(n).b(),
|
|
713
713
|
style: l(o)
|
|
714
714
|
}, r.$attrs), [
|
|
@@ -723,7 +723,7 @@ var nr = /* @__PURE__ */ N({
|
|
|
723
723
|
name: "Close",
|
|
724
724
|
__name: "close",
|
|
725
725
|
setup(e) {
|
|
726
|
-
return (t, n) => (
|
|
726
|
+
return (t, n) => (M(), q("svg", {
|
|
727
727
|
xmlns: "http://www.w3.org/2000/svg",
|
|
728
728
|
viewBox: "0 0 1024 1024"
|
|
729
729
|
}, [
|
|
@@ -745,12 +745,12 @@ const rr = J([
|
|
|
745
745
|
current: 0
|
|
746
746
|
}, ar = Symbol("elIdInjection"), ir = () => G() ? R(ar, Oe) : Oe, Xe = (e) => {
|
|
747
747
|
const t = ir();
|
|
748
|
-
!
|
|
748
|
+
!k && t === Oe && be("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
749
749
|
usage: app.provide(ID_INJECTION_KEY, {
|
|
750
750
|
prefix: number,
|
|
751
751
|
current: number,
|
|
752
752
|
})`);
|
|
753
|
-
const n =
|
|
753
|
+
const n = ft();
|
|
754
754
|
return No(() => l(e) || `${n.value}-id-${t.prefix}-${t.current++}`);
|
|
755
755
|
}, lr = (e) => {
|
|
756
756
|
if (e.tabIndex > 0 || e.tabIndex === 0 && e.getAttribute("tabIndex") !== null)
|
|
@@ -769,15 +769,15 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
769
769
|
default:
|
|
770
770
|
return !1;
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, Te = "focus-trap.focus-after-trapped", we = "focus-trap.focus-after-released", cr = "focus-trap.focusout-prevented", Ze = {
|
|
773
773
|
cancelable: !0,
|
|
774
774
|
bubbles: !1
|
|
775
775
|
}, ur = {
|
|
776
776
|
cancelable: !0,
|
|
777
777
|
bubbles: !1
|
|
778
|
-
}, qe = "focusAfterTrapped", Qe = "focusAfterReleased",
|
|
778
|
+
}, qe = "focusAfterTrapped", Qe = "focusAfterReleased", wt = Symbol("elFocusTrap"), Ae = _(), Ee = _(0), Fe = _(0);
|
|
779
779
|
let ie = 0;
|
|
780
|
-
const
|
|
780
|
+
const St = (e) => {
|
|
781
781
|
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
782
782
|
acceptNode: (o) => {
|
|
783
783
|
const r = o.tagName === "INPUT" && o.type === "hidden";
|
|
@@ -805,7 +805,7 @@ const wt = (e) => {
|
|
|
805
805
|
}
|
|
806
806
|
return !1;
|
|
807
807
|
}, fr = (e) => {
|
|
808
|
-
const t =
|
|
808
|
+
const t = St(e), n = et(t, e), o = et(t.reverse(), e);
|
|
809
809
|
return [n, o];
|
|
810
810
|
}, pr = (e) => e instanceof HTMLInputElement && "select" in e, z = (e, t) => {
|
|
811
811
|
if (e && e.focus) {
|
|
@@ -835,33 +835,33 @@ const vr = () => {
|
|
|
835
835
|
for (const o of e)
|
|
836
836
|
if (z(o, t), document.activeElement !== n)
|
|
837
837
|
return;
|
|
838
|
-
}, nt = vr(), yr = () =>
|
|
839
|
-
Ae.value = "pointer",
|
|
838
|
+
}, nt = vr(), yr = () => Ee.value > Fe.value, le = () => {
|
|
839
|
+
Ae.value = "pointer", Ee.value = window.performance.now();
|
|
840
840
|
}, ot = () => {
|
|
841
|
-
Ae.value = "keyboard",
|
|
841
|
+
Ae.value = "keyboard", Ee.value = window.performance.now();
|
|
842
842
|
}, hr = () => (oe(() => {
|
|
843
843
|
ie === 0 && (document.addEventListener("mousedown", le), document.addEventListener("touchstart", le), document.addEventListener("keydown", ot)), ie++;
|
|
844
|
-
}),
|
|
844
|
+
}), ve(() => {
|
|
845
845
|
ie--, ie <= 0 && (document.removeEventListener("mousedown", le), document.removeEventListener("touchstart", le), document.removeEventListener("keydown", ot));
|
|
846
846
|
}), {
|
|
847
847
|
focusReason: Ae,
|
|
848
|
-
lastUserFocusTimestamp:
|
|
848
|
+
lastUserFocusTimestamp: Ee,
|
|
849
849
|
lastAutomatedFocusTimestamp: Fe
|
|
850
850
|
}), ce = (e) => new CustomEvent(cr, {
|
|
851
851
|
...ur,
|
|
852
852
|
detail: e
|
|
853
|
-
}),
|
|
853
|
+
}), Ot = {
|
|
854
854
|
tab: "Tab",
|
|
855
855
|
esc: "Escape"
|
|
856
856
|
};
|
|
857
857
|
let H = [];
|
|
858
858
|
const rt = (e) => {
|
|
859
|
-
e.code ===
|
|
859
|
+
e.code === Ot.esc && H.forEach((t) => t(e));
|
|
860
860
|
}, gr = (e) => {
|
|
861
861
|
oe(() => {
|
|
862
|
-
H.length === 0 && document.addEventListener("keydown", rt),
|
|
863
|
-
}),
|
|
864
|
-
H = H.filter((t) => t !== e), H.length === 0 &&
|
|
862
|
+
H.length === 0 && document.addEventListener("keydown", rt), k && H.push(e);
|
|
863
|
+
}), ve(() => {
|
|
864
|
+
H = H.filter((t) => t !== e), H.length === 0 && k && document.removeEventListener("keydown", rt);
|
|
865
865
|
});
|
|
866
866
|
}, br = N({
|
|
867
867
|
name: "ElFocusTrap",
|
|
@@ -901,8 +901,8 @@ const rt = (e) => {
|
|
|
901
901
|
}, m = (i) => {
|
|
902
902
|
if (!e.loop && !e.trapped || u.paused)
|
|
903
903
|
return;
|
|
904
|
-
const { code: a, altKey: d, ctrlKey: c, metaKey: g, currentTarget: S, shiftKey: L } = i, { loop: D } = e,
|
|
905
|
-
if (
|
|
904
|
+
const { code: a, altKey: d, ctrlKey: c, metaKey: g, currentTarget: S, shiftKey: L } = i, { loop: D } = e, x = a === Ot.tab && !d && !c && !g, O = document.activeElement;
|
|
905
|
+
if (x && O) {
|
|
906
906
|
const I = S, [A, j] = fr(I);
|
|
907
907
|
if (A && j) {
|
|
908
908
|
if (!L && O === j) {
|
|
@@ -924,7 +924,7 @@ const rt = (e) => {
|
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
};
|
|
927
|
-
ct(
|
|
927
|
+
ct(wt, {
|
|
928
928
|
focusTrapRef: n,
|
|
929
929
|
onKeydown: m
|
|
930
930
|
}), K(() => e.focusTrapEl, (i) => {
|
|
@@ -959,16 +959,16 @@ const rt = (e) => {
|
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
961
|
async function b() {
|
|
962
|
-
await
|
|
962
|
+
await Se();
|
|
963
963
|
const i = l(n);
|
|
964
964
|
if (i) {
|
|
965
965
|
nt.push(u);
|
|
966
966
|
const a = i.contains(document.activeElement) ? o : document.activeElement;
|
|
967
967
|
if (o = a, !i.contains(a)) {
|
|
968
|
-
const c = new Event(
|
|
969
|
-
i.addEventListener(
|
|
968
|
+
const c = new Event(Te, Ze);
|
|
969
|
+
i.addEventListener(Te, f), i.dispatchEvent(c), c.defaultPrevented || Se(() => {
|
|
970
970
|
let g = e.focusStartEl;
|
|
971
|
-
|
|
971
|
+
ye(g) || (z(g), document.activeElement !== g && (g = "first")), g === "first" && mr(St(i), !0), (document.activeElement === a || g === "container") && z(i);
|
|
972
972
|
});
|
|
973
973
|
}
|
|
974
974
|
}
|
|
@@ -976,21 +976,21 @@ const rt = (e) => {
|
|
|
976
976
|
function E() {
|
|
977
977
|
const i = l(n);
|
|
978
978
|
if (i) {
|
|
979
|
-
i.removeEventListener(
|
|
980
|
-
const a = new CustomEvent(
|
|
979
|
+
i.removeEventListener(Te, f);
|
|
980
|
+
const a = new CustomEvent(we, {
|
|
981
981
|
...Ze,
|
|
982
982
|
detail: {
|
|
983
983
|
focusReason: s.value
|
|
984
984
|
}
|
|
985
985
|
});
|
|
986
|
-
i.addEventListener(
|
|
986
|
+
i.addEventListener(we, y), i.dispatchEvent(a), !a.defaultPrevented && (s.value == "keyboard" || !yr() || i.contains(document.activeElement)) && z(o ?? document.body), i.removeEventListener(we, y), nt.remove(u);
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
return oe(() => {
|
|
990
990
|
e.trapped && b(), K(() => e.trapped, (i) => {
|
|
991
991
|
i ? b() : E();
|
|
992
992
|
});
|
|
993
|
-
}),
|
|
993
|
+
}), ve(() => {
|
|
994
994
|
e.trapped && E(), n.value && (n.value.removeEventListener("keydown", m), n.value.removeEventListener("focusin", h), n.value.removeEventListener("focusout", v), n.value = void 0);
|
|
995
995
|
}), {
|
|
996
996
|
onKeydown: m
|
|
@@ -1001,7 +1001,7 @@ function Er(e, t, n, o, r, s) {
|
|
|
1001
1001
|
return C(e.$slots, "default", { handleKeydown: e.onKeydown });
|
|
1002
1002
|
}
|
|
1003
1003
|
var _r = /* @__PURE__ */ se(br, [["render", Er], ["__file", "focus-trap.vue"]]);
|
|
1004
|
-
const
|
|
1004
|
+
const It = re({
|
|
1005
1005
|
to: {
|
|
1006
1006
|
type: J([String, Object]),
|
|
1007
1007
|
required: !0
|
|
@@ -1009,9 +1009,9 @@ const Ot = re({
|
|
|
1009
1009
|
disabled: Boolean
|
|
1010
1010
|
}), Cr = /* @__PURE__ */ N({
|
|
1011
1011
|
__name: "teleport",
|
|
1012
|
-
props:
|
|
1012
|
+
props: It,
|
|
1013
1013
|
setup(e) {
|
|
1014
|
-
return (t, n) => t.disabled ? C(t.$slots, "default", { key: 0 }) : (
|
|
1014
|
+
return (t, n) => t.disabled ? C(t.$slots, "default", { key: 0 }) : (M(), te(xt, {
|
|
1015
1015
|
key: 1,
|
|
1016
1016
|
to: t.to
|
|
1017
1017
|
}, [
|
|
@@ -1022,7 +1022,7 @@ const Ot = re({
|
|
|
1022
1022
|
var Tr = /* @__PURE__ */ se(Cr, [["__file", "teleport.vue"]]);
|
|
1023
1023
|
const wr = De(Tr), Sr = ({ from: e, replacement: t, scope: n, version: o, ref: r, type: s = "API" }, u) => {
|
|
1024
1024
|
K(() => l(u), (m) => {
|
|
1025
|
-
m &&
|
|
1025
|
+
m && be(n, `[${s}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.
|
|
1026
1026
|
For more detail, please visit: ${r}
|
|
1027
1027
|
`);
|
|
1028
1028
|
}, {
|
|
@@ -1030,9 +1030,9 @@ For more detail, please visit: ${r}
|
|
|
1030
1030
|
});
|
|
1031
1031
|
};
|
|
1032
1032
|
var de = /* @__PURE__ */ ((e) => (e[e.TEXT = 1] = "TEXT", e[e.CLASS = 2] = "CLASS", e[e.STYLE = 4] = "STYLE", e[e.PROPS = 8] = "PROPS", e[e.FULL_PROPS = 16] = "FULL_PROPS", e[e.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", e[e.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", e[e.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", e[e.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", e[e.NEED_PATCH = 512] = "NEED_PATCH", e[e.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", e[e.HOISTED = -1] = "HOISTED", e[e.BAIL = -2] = "BAIL", e))(de || {});
|
|
1033
|
-
const
|
|
1033
|
+
const $t = (e) => {
|
|
1034
1034
|
if (!e)
|
|
1035
|
-
return { onClick:
|
|
1035
|
+
return { onClick: _e, onMousedown: _e, onMouseup: _e };
|
|
1036
1036
|
let t = !1, n = !1;
|
|
1037
1037
|
return { onClick: (u) => {
|
|
1038
1038
|
t && n && e(u), t = n = !1;
|
|
@@ -1065,9 +1065,9 @@ var Pr = N({
|
|
|
1065
1065
|
props: Or,
|
|
1066
1066
|
emits: Ir,
|
|
1067
1067
|
setup(e, { slots: t, emit: n }) {
|
|
1068
|
-
const o =
|
|
1068
|
+
const o = me($r), r = (f) => {
|
|
1069
1069
|
n("click", f);
|
|
1070
|
-
}, { onClick: s, onMousedown: u, onMouseup: m } =
|
|
1070
|
+
}, { onClick: s, onMousedown: u, onMouseup: m } = $t(e.customMaskEvent ? void 0 : r);
|
|
1071
1071
|
return () => e.mask ? ee("div", {
|
|
1072
1072
|
class: [o.b(), e.overlayClass],
|
|
1073
1073
|
style: {
|
|
@@ -1076,7 +1076,7 @@ var Pr = N({
|
|
|
1076
1076
|
onClick: s,
|
|
1077
1077
|
onMousedown: u,
|
|
1078
1078
|
onMouseup: m
|
|
1079
|
-
}, [C(t, "default")], de.STYLE | de.CLASS | de.PROPS, ["onClick", "onMouseup", "onMousedown"]) :
|
|
1079
|
+
}, [C(t, "default")], de.STYLE | de.CLASS | de.PROPS, ["onClick", "onMouseup", "onMousedown"]) : Rt("div", {
|
|
1080
1080
|
class: e.overlayClass,
|
|
1081
1081
|
style: {
|
|
1082
1082
|
zIndex: e.zIndex,
|
|
@@ -1089,7 +1089,7 @@ var Pr = N({
|
|
|
1089
1089
|
}, [C(t, "default")]);
|
|
1090
1090
|
}
|
|
1091
1091
|
});
|
|
1092
|
-
const Nr = Pr,
|
|
1092
|
+
const Nr = Pr, Pt = Symbol("dialogInjectionKey"), Nt = re({
|
|
1093
1093
|
center: Boolean,
|
|
1094
1094
|
alignCenter: Boolean,
|
|
1095
1095
|
closeIcon: {
|
|
@@ -1121,8 +1121,8 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1121
1121
|
offsetY: 0
|
|
1122
1122
|
}, s = (v, b) => {
|
|
1123
1123
|
if (e.value) {
|
|
1124
|
-
const { offsetX: E, offsetY: i } = r, a = e.value.getBoundingClientRect(), d = a.left, c = a.top, g = a.width, S = a.height, L = document.documentElement.clientWidth, D = document.documentElement.clientHeight,
|
|
1125
|
-
o?.value || (v = Math.min(Math.max(v,
|
|
1124
|
+
const { offsetX: E, offsetY: i } = r, a = e.value.getBoundingClientRect(), d = a.left, c = a.top, g = a.width, S = a.height, L = document.documentElement.clientWidth, D = document.documentElement.clientHeight, x = -d + E, O = -c + i, I = L - d - g + E, A = D - c - (S < D ? S : 0) + i;
|
|
1125
|
+
o?.value || (v = Math.min(Math.max(v, x), I), b = Math.min(Math.max(b, O), A)), r.offsetX = v, r.offsetY = b, e.value.style.transform = `translate(${pe(v)}, ${pe(b)})`;
|
|
1126
1126
|
}
|
|
1127
1127
|
}, u = (v) => {
|
|
1128
1128
|
const b = v.clientX, E = v.clientY, { offsetX: i, offsetY: a } = r, d = (g) => {
|
|
@@ -1146,7 +1146,7 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1146
1146
|
st(() => {
|
|
1147
1147
|
n.value ? m() : f();
|
|
1148
1148
|
});
|
|
1149
|
-
}),
|
|
1149
|
+
}), ve(() => {
|
|
1150
1150
|
f();
|
|
1151
1151
|
}), {
|
|
1152
1152
|
resetPosition: y,
|
|
@@ -1156,12 +1156,12 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1156
1156
|
e.forEach((n) => {
|
|
1157
1157
|
Jt(n) ? n(t) : n.value = t;
|
|
1158
1158
|
});
|
|
1159
|
-
}, Fr = N({ name: "ElDialogContent" }),
|
|
1159
|
+
}, Fr = N({ name: "ElDialogContent" }), Mr = /* @__PURE__ */ N({
|
|
1160
1160
|
...Fr,
|
|
1161
|
-
props:
|
|
1161
|
+
props: Nt,
|
|
1162
1162
|
emits: Lr,
|
|
1163
1163
|
setup(e, { expose: t }) {
|
|
1164
|
-
const n = e, { t: o } = Ko(), { Close: r } = sr, { dialogRef: s, headerRef: u, bodyId: m, ns: f, style: y } = R(
|
|
1164
|
+
const n = e, { t: o } = Ko(), { Close: r } = sr, { dialogRef: s, headerRef: u, bodyId: m, ns: f, style: y } = R(Pt), { focusTrapRef: h } = R(wt), v = w(() => [
|
|
1165
1165
|
f.b(),
|
|
1166
1166
|
f.is("fullscreen", n.fullscreen),
|
|
1167
1167
|
f.is("draggable", n.draggable),
|
|
@@ -1171,7 +1171,7 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1171
1171
|
return t({
|
|
1172
1172
|
resetPosition: a,
|
|
1173
1173
|
updatePosition: d
|
|
1174
|
-
}), (c, g) => (
|
|
1174
|
+
}), (c, g) => (M(), q("div", {
|
|
1175
1175
|
ref: l(b),
|
|
1176
1176
|
class: B(l(v)),
|
|
1177
1177
|
style: ut(l(y)),
|
|
@@ -1187,9 +1187,9 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1187
1187
|
role: "heading",
|
|
1188
1188
|
"aria-level": c.ariaLevel,
|
|
1189
1189
|
class: B(l(f).e("title"))
|
|
1190
|
-
},
|
|
1190
|
+
}, jt(c.title), 11, ["aria-level"])
|
|
1191
1191
|
]),
|
|
1192
|
-
c.showClose ? (
|
|
1192
|
+
c.showClose ? (M(), q("button", {
|
|
1193
1193
|
key: 0,
|
|
1194
1194
|
"aria-label": l(o)("el.dialog.close"),
|
|
1195
1195
|
class: B(l(f).e("headerbtn")),
|
|
@@ -1200,11 +1200,11 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1200
1200
|
class: B(l(f).e("close"))
|
|
1201
1201
|
}, {
|
|
1202
1202
|
default: P(() => [
|
|
1203
|
-
(
|
|
1203
|
+
(M(), te(Bt(c.closeIcon || l(r))))
|
|
1204
1204
|
]),
|
|
1205
1205
|
_: 1
|
|
1206
1206
|
}, 8, ["class"])
|
|
1207
|
-
], 10, ["aria-label", "onClick"])) :
|
|
1207
|
+
], 10, ["aria-label", "onClick"])) : fe("v-if", !0)
|
|
1208
1208
|
], 2),
|
|
1209
1209
|
Q("div", {
|
|
1210
1210
|
id: l(m),
|
|
@@ -1212,21 +1212,21 @@ const Nr = Pr, $t = Symbol("dialogInjectionKey"), Pt = re({
|
|
|
1212
1212
|
}, [
|
|
1213
1213
|
C(c.$slots, "default")
|
|
1214
1214
|
], 10, ["id"]),
|
|
1215
|
-
c.$slots.footer ? (
|
|
1215
|
+
c.$slots.footer ? (M(), q("footer", {
|
|
1216
1216
|
key: 0,
|
|
1217
1217
|
class: B([l(f).e("footer"), c.footerClass])
|
|
1218
1218
|
}, [
|
|
1219
1219
|
C(c.$slots, "footer")
|
|
1220
|
-
], 2)) :
|
|
1220
|
+
], 2)) : fe("v-if", !0)
|
|
1221
1221
|
], 6));
|
|
1222
1222
|
}
|
|
1223
1223
|
});
|
|
1224
|
-
var
|
|
1225
|
-
const
|
|
1226
|
-
...
|
|
1224
|
+
var kr = /* @__PURE__ */ se(Mr, [["__file", "dialog-content.vue"]]);
|
|
1225
|
+
const xr = re({
|
|
1226
|
+
...Nt,
|
|
1227
1227
|
appendToBody: Boolean,
|
|
1228
1228
|
appendTo: {
|
|
1229
|
-
type:
|
|
1229
|
+
type: It.to.type,
|
|
1230
1230
|
default: "body"
|
|
1231
1231
|
},
|
|
1232
1232
|
beforeClose: {
|
|
@@ -1281,13 +1281,13 @@ const kr = re({
|
|
|
1281
1281
|
opened: () => !0,
|
|
1282
1282
|
close: () => !0,
|
|
1283
1283
|
closed: () => !0,
|
|
1284
|
-
[
|
|
1284
|
+
[Ct]: (e) => _o(e),
|
|
1285
1285
|
openAutoFocus: () => !0,
|
|
1286
1286
|
closeAutoFocus: () => !0
|
|
1287
1287
|
}, jr = (e, t = {}) => {
|
|
1288
1288
|
lt(e) || Ao("[useLockscreen]", "You need to pass a ref param to this function");
|
|
1289
|
-
const n = t.ns ||
|
|
1290
|
-
if (!
|
|
1289
|
+
const n = t.ns || me("popup"), o = w(() => n.bm("parent", "hidden"));
|
|
1290
|
+
if (!k || Je(document.body, o.value))
|
|
1291
1291
|
return;
|
|
1292
1292
|
let r = 0, s = !1, u = "0";
|
|
1293
1293
|
const m = () => {
|
|
@@ -1306,19 +1306,19 @@ const kr = re({
|
|
|
1306
1306
|
}), it(() => m());
|
|
1307
1307
|
}, Br = (e, t) => {
|
|
1308
1308
|
var n;
|
|
1309
|
-
const r = G().emit, { nextZIndex: s } =
|
|
1309
|
+
const r = G().emit, { nextZIndex: s } = ko();
|
|
1310
1310
|
let u = "";
|
|
1311
1311
|
const m = Xe(), f = Xe(), y = _(!1), h = _(!1), v = _(!1), b = _((n = e.zIndex) != null ? n : s());
|
|
1312
1312
|
let E, i;
|
|
1313
1313
|
const a = Yo("namespace", ue), d = w(() => {
|
|
1314
1314
|
const T = {}, F = `--${a.value}-dialog`;
|
|
1315
|
-
return e.fullscreen || (e.top && (T[`${F}-margin-top`] = e.top), e.width && (T[`${F}-width`] =
|
|
1315
|
+
return e.fullscreen || (e.top && (T[`${F}-margin-top`] = e.top), e.width && (T[`${F}-width`] = pe(e.width))), T;
|
|
1316
1316
|
}), c = w(() => e.alignCenter ? { display: "flex" } : {});
|
|
1317
1317
|
function g() {
|
|
1318
1318
|
r("opened");
|
|
1319
1319
|
}
|
|
1320
1320
|
function S() {
|
|
1321
|
-
r("closed"), r(
|
|
1321
|
+
r("closed"), r(Ct, !1), e.destroyOnClose && (v.value = !1);
|
|
1322
1322
|
}
|
|
1323
1323
|
function L() {
|
|
1324
1324
|
r("close");
|
|
@@ -1326,20 +1326,20 @@ const kr = re({
|
|
|
1326
1326
|
function D() {
|
|
1327
1327
|
i?.(), E?.(), e.openDelay && e.openDelay > 0 ? { stop: E } = Ve(() => A(), e.openDelay) : A();
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function x() {
|
|
1330
1330
|
E?.(), i?.(), e.closeDelay && e.closeDelay > 0 ? { stop: i } = Ve(() => j(), e.closeDelay) : j();
|
|
1331
1331
|
}
|
|
1332
1332
|
function O() {
|
|
1333
1333
|
function T(F) {
|
|
1334
1334
|
F || (h.value = !0, y.value = !1);
|
|
1335
1335
|
}
|
|
1336
|
-
e.beforeClose ? e.beforeClose(T) :
|
|
1336
|
+
e.beforeClose ? e.beforeClose(T) : x();
|
|
1337
1337
|
}
|
|
1338
1338
|
function I() {
|
|
1339
1339
|
e.closeOnClickModal && O();
|
|
1340
1340
|
}
|
|
1341
1341
|
function A() {
|
|
1342
|
-
|
|
1342
|
+
k && (y.value = !0);
|
|
1343
1343
|
}
|
|
1344
1344
|
function j() {
|
|
1345
1345
|
y.value = !1;
|
|
@@ -1350,12 +1350,12 @@ const kr = re({
|
|
|
1350
1350
|
function $() {
|
|
1351
1351
|
r("closeAutoFocus");
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Dt(T) {
|
|
1354
1354
|
var F;
|
|
1355
1355
|
((F = T.detail) == null ? void 0 : F.focusReason) === "pointer" && T.preventDefault();
|
|
1356
1356
|
}
|
|
1357
1357
|
e.lockScroll && jr(y);
|
|
1358
|
-
function
|
|
1358
|
+
function At() {
|
|
1359
1359
|
e.closeOnPressEscape && O();
|
|
1360
1360
|
}
|
|
1361
1361
|
return K(() => e.zIndex, () => {
|
|
@@ -1363,9 +1363,9 @@ const kr = re({
|
|
|
1363
1363
|
b.value = (T = e.zIndex) != null ? T : s();
|
|
1364
1364
|
}), K(() => e.modelValue, (T) => {
|
|
1365
1365
|
var F;
|
|
1366
|
-
T ? (h.value = !1, D(), v.value = !0, b.value = (F = e.zIndex) != null ? F : s(),
|
|
1366
|
+
T ? (h.value = !1, D(), v.value = !0, b.value = (F = e.zIndex) != null ? F : s(), Se(() => {
|
|
1367
1367
|
r("open"), t.value && (t.value.parentElement.scrollTop = 0, t.value.parentElement.scrollLeft = 0, t.value.scrollTop = 0);
|
|
1368
|
-
})) : y.value &&
|
|
1368
|
+
})) : y.value && x();
|
|
1369
1369
|
}), K(() => e.fullscreen, (T) => {
|
|
1370
1370
|
t.value && (T ? (u = t.value.style.transform, t.value.style.transform = "") : t.value.style.transform = u);
|
|
1371
1371
|
}), oe(() => {
|
|
@@ -1376,12 +1376,12 @@ const kr = re({
|
|
|
1376
1376
|
beforeLeave: L,
|
|
1377
1377
|
handleClose: O,
|
|
1378
1378
|
onModalClick: I,
|
|
1379
|
-
close:
|
|
1379
|
+
close: x,
|
|
1380
1380
|
doClose: j,
|
|
1381
1381
|
onOpenAutoFocus: p,
|
|
1382
1382
|
onCloseAutoFocus: $,
|
|
1383
|
-
onCloseRequested:
|
|
1384
|
-
onFocusoutPrevented:
|
|
1383
|
+
onCloseRequested: At,
|
|
1384
|
+
onFocusoutPrevented: Dt,
|
|
1385
1385
|
titleId: m,
|
|
1386
1386
|
bodyId: f,
|
|
1387
1387
|
closed: h,
|
|
@@ -1396,10 +1396,10 @@ const kr = re({
|
|
|
1396
1396
|
inheritAttrs: !1
|
|
1397
1397
|
}), Kr = /* @__PURE__ */ N({
|
|
1398
1398
|
...zr,
|
|
1399
|
-
props:
|
|
1399
|
+
props: xr,
|
|
1400
1400
|
emits: Rr,
|
|
1401
1401
|
setup(e, { expose: t }) {
|
|
1402
|
-
const n = e, o =
|
|
1402
|
+
const n = e, o = zt();
|
|
1403
1403
|
Sr({
|
|
1404
1404
|
scope: "el-dialog",
|
|
1405
1405
|
from: "the title slot",
|
|
@@ -1407,7 +1407,7 @@ const kr = re({
|
|
|
1407
1407
|
version: "3.0.0",
|
|
1408
1408
|
ref: "https://element-plus.org/en-US/component/dialog.html#slots"
|
|
1409
1409
|
}, w(() => !!o.title));
|
|
1410
|
-
const r =
|
|
1410
|
+
const r = me("dialog"), s = _(), u = _(), m = _(), {
|
|
1411
1411
|
visible: f,
|
|
1412
1412
|
titleId: y,
|
|
1413
1413
|
bodyId: h,
|
|
@@ -1422,10 +1422,10 @@ const kr = re({
|
|
|
1422
1422
|
onModalClick: S,
|
|
1423
1423
|
onOpenAutoFocus: L,
|
|
1424
1424
|
onCloseAutoFocus: D,
|
|
1425
|
-
onCloseRequested:
|
|
1425
|
+
onCloseRequested: x,
|
|
1426
1426
|
onFocusoutPrevented: O
|
|
1427
1427
|
} = Br(n, s);
|
|
1428
|
-
ct(
|
|
1428
|
+
ct(Pt, {
|
|
1429
1429
|
dialogRef: s,
|
|
1430
1430
|
headerRef: u,
|
|
1431
1431
|
bodyId: h,
|
|
@@ -1433,7 +1433,7 @@ const kr = re({
|
|
|
1433
1433
|
rendered: E,
|
|
1434
1434
|
style: v
|
|
1435
1435
|
});
|
|
1436
|
-
const I =
|
|
1436
|
+
const I = $t(S), A = w(() => n.draggable && !n.fullscreen);
|
|
1437
1437
|
return t({
|
|
1438
1438
|
visible: f,
|
|
1439
1439
|
dialogContentRef: m,
|
|
@@ -1442,12 +1442,12 @@ const kr = re({
|
|
|
1442
1442
|
(p = m.value) == null || p.resetPosition();
|
|
1443
1443
|
},
|
|
1444
1444
|
handleClose: g
|
|
1445
|
-
}), (p, $) => (
|
|
1445
|
+
}), (p, $) => (M(), te(l(wr), {
|
|
1446
1446
|
to: p.appendTo,
|
|
1447
1447
|
disabled: p.appendTo !== "body" ? !1 : !p.appendToBody
|
|
1448
1448
|
}, {
|
|
1449
1449
|
default: P(() => [
|
|
1450
|
-
ee(
|
|
1450
|
+
ee(Kt, {
|
|
1451
1451
|
name: "dialog-fade",
|
|
1452
1452
|
onAfterEnter: l(a),
|
|
1453
1453
|
onAfterLeave: l(d),
|
|
@@ -1455,7 +1455,7 @@ const kr = re({
|
|
|
1455
1455
|
persisted: ""
|
|
1456
1456
|
}, {
|
|
1457
1457
|
default: P(() => [
|
|
1458
|
-
|
|
1458
|
+
Ut(ee(l(Nr), {
|
|
1459
1459
|
"custom-mask-event": "",
|
|
1460
1460
|
mask: p.modal,
|
|
1461
1461
|
"overlay-class": p.modalClass,
|
|
@@ -1481,10 +1481,10 @@ const kr = re({
|
|
|
1481
1481
|
onFocusAfterTrapped: l(L),
|
|
1482
1482
|
onFocusAfterReleased: l(D),
|
|
1483
1483
|
onFocusoutPrevented: l(O),
|
|
1484
|
-
onReleaseRequested: l(
|
|
1484
|
+
onReleaseRequested: l(x)
|
|
1485
1485
|
}, {
|
|
1486
1486
|
default: P(() => [
|
|
1487
|
-
l(E) ? (
|
|
1487
|
+
l(E) ? (M(), te(kr, Ie({
|
|
1488
1488
|
key: 0,
|
|
1489
1489
|
ref_key: "dialogContentRef",
|
|
1490
1490
|
ref: m
|
|
@@ -1502,7 +1502,7 @@ const kr = re({
|
|
|
1502
1502
|
title: p.title,
|
|
1503
1503
|
"aria-level": p.headerAriaLevel,
|
|
1504
1504
|
onClose: l(g)
|
|
1505
|
-
}),
|
|
1505
|
+
}), dt({
|
|
1506
1506
|
header: P(() => [
|
|
1507
1507
|
p.$slots.title ? C(p.$slots, "title", { key: 1 }) : C(p.$slots, "header", {
|
|
1508
1508
|
key: 0,
|
|
@@ -1522,7 +1522,7 @@ const kr = re({
|
|
|
1522
1522
|
C(p.$slots, "footer")
|
|
1523
1523
|
])
|
|
1524
1524
|
} : void 0
|
|
1525
|
-
]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose"])) :
|
|
1525
|
+
]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose"])) : fe("v-if", !0)
|
|
1526
1526
|
]),
|
|
1527
1527
|
_: 3
|
|
1528
1528
|
}, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
|
|
@@ -1541,40 +1541,45 @@ const kr = re({
|
|
|
1541
1541
|
}
|
|
1542
1542
|
});
|
|
1543
1543
|
var Ur = /* @__PURE__ */ se(Kr, [["__file", "dialog.vue"]]);
|
|
1544
|
-
const
|
|
1544
|
+
const Lt = De(Ur), Vr = /* @__PURE__ */ N({
|
|
1545
1545
|
name: "RaDialog",
|
|
1546
1546
|
__name: "index",
|
|
1547
1547
|
props: {
|
|
1548
|
-
|
|
1548
|
+
// @doc 原生appendToBody默认设置为ture
|
|
1549
|
+
appendToBody: { type: Boolean, default: !0 }
|
|
1549
1550
|
},
|
|
1550
1551
|
setup(e) {
|
|
1551
1552
|
return (t, n) => {
|
|
1552
|
-
const o =
|
|
1553
|
-
return
|
|
1554
|
-
header: P(() => [
|
|
1555
|
-
C(t.$slots, "header", {}, void 0, !0)
|
|
1556
|
-
]),
|
|
1557
|
-
footer: P(() => [
|
|
1558
|
-
C(t.$slots, "footer", {}, void 0, !0)
|
|
1559
|
-
]),
|
|
1553
|
+
const o = Lt;
|
|
1554
|
+
return M(), te(o, Ie(t.$attrs, { "append-to-body": e.appendToBody }), dt({
|
|
1560
1555
|
default: P(() => [
|
|
1561
|
-
C(t.$slots, "default", {}
|
|
1556
|
+
t.$slots.default ? C(t.$slots, "default", { key: 0 }) : fe("", !0)
|
|
1562
1557
|
]),
|
|
1563
|
-
_:
|
|
1564
|
-
},
|
|
1558
|
+
_: 2
|
|
1559
|
+
}, [
|
|
1560
|
+
t.$slots.header ? {
|
|
1561
|
+
name: "header",
|
|
1562
|
+
fn: P(() => [
|
|
1563
|
+
C(t.$slots, "header")
|
|
1564
|
+
]),
|
|
1565
|
+
key: "0"
|
|
1566
|
+
} : void 0,
|
|
1567
|
+
t.$slots.footer ? {
|
|
1568
|
+
name: "footer",
|
|
1569
|
+
fn: P(() => [
|
|
1570
|
+
C(t.$slots, "footer")
|
|
1571
|
+
]),
|
|
1572
|
+
key: "1"
|
|
1573
|
+
} : void 0
|
|
1574
|
+
]), 1040, ["append-to-body"]);
|
|
1565
1575
|
};
|
|
1566
1576
|
}
|
|
1567
|
-
}), Yr = (e
|
|
1568
|
-
|
|
1569
|
-
for (const [o, r] of t)
|
|
1570
|
-
n[o] = r;
|
|
1571
|
-
return n;
|
|
1572
|
-
}, Hr = /* @__PURE__ */ Yr(Vr, [["__scopeId", "data-v-e6ee064f"]]), Gr = [Hr], Jr = (e) => {
|
|
1573
|
-
e.use(Nt), Gr.forEach((t) => {
|
|
1577
|
+
}), Yr = [Vr], Gr = (e) => {
|
|
1578
|
+
e.use(Lt), Yr.forEach((t) => {
|
|
1574
1579
|
e.component(t.name, t);
|
|
1575
1580
|
});
|
|
1576
1581
|
};
|
|
1577
1582
|
export {
|
|
1578
|
-
|
|
1579
|
-
|
|
1583
|
+
Vr as RaDialog,
|
|
1584
|
+
Gr as default
|
|
1580
1585
|
};
|