wj-elements 0.1.174 → 0.1.176
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/{list.element-Ce1vIm1O.js → list.element-D4-wlFN_.js} +2 -2
- package/dist/{list.element-Ce1vIm1O.js.map → list.element-D4-wlFN_.js.map} +1 -1
- package/dist/localize.js +34 -6
- package/dist/localize.js.map +1 -1
- package/dist/packages/localize/localize.d.ts +37 -7
- package/dist/packages/wje-element/element.d.ts +28 -36
- package/dist/packages/wje-masonry/masonry.element.d.ts +1 -1
- package/dist/packages/wje-select/select.element.d.ts +23 -9
- package/dist/packages/wje-stepper/stepper.element.d.ts +7 -6
- package/dist/wje-element.js +111 -110
- package/dist/wje-element.js.map +1 -1
- package/dist/wje-list.js +1 -1
- package/dist/wje-masonry.js.map +1 -1
- package/dist/wje-master.js +1 -1
- package/dist/wje-options.js +1 -1
- package/dist/wje-orgchart-item.js +1 -1
- package/dist/wje-routerx.js.map +1 -1
- package/dist/wje-select.js +77 -32
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-stepper.js +79 -31
- package/dist/wje-stepper.js.map +1 -1
- package/dist/wje-tree-item.js +2 -4
- package/dist/wje-tree-item.js.map +1 -1
- package/dist/wje-tree.js +4 -0
- package/dist/wje-tree.js.map +1 -1
- package/package.json +2 -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
|
@@ -2,7 +2,7 @@ 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 from "./wje-element.js";
|
|
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}";
|
|
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 --wje-item-border-width: 0!important;\n}";
|
|
6
6
|
class List extends WJElement {
|
|
7
7
|
/**
|
|
8
8
|
* Creates an instance of List.
|
|
@@ -47,4 +47,4 @@ class List extends WJElement {
|
|
|
47
47
|
export {
|
|
48
48
|
List as L
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=list.element-
|
|
50
|
+
//# sourceMappingURL=list.element-D4-wlFN_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.element-
|
|
1
|
+
{"version":3,"file":"list.element-D4-wlFN_.js","sources":["../packages/wje-list/list.element.js"],"sourcesContent":["import WJElement from '../wje-element/element.js';\nimport styles from './styles/styles.scss?inline';\n\n/**\n * `List` is a custom web component that represents a list.\n * It extends from `WJElement`.\n * @summary This element represents a list.\n * @documentation https://elements.webjet.sk/components/list\n * @status stable\n * @augments {WJElement}\n * @slot - The default slot for the list.\n * @cssproperty [--wje-list-inset-padding=1rem] - The padding of the list when it is inset.\n * @cssproperty [--wje-list-border-radius=8px] - The border radius of the list. Accepts any valid CSS length.\n * @cssproperty [--wje-list-background=var(--wje-background)] - The background of the list. Accepts any valid CSS color value.\n * @tag wje-list\n */\nexport default class List extends WJElement {\n /**\n * Creates an instance of List.\n * @class\n */\n constructor() {\n super();\n }\n\n className = 'List';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let element = document.createElement('slot');\n fragment.appendChild(element);\n\n return fragment;\n }\n\n /**\n * Called after the component has been drawn.\n */\n afterDraw() {\n this.classList.toggle('wje-lines-' + this.lines, this.hasAttribute('lines'));\n this.classList.toggle('wje-inset', this.hasAttribute('inset'));\n }\n}\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,aAAa,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKxC,cAAc;AACV,UAAO;AAGX,qCAAY;AAAA,EAFhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,UAAU,SAAS,cAAc,MAAM;AAC3C,aAAS,YAAY,OAAO;AAE5B,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,UAAU,OAAO,eAAe,KAAK,OAAO,KAAK,aAAa,OAAO,CAAC;AAC3E,SAAK,UAAU,OAAO,aAAa,KAAK,aAAa,OAAO,CAAC;AAAA,EACrE;AACA;"}
|
package/dist/localize.js
CHANGED
|
@@ -18,27 +18,55 @@ class LocalizerDefault {
|
|
|
18
18
|
console.error(`Language "${this.lang}" not loaded.`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Translates a given translation key based on the currently selected language.
|
|
23
|
+
* @param {string} key The key representing the text to be translated.
|
|
24
|
+
* @returns {string} The translated text if available; otherwise, returns the original key.
|
|
25
|
+
*/
|
|
22
26
|
translate(key) {
|
|
23
27
|
var _a;
|
|
24
28
|
const langMap = (_a = this.languages) == null ? void 0 : _a.get(this.currentLang);
|
|
25
29
|
if (!langMap) return key;
|
|
26
30
|
return langMap ? langMap[key] || key : key;
|
|
27
31
|
}
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Translates a key into a localized string based on the provided count and pluralization type.
|
|
34
|
+
* @param {string} key The base translation key to be used for fetching the localized string.
|
|
35
|
+
* @param {number} [count=0] The count value used to determine the pluralization form.
|
|
36
|
+
* @param {string} [type='cardinal'] The type of pluralization to use, such as 'cardinal' or 'ordinal'.
|
|
37
|
+
* @returns {string} The translated string, adapted to the pluralization rules and count.
|
|
38
|
+
*/
|
|
29
39
|
translatePlural(key, count = 0, type = "cardinal") {
|
|
30
40
|
const plural = new Intl.PluralRules(this.lang, { type });
|
|
31
41
|
if (count !== void 0) key += "." + plural.select(count);
|
|
32
42
|
return this.translate(key);
|
|
33
43
|
}
|
|
34
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Formats a number according to the specified locale and formatting options.
|
|
46
|
+
* @param {number} number The numeric value to format.
|
|
47
|
+
* @param {object} options An object containing formatting options for the number.
|
|
48
|
+
* @returns {string} The formatted number as a string.
|
|
49
|
+
*/
|
|
35
50
|
formatNumber(number, options) {
|
|
36
51
|
return new Intl.NumberFormat(this.currentLang, options).format(number);
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Formats a given date based on the specified options and the current language setting.
|
|
55
|
+
* @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.
|
|
56
|
+
* @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.
|
|
57
|
+
* @returns {string} The formatted date string based on the specified options and current language.
|
|
58
|
+
*/
|
|
59
|
+
formatDate(date, options) {
|
|
60
|
+
return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));
|
|
41
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Formats a relative time string based on a given language, value, unit, and formatting options.
|
|
64
|
+
* @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.
|
|
65
|
+
* @param {number} value The numerical value to format, representing the time difference.
|
|
66
|
+
* @param {string} [unit] The unit of time to use (e.g., "second", "minute", "hour", "day", "week", "month", "year").
|
|
67
|
+
* @param {object} [options] An object containing formatting options, such as the style for the numeric representation.
|
|
68
|
+
* @returns {string} The formatted relative time string in the specified language.
|
|
69
|
+
*/
|
|
42
70
|
relativeTime(lang, value = 0, unit = "day", options = { numeric: "auto" }) {
|
|
43
71
|
lang = lang || this.currentLang;
|
|
44
72
|
return new Intl.RelativeTimeFormat(lang, options).format(value, unit);
|
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
|
|
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 /**\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 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=0] The count value used to determine the pluralization form.\n * @param {string} [type='cardinal'] The type of pluralization to use, such as 'cardinal' or 'ordinal'.\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.lang, { type: type });\n\n if (count !== undefined) key += '.' + plural.select(count);\n\n return this.translate(key);\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,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;AAAA;AAAA;AAAA;AAAA,EAOI,UAAU,KAAK;AA/BnB;AAgCQ,UAAM,WAAU,UAAK,cAAL,mBAAgB,IAAI,KAAK;AACzC,QAAI,CAAC,QAAS,QAAO;AACrB,WAAO,UAAU,QAAQ,GAAG,KAAK,MAAM;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,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;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,aAAa,QAAQ,SAAS;AAC1B,WAAO,IAAI,KAAK,aAAa,KAAK,aAAa,OAAO,EAAE,OAAO,MAAM;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,WAAW,MAAM,SAAS;AACtB,WAAO,IAAI,KAAK,eAAe,KAAK,aAAa,OAAO,EAAE,OAAO,IAAI,KAAK,IAAI,CAAC;AAAA,EACvF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,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;AClGO,MAAM,kBAAkB,iBAAiB;AAAA,EAC5C,YAAY,SAAS;AACjB,UAAM,OAAO;AAAA,EACrB;AAAA,EACI,OAAO,uBAAuB,aAAa;AACvC,wBAAoB,GAAG,WAAW;AAAA,EAC1C;AACA;"}
|
|
@@ -7,11 +7,41 @@ export class LocalizerDefault {
|
|
|
7
7
|
currentLang: string;
|
|
8
8
|
get languages(): any;
|
|
9
9
|
setLanguage(): void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Translates a given translation key based on the currently selected language.
|
|
12
|
+
* @param {string} key The key representing the text to be translated.
|
|
13
|
+
* @returns {string} The translated text if available; otherwise, returns the original key.
|
|
14
|
+
*/
|
|
15
|
+
translate(key: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Translates a key into a localized string based on the provided count and pluralization type.
|
|
18
|
+
* @param {string} key The base translation key to be used for fetching the localized string.
|
|
19
|
+
* @param {number} [count=0] The count value used to determine the pluralization form.
|
|
20
|
+
* @param {string} [type='cardinal'] The type of pluralization to use, such as 'cardinal' or 'ordinal'.
|
|
21
|
+
* @returns {string} The translated string, adapted to the pluralization rules and count.
|
|
22
|
+
*/
|
|
23
|
+
translatePlural(key: string, count?: number, type?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Formats a number according to the specified locale and formatting options.
|
|
26
|
+
* @param {number} number The numeric value to format.
|
|
27
|
+
* @param {object} options An object containing formatting options for the number.
|
|
28
|
+
* @returns {string} The formatted number as a string.
|
|
29
|
+
*/
|
|
30
|
+
formatNumber(number: number, options: object): string;
|
|
31
|
+
/**
|
|
32
|
+
* Formats a given date based on the specified options and the current language setting.
|
|
33
|
+
* @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.
|
|
34
|
+
* @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.
|
|
35
|
+
* @returns {string} The formatted date string based on the specified options and current language.
|
|
36
|
+
*/
|
|
37
|
+
formatDate(date: string | Date | number, options: object): string;
|
|
38
|
+
/**
|
|
39
|
+
* Formats a relative time string based on a given language, value, unit, and formatting options.
|
|
40
|
+
* @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.
|
|
41
|
+
* @param {number} value The numerical value to format, representing the time difference.
|
|
42
|
+
* @param {string} [unit] The unit of time to use (e.g., "second", "minute", "hour", "day", "week", "month", "year").
|
|
43
|
+
* @param {object} [options] An object containing formatting options, such as the style for the numeric representation.
|
|
44
|
+
* @returns {string} The formatted relative time string in the specified language.
|
|
45
|
+
*/
|
|
46
|
+
relativeTime(lang: string, value?: number, unit?: string, options?: object): string;
|
|
17
47
|
}
|
|
@@ -18,12 +18,10 @@ export default class WJElement extends HTMLElement {
|
|
|
18
18
|
* @param [options] Additional options for defining the element.
|
|
19
19
|
*/
|
|
20
20
|
static define(name: any, elementConstructor?: typeof WJElement, options?: {}): void;
|
|
21
|
-
isAttached: boolean;
|
|
22
21
|
service: UniversalService;
|
|
23
|
-
rendering: boolean;
|
|
24
22
|
_dependencies: {};
|
|
25
23
|
/**
|
|
26
|
-
* @typedef {
|
|
24
|
+
* @typedef {object} DrawingStatuses
|
|
27
25
|
* @property {number} CREATED - The component has been created.
|
|
28
26
|
* @property {number} ATTACHED - The component has been attached to the DOM.
|
|
29
27
|
* @property {number} BEGINING - The component is beginning to draw.
|
|
@@ -32,6 +30,30 @@ export default class WJElement extends HTMLElement {
|
|
|
32
30
|
* @property {number} DONE - The component has finished drawing.
|
|
33
31
|
* @property {number} DISCONNECTED - The component has been disconnected from the DOM.
|
|
34
32
|
*/
|
|
33
|
+
/**
|
|
34
|
+
* WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,
|
|
35
|
+
* permission-based visibility, and extensibility hooks.
|
|
36
|
+
* @property {boolean} isAttached - True if the component is currently attached to the DOM.
|
|
37
|
+
* @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.
|
|
38
|
+
* @property {number} drawingStatus - Current drawing status (see drawingStatuses).
|
|
39
|
+
* @property {boolean} _pristine - True if the component has not been updated since last render.
|
|
40
|
+
* @property {boolean} isRendering - True if a render is currently in progress.
|
|
41
|
+
* @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.
|
|
42
|
+
* @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.
|
|
43
|
+
* @property {object} params - Stores the current attributes/properties for rendering.
|
|
44
|
+
* @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.
|
|
45
|
+
* @property {string[]} permission - List of required permissions (from 'permission' attribute).
|
|
46
|
+
* @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).
|
|
47
|
+
* @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).
|
|
48
|
+
* @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.
|
|
49
|
+
* @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.
|
|
50
|
+
* @property {string} shadowType - Type of shadow root ('open' by default).
|
|
51
|
+
* @property {object} store - Reference to the global store instance.
|
|
52
|
+
* @property {object} defaultStoreActions - Default store actions for arrays and objects.
|
|
53
|
+
* @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).
|
|
54
|
+
* @property {object} dependencies - Registered component dependencies.
|
|
55
|
+
* @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).
|
|
56
|
+
*/
|
|
35
57
|
drawingStatuses: {
|
|
36
58
|
CREATED: number;
|
|
37
59
|
ATTACHED: number;
|
|
@@ -41,16 +63,12 @@ export default class WJElement extends HTMLElement {
|
|
|
41
63
|
DONE: number;
|
|
42
64
|
DISCONNECTED: number;
|
|
43
65
|
};
|
|
44
|
-
drawingStatus: number;
|
|
45
|
-
_pristine: boolean;
|
|
46
|
-
_pristineCauseWeakMap: WeakMap<WeakKey, any>;
|
|
47
|
-
isRendering: boolean;
|
|
48
66
|
rafId: number;
|
|
49
|
-
originalVisibility: any;
|
|
50
67
|
params: {};
|
|
51
68
|
updateComplete: Promise<any>;
|
|
52
69
|
finisPromise: (value: any) => void;
|
|
53
70
|
rejectPromise: (reason?: any) => void;
|
|
71
|
+
get drawingStatus(): number;
|
|
54
72
|
/**
|
|
55
73
|
* Sets the value of the 'permission' attribute.
|
|
56
74
|
* @param {string[]} value The value to set for the 'permission' attribute.
|
|
@@ -97,7 +115,7 @@ export default class WJElement extends HTMLElement {
|
|
|
97
115
|
* Gets the rendering context, either the shadow root or the component itself.
|
|
98
116
|
* @returns The rendering context.
|
|
99
117
|
*/
|
|
100
|
-
get context():
|
|
118
|
+
get context(): this | ShadowRoot;
|
|
101
119
|
/**
|
|
102
120
|
* Gets the store instance.
|
|
103
121
|
* @returns {object} The store instance.
|
|
@@ -230,11 +248,6 @@ export default class WJElement extends HTMLElement {
|
|
|
230
248
|
* Lifecycle method invoked when the component is disconnected from the DOM.
|
|
231
249
|
*/
|
|
232
250
|
disconnectedCallback(): void;
|
|
233
|
-
/**
|
|
234
|
-
* Enqueues an update for the component.
|
|
235
|
-
* This method processes the current render promise and then refreshes the component.
|
|
236
|
-
*/
|
|
237
|
-
enqueueUpdate(): void;
|
|
238
251
|
/**
|
|
239
252
|
* Lifecycle method invoked when an observed attribute changes.
|
|
240
253
|
* @param name The name of the attribute that changed.
|
|
@@ -243,18 +256,6 @@ export default class WJElement extends HTMLElement {
|
|
|
243
256
|
*/
|
|
244
257
|
attributeChangedCallback(name: any, old: any, newName: any): void;
|
|
245
258
|
refresh(): void;
|
|
246
|
-
/**
|
|
247
|
-
* Refreshes the component by reinitializing it if it is in a drawing state.
|
|
248
|
-
* This method checks if the component's drawing status is at least in the START state.
|
|
249
|
-
* If so, it performs the following steps:
|
|
250
|
-
* 1. Calls the `beforeRedraw` hook if defined.
|
|
251
|
-
* 2. Calls the `beforeDisconnect` hook if defined.
|
|
252
|
-
* 3. Refreshes the update promise to manage the rendering lifecycle.
|
|
253
|
-
* 4. Calls the `afterDisconnect` hook if defined.
|
|
254
|
-
* 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.
|
|
255
|
-
* If the component is not in a drawing state, it simply returns a resolved promise.
|
|
256
|
-
*/
|
|
257
|
-
_refresh(): Promise<void>;
|
|
258
259
|
stopRenderLoop(): void;
|
|
259
260
|
/**
|
|
260
261
|
* Displays the component's content, optionally forcing a re-render.
|
|
@@ -272,10 +273,8 @@ export default class WJElement extends HTMLElement {
|
|
|
272
273
|
* @param {string} name The name in kebab-case format (e.g., "example-name").
|
|
273
274
|
* @returns {string} The sanitized name in camelCase format (e.g., "exampleName").
|
|
274
275
|
* @example
|
|
275
|
-
* // Returns 'exampleName'
|
|
276
276
|
* sanitizeName('example-name');
|
|
277
277
|
* @example
|
|
278
|
-
* // Returns 'myCustomComponent'
|
|
279
278
|
* sanitizeName('my-custom-component');
|
|
280
279
|
*/
|
|
281
280
|
sanitizeName(name: string): string;
|
|
@@ -291,11 +290,9 @@ export default class WJElement extends HTMLElement {
|
|
|
291
290
|
* get name() { return 'value'; },
|
|
292
291
|
* set name(val) { console.log(val); }
|
|
293
292
|
* };
|
|
294
|
-
* // Returns { hasGetter: [Function: get name], hasSetter: [Function: set name] }
|
|
295
293
|
* checkGetterSetter(obj, 'name');
|
|
296
294
|
* @example
|
|
297
295
|
* const obj = { prop: 42 };
|
|
298
|
-
* // Returns { hasGetter: null, hasSetter: null }
|
|
299
296
|
* checkGetterSetter(obj, 'prop');
|
|
300
297
|
*/
|
|
301
298
|
checkGetterSetter(obj: object, property: string): object;
|
|
@@ -303,12 +300,7 @@ export default class WJElement extends HTMLElement {
|
|
|
303
300
|
* Sets up property accessors for the component's attributes.
|
|
304
301
|
*/
|
|
305
302
|
setUpAccessors(): void;
|
|
306
|
-
|
|
307
|
-
* Resolves the rendering process of the component.
|
|
308
|
-
* @returns A promise that resolves when rendering is complete.
|
|
309
|
-
* @private
|
|
310
|
-
*/
|
|
311
|
-
private _resolveRender;
|
|
303
|
+
#private;
|
|
312
304
|
}
|
|
313
305
|
export let __esModule: string;
|
|
314
306
|
export { WjePermissionsApi, WjElementUtils, event };
|
|
@@ -9,7 +9,7 @@ import { default as WJElement } from '../wje-element/element.js';
|
|
|
9
9
|
* @csspart native - The native part of the masonry layout.
|
|
10
10
|
* @csspart column - The individual columns in the masonry layout.
|
|
11
11
|
* @slot - The default slot for the masonry layout.
|
|
12
|
-
* @cssproperty [--wje-masonry-gap=1rem] - The gap between items in the masonry layout. Accepts any valid CSS length. Default is 1rem.
|
|
12
|
+
* @cssproperty [--wje-masonry-layout-gap=1rem] - The gap between items in the masonry layout. Accepts any valid CSS length. Default is 1rem.
|
|
13
13
|
* @cssproperty [--wje-masonry-layout-col-count=1] - The count column in the masonry layout. Accepts any valid CSS length.
|
|
14
14
|
* @tag wje-masonry
|
|
15
15
|
*/
|
|
@@ -164,9 +164,9 @@ export default class Select extends WJElement {
|
|
|
164
164
|
set value(value: string);
|
|
165
165
|
/**
|
|
166
166
|
* Getter for the value attribute.
|
|
167
|
-
* @returns {
|
|
167
|
+
* @returns {object} The value of the attribute.
|
|
168
168
|
*/
|
|
169
|
-
get value():
|
|
169
|
+
get value(): object;
|
|
170
170
|
/**
|
|
171
171
|
* Getter for the customErrorDisplay attribute.
|
|
172
172
|
* @returns {boolean} Whether the attribute is present.
|
|
@@ -255,6 +255,7 @@ export default class Select extends WJElement {
|
|
|
255
255
|
* @returns {Array} The selected value.
|
|
256
256
|
*/
|
|
257
257
|
get selected(): any[];
|
|
258
|
+
get options(): any[];
|
|
258
259
|
/**
|
|
259
260
|
* Sets the trigger value.
|
|
260
261
|
* @param {string} value The trigger value to set.
|
|
@@ -313,15 +314,26 @@ export default class Select extends WJElement {
|
|
|
313
314
|
getSelected(): any[];
|
|
314
315
|
/**
|
|
315
316
|
* Handles the selection change.
|
|
316
|
-
* @param {Element}
|
|
317
|
+
* @param {Element[]} options The option that changed.
|
|
317
318
|
* @param {number} length The length of the selected options.
|
|
318
319
|
*/
|
|
319
|
-
selectionChanged(
|
|
320
|
-
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* @
|
|
324
|
-
* @
|
|
320
|
+
selectionChanged(options?: Element[], length?: number): void;
|
|
321
|
+
/**
|
|
322
|
+
* Updates the selected options and their corresponding chips.
|
|
323
|
+
* @param {boolean} [silence] Determines whether to suppress the "wje-select:change" event.
|
|
324
|
+
* @returns {void}
|
|
325
|
+
* @description
|
|
326
|
+
* This method fetches the currently selected options and updates the `selectedOptions` array.
|
|
327
|
+
* It clears and rebuilds the chips representing the selected items in the UI.
|
|
328
|
+
* If the number of selected options reaches the maximum allowed (`maxOptions`), it stops updating the counter.
|
|
329
|
+
* Optionally, it dispatches a custom event when the selection changes unless `silence` is set to `true`.
|
|
330
|
+
* //@fires wje-select:change - Dispatched when the selection changes, unless `silence` is `true`.
|
|
331
|
+
* @example
|
|
332
|
+
* // Call the method and allow event dispatch
|
|
333
|
+
* selections();
|
|
334
|
+
* @example
|
|
335
|
+
* // Call the method without dispatching the event
|
|
336
|
+
* selections(true);
|
|
325
337
|
*/
|
|
326
338
|
selections(silence?: boolean): void;
|
|
327
339
|
/**
|
|
@@ -379,6 +391,7 @@ export default class Select extends WJElement {
|
|
|
379
391
|
* @param {boolean} [silent] Whether to trigger the change event or not.
|
|
380
392
|
*/
|
|
381
393
|
selectOptions(values: any[] | any, silent?: boolean): void;
|
|
394
|
+
htmlSelectedItem(item: any): any;
|
|
382
395
|
/**
|
|
383
396
|
* @summary Callback function that is called when the custom element is associated with a form.
|
|
384
397
|
* This function adds an event listener to the form's submit event, which validates the input and propagates the validation.
|
|
@@ -421,4 +434,5 @@ export default class Select extends WJElement {
|
|
|
421
434
|
* @returns {boolean} Returns true if all elements in the `elements` array are found within the `options` array, otherwise returns false.
|
|
422
435
|
*/
|
|
423
436
|
areAllElementsInOptions(elements: any[], options: any[]): boolean;
|
|
437
|
+
#private;
|
|
424
438
|
}
|
|
@@ -19,6 +19,7 @@ export default class Stepper extends WJElement {
|
|
|
19
19
|
currentStep: number;
|
|
20
20
|
localizer: Localizer;
|
|
21
21
|
steps: any[];
|
|
22
|
+
headerSteps: any[];
|
|
22
23
|
get active(): string;
|
|
23
24
|
get done(): string;
|
|
24
25
|
/**
|
|
@@ -27,10 +28,10 @@ export default class Stepper extends WJElement {
|
|
|
27
28
|
*/
|
|
28
29
|
draw(): DocumentFragment;
|
|
29
30
|
header: HTMLDivElement;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
processStep(index: any, step: any, header: any, steps: any):
|
|
31
|
+
prev: HTMLSlotElement;
|
|
32
|
+
next: HTMLSlotElement;
|
|
33
|
+
finish: HTMLSlotElement;
|
|
34
|
+
processStep(index: any, step: any, header: any, steps: any): HTMLDivElement;
|
|
34
35
|
/**
|
|
35
36
|
* Sets up the attributes for the component.
|
|
36
37
|
*/
|
|
@@ -44,12 +45,11 @@ export default class Stepper extends WJElement {
|
|
|
44
45
|
/**
|
|
45
46
|
* Navigates to a specific step in a multi-step process and updates the stepper UI accordingly.
|
|
46
47
|
* @param {number} stepIndex The index of the step to navigate to.
|
|
47
|
-
* @param {number} direction The navigation direction. A positive value indicates forward navigation, and a negative value indicates backward navigation.
|
|
48
48
|
* //@fires stepper:next Dispatched when navigating to the next step.
|
|
49
49
|
* //@fires stepper:prev Dispatched when navigating to the previous step.
|
|
50
50
|
* //@fires stepper:finish Dispatched when the final step is completed.
|
|
51
51
|
*/
|
|
52
|
-
goToStep(stepIndex: number
|
|
52
|
+
goToStep(stepIndex: number): void;
|
|
53
53
|
/**
|
|
54
54
|
* Resets a step to its default state by clearing its active and done attributes.
|
|
55
55
|
* Updates the step's badge to show its index and removes any color styling.
|
|
@@ -76,4 +76,5 @@ export default class Stepper extends WJElement {
|
|
|
76
76
|
* @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.
|
|
77
77
|
*/
|
|
78
78
|
setStepDone(nav: HTMLElement, badge?: HTMLElement | null): void;
|
|
79
|
+
setStepLocked(nav: any, badge?: any): void;
|
|
79
80
|
}
|