wj-elements 0.1.48 → 0.1.49
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/custom-elements.json +14058 -0
- package/dist/dark.css +1 -0
- package/dist/light.css +1 -0
- package/dist/localize.js +45 -0
- package/dist/popup.element-CWsSOxs2.js +1072 -0
- package/dist/router-links-FtZbFUto.js +146 -0
- package/dist/styles.css +1 -0
- package/dist/web-types.json +3122 -0
- package/dist/wje-accordion-item.js +88 -0
- package/dist/wje-accordion.js +79 -0
- package/dist/wje-animation.js +121 -0
- package/dist/wje-aside.js +55 -0
- package/dist/wje-avatar.js +77 -0
- package/dist/wje-badge.js +50 -0
- package/dist/wje-breadcrumb.js +148 -0
- package/dist/wje-breadcrumbs.js +67 -0
- package/dist/wje-button-group.js +78 -0
- package/dist/wje-button.js +207 -0
- package/dist/wje-card-content.js +48 -0
- package/dist/wje-card-controls.js +48 -0
- package/dist/wje-card-header.js +47 -0
- package/dist/wje-card-subtitle.js +55 -0
- package/dist/wje-card-title.js +55 -0
- package/dist/wje-card.js +50 -0
- package/dist/wje-carousel-item.js +33 -0
- package/dist/wje-carousel.js +177 -0
- package/dist/wje-checkbox.js +96 -0
- package/dist/wje-chip.js +32 -0
- package/dist/wje-col.js +27 -0
- package/dist/wje-color-picker.js +953 -0
- package/dist/wje-container.js +57 -0
- package/dist/wje-copy-button.js +170 -0
- package/dist/wje-dialog.js +86 -0
- package/dist/wje-divider.js +53 -0
- package/dist/wje-dropdown.js +114 -0
- package/dist/wje-element.js +453 -0
- package/dist/wje-fetchAndParseCSS.js +40 -0
- package/dist/wje-file-upload-item.js +115 -0
- package/dist/wje-file-upload.js +297 -0
- package/dist/wje-footer.js +56 -0
- package/dist/wje-form.js +28 -0
- package/dist/wje-format-digital.js +85 -0
- package/dist/wje-grid.js +28 -0
- package/dist/wje-header.js +58 -0
- package/dist/wje-icon-picker.js +221 -0
- package/dist/wje-icon.js +119 -0
- package/dist/wje-img-comparer.js +111 -0
- package/dist/wje-img.js +58 -0
- package/dist/wje-infinite-scroll.js +201 -0
- package/dist/wje-inline-edit.js +145 -0
- package/dist/wje-input-file.js +85 -0
- package/dist/wje-input.js +334 -0
- package/dist/wje-item.js +45 -0
- package/dist/wje-label.js +67 -0
- package/dist/wje-list.js +53 -0
- package/dist/wje-main.js +56 -0
- package/dist/wje-masonry.js +218 -0
- package/dist/wje-master.js +423 -0
- package/dist/wje-menu-button.js +65 -0
- package/dist/wje-menu-item.js +230 -0
- package/dist/wje-menu-label.js +57 -0
- package/dist/wje-menu.js +74 -0
- package/dist/wje-option.js +99 -0
- package/dist/wje-options.js +63 -0
- package/dist/wje-popup.js +5 -0
- package/dist/wje-progress-bar.js +161 -0
- package/dist/wje-qr-code.js +2332 -0
- package/dist/wje-radio-group.js +101 -0
- package/dist/wje-radio.js +46 -0
- package/dist/wje-rate.js +260 -0
- package/dist/wje-relative-time.js +85 -0
- package/dist/wje-reorder-dropzone.js +27 -0
- package/dist/wje-reorder-handle.js +115 -0
- package/dist/wje-reorder-item.js +32 -0
- package/dist/wje-reorder.js +138 -0
- package/dist/wje-route.js +46 -0
- package/dist/wje-router-link.js +64 -0
- package/dist/wje-router-outlet.js +127 -0
- package/dist/wje-routerx.js +1088 -0
- package/dist/wje-row.js +58 -0
- package/dist/wje-select.js +242 -0
- package/dist/wje-slider.js +177 -0
- package/dist/wje-sliding-container.js +277 -0
- package/dist/wje-split-view.js +112 -0
- package/dist/wje-status.js +54 -0
- package/dist/wje-store.js +192 -0
- package/dist/wje-tab-group.js +107 -0
- package/dist/wje-tab-panel.js +52 -0
- package/dist/wje-tab.js +59 -0
- package/dist/wje-textarea.js +116 -0
- package/dist/wje-thumbnail.js +64 -0
- package/dist/wje-toast.js +76 -0
- package/dist/wje-toggle.js +94 -0
- package/dist/wje-toolbar-action.js +63 -0
- package/dist/wje-toolbar.js +61 -0
- package/dist/wje-tooltip.js +116 -0
- package/dist/wje-visually-hidden.js +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var E = (a, l, e) => l in a ? f(a, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[l] = e;
|
|
3
|
+
var g = (a, l, e) => (E(a, typeof l != "symbol" ? l + "" : l, e), e);
|
|
4
|
+
import m from "./wje-element.js";
|
|
5
|
+
const p = ".container{position:relative;display:flex;align-items:center;justify-content:center;margin:auto;flex-direction:var(--flex-direction)}.container-w-dropzones{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:row}.reversed{--flex-direction: column-reverse}.basic{--flex-direction: column}.dragging{position:absolute;pointer-events:none;z-index:1000}.reorder-item{transition:top .3s ease,left .3s ease}";
|
|
6
|
+
class u extends m {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of Select.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
g(this, "className", "Select");
|
|
15
|
+
this.dragEl = null, this.items = [], this.originalIndex = null, this.isDragging = !1, this.offsetX = 0, this.offsetY = 0, this.cloneEl = null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the CSS styles for the component.
|
|
19
|
+
*
|
|
20
|
+
* @static
|
|
21
|
+
* @returns {CSSStyleSheet}
|
|
22
|
+
*/
|
|
23
|
+
static get cssStyleSheet() {
|
|
24
|
+
return p;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the list of attributes to observe for changes.
|
|
28
|
+
*
|
|
29
|
+
* @static
|
|
30
|
+
* @returns {Array<string>}
|
|
31
|
+
*/
|
|
32
|
+
static get observedAttributes() {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Sets up the attributes for the component.
|
|
37
|
+
*/
|
|
38
|
+
setupAttributes() {
|
|
39
|
+
this.isShadowRoot = "open";
|
|
40
|
+
}
|
|
41
|
+
draw(e, t, i) {
|
|
42
|
+
const s = document.createDocumentFragment(), n = document.createElement("div");
|
|
43
|
+
n.classList.add("container"), n.setAttribute("part", "native");
|
|
44
|
+
const o = document.createElement("slot");
|
|
45
|
+
return o.classList.add("reorder-items"), n.appendChild(o), s.appendChild(n), this.container = n, s;
|
|
46
|
+
}
|
|
47
|
+
afterDraw(e, t, i) {
|
|
48
|
+
const s = this.querySelectorAll("wje-reorder-item"), n = this.querySelectorAll("wje-reorder-dropzone");
|
|
49
|
+
this.container.classList.add(this.hasAttribute("reverse") ? "reversed" : "basic"), n && n.forEach((o) => {
|
|
50
|
+
this.container.classList.remove("container"), this.container.classList.add("container-w-dropzones");
|
|
51
|
+
}), s && s.forEach((o) => {
|
|
52
|
+
const d = o.querySelectorAll("[slot=handle]");
|
|
53
|
+
(d.length > 0 ? d : [o]).forEach((c) => {
|
|
54
|
+
this.attachEventListeners(c);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
attachEventListeners(e) {
|
|
59
|
+
e.addEventListener("mousedown", this.onMouseDown.bind(this), !1), e.addEventListener("touchstart", this.onTouchStart.bind(this), !1), e.addEventListener("dragstart", this.onDragStart.bind(this), !1);
|
|
60
|
+
}
|
|
61
|
+
/*Initialization of dragging
|
|
62
|
+
**********************************************************************************/
|
|
63
|
+
onMouseDown(e) {
|
|
64
|
+
this.startDragging(e.clientX, e.clientY, e.currentTarget), document.addEventListener("mousemove", this.onMouseMove.bind(this), !1), document.addEventListener("mouseup", this.onMouseUp.bind(this), !1), document.body.style.userSelect = "none";
|
|
65
|
+
}
|
|
66
|
+
onTouchStart(e) {
|
|
67
|
+
const t = e.touches[0];
|
|
68
|
+
this.startDragging(t.clientX, t.clientY, e.currentTarget), document.addEventListener("touchmove", this.onTouchMove.bind(this), !1), document.addEventListener("touchend", this.onTouchEnd.bind(this), !1), document.body.style.userSelect = "none";
|
|
69
|
+
}
|
|
70
|
+
startDragging(e, t, i) {
|
|
71
|
+
if (this.hasAttribute("disabled"))
|
|
72
|
+
return;
|
|
73
|
+
this.isDragging = !0, this.dragEl = i.closest("wje-reorder-item"), this.createClone(), this.dragEl.style.opacity = "0.3";
|
|
74
|
+
const s = this.dragEl.getBoundingClientRect();
|
|
75
|
+
this.offsetX = e - s.left, this.offsetY = t - s.top, this.dragEl.classList.add("dragging"), this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl), this.originalParent = this.dragEl.parentNode;
|
|
76
|
+
}
|
|
77
|
+
/*Initialization of movement
|
|
78
|
+
**********************************************************************************/
|
|
79
|
+
onMouseMove(e) {
|
|
80
|
+
this.isDragging && (this.moveElement(e.pageX, e.pageY), this.cloneEl && (this.cloneEl.style.left = `${e.pageX - this.offsetX}px`, this.cloneEl.style.top = `${e.pageY - this.offsetY}px`));
|
|
81
|
+
}
|
|
82
|
+
onTouchMove(e) {
|
|
83
|
+
if (!this.isDragging)
|
|
84
|
+
return;
|
|
85
|
+
const t = e.touches[0];
|
|
86
|
+
this.moveElement(t.pageX, t.pageY);
|
|
87
|
+
}
|
|
88
|
+
moveElement(e, t) {
|
|
89
|
+
const i = window.scrollX || document.documentElement.scrollLeft, s = window.scrollY || document.documentElement.scrollTop, n = e - i, o = t - s;
|
|
90
|
+
this.dragEl.style.left = `${n}px`, this.dragEl.style.top = `${o}px`, this.cloneEl && (this.cloneEl.style.left = `${n}px`, this.cloneEl.style.top = `${o}px`), this.querySelectorAll("wje-reorder-item").forEach((r) => {
|
|
91
|
+
if (r === this.dragEl)
|
|
92
|
+
return;
|
|
93
|
+
const c = r.getBoundingClientRect(), h = (o - c.top) / c.height * 100;
|
|
94
|
+
h > 30 && this.isMovingDown(r) ? r.parentNode.insertBefore(this.dragEl, r.nextSibling) : h < 30 && !this.isMovingDown(r) && r.parentNode.insertBefore(this.dragEl, r);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/*End of dragging
|
|
98
|
+
**********************************************************************************/
|
|
99
|
+
onMouseUp() {
|
|
100
|
+
this.stopDragging(), document.removeEventListener("mousemove", this.onMouseMove.bind(this), !1), document.removeEventListener("mouseup", this.onMouseUp.bind(this), !1), this.cloneEl && (this.cloneEl.remove(), this.cloneEl = null), this.dragEl && (this.dragEl.style.opacity = "1");
|
|
101
|
+
}
|
|
102
|
+
onTouchEnd() {
|
|
103
|
+
this.stopDragging(), document.removeEventListener("touchmove", this.onTouchMove.bind(this), !1), document.removeEventListener("touchend", this.onTouchEnd.bind(this), !1);
|
|
104
|
+
}
|
|
105
|
+
stopDragging() {
|
|
106
|
+
if (!this.isDragging)
|
|
107
|
+
return;
|
|
108
|
+
this.isDragging = !1, this.dragEl.classList.remove("dragging"), this.dragEl.style.left = "", this.dragEl.style.top = "";
|
|
109
|
+
const e = this.dragEl.parentNode, t = Array.from(e.children).indexOf(this.dragEl), i = Array.from(e.children).map((s) => {
|
|
110
|
+
const n = s.cloneNode(!0), o = n.querySelector(".handle");
|
|
111
|
+
return o && o.remove(), n.innerText.trim();
|
|
112
|
+
});
|
|
113
|
+
this.dispatchChange(this.originalIndex, t, i), document.body.style.userSelect = "";
|
|
114
|
+
}
|
|
115
|
+
onDragStart(e) {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
}
|
|
118
|
+
/*Helpers
|
|
119
|
+
**********************************************************************************/
|
|
120
|
+
createClone() {
|
|
121
|
+
this.cloneEl = this.dragEl.cloneNode(!0), this.cloneEl.style.position = "absolute", this.cloneEl.style.pointerEvents = "none", this.cloneEl.style.visibility = "visible", document.body.appendChild(this.cloneEl);
|
|
122
|
+
}
|
|
123
|
+
isMovingDown(e) {
|
|
124
|
+
const t = e.parentNode, i = Array.from(t.children).indexOf(this.dragEl), s = Array.from(t.children).indexOf(e);
|
|
125
|
+
return i < s;
|
|
126
|
+
}
|
|
127
|
+
dispatchChange(e, t, i) {
|
|
128
|
+
console.log("FROM:", e), console.log("TO:", t), console.log("ORDER:", i), this.dispatchEvent(
|
|
129
|
+
new CustomEvent("wje-reorder:change", {
|
|
130
|
+
detail: { from: e, to: t, order: i }
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
u.define("wje-reorder", u);
|
|
136
|
+
export {
|
|
137
|
+
u as default
|
|
138
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (t, e, r) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var s = (t, e, r) => (c(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import m from "./wje-element.js";
|
|
5
|
+
class a extends m {
|
|
6
|
+
/**
|
|
7
|
+
* Creates an instance of Route.
|
|
8
|
+
*
|
|
9
|
+
* @constructor
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
s(this, "className", "Route");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the list of attributes to observe for changes.
|
|
17
|
+
*
|
|
18
|
+
* @static
|
|
19
|
+
* @returns {Array<string>}
|
|
20
|
+
*/
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Sets up the attributes for the component.
|
|
26
|
+
*/
|
|
27
|
+
setupAttributes() {
|
|
28
|
+
this.isShadowRoot = "open";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Draws the component.
|
|
32
|
+
*
|
|
33
|
+
* @param {Object} context - The context for drawing.
|
|
34
|
+
* @param {Object} store - The store for drawing.
|
|
35
|
+
* @param {Object} params - The parameters for drawing.
|
|
36
|
+
* @returns {DocumentFragment}
|
|
37
|
+
*/
|
|
38
|
+
draw(r, d, l) {
|
|
39
|
+
let o = document.createDocumentFragment(), n = document.createElement("slot");
|
|
40
|
+
return o.appendChild(n), o;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
a.define("wje-route", a);
|
|
44
|
+
export {
|
|
45
|
+
a as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = (e, t, s) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var n = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import u from "./wje-element.js";
|
|
5
|
+
import { b as l } from "./router-links-FtZbFUto.js";
|
|
6
|
+
const d = ":host{display:block;background:transparent!important}:host(.active){cursor:pointer;font-weight:700}";
|
|
7
|
+
class o extends u {
|
|
8
|
+
/**
|
|
9
|
+
* Creates an instance of RouterLink.
|
|
10
|
+
*
|
|
11
|
+
* @constructor
|
|
12
|
+
*/
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
n(this, "className", "RouterLink");
|
|
16
|
+
this.unbindRouterLinks = l(this, { selector: !1 });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns the CSS styles for the component.
|
|
20
|
+
*
|
|
21
|
+
* @static
|
|
22
|
+
* @returns {CSSStyleSheet}
|
|
23
|
+
*/
|
|
24
|
+
static get cssStyleSheet() {
|
|
25
|
+
return d;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the list of attributes to observe for changes.
|
|
29
|
+
*
|
|
30
|
+
* @static
|
|
31
|
+
* @returns {Array<string>}
|
|
32
|
+
*/
|
|
33
|
+
static get observedAttributes() {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Sets up the attributes for the component.
|
|
38
|
+
*/
|
|
39
|
+
setupAttributes() {
|
|
40
|
+
this.isShadowRoot = "open", this.setAttribute("active-class", "active");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Draws the component.
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} context - The context for drawing.
|
|
46
|
+
* @param {Object} store - The store for drawing.
|
|
47
|
+
* @param {Object} params - The parameters for drawing.
|
|
48
|
+
* @returns {DocumentFragment}
|
|
49
|
+
*/
|
|
50
|
+
draw(s, m, p) {
|
|
51
|
+
let r = document.createDocumentFragment(), i = document.createElement("slot");
|
|
52
|
+
return r.appendChild(i), r;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Cleans up before the component is disconnected.
|
|
56
|
+
*/
|
|
57
|
+
beforeDisconnect() {
|
|
58
|
+
this.unbindRouterLinks();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
o.define("wje-router-link", o);
|
|
62
|
+
export {
|
|
63
|
+
o as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var E = (i, t, n) => t in i ? C(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
|
|
3
|
+
var m = (i, t, n) => (E(i, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import b from "./wje-element.js";
|
|
5
|
+
class $ {
|
|
6
|
+
constructor(t = {}) {
|
|
7
|
+
this.options = t;
|
|
8
|
+
}
|
|
9
|
+
getOption(t, n) {
|
|
10
|
+
return t.hasAttribute(n) ? t.getAttribute(n) : this.options[n];
|
|
11
|
+
}
|
|
12
|
+
hasOption(t, n) {
|
|
13
|
+
return t.hasAttribute(n) || this.options[n];
|
|
14
|
+
}
|
|
15
|
+
runParallel(t) {
|
|
16
|
+
return this.hasOption(t, "parallel");
|
|
17
|
+
}
|
|
18
|
+
beforeEnter(t, n) {
|
|
19
|
+
}
|
|
20
|
+
enter(t, n) {
|
|
21
|
+
}
|
|
22
|
+
leave(t, n, e) {
|
|
23
|
+
e();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var p = window.requestAnimationFrame, v = "transition", L = "animation", d = "transition", N = "transitionend", c = "animation", D = "animationend";
|
|
27
|
+
function O(i) {
|
|
28
|
+
window.scrollTo(0, 0), p(function() {
|
|
29
|
+
window.scrollTo(0, 0), p(i);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function x(i, t) {
|
|
33
|
+
var n = k(i), e = n.type, r = n.timeout, l = n.propCount;
|
|
34
|
+
if (!e)
|
|
35
|
+
return t();
|
|
36
|
+
var s = e === v ? N : D, u = 0, o = function() {
|
|
37
|
+
i.removeEventListener(s, a), t();
|
|
38
|
+
}, a = function(h) {
|
|
39
|
+
h.target === i && ++u >= l && o();
|
|
40
|
+
};
|
|
41
|
+
setTimeout(function() {
|
|
42
|
+
u < l && o();
|
|
43
|
+
}, r + 1), i.addEventListener(s, a);
|
|
44
|
+
}
|
|
45
|
+
function k(i) {
|
|
46
|
+
var t = window.getComputedStyle(i), n = (t[d + "Delay"] || "").split(", "), e = (t[d + "Duration"] || "").split(", "), r = f(n, e), l = (t[c + "Delay"] || "").split(", "), s = (t[c + "Duration"] || "").split(", "), u = f(l, s), o, a = 0, h = 0;
|
|
47
|
+
return a = Math.max(r, u), o = a > 0 ? r > u ? v : L : null, h = o ? o === v ? e.length : s.length : 0, {
|
|
48
|
+
type: o,
|
|
49
|
+
timeout: a,
|
|
50
|
+
propCount: h
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function f(i, t) {
|
|
54
|
+
for (; i.length < t.length; )
|
|
55
|
+
i = i.concat(i);
|
|
56
|
+
return Math.max.apply(null, t.map(function(n, e) {
|
|
57
|
+
return g(n) + g(i[e]);
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
function g(i) {
|
|
61
|
+
return Number(i.slice(0, -1).replace(",", ".")) * 1e3;
|
|
62
|
+
}
|
|
63
|
+
function A(i, t, n, e) {
|
|
64
|
+
i.classList.add(`${t}-${n}-active`), O(function() {
|
|
65
|
+
window.scrollTo(0, 0), i.classList.remove(`${t}-${n}`), i.classList.add(`${t}-${n}-to`), x(i, function() {
|
|
66
|
+
i.classList.remove(`${t}-${n}-active`, `${t}-${n}-to`), e && e();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
class y extends $ {
|
|
71
|
+
beforeEnter(t, n) {
|
|
72
|
+
const e = t.getAttribute("animation") || "outlet";
|
|
73
|
+
n.classList.add(`${e}-enter`);
|
|
74
|
+
}
|
|
75
|
+
enter(t, n) {
|
|
76
|
+
const e = t.getAttribute("animation") || "outlet";
|
|
77
|
+
A(n, e, "enter");
|
|
78
|
+
}
|
|
79
|
+
leave(t, n, e) {
|
|
80
|
+
const r = t.getAttribute("animation") || "outlet";
|
|
81
|
+
n.classList.add(`${r}-leave`), n.style.display = "none", A(n, r, "leave", e);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const I = {};
|
|
85
|
+
let w;
|
|
86
|
+
function T(i) {
|
|
87
|
+
return I[i] || w || (w = new y());
|
|
88
|
+
}
|
|
89
|
+
class M extends HTMLElement {
|
|
90
|
+
appendChild(t) {
|
|
91
|
+
if (!this.hasAttribute("animation")) {
|
|
92
|
+
super.appendChild(t);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const n = T(this.getAttribute("animation")), e = n.runParallel(this);
|
|
96
|
+
n.beforeEnter(this, t), super.appendChild(t), !e && this.removing ? this.appending = t : n.enter(this, t);
|
|
97
|
+
}
|
|
98
|
+
removeChild(t) {
|
|
99
|
+
if (!this.hasAttribute("animation")) {
|
|
100
|
+
super.removeChild(t);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const n = T(this.getAttribute("animation"));
|
|
104
|
+
if (this.removing && this.removing.parentNode === this && super.removeChild(this.removing), t === this.appending) {
|
|
105
|
+
t.parentNode === this && super.removeChild(t), this.removing = null;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this.removing = t, n.leave(this, t, () => {
|
|
109
|
+
this.removing && this.removing.parentNode === this && super.removeChild(this.removing), this.appending && n.enter(this, this.appending), this.appending = null, this.removing = null;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
class P extends M {
|
|
114
|
+
/**
|
|
115
|
+
* Creates an instance of Route.
|
|
116
|
+
*
|
|
117
|
+
* @constructor
|
|
118
|
+
*/
|
|
119
|
+
constructor() {
|
|
120
|
+
super();
|
|
121
|
+
m(this, "className", "RouterOutlet");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
b.define("wje-router-outlet", P);
|
|
125
|
+
export {
|
|
126
|
+
P as default
|
|
127
|
+
};
|