wj-elements 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/router-links-e0087f84.js +146 -0
- package/dist/style.css +2 -2365
- package/dist/wj-aside.js +18 -22
- package/dist/wj-avatar.js +32 -49
- package/dist/wj-badge.js +18 -22
- package/dist/wj-breadcrumb.js +53 -103
- package/dist/wj-breadcrumbs.js +21 -36
- package/dist/wj-button-group.js +24 -36
- package/dist/wj-button.js +37 -80
- package/dist/wj-card-content.js +16 -18
- package/dist/wj-card-controls.js +16 -18
- package/dist/wj-card-header.js +16 -20
- package/dist/wj-card-subtitle.js +17 -19
- package/dist/wj-card-title.js +16 -18
- package/dist/wj-card.js +16 -20
- package/dist/wj-checkbox.js +24 -46
- package/dist/wj-chip.js +21 -39
- package/dist/wj-col.js +18 -32
- package/dist/wj-color-picker.js +503 -868
- package/dist/wj-container.js +18 -20
- package/dist/wj-copy-button.js +66 -112
- package/dist/wj-dialog.js +43 -67
- package/dist/wj-divider.js +16 -20
- package/dist/wj-dropdown.js +22 -31
- package/dist/wj-element.js +241 -416
- package/dist/wj-footer.js +16 -18
- package/dist/wj-form.js +16 -18
- package/dist/wj-grid.js +17 -21
- package/dist/wj-header.js +18 -22
- package/dist/wj-icon-picker.js +66 -107
- package/dist/wj-icon.js +67 -142
- package/dist/wj-img-comparer.js +43 -72
- package/dist/wj-img.js +21 -31
- package/dist/wj-infinite-scroll.js +49 -84
- package/dist/wj-input.js +67 -146
- package/dist/wj-item.js +19 -34
- package/dist/wj-label.js +19 -21
- package/dist/wj-list.js +17 -20
- package/dist/wj-main.js +16 -18
- package/dist/wj-master.js +331 -462
- package/dist/wj-menu-button.js +18 -21
- package/dist/wj-menu-item.js +67 -144
- package/dist/wj-menu-label.js +17 -21
- package/dist/wj-menu.js +20 -24
- package/dist/wj-popup.js +714 -1140
- package/dist/wj-progress-bar.js +42 -100
- package/dist/wj-radio-group.js +27 -38
- package/dist/wj-radio.js +24 -46
- package/dist/wj-route.js +8 -11
- package/dist/wj-router-link.js +19 -22
- package/dist/wj-router-outlet.js +71 -135
- package/dist/wj-routerx.js +641 -1121
- package/dist/wj-row.js +20 -22
- package/dist/wj-slider.js +55 -97
- package/dist/wj-split-view.js +45 -81
- package/dist/wj-store.js +110 -195
- package/dist/wj-textarea.js +39 -86
- package/dist/wj-thumbnail.js +17 -19
- package/dist/wj-toast.js +34 -88
- package/dist/wj-toggle.js +24 -42
- package/dist/wj-toolbar-action.js +16 -27
- package/dist/wj-toolbar.js +21 -26
- package/dist/wj-tooltip.js +27 -41
- package/dist/wj-visually-hidden.js +16 -18
- package/package.json +1 -1
- package/dist/router-links-26e4a166.js +0 -204
package/dist/wj-router-outlet.js
CHANGED
|
@@ -1,175 +1,111 @@
|
|
|
1
1
|
import "./wj-element.js";
|
|
2
2
|
import "./wj-store.js";
|
|
3
|
-
class
|
|
4
|
-
constructor(
|
|
5
|
-
this.options =
|
|
3
|
+
class E {
|
|
4
|
+
constructor(t = {}) {
|
|
5
|
+
this.options = t;
|
|
6
6
|
}
|
|
7
|
-
getOption(
|
|
8
|
-
return
|
|
7
|
+
getOption(t, n) {
|
|
8
|
+
return t.hasAttribute(n) ? t.getAttribute(n) : this.options[n];
|
|
9
9
|
}
|
|
10
|
-
hasOption(
|
|
11
|
-
return
|
|
10
|
+
hasOption(t, n) {
|
|
11
|
+
return t.hasAttribute(n) || this.options[n];
|
|
12
12
|
}
|
|
13
|
-
runParallel(
|
|
14
|
-
return this.hasOption(
|
|
13
|
+
runParallel(t) {
|
|
14
|
+
return this.hasOption(t, "parallel");
|
|
15
15
|
}
|
|
16
|
-
beforeEnter(
|
|
16
|
+
beforeEnter(t, n) {
|
|
17
17
|
}
|
|
18
|
-
enter(
|
|
18
|
+
enter(t, n) {
|
|
19
19
|
}
|
|
20
|
-
leave(
|
|
21
|
-
|
|
20
|
+
leave(t, n, e) {
|
|
21
|
+
e();
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var transitionEndEvent = "transitionend";
|
|
29
|
-
var animationProp = "animation";
|
|
30
|
-
var animationEndEvent = "animationend";
|
|
31
|
-
function nextFrame(fn) {
|
|
32
|
-
window.scrollTo(0, 0);
|
|
33
|
-
raf(function() {
|
|
34
|
-
window.scrollTo(0, 0);
|
|
35
|
-
raf(fn);
|
|
24
|
+
var v = window.requestAnimationFrame, m = "transition", T = "animation", p = "transition", C = "transitionend", d = "animation", b = "animationend";
|
|
25
|
+
function $(i) {
|
|
26
|
+
window.scrollTo(0, 0), v(function() {
|
|
27
|
+
window.scrollTo(0, 0), v(i);
|
|
36
28
|
});
|
|
37
29
|
}
|
|
38
|
-
function
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
|
47
|
-
var ended = 0;
|
|
48
|
-
var end = function() {
|
|
49
|
-
el.removeEventListener(event, onEnd);
|
|
50
|
-
cb();
|
|
51
|
-
};
|
|
52
|
-
var onEnd = function(e) {
|
|
53
|
-
if (e.target === el) {
|
|
54
|
-
if (++ended >= propCount) {
|
|
55
|
-
end();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
30
|
+
function L(i, t) {
|
|
31
|
+
var n = D(i), e = n.type, r = n.timeout, l = n.propCount;
|
|
32
|
+
if (!e)
|
|
33
|
+
return t();
|
|
34
|
+
var s = e === m ? C : b, u = 0, o = function() {
|
|
35
|
+
i.removeEventListener(s, a), t();
|
|
36
|
+
}, a = function(h) {
|
|
37
|
+
h.target === i && ++u >= l && o();
|
|
58
38
|
};
|
|
59
39
|
setTimeout(function() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}, timeout + 1);
|
|
64
|
-
el.addEventListener(event, onEnd);
|
|
40
|
+
u < l && o();
|
|
41
|
+
}, r + 1), i.addEventListener(s, a);
|
|
65
42
|
}
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var animationDurations = (styles[animationProp + "Duration"] || "").split(", ");
|
|
73
|
-
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
|
74
|
-
var type;
|
|
75
|
-
var timeout = 0;
|
|
76
|
-
var propCount = 0;
|
|
77
|
-
timeout = Math.max(transitionTimeout, animationTimeout);
|
|
78
|
-
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
79
|
-
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
80
|
-
return {
|
|
81
|
-
type,
|
|
82
|
-
timeout,
|
|
83
|
-
propCount
|
|
43
|
+
function D(i) {
|
|
44
|
+
var t = window.getComputedStyle(i), n = (t[p + "Delay"] || "").split(", "), e = (t[p + "Duration"] || "").split(", "), r = c(n, e), l = (t[d + "Delay"] || "").split(", "), s = (t[d + "Duration"] || "").split(", "), u = c(l, s), o, a = 0, h = 0;
|
|
45
|
+
return a = Math.max(r, u), o = a > 0 ? r > u ? m : T : null, h = o ? o === m ? e.length : s.length : 0, {
|
|
46
|
+
type: o,
|
|
47
|
+
timeout: a,
|
|
48
|
+
propCount: h
|
|
84
49
|
};
|
|
85
50
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return toMs(d) + toMs(delays[i]);
|
|
51
|
+
function c(i, t) {
|
|
52
|
+
for (; i.length < t.length; )
|
|
53
|
+
i = i.concat(i);
|
|
54
|
+
return Math.max.apply(null, t.map(function(n, e) {
|
|
55
|
+
return f(n) + f(i[e]);
|
|
92
56
|
}));
|
|
93
57
|
}
|
|
94
|
-
function
|
|
95
|
-
return Number(
|
|
58
|
+
function f(i) {
|
|
59
|
+
return Number(i.slice(0, -1).replace(",", ".")) * 1e3;
|
|
96
60
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
el.classList.remove(`${name}-${type}`);
|
|
102
|
-
el.classList.add(`${name}-${type}-to`);
|
|
103
|
-
whenTransitionEnds(el, function() {
|
|
104
|
-
el.classList.remove(`${name}-${type}-active`, `${name}-${type}-to`);
|
|
105
|
-
if (cb)
|
|
106
|
-
cb();
|
|
61
|
+
function g(i, t, n, e) {
|
|
62
|
+
i.classList.add(`${t}-${n}-active`), $(function() {
|
|
63
|
+
window.scrollTo(0, 0), i.classList.remove(`${t}-${n}`), i.classList.add(`${t}-${n}-to`), L(i, function() {
|
|
64
|
+
i.classList.remove(`${t}-${n}-active`, `${t}-${n}-to`), e && e();
|
|
107
65
|
});
|
|
108
66
|
});
|
|
109
67
|
}
|
|
110
|
-
class
|
|
111
|
-
beforeEnter(
|
|
112
|
-
const
|
|
113
|
-
|
|
68
|
+
class N extends E {
|
|
69
|
+
beforeEnter(t, n) {
|
|
70
|
+
const e = t.getAttribute("animation") || "outlet";
|
|
71
|
+
n.classList.add(`${e}-enter`);
|
|
114
72
|
}
|
|
115
|
-
enter(
|
|
116
|
-
const
|
|
117
|
-
|
|
73
|
+
enter(t, n) {
|
|
74
|
+
const e = t.getAttribute("animation") || "outlet";
|
|
75
|
+
g(n, e, "enter");
|
|
118
76
|
}
|
|
119
|
-
leave(
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
el.style.display = "none";
|
|
123
|
-
runTransition(el, name, "leave", done);
|
|
77
|
+
leave(t, n, e) {
|
|
78
|
+
const r = t.getAttribute("animation") || "outlet";
|
|
79
|
+
n.classList.add(`${r}-leave`), n.style.display = "none", g(n, r, "leave", e);
|
|
124
80
|
}
|
|
125
81
|
}
|
|
126
|
-
const
|
|
127
|
-
let
|
|
128
|
-
function
|
|
129
|
-
return
|
|
82
|
+
const O = {};
|
|
83
|
+
let w;
|
|
84
|
+
function A(i) {
|
|
85
|
+
return O[i] || w || (w = new N());
|
|
130
86
|
}
|
|
131
|
-
class
|
|
132
|
-
appendChild(
|
|
87
|
+
class k extends HTMLElement {
|
|
88
|
+
appendChild(t) {
|
|
133
89
|
if (!this.hasAttribute("animation")) {
|
|
134
|
-
super.appendChild(
|
|
90
|
+
super.appendChild(t);
|
|
135
91
|
return;
|
|
136
92
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
hook.beforeEnter(this, el);
|
|
140
|
-
super.appendChild(el);
|
|
141
|
-
if (!runParallel && this.removing) {
|
|
142
|
-
this.appending = el;
|
|
143
|
-
} else {
|
|
144
|
-
hook.enter(this, el);
|
|
145
|
-
}
|
|
93
|
+
const n = A(this.getAttribute("animation")), e = n.runParallel(this);
|
|
94
|
+
n.beforeEnter(this, t), super.appendChild(t), !e && this.removing ? this.appending = t : n.enter(this, t);
|
|
146
95
|
}
|
|
147
|
-
removeChild(
|
|
96
|
+
removeChild(t) {
|
|
148
97
|
if (!this.hasAttribute("animation")) {
|
|
149
|
-
super.removeChild(
|
|
98
|
+
super.removeChild(t);
|
|
150
99
|
return;
|
|
151
100
|
}
|
|
152
|
-
const
|
|
153
|
-
if (this.removing && this.removing.parentNode === this) {
|
|
154
|
-
super.removeChild(this.removing
|
|
155
|
-
}
|
|
156
|
-
if (el === this.appending) {
|
|
157
|
-
if (el.parentNode === this) {
|
|
158
|
-
super.removeChild(el);
|
|
159
|
-
}
|
|
160
|
-
this.removing = null;
|
|
101
|
+
const n = A(this.getAttribute("animation"));
|
|
102
|
+
if (this.removing && this.removing.parentNode === this && super.removeChild(this.removing), t === this.appending) {
|
|
103
|
+
t.parentNode === this && super.removeChild(t), this.removing = null;
|
|
161
104
|
return;
|
|
162
105
|
}
|
|
163
|
-
this.removing =
|
|
164
|
-
|
|
165
|
-
if (this.removing && this.removing.parentNode === this) {
|
|
166
|
-
super.removeChild(this.removing);
|
|
167
|
-
}
|
|
168
|
-
if (this.appending)
|
|
169
|
-
hook.enter(this, this.appending);
|
|
170
|
-
this.appending = null;
|
|
171
|
-
this.removing = null;
|
|
106
|
+
this.removing = t, n.leave(this, t, () => {
|
|
107
|
+
this.removing && this.removing.parentNode === this && super.removeChild(this.removing), this.appending && n.enter(this, this.appending), this.appending = null, this.removing = null;
|
|
172
108
|
});
|
|
173
109
|
}
|
|
174
110
|
}
|
|
175
|
-
customElements.get("wj-router-outlet") || window.customElements.define("wj-router-outlet",
|
|
111
|
+
customElements.get("wj-router-outlet") || window.customElements.define("wj-router-outlet", k);
|