wj-elements 0.0.29 → 0.0.31

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 (80) hide show
  1. package/README.md +19 -7
  2. package/dist/wj-animation.js +2 -2
  3. package/dist/wj-aside.js +2 -2
  4. package/dist/wj-avatar.js +2 -2
  5. package/dist/wj-badge.js +2 -4
  6. package/dist/wj-breadcrumb.js +2 -1
  7. package/dist/wj-breadcrumbs.js +2 -2
  8. package/dist/wj-button-group.js +2 -2
  9. package/dist/wj-button.js +6 -2
  10. package/dist/wj-card-content.js +2 -2
  11. package/dist/wj-card-controls.js +2 -2
  12. package/dist/wj-card-header.js +2 -2
  13. package/dist/wj-card-subtitle.js +2 -2
  14. package/dist/wj-card-title.js +2 -2
  15. package/dist/wj-card.js +2 -2
  16. package/dist/wj-carousel-item.js +2 -2
  17. package/dist/wj-carousel.js +20 -19
  18. package/dist/wj-checkbox.js +2 -1
  19. package/dist/wj-chip.js +2 -2
  20. package/dist/wj-col.js +2 -2
  21. package/dist/wj-color-picker.js +2 -2
  22. package/dist/wj-container.js +2 -2
  23. package/dist/wj-copy-button.js +3 -3
  24. package/dist/wj-dialog.js +2 -3
  25. package/dist/wj-divider.js +2 -2
  26. package/dist/wj-dropdown.js +2 -2
  27. package/dist/wj-element.js +23 -12
  28. package/dist/wj-file-upload-item.js +2 -2
  29. package/dist/wj-file-upload.js +2 -2
  30. package/dist/wj-footer.js +2 -2
  31. package/dist/wj-form.js +2 -2
  32. package/dist/wj-format-digital.js +2 -2
  33. package/dist/wj-grid.js +2 -2
  34. package/dist/wj-header.js +2 -2
  35. package/dist/wj-icon-picker.js +3 -4
  36. package/dist/wj-icon.js +3 -3
  37. package/dist/wj-img-comparer.js +2 -2
  38. package/dist/wj-img.js +3 -3
  39. package/dist/wj-infinite-scroll.js +2 -2
  40. package/dist/wj-input-file.js +2 -2
  41. package/dist/wj-input.js +2 -2
  42. package/dist/wj-item.js +2 -2
  43. package/dist/wj-label.js +2 -2
  44. package/dist/wj-list.js +2 -2
  45. package/dist/wj-main.js +2 -2
  46. package/dist/wj-masonry.js +2 -2
  47. package/dist/wj-master.js +146 -150
  48. package/dist/wj-menu-button.js +2 -2
  49. package/dist/wj-menu-item.js +2 -2
  50. package/dist/wj-menu-label.js +2 -2
  51. package/dist/wj-menu.js +2 -2
  52. package/dist/wj-option.js +2 -2
  53. package/dist/wj-options.js +2 -2
  54. package/dist/wj-popup.js +2 -2
  55. package/dist/wj-progress-bar.js +2 -2
  56. package/dist/wj-radio-group.js +3 -3
  57. package/dist/wj-radio.js +2 -2
  58. package/dist/wj-rate.js +2 -2
  59. package/dist/wj-relative-time.js +2 -2
  60. package/dist/wj-route.js +2 -2
  61. package/dist/wj-router-link.js +2 -2
  62. package/dist/wj-routerx.js +2 -2
  63. package/dist/wj-row.js +2 -2
  64. package/dist/wj-select.js +2 -2
  65. package/dist/wj-slider.js +2 -2
  66. package/dist/wj-split-view.js +2 -2
  67. package/dist/wj-tab-group.js +2 -2
  68. package/dist/wj-tab-panel.js +2 -2
  69. package/dist/wj-tab.js +2 -2
  70. package/dist/wj-textarea.js +2 -2
  71. package/dist/wj-thumbnail.js +2 -2
  72. package/dist/wj-toast.js +2 -2
  73. package/dist/wj-toggle.js +2 -2
  74. package/dist/wj-toolbar-action.js +2 -2
  75. package/dist/wj-toolbar.js +2 -2
  76. package/dist/wj-tooltip.js +2 -2
  77. package/dist/wj-visually-hidden.js +2 -2
  78. package/package.json +20 -3
  79. package/dist/wj-nav-menu.js +0 -37
  80. package/dist/wj-nav.js +0 -61
package/README.md CHANGED
@@ -1,21 +1,27 @@
1
1
  # WJ Elements
2
- WebJET Elementy modernou sadou nástrojov používateľského rozhrania využívajúca silu web komponentov, ktorá je určená na zjednodušenie vývoja webových aplikácií. Poskytuje kolekciu zapúzdrených a opakovane použiteľných elementov, ktoré môžu výrazne zvýšiť efektivitu a udržiavateľnosť projektov vývoja webových stránok. Ponúkajú jednoduchú integráciu s React a Vue.
2
+ WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development. It provides a collection of encapsulated and reusable elements that can greatly increase the efficiency and maintainability of web development projects. They offer easy integration with React and Vue.
3
3
 
4
- Zahrňte WebJET Elements do svojho projektu pomocou [CDN](#inštalácia-s-cdn) alebo ho nainštalujte pomocou [npm](#inštalácia-s-npm).
4
+ Include WebJET Elements in your project using [CDN](#inštalácia-s-cdn) or install it using [npm](#inštalácia-s-npm).
5
+
6
+ Documentation: [elements.webjet](https://elements.webjet.sk/)
7
+
8
+ Source: [https://github.com/lencys/wj-elements](https://github.com/lencys/wj-elements)
9
+
10
+ Discord: [WJElements](https://discord.com/invite/b5DqKM997s)
5
11
 
6
12
  ## Inštalácia s npm
7
13
 
8
- Pomocou správcu balíkov npm môžete do takmer každého projektu vložiť zdrojové súbory aplikácie Elements.
14
+ Using the npm package manager, you can insert Elements source files into almost any project.
9
15
 
10
- Pred pokračovaním sa uistite, že máte v počítači nainštalovaný Node.js. Ak chcete nastaviť prostredie pre Elements, pozrite si [tieto pokyny](environment.md).
16
+ Make sure you have Node.js installed on your computer before proceeding. To set up the environment for Elements, see these instructions.
11
17
 
12
- Nainštalujte WebJet Elements pomocou npm:
18
+ Install WebJet Elements using npm:
13
19
 
14
20
  ```shell
15
21
  $ npm install wj-elements
16
22
  ```
17
23
 
18
- Ak existovala predchádzajúca inštalácia rozhrania Ionic CLI, bude potrebné ju odinštalovať z dôvodu zmeny názvu balíka.
24
+ If there was a previous installation of the Ionic CLI, it will need to be uninstalled due to a package name change.
19
25
 
20
26
  ```shell
21
27
  $ npm uninstall wj-elements
@@ -23,10 +29,16 @@ $ npm uninstall wj-elements
23
29
 
24
30
  ## Inštalácia s CDN
25
31
 
26
- Použite CDN a zahrňte do svojho projektu skompilované CSS a JS súbory WebJET Elements.
32
+ Use CDN and include compiled CSS and JS files of WebJET Elements in your project.
27
33
 
28
34
  ```html
29
35
  <script type="module" src="https://cdn.jsdelivr.net/gh/lencys/wj-elements@dddb1c19734498c5b2a17f2e6ed605d0cd40d02e/wj-master.js"></script>
30
36
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lencys/wj-elements@e5cdd8566b4acaad5c11040bfbb4e09e170074c9/style.css" />
31
37
  ```
32
38
 
39
+ ### Basic usage
40
+
41
+ ```html
42
+ <wj-button>Button</wj-button>
43
+ ```
44
+
@@ -70,7 +70,7 @@ class Animation extends WJElement {
70
70
  return await fetchAndParseCSS(cssUrl);
71
71
  }
72
72
  }
73
- customElements.get("wj-animation") || window.customElements.define("wj-animation", Animation);
73
+ WJElement.define("wj-animation", Animation);
74
74
  export {
75
- Animation
75
+ Animation as default
76
76
  };
package/dist/wj-aside.js CHANGED
@@ -31,7 +31,7 @@ class Aside extends WJElement {
31
31
  return fragment;
32
32
  }
33
33
  }
34
- customElements.get("wj-aside") || window.customElements.define("wj-aside", Aside);
34
+ WJElement.define("wj-aside", Aside);
35
35
  export {
36
- Aside
36
+ Aside as default
37
37
  };
package/dist/wj-avatar.js CHANGED
@@ -62,7 +62,7 @@ class Avatar extends WJElement {
62
62
  return this.getElementsByTagName("wj-img").length > 0;
63
63
  }
64
64
  }
65
- customElements.get("wj-avatar") || window.customElements.define("wj-avatar", Avatar);
65
+ WJElement.define("wj-avatar", Avatar);
66
66
  export {
67
- Avatar
67
+ Avatar as default
68
68
  };
package/dist/wj-badge.js CHANGED
@@ -26,9 +26,7 @@ class Badge extends WJElement {
26
26
  return fragment;
27
27
  }
28
28
  }
29
- let __esModule = "true";
30
- customElements.get("wj-badge") || window.customElements.define("wj-badge", Badge);
29
+ WJElement.define("wj-badge", Badge);
31
30
  export {
32
- Badge,
33
- __esModule
31
+ Badge as default
34
32
  };
@@ -138,6 +138,7 @@ class Breadcrumb extends WJElement {
138
138
  }
139
139
  }
140
140
  customElements.get("wj-breadcrumb") || window.customElements.define("wj-breadcrumb", Breadcrumb);
141
+ WJElement.define("wj-breadcrumb", Breadcrumb);
141
142
  export {
142
- Breadcrumb
143
+ Breadcrumb as default
143
144
  };
@@ -49,7 +49,7 @@ class Breadcrumbs extends WJElement {
49
49
  return Array.from(this.querySelectorAll("wj-breadcrumb")) || [];
50
50
  }
51
51
  }
52
- customElements.get("wj-breadcrumbs") || window.customElements.define("wj-breadcrumbs", Breadcrumbs);
52
+ WJElement.define("wj-breadcrumbs", Breadcrumbs);
53
53
  export {
54
- Breadcrumbs
54
+ Breadcrumbs as default
55
55
  };
@@ -48,7 +48,7 @@ class ButtonGroup extends WJElement {
48
48
  return el.closest(selector) ?? el.querySelector(selector);
49
49
  }
50
50
  }
51
- customElements.get("wj-button-group") || window.customElements.define("wj-button-group", ButtonGroup);
51
+ WJElement.define("wj-button-group", ButtonGroup);
52
52
  export {
53
- ButtonGroup
53
+ ButtonGroup as default
54
54
  };
package/dist/wj-button.js CHANGED
@@ -5,6 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement, { WjElementUtils, event } from "./wj-element.js";
8
+ import IconElement from "./wj-icon.js";
8
9
  const bool = (v) => {
9
10
  return v === "false" || v === "null" || v === "NaN" || v === "undefined" || v === "0" ? false : !!v;
10
11
  };
@@ -12,6 +13,9 @@ const styles = "/*\n[ WJ Button ]\n*/\n:host(.wj-button-solid.wj-color-primary)
12
13
  class Button extends WJElement {
13
14
  constructor() {
14
15
  super();
16
+ __publicField(this, "depandencies", {
17
+ "wj-icon": IconElement
18
+ });
15
19
  __publicField(this, "className", "Button");
16
20
  __publicField(this, "eventDialogOpen", (e) => {
17
21
  document.dispatchEvent(
@@ -154,7 +158,7 @@ class Button extends WJElement {
154
158
  this.removeEventListener("click", this.eventDialogOpen);
155
159
  }
156
160
  }
157
- customElements.get("wj-button") || window.customElements.define("wj-button", Button);
161
+ WJElement.define("wj-button", Button);
158
162
  export {
159
- Button
163
+ Button as default
160
164
  };
@@ -24,7 +24,7 @@ class CardContent extends WJElement {
24
24
  return fragment;
25
25
  }
26
26
  }
27
- customElements.get("wj-card-content") || window.customElements.define("wj-card-content", CardContent);
27
+ WJElement.define("wj-card-content", CardContent);
28
28
  export {
29
- CardContent
29
+ CardContent as default
30
30
  };
@@ -24,7 +24,7 @@ class CardControls extends WJElement {
24
24
  return fragment;
25
25
  }
26
26
  }
27
- customElements.get("wj-card-controls") || window.customElements.define("wj-card-controls", CardControls);
27
+ WJElement.define("wj-card-controls", CardControls);
28
28
  export {
29
- CardControls
29
+ CardControls as default
30
30
  };
@@ -26,7 +26,7 @@ class CardHeader extends WJElement {
26
26
  return fragment;
27
27
  }
28
28
  }
29
- customElements.get("wj-card-header") || window.customElements.define("wj-card-header", CardHeader);
29
+ WJElement.define("wj-card-header", CardHeader);
30
30
  export {
31
- CardHeader
31
+ CardHeader as default
32
32
  };
@@ -29,7 +29,7 @@ class CardSubtitle extends WJElement {
29
29
  return fragment;
30
30
  }
31
31
  }
32
- customElements.get("wj-card-subtitle") || window.customElements.define("wj-card-subtitle", CardSubtitle);
32
+ WJElement.define("wj-card-subtitle", CardSubtitle);
33
33
  export {
34
- CardSubtitle
34
+ CardSubtitle as default
35
35
  };
@@ -27,7 +27,7 @@ class CardTitle extends WJElement {
27
27
  return fragment;
28
28
  }
29
29
  }
30
- customElements.get("wj-card-title") || window.customElements.define("wj-card-title", CardTitle);
30
+ WJElement.define("wj-card-title", CardTitle);
31
31
  export {
32
- CardTitle
32
+ CardTitle as default
33
33
  };
package/dist/wj-card.js CHANGED
@@ -26,7 +26,7 @@ class Card extends WJElement {
26
26
  return fragment;
27
27
  }
28
28
  }
29
- customElements.get("wj-card") || window.customElements.define("wj-card", Card);
29
+ WJElement.define("wj-card", Card);
30
30
  export {
31
- Card
31
+ Card as default
32
32
  };
@@ -31,7 +31,7 @@ class CarouselItem extends WJElement {
31
31
  return fragment;
32
32
  }
33
33
  }
34
- customElements.get("wj-carousel-item") || window.customElements.define("wj-carousel-item", CarouselItem);
34
+ WJElement.define("wj-carousel-item", CarouselItem);
35
35
  export {
36
- CarouselItem
36
+ CarouselItem as default
37
37
  };
@@ -10,7 +10,6 @@ class Carousel extends WJElement {
10
10
  constructor() {
11
11
  super();
12
12
  __publicField(this, "className", "Carousel");
13
- this.activeSlide = 0;
14
13
  this.slidePerPage = 1;
15
14
  }
16
15
  set activeSlide(value) {
@@ -48,6 +47,9 @@ class Carousel extends WJElement {
48
47
  setupAttributes() {
49
48
  this.isShadowRoot = "open";
50
49
  }
50
+ beforeDraw(context, store, params) {
51
+ this.cloneFirstAndLastItems();
52
+ }
51
53
  draw(context, store, params) {
52
54
  let fragment = document.createDocumentFragment();
53
55
  let native = document.createElement("div");
@@ -67,24 +69,8 @@ class Carousel extends WJElement {
67
69
  native.appendChild(this.createThumbnails());
68
70
  fragment.appendChild(native);
69
71
  this.slides = slides;
70
- this.cloneFirstAndLastItems();
71
72
  return fragment;
72
73
  }
73
- setIntersectionObserver() {
74
- this.intersectionObserver = new IntersectionObserver((entries) => {
75
- entries.forEach((entry) => {
76
- this.entriesMap.set(entry.target, entry);
77
- });
78
- }, {
79
- root: this.context.querySelector(".carousel-slides"),
80
- threshold: 0.5
81
- });
82
- this.entriesMap = /* @__PURE__ */ new Map();
83
- this.records = this.intersectionObserver.takeRecords();
84
- this.records.forEach((entry) => {
85
- this.entriesMap.set(entry.target, entry);
86
- });
87
- }
88
74
  afterDraw() {
89
75
  this.setIntersectionObserver();
90
76
  this.getSlidesWithClones().forEach((slide, i) => {
@@ -108,6 +94,21 @@ class Carousel extends WJElement {
108
94
  }
109
95
  });
110
96
  }
97
+ setIntersectionObserver() {
98
+ this.intersectionObserver = new IntersectionObserver((entries) => {
99
+ entries.forEach((entry) => {
100
+ this.entriesMap.set(entry.target, entry);
101
+ });
102
+ }, {
103
+ root: this.context.querySelector(".carousel-slides"),
104
+ threshold: 0.5
105
+ });
106
+ this.entriesMap = /* @__PURE__ */ new Map();
107
+ this.records = this.intersectionObserver.takeRecords();
108
+ this.records.forEach((entry) => {
109
+ this.entriesMap.set(entry.target, entry);
110
+ });
111
+ }
111
112
  goToSlide(index, behavior = "smooth", next = true) {
112
113
  const slides = this.getSlides();
113
114
  const slideWithClones = this.getSlidesWithClones();
@@ -248,7 +249,7 @@ class Carousel extends WJElement {
248
249
  return this.querySelector(".native-carousel").scrollLeft > 0;
249
250
  }
250
251
  }
251
- customElements.get("wj-carousel") || window.customElements.define("wj-carousel", Carousel);
252
+ WJElement.define("wj-carousel", Carousel);
252
253
  export {
253
- Carousel
254
+ Carousel as default
254
255
  };
@@ -66,6 +66,7 @@ class Checkbox extends WJElement {
66
66
  }
67
67
  }
68
68
  customElements.get("wj-checkbox") || window.customElements.define("wj-checkbox", Checkbox);
69
+ WJElement.define("wj-checkbox", Checkbox);
69
70
  export {
70
- Checkbox
71
+ Checkbox as default
71
72
  };
package/dist/wj-chip.js CHANGED
@@ -47,7 +47,7 @@ class Chip extends WJElement {
47
47
  event.addListener(this.remove, "click", "wj:chip-remove", null, { stopPropagation: true });
48
48
  }
49
49
  }
50
- customElements.get("wj-chip") || window.customElements.define("wj-chip", Chip);
50
+ WJElement.define("wj-chip", Chip);
51
51
  export {
52
- Chip
52
+ Chip as default
53
53
  };
package/dist/wj-col.js CHANGED
@@ -38,7 +38,7 @@ class Col extends WJElement {
38
38
  return fragment;
39
39
  }
40
40
  }
41
- customElements.get("wj-col") || window.customElements.define("wj-col", Col);
41
+ WJElement.define("wj-col", Col);
42
42
  export {
43
- Col
43
+ Col as default
44
44
  };
@@ -1277,7 +1277,7 @@ class ColorPicker extends WJElement {
1277
1277
  return tinycolor(hsva);
1278
1278
  }
1279
1279
  }
1280
- customElements.get("wj-color-picker") || window.customElements.define("wj-color-picker", ColorPicker);
1280
+ WJElement.define("wj-color-picker", ColorPicker);
1281
1281
  export {
1282
- ColorPicker
1282
+ ColorPicker as default
1283
1283
  };
@@ -29,7 +29,7 @@ class Container extends WJElement {
29
29
  return fragment;
30
30
  }
31
31
  }
32
- customElements.get("wj-container") || window.customElements.define("wj-container", Container);
32
+ WJElement.define("wj-container", Container);
33
33
  export {
34
- Container
34
+ Container as default
35
35
  };
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement, { event } from "./wj-element.js";
8
- import { Input } from "./wj-input.js";
8
+ import Input from "./wj-input.js";
9
9
  function createNode(text) {
10
10
  const node = document.createElement("pre");
11
11
  node.style.width = "1px";
@@ -145,7 +145,7 @@ class CopyButton extends WJElement {
145
145
  }
146
146
  }
147
147
  }
148
- customElements.get("wj-copy-button") || window.customElements.define("wj-copy-button", CopyButton);
148
+ WJElement.define("wj-copy-button", CopyButton);
149
149
  export {
150
- CopyButton
150
+ CopyButton as default
151
151
  };
package/dist/wj-dialog.js CHANGED
@@ -5,7 +5,6 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement, { WjElementUtils } from "./wj-element.js";
8
- import "./wj-button.js";
9
8
  import "./wj-icon.js";
10
9
  const styles = '/*\n[ WJ Dialog ]\n*/\n:host {\n --wj-dialog-width: 600px;\n --wj-dialog-height: 600px;\n --wj-dialog-border-radius: var(--wj-border-radius-large);\n --wj-dialog-border-width: var(--wj-border-width);\n --wj-dialog-border-style: var(--wj-border-style);\n --wj-dialog-border-color: var(--wj-border-color);\n --wj-dialog-margin-top: auto;\n --wj-dialog-margin-start: auto;\n --wj-dialog-margin-end: auto;\n --wj-dialog-margin-bottom: auto;\n}\n:host .close {\n margin-left: auto;\n}\n:host .modal-content {\n border-radius: 3px;\n box-shadow: none;\n}\n:host .dialog-header {\n position: relative;\n border-bottom: 0;\n padding-inline: var(--wj-dialog-padding, 1rem);\n padding-top: var(--wj-dialog-padding, 1rem);\n padding-bottom: var(--wj-dialog-padding, 0);\n display: flex;\n align-items: center;\n}\n:host .dialog-header span {\n font-family: var(--wj-font-family-secondary);\n font-size: 10.5px;\n text-transform: uppercase;\n display: inline-block;\n letter-spacing: 0.06em;\n font-weight: 500;\n margin: 0;\n padding: 0;\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n filter: alpha(opacity=40);\n}\n:host .dialog-content {\n box-shadow: none;\n padding-inline: var(--wj-dialog-padding, 1rem);\n white-space: normal;\n z-index: 1;\n}\n:host .dialog-footer {\n display: flex;\n justify-content: end;\n border-top: none;\n box-shadow: none;\n margin-top: 0;\n padding-inline: var(--wj-dialog-padding-inline, 1rem);\n padding-top: var(--wj-dialog-padding-top, 1rem);\n padding-bottom: var(--wj-dialog-padding-bottom, 1rem);\n}\n\ndialog::backdrop {\n opacity: var(--wj-backdrop-opacity);\n background-color: var(--wj-backdrop);\n}\n\n:host(.separator) .dialog-header:after {\n content: "";\n height: 1px;\n background: rgba(0, 0, 0, 0.08);\n left: var(--wj-dialog-padding, 1rem);\n right: var(--wj-dialog-padding, 1rem);\n position: absolute;\n bottom: 0;\n}\n\n:host dialog {\n box-sizing: border-box;\n transition: all 0.2s !important;\n width: var(--wj-dialog-width);\n height: var(--wj-dialog-height);\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);\n border-radius: var(--wj-dialog-border-radius);\n border-width: var(--wj-dialog-border-width);\n border-style: var(--wj-dialog-border-style);\n border-color: var(--wj-dialog-border-color);\n margin-top: var(--wj-dialog-margin-top);\n margin-bottom: var(--wj-dialog-margin-bottom);\n margin-inline: var(--wj-dialog-margin-start) var(--wj-dialog-margin-end);\n padding: 0;\n}\n\n:host(.stick-up) {\n --wj-dialog-width: 300px !important;\n --wj-dialog-height: fit-content;\n --wj-dialog-border-radius: 0 0 8px 8px;\n --wj-dialog-border-width: 0 1px 1px 1px;\n --wj-dialog-margin-top: 0;\n --wj-dialog-translate-from: translateY(-110%);\n --wj-dialog-template-to: translateX(0);\n}\n\n:host(.slide-up) {\n --wj-dialog-width: 300px !important;\n --wj-dialog-height: fit-content;\n --wj-dialog-border-radius: 8px;\n --wj-dialog-border-width: 1px;\n --wj-dialog-opacity-from: 0;\n --wj-dialog-translate-from: scale(.9);\n --wj-dialog-translate-to: scale(1);\n}\n\n:host(.fill-in) {\n --wj-dialog-width: 100%;\n --wj-dialog-height: 100%;\n --wj-dialog-border-radius: 0 0 0 0 !important;\n --wj-dialog-border-width: 0;\n --wj-dialog-margin-top: 0;\n --wj-dialog-margin-start: 0;\n --wj-dialog-margin-end: 0;\n --wj-dialog-margin-bottom: 0;\n --wj-dialog-translate-from: scale(.95);\n --wj-dialog-translate-to: scale(1);\n}\n:host(.fill-in) dialog {\n min-width: var(--wj-dialog-width);\n min-height: var(--wj-dialog-height);\n}\n\n:host(.slide-left) {\n --wj-dialog-width: 300px !important;\n --wj-dialog-height: 100% !important;\n --wj-dialog-border-radius: 0;\n --wj-dialog-border-width: 0 1px 0 0;\n --wj-dialog-margin-top: 0;\n --wj-dialog-margin-start: 0;\n --wj-dialog-margin-end: auto;\n --wj-dialog-margin-bottom: 0;\n}\n:host(.slide-left) dialog {\n min-height: var(--wj-dialog-height);\n --wj-dialog-translate-from: translateX(-110%);\n --wj-dialog-template-to: translateX(0);\n}\n\n:host(.slide-right) {\n --wj-dialog-width: 300px !important;\n --wj-dialog-height: 100% !important;\n --wj-dialog-border-radius: 0;\n --wj-dialog-border-width: 0 0 0 1px;\n --wj-dialog-margin-top: 0;\n --wj-dialog-margin-start: auto;\n --wj-dialog-margin-end: 0;\n --wj-dialog-margin-bottom: 0;\n}\n:host(.slide-right) dialog {\n min-height: var(--wj-dialog-height);\n --wj-dialog-translate-from: translateX(110%);\n --wj-dialog-template-to: translateX(0);\n}\n\n:host(.small) {\n --wj-dialog-width: 300px !important;\n}\n\n:host(.medium) {\n --wj-dialog-width: 500px !important;\n}\n\n:host(.large) {\n --wj-dialog-width: 600px !important;\n}\n\n:host(.ex-large) {\n --wj-dialog-width: 900px !important;\n}\n\ndialog[open] {\n animation: show 0.5s ease normal;\n}\n\n@keyframes show {\n from {\n opacity: var(--wj-dialog-opacity-from, 1);\n transform: var(--wj-dialog-translate-from);\n }\n to {\n opacity: 1;\n transform: var(--wj-dialog-translate-to);\n }\n}';
11
10
  class Dialog extends WJElement {
@@ -84,7 +83,7 @@ class Dialog extends WJElement {
84
83
  }
85
84
  }
86
85
  }
87
- customElements.get("wj-dialog") || window.customElements.define("wj-dialog", Dialog);
86
+ WJElement.define("wj-dialog", Dialog);
88
87
  export {
89
- Dialog
88
+ Dialog as default
90
89
  };
@@ -29,7 +29,7 @@ class Divider extends WJElement {
29
29
  return fragment;
30
30
  }
31
31
  }
32
- customElements.get("wj-divider") || window.customElements.define("wj-divider", Divider);
32
+ WJElement.define("wj-divider", Divider);
33
33
  export {
34
- Divider
34
+ Divider as default
35
35
  };
@@ -41,7 +41,7 @@ class Dropdown extends WJElement {
41
41
  return fragment;
42
42
  }
43
43
  }
44
- customElements.get("wj-dropdown") || window.customElements.define("wj-dropdown", Dropdown);
44
+ WJElement.define("wj-dropdown", Dropdown);
45
45
  export {
46
- Dropdown
46
+ Dropdown as default
47
47
  };
@@ -330,7 +330,7 @@ dispatch_fn = function(e) {
330
330
  let event = new WjEvent();
331
331
  const template = document.createElement("template");
332
332
  template.innerHTML = ``;
333
- class WJElement extends HTMLElement {
333
+ const _WJElement = class _WJElement extends HTMLElement {
334
334
  constructor(componentTemplate) {
335
335
  super();
336
336
  __publicField(this, "initWjElement", async (force = false) => {
@@ -350,16 +350,17 @@ class WJElement extends HTMLElement {
350
350
  this.context.adoptedStyleSheets = [sheet];
351
351
  });
352
352
  this.template = componentTemplate || template;
353
- this._attributes = {};
354
353
  this.isAttached = false;
355
354
  this.service = new UniversalService({
356
355
  store
357
356
  });
357
+ this.defineDepandencies();
358
358
  this.rendering = false;
359
359
  this.runtimeTimeout = null;
360
360
  this.count = 0;
361
361
  this.functionStack = [];
362
362
  this.scheludedRefresh = false;
363
+ this._depandencies = {};
363
364
  }
364
365
  get permission() {
365
366
  return this.getAttribute("permission-check");
@@ -420,6 +421,23 @@ class WJElement extends HTMLElement {
420
421
  var _a;
421
422
  return (_a = this.getAttribute("remove-class-after-connect")) == null ? void 0 : _a.split(" ");
422
423
  }
424
+ get depandencies() {
425
+ return this._depandencies;
426
+ }
427
+ set depandencies(value) {
428
+ this._depandencies = value;
429
+ }
430
+ static define(name, elementConstructor = this, options = {}) {
431
+ const definedElement = customElements.get(name);
432
+ if (!definedElement) {
433
+ customElements.define(name, elementConstructor, options);
434
+ return;
435
+ }
436
+ }
437
+ defineDepandencies() {
438
+ if (this.depandencies)
439
+ Object.entries(depandencies).forEach((name, component) => _WJElement.define(name, component));
440
+ }
423
441
  beforeDraw() {
424
442
  }
425
443
  afterDraw() {
@@ -586,21 +604,14 @@ class WJElement extends HTMLElement {
586
604
  );
587
605
  });
588
606
  }
589
- static define(name, elementConstructor = this, options = {}) {
590
- const definedElement = customElements.get(name);
591
- if (!definedElement) {
592
- customElements.define(name, elementConstructor, options);
593
- return;
594
- }
595
- }
596
- }
597
- __publicField(WJElement, "processTemplates", (pTemplate, template2) => {
607
+ };
608
+ __publicField(_WJElement, "processTemplates", (pTemplate, template2) => {
598
609
  const newTemplate = document.createElement("template");
599
610
  newTemplate.innerHTML = [template2.innerHTML, (pTemplate == null ? void 0 : pTemplate.innerHTML) || ""].join("");
600
611
  return newTemplate;
601
612
  });
613
+ let WJElement = _WJElement;
602
614
  let __esModule = "true";
603
- customElements.get("wj-element") || customElements.define("wj-element", WJElement);
604
615
  export {
605
616
  WjElementUtils,
606
617
  WjPermissionsApi,
@@ -82,7 +82,7 @@ class FileUploadItem extends WJElement {
82
82
  this.button.addEventListener("wj:button-click", this.onDelete);
83
83
  }
84
84
  }
85
- customElements.get("wj-file-upload-item") || window.customElements.define("wj-file-upload-item", FileUploadItem);
85
+ WJElement.define("wj-file-upload-item", FileUploadItem);
86
86
  export {
87
- FileUploadItem
87
+ FileUploadItem as default
88
88
  };
@@ -314,7 +314,7 @@ class FileUpload extends WJElement {
314
314
  this.updateStatusMessage(`🤷‍♂ Nothing's uploaded`);
315
315
  }
316
316
  }
317
- customElements.get("wj-file-upload") || window.customElements.define("wj-file-upload", FileUpload);
317
+ WJElement.define("wj-file-upload", FileUpload);
318
318
  export {
319
- FileUpload
319
+ FileUpload as default
320
320
  };
package/dist/wj-footer.js CHANGED
@@ -27,7 +27,7 @@ class Footer extends WJElement {
27
27
  return fragment;
28
28
  }
29
29
  }
30
- customElements.get("wj-footer") || window.customElements.define("wj-footer", Footer);
30
+ WJElement.define("wj-footer", Footer);
31
31
  export {
32
- Footer
32
+ Footer as default
33
33
  };
package/dist/wj-form.js CHANGED
@@ -27,7 +27,7 @@ class Form extends WJElement {
27
27
  return fragment;
28
28
  }
29
29
  }
30
- customElements.get("wj-form") || window.customElements.define("wj-form", Form);
30
+ WJElement.define("wj-form", Form);
31
31
  export {
32
- Form
32
+ Form as default
33
33
  };
@@ -59,7 +59,7 @@ class FormatDigital extends WJElement {
59
59
  return fragment;
60
60
  }
61
61
  }
62
- customElements.get("wj-format-digital") || window.customElements.define("wj-format-digital", FormatDigital);
62
+ WJElement.define("wj-format-digital", FormatDigital);
63
63
  export {
64
- FormatDigital
64
+ FormatDigital as default
65
65
  };
package/dist/wj-grid.js CHANGED
@@ -29,7 +29,7 @@ class Grid extends WJElement {
29
29
  return fragment;
30
30
  }
31
31
  }
32
- customElements.get("wj-grid") || window.customElements.define("wj-grid", Grid);
32
+ WJElement.define("wj-grid", Grid);
33
33
  export {
34
- Grid
34
+ Grid as default
35
35
  };
package/dist/wj-header.js CHANGED
@@ -31,7 +31,7 @@ class Header extends WJElement {
31
31
  return fragment;
32
32
  }
33
33
  }
34
- customElements.get("wj-header") || window.customElements.define("wj-header", Header);
34
+ WJElement.define("wj-header", Header);
35
35
  export {
36
- Header
36
+ Header as default
37
37
  };
@@ -5,8 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import WJElement, { event } from "./wj-element.js";
8
- import { InfiniteScroll } from "./wj-infinite-scroll.js";
9
- import "./wj-tooltip.js";
8
+ import InfiniteScroll from "./wj-infinite-scroll.js";
10
9
  const styles = "/*\n[ Wj Icon Picker ]\n*/\n:host {\n --wj-icon-picker-radius: var(--wj-border-radius-small);\n --wj-icon-picker-icon-size: 1.5rem;\n --wj-icon-picker-border-width: 1px;\n --wj-icon-picker-border-style: solid;\n --wj-icon-picker-border-color: var(--wj-border-color);\n --wj-icon-picker-padding: .25rem;\n padding: 0 1rem;\n}\n\n.anchor {\n width: var(--wj-icon-picker-icon-size);\n height: var(--wj-icon-picker-icon-size);\n padding: var(--wj-icon-picker-padding);\n border-width: var(--wj-icon-picker-border-width);\n border-style: var(--wj-icon-picker-border-style);\n border-color: var(--wj-icon-picker-border-color);\n box-sizing: border-box;\n border-radius: var(--wj-icon-picker-radius);\n}\n\n.picker {\n width: 320px;\n height: 271px;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.05), 0 5px 20px rgba(0, 0, 0, 0.1);\n border-radius: var(--wj-icon-picker-radius);\n border-width: var(--wj-icon-picker-border-width);\n border-style: var(--wj-icon-picker-border-style);\n border-color: var(--wj-icon-picker-border-color);\n overflow: auto;\n padding: 1rem;\n background: var(--wj-background);\n}\n\n.icon-items {\n --icon-min-width: 2rem;\n display: grid;\n grid-gap: 0.5rem;\n grid-template-columns: repeat(auto-fit, minmax(var(--icon-min-width), 1fr));\n}\n\n.icon-item {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: inherit;\n padding: 0.25rem;\n min-height: var(--wj-icon-picker-icon-size);\n min-width: var(--wj-icon-picker-icon-size);\n text-decoration: none;\n}\n.icon-item:hover {\n border-radius: 0.25rem;\n background: var(--wj-border-color);\n}\n\n.wj-size {\n --wj-icon-size: 24px !important;\n}\n\nicon-item svg {\n width: var(--wj-icon-picker-icon-size);\n height: var(--wj-icon-picker-icon-size);\n}\n\nwj-input {\n --wj-input-border-radius: 4px;\n --wj-input-margin-bottom: 0;\n}\n\nwj-infinite-scroll {\n margin-top: 1rem;\n}\n\nwj-select {\n --wj-select-border-width: 0 0 1px 0 !important;\n --wj-select-border-radius: 0 !important;\n margin-bottom: 1rem;\n}\n\n.anchor wj-icon {\n --wj-icon-size: 100% !important;\n}";
11
10
  class IconPicker extends WJElement {
12
11
  constructor() {
@@ -184,7 +183,7 @@ class IconPicker extends WJElement {
184
183
  this.context.querySelector(".icon-items").innerHTML = "";
185
184
  }
186
185
  }
187
- customElements.get("wj-icon-picker") || window.customElements.define("wj-icon-picker", IconPicker);
186
+ WJElement.define("wj-icon-picker", IconPicker);
188
187
  export {
189
- IconPicker
188
+ IconPicker as default
190
189
  };
package/dist/wj-icon.js CHANGED
@@ -116,7 +116,7 @@ const getNamedUrl = (iconName) => {
116
116
  return new URL(parsedUrl.origin + folderPath + path).href;
117
117
  };
118
118
  const styles = "/*\n[ WJ Icon ]\n*/\n:host(.wj-color-primary) {\n --wj-icon-color: var(--wj-color-primary);\n}\n\n:host(.wj-color-complete) {\n --wj-icon-color: var(--wj-color-complete);\n}\n\n:host(.wj-color-success) {\n --wj-icon-color: var(--wj-color-success);\n}\n\n:host(.wj-color-warning) {\n --wj-icon-color: var(--wj-color-warning);\n}\n\n:host(.wj-color-danger) {\n --wj-icon-color: var(--wj-color-danger);\n}\n\n:host(.wj-color-info) {\n --wj-icon-color: var(--wj-color-info);\n}\n\n:host {\n --wj-icon-size: 1rem;\n --wj-icon-width: var(--wj-icon-size, 100%);\n --wj-icon-height: var(--wj-icon-size, 100%);\n display: inline-block;\n width: var(--wj-icon-width);\n height: var(--wj-icon-height);\n contain: strict;\n fill: currentColor;\n box-sizing: content-box !important;\n}\n\n.icon-inner, svg {\n display: block;\n width: var(--wj-icon-width);\n height: var(--wj-icon-height);\n}\n\n:host(.wj-size-small) {\n --wj-icon-size: 18px;\n}\n\n:host(.wj-size-large) {\n --wj-icon-size: 32px;\n}\n\n:host(.wj-size) {\n font-size: var(--wj-icon-size);\n}\n\n:host(.wj-color) {\n color: var(--wj-icon-color) !important;\n}";
119
- class Icon extends WJElement {
119
+ class IconElement extends WJElement {
120
120
  constructor() {
121
121
  super();
122
122
  __publicField(this, "className", "Icon");
@@ -160,7 +160,7 @@ class Icon extends WJElement {
160
160
  lazyImageObserver.observe(this.element);
161
161
  }
162
162
  }
163
- customElements.get("wj-icon") || window.customElements.define("wj-icon", Icon);
163
+ WJElement.define("wj-icon", IconElement);
164
164
  export {
165
- Icon
165
+ IconElement as default
166
166
  };