wj-elements 0.1.128 → 0.1.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dark.css +6 -1
- package/dist/{infinite-scroll.element-DcO1E5Es.js → infinite-scroll.element-R3y_ZQj6.js} +42 -14
- package/dist/light.css +5 -0
- package/dist/{list.element-TZXMx1rt.js → list.element-syl98NWS.js} +4 -1
- package/dist/localize.js +4 -3
- package/dist/{popup.element-l8v-dMoK.js → popup.element-C0a1z1y2.js} +191 -78
- package/dist/wje-accordion-item.js +1 -1
- package/dist/wje-animation.js +141 -13
- package/dist/wje-aside.js +1 -1
- package/dist/wje-avatar.js +5 -5
- package/dist/wje-badge.js +1 -1
- package/dist/wje-breadcrumb.js +16 -6
- package/dist/wje-breadcrumbs.js +4 -4
- package/dist/wje-button-group.js +2 -2
- package/dist/wje-button.js +64 -6
- package/dist/wje-card-content.js +1 -1
- package/dist/wje-card-controls.js +1 -1
- package/dist/wje-card-header.js +1 -1
- package/dist/wje-card-subtitle.js +1 -1
- package/dist/wje-card-title.js +1 -1
- package/dist/wje-carousel-item.js +1 -1
- package/dist/wje-carousel.js +1 -1
- package/dist/wje-checkbox.js +14 -11
- package/dist/wje-chip.js +1 -1
- package/dist/wje-col.js +9 -3
- package/dist/wje-color-picker.js +72 -42
- package/dist/wje-container.js +1 -1
- package/dist/wje-copy-button.js +3 -3
- package/dist/wje-dialog.js +89 -0
- package/dist/wje-divider.js +1 -1
- package/dist/wje-dropdown.js +21 -6
- package/dist/wje-element.js +284 -127
- package/dist/wje-fetchAndParseCSS.js +2 -1
- package/dist/wje-file-upload-item.js +5 -2
- package/dist/wje-file-upload.js +57 -13
- package/dist/wje-footer.js +1 -1
- package/dist/wje-form.js +1 -1
- package/dist/wje-format-digital.js +1 -1
- package/dist/wje-grid.js +1 -1
- package/dist/wje-header.js +1 -1
- package/dist/wje-icon-picker.js +6 -3
- package/dist/wje-icon.js +4 -1
- package/dist/wje-img-comparer.js +1 -3
- package/dist/wje-img.js +5 -2
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-input-file.js +4 -1
- package/dist/wje-input.js +9 -4
- package/dist/wje-item.js +34 -3
- package/dist/wje-kanban.js +16 -31
- package/dist/wje-label.js +1 -10
- package/dist/wje-list.js +1 -1
- package/dist/wje-main.js +1 -1
- package/dist/wje-masonry.js +9 -9
- package/dist/wje-master.js +9 -117
- package/dist/wje-menu-button.js +4 -1
- package/dist/wje-menu-item.js +13 -4
- package/dist/wje-menu-label.js +1 -1
- package/dist/wje-menu.js +4 -1
- package/dist/wje-option.js +8 -4
- package/dist/wje-options.js +25 -11
- package/dist/wje-orgchart-group.js +2 -2
- package/dist/wje-orgchart-item.js +7 -4
- package/dist/wje-orgchart.js +1 -1
- package/dist/wje-popup.js +1 -1
- package/dist/wje-progress-bar.js +6 -2
- package/dist/wje-qr-code.js +2 -2
- package/dist/wje-radio-group.js +4 -1
- package/dist/wje-radio.js +1 -1
- package/dist/wje-rate.js +6 -3
- package/dist/wje-relative-time.js +37 -19
- package/dist/wje-reorder.js +73 -10
- package/dist/wje-route.js +1 -1
- package/dist/wje-router-link.js +1 -2
- package/dist/wje-routerx.js +3 -1
- package/dist/wje-row.js +1 -11
- package/dist/wje-select.js +15 -12
- package/dist/wje-slider.js +7 -4
- package/dist/wje-sliding-container.js +125 -49
- package/dist/wje-split-view.js +10 -2
- package/dist/wje-status.js +1 -1
- package/dist/wje-stepper.js +879 -766
- package/dist/wje-store.js +17 -18
- package/dist/wje-tab-group.js +4 -1
- package/dist/wje-tab-panel.js +1 -1
- package/dist/wje-tab.js +4 -1
- package/dist/wje-textarea.js +8 -2
- package/dist/wje-thumbnail.js +1 -9
- package/dist/wje-toast.js +24 -23
- package/dist/wje-toggle.js +7 -1
- package/dist/wje-toolbar-action.js +1 -1
- package/dist/wje-toolbar.js +1 -1
- package/dist/wje-tooltip.js +5 -1
- package/dist/wje-visually-hidden.js +1 -1
- package/package.json +16 -5
package/dist/wje-main.js
CHANGED
|
@@ -45,7 +45,7 @@ class Main extends WJElement {
|
|
|
45
45
|
* @param {Object} params - The parameters for drawing.
|
|
46
46
|
* @returns {DocumentFragment}
|
|
47
47
|
*/
|
|
48
|
-
draw(
|
|
48
|
+
draw() {
|
|
49
49
|
let fragment = document.createDocumentFragment();
|
|
50
50
|
let element = document.createElement("slot");
|
|
51
51
|
fragment.appendChild(element);
|
package/dist/wje-masonry.js
CHANGED
|
@@ -17,7 +17,7 @@ function getColCount(totalWidth, cols, maxColWidth) {
|
|
|
17
17
|
}
|
|
18
18
|
function debounce(cb, ms, id) {
|
|
19
19
|
const existingTimeout = DEBOUNCE_MAP.get(id);
|
|
20
|
-
if (existingTimeout
|
|
20
|
+
if (existingTimeout !== null && existingTimeout !== void 0) window.clearTimeout(existingTimeout);
|
|
21
21
|
DEBOUNCE_MAP.set(id, window.setTimeout(cb, ms));
|
|
22
22
|
}
|
|
23
23
|
function findSmallestColIndex(colHeights) {
|
|
@@ -55,7 +55,7 @@ class Masonry extends WJElement {
|
|
|
55
55
|
* @param {Array} entries - The entries to use.
|
|
56
56
|
*/
|
|
57
57
|
__publicField(this, "onResize", (entries) => {
|
|
58
|
-
const { width } = entries
|
|
58
|
+
const { width } = entries !== null && entries !== void 0 && Array.isArray(entries) && entries.length > 0 ? entries[0].contentRect : { width: this.offsetWidth };
|
|
59
59
|
const colCount = getColCount(width, this.cols, this.maxColWidth);
|
|
60
60
|
if (colCount !== this.columns.length) {
|
|
61
61
|
this.scheduleLayout();
|
|
@@ -65,7 +65,7 @@ class Masonry extends WJElement {
|
|
|
65
65
|
* Lays out the element.
|
|
66
66
|
*/
|
|
67
67
|
__publicField(this, "layout", () => {
|
|
68
|
-
if (this.currentRequestAnimationFrameCallback
|
|
68
|
+
if (this.currentRequestAnimationFrameCallback !== null && this.currentRequestAnimationFrameCallback !== void 0) {
|
|
69
69
|
window.cancelAnimationFrame(this.currentRequestAnimationFrameCallback);
|
|
70
70
|
}
|
|
71
71
|
this.currentRequestAnimationFrameCallback = requestAnimationFrame(() => {
|
|
@@ -113,7 +113,10 @@ class Masonry extends WJElement {
|
|
|
113
113
|
* @param {number} value - The number of columns.
|
|
114
114
|
*/
|
|
115
115
|
set cols(value) {
|
|
116
|
-
this.hasAttribute("cols")
|
|
116
|
+
if (this.hasAttribute("cols"))
|
|
117
|
+
this.setAttribute("cols", value);
|
|
118
|
+
else
|
|
119
|
+
this.setAttribute("cols", "auto");
|
|
117
120
|
}
|
|
118
121
|
/**
|
|
119
122
|
* Getter for the cols property.
|
|
@@ -191,7 +194,7 @@ class Masonry extends WJElement {
|
|
|
191
194
|
beforeDisconnect() {
|
|
192
195
|
this.unsetSlot.removeEventListener("slotchange", this.onSlotChange);
|
|
193
196
|
window.removeEventListener("resize", this.onResize);
|
|
194
|
-
if (this.ro
|
|
197
|
+
if (this.ro !== null && this.ro !== void 0) {
|
|
195
198
|
this.ro.unobserve(this);
|
|
196
199
|
}
|
|
197
200
|
}
|
|
@@ -208,7 +211,7 @@ class Masonry extends WJElement {
|
|
|
208
211
|
* @param {Object} params - The parameters to use.
|
|
209
212
|
* @returns {DocumentFragment} The drawn element.
|
|
210
213
|
*/
|
|
211
|
-
draw(
|
|
214
|
+
draw() {
|
|
212
215
|
let fragment = document.createDocumentFragment();
|
|
213
216
|
let native = document.createElement("div");
|
|
214
217
|
native.setAttribute("id", "unset-items");
|
|
@@ -244,9 +247,6 @@ class Masonry extends WJElement {
|
|
|
244
247
|
if (columns.length === colCount) {
|
|
245
248
|
return;
|
|
246
249
|
}
|
|
247
|
-
for (const column of columns) {
|
|
248
|
-
column.parentNode && column.parentNode.removeChild(column);
|
|
249
|
-
}
|
|
250
250
|
for (let i = 0; i < colCount; i++) {
|
|
251
251
|
const column = document.createElement("div");
|
|
252
252
|
column.classList.add("column");
|
package/dist/wje-master.js
CHANGED
|
@@ -96,9 +96,9 @@ import { default as default84 } from "./wje-toolbar-action.js";
|
|
|
96
96
|
import { default as default85 } from "./wje-tooltip.js";
|
|
97
97
|
import { default as default86 } from "./wje-visually-hidden.js";
|
|
98
98
|
import { default as default87 } from "./wje-sliding-container.js";
|
|
99
|
-
import { L } from "./list.element-
|
|
100
|
-
import { I } from "./infinite-scroll.element-
|
|
101
|
-
import { P } from "./popup.element-
|
|
99
|
+
import { L } from "./list.element-syl98NWS.js";
|
|
100
|
+
import { I } from "./infinite-scroll.element-R3y_ZQj6.js";
|
|
101
|
+
import { P } from "./popup.element-C0a1z1y2.js";
|
|
102
102
|
function formatDate(input, format) {
|
|
103
103
|
let date;
|
|
104
104
|
if (typeof input === "string") {
|
|
@@ -153,7 +153,7 @@ const enGb = {
|
|
|
153
153
|
"wj.stepper.step": "Step"
|
|
154
154
|
};
|
|
155
155
|
Localizer.registerTranslation(enGb);
|
|
156
|
-
const styles$
|
|
156
|
+
const styles$1 = ".native-timeline {\n position: relative;\n}\n\n.vertical-line {\n position: absolute;\n margin-left: calc(var(--wje-spacing-x-large) + 1px);\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: var(--wje-color-info-3);\n}\n\n\n";
|
|
157
157
|
class Timeline extends WJElement {
|
|
158
158
|
constructor() {
|
|
159
159
|
super();
|
|
@@ -171,7 +171,7 @@ class Timeline extends WJElement {
|
|
|
171
171
|
* @returns {CSSStyleSheet}
|
|
172
172
|
*/
|
|
173
173
|
static get cssStyleSheet() {
|
|
174
|
-
return styles$
|
|
174
|
+
return styles$1;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Sets up the attributes for the component.
|
|
@@ -187,7 +187,7 @@ class Timeline extends WJElement {
|
|
|
187
187
|
* @param {Object} params - The parameters for drawing.
|
|
188
188
|
* @returns {DocumentFragment}
|
|
189
189
|
*/
|
|
190
|
-
draw(
|
|
190
|
+
draw() {
|
|
191
191
|
let fragment = document.createDocumentFragment();
|
|
192
192
|
const native = document.createElement("div");
|
|
193
193
|
native.setAttribute("part", "native");
|
|
@@ -203,7 +203,7 @@ class Timeline extends WJElement {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
Timeline.define("wje-timeline", Timeline);
|
|
206
|
-
const styles
|
|
206
|
+
const styles = ":host {\n --wje-card-content-padding: var(--wje-spacing-medium);\n margin-bottom: .5rem;\n display: block;\n}\n\n.native-timeline-item > wje-icon {\n color: var(--wje-color-contrast-5) !important;\n}\n\n.timeline-items {\n display: flex;\n flex-direction: column;\n}\n\n.native-timeline-item {\n display: flex;\n position: relative;\n padding: var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-large);\n gap: var(--wje-spacing-medium);\n border-width: 1px;\n border-style: solid;\n border-color: transparent;\n border-radius: var(--wje-border-radius-large);\n}\n\n:host .native-timeline-item:hover {\n background-color: var(--wje-color-contrast-1);\n border-color: var(--wje-color-contrast-3);\n}\n\n:host([active]) .native-timeline-item {\n background-color: var(--wje-color-primary-1);\n border-color: var(--wje-color-primary-3);\n}\n\n:host([active]) .native-timeline-item:hover {\n background-color: var(--wje-color-primary-2);\n}\n\n.icon-container {\n position: absolute;\n display: flex;\n width: var(--wje-size-small); \n height: var(--wje-size-small); \n padding: var(--wje-spacing-2x-small);\n border-radius: var(--wje-border-radius-circle); \n opacity: 0;\n}\n\n.content-container {\n height: fit-content;\n gap: var(--wje-spacing-small);\n}\n\n.event {\n margin: 0;\n font-size: var(--wje-font-size-large);\n font-weight: var(--wje-font-weight-bold);\n line-height: var(--wje-line-height-dense);\n letter-spacing: var(--wje-spacing-4x-small);\n}\n\n.additional-content {\n font-size: var(--wje-font-size-medium);\n margin-top: 1rem;\n}\n\nwje-status {\n position: relative;\n z-index: 1;\n}\n\nwje-relative-time {\n display: block;\n margin-bottom: var(--wje-spacing-2x-small);\n}";
|
|
207
207
|
class TimelineItem extends WJElement {
|
|
208
208
|
constructor() {
|
|
209
209
|
super();
|
|
@@ -221,7 +221,7 @@ class TimelineItem extends WJElement {
|
|
|
221
221
|
* @returns {CSSStyleSheet}
|
|
222
222
|
*/
|
|
223
223
|
static get cssStyleSheet() {
|
|
224
|
-
return styles
|
|
224
|
+
return styles;
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
227
|
* Sets up the attributes for the component.
|
|
@@ -238,7 +238,7 @@ class TimelineItem extends WJElement {
|
|
|
238
238
|
* @param {Object} params - The parameters for drawing.
|
|
239
239
|
* @returns {DocumentFragment}
|
|
240
240
|
*/
|
|
241
|
-
draw(
|
|
241
|
+
draw() {
|
|
242
242
|
let fragment = document.createDocumentFragment();
|
|
243
243
|
let native = document.createElement("div");
|
|
244
244
|
native.setAttribute("part", "native");
|
|
@@ -276,113 +276,6 @@ class TimelineItem extends WJElement {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
TimelineItem.define("wje-timeline-item", TimelineItem);
|
|
279
|
-
const styles = '/*\n[ WJ Toast ]\n*/\n\n:host {\n position: fixed;\n z-index: 9999;\n width: 300px;\n}\n\n.native-toast {\n display: flex;\n align-items: center;\n padding: 1rem;\n overflow: hidden;\n margin: 0;\n border-width: 1px;\n border-style: solid;\n border-radius: var(--wje-border-radius-large);\n\n slot[name="avatar"]::slotted(wje-avatar) {\n margin-right: .5rem;\n }\n\n .content {\n font-size: var(--wje-font-size-small);\n .title {\n font-size: var(--wje-font-size);\n font-weight: var(--wje-font-weight-bold);\n }\n }\n\n wje-button {\n --wje-button-margin-inline: auto 0;\n margin-left: auto !important;\n }\n}\n\n:host([position=top]) {\n animation: slideDown .3s ease-out forwards;\n top: 1rem;\n left: auto;\n right: auto;\n}\n\n:host([position=bottom]) {\n animation: slideUp .3s ease-out forwards;\n bottom: 1rem;\n left: auto;\n right: auto;\n}\n\n:host([position=top-start]) {\n animation: slideStart .3s ease-out forwards;\n top: 1rem;\n left: 1rem;\n right: auto;\n}\n\n:host([position=top-end]) {\n animation: slideEnd .3s ease-out forwards;\n top: 1rem;\n left: auto;\n right: 1rem;\n}\n\n:host([position=bottom-start]) {\n animation: slideStart .3s ease-out forwards;\n bottom: 1rem;\n left: 1rem;\n right: auto;\n}\n\n:host([position=bottom-end]) {\n animation: slideEnd .3s ease-out forwards;\n bottom: 1rem;\n left: auto;\n right: 1rem;\n}\n\n@keyframes slideDown {\n 0% {\n transform: translateY(-100%);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes slideUp {\n 0% {\n transform: translateY(100%);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes slideStart {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes slideEnd {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n/*PRIMARY*/\n:host([type=primary]) .native-toast {\n background-color: var(--wje-color-primary-1);\n color: var(--wje-color-primary-9);\n border-color: var(--wje-color-primary-3);\n}\n\n/*COMPLETE*/\n:host([type=complete]) .native-toast {\n background-color: var(--wje-color-complete-1);\n color: var(--wje-color-complete-9);\n border-color: var(--wje-color-complete-3);\n}\n\n/*SUCCESS*/\n:host([type=success]) .native-toast {\n background-color: var(--wje-color-success-1);\n color: var(--wje-color-success-9);\n border-color: var(--wje-color-success-3);\n}\n\n/*WARNING*/\n:host([type=warning]) .native-toast{\n background-color: var(--wje-color-warning-1);\n color: var(--wje-color-warning-11);\n border-color: var(--wje-color-warning-3);\n}\n\n/*DANGER*/\n:host([type=danger]) .native-toast {\n background-color: var(--wje-color-danger-1);\n color: var(--wje-color-danger-9);\n border-color: var(--wje-color-danger-3);\n}\n\n/*INFO*/\n:host([type=info]) .native-toast {\n background-color: var(--wje-color-info-1);\n color: var(--wje-color-info-11);\n border-color: var(--wje-color-info-4);\n}\n\n/*CONTRAST*/\n:host([type=contrast]) .native-toast {\n background-color: var(--wje-color-contrast-2);\n color: var(--wje-color-primary-9);\n border-color: var(--wje-color-contrast-3);\n}';
|
|
280
|
-
class ToastItem extends WJElement {
|
|
281
|
-
/**
|
|
282
|
-
* Toast constructor
|
|
283
|
-
* @constructor
|
|
284
|
-
*/
|
|
285
|
-
constructor() {
|
|
286
|
-
super();
|
|
287
|
-
/**
|
|
288
|
-
* Class name
|
|
289
|
-
* @type {string}
|
|
290
|
-
*/
|
|
291
|
-
__publicField(this, "className", "ToastItem");
|
|
292
|
-
__publicField(this, "removeToast", () => {
|
|
293
|
-
clearTimeout(this.timeout);
|
|
294
|
-
this.remove();
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
set duration(value) {
|
|
298
|
-
this.setAttribute("duration", value);
|
|
299
|
-
}
|
|
300
|
-
get duration() {
|
|
301
|
-
return +this.getAttribute("duration");
|
|
302
|
-
}
|
|
303
|
-
set position(value) {
|
|
304
|
-
this.setAttribute("position", value);
|
|
305
|
-
}
|
|
306
|
-
get position() {
|
|
307
|
-
return this.getAttribute("position");
|
|
308
|
-
}
|
|
309
|
-
set type(value) {
|
|
310
|
-
this.setAttribute("type", value);
|
|
311
|
-
}
|
|
312
|
-
get type() {
|
|
313
|
-
return this.getAttribute("type");
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Get CSS stylesheet
|
|
317
|
-
* @static
|
|
318
|
-
* @returns {Object} styles
|
|
319
|
-
*/
|
|
320
|
-
static get cssStyleSheet() {
|
|
321
|
-
return styles;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Returns the list of attributes to observe for changes.
|
|
325
|
-
*
|
|
326
|
-
* @static
|
|
327
|
-
* @returns {Array<string>}
|
|
328
|
-
*/
|
|
329
|
-
static get observedAttributes() {
|
|
330
|
-
return ["position", "type", "duration"];
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Setup attributes
|
|
334
|
-
*/
|
|
335
|
-
setupAttributes() {
|
|
336
|
-
this.isShadowRoot = "open";
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Draw method
|
|
340
|
-
* @param {Object} context - The context
|
|
341
|
-
* @param {Object} store - The store
|
|
342
|
-
* @param {Object} params - The parameters
|
|
343
|
-
* @returns {Object} Document fragment
|
|
344
|
-
*/
|
|
345
|
-
draw(context, store2, params) {
|
|
346
|
-
let fragment = document.createDocumentFragment();
|
|
347
|
-
let native = document.createElement("div");
|
|
348
|
-
native.setAttribute("part", "native");
|
|
349
|
-
native.classList.add("native-toast");
|
|
350
|
-
let avatarSlot = document.createElement("slot");
|
|
351
|
-
avatarSlot.setAttribute("name", "avatar");
|
|
352
|
-
avatarSlot.classList.add("avatar");
|
|
353
|
-
let content = document.createElement("div");
|
|
354
|
-
content.classList.add("content");
|
|
355
|
-
content.innerHTML = `<div class="title">${this.title}</div><div class="message"><slot></slot></div>`;
|
|
356
|
-
let icon = document.createElement("wje-icon");
|
|
357
|
-
icon.setAttribute("name", "x");
|
|
358
|
-
let closeBtn = document.createElement("wje-button");
|
|
359
|
-
closeBtn.setAttribute("fill", "link");
|
|
360
|
-
closeBtn.setAttribute("color", this.type);
|
|
361
|
-
closeBtn.setAttribute("size", "small");
|
|
362
|
-
closeBtn.classList.add("close");
|
|
363
|
-
closeBtn.appendChild(icon);
|
|
364
|
-
native.appendChild(avatarSlot);
|
|
365
|
-
native.appendChild(content);
|
|
366
|
-
if (this.hasAttribute("close"))
|
|
367
|
-
native.appendChild(closeBtn);
|
|
368
|
-
fragment.appendChild(native);
|
|
369
|
-
this.closeBtn = closeBtn;
|
|
370
|
-
return fragment;
|
|
371
|
-
}
|
|
372
|
-
afterDraw() {
|
|
373
|
-
this.closeBtn.addEventListener("wje-button:click", this.removeToast);
|
|
374
|
-
if (this.duration > 0) {
|
|
375
|
-
this.timeout = setTimeout(() => {
|
|
376
|
-
this.removeToast();
|
|
377
|
-
}, this.duration);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
beforeDisconnect() {
|
|
381
|
-
this.closeBtn.removeEventListener("wje-button:click", this.removeToast);
|
|
382
|
-
clearTimeout(this.timeout);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
ToastItem.define("wje-toast-item", ToastItem);
|
|
386
279
|
export {
|
|
387
280
|
default2 as Accordion,
|
|
388
281
|
default3 as AccordionItem,
|
|
@@ -471,7 +364,6 @@ export {
|
|
|
471
364
|
Timeline,
|
|
472
365
|
TimelineItem,
|
|
473
366
|
default81 as Toast,
|
|
474
|
-
ToastItem,
|
|
475
367
|
default82 as Toggle,
|
|
476
368
|
default83 as Toolbar,
|
|
477
369
|
default84 as ToolbarAction,
|
package/dist/wje-menu-button.js
CHANGED
|
@@ -45,7 +45,7 @@ class MenuButton extends WJElement {
|
|
|
45
45
|
* @param {Object} params - The parameters for drawing.
|
|
46
46
|
* @returns {DocumentFragment}
|
|
47
47
|
*/
|
|
48
|
-
draw(
|
|
48
|
+
draw() {
|
|
49
49
|
let fragment = document.createDocumentFragment();
|
|
50
50
|
let slot = document.createElement("slot");
|
|
51
51
|
fragment.appendChild(slot);
|
|
@@ -54,6 +54,9 @@ class MenuButton extends WJElement {
|
|
|
54
54
|
/**
|
|
55
55
|
* Refreshes the component after drawing.
|
|
56
56
|
* Adds a click event listener that toggles the "open" class on the content element.
|
|
57
|
+
* @params {Object} context - The context for drawing.
|
|
58
|
+
* @params {Object} store - The store for drawing.
|
|
59
|
+
* @params {Object} params - The parameters for drawing.
|
|
57
60
|
*/
|
|
58
61
|
afterDraw() {
|
|
59
62
|
event.addListener(this, "click", null, (e) => {
|
package/dist/wje-menu-item.js
CHANGED
|
@@ -151,7 +151,7 @@ class MenuItem extends WJElement {
|
|
|
151
151
|
/**
|
|
152
152
|
* Removes the active attribute from the menu before drawing the MenuItem.
|
|
153
153
|
*/
|
|
154
|
-
beforeDraw(
|
|
154
|
+
beforeDraw() {
|
|
155
155
|
var _a;
|
|
156
156
|
(_a = this.querySelector("wje-menu")) == null ? void 0 : _a.removeAttribute("active");
|
|
157
157
|
}
|
|
@@ -163,7 +163,7 @@ class MenuItem extends WJElement {
|
|
|
163
163
|
* @param {Object} params - The parameters for drawing.
|
|
164
164
|
* @returns {DocumentFragment} The fragment to be appended to the MenuItem.
|
|
165
165
|
*/
|
|
166
|
-
draw(
|
|
166
|
+
draw() {
|
|
167
167
|
var _a, _b, _c;
|
|
168
168
|
this.hasSubmenu = WjElementUtils.hasSlot(this, "submenu");
|
|
169
169
|
let fragment = document.createDocumentFragment();
|
|
@@ -188,7 +188,10 @@ class MenuItem extends WJElement {
|
|
|
188
188
|
checkedIcon.setAttribute("part", "check");
|
|
189
189
|
checkedIcon.classList.add("check-icon");
|
|
190
190
|
checkedIcon.innerHTML = `<wje-icon name="check"></wje-icon>`;
|
|
191
|
-
this.hasAttribute("checked")
|
|
191
|
+
if (this.hasAttribute("checked"))
|
|
192
|
+
checkedIcon.classList.add("checked");
|
|
193
|
+
else
|
|
194
|
+
checkedIcon.classList.remove("checked");
|
|
192
195
|
let start = document.createElement("slot");
|
|
193
196
|
start.name = "start";
|
|
194
197
|
let slot = document.createElement("slot");
|
|
@@ -204,7 +207,10 @@ class MenuItem extends WJElement {
|
|
|
204
207
|
submenuIcon.setAttribute("part", "submenu-icon");
|
|
205
208
|
submenuIcon.classList.add("submenu-icon", submenuIconClass);
|
|
206
209
|
submenuIcon.innerHTML = this.collapse ? `<wje-icon name="chevron-down"></wje-icon>` : `<wje-icon name="chevron-right"></wje-icon>`;
|
|
207
|
-
this.hasSubmenu
|
|
210
|
+
if (this.hasSubmenu)
|
|
211
|
+
native.classList.add("has-submenu");
|
|
212
|
+
else
|
|
213
|
+
native.classList.remove("has-submenu");
|
|
208
214
|
native.appendChild(checkedIcon);
|
|
209
215
|
native.appendChild(start);
|
|
210
216
|
native.appendChild(slot);
|
|
@@ -240,6 +246,9 @@ class MenuItem extends WJElement {
|
|
|
240
246
|
}
|
|
241
247
|
/**
|
|
242
248
|
* Adds event listeners after drawing the MenuItem.
|
|
249
|
+
* @params {Object} context - The context for drawing.
|
|
250
|
+
* @params {Object} store - The store for drawing.
|
|
251
|
+
* @params {Object} params - The parameters
|
|
243
252
|
*/
|
|
244
253
|
afterDraw() {
|
|
245
254
|
this.addEventListener("mousemove", this.dispatchMove);
|
package/dist/wje-menu-label.js
CHANGED
|
@@ -46,7 +46,7 @@ class MenuLabel extends WJElement {
|
|
|
46
46
|
* @param {Object} params - The parameters for drawing.
|
|
47
47
|
* @returns {DocumentFragment}
|
|
48
48
|
*/
|
|
49
|
-
draw(
|
|
49
|
+
draw() {
|
|
50
50
|
let fragment = document.createDocumentFragment();
|
|
51
51
|
let slot = document.createElement("slot");
|
|
52
52
|
slot.setAttribute("part", "native");
|
package/dist/wje-menu.js
CHANGED
|
@@ -45,7 +45,7 @@ class Menu extends WJElement {
|
|
|
45
45
|
* @param {Object} params - The parameters for drawing.
|
|
46
46
|
* @returns {DocumentFragment}
|
|
47
47
|
*/
|
|
48
|
-
draw(
|
|
48
|
+
draw() {
|
|
49
49
|
let fragment = document.createDocumentFragment();
|
|
50
50
|
this.classList.remove("wje-menu-collapse");
|
|
51
51
|
if (this.hasAttribute("collapse"))
|
|
@@ -60,6 +60,9 @@ class Menu extends WJElement {
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Refreshes the component after drawing.
|
|
63
|
+
* @params {Object} context - The context for drawing.
|
|
64
|
+
* @params {Object} store - The store for drawing.
|
|
65
|
+
* @params {Object} params - The parameters
|
|
63
66
|
*/
|
|
64
67
|
afterDraw() {
|
|
65
68
|
Array.from(this.children).forEach((child) => {
|
package/dist/wje-option.js
CHANGED
|
@@ -22,15 +22,16 @@ class Option extends WJElement {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Sets the selected attribute of the option.
|
|
25
|
-
*
|
|
26
25
|
* @param {boolean} value - The value to set.
|
|
27
26
|
*/
|
|
28
27
|
set selected(value) {
|
|
29
|
-
|
|
28
|
+
if (value)
|
|
29
|
+
this.setAttribute("selected", "");
|
|
30
|
+
else
|
|
31
|
+
this.removeAttribute("selected");
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* Sets the value attribute of the option.
|
|
33
|
-
*
|
|
34
35
|
* @param {string} value - The value to set.
|
|
35
36
|
*/
|
|
36
37
|
set value(value) {
|
|
@@ -76,7 +77,7 @@ class Option extends WJElement {
|
|
|
76
77
|
* @param {Object} params - The parameters for drawing.
|
|
77
78
|
* @returns {DocumentFragment}
|
|
78
79
|
*/
|
|
79
|
-
draw(
|
|
80
|
+
draw() {
|
|
80
81
|
let fragment = document.createDocumentFragment();
|
|
81
82
|
let element = document.createElement("div");
|
|
82
83
|
element.classList.add("native-option");
|
|
@@ -97,6 +98,9 @@ class Option extends WJElement {
|
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
100
|
* Adds event listeners after the component is drawn.
|
|
101
|
+
* @params {Object} context - The context for drawing.
|
|
102
|
+
* @params {Object} store - The store for drawing.
|
|
103
|
+
* @params {Object} params - The parameters for drawing.
|
|
100
104
|
*/
|
|
101
105
|
afterDraw() {
|
|
102
106
|
event.addListener(this, "click", null, (e, b, c) => {
|
package/dist/wje-options.js
CHANGED
|
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement, { event } from "./wje-element.js";
|
|
5
|
-
import { I as InfiniteScroll } from "./infinite-scroll.element-
|
|
6
|
-
import { L as List } from "./list.element-
|
|
5
|
+
import { I as InfiniteScroll } from "./infinite-scroll.element-R3y_ZQj6.js";
|
|
6
|
+
import { L as List } from "./list.element-syl98NWS.js";
|
|
7
7
|
import Option from "./wje-option.js";
|
|
8
8
|
class Options extends WJElement {
|
|
9
9
|
/**
|
|
@@ -27,10 +27,10 @@ class Options extends WJElement {
|
|
|
27
27
|
*/
|
|
28
28
|
__publicField(this, "htmlItem", (item) => {
|
|
29
29
|
let option = document.createElement("wje-option");
|
|
30
|
-
if (item[this.itemValue]
|
|
30
|
+
if (item[this.itemValue] === null || item[this.itemValue] === void 0) {
|
|
31
31
|
console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemValue}`);
|
|
32
32
|
}
|
|
33
|
-
if (item[this.itemText]
|
|
33
|
+
if (item[this.itemText] === null || item[this.itemText] === void 0) {
|
|
34
34
|
console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemText}`);
|
|
35
35
|
}
|
|
36
36
|
option.setAttribute("value", item[this.itemValue] ?? "");
|
|
@@ -121,9 +121,17 @@ class Options extends WJElement {
|
|
|
121
121
|
* Prepares the component before drawing.
|
|
122
122
|
* Fetches the pages and creates the options elements.
|
|
123
123
|
*/
|
|
124
|
-
|
|
124
|
+
beforeDraw() {
|
|
125
125
|
event.dispatchCustomEvent(this, "wje-options:load", {});
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Draws the component.
|
|
129
|
+
*
|
|
130
|
+
* @param {Object} context - The context for drawing.
|
|
131
|
+
* @param {Object} store - The store for drawing.
|
|
132
|
+
* @param {Object} params - The parameters for drawing.
|
|
133
|
+
* @returns {DocumentFragment}
|
|
134
|
+
*/
|
|
127
135
|
async draw() {
|
|
128
136
|
let fragment = document.createDocumentFragment();
|
|
129
137
|
const slot = document.createElement("slot");
|
|
@@ -141,7 +149,6 @@ class Options extends WJElement {
|
|
|
141
149
|
this._loadedOptions.push(...this.processData(filteredOptions));
|
|
142
150
|
return filteredOptions;
|
|
143
151
|
};
|
|
144
|
-
this.contains(infiniteScroll) || this.appendChild(infiniteScroll);
|
|
145
152
|
this.infiniteScroll = infiniteScroll;
|
|
146
153
|
} else {
|
|
147
154
|
this.response = await this.getPages();
|
|
@@ -180,13 +187,17 @@ class Options extends WJElement {
|
|
|
180
187
|
let filteredResponse = structuredClone(response);
|
|
181
188
|
const recursiveUpdate = (object, pathToProperty) => {
|
|
182
189
|
var _a2;
|
|
190
|
+
if (pathToProperty.length === 0) {
|
|
191
|
+
return object.filter((option) => !this._loadedOptions.some((loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]));
|
|
192
|
+
}
|
|
183
193
|
if (pathToProperty.length > 1) {
|
|
184
|
-
recursiveUpdate(object[pathToProperty[0]], pathToProperty.slice(1));
|
|
185
|
-
|
|
186
|
-
object[pathToProperty[0]] = ((_a2 = object[pathToProperty[0]]) == null ? void 0 : _a2.filter((option) => !this._loadedOptions.some((loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]))) ?? [];
|
|
194
|
+
object[pathToProperty[0]] = recursiveUpdate(object[pathToProperty[0]], pathToProperty.slice(1));
|
|
195
|
+
return object;
|
|
187
196
|
}
|
|
197
|
+
object[pathToProperty[0]] = ((_a2 = object[pathToProperty[0]]) == null ? void 0 : _a2.filter((option) => !this._loadedOptions.some((loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]))) ?? [];
|
|
198
|
+
return object;
|
|
188
199
|
};
|
|
189
|
-
recursiveUpdate(filteredResponse, splittedOptionArrayPath);
|
|
200
|
+
filteredResponse = recursiveUpdate(filteredResponse, splittedOptionArrayPath);
|
|
190
201
|
return filteredResponse;
|
|
191
202
|
}
|
|
192
203
|
/**
|
|
@@ -232,7 +243,10 @@ class Options extends WJElement {
|
|
|
232
243
|
* @param {boolean} [silent=false] - Whether to suppress events triggered by adding options.
|
|
233
244
|
*/
|
|
234
245
|
addOptions(optionsData = [], silent = false) {
|
|
235
|
-
Array.isArray(optionsData)
|
|
246
|
+
if (Array.isArray(optionsData))
|
|
247
|
+
optionsData == null ? void 0 : optionsData.forEach((od) => this.addOption(od, silent));
|
|
248
|
+
else
|
|
249
|
+
this.addOption(optionsData, silent);
|
|
236
250
|
}
|
|
237
251
|
}
|
|
238
252
|
Options.define("wje-options", Options);
|
|
@@ -36,7 +36,7 @@ class OrgchartGroup extends WJElement {
|
|
|
36
36
|
* @param {Object} params - The parameters for drawing.
|
|
37
37
|
* @returns {DocumentFragment}
|
|
38
38
|
*/
|
|
39
|
-
draw(
|
|
39
|
+
draw() {
|
|
40
40
|
let fragment = document.createDocumentFragment();
|
|
41
41
|
let native = document.createElement("div");
|
|
42
42
|
native.setAttribute("part", "native");
|
|
@@ -65,7 +65,7 @@ class OrgchartGroup extends WJElement {
|
|
|
65
65
|
* @param {Object} params - The parameters for drawing.
|
|
66
66
|
* @returns {DocumentFragment}
|
|
67
67
|
*/
|
|
68
|
-
afterDraw(
|
|
68
|
+
afterDraw() {
|
|
69
69
|
this.card.addEventListener("click", (e) => {
|
|
70
70
|
e.stopPropagation();
|
|
71
71
|
event.dispatchCustomEvent(this.card, "wje-orgchart-group:click", { target: this });
|
|
@@ -152,7 +152,10 @@ class OrgchartItem extends WJElement {
|
|
|
152
152
|
*/
|
|
153
153
|
__publicField(this, "toggleChildren", (e) => {
|
|
154
154
|
this.classList.toggle("collapse");
|
|
155
|
-
this.classList.contains("collapse")
|
|
155
|
+
if (this.classList.contains("collapse"))
|
|
156
|
+
e.target.innerHTML = "+";
|
|
157
|
+
else
|
|
158
|
+
e.target.innerHTML = "-";
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
161
|
/**
|
|
@@ -198,7 +201,7 @@ class OrgchartItem extends WJElement {
|
|
|
198
201
|
* @param {Object} params - The parameters for drawing.
|
|
199
202
|
* @returns {DocumentFragment}
|
|
200
203
|
*/
|
|
201
|
-
draw(
|
|
204
|
+
draw() {
|
|
202
205
|
let fragment = document.createDocumentFragment();
|
|
203
206
|
let native = document.createElement("div");
|
|
204
207
|
native.setAttribute("part", "native");
|
|
@@ -227,10 +230,10 @@ class OrgchartItem extends WJElement {
|
|
|
227
230
|
* @param {Object} params - The parameters for drawing.
|
|
228
231
|
* @returns {DocumentFragment}
|
|
229
232
|
*/
|
|
230
|
-
afterDraw(
|
|
233
|
+
afterDraw() {
|
|
231
234
|
this.expander.addEventListener("click", this.toggleChildren);
|
|
232
235
|
}
|
|
233
|
-
dispatchEvent(
|
|
236
|
+
dispatchEvent(e) {
|
|
234
237
|
return false;
|
|
235
238
|
}
|
|
236
239
|
}
|
package/dist/wje-orgchart.js
CHANGED
|
@@ -36,7 +36,7 @@ class Orgchart extends WJElement {
|
|
|
36
36
|
* @param {Object} params - The parameters for drawing.
|
|
37
37
|
* @returns {DocumentFragment}
|
|
38
38
|
*/
|
|
39
|
-
draw(
|
|
39
|
+
draw() {
|
|
40
40
|
let fragment = document.createDocumentFragment();
|
|
41
41
|
let native = document.createElement("div");
|
|
42
42
|
native.setAttribute("part", "native");
|
package/dist/wje-popup.js
CHANGED
package/dist/wje-progress-bar.js
CHANGED
|
@@ -183,7 +183,7 @@ class ProgressBar extends WJElement {
|
|
|
183
183
|
/**
|
|
184
184
|
* Adds event listeners after the component is drawn.
|
|
185
185
|
*/
|
|
186
|
-
afterDraw(
|
|
186
|
+
afterDraw() {
|
|
187
187
|
if (this.type === "circle") {
|
|
188
188
|
this.setCircleProgress(this.progress);
|
|
189
189
|
}
|
|
@@ -204,9 +204,13 @@ class ProgressBar extends WJElement {
|
|
|
204
204
|
* @param {number} radius - The radius of the circle.
|
|
205
205
|
* @returns {number} The dashoffset value.
|
|
206
206
|
*/
|
|
207
|
-
getCircleDashoffset(progress = 0, radius) {
|
|
207
|
+
getCircleDashoffset(progress = 0, radius = 70) {
|
|
208
208
|
return this.getCircleDasharray(radius) * ((100 - progress) / 100);
|
|
209
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Sets the progress of the circle.
|
|
212
|
+
* @param percent
|
|
213
|
+
*/
|
|
210
214
|
setCircleProgress(percent) {
|
|
211
215
|
const progress = this.bar;
|
|
212
216
|
const radius = progress.r.baseVal.value;
|
package/dist/wje-qr-code.js
CHANGED
|
@@ -2818,7 +2818,7 @@ class QrCode extends WJElement {
|
|
|
2818
2818
|
"size"
|
|
2819
2819
|
];
|
|
2820
2820
|
}
|
|
2821
|
-
draw(
|
|
2821
|
+
draw() {
|
|
2822
2822
|
let fragment = document.createDocumentFragment();
|
|
2823
2823
|
let wrapper = document.createElement("div");
|
|
2824
2824
|
wrapper.classList.add("container");
|
|
@@ -2835,7 +2835,7 @@ class QrCode extends WJElement {
|
|
|
2835
2835
|
fragment.appendChild(wrapper);
|
|
2836
2836
|
return fragment;
|
|
2837
2837
|
}
|
|
2838
|
-
afterDraw(
|
|
2838
|
+
afterDraw() {
|
|
2839
2839
|
const canvas = this.shadowRoot.querySelector("canvas");
|
|
2840
2840
|
const qrOptions = {};
|
|
2841
2841
|
const attributes = [
|
package/dist/wje-radio-group.js
CHANGED
|
@@ -116,7 +116,7 @@ class RadioGroup extends WJElement {
|
|
|
116
116
|
* @param {Object} params - The parameters for drawing.
|
|
117
117
|
* @returns {DocumentFragment}
|
|
118
118
|
*/
|
|
119
|
-
draw(
|
|
119
|
+
draw() {
|
|
120
120
|
let fragment = document.createDocumentFragment();
|
|
121
121
|
let native = document.createElement("div");
|
|
122
122
|
native.classList.add("native-radio-group", this.hasAttribute("inline") ? "wje-inline" : "ddd");
|
|
@@ -135,6 +135,9 @@ class RadioGroup extends WJElement {
|
|
|
135
135
|
/**
|
|
136
136
|
* Adds event listeners after the component is drawn.
|
|
137
137
|
* Handles the selection of radio buttons.
|
|
138
|
+
* @params {Object} context - The context for drawing.
|
|
139
|
+
* @params {Object} store - The store for drawing.
|
|
140
|
+
* @params {Object} params - The parameters for drawing.
|
|
138
141
|
*/
|
|
139
142
|
afterDraw() {
|
|
140
143
|
this.checkRadio(this.value);
|
package/dist/wje-radio.js
CHANGED
|
@@ -31,7 +31,7 @@ class Radio extends WJElement {
|
|
|
31
31
|
setupAttributes() {
|
|
32
32
|
this.isShadowRoot = "open";
|
|
33
33
|
}
|
|
34
|
-
draw(
|
|
34
|
+
draw() {
|
|
35
35
|
let fragment = document.createDocumentFragment();
|
|
36
36
|
let native = document.createElement("div");
|
|
37
37
|
native.classList.add("native-radio");
|