wj-elements 0.0.2 → 0.0.4

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 (66) hide show
  1. package/dist/router-links-e0087f84.js +146 -0
  2. package/dist/style.css +2 -2365
  3. package/dist/wj-aside.js +18 -22
  4. package/dist/wj-avatar.js +32 -49
  5. package/dist/wj-badge.js +18 -22
  6. package/dist/wj-breadcrumb.js +53 -103
  7. package/dist/wj-breadcrumbs.js +21 -36
  8. package/dist/wj-button-group.js +24 -36
  9. package/dist/wj-button.js +37 -80
  10. package/dist/wj-card-content.js +16 -18
  11. package/dist/wj-card-controls.js +16 -18
  12. package/dist/wj-card-header.js +16 -20
  13. package/dist/wj-card-subtitle.js +17 -19
  14. package/dist/wj-card-title.js +16 -18
  15. package/dist/wj-card.js +16 -20
  16. package/dist/wj-checkbox.js +24 -46
  17. package/dist/wj-chip.js +21 -39
  18. package/dist/wj-col.js +18 -32
  19. package/dist/wj-color-picker.js +503 -868
  20. package/dist/wj-container.js +18 -20
  21. package/dist/wj-copy-button.js +66 -112
  22. package/dist/wj-dialog.js +43 -67
  23. package/dist/wj-divider.js +16 -20
  24. package/dist/wj-dropdown.js +22 -31
  25. package/dist/wj-element.js +241 -416
  26. package/dist/wj-footer.js +16 -18
  27. package/dist/wj-form.js +16 -18
  28. package/dist/wj-grid.js +17 -21
  29. package/dist/wj-header.js +18 -22
  30. package/dist/wj-icon-picker.js +66 -107
  31. package/dist/wj-icon.js +67 -140
  32. package/dist/wj-img-comparer.js +43 -72
  33. package/dist/wj-img.js +21 -31
  34. package/dist/wj-infinite-scroll.js +49 -84
  35. package/dist/wj-input.js +67 -146
  36. package/dist/wj-item.js +19 -34
  37. package/dist/wj-label.js +19 -21
  38. package/dist/wj-list.js +17 -20
  39. package/dist/wj-main.js +16 -18
  40. package/dist/wj-master.js +331 -462
  41. package/dist/wj-menu-button.js +18 -21
  42. package/dist/wj-menu-item.js +67 -144
  43. package/dist/wj-menu-label.js +17 -21
  44. package/dist/wj-menu.js +20 -24
  45. package/dist/wj-popup.js +714 -1140
  46. package/dist/wj-progress-bar.js +42 -100
  47. package/dist/wj-radio-group.js +27 -38
  48. package/dist/wj-radio.js +24 -46
  49. package/dist/wj-route.js +8 -11
  50. package/dist/wj-router-link.js +19 -22
  51. package/dist/wj-router-outlet.js +71 -135
  52. package/dist/wj-routerx.js +641 -1121
  53. package/dist/wj-row.js +20 -22
  54. package/dist/wj-slider.js +55 -97
  55. package/dist/wj-split-view.js +45 -81
  56. package/dist/wj-store.js +110 -195
  57. package/dist/wj-textarea.js +39 -86
  58. package/dist/wj-thumbnail.js +17 -19
  59. package/dist/wj-toast.js +34 -88
  60. package/dist/wj-toggle.js +24 -42
  61. package/dist/wj-toolbar-action.js +16 -27
  62. package/dist/wj-toolbar.js +21 -26
  63. package/dist/wj-tooltip.js +27 -41
  64. package/dist/wj-visually-hidden.js +16 -18
  65. package/package.json +1 -1
  66. package/dist/router-links-26e4a166.js +0 -204
package/dist/wj-aside.js CHANGED
@@ -1,19 +1,19 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement from "./wj-element.js";
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";
8
5
  import "./wj-store.js";
9
- const styles = '/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Aside ]\n*/\n:host {\n --wj-aside-width: "100px";\n --wj-aside-top: 0;\n --wj-aside-border-color: var(--wj-border-color);\n --wj-aside-border-width: 0 1px 0 0;\n --wj-aside-border-style: solid;\n box-sizing: border-box;\n flex-shrink: 0;\n overflow: auto;\n border-color: var(--wj-aside-border-color);\n border-width: var(--wj-aside-border-width);\n border-style: var(--wj-aside-border-style);\n}\n:host(.open) {\n display: block !important;\n}\n@media (min-width: 768px) {\n :host([fixed]) {\n position: fixed;\n width: var(--wj-aside-width);\n top: var(--wj-aside-top);\n height: calc(100% - var(--wj-aside-top));\n }\n}\n@media (max-width: 768px) {\n :host {\n display: none;\n }\n :host([variant=top-start]) {\n position: fixed;\n top: 0;\n left: 0;\n width: 80%;\n height: 100%;\n z-index: 9999;\n background-color: #fff;\n }\n}';
10
- class Aside extends WJElement {
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}}
9
+ `;
10
+ class w extends n {
11
11
  constructor() {
12
12
  super();
13
- __publicField(this, "className", "Aside");
13
+ o(this, "className", "Aside");
14
14
  }
15
15
  static get cssStyleSheet() {
16
- return styles;
16
+ return h;
17
17
  }
18
18
  static get observedAttributes() {
19
19
  return [];
@@ -21,18 +21,14 @@ class Aside extends WJElement {
21
21
  setupAttributes() {
22
22
  this.isShadowRoot = "open";
23
23
  }
24
- draw(context, store, params) {
25
- let fragment = document.createDocumentFragment();
26
- if (this.width)
27
- this.style.setProperty("--wj-aside-width", this.width);
28
- if (this.top && this.hasAttribute("fixed"))
29
- this.style.setProperty("--wj-aside-top", this.top);
30
- let element = document.createElement("slot");
31
- fragment.appendChild(element);
32
- return fragment;
24
+ draw(s, l, p) {
25
+ let i = document.createDocumentFragment();
26
+ this.width && this.style.setProperty("--wj-aside-width", this.width), this.top && this.hasAttribute("fixed") && this.style.setProperty("--wj-aside-top", this.top);
27
+ let r = document.createElement("slot");
28
+ return i.appendChild(r), i;
33
29
  }
34
30
  }
35
- customElements.get("wj-aside") || window.customElements.define("wj-aside", Aside);
31
+ customElements.get("wj-aside") || window.customElements.define("wj-aside", w);
36
32
  export {
37
- Aside
33
+ w as Aside
38
34
  };
package/dist/wj-avatar.js CHANGED
@@ -1,69 +1,52 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement from "./wj-element.js";
1
+ var d = Object.defineProperty;
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);
4
+ import v from "./wj-element.js";
8
5
  import "./wj-store.js";
9
- function getHsl(text, s = 30, l = 80) {
10
- let str = text, hash = 0;
11
- for (let i = 0; i < (str == null ? void 0 : str.length); i++) {
12
- hash = str.charCodeAt(i) + ((hash << 5) - hash);
13
- }
14
- let h = hash % 360;
15
- let hexColor = "hsl(" + h + ", " + s + "%, " + l + "%)";
16
- return hexColor;
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);
10
+ return "hsl(" + s % 360 + ", " + a + "%, " + t + "%)";
17
11
  }
18
- function getInitials(string, length = 2) {
19
- let names = string.split(" ");
20
- let initials = names[0].substring(0, 1).toUpperCase();
21
- if (names.length > 1 && length > 1) {
22
- initials += names[names.length - 1].substring(0, 1).toUpperCase();
23
- }
24
- return initials;
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;
25
15
  }
26
- const styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n:host {\n --wj-avatar-width: 32px;\n --wj-avatar-height: 32px;\n --wj-avatar-font-size: .75rem;\n --wj-avatar-font-weight: 400;\n --wj-avatar-color: inherit;\n --wj-avatar-background-color: rgba(33, 33, 33, 0.17);\n --wj-avatar-border-radius: 50%;\n --wj-avatar-border-color: transparent;\n --wj-avatar-border-width: 1px;\n --wj-avatar-border-style: solid;\n display: inline-block;\n width: var(--wj-avatar-width);\n height: var(--wj-avatar-height);\n font-size: var(--wj-avatar-font-size);\n font-weight: var(--wj-avatar-font-weight);\n color: var(--wj-avatar-color);\n}\n:host .native-avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n border-radius: var(--wj-avatar-border-radius);\n background-color: var(--wj-avatar-background-color);\n}\n::slotted(wj-img),\n::slotted(img) {\n border-radius: var(--wj-avatar-border-radius);\n width: 100%;\n height: 100%;\n object-fit: cover;\n overflow: hidden;\n}\n:host(.wj-avatar-border) {\n border-color: var(--wj-avatar-border-color);\n border-width: var(--wj-avatar-border-width);\n border-style: var(--wj-avatar-border-style);\n}\n:host(.wj-avatar-small) {\n --wj-avatar-width: 24px;\n --wj-avatar-height: 24px;\n}\n:host(.wj-avatar-large) {\n --wj-avatar-width: 48px;\n --wj-avatar-height: 48px;\n}";
27
- class Avatar extends WJElement {
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}
19
+ `;
20
+ class j extends v {
28
21
  constructor() {
29
22
  super();
30
- __publicField(this, "className", "Avatar");
23
+ l(this, "className", "Avatar");
31
24
  }
32
25
  static get cssStyleSheet() {
33
- return styles;
26
+ return g;
34
27
  }
35
28
  setupAttributes() {
36
29
  this.isShadowRoot = "open";
37
30
  }
38
- draw(context, store, params) {
39
- let fragment = document.createDocumentFragment();
40
- let element = document.createElement("div");
41
- element.setAttribute("part", "native");
42
- element.classList.add("native-avatar");
43
- if (this.size)
44
- this.classList.add("wj-avatar-" + this.size);
45
- if (this.isImage()) {
46
- let slot = document.createElement("slot");
47
- element.appendChild(slot);
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()) {
34
+ let e = document.createElement("slot");
35
+ o.appendChild(e);
36
+ } else if (this.hasAttribute("initials")) {
37
+ let e = c(this.label);
38
+ this.setAttribute("style", `--wj-avatar-background-color: ${w(e)}`), o.innerText = e;
48
39
  } else {
49
- if (this.hasAttribute("initials")) {
50
- let initials = getInitials(this.label);
51
- this.setAttribute("style", `--wj-avatar-background-color: ${getHsl(initials)}`);
52
- element.innerText = initials;
53
- } else {
54
- let slotIcon = document.createElement("slot");
55
- slotIcon.setAttribute("name", "icon");
56
- element.appendChild(slotIcon);
57
- }
40
+ let e = document.createElement("slot");
41
+ e.setAttribute("name", "icon"), o.appendChild(e);
58
42
  }
59
- fragment.appendChild(element);
60
- return fragment;
43
+ return n.appendChild(o), n;
61
44
  }
62
45
  isImage() {
63
46
  return this.getElementsByTagName("wj-img").length > 0;
64
47
  }
65
48
  }
66
- customElements.get("wj-avatar") || window.customElements.define("wj-avatar", Avatar);
49
+ customElements.get("wj-avatar") || window.customElements.define("wj-avatar", j);
67
50
  export {
68
- Avatar
51
+ j as Avatar
69
52
  };
package/dist/wj-badge.js CHANGED
@@ -1,35 +1,31 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement from "./wj-element.js";
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";
8
5
  import "./wj-store.js";
9
- const styles = '/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Badge ]\n*/\n:host(.wj-color-primary) {\n --wj-color-base: #7252D3 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-complete) {\n --wj-color-base: #0072EC !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-success) {\n --wj-color-base: #19AD79 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-warning) {\n --wj-color-base: #FFd945 !important;\n --wj-color-contrast: #4b4b4b !important;\n}\n:host(.wj-color-danger) {\n --wj-color-base: #D83C31 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-info) {\n --wj-color-base: #3B4752 !important;\n --wj-color-contrast: #fff !important;\n}\n:host(.wj-color-menu) {\n --wj-color-base: #f4f4f4 !important;\n --wj-color-contrast: #4b4b4b !important;\n}\n:host {\n --wj-chip-border-radius: 100px;\n text-shadow: none;\n font-family: "Inter UI", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n font-weight: 600;\n background-color: #e0e0e0;\n font-size: 11px;\n padding-left: 6px;\n padding-right: 6px;\n color: #4b4b4b;\n border-radius: 10px;\n}\n:host(.wj-color) {\n background-color: var(--wj-color-base, red);\n color: var(--wj-color-contrast);\n}';
10
- class Badge extends WJElement {
6
+ const i = `/*!
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)}
9
+ `;
10
+ class m extends l {
11
11
  constructor() {
12
12
  super();
13
- __publicField(this, "className", "Badge");
13
+ s(this, "className", "Badge");
14
14
  }
15
15
  static get cssStyleSheet() {
16
- return styles;
16
+ return i;
17
17
  }
18
18
  setupAttributes() {
19
19
  this.isShadowRoot = "open";
20
20
  }
21
- draw(context, store, params) {
22
- let fragment = document.createDocumentFragment();
23
- let element = document.createElement("slot");
24
- if (this.color)
25
- this.classList.add("wj-color-" + this.color, "wj-color");
26
- fragment.appendChild(element);
27
- return fragment;
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;
28
24
  }
29
25
  }
30
- let __esModule = "true";
31
- customElements.get("wj-badge") || window.customElements.define("wj-badge", Badge);
26
+ let b = "true";
27
+ customElements.get("wj-badge") || window.customElements.define("wj-badge", m);
32
28
  export {
33
- Badge,
34
- __esModule
29
+ m as Badge,
30
+ b as __esModule
35
31
  };
@@ -1,142 +1,92 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement, { WjElementUtils, event } from "./wj-element.js";
1
+ var h = Object.defineProperty;
2
+ var b = (o, a, e) => a in o ? h(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
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";
8
5
  import "./wj-store.js";
9
- const styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Breadcrumbs ]\n*/\n:host {\n --wj-breadcrumb-a: rgba(33, 33, 33, 0.81);\n --wj-breadcrumb-a-hover: rgba(33, 33, 33, 0.62);\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n line-height: 1.5;\n}\n:host(.collapsed) {\n display: none;\n}\n.native-breadcrumb {\n display: flex;\n align-items: center;\n width: 100%;\n outline: none;\n background: inherit;\n padding: 0.25rem 0.75rem;\n color: var(--wj-breadcrumb-a);\n text-decoration: none;\n}\n.native-breadcrumb.hidden {\n display: none;\n}\n.native-breadcrumb.active {\n font-weight: bold;\n}\n.native-breadcrumb:hover {\n color: var(--wj-breadcrumb-a-hover);\n}\nbutton {\n margin-inline: 0.75rem;\n border: 0 solid transparent;\n border-radius: 3px;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.separator {\n display: inline-flex;\n align-items: center;\n}\n::slotted([slot=start]) {\n margin-inline: 0 0.5rem;\n}\n::slotted([slot=end]) {\n margin-inline: 0.5rem 0;\n}";
10
- class Breadcrumb extends WJElement {
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}
9
+ `;
10
+ class v extends w {
11
11
  constructor() {
12
- var _a;
12
+ var e;
13
13
  super();
14
- __publicField(this, "className", "Breadcrumb");
15
- this._showSeparator = true;
16
- this._collapsedVariant = ((_a = this.parentElement) == null ? void 0 : _a.collapsedVariant) || "BUTTON";
14
+ p(this, "className", "Breadcrumb");
15
+ this._showSeparator = !0, this._collapsedVariant = ((e = this.parentElement) == null ? void 0 : e.collapsedVariant) || "BUTTON";
17
16
  }
18
17
  get showSeparator() {
19
18
  return this._showSeparator;
20
19
  }
21
- set showSeparator(value) {
22
- this._showSeparator = value;
20
+ set showSeparator(e) {
21
+ this._showSeparator = e;
23
22
  }
24
23
  get collapsedVariant() {
25
24
  return this._collapsedVariant.toUpperCase();
26
25
  }
27
- set collapsedVariant(value) {
28
- this._collapsedVariant = value || this.parentElement.collapsedVariant;
26
+ set collapsedVariant(e) {
27
+ this._collapsedVariant = e || this.parentElement.collapsedVariant;
29
28
  }
30
29
  static get cssStyleSheet() {
31
- return styles;
30
+ return j;
32
31
  }
33
32
  static get observedAttributes() {
34
33
  return ["show-collapsed-indicator", "collapsed", "last"];
35
34
  }
36
- attributeChangedCallback(name, oldValue, newValue) {
37
- if (name === "collapsed") {
38
- if (WjElementUtils.stringToBoolean(newValue))
39
- this.classList.add("collapsed");
40
- } else if (name === "show-collapsed-indicator") {
41
- if (WjElementUtils.stringToBoolean(newValue))
42
- this.showCollapsedIndicator = true;
43
- } else if (name === "last") {
44
- this.active = WjElementUtils.stringToBoolean(newValue);
45
- this.showSeparator = !WjElementUtils.stringToBoolean(newValue);
46
- }
47
- return false;
35
+ attributeChangedCallback(e, r, t) {
36
+ return e === "collapsed" ? l.stringToBoolean(t) && this.classList.add("collapsed") : e === "show-collapsed-indicator" ? l.stringToBoolean(t) && (this.showCollapsedIndicator = !0) : e === "last" && (this.active = l.stringToBoolean(t), this.showSeparator = !l.stringToBoolean(t)), !1;
48
37
  }
49
38
  setupAttributes() {
50
39
  this.isShadowRoot = "open";
51
40
  }
52
- draw(context, store, params) {
53
- let fragment = document.createDocumentFragment();
54
- let native = document.createElement("a");
55
- native.classList.add("native-breadcrumb");
56
- if (this.active)
57
- native.classList.add("active");
58
- let slot = document.createElement("slot");
59
- let start = document.createElement("slot");
60
- start.setAttribute("name", "start");
61
- let end = document.createElement("slot");
62
- end.setAttribute("name", "end");
63
- native.appendChild(start);
64
- native.appendChild(slot);
65
- native.appendChild(end);
66
- fragment.appendChild(native);
67
- if (this.showCollapsedIndicator) {
68
- fragment.appendChild(this.drawCollapsedIndicator());
69
- this.classList.remove("collapsed");
70
- native.classList.add("hidden");
41
+ draw(e, r, t) {
42
+ let s = document.createDocumentFragment(), n = document.createElement("a");
43
+ n.classList.add("native-breadcrumb"), this.active && n.classList.add("active");
44
+ let u = document.createElement("slot"), d = document.createElement("slot");
45
+ d.setAttribute("name", "start");
46
+ let c = document.createElement("slot");
47
+ if (c.setAttribute("name", "end"), n.appendChild(d), n.appendChild(u), n.appendChild(c), s.appendChild(n), this.showCollapsedIndicator && (s.appendChild(this.drawCollapsedIndicator()), this.classList.remove("collapsed"), n.classList.add("hidden")), this.showSeparator) {
48
+ let i = document.createElement("span");
49
+ if (i.classList.add("separator"), i.setAttribute("part", "separator"), l.hasSlot(this, "separator")) {
50
+ let m = document.createElement("slot");
51
+ m.setAttribute("name", "separator"), i.appendChild(m);
52
+ } else
53
+ i.innerHTML = `<wj-icon name=${this.separator || "chevron-right"}></wj-icon>`;
54
+ s.appendChild(i);
71
55
  }
72
- if (this.showSeparator) {
73
- let separator = document.createElement("span");
74
- separator.classList.add("separator");
75
- separator.setAttribute("part", "separator");
76
- if (WjElementUtils.hasSlot(this, "separator")) {
77
- let slotSeparator = document.createElement("slot");
78
- slotSeparator.setAttribute("name", "separator");
79
- separator.appendChild(slotSeparator);
80
- } else {
81
- separator.innerHTML = `<wj-icon name=${this.separator || "chevron-right"}></wj-icon>`;
82
- }
83
- fragment.appendChild(separator);
84
- }
85
- this.native = native;
86
- return fragment;
56
+ return this.native = n, s;
87
57
  }
88
58
  drawCollapsedIndicator() {
89
- let collapsedIndicator = null;
90
- if (this.collapsedVariant === "DROPDOWN") {
91
- collapsedIndicator = this.collapseDropdown();
92
- } else {
93
- collapsedIndicator = this.collapseButton();
94
- }
95
- return collapsedIndicator;
59
+ let e = null;
60
+ return this.collapsedVariant === "DROPDOWN" ? e = this.collapseDropdown() : e = this.collapseButton(), e;
96
61
  }
97
62
  collapseDropdown() {
98
63
  console.log("DROPDOWN");
99
- let dropdown = document.createElement("wj-dropdown");
100
- dropdown.setAttribute("placement", "bottom");
101
- dropdown.setAttribute("offset", "10");
102
- let button = document.createElement("wj-button");
103
- button.setAttribute("slot", "trigger");
104
- button.setAttribute("variant", "link");
105
- button.innerHTML = `<wj-icon name="dots"></wj-icon>`;
106
- let menu = document.createElement("wj-menu");
107
- menu.setAttribute("variant", "context");
108
- dropdown.appendChild(button);
109
- dropdown.appendChild(menu);
110
- dropdown.innerHTML = `<wj-button slot="trigger" variant="link">
64
+ let e = document.createElement("wj-dropdown");
65
+ e.setAttribute("placement", "bottom"), e.setAttribute("offset", "10");
66
+ let r = document.createElement("wj-button");
67
+ r.setAttribute("slot", "trigger"), r.setAttribute("variant", "link"), r.innerHTML = '<wj-icon name="dots"></wj-icon>';
68
+ 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">
111
70
  <wj-icon name="dots"></wj-icon>
112
71
  </wj-button>
113
72
  <wj-menu variant="context">
114
73
  <wj-menu-item>Tralala</wj-menu-item>
115
74
  <wj-menu-item>Test 1</wj-menu-item>
116
75
  <wj-menu-item>Test 2</wj-menu-item>
117
- </wj-menu>`;
118
- this.parentElement.querySelectorAll("wj-breadcrumb").forEach((el) => {
119
- console.log(el);
120
- });
121
- return dropdown;
76
+ </wj-menu>`, this.parentElement.querySelectorAll("wj-breadcrumb").forEach((s) => {
77
+ console.log(s);
78
+ }), e;
122
79
  }
123
80
  collapseButton() {
124
- let button = document.createElement("button");
125
- button.setAttribute("aria-label", "Show more breadcrumbs");
126
- button.setAttribute("part", "collapsed-indicator");
127
- button.innerHTML = `<wj-icon name="dots"></wj-icon>`;
128
- event.addListener(button, "click", null, (e) => {
129
- this.native.classList.remove("hidden");
130
- button.remove();
131
- this.parentElement.querySelectorAll("wj-breadcrumb").forEach((e2) => {
132
- e2.classList.remove("collapsed");
133
- });
134
- e.stopPropagation();
135
- });
136
- return button;
81
+ 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) => {
83
+ this.native.classList.remove("hidden"), e.remove(), this.parentElement.querySelectorAll("wj-breadcrumb").forEach((t) => {
84
+ t.classList.remove("collapsed");
85
+ }), r.stopPropagation();
86
+ }), e;
137
87
  }
138
88
  }
139
- customElements.get("wj-breadcrumb") || window.customElements.define("wj-breadcrumb", Breadcrumb);
89
+ customElements.get("wj-breadcrumb") || window.customElements.define("wj-breadcrumb", v);
140
90
  export {
141
- Breadcrumb
91
+ v as Breadcrumb
142
92
  };
@@ -1,54 +1,39 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement from "./wj-element.js";
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);
4
+ import d from "./wj-element.js";
8
5
  import "./wj-store.js";
9
- const styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Breadcrumbs ]\n*/\n:host {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}";
10
- class Breadcrumbs extends WJElement {
6
+ const p = `/*!
7
+ * direction.scss
8
+ */:host{display:flex;flex-wrap:wrap;align-items:center}
9
+ `;
10
+ class b extends d {
11
11
  constructor() {
12
12
  super();
13
- __publicField(this, "className", "Breadcrumbs");
14
- this.last = false;
13
+ i(this, "className", "Breadcrumbs");
14
+ this.last = !1;
15
15
  }
16
16
  static get cssStyleSheet() {
17
- return styles;
17
+ return p;
18
18
  }
19
19
  setupAttributes() {
20
20
  this.isShadowRoot = "open";
21
21
  }
22
- draw(context, store, params) {
23
- let fragment = document.createDocumentFragment();
24
- let element = document.createElement("slot");
25
- fragment.appendChild(element);
26
- return fragment;
22
+ draw(e, l, o) {
23
+ let s = document.createDocumentFragment(), c = document.createElement("slot");
24
+ return s.appendChild(c), s;
27
25
  }
28
26
  afterDraw() {
29
- let maxItems = +this.maxItems || 0;
30
- let itemsBeforeCollapse = +this.itemsBeforeCollapse || 1;
31
- let itemsAfterCollapse = +this.itemsAfterCollapse || 1;
32
- let breadcrumbs = this.getBreadcrumbs();
33
- let breadcrumb = breadcrumbs.findLast((e) => e);
34
- breadcrumb.setAttribute("last", true);
35
- const shouldCollapse = maxItems !== void 0 && breadcrumbs.length > maxItems && itemsBeforeCollapse + itemsAfterCollapse <= maxItems;
36
- if (shouldCollapse) {
37
- breadcrumbs.forEach((breadcrumb2, index) => {
38
- if (index === itemsBeforeCollapse) {
39
- breadcrumb2.setAttribute("show-collapsed-indicator", true);
40
- }
41
- if (index >= itemsBeforeCollapse && index < breadcrumbs.length - itemsAfterCollapse) {
42
- breadcrumb2.setAttribute("collapsed", true);
43
- }
44
- });
45
- }
27
+ let e = +this.maxItems || 0, l = +this.itemsBeforeCollapse || 1, o = +this.itemsAfterCollapse || 1, s = this.getBreadcrumbs();
28
+ s.findLast((a) => a).setAttribute("last", !0), e !== void 0 && s.length > e && l + o <= e && s.forEach((a, m) => {
29
+ m === l && a.setAttribute("show-collapsed-indicator", !0), m >= l && m < s.length - o && a.setAttribute("collapsed", !0);
30
+ });
46
31
  }
47
32
  getBreadcrumbs() {
48
33
  return Array.from(this.querySelectorAll("wj-breadcrumb"));
49
34
  }
50
35
  }
51
- customElements.get("wj-breadcrumbs") || window.customElements.define("wj-breadcrumbs", Breadcrumbs);
36
+ customElements.get("wj-breadcrumbs") || window.customElements.define("wj-breadcrumbs", b);
52
37
  export {
53
- Breadcrumbs
38
+ b as Breadcrumbs
54
39
  };
@@ -1,19 +1,19 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import WJElement from "./wj-element.js";
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";
8
5
  import "./wj-store.js";
9
- const styles = "/*!\n* direction.scss\n*/\n/* Skeleton Variables */\n/*\n[ Button Group ]\n*/\n:host {\n display: inline-block;\n}\n:host .native-button-group {\n display: flex;\n flex-wrap: nowrap;\n line-height: 1;\n}\n:host slot {\n display: contents;\n}\n::slotted(wj-button) {\n margin: 0;\n}";
10
- class ButtonGroup extends WJElement {
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}
9
+ `;
10
+ class g extends p {
11
11
  constructor() {
12
12
  super();
13
- __publicField(this, "className", "ButtonGroup");
13
+ u(this, "className", "ButtonGroup");
14
14
  }
15
15
  static get cssStyleSheet() {
16
- return styles;
16
+ return m;
17
17
  }
18
18
  static get observedAttributes() {
19
19
  return [];
@@ -21,35 +21,23 @@ class ButtonGroup extends WJElement {
21
21
  setupAttributes() {
22
22
  this.isShadowRoot = "open";
23
23
  }
24
- draw(context, store, params) {
25
- let fragment = document.createDocumentFragment();
26
- let element = document.createElement("div");
27
- element.classList.add("native-button-group");
28
- element.setAttribute("part", "native");
29
- this.slotElement = document.createElement("slot");
30
- element.appendChild(this.slotElement);
31
- fragment.appendChild(element);
32
- return fragment;
24
+ 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;
33
27
  }
34
- afterDraw(context, store, params) {
35
- const slottedElements = [...this.slotElement.assignedElements({ flatten: true })];
36
- slottedElements.forEach((el) => {
37
- let index = slottedElements.indexOf(el);
38
- let button = this.findButton(el);
39
- if (button) {
40
- button.classList.add("wj-button-group-button");
41
- button.classList.toggle("wj-button-group-first", index === 0);
42
- button.classList.toggle("wj-button-group-inner", index > 0 && index < slottedElements.length - 1);
43
- button.classList.toggle("wj-button-group-last", index === slottedElements.length - 1);
44
- }
28
+ afterDraw(t, l, a) {
29
+ 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));
45
33
  });
46
34
  }
47
- findButton(el) {
48
- const selector = "wj-button";
49
- return el.closest(selector) ?? el.querySelector(selector);
35
+ findButton(t) {
36
+ const l = "wj-button";
37
+ return t.closest(l) ?? t.querySelector(l);
50
38
  }
51
39
  }
52
- customElements.get("wj-button-group") || window.customElements.define("wj-button-group", ButtonGroup);
40
+ customElements.get("wj-button-group") || window.customElements.define("wj-button-group", g);
53
41
  export {
54
- ButtonGroup
42
+ g as ButtonGroup
55
43
  };