wj-elements 0.1.211 → 0.1.213
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 -0
- package/dist/packages/wje-checkbox/checkbox.element.d.ts +2 -1
- package/dist/wje-checkbox.js +34 -8
- package/dist/wje-checkbox.js.map +1 -1
- package/dist/wje-input.js +2 -1
- package/dist/wje-input.js.map +1 -1
- package/dist/wje-radio-group.js +19 -1
- package/dist/wje-radio-group.js.map +1 -1
- package/dist/wje-select.js +2 -2
- package/dist/wje-select.js.map +1 -1
- package/package.json +1 -1
package/dist/localize.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1
4
|
class LocalizerDefault {
|
|
2
5
|
constructor(element) {
|
|
6
|
+
__publicField(this, "convertLangCode", (lang) => lang.replace("-", "_").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`));
|
|
3
7
|
this.element = element;
|
|
4
|
-
this.lang = this.element.lang || document.documentElement.lang || "en-
|
|
8
|
+
this.lang = this.element.lang || document.documentElement.lang || "en-GB";
|
|
5
9
|
this.dir = this.element.dir || document.documentElement.dir || "ltr";
|
|
6
|
-
this.currentLang = "en-
|
|
10
|
+
this.currentLang = "en-GB";
|
|
7
11
|
this.setLanguage();
|
|
8
12
|
}
|
|
9
13
|
get languages() {
|
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-
|
|
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 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;AAuBrB,2CAAkB,CAAC,SAAS,KAAK,QAAQ,KAAK,GAAG,EAAE,QAAQ,gBAAgB,CAAC,GAAG,SAAS,IAAI,KAAK,YAAa,CAAA,EAAE;AAtB5G,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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AuB,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;ACpGO,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,6 +7,7 @@ export class LocalizerDefault {
|
|
|
7
7
|
currentLang: string;
|
|
8
8
|
get languages(): any;
|
|
9
9
|
setLanguage(): void;
|
|
10
|
+
convertLangCode: (lang: any) => any;
|
|
10
11
|
/**
|
|
11
12
|
* Translates a given translation key based on the currently selected language.
|
|
12
13
|
* @param {string} key The key representing the text to be translated.
|
|
@@ -13,7 +13,7 @@ import { FormAssociatedElement } from '../internals/form-associated-element.js';
|
|
|
13
13
|
* @cssproperty [--wje-checkbox-border-style=solid] - Border style of the component;
|
|
14
14
|
* @cssproperty [--wje-checkbox-border-color=--wje-color-contrast-1] - Border color of the component;
|
|
15
15
|
* @cssproperty [--wje-checkbox-margin-inline=0] - Margin inline of the component;
|
|
16
|
-
*
|
|
16
|
+
* @fires wje-checkbox:change - Dispatched when the checkbox state changes;
|
|
17
17
|
*/
|
|
18
18
|
export default class Checkbox extends FormAssociatedElement {
|
|
19
19
|
/**
|
|
@@ -85,6 +85,7 @@ export default class Checkbox extends FormAssociatedElement {
|
|
|
85
85
|
* @returns {boolean} true if the toggle is checked, false otherwise
|
|
86
86
|
*/
|
|
87
87
|
get checked(): boolean;
|
|
88
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
88
89
|
/**
|
|
89
90
|
* Draws the checkbox element.
|
|
90
91
|
* @returns {DocumentFragment} The created fragment.
|
package/dist/wje-checkbox.js
CHANGED
|
@@ -19,7 +19,7 @@ class Checkbox extends FormAssociatedElement {
|
|
|
19
19
|
*/
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
|
-
__privateAdd(this, _internalValue
|
|
22
|
+
__privateAdd(this, _internalValue);
|
|
23
23
|
/**
|
|
24
24
|
* The class name for the Checkbox.
|
|
25
25
|
*/
|
|
@@ -32,12 +32,9 @@ class Checkbox extends FormAssociatedElement {
|
|
|
32
32
|
* @param {string} value The value to set.
|
|
33
33
|
*/
|
|
34
34
|
set value(value) {
|
|
35
|
-
this.internals.setFormValue(value);
|
|
36
35
|
__privateSet(this, _internalValue, value);
|
|
37
36
|
if (this.input) {
|
|
38
37
|
this.input.value = value;
|
|
39
|
-
this.input.checked = value;
|
|
40
|
-
this.pristine = false;
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
/**
|
|
@@ -45,7 +42,7 @@ class Checkbox extends FormAssociatedElement {
|
|
|
45
42
|
* @returns {string} The value of the attribute.
|
|
46
43
|
*/
|
|
47
44
|
get value() {
|
|
48
|
-
return __privateGet(this, _internalValue);
|
|
45
|
+
return __privateGet(this, _internalValue) ?? this.getAttribute("value") ?? "on";
|
|
49
46
|
}
|
|
50
47
|
/**
|
|
51
48
|
* Getter for the customErrorDisplay attribute.
|
|
@@ -112,8 +109,13 @@ class Checkbox extends FormAssociatedElement {
|
|
|
112
109
|
set checked(value) {
|
|
113
110
|
if (value) {
|
|
114
111
|
this.setAttribute("checked", "");
|
|
112
|
+
this.internals.setFormValue(this.value);
|
|
115
113
|
} else {
|
|
116
114
|
this.removeAttribute("checked");
|
|
115
|
+
this.internals.setFormValue(null);
|
|
116
|
+
}
|
|
117
|
+
if (this.input) {
|
|
118
|
+
this.input.checked = value;
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
@@ -133,6 +135,28 @@ class Checkbox extends FormAssociatedElement {
|
|
|
133
135
|
static get observedAttributes() {
|
|
134
136
|
return ["checked", "disabled", "value", "indeterminate"];
|
|
135
137
|
}
|
|
138
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
139
|
+
if (!this.input) return;
|
|
140
|
+
if (name === "checked") {
|
|
141
|
+
const isChecked = this.hasAttribute("checked");
|
|
142
|
+
this.input.checked = isChecked;
|
|
143
|
+
if (isChecked) {
|
|
144
|
+
this.internals.setFormValue(this.value);
|
|
145
|
+
} else {
|
|
146
|
+
this.internals.setFormValue(null);
|
|
147
|
+
}
|
|
148
|
+
} else if (name === "disabled") {
|
|
149
|
+
this.input.disabled = this.hasAttribute("disabled");
|
|
150
|
+
} else if (name === "indeterminate") {
|
|
151
|
+
this.input.indeterminate = this.hasAttribute("indeterminate");
|
|
152
|
+
} else if (name === "value") {
|
|
153
|
+
__privateSet(this, _internalValue, newValue ?? void 0);
|
|
154
|
+
this.input.value = this.value;
|
|
155
|
+
if (this.input.checked) {
|
|
156
|
+
this.internals.setFormValue(this.value);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
136
160
|
/**
|
|
137
161
|
* Sets up the attributes for the checkbox.
|
|
138
162
|
*/
|
|
@@ -160,6 +184,7 @@ class Checkbox extends FormAssociatedElement {
|
|
|
160
184
|
input.disabled = this.disabled;
|
|
161
185
|
input.indeterminate = this.indeterminate;
|
|
162
186
|
input.required = this.required;
|
|
187
|
+
input.value = this.value;
|
|
163
188
|
let label = document.createElement("label");
|
|
164
189
|
label.htmlFor = "checkbox";
|
|
165
190
|
label.innerHTML = "<slot></slot>";
|
|
@@ -184,11 +209,12 @@ class Checkbox extends FormAssociatedElement {
|
|
|
184
209
|
this.validate();
|
|
185
210
|
this.pristine = false;
|
|
186
211
|
this.propagateValidation();
|
|
187
|
-
this.
|
|
188
|
-
|
|
212
|
+
this.indeterminate = false;
|
|
213
|
+
this.checked = e.target.checked;
|
|
214
|
+
event.dispatchCustomEvent(this, "wje-checkbox:input");
|
|
189
215
|
});
|
|
190
216
|
this.input.addEventListener("change", (e) => {
|
|
191
|
-
event.dispatchCustomEvent(this, "wje-
|
|
217
|
+
event.dispatchCustomEvent(this, "wje-checkbox:change");
|
|
192
218
|
});
|
|
193
219
|
this.addEventListener("wje-checkbox:invalid", (e) => {
|
|
194
220
|
this.invalid = true;
|
package/dist/wje-checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-checkbox.js","sources":["../packages/wje-checkbox/checkbox.element.js","../packages/wje-checkbox/checkbox.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This method dispatches a custom event named \"wje-checkbox:change\".\n * It is triggered when the input event is fired, which happens when the state of the checkbox changes.\n * The event is dispatched on the current instance of the Checkbox class.\n * @documentation https://elements.webjet.sk/components/checkbox\n * @status stable\n * @augments {FormAssociatedElement}\n * @slot - The checkbox main content.\n * @csspart native - The component's native wrapper.\n * @cssproperty [--wje-checkbox-border-radius=--wje-border-radius-medium] - Border radius of the component;\n * @cssproperty [--wje-checkbox-border-width=1px] - Border width of the component;\n * @cssproperty [--wje-checkbox-border-style=solid] - Border style of the component;\n * @cssproperty [--wje-checkbox-border-color=--wje-color-contrast-1] - Border color of the component;\n * @cssproperty [--wje-checkbox-margin-inline=0] - Margin inline of the component;\n * //@fires wje-checkbox:change - Dispatched when the checkbox state changes;\n */\nexport default class Checkbox extends FormAssociatedElement {\n\t#internalValue = false;\n\t/**\n\t * Checkbox constructor method.\n\t */\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.invalid = false;\n\t\tthis.pristine = true;\n\t}\n\n\t/**\n\t * Setter for the value attribute.\n\t * @param {string} value The value to set.\n\t */\n\tset value(value) {\n\t\tthis.internals.setFormValue(value);\n\t\tthis.#internalValue = value;\n\n\t\tif (this.input) {\n\t\t\tthis.input.value = value;\n\t\t\tthis.input.checked = value;\n\t\t\tthis.pristine = false;\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the value attribute.\n\t * @returns {string} The value of the attribute.\n\t */\n\tget value() {\n\t\treturn this.#internalValue;\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Getter for the validateOnChange attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget validateOnChange() {\n\t\treturn this.hasAttribute('validate-on-change');\n\t}\n\n\t/**\n\t * Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets or removes the 'indeterminate' attribute for the object.\n\t * This property typically reflects the visual or functional state where\n\t * the component is neither fully active nor inactive.\n\t * @param {boolean} value A boolean where `true` indicates the 'indeterminate'\n\t * state should be set, and `false` removes it.\n\t */\n\tset indeterminate(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('indeterminate', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('indeterminate');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'indeterminate' attribute.\n\t *\n\t * The 'indeterminate' attribute is typically used to signify a state\n\t * where a checkbox is neither checked nor unchecked, such as a partially\n\t * selected state.\n\t * @returns {boolean} Returns true if the 'indeterminate' attribute is present; otherwise, false.\n\t */\n\tget indeterminate() {\n\t\treturn this.hasAttribute('indeterminate');\n\t}\n\n\t/**\n\t * Set checked attribute.\n\t * @param {boolean} value true if the toggle is checked, false otherwise\n\t */\n\tset checked(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('checked', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('checked');\n\t\t}\n\t}\n\n\t/**\n\t * Get checked attribute.\n\t * @returns {boolean} true if the toggle is checked, false otherwise\n\t */\n\tget checked() {\n\t\treturn this.hasAttribute('checked');\n\t}\n\n\t/**\n\t * The class name for the Checkbox.\n\t */\n\tclassName = 'Checkbox';\n\n\t/**\n\t * Getter for the CSS stylesheet.\n\t * @returns {string} The CSS stylesheet.\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\tstatic get observedAttributes() {\n\t\treturn ['checked', 'disabled', 'value', 'indeterminate'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the checkbox.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\t// if some value was set via value setter then dont use default value\n\t\tif (this.pristine) {\n\t\t\tthis.value = this.#internalValue;\n\t\t\tthis.pristine = false;\n\t\t}\n\t}\n\n\t/**\n\t * Draws the checkbox element.\n\t * @returns {DocumentFragment} The created fragment.\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-checkbox');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.type = 'checkbox';\n\t\tinput.id = 'checkbox';\n\t\tinput.name = this.name || 'checkbox';\n\t\tinput.checked = this.checked;\n\t\tinput.disabled = this.disabled;\n\t\tinput.indeterminate = this.indeterminate;\n\t\tinput.required = this.required;\n\n\t\tlet label = document.createElement('label');\n\t\tlabel.htmlFor = 'checkbox';\n\t\tlabel.innerHTML = '<slot></slot>';\n\n\t\t// Error\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tnative.append(input);\n\t\tnative.append(label);\n\t\tnative.append(errorSlot);\n\n\t\tthis.append(error);\n\n\t\tthis.input = input;\n\n\t\tfragment.appendChild(native);\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Adds an event listener after drawing the checkbox.\n\t */\n\tafterDraw() {\n\t\tif (!this.disabled) {\n\t\t\tthis.input.addEventListener('input', (e) => {\n\t\t\t\tthis.validate();\n\n\t\t\t\tthis.pristine = false;\n\t\t\t\tthis.propagateValidation();\n\n\t\t\t\tthis.value = e.target.checked;\n\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-toggle:input');\n\t\t\t});\n\n\t\t\tthis.input.addEventListener('change', (e) => {\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-toggle:change');\n\t\t\t});\n\n\t\t\tthis.addEventListener('wje-checkbox:invalid', (e) => {\n\t\t\t\tthis.invalid = true;\n\t\t\t\tthis.pristine = false;\n\n\t\t\t\tthis.showInvalidMessage();\n\t\t\t});\n\n\t\t\tthis.validate();\n\n\t\t\tif (this.invalid) {\n\t\t\t\tthis.showInvalidMessage();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes the event listener when the checkbox is disconnected.\n\t */\n\tbeforeDisconnect() {\n\t\tevent.removeElement(this.input);\n\t}\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Checkbox from './checkbox.element.js';\n\n// export * from \"./checkbox.element.js\";\nexport default Checkbox;\n\nWJElement.define('wje-checkbox', Checkbox);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoBe,MAAM,iBAAiB,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAK3D,cAAc;AACb,UAAO;AALR,uCAAiB;AAyHjB;AAAA;AAAA;AAAA,qCAAY;AAlHX,SAAK,UA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,SAAS,CAAC,MAAM;AAC3C,aAAK,SAAU;AAEf,aAAK,WAAW;AAChB,aAAK,oBAAqB;AAE1B,aAAK,QAAQ,EAAE,OAAO;AAEtB,cAAM,oBAAoB,MAAM,kBAAkB;AAAA,MACtD,CAAI;AAED,WAAK,MAAM,iBAAiB,UAAU,CAAC,MAAM;AAC5C,cAAM,oBAAoB,MAAM,mBAAmB;AAAA,MACvD,CAAI;AAED,WAAK,iBAAiB,wBAAwB,CAAC,MAAM;AACpD,aAAK,UAAU;AACf,aAAK,WAAW;AAEhB,aAAK,mBAAoB;AAAA,MAC7B,CAAI;AAED,WAAK,SAAU;AAEf,UAAI,KAAK,SAAS;AACjB,aAAK,mBAAoB;AAAA,MAC7B;AAAA,IACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKC,mBAAmB;AAClB,UAAM,cAAc,KAAK,KAAK;AAAA,EAChC;AACA;AAxOC;ACfD,UAAU,OAAO,gBAAgB,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"wje-checkbox.js","sources":["../packages/wje-checkbox/checkbox.element.js","../packages/wje-checkbox/checkbox.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This method dispatches a custom event named \"wje-checkbox:change\".\n * It is triggered when the input event is fired, which happens when the state of the checkbox changes.\n * The event is dispatched on the current instance of the Checkbox class.\n * @documentation https://elements.webjet.sk/components/checkbox\n * @status stable\n * @augments {FormAssociatedElement}\n * @slot - The checkbox main content.\n * @csspart native - The component's native wrapper.\n * @cssproperty [--wje-checkbox-border-radius=--wje-border-radius-medium] - Border radius of the component;\n * @cssproperty [--wje-checkbox-border-width=1px] - Border width of the component;\n * @cssproperty [--wje-checkbox-border-style=solid] - Border style of the component;\n * @cssproperty [--wje-checkbox-border-color=--wje-color-contrast-1] - Border color of the component;\n * @cssproperty [--wje-checkbox-margin-inline=0] - Margin inline of the component;\n * @fires wje-checkbox:change - Dispatched when the checkbox state changes;\n */\nexport default class Checkbox extends FormAssociatedElement {\n\t#internalValue;\n\t/**\n\t * Checkbox constructor method.\n\t */\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.invalid = false;\n\t\tthis.pristine = true;\n\t}\n\n\t/**\n\t * Setter for the value attribute.\n\t * @param {string} value The value to set.\n\t */\n\tset value(value) {\n\t\tthis.#internalValue = value;\n\t\tif (this.input) {\n\t\t\tthis.input.value = value;\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the value attribute.\n\t * @returns {string} The value of the attribute.\n\t */\n\tget value() {\n\t\treturn this.#internalValue ?? this.getAttribute('value') ?? 'on';;\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Getter for the validateOnChange attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget validateOnChange() {\n\t\treturn this.hasAttribute('validate-on-change');\n\t}\n\n\t/**\n\t * Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets or removes the 'indeterminate' attribute for the object.\n\t * This property typically reflects the visual or functional state where\n\t * the component is neither fully active nor inactive.\n\t * @param {boolean} value A boolean where `true` indicates the 'indeterminate'\n\t * state should be set, and `false` removes it.\n\t */\n\tset indeterminate(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('indeterminate', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('indeterminate');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'indeterminate' attribute.\n\t *\n\t * The 'indeterminate' attribute is typically used to signify a state\n\t * where a checkbox is neither checked nor unchecked, such as a partially\n\t * selected state.\n\t * @returns {boolean} Returns true if the 'indeterminate' attribute is present; otherwise, false.\n\t */\n\tget indeterminate() {\n\t\treturn this.hasAttribute('indeterminate');\n\t}\n\n\t/**\n\t * Set checked attribute.\n\t * @param {boolean} value true if the toggle is checked, false otherwise\n\t */\n\tset checked(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('checked', '');\n\t\t\tthis.internals.setFormValue(this.value); // len ak je checked\n\t\t} else {\n\t\t\tthis.removeAttribute('checked');\n\t\t\tthis.internals.setFormValue(null); // ak nie je checked, nič sa neposiela\n\t\t}\n\t\tif (this.input) {\n\t\t\tthis.input.checked = value;\n\t\t}\n\t}\n\n\t/**\n\t * Get checked attribute.\n\t * @returns {boolean} true if the toggle is checked, false otherwise\n\t */\n\tget checked() {\n\t\treturn this.hasAttribute('checked');\n\t}\n\n\t/**\n\t * The class name for the Checkbox.\n\t */\n\tclassName = 'Checkbox';\n\n\t/**\n\t * Getter for the CSS stylesheet.\n\t * @returns {string} The CSS stylesheet.\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\tstatic get observedAttributes() {\n\t\treturn ['checked', 'disabled', 'value', 'indeterminate'];\n\t}\n\n\tattributeChangedCallback(name, oldValue, newValue) {\n\t\tif (!this.input) return;\n\t\tif (name === 'checked') {\n\t\t\tconst isChecked = this.hasAttribute('checked');\n\t\t\tthis.input.checked = isChecked;\n\t\t\t// Reflect into form value\n\t\t\tif (isChecked) {\n\t\t\t\tthis.internals.setFormValue(this.value);\n\t\t\t} else {\n\t\t\t\tthis.internals.setFormValue(null);\n\t\t\t}\n\t\t} else if (name === 'disabled') {\n\t\t\tthis.input.disabled = this.hasAttribute('disabled');\n\t\t} else if (name === 'indeterminate') {\n\t\t\tthis.input.indeterminate = this.hasAttribute('indeterminate');\n\t\t} else if (name === 'value') {\n\t\t\t// keep payload in sync; do not toggle checked here\n\t\t\tthis.#internalValue = newValue ?? undefined;\n\t\t\tthis.input.value = this.value;\n\t\t\t// If currently checked, update the submitted payload\n\t\t\tif (this.input.checked) {\n\t\t\t\tthis.internals.setFormValue(this.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the attributes for the checkbox.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\t// if some value was set via value setter then dont use default value\n\t\tif (this.pristine) {\n\t\t\tthis.value = this.#internalValue;\n\t\t\tthis.pristine = false;\n\t\t}\n\t}\n\n\t/**\n\t * Draws the checkbox element.\n\t * @returns {DocumentFragment} The created fragment.\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-checkbox');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.type = 'checkbox';\n\t\tinput.id = 'checkbox';\n\t\tinput.name = this.name || 'checkbox';\n\t\tinput.checked = this.checked;\n\t\tinput.disabled = this.disabled;\n\t\tinput.indeterminate = this.indeterminate;\n\t\tinput.required = this.required;\n\t\tinput.value = this.value;\n\n\t\tlet label = document.createElement('label');\n\t\tlabel.htmlFor = 'checkbox';\n\t\tlabel.innerHTML = '<slot></slot>';\n\n\t\t// Error\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tnative.append(input);\n\t\tnative.append(label);\n\t\tnative.append(errorSlot);\n\n\t\tthis.append(error);\n\n\t\tthis.input = input;\n\n\t\tfragment.appendChild(native);\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Adds an event listener after drawing the checkbox.\n\t */\n\tafterDraw() {\n\t\tif (!this.disabled) {\n\t\t\tthis.input.addEventListener('input', (e) => {\n\t\t\t\tthis.validate();\n\n\t\t\t\tthis.pristine = false;\n\t\t\t\tthis.propagateValidation();\n\n\t\t\t\t// User interaction decides the checked state; value stays as payload\n\t\t\t\tthis.indeterminate = false;\n\t\t\t\tthis.checked = e.target.checked;\n\n\t\t\t\t// Fire checkbox-specific event name\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-checkbox:input');\n\t\t\t});\n\n\t\t\tthis.input.addEventListener('change', (e) => {\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-checkbox:change');\n\t\t\t});\n\n\t\t\tthis.addEventListener('wje-checkbox:invalid', (e) => {\n\t\t\t\tthis.invalid = true;\n\t\t\t\tthis.pristine = false;\n\n\t\t\t\tthis.showInvalidMessage();\n\t\t\t});\n\n\t\t\tthis.validate();\n\n\t\t\tif (this.invalid) {\n\t\t\t\tthis.showInvalidMessage();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes the event listener when the checkbox is disconnected.\n\t */\n\tbeforeDisconnect() {\n\t\tevent.removeElement(this.input);\n\t}\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Checkbox from './checkbox.element.js';\n\n// export * from \"./checkbox.element.js\";\nexport default Checkbox;\n\nWJElement.define('wje-checkbox', Checkbox);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoBe,MAAM,iBAAiB,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAK3D,cAAc;AACb,UAAO;AALR;AA0HA;AAAA;AAAA;AAAA,qCAAY;AAnHX,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,MAAM,OAAO;AAChB,uBAAK,gBAAiB;AACtB,QAAI,KAAK,OAAO;AACf,WAAK,MAAM,QAAQ;AAAA,IACtB;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,QAAQ;AACX,WAAO,mB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,KAAK;AAEnB,QAAI,QAAQ,SAAS,cAAc,OAAO;AAC1C,UAAM,UAAU;AAChB,UAAM,YAAY;AAGlB,QAAI,YAAY,SAAS,cAAc,MAAM;AAC7C,cAAU,aAAa,QAAQ,OAAO;AAEtC,QAAI,QAAQ,SAAS,cAAc,KAAK;AACxC,UAAM,aAAa,QAAQ,OAAO;AAElC,WAAO,OAAO,KAAK;AACnB,WAAO,OAAO,KAAK;AACnB,WAAO,OAAO,SAAS;AAEvB,SAAK,OAAO,KAAK;AAEjB,SAAK,QAAQ;AAEb,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKC,YAAY;AACX,QAAI,CAAC,KAAK,UAAU;AACnB,WAAK,MAAM,iBAAiB,SAAS,CAAC,MAAM;AAC3C,aAAK,SAAU;AAEf,aAAK,WAAW;AAChB,aAAK,oBAAqB;AAG1B,aAAK,gBAAgB;AACrB,aAAK,UAAU,EAAE,OAAO;AAGxB,cAAM,oBAAoB,MAAM,oBAAoB;AAAA,MACxD,CAAI;AAED,WAAK,MAAM,iBAAiB,UAAU,CAAC,MAAM;AAC5C,cAAM,oBAAoB,MAAM,qBAAqB;AAAA,MACzD,CAAI;AAED,WAAK,iBAAiB,wBAAwB,CAAC,MAAM;AACpD,aAAK,UAAU;AACf,aAAK,WAAW;AAEhB,aAAK,mBAAoB;AAAA,MAC7B,CAAI;AAED,WAAK,SAAU;AAEf,UAAI,KAAK,SAAS;AACjB,aAAK,mBAAoB;AAAA,MAC7B;AAAA,IACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKC,mBAAmB;AAClB,UAAM,cAAc,KAAK,KAAK;AAAA,EAChC;AACA;AAvQC;ACfD,UAAU,OAAO,gBAAgB,QAAQ;"}
|
package/dist/wje-input.js
CHANGED
|
@@ -25,6 +25,7 @@ class Input extends FormAssociatedElement {
|
|
|
25
25
|
set value(value) {
|
|
26
26
|
this.internals.setFormValue(value);
|
|
27
27
|
if (this.input) this.input.value = value;
|
|
28
|
+
this.setAttribute("value", value);
|
|
28
29
|
this.pristine = false;
|
|
29
30
|
this._value = value;
|
|
30
31
|
}
|
|
@@ -218,7 +219,7 @@ class Input extends FormAssociatedElement {
|
|
|
218
219
|
label.innerText = this.label;
|
|
219
220
|
if (this.value && !this.hasAttribute("error")) label.classList.add("fade");
|
|
220
221
|
let input = document.createElement("input");
|
|
221
|
-
input.setAttribute("type", "
|
|
222
|
+
input.setAttribute("type", "text");
|
|
222
223
|
input.setAttribute("part", "input");
|
|
223
224
|
input.setAttribute("value", this.value || "");
|
|
224
225
|
input.classList.add("form-control");
|
package/dist/wje-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-input.js","sources":["../packages/wje-input/input.element.js","../packages/wje-input/input.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents a custom input element. It extends the WJElement class and provides additional functionality for handling input.\n * @documentation https://elements.webjet.sk/components/input\n * @status stable\n * @augments {FormAssociatedElement}\n * @csspart native - The native part.\n * @csspart wrapper - The wrapper part.\n * @csspart input - The input part.\n * @csspart clear - The clear part.\n * @slot start - Slot for content at the start of the input.\n * @slot end - Slot for content at the end of the input.\n * @cssproperty [--wje-input-font-family=var(--wje-font-family)] - Defines the font family for the input text.\n * @cssproperty [--wje-input-background-color=var(--wje-background)] - Specifies the background color of the input field.\n * @cssproperty [--wje-input-color=var(--wje-color)] - Sets the text color within the input field.\n * @cssproperty [--wje-input-color-invalid=var(--wje-color-danger)] - Changes the text color when the input value is invalid.\n * @cssproperty [--wje-input-border-color=var(--wje-border-color)] - Defines the border color of the input field.\n * @cssproperty [--wje-input-border-color-focus=var(--wje-color-primary)] - Specifies the border color when the input is focused.\n * @cssproperty [--wje-input-border-width=1px] - Sets the width of the input border.\n * @cssproperty [--wje-input-border-style=solid] - Defines the border style of the input (e.g., solid, dashed).\n * @cssproperty [--wje-input-border-radius=4px] - Specifies the border radius, creating rounded corners.\n * @cssproperty [--wje-input-margin-bottom=.5rem] - Adds spacing below the input field.\n * @cssproperty [--wje-input-line-height=20px] - Sets the line height of the text within the input field.\n * @cssproperty [--wje-input-slot-padding-inline=.5rem] - Controls the padding on the left and right of the input slot content.\n * // @fires wje-input:input - Dispatched when the input value changes.\n * // @fires wje-input:clear - Dispatched when the input is cleared.\n */\nexport default class Input extends FormAssociatedElement {\n /**\n * Creates an instance of Input.\n */\n constructor() {\n super();\n\n this.invalid = false;\n this.pristine = true;\n }\n\n /**\n * Setter for the value attribute.\n * @param {string} value The value to set.\n */\n set value(value) {\n this.internals.setFormValue(value);\n\n if (this.input) this.input.value = value;\n\n this.pristine = false;\n this._value = value;\n }\n\n /**\n * Retrieves the value from the input element if available; otherwise,\n * returns the internal _value property or an empty string as the default.\n * @returns {string} The current value from the input element, the internal _value, or an empty string.\n */\n get value() {\n return this.input?.value ?? this._value ?? '';\n }\n\n /**\n * Sets the label attribute of the element.\n * @param {string} value The value to set as the label attribute.\n */\n set label(value) {\n this.setAttribute('label', value);\n }\n\n /**\n * Retrieves the value of the 'label' attribute if it exists.\n * If the 'label' attribute is not set, it returns false.\n * @returns {string|boolean} The value of the 'label' attribute as a string, or false if the attribute is not set.\n */\n get label() {\n return this.getAttribute('label') || false;\n }\n\n /**\n * Sets the custom error display attribute for an element.\n * @param {boolean} value If true, adds the 'custom-error-display' attribute to the element. If false, removes the attribute from the element.\n */\n set customErrorDisplay(value) {\n if (value) {\n this.setAttribute('custom-error-display', '');\n } else {\n this.removeAttribute('custom-error-display');\n }\n }\n\n /**\n * Getter for the customErrorDisplay attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get customErrorDisplay() {\n return this.hasAttribute('custom-error-display');\n }\n\n /**\n * Sets the `validateOnChange` property. If set to a truthy value, it adds the\n * `validate-on-change` attribute to the element. If set to a falsy value, it\n * removes the `validate-on-change` attribute from the element.\n * @param {boolean} value Determines whether to add or remove the\n * `validate-on-change` attribute. A truthy value adds the attribute, whereas a\n * falsy value removes it.\n */\n set validateOnChange(value) {\n if (value) {\n this.setAttribute('validate-on-change', '');\n } else {\n this.removeAttribute('validate-on-change');\n }\n }\n\n /**\n * Getter for the validateOnChange attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get validateOnChange() {\n return this.hasAttribute('validate-on-change');\n }\n\n /**\n * @summary Getter for the defaultValue attribute.\n * This method retrieves the 'value' attribute of the custom input element.\n * The 'value' attribute represents the default value of the input element.\n * If the 'value' attribute is not set, it returns an empty string.\n * @returns {string} The default value of the input element.\n */\n get defaultValue() {\n return this.getAttribute('value') ?? '';\n }\n\n /**\n * @summary Setter for the defaultValue attribute.\n * This method sets the 'value' attribute of the custom input element to the provided value.\n * The 'value' attribute represents the default value of the input element.\n * @param {string} value The value to set as the default value.\n */\n set defaultValue(value) {\n this.setAttribute('value', value);\n }\n\n /**\n * Sets or removes the 'clearable' attribute on the element.\n * When set to a truthy value, the 'clearable' attribute is added; when falsy, the attribute is removed.\n * @param {boolean} value Determines whether to set or remove the 'clearable' attribute. If true, the 'clearable' attribute is added. If false, it is removed.\n */\n set clearable(value) {\n if (value) {\n this.setAttribute('clearable', '');\n } else {\n this.removeAttribute('clearable');\n }\n }\n\n /**\n * Checks if the 'clearable' attribute is present on the element.\n * @returns {boolean} True if the 'clearable' attribute is set, otherwise false.\n */\n get clearable() {\n return this.hasAttribute('clearable');\n }\n\n /**\n * Sets the placeholder value for an element. If the provided value is non-empty,\n * it assigns the value to the \"placeholder\" attribute. Otherwise, it removes\n * the \"placeholder\" attribute from the element.\n * @param {string} value The placeholder text to set or null/undefined to remove the attribute.\n */\n set placeholder(value) {\n if (value) {\n this.setAttribute('placeholder', value);\n } else {\n this.removeAttribute('placeholder');\n }\n }\n\n /**\n * Retrieves the value of the 'placeholder' attribute from the element.\n * If the attribute is not set, it returns an empty string.\n * @returns {string} The value of the 'placeholder' attribute or an empty string if not set.\n */\n get placeholder() {\n return this.getAttribute('placeholder') || '';\n }\n\n /**\n * Sets the `variant` attribute on the element. If a value is provided, it will set the attribute to the given value.\n * If no value is provided, it removes the `variant` attribute from the element.\n * @param {string} value The value to set for the `variant` attribute. If falsy, the attribute is removed.\n */\n set variant(value) {\n if (value) {\n this.setAttribute('variant', value);\n } else {\n this.removeAttribute('variant');\n }\n }\n\n /**\n * Retrieves the value of the 'variant' attribute from the element.\n * If the attribute is not set, it defaults to 'default'.\n * @returns {string} The value of the 'variant' attribute or 'default' if not set.\n */\n get variant() {\n return this.getAttribute('variant') || 'default';\n }\n\n /**\n * The class name of the input element.\n * @type {string}\n */\n className = 'Input';\n\n /**\n * Getter for the cssStyleSheet attribute.\n * @returns {CSSStyleSheet} The CSS style sheet of the input element.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes attribute of the input element.\n * @returns {Array} The attributes to observe for changes.\n */\n static get observedAttributes() {\n return ['value', 'name', 'disabled', 'placeholder', 'label', 'message', 'error-inline'];\n }\n\n /**\n * Sets up the attributes for the input.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n // if some value was set via value setter then dont use default value\n if (this.pristine) {\n this.value = this.defaultValue;\n this.pristine = false;\n }\n }\n\n /**\n * Draws the input element.\n * @returns {DocumentFragment} The drawn input.\n */\n draw() {\n let hasSlotStart = this.hasSlot(this, 'start');\n let hasSlotEnd = this.hasSlot(this, 'end');\n let hasSlotError = this.hasSlot(this, 'error');\n let fragment = document.createDocumentFragment();\n\n // Wrapper\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-input', this.variant);\n\n if (this.invalid) native.classList.add('has-error');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('wrapper');\n\n let inputWrapper = document.createElement('div');\n inputWrapper.setAttribute('part', 'wrapper');\n inputWrapper.classList.add('input-wrapper');\n\n // Label\n let label = document.createElement('label');\n label.setAttribute('part', 'label');\n label.innerText = this.label;\n if (this.value && !this.hasAttribute('error')) label.classList.add('fade');\n\n // Input\n let input = document.createElement('input');\n input.setAttribute('type', 'tralala');\n input.setAttribute('part', 'input');\n input.setAttribute('value', this.value || '');\n input.classList.add('form-control');\n\n const attributes = Array.from(this.attributes).map((attr) => attr.name);\n\n attributes.forEach((attr) => {\n if (this.hasAttribute(attr)) {\n input.setAttribute(attr, this[attr] || '');\n }\n });\n\n // Error\n let errorSlot = document.createElement('slot');\n errorSlot.setAttribute('name', 'error');\n\n let error = document.createElement('div');\n error.setAttribute('slot', 'error');\n\n let start = null;\n if (hasSlotStart) {\n start = document.createElement('slot');\n start.setAttribute('name', 'start');\n start.setAttribute('part', 'start');\n }\n\n let end = null;\n if (hasSlotEnd) {\n end = document.createElement('slot');\n end.setAttribute('name', 'end');\n end.setAttribute('part', 'end');\n }\n\n if (hasSlotStart) {\n wrapper.appendChild(start); // zmenene\n native.classList.add('has-start');\n }\n\n if (this.label) {\n if (this.variant === 'standard') {\n native.append(label);\n } else {\n inputWrapper.appendChild(label);\n }\n }\n\n inputWrapper.appendChild(input);\n wrapper.appendChild(inputWrapper);\n\n native.appendChild(wrapper);\n native.append(errorSlot);\n\n this.append(error);\n\n if (this.clearable) {\n this.clear = document.createElement('wje-button');\n this.clear.classList.add('clear');\n this.clear.setAttribute('fill', 'link');\n this.clear.setAttribute('part', 'clear');\n\n let clearIcon = document.createElement('wje-icon');\n clearIcon.setAttribute('name', 'x');\n this.clear.appendChild(clearIcon);\n inputWrapper.appendChild(this.clear);\n }\n\n if (hasSlotEnd) {\n wrapper.appendChild(end);// zmenene\n native.classList.add('has-end');\n }\n\n fragment.appendChild(native);\n\n this.native = native;\n this.labelElement = label;\n this.input = input;\n this.errorMessage = error;\n\n return fragment;\n }\n\n /**\n * Runs after the input is drawn to the DOM.\n */\n afterDraw() {\n this.input.addEventListener('focus', (e) => {\n this.labelElement.classList.add('fade');\n this.native.classList.add('focused');\n });\n\n this.input.addEventListener('blur', (e) => {\n this.native.classList.remove('focused');\n if (!e.target.value) this.labelElement.classList.remove('fade');\n });\n\n this.input.addEventListener('input', (e) => {\n this.validate();\n\n if (this.validateOnChange) {\n this.pristine = false;\n this.propagateValidation();\n }\n\n this.input.classList.remove('pristine');\n this.labelElement.classList.add('fade');\n\n // const clone = new e.constructor(e.type, e);\n // this.dispatchEvent(clone);\n\n event.dispatchCustomEvent(this, 'wje-input:input', {\n value: this.input.value,\n });\n\n this.value = this.input.value;\n });\n\n this.addEventListener('wje-input:invalid', (e) => {\n this.invalid = true;\n this.pristine = false;\n\n this.showInvalidMessage();\n\n if (this.customErrorDisplay) {\n e.preventDefault();\n }\n });\n\n this.addEventListener('focus', () => this.input.focus());\n\n if (this.clear) {\n this.clear.addEventListener('wje-button:click', (e) => {\n this.input.value = '';\n event.dispatchCustomEvent(this.clear, 'wje-input:clear');\n });\n }\n\n this.validate();\n\n if (this.invalid) {\n this.showInvalidMessage();\n }\n\n }\n\n /**\n * Checks whether the input has a slot.\n * @param {HTMLElement} el The element to check.\n * @param {string} slotName The name of the slot to check for.\n * @returns {boolean} Whether the input has the slot.\n */\n hasSlot(el, slotName = null) {\n let selector = slotName ? `[slot=\"${slotName}\"]` : '[slot]';\n\n return el.querySelectorAll(selector).length > 0 ? true : false;\n }\n}\n","import Input from './input.element.js';\n\nexport default Input;\n\nInput.define('wje-input', Input);\n"],"names":[],"mappings":";;;;;;AA8Be,MAAM,cAAc,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAIrD,cAAc;AACV,UAAO;AAoLX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAlLR,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,UAAU,aAAa,KAAK;AAEjC,QAAI,KAAK,MAAO,MAAK,MAAM,QAAQ;AAEnC,SAAK,WAAW;AAChB,SAAK,SAAS;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,QAAQ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K,aAAa,UAAU,OAAO,MAAM;AAAA,IAC1E,CAAS;AAED,SAAK,MAAM,iBAAiB,SAAS,CAAC,MAAM;AACxC,WAAK,SAAU;AAEf,UAAI,KAAK,kBAAkB;AACvB,aAAK,WAAW;AAChB,aAAK,oBAAqB;AAAA,MAC1C;AAEY,WAAK,MAAM,UAAU,OAAO,UAAU;AACtC,WAAK,aAAa,UAAU,IAAI,MAAM;AAKtC,YAAM,oBAAoB,MAAM,mBAAmB;AAAA,QAC/C,OAAO,KAAK,MAAM;AAAA,MAClC,CAAa;AAED,WAAK,QAAQ,KAAK,MAAM;AAAA,IACpC,CAAS;AAED,SAAK,iBAAiB,qBAAqB,CAAC,MAAM;AAC9C,WAAK,UAAU;AACf,WAAK,WAAW;AAEhB,WAAK,mBAAoB;AAEzB,UAAI,KAAK,oBAAoB;AACzB,UAAE,eAAgB;AAAA,MAClC;AAAA,IACA,CAAS;AAED,SAAK,iBAAiB,SAAS,MAAM,KAAK,MAAM,OAAO;AAEvD,QAAI,KAAK,OAAO;AACZ,WAAK,MAAM,iBAAiB,oBAAoB,CAAC,MAAM;AACnD,aAAK,MAAM,QAAQ;AACnB,cAAM,oBAAoB,KAAK,OAAO,iBAAiB;AAAA,MACvE,CAAa;AAAA,IACb;AAEQ,SAAK,SAAU;AAEf,QAAI,KAAK,SAAS;AACd,WAAK,mBAAoB;AAAA,IACrC;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,QAAQ,IAAI,WAAW,MAAM;AACzB,QAAI,WAAW,WAAW,UAAU,QAAQ,OAAO;AAEnD,WAAO,GAAG,iBAAiB,QAAQ,EAAE,SAAS,IAAI,OAAO;AAAA,EACjE;AACA;AC7aA,MAAM,OAAO,aAAa,KAAK;"}
|
|
1
|
+
{"version":3,"file":"wje-input.js","sources":["../packages/wje-input/input.element.js","../packages/wje-input/input.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents a custom input element. It extends the WJElement class and provides additional functionality for handling input.\n * @documentation https://elements.webjet.sk/components/input\n * @status stable\n * @augments {FormAssociatedElement}\n * @csspart native - The native part.\n * @csspart wrapper - The wrapper part.\n * @csspart input - The input part.\n * @csspart clear - The clear part.\n * @slot start - Slot for content at the start of the input.\n * @slot end - Slot for content at the end of the input.\n * @cssproperty [--wje-input-font-family=var(--wje-font-family)] - Defines the font family for the input text.\n * @cssproperty [--wje-input-background-color=var(--wje-background)] - Specifies the background color of the input field.\n * @cssproperty [--wje-input-color=var(--wje-color)] - Sets the text color within the input field.\n * @cssproperty [--wje-input-color-invalid=var(--wje-color-danger)] - Changes the text color when the input value is invalid.\n * @cssproperty [--wje-input-border-color=var(--wje-border-color)] - Defines the border color of the input field.\n * @cssproperty [--wje-input-border-color-focus=var(--wje-color-primary)] - Specifies the border color when the input is focused.\n * @cssproperty [--wje-input-border-width=1px] - Sets the width of the input border.\n * @cssproperty [--wje-input-border-style=solid] - Defines the border style of the input (e.g., solid, dashed).\n * @cssproperty [--wje-input-border-radius=4px] - Specifies the border radius, creating rounded corners.\n * @cssproperty [--wje-input-margin-bottom=.5rem] - Adds spacing below the input field.\n * @cssproperty [--wje-input-line-height=20px] - Sets the line height of the text within the input field.\n * @cssproperty [--wje-input-slot-padding-inline=.5rem] - Controls the padding on the left and right of the input slot content.\n * // @fires wje-input:input - Dispatched when the input value changes.\n * // @fires wje-input:clear - Dispatched when the input is cleared.\n */\nexport default class Input extends FormAssociatedElement {\n /**\n * Creates an instance of Input.\n */\n constructor() {\n super();\n\n this.invalid = false;\n this.pristine = true;\n }\n\n /**\n * Setter for the value attribute.\n * @param {string} value The value to set.\n */\n set value(value) {\n this.internals.setFormValue(value);\n\n if (this.input) this.input.value = value;\n\n this.setAttribute('value', value);\n\n this.pristine = false;\n this._value = value;\n }\n\n /**\n * Retrieves the value from the input element if available; otherwise,\n * returns the internal _value property or an empty string as the default.\n * @returns {string} The current value from the input element, the internal _value, or an empty string.\n */\n get value() {\n return this.input?.value ?? this._value ?? '';\n }\n\n /**\n * Sets the label attribute of the element.\n * @param {string} value The value to set as the label attribute.\n */\n set label(value) {\n this.setAttribute('label', value);\n }\n\n /**\n * Retrieves the value of the 'label' attribute if it exists.\n * If the 'label' attribute is not set, it returns false.\n * @returns {string|boolean} The value of the 'label' attribute as a string, or false if the attribute is not set.\n */\n get label() {\n return this.getAttribute('label') || false;\n }\n\n /**\n * Sets the custom error display attribute for an element.\n * @param {boolean} value If true, adds the 'custom-error-display' attribute to the element. If false, removes the attribute from the element.\n */\n set customErrorDisplay(value) {\n if (value) {\n this.setAttribute('custom-error-display', '');\n } else {\n this.removeAttribute('custom-error-display');\n }\n }\n\n /**\n * Getter for the customErrorDisplay attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get customErrorDisplay() {\n return this.hasAttribute('custom-error-display');\n }\n\n /**\n * Sets the `validateOnChange` property. If set to a truthy value, it adds the\n * `validate-on-change` attribute to the element. If set to a falsy value, it\n * removes the `validate-on-change` attribute from the element.\n * @param {boolean} value Determines whether to add or remove the\n * `validate-on-change` attribute. A truthy value adds the attribute, whereas a\n * falsy value removes it.\n */\n set validateOnChange(value) {\n if (value) {\n this.setAttribute('validate-on-change', '');\n } else {\n this.removeAttribute('validate-on-change');\n }\n }\n\n /**\n * Getter for the validateOnChange attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get validateOnChange() {\n return this.hasAttribute('validate-on-change');\n }\n\n /**\n * @summary Getter for the defaultValue attribute.\n * This method retrieves the 'value' attribute of the custom input element.\n * The 'value' attribute represents the default value of the input element.\n * If the 'value' attribute is not set, it returns an empty string.\n * @returns {string} The default value of the input element.\n */\n get defaultValue() {\n return this.getAttribute('value') ?? '';\n }\n\n /**\n * @summary Setter for the defaultValue attribute.\n * This method sets the 'value' attribute of the custom input element to the provided value.\n * The 'value' attribute represents the default value of the input element.\n * @param {string} value The value to set as the default value.\n */\n set defaultValue(value) {\n this.setAttribute('value', value);\n }\n\n /**\n * Sets or removes the 'clearable' attribute on the element.\n * When set to a truthy value, the 'clearable' attribute is added; when falsy, the attribute is removed.\n * @param {boolean} value Determines whether to set or remove the 'clearable' attribute. If true, the 'clearable' attribute is added. If false, it is removed.\n */\n set clearable(value) {\n if (value) {\n this.setAttribute('clearable', '');\n } else {\n this.removeAttribute('clearable');\n }\n }\n\n /**\n * Checks if the 'clearable' attribute is present on the element.\n * @returns {boolean} True if the 'clearable' attribute is set, otherwise false.\n */\n get clearable() {\n return this.hasAttribute('clearable');\n }\n\n /**\n * Sets the placeholder value for an element. If the provided value is non-empty,\n * it assigns the value to the \"placeholder\" attribute. Otherwise, it removes\n * the \"placeholder\" attribute from the element.\n * @param {string} value The placeholder text to set or null/undefined to remove the attribute.\n */\n set placeholder(value) {\n if (value) {\n this.setAttribute('placeholder', value);\n } else {\n this.removeAttribute('placeholder');\n }\n }\n\n /**\n * Retrieves the value of the 'placeholder' attribute from the element.\n * If the attribute is not set, it returns an empty string.\n * @returns {string} The value of the 'placeholder' attribute or an empty string if not set.\n */\n get placeholder() {\n return this.getAttribute('placeholder') || '';\n }\n\n /**\n * Sets the `variant` attribute on the element. If a value is provided, it will set the attribute to the given value.\n * If no value is provided, it removes the `variant` attribute from the element.\n * @param {string} value The value to set for the `variant` attribute. If falsy, the attribute is removed.\n */\n set variant(value) {\n if (value) {\n this.setAttribute('variant', value);\n } else {\n this.removeAttribute('variant');\n }\n }\n\n /**\n * Retrieves the value of the 'variant' attribute from the element.\n * If the attribute is not set, it defaults to 'default'.\n * @returns {string} The value of the 'variant' attribute or 'default' if not set.\n */\n get variant() {\n return this.getAttribute('variant') || 'default';\n }\n\n /**\n * The class name of the input element.\n * @type {string}\n */\n className = 'Input';\n\n /**\n * Getter for the cssStyleSheet attribute.\n * @returns {CSSStyleSheet} The CSS style sheet of the input element.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes attribute of the input element.\n * @returns {Array} The attributes to observe for changes.\n */\n static get observedAttributes() {\n return ['value', 'name', 'disabled', 'placeholder', 'label', 'message', 'error-inline'];\n }\n\n /**\n * Sets up the attributes for the input.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n // if some value was set via value setter then dont use default value\n if (this.pristine) {\n this.value = this.defaultValue;\n this.pristine = false;\n }\n }\n\n /**\n * Draws the input element.\n * @returns {DocumentFragment} The drawn input.\n */\n draw() {\n let hasSlotStart = this.hasSlot(this, 'start');\n let hasSlotEnd = this.hasSlot(this, 'end');\n let hasSlotError = this.hasSlot(this, 'error');\n let fragment = document.createDocumentFragment();\n\n // Wrapper\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-input', this.variant);\n\n if (this.invalid) native.classList.add('has-error');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('wrapper');\n\n let inputWrapper = document.createElement('div');\n inputWrapper.setAttribute('part', 'wrapper');\n inputWrapper.classList.add('input-wrapper');\n\n // Label\n let label = document.createElement('label');\n label.setAttribute('part', 'label');\n label.innerText = this.label;\n if (this.value && !this.hasAttribute('error')) label.classList.add('fade');\n\n // Input\n let input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('part', 'input');\n input.setAttribute('value', this.value || '');\n input.classList.add('form-control');\n\n const attributes = Array.from(this.attributes).map((attr) => attr.name);\n\n attributes.forEach((attr) => {\n if (this.hasAttribute(attr)) {\n input.setAttribute(attr, this[attr] || '');\n }\n });\n\n // Error\n let errorSlot = document.createElement('slot');\n errorSlot.setAttribute('name', 'error');\n\n let error = document.createElement('div');\n error.setAttribute('slot', 'error');\n\n let start = null;\n if (hasSlotStart) {\n start = document.createElement('slot');\n start.setAttribute('name', 'start');\n start.setAttribute('part', 'start');\n }\n\n let end = null;\n if (hasSlotEnd) {\n end = document.createElement('slot');\n end.setAttribute('name', 'end');\n end.setAttribute('part', 'end');\n }\n\n if (hasSlotStart) {\n wrapper.appendChild(start); // zmenene\n native.classList.add('has-start');\n }\n\n if (this.label) {\n if (this.variant === 'standard') {\n native.append(label);\n } else {\n inputWrapper.appendChild(label);\n }\n }\n\n inputWrapper.appendChild(input);\n wrapper.appendChild(inputWrapper);\n\n native.appendChild(wrapper);\n native.append(errorSlot);\n\n this.append(error);\n\n if (this.clearable) {\n this.clear = document.createElement('wje-button');\n this.clear.classList.add('clear');\n this.clear.setAttribute('fill', 'link');\n this.clear.setAttribute('part', 'clear');\n\n let clearIcon = document.createElement('wje-icon');\n clearIcon.setAttribute('name', 'x');\n this.clear.appendChild(clearIcon);\n inputWrapper.appendChild(this.clear);\n }\n\n if (hasSlotEnd) {\n wrapper.appendChild(end);// zmenene\n native.classList.add('has-end');\n }\n\n fragment.appendChild(native);\n\n this.native = native;\n this.labelElement = label;\n this.input = input;\n this.errorMessage = error;\n\n return fragment;\n }\n\n /**\n * Runs after the input is drawn to the DOM.\n */\n afterDraw() {\n this.input.addEventListener('focus', (e) => {\n this.labelElement.classList.add('fade');\n this.native.classList.add('focused');\n });\n\n this.input.addEventListener('blur', (e) => {\n this.native.classList.remove('focused');\n if (!e.target.value) this.labelElement.classList.remove('fade');\n });\n\n this.input.addEventListener('input', (e) => {\n this.validate();\n\n if (this.validateOnChange) {\n this.pristine = false;\n this.propagateValidation();\n }\n\n this.input.classList.remove('pristine');\n this.labelElement.classList.add('fade');\n\n // const clone = new e.constructor(e.type, e);\n // this.dispatchEvent(clone);\n\n event.dispatchCustomEvent(this, 'wje-input:input', {\n value: this.input.value,\n });\n\n this.value = this.input.value;\n });\n\n this.addEventListener('wje-input:invalid', (e) => {\n this.invalid = true;\n this.pristine = false;\n\n this.showInvalidMessage();\n\n if (this.customErrorDisplay) {\n e.preventDefault();\n }\n });\n\n this.addEventListener('focus', () => this.input.focus());\n\n if (this.clear) {\n this.clear.addEventListener('wje-button:click', (e) => {\n this.input.value = '';\n event.dispatchCustomEvent(this.clear, 'wje-input:clear');\n });\n }\n\n this.validate();\n\n if (this.invalid) {\n this.showInvalidMessage();\n }\n\n }\n\n /**\n * Checks whether the input has a slot.\n * @param {HTMLElement} el The element to check.\n * @param {string} slotName The name of the slot to check for.\n * @returns {boolean} Whether the input has the slot.\n */\n hasSlot(el, slotName = null) {\n let selector = slotName ? `[slot=\"${slotName}\"]` : '[slot]';\n\n return el.querySelectorAll(selector).length > 0 ? true : false;\n }\n}\n","import Input from './input.element.js';\n\nexport default Input;\n\nInput.define('wje-input', Input);\n"],"names":[],"mappings":";;;;;;AA8Be,MAAM,cAAc,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAIrD,cAAc;AACV,UAAO;AAsLX;AAAA;AAAA;AAAA;AAAA,qCAAY;AApLR,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,UAAU,aAAa,KAAK;AAEjC,QAAI,KAAK,MAAO,MAAK,MAAM,QAAQ;AAEnC,SAAK,aAAa,SAAS,KAAK;AAEhC,SAAK,WAAW;AAChB,SAAK,SAAS;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,QAAQ;;AACR,aAAO,UAAK,UAAL,mBAAY,UAAS,KAAK,UAAU;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,aAAa,SAAS,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,QAAQ;AACR,WAAO,KAAK,aAAa,OAAO,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,mBAAmB,OAAO;AAC1B,QAAI,OAAO;AACP,WAAK,aAAa,wBAAwB,EAAE;AAAA,IACxD,OAAe;AACH,WAAK,gBAAgB,sBAAsB;AAAA,IACvD;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,qBAAqB;AACrB,WAAO,KAAK,aAAa,sBAAsB;AAAA,E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,eAAgB;AAAA,MAClC;AAAA,IACA,CAAS;AAED,SAAK,iBAAiB,SAAS,MAAM,KAAK,MAAM,OAAO;AAEvD,QAAI,KAAK,OAAO;AACZ,WAAK,MAAM,iBAAiB,oBAAoB,CAAC,MAAM;AACnD,aAAK,MAAM,QAAQ;AACnB,cAAM,oBAAoB,KAAK,OAAO,iBAAiB;AAAA,MACvE,CAAa;AAAA,IACb;AAEQ,SAAK,SAAU;AAEf,QAAI,KAAK,SAAS;AACd,WAAK,mBAAoB;AAAA,IACrC;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,QAAQ,IAAI,WAAW,MAAM;AACzB,QAAI,WAAW,WAAW,UAAU,QAAQ,OAAO;AAEnD,WAAO,GAAG,iBAAiB,QAAQ,EAAE,SAAS,IAAI,OAAO;AAAA,EACjE;AACA;AC/aA,MAAM,OAAO,aAAa,KAAK;"}
|
package/dist/wje-radio-group.js
CHANGED
|
@@ -41,6 +41,24 @@ class RadioGroup extends FormAssociatedElement {
|
|
|
41
41
|
get value() {
|
|
42
42
|
return this.getAttribute("value");
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Setter for the name attribute.
|
|
46
|
+
* @param {string} value The name to set.
|
|
47
|
+
*/
|
|
48
|
+
set required(value) {
|
|
49
|
+
if (value === null || value === void 0) {
|
|
50
|
+
this.removeAttribute("required");
|
|
51
|
+
} else {
|
|
52
|
+
this.setAttribute("required", "");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Getter for the name attribute.
|
|
57
|
+
* @returns {boolean}
|
|
58
|
+
*/
|
|
59
|
+
get required() {
|
|
60
|
+
return this.hasAttribute("required");
|
|
61
|
+
}
|
|
44
62
|
/**
|
|
45
63
|
* Returns the CSS styles for the component.
|
|
46
64
|
* @static
|
|
@@ -73,7 +91,7 @@ class RadioGroup extends FormAssociatedElement {
|
|
|
73
91
|
input.type = "text";
|
|
74
92
|
input.name = this.name;
|
|
75
93
|
input.disabled = this.disabled;
|
|
76
|
-
input.required =
|
|
94
|
+
input.required = this.required;
|
|
77
95
|
input.value = this.value || "";
|
|
78
96
|
input.classList.add("input-hidden");
|
|
79
97
|
let slot = document.createElement("slot");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-radio-group.js","sources":["../packages/wje-radio-group/radio-group.element.js","../packages/wje-radio-group/radio-group.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Radio from '../wje-radio/radio.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `RadioGroup` is a custom web component that represents a group of radio buttons.\n * @summary This element represents a group of radio buttons.\n * @documentation https://elements.webjet.sk/components/radio-group\n * @status stable\n * @augments {FormAssociatedElement}\n * @slot - The default slot for the radio group.\n * @tag wje-radio-group\n */\n\nexport default class RadioGroup extends FormAssociatedElement {\n #internalValue = '';\n\n /**\n * Creates an instance of RadioGroup.\n * @class\n */\n constructor() {\n super();\n\n this.invalid = false;\n this.pristine = true;\n }\n\n /**\n * Setter for the value attribute.\n * @param {string} value The value to set.\n */\n set value(value) {\n this.#internalValue = value;\n this.pristine = false;\n this.internals.setFormValue(value);\n this.setAttribute('value', value);\n }\n\n /**\n * Getter for the value attribute.\n * @returns {string} The value of the attribute.\n */\n get value() {\n return this.getAttribute('value');\n }\n\n className = 'RadioGroup';\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 static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n if (this.pristine) {\n this.pristine = false;\n }\n }\n\n /**\n * Draws the component for the radio group.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-radio-group', this.hasAttribute('inline') ? 'wje-inline' : 'ddd');\n\n let input = document.createElement('input');\n input.type = 'text';\n input.name = this.name;\n input.disabled = this.disabled;\n input.required =
|
|
1
|
+
{"version":3,"file":"wje-radio-group.js","sources":["../packages/wje-radio-group/radio-group.element.js","../packages/wje-radio-group/radio-group.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Radio from '../wje-radio/radio.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `RadioGroup` is a custom web component that represents a group of radio buttons.\n * @summary This element represents a group of radio buttons.\n * @documentation https://elements.webjet.sk/components/radio-group\n * @status stable\n * @augments {FormAssociatedElement}\n * @slot - The default slot for the radio group.\n * @tag wje-radio-group\n */\n\nexport default class RadioGroup extends FormAssociatedElement {\n #internalValue = '';\n\n /**\n * Creates an instance of RadioGroup.\n * @class\n */\n constructor() {\n super();\n\n this.invalid = false;\n this.pristine = true;\n }\n\n /**\n * Setter for the value attribute.\n * @param {string} value The value to set.\n */\n set value(value) {\n this.#internalValue = value;\n this.pristine = false;\n this.internals.setFormValue(value);\n this.setAttribute('value', value);\n }\n\n /**\n * Getter for the value attribute.\n * @returns {string} The value of the attribute.\n */\n get value() {\n return this.getAttribute('value');\n }\n /**\n * Setter for the name attribute.\n * @param {string} value The name to set.\n */\n set required(value) {\n if (value === null || value === undefined) {\n this.removeAttribute('required');\n } else {\n this.setAttribute('required', '');\n }\n }\n\n /**\n * Getter for the name attribute.\n * @returns {boolean}\n */\n get required() {\n return this.hasAttribute('required');\n }\n\n className = 'RadioGroup';\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 static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n if (this.pristine) {\n this.pristine = false;\n }\n }\n\n /**\n * Draws the component for the radio group.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-radio-group', this.hasAttribute('inline') ? 'wje-inline' : 'ddd');\n\n let input = document.createElement('input');\n input.type = 'text';\n input.name = this.name;\n input.disabled = this.disabled;\n input.required = this.required;\n input.value = this.value || '';\n input.classList.add('input-hidden');\n\n let slot = document.createElement('slot');\n\n let label = document.createElement('label');\n label.innerText = this.label;\n if (this.value && !this.hasAttribute('error')) label.classList.add('fade');\n\n if (this.label) {\n native.append(label);\n }\n\n // Error\n let errorSlot = document.createElement('slot');\n errorSlot.setAttribute('name', 'error');\n\n let error = document.createElement('div');\n error.setAttribute('slot', 'error');\n\n native.append(input);\n native.append(slot);\n native.append(errorSlot);\n\n this.append(error);\n\n fragment.append(native);\n\n this.input = input;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn. Handles the selection of radio buttons.\n */\n afterDraw() {\n if(this.value)\n this.checkRadio(this.getRadioByValue(this.value));\n\n // this.addEventListener('wje-radio:input', (e) => {\n // this.value = e.detail.context.value;\n // });\n\n this.validate();\n\n if (this.invalid) {\n this.showInvalidMessage();\n }\n\n this.addEventListener('wje-radio:change', (e) => {\n this.checkRadio(e.target);\n\n this.validate();\n\n this.pristine = false;\n this.propagateValidation();\n\n });\n\n this.input.addEventListener('input', (e) => {\n this.validate();\n\n this.pristine = false;\n this.propagateValidation();\n\n this.value = this.checkRadio(this.value);\n\n event.dispatchCustomEvent(this, 'wje-toggle:input');\n });\n\n this.addEventListener('wje-radio-group:invalid', (e) => {\n this.invalid = true;\n this.pristine = false;\n\n this.showInvalidMessage();\n });\n\n }\n\n /**\n * Returns the radio button with the given value.\n * @param {string} value The value of the radio button.\n * @returns {Radio} The radio button.\n */\n getRadioByValue(value) {\n return this.getAllElements().find((el) => el instanceof Radio && el.value === value);\n }\n\n /**\n * Removes the check from all radio buttons.\n */\n removeCheck() {\n this.getAllElements().forEach((el) => {\n if (el instanceof Radio) el.checked = false;\n });\n }\n\n /**\n * Sets the given radio button to checked.\n */\n checkRadio(radio) {\n this.removeCheck();\n\n if (radio) {\n radio.checked = true;\n this.value = radio.value;\n this.input.value = radio.value;\n return true;\n }\n\n console.error(`Radio with value ${radio.value} not found`);\n return false;\n }\n\n /**\n * Retrieves all direct child elements of the current element.\n * @returns {HTMLElement[]} An array of child elements.\n */\n getAllElements() {\n return Array.from(this.children);\n }\n}\n","import RadioGroup from './radio-group.element.js';\n\nexport default RadioGroup;\n\nRadioGroup.define('wje-radio-group', RadioGroup);\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAee,MAAM,mBAAmB,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1D,cAAc;AACV,UAAO;AAPX,uCAAiB;AAmDjB,qCAAY;AA1CR,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,uBAAK,gBAAiB;AACtB,SAAK,WAAW;AAChB,SAAK,UAAU,aAAa,KAAK;AACjC,SAAK,aAAa,SAAS,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,QAAQ;AACR,WAAO,KAAK,aAAa,OAAO;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKI,IAAI,SAAS,OAAO;AAChB,QAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAK,gBAAgB,UAAU;AAAA,IAC3C,OAAe;AACH,WAAK,aAAa,YAAY,EAAE;AAAA,IAC5C;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,WAAW;AACX,WAAO,KAAK,aAAa,UAAU;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA,EAEI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AACpB,QAAI,KAAK,UAAU;AACf,WA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,WAAW;AAChB,WAAK,oBAAqB;AAAA,IAEtC,CAAS;AAED,SAAK,MAAM,iBAAiB,SAAS,CAAC,MAAM;AACxC,WAAK,SAAU;AAEf,WAAK,WAAW;AAChB,WAAK,oBAAqB;AAE1B,WAAK,QAAQ,KAAK,WAAW,KAAK,KAAK;AAEvC,YAAM,oBAAoB,MAAM,kBAAkB;AAAA,IAC9D,CAAS;AAED,SAAK,iBAAiB,2BAA2B,CAAC,MAAM;AACpD,WAAK,UAAU;AACf,WAAK,WAAW;AAEhB,WAAK,mBAAoB;AAAA,IACrC,CAAS;AAAA,EAET;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,gBAAgB,OAAO;AACnB,WAAO,KAAK,iBAAiB,KAAK,CAAC,OAAO,cAAc,SAAS,GAAG,UAAU,KAAK;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA,EAKI,cAAc;AACV,SAAK,eAAc,EAAG,QAAQ,CAAC,OAAO;AAClC,UAAI,cAAc,MAAO,IAAG,UAAU;AAAA,IAClD,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKI,WAAW,OAAO;AACd,SAAK,YAAa;AAElB,QAAI,OAAO;AACP,YAAM,UAAU;AAChB,WAAK,QAAQ,MAAM;AACnB,WAAK,MAAM,QAAQ,MAAM;AACzB,aAAO;AAAA,IACnB;AAEQ,YAAQ,MAAM,oBAAoB,MAAM,KAAK,YAAY;AACzD,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,iBAAiB;AACb,WAAO,MAAM,KAAK,KAAK,QAAQ;AAAA,EACvC;AACA;AArNI;ACZJ,WAAW,OAAO,mBAAmB,UAAU;"}
|
package/dist/wje-select.js
CHANGED
|
@@ -311,7 +311,7 @@ class Select extends FormAssociatedElement {
|
|
|
311
311
|
* @returns {string} The maximum height value as a string.
|
|
312
312
|
*/
|
|
313
313
|
get maxHeight() {
|
|
314
|
-
return this.getAttribute("max-height") || "
|
|
314
|
+
return this.getAttribute("max-height") || "auto";
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
317
|
* Sets the offset attribute for the element.
|
|
@@ -476,7 +476,7 @@ class Select extends FormAssociatedElement {
|
|
|
476
476
|
let optionsWrapper = document.createElement("div");
|
|
477
477
|
optionsWrapper.setAttribute("part", "options-wrapper");
|
|
478
478
|
optionsWrapper.classList.add("options-wrapper");
|
|
479
|
-
optionsWrapper.style.setProperty("
|
|
479
|
+
optionsWrapper.style.setProperty("height", this.maxHeight);
|
|
480
480
|
let list = document.createElement("div");
|
|
481
481
|
list.classList.add("list");
|
|
482
482
|
let slot = document.createElement("slot");
|
package/dist/wje-select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-select.js","sources":["../packages/wje-select/select.element.js","../packages/wje-select/select.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Button from '../wje-button/button.js';\nimport Popup from '../wje-popup/popup.js';\nimport Icon from '../wje-icon/icon.js';\nimport Label from '../wje-label/label.js';\nimport Chip from '../wje-chip/chip.js';\nimport Input from '../wje-input/input.js';\nimport Option from '../wje-option/option.js';\nimport Options from '../wje-options/options.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\nexport class Select extends FormAssociatedElement {\n\tconstructor() {\n\t\tsuper();\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the counter element, initially null.\n\t\t * @private\n\t\t */\n\t\tthis.counterEl = null;\n\n\t\t/**\n\t\t * @type {boolean}\n\t\t * @description Tracks whether the select element was previously opened, initially false.\n\t\t * @private\n\t\t * @default {boolean} false\n\t\t */\n\t\tthis._wasOppened = false;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the native select element, initially null.\n\t\t */\n\t\tthis.native = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the popup element, initially null.\n\t\t */\n\t\tthis.popup = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the label element, initially null.\n\t\t */\n\t\tthis.labelElement = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot start element, initially null.\n\t\t */\n\t\tthis.slotStart = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot end element, initially null.\n\t\t */\n\t\tthis.slotEnd = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the input element, initially null.\n\t\t */\n\t\tthis.input = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the chips element, initially null.\n\t\t */\n\t\tthis.chips = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the clear button element, initially null.\n\t\t */\n\t\tthis.clear = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the list element, initially null.\n\t\t */\n\t\tthis.list = null;\n\n\t\tthis._value = [];\n\t\tthis._selectedOptions = [];\n\t}\n\n\t#addedOptions = [];\n\n\t#htmlOptions = [];\n\n\t/**\n\t * An object representing component dependencies with their respective classes.\n\t * Each property in the object maps a custom component name (as a string key)\n\t * to its corresponding class or constructor.\n\t * @typedef {{[key: string]: Function}} Dependencies\n\t * @property {Function} 'wje-button' Represents the Button component class.\n\t * @property {Function} 'wje-popup' Represents the Popup component class.\n\t * @property {Function} 'wje-icon' Represents the Icon component class.\n\t * @property {Function} 'wje-label' Represents the Label component class.\n\t * @property {Function} 'wje-chip' Represents the Chip component class.\n\t * @property {Function} 'wje-input' Represents the Input component class.\n\t * @property {Function} 'wje-option' Represents the Option component class.\n\t * @property {Function} 'wje-checkbox' Represents the Checkbox component class.\n\t */\n\tdependencies = {\n\t\t'wje-button': Button,\n\t\t'wje-popup': Popup,\n\t\t'wje-icon': Icon,\n\t\t'wje-label': Label,\n\t\t'wje-chip': Chip,\n\t\t'wje-input': Input,\n\t\t'wje-option': Option,\n\t\t'wje-options': Options,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the value for the form field. Converts the input value into a FormData object\n\t * if it is not already an array, splitting by spaces if necessary, and sets the\n\t * internal form value as well as the selected values.\n\t * @param {string|Array} value The value to be set. Can be a string (which will be\n\t * split into an array by spaces) or an array of values.\n\t */\n\tset value(value) {\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t}\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t}\n\t\tthis.internals.setFormValue(value);\n\t}\n\n\t/**\n\t * Retrieves the current value.\n\t * @returns {any} The value of the `_value` property.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets the maximum number of options allowed.\n\t * @param { number | object} value The value to set as the maximum number of options.\n\t * If null, the 'max-options' attribute will be removed.\n\t */\n\tset maxOptions(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-options', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-options');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum number of options allowed.\n\t * Parses the value of the 'max-options' attribute from the element and converts it to a number.\n\t * If the attribute is not present or cannot be converted to a valid number, defaults to 1.\n\t * @returns {number} The maximum number of options, or 0 if the attribute is not set or invalid.\n\t */\n\tget maxOptions() {\n\t\treturn +this.getAttribute('max-options') || 1;\n\t}\n\n\t/**\n\t * @summary Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * @summary Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets the trigger value.\n\t * @param {string} value The trigger value to set.\n\t */\n\tset trigger(value) {\n\t\tthis.setAttribute('trigger', value);\n\t}\n\n\t/**\n\t * Returns the trigger value.\n\t * @returns {string} The trigger value.\n\t */\n\tget trigger() {\n\t\treturn this.getAttribute('trigger') || 'click';\n\t}\n\n\t/**\n\t * Sets or removes the disabled state for the associated elements.\n\t * @param {boolean} value A boolean indicating whether the elements should be disabled.\n\t * If true, the disabled attribute is added to the elements. If false, the disabled attribute is removed.\n\t */\n\tset disabled(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\t\t\tthis.input.setAttribute('disabled', '');\n\t\t\tthis.displayInput.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\t\t\tthis.input.removeAttribute('disabled');\n\t\t\tthis.displayInput.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'disabled' attribute.\n\t * @returns {boolean} Returns true if the 'disabled' attribute is present, otherwise false.\n\t */\n\tget disabled() {\n\t\treturn this.hasAttribute('disabled');\n\t}\n\n\t/**\n\t * Sets the readonly state of the element. When set to true,\n\t * the element and its associated inputs are marked as readonly or disabled.\n\t * When set to false, the readonly and disabled attributes are removed,\n\t * allowing user interaction.\n\t * @param {boolean} value A boolean value indicating whether to set the\n\t * element and its associated inputs to readonly (true) or not (false).\n\t */\n\tset readonly(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\t\t\tthis.input.setAttribute('readonly', '');\n\t\t\tthis.displayInput.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\t\t\tthis.input.removeAttribute('readonly');\n\t\t\tthis.displayInput.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the 'readonly' attribute is present on the element.\n\t * @returns {boolean} Returns true if the 'readonly' attribute is set, otherwise false.\n\t */\n\tget readonly() {\n\t\treturn this.hasAttribute('readonly');\n\t}\n\n\t/**\n\t * Sets the maximum height value for the element.\n\t * If a value is provided, it sets the 'max-height' attribute on the element.\n\t * If no value is provided, it removes the 'max-height' attribute from the element.\n\t * @param {string|null} value The maximum height to be set. If null or undefined, the attribute is removed.\n\t */\n\tset maxHeight(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-height', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-height');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum height value, which is determined by the 'max-height' attribute.\n\t * If the attribute is not set, a default value of '200px' is returned.\n\t * @returns {string} The maximum height value as a string.\n\t */\n\tget maxHeight() {\n\t\treturn this.getAttribute('max-height') || '200px';\n\t}\n\n\t/**\n\t * Sets the offset attribute for the element.\n\t * @param {string} value The value to assign to the offset attribute.\n\t */\n\tset offset(value) {\n\t\tthis.setAttribute('offset', value);\n\t}\n\n\t/**\n\t * Gets the value of the offset attribute of the current element.\n\t * If the offset attribute is not present, returns a default value of '0'.\n\t * @returns {string} The value of the offset attribute or the default value '0'.\n\t */\n\tget offset() {\n\t\treturn this.getAttribute('offset') || '5';\n\t}\n\n\t/**\n\t * Sets the selected options for the object.\n\t * @param {Array|object} value The new value for the selected options. It can be an array or object containing the selected options.\n\t */\n\tset selectedOptions(value) {\n\t\tthis._selectedOptions = value;\n\t}\n\n\t/**\n\t * Retrieves the selected options.\n\t * @returns {Array} An array containing the currently selected options. If no options are selected, an empty array is returned.\n\t */\n\tget selectedOptions() {\n\t\treturn this._selectedOptions || [];\n\t}\n\n\t/**\n\t * Sets the `lazy` attribute on the element. If the provided value is truthy, the `lazy` attribute is added. If the value is falsy, the `lazy` attribute is removed.\n\t * @param {boolean} value A boolean value indicating whether to add or remove the `lazy` attribute. If `true`, the attribute is added; if `false`, it is removed.\n\t */\n\tset lazy(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('lazy', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('lazy');\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the 'lazy' property.\n\t * @returns {boolean} Returns true if the 'lazy' attribute is present on the element, otherwise false.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Sets or removes the 'no-size' attribute on an element.\n\t * @param {boolean} value A boolean indicating whether to add or remove the 'no-size' attribute. If true, the attribute is added; if false, the attribute is removed.\n\t */\n\tset noSize(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('no-size', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('no-size');\n\t\t}\n\t}\n\n\t/**\n\t * Gets the value of the 'no-size' attribute for the element.\n\t * @returns {boolean} True if the 'no-size' attribute is present, otherwise false.\n\t */\n\tget noSize() {\n\t\treturn this.hasAttribute('no-size');\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Retrieves the complete list of options available for the component.\n\t * The options are determined by combining elements from various sources, including loaded options, added options, and HTML-sourced options.\n\t * If a `wje-options` element is present within the component, its loaded options are included in the merged list.\n\t * In the absence of a `wje-options` element, duplicates among the added and HTML options are removed, retaining their order.\n\t * @returns {Array<object>} An array containing all the available options, combining the loaded, added, and HTML-based options, with duplicates removed where applicable.\n\t */\n\tget options() {\n\t\tif (this.querySelector('wje-options')) {\n\t\t\tconst allOptions = [...this.querySelector('wje-options').loadedOptions, ...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn allOptions\n\t\t} else {\n\t\t\tconst allOptions = [...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn Array.from(\n\t\t\t\tnew Map(allOptions.reverse().map(obj => [obj.value, obj])).values()\n\t\t\t).reverse();\n\t\t}\n\t}\n\n\tclassName = 'Select';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['active', 'value', 'disabled', 'readonly', 'multiple', 'label', 'placeholder', 'max-height', 'max-options', 'variant', 'placement'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t}\n\n\tbeforeDraw() {\n\t\tif(this.hasAttribute('value')) {\n\t\t\tthis.value = this.getAttribute('value');\n\t\t}\n\t}\n\n\t/**\n\t * Draws the component for the select.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tthis.classList.add('wje-placement', this.placement ? 'wje-' + this.placement : 'wje-start');\n\n\t\t// zakladny obalovac\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-select', this.variant || 'default');\n\n\t\t// wrapper pre label a inputWrapper\n\t\tlet wrapper = document.createElement('div');\n\t\twrapper.classList.add('wrapper');\n\t\twrapper.setAttribute('slot', 'anchor');\n\n\t\t// label\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.setAttribute('part', 'label');\n\t\tlabel.innerText = this.label || '';\n\n\t\t// obalovac pre input\n\t\tlet inputWrapper = document.createElement('div');\n\t\tinputWrapper.setAttribute('part', 'input-wrapper');\n\t\tinputWrapper.classList.add('input-wrapper');\n\n\t\tlet slotStart = document.createElement('div');\n\t\tslotStart.classList.add('slot-start');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.setAttribute('type', 'text');\n\t\tinput.value = this.value.join(' ').trim();\n\t\tinput.classList.add('input-hidden');\n\n\t\tlet display = document.createElement('input');\n\t\tdisplay.setAttribute('type', 'text');\n\t\tdisplay.setAttribute('part', 'input');\n\t\tdisplay.setAttribute('autocomplete', 'off');\n\t\tdisplay.setAttribute('readonly', '');\n\t\tdisplay.setAttribute('placeholder', this.placeholder || '');\n\n\t\tif (this.required) {\n\t\t\tinput.setAttribute('required', '');\n\t\t\tdisplay.setAttribute('required', '');\n\t\t}\n\n\t\tlet slotEnd = document.createElement('div');\n\t\tslotEnd.classList.add('slot-end');\n\n\t\tlet arrow = document.createElement('wje-icon');\n\t\tarrow.setAttribute('name', 'chevron-down');\n\t\tarrow.setAttribute('slot', 'arrow');\n\n\t\tlet chips = document.createElement('div');\n\t\tchips.classList.add('chips');\n\t\tchips.innerText = this.placeholder || '';\n\n\t\t// obalovac pre option a find\n\t\tlet optionsWrapper = document.createElement('div');\n\t\toptionsWrapper.setAttribute('part', 'options-wrapper');\n\t\toptionsWrapper.classList.add('options-wrapper');\n\t\toptionsWrapper.style.setProperty('max-height', this.maxHeight || 'auto');\n\n\t\tlet list = document.createElement('div');\n\t\tlist.classList.add('list');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet clear = document.createElement('wje-button');\n\t\tclear.setAttribute('fill', 'link');\n\t\tclear.setAttribute('part', 'clear');\n\t\tclear.setAttribute('stop-propagation', '');\n\n\t\tlet clearIcon = document.createElement('wje-icon');\n\t\tclearIcon.setAttribute('name', 'x');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\t// vytvorime popup\n\t\tlet popup = document.createElement('wje-popup');\n\t\tpopup.setAttribute('placement', 'bottom-start');\n\t\tif (!this.noSize)\n\t\t\tpopup.setAttribute('size', '');\n\t\tpopup.setAttribute('part', 'popup');\n\t\tpopup.setAttribute('offset', this.offset);\n\n\t\tif(this.lazy || this.querySelector('wje-options')) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t}\n\n\t\tif (this.disabled || this.readonly) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.variant === 'standard') {\n\t\t\tif (this.hasAttribute('label')) native.appendChild(label);\n\t\t} else {\n\t\t\twrapper.appendChild(label);\n\t\t}\n\n\t\tinputWrapper.append(slotStart);\n\t\tinputWrapper.append(display);\n\t\tinputWrapper.append(input);\n\n\t\tclear.append(clearIcon);\n\n\t\tif (this.hasAttribute('multiple')) inputWrapper.append(chips);\n\n\t\tif (this.hasAttribute('clearable')) inputWrapper.append(clear);\n\n\t\tinputWrapper.appendChild(slotEnd);\n\t\tinputWrapper.appendChild(arrow);\n\n\t\tlist.appendChild(slot);\n\n\t\tif (this.hasAttribute('find')) {\n\t\t\tlet find = document.createElement('wje-input');\n\t\t\tfind.setAttribute('variant', 'standard');\n\t\t\tfind.setAttribute('placeholder', 'Hľadať');\n\t\t\tfind.setAttribute('part', 'find');\n\t\t\tfind.clearable = true;\n\t\t\tfind.classList.add('find');\n\n\t\t\toptionsWrapper.appendChild(find);\n\n\t\t\tthis.findEl = find;\n\t\t}\n\n\t\toptionsWrapper.append(list);\n\n\t\twrapper.append(inputWrapper);\n\n\t\tpopup.append(wrapper);\n\t\tpopup.append(optionsWrapper);\n\n\t\tif (this.trigger === 'click') popup.setAttribute('manual', '');\n\n\t\tthis.append(error);\n\n\t\tnative.append(popup);\n\t\tnative.append(errorSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.native = native;\n\t\tthis.popup = popup;\n\t\tthis.labelElement = label;\n\t\tthis.slotStart = slotStart;\n\t\tthis.slotEnd = slotEnd;\n\t\tthis.input = input;\n\t\tthis.displayInput = display;\n\t\tthis.chips = chips;\n\t\tthis.clear = clear;\n\t\tthis.list = list;\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Executes post-render logic for the custom element.\n\t * This includes validation, event listener registration, managing custom attributes, and\n\t * handling options initialization for the component.\n\t * @returns {void} This method does not return any value.\n\t */\n\tafterDraw() {\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\n\t\tthis.getAllOptions()?.forEach((option) => {\n\t\t\tthis.optionCheckSlot(option);\n\t\t});\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\tthis.selectOptions(this.value);\n\n\t\tif (this.lazy) {\n\t\t\tevent.addListener(this.popup, 'wje-popup:show', null, (e) => {\n\t\t\t\tif (this._wasOppened) return;\n\t\t\t\tthis._wasOppened = true;\n\n\t\t\t\tconst optionsElement = this.querySelector('wje-options');\n\t\t\t\toptionsElement.setAttribute('lazy', '');\n\t\t\t\toptionsElement.setAttribute('attached', '');\n\t\t\t});\n\t\t}\n\n\t\tthis.#htmlOptions = Array.from(this.querySelectorAll(':scope > wje-option')).map((option) => {\n\t\t\treturn {\n\t\t\t\tvalue: option.value,\n\t\t\t\ttext: option.textContent.trim(),\n\t\t\t};\n\t\t})\n\n\t\tthis.input.addEventListener('focus', (e) => {\n\t\t\tthis.labelElement?.classList.add('fade');\n\t\t\tthis.native.classList.add('focused');\n\t\t});\n\n\t\tthis.input.addEventListener('blur', (e) => {\n\t\t\tthis.native.classList.remove('focused');\n\t\t\tif (!e.target.value) this.labelElement?.classList.remove('fade');\n\t\t});\n\n\t\tthis.input.addEventListener('input', (e) => {\n\t\t\tthis.propagateValidation();\n\t\t});\n\n\t\tthis.addEventListener('wje-option:change', this.optionChange);\n\n\t\tthis.addEventListener('wje-select:invalid', (e) => {\n\t\t\tthis.invalid = true;\n\t\t\tthis.pristine = false;\n\n\t\t\tthis.showInvalidMessage();\n\n\t\t\tif (this.customErrorDisplay) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tthis.clear?.addEventListener('wje-button:click', (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.clearSelections();\n\t\t});\n\n\t\tthis.list.addEventListener('wje-options:load', (e) => {\n\t\t\tthis.selectedOptions.forEach((option) => {\n\t\t\t\tthis.getAllOptions().forEach((el) => {\n\t\t\t\t\tif (el.value === option.value) {\n\t\t\t\t\t\tel.selected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ensure values from the value attribute are (re)selected after lazy-loaded pages\n\t\t\tconst attrValue = this.getAttribute('value')?.split(' ') || [];\n\n\t\t\tattrValue.forEach(val => {\n\t\t\t\tconst existingOption = Array.from(this.getAllOptions()).find(el => el.value === val);\n\t\t\t\tif (existingOption) {\n\t\t\t\t\texistingOption.selected = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t\tthis.selections(true);\n\n\t\t\tthis.list.scrollTo(0, 0);\n\t\t\tevent.dispatchCustomEvent(this.popup, 'wje-popup:content-ready'); // Notify that the content is ready\n\t\t});\n\n\t\t// skontrolujeme ci ma select atribut find\n\t\tif (this.hasAttribute('find') && this.findEl instanceof HTMLElement) {\n\t\t\tevent.addListener(this.findEl, 'keyup', '', this.#applySearchFilter);\n\t\t\tevent.addListener(this.findEl, 'wje-input:clear', '', this.#applySearchFilter);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the change event for an option element within a select-like component.\n\t * This method processes user interactions with options and updates the state of the component,\n\t * including selection management, validation, and UI updates. Behavior differs based on\n\t * whether the component supports multiple selections.\n\t * Key functionality:\n\t * - Prevents the default behavior, event propagation, and immediate propagation of the event.\n\t * - Retrieves all options within the component.\n\t * - If the component doesn't support multiple selection:\n\t * - Marks only the clicked option as selected and deselects others.\n\t * - Hides the option popup.\n\t * - If the component supports multiple selection:\n\t * - Processes the clicked option without deselecting others.\n\t * - Updates the selected options and triggers validation.\n\t * - Marks the form state as non-pristine.\n\t * - Propagates the validation state to other relevant parts of the component or system.\n\t * @param {Event} e The event object representing the option change interaction.\n\t */\n\toptionChange = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tlet allOptions = this.getAllOptions();\n\n\t\tif (!this.hasAttribute('multiple')) {\n\t\t\tallOptions.forEach((option) => {\n\t\t\t\tif (option.value === e.target.value) {\n\t\t\t\t\tthis.processClickedOption(option);\n\t\t\t\t} else {\n\t\t\t\t\toption.selected = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.popup.hide(false);\n\t\t} else {\n\t\t\tthis.processClickedOption(e.target, true);\n\t\t}\n\n\t\tthis.selections();\n\n\t\tthis.validate(this.selectedOptions);\n\n\t\tthis.pristine = false;\n\t\tthis.propagateValidation();\n\t}\n\n\t/**\n\t * Handles the logic for processing the selection state of a clicked option element.\n\t * @function processClickedOption\n\t * @param {Element} option The option element that is clicked.\n\t * @param {boolean} [multiple] A Boolean indicating whether multiple options can be selected. Defaults to false.\n\t * Changes the selected state of the passed option and updates the selected options list.\n\t * Checks if the option already has a \"selected\" attribute, toggles its state,\n\t * and updates the internal selected options.\n\t */\n\tprocessClickedOption = (option, multiple = false) => {\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\toption.selected = !isSelected;\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t}\n\n\t/**\n\t * Returns all the options as HTML.\n\t * @returns {NodeList} The options as HTML.\n\t */\n\tgetAllOptions() {\n\t\treturn this.querySelectorAll('wje-option');\n\t}\n\n\t/**\n\t * Handles changes in the selection for a component, updating internal values, input fields,\n\t * and visual presentation (like chips or slots) as per the given selection options.\n\t * @param {Array|null} options The collection of selected option elements. If null, no options are selected.\n\t * @param {number} length The total number of selected options.\n\t * @returns {void}\n\t */\n\tselectionChanged(options = null, length = 0) {\n\t\tif (this.hasAttribute('multiple')) {\n\t\t\tthis.value = options.map((el) => el.value).reverse();\n\t\t\tthis.input.value = this.value.map(a => a).join(\" \").trim();\n\n\t\t\tif (this.placeholder && length === 0) {\n\t\t\t\tthis.chips.innerHTML = this.placeholder;\n\t\t\t} else {\n\t\t\t\tif (options !== null) Array.from(options).slice(0, +this.maxOptions).forEach(option => this.chips.appendChild(this.getChip(option)));\n\t\t\t\tif (this.counterEl instanceof HTMLElement || !this.maxOptions || length > +this.maxOptions) {\n\t\t\t\t\tthis.counter();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst option = options?.at(0);\n\n\t\t\tthis.value = options?.map((el) => el.value)?.at(0) || '';\n\t\t\tthis.input.value = this.value[0] || '';\n\t\t\tthis.displayInput.value = options[0]?.textContent?.trim() || '';\n\n\t\t\tthis.slotStart.innerHTML = '';\n\t\t\tthis.slotEnd.innerHTML = '';\n\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\tlet optionSlotStart = option?.querySelector('wje-option > [slot=start]');\n\t\t\t\tif (optionSlotStart) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotStart.append(optionSlotStart.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\n\t\t\t\tlet optionSlotEnd = option?.querySelector('wje-option > [slot=end]');\n\t\t\t\tif (optionSlotEnd) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotEnd.append(optionSlotEnd.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles the logic for updating selections based on the current selected options,\n\t * updating chips content, and dispatching change events if necessary.\n\t * @param {boolean} [silence] If true, suppresses the dispatch of a custom change event.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselections(silence = false) {\n\t\tif (this.selectedOptions.length >= +this.maxOptions) {\n\t\t\tthis.counterEl = null;\n\t\t}\n\n\t\tif (this.chips) {\n\t\t\tthis.chips.innerHTML = '';\n\t\t}\n\n\t\tif (this.selectedOptions.length > 0) {\n\t\t\tthis.selectionChanged(this.selectedOptions, this.selectedOptions.length);\n\t\t} else {\n\t\t\tthis.selectionChanged(this.selectedOptions);\n\t\t}\n\n\t\tif (silence) return;\n\t\tevent.dispatchCustomEvent(this, 'wje-select:change');\n\t}\n\n\t/**\n\t * Updates the counter element to reflect the current state of selected values relative to the maximum allowed options.\n\t * If the maximum options are selected, the counter element is removed. If it does not already exist and needs to be displayed, it is created.\n\t * @returns {void} Does not return a value.\n\t */\n\tcounter() {\n\t\t// zmazanie counter (span)\n\t\tif (this.counterEl && this.value.length === +this.maxOptions) {\n\t\t\tthis.counterEl.remove();\n\t\t\tthis.counterEl = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// ak counter nie je, tak ho vytvorime\n\t\tif (!this.counterEl) {\n\t\t\tthis.counterEl = document.createElement('span');\n\t\t\tthis.counterEl.classList.add('counter');\n\n\t\t\tthis.chips.appendChild(this.counterEl);\n\t\t}\n\n\t\t// nastavime hodnotu counter\n\t\tthis.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;\n\t}\n\n\t/**\n\t * Creates and returns a chip element with specified properties and a label.\n\t * @param {object} option The configuration object for the chip. Typically includes properties such as value and textContent to set up the chip's label and data.\n\t * @returns {HTMLElement} The newly created chip element with a label and default properties.\n\t */\n\tgetChip(option) {\n\t\tlet chip = document.createElement('wje-chip');\n\t\tchip.size = 'small';\n\t\tchip.removable = true;\n\t\tchip.round = true;\n\t\tchip.addEventListener('wje:chip-remove', this.removeChip);\n\t\tchip.option = option;\n\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.innerText = this.#htmlSelectedItem(option.value) // option.textContent.trim();\n\n\t\tchip.appendChild(label);\n\n\t\treturn chip;\n\t}\n\n\t/**\n\t * Handles the removal of a chip element from the DOM and updates the related state.\n\t * @param {Event} e The event object triggered by the chip removal action.\n\t * The target of the event is expected to be the chip element itself.\n\t */\n\tremoveChip = (e) => {\n\t\te.target.parentNode.removeChild(e.target);\n\t\tthis.processClickedOption(e.target.option, true);\n\t\tthis.selections();\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item and mapping.\n\t * @param {object} item The item to generate the option for.\n\t * @param {object} [map] The mapping object that specifies the properties of the item to use for the option's value and text.\n\t * @param {string} [map.value] The property of the item to use for the option's value.\n\t * @param {string} [map.text] The property of the item to use for the option's text.\n\t * @returns {HTMLElement} The generated HTML option element.\n\t */\n\thtmlOption(item, map = { value: 'value', text: 'text' }) {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[map.value] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.value}`);\n\t\t}\n\n\t\tif (item[map.text] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.text}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[map.value] ?? '');\n\t\toption.innerText = item[map.text] ?? '';\n\n\t\tthis.#addedOptions.push({ [map.value]: item[map.value], [map.text]: item[map.text] });\n\t\treturn option;\n\t}\n\n\t/**\n\t * Returns the provided item.\n\t * @param {any} item The item to be returned.\n\t * @returns {any} The same item that was passed as input.\n\t */\n\thtmlSelectedItem(item) {\n\t\treturn item;\n\t}\n\n\t/**\n\t * Adds a new option to the component.\n\t * @param {object} optionData The data used to create the new option.\n\t * @param {boolean} [silent] Whether the addition should trigger events or not.\n\t * @param {object} [map] Mapping of keys to identify value and text in the optionData.\n\t * @param {string} [map.value] The key in optionData that represents the value of the option.\n\t * @param {string} [map.text] The key in optionData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOption(optionData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!optionData) return;\n\n\t\tconst optionsElement = this.querySelector('wje-options');\n\t\tif (optionsElement) {\n\t\t\toptionsElement.addOption(optionData, silent, map);\n\t\t\treturn;\n\t\t}\n\t\tlet option = this.htmlOption(optionData, map);\n\t\tthis.appendChild(option);\n\t}\n\n\t/**\n\t * Adds one or more options to a collection. If the input is an array, it adds each option within the array.\n\t * Otherwise, it adds a single option.\n\t * @param {Array | object} optionsData The data representing the options to be added. It can be a single object or an array of objects.\n\t * @param {boolean} [silent] Optional flag to determine if events or notifications should be suppressed while adding options.\n\t * @param {object} [map] An optional mapping object specifying how to map data properties to value and text for the options.\n\t * @param {string} [map.value] The property in the optionsData that represents the value of the option.\n\t * @param {string} [map.text] The property in the optionsData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOptions(optionsData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!Array.isArray(optionsData)) {\n\t\t\tthis.addOption(optionsData, silent, map);\n\t\t} else {\n\t\t\toptionsData.forEach((item) => {\n\t\t\t\tthis.addOption(item, silent, map);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Selects an option from the available options within the component.\n\t * @param {string} value The value of the option to be selected.\n\t * @param {boolean} [silent] Determines whether the selection should trigger notification or updates. Defaults to false.\n\t * @returns {void} Does not return a value.\n\t */\n\tselectOption(value, silent = false) {\n\t\tif (!value) return;\n\n\t\tlet option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\n\t\tif (option) {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) this.selections(silent);\n\t}\n\n\t/**\n\t * Selects multiple options based on the provided values. If a single value is provided, it selects that option.\n\t * If an array of values is provided, it iterates through the array and selects each option.\n\t * @param {any|any[]} values A single value or an array of values to be selected.\n\t * @param {boolean} [silent] Determines whether the selection action should occur silently without triggering other side effects or events.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselectOptions(values, silent = false) {\n\t\tif (!Array.isArray(values)) {\n\t\t\tthis.selectOption(values, silent);\n\t\t} else {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tthis.selectOption(value, silent);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Clones and appends an icon with the \"check\" slot to the specified option element.\n\t * @param {HTMLElement} option The target HTML element to which the cloned \"check\" icon will be appended.\n\t * @returns {void} This method does not return a value, but it modifies the DOM by appending a cloned \"check\" icon to the provided option element.\n\t */\n\toptionCheckSlot(option) {\n\t\tlet icon = this.querySelector('template')?.content.querySelector(`[slot=\"check\"]`);\n\t\tif (!icon) {\n\t\t\tconsole.warn(`Icon with slot \"check\" was not found.`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconClone = icon.cloneNode(true);\n\t\toption.append(iconClone);\n\t}\n\n\t/**\n\t * Clears all selected options and resets selections.\n\t * The method ensures that all options are deselected, updates the internal state, validates the selections,\n\t * propagates the validation status, and indicates invalid state if necessary.\n\t * @returns {void} No value is returned by this method.\n\t */\n\tclearSelections() {\n\t\tthis.selectedOptions = [];\n\n\t\tthis.getAllOptions().forEach((option) => {\n\t\t\toption.selected = false;\n\t\t});\n\t\tthis.selections();\n\n\t\tthis.validate();\n\t\tthis.propagateValidation();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Processes the given item and retrieves the corresponding value from the selected options.\n\t * @param {string} item The key to search for in the selected options.\n\t * @returns {string} The text content associated with the selected item, or an empty string if not found.\n\t */\n\t#htmlSelectedItem(item) {\n\t\tconst keyValue = \"value\"\n\t\tconst textValue = \"textContent\";\n\n\t\tconst value = this.selectedOptions.find((option) => option[keyValue] === item)?.[textValue] ?? \"\";\n\n\t\treturn this.htmlSelectedItem(value);\n\t}\n\n\t/**\n\t * Retrieves the list of selected options within the component.\n\t * @returns {Array<Element>} An array of elements representing the options that are currently selected.\n\t */\n\t#getSelectedOptions() {\n\t\treturn Array.from(this.querySelectorAll('wje-option[selected]'));\n\t}\n\n\t/**\n\t * Filters option elements based on the search input value.\n\t * This function applies a search filter to a list of options. If a `wj-options` element exists and has\n\t * the `lazy` attribute, the search value is passed to the `wj-options` element, enabling infinite scroll\n\t * functionality to handle the filtering. If the `lazy` attribute is not present, it performs a local\n\t * search to show or hide options depending on whether their text content matches the search input.\n\t * @param {Event} e The input event containing the search input value from the user.\n\t */\n\t#applySearchFilter = (e) => {\n\t\t// contains wj-options element with options\n\t\tconst optionsElement = this.querySelector('wje-options');\n\n\t\tif (optionsElement && optionsElement.hasAttribute('lazy')) {\n\t\t\t// pass search value to wj-options element and infinite scroll will handle the rest\n\t\t\toptionsElement.setAttribute('search', e.target.value);\n\t\t} else {\n\t\t\tlet value = e.target.value.trim().toLowerCase();\n\n\t\t\tthis.getAllOptions().forEach((option) => {\n\t\t\t\tif (option.textContent.trim().toLowerCase().includes(value)) {\n\t\t\t\t\toption.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\toption.style.display = 'none';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n","import { Select } from \"./select.element.js\";\n\nexport default Select;\n\nSelect.define('wje-select', Select);\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAe,sBAAsB;AAAA,EACjD,cAAc;AACb,UAAO;AAFF;AA4EN,sCAAgB,CAAE;AAElB,qCAAe,CAAE;AAgBjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACd,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,eAAe;AAAA,MACf,gBAAgB;AAAA,IAChB;AAsRD,qCAAY;AAmUZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,CAAC,MAAM;AACrB,QAAE,eAAgB;AAClB,QAAE,gBAAiB;AACnB,QAAE,yBAA0B;AAE5B,UAAI,aAAa,KAAK,cAAe;AAErC,UAAI,CAAC,KAAK,aAAa,UAAU,GAAG;AACnC,mBAAW,QAAQ,CAAC,WAAW;AAC9B,cAAI,OAAO,UAAU,EAAE,OAAO,OAAO;AACpC,iBAAK,qBAAqB,MAAM;AAAA,UACrC,OAAW;AACN,mBAAO,WAA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,IACnC,OAAS;AACN,aAAO,QAAQ,CAAC,UAAU;AACzB,aAAK,aAAa,OAAO,MAAM;AAAA,MACnC,CAAI;AAAA,IACJ;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,gBAAgB,QAAQ;;AACvB,QAAI,QAAO,UAAK,cAAc,UAAU,MAA7B,mBAAgC,QAAQ,cAAc;AACjE,QAAI,CAAC,MAAM;AACV,cAAQ,KAAK,uCAAuC;AACpD;AAAA,IACH;AAEE,QAAI,YAAY,KAAK,UAAU,IAAI;AACnC,WAAO,OAAO,SAAS;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQC,kBAAkB;AACjB,SAAK,kBAAkB,CAAE;AAEzB,SAAK,cAAa,EAAG,QAAQ,CAAC,WAAW;AACxC,aAAO,WAAW;AAAA,IACrB,CAAG;AACD,SAAK,WAAY;AAEjB,SAAK,SAAU;AACf,SAAK,oBAAqB;AAE1B,QAAI,KAAK,aAAa,SAAS,GAAG;AACjC,WAAK,mBAAoB;AAAA,IAC5B;AAAA,EACA;AAmDA;AAj/BC;AAEA;AA9EM;AAAA;AAAA;AAAA;AAAA;AAAA;AAihCN,sBAAiB,SAAC,MAAM;;AACvB,QAAM,WAAW;AACjB,QAAM,YAAY;AAElB,QAAM,UAAQ,UAAK,gBAAgB,KAAK,CAAC,WAAW,OAAO,QAAQ,MAAM,IAAI,MAA/D,mBAAmE,eAAc;AAE/F,SAAO,KAAK,iBAAiB,KAAK;AACpC;AAAA;AAAA;AAAA;AAAA;AAMC,wBAAmB,WAAG;AACrB,SAAO,MAAM,KAAK,KAAK,iBAAiB,sBAAsB,CAAC;AACjE;AAUC;ACnjCD,OAAO,OAAO,cAAc,MAAM;"}
|
|
1
|
+
{"version":3,"file":"wje-select.js","sources":["../packages/wje-select/select.element.js","../packages/wje-select/select.js"],"sourcesContent":["import { FormAssociatedElement } from '../internals/form-associated-element.js';\nimport { event } from '../utils/event.js';\nimport Button from '../wje-button/button.js';\nimport Popup from '../wje-popup/popup.js';\nimport Icon from '../wje-icon/icon.js';\nimport Label from '../wje-label/label.js';\nimport Chip from '../wje-chip/chip.js';\nimport Input from '../wje-input/input.js';\nimport Option from '../wje-option/option.js';\nimport Options from '../wje-options/options.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\nexport class Select extends FormAssociatedElement {\n\tconstructor() {\n\t\tsuper();\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the counter element, initially null.\n\t\t * @private\n\t\t */\n\t\tthis.counterEl = null;\n\n\t\t/**\n\t\t * @type {boolean}\n\t\t * @description Tracks whether the select element was previously opened, initially false.\n\t\t * @private\n\t\t * @default {boolean} false\n\t\t */\n\t\tthis._wasOppened = false;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the native select element, initially null.\n\t\t */\n\t\tthis.native = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the popup element, initially null.\n\t\t */\n\t\tthis.popup = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the label element, initially null.\n\t\t */\n\t\tthis.labelElement = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot start element, initially null.\n\t\t */\n\t\tthis.slotStart = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the slot end element, initially null.\n\t\t */\n\t\tthis.slotEnd = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the input element, initially null.\n\t\t */\n\t\tthis.input = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the chips element, initially null.\n\t\t */\n\t\tthis.chips = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the clear button element, initially null.\n\t\t */\n\t\tthis.clear = null;\n\n\t\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the list element, initially null.\n\t\t */\n\t\tthis.list = null;\n\n\t\tthis._value = [];\n\t\tthis._selectedOptions = [];\n\t}\n\n\t#addedOptions = [];\n\n\t#htmlOptions = [];\n\n\t/**\n\t * An object representing component dependencies with their respective classes.\n\t * Each property in the object maps a custom component name (as a string key)\n\t * to its corresponding class or constructor.\n\t * @typedef {{[key: string]: Function}} Dependencies\n\t * @property {Function} 'wje-button' Represents the Button component class.\n\t * @property {Function} 'wje-popup' Represents the Popup component class.\n\t * @property {Function} 'wje-icon' Represents the Icon component class.\n\t * @property {Function} 'wje-label' Represents the Label component class.\n\t * @property {Function} 'wje-chip' Represents the Chip component class.\n\t * @property {Function} 'wje-input' Represents the Input component class.\n\t * @property {Function} 'wje-option' Represents the Option component class.\n\t * @property {Function} 'wje-checkbox' Represents the Checkbox component class.\n\t */\n\tdependencies = {\n\t\t'wje-button': Button,\n\t\t'wje-popup': Popup,\n\t\t'wje-icon': Icon,\n\t\t'wje-label': Label,\n\t\t'wje-chip': Chip,\n\t\t'wje-input': Input,\n\t\t'wje-option': Option,\n\t\t'wje-options': Options,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the value for the form field. Converts the input value into a FormData object\n\t * if it is not already an array, splitting by spaces if necessary, and sets the\n\t * internal form value as well as the selected values.\n\t * @param {string|Array} value The value to be set. Can be a string (which will be\n\t * split into an array by spaces) or an array of values.\n\t */\n\tset value(value) {\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t}\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t}\n\t\tthis.internals.setFormValue(value);\n\t}\n\n\t/**\n\t * Retrieves the current value.\n\t * @returns {any} The value of the `_value` property.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets the maximum number of options allowed.\n\t * @param { number | object} value The value to set as the maximum number of options.\n\t * If null, the 'max-options' attribute will be removed.\n\t */\n\tset maxOptions(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-options', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-options');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum number of options allowed.\n\t * Parses the value of the 'max-options' attribute from the element and converts it to a number.\n\t * If the attribute is not present or cannot be converted to a valid number, defaults to 1.\n\t * @returns {number} The maximum number of options, or 0 if the attribute is not set or invalid.\n\t */\n\tget maxOptions() {\n\t\treturn +this.getAttribute('max-options') || 1;\n\t}\n\n\t/**\n\t * @summary Setter for the defaultValue attribute.\n\t * This method sets the 'value' attribute of the custom input element to the provided value.\n\t * The 'value' attribute represents the default value of the input element.\n\t * @param {string} value The value to set as the default value.\n\t */\n\tset defaultValue(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\t/**\n\t * @summary Getter for the defaultValue attribute.\n\t * This method retrieves the 'value' attribute of the custom input element.\n\t * The 'value' attribute represents the default value of the input element.\n\t * If the 'value' attribute is not set, it returns an empty string.\n\t * @returns {string} The default value of the input element.\n\t */\n\tget defaultValue() {\n\t\treturn this.getAttribute('value') ?? '';\n\t}\n\n\t/**\n\t * Sets the trigger value.\n\t * @param {string} value The trigger value to set.\n\t */\n\tset trigger(value) {\n\t\tthis.setAttribute('trigger', value);\n\t}\n\n\t/**\n\t * Returns the trigger value.\n\t * @returns {string} The trigger value.\n\t */\n\tget trigger() {\n\t\treturn this.getAttribute('trigger') || 'click';\n\t}\n\n\t/**\n\t * Sets or removes the disabled state for the associated elements.\n\t * @param {boolean} value A boolean indicating whether the elements should be disabled.\n\t * If true, the disabled attribute is added to the elements. If false, the disabled attribute is removed.\n\t */\n\tset disabled(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\t\t\tthis.input.setAttribute('disabled', '');\n\t\t\tthis.displayInput.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\t\t\tthis.input.removeAttribute('disabled');\n\t\t\tthis.displayInput.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the current state of the 'disabled' attribute.\n\t * @returns {boolean} Returns true if the 'disabled' attribute is present, otherwise false.\n\t */\n\tget disabled() {\n\t\treturn this.hasAttribute('disabled');\n\t}\n\n\t/**\n\t * Sets the readonly state of the element. When set to true,\n\t * the element and its associated inputs are marked as readonly or disabled.\n\t * When set to false, the readonly and disabled attributes are removed,\n\t * allowing user interaction.\n\t * @param {boolean} value A boolean value indicating whether to set the\n\t * element and its associated inputs to readonly (true) or not (false).\n\t */\n\tset readonly(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('disabled', '');\n\t\t\tthis.input.setAttribute('readonly', '');\n\t\t\tthis.displayInput.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\t\t\tthis.input.removeAttribute('readonly');\n\t\t\tthis.displayInput.removeAttribute('disabled');\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the 'readonly' attribute is present on the element.\n\t * @returns {boolean} Returns true if the 'readonly' attribute is set, otherwise false.\n\t */\n\tget readonly() {\n\t\treturn this.hasAttribute('readonly');\n\t}\n\n\t/**\n\t * Sets the maximum height value for the element.\n\t * If a value is provided, it sets the 'max-height' attribute on the element.\n\t * If no value is provided, it removes the 'max-height' attribute from the element.\n\t * @param {string|null} value The maximum height to be set. If null or undefined, the attribute is removed.\n\t */\n\tset maxHeight(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('max-height', value);\n\t\t} else {\n\t\t\tthis.removeAttribute('max-height');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the maximum height value, which is determined by the 'max-height' attribute.\n\t * If the attribute is not set, a default value of '200px' is returned.\n\t * @returns {string} The maximum height value as a string.\n\t */\n\tget maxHeight() {\n\t\treturn this.getAttribute('max-height') || 'auto';\n\t}\n\n\t/**\n\t * Sets the offset attribute for the element.\n\t * @param {string} value The value to assign to the offset attribute.\n\t */\n\tset offset(value) {\n\t\tthis.setAttribute('offset', value);\n\t}\n\n\t/**\n\t * Gets the value of the offset attribute of the current element.\n\t * If the offset attribute is not present, returns a default value of '0'.\n\t * @returns {string} The value of the offset attribute or the default value '0'.\n\t */\n\tget offset() {\n\t\treturn this.getAttribute('offset') || '5';\n\t}\n\n\t/**\n\t * Sets the selected options for the object.\n\t * @param {Array|object} value The new value for the selected options. It can be an array or object containing the selected options.\n\t */\n\tset selectedOptions(value) {\n\t\tthis._selectedOptions = value;\n\t}\n\n\t/**\n\t * Retrieves the selected options.\n\t * @returns {Array} An array containing the currently selected options. If no options are selected, an empty array is returned.\n\t */\n\tget selectedOptions() {\n\t\treturn this._selectedOptions || [];\n\t}\n\n\t/**\n\t * Sets the `lazy` attribute on the element. If the provided value is truthy, the `lazy` attribute is added. If the value is falsy, the `lazy` attribute is removed.\n\t * @param {boolean} value A boolean value indicating whether to add or remove the `lazy` attribute. If `true`, the attribute is added; if `false`, it is removed.\n\t */\n\tset lazy(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('lazy', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('lazy');\n\t\t}\n\t}\n\n\t/**\n\t * Getter for the 'lazy' property.\n\t * @returns {boolean} Returns true if the 'lazy' attribute is present on the element, otherwise false.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Sets or removes the 'no-size' attribute on an element.\n\t * @param {boolean} value A boolean indicating whether to add or remove the 'no-size' attribute. If true, the attribute is added; if false, the attribute is removed.\n\t */\n\tset noSize(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('no-size', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('no-size');\n\t\t}\n\t}\n\n\t/**\n\t * Gets the value of the 'no-size' attribute for the element.\n\t * @returns {boolean} True if the 'no-size' attribute is present, otherwise false.\n\t */\n\tget noSize() {\n\t\treturn this.hasAttribute('no-size');\n\t}\n\n\t/**\n\t * Getter for the customErrorDisplay attribute.\n\t * @returns {boolean} Whether the attribute is present.\n\t */\n\tget customErrorDisplay() {\n\t\treturn this.hasAttribute('custom-error-display');\n\t}\n\n\t/**\n\t * Retrieves the complete list of options available for the component.\n\t * The options are determined by combining elements from various sources, including loaded options, added options, and HTML-sourced options.\n\t * If a `wje-options` element is present within the component, its loaded options are included in the merged list.\n\t * In the absence of a `wje-options` element, duplicates among the added and HTML options are removed, retaining their order.\n\t * @returns {Array<object>} An array containing all the available options, combining the loaded, added, and HTML-based options, with duplicates removed where applicable.\n\t */\n\tget options() {\n\t\tif (this.querySelector('wje-options')) {\n\t\t\tconst allOptions = [...this.querySelector('wje-options').loadedOptions, ...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn allOptions\n\t\t} else {\n\t\t\tconst allOptions = [...this.#addedOptions, ...this.#htmlOptions]\n\n\t\t\treturn Array.from(\n\t\t\t\tnew Map(allOptions.reverse().map(obj => [obj.value, obj])).values()\n\t\t\t).reverse();\n\t\t}\n\t}\n\n\tclassName = 'Select';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['active', 'value', 'disabled', 'readonly', 'multiple', 'label', 'placeholder', 'max-height', 'max-options', 'variant', 'placement'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t}\n\n\tbeforeDraw() {\n\t\tif(this.hasAttribute('value')) {\n\t\t\tthis.value = this.getAttribute('value');\n\t\t}\n\t}\n\n\t/**\n\t * Draws the component for the select.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tthis.classList.add('wje-placement', this.placement ? 'wje-' + this.placement : 'wje-start');\n\n\t\t// zakladny obalovac\n\t\tlet native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.classList.add('native-select', this.variant || 'default');\n\n\t\t// wrapper pre label a inputWrapper\n\t\tlet wrapper = document.createElement('div');\n\t\twrapper.classList.add('wrapper');\n\t\twrapper.setAttribute('slot', 'anchor');\n\n\t\t// label\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.setAttribute('part', 'label');\n\t\tlabel.innerText = this.label || '';\n\n\t\t// obalovac pre input\n\t\tlet inputWrapper = document.createElement('div');\n\t\tinputWrapper.setAttribute('part', 'input-wrapper');\n\t\tinputWrapper.classList.add('input-wrapper');\n\n\t\tlet slotStart = document.createElement('div');\n\t\tslotStart.classList.add('slot-start');\n\n\t\tlet input = document.createElement('input');\n\t\tinput.setAttribute('type', 'text');\n\t\tinput.value = this.value.join(' ').trim();\n\t\tinput.classList.add('input-hidden');\n\n\t\tlet display = document.createElement('input');\n\t\tdisplay.setAttribute('type', 'text');\n\t\tdisplay.setAttribute('part', 'input');\n\t\tdisplay.setAttribute('autocomplete', 'off');\n\t\tdisplay.setAttribute('readonly', '');\n\t\tdisplay.setAttribute('placeholder', this.placeholder || '');\n\n\t\tif (this.required) {\n\t\t\tinput.setAttribute('required', '');\n\t\t\tdisplay.setAttribute('required', '');\n\t\t}\n\n\t\tlet slotEnd = document.createElement('div');\n\t\tslotEnd.classList.add('slot-end');\n\n\t\tlet arrow = document.createElement('wje-icon');\n\t\tarrow.setAttribute('name', 'chevron-down');\n\t\tarrow.setAttribute('slot', 'arrow');\n\n\t\tlet chips = document.createElement('div');\n\t\tchips.classList.add('chips');\n\t\tchips.innerText = this.placeholder || '';\n\n\t\t// obalovac pre option a find\n\t\tlet optionsWrapper = document.createElement('div');\n\t\toptionsWrapper.setAttribute('part', 'options-wrapper');\n\t\toptionsWrapper.classList.add('options-wrapper');\n\t\toptionsWrapper.style.setProperty('height', this.maxHeight);\n\n\t\tlet list = document.createElement('div');\n\t\tlist.classList.add('list');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet clear = document.createElement('wje-button');\n\t\tclear.setAttribute('fill', 'link');\n\t\tclear.setAttribute('part', 'clear');\n\t\tclear.setAttribute('stop-propagation', '');\n\n\t\tlet clearIcon = document.createElement('wje-icon');\n\t\tclearIcon.setAttribute('name', 'x');\n\n\t\tlet error = document.createElement('div');\n\t\terror.setAttribute('slot', 'error');\n\n\t\tlet errorSlot = document.createElement('slot');\n\t\terrorSlot.setAttribute('name', 'error');\n\n\t\t// vytvorime popup\n\t\tlet popup = document.createElement('wje-popup');\n\t\tpopup.setAttribute('placement', 'bottom-start');\n\t\tif (!this.noSize)\n\t\t\tpopup.setAttribute('size', '');\n\t\tpopup.setAttribute('part', 'popup');\n\t\tpopup.setAttribute('offset', this.offset);\n\n\t\tif(this.lazy || this.querySelector('wje-options')) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t}\n\n\t\tif (this.disabled || this.readonly) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.variant === 'standard') {\n\t\t\tif (this.hasAttribute('label')) native.appendChild(label);\n\t\t} else {\n\t\t\twrapper.appendChild(label);\n\t\t}\n\n\t\tinputWrapper.append(slotStart);\n\t\tinputWrapper.append(display);\n\t\tinputWrapper.append(input);\n\n\t\tclear.append(clearIcon);\n\n\t\tif (this.hasAttribute('multiple')) inputWrapper.append(chips);\n\n\t\tif (this.hasAttribute('clearable')) inputWrapper.append(clear);\n\n\t\tinputWrapper.appendChild(slotEnd);\n\t\tinputWrapper.appendChild(arrow);\n\n\t\tlist.appendChild(slot);\n\n\t\tif (this.hasAttribute('find')) {\n\t\t\tlet find = document.createElement('wje-input');\n\t\t\tfind.setAttribute('variant', 'standard');\n\t\t\tfind.setAttribute('placeholder', 'Hľadať');\n\t\t\tfind.setAttribute('part', 'find');\n\t\t\tfind.clearable = true;\n\t\t\tfind.classList.add('find');\n\n\t\t\toptionsWrapper.appendChild(find);\n\n\t\t\tthis.findEl = find;\n\t\t}\n\n\t\toptionsWrapper.append(list);\n\n\t\twrapper.append(inputWrapper);\n\n\t\tpopup.append(wrapper);\n\t\tpopup.append(optionsWrapper);\n\n\t\tif (this.trigger === 'click') popup.setAttribute('manual', '');\n\n\t\tthis.append(error);\n\n\t\tnative.append(popup);\n\t\tnative.append(errorSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.native = native;\n\t\tthis.popup = popup;\n\t\tthis.labelElement = label;\n\t\tthis.slotStart = slotStart;\n\t\tthis.slotEnd = slotEnd;\n\t\tthis.input = input;\n\t\tthis.displayInput = display;\n\t\tthis.chips = chips;\n\t\tthis.clear = clear;\n\t\tthis.list = list;\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Executes post-render logic for the custom element.\n\t * This includes validation, event listener registration, managing custom attributes, and\n\t * handling options initialization for the component.\n\t * @returns {void} This method does not return any value.\n\t */\n\tafterDraw() {\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\n\t\tthis.getAllOptions()?.forEach((option) => {\n\t\t\tthis.optionCheckSlot(option);\n\t\t});\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\tthis.selectOptions(this.value);\n\n\t\tif (this.lazy) {\n\t\t\tevent.addListener(this.popup, 'wje-popup:show', null, (e) => {\n\t\t\t\tif (this._wasOppened) return;\n\t\t\t\tthis._wasOppened = true;\n\n\t\t\t\tconst optionsElement = this.querySelector('wje-options');\n\t\t\t\toptionsElement.setAttribute('lazy', '');\n\t\t\t\toptionsElement.setAttribute('attached', '');\n\t\t\t});\n\t\t}\n\n\t\tthis.#htmlOptions = Array.from(this.querySelectorAll(':scope > wje-option')).map((option) => {\n\t\t\treturn {\n\t\t\t\tvalue: option.value,\n\t\t\t\ttext: option.textContent.trim(),\n\t\t\t};\n\t\t})\n\n\t\tthis.input.addEventListener('focus', (e) => {\n\t\t\tthis.labelElement?.classList.add('fade');\n\t\t\tthis.native.classList.add('focused');\n\t\t});\n\n\t\tthis.input.addEventListener('blur', (e) => {\n\t\t\tthis.native.classList.remove('focused');\n\t\t\tif (!e.target.value) this.labelElement?.classList.remove('fade');\n\t\t});\n\n\t\tthis.input.addEventListener('input', (e) => {\n\t\t\tthis.propagateValidation();\n\t\t});\n\n\t\tthis.addEventListener('wje-option:change', this.optionChange);\n\n\t\tthis.addEventListener('wje-select:invalid', (e) => {\n\t\t\tthis.invalid = true;\n\t\t\tthis.pristine = false;\n\n\t\t\tthis.showInvalidMessage();\n\n\t\t\tif (this.customErrorDisplay) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\tthis.clear?.addEventListener('wje-button:click', (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.clearSelections();\n\t\t});\n\n\t\tthis.list.addEventListener('wje-options:load', (e) => {\n\t\t\tthis.selectedOptions.forEach((option) => {\n\t\t\t\tthis.getAllOptions().forEach((el) => {\n\t\t\t\t\tif (el.value === option.value) {\n\t\t\t\t\t\tel.selected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Ensure values from the value attribute are (re)selected after lazy-loaded pages\n\t\t\tconst attrValue = this.getAttribute('value')?.split(' ') || [];\n\n\t\t\tattrValue.forEach(val => {\n\t\t\t\tconst existingOption = Array.from(this.getAllOptions()).find(el => el.value === val);\n\t\t\t\tif (existingOption) {\n\t\t\t\t\texistingOption.selected = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t\tthis.selections(true);\n\n\t\t\tthis.list.scrollTo(0, 0);\n\t\t\tevent.dispatchCustomEvent(this.popup, 'wje-popup:content-ready'); // Notify that the content is ready\n\t\t});\n\n\t\t// skontrolujeme ci ma select atribut find\n\t\tif (this.hasAttribute('find') && this.findEl instanceof HTMLElement) {\n\t\t\tevent.addListener(this.findEl, 'keyup', '', this.#applySearchFilter);\n\t\t\tevent.addListener(this.findEl, 'wje-input:clear', '', this.#applySearchFilter);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the change event for an option element within a select-like component.\n\t * This method processes user interactions with options and updates the state of the component,\n\t * including selection management, validation, and UI updates. Behavior differs based on\n\t * whether the component supports multiple selections.\n\t * Key functionality:\n\t * - Prevents the default behavior, event propagation, and immediate propagation of the event.\n\t * - Retrieves all options within the component.\n\t * - If the component doesn't support multiple selection:\n\t * - Marks only the clicked option as selected and deselects others.\n\t * - Hides the option popup.\n\t * - If the component supports multiple selection:\n\t * - Processes the clicked option without deselecting others.\n\t * - Updates the selected options and triggers validation.\n\t * - Marks the form state as non-pristine.\n\t * - Propagates the validation state to other relevant parts of the component or system.\n\t * @param {Event} e The event object representing the option change interaction.\n\t */\n\toptionChange = (e) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tlet allOptions = this.getAllOptions();\n\n\t\tif (!this.hasAttribute('multiple')) {\n\t\t\tallOptions.forEach((option) => {\n\t\t\t\tif (option.value === e.target.value) {\n\t\t\t\t\tthis.processClickedOption(option);\n\t\t\t\t} else {\n\t\t\t\t\toption.selected = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.popup.hide(false);\n\t\t} else {\n\t\t\tthis.processClickedOption(e.target, true);\n\t\t}\n\n\t\tthis.selections();\n\n\t\tthis.validate(this.selectedOptions);\n\n\t\tthis.pristine = false;\n\t\tthis.propagateValidation();\n\t}\n\n\t/**\n\t * Handles the logic for processing the selection state of a clicked option element.\n\t * @function processClickedOption\n\t * @param {Element} option The option element that is clicked.\n\t * @param {boolean} [multiple] A Boolean indicating whether multiple options can be selected. Defaults to false.\n\t * Changes the selected state of the passed option and updates the selected options list.\n\t * Checks if the option already has a \"selected\" attribute, toggles its state,\n\t * and updates the internal selected options.\n\t */\n\tprocessClickedOption = (option, multiple = false) => {\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\toption.selected = !isSelected;\n\n\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t}\n\n\t/**\n\t * Returns all the options as HTML.\n\t * @returns {NodeList} The options as HTML.\n\t */\n\tgetAllOptions() {\n\t\treturn this.querySelectorAll('wje-option');\n\t}\n\n\t/**\n\t * Handles changes in the selection for a component, updating internal values, input fields,\n\t * and visual presentation (like chips or slots) as per the given selection options.\n\t * @param {Array|null} options The collection of selected option elements. If null, no options are selected.\n\t * @param {number} length The total number of selected options.\n\t * @returns {void}\n\t */\n\tselectionChanged(options = null, length = 0) {\n\t\tif (this.hasAttribute('multiple')) {\n\t\t\tthis.value = options.map((el) => el.value).reverse();\n\t\t\tthis.input.value = this.value.map(a => a).join(\" \").trim();\n\n\t\t\tif (this.placeholder && length === 0) {\n\t\t\t\tthis.chips.innerHTML = this.placeholder;\n\t\t\t} else {\n\t\t\t\tif (options !== null) Array.from(options).slice(0, +this.maxOptions).forEach(option => this.chips.appendChild(this.getChip(option)));\n\t\t\t\tif (this.counterEl instanceof HTMLElement || !this.maxOptions || length > +this.maxOptions) {\n\t\t\t\t\tthis.counter();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst option = options?.at(0);\n\n\t\t\tthis.value = options?.map((el) => el.value)?.at(0) || '';\n\t\t\tthis.input.value = this.value[0] || '';\n\t\t\tthis.displayInput.value = options[0]?.textContent?.trim() || '';\n\n\t\t\tthis.slotStart.innerHTML = '';\n\t\t\tthis.slotEnd.innerHTML = '';\n\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\tlet optionSlotStart = option?.querySelector('wje-option > [slot=start]');\n\t\t\t\tif (optionSlotStart) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotStart.append(optionSlotStart.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\n\t\t\t\tlet optionSlotEnd = option?.querySelector('wje-option > [slot=end]');\n\t\t\t\tif (optionSlotEnd) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tthis.slotEnd.append(optionSlotEnd.cloneNode(true));\n\t\t\t\t\t},0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles the logic for updating selections based on the current selected options,\n\t * updating chips content, and dispatching change events if necessary.\n\t * @param {boolean} [silence] If true, suppresses the dispatch of a custom change event.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselections(silence = false) {\n\t\tif (this.selectedOptions.length >= +this.maxOptions) {\n\t\t\tthis.counterEl = null;\n\t\t}\n\n\t\tif (this.chips) {\n\t\t\tthis.chips.innerHTML = '';\n\t\t}\n\n\t\tif (this.selectedOptions.length > 0) {\n\t\t\tthis.selectionChanged(this.selectedOptions, this.selectedOptions.length);\n\t\t} else {\n\t\t\tthis.selectionChanged(this.selectedOptions);\n\t\t}\n\n\t\tif (silence) return;\n\t\tevent.dispatchCustomEvent(this, 'wje-select:change');\n\t}\n\n\t/**\n\t * Updates the counter element to reflect the current state of selected values relative to the maximum allowed options.\n\t * If the maximum options are selected, the counter element is removed. If it does not already exist and needs to be displayed, it is created.\n\t * @returns {void} Does not return a value.\n\t */\n\tcounter() {\n\t\t// zmazanie counter (span)\n\t\tif (this.counterEl && this.value.length === +this.maxOptions) {\n\t\t\tthis.counterEl.remove();\n\t\t\tthis.counterEl = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// ak counter nie je, tak ho vytvorime\n\t\tif (!this.counterEl) {\n\t\t\tthis.counterEl = document.createElement('span');\n\t\t\tthis.counterEl.classList.add('counter');\n\n\t\t\tthis.chips.appendChild(this.counterEl);\n\t\t}\n\n\t\t// nastavime hodnotu counter\n\t\tthis.counterEl.innerText = `+${this.value.length - +this.maxOptions}`;\n\t}\n\n\t/**\n\t * Creates and returns a chip element with specified properties and a label.\n\t * @param {object} option The configuration object for the chip. Typically includes properties such as value and textContent to set up the chip's label and data.\n\t * @returns {HTMLElement} The newly created chip element with a label and default properties.\n\t */\n\tgetChip(option) {\n\t\tlet chip = document.createElement('wje-chip');\n\t\tchip.size = 'small';\n\t\tchip.removable = true;\n\t\tchip.round = true;\n\t\tchip.addEventListener('wje:chip-remove', this.removeChip);\n\t\tchip.option = option;\n\n\t\tlet label = document.createElement('wje-label');\n\t\tlabel.innerText = this.#htmlSelectedItem(option.value) // option.textContent.trim();\n\n\t\tchip.appendChild(label);\n\n\t\treturn chip;\n\t}\n\n\t/**\n\t * Handles the removal of a chip element from the DOM and updates the related state.\n\t * @param {Event} e The event object triggered by the chip removal action.\n\t * The target of the event is expected to be the chip element itself.\n\t */\n\tremoveChip = (e) => {\n\t\te.target.parentNode.removeChild(e.target);\n\t\tthis.processClickedOption(e.target.option, true);\n\t\tthis.selections();\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item and mapping.\n\t * @param {object} item The item to generate the option for.\n\t * @param {object} [map] The mapping object that specifies the properties of the item to use for the option's value and text.\n\t * @param {string} [map.value] The property of the item to use for the option's value.\n\t * @param {string} [map.text] The property of the item to use for the option's text.\n\t * @returns {HTMLElement} The generated HTML option element.\n\t */\n\thtmlOption(item, map = { value: 'value', text: 'text' }) {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[map.value] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.value}`);\n\t\t}\n\n\t\tif (item[map.text] === null) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${map.text}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[map.value] ?? '');\n\t\toption.innerText = item[map.text] ?? '';\n\n\t\tthis.#addedOptions.push({ [map.value]: item[map.value], [map.text]: item[map.text] });\n\t\treturn option;\n\t}\n\n\t/**\n\t * Returns the provided item.\n\t * @param {any} item The item to be returned.\n\t * @returns {any} The same item that was passed as input.\n\t */\n\thtmlSelectedItem(item) {\n\t\treturn item;\n\t}\n\n\t/**\n\t * Adds a new option to the component.\n\t * @param {object} optionData The data used to create the new option.\n\t * @param {boolean} [silent] Whether the addition should trigger events or not.\n\t * @param {object} [map] Mapping of keys to identify value and text in the optionData.\n\t * @param {string} [map.value] The key in optionData that represents the value of the option.\n\t * @param {string} [map.text] The key in optionData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOption(optionData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!optionData) return;\n\n\t\tconst optionsElement = this.querySelector('wje-options');\n\t\tif (optionsElement) {\n\t\t\toptionsElement.addOption(optionData, silent, map);\n\t\t\treturn;\n\t\t}\n\t\tlet option = this.htmlOption(optionData, map);\n\t\tthis.appendChild(option);\n\t}\n\n\t/**\n\t * Adds one or more options to a collection. If the input is an array, it adds each option within the array.\n\t * Otherwise, it adds a single option.\n\t * @param {Array | object} optionsData The data representing the options to be added. It can be a single object or an array of objects.\n\t * @param {boolean} [silent] Optional flag to determine if events or notifications should be suppressed while adding options.\n\t * @param {object} [map] An optional mapping object specifying how to map data properties to value and text for the options.\n\t * @param {string} [map.value] The property in the optionsData that represents the value of the option.\n\t * @param {string} [map.text] The property in the optionsData that represents the text of the option.\n\t * @returns {void}\n\t */\n\taddOptions(optionsData, silent = false, map = { value: 'value', text: 'text' }) {\n\t\tif (!Array.isArray(optionsData)) {\n\t\t\tthis.addOption(optionsData, silent, map);\n\t\t} else {\n\t\t\toptionsData.forEach((item) => {\n\t\t\t\tthis.addOption(item, silent, map);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Selects an option from the available options within the component.\n\t * @param {string} value The value of the option to be selected.\n\t * @param {boolean} [silent] Determines whether the selection should trigger notification or updates. Defaults to false.\n\t * @returns {void} Does not return a value.\n\t */\n\tselectOption(value, silent = false) {\n\t\tif (!value) return;\n\n\t\tlet option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\n\t\tif (option) {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) this.selections(silent);\n\t}\n\n\t/**\n\t * Selects multiple options based on the provided values. If a single value is provided, it selects that option.\n\t * If an array of values is provided, it iterates through the array and selects each option.\n\t * @param {any|any[]} values A single value or an array of values to be selected.\n\t * @param {boolean} [silent] Determines whether the selection action should occur silently without triggering other side effects or events.\n\t * @returns {void} This method does not return a value.\n\t */\n\tselectOptions(values, silent = false) {\n\t\tif (!Array.isArray(values)) {\n\t\t\tthis.selectOption(values, silent);\n\t\t} else {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tthis.selectOption(value, silent);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Clones and appends an icon with the \"check\" slot to the specified option element.\n\t * @param {HTMLElement} option The target HTML element to which the cloned \"check\" icon will be appended.\n\t * @returns {void} This method does not return a value, but it modifies the DOM by appending a cloned \"check\" icon to the provided option element.\n\t */\n\toptionCheckSlot(option) {\n\t\tlet icon = this.querySelector('template')?.content.querySelector(`[slot=\"check\"]`);\n\t\tif (!icon) {\n\t\t\tconsole.warn(`Icon with slot \"check\" was not found.`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconClone = icon.cloneNode(true);\n\t\toption.append(iconClone);\n\t}\n\n\t/**\n\t * Clears all selected options and resets selections.\n\t * The method ensures that all options are deselected, updates the internal state, validates the selections,\n\t * propagates the validation status, and indicates invalid state if necessary.\n\t * @returns {void} No value is returned by this method.\n\t */\n\tclearSelections() {\n\t\tthis.selectedOptions = [];\n\n\t\tthis.getAllOptions().forEach((option) => {\n\t\t\toption.selected = false;\n\t\t});\n\t\tthis.selections();\n\n\t\tthis.validate();\n\t\tthis.propagateValidation();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t}\n\n\t/**\n\t * Processes the given item and retrieves the corresponding value from the selected options.\n\t * @param {string} item The key to search for in the selected options.\n\t * @returns {string} The text content associated with the selected item, or an empty string if not found.\n\t */\n\t#htmlSelectedItem(item) {\n\t\tconst keyValue = \"value\"\n\t\tconst textValue = \"textContent\";\n\n\t\tconst value = this.selectedOptions.find((option) => option[keyValue] === item)?.[textValue] ?? \"\";\n\n\t\treturn this.htmlSelectedItem(value);\n\t}\n\n\t/**\n\t * Retrieves the list of selected options within the component.\n\t * @returns {Array<Element>} An array of elements representing the options that are currently selected.\n\t */\n\t#getSelectedOptions() {\n\t\treturn Array.from(this.querySelectorAll('wje-option[selected]'));\n\t}\n\n\t/**\n\t * Filters option elements based on the search input value.\n\t * This function applies a search filter to a list of options. If a `wj-options` element exists and has\n\t * the `lazy` attribute, the search value is passed to the `wj-options` element, enabling infinite scroll\n\t * functionality to handle the filtering. If the `lazy` attribute is not present, it performs a local\n\t * search to show or hide options depending on whether their text content matches the search input.\n\t * @param {Event} e The input event containing the search input value from the user.\n\t */\n\t#applySearchFilter = (e) => {\n\t\t// contains wj-options element with options\n\t\tconst optionsElement = this.querySelector('wje-options');\n\n\t\tif (optionsElement && optionsElement.hasAttribute('lazy')) {\n\t\t\t// pass search value to wj-options element and infinite scroll will handle the rest\n\t\t\toptionsElement.setAttribute('search', e.target.value);\n\t\t} else {\n\t\t\tlet value = e.target.value.trim().toLowerCase();\n\n\t\t\tthis.getAllOptions().forEach((option) => {\n\t\t\t\tif (option.textContent.trim().toLowerCase().includes(value)) {\n\t\t\t\t\toption.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\toption.style.display = 'none';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n","import { Select } from \"./select.element.js\";\n\nexport default Select;\n\nSelect.define('wje-select', Select);\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAe,sBAAsB;AAAA,EACjD,cAAc;AACb,UAAO;AAFF;AA4EN,sCAAgB,CAAE;AAElB,qCAAe,CAAE;AAgBjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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;AAE1B,QAAI,KAAK,aAAa,SAAS,GAAG;AACjC,WAAK,mBAAoB;AAAA,IAC5B;AAAA,EACA;AAmDA;AAj/BC;AAEA;AA9EM;AAAA;AAAA;AAAA;AAAA;AAAA;AAihCN,sBAAiB,SAAC,MAAM;;AACvB,QAAM,WAAW;AACjB,QAAM,YAAY;AAElB,QAAM,UAAQ,UAAK,gBAAgB,KAAK,CAAC,WAAW,OAAO,QAAQ,MAAM,IAAI,MAA/D,mBAAmE,eAAc;AAE/F,SAAO,KAAK,iBAAiB,KAAK;AACpC;AAAA;AAAA;AAAA;AAAA;AAMC,wBAAmB,WAAG;AACrB,SAAO,MAAM,KAAK,KAAK,iBAAiB,sBAAsB,CAAC;AACjE;AAUC;ACnjCD,OAAO,OAAO,cAAc,MAAM;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.213",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|