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/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 p = (s, i, t) => (y(s, typeof i != "symbol" ? i + "" : i, t), t);
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 { A as tt, f as et } from "./animation-2266bd6e.js";
7
+ import { fetchAndParseCSS as tt } from "./wj-fetchAndParseCSS.js";
8
8
  import { L as x } from "./localize-762a9f0f.js";
9
- import { Aside as ot } from "./wj-aside.js";
10
- import { Avatar as it } from "./wj-avatar.js";
11
- import { Badge as nt } from "./wj-badge.js";
12
- import { Breadcrumb as dt } from "./wj-breadcrumb.js";
13
- import { Breadcrumbs as ct } from "./wj-breadcrumbs.js";
14
- import { Button as ut } from "./wj-button.js";
15
- import { ButtonGroup as bt } from "./wj-button-group.js";
16
- import { Card as gt } from "./wj-card.js";
17
- import { CardContent as vt } from "./wj-card-content.js";
18
- import { CardControls as jt } from "./wj-card-controls.js";
19
- import { CardHeader as yt } from "./wj-card-header.js";
20
- import { CardSubtitle as Ct } from "./wj-card-subtitle.js";
21
- import { CardTitle as Tt } from "./wj-card-title.js";
22
- import { Carousel as Lt } from "./wj-carousel.js";
23
- import { CarouselItem as Dt } from "./wj-carousel-item.js";
24
- import { Checkbox as zt } from "./wj-checkbox.js";
25
- import { Chip as Mt } from "./wj-chip.js";
26
- import { Col as Pt } from "./wj-col.js";
27
- import { ColorPicker as $t } from "./wj-color-picker.js";
28
- import { Container as Ht } from "./wj-container.js";
29
- import { CopyButton as qt } from "./wj-copy-button.js";
30
- import { Dialog as Vt } from "./wj-dialog.js";
31
- import { Divider as _t } from "./wj-divider.js";
32
- import { Dropdown as Kt } from "./wj-dropdown.js";
33
- import { FileUpload as Xt } from "./wj-file-upload.js";
34
- import { FileUploadItem as Zt } from "./wj-file-upload-item.js";
35
- import { Footer as ee } from "./wj-footer.js";
36
- import { FormatDigital as oe } from "./wj-format-digital.js";
37
- import { Grid as ie } from "./wj-grid.js";
38
- import { Header as ne } from "./wj-header.js";
39
- import { Icon as de } from "./wj-icon.js";
40
- import { IconPicker as ce } from "./wj-icon-picker.js";
41
- import { Img as ue } from "./wj-img.js";
42
- import { ImgComparer as be } from "./wj-img-comparer.js";
43
- import { InfiniteScroll as ge } from "./wj-infinite-scroll.js";
44
- import { Input as ve } from "./wj-input.js";
45
- import { InputFile as je } from "./wj-input-file.js";
46
- import { Item as ye } from "./wj-item.js";
47
- import { Label as Ce } from "./wj-label.js";
48
- import { List as Te } from "./wj-list.js";
49
- import { Main as Le } from "./wj-main.js";
50
- import { Masonry as De } from "./wj-masonry.js";
51
- import { Menu as ze } from "./wj-menu.js";
52
- import { MenuButton as Me } from "./wj-menu-button.js";
53
- import { MenuItem as Pe } from "./wj-menu-item.js";
54
- import { MenuLabel as $e } from "./wj-menu-label.js";
55
- import { Popup as He } from "./wj-popup.js";
56
- import { ProgressBar as qe } from "./wj-progress-bar.js";
57
- import { Radio as Ve } from "./wj-radio.js";
58
- import { RadioGroup as _e } from "./wj-radio-group.js";
59
- import { Rate as Ke } from "./wj-rate.js";
60
- import { RelativeTime as Xe } from "./wj-relative-time.js";
61
- import { Route as Ze } from "./wj-route.js";
62
- import { Routerx as er } from "./wj-routerx.js";
63
- import { RouterLink as or } from "./wj-router-link.js";
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 ir } from "./wj-row.js";
66
- import { Slider as nr } from "./wj-slider.js";
67
- import { SplitView as dr } from "./wj-split-view.js";
68
- import { Textarea as cr } from "./wj-textarea.js";
69
- import { Thumbnail as ur } from "./wj-thumbnail.js";
70
- import { Toast as br } from "./wj-toast.js";
71
- import { Toggle as gr } from "./wj-toggle.js";
72
- import { Toolbar as vr } from "./wj-toolbar.js";
73
- import { ToolbarAction as jr } from "./wj-toolbar-action.js";
74
- import { Tooltip as yr } from "./wj-tooltip.js";
75
- import { VisuallyHidden as Cr } from "./wj-visually-hidden.js";
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
- p(this, "className", "ExampleElement");
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
- p(this, "className", "ButtonGroup");
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
- p(this, "className", "Option");
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 c = document.createElement("slot");
181
- c.setAttribute("name", "start");
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(c), r.appendChild(d), r.appendChild(l), o.appendChild(r), o;
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
- p(this, "className", "Options");
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
- p(this, "className", "Select");
226
- p(this, "optionChange", (t) => {
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
- p(this, "removeChip", (t) => {
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 c = document.createElement("wj-label");
267
- c.innerText = this.label || "";
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(c) : n.appendChild(c), 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 = c, this.input = l, this.optionsWrapper = b, this.chips = g, this.clear = w, o.appendChild(r), o;
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
- p(this, "className", "Tab");
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
- p(this, "className", "TabGroup");
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 c = document.createElement("nav"), d = document.createElement("section"), l = document.createElement("slot"), h = document.createElement("slot");
382
- return h.setAttribute("name", "nav"), n.appendChild(c), c.appendChild(h), d.appendChild(l), r.appendChild(n), r.appendChild(d), o.appendChild(r), o;
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
- p(this, "className", "TabPanel");
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
- tt as Animation,
435
- ot as Aside,
436
- it as Avatar,
437
- nt as Badge,
438
- dt as Breadcrumb,
439
- ct as Breadcrumbs,
440
- ut as Button,
441
- bt as ButtonGroup,
442
- gt as Card,
443
- vt as CardContent,
444
- jt as CardControls,
445
- yt as CardHeader,
446
- Ct as CardSubtitle,
447
- Tt as CardTitle,
448
- Lt as Carousel,
449
- Dt as CarouselItem,
450
- zt as Checkbox,
451
- Mt as Chip,
452
- Pt as Col,
453
- $t as ColorPicker,
454
- Ht as Container,
455
- qt as CopyButton,
456
- Vt as Dialog,
457
- _t as Divider,
458
- Kt as Dropdown,
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
- Xt as FileUpload,
461
- Zt as FileUploadItem,
462
- ee as Footer,
463
- oe as FormatDigital,
464
- ie as Grid,
465
- ne as Header,
466
- de as Icon,
467
- ce as IconPicker,
468
- ue as Img,
469
- be as ImgComparer,
470
- ge as InfiniteScroll,
471
- ve as Input,
472
- je as InputFile,
473
- ye as Item,
474
- Ce as Label,
475
- Te as List,
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
- Le as Main,
478
- De as Masonry,
479
- ze as Menu,
480
- Me as MenuButton,
481
- Pe as MenuItem,
482
- $e as MenuLabel,
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
- He as Popup,
487
- qe as ProgressBar,
488
- Ve as Radio,
489
- _e as RadioGroup,
490
- Ke as Rate,
491
- Xe as RelativeTime,
492
- Ze as Route,
493
- or as RouterLink,
494
- er as Routerx,
495
- ir as Row,
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
- nr as Slider,
498
- dr as SplitView,
498
+ lr as Slider,
499
+ cr as SplitView,
499
500
  P as Tab,
500
501
  $ as TabGroup,
501
502
  H as TabPanel,
502
- cr as Textarea,
503
- ur as Thumbnail,
504
- br as Toast,
505
- gr as Toggle,
506
- vr as Toolbar,
507
- jr as ToolbarAction,
508
- yr as Tooltip,
509
- Cr as VisuallyHidden,
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
- et as fetchAndParseCSS,
514
+ tt as fetchAndParseCSS,
514
515
  K as store,
515
516
  Y as withRouterLinks
516
517
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "private": false,
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "./dist"
@@ -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
- };