wj-elements 0.0.6 → 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/style.css +3 -0
- package/dist/wj-animation.js +62 -3
- package/dist/wj-fetchAndParseCSS.js +43 -0
- package/dist/wj-masonry.js +75 -71460
- package/dist/wj-master.js +155 -154
- package/package.json +1 -1
- package/dist/animation-2266bd6e.js +0 -103
package/dist/wj-master.js
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
2
|
var y = (s, i, t) => i in s ? A(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
|
|
3
|
-
var
|
|
3
|
+
var c = (s, i, t) => (y(s, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
4
|
import u, { WjElementUtils as E, event as f } from "./wj-element.js";
|
|
5
5
|
import { defaultStoreActions as J, store as K } from "./wj-store.js";
|
|
6
6
|
import { b as X, w as Y } from "./router-links-e0087f84.js";
|
|
7
|
-
import {
|
|
7
|
+
import { fetchAndParseCSS as tt } from "./wj-fetchAndParseCSS.js";
|
|
8
8
|
import { L as x } from "./localize-762a9f0f.js";
|
|
9
|
-
import { Aside as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
9
|
+
import { Aside as rt } from "./wj-aside.js";
|
|
10
|
+
import { Animation as at } from "./wj-animation.js";
|
|
11
|
+
import { Avatar as st } from "./wj-avatar.js";
|
|
12
|
+
import { Badge as lt } from "./wj-badge.js";
|
|
13
|
+
import { Breadcrumb as ct } from "./wj-breadcrumb.js";
|
|
14
|
+
import { Breadcrumbs as mt } from "./wj-breadcrumbs.js";
|
|
15
|
+
import { Button as ht } from "./wj-button.js";
|
|
16
|
+
import { ButtonGroup as wt } from "./wj-button-group.js";
|
|
17
|
+
import { Card as ft } from "./wj-card.js";
|
|
18
|
+
import { CardContent as xt } from "./wj-card-content.js";
|
|
19
|
+
import { CardControls as At } from "./wj-card-controls.js";
|
|
20
|
+
import { CardHeader as Et } from "./wj-card-header.js";
|
|
21
|
+
import { CardSubtitle as St } from "./wj-card-subtitle.js";
|
|
22
|
+
import { CardTitle as kt } from "./wj-card-title.js";
|
|
23
|
+
import { Carousel as Ot } from "./wj-carousel.js";
|
|
24
|
+
import { CarouselItem as Rt } from "./wj-carousel-item.js";
|
|
25
|
+
import { Checkbox as Ft } from "./wj-checkbox.js";
|
|
26
|
+
import { Chip as Nt } from "./wj-chip.js";
|
|
27
|
+
import { Col as It } from "./wj-col.js";
|
|
28
|
+
import { ColorPicker as Bt } from "./wj-color-picker.js";
|
|
29
|
+
import { Container as Wt } from "./wj-container.js";
|
|
30
|
+
import { CopyButton as Gt } from "./wj-copy-button.js";
|
|
31
|
+
import { Dialog as Ut } from "./wj-dialog.js";
|
|
32
|
+
import { Divider as Jt } from "./wj-divider.js";
|
|
33
|
+
import { Dropdown as Qt } from "./wj-dropdown.js";
|
|
34
|
+
import { FileUpload as Yt } from "./wj-file-upload.js";
|
|
35
|
+
import { FileUploadItem as te } from "./wj-file-upload-item.js";
|
|
36
|
+
import { Footer as re } from "./wj-footer.js";
|
|
37
|
+
import { FormatDigital as ae } from "./wj-format-digital.js";
|
|
38
|
+
import { Grid as se } from "./wj-grid.js";
|
|
39
|
+
import { Header as le } from "./wj-header.js";
|
|
40
|
+
import { Icon as ce } from "./wj-icon.js";
|
|
41
|
+
import { IconPicker as me } from "./wj-icon-picker.js";
|
|
42
|
+
import { Img as he } from "./wj-img.js";
|
|
43
|
+
import { ImgComparer as we } from "./wj-img-comparer.js";
|
|
44
|
+
import { InfiniteScroll as fe } from "./wj-infinite-scroll.js";
|
|
45
|
+
import { Input as xe } from "./wj-input.js";
|
|
46
|
+
import { InputFile as Ae } from "./wj-input-file.js";
|
|
47
|
+
import { Item as Ee } from "./wj-item.js";
|
|
48
|
+
import { Label as Se } from "./wj-label.js";
|
|
49
|
+
import { List as ke } from "./wj-list.js";
|
|
50
|
+
import { Main as Oe } from "./wj-main.js";
|
|
51
|
+
import { Masonry as Re } from "./wj-masonry.js";
|
|
52
|
+
import { Menu as Fe } from "./wj-menu.js";
|
|
53
|
+
import { MenuButton as Ne } from "./wj-menu-button.js";
|
|
54
|
+
import { MenuItem as Ie } from "./wj-menu-item.js";
|
|
55
|
+
import { MenuLabel as Be } from "./wj-menu-label.js";
|
|
56
|
+
import { Popup as We } from "./wj-popup.js";
|
|
57
|
+
import { ProgressBar as Ge } from "./wj-progress-bar.js";
|
|
58
|
+
import { Radio as Ue } from "./wj-radio.js";
|
|
59
|
+
import { RadioGroup as Je } from "./wj-radio-group.js";
|
|
60
|
+
import { Rate as Qe } from "./wj-rate.js";
|
|
61
|
+
import { RelativeTime as Ye } from "./wj-relative-time.js";
|
|
62
|
+
import { Route as tr } from "./wj-route.js";
|
|
63
|
+
import { Routerx as rr } from "./wj-routerx.js";
|
|
64
|
+
import { RouterLink as ar } from "./wj-router-link.js";
|
|
64
65
|
import "./wj-router-outlet.js";
|
|
65
|
-
import { Row as
|
|
66
|
-
import { Slider as
|
|
67
|
-
import { SplitView as
|
|
68
|
-
import { Textarea as
|
|
69
|
-
import { Thumbnail as
|
|
70
|
-
import { Toast as
|
|
71
|
-
import { Toggle as
|
|
72
|
-
import { Toolbar as
|
|
73
|
-
import { ToolbarAction as
|
|
74
|
-
import { Tooltip as
|
|
75
|
-
import { VisuallyHidden as
|
|
66
|
+
import { Row as sr } from "./wj-row.js";
|
|
67
|
+
import { Slider as lr } from "./wj-slider.js";
|
|
68
|
+
import { SplitView as cr } from "./wj-split-view.js";
|
|
69
|
+
import { Textarea as mr } from "./wj-textarea.js";
|
|
70
|
+
import { Thumbnail as hr } from "./wj-thumbnail.js";
|
|
71
|
+
import { Toast as wr } from "./wj-toast.js";
|
|
72
|
+
import { Toggle as fr } from "./wj-toggle.js";
|
|
73
|
+
import { Toolbar as xr } from "./wj-toolbar.js";
|
|
74
|
+
import { ToolbarAction as Ar } from "./wj-toolbar-action.js";
|
|
75
|
+
import { Tooltip as Er } from "./wj-tooltip.js";
|
|
76
|
+
import { VisuallyHidden as Sr } from "./wj-visually-hidden.js";
|
|
76
77
|
const C = {
|
|
77
78
|
code: "sk",
|
|
78
79
|
name: "Slovak",
|
|
@@ -98,7 +99,7 @@ const T = `:host{color:red}
|
|
|
98
99
|
class k extends u {
|
|
99
100
|
constructor() {
|
|
100
101
|
super();
|
|
101
|
-
|
|
102
|
+
c(this, "className", "ExampleElement");
|
|
102
103
|
}
|
|
103
104
|
static get cssStyleSheet() {
|
|
104
105
|
return T;
|
|
@@ -130,7 +131,7 @@ const L = `/*!
|
|
|
130
131
|
class O extends u {
|
|
131
132
|
constructor() {
|
|
132
133
|
super();
|
|
133
|
-
|
|
134
|
+
c(this, "className", "ButtonGroup");
|
|
134
135
|
}
|
|
135
136
|
static get cssStyleSheet() {
|
|
136
137
|
return L;
|
|
@@ -152,7 +153,7 @@ const D = `:host{--wj-option-padding-top: .5rem;--wj-option-padding-bottom: .5re
|
|
|
152
153
|
class R extends u {
|
|
153
154
|
constructor() {
|
|
154
155
|
super();
|
|
155
|
-
|
|
156
|
+
c(this, "className", "Option");
|
|
156
157
|
}
|
|
157
158
|
set selected(t) {
|
|
158
159
|
return t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
|
|
@@ -177,10 +178,10 @@ class R extends u {
|
|
|
177
178
|
r.classList.add("native-option"), r.setAttribute("part", "native");
|
|
178
179
|
let n = document.createElement("wj-icon");
|
|
179
180
|
n.setAttribute("name", "check");
|
|
180
|
-
let
|
|
181
|
-
|
|
181
|
+
let p = document.createElement("slot");
|
|
182
|
+
p.setAttribute("name", "start");
|
|
182
183
|
let d = document.createElement("slot"), l = document.createElement("slot");
|
|
183
|
-
return l.setAttribute("name", "end"), r.appendChild(n), r.appendChild(
|
|
184
|
+
return l.setAttribute("name", "end"), r.appendChild(n), r.appendChild(p), r.appendChild(d), r.appendChild(l), o.appendChild(r), o;
|
|
184
185
|
}
|
|
185
186
|
afterDraw() {
|
|
186
187
|
f.addListener(this, "click", "wj:option-change");
|
|
@@ -190,7 +191,7 @@ customElements.get("wj-option") || window.customElements.define("wj-option", R);
|
|
|
190
191
|
class z extends u {
|
|
191
192
|
constructor() {
|
|
192
193
|
super();
|
|
193
|
-
|
|
194
|
+
c(this, "className", "Options");
|
|
194
195
|
}
|
|
195
196
|
static get cssStyleSheet() {
|
|
196
197
|
return styles;
|
|
@@ -222,14 +223,14 @@ const F = `:host{--wj-select-border-width: 1px;--wj-select-border-style: solid;-
|
|
|
222
223
|
class M extends u {
|
|
223
224
|
constructor() {
|
|
224
225
|
super();
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
c(this, "className", "Select");
|
|
227
|
+
c(this, "optionChange", (t) => {
|
|
227
228
|
let e = this.getAllOptions();
|
|
228
229
|
this.hasAttribute("multiple") || (e.forEach((a) => {
|
|
229
230
|
a.selected = !1, a.removeAttribute("selected");
|
|
230
231
|
}), this.popup.removeAttribute("active")), t.target.selected = !t.target.hasAttribute("selected"), this.selections(t.target);
|
|
231
232
|
});
|
|
232
|
-
|
|
233
|
+
c(this, "removeChip", (t) => {
|
|
233
234
|
let e = t.target.option;
|
|
234
235
|
e.selected = !1, e.removeAttribute("selected"), t.target.parentNode.removeChild(t.target), this.selections(null, 0);
|
|
235
236
|
});
|
|
@@ -263,8 +264,8 @@ class M extends u {
|
|
|
263
264
|
r.setAttribute("part", "native"), r.classList.add("native-select", this.variant || "default");
|
|
264
265
|
let n = document.createElement("div");
|
|
265
266
|
n.classList.add("wrapper"), n.setAttribute("slot", "anchor");
|
|
266
|
-
let
|
|
267
|
-
|
|
267
|
+
let p = document.createElement("wj-label");
|
|
268
|
+
p.innerText = this.label || "";
|
|
268
269
|
let d = document.createElement("div");
|
|
269
270
|
d.classList.add("input-wrapper");
|
|
270
271
|
let l = document.createElement("input");
|
|
@@ -280,7 +281,7 @@ class M extends u {
|
|
|
280
281
|
let v = document.createElement("wj-icon");
|
|
281
282
|
v.setAttribute("name", "x"), w.appendChild(v);
|
|
282
283
|
let m = document.createElement("wj-popup");
|
|
283
|
-
return m.setAttribute("placement", "bottom-start"), m.setAttribute("manual", ""), m.setAttribute("size", ""), this.hasAttribute("disabled") && m.setAttribute("disabled", ""), this.variant === "standard" ? this.hasAttribute("label") && r.appendChild(
|
|
284
|
+
return m.setAttribute("placement", "bottom-start"), m.setAttribute("manual", ""), m.setAttribute("size", ""), this.hasAttribute("disabled") && m.setAttribute("disabled", ""), this.variant === "standard" ? this.hasAttribute("label") && r.appendChild(p) : n.appendChild(p), d.appendChild(l), this.hasAttribute("multiple") && d.appendChild(g), this.hasAttribute("clearable") && d.appendChild(w), d.appendChild(h), b.appendChild(j), n.appendChild(d), m.appendChild(n), m.appendChild(b), this.trigger === "click" && m.setAttribute("manual", ""), r.appendChild(m), this.native = r, this.popup = m, this.labelElement = p, this.input = l, this.optionsWrapper = b, this.chips = g, this.clear = w, o.appendChild(r), o;
|
|
284
285
|
}
|
|
285
286
|
afterDraw(t, e, a) {
|
|
286
287
|
this.input.addEventListener("focus", (o) => {
|
|
@@ -342,7 +343,7 @@ const N = `:host{--wj-font-size: 10px;--wj-tab-text-transfrom: uppercase;--wj-ta
|
|
|
342
343
|
class P extends u {
|
|
343
344
|
constructor() {
|
|
344
345
|
super();
|
|
345
|
-
|
|
346
|
+
c(this, "className", "Tab");
|
|
346
347
|
this.last = !1;
|
|
347
348
|
}
|
|
348
349
|
static get cssStyleSheet() {
|
|
@@ -365,7 +366,7 @@ const I = `:host{--wj-tab-top: 0;--wj-tab-start: 0;--wj-tab-end: 0;--wj-tab-bott
|
|
|
365
366
|
class $ extends u {
|
|
366
367
|
constructor() {
|
|
367
368
|
super();
|
|
368
|
-
|
|
369
|
+
c(this, "className", "TabGroup");
|
|
369
370
|
}
|
|
370
371
|
static get cssStyleSheet() {
|
|
371
372
|
return I;
|
|
@@ -378,8 +379,8 @@ class $ extends u {
|
|
|
378
379
|
r.classList.add("native-tab-group");
|
|
379
380
|
let n = document.createElement("header");
|
|
380
381
|
n.classList.add("scroll-snap-x");
|
|
381
|
-
let
|
|
382
|
-
return h.setAttribute("name", "nav"), n.appendChild(
|
|
382
|
+
let p = document.createElement("nav"), d = document.createElement("section"), l = document.createElement("slot"), h = document.createElement("slot");
|
|
383
|
+
return h.setAttribute("name", "nav"), n.appendChild(p), p.appendChild(h), d.appendChild(l), r.appendChild(n), r.appendChild(d), o.appendChild(r), o;
|
|
383
384
|
}
|
|
384
385
|
afterDraw() {
|
|
385
386
|
let t = this.getActiveTab(), e = t ? t[0].name : this.getTabAll()[0].panel;
|
|
@@ -416,7 +417,7 @@ const B = `:host{display:none;flex-wrap:wrap;align-items:center;padding:1rem}:ho
|
|
|
416
417
|
class H extends u {
|
|
417
418
|
constructor() {
|
|
418
419
|
super();
|
|
419
|
-
|
|
420
|
+
c(this, "className", "TabPanel");
|
|
420
421
|
}
|
|
421
422
|
static get cssStyleSheet() {
|
|
422
423
|
return B;
|
|
@@ -431,86 +432,86 @@ class H extends u {
|
|
|
431
432
|
}
|
|
432
433
|
customElements.get("wj-tab-panel") || window.customElements.define("wj-tab-panel", H);
|
|
433
434
|
export {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
435
|
+
at as Animation,
|
|
436
|
+
rt as Aside,
|
|
437
|
+
st as Avatar,
|
|
438
|
+
lt as Badge,
|
|
439
|
+
ct as Breadcrumb,
|
|
440
|
+
mt as Breadcrumbs,
|
|
441
|
+
ht as Button,
|
|
442
|
+
wt as ButtonGroup,
|
|
443
|
+
ft as Card,
|
|
444
|
+
xt as CardContent,
|
|
445
|
+
At as CardControls,
|
|
446
|
+
Et as CardHeader,
|
|
447
|
+
St as CardSubtitle,
|
|
448
|
+
kt as CardTitle,
|
|
449
|
+
Ot as Carousel,
|
|
450
|
+
Rt as CarouselItem,
|
|
451
|
+
Ft as Checkbox,
|
|
452
|
+
Nt as Chip,
|
|
453
|
+
It as Col,
|
|
454
|
+
Bt as ColorPicker,
|
|
455
|
+
Wt as Container,
|
|
456
|
+
Gt as CopyButton,
|
|
457
|
+
Ut as Dialog,
|
|
458
|
+
Jt as Divider,
|
|
459
|
+
Qt as Dropdown,
|
|
459
460
|
k as ExampleElement,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
461
|
+
Yt as FileUpload,
|
|
462
|
+
te as FileUploadItem,
|
|
463
|
+
re as Footer,
|
|
464
|
+
ae as FormatDigital,
|
|
465
|
+
se as Grid,
|
|
466
|
+
le as Header,
|
|
467
|
+
ce as Icon,
|
|
468
|
+
me as IconPicker,
|
|
469
|
+
he as Img,
|
|
470
|
+
we as ImgComparer,
|
|
471
|
+
fe as InfiniteScroll,
|
|
472
|
+
xe as Input,
|
|
473
|
+
Ae as InputFile,
|
|
474
|
+
Ee as Item,
|
|
475
|
+
Se as Label,
|
|
476
|
+
ke as List,
|
|
476
477
|
x as Localizer,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
Oe as Main,
|
|
479
|
+
Re as Masonry,
|
|
480
|
+
Fe as Menu,
|
|
481
|
+
Ne as MenuButton,
|
|
482
|
+
Ie as MenuItem,
|
|
483
|
+
Be as MenuLabel,
|
|
483
484
|
O as NavMenu,
|
|
484
485
|
R as Option,
|
|
485
486
|
z as Options,
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
487
|
+
We as Popup,
|
|
488
|
+
Ge as ProgressBar,
|
|
489
|
+
Ue as Radio,
|
|
490
|
+
Je as RadioGroup,
|
|
491
|
+
Qe as Rate,
|
|
492
|
+
Ye as RelativeTime,
|
|
493
|
+
tr as Route,
|
|
494
|
+
ar as RouterLink,
|
|
495
|
+
rr as Routerx,
|
|
496
|
+
sr as Row,
|
|
496
497
|
M as Select,
|
|
497
|
-
|
|
498
|
-
|
|
498
|
+
lr as Slider,
|
|
499
|
+
cr as SplitView,
|
|
499
500
|
P as Tab,
|
|
500
501
|
$ as TabGroup,
|
|
501
502
|
H as TabPanel,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
503
|
+
mr as Textarea,
|
|
504
|
+
hr as Thumbnail,
|
|
505
|
+
wr as Toast,
|
|
506
|
+
fr as Toggle,
|
|
507
|
+
xr as Toolbar,
|
|
508
|
+
Ar as ToolbarAction,
|
|
509
|
+
Er as Tooltip,
|
|
510
|
+
Sr as VisuallyHidden,
|
|
510
511
|
u as WJElement,
|
|
511
512
|
X as bindRouterLinks,
|
|
512
513
|
J as defaultStoreActions,
|
|
513
|
-
|
|
514
|
+
tt as fetchAndParseCSS,
|
|
514
515
|
K as store,
|
|
515
516
|
Y as withRouterLinks
|
|
516
517
|
};
|
package/package.json
CHANGED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
var l = Object.defineProperty;
|
|
2
|
-
var c = (s, e, t) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var m = (s, e, t) => (c(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import f from "./wj-element.js";
|
|
5
|
-
let o = [];
|
|
6
|
-
function h(s) {
|
|
7
|
-
const e = /@keyframes\s+([\w-]+)\s*{([\s\S]+?})\s*}/g;
|
|
8
|
-
let t, n = [];
|
|
9
|
-
for (; (t = e.exec(s)) !== null; ) {
|
|
10
|
-
let i = t[1], a = t[2].trim(), r = u(a);
|
|
11
|
-
n.push({ name: i, keyframes: r });
|
|
12
|
-
}
|
|
13
|
-
return n;
|
|
14
|
-
}
|
|
15
|
-
function u(s) {
|
|
16
|
-
const e = /([\d%]+)\s*{([\s\S]+?)}/g;
|
|
17
|
-
let t, n = [];
|
|
18
|
-
for (; (t = e.exec(s)) !== null; ) {
|
|
19
|
-
let i = parseFloat(t[1]) / 100, a = d(t[2]), r = {
|
|
20
|
-
offset: i,
|
|
21
|
-
...a
|
|
22
|
-
};
|
|
23
|
-
n.push(r);
|
|
24
|
-
}
|
|
25
|
-
return n.sort((i, a) => i.offset - a.offset), n;
|
|
26
|
-
}
|
|
27
|
-
function d(s) {
|
|
28
|
-
const e = {};
|
|
29
|
-
return s.split(";").forEach((t) => {
|
|
30
|
-
const [n, i] = t.split(":").map((a) => a.trim());
|
|
31
|
-
n && i && (n === "animation-timing-function" ? e.easing = i : e[n] = i);
|
|
32
|
-
}), e;
|
|
33
|
-
}
|
|
34
|
-
async function p(s) {
|
|
35
|
-
try {
|
|
36
|
-
if (o.length > 0)
|
|
37
|
-
return o;
|
|
38
|
-
const t = await (await fetch(s)).text();
|
|
39
|
-
return o = h(t), o;
|
|
40
|
-
} catch (e) {
|
|
41
|
-
console.error("Error:", e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const y = "";
|
|
45
|
-
class g extends f {
|
|
46
|
-
constructor() {
|
|
47
|
-
super();
|
|
48
|
-
m(this, "className", "Animation");
|
|
49
|
-
this._animations = [];
|
|
50
|
-
}
|
|
51
|
-
set animations(t) {
|
|
52
|
-
this._animations = t;
|
|
53
|
-
}
|
|
54
|
-
get animations() {
|
|
55
|
-
return this._animations;
|
|
56
|
-
}
|
|
57
|
-
static get cssStyleSheet() {
|
|
58
|
-
return y;
|
|
59
|
-
}
|
|
60
|
-
static get observedAttributes() {
|
|
61
|
-
return ["name"];
|
|
62
|
-
}
|
|
63
|
-
setupAttributes() {
|
|
64
|
-
this.isShadowRoot = "open";
|
|
65
|
-
}
|
|
66
|
-
draw(t, n, i) {
|
|
67
|
-
let a = document.createDocumentFragment(), r = document.createElement("slot");
|
|
68
|
-
return a.appendChild(r), this.slotEl = r, a;
|
|
69
|
-
}
|
|
70
|
-
async afterDraw() {
|
|
71
|
-
this.destroyAnimation(), this.animations = await this.getAnimationsArray();
|
|
72
|
-
const t = this.animations.find((i) => i.name === this.name), n = this.slotEl.assignedElements()[0];
|
|
73
|
-
this.animation = n.animate(t.keyframes, {
|
|
74
|
-
delay: +this.delay || 0,
|
|
75
|
-
// zdrzanie pred zacatim animacie
|
|
76
|
-
endDelay: +this.endDelay || 0,
|
|
77
|
-
// zdrzanie po skoncení animacie
|
|
78
|
-
fill: this.fill || "auto",
|
|
79
|
-
// vyplnenie animace (pred a po animacii)
|
|
80
|
-
duration: +this.duration || 1e3,
|
|
81
|
-
// doba trvania animacie v milisekundách
|
|
82
|
-
iterationStart: +this.iterationStart || 0,
|
|
83
|
-
// počet opakování animacie
|
|
84
|
-
iterations: this.iterations || 1 / 0,
|
|
85
|
-
// počet opakování animacie
|
|
86
|
-
direction: this.direction || "normal",
|
|
87
|
-
// smer animaciee (zpat a dopredu)
|
|
88
|
-
easing: this.easing || "linear"
|
|
89
|
-
// typ spomalenia (rychlost zmen v čase)
|
|
90
|
-
}), this.animation.play();
|
|
91
|
-
}
|
|
92
|
-
destroyAnimation() {
|
|
93
|
-
this.animation && this.animation.cancel();
|
|
94
|
-
}
|
|
95
|
-
async getAnimationsArray() {
|
|
96
|
-
return await p("https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css");
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
customElements.get("wj-animation") || window.customElements.define("wj-animation", g);
|
|
100
|
-
export {
|
|
101
|
-
g as A,
|
|
102
|
-
p as f
|
|
103
|
-
};
|