wj-elements 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-2266bd6e.js +103 -0
- package/dist/localize-762a9f0f.js +43 -0
- package/dist/wj-animation.js +6 -0
- package/dist/wj-aside.js +8 -10
- package/dist/wj-avatar.js +19 -21
- package/dist/wj-badge.js +16 -16
- package/dist/wj-breadcrumb.js +7 -11
- package/dist/wj-breadcrumbs.js +5 -7
- package/dist/wj-button-group.js +11 -13
- package/dist/wj-button.js +36 -39
- package/dist/wj-card-content.js +11 -13
- package/dist/wj-card-controls.js +6 -8
- package/dist/wj-card-header.js +11 -13
- package/dist/wj-card-subtitle.js +9 -11
- package/dist/wj-card-title.js +7 -9
- package/dist/wj-card.js +13 -15
- package/dist/wj-carousel-item.js +32 -0
- package/dist/wj-carousel.js +178 -0
- package/dist/wj-checkbox.js +11 -11
- package/dist/wj-chip.js +17 -17
- package/dist/wj-col.js +11 -12
- package/dist/wj-color-picker.js +192 -179
- package/dist/wj-container.js +7 -9
- package/dist/wj-copy-button.js +1 -3
- package/dist/wj-dialog.js +20 -22
- package/dist/wj-divider.js +7 -9
- package/dist/wj-dropdown.js +10 -14
- package/dist/wj-element.js +9 -9
- package/dist/wj-file-upload-item.js +63 -0
- package/dist/wj-file-upload.js +221 -0
- package/dist/wj-footer.js +9 -11
- package/dist/wj-form.js +6 -8
- package/dist/wj-format-digital.js +51 -0
- package/dist/wj-grid.js +9 -10
- package/dist/wj-header.js +9 -11
- package/dist/wj-icon-picker.js +78 -58
- package/dist/wj-icon.js +45 -48
- package/dist/wj-img-comparer.js +12 -14
- package/dist/wj-img.js +14 -16
- package/dist/wj-infinite-scroll.js +27 -22
- package/dist/wj-input-file.js +47 -0
- package/dist/wj-input.js +30 -23
- package/dist/wj-item.js +1 -3
- package/dist/wj-label.js +10 -10
- package/dist/wj-list.js +1 -3
- package/dist/wj-main.js +1 -3
- package/dist/wj-masonry.js +71518 -0
- package/dist/wj-master.js +287 -253
- package/dist/wj-menu-button.js +10 -12
- package/dist/wj-menu-item.js +49 -46
- package/dist/wj-menu-label.js +2 -2
- package/dist/wj-menu.js +8 -10
- package/dist/wj-popup.js +89 -88
- package/dist/wj-progress-bar.js +14 -16
- package/dist/wj-radio-group.js +5 -7
- package/dist/wj-radio.js +13 -15
- package/dist/wj-rate.js +127 -0
- package/dist/wj-relative-time.js +50 -0
- package/dist/wj-router-link.js +11 -13
- package/dist/wj-row.js +11 -12
- package/dist/wj-slider.js +6 -6
- package/dist/wj-split-view.js +1 -3
- package/dist/wj-textarea.js +17 -19
- package/dist/wj-thumbnail.js +12 -14
- package/dist/wj-toast.js +1 -1
- package/dist/wj-toggle.js +9 -9
- package/dist/wj-toolbar.js +13 -15
- package/dist/wj-tooltip.js +16 -18
- package/dist/wj-visually-hidden.js +6 -8
- package/package.json +1 -1
- package/dist/style.css +0 -3
package/dist/wj-popup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ot = Object.defineProperty;
|
|
2
2
|
var Lt = (t, e, n) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var ut = (t, e, n) => (Lt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
-
import Tt, { event as
|
|
4
|
+
import Tt, { event as U } from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
6
|
const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
|
|
7
7
|
x: t,
|
|
@@ -18,10 +18,10 @@ const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
|
|
|
18
18
|
function Dt(t, e, n) {
|
|
19
19
|
return R(t, N(e, n));
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function K(t, e) {
|
|
22
22
|
return typeof t == "function" ? t(e) : t;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function V(t) {
|
|
25
25
|
return t.split("-")[0];
|
|
26
26
|
}
|
|
27
27
|
function _(t) {
|
|
@@ -34,7 +34,7 @@ function rt(t) {
|
|
|
34
34
|
return t === "y" ? "height" : "width";
|
|
35
35
|
}
|
|
36
36
|
function nt(t) {
|
|
37
|
-
return ["top", "bottom"].includes(
|
|
37
|
+
return ["top", "bottom"].includes(V(t)) ? "y" : "x";
|
|
38
38
|
}
|
|
39
39
|
function ct(t) {
|
|
40
40
|
return kt(nt(t));
|
|
@@ -45,14 +45,14 @@ function Wt(t, e, n) {
|
|
|
45
45
|
let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
46
46
|
return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Ht(t) {
|
|
49
49
|
const e = tt(t);
|
|
50
50
|
return [st(t), e, st(e)];
|
|
51
51
|
}
|
|
52
52
|
function st(t) {
|
|
53
53
|
return t.replace(/start|end/g, (e) => St[e]);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Mt(t, e, n) {
|
|
56
56
|
const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
57
57
|
switch (t) {
|
|
58
58
|
case "top":
|
|
@@ -65,9 +65,9 @@ function Ft(t, e, n) {
|
|
|
65
65
|
return [];
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ft(t, e, n, o) {
|
|
69
69
|
const i = _(t);
|
|
70
|
-
let s =
|
|
70
|
+
let s = Mt(V(t), n === "start", o);
|
|
71
71
|
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), s;
|
|
72
72
|
}
|
|
73
73
|
function tt(t) {
|
|
@@ -104,7 +104,7 @@ function ht(t, e, n) {
|
|
|
104
104
|
reference: o,
|
|
105
105
|
floating: i
|
|
106
106
|
} = t;
|
|
107
|
-
const s = nt(e), r = ct(e), l = rt(r), c =
|
|
107
|
+
const s = nt(e), r = ct(e), l = rt(r), c = V(e), a = s === "y", d = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
|
|
108
108
|
let f;
|
|
109
109
|
switch (c) {
|
|
110
110
|
case "top":
|
|
@@ -227,7 +227,7 @@ async function wt(t, e) {
|
|
|
227
227
|
elementContext: u = "floating",
|
|
228
228
|
altBoundary: p = !1,
|
|
229
229
|
padding: f = 0
|
|
230
|
-
} =
|
|
230
|
+
} = K(e, t), h = gt(f), w = l[p ? u === "floating" ? "reference" : "floating" : u], g = et(await s.getClippingRect({
|
|
231
231
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
232
232
|
boundary: a,
|
|
233
233
|
rootBoundary: d,
|
|
@@ -254,7 +254,7 @@ async function wt(t, e) {
|
|
|
254
254
|
right: (x.right - g.right + h.right) / A.x
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const jt = (t) => ({
|
|
258
258
|
name: "arrow",
|
|
259
259
|
options: t,
|
|
260
260
|
async fn(e) {
|
|
@@ -269,7 +269,7 @@ const Vt = (t) => ({
|
|
|
269
269
|
} = e, {
|
|
270
270
|
element: a,
|
|
271
271
|
padding: d = 0
|
|
272
|
-
} =
|
|
272
|
+
} = K(t, e) || {};
|
|
273
273
|
if (a == null)
|
|
274
274
|
return {};
|
|
275
275
|
const u = gt(d), p = {
|
|
@@ -278,7 +278,7 @@ const Vt = (t) => ({
|
|
|
278
278
|
}, f = ct(i), h = rt(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", v = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", A = s.reference[h] + s.reference[f] - p[f] - s.floating[h], x = p[f] - s.reference[f], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
|
|
279
279
|
let E = b ? b[y] : 0;
|
|
280
280
|
(!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = l.floating[y] || s.floating[h]);
|
|
281
|
-
const P = A / 2 - x / 2,
|
|
281
|
+
const P = A / 2 - x / 2, F = E / 2 - m[h] / 2 - 1, Y = N(u[g], F), X = N(u[v], F), L = Y, q = E - m[h] - X, C = E / 2 - m[h] / 2 + P, S = Dt(L, C, q), D = !c.arrow && _(i) != null && C != S && s.reference[h] / 2 - (C < L ? Y : X) - m[h] / 2 < 0, W = D ? C < L ? C - L : C - q : 0;
|
|
282
282
|
return {
|
|
283
283
|
[f]: p[f] + W,
|
|
284
284
|
data: {
|
|
@@ -291,7 +291,7 @@ const Vt = (t) => ({
|
|
|
291
291
|
reset: D
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
}),
|
|
294
|
+
}), Vt = function(t) {
|
|
295
295
|
return t === void 0 && (t = {}), {
|
|
296
296
|
name: "flip",
|
|
297
297
|
options: t,
|
|
@@ -312,11 +312,11 @@ const Vt = (t) => ({
|
|
|
312
312
|
fallbackAxisSideDirection: h = "none",
|
|
313
313
|
flipAlignment: m = !0,
|
|
314
314
|
...w
|
|
315
|
-
} =
|
|
315
|
+
} = K(t, e);
|
|
316
316
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
317
317
|
return {};
|
|
318
|
-
const g =
|
|
319
|
-
!p && h !== "none" && A.push(...
|
|
318
|
+
const g = V(i), v = V(l) === l, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (v || !m ? [tt(l)] : Ht(l));
|
|
319
|
+
!p && h !== "none" && A.push(...Ft(l, m, h, y));
|
|
320
320
|
const x = [l, ...A], b = await wt(e, w), E = [];
|
|
321
321
|
let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
322
322
|
if (d && E.push(b[g]), u) {
|
|
@@ -327,8 +327,8 @@ const Vt = (t) => ({
|
|
|
327
327
|
placement: i,
|
|
328
328
|
overflows: E
|
|
329
329
|
}], !E.every((L) => L <= 0)) {
|
|
330
|
-
var
|
|
331
|
-
const L = (((
|
|
330
|
+
var F, Y;
|
|
331
|
+
const L = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, q = x[L];
|
|
332
332
|
if (q)
|
|
333
333
|
return {
|
|
334
334
|
data: {
|
|
@@ -368,7 +368,7 @@ async function zt(t, e) {
|
|
|
368
368
|
placement: n,
|
|
369
369
|
platform: o,
|
|
370
370
|
elements: i
|
|
371
|
-
} = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r =
|
|
371
|
+
} = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = V(n), l = _(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, u = K(e, t);
|
|
372
372
|
let {
|
|
373
373
|
mainAxis: p,
|
|
374
374
|
crossAxis: f,
|
|
@@ -391,7 +391,7 @@ async function zt(t, e) {
|
|
|
391
391
|
y: f * d
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
|
-
const
|
|
394
|
+
const $t = function(t) {
|
|
395
395
|
return t === void 0 && (t = 0), {
|
|
396
396
|
name: "offset",
|
|
397
397
|
options: t,
|
|
@@ -407,7 +407,7 @@ const It = function(t) {
|
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
409
|
};
|
|
410
|
-
},
|
|
410
|
+
}, It = function(t) {
|
|
411
411
|
return t === void 0 && (t = {}), {
|
|
412
412
|
name: "size",
|
|
413
413
|
options: t,
|
|
@@ -421,7 +421,7 @@ const It = function(t) {
|
|
|
421
421
|
apply: r = () => {
|
|
422
422
|
},
|
|
423
423
|
...l
|
|
424
|
-
} =
|
|
424
|
+
} = K(t, e), c = await wt(e, l), a = V(n), d = _(n), u = nt(n) === "y", {
|
|
425
425
|
width: p,
|
|
426
426
|
height: f
|
|
427
427
|
} = o.floating;
|
|
@@ -437,8 +437,8 @@ const It = function(t) {
|
|
|
437
437
|
y = d || v ? N(w, b) : b;
|
|
438
438
|
}
|
|
439
439
|
if (v && !d) {
|
|
440
|
-
const b = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0),
|
|
441
|
-
u ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : R(c.left, c.right)) : y = f - 2 * (P !== 0 ||
|
|
440
|
+
const b = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0), F = R(c.bottom, 0);
|
|
441
|
+
u ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : R(c.left, c.right)) : y = f - 2 * (P !== 0 || F !== 0 ? P + F : R(c.top, c.bottom));
|
|
442
442
|
}
|
|
443
443
|
await r({
|
|
444
444
|
...e,
|
|
@@ -454,21 +454,21 @@ const It = function(t) {
|
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
456
|
};
|
|
457
|
-
function
|
|
457
|
+
function j(t) {
|
|
458
458
|
return xt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
459
459
|
}
|
|
460
460
|
function O(t) {
|
|
461
461
|
var e;
|
|
462
462
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function M(t) {
|
|
465
465
|
var e;
|
|
466
466
|
return (e = (xt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
467
467
|
}
|
|
468
468
|
function xt(t) {
|
|
469
469
|
return t instanceof Node || t instanceof O(t).Node;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function H(t) {
|
|
472
472
|
return t instanceof Element || t instanceof O(t).Element;
|
|
473
473
|
}
|
|
474
474
|
function k(t) {
|
|
@@ -477,7 +477,7 @@ function k(t) {
|
|
|
477
477
|
function dt(t) {
|
|
478
478
|
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof O(t).ShadowRoot;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function G(t) {
|
|
481
481
|
const {
|
|
482
482
|
overflow: e,
|
|
483
483
|
overflowX: n,
|
|
@@ -487,18 +487,18 @@ function J(t) {
|
|
|
487
487
|
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
|
|
488
488
|
}
|
|
489
489
|
function _t(t) {
|
|
490
|
-
return ["table", "td", "th"].includes(
|
|
490
|
+
return ["table", "td", "th"].includes(j(t));
|
|
491
491
|
}
|
|
492
492
|
function lt(t) {
|
|
493
493
|
const e = at(), n = T(t);
|
|
494
494
|
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
|
|
495
495
|
}
|
|
496
496
|
function Yt(t) {
|
|
497
|
-
let e =
|
|
497
|
+
let e = I(t);
|
|
498
498
|
for (; k(e) && !ot(e); ) {
|
|
499
499
|
if (lt(e))
|
|
500
500
|
return e;
|
|
501
|
-
e =
|
|
501
|
+
e = I(e);
|
|
502
502
|
}
|
|
503
503
|
return null;
|
|
504
504
|
}
|
|
@@ -506,13 +506,13 @@ function at() {
|
|
|
506
506
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
507
507
|
}
|
|
508
508
|
function ot(t) {
|
|
509
|
-
return ["html", "body", "#document"].includes(
|
|
509
|
+
return ["html", "body", "#document"].includes(j(t));
|
|
510
510
|
}
|
|
511
511
|
function T(t) {
|
|
512
512
|
return O(t).getComputedStyle(t);
|
|
513
513
|
}
|
|
514
514
|
function it(t) {
|
|
515
|
-
return
|
|
515
|
+
return H(t) ? {
|
|
516
516
|
scrollLeft: t.scrollLeft,
|
|
517
517
|
scrollTop: t.scrollTop
|
|
518
518
|
} : {
|
|
@@ -520,27 +520,27 @@ function it(t) {
|
|
|
520
520
|
scrollTop: t.pageYOffset
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
523
|
+
function I(t) {
|
|
524
|
+
if (j(t) === "html")
|
|
525
525
|
return t;
|
|
526
526
|
const e = (
|
|
527
527
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
528
528
|
t.assignedSlot || // DOM Element detected.
|
|
529
529
|
t.parentNode || // ShadowRoot detected.
|
|
530
530
|
dt(t) && t.host || // Fallback.
|
|
531
|
-
|
|
531
|
+
M(t)
|
|
532
532
|
);
|
|
533
533
|
return dt(e) ? e.host : e;
|
|
534
534
|
}
|
|
535
535
|
function vt(t) {
|
|
536
|
-
const e =
|
|
537
|
-
return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) &&
|
|
536
|
+
const e = I(t);
|
|
537
|
+
return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && G(e) ? e : vt(e);
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function J(t, e, n) {
|
|
540
540
|
var o;
|
|
541
541
|
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
542
542
|
const i = vt(t), s = i === ((o = t.ownerDocument) == null ? void 0 : o.body), r = O(i);
|
|
543
|
-
return s ? e.concat(r, r.visualViewport || [],
|
|
543
|
+
return s ? e.concat(r, r.visualViewport || [], G(i) ? i : [], r.frameElement && n ? J(r.frameElement) : []) : e.concat(i, J(i, [], n));
|
|
544
544
|
}
|
|
545
545
|
function yt(t) {
|
|
546
546
|
const e = T(t);
|
|
@@ -553,9 +553,9 @@ function yt(t) {
|
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
555
|
function ft(t) {
|
|
556
|
-
return
|
|
556
|
+
return H(t) ? t : t.contextElement;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function $(t) {
|
|
559
559
|
const e = ft(t);
|
|
560
560
|
if (!k(e))
|
|
561
561
|
return B(1);
|
|
@@ -585,14 +585,14 @@ function z(t, e, n, o) {
|
|
|
585
585
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
586
586
|
const i = t.getBoundingClientRect(), s = ft(t);
|
|
587
587
|
let r = B(1);
|
|
588
|
-
e && (o ?
|
|
588
|
+
e && (o ? H(o) && (r = $(o)) : r = $(t));
|
|
589
589
|
const l = qt(s, n, o) ? bt(s) : B(0);
|
|
590
590
|
let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, u = i.height / r.y;
|
|
591
591
|
if (s) {
|
|
592
|
-
const p = O(s), f = o &&
|
|
592
|
+
const p = O(s), f = o && H(o) ? O(o) : o;
|
|
593
593
|
let h = p.frameElement;
|
|
594
594
|
for (; h && o && f !== p; ) {
|
|
595
|
-
const m =
|
|
595
|
+
const m = $(h), w = h.getBoundingClientRect(), g = T(h), v = w.left + (h.clientLeft + parseFloat(g.paddingLeft)) * m.x, y = w.top + (h.clientTop + parseFloat(g.paddingTop)) * m.y;
|
|
596
596
|
c *= m.x, a *= m.y, d *= m.x, u *= m.y, c += v, a += y, h = O(h).frameElement;
|
|
597
597
|
}
|
|
598
598
|
}
|
|
@@ -603,13 +603,13 @@ function z(t, e, n, o) {
|
|
|
603
603
|
y: a
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Ut(t) {
|
|
607
607
|
let {
|
|
608
608
|
rect: e,
|
|
609
609
|
offsetParent: n,
|
|
610
610
|
strategy: o
|
|
611
611
|
} = t;
|
|
612
|
-
const i = k(n), s =
|
|
612
|
+
const i = k(n), s = M(n);
|
|
613
613
|
if (n === s)
|
|
614
614
|
return e;
|
|
615
615
|
let r = {
|
|
@@ -617,9 +617,9 @@ function Kt(t) {
|
|
|
617
617
|
scrollTop: 0
|
|
618
618
|
}, l = B(1);
|
|
619
619
|
const c = B(0);
|
|
620
|
-
if ((i || !i && o !== "fixed") && ((
|
|
620
|
+
if ((i || !i && o !== "fixed") && ((j(n) !== "body" || G(s)) && (r = it(n)), k(n))) {
|
|
621
621
|
const a = z(n);
|
|
622
|
-
l =
|
|
622
|
+
l = $(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
|
|
623
623
|
}
|
|
624
624
|
return {
|
|
625
625
|
width: e.width * l.x,
|
|
@@ -628,14 +628,14 @@ function Kt(t) {
|
|
|
628
628
|
y: e.y * l.y - r.scrollTop * l.y + c.y
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Jt(t) {
|
|
632
632
|
return Array.from(t.getClientRects());
|
|
633
633
|
}
|
|
634
634
|
function At(t) {
|
|
635
|
-
return z(
|
|
635
|
+
return z(M(t)).left + it(t).scrollLeft;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
const e =
|
|
637
|
+
function Kt(t) {
|
|
638
|
+
const e = M(t), n = it(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
639
639
|
let r = -n.scrollLeft + At(t);
|
|
640
640
|
const l = -n.scrollTop;
|
|
641
641
|
return T(o).direction === "rtl" && (r += R(e.clientWidth, o.clientWidth) - i), {
|
|
@@ -646,7 +646,7 @@ function Jt(t) {
|
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
648
|
function Gt(t, e) {
|
|
649
|
-
const n = O(t), o =
|
|
649
|
+
const n = O(t), o = M(t), i = n.visualViewport;
|
|
650
650
|
let s = o.clientWidth, r = o.clientHeight, l = 0, c = 0;
|
|
651
651
|
if (i) {
|
|
652
652
|
s = i.width, r = i.height;
|
|
@@ -661,7 +661,7 @@ function Gt(t, e) {
|
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function Qt(t, e) {
|
|
664
|
-
const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ?
|
|
664
|
+
const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = k(t) ? $(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = o * s.y;
|
|
665
665
|
return {
|
|
666
666
|
width: r,
|
|
667
667
|
height: l,
|
|
@@ -674,8 +674,8 @@ function pt(t, e, n) {
|
|
|
674
674
|
if (e === "viewport")
|
|
675
675
|
o = Gt(t, n);
|
|
676
676
|
else if (e === "document")
|
|
677
|
-
o =
|
|
678
|
-
else if (
|
|
677
|
+
o = Kt(M(t));
|
|
678
|
+
else if (H(e))
|
|
679
679
|
o = Qt(e, n);
|
|
680
680
|
else {
|
|
681
681
|
const i = bt(t);
|
|
@@ -688,19 +688,19 @@ function pt(t, e, n) {
|
|
|
688
688
|
return et(o);
|
|
689
689
|
}
|
|
690
690
|
function Et(t, e) {
|
|
691
|
-
const n =
|
|
692
|
-
return n === e || !
|
|
691
|
+
const n = I(t);
|
|
692
|
+
return n === e || !H(n) || ot(n) ? !1 : T(n).position === "fixed" || Et(n, e);
|
|
693
693
|
}
|
|
694
694
|
function Zt(t, e) {
|
|
695
695
|
const n = e.get(t);
|
|
696
696
|
if (n)
|
|
697
697
|
return n;
|
|
698
|
-
let o =
|
|
698
|
+
let o = J(t, [], !1).filter((l) => H(l) && j(l) !== "body"), i = null;
|
|
699
699
|
const s = T(t).position === "fixed";
|
|
700
|
-
let r = s ?
|
|
701
|
-
for (;
|
|
700
|
+
let r = s ? I(t) : t;
|
|
701
|
+
for (; H(r) && !ot(r); ) {
|
|
702
702
|
const l = T(r), c = lt(r);
|
|
703
|
-
!c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) ||
|
|
703
|
+
!c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(r) && !c && Et(t, r)) ? o = o.filter((d) => d !== r) : i = l, r = I(r);
|
|
704
704
|
}
|
|
705
705
|
return e.set(t, o), o;
|
|
706
706
|
}
|
|
@@ -726,14 +726,14 @@ function ee(t) {
|
|
|
726
726
|
return yt(t);
|
|
727
727
|
}
|
|
728
728
|
function ne(t, e, n) {
|
|
729
|
-
const o = k(e), i =
|
|
729
|
+
const o = k(e), i = M(e), s = n === "fixed", r = z(t, !0, s, e);
|
|
730
730
|
let l = {
|
|
731
731
|
scrollLeft: 0,
|
|
732
732
|
scrollTop: 0
|
|
733
733
|
};
|
|
734
734
|
const c = B(0);
|
|
735
735
|
if (o || !o && !s)
|
|
736
|
-
if ((
|
|
736
|
+
if ((j(e) !== "body" || G(i)) && (l = it(e)), o) {
|
|
737
737
|
const a = z(e, !0, s, e);
|
|
738
738
|
c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
|
|
739
739
|
} else
|
|
@@ -755,7 +755,7 @@ function Ct(t, e) {
|
|
|
755
755
|
let o = mt(t, e);
|
|
756
756
|
for (; o && _t(o) && T(o).position === "static"; )
|
|
757
757
|
o = mt(o, e);
|
|
758
|
-
return o && (
|
|
758
|
+
return o && (j(o) === "html" || j(o) === "body" && T(o).position === "static" && !lt(o)) ? n : o || Yt(t) || n;
|
|
759
759
|
}
|
|
760
760
|
const oe = async function(t) {
|
|
761
761
|
let {
|
|
@@ -777,20 +777,20 @@ function ie(t) {
|
|
|
777
777
|
return T(t).direction === "rtl";
|
|
778
778
|
}
|
|
779
779
|
const se = {
|
|
780
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
781
|
-
getDocumentElement:
|
|
780
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
|
|
781
|
+
getDocumentElement: M,
|
|
782
782
|
getClippingRect: te,
|
|
783
783
|
getOffsetParent: Ct,
|
|
784
784
|
getElementRects: oe,
|
|
785
|
-
getClientRects:
|
|
785
|
+
getClientRects: Jt,
|
|
786
786
|
getDimensions: ee,
|
|
787
|
-
getScale:
|
|
788
|
-
isElement:
|
|
787
|
+
getScale: $,
|
|
788
|
+
isElement: H,
|
|
789
789
|
isRTL: ie
|
|
790
790
|
};
|
|
791
791
|
function re(t, e) {
|
|
792
792
|
let n = null, o;
|
|
793
|
-
const i =
|
|
793
|
+
const i = M(t);
|
|
794
794
|
function s() {
|
|
795
795
|
clearTimeout(o), n && n.disconnect(), n = null;
|
|
796
796
|
}
|
|
@@ -841,7 +841,7 @@ function ce(t, e, n, o) {
|
|
|
841
841
|
elementResize: r = typeof ResizeObserver == "function",
|
|
842
842
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
843
843
|
animationFrame: c = !1
|
|
844
|
-
} = o, a = ft(t), d = i || s ? [...a ?
|
|
844
|
+
} = o, a = ft(t), d = i || s ? [...a ? J(a) : [], ...J(e)] : [];
|
|
845
845
|
d.forEach((g) => {
|
|
846
846
|
i && g.addEventListener("scroll", n, {
|
|
847
847
|
passive: !0
|
|
@@ -879,9 +879,7 @@ const le = (t, e, n) => {
|
|
|
879
879
|
...i,
|
|
880
880
|
platform: s
|
|
881
881
|
});
|
|
882
|
-
}, ae =
|
|
883
|
-
* direction.scss
|
|
884
|
-
*/:host{--wj-popup-top: auto;--wj-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wj-popup-left);top:var(--wj-popup-top)}.native-popup:not(.popup-active){display:none}
|
|
882
|
+
}, ae = `:host{--wj-popup-top: auto;--wj-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wj-popup-left);top:var(--wj-popup-top)}.native-popup:not(.popup-active){display:none}
|
|
885
883
|
`;
|
|
886
884
|
class fe extends Tt {
|
|
887
885
|
constructor() {
|
|
@@ -926,27 +924,27 @@ class fe extends Tt {
|
|
|
926
924
|
this.anchorEl = n.getElementById(this.anchor);
|
|
927
925
|
} else
|
|
928
926
|
this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
|
|
929
|
-
|
|
930
|
-
|
|
927
|
+
U.addListener(this.anchorEl, "click", null, (n) => {
|
|
928
|
+
this.hasAttribute("disabled") || this.showHide();
|
|
931
929
|
}, { stopPropagation: !0 }), document.addEventListener("click", (n) => {
|
|
932
930
|
n.composedPath().some((i) => i === this) || this.hasAttribute("active") && this.removeAttribute("active");
|
|
933
931
|
});
|
|
934
932
|
}
|
|
935
933
|
showHide() {
|
|
936
|
-
this.hasAttribute("active") ? this.removeAttribute("active") :
|
|
934
|
+
this.hasAttribute("active") ? this.removeAttribute("active") : this.setAttribute("active", "");
|
|
937
935
|
}
|
|
938
936
|
reposition() {
|
|
939
937
|
const n = [];
|
|
940
938
|
this.offsetCalc = +this.offset || 0, this.slotArrow instanceof HTMLSlotElement && (this.arrow = this.slotArrow.assignedElements({ flatten: !0 })[0], this.arrow && (n.push(
|
|
941
|
-
|
|
939
|
+
jt({
|
|
942
940
|
element: this.arrow
|
|
943
941
|
})
|
|
944
942
|
), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
|
|
945
|
-
|
|
943
|
+
$t(this.offsetCalc)
|
|
946
944
|
), n.push(
|
|
947
|
-
|
|
945
|
+
Vt()
|
|
948
946
|
), this.hasAttribute("size") && n.push(
|
|
949
|
-
|
|
947
|
+
It({
|
|
950
948
|
apply({ availableWidth: o, availableHeight: i, elements: s }) {
|
|
951
949
|
Object.assign(s.floating.style, {
|
|
952
950
|
width: `${s.reference.offsetWidth}px`
|
|
@@ -974,22 +972,25 @@ class fe extends Tt {
|
|
|
974
972
|
});
|
|
975
973
|
}
|
|
976
974
|
}
|
|
977
|
-
}),
|
|
975
|
+
}), U.dispatchCustomEvent(this, "wj-popup:reposition", {
|
|
978
976
|
data: { top: "bottom", right: "left", bottom: "top", left: "right" },
|
|
979
977
|
context: this,
|
|
980
978
|
event: this
|
|
981
979
|
});
|
|
982
980
|
}
|
|
983
981
|
show() {
|
|
984
|
-
this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
|
|
982
|
+
U.dispatchCustomEvent(this, "wj-popup:show"), this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
|
|
985
983
|
this.reposition();
|
|
986
984
|
});
|
|
987
985
|
}
|
|
988
986
|
hide() {
|
|
989
|
-
this.native.classList.remove("popup-active"), this.cleanup(), this.cleanup = void 0;
|
|
987
|
+
U.dispatchCustomEvent(this, "wj-popup:hide"), this.native.classList.remove("popup-active"), this.cleanup(), this.cleanup = void 0;
|
|
988
|
+
}
|
|
989
|
+
onHide() {
|
|
990
|
+
this.removeAttribute("active");
|
|
990
991
|
}
|
|
991
992
|
disconnectedCallback() {
|
|
992
|
-
|
|
993
|
+
U.removeElement(this.anchorEl);
|
|
993
994
|
}
|
|
994
995
|
}
|
|
995
996
|
customElements.get("wj-popup") || window.customElements.define("wj-popup", fe);
|
package/dist/wj-progress-bar.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
|
-
var A = (
|
|
3
|
-
var g = (
|
|
4
|
-
import
|
|
2
|
+
var A = (i, o, e) => o in i ? m(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
|
|
3
|
+
var g = (i, o, e) => (A(i, typeof o != "symbol" ? o + "" : o, e), e);
|
|
4
|
+
import j from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const k =
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host(.wj-color-primary) #bar{--wj-progress-bar-color: #7252D3}:host(.wj-color-complete) #bar{--wj-progress-bar-color: #0072EC}:host(.wj-color-success) #bar{--wj-progress-bar-color: #19AD79}:host(.wj-color-warning) #bar{--wj-progress-bar-color: #FFd945}:host(.wj-color-danger) #bar{--wj-progress-bar-color: #D83C31}:host(.wj-color-dark) #bar{--wj-progress-bar-color: #212121}:host(.wj-color-light) #bar{--wj-progress-bar-color: #fff}:host{--wj-progress-bar-color: #212121;--wj-progress-bar-text-size: 1rem}:host .progress{position:relative;display:flex;align-items:center}:host .slot-wrapper{display:flex;position:absolute;top:0;align-items:center;width:100%;height:100%;justify-content:center}:host #bar{stroke:var(--wj-progress-bar-color, red)}:host text{transform:rotate(90deg);transform-origin:center;text-anchor:middle;dominant-baseline:middle;font-size:var(--wj-progress-bar-text-size)}:host(.wj-color) #bar{stroke:var(--wj-progress-bar-color)}::slotted([slot=start]){margin-inline:0 1rem}::slotted([slot=end]){margin-inline:1rem 0}
|
|
6
|
+
const k = `:host(.wj-color-primary) #bar{--wj-progress-bar-color: var(--wj-color-primary)}:host(.wj-color-complete) #bar{--wj-progress-bar-color: var(--wj-color-complete)}:host(.wj-color-success) #bar{--wj-progress-bar-color: var(--wj-color-success)}:host(.wj-color-warning) #bar{--wj-progress-bar-color: var(--wj-color-warning)}:host(.wj-color-danger) #bar{--wj-progress-bar-color: var(--wj-color-danger)}:host(.wj-color-dark) #bar{--wj-progress-bar-color: var(--wj-color-contrast-0)}:host(.wj-color-light) #bar{--wj-progress-bar-color: var(--wj-color-contrast-11)}:host{--wj-progress-bar-color: var(--wj-color-contrast-6);--wj-progress-bar-text-size: .75rem;--wj-progress-bar-text-color: var(--wj-color)}:host .progress{position:relative;display:flex;align-items:center}:host .slot-wrapper{display:flex;position:absolute;top:0;align-items:center;width:100%;height:100%;justify-content:center}:host #bar{stroke:var(--wj-progress-bar-color)}:host text{transform:rotate(90deg);transform-origin:center;text-anchor:middle;dominant-baseline:middle;font-size:var(--wj-progress-bar-text-size);fill:var(--wj-progress-bar-text-color)}:host(.wj-color) #bar{stroke:var(--wj-progress-bar-color)}::slotted([slot=start]){margin-inline:0 1rem}::slotted([slot=end]){margin-inline:1rem 0}
|
|
9
7
|
`;
|
|
10
|
-
class
|
|
8
|
+
class f extends j {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
11
|
g(this, "className", "ProgressBar");
|
|
@@ -41,16 +39,16 @@ class x extends f {
|
|
|
41
39
|
this.isShadowRoot = "open";
|
|
42
40
|
}
|
|
43
41
|
draw(e, h, l) {
|
|
44
|
-
let n = this.radius + this.stroke / 2,
|
|
42
|
+
let n = this.radius + this.stroke / 2, d = document.createDocumentFragment();
|
|
45
43
|
l.color && this.classList.add("wj-color-" + l.color, "wj-color");
|
|
46
44
|
let a = document.createElement("div");
|
|
47
45
|
a.classList.add("progress");
|
|
48
|
-
let w = document.createElement("slot"),
|
|
49
|
-
|
|
50
|
-
let b = document.createElement("slot");
|
|
51
|
-
b.setAttribute("name", "start");
|
|
46
|
+
let w = document.createElement("slot"), u = document.createElement("div");
|
|
47
|
+
u.classList.add("slot-wrapper");
|
|
52
48
|
let p = document.createElement("slot");
|
|
53
|
-
p.setAttribute("name", "
|
|
49
|
+
p.setAttribute("name", "start");
|
|
50
|
+
let b = document.createElement("slot");
|
|
51
|
+
b.setAttribute("name", "end");
|
|
54
52
|
let s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), r, t;
|
|
55
53
|
if ((this == null ? void 0 : this.type) === "circle") {
|
|
56
54
|
s.setAttribute("width", this.diameter), s.setAttribute("height", this.diameter), s.setAttribute("viewBox", `0 0 ${this.diameter} ${this.diameter}`), s.setAttribute("style", "transform: rotate(-90deg)"), r = document.createElementNS("http://www.w3.org/2000/svg", "circle"), r.setAttribute("r", this.radius), r.setAttribute("cx", n), r.setAttribute("cy", n), r.setAttribute("fill", "transparent"), t = document.createElementNS("http://www.w3.org/2000/svg", "circle"), t.setAttribute("r", this.radius), t.setAttribute("cx", n), t.setAttribute("cy", n), t.setAttribute("fill", "transparent"), t.setAttribute("stroke-dasharray", "0"), t.setAttribute("stroke-dashoffset", "0");
|
|
@@ -58,7 +56,7 @@ class x extends f {
|
|
|
58
56
|
c.setAttribute("x", "50%"), c.setAttribute("y", "50%"), c.innerHTML = this.progress + "%", s.appendChild(c);
|
|
59
57
|
} else
|
|
60
58
|
s.setAttribute("width", "100%"), s.setAttribute("height", this.stroke), s.setAttribute("preserveAspectRatio", "none"), r = document.createElementNS("http://www.w3.org/2000/svg", "line"), r.setAttribute("x1", 0), r.setAttribute("y1", this.stroke / 2), r.setAttribute("x2", "100%"), r.setAttribute("y2", this.stroke / 2), t = document.createElementNS("http://www.w3.org/2000/svg", "line"), t.setAttribute("x1", 0), t.setAttribute("y1", this.stroke / 2), t.setAttribute("x2", this.progress + "%"), t.setAttribute("y2", this.stroke / 2);
|
|
61
|
-
return r.setAttribute("stroke", "#e0e0e0"), r.setAttribute("stroke-linecap", this.linecap), r.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("stroke-linecap", this.linecap), t.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("id", "bar"), s.appendChild(r), s.appendChild(t),
|
|
59
|
+
return r.setAttribute("stroke", "#e0e0e0"), r.setAttribute("stroke-linecap", this.linecap), r.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("stroke-linecap", this.linecap), t.setAttribute("stroke-width", this.stroke + "px"), t.setAttribute("id", "bar"), s.appendChild(r), s.appendChild(t), u.appendChild(w), a.appendChild(p), a.appendChild(u), a.appendChild(s), a.appendChild(b), d.appendChild(a), this.background = r, this.bar = t, d;
|
|
62
60
|
}
|
|
63
61
|
afterDraw(e, h, l) {
|
|
64
62
|
this.type === "circle" && (this.background.setAttribute("stroke-dasharray", this.getCircleDashoffset(100) + "px"), this.background.setAttribute("stroke-dashoffset", "0px"), this.bar.setAttribute("stroke-dasharray", this.getCircleDasharray(this.radius) + "px"), this.bar.setAttribute("stroke-dashoffset", this.getCircleDashoffset(l.progress, this.radius) + "px"));
|
|
@@ -70,7 +68,7 @@ class x extends f {
|
|
|
70
68
|
return this.getCircleDasharray(h) * ((100 - e) / 100);
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar",
|
|
71
|
+
customElements.get("wj-progress-bar") || window.customElements.define("wj-progress-bar", f);
|
|
74
72
|
export {
|
|
75
|
-
|
|
73
|
+
f as ProgressBar
|
|
76
74
|
};
|
package/dist/wj-radio-group.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var c = (i, t, e) => t in i ?
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var c = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var n = (i, t, e) => (c(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import u from "./wj-element.js";
|
|
5
5
|
import { Radio as o } from "./wj-radio.js";
|
|
6
6
|
import "./wj-store.js";
|
|
7
|
-
const h =
|
|
8
|
-
* direction.scss
|
|
9
|
-
*/.wj-inline{display:flex;flex-direction:row;flex-wrap:wrap;gap:.5rem}
|
|
7
|
+
const h = `.wj-inline{display:flex;flex-direction:row;flex-wrap:wrap;gap:.5rem}
|
|
10
8
|
`;
|
|
11
9
|
class m extends u {
|
|
12
10
|
constructor() {
|
|
@@ -25,8 +23,8 @@ class m extends u {
|
|
|
25
23
|
draw(e, s, p) {
|
|
26
24
|
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
27
25
|
r.classList.add("native-radio-group", this.hasAttribute("inline") ? "wj-inline" : "ddd");
|
|
28
|
-
let
|
|
29
|
-
return r.appendChild(
|
|
26
|
+
let l = document.createElement("slot");
|
|
27
|
+
return r.appendChild(l), a.appendChild(r), a;
|
|
30
28
|
}
|
|
31
29
|
afterDraw() {
|
|
32
30
|
this.value && this.setRadioToChekced(this.getRadioByValue(this.value)), this.addEventListener("wj:radio:input", (e) => {
|