wj-elements 0.1.46 → 0.1.48

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 (96) hide show
  1. package/package.json +1 -1
  2. package/dist/dark.css +0 -1
  3. package/dist/light.css +0 -1
  4. package/dist/localize.js +0 -45
  5. package/dist/popup.element-CWsSOxs2.js +0 -1072
  6. package/dist/router-links-FtZbFUto.js +0 -146
  7. package/dist/styles.css +0 -1
  8. package/dist/wje-accordion-item.js +0 -88
  9. package/dist/wje-accordion.js +0 -79
  10. package/dist/wje-animation.js +0 -121
  11. package/dist/wje-aside.js +0 -55
  12. package/dist/wje-avatar.js +0 -77
  13. package/dist/wje-badge.js +0 -50
  14. package/dist/wje-breadcrumb.js +0 -148
  15. package/dist/wje-breadcrumbs.js +0 -67
  16. package/dist/wje-button-group.js +0 -78
  17. package/dist/wje-button.js +0 -207
  18. package/dist/wje-card-content.js +0 -48
  19. package/dist/wje-card-controls.js +0 -48
  20. package/dist/wje-card-header.js +0 -47
  21. package/dist/wje-card-subtitle.js +0 -55
  22. package/dist/wje-card-title.js +0 -55
  23. package/dist/wje-card.js +0 -50
  24. package/dist/wje-carousel-item.js +0 -33
  25. package/dist/wje-carousel.js +0 -177
  26. package/dist/wje-checkbox.js +0 -96
  27. package/dist/wje-chip.js +0 -32
  28. package/dist/wje-col.js +0 -27
  29. package/dist/wje-color-picker.js +0 -953
  30. package/dist/wje-container.js +0 -57
  31. package/dist/wje-copy-button.js +0 -164
  32. package/dist/wje-dialog.js +0 -86
  33. package/dist/wje-divider.js +0 -53
  34. package/dist/wje-dropdown.js +0 -114
  35. package/dist/wje-element.js +0 -453
  36. package/dist/wje-fetchAndParseCSS.js +0 -40
  37. package/dist/wje-file-upload-item.js +0 -115
  38. package/dist/wje-file-upload.js +0 -297
  39. package/dist/wje-footer.js +0 -56
  40. package/dist/wje-form.js +0 -28
  41. package/dist/wje-format-digital.js +0 -85
  42. package/dist/wje-grid.js +0 -28
  43. package/dist/wje-header.js +0 -58
  44. package/dist/wje-icon-picker.js +0 -221
  45. package/dist/wje-icon.js +0 -119
  46. package/dist/wje-img-comparer.js +0 -111
  47. package/dist/wje-img.js +0 -58
  48. package/dist/wje-infinite-scroll.js +0 -201
  49. package/dist/wje-inline-edit.js +0 -145
  50. package/dist/wje-input-file.js +0 -85
  51. package/dist/wje-input.js +0 -334
  52. package/dist/wje-item.js +0 -45
  53. package/dist/wje-label.js +0 -67
  54. package/dist/wje-list.js +0 -53
  55. package/dist/wje-main.js +0 -56
  56. package/dist/wje-masonry.js +0 -218
  57. package/dist/wje-master.js +0 -423
  58. package/dist/wje-menu-button.js +0 -65
  59. package/dist/wje-menu-item.js +0 -230
  60. package/dist/wje-menu-label.js +0 -57
  61. package/dist/wje-menu.js +0 -74
  62. package/dist/wje-option.js +0 -99
  63. package/dist/wje-options.js +0 -63
  64. package/dist/wje-popup.js +0 -5
  65. package/dist/wje-progress-bar.js +0 -161
  66. package/dist/wje-qr-code.js +0 -2332
  67. package/dist/wje-radio-group.js +0 -101
  68. package/dist/wje-radio.js +0 -46
  69. package/dist/wje-rate.js +0 -260
  70. package/dist/wje-relative-time.js +0 -85
  71. package/dist/wje-reorder-dropzone.js +0 -27
  72. package/dist/wje-reorder-handle.js +0 -115
  73. package/dist/wje-reorder-item.js +0 -32
  74. package/dist/wje-reorder.js +0 -138
  75. package/dist/wje-route.js +0 -46
  76. package/dist/wje-router-link.js +0 -64
  77. package/dist/wje-router-outlet.js +0 -127
  78. package/dist/wje-routerx.js +0 -1088
  79. package/dist/wje-row.js +0 -58
  80. package/dist/wje-select.js +0 -242
  81. package/dist/wje-slider.js +0 -177
  82. package/dist/wje-sliding-container.js +0 -274
  83. package/dist/wje-split-view.js +0 -112
  84. package/dist/wje-status.js +0 -54
  85. package/dist/wje-store.js +0 -192
  86. package/dist/wje-tab-group.js +0 -107
  87. package/dist/wje-tab-panel.js +0 -52
  88. package/dist/wje-tab.js +0 -59
  89. package/dist/wje-textarea.js +0 -116
  90. package/dist/wje-thumbnail.js +0 -64
  91. package/dist/wje-toast.js +0 -76
  92. package/dist/wje-toggle.js +0 -94
  93. package/dist/wje-toolbar-action.js +0 -63
  94. package/dist/wje-toolbar.js +0 -61
  95. package/dist/wje-tooltip.js +0 -116
  96. package/dist/wje-visually-hidden.js +0 -56
@@ -1,218 +0,0 @@
1
- var p = Object.defineProperty;
2
- var b = (o, s, t) => s in o ? p(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
3
- var r = (o, s, t) => (b(o, typeof s != "symbol" ? s + "" : s, t), t);
4
- import w from "./wje-element.js";
5
- const A = 500, C = 300, x = "--wje-masonry-layout-col-count", v = "--wje-masonry-layout-gap", d = 1, m = /* @__PURE__ */ new Map();
6
- function c(o, s, t) {
7
- const e = parseFloat(o.getAttribute(s) || "");
8
- return isNaN(e) ? t : e;
9
- }
10
- function g(o, s, t) {
11
- return isNaN(s) ? Math.max(1, Math.ceil(o / t)) : s;
12
- }
13
- function E(o, s, t) {
14
- const e = m.get(t);
15
- e != null && window.clearTimeout(e), m.set(t, window.setTimeout(o, s));
16
- }
17
- function S(o) {
18
- let s = 0, t = 1 / 0;
19
- return o.forEach((e, n) => {
20
- e < t && (t = e, s = n);
21
- }), s;
22
- }
23
- const N = ":host{display:flex;align-items:flex-start;justify-content:stretch;width:100%}.column{max-width:calc((100% / var(--wje-masonry-layout-col-count, 1) - ((var(--wje-masonry-layout-gap, 1rem) * (var(--wje-masonry-layout-col-count, 1) - 1) / var(--wje-masonry-layout-col-count, 1)))));width:100%;flex:1;display:flex;flex-direction:column}.column:not(:last-child){margin-inline-end:var(--wje-masonry-layout-gap, 1rem)}.column ::slotted(*){margin-block-end:var(--wje-masonry-layout-gap, 1rem);box-sizing:border-box;width:100%}#unset-items{opacity:0;position:absolute;pointer-events:none}";
24
- class f extends w {
25
- /**
26
- * Constructor for the Masonry class.
27
- */
28
- constructor() {
29
- super();
30
- r(this, "debounceId", `layout_${Math.random()}`);
31
- r(this, "ro");
32
- r(this, "className", "Masonry");
33
- /**
34
- * Called when the slot changes.
35
- */
36
- r(this, "onSlotChange", () => {
37
- (this.unsetSlot.assignedNodes() || []).filter((e) => e.nodeType === d).length > 0 && this.layout();
38
- });
39
- /**
40
- * Called when the window resizes.
41
- * @param {Array} entries - The entries to use.
42
- */
43
- r(this, "onResize", (t) => {
44
- const { width: e } = t != null && Array.isArray(t) && t.length > 0 ? t[0].contentRect : { width: this.offsetWidth };
45
- g(e, this.cols, this.maxColWidth) !== this.columns.length && this.scheduleLayout();
46
- });
47
- /**
48
- * Lays out the element.
49
- */
50
- r(this, "layout", () => {
51
- this.currentRequestAnimationFrameCallback != null && window.cancelAnimationFrame(this.currentRequestAnimationFrameCallback), this.currentRequestAnimationFrameCallback = requestAnimationFrame(() => {
52
- const t = this.gap, e = Array.from(this.children).filter((l) => l.nodeType === d), n = g(this.offsetWidth, this.cols, this.maxColWidth), a = Array(n).fill(0), i = [];
53
- for (const l of e) {
54
- const y = l.getBoundingClientRect().height;
55
- let u = S(a);
56
- a[u] += y + +t;
57
- const h = u;
58
- l.slot !== h && i.push(() => l.slot = h);
59
- }
60
- for (const l of i)
61
- l();
62
- this.renderCols(n);
63
- });
64
- });
65
- this.debounceId = `layout_${Math.random()}`, this.ro = void 0, this.currentRequestAnimationFrameCallback = void 0, this.unsetSlot = void 0;
66
- }
67
- /**
68
- * Setter for the maxColWidth property.
69
- * @param {number} value - The maximum column width.
70
- */
71
- set maxColWidth(t) {
72
- this.setAttribute("max-col-width", t);
73
- }
74
- /**
75
- * Getter for the maxColWidth property.
76
- * @returns {number} The maximum column width.
77
- */
78
- get maxColWidth() {
79
- return this.hasAttribute("max-col-width") ? +this.getAttribute("max-col-width") : +A;
80
- }
81
- /**
82
- * Setter for the cols property.
83
- * @param {number} value - The number of columns.
84
- */
85
- set cols(t) {
86
- this.hasAttribute("cols") && this.setAttribute("cols", t);
87
- }
88
- /**
89
- * Getter for the cols property.
90
- * @returns {number} The number of columns.
91
- */
92
- get cols() {
93
- return c(this, "cols", "auto");
94
- }
95
- /**
96
- * Setter for the gap property.
97
- * @param {number} value - The gap between columns.
98
- */
99
- set gap(t) {
100
- this.setAttribute("gap", t);
101
- }
102
- /**
103
- * Getter for the gap property.
104
- * @returns {number} The gap between columns.
105
- */
106
- get gap() {
107
- return c(this, "gap", "24");
108
- }
109
- /**
110
- * Setter for the debounce property.
111
- * @param {number} value - The debounce time.
112
- */
113
- set debounce(t) {
114
- this.setAttribute("debounce", t);
115
- }
116
- /**
117
- * Getter for the debounce property.
118
- * @returns {number} The debounce time.
119
- */
120
- get debounce() {
121
- return c(this, "debounce", C);
122
- }
123
- /**
124
- * Getter for the columns property.
125
- * @returns {Array} An array of all the columns.
126
- */
127
- get columns() {
128
- return Array.from(this.shadowRoot.querySelectorAll(".column"));
129
- }
130
- /**
131
- * Getter for the cssStyleSheet property.
132
- * @returns {CSSStyleSheet} The CSS style sheet.
133
- */
134
- static get cssStyleSheet() {
135
- return N;
136
- }
137
- /**
138
- * Getter for the observedAttributes property.
139
- * @returns {Array} An array of the observed attributes.
140
- */
141
- static get observedAttributes() {
142
- return ["max-col-width", "gap", "cols"];
143
- }
144
- /**
145
- * Callback for when an attribute changes.
146
- * @param {string} name - The name of the attribute.
147
- * @param {string} old - The old value of the attribute.
148
- * @param {string} newName - The new value of the attribute.
149
- */
150
- attributeChangedCallback(t, e, n) {
151
- switch (t) {
152
- case "gap":
153
- this.style.setProperty(v, `${this.gap}px`);
154
- break;
155
- }
156
- this.scheduleLayout();
157
- }
158
- /**
159
- * Callback for when the element is disconnected.
160
- */
161
- disconnectedCallback() {
162
- this.unsetSlot.removeEventListener("slotchange", this.onSlotChange), window.removeEventListener("resize", this.onResize), this.ro != null && this.ro.unobserve(this);
163
- }
164
- /**
165
- * Sets up the attributes for the element.
166
- */
167
- setupAttributes() {
168
- this.isShadowRoot = "open";
169
- }
170
- /**
171
- * Draws the element.
172
- * @param {CanvasRenderingContext2D} context - The context to draw on.
173
- * @param {Object} store - The store to use.
174
- * @param {Object} params - The parameters to use.
175
- * @returns {DocumentFragment} The drawn element.
176
- */
177
- draw(t, e, n) {
178
- let a = document.createDocumentFragment(), i = document.createElement("div");
179
- i.setAttribute("id", "unset-items"), i.setAttribute("part", "native");
180
- let l = document.createElement("slot");
181
- return i.appendChild(l), this.unsetSlot = l, this.native = i, a.appendChild(i), a;
182
- }
183
- /**
184
- * Called after the element is drawn.
185
- */
186
- afterDraw() {
187
- this.onSlotChange(), this.onResize(), this.layout(), this.unsetSlot.addEventListener("slotchange", this.onSlotChange), "ResizeObserver" in window ? (this.ro = new ResizeObserver(this.onResize), this.ro.observe(this)) : window.addEventListener("resize", this.onResize);
188
- }
189
- /**
190
- * Renders the columns.
191
- * @param {number} colCount - The number of columns to render.
192
- */
193
- renderCols(t) {
194
- const e = this.columns;
195
- if (e.length !== t) {
196
- for (const n of e)
197
- n.parentNode && n.parentNode.removeChild(n);
198
- for (let n = 0; n < t; n++) {
199
- const a = document.createElement("div");
200
- a.classList.add("column"), a.setAttribute("part", `column column-${n}`);
201
- const i = document.createElement("slot");
202
- i.setAttribute("name", n), a.appendChild(i), this.context.appendChild(a);
203
- }
204
- this.style.setProperty(x, t);
205
- }
206
- }
207
- /**
208
- * Schedules a layout.
209
- * @param {number} ms - The number of milliseconds to wait before laying out.
210
- */
211
- scheduleLayout(t = this.debounce) {
212
- E(this.layout, t, this.debounceId);
213
- }
214
- }
215
- f.define("wje-masonry", f);
216
- export {
217
- f as default
218
- };
@@ -1,423 +0,0 @@
1
- var y = Object.defineProperty;
2
- var C = (o, l, e) => l in o ? y(o, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[l] = e;
3
- var f = (o, l, e) => (C(o, typeof l != "symbol" ? l + "" : l, e), e);
4
- import g from "./wje-element.js";
5
- import { event as q } from "./wje-element.js";
6
- import { defaultStoreActions as P, store as U } from "./wje-store.js";
7
- import { b as V, w as $ } from "./router-links-FtZbFUto.js";
8
- import { fetchAndParseCSS as W } from "./wje-fetchAndParseCSS.js";
9
- import { Localizer as j } from "./localize.js";
10
- import { default as Q } from "./wje-accordion.js";
11
- import { default as K } from "./wje-accordion-item.js";
12
- import { default as Z } from "./wje-animation.js";
13
- import { default as ee } from "./wje-aside.js";
14
- import { default as re } from "./wje-avatar.js";
15
- import { default as oe } from "./wje-badge.js";
16
- import { default as ie } from "./wje-breadcrumb.js";
17
- import { default as le } from "./wje-breadcrumbs.js";
18
- import { default as ce } from "./wje-button.js";
19
- import { default as me } from "./wje-button-group.js";
20
- import { default as fe } from "./wje-card.js";
21
- import { default as ge } from "./wje-card-content.js";
22
- import { default as ve } from "./wje-card-controls.js";
23
- import { default as be } from "./wje-card-header.js";
24
- import { default as je } from "./wje-card-subtitle.js";
25
- import { default as Ce } from "./wje-card-title.js";
26
- import { default as Ee } from "./wje-carousel.js";
27
- import { default as Me } from "./wje-carousel-item.js";
28
- import { default as Te } from "./wje-checkbox.js";
29
- import { default as He } from "./wje-chip.js";
30
- import { default as De } from "./wje-col.js";
31
- import { default as Ne } from "./wje-color-picker.js";
32
- import { default as qe } from "./wje-container.js";
33
- import { default as Pe } from "./wje-copy-button.js";
34
- import { default as Ge } from "./wje-dialog.js";
35
- import { default as $e } from "./wje-divider.js";
36
- import { default as We } from "./wje-dropdown.js";
37
- import { default as Qe } from "./wje-file-upload.js";
38
- import { default as Ke } from "./wje-file-upload-item.js";
39
- import { default as Ze } from "./wje-footer.js";
40
- import { default as et } from "./wje-format-digital.js";
41
- import { default as rt } from "./wje-grid.js";
42
- import { default as ot } from "./wje-header.js";
43
- import { default as it } from "./wje-icon.js";
44
- import { default as lt } from "./wje-icon-picker.js";
45
- import { default as ct } from "./wje-img.js";
46
- import { default as mt } from "./wje-img-comparer.js";
47
- import { default as ft } from "./wje-infinite-scroll.js";
48
- import { default as gt } from "./wje-inline-edit.js";
49
- import { default as vt } from "./wje-input.js";
50
- import { default as bt } from "./wje-input-file.js";
51
- import { default as jt } from "./wje-item.js";
52
- import { default as Ct } from "./wje-label.js";
53
- import { default as Et } from "./wje-list.js";
54
- import { default as Mt } from "./wje-main.js";
55
- import { default as Tt } from "./wje-masonry.js";
56
- import { default as Ht } from "./wje-menu.js";
57
- import { default as Dt } from "./wje-menu-button.js";
58
- import { default as Nt } from "./wje-menu-item.js";
59
- import { default as qt } from "./wje-menu-label.js";
60
- import { default as Pt } from "./wje-option.js";
61
- import { default as Gt } from "./wje-options.js";
62
- import "./wje-popup.js";
63
- import { default as $t } from "./wje-progress-bar.js";
64
- import { default as Wt } from "./wje-qr-code.js";
65
- import { default as Qt } from "./wje-radio.js";
66
- import { default as Kt } from "./wje-radio-group.js";
67
- import { default as Zt } from "./wje-rate.js";
68
- import { default as er } from "./wje-relative-time.js";
69
- import { default as rr } from "./wje-reorder.js";
70
- import { default as or } from "./wje-reorder-dropzone.js";
71
- import { default as ir } from "./wje-reorder-handle.js";
72
- import { default as lr } from "./wje-reorder-item.js";
73
- import { default as cr } from "./wje-route.js";
74
- import { default as mr } from "./wje-routerx.js";
75
- import { default as fr } from "./wje-router-link.js";
76
- import { default as gr } from "./wje-router-outlet.js";
77
- import { default as vr } from "./wje-row.js";
78
- import { default as br } from "./wje-select.js";
79
- import { default as jr } from "./wje-slider.js";
80
- import { default as Cr } from "./wje-split-view.js";
81
- import { default as Er } from "./wje-status.js";
82
- import { default as Mr } from "./wje-tab.js";
83
- import { default as Tr } from "./wje-tab-group.js";
84
- import { default as Hr } from "./wje-tab-panel.js";
85
- import { default as Dr } from "./wje-textarea.js";
86
- import { default as Nr } from "./wje-thumbnail.js";
87
- import { default as qr } from "./wje-toast.js";
88
- import { default as Pr } from "./wje-toggle.js";
89
- import { default as Gr } from "./wje-toolbar.js";
90
- import { default as $r } from "./wje-toolbar-action.js";
91
- import { default as Wr } from "./wje-tooltip.js";
92
- import { default as Qr } from "./wje-visually-hidden.js";
93
- import { default as Kr } from "./wje-sliding-container.js";
94
- import { P as Zr } from "./popup.element-CWsSOxs2.js";
95
- const A = {
96
- code: "sk",
97
- name: "Slovak",
98
- dir: "ltr",
99
- welcome: "Vitajte",
100
- "wj.file.upload.button": "Vybrať súbor",
101
- "wj.file.upload.uploaded": "Nahraných: ",
102
- "wj.file.upload.from": "z"
103
- };
104
- j.registerTranslation(A);
105
- const E = {
106
- code: "en",
107
- name: "English",
108
- dir: "ltr",
109
- welcome: "Welcome",
110
- "wj.file.upload.button": "Browse files",
111
- "wj.file.upload.uploaded": "Uploaded: ",
112
- "wj.file.upload.from": "from"
113
- };
114
- j.registerTranslation(E);
115
- const L = "";
116
- class v extends g {
117
- constructor() {
118
- super();
119
- f(this, "className", "Step");
120
- }
121
- static get cssStyleSheet() {
122
- return L;
123
- }
124
- setupAttributes() {
125
- this.isShadowRoot = "open";
126
- }
127
- draw() {
128
- let e = document.createDocumentFragment(), r = document.createElement("div");
129
- const s = document.createElement("slot");
130
- return r.appendChild(s), e.appendChild(r), e;
131
- }
132
- }
133
- v.define("wje-step", v);
134
- const M = ".stepper-container{display:flex;flex-direction:column}.step-headers{display:flex;justify-content:space-between;margin-bottom:var(--wje-spacing-medium)}.step-header{display:flex;padding:var(--wje-spacing-medium);gap:var(--wje-spacing-x-small);color:var(--wje-color-contrast-5);flex-grow:1;text-align:center}.pointer{cursor:pointer}.active{color:var(--wje-color-contrast-11)}.steps-content{margin-bottom:var(--wje-spacing-medium)}.arrow-icon{margin-top:var(--wje-stepper-margin)}.step{padding:var(--wje-spacing-medium);text-align:center}.done{color:var(--wje-color-contrast-11)}.nav-buttons{display:flex;justify-content:space-between}";
135
- class w extends g {
136
- constructor() {
137
- super();
138
- f(this, "className", "Stepper");
139
- this.currentStep = 0, this.completedSteps = [];
140
- }
141
- static get cssStyleSheet() {
142
- return M;
143
- }
144
- setupAttributes() {
145
- this.isShadowRoot = "open";
146
- }
147
- draw() {
148
- let e = document.createDocumentFragment();
149
- const r = document.createElement("div");
150
- r.className = "stepper-container";
151
- const s = document.createElement("div");
152
- s.className = "step-headers";
153
- const a = document.createElement("div");
154
- a.className = "steps-content";
155
- const t = Array.from(this.children);
156
- this.steps = t.map((c, m) => {
157
- if (c.nodeName === "WJE-STEP") {
158
- const n = document.createElement("div");
159
- n.className = "step-header";
160
- const u = document.createElement("wje-badge");
161
- u.className = "step-badge", u.setAttribute("label", (m + 1).toString()), u.innerHTML = "12";
162
- const x = document.createElement("span");
163
- if (x.innerText = c.getAttribute("label") || `Step ${m + 1}`, m === this.currentStep && (n.classList.add("active"), u.setAttribute("color", "primary")), c.hasAttribute("disabled") || (n.addEventListener("click", () => this.gotoStep(m)), n.classList.add("pointer")), n.appendChild(u), n.appendChild(x), s.appendChild(n), m < t.length - 1) {
164
- const h = document.createElement("wje-icon");
165
- h.setAttribute("name", "chevron-right"), h.classList.add("arrow-icon"), h.setAttribute("size", "small"), s.appendChild(h);
166
- }
167
- return c.classList.add("step"), m !== this.currentStep && (c.style.display = "none"), c;
168
- }
169
- }), this.steps.forEach((c) => a.appendChild(c));
170
- const i = document.createElement("div");
171
- i.className = "nav-buttons";
172
- const d = document.createElement("wje-button");
173
- d.setAttribute("label", "Previous"), d.disabled = this.currentStep === 0, d.addEventListener("click", () => this.navigate(-1)), d.innerHTML = "Prev";
174
- const p = document.createElement("wje-button");
175
- return p.setAttribute("label", "Next"), p.disabled = this.currentStep === this.steps.length - 1, p.addEventListener("click", () => this.navigate(1)), p.innerHTML = "Next", i.appendChild(d), i.appendChild(p), r.appendChild(s), r.appendChild(a), r.appendChild(i), e.appendChild(r), e;
176
- }
177
- navigate(e) {
178
- this.gotoStep(this.currentStep + e);
179
- }
180
- gotoStep(e) {
181
- if (e >= 0 && e < this.steps.length) {
182
- e > this.currentStep && (this.completedSteps[this.currentStep] = !0), this.steps[this.currentStep].style.display = "none", this.steps[e].style.display = "block";
183
- const r = this.shadowRoot.querySelectorAll(".step-header");
184
- r[this.currentStep].classList.remove("active"), r[this.currentStep].classList.add("done"), r[e].classList.add("active");
185
- const s = this.shadowRoot.querySelectorAll("wje-badge");
186
- s[this.currentStep].shadowRoot.querySelector("div").classList.remove("wje-color-primary"), this.currentStep = e, s[this.currentStep].shadowRoot.querySelector("div").classList.add("wje-color-primary");
187
- const a = this.shadowRoot.querySelectorAll("wje-button");
188
- a[0].disabled = this.currentStep === 0, a[1].disabled = this.currentStep === this.steps.length - 1, this.updateBadges();
189
- }
190
- }
191
- updateBadges() {
192
- this.shadowRoot.querySelectorAll(".step-header").forEach((r, s) => {
193
- const a = r.querySelector("wje-badge");
194
- if (this.completedSteps[s]) {
195
- if (!a.querySelector("wje-status")) {
196
- a.innerHTML = "";
197
- const t = document.createElement("wje-icon");
198
- t.setAttribute("name", "check"), t.setAttribute("color", "success"), t.setAttribute("size", "medium"), a.shadowRoot.querySelector("div").classList.add("wje-color-success"), a.appendChild(t);
199
- }
200
- } else
201
- a.innerHTML = "12";
202
- });
203
- }
204
- }
205
- w.define("wje-stepper", w);
206
- const R = ".native-timeline{position:relative}.vertical-line{position:absolute;margin-left:calc(var(--wje-spacing-x-large) + 1px);top:0;bottom:0;width:1px;background-color:var(--wje-color-info-3)}";
207
- class b extends g {
208
- constructor() {
209
- super();
210
- /**
211
- * Returns the class name of the tab.
212
- *
213
- * @returns {string} The class name of the tab.
214
- */
215
- f(this, "className", "Timeline");
216
- }
217
- /**
218
- * Returns the CSS styles for the component.
219
- *
220
- * @static
221
- * @returns {CSSStyleSheet}
222
- */
223
- static get cssStyleSheet() {
224
- return R;
225
- }
226
- /**
227
- * Sets up the attributes for the component.
228
- */
229
- setupAttributes() {
230
- this.isShadowRoot = "open";
231
- }
232
- /**
233
- * Draws the component.
234
- *
235
- * @param {Object} context - The context for drawing.
236
- * @param {Object} store - The store for drawing.
237
- * @param {Object} params - The parameters for drawing.
238
- * @returns {DocumentFragment}
239
- */
240
- draw(e, r, s) {
241
- let a = document.createDocumentFragment();
242
- const t = document.createElement("div");
243
- t.setAttribute("part", "native"), t.classList.add("native-timeline");
244
- const i = document.createElement("div");
245
- i.setAttribute("part", "vertical-line"), i.classList.add("vertical-line");
246
- const d = document.createElement("slot");
247
- return t.appendChild(i), t.appendChild(d), a.appendChild(t), a;
248
- }
249
- }
250
- b.define("wje-timeline", b);
251
- function T(o, l) {
252
- let e;
253
- if (typeof o == "string")
254
- e = new Date(o);
255
- else if (typeof o == "number")
256
- e = new Date(o);
257
- else if (o instanceof Date)
258
- e = o;
259
- else
260
- throw new Error("Invalid date input");
261
- const r = {
262
- yyyy: e.getFullYear(),
263
- MM: String(e.getMonth() + 1).padStart(2, "0"),
264
- // Mesiace sú indexované od 0
265
- dd: String(e.getDate()).padStart(2, "0"),
266
- HH: String(e.getHours()).padStart(2, "0"),
267
- mm: String(e.getMinutes()).padStart(2, "0"),
268
- ss: String(e.getSeconds()).padStart(2, "0"),
269
- MMMM: e.toLocaleString("en-US", { month: "long" }),
270
- // Full month name
271
- MMM: e.toLocaleString("en-US", { month: "short" })
272
- // Short month name
273
- };
274
- return l.replace(/yyyy|MM|dd|HH|mm|ss|MMMM|MMM/g, (s) => r[s]);
275
- }
276
- const k = ":host{--wje-card-content-padding: var(--wje-spacing-medium);margin-bottom:.5rem;display:block}.native-timeline-item>wje-icon{color:var(--wje-color-contrast-5)!important}.timeline-items{display:flex;flex-direction:column}.native-timeline-item{display:flex;position:relative;padding:var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-large);gap:var(--wje-spacing-medium);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--wje-border-radius-large)}:host .native-timeline-item:hover{background-color:var(--wje-color-contrast-1);border-color:var(--wje-color-contrast-3)}:host([active]) .native-timeline-item{background-color:var(--wje-color-primary-1);border-color:var(--wje-color-primary-3)}:host([active]) .native-timeline-item:hover{background-color:var(--wje-color-primary-2)}.icon-container{position:absolute;display:flex;width:var(--wje-size-small);height:var(--wje-size-small);padding:var(--wje-spacing-2x-small);border-radius:var(--wje-border-radius-circle);opacity:0}.content-container{height:fit-content;gap:var(--wje-spacing-small)}.event{margin:0;font-size:var(--wje-font-size-large);font-weight:var(--wje-font-weight-bold);line-height:var(--wje-line-height-dense);letter-spacing:var(--wje-spacing-4x-small)}.additional-content{font-size:var(--wje-font-size-medium);margin-top:1rem}wje-status{position:relative;z-index:1}wje-relative-time{display:block;margin-bottom:var(--wje-spacing-2x-small)}";
277
- class S extends g {
278
- constructor() {
279
- super();
280
- /**
281
- * Returns the class name of the tab.
282
- *
283
- * @returns {string} The class name of the tab.
284
- */
285
- f(this, "className", "TimelineItem");
286
- }
287
- /**
288
- * Returns the CSS styles for the component.
289
- *
290
- * @static
291
- * @returns {CSSStyleSheet}
292
- */
293
- static get cssStyleSheet() {
294
- return k;
295
- }
296
- /**
297
- * Sets up the attributes for the component.
298
- */
299
- setupAttributes() {
300
- this.isShadowRoot = "open", this.setAttribute("relative-time", "");
301
- }
302
- /**
303
- * Draws the component.
304
- *
305
- * @param {Object} context - The context for drawing.
306
- * @param {Object} store - The store for drawing.
307
- * @param {Object} params - The parameters for drawing.
308
- * @returns {DocumentFragment}
309
- */
310
- draw(e, r, s) {
311
- let a = document.createDocumentFragment(), t = document.createElement("div");
312
- t.setAttribute("part", "native"), t.classList.add("native-timeline-item");
313
- let i = document.createElement("div");
314
- i.classList.add("content-container");
315
- let d = document.createElement("wje-tooltip");
316
- d.setAttribute("text", this.getAttribute("tooltip") || ""), d.setAttribute("position", "top"), d.setAttribute("content", T(this.datetime, "dd.MM.yyyy HH:mm"));
317
- let p = document.createElement("wje-relative-time");
318
- p.setAttribute("date", this.datetime || ""), p.setAttribute("format", this.getAttribute("format") || ""), d.appendChild(p);
319
- let c = document.createElement("h3");
320
- c.classList.add("event"), c.textContent = this.getAttribute("event") || "";
321
- let m = document.createElement("slot"), n = document.createElement("wje-icon");
322
- return n.setAttribute("name", "circle-dot"), n.setAttribute("filled", ""), n.setAttribute("part", "default-icon"), this.querySelector('[slot="status"]') && (n = document.createElement("slot"), n.setAttribute("name", "status")), i.appendChild(d), i.appendChild(c), i.appendChild(m), t.appendChild(n), t.appendChild(i), a.appendChild(t), a;
323
- }
324
- }
325
- S.define("wje-timeline-item", S);
326
- export {
327
- Q as Accordion,
328
- K as AccordionItem,
329
- Z as Animation,
330
- ee as Aside,
331
- re as Avatar,
332
- oe as Badge,
333
- ie as Breadcrumb,
334
- le as Breadcrumbs,
335
- ce as Button,
336
- me as ButtonGroup,
337
- fe as Card,
338
- ge as CardContent,
339
- ve as CardControls,
340
- be as CardHeader,
341
- je as CardSubtitle,
342
- Ce as CardTitle,
343
- Ee as Carousel,
344
- Me as CarouselItem,
345
- Te as Checkbox,
346
- He as Chip,
347
- De as Col,
348
- Ne as ColorPicker,
349
- qe as Container,
350
- Pe as CopyButton,
351
- Ge as Dialog,
352
- $e as Divider,
353
- We as Dropdown,
354
- Qe as FileUpload,
355
- Ke as FileUploadItem,
356
- Ze as Footer,
357
- et as FormatDigital,
358
- rt as Grid,
359
- ot as Header,
360
- it as Icon,
361
- lt as IconPicker,
362
- ct as Img,
363
- mt as ImgComparer,
364
- ft as InfiniteScroll,
365
- gt as InlineEdit,
366
- vt as Input,
367
- bt as InputFile,
368
- jt as Item,
369
- Ct as Label,
370
- Et as List,
371
- j as Localizer,
372
- Mt as Main,
373
- Tt as Masonry,
374
- Ht as Menu,
375
- Dt as MenuButton,
376
- Nt as MenuItem,
377
- qt as MenuLabel,
378
- Pt as Option,
379
- Gt as Options,
380
- Zr as Popup,
381
- $t as ProgressBar,
382
- Wt as QrCode,
383
- Qt as Radio,
384
- Kt as RadioGroup,
385
- Zt as Rate,
386
- er as RelativeTime,
387
- rr as Reorder,
388
- or as ReorderDropzone,
389
- ir as ReorderHandle,
390
- lr as ReorderItem,
391
- cr as Route,
392
- fr as RouterLink,
393
- gr as RouterOutlet,
394
- mr as Routerx,
395
- vr as Row,
396
- br as Select,
397
- jr as Slider,
398
- Kr as SlidingContainer,
399
- Cr as SplitView,
400
- Er as Status,
401
- v as Step,
402
- w as Stepper,
403
- Mr as Tab,
404
- Tr as TabGroup,
405
- Hr as TabPanel,
406
- Dr as Textarea,
407
- Nr as Thumbnail,
408
- b as Timeline,
409
- S as TimelineItem,
410
- qr as Toast,
411
- Pr as Toggle,
412
- Gr as Toolbar,
413
- $r as ToolbarAction,
414
- Wr as Tooltip,
415
- Qr as VisuallyHidden,
416
- g as WJElement,
417
- V as bindRouterLinks,
418
- P as defaultStoreActions,
419
- q as event,
420
- W as fetchAndParseCSS,
421
- U as store,
422
- $ as withRouterLinks
423
- };