wj-elements 0.7.7 → 0.8.0
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/animations.js +28 -51
- package/dist/animations.js.map +1 -1
- package/dist/base-path.js +19 -31
- package/dist/base-path.js.map +1 -1
- package/dist/custom-elements.json +11504 -11499
- package/dist/dark.css +1 -302
- package/dist/date.js +16 -36
- package/dist/date.js.map +1 -1
- package/dist/element-utils.js +20 -81
- package/dist/element-utils.js.map +1 -1
- package/dist/event.js +49 -165
- package/dist/event.js.map +1 -1
- package/dist/form-associated-element-BjeJn7j8.js +101 -0
- package/dist/{form-associated-element-DEQ4y-jn.js.map → form-associated-element-BjeJn7j8.js.map} +1 -1
- package/dist/icon-DmsqtDpL.js +102 -0
- package/dist/{icon-CReYMzAK.js.map → icon-DmsqtDpL.js.map} +1 -1
- package/dist/light.css +1 -731
- package/dist/localize.js +36 -111
- package/dist/localize.js.map +1 -1
- package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +3 -2
- package/dist/permissions.js +14 -41
- package/dist/permissions.js.map +1 -1
- package/dist/popup.element-CbkhthPP.js +806 -0
- package/dist/{popup.element-CwXvVFK7.js.map → popup.element-CbkhthPP.js.map} +1 -1
- package/dist/router-links-CNsJ-elb.js +105 -0
- package/dist/{router-links-wjqCnncc.js.map → router-links-CNsJ-elb.js.map} +1 -1
- package/dist/skeleton.css +1 -197
- package/dist/styles.css +1 -866
- package/dist/universal-service.js +48 -109
- package/dist/universal-service.js.map +1 -1
- package/dist/utils.js +11 -18
- package/dist/utils.js.map +1 -1
- package/dist/web-types.json +760 -760
- package/dist/wje-accordion-item.js +33 -106
- package/dist/wje-accordion-item.js.map +1 -1
- package/dist/wje-accordion.js +19 -84
- package/dist/wje-accordion.js.map +1 -1
- package/dist/wje-animation.js +37 -4258
- package/dist/wje-animation.js.map +1 -1
- package/dist/wje-aside.js +9 -34
- package/dist/wje-aside.js.map +1 -1
- package/dist/wje-avatar.js +36 -126
- package/dist/wje-avatar.js.map +1 -1
- package/dist/wje-badge.js +10 -52
- package/dist/wje-badge.js.map +1 -1
- package/dist/wje-breadcrumb.js +205 -672
- package/dist/wje-breadcrumb.js.map +1 -1
- package/dist/wje-breadcrumbs.js +177 -633
- package/dist/wje-breadcrumbs.js.map +1 -1
- package/dist/wje-button-group.js +48 -153
- package/dist/wje-button-group.js.map +1 -1
- package/dist/wje-button.js +92 -413
- package/dist/wje-button.js.map +1 -1
- package/dist/wje-card-content.js +7 -30
- package/dist/wje-card-content.js.map +1 -1
- package/dist/wje-card-controls.js +7 -30
- package/dist/wje-card-controls.js.map +1 -1
- package/dist/wje-card-header.js +7 -30
- package/dist/wje-card-header.js.map +1 -1
- package/dist/wje-card-subtitle.js +7 -34
- package/dist/wje-card-subtitle.js.map +1 -1
- package/dist/wje-card-title.js +7 -34
- package/dist/wje-card-title.js.map +1 -1
- package/dist/wje-card.js +15 -71
- package/dist/wje-card.js.map +1 -1
- package/dist/wje-carousel-item.js +12 -56
- package/dist/wje-carousel-item.js.map +1 -1
- package/dist/wje-carousel.js +154 -509
- package/dist/wje-carousel.js.map +1 -1
- package/dist/wje-checkbox.js +50 -227
- package/dist/wje-checkbox.js.map +1 -1
- package/dist/wje-chip.js +43 -160
- package/dist/wje-chip.js.map +1 -1
- package/dist/wje-col.js +7 -20
- package/dist/wje-col.js.map +1 -1
- package/dist/wje-color-picker.js +445 -1464
- package/dist/wje-color-picker.js.map +1 -1
- package/dist/wje-container.js +9 -35
- package/dist/wje-container.js.map +1 -1
- package/dist/wje-copy-button.js +64 -204
- package/dist/wje-copy-button.js.map +1 -1
- package/dist/wje-dialog.js +85 -553
- package/dist/wje-dialog.js.map +1 -1
- package/dist/wje-divider.js +7 -34
- package/dist/wje-divider.js.map +1 -1
- package/dist/wje-dropdown.js +78 -305
- package/dist/wje-dropdown.js.map +1 -1
- package/dist/wje-element.js +191 -700
- package/dist/wje-element.js.map +1 -1
- package/dist/wje-file-upload-item.js +51 -156
- package/dist/wje-file-upload-item.js.map +1 -1
- package/dist/wje-file-upload.js +181 -619
- package/dist/wje-file-upload.js.map +1 -1
- package/dist/wje-footer.js +7 -31
- package/dist/wje-footer.js.map +1 -1
- package/dist/wje-form.js +7 -32
- package/dist/wje-form.js.map +1 -1
- package/dist/wje-format-digital.js +26 -118
- package/dist/wje-format-digital.js.map +1 -1
- package/dist/wje-grid.js +7 -33
- package/dist/wje-grid.js.map +1 -1
- package/dist/wje-header.js +9 -35
- package/dist/wje-header.js.map +1 -1
- package/dist/wje-icon-library.js +12 -18
- package/dist/wje-icon-library.js.map +1 -1
- package/dist/wje-icon-picker.js +65 -320
- package/dist/wje-icon-picker.js.map +1 -1
- package/dist/wje-icon.js +1 -1
- package/dist/wje-img-comparer.js +37 -114
- package/dist/wje-img-comparer.js.map +1 -1
- package/dist/wje-img.js +50 -198
- package/dist/wje-img.js.map +1 -1
- package/dist/wje-infinite-scroll.js +94 -346
- package/dist/wje-infinite-scroll.js.map +1 -1
- package/dist/wje-input-file.js +23 -84
- package/dist/wje-input-file.js.map +1 -1
- package/dist/wje-input.js +78 -392
- package/dist/wje-input.js.map +1 -1
- package/dist/wje-item.js +11 -64
- package/dist/wje-item.js.map +1 -1
- package/dist/wje-kanban.js +124 -401
- package/dist/wje-kanban.js.map +1 -1
- package/dist/wje-label.js +9 -32
- package/dist/wje-label.js.map +1 -1
- package/dist/wje-level-indicator.js +38 -157
- package/dist/wje-level-indicator.js.map +1 -1
- package/dist/wje-list.js +10 -40
- package/dist/wje-list.js.map +1 -1
- package/dist/wje-main.js +7 -31
- package/dist/wje-main.js.map +1 -1
- package/dist/wje-masonry.js +66 -211
- package/dist/wje-masonry.js.map +1 -1
- package/dist/wje-master.js +45 -161
- package/dist/wje-master.js.map +1 -1
- package/dist/wje-menu-button.js +10 -38
- package/dist/wje-menu-button.js.map +1 -1
- package/dist/wje-menu-item.js +127 -577
- package/dist/wje-menu-item.js.map +1 -1
- package/dist/wje-menu-label.js +9 -35
- package/dist/wje-menu-label.js.map +1 -1
- package/dist/wje-menu.js +14 -49
- package/dist/wje-menu.js.map +1 -1
- package/dist/wje-option.js +48 -279
- package/dist/wje-option.js.map +1 -1
- package/dist/wje-options.js +130 -384
- package/dist/wje-options.js.map +1 -1
- package/dist/wje-orgchart-group.js +16 -52
- package/dist/wje-orgchart-group.js.map +1 -1
- package/dist/wje-orgchart-item.js +24 -93
- package/dist/wje-orgchart-item.js.map +1 -1
- package/dist/wje-orgchart.js +18 -68
- package/dist/wje-orgchart.js.map +1 -1
- package/dist/wje-pagination.js +113 -397
- package/dist/wje-pagination.js.map +1 -1
- package/dist/wje-popup.js +3 -3
- package/dist/wje-popup.js.map +1 -1
- package/dist/wje-progress-bar.js +53 -205
- package/dist/wje-progress-bar.js.map +1 -1
- package/dist/wje-qr-code.js +398 -2980
- package/dist/wje-qr-code.js.map +1 -1
- package/dist/wje-radio-group.js +52 -190
- package/dist/wje-radio-group.js.map +1 -1
- package/dist/wje-radio.js +24 -118
- package/dist/wje-radio.js.map +1 -1
- package/dist/wje-rate.js +62 -266
- package/dist/wje-rate.js.map +1 -1
- package/dist/wje-relative-time.js +24 -99
- package/dist/wje-relative-time.js.map +1 -1
- package/dist/wje-reorder-dropzone.js +9 -31
- package/dist/wje-reorder-dropzone.js.map +1 -1
- package/dist/wje-reorder-handle.js +67 -204
- package/dist/wje-reorder-handle.js.map +1 -1
- package/dist/wje-reorder-item.js +14 -44
- package/dist/wje-reorder-item.js.map +1 -1
- package/dist/wje-reorder.js +61 -246
- package/dist/wje-reorder.js.map +1 -1
- package/dist/wje-route.js +6 -24
- package/dist/wje-route.js.map +1 -1
- package/dist/wje-router-link.js +11 -39
- package/dist/wje-router-link.js.map +1 -1
- package/dist/wje-router-outlet.js +76 -172
- package/dist/wje-router-outlet.js.map +1 -1
- package/dist/wje-routerx.js +537 -1331
- package/dist/wje-routerx.js.map +1 -1
- package/dist/wje-row.js +9 -31
- package/dist/wje-row.js.map +1 -1
- package/dist/wje-select.js +326 -1152
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-slider.js +44 -225
- package/dist/wje-slider.js.map +1 -1
- package/dist/wje-sliding-container.js +295 -1319
- package/dist/wje-sliding-container.js.map +1 -1
- package/dist/wje-split-view.js +35 -121
- package/dist/wje-split-view.js.map +1 -1
- package/dist/wje-status.js +14 -45
- package/dist/wje-status.js.map +1 -1
- package/dist/wje-step.js +9 -32
- package/dist/wje-step.js.map +1 -1
- package/dist/wje-stepper.js +109 -357
- package/dist/wje-stepper.js.map +1 -1
- package/dist/wje-store.js +67 -360
- package/dist/wje-store.js.map +1 -1
- package/dist/wje-tab-group.js +85 -314
- package/dist/wje-tab-group.js.map +1 -1
- package/dist/wje-tab-panel.js +7 -28
- package/dist/wje-tab-panel.js.map +1 -1
- package/dist/wje-tab.js +21 -198
- package/dist/wje-tab.js.map +1 -1
- package/dist/wje-textarea.js +64 -264
- package/dist/wje-textarea.js.map +1 -1
- package/dist/wje-thumbnail.js +10 -51
- package/dist/wje-thumbnail.js.map +1 -1
- package/dist/wje-toast.js +127 -632
- package/dist/wje-toast.js.map +1 -1
- package/dist/wje-toggle.js +52 -177
- package/dist/wje-toggle.js.map +1 -1
- package/dist/wje-toolbar-action.js +128 -456
- package/dist/wje-toolbar-action.js.map +1 -1
- package/dist/wje-toolbar.js +75 -270
- package/dist/wje-toolbar.js.map +1 -1
- package/dist/wje-tooltip.js +50 -161
- package/dist/wje-tooltip.js.map +1 -1
- package/dist/wje-tree-item.js +70 -301
- package/dist/wje-tree-item.js.map +1 -1
- package/dist/wje-tree.js +145 -489
- package/dist/wje-tree.js.map +1 -1
- package/dist/wje-visually-hidden.js +7 -34
- package/dist/wje-visually-hidden.js.map +1 -1
- package/package.json +3 -2
- package/dist/form-associated-element-DEQ4y-jn.js +0 -245
- package/dist/icon-CReYMzAK.js +0 -245
- package/dist/popup.element-CwXvVFK7.js +0 -2133
- package/dist/router-links-wjqCnncc.js +0 -156
package/dist/localize.js
CHANGED
|
@@ -1,135 +1,60 @@
|
|
|
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
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
__publicField(this, "convertLangCode", (
|
|
4
|
+
class t {
|
|
5
|
+
constructor(t2) {
|
|
6
|
+
__publicField(this, "convertLangCode", (t2) => t2.replace("-", "_").replace(/_([a-z]{2})$/, (t3, e2) => `_${e2.toUpperCase()}`));
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
|
-
this.element = element;
|
|
9
|
-
this.lang = ((_a = this.element) == null ? void 0 : _a.lang) || ((_b = document.documentElement) == null ? void 0 : _b.lang) || "en-GB";
|
|
10
|
-
this.dir = ((_c = this.element) == null ? void 0 : _c.dir) || ((_d = document.documentElement) == null ? void 0 : _d.dir) || "ltr";
|
|
11
|
-
this.currentLang = "en-GB";
|
|
12
|
-
this.setLanguage();
|
|
8
|
+
this.element = t2, this.lang = ((_a = this.element) == null ? void 0 : _a.lang) || ((_b = document.documentElement) == null ? void 0 : _b.lang) || "en-GB", this.dir = ((_c = this.element) == null ? void 0 : _c.dir) || ((_d = document.documentElement) == null ? void 0 : _d.dir) || "ltr", this.currentLang = "en-GB", this.setLanguage();
|
|
13
9
|
}
|
|
14
10
|
get languages() {
|
|
15
11
|
return window.translations;
|
|
16
12
|
}
|
|
17
|
-
// Nastavenie aktuálneho jazyka
|
|
18
13
|
setLanguage() {
|
|
19
14
|
var _a;
|
|
20
|
-
|
|
21
|
-
this.currentLang = this.lang;
|
|
22
|
-
} else {
|
|
23
|
-
console.error(`Language "${this.lang}" not loaded.`);
|
|
24
|
-
}
|
|
15
|
+
((_a = this.languages) == null ? void 0 : _a.has(this.lang)) ? this.currentLang = this.lang : console.error(`Language "${this.lang}" not loaded.`);
|
|
25
16
|
}
|
|
26
|
-
|
|
27
|
-
* Translates a given translation key based on the currently selected language.
|
|
28
|
-
* @param {string} key The key representing the text to be translated.
|
|
29
|
-
* @returns {string} The translated text if available; otherwise, returns the original key.
|
|
30
|
-
*/
|
|
31
|
-
translate(key) {
|
|
17
|
+
translate(t2) {
|
|
32
18
|
var _a;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* the token name is trimmed, and the value is looked up in the `params` object.
|
|
42
|
-
* When a matching param exists, its value is converted to a string and inserted into the translation.
|
|
43
|
-
* Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.
|
|
44
|
-
* @param {string} key The translation key.
|
|
45
|
-
* @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.
|
|
46
|
-
* @returns {string} Localized string with interpolated params.
|
|
47
|
-
* @example
|
|
48
|
-
* // If the translation is:
|
|
49
|
-
* // "personalSettings.settings.synchronization.checkbox.exportApprovedAbsence":
|
|
50
|
-
* // "Exportuj schválené absencie do {calendar}"
|
|
51
|
-
* this.localizer.translateWithParams(
|
|
52
|
-
* 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',
|
|
53
|
-
* { calendar: 'Google kalendára' },
|
|
54
|
-
* );
|
|
55
|
-
* // Returns: 'Exportuj schválené absencie do Google kalendára'
|
|
56
|
-
*/
|
|
57
|
-
translateWithParams(key, params = {}) {
|
|
58
|
-
const translated = this.translate(key);
|
|
59
|
-
if (typeof translated !== "string") return translated;
|
|
60
|
-
return translated.replace(/\{([^{}]+)\}/g, (match, token) => {
|
|
61
|
-
const value = params[token.trim()];
|
|
62
|
-
return value === void 0 || value === null ? match : String(value);
|
|
19
|
+
const e2 = (_a = this.languages) == null ? void 0 : _a.get(this.currentLang);
|
|
20
|
+
return e2 && e2 && e2[t2] || t2;
|
|
21
|
+
}
|
|
22
|
+
translateWithParams(t2, e2 = {}) {
|
|
23
|
+
const n = this.translate(t2);
|
|
24
|
+
return "string" != typeof n ? n : n.replace(/\{([^{}]+)\}/g, (t3, n2) => {
|
|
25
|
+
const r = e2[n2.trim()];
|
|
26
|
+
return null == r ? t3 : String(r);
|
|
63
27
|
});
|
|
64
28
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
* @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.
|
|
69
|
-
* @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.
|
|
70
|
-
* @returns {string} The translated string, adapted to the pluralization rules and count.
|
|
71
|
-
*/
|
|
72
|
-
translatePlural(key, count = 0, type = "cardinal") {
|
|
73
|
-
const plural = new Intl.PluralRules(this.currentLang, { type });
|
|
74
|
-
const k = `${key}.${plural.select(count)}`;
|
|
75
|
-
const t = this.translate(k);
|
|
76
|
-
if (t !== k) return t;
|
|
77
|
-
return this.translate(`${key}.other`);
|
|
29
|
+
translatePlural(t2, e2 = 0, n = "cardinal") {
|
|
30
|
+
const r = `${t2}.${new Intl.PluralRules(this.currentLang, { type: n }).select(e2)}`, a = this.translate(r);
|
|
31
|
+
return a !== r ? a : this.translate(`${t2}.other`);
|
|
78
32
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* @param {number} number The numeric value to format.
|
|
82
|
-
* @param {object} options An object containing formatting options for the number.
|
|
83
|
-
* @returns {string} The formatted number as a string.
|
|
84
|
-
*/
|
|
85
|
-
formatNumber(number, options) {
|
|
86
|
-
return new Intl.NumberFormat(this.currentLang, options).format(number);
|
|
33
|
+
formatNumber(t2, e2) {
|
|
34
|
+
return new Intl.NumberFormat(this.currentLang, e2).format(t2);
|
|
87
35
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.
|
|
91
|
-
* @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.
|
|
92
|
-
* @returns {string} The formatted date string based on the specified options and current language.
|
|
93
|
-
*/
|
|
94
|
-
formatDate(date, options) {
|
|
95
|
-
return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));
|
|
36
|
+
formatDate(t2, e2) {
|
|
37
|
+
return new Intl.DateTimeFormat(this.currentLang, e2).format(new Date(t2));
|
|
96
38
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.
|
|
100
|
-
* @param {number} value The numerical value to format, representing the time difference.
|
|
101
|
-
* @param {string} [unit] The unit of time to use (e.g., "second", "minute", "hour", "day", "week", "month", "year").
|
|
102
|
-
* @param {object} [options] An object containing formatting options, such as the style for the numeric representation.
|
|
103
|
-
* @returns {string} The formatted relative time string in the specified language.
|
|
104
|
-
*/
|
|
105
|
-
relativeTime(lang, value = 0, unit = "day", options = { numeric: "auto" }) {
|
|
106
|
-
lang = lang || this.currentLang;
|
|
107
|
-
return new Intl.RelativeTimeFormat(lang, options).format(value, unit);
|
|
39
|
+
relativeTime(t2, e2 = 0, n = "day", r = { numeric: "auto" }) {
|
|
40
|
+
return t2 = t2 || this.currentLang, new Intl.RelativeTimeFormat(t2, r).format(e2, n);
|
|
108
41
|
}
|
|
109
42
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
class Localizer extends LocalizerDefault {
|
|
125
|
-
constructor(element) {
|
|
126
|
-
super(element);
|
|
127
|
-
}
|
|
128
|
-
static registerTranslation(...translation) {
|
|
129
|
-
registerTranslation(...translation);
|
|
43
|
+
class e extends t {
|
|
44
|
+
constructor(t2) {
|
|
45
|
+
super(t2);
|
|
46
|
+
}
|
|
47
|
+
static registerTranslation(...t2) {
|
|
48
|
+
!(function(...t3) {
|
|
49
|
+
t3.forEach((t4) => {
|
|
50
|
+
if (!t4.code) return void console.error("Translation object is missing 'code' property:", t4);
|
|
51
|
+
const e2 = t4.code.toLowerCase();
|
|
52
|
+
window.translations.has(e2) ? window.translations.set(e2, { ...window.translations.get(e2), ...t4 }) : window.translations.set(e2, t4);
|
|
53
|
+
});
|
|
54
|
+
})(...t2);
|
|
130
55
|
}
|
|
131
56
|
}
|
|
132
57
|
export {
|
|
133
|
-
Localizer
|
|
58
|
+
e as Localizer
|
|
134
59
|
};
|
|
135
60
|
//# sourceMappingURL=localize.js.map
|
package/dist/localize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element?.lang || document.documentElement?.lang || 'en-GB';\n this.dir = this.element?.dir || document.documentElement?.dir || 'ltr';\n this.currentLang = 'en-GB';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n convertLangCode = (lang) => lang.replace(\"-\", \"_\").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`);\n\n /**\n * Translates a given translation key based on the currently selected language.\n * @param {string} key The key representing the text to be translated.\n * @returns {string} The translated text if available; otherwise, returns the original key.\n */\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n /**\n * Translates a key and then interpolates placeholders in the format {placeholder}.\n * The method first resolves the base text through `translate()`. If the result is not a string,\n * it is returned unchanged. For string results, every placeholder wrapped in curly braces is matched,\n * the token name is trimmed, and the value is looked up in the `params` object.\n * When a matching param exists, its value is converted to a string and inserted into the translation.\n * Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.\n * @param {string} key The translation key.\n * @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.\n * @returns {string} Localized string with interpolated params.\n * @example\n * // If the translation is:\n * // \"personalSettings.settings.synchronization.checkbox.exportApprovedAbsence\":\n * // \"Exportuj schválené absencie do {calendar}\"\n * this.localizer.translateWithParams(\n * 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',\n * { calendar: 'Google kalendára' },\n * );\n * // Returns: 'Exportuj schválené absencie do Google kalendára'\n */\n translateWithParams(key, params = {}) {\n const translated = this.translate(key);\n\n if (typeof translated !== 'string') return translated;\n\n return translated.replace(/\\{([^{}]+)\\}/g, (match, token) => {\n const value = params[token.trim()];\n return value === undefined || value === null ? match : String(value);\n });\n }\n\n /**\n * Translates a key into a localized string based on the provided count and pluralization type.\n * @param {string} key The base translation key to be used for fetching the localized string.\n * @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.\n * @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.\n * @returns {string} The translated string, adapted to the pluralization rules and count.\n */\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.currentLang, { type });\n const k = `${key}.${plural.select(count)}`;\n const t = this.translate(k);\n if (t !== k) return t;\n return this.translate(`${key}.other`);\n }\n\n /**\n * Formats a number according to the specified locale and formatting options.\n * @param {number} number The numeric value to format.\n * @param {object} options An object containing formatting options for the number.\n * @returns {string} The formatted number as a string.\n */\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n /**\n * Formats a given date based on the specified options and the current language setting.\n * @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.\n * @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.\n * @returns {string} The formatted date string based on the specified options and current language.\n */\n formatDate(date, options) {\n return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));\n }\n\n /**\n * Formats a relative time string based on a given language, value, unit, and formatting options.\n * @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.\n * @param {number} value The numerical value to format, representing the time difference.\n * @param {string} [unit] The unit of time to use (e.g., \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\").\n * @param {object} [options] An object containing formatting options, such as the style for the numeric representation.\n * @returns {string} The formatted relative time string in the specified language.\n */\n relativeTime(lang, value = 0, unit = 'day', options = { numeric: 'auto' }) {\n lang = lang || this.currentLang;\n return new Intl.RelativeTimeFormat(lang, options).format(value, unit);\n }\n}\n\nexport function registerTranslation(...translation) {\n translation.forEach((t) => {\n if (!t.code) {\n console.error(\"Translation object is missing 'code' property:\", t);\n return;\n }\n\n const code = t.code.toLowerCase();\n if (window.translations.has(code)) {\n window.translations.set(code, { ...window.translations.get(code), ...t });\n } else {\n window.translations.set(code, t);\n }\n });\n}\n","import { LocalizerDefault, registerTranslation } from '../localize/localize.js';\n\nexport class Localizer extends LocalizerDefault {\n constructor(element) {\n super(element);\n }\n static registerTranslation(...translation) {\n registerTranslation(...translation);\n }\n}\n"],"names":[],"mappings":";;;AAEO,
|
|
1
|
+
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element?.lang || document.documentElement?.lang || 'en-GB';\n this.dir = this.element?.dir || document.documentElement?.dir || 'ltr';\n this.currentLang = 'en-GB';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n convertLangCode = (lang) => lang.replace(\"-\", \"_\").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`);\n\n /**\n * Translates a given translation key based on the currently selected language.\n * @param {string} key The key representing the text to be translated.\n * @returns {string} The translated text if available; otherwise, returns the original key.\n */\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n /**\n * Translates a key and then interpolates placeholders in the format {placeholder}.\n * The method first resolves the base text through `translate()`. If the result is not a string,\n * it is returned unchanged. For string results, every placeholder wrapped in curly braces is matched,\n * the token name is trimmed, and the value is looked up in the `params` object.\n * When a matching param exists, its value is converted to a string and inserted into the translation.\n * Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.\n * @param {string} key The translation key.\n * @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.\n * @returns {string} Localized string with interpolated params.\n * @example\n * // If the translation is:\n * // \"personalSettings.settings.synchronization.checkbox.exportApprovedAbsence\":\n * // \"Exportuj schválené absencie do {calendar}\"\n * this.localizer.translateWithParams(\n * 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',\n * { calendar: 'Google kalendára' },\n * );\n * // Returns: 'Exportuj schválené absencie do Google kalendára'\n */\n translateWithParams(key, params = {}) {\n const translated = this.translate(key);\n\n if (typeof translated !== 'string') return translated;\n\n return translated.replace(/\\{([^{}]+)\\}/g, (match, token) => {\n const value = params[token.trim()];\n return value === undefined || value === null ? match : String(value);\n });\n }\n\n /**\n * Translates a key into a localized string based on the provided count and pluralization type.\n * @param {string} key The base translation key to be used for fetching the localized string.\n * @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.\n * @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.\n * @returns {string} The translated string, adapted to the pluralization rules and count.\n */\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.currentLang, { type });\n const k = `${key}.${plural.select(count)}`;\n const t = this.translate(k);\n if (t !== k) return t;\n return this.translate(`${key}.other`);\n }\n\n /**\n * Formats a number according to the specified locale and formatting options.\n * @param {number} number The numeric value to format.\n * @param {object} options An object containing formatting options for the number.\n * @returns {string} The formatted number as a string.\n */\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n /**\n * Formats a given date based on the specified options and the current language setting.\n * @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.\n * @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.\n * @returns {string} The formatted date string based on the specified options and current language.\n */\n formatDate(date, options) {\n return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));\n }\n\n /**\n * Formats a relative time string based on a given language, value, unit, and formatting options.\n * @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.\n * @param {number} value The numerical value to format, representing the time difference.\n * @param {string} [unit] The unit of time to use (e.g., \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\").\n * @param {object} [options] An object containing formatting options, such as the style for the numeric representation.\n * @returns {string} The formatted relative time string in the specified language.\n */\n relativeTime(lang, value = 0, unit = 'day', options = { numeric: 'auto' }) {\n lang = lang || this.currentLang;\n return new Intl.RelativeTimeFormat(lang, options).format(value, unit);\n }\n}\n\nexport function registerTranslation(...translation) {\n translation.forEach((t) => {\n if (!t.code) {\n console.error(\"Translation object is missing 'code' property:\", t);\n return;\n }\n\n const code = t.code.toLowerCase();\n if (window.translations.has(code)) {\n window.translations.set(code, { ...window.translations.get(code), ...t });\n } else {\n window.translations.set(code, t);\n }\n });\n}\n","import { LocalizerDefault, registerTranslation } from '../localize/localize.js';\n\nexport class Localizer extends LocalizerDefault {\n constructor(element) {\n super(element);\n }\n static registerTranslation(...translation) {\n registerTranslation(...translation);\n }\n}\n"],"names":["LocalizerDefault","element","convertLangCode","lang","replace","_","code","toUpperCase","this","document","documentElement","dir","currentLang","setLanguage","languages","window","translations","has","console","error","key","langMap","get","params","translated","translate","match","token","value","trim","String","count","type","k","Intl","PluralRules","select","t","number","options","NumberFormat","format","date","DateTimeFormat","Date","unit","numeric","RelativeTimeFormat","Localizer","super","translation","forEach","toLowerCase","set","registerTranslation"],"mappings":"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"}
|
|
@@ -23,6 +23,7 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
23
23
|
* @cssproperty [--wje-accordion-border-expanded=var(--wje-color-contrast-0)] - Border color of the expanded item wrapper.
|
|
24
24
|
* @cssproperty [--wje-accordion-headline-color=var(--wje-color-contrast-11)] - Text color of the headline area.
|
|
25
25
|
* @cssproperty [--wje-accordion-content-color=var(--wje-color-contrast-6)] - Text color of the expandable content area.
|
|
26
|
+
* @cssproperty [--wje-accordion-content-margin=0 var(--wje-spacing-small, 0.75rem) var(--wje-spacing-small, 0.75rem)] - Margin around the slotted expandable content.
|
|
26
27
|
* @cssproperty [--wje-accordion-marker-rotate=0deg] - Rotation applied to the toggle marker icon.
|
|
27
28
|
* // @fires wje-accordion-item:open - Dispatched when the item is expanded.
|
|
28
29
|
* // @fires wje-accordion-item:close - Dispatched when the item is collapsed.
|
|
@@ -54,11 +55,11 @@ export default class AccordionItem extends WJElement {
|
|
|
54
55
|
*/
|
|
55
56
|
afterDraw(): void;
|
|
56
57
|
/**
|
|
57
|
-
* Collapses the accordion item
|
|
58
|
+
* Collapses the accordion item, updates the headline ARIA state, and makes its content inert.
|
|
58
59
|
*/
|
|
59
60
|
collapse(): void;
|
|
60
61
|
/**
|
|
61
|
-
* Expands the accordion item
|
|
62
|
+
* Expands the accordion item, updates the headline ARIA state, and makes its content interactive.
|
|
62
63
|
*/
|
|
63
64
|
expand(): void;
|
|
64
65
|
}
|
package/dist/permissions.js
CHANGED
|
@@ -1,56 +1,29 @@
|
|
|
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
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* The key is stored internally and defaults to 'permissions' if no value is provided.
|
|
8
|
-
* @param {string} value The key to set for permissions. If no value is provided, the default is 'permissions'.
|
|
9
|
-
*/
|
|
10
|
-
static set permissionKey(value) {
|
|
11
|
-
_Permissions._permissionKey = value || "permissions";
|
|
4
|
+
const _s = class _s {
|
|
5
|
+
static set permissionKey(i) {
|
|
6
|
+
_s._permissionKey = i || "permissions";
|
|
12
7
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Retrieves the permission key used for accessing the permissions utility.
|
|
15
|
-
* @returns {string} The permission key associated with the Permissions utility.
|
|
16
|
-
*/
|
|
17
8
|
static get permissionKey() {
|
|
18
|
-
return
|
|
9
|
+
return _s._permissionKey;
|
|
19
10
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @param {Array<string>} value The permissions array to be stored.
|
|
23
|
-
*/
|
|
24
|
-
static set permissions(value) {
|
|
25
|
-
window.localStorage.setItem(_Permissions.permissionKey, JSON.stringify(value));
|
|
11
|
+
static set permissions(i) {
|
|
12
|
+
window.localStorage.setItem(_s.permissionKey, JSON.stringify(i));
|
|
26
13
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves the list of permissions stored in the browser's local storage.
|
|
29
|
-
* @returns {Array} An array of permissions. If no permissions are found, returns an empty array.
|
|
30
|
-
*/
|
|
31
14
|
static get permissions() {
|
|
32
|
-
return JSON.parse(window.localStorage.getItem(
|
|
15
|
+
return JSON.parse(window.localStorage.getItem(_s.permissionKey)) || [];
|
|
33
16
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* @param {string} key The key to check for existence in the permissions list.
|
|
37
|
-
* @returns {boolean} Returns true if the key exists in the permissions list; otherwise, returns false.
|
|
38
|
-
*/
|
|
39
|
-
static includesKey(key) {
|
|
40
|
-
return _Permissions.permissions.includes(key);
|
|
17
|
+
static includesKey(i) {
|
|
18
|
+
return _s.permissions.includes(i);
|
|
41
19
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* @param {Array<string>} permissions The list of permissions to check against the permissions available in `Permissions`.
|
|
45
|
-
* @returns {boolean} Returns `true` if any of the given permissions match the permissions available in `Permissions`, otherwise returns `false`.
|
|
46
|
-
*/
|
|
47
|
-
static isPermissionFulfilled(permissions) {
|
|
48
|
-
return permissions.some((perm) => _Permissions.permissions.includes(perm));
|
|
20
|
+
static isPermissionFulfilled(i) {
|
|
21
|
+
return i.some((i2) => _s.permissions.includes(i2));
|
|
49
22
|
}
|
|
50
23
|
};
|
|
51
|
-
__publicField(
|
|
52
|
-
let
|
|
24
|
+
__publicField(_s, "_permissionKey", "permissions");
|
|
25
|
+
let s = _s;
|
|
53
26
|
export {
|
|
54
|
-
Permissions
|
|
27
|
+
s as Permissions
|
|
55
28
|
};
|
|
56
29
|
//# sourceMappingURL=permissions.js.map
|
package/dist/permissions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sources":["../packages/utils/permissions.js"],"sourcesContent":["/**\n * Permissions is a utility class for managing permissions.\n * It allows setting, retrieving, and checking permissions stored in the browser's local storage.\n */\nexport class Permissions {\n static _permissionKey = 'permissions';\n\n /**\n * Sets the permission key for the Permissions utility.\n * The key is stored internally and defaults to 'permissions' if no value is provided.\n * @param {string} value The key to set for permissions. If no value is provided, the default is 'permissions'.\n */\n static set permissionKey(value) {\n Permissions._permissionKey = value || 'permissions';\n }\n\n /**\n * Retrieves the permission key used for accessing the permissions utility.\n * @returns {string} The permission key associated with the Permissions utility.\n */\n static get permissionKey() {\n return Permissions._permissionKey;\n }\n\n /**\n * Sets the permissions by storing them in the local storage.\n * @param {Array<string>} value The permissions array to be stored.\n */\n static set permissions(value) {\n window.localStorage.setItem(Permissions.permissionKey, JSON.stringify(value));\n }\n\n /**\n * Retrieves the list of permissions stored in the browser's local storage.\n * @returns {Array} An array of permissions. If no permissions are found, returns an empty array.\n */\n static get permissions() {\n return JSON.parse(window.localStorage.getItem(Permissions.permissionKey)) || [];\n }\n\n /**\n * Determines whether the specified key exists in the permissions list.\n * @param {string} key The key to check for existence in the permissions list.\n * @returns {boolean} Returns true if the key exists in the permissions list; otherwise, returns false.\n */\n static includesKey(key) {\n return Permissions.permissions.includes(key);\n }\n\n /**\n * Checks if at least one of the given permissions is fulfilled, based on the permissions available in `Permissions`.\n * @param {Array<string>} permissions The list of permissions to check against the permissions available in `Permissions`.\n * @returns {boolean} Returns `true` if any of the given permissions match the permissions available in `Permissions`, otherwise returns `false`.\n */\n static isPermissionFulfilled(permissions) {\n return permissions.some((perm) => Permissions.permissions.includes(perm));\n }\n}\n"],"names":[],"mappings":";;;AAIO,
|
|
1
|
+
{"version":3,"file":"permissions.js","sources":["../packages/utils/permissions.js"],"sourcesContent":["/**\n * Permissions is a utility class for managing permissions.\n * It allows setting, retrieving, and checking permissions stored in the browser's local storage.\n */\nexport class Permissions {\n static _permissionKey = 'permissions';\n\n /**\n * Sets the permission key for the Permissions utility.\n * The key is stored internally and defaults to 'permissions' if no value is provided.\n * @param {string} value The key to set for permissions. If no value is provided, the default is 'permissions'.\n */\n static set permissionKey(value) {\n Permissions._permissionKey = value || 'permissions';\n }\n\n /**\n * Retrieves the permission key used for accessing the permissions utility.\n * @returns {string} The permission key associated with the Permissions utility.\n */\n static get permissionKey() {\n return Permissions._permissionKey;\n }\n\n /**\n * Sets the permissions by storing them in the local storage.\n * @param {Array<string>} value The permissions array to be stored.\n */\n static set permissions(value) {\n window.localStorage.setItem(Permissions.permissionKey, JSON.stringify(value));\n }\n\n /**\n * Retrieves the list of permissions stored in the browser's local storage.\n * @returns {Array} An array of permissions. If no permissions are found, returns an empty array.\n */\n static get permissions() {\n return JSON.parse(window.localStorage.getItem(Permissions.permissionKey)) || [];\n }\n\n /**\n * Determines whether the specified key exists in the permissions list.\n * @param {string} key The key to check for existence in the permissions list.\n * @returns {boolean} Returns true if the key exists in the permissions list; otherwise, returns false.\n */\n static includesKey(key) {\n return Permissions.permissions.includes(key);\n }\n\n /**\n * Checks if at least one of the given permissions is fulfilled, based on the permissions available in `Permissions`.\n * @param {Array<string>} permissions The list of permissions to check against the permissions available in `Permissions`.\n * @returns {boolean} Returns `true` if any of the given permissions match the permissions available in `Permissions`, otherwise returns `false`.\n */\n static isPermissionFulfilled(permissions) {\n return permissions.some((perm) => Permissions.permissions.includes(perm));\n }\n}\n"],"names":["Permissions","value","_permissionKey","permissionKey","window","localStorage","setItem","JSON","stringify","permissions","parse","getItem","key","includes","some","perm","static"],"mappings":";;;AAIO,MAAMA,KAAN,MAAMA,GAAAA;AAAAA,EAQT,WAAA,cAAyBC,GAAAA;AACrBD,OAAYE,iBAAiBD,KAAS;AAAA,EAC1C;AAAA,EAMA,WAAA,gBAAWE;AACP,WAAOH,GAAYE;AAAAA,EACvB;AAAA,EAMA,WAAA,YAAuBD,GAAAA;AACnBG,WAAOC,aAAaC,QAAQN,GAAYG,eAAeI,KAAKC,UAAUP,CAAAA,CAAAA;AAAAA,EAC1E;AAAA,EAMA,WAAA,cAAWQ;AACP,WAAOF,KAAKG,MAAMN,OAAOC,aAAaM,QAAQX,GAAYG,aAAAA,CAAAA,KAAmB,CAAA;AAAA,EACjF;AAAA,EAOA,OAAA,YAAmBS,GAAAA;AACf,WAAOZ,GAAYS,YAAYI,SAASD,CAAAA;AAAAA,EAC5C;AAAA,EAOA,OAAA,sBAA6BH,GAAAA;AACzB,WAAOA,EAAYK,KAAMC,CAAAA,OAASf,GAAYS,YAAYI,SAASE;EACvE;AAAA;AAnDAC,cADShB,IACTgB,kBAAwB;AADrB,IAAMhB,IAAN;"}
|