wj-elements 0.1.127 → 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-DEQ-AqTB.js → infinite-scroll.element-R3y_ZQj6.js} +43 -18
- package/dist/light.css +5 -0
- package/dist/{list.element-BkOOqBtW.js → list.element-syl98NWS.js} +5 -5
- package/dist/localize.js +4 -3
- package/dist/{popup.element-DvPGL_NN.js → popup.element-C0a1z1y2.js} +195 -88
- package/dist/{router-links-F7MJWhZi.js → router-links-I2vcmVCs.js} +8 -16
- package/dist/wje-accordion-item.js +2 -5
- package/dist/wje-accordion.js +1 -4
- package/dist/wje-animation.js +142 -17
- package/dist/wje-aside.js +2 -5
- package/dist/wje-avatar.js +6 -9
- package/dist/wje-badge.js +2 -5
- package/dist/wje-breadcrumb.js +17 -10
- package/dist/wje-breadcrumbs.js +5 -8
- package/dist/wje-button-group.js +3 -6
- package/dist/wje-button.js +65 -10
- package/dist/wje-card-content.js +2 -5
- package/dist/wje-card-controls.js +2 -5
- package/dist/wje-card-header.js +2 -5
- package/dist/wje-card-subtitle.js +2 -5
- package/dist/wje-card-title.js +2 -5
- package/dist/wje-card.js +1 -4
- package/dist/wje-carousel-item.js +2 -5
- package/dist/wje-carousel.js +2 -5
- package/dist/wje-checkbox.js +15 -15
- package/dist/wje-chip.js +2 -5
- package/dist/wje-col.js +10 -7
- package/dist/wje-color-picker.js +90 -80
- package/dist/wje-container.js +2 -5
- package/dist/wje-copy-button.js +4 -7
- package/dist/wje-dialog.js +90 -4
- package/dist/wje-divider.js +2 -5
- package/dist/wje-dropdown.js +22 -10
- package/dist/wje-element.js +355 -158
- package/dist/wje-fetchAndParseCSS.js +2 -1
- package/dist/wje-file-upload-item.js +8 -7
- package/dist/wje-file-upload.js +58 -17
- package/dist/wje-footer.js +2 -5
- package/dist/wje-form.js +2 -5
- package/dist/wje-format-digital.js +3 -7
- package/dist/wje-grid.js +2 -5
- package/dist/wje-header.js +2 -5
- package/dist/wje-icon-picker.js +18 -7
- package/dist/wje-icon.js +5 -5
- package/dist/wje-img-comparer.js +2 -7
- package/dist/wje-img.js +14 -6
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-input-file.js +5 -5
- package/dist/wje-input.js +13 -7
- package/dist/wje-item.js +35 -7
- package/dist/wje-kanban.js +18 -37
- package/dist/wje-label.js +2 -14
- package/dist/wje-list.js +1 -1
- package/dist/wje-main.js +2 -5
- package/dist/wje-masonry.js +10 -14
- package/dist/wje-master.js +11 -122
- package/dist/wje-menu-button.js +5 -5
- package/dist/wje-menu-item.js +17 -13
- package/dist/wje-menu-label.js +2 -5
- package/dist/wje-menu.js +5 -5
- package/dist/wje-option.js +10 -10
- package/dist/wje-options.js +26 -15
- package/dist/wje-orgchart-group.js +3 -6
- package/dist/wje-orgchart-item.js +9 -10
- package/dist/wje-orgchart.js +2 -5
- package/dist/wje-popup.js +1 -1
- package/dist/wje-progress-bar.js +7 -6
- package/dist/wje-qr-code.js +3 -6
- package/dist/wje-radio-group.js +5 -5
- package/dist/wje-radio.js +2 -5
- package/dist/wje-rate.js +7 -7
- package/dist/wje-relative-time.js +38 -23
- package/dist/wje-reorder-dropzone.js +1 -4
- package/dist/wje-reorder-handle.js +7 -16
- package/dist/wje-reorder-item.js +1 -4
- package/dist/wje-reorder.js +78 -22
- package/dist/wje-route.js +2 -5
- package/dist/wje-router-link.js +3 -7
- package/dist/wje-router-outlet.js +3 -8
- package/dist/wje-routerx.js +32 -60
- package/dist/wje-row.js +2 -15
- package/dist/wje-select.js +19 -22
- package/dist/wje-slider.js +9 -9
- package/dist/wje-sliding-container.js +126 -53
- package/dist/wje-split-view.js +11 -6
- package/dist/wje-status.js +2 -5
- package/dist/wje-step.js +1 -4
- package/dist/wje-stepper.js +932 -919
- package/dist/wje-store.js +18 -22
- package/dist/wje-tab-group.js +5 -5
- package/dist/wje-tab-panel.js +2 -5
- package/dist/wje-tab.js +5 -5
- package/dist/wje-textarea.js +9 -6
- package/dist/wje-thumbnail.js +2 -13
- package/dist/wje-toast.js +112 -37
- package/dist/wje-toggle.js +8 -5
- package/dist/wje-toolbar-action.js +2 -5
- package/dist/wje-toolbar.js +3 -6
- package/dist/wje-tooltip.js +6 -5
- package/dist/wje-visually-hidden.js +2 -5
- package/package.json +25 -7
package/dist/dark.css
CHANGED
|
@@ -149,6 +149,11 @@
|
|
|
149
149
|
/* Divider */
|
|
150
150
|
--wje-divider-border-color: var(--wje-border-color);
|
|
151
151
|
|
|
152
|
+
/* File Upload - Item */
|
|
153
|
+
--wje-file-upload-item-border-width: 1px;
|
|
154
|
+
--wje-file-upload-item-border-style: solid;
|
|
155
|
+
--wje-file-upload-item-border-color: var(--wje-border-color);
|
|
156
|
+
|
|
152
157
|
/* Input */
|
|
153
158
|
--wje-input-background-color: var(--wje-background);
|
|
154
159
|
--wje-input-color: var(--wje-color);
|
|
@@ -182,7 +187,7 @@
|
|
|
182
187
|
/* Option */
|
|
183
188
|
--wje-option-highlighted: var(--wje-color-contrast-3);
|
|
184
189
|
|
|
185
|
-
|
|
190
|
+
/* Orgchart - Item */
|
|
186
191
|
--wje-orgchart-item-background: var(--wje-color-contrast-0);
|
|
187
192
|
|
|
188
193
|
--wje-orgchart-item-highlight-background: var(--wje-color-complete-2);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
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
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
import WJElement, { WjElementUtils, event } from "./wje-element.js";
|
|
8
5
|
const styles = "/*\n[ Wj infinite Scroll ]\n*/\n\n:host {\n overflow-x: auto;\n width: var(--wje-infinite-scroll-width);\n height: var(--wje-infinite-scroll-height);\n display: block;\n}\n\n.native {\n /*position: relative;*/\n}\n\n.loading {\n position: sticky;\n display: none;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 9999;\n background-color: var(--wje-infinite-scroll-loading-bg);\n &.show {\n display: flex;\n }\n}\n\n[name=ending] {\n display: none;\n margin-top: 1rem;\n text-align: center;\n}\n\n[name=ending].show {\n display: block;\n}";
|
|
9
6
|
class InfiniteScroll extends WJElement {
|
|
@@ -45,7 +42,7 @@ class InfiniteScroll extends WJElement {
|
|
|
45
42
|
*
|
|
46
43
|
*/
|
|
47
44
|
__publicField(this, "dataToHtml", (item) => {
|
|
48
|
-
let interpolateItem = this.
|
|
45
|
+
let interpolateItem = this.interpolate(this.infiniteScrollTemplate, item);
|
|
49
46
|
let doc = this.parser.parseFromString(interpolateItem, "text/html");
|
|
50
47
|
let element = doc.activeElement.firstElementChild;
|
|
51
48
|
return element;
|
|
@@ -57,41 +54,66 @@ class InfiniteScroll extends WJElement {
|
|
|
57
54
|
this.placementObj.insertAdjacentElement("beforeend", element);
|
|
58
55
|
});
|
|
59
56
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this
|
|
67
|
-
String.prototype.interpolate = function(params) {
|
|
68
|
-
let template = this;
|
|
57
|
+
/**
|
|
58
|
+
* Interpolates the string.
|
|
59
|
+
* @param template
|
|
60
|
+
* @param {Object} params - The parameters for interpolation.
|
|
61
|
+
* @returns {string} The interpolated string.
|
|
62
|
+
*/
|
|
63
|
+
__publicField(this, "interpolate", (template, params) => {
|
|
69
64
|
let keys = template.match(/\{{.*?\}}/g);
|
|
70
65
|
if (keys) {
|
|
71
66
|
for (let key of keys) {
|
|
72
67
|
let cleanKey = key.replace("{{", "").replace("}}", "");
|
|
73
68
|
let val = "";
|
|
74
69
|
cleanKey.split(".").forEach((k) => {
|
|
75
|
-
val = val
|
|
70
|
+
val = val === "" ? params[k] : val[k];
|
|
76
71
|
});
|
|
77
72
|
template = template.replace(key, val);
|
|
78
73
|
}
|
|
79
74
|
}
|
|
80
75
|
return template;
|
|
81
|
-
};
|
|
76
|
+
});
|
|
77
|
+
this.totalPages = 0;
|
|
78
|
+
this.isLoading = [];
|
|
79
|
+
this._response = {};
|
|
80
|
+
this.iterate = null;
|
|
81
|
+
this._infiniteScrollTemplate = null;
|
|
82
|
+
this._abortController = new AbortController();
|
|
83
|
+
this._signal = this._abortController.signal;
|
|
82
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Dependencies of the InfiniteScroll component.
|
|
87
|
+
* @param value
|
|
88
|
+
*/
|
|
83
89
|
set infiniteScrollTemplate(value) {
|
|
84
90
|
this._infiniteScrollTemplate = value;
|
|
85
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Getter for the infiniteScrollTemplate property.
|
|
94
|
+
* @returns {null}
|
|
95
|
+
*/
|
|
86
96
|
get infiniteScrollTemplate() {
|
|
87
97
|
return this._infiniteScrollTemplate;
|
|
88
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Dependencies of the InfiniteScroll component.
|
|
101
|
+
* @param value
|
|
102
|
+
*/
|
|
89
103
|
set response(value) {
|
|
90
104
|
this._response = value;
|
|
91
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Getter for the response property.
|
|
108
|
+
* @returns {*|{}}
|
|
109
|
+
*/
|
|
92
110
|
get response() {
|
|
93
111
|
return this._response;
|
|
94
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Dependencies of the InfiniteScroll component.
|
|
115
|
+
* @param value
|
|
116
|
+
*/
|
|
95
117
|
set objectName(value) {
|
|
96
118
|
this.setAttribute("object-name", value);
|
|
97
119
|
}
|
|
@@ -129,7 +151,7 @@ class InfiniteScroll extends WJElement {
|
|
|
129
151
|
* @param {Object} store - The store for drawing.
|
|
130
152
|
* @param {Object} params - The parameters for drawing.
|
|
131
153
|
*/
|
|
132
|
-
beforeDraw(
|
|
154
|
+
beforeDraw() {
|
|
133
155
|
var _a, _b;
|
|
134
156
|
this.iterate = this.querySelector("[iterate]");
|
|
135
157
|
this.infiniteScrollTemplate = (_a = this.iterate) == null ? void 0 : _a.outerHTML;
|
|
@@ -149,7 +171,7 @@ class InfiniteScroll extends WJElement {
|
|
|
149
171
|
* @param {Object} params - The parameters for drawing.
|
|
150
172
|
* @returns {DocumentFragment}
|
|
151
173
|
*/
|
|
152
|
-
draw(
|
|
174
|
+
draw() {
|
|
153
175
|
let fragment = document.createDocumentFragment();
|
|
154
176
|
let native = document.createElement("div");
|
|
155
177
|
native.classList.add("native");
|
|
@@ -174,6 +196,9 @@ class InfiniteScroll extends WJElement {
|
|
|
174
196
|
}
|
|
175
197
|
/**
|
|
176
198
|
* Called after the component has been drawn.
|
|
199
|
+
* @params {Object} context - The context for drawing.
|
|
200
|
+
* @params {Object} store - The store for drawing.
|
|
201
|
+
* @params {Object} params - The parameters for drawing.
|
|
177
202
|
*/
|
|
178
203
|
async afterDraw() {
|
|
179
204
|
this.queryParams = this.queryParams || "";
|
package/dist/light.css
CHANGED
|
@@ -322,6 +322,11 @@
|
|
|
322
322
|
--wje-divider-border-color: var(--wje-border-color);
|
|
323
323
|
--wje-divider-spacing: 0;
|
|
324
324
|
|
|
325
|
+
/* File Upload - Item */
|
|
326
|
+
--wje-file-upload-item-border-width: 1px;
|
|
327
|
+
--wje-file-upload-item-border-style: solid;
|
|
328
|
+
--wje-file-upload-item-border-color: var(--wje-border-color);
|
|
329
|
+
|
|
325
330
|
/* Icon */
|
|
326
331
|
--wje-icon-stroke: 2;
|
|
327
332
|
--wje-icon-size: var(--wje-size);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
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
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
import WJElement from "./wje-element.js";
|
|
8
5
|
const styles = "/*\n[ WJ List ]\n*/\n:host {\n margin: 0;\n padding: 0;\n display: block;\n contain: content;\n list-style-type: none;\n}\n\n:host(.wje-inset) {\n background: var(--wje-list-background);\n transform: translateZ(0);\n overflow: hidden;\n padding: var(--wje-list-inset-padding);\n border-radius: var(--wje-list-border-radius);\n}\n\n:host(.wje-lines-none) ::slotted(wje-item) {\n --wje-border-width: 0 !important;\n}";
|
|
9
6
|
class List extends WJElement {
|
|
@@ -39,7 +36,7 @@ class List extends WJElement {
|
|
|
39
36
|
* @param {Object} params - The parameters for drawing.
|
|
40
37
|
* @returns {DocumentFragment}
|
|
41
38
|
*/
|
|
42
|
-
draw(
|
|
39
|
+
draw() {
|
|
43
40
|
let fragment = document.createDocumentFragment();
|
|
44
41
|
let element = document.createElement("slot");
|
|
45
42
|
fragment.appendChild(element);
|
|
@@ -47,6 +44,9 @@ class List extends WJElement {
|
|
|
47
44
|
}
|
|
48
45
|
/**
|
|
49
46
|
* Called after the component has been drawn.
|
|
47
|
+
* @params {Object} context - The context for drawing.
|
|
48
|
+
* @params {Object} store - The store for drawing.
|
|
49
|
+
* @params {Object} params - The parameters for drawing.
|
|
50
50
|
*/
|
|
51
51
|
afterDraw() {
|
|
52
52
|
this.classList.toggle("wje-lines-" + this.lines, this.hasAttribute("lines"));
|
package/dist/localize.js
CHANGED
|
@@ -24,7 +24,7 @@ class LocalizerDefault {
|
|
|
24
24
|
// Vyhľadávanie prekladu podľa kľúča a typu čísla
|
|
25
25
|
translatePlural(key, count = 0, type = "cardinal") {
|
|
26
26
|
const plural = new Intl.PluralRules(this.lang, { type });
|
|
27
|
-
if (count
|
|
27
|
+
if (count !== void 0)
|
|
28
28
|
key += "." + plural.select(count);
|
|
29
29
|
return this.translate(key);
|
|
30
30
|
}
|
|
@@ -36,8 +36,9 @@ class LocalizerDefault {
|
|
|
36
36
|
formatDate(date) {
|
|
37
37
|
return new Intl.DateTimeFormat(this.currentLang).format(new Date(date));
|
|
38
38
|
}
|
|
39
|
-
relativeTime(value = 0, unit, options = { numeric: "auto" }) {
|
|
40
|
-
|
|
39
|
+
relativeTime(lang, value = 0, unit = "day", options = { numeric: "auto" }) {
|
|
40
|
+
lang = lang || this.currentLang;
|
|
41
|
+
return new Intl.RelativeTimeFormat(lang, options).format(value, unit);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
function registerTranslation(...translation) {
|