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.
Files changed (71) hide show
  1. package/dist/animation-2266bd6e.js +103 -0
  2. package/dist/localize-762a9f0f.js +43 -0
  3. package/dist/wj-animation.js +6 -0
  4. package/dist/wj-aside.js +8 -10
  5. package/dist/wj-avatar.js +19 -21
  6. package/dist/wj-badge.js +16 -16
  7. package/dist/wj-breadcrumb.js +7 -11
  8. package/dist/wj-breadcrumbs.js +5 -7
  9. package/dist/wj-button-group.js +11 -13
  10. package/dist/wj-button.js +36 -39
  11. package/dist/wj-card-content.js +11 -13
  12. package/dist/wj-card-controls.js +6 -8
  13. package/dist/wj-card-header.js +11 -13
  14. package/dist/wj-card-subtitle.js +9 -11
  15. package/dist/wj-card-title.js +7 -9
  16. package/dist/wj-card.js +13 -15
  17. package/dist/wj-carousel-item.js +32 -0
  18. package/dist/wj-carousel.js +178 -0
  19. package/dist/wj-checkbox.js +11 -11
  20. package/dist/wj-chip.js +17 -17
  21. package/dist/wj-col.js +11 -12
  22. package/dist/wj-color-picker.js +192 -179
  23. package/dist/wj-container.js +7 -9
  24. package/dist/wj-copy-button.js +1 -3
  25. package/dist/wj-dialog.js +20 -22
  26. package/dist/wj-divider.js +7 -9
  27. package/dist/wj-dropdown.js +10 -14
  28. package/dist/wj-element.js +9 -9
  29. package/dist/wj-file-upload-item.js +63 -0
  30. package/dist/wj-file-upload.js +221 -0
  31. package/dist/wj-footer.js +9 -11
  32. package/dist/wj-form.js +6 -8
  33. package/dist/wj-format-digital.js +51 -0
  34. package/dist/wj-grid.js +9 -10
  35. package/dist/wj-header.js +9 -11
  36. package/dist/wj-icon-picker.js +78 -58
  37. package/dist/wj-icon.js +45 -48
  38. package/dist/wj-img-comparer.js +12 -14
  39. package/dist/wj-img.js +14 -16
  40. package/dist/wj-infinite-scroll.js +27 -22
  41. package/dist/wj-input-file.js +47 -0
  42. package/dist/wj-input.js +30 -23
  43. package/dist/wj-item.js +1 -3
  44. package/dist/wj-label.js +10 -10
  45. package/dist/wj-list.js +1 -3
  46. package/dist/wj-main.js +1 -3
  47. package/dist/wj-masonry.js +71518 -0
  48. package/dist/wj-master.js +287 -253
  49. package/dist/wj-menu-button.js +10 -12
  50. package/dist/wj-menu-item.js +49 -46
  51. package/dist/wj-menu-label.js +2 -2
  52. package/dist/wj-menu.js +8 -10
  53. package/dist/wj-popup.js +89 -88
  54. package/dist/wj-progress-bar.js +14 -16
  55. package/dist/wj-radio-group.js +5 -7
  56. package/dist/wj-radio.js +13 -15
  57. package/dist/wj-rate.js +127 -0
  58. package/dist/wj-relative-time.js +50 -0
  59. package/dist/wj-router-link.js +11 -13
  60. package/dist/wj-row.js +11 -12
  61. package/dist/wj-slider.js +6 -6
  62. package/dist/wj-split-view.js +1 -3
  63. package/dist/wj-textarea.js +17 -19
  64. package/dist/wj-thumbnail.js +12 -14
  65. package/dist/wj-toast.js +1 -1
  66. package/dist/wj-toggle.js +9 -9
  67. package/dist/wj-toolbar.js +13 -15
  68. package/dist/wj-tooltip.js +16 -18
  69. package/dist/wj-visually-hidden.js +6 -8
  70. package/package.json +1 -1
  71. package/dist/style.css +0 -3
@@ -0,0 +1,103 @@
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
+ };
@@ -0,0 +1,43 @@
1
+ const n = /* @__PURE__ */ new Map();
2
+ class s {
3
+ constructor(t) {
4
+ this.element = t, this.languages = n, this.lang = this.element.lang || document.documentElement.lang || "en", this.dir = this.element.dir || document.documentElement.dir || "ltr", this.setLanguage();
5
+ }
6
+ // Nastavenie aktuálneho jazyka
7
+ setLanguage() {
8
+ this.languages.has(this.lang) ? this.currentLang = this.lang : console.error(`Language "${this.lang}" not loaded.`);
9
+ }
10
+ // Vyhľadávanie prekladu podľa kľúča
11
+ translate(t) {
12
+ const e = this.languages.get(this.currentLang);
13
+ return e && e[t] || t;
14
+ }
15
+ // Formátovanie čísla podľa aktuálneho jazyka
16
+ formatNumber(t, e) {
17
+ return new Intl.NumberFormat(this.currentLang, e).format(t);
18
+ }
19
+ // Formátovanie dátumu podľa aktuálneho jazyka
20
+ formatDate(t) {
21
+ return new Intl.DateTimeFormat(this.currentLang).format(new Date(t));
22
+ }
23
+ relativeTime(t = 0, e, r = { numeric: "auto" }) {
24
+ return new Intl.RelativeTimeFormat(this.currentLang, r).format(t, e);
25
+ }
26
+ }
27
+ function i(...a) {
28
+ a.map((t) => {
29
+ const e = t.code.toLowerCase();
30
+ n.has(e) ? n.set(e, { ...n.get(e), ...t }) : n.set(e, t);
31
+ });
32
+ }
33
+ class o extends s {
34
+ constructor(t) {
35
+ super(t);
36
+ }
37
+ static registerTranslation(...t) {
38
+ i(...t);
39
+ }
40
+ }
41
+ export {
42
+ o as L
43
+ };
@@ -0,0 +1,6 @@
1
+ import "./wj-element.js";
2
+ import { A as t } from "./animation-2266bd6e.js";
3
+ import "./wj-store.js";
4
+ export {
5
+ t as Animation
6
+ };
package/dist/wj-aside.js CHANGED
@@ -1,19 +1,17 @@
1
1
  var d = Object.defineProperty;
2
- var a = (e, t, s) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var o = (e, t, s) => (a(e, typeof t != "symbol" ? t + "" : t, s), s);
4
- import n from "./wj-element.js";
2
+ var a = (e, t, o) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var s = (e, t, o) => (a(e, typeof t != "symbol" ? t + "" : t, o), o);
4
+ import h from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const h = `/*!
7
- * direction.scss
8
- */:host{--wj-aside-width: "100px";--wj-aside-top: 0;--wj-aside-border-color: var(--wj-border-color);--wj-aside-border-width: 0 1px 0 0;--wj-aside-border-style: solid;box-sizing:border-box;flex-shrink:0;overflow:auto;border-color:var(--wj-aside-border-color);border-width:var(--wj-aside-border-width);border-style:var(--wj-aside-border-style)}:host(.open){display:block!important}@media (min-width: 768px){:host([fixed]){position:fixed;width:var(--wj-aside-width);top:var(--wj-aside-top);height:calc(100% - var(--wj-aside-top))}}@media (max-width: 768px){:host{display:none}:host([variant=top-start]){position:fixed;top:0;left:0;width:80%;height:100%;z-index:9999;background-color:#fff}}
6
+ const n = `:host{--wj-aside-width: "100px";--wj-aside-top: 0;--wj-aside-border-color: var(--wj-border-color);--wj-aside-border-width: 0 1px 0 0;--wj-aside-border-style: solid;box-sizing:border-box;flex-shrink:0;overflow:auto;border-color:var(--wj-aside-border-color);border-width:var(--wj-aside-border-width);border-style:var(--wj-aside-border-style)}:host(.open){display:block!important}@media (min-width: 768px){:host([fixed]){position:fixed;width:var(--wj-aside-width);top:var(--wj-aside-top);height:calc(100% - var(--wj-aside-top))}}@media (max-width: 768px){:host{display:none}:host([variant=top-start]){position:fixed;top:0;left:0;width:80%;height:100%;z-index:9999;background-color:#fff}}
9
7
  `;
10
- class w extends n {
8
+ class w extends h {
11
9
  constructor() {
12
10
  super();
13
- o(this, "className", "Aside");
11
+ s(this, "className", "Aside");
14
12
  }
15
13
  static get cssStyleSheet() {
16
- return h;
14
+ return n;
17
15
  }
18
16
  static get observedAttributes() {
19
17
  return [];
@@ -21,7 +19,7 @@ class w extends n {
21
19
  setupAttributes() {
22
20
  this.isShadowRoot = "open";
23
21
  }
24
- draw(s, l, p) {
22
+ draw(o, l, p) {
25
23
  let i = document.createDocumentFragment();
26
24
  this.width && this.style.setProperty("--wj-aside-width", this.width), this.top && this.hasAttribute("fixed") && this.style.setProperty("--wj-aside-top", this.top);
27
25
  let r = document.createElement("slot");
package/dist/wj-avatar.js CHANGED
@@ -1,52 +1,50 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (r, a, t) => a in r ? d(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t;
3
- var l = (r, a, t) => (h(r, typeof a != "symbol" ? a + "" : a, t), t);
3
+ var n = (r, a, t) => (h(r, typeof a != "symbol" ? a + "" : a, t), t);
4
4
  import v from "./wj-element.js";
5
5
  import "./wj-store.js";
6
6
  function w(r, a = 30, t = 80) {
7
- let i = r, s = 0;
8
- for (let e = 0; e < (i == null ? void 0 : i.length); e++)
9
- s = i.charCodeAt(e) + ((s << 5) - s);
7
+ let o = r, s = 0;
8
+ for (let e = 0; e < (o == null ? void 0 : o.length); e++)
9
+ s = o.charCodeAt(e) + ((s << 5) - s);
10
10
  return "hsl(" + s % 360 + ", " + a + "%, " + t + "%)";
11
11
  }
12
12
  function c(r, a = 2) {
13
- let t = r.split(" "), i = t[0].substring(0, 1).toUpperCase();
14
- return t.length > 1 && a > 1 && (i += t[t.length - 1].substring(0, 1).toUpperCase()), i;
13
+ let t = r.split(" "), o = t[0].substring(0, 1).toUpperCase();
14
+ return t.length > 1 && a > 1 && (o += t[t.length - 1].substring(0, 1).toUpperCase()), o;
15
15
  }
16
- const g = `/*!
17
- * direction.scss
18
- */:host{--wj-avatar-width: 32px;--wj-avatar-height: 32px;--wj-avatar-font-size: .75rem;--wj-avatar-font-weight: 400;--wj-avatar-color: inherit;--wj-avatar-background-color: rgba(33, 33, 33, .17);--wj-avatar-border-radius: 50%;--wj-avatar-border-color: transparent;--wj-avatar-border-width: 1px;--wj-avatar-border-style: solid;display:inline-block;width:var(--wj-avatar-width);height:var(--wj-avatar-height);font-size:var(--wj-avatar-font-size);font-weight:var(--wj-avatar-font-weight);color:var(--wj-avatar-color)}:host .native-avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:var(--wj-avatar-border-radius);background-color:var(--wj-avatar-background-color)}::slotted(wj-img),::slotted(img){border-radius:var(--wj-avatar-border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}:host(.wj-avatar-border){border-color:var(--wj-avatar-border-color);border-width:var(--wj-avatar-border-width);border-style:var(--wj-avatar-border-style)}:host(.wj-avatar-small){--wj-avatar-width: 24px;--wj-avatar-height: 24px}:host(.wj-avatar-large){--wj-avatar-width: 48px;--wj-avatar-height: 48px}
16
+ const j = `:host{--wj-avatar-width: 32px;--wj-avatar-height: 32px;--wj-avatar-font-size: .75rem;--wj-avatar-font-weight: 400;--wj-avatar-color: inherit;--wj-avatar-background-color: var(--wj-color-contrast-low);--wj-avatar-border-radius: 50%;--wj-avatar-border-color: transparent;--wj-avatar-border-width: 1px;--wj-avatar-border-style: solid;display:inline-block;width:var(--wj-avatar-width);height:var(--wj-avatar-height);font-size:var(--wj-avatar-font-size);font-weight:var(--wj-avatar-font-weight);color:var(--wj-avatar-color)}:host .native-avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:var(--wj-avatar-border-radius);background-color:var(--wj-avatar-background-color)}::slotted(wj-img),::slotted(img){border-radius:var(--wj-avatar-border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}:host(.wj-avatar-border){border-color:var(--wj-avatar-border-color);border-width:var(--wj-avatar-border-width);border-style:var(--wj-avatar-border-style)}:host(.wj-avatar-small){--wj-avatar-width: 24px;--wj-avatar-height: 24px}:host(.wj-avatar-large){--wj-avatar-width: 48px;--wj-avatar-height: 48px}
19
17
  `;
20
- class j extends v {
18
+ class g extends v {
21
19
  constructor() {
22
20
  super();
23
- l(this, "className", "Avatar");
21
+ n(this, "className", "Avatar");
24
22
  }
25
23
  static get cssStyleSheet() {
26
- return g;
24
+ return j;
27
25
  }
28
26
  setupAttributes() {
29
27
  this.isShadowRoot = "open";
30
28
  }
31
- draw(t, i, s) {
32
- let n = document.createDocumentFragment(), o = document.createElement("div");
33
- if (o.setAttribute("part", "native"), o.classList.add("native-avatar"), this.size && this.classList.add("wj-avatar-" + this.size), this.isImage()) {
29
+ draw(t, o, s) {
30
+ let l = document.createDocumentFragment(), i = document.createElement("div");
31
+ if (i.setAttribute("part", "native"), i.classList.add("native-avatar"), this.size && this.classList.add("wj-avatar-" + this.size), this.isImage()) {
34
32
  let e = document.createElement("slot");
35
- o.appendChild(e);
33
+ i.appendChild(e);
36
34
  } else if (this.hasAttribute("initials")) {
37
35
  let e = c(this.label);
38
- this.setAttribute("style", `--wj-avatar-background-color: ${w(e)}`), o.innerText = e;
36
+ this.setAttribute("style", `--wj-avatar-background-color: ${w(e)}`), i.innerText = e;
39
37
  } else {
40
38
  let e = document.createElement("slot");
41
- e.setAttribute("name", "icon"), o.appendChild(e);
39
+ e.setAttribute("name", "icon"), i.appendChild(e);
42
40
  }
43
- return n.appendChild(o), n;
41
+ return l.appendChild(i), l;
44
42
  }
45
43
  isImage() {
46
44
  return this.getElementsByTagName("wj-img").length > 0;
47
45
  }
48
46
  }
49
- customElements.get("wj-avatar") || window.customElements.define("wj-avatar", j);
47
+ customElements.get("wj-avatar") || window.customElements.define("wj-avatar", g);
50
48
  export {
51
- j as Avatar
49
+ g as Avatar
52
50
  };
package/dist/wj-badge.js CHANGED
@@ -1,31 +1,31 @@
1
- var n = Object.defineProperty;
2
- var c = (t, o, r) => o in t ? n(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r;
3
- var s = (t, o, r) => (c(t, typeof o != "symbol" ? o + "" : o, r), r);
4
- import l from "./wj-element.js";
1
+ var e = Object.defineProperty;
2
+ var l = (r, o, t) => o in r ? e(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
3
+ var c = (r, o, t) => (l(r, typeof o != "symbol" ? o + "" : o, t), t);
4
+ import n from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const i = `/*!
6
+ const w = `/*!
7
7
  * direction.scss
8
- */:host(.wj-color-primary){--wj-color-base: #7252D3 !important;--wj-color-contrast: #fff !important}:host(.wj-color-complete){--wj-color-base: #0072EC !important;--wj-color-contrast: #fff !important}:host(.wj-color-success){--wj-color-base: #19AD79 !important;--wj-color-contrast: #fff !important}:host(.wj-color-warning){--wj-color-base: #FFd945 !important;--wj-color-contrast: #4b4b4b !important}:host(.wj-color-danger){--wj-color-base: #D83C31 !important;--wj-color-contrast: #fff !important}:host(.wj-color-info){--wj-color-base: #3B4752 !important;--wj-color-contrast: #fff !important}:host(.wj-color-menu){--wj-color-base: #f4f4f4 !important;--wj-color-contrast: #4b4b4b !important}:host{--wj-chip-border-radius: 100px;text-shadow:none;font-family:Inter UI,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:600;background-color:#e0e0e0;font-size:11px;padding-left:6px;padding-right:6px;color:#4b4b4b;border-radius:10px}:host(.wj-color){background-color:var(--wj-color-base, red);color:var(--wj-color-contrast)}
8
+ */:host(.wj-color-primary){--wj-color-base: var(--wj-color-primary) !important;--wj-color-contrast: var(--wj-color-contrast-lowest) !important}:host(.wj-color-complete){--wj-color-base: var(--wj-color-complete) !important;--wj-color-contrast: var(--wj-color-contrast-lowest) !important}:host(.wj-color-success){--wj-color-base: var(--wj-color-success) !important;--wj-color-contrast: var(--wj-color-contrast-lowest) !important}:host(.wj-color-warning){--wj-color-base: var(--wj-color-warning) !important;--wj-color-contrast: var(--wj-color-contrast-high) !important}:host(.wj-color-danger){--wj-color-base: var(--wj-color-danger) !important;--wj-color-contrast: var(--wj-color-contrast-lowest) !important}:host(.wj-color-info){--wj-color-base: var(--wj-color-info) !important;--wj-color-contrast: var(--wj-color-contrast-lowest) !important}:host(.wj-color-menu){--wj-color-base: var(--wj-color-contrast-lower) !important;--wj-color-contrast: var(--wj-color-contrast-high) !important}:host{--wj-chip-border-radius: 100px;text-shadow:none;font-family:var(--wj-font-family);font-weight:600;background-color:var(--wj-color-contrast-low);font-size:11px;padding-left:6px;padding-right:6px;color:var(--wj-color-contrast-high);border-radius:10px}:host(.wj-color){background-color:var(--wj-color-base, red);color:var(--wj-color-contrast)}
9
9
  `;
10
- class m extends l {
10
+ class i extends n {
11
11
  constructor() {
12
12
  super();
13
- s(this, "className", "Badge");
13
+ c(this, "className", "Badge");
14
14
  }
15
15
  static get cssStyleSheet() {
16
- return i;
16
+ return w;
17
17
  }
18
18
  setupAttributes() {
19
19
  this.isShadowRoot = "open";
20
20
  }
21
- draw(r, w, p) {
22
- let e = document.createDocumentFragment(), a = document.createElement("slot");
23
- return this.color && this.classList.add("wj-color-" + this.color, "wj-color"), e.appendChild(a), e;
21
+ draw(t, j, m) {
22
+ let a = document.createDocumentFragment(), s = document.createElement("slot");
23
+ return this.color && this.classList.add("wj-color-" + this.color, "wj-color"), a.appendChild(s), a;
24
24
  }
25
25
  }
26
- let b = "true";
27
- customElements.get("wj-badge") || window.customElements.define("wj-badge", m);
26
+ let g = "true";
27
+ customElements.get("wj-badge") || window.customElements.define("wj-badge", i);
28
28
  export {
29
- m as Badge,
30
- b as __esModule
29
+ i as Badge,
30
+ g as __esModule
31
31
  };
@@ -1,11 +1,9 @@
1
1
  var h = Object.defineProperty;
2
2
  var b = (o, a, e) => a in o ? h(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
3
  var p = (o, a, e) => (b(o, typeof a != "symbol" ? a + "" : a, e), e);
4
- import w, { WjElementUtils as l, event as g } from "./wj-element.js";
4
+ import w, { WjElementUtils as l, event as j } from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const j = `/*!
7
- * direction.scss
8
- */:host{--wj-breadcrumb-a: rgba(33, 33, 33, .81);--wj-breadcrumb-a-hover: rgba(33, 33, 33, .62);display:flex;flex:0 0 auto;align-items:center;line-height:1.5}:host(.collapsed){display:none}.native-breadcrumb{display:flex;align-items:center;width:100%;outline:none;background:inherit;padding:.25rem .75rem;color:var(--wj-breadcrumb-a);text-decoration:none}.native-breadcrumb.hidden{display:none}.native-breadcrumb.active{font-weight:700}.native-breadcrumb:hover{color:var(--wj-breadcrumb-a-hover)}button{margin-inline:.75rem;border:0 solid transparent;border-radius:3px;background-color:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.separator{display:inline-flex;align-items:center}::slotted([slot=start]){margin-inline:0 .5rem}::slotted([slot=end]){margin-inline:.5rem 0}
6
+ const g = `:host{--wj-breadcrumb-a: var(--wj-color-contrast-high);--wj-breadcrumb-a-hover: var(--wj-color-contrast-medium);display:flex;flex:0 0 auto;align-items:center;line-height:1.5}:host(.collapsed){display:none}.native-breadcrumb{display:flex;align-items:center;width:100%;outline:none;background:inherit;padding:.25rem .75rem;color:var(--wj-breadcrumb-a);text-decoration:none}.native-breadcrumb.hidden{display:none}.native-breadcrumb.active{font-weight:700}.native-breadcrumb:hover{color:var(--wj-breadcrumb-a-hover)}button{margin-inline:.75rem;border:0 solid transparent;border-radius:3px;background-color:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.separator{display:inline-flex;align-items:center}::slotted([slot=start]){margin-inline:0 .5rem}::slotted([slot=end]){margin-inline:.5rem 0}
9
7
  `;
10
8
  class v extends w {
11
9
  constructor() {
@@ -27,7 +25,7 @@ class v extends w {
27
25
  this._collapsedVariant = e || this.parentElement.collapsedVariant;
28
26
  }
29
27
  static get cssStyleSheet() {
30
- return j;
28
+ return g;
31
29
  }
32
30
  static get observedAttributes() {
33
31
  return ["show-collapsed-indicator", "collapsed", "last"];
@@ -60,26 +58,24 @@ class v extends w {
60
58
  return this.collapsedVariant === "DROPDOWN" ? e = this.collapseDropdown() : e = this.collapseButton(), e;
61
59
  }
62
60
  collapseDropdown() {
63
- console.log("DROPDOWN");
64
61
  let e = document.createElement("wj-dropdown");
65
62
  e.setAttribute("placement", "bottom"), e.setAttribute("offset", "10");
66
63
  let r = document.createElement("wj-button");
67
- r.setAttribute("slot", "trigger"), r.setAttribute("variant", "link"), r.innerHTML = '<wj-icon name="dots"></wj-icon>';
64
+ r.setAttribute("slot", "trigger"), r.setAttribute("fill", "link"), r.innerHTML = '<wj-icon name="dots"></wj-icon>';
68
65
  let t = document.createElement("wj-menu");
69
- return t.setAttribute("variant", "context"), e.appendChild(r), e.appendChild(t), e.innerHTML = `<wj-button slot="trigger" variant="link">
66
+ return t.setAttribute("variant", "context"), e.appendChild(r), e.appendChild(t), e.innerHTML = `<wj-button slot="trigger" fill="link">
70
67
  <wj-icon name="dots"></wj-icon>
71
68
  </wj-button>
72
69
  <wj-menu variant="context">
73
- <wj-menu-item>Tralala</wj-menu-item>
70
+ <wj-menu-item>Test 0</wj-menu-item>
74
71
  <wj-menu-item>Test 1</wj-menu-item>
75
72
  <wj-menu-item>Test 2</wj-menu-item>
76
73
  </wj-menu>`, this.parentElement.querySelectorAll("wj-breadcrumb").forEach((s) => {
77
- console.log(s);
78
74
  }), e;
79
75
  }
80
76
  collapseButton() {
81
77
  let e = document.createElement("button");
82
- return e.setAttribute("aria-label", "Show more breadcrumbs"), e.setAttribute("part", "collapsed-indicator"), e.innerHTML = '<wj-icon name="dots"></wj-icon>', g.addListener(e, "click", null, (r) => {
78
+ return e.setAttribute("aria-label", "Show more breadcrumbs"), e.setAttribute("part", "collapsed-indicator"), e.innerHTML = '<wj-icon name="dots"></wj-icon>', j.addListener(e, "click", null, (r) => {
83
79
  this.native.classList.remove("hidden"), e.remove(), this.parentElement.querySelectorAll("wj-breadcrumb").forEach((t) => {
84
80
  t.classList.remove("collapsed");
85
81
  }), r.stopPropagation();
@@ -1,16 +1,14 @@
1
- var n = Object.defineProperty;
2
- var u = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var i = (r, t, e) => (u(r, typeof t != "symbol" ? t + "" : t, e), e);
1
+ var i = Object.defineProperty;
2
+ var n = (r, t, e) => t in r ? i(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var u = (r, t, e) => (n(r, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import d from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const p = `/*!
7
- * direction.scss
8
- */:host{display:flex;flex-wrap:wrap;align-items:center}
6
+ const p = `:host{display:flex;flex-wrap:wrap;align-items:center}
9
7
  `;
10
8
  class b extends d {
11
9
  constructor() {
12
10
  super();
13
- i(this, "className", "Breadcrumbs");
11
+ u(this, "className", "Breadcrumbs");
14
12
  this.last = !1;
15
13
  }
16
14
  static get cssStyleSheet() {
@@ -1,16 +1,14 @@
1
1
  var c = Object.defineProperty;
2
- var d = (o, e, t) => e in o ? c(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var u = (o, e, t) => (d(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- import p from "./wj-element.js";
2
+ var p = (n, e, t) => e in n ? c(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var i = (n, e, t) => (p(n, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import d from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const m = `/*!
7
- * direction.scss
8
- */:host{display:inline-block}:host .native-button-group{display:flex;flex-wrap:nowrap;line-height:1}:host slot{display:contents}::slotted(wj-button){margin:0}
6
+ const m = `:host{display:inline-block}:host .native-button-group{display:flex;flex-wrap:nowrap;line-height:1}:host slot{display:contents}::slotted(wj-button){margin:0!important}
9
7
  `;
10
- class g extends p {
8
+ class g extends d {
11
9
  constructor() {
12
10
  super();
13
- u(this, "className", "ButtonGroup");
11
+ i(this, "className", "ButtonGroup");
14
12
  }
15
13
  static get cssStyleSheet() {
16
14
  return m;
@@ -22,14 +20,14 @@ class g extends p {
22
20
  this.isShadowRoot = "open";
23
21
  }
24
22
  draw(t, l, a) {
25
- let s = document.createDocumentFragment(), n = document.createElement("div");
26
- return n.classList.add("native-button-group"), n.setAttribute("part", "native"), this.slotElement = document.createElement("slot"), n.appendChild(this.slotElement), s.appendChild(n), s;
23
+ let s = document.createDocumentFragment(), o = document.createElement("div");
24
+ return o.classList.add("native-button-group"), o.setAttribute("part", "native"), this.slotElement = document.createElement("slot"), o.appendChild(this.slotElement), s.appendChild(o), s;
27
25
  }
28
26
  afterDraw(t, l, a) {
29
27
  const s = [...this.slotElement.assignedElements({ flatten: !0 })];
30
- s.forEach((n) => {
31
- let i = s.indexOf(n), r = this.findButton(n);
32
- r && (r.classList.add("wj-button-group-button"), r.classList.toggle("wj-button-group-first", i === 0), r.classList.toggle("wj-button-group-inner", i > 0 && i < s.length - 1), r.classList.toggle("wj-button-group-last", i === s.length - 1));
28
+ s.forEach((o) => {
29
+ let u = s.indexOf(o), r = this.findButton(o);
30
+ r && (r.classList.add("wj-button-group-button"), r.classList.toggle("wj-button-group-first", u === 0), r.classList.toggle("wj-button-group-inner", u > 0 && u < s.length - 1), r.classList.toggle("wj-button-group-last", u === s.length - 1));
33
31
  });
34
32
  }
35
33
  findButton(t) {
package/dist/wj-button.js CHANGED
@@ -1,17 +1,15 @@
1
1
  var d = Object.defineProperty;
2
- var c = (o, n, t) => n in o ? d(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
- var u = (o, n, t) => (c(o, typeof n != "symbol" ? n + "" : n, t), t);
4
- import w, { event as a } from "./wj-element.js";
2
+ var b = (t, e, o) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
+ var c = (t, e, o) => (b(t, typeof e != "symbol" ? e + "" : e, o), o);
4
+ import j, { WjElementUtils as h, event as i } from "./wj-element.js";
5
5
  import "./wj-store.js";
6
- const b = (o) => o === "false" || o === "null" || o === "NaN" || o === "undefined" || o === "0" ? !1 : !!o, j = `/*!
7
- * direction.scss
8
- */:host(.wj-button-solid.wj-color-primary){--wj-button-background-color: #7252D3;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-primary){--wj-button-border-color: #7252d3;--wj-button-color: #7252D3}:host(.wj-button-solid.wj-color-complete){--wj-button-background-color: #0072EC;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-complete){--wj-button-border-color: #0072ec;--wj-button-color: #0072EC}:host(.wj-button-solid.wj-color-success){--wj-button-background-color: #19AD79;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-success){--wj-button-border-color: #19ad79;--wj-button-color: #19AD79}:host(.wj-button-solid.wj-color-warning){--wj-button-background-color: #FFd945;--wj-button-color: #4b4b4b}:host(.wj-button-outline.wj-color-warning){--wj-button-border-color: #ffd945;--wj-button-color: #FFd945}:host(.wj-button-solid.wj-color-danger){--wj-button-background-color: #D83C31;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-danger){--wj-button-border-color: #d83c31;--wj-button-color: #D83C31}:host(.wj-button-solid.wj-color-neutral){--wj-button-background-color: #212121;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-neutral){--wj-button-border-color: #212121;--wj-button-color: #212121}:host(.wj-button-solid.wj-color-default){--wj-button-background-color: #fff;--wj-button-color: #4b4b4b}:host(.wj-button-outline.wj-color-default){--wj-button-border-color: rgba(33, 33, 33, .17);--wj-button-background-color: #fff;--wj-button-color: #4b4b4b}:host{--wj-button-border-radius: 4px;--wj-button-border-width: 1px;--wj-button-border-style: solid;--wj-button-border-color: rgba(33, 33, 33, .17);--wj-button-margin-inline: 0;--wj-padding-top: .4rem;--wj-padding-start: .5rem;--wj-padding-end: .5rem;--wj-padding-bottom: .4rem;display:inline-flex;position:relative;width:auto;cursor:pointer;margin-inline:var(--wj-button-margin-inline)}:host(.wj-button-group-button){display:block}.button-native{font-family:var(--wj-font-family);font-size:var(--wj-font-size);display:flex;position:relative;align-items:center;width:100%;height:100%;min-height:inherit;overflow:hidden;border-width:var(--wj-button-border-width);border-style:var(--wj-button-border-style);border-color:var(--wj-button-border-color);outline:none;background-color:var(--wj-button-background-color);color:var(--wj-button-color);line-height:1;contain:layout style;cursor:pointer;z-index:0;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;border-radius:var(--wj-button-border-radius);padding-top:var(--wj-padding-top);padding-bottom:var(--wj-padding-bottom);padding-left:var(--wj-padding-start);padding-right:var(--wj-padding-end)}@media (any-hover: hover){:host(.wj-button-solid:hover){--wj-button-background-color: #845ae0;--wj-button-border-color: #7252D3;--wj-button-color: #fff}:host(.wj-button-outline:hover){--wj-button-background-color: rgba(114, 82, 211, .1);--wj-button-border-color: #7252D3;--wj-button-color: #7252D3}:host(.wj-button-solid.wj-color-complete:hover){--wj-button-background-color: #0f8ff9;--wj-button-border-color: #0072EC;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-complete:hover){--wj-button-background-color: rgba(0, 114, 236, .1);--wj-button-border-color: #0072EC;--wj-button-color: #0072EC}:host(.wj-button-solid.wj-color-success:hover){--wj-button-background-color: #26bf93;--wj-button-border-color: #19AD79;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-success:hover){--wj-button-background-color: rgba(25, 173, 121, .1);--wj-button-border-color: #19AD79;--wj-button-color: #19AD79}:host(.wj-button-solid.wj-color-warning:hover){--wj-button-background-color: #ffe858;--wj-button-border-color: #FFd945;--wj-button-color: #4b4b4b}:host(.wj-button-outline.wj-color-warning:hover){--wj-button-background-color: rgba(255, 217, 69, .1);--wj-button-border-color: #FFd945;--wj-button-color: #FFd945}:host(.wj-button-solid.wj-color-danger:hover){--wj-button-background-color: #e6533c;--wj-button-border-color: #D83C31;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-danger:hover){--wj-button-background-color: rgba(216, 60, 49, .1);--wj-button-border-color: #D83C31;--wj-button-color: #D83C31}:host(.wj-button-solid.wj-color-neutral:hover){--wj-button-background-color: #373737;--wj-button-border-color: #212121;--wj-button-color: #fff}:host(.wj-button-outline.wj-color-neutral:hover){--wj-button-background-color: rgba(33, 33, 33, .1);--wj-button-border-color: #212121;--wj-button-color: #212121}:host(.wj-button-solid.wj-color-default:hover){--wj-button-background-color: rgba(245, 245, 245, .19);--wj-button-border-color: #e0e0e0;--wj-button-color: #4b4b4b}:host(.wj-button-outline.wj-color-default:hover){--wj-button-background-color: rgba(224, 224, 224, .1);--wj-button-border-color: #e0e0e0;--wj-button-color: #4b4b4b}:host(.wj-button-link:hover){--wj-button-background-color: rgba(128, 128, 128, .2) !important;--wj-button-border-color: transparent !important;color:#4b4b4b!important}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.button-solid.wj-color){background-color:var(--wj-button-background-color);color:var(--wj-button-color)}:host(.wj-button-solid){--wj-button-background-color: #7252D3;--wj-button-color: #fff}:host(.wj-button-outline){--wj-button-border-color: #7252d3;--wj-button-background-color: transparent;--wj-button-color: #7252D3}:host(.wj-button-link){--wj-button-border-width: 1px;--wj-button-border-color: transparent;--wj-button-background-color: transparent !important}:host(.wj-button-disabled){cursor:default;opacity:.5;pointer-events:none}:host(.wj-button-round){--wj-button-border-radius: 100px}:host(.wj-button-large){--wj-padding-top: .6rem;--wj-padding-start: .7rem;--wj-padding-end: .7rem;--wj-padding-bottom: .6rem}:host(.wj-button-small){--wj-padding-top: .25rem;--wj-padding-start: .25rem;--wj-padding-end: .25rem;--wj-padding-bottom: .25rem}::slotted(wj-icon[slot=start]){margin:0 .3rem 0 -.3rem}::slotted(wj-icon[slot=end]){margin:0 -.2rem 0 .3rem}::slotted(wj-icon[slot=caret]){margin:0 0 0 .3rem}slot[name=caret]{display:block}:host(.wj-button-group-first:not(.wj-button-group-last)) .button-native{border-start-end-radius:0;border-end-end-radius:0}:host(.wj-button-group-inner) .button-native{border-radius:0}:host(.wj-button-group-last:not(.wj-button-group-first)) .button-native{border-start-start-radius:0;border-end-start-radius:0}:host(.wj-button-group-button:not(.wj-button-group-first)){margin-inline-start:calc(-1 * var(--wj-button-border-width))!important}
6
+ const u = (t) => t === "false" || t === "null" || t === "NaN" || t === "undefined" || t === "0" ? !1 : !!t, g = `:host(.wj-button-solid.wj-color-primary){--wj-button-background-color: var(--wj-color-primary-10);--wj-button-border-color: var(--wj-color-primary-11);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-primary){--wj-button-border-color: var(--wj-color-primary-6);--wj-button-color: var(--wj-color-primary-6)}:host(.wj-button-solid.wj-color-complete){--wj-button-background-color: var(--wj-color-complete-10);--wj-button-border-color: var(--wj-color-complete-11);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-complete){--wj-button-border-color: var(--wj-color-complete-6);--wj-button-color: var(--wj-color-complete-6)}:host(.wj-button-solid.wj-color-success){--wj-button-background-color: var(--wj-color-success-10);--wj-button-border-color: var(--wj-color-success-11);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-success){--wj-button-border-color: var(--wj-color-success-6);--wj-button-color: var(--wj-color-success-6)}:host(.wj-button-solid.wj-color-warning){--wj-button-background-color: var(--wj-color-warning-10);--wj-button-border-color: var(--wj-color-warning-11);--wj-button-color: var(--wj-color-black)}:host(.wj-button-outline.wj-color-warning){--wj-button-border-color: var(--wj-color-warning-6);--wj-button-color: var(--wj-color-warning-6)}:host(.wj-button-solid.wj-color-danger){--wj-button-background-color: var(--wj-color-danger-10);--wj-button-border-color: var(--wj-color-danger-11);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-danger){--wj-button-border-color: var(--wj-color-danger-6);--wj-button-color: var(--wj-color-danger-6)}:host(.wj-button-solid.wj-color-neutral){--wj-button-background-color: var(--wj-color-contrast-10);--wj-button-border-color: var(--wj-color-contrast-11);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-neutral){--wj-button-border-color: var(--wj-color-contrast-6);--wj-button-color: var(--wj-color-contrast-6)}:host(.wj-button-solid.wj-color-default){--wj-button-background-color: transparent;--wj-button-border-color: var(--wj-color-contrast-4);--wj-button-color: var(--wj-color-contrast-11)}:host(.wj-button-outline.wj-color-default){--wj-button-border-color: var(--wj-color-contrast-4);--wj-button-color: var(--wj-color-contrast-11)}:host{--wj-button-border-radius: 4px;--wj-button-border-width: 1px;--wj-button-border-style: solid;--wj-button-border-color: var(--wj-color-contrast-1);--wj-button-margin-inline: 0;--wj-padding-top: .4rem;--wj-padding-start: .5rem;--wj-padding-end: .5rem;--wj-padding-bottom: .4rem;display:inline-flex;position:relative;width:auto;cursor:pointer;margin-inline:var(--wj-button-margin-inline)}:host(.wj-button-group-button){display:block}.button-native{font-family:var(--wj-font-family);font-size:var(--wj-font-size);display:flex;position:relative;align-items:center;width:100%;height:100%;min-height:inherit;overflow:hidden;border-width:var(--wj-button-border-width);border-style:var(--wj-button-border-style);border-color:var(--wj-button-border-color);outline:none;background-color:var(--wj-button-background-color);color:var(--wj-button-color);line-height:1;contain:layout style;cursor:pointer;z-index:0;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;border-radius:var(--wj-button-border-radius);padding-top:var(--wj-padding-top);padding-bottom:var(--wj-padding-bottom);padding-inline:var(--wj-padding-start) var(--wj-padding-end)}@media (any-hover: hover){:host(.wj-button-solid.wj-color-primary:hover){--wj-button-background-color: var(--wj-color-primary-9);--wj-button-border-color: var(--wj-color-primary-10);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-primary:hover){--wj-button-background-color: var(--wj-color-primary-1);--wj-button-border-color: var(--wj-color-primary-11);--wj-button-color: var(--wj-color-primary-11)}:host(.wj-button-solid.wj-color-complete:hover){--wj-button-background-color: var(--wj-color-complete-9);--wj-button-border-color: var(--wj-color-complete-10);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-complete:hover){--wj-button-background-color: var(--wj-color-complete-1);--wj-button-border-color: var(--wj-color-complete-11);--wj-button-color: var(--wj-color-complete-11)}:host(.wj-button-solid.wj-color-success:hover){--wj-button-background-color: var(--wj-color-success-9);--wj-button-border-color: var(--wj-color-success-10);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-success:hover){--wj-button-background-color: var(--wj-color-success-1);--wj-button-border-color: var(--wj-color-success-11);--wj-button-color: var(--wj-color-success-11)}:host(.wj-button-solid.wj-color-warning:hover){--wj-button-background-color: var(--wj-color-warning-9);--wj-button-border-color: var(--wj-color-warning-10);--wj-button-color: var(--wj-color-black)}:host(.wj-button-outline.wj-color-warning:hover){--wj-button-background-color: var(--wj-color-warning-1);--wj-button-border-color: var(--wj-color-warning-11);--wj-button-color: var(--wj-color-warning-11)}:host(.wj-button-solid.wj-color-danger:hover){--wj-button-background-color: var(--wj-color-danger-9);--wj-button-border-color: var(--wj-color-danger-10);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-danger:hover){--wj-button-background-color: var(--wj-color-danger-1);--wj-button-border-color: var(--wj-color-danger-11);--wj-button-color: var(--wj-color-danger-11)}:host(.wj-button-solid.wj-color-neutral:hover){--wj-button-background-color: var(--wj-color-contrast-9);--wj-button-border-color: var(--wj-color-contrast-10);--wj-button-color: var(--wj-color-contrast-0)}:host(.wj-button-outline.wj-color-neutral:hover){--wj-button-background-color: var(--wj-color-contrast-1);--wj-button-border-color: var(--wj-color-contrast-11);--wj-button-color: var(--wj-color-contrast-11)}:host(.wj-button-solid.wj-color-default:hover){--wj-button-background-color: var(--wj-color-contrast-1);--wj-button-border-color: var(--wj-color-contrast-2);--wj-button-color: var(--wj-color-contrast-9)}:host(.wj-button-outline.wj-color-default:hover){--wj-button-background-color: var(--wj-color-contrast-1);--wj-button-border-color: var(--wj-color-contrast-2);--wj-button-color: var(--wj-color-contrast-9)}:host(.wj-button-link:hover){--wj-button-background-color: var(--wj-color-contrast-1) !important;--wj-button-border-color: transparent !important;color:var(--wj-color-contrast-9)!important}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.button-solid.wj-color){background-color:var(--wj-button-background-color);color:var(--wj-button-color)}:host(.wj-button-link){--wj-button-border-width: 1px;--wj-button-border-color: transparent;--wj-button-background-color: transparent !important}:host(.wj-button-disabled){cursor:default;opacity:.5;pointer-events:none}:host(.wj-button-round){--wj-button-border-radius: var(--wj-border-radius-pill)}:host(.wj-button-circle){--wj-button-border-radius: var(--wj-border-radius-circle);aspect-ratio:1/1}:host(.wj-button-large){--wj-padding-top: .6rem;--wj-padding-start: .7rem;--wj-padding-end: .7rem;--wj-padding-bottom: .6rem}:host(.wj-button-small){--wj-padding-top: .25rem;--wj-padding-start: .25rem;--wj-padding-end: .25rem;--wj-padding-bottom: .25rem}::slotted(wj-icon[slot=start]){margin:0 .3rem 0 -.3rem}::slotted(wj-icon[slot=end]){margin:0 -.2rem 0 .3rem}:host(:not([only-caret])) slot[name=caret]{padding:0 0 0 .3rem}:host([only-caret]) slot[name=caret]{padding:0;display:block}:host(.wj-button-group-first:not(.wj-button-group-last)) .button-native{border-start-end-radius:0;border-end-end-radius:0}:host(.wj-button-group-inner) .button-native{border-radius:0}:host(.wj-button-group-last:not(.wj-button-group-first)) .button-native{border-start-start-radius:0;border-end-start-radius:0}:host(.wj-button-group-button:not(.wj-button-group-first)){margin-inline-start:calc(-1 * var(--wj-button-border-width))!important}::slotted([slot=toggle]){display:none}::slotted([slot=toggle].show){display:block}
9
7
  `;
10
- class h extends w {
8
+ class p extends j {
11
9
  constructor() {
12
10
  super();
13
- u(this, "className", "Button");
14
- u(this, "eventDialogOpen", (t) => {
11
+ c(this, "className", "Button");
12
+ c(this, "eventDialogOpen", (o) => {
15
13
  document.dispatchEvent(
16
14
  new CustomEvent(
17
15
  this.dialog,
@@ -21,45 +19,44 @@ class h extends w {
21
19
  )
22
20
  );
23
21
  });
22
+ c(this, "toggleStates", () => {
23
+ this.slotToggle.assignedNodes().filter((l) => l.nodeType === Node.ELEMENT_NODE).forEach((l) => {
24
+ l.classList.contains("show") ? l.classList.remove("show") : l.classList.add("show");
25
+ });
26
+ });
24
27
  }
25
- set active(t) {
28
+ set active(o) {
26
29
  this.setAttribute("active", "");
27
30
  }
28
31
  get active() {
29
32
  return this.hasAttribute("active");
30
33
  }
31
- set disabled(t) {
34
+ set disabled(o) {
32
35
  this.setAttribute("disabled", "");
33
36
  }
34
37
  get disabled() {
35
38
  return this.hasAttribute("disabled");
36
39
  }
37
- set fill(t) {
38
- this.setAttribute("fill", t);
40
+ set fill(o) {
41
+ this.setAttribute("fill", o);
39
42
  }
40
43
  get fill() {
41
44
  return this.getAttribute("fill") || "solid";
42
45
  }
43
- set outline(t) {
46
+ set outline(o) {
44
47
  this.setAttribute("outline", "");
45
48
  }
46
49
  get outline() {
47
50
  return this.hasAttribute("outline");
48
51
  }
49
- set round(t) {
50
- this.setAttribute("round", "");
51
- }
52
- get round() {
53
- return this.hasAttribute("round");
54
- }
55
- set stopPropagation(t) {
56
- this.setAttribute("stop-propagation", b(t));
52
+ set stopPropagation(o) {
53
+ this.setAttribute("stop-propagation", u(o));
57
54
  }
58
55
  get stopPropagation() {
59
- return console.log("SP:", b(this.getAttribute("stop-propagation")), this.innerHTML, this.getAttribute("stop-propagation")), b(this.getAttribute("stop-propagation"));
56
+ return u(this.getAttribute("stop-propagation"));
60
57
  }
61
58
  static get cssStyleSheet() {
62
- return j;
59
+ return g;
63
60
  }
64
61
  static get observedAttributes() {
65
62
  return [];
@@ -67,33 +64,33 @@ class h extends w {
67
64
  setupAttributes() {
68
65
  this.isShadowRoot = "open";
69
66
  }
70
- draw(t, p, g) {
71
- let s = document.createDocumentFragment();
72
- if (this.disabled && this.classList.add("wj-button-disabled"), this.variant && this.classList.add("wj-button-" + this.variant), this.round && this.classList.add("wj-button-round"), this.outline && this.classList.add("wj-outline"), this.fill && this.classList.add("wj-button-" + this.fill), this.size && this.classList.add("wj-button-" + this.size), this.hasAttribute("color") ? this.classList.add("wj-color-" + this.color, "wj-color") : this.classList.add("wj-color-default", "wj-color"), this.hasAttribute("caret")) {
73
- let i = document.createElement("wj-icon");
74
- i.style.setProperty("--wj-icon-size", "14px"), i.setAttribute("slot", "caret"), i.setAttribute("name", "chevron-down"), this.appendChild(i);
67
+ draw(o, l, v) {
68
+ let w = document.createDocumentFragment();
69
+ if (this.disabled && this.classList.add("wj-button-disabled"), this.variant && this.classList.add("wj-button-" + this.variant), this.hasAttribute("round") && this.classList.add("wj-button-round"), this.hasAttribute("circle") && this.classList.add("wj-button-circle"), this.outline && this.classList.add("wj-outline"), this.fill && this.classList.add("wj-button-" + this.fill), this.size && this.classList.add("wj-button-" + this.size), this.hasAttribute("color") ? this.classList.add("wj-color-" + this.color, "wj-color") : this.classList.add("wj-color-default", "wj-color"), this.hasAttribute("caret") || this.hasAttribute("only-caret")) {
70
+ let a = document.createElement("wj-icon");
71
+ a.style.setProperty("--wj-icon-size", "14px"), a.setAttribute("slot", "caret"), a.setAttribute("name", "chevron-down"), this.appendChild(a);
75
72
  }
76
73
  if (this.active) {
77
74
  this.classList.add("wj-active");
78
- let i = document.createElement("wj-icon");
79
- i.setAttribute("name", "check"), this.appendChild(i);
75
+ let a = document.createElement("wj-icon");
76
+ a.setAttribute("name", "check"), this.appendChild(a);
80
77
  }
81
78
  this.disabled && this.classList.add("wj-disabled");
82
- let l = document.createElement(this.hasAttribute("href") ? "a" : "button");
83
- l.classList.add("button-native"), l.setAttribute("part", "native");
84
- let e = document.createElement("span");
85
- e.classList.add("button-inner");
79
+ let s = document.createElement(this.hasAttribute("href") ? "a" : "button");
80
+ s.classList.add("button-native"), s.setAttribute("part", "native");
81
+ let n = document.createElement("span");
82
+ n.classList.add("button-inner");
86
83
  let r = document.createElement("slot");
87
- return r.setAttribute("name", "icon-only"), e.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "start"), e.appendChild(r), r = document.createElement("slot"), e.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "end"), e.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "caret"), e.appendChild(r), l.appendChild(e), s.appendChild(l), s;
84
+ return r.setAttribute("name", "icon-only"), n.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "start"), n.appendChild(r), r = document.createElement("slot"), n.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "end"), n.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "caret"), n.appendChild(r), this.hasToggle = h.hasSlot(this, "toggle"), this.hasToggle && (this.slotToggle = document.createElement("slot"), this.slotToggle.setAttribute("name", "toggle"), n.appendChild(this.slotToggle)), s.appendChild(n), w.appendChild(s), w;
88
85
  }
89
86
  afterDraw() {
90
- console.log("Stop propagation: ", this.stopPropagation), a.addListener(this, "click", "wj:button-click", null, { stopPropagation: this.stopPropagation }), a.addListener(this, "click", null, this.eventDialogOpen);
87
+ this.hasToggle && (this.toggle === "off" ? this.slotToggle.assignedNodes()[1].classList.add("show") : this.slotToggle.assignedNodes()[0].classList.add("show")), i.addListener(this, "click", "wj:button-click", null, { stopPropagation: this.stopPropagation }), i.addListener(this, "click", null, this.eventDialogOpen), this.hasToggle && i.addListener(this, "click", "wj-button:toggle", this.toggleStates, { stopPropagation: this.stopPropagation });
91
88
  }
92
89
  beforeDisconnect() {
93
90
  this.removeEventListener("click", this.eventDialogOpen);
94
91
  }
95
92
  }
96
- customElements.get("wj-button") || window.customElements.define("wj-button", h);
93
+ customElements.get("wj-button") || window.customElements.define("wj-button", p);
97
94
  export {
98
- h as Button
95
+ p as Button
99
96
  };