wj-elements 0.1.142 → 0.1.144
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/localize.js +6 -2
- package/dist/localize.js.map +1 -1
- package/dist/packages/localize/localize.d.ts +1 -1
- package/dist/packages/utils/permissions-api.d.ts +2 -2
- package/dist/packages/wje-accordion/accordion.element.d.ts +2 -2
- package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +1 -1
- package/dist/packages/wje-animation/animation.element.d.ts +1 -1
- package/dist/packages/wje-aside/aside.element.d.ts +1 -1
- package/dist/packages/wje-badge/badge.element.d.ts +1 -1
- package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +2 -2
- package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +3 -3
- package/dist/packages/wje-button/button.element.d.ts +5 -5
- package/dist/packages/wje-button-group/button-group.element.d.ts +2 -2
- package/dist/packages/wje-card/card.element.d.ts +1 -1
- package/dist/packages/wje-card-content/card-content.element.d.ts +1 -1
- package/dist/packages/wje-card-controls/card-controls.element.d.ts +1 -1
- package/dist/packages/wje-card-header/card-header.element.d.ts +1 -1
- package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +1 -1
- package/dist/packages/wje-card-title/card-title.element.d.ts +1 -1
- package/dist/packages/wje-carousel/carousel.element.d.ts +2 -2
- package/dist/packages/wje-color-picker/color-picker.element.d.ts +4 -4
- package/dist/packages/wje-container/container.element.d.ts +1 -1
- package/dist/packages/wje-dialog/dialog.element.d.ts +2 -2
- package/dist/packages/wje-dropdown/dropdown.element.d.ts +2 -2
- package/dist/packages/wje-element/element.d.ts +2 -2
- package/dist/packages/wje-file-upload/file-upload.element.d.ts +2 -2
- package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +1 -1
- package/dist/packages/wje-footer/footer.element.d.ts +1 -1
- package/dist/packages/wje-format-digital/format-digital.element.d.ts +1 -1
- package/dist/packages/wje-header/header.element.d.ts +1 -1
- package/dist/packages/wje-icon/icon.element.d.ts +1 -1
- package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +1 -1
- package/dist/packages/wje-img/img.element.d.ts +66 -5
- package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +1 -1
- package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +3 -3
- package/dist/packages/wje-input-file/input-file.element.d.ts +1 -1
- package/dist/packages/wje-item/item.element.d.ts +1 -1
- package/dist/packages/wje-kanban/kanban.element.d.ts +3 -3
- package/dist/packages/wje-label/label.element.d.ts +1 -1
- package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +2 -2
- package/dist/packages/wje-main/main.element.d.ts +1 -1
- package/dist/packages/wje-menu/menu.element.d.ts +1 -1
- package/dist/packages/wje-menu-button/menu-button.element.d.ts +1 -1
- package/dist/packages/wje-menu-label/menu-label.element.d.ts +1 -1
- package/dist/packages/wje-option/option.element.d.ts +1 -1
- package/dist/packages/wje-options/options.element.d.ts +1 -1
- package/dist/packages/wje-pagination/pagination.element.d.ts +5 -5
- package/dist/packages/wje-popup/popup.element.d.ts +1 -1
- package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +1 -1
- package/dist/packages/wje-radio/radio.element.d.ts +1 -1
- package/dist/packages/wje-rate/rate.element.d.ts +3 -3
- package/dist/packages/wje-relative-time/relative-time.element.d.ts +1 -1
- package/dist/packages/wje-reorder/reorder.element.d.ts +1 -1
- package/dist/packages/wje-route/route.element.d.ts +1 -1
- package/dist/packages/wje-router/router.element.d.ts +1 -1
- package/dist/packages/wje-router-link/router-link.element.d.ts +1 -1
- package/dist/packages/wje-select/select.element.d.ts +2 -2
- package/dist/packages/wje-slider/slider.element.d.ts +1 -1
- package/dist/packages/wje-split-view/split-view.element.d.ts +1 -1
- package/dist/packages/wje-textarea/textarea.element.d.ts +1 -1
- package/dist/packages/wje-tree-item/tree-item.element.d.ts +2 -2
- package/dist/wje-img.js +94 -3
- package/dist/wje-img.js.map +1 -1
- package/dist/wje-textarea.js +4 -1
- package/dist/wje-textarea.js.map +1 -1
- package/package.json +1 -1
- package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
- package/dist/packages/wje-color-picker/color-picker.test.d.ts +0 -1
package/dist/localize.js
CHANGED
|
@@ -3,6 +3,7 @@ class LocalizerDefault {
|
|
|
3
3
|
this.element = element;
|
|
4
4
|
this.lang = this.element.lang || document.documentElement.lang || "en-gb";
|
|
5
5
|
this.dir = this.element.dir || document.documentElement.dir || "ltr";
|
|
6
|
+
this.currentLang = "en-gb";
|
|
6
7
|
this.setLanguage();
|
|
7
8
|
}
|
|
8
9
|
get languages() {
|
|
@@ -10,7 +11,8 @@ class LocalizerDefault {
|
|
|
10
11
|
}
|
|
11
12
|
// Nastavenie aktuálneho jazyka
|
|
12
13
|
setLanguage() {
|
|
13
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
if ((_a = this.languages) == null ? void 0 : _a.has(this.lang)) {
|
|
14
16
|
this.currentLang = this.lang;
|
|
15
17
|
} else {
|
|
16
18
|
console.error(`Language "${this.lang}" not loaded.`);
|
|
@@ -18,7 +20,9 @@ class LocalizerDefault {
|
|
|
18
20
|
}
|
|
19
21
|
// Vyhľadávanie prekladu podľa kľúča
|
|
20
22
|
translate(key) {
|
|
21
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
const langMap = (_a = this.languages) == null ? void 0 : _a.get(this.currentLang);
|
|
25
|
+
if (!langMap) return key;
|
|
22
26
|
return langMap ? langMap[key] || key : key;
|
|
23
27
|
}
|
|
24
28
|
// Vyhľadávanie prekladu podľa kľúča a typu čísla
|
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\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
|
|
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 // Vyhľadávanie prekladu podľa kľúča\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 // Vyhľadávanie prekladu podľa kľúča a typu čísla\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.lang, { type: type });\n\n if (count !== undefined) key += '.' + plural.select(count);\n\n return this.translate(key);\n }\n\n // Formátovanie čísla podľa aktuálneho jazyka\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n // Formátovanie dátumu podľa aktuálneho jazyka\n formatDate(date) {\n return new Intl.DateTimeFormat(this.currentLang).format(new Date(date));\n }\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,MAAM,iBAAiB;AAAA,EAC1B,YAAY,SAAS;AACjB,SAAK,UAAU;AAEf,SAAK,OAAO,KAAK,QAAQ,QAAQ,SAAS,gBAAgB,QAAQ;AAClE,SAAK,MAAM,KAAK,QAAQ,OAAO,SAAS,gBAAgB,OAAO;AAC/D,SAAK,cAAc;AAEnB,SAAK,YAAa;AAAA,EAC1B;AAAA,EAEI,IAAI,YAAY;AACZ,WAAO,OAAO;AAAA,EACtB;AAAA;AAAA,EAGI,cAAc;AAlBlB;AAmBQ,SAAI,UAAK,cAAL,mBAAgB,IAAI,KAAK,OAAO;AAChC,WAAK,cAAc,KAAK;AAAA,IACpC,OAAe;AACH,cAAQ,MAAM,aAAa,KAAK,IAAI,eAAe;AAAA,IAC/D;AAAA,EACA;AAAA;AAAA,EAGI,UAAU,KAAK;AA3BnB;AA4BQ,UAAM,WAAU,UAAK,cAAL,mBAAgB,IAAI,KAAK;AACzC,QAAI,CAAC,QAAS,QAAO;AACrB,WAAO,UAAU,QAAQ,GAAG,KAAK,MAAM;AAAA,EAC/C;AAAA;AAAA,EAGI,gBAAgB,KAAK,QAAQ,GAAG,OAAO,YAAY;AAC/C,UAAM,SAAS,IAAI,KAAK,YAAY,KAAK,MAAM,EAAE,MAAY;AAE7D,QAAI,UAAU,OAAW,QAAO,MAAM,OAAO,OAAO,KAAK;AAEzD,WAAO,KAAK,UAAU,GAAG;AAAA,EACjC;AAAA;AAAA,EAGI,aAAa,QAAQ,SAAS;AAC1B,WAAO,IAAI,KAAK,aAAa,KAAK,aAAa,OAAO,EAAE,OAAO,MAAM;AAAA,EAC7E;AAAA;AAAA,EAGI,WAAW,MAAM;AACb,WAAO,IAAI,KAAK,eAAe,KAAK,WAAW,EAAE,OAAO,IAAI,KAAK,IAAI,CAAC;AAAA,EAC9E;AAAA,EAEI,aAAa,MAAM,QAAQ,GAAG,OAAO,OAAO,UAAU,EAAE,SAAS,UAAU;AACvE,WAAO,QAAQ,KAAK;AACpB,WAAO,IAAI,KAAK,mBAAmB,MAAM,OAAO,EAAE,OAAO,OAAO,IAAI;AAAA,EAC5E;AACA;AAEO,SAAS,uBAAuB,aAAa;AAChD,cAAY,QAAQ,CAAC,MAAM;AACvB,QAAI,CAAC,EAAE,MAAM;AACT,cAAQ,MAAM,kDAAkD,CAAC;AACjE;AAAA,IACZ;AAEQ,UAAM,OAAO,EAAE,KAAK,YAAa;AACjC,QAAI,OAAO,aAAa,IAAI,IAAI,GAAG;AAC/B,aAAO,aAAa,IAAI,MAAM,EAAE,GAAG,OAAO,aAAa,IAAI,IAAI,GAAG,GAAG,EAAC,CAAE;AAAA,IACpF,OAAe;AACH,aAAO,aAAa,IAAI,MAAM,CAAC;AAAA,IAC3C;AAAA,EACA,CAAK;AACL;ACtEO,MAAM,kBAAkB,iBAAiB;AAAA,EAC5C,YAAY,SAAS;AACjB,UAAM,OAAO;AAAA,EACrB;AAAA,EACI,OAAO,uBAAuB,aAAa;AACvC,wBAAoB,GAAG,WAAW;AAAA,EAC1C;AACA;"}
|
|
@@ -4,9 +4,9 @@ export class LocalizerDefault {
|
|
|
4
4
|
element: any;
|
|
5
5
|
lang: any;
|
|
6
6
|
dir: any;
|
|
7
|
+
currentLang: string;
|
|
7
8
|
get languages(): any;
|
|
8
9
|
setLanguage(): void;
|
|
9
|
-
currentLang: any;
|
|
10
10
|
translate(key: any): any;
|
|
11
11
|
translatePlural(key: any, count?: number, type?: string): any;
|
|
12
12
|
formatNumber(number: any, options: any): string;
|
|
@@ -4,12 +4,12 @@ export class WjePermissionsApi {
|
|
|
4
4
|
* Sets the permission key.
|
|
5
5
|
* @param value
|
|
6
6
|
*/
|
|
7
|
-
static set permissionKey(value: any);
|
|
7
|
+
static set permissionKey(value: any | string);
|
|
8
8
|
/**
|
|
9
9
|
* Returns the permission key.
|
|
10
10
|
* @returns {*|string}
|
|
11
11
|
*/
|
|
12
|
-
static get permissionKey(): any;
|
|
12
|
+
static get permissionKey(): any | string;
|
|
13
13
|
/**
|
|
14
14
|
* Sets the permissions.
|
|
15
15
|
* @param value
|
|
@@ -17,7 +17,7 @@ export default class Accordion extends WJElement {
|
|
|
17
17
|
* Getter for the CSS stylesheet.
|
|
18
18
|
* @returns {object} The styles for the Accordion element.
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): object;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -39,7 +39,7 @@ export default class Accordion extends WJElement {
|
|
|
39
39
|
* Sets the value of the `index` attribute.
|
|
40
40
|
* @param {number|string} value The value to set for the `index` attribute.
|
|
41
41
|
*/
|
|
42
|
-
set index(value: number);
|
|
42
|
+
set index(value: number | string);
|
|
43
43
|
/**
|
|
44
44
|
* Retrieves the value of the `index` attribute as a number.
|
|
45
45
|
* @returns {number} The numerical value of the `index` attribute, or `0` if the attribute is not set.
|
|
@@ -12,7 +12,7 @@ export default class AccordionItem extends WJElement {
|
|
|
12
12
|
* Getter for the CSS stylesheet.
|
|
13
13
|
* @returns {object} The styles for the Accordion Item element.
|
|
14
14
|
*/
|
|
15
|
-
static get cssStyleSheet():
|
|
15
|
+
static get cssStyleSheet(): object;
|
|
16
16
|
/**
|
|
17
17
|
* Getter for the observed attributes.
|
|
18
18
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -13,7 +13,7 @@ export default class Animation extends WJElement {
|
|
|
13
13
|
* Getter for the CSS stylesheet.
|
|
14
14
|
* @returns {object} The styles for the Animation element.
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): object;
|
|
17
17
|
/**
|
|
18
18
|
* Getter for the observed attributes.
|
|
19
19
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -17,7 +17,7 @@ export default class Aside extends WJElement {
|
|
|
17
17
|
* Getter for the CSS stylesheet.
|
|
18
18
|
* @returns {object} The styles for the Aside element.
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): object;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An empty array as there are no observed attributes.
|
|
@@ -26,7 +26,7 @@ export default class Badge extends WJElement {
|
|
|
26
26
|
* return ['color'];
|
|
27
27
|
* }
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes(): string
|
|
29
|
+
static get observedAttributes(): Array<string>;
|
|
30
30
|
/**
|
|
31
31
|
* Creates the DOM structure for the Badge element.
|
|
32
32
|
* @returns {DocumentFragment} A document fragment containing the Badge's structure.
|
|
@@ -20,13 +20,13 @@ export default class Breadcrumb extends WJElement {
|
|
|
20
20
|
* @static
|
|
21
21
|
* @returns {object} styles - The CSS styles
|
|
22
22
|
*/
|
|
23
|
-
static get cssStyleSheet():
|
|
23
|
+
static get cssStyleSheet(): object;
|
|
24
24
|
/**
|
|
25
25
|
* Get observed attributes for the Breadcrumb element.
|
|
26
26
|
* @static
|
|
27
27
|
* @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes(): string
|
|
29
|
+
static get observedAttributes(): Array<string>;
|
|
30
30
|
_showSeparator: boolean;
|
|
31
31
|
showCollapsedIndicator: boolean;
|
|
32
32
|
/**
|
|
@@ -28,13 +28,13 @@ export default class Breadcrumbs extends WJElement {
|
|
|
28
28
|
* @static
|
|
29
29
|
* @returns {object} styles - The CSS styles
|
|
30
30
|
*/
|
|
31
|
-
static get cssStyleSheet():
|
|
31
|
+
static get cssStyleSheet(): object;
|
|
32
32
|
/**
|
|
33
33
|
* Get observed attributes for the Breadcrumb element.
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes(): string
|
|
37
|
+
static get observedAttributes(): Array<string>;
|
|
38
38
|
/**
|
|
39
39
|
* Last breadcrumb flag
|
|
40
40
|
* @type {boolean}
|
|
@@ -54,7 +54,7 @@ export default class Breadcrumbs extends WJElement {
|
|
|
54
54
|
* Get items before collapse attribute.
|
|
55
55
|
* @param {string} value
|
|
56
56
|
*/
|
|
57
|
-
set maxItems(value:
|
|
57
|
+
set maxItems(value: string);
|
|
58
58
|
/**
|
|
59
59
|
* Get items before collapse attribute.
|
|
60
60
|
* @returns {number}
|
|
@@ -33,7 +33,7 @@ export default class Button extends WJElement {
|
|
|
33
33
|
* @static
|
|
34
34
|
* @returns {Array<string>} observedAttributes - The observed attributes array for the Button element.
|
|
35
35
|
*/
|
|
36
|
-
static get observedAttributes(): string
|
|
36
|
+
static get observedAttributes(): Array<string>;
|
|
37
37
|
/**
|
|
38
38
|
* @summary A static property that indicates whether the custom element is form-associated or not.
|
|
39
39
|
* Form-associated custom elements are elements that can participate in form submission.
|
|
@@ -50,12 +50,12 @@ export default class Button extends WJElement {
|
|
|
50
50
|
* Properties of the element Button.
|
|
51
51
|
* @param value
|
|
52
52
|
*/
|
|
53
|
-
set color(value: string);
|
|
53
|
+
set color(value: string | string);
|
|
54
54
|
/**
|
|
55
55
|
* Get color of the Button element.
|
|
56
56
|
* @returns {string|string}
|
|
57
57
|
*/
|
|
58
|
-
get color(): string;
|
|
58
|
+
get color(): string | string;
|
|
59
59
|
/**
|
|
60
60
|
* Set variant of the Button element.
|
|
61
61
|
* @param value
|
|
@@ -80,12 +80,12 @@ export default class Button extends WJElement {
|
|
|
80
80
|
* Set variant of the Button element.
|
|
81
81
|
* @param value
|
|
82
82
|
*/
|
|
83
|
-
set dialog(value:
|
|
83
|
+
set dialog(value: string | object);
|
|
84
84
|
/**
|
|
85
85
|
* Get variant of the Button element.
|
|
86
86
|
* @returns {string|object}
|
|
87
87
|
*/
|
|
88
|
-
get dialog():
|
|
88
|
+
get dialog(): string | object;
|
|
89
89
|
/**
|
|
90
90
|
* Set active state of the Button element.
|
|
91
91
|
* @param {boolean} value The value to set
|
|
@@ -13,13 +13,13 @@ export default class ButtonGroup extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {object} styles - The CSS styles
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): object;
|
|
17
17
|
/**
|
|
18
18
|
* Get observed attributes for the ButtonGroup element.
|
|
19
19
|
* @static
|
|
20
20
|
* @returns {Array<string>} observedAttributes - The observed attributes array
|
|
21
21
|
*/
|
|
22
|
-
static get observedAttributes(): string
|
|
22
|
+
static get observedAttributes(): Array<string>;
|
|
23
23
|
/**
|
|
24
24
|
* Draw method for the ButtonGroup element.
|
|
25
25
|
* @returns {object} fragment - The document fragment
|
|
@@ -17,7 +17,7 @@ export default class Card extends WJElement {
|
|
|
17
17
|
* @static
|
|
18
18
|
* @returns {object} styles - The CSS styles
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): object;
|
|
21
21
|
/**
|
|
22
22
|
* Draw method for the Card element.
|
|
23
23
|
* @param {object} context The context object
|
|
@@ -13,7 +13,7 @@ export default class CardContent extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {object} styles - The CSS styles for the CardContent element.
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): object;
|
|
17
17
|
/**
|
|
18
18
|
* Draw method for the CardContent element.
|
|
19
19
|
* @returns {object} fragment - The document fragment containing the drawn element.
|
|
@@ -14,7 +14,7 @@ export default class CardControls extends WJElement {
|
|
|
14
14
|
* @static
|
|
15
15
|
* @returns {object} styles - The CSS styles
|
|
16
16
|
*/
|
|
17
|
-
static get cssStyleSheet():
|
|
17
|
+
static get cssStyleSheet(): object;
|
|
18
18
|
/**
|
|
19
19
|
* Draw method for the CardControls element.
|
|
20
20
|
* @returns {object} fragment - The document fragment
|
|
@@ -13,7 +13,7 @@ export default class CardHeader extends WJElement {
|
|
|
13
13
|
* @returns {object} The styles object.
|
|
14
14
|
* @static
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): object;
|
|
17
17
|
/**
|
|
18
18
|
* Draws the CardHeader.
|
|
19
19
|
* @returns {DocumentFragment} The created document fragment.
|
|
@@ -15,7 +15,7 @@ export default class CardSubtitle extends WJElement {
|
|
|
15
15
|
* @returns {object} The styles object.
|
|
16
16
|
* @static
|
|
17
17
|
*/
|
|
18
|
-
static get cssStyleSheet():
|
|
18
|
+
static get cssStyleSheet(): object;
|
|
19
19
|
/**
|
|
20
20
|
* Getter for the observed attributes.
|
|
21
21
|
* @returns {Array} An empty array.
|
|
@@ -17,7 +17,7 @@ export default class CardTitle extends WJElement {
|
|
|
17
17
|
* @returns {object} The styles object.
|
|
18
18
|
* @static
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): object;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An empty array.
|
|
@@ -23,12 +23,12 @@ export default class Carousel extends WJElement {
|
|
|
23
23
|
* Active slide attribute.
|
|
24
24
|
* @param value
|
|
25
25
|
*/
|
|
26
|
-
set activeSlide(value: number);
|
|
26
|
+
set activeSlide(value: number | number);
|
|
27
27
|
/**
|
|
28
28
|
* Active slide attribute.
|
|
29
29
|
* @returns {number|number}
|
|
30
30
|
*/
|
|
31
|
-
get activeSlide(): number;
|
|
31
|
+
get activeSlide(): number | number;
|
|
32
32
|
/**
|
|
33
33
|
* Pagination attribute.
|
|
34
34
|
* @returns {boolean}
|
|
@@ -27,7 +27,7 @@ export default class ColorPicker extends WJElement {
|
|
|
27
27
|
* @returns {object} The styles object.
|
|
28
28
|
* @static
|
|
29
29
|
*/
|
|
30
|
-
static get cssStyleSheet():
|
|
30
|
+
static get cssStyleSheet(): object;
|
|
31
31
|
/**
|
|
32
32
|
* Getter for the observed attributes.
|
|
33
33
|
* @returns {Array} An empty array.
|
|
@@ -50,17 +50,17 @@ export default class ColorPicker extends WJElement {
|
|
|
50
50
|
* Setter for the marker position.
|
|
51
51
|
* @param {object} value The new marker position.
|
|
52
52
|
*/
|
|
53
|
-
set markerPosition(value:
|
|
53
|
+
set markerPosition(value: object);
|
|
54
54
|
/**
|
|
55
55
|
* Getter for the marker position.
|
|
56
56
|
* @returns {object} The current marker position.
|
|
57
57
|
*/
|
|
58
|
-
get markerPosition():
|
|
58
|
+
get markerPosition(): object;
|
|
59
59
|
/**
|
|
60
60
|
* Setter for the color swatches.
|
|
61
61
|
* @param {string} value The new color swatches.
|
|
62
62
|
*/
|
|
63
|
-
set swatches(value:
|
|
63
|
+
set swatches(value: string);
|
|
64
64
|
/**
|
|
65
65
|
* Getter for the color swatches.
|
|
66
66
|
* @returns {Array} The current color swatches.
|
|
@@ -16,7 +16,7 @@ export default class Container extends WJElement {
|
|
|
16
16
|
* @returns {object} The styles object.
|
|
17
17
|
* @static
|
|
18
18
|
*/
|
|
19
|
-
static get cssStyleSheet():
|
|
19
|
+
static get cssStyleSheet(): object;
|
|
20
20
|
/**
|
|
21
21
|
* Getter for the observed attributes.
|
|
22
22
|
* @returns {Array} An empty array.
|
|
@@ -35,12 +35,12 @@ export default class Dialog extends WJElement {
|
|
|
35
35
|
* Sets the headline of the dialog.
|
|
36
36
|
* @param value
|
|
37
37
|
*/
|
|
38
|
-
set placement(value: string);
|
|
38
|
+
set placement(value: string | string);
|
|
39
39
|
/**
|
|
40
40
|
* Gets the headline of the dialog.
|
|
41
41
|
* @returns {string|string}
|
|
42
42
|
*/
|
|
43
|
-
get placement(): string;
|
|
43
|
+
get placement(): string | string;
|
|
44
44
|
/**
|
|
45
45
|
* Sets the headline of the dialog.
|
|
46
46
|
* @param value
|
|
@@ -30,12 +30,12 @@ export default class Dropdown extends WJElement {
|
|
|
30
30
|
* Sets the placement of the dropdown.
|
|
31
31
|
* @param value
|
|
32
32
|
*/
|
|
33
|
-
set trigger(value: string);
|
|
33
|
+
set trigger(value: string | string);
|
|
34
34
|
/**
|
|
35
35
|
* Gets the placement of the dropdown.
|
|
36
36
|
* @returns {string|string}
|
|
37
37
|
*/
|
|
38
|
-
get trigger(): string;
|
|
38
|
+
get trigger(): string | string;
|
|
39
39
|
/**
|
|
40
40
|
* Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.
|
|
41
41
|
* @param {Event} e The event object.
|
|
@@ -88,12 +88,12 @@ export default class WJElement extends HTMLElement {
|
|
|
88
88
|
* Gets the rendering context, either the shadow root or the component itself.
|
|
89
89
|
* @returns The rendering context.
|
|
90
90
|
*/
|
|
91
|
-
get context():
|
|
91
|
+
get context(): this | ShadowRoot;
|
|
92
92
|
/**
|
|
93
93
|
* Gets the store instance.
|
|
94
94
|
* @returns {object} The store instance.
|
|
95
95
|
*/
|
|
96
|
-
get store():
|
|
96
|
+
get store(): object;
|
|
97
97
|
/**
|
|
98
98
|
* @typedef {object} ArrayActions
|
|
99
99
|
* @property {Function} addAction - Adds an item to the array.
|
|
@@ -83,12 +83,12 @@ export default class FileUpload extends WJElement {
|
|
|
83
83
|
* Sets the autoProcessFiles attribute.
|
|
84
84
|
* @param value
|
|
85
85
|
*/
|
|
86
|
-
set autoProcessFiles(value: any);
|
|
86
|
+
set autoProcessFiles(value: any | boolean);
|
|
87
87
|
/**
|
|
88
88
|
* Gets the autoProcessFiles attribute.
|
|
89
89
|
* @returns {any|boolean}
|
|
90
90
|
*/
|
|
91
|
-
get autoProcessFiles(): any;
|
|
91
|
+
get autoProcessFiles(): any | boolean;
|
|
92
92
|
/**
|
|
93
93
|
* Sets the noUploadButton attribute.
|
|
94
94
|
* @param value
|
|
@@ -29,7 +29,7 @@ export default class FileUploadItem extends WJElement {
|
|
|
29
29
|
* @static
|
|
30
30
|
* @returns {Array<string>}
|
|
31
31
|
*/
|
|
32
|
-
static get observedAttributes(): string
|
|
32
|
+
static get observedAttributes(): Array<string>;
|
|
33
33
|
localizer: Localizer;
|
|
34
34
|
set size(value: string);
|
|
35
35
|
get size(): string;
|
|
@@ -34,7 +34,7 @@ export default class FormatDigital extends WJElement {
|
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>} - The attributes to observe.
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes(): string
|
|
37
|
+
static get observedAttributes(): Array<string>;
|
|
38
38
|
localizer: Localizer;
|
|
39
39
|
/**
|
|
40
40
|
* Sets the value of the digital format.
|
|
@@ -22,7 +22,7 @@ export default class Icon extends WJElement {
|
|
|
22
22
|
* @static
|
|
23
23
|
* @returns {Array<string>}
|
|
24
24
|
*/
|
|
25
|
-
static get observedAttributes(): string
|
|
25
|
+
static get observedAttributes(): Array<string>;
|
|
26
26
|
/**
|
|
27
27
|
* Draws the component.
|
|
28
28
|
* @param {object} context The context for drawing.
|
|
@@ -36,7 +36,7 @@ export default class IconPicker extends WJElement {
|
|
|
36
36
|
* @static
|
|
37
37
|
* @returns {Array<string>}
|
|
38
38
|
*/
|
|
39
|
-
static get observedAttributes(): string
|
|
39
|
+
static get observedAttributes(): Array<string>;
|
|
40
40
|
/**
|
|
41
41
|
* Dependencies of the IconPicker component.
|
|
42
42
|
* @property {object} dependencies
|
|
@@ -6,6 +6,10 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
6
6
|
* @augments {WJElement}
|
|
7
7
|
* @cssproperty --img-width - The width of the image
|
|
8
8
|
* @cssproperty --img-height - The height of the image
|
|
9
|
+
* @property {string} src - The source URL of the image.
|
|
10
|
+
* @property {string} alt - The alternative text for the image.
|
|
11
|
+
* @property {string} fallout - The action to perform when an error occurs while loading the image. The value can be a function or a predefined action like 'delete'.
|
|
12
|
+
* @property {string} loader - The URL of the image loader to display while the image is loading.
|
|
9
13
|
* @tag wje-img
|
|
10
14
|
*/
|
|
11
15
|
export default class Img extends WJElement {
|
|
@@ -20,17 +24,74 @@ export default class Img extends WJElement {
|
|
|
20
24
|
* @static
|
|
21
25
|
* @returns {Array<string>}
|
|
22
26
|
*/
|
|
23
|
-
static get observedAttributes(): string
|
|
27
|
+
static get observedAttributes(): Array<string>;
|
|
28
|
+
_fallout: boolean;
|
|
29
|
+
actions: {
|
|
30
|
+
delete: () => void;
|
|
31
|
+
log: () => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Sets the fallout property. Updates the `fallout` attribute if the value is a string;
|
|
35
|
+
* otherwise, assigns the value to the `_fallout` property.
|
|
36
|
+
* @param {string|*} value The value to set for the fallout property. If a string, it will update the `fallout` attribute; for other types, it will assign it to the `_fallout` property.
|
|
37
|
+
*/
|
|
38
|
+
set fallout(value: string | any);
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the value of the 'fallout' attribute if it exists, otherwise returns the internal `_fallout` property.
|
|
41
|
+
* @returns {string|null} The value of the 'fallout' attribute or the `_fallout` property if the attribute is not present. Returns null if no value is found.
|
|
42
|
+
*/
|
|
43
|
+
get fallout(): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the value of the loader attribute.
|
|
46
|
+
* @param {string} value The value to set for the loader attribute.
|
|
47
|
+
*/
|
|
24
48
|
set loader(value: string);
|
|
25
|
-
get loader(): string;
|
|
26
49
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @returns {
|
|
50
|
+
* Retrieves the value of the 'loader' attribute from the element.
|
|
51
|
+
* @returns {string|null} The value of the 'loader' attribute if set, otherwise null.
|
|
52
|
+
*/
|
|
53
|
+
get loader(): string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Creates and assembles a lazy-loaded image element within a document fragment.
|
|
56
|
+
* @returns {DocumentFragment} A document fragment containing the image element.
|
|
29
57
|
*/
|
|
30
58
|
draw(): DocumentFragment;
|
|
31
59
|
native: HTMLImageElement;
|
|
32
60
|
/**
|
|
33
|
-
*
|
|
61
|
+
* Handles post-draw operations, such as setting up a lazy image loader using an IntersectionObserver.
|
|
62
|
+
* Observes when the target element becomes visible in the viewport and updates its source with the provided image source.
|
|
63
|
+
* Removes the `lazy` class once the image source is updated and unobserves the element.
|
|
64
|
+
* It also invokes the `onerrorFunc` method at the beginning to handle potential error scenarios.
|
|
65
|
+
* @returns {void} Does not return a value.
|
|
34
66
|
*/
|
|
35
67
|
afterDraw(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Deletes the current image by calling the remove method.
|
|
70
|
+
* This function is typically used to trigger the removal of an image element
|
|
71
|
+
* or perform cleanup operations related to the image.
|
|
72
|
+
*/
|
|
73
|
+
deleteImage: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Adds a new action to the internal actions object.
|
|
76
|
+
* @param {string} name The name of the action to be added.
|
|
77
|
+
* @param {Function} func The function representing the action logic.
|
|
78
|
+
* @returns {void} This method does not return a value.
|
|
79
|
+
*/
|
|
80
|
+
addAction(name: string, func: Function): void;
|
|
81
|
+
/**
|
|
82
|
+
* Removes an action from the actions list if it exists.
|
|
83
|
+
* @param {string} name The name of the action to remove.
|
|
84
|
+
* @returns {void} Does not return a value.
|
|
85
|
+
*/
|
|
86
|
+
removeAction(name: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Handles error scenarios by checking the `fallout` property and performing
|
|
89
|
+
* corresponding actions. If `fallout` is not defined, the function terminates
|
|
90
|
+
* early. Logs the active actions and attempts to assign an error handler
|
|
91
|
+
* based on the `fallout` value. If the `fallout` value does not correspond to
|
|
92
|
+
* a recognized action, it logs an error message.
|
|
93
|
+
* @function onerrorFunc
|
|
94
|
+
* @memberof Img
|
|
95
|
+
*/
|
|
96
|
+
onerrorFunc: () => void;
|
|
36
97
|
}
|
|
@@ -29,7 +29,7 @@ export default class ImgComparer extends WJElement {
|
|
|
29
29
|
* @static
|
|
30
30
|
* @returns {Array<string>}
|
|
31
31
|
*/
|
|
32
|
-
static get observedAttributes(): string
|
|
32
|
+
static get observedAttributes(): Array<string>;
|
|
33
33
|
/**
|
|
34
34
|
* Dependencies of the ImgComparer component.
|
|
35
35
|
* @property {object} dependencies
|
|
@@ -25,7 +25,7 @@ export default class InfiniteScroll extends WJElement {
|
|
|
25
25
|
* @static
|
|
26
26
|
* @returns {Array<string>}
|
|
27
27
|
*/
|
|
28
|
-
static get observedAttributes(): string
|
|
28
|
+
static get observedAttributes(): Array<string>;
|
|
29
29
|
totalPages: number;
|
|
30
30
|
isLoading: any[];
|
|
31
31
|
_response: {};
|
|
@@ -47,12 +47,12 @@ export default class InfiniteScroll extends WJElement {
|
|
|
47
47
|
* Dependencies of the InfiniteScroll component.
|
|
48
48
|
* @param value
|
|
49
49
|
*/
|
|
50
|
-
set response(value: any);
|
|
50
|
+
set response(value: any | {});
|
|
51
51
|
/**
|
|
52
52
|
* Getter for the response property.
|
|
53
53
|
* @returns {*|{}}
|
|
54
54
|
*/
|
|
55
|
-
get response(): any;
|
|
55
|
+
get response(): any | {};
|
|
56
56
|
/**
|
|
57
57
|
* Dependencies of the InfiniteScroll component.
|
|
58
58
|
* @param value
|