wj-elements 0.3.6 → 0.3.8
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 +30 -2
- package/dist/localize.js.map +1 -1
- package/dist/packages/localize/localize.d.ts +23 -2
- package/dist/packages/translations/en-gb.d.ts +1 -0
- package/dist/packages/translations/sk-sk.d.ts +1 -0
- package/dist/packages/wje-file-upload/service/service.d.ts +1 -1
- package/dist/packages/wje-select/select.element.d.ts +7 -0
- package/dist/wje-file-upload.js +41 -4
- package/dist/wje-file-upload.js.map +1 -1
- package/dist/wje-master.js +4 -2
- package/dist/wje-master.js.map +1 -1
- package/dist/wje-select.js +40 -3
- package/dist/wje-select.js.map +1 -1
- package/package.json +1 -1
package/dist/localize.js
CHANGED
|
@@ -34,11 +34,39 @@ class LocalizerDefault {
|
|
|
34
34
|
if (!langMap) return key;
|
|
35
35
|
return langMap ? langMap[key] || key : key;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Translates a key and then interpolates placeholders in the format {placeholder}.
|
|
39
|
+
* The method first resolves the base text through `translate()`. If the result is not a string,
|
|
40
|
+
* it is returned unchanged. For string results, every placeholder wrapped in curly braces is matched,
|
|
41
|
+
* the token name is trimmed, and the value is looked up in the `params` object.
|
|
42
|
+
* When a matching param exists, its value is converted to a string and inserted into the translation.
|
|
43
|
+
* Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.
|
|
44
|
+
* @param {string} key The translation key.
|
|
45
|
+
* @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.
|
|
46
|
+
* @returns {string} Localized string with interpolated params.
|
|
47
|
+
* @example
|
|
48
|
+
* // If the translation is:
|
|
49
|
+
* // "personalSettings.settings.synchronization.checkbox.exportApprovedAbsence":
|
|
50
|
+
* // "Exportuj schválené absencie do {calendar}"
|
|
51
|
+
* this.localizer.translateWithParams(
|
|
52
|
+
* 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',
|
|
53
|
+
* { calendar: 'Google kalendára' },
|
|
54
|
+
* );
|
|
55
|
+
* // Returns: 'Exportuj schválené absencie do Google kalendára'
|
|
56
|
+
*/
|
|
57
|
+
translateWithParams(key, params = {}) {
|
|
58
|
+
const translated = this.translate(key);
|
|
59
|
+
if (typeof translated !== "string") return translated;
|
|
60
|
+
return translated.replace(/\{([^{}]+)\}/g, (match, token) => {
|
|
61
|
+
const value = params[token.trim()];
|
|
62
|
+
return value === void 0 || value === null ? match : String(value);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
37
65
|
/**
|
|
38
66
|
* Translates a key into a localized string based on the provided count and pluralization type.
|
|
39
67
|
* @param {string} key The base translation key to be used for fetching the localized string.
|
|
40
|
-
* @param {number} [count
|
|
41
|
-
* @param {string} [type
|
|
68
|
+
* @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.
|
|
69
|
+
* @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.
|
|
42
70
|
* @returns {string} The translated string, adapted to the pluralization rules and count.
|
|
43
71
|
*/
|
|
44
72
|
translatePlural(key, count = 0, type = "cardinal") {
|
package/dist/localize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element?.lang || document.documentElement?.lang || 'en-GB';\n this.dir = this.element?.dir || document.documentElement?.dir || 'ltr';\n this.currentLang = 'en-GB';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n convertLangCode = (lang) => lang.replace(\"-\", \"_\").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`);\n\n /**\n * Translates a given translation key based on the currently selected language.\n * @param {string} key The key representing the text to be translated.\n * @returns {string} The translated text if available; otherwise, returns the original key.\n */\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n /**\n * Translates a key 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
|
|
1
|
+
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element?.lang || document.documentElement?.lang || 'en-GB';\n this.dir = this.element?.dir || document.documentElement?.dir || 'ltr';\n this.currentLang = 'en-GB';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n convertLangCode = (lang) => lang.replace(\"-\", \"_\").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`);\n\n /**\n * Translates a given translation key based on the currently selected language.\n * @param {string} key The key representing the text to be translated.\n * @returns {string} The translated text if available; otherwise, returns the original key.\n */\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n /**\n * Translates a key and then interpolates placeholders in the format {placeholder}.\n * The method first resolves the base text through `translate()`. If the result is not a string,\n * it is returned unchanged. For string results, every placeholder wrapped in curly braces is matched,\n * the token name is trimmed, and the value is looked up in the `params` object.\n * When a matching param exists, its value is converted to a string and inserted into the translation.\n * Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.\n * @param {string} key The translation key.\n * @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.\n * @returns {string} Localized string with interpolated params.\n * @example\n * // If the translation is:\n * // \"personalSettings.settings.synchronization.checkbox.exportApprovedAbsence\":\n * // \"Exportuj schválené absencie do {calendar}\"\n * this.localizer.translateWithParams(\n * 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',\n * { calendar: 'Google kalendára' },\n * );\n * // Returns: 'Exportuj schválené absencie do Google kalendára'\n */\n translateWithParams(key, params = {}) {\n const translated = this.translate(key);\n\n if (typeof translated !== 'string') return translated;\n\n return translated.replace(/\\{([^{}]+)\\}/g, (match, token) => {\n const value = params[token.trim()];\n return value === undefined || value === null ? match : String(value);\n });\n }\n\n /**\n * Translates a key into a localized string based on the provided count and pluralization type.\n * @param {string} key The base translation key to be used for fetching the localized string.\n * @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.\n * @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.\n * @returns {string} The translated string, adapted to the pluralization rules and count.\n */\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.currentLang, { type });\n const k = `${key}.${plural.select(count)}`;\n const t = this.translate(k);\n if (t !== k) return t;\n return this.translate(`${key}.other`);\n }\n\n /**\n * Formats a number according to the specified locale and formatting options.\n * @param {number} number The numeric value to format.\n * @param {object} options An object containing formatting options for the number.\n * @returns {string} The formatted number as a string.\n */\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n /**\n * Formats a given date based on the specified options and the current language setting.\n * @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.\n * @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.\n * @returns {string} The formatted date string based on the specified options and current language.\n */\n formatDate(date, options) {\n return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));\n }\n\n /**\n * Formats a relative time string based on a given language, value, unit, and formatting options.\n * @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.\n * @param {number} value The numerical value to format, representing the time difference.\n * @param {string} [unit] The unit of time to use (e.g., \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\").\n * @param {object} [options] An object containing formatting options, such as the style for the numeric representation.\n * @returns {string} The formatted relative time string in the specified language.\n */\n relativeTime(lang, value = 0, unit = 'day', options = { numeric: 'auto' }) {\n lang = lang || this.currentLang;\n return new Intl.RelativeTimeFormat(lang, options).format(value, unit);\n }\n}\n\nexport function registerTranslation(...translation) {\n translation.forEach((t) => {\n if (!t.code) {\n console.error(\"Translation object is missing 'code' property:\", t);\n return;\n }\n\n const code = t.code.toLowerCase();\n if (window.translations.has(code)) {\n window.translations.set(code, { ...window.translations.get(code), ...t });\n } else {\n window.translations.set(code, t);\n }\n });\n}\n","import { LocalizerDefault, registerTranslation } from '../localize/localize.js';\n\nexport class Localizer extends LocalizerDefault {\n constructor(element) {\n super(element);\n }\n static registerTranslation(...translation) {\n registerTranslation(...translation);\n }\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB;AAAA,EAC1B,YAAY,SAAS;AAuBrB,2CAAkB,CAAC,SAAS,KAAK,QAAQ,KAAK,GAAG,EAAE,QAAQ,gBAAgB,CAAC,GAAG,SAAS,IAAI,KAAK,YAAW,CAAE,EAAE;AA1BpH;AAIQ,SAAK,UAAU;AAEf,SAAK,SAAO,UAAK,YAAL,mBAAc,WAAQ,cAAS,oBAAT,mBAA0B,SAAQ;AACpE,SAAK,QAAM,UAAK,YAAL,mBAAc,UAAO,cAAS,oBAAT,mBAA0B,QAAO;AACjE,SAAK,cAAc;AAEnB,SAAK,YAAW;AAAA,EACpB;AAAA,EAEA,IAAI,YAAY;AACZ,WAAO,OAAO;AAAA,EAClB;AAAA;AAAA,EAGA,cAAc;AAlBlB;AAmBQ,SAAI,UAAK,cAAL,mBAAgB,IAAI,KAAK,OAAO;AAChC,WAAK,cAAc,KAAK;AAAA,IAC5B,OAAO;AACH,cAAQ,MAAM,aAAa,KAAK,IAAI,eAAe;AAAA,IACvD;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,UAAU,KAAK;AAjCnB;AAkCQ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A;AAAA;AAAA,EAUA,aAAa,MAAM,QAAQ,GAAG,OAAO,OAAO,UAAU,EAAE,SAAS,UAAU;AACvE,WAAO,QAAQ,KAAK;AACpB,WAAO,IAAI,KAAK,mBAAmB,MAAM,OAAO,EAAE,OAAO,OAAO,IAAI;AAAA,EACxE;AACJ;AAEO,SAAS,uBAAuB,aAAa;AAChD,cAAY,QAAQ,CAAC,MAAM;AACvB,QAAI,CAAC,EAAE,MAAM;AACT,cAAQ,MAAM,kDAAkD,CAAC;AACjE;AAAA,IACJ;AAEA,UAAM,OAAO,EAAE,KAAK,YAAW;AAC/B,QAAI,OAAO,aAAa,IAAI,IAAI,GAAG;AAC/B,aAAO,aAAa,IAAI,MAAM,EAAE,GAAG,OAAO,aAAa,IAAI,IAAI,GAAG,GAAG,EAAC,CAAE;AAAA,IAC5E,OAAO;AACH,aAAO,aAAa,IAAI,MAAM,CAAC;AAAA,IACnC;AAAA,EACJ,CAAC;AACL;ACnIO,MAAM,kBAAkB,iBAAiB;AAAA,EAC5C,YAAY,SAAS;AACjB,UAAM,OAAO;AAAA,EACjB;AAAA,EACA,OAAO,uBAAuB,aAAa;AACvC,wBAAoB,GAAG,WAAW;AAAA,EACtC;AACJ;"}
|
|
@@ -14,11 +14,32 @@ export class LocalizerDefault {
|
|
|
14
14
|
* @returns {string} The translated text if available; otherwise, returns the original key.
|
|
15
15
|
*/
|
|
16
16
|
translate(key: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Translates a key and then interpolates placeholders in the format {placeholder}.
|
|
19
|
+
* The method first resolves the base text through `translate()`. If the result is not a string,
|
|
20
|
+
* it is returned unchanged. For string results, every placeholder wrapped in curly braces is matched,
|
|
21
|
+
* the token name is trimmed, and the value is looked up in the `params` object.
|
|
22
|
+
* When a matching param exists, its value is converted to a string and inserted into the translation.
|
|
23
|
+
* Missing or `null` params are left in their original `{placeholder}` form so unresolved tokens stay visible.
|
|
24
|
+
* @param {string} key The translation key.
|
|
25
|
+
* @param {object} [params] Key-value map used for interpolation. Defaults to an empty object.
|
|
26
|
+
* @returns {string} Localized string with interpolated params.
|
|
27
|
+
* @example
|
|
28
|
+
* // If the translation is:
|
|
29
|
+
* // "personalSettings.settings.synchronization.checkbox.exportApprovedAbsence":
|
|
30
|
+
* // "Exportuj schválené absencie do {calendar}"
|
|
31
|
+
* this.localizer.translateWithParams(
|
|
32
|
+
* 'personalSettings.settings.synchronization.checkbox.exportApprovedAbsence',
|
|
33
|
+
* { calendar: 'Google kalendára' },
|
|
34
|
+
* );
|
|
35
|
+
* // Returns: 'Exportuj schválené absencie do Google kalendára'
|
|
36
|
+
*/
|
|
37
|
+
translateWithParams(key: string, params?: object): string;
|
|
17
38
|
/**
|
|
18
39
|
* Translates a key into a localized string based on the provided count and pluralization type.
|
|
19
40
|
* @param {string} key The base translation key to be used for fetching the localized string.
|
|
20
|
-
* @param {number} [count
|
|
21
|
-
* @param {string} [type
|
|
41
|
+
* @param {number} [count] The count value used to determine the pluralization form. Defaults to 0.
|
|
42
|
+
* @param {string} [type] The type of pluralization to use, such as 'cardinal' or 'ordinal'. Defaults to 'cardinal'.
|
|
22
43
|
* @returns {string} The translated string, adapted to the pluralization rules and count.
|
|
23
44
|
*/
|
|
24
45
|
translatePlural(key: string, count?: number, type?: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Retrieves the icon name for a given file type.
|
|
3
|
-
* @param {string} type The file
|
|
3
|
+
* @param {string} type The file extension, MIME subtype or category (e.g., "pdf", "vnd.ms-excel", "folder").
|
|
4
4
|
* @returns {string} The name of the icon associated with the file type.
|
|
5
5
|
* @example
|
|
6
6
|
* getFileTypeIcon('pdf'); // Returns the icon name for PDF files.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FormAssociatedElement } from '../internals/form-associated-element.js';
|
|
2
|
+
import { Localizer } from '../utils/localize.js';
|
|
2
3
|
import { default as Button } from '../wje-button/button.js';
|
|
3
4
|
import { default as Popup } from '../wje-popup/popup.js';
|
|
4
5
|
import { default as Icon } from '../wje-icon/icon.js';
|
|
@@ -22,6 +23,7 @@ export class Select extends FormAssociatedElement {
|
|
|
22
23
|
* @returns {Array<string>}
|
|
23
24
|
*/
|
|
24
25
|
static get observedAttributes(): Array<string>;
|
|
26
|
+
localizer: Localizer;
|
|
25
27
|
/**
|
|
26
28
|
* @type {HTMLElement|null}
|
|
27
29
|
* @description A reference to the counter element, initially null.
|
|
@@ -80,6 +82,11 @@ export class Select extends FormAssociatedElement {
|
|
|
80
82
|
* @description A reference to the list element, initially null.
|
|
81
83
|
*/
|
|
82
84
|
list: HTMLElement | null;
|
|
85
|
+
/**
|
|
86
|
+
* @type {HTMLElement|null}
|
|
87
|
+
* @description A reference to the empty state element, initially null.
|
|
88
|
+
*/
|
|
89
|
+
emptyState: HTMLElement | null;
|
|
83
90
|
_value: any[];
|
|
84
91
|
_selectedOptions: any[];
|
|
85
92
|
_instanceId: number;
|
package/dist/wje-file-upload.js
CHANGED
|
@@ -37,11 +37,31 @@ function fileType() {
|
|
|
37
37
|
name: "file-type-txt"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
type: [
|
|
40
|
+
type: [
|
|
41
|
+
"doc",
|
|
42
|
+
"docx",
|
|
43
|
+
"msword",
|
|
44
|
+
"vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
45
|
+
"vnd.ms-word.document.macroenabled.12",
|
|
46
|
+
"vnd.openxmlformats-officedocument.wordprocessingml.template",
|
|
47
|
+
"vnd.ms-word.template.macroenabled.12",
|
|
48
|
+
"vnd.oasis.opendocument.text"
|
|
49
|
+
],
|
|
41
50
|
name: "file-type-doc"
|
|
42
51
|
},
|
|
43
52
|
{
|
|
44
|
-
type: [
|
|
53
|
+
type: [
|
|
54
|
+
"xls",
|
|
55
|
+
"xlsx",
|
|
56
|
+
"vnd.ms-excel",
|
|
57
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
58
|
+
"vnd.ms-excel.sheet.macroenabled.12",
|
|
59
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
60
|
+
"vnd.ms-excel.template.macroenabled.12",
|
|
61
|
+
"vnd.ms-excel.addin.macroenabled.12",
|
|
62
|
+
"vnd.ms-excel.sheet.binary.macroenabled.12",
|
|
63
|
+
"vnd.oasis.opendocument.spreadsheet"
|
|
64
|
+
],
|
|
45
65
|
name: "file-type-xls"
|
|
46
66
|
},
|
|
47
67
|
{
|
|
@@ -49,13 +69,28 @@ function fileType() {
|
|
|
49
69
|
name: "file-type-pdf"
|
|
50
70
|
},
|
|
51
71
|
{
|
|
52
|
-
type: [
|
|
72
|
+
type: [
|
|
73
|
+
"ppt",
|
|
74
|
+
"pptx",
|
|
75
|
+
"odp",
|
|
76
|
+
"vnd.ms-powerpoint",
|
|
77
|
+
"vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
78
|
+
"vnd.ms-powerpoint.presentation.macroenabled.12",
|
|
79
|
+
"vnd.openxmlformats-officedocument.presentationml.slideshow",
|
|
80
|
+
"vnd.ms-powerpoint.slideshow.macroenabled.12",
|
|
81
|
+
"vnd.openxmlformats-officedocument.presentationml.template",
|
|
82
|
+
"vnd.ms-powerpoint.template.macroenabled.12",
|
|
83
|
+
"vnd.oasis.opendocument.presentation"
|
|
84
|
+
],
|
|
53
85
|
name: "file-type-ppt"
|
|
54
86
|
}
|
|
55
87
|
];
|
|
56
88
|
}
|
|
57
89
|
function getFileTypeIcon(type) {
|
|
58
90
|
let searchType;
|
|
91
|
+
if (!type) {
|
|
92
|
+
return searchType;
|
|
93
|
+
}
|
|
59
94
|
if (type.toLowerCase() !== "folder") {
|
|
60
95
|
fileType().forEach((i) => {
|
|
61
96
|
if (i.type.includes(type.toLowerCase())) {
|
|
@@ -547,11 +582,13 @@ class FileUpload extends WJElement {
|
|
|
547
582
|
*/
|
|
548
583
|
createPreview(file, reader) {
|
|
549
584
|
let preview = document.createElement("wje-file-upload-item");
|
|
585
|
+
let fileType2 = file.type ? file.type.split("/")[1] : file.name.split(".").pop();
|
|
586
|
+
let icon = getFileTypeIcon(fileType2) || "file";
|
|
550
587
|
preview.setAttribute("slot", "item");
|
|
551
588
|
preview.setAttribute("name", file.name);
|
|
552
589
|
preview.setAttribute("size", file.size);
|
|
553
590
|
preview.setAttribute("uploaded", "0");
|
|
554
|
-
preview.innerHTML = `<wje-icon slot="img" name="${
|
|
591
|
+
preview.innerHTML = `<wje-icon slot="img" name="${icon}" size="large"></wje-icon>`;
|
|
555
592
|
preview.data = file;
|
|
556
593
|
return preview;
|
|
557
594
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-file-upload.js","sources":["../packages/wje-file-upload/service/service.js","../packages/wje-file-upload/file-upload.element.js","../packages/wje-file-upload/file-upload.js"],"sourcesContent":["/**\n * Returns a list of file type categories and their corresponding icon names.\n * @returns {Array<object>} An array of objects representing file type categories.\n * Each object contains the following properties:\n * - `type` {Array<string>} A list of file extensions associated with the category.\n * - `name` {string} The name of the icon representing the category.\n * @example\n * const types = fileType();\n * console.log(types);\n * // [\n * // { type: [\"jpg\", \"jpeg\", \"png\", \"gif\", \"bpm\", \"tiff\", \"svg\"], name: \"photo\" },\n * // { type: [\"zip\", \"rar\", \"cab\", \"jar\", \"tar\", \"gzip\", \"uue\", \"bz2\", \"scorm\", \"war\"], name: \"file-type-zip\" },\n * // ...\n * // ]\n */\nfunction fileType() {\n return [\n {\n type: ['jpg', 'jpeg', 'png', 'gif', 'bpm', 'tiff', 'svg'],\n name: 'photo',\n },\n {\n type: ['zip', 'rar', 'cab', 'jar', 'tar', 'gzip', 'uue', 'bz2', 'scorm', 'war'],\n name: 'file-type-zip',\n },\n {\n type: ['mov', 'mp4', 'avi', 'flv'],\n name: 'video',\n },\n {\n type: ['m4a', 'mp3', 'wav'],\n name: 'audio',\n },\n {\n type: ['html', 'html'],\n name: 'file-type-html',\n },\n {\n type: ['css'],\n name: 'code',\n },\n {\n type: ['txt'],\n name: 'file-type-txt',\n },\n {\n type: ['doc', 'docx'],\n name: 'file-type-doc',\n },\n {\n type: ['xls', 'xlsx'],\n name: 'file-type-xls',\n },\n {\n type: ['pdf'],\n name: 'file-type-pdf',\n },\n {\n type: ['ppt', 'pptx', 'odp'],\n name: 'file-type-ppt',\n },\n ];\n}\n\n/**\n * Retrieves the icon name for a given file type.\n * @param {string} type The file type or category (e.g., \"pdf\", \"image\", \"folder\").\n * @returns {string} The name of the icon associated with the file type.\n * @example\n * getFileTypeIcon('pdf'); // Returns the icon name for PDF files.\n * getFileTypeIcon('folder'); // Returns 'folder'.\n */\nexport function getFileTypeIcon(type) {\n let searchType;\n if (type.toLowerCase() !== 'folder') {\n fileType().forEach((i) => {\n if (i.type.includes(type.toLowerCase())) {\n searchType = i.name;\n }\n });\n } else {\n searchType = 'folder';\n }\n\n return searchType;\n}\n\n/**\n * Returns a function for uploading files either in chunks or as a whole file, based on the provided options.\n * @param {string} url The URL to which the file will be uploaded.\n * @param {number} [chunkSize] The size of each chunk in bytes when uploading in chunks (default is 1MB).\n * @param {boolean} [wholeFile] Whether to upload the file as a whole. If `true`, the entire file is uploaded at once.\n * @returns {Function} A function that takes a file and a preview element as arguments and uploads the file.\n * @example\n * // Upload a file in chunks\n * const uploadInChunks = upload('/upload', 1024 * 512); // 512KB chunks\n * uploadInChunks(file, previewElement);\n * @example\n * // Upload a whole file\n * const uploadWhole = upload('/upload', undefined, true);\n * uploadWhole(file, previewElement);\n */\nexport function upload(url, chunkSize = 1024 * 1024, wholeFile = false) {\n if (wholeFile) {\n return (file, preview) => uploadWholeFile(url, file, preview);\n }\n return (file, preview) => uploadFileInChunks(url, file, preview, chunkSize);\n}\n\n/**\n * Uploads a file in chunks to a specified URL, allowing for progress tracking and resuming in case of errors.\n * @param {string} url The URL to which the file chunks will be uploaded.\n * @param {File} file The file to be uploaded in chunks.\n * @param {HTMLElement} preview The element used to display upload progress.\n * @param {number} [chunkSize] The size of each chunk in bytes (default is 1MB).\n * @returns {Promise<object>} Resolves with the response of the last chunk uploaded, parsed as JSON.\n * @throws {Error} - Throws an error if a chunk fails to upload.\n */\nexport async function uploadFileInChunks(url, file, preview, chunkSize = 1024 * 1024) {\n let offset = 0;\n const totalChunks = Math.ceil(file.size / chunkSize);\n const partResponses = [];\n\n while (offset < file.size) {\n const chunk = file.slice(offset, offset + chunkSize);\n\n // Creating a custom ReadableStream to track progress of the current chunk\n const stream = new ReadableStream({\n start(controller) {\n const reader = chunk.stream().getReader();\n let uploadedBytes = 0;\n\n reader.read().then(function process({ done, value }) {\n if (done) {\n controller.close();\n return Promise.resolve();\n }\n\n // Track progress\n uploadedBytes += value.byteLength;\n const percentComplete = ((offset + uploadedBytes) / file.size) * 100;\n preview.setAttribute('uploaded', offset + uploadedBytes);\n\n // Enqueue chunk data into the stream\n controller.enqueue(value);\n\n // Read the next chunk\n return reader.read().then(process);\n });\n },\n });\n\n const formData = new FormData();\n formData.append('file', new Blob([stream])); // Send the current stream (chunk)\n formData.append('chunkIndex', Math.floor(offset / chunkSize)); // Send chunk index\n formData.append('totalChunks', totalChunks); // Send total chunks\n formData.append('fileName', file.name); // Send file name\n\n try {\n // Send the current chunk via Fetch\n const response = await fetch(url, {\n method: 'POST',\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to upload chunk ${Math.floor(offset / chunkSize) + 1}: ${response.statusText}`);\n }\n\n partResponses.push(response);\n } catch (error) {\n console.error('Error uploading chunk:', error);\n break;\n }\n\n // Move to the next chunk\n offset += chunkSize;\n }\n\n const response = await partResponses.at(-1).json();\n\n return {\n data: response,\n file,\n };\n}\n\n/**\n * Uploads a file to a specified URL using a `POST` request and updates the preview element with the uploaded file size.\n * @param {string} url The URL to which the file will be uploaded.\n * @param {File} file The file to be uploaded.\n * @param {HTMLElement} preview The element that displays the upload preview. It will be updated with the file size.\n * @returns {Promise<{data: object, file: File}>} - A promise that resolves with the server response and the uploaded file.\n * @throws {Error} - Logs an error to the console if the request fails.\n */\nexport function uploadWholeFile(url, file, preview) {\n const formData = new FormData();\n formData.append('file', file);\n\n //use fetch\n return fetch(url, {\n method: 'POST',\n body: formData,\n })\n .then((response) => response.json())\n .then((data) => {\n preview.setAttribute('uploaded', file.size);\n return {\n data,\n file,\n };\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n}\n","import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport Button from '../wje-button/button.js';\nimport { isValidFileType } from '../utils/utils.js';\nimport { getFileTypeIcon, upload } from './service/service.js';\n\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary FileUpload is a custom web component for uploading files.\n * It extends from WJElement and provides functionalities for file upload.\n * @documentation https://elements.webjet.sk/components/file-upload\n * @status stable\n * @augments WJElement\n * @slot - This is a default/unnamed slot.\n * @csspart native - The native file upload part.\n * @csspart file-list - The file list part.\n * @csspart upload-button - The label part.\n * @event change - Fires when the file input changes.\n * @event drop - Fires when a file is dropped into the component.\n * @attribute {string} accepted-types - The accepted file types for upload.\n * @attribute {number} chunk-size - The chunk size for file upload.\n * @attribute {number} max-file-size - The maximum file size for upload.\n * @attribute {string} upload-url - The URL to set as the upload URL.\n * @attribute {boolean} auto-process-files - The auto process files attribute.\n * @attribute {boolean} no-upload-button - The no upload button attribute.\n * @tag wje-file-upload\n */\nexport default class FileUpload extends WJElement {\n /**\n * Constructor for FileUpload.\n * Initializes a new instance of the Localizer.\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n this._uploadedFiles = [];\n this._queuedFiles = [];\n }\n\n /**\n * Dependencies for the FileUpload component.\n * @type {object}\n */\n dependencies = {\n 'wje-button': Button,\n };\n\n /**\n * Setter for acceptedTypes attribute.\n * @param {string} value The accepted file types for upload.\n */\n set acceptedTypes(value) {\n this.setAttribute('accepted-types', value);\n }\n\n /**\n * Getter for acceptedTypes attribute.\n * @returns {string} The accepted file types for upload.\n */\n get acceptedTypes() {\n const accepted = this.getAttribute('accepted-types');\n return this.hasAttribute('accepted-types') ? accepted : 'image/*';\n }\n\n /**\n * Setter for chunkSize attribute.\n * @param {number} value The chunk size for file upload.\n */\n set chunkSize(value) {\n this.setAttribute('chunk-size', value);\n }\n\n /**\n * Getter for chunkSize attribute.\n * @returns {number} The chunk size for file upload.\n */\n get chunkSize() {\n const chunk = this.getAttribute('chunk-size');\n return this.hasAttribute('chunk-size') ? chunk : 1024 * 1024;\n }\n\n /**\n * Setter for maxFileSize attribute.\n * @param {number} value The maximum file size for upload.\n */\n set maxFileSize(value) {\n this.setAttribute('max-file-size', value);\n }\n\n /**\n * Getter for maxFileSize attribute.\n * @returns {number} The maximum file size for upload.\n */\n get maxFileSize() {\n const fileSize = this.getAttribute('max-file-size');\n return this.hasAttribute('max-file-size') ? fileSize * 1024 * 1024 : 1024 * 1024;\n }\n\n /**\n * Setter for label attribute.\n * @param {string} value The URL to set as the upload URL.\n */\n set uploadUrl(value) {\n this.setAttribute('upload-url', value);\n }\n\n /**\n * Gets the upload URL for the file upload element.\n * @returns {string} The upload URL for the file upload element.\n */\n get uploadUrl() {\n return this.getAttribute('upload-url') ?? '/upload';\n }\n\n /**\n * Sets the autoProcessFiles attribute.\n * @param value\n */\n set autoProcessFiles(value) {\n this.setAttribute('auto-process-files', value);\n }\n\n /**\n * Gets the autoProcessFiles attribute.\n * @returns {any|boolean}\n */\n get autoProcessFiles() {\n return JSON.parse(this.getAttribute('auto-process-files')) ?? true;\n }\n\n /**\n * Sets the noUploadButton attribute.\n * @param value\n */\n set noUploadButton(value) {\n this.setAttribute('no-upload-button', value);\n }\n\n /**\n * Gets the noUploadButton attribute.\n * @returns {boolean}\n */\n get noUploadButton() {\n return this.hasAttribute('no-upload-button');\n }\n\n /**\n * Sets the uploaded files.\n * @param value\n */\n set uploadedFiles(value) {\n this._uploadedFiles = value;\n }\n\n /**\n * Return the uploaded files.\n * @returns {[]}\n */\n get uploadedFiles() {\n return this._uploadedFiles;\n }\n\n /**\n * Sets the to-chunk attribute.\n * @param value\n */\n set toChunk(value) {\n this.setAttribute('to-chunk', value);\n }\n\n /**\n * Gets the to-chunk attribute.\n * @returns {boolean}\n */\n get toChunk() {\n return this.hasAttribute('to-chunk');\n }\n\n /**\n * Sets the maximum number of files that can be uploaded or managed.\n * Assigns the specified value to the 'max-files' attribute.\n * @param {number} value The maximum allowable number of files.\n */\n set maxFiles(value) {\n this.setAttribute('max-files', value);\n }\n\n /**\n * Sets the label attribute for the upload button.\n * @param {string} value\n */\n set label(value) {\n this.setAttribute('label', value);\n }\n\n /**\n * Gets the label attribute for the upload button.\n * @returns {string}\n */\n get label() {\n return this.getAttribute('label') || '';\n }\n\n /**\n * Retrieves the maximum number of files allowed from the `max-files` attribute.\n * If the attribute is not set or is invalid, defaults to 0.\n * @returns {number} The maximum number of files allowed.\n */\n get maxFiles() {\n return parseInt(this.getAttribute('max-files')) || 10;\n }\n\n className = 'FileUpload';\n\n /**\n * Getter for cssStyleSheet.\n * @returns {string} The CSS styles for the component.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for observedAttributes.\n * @returns {Array} An empty array as no attributes are observed.\n */\n static get observedAttributes() {\n return ['label'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n if (name === 'label' && this.button) {\n const nextLabel = this.label || this.localizer.translate('wj.file.upload.button');\n this.button.innerText = nextLabel;\n this.button.setAttribute('aria-label', nextLabel);\n }\n }\n\n /**\n * Method to setup attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({\n role: 'group',\n });\n }\n\n beforeDraw() {\n this.uploadFunction = upload(this.uploadUrl, this.chunkSize, !this.toChunk);\n }\n\n /**\n * Method to draw the component on the screen.\n * @returns {DocumentFragment} The fragment containing the component.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-file-upload');\n native.setAttribute('part', 'native');\n\n let label = document.createElement('div');\n label.setAttribute('part', 'file-label');\n label.classList.add('file-label');\n\n let fileList = document.createElement('slot');\n fileList.setAttribute('name', 'item');\n fileList.setAttribute('part', 'items');\n fileList.classList.add('file-list');\n\n let slot = document.createElement('slot');\n label.appendChild(slot);\n\n let fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('multiple', '');\n fileInput.setAttribute('style', 'display:none;');\n fileInput.setAttribute('aria-hidden', 'true');\n\n if (!this.noUploadButton) {\n let button = document.createElement('wje-button');\n button.innerText = this.label || this.localizer.translate('wj.file.upload.button');\n button.setAttribute('part', 'upload-button');\n button.setAttribute('aria-label', button.innerText);\n\n label.appendChild(button);\n\n this.button = button;\n }\n\n native.appendChild(fileInput);\n native.appendChild(label);\n native.appendChild(fileList);\n\n fragment.appendChild(native);\n\n this.native = native;\n this.fileList = fileList;\n this.fileInput = fileInput;\n\n return fragment;\n }\n\n /**\n * Method to perform actions after the component is drawn.\n */\n afterDraw() {\n this.button?.addEventListener('click', () => {\n this.fileInput.click();\n });\n\n this.fileInput.addEventListener('change', this.handleInputChange);\n this.native.addEventListener('drop', this.handleDrop);\n\n let dragEventCounter = 0;\n\n this.native.addEventListener('dragenter', (e) => {handleInputChange\n e.preventDefault();\n\n if (dragEventCounter === 0) {\n this.native.classList.add('highlight');\n }\n\n dragEventCounter += 1;\n });\n\n this.native.addEventListener('dragover', (e) => {\n e.preventDefault();\n\n if (dragEventCounter === 0) {\n dragEventCounter = 1;\n }\n });\n\n this.native.addEventListener('dragleave', (e) => {\n e.preventDefault();\n\n dragEventCounter -= 1;\n\n if (dragEventCounter <= 0) {\n dragEventCounter = 0;\n this.native.classList.remove('highlight');\n }\n });\n\n this.native.addEventListener('drop', (e) => {\n event.preventDefault();\n\n dragEventCounter = 0;\n this.native.classList.remove('highlight');\n });\n\n this.addEventListener('wje-file-upload-item:remove', (e) => {\n const file = e.detail;\n\n if (!(file instanceof File)) {\n return;\n }\n\n let count = this.uploadedFiles.length;\n\n this.uploadedFiles = this.uploadedFiles.filter((entry) => {\n return entry?.file?.lastModified !== file.lastModified;\n });\n\n if(count !== this.uploadedFiles.length)\n event.dispatchCustomEvent(this, 'wje-file-upload:file-removed', file);\n });\n }\n\n /**\n * Method to handle form submission.\n * @param {Event} e The form submission event.\n */\n handleSubmit(e) {\n e.preventDefault();\n\n this.addFilesToQueue(this.fileInput.files);\n }\n\n /**\n * Method to handle file drop event.\n * @param {Event} e The file drop event object.\n */\n handleDrop = (e) => {\n const fileList = e.dataTransfer.files;\n\n this.resetFormState();\n\n this.addFilesToQueue(fileList);\n };\n\n /**\n * Method to handle file input change event.\n * @param {Event} e The file input change event object.\n */\n handleInputChange = (e) => {\n const files = Array.from(e.target.files);\n\n event.dispatchCustomEvent(this, 'wje-file-upload:files-selected', files);\n\n this.resetFormState();\n\n try {\n this.handleSubmit(e);\n } catch (err) {\n console.error(err);\n }\n };\n\n /**\n * Method to add files to the queue.\n * @param files\n */\n addFilesToQueue(files) {\n const currentCount = (Array.isArray(this.uploadedFiles) ? this.uploadedFiles.length : 0) + (Array.isArray(this._queuedFiles) ? this._queuedFiles.length : 0);\n const newTotal = currentCount + files.length;\n\n if (this.maxFiles && newTotal > this.maxFiles) {\n const detail = {\n code: 'MAX-FILES-EXCEEDED',\n files,\n maxFiles: this.maxFiles,\n currentCount,\n attemptedToAdd: files.length,\n allowedRemaining: Math.max(this.maxFiles - currentCount, 0),\n };\n\n event.dispatchCustomEvent(this, 'wje-file-upload:error', detail);\n\n return;\n }\n\n this._queuedFiles = [...(this._queuedFiles || []), ...files];\n\n event.dispatchCustomEvent(this, 'wje-file-upload:files-added', files);\n\n this.onAddedFiles?.();\n\n if (this.autoProcessFiles) {\n this.uploadFiles();\n }\n\n this.fileInput.value = '';\n }\n\n /**\n * Method to upload files.\n */\n uploadFiles() {\n if (this._queuedFiles.length === 0) {\n return;\n }\n\n const uploadPromises = this._queuedFiles.map((file) => this.createUploadPromise(file));\n uploadPromises\n .reduce((prev, curr) => {\n return prev.then(() => {\n return curr;\n });\n }, Promise.resolve())\n .then(() => {\n event.dispatchCustomEvent(this, 'wje-file-upload:files-uploaded', this.uploadedFiles);\n\n this.onAllFilesUploaded?.();\n this._queuedFiles = [];\n }).catch((err) => {\n this._queuedFiles = this._queuedFiles.filter((file) => file !== err.file);\n\n event.dispatchCustomEvent(this,'wje-file-upload:error', err);\n });\n }\n\n /**\n * Method to create an upload promise.\n * @param file\n * @returns {Promise<unknown>}\n */\n createUploadPromise = (file) => {\n return new Promise((resolve, reject) => {\n this.assertFilesValid(file);\n let preview;\n\n let reader = new FileReader();\n reader.onload = () => {\n event.dispatchCustomEvent(this, 'wje-file-upload:started', file);\n\n this.onUploadStarted?.(file);\n\n preview = this.createPreview(file, reader);\n this.appendChild(preview);\n\n this.uploadFunction(file, preview).then((res) => {\n res.item = preview;\n\n event.dispatchCustomEvent(this, 'wje-file-upload:file-uploaded', res);\n\n this.onUploadedFileComplete?.(res);\n\n this.uploadedFiles.push(res);\n\n resolve(res);\n });\n };\n\n reader.readAsDataURL(file);\n });\n };\n\n /**\n * Method to create a preview for the file.\n * @param {File} file The file for which the preview is to be created.\n * @param {FileReader} reader The FileReader instance to read the file.\n * @returns {HTMLElement} The created preview.\n */\n createPreview(file, reader) {\n let preview = document.createElement('wje-file-upload-item');\n preview.setAttribute('slot', 'item');\n preview.setAttribute('name', file.name);\n preview.setAttribute('size', file.size);\n preview.setAttribute('uploaded', '0');\n preview.innerHTML = `<wje-icon slot=\"img\" name=\"${getFileTypeIcon(file.type.split('/')[1])}\" size=\"large\"></wje-icon>`;\n preview.data = file;\n\n return preview;\n }\n\n /**\n * Method to create a thumbnail for the file.\n * @param {File} file The file for which the thumbnail is to be created.\n * @param {FileReader} reader The FileReader instance to read the file.\n * @returns {HTMLElement} The created thumbnail.\n */\n createThumbnail(file, reader) {\n let img = document.createElement('img');\n img.setAttribute('src', reader.result);\n\n return img;\n }\n\n /**\n * Method to validate the files.\n * @param {File} file The file to be validated.\n * TODO: alowed types a size limit by malo byt cez attributy\n */\n assertFilesValid(file) {\n const { name: fileName, size: fileSize } = file;\n\n if (!isValidFileType(file, this.acceptedTypes)) {\n const err = new Error('');\n err.code = 'INVALID-FILE-TYPE';\n err.file = file;\n err.acceptedTypes = this.acceptedTypes;\n\n throw err;\n }\n\n if (fileSize > this.maxFileSize) {\n const err = new Error('');\n err.code = 'FILE-TOO-LARGE';\n err.file = file;\n err.maxFileSize = this.maxFileSize;\n\n throw err;\n }\n }\n\n /**\n * Method to reset the form state.\n */\n resetFormState() {\n this.fileList.textContent = '';\n }\n}\n","import FileUpload from './file-upload.element.js';\n\nexport default FileUpload;\n\nFileUpload.define('wje-file-upload', FileUpload);\n"],"names":["response","_a"],"mappings":";;;;;;;;AAeA,SAAS,WAAW;AAChB,SAAO;AAAA,IACH;AAAA,MACI,MAAM,CAAC,OAAO,QAAQ,OAAO,OAAO,OAAO,QAAQ,KAAK;AAAA,MACxD,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,SAAS,KAAK;AAAA,MAC9E,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,OAAO,OAAO,OAAO,KAAK;AAAA,MACjC,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,OAAO,OAAO,KAAK;AAAA,MAC1B,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,KAAK;AAAA,MACZ,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,KAAK;AAAA,MACZ,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,OAAO,MAAM;AAAA,MACpB,MAAM;AAAA,IAClB;AAAA,IACQ;AAAA,MACI,MAAM,CAAC,OAAO,MAAM;AAAA,MACpB,MAAM;AAAA,IAClB;AAAA,IACQ;A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AI,WAAW,KAAK,aAAa;AAC7B,YAAM,MAAM,IAAI,MAAM,EAAE;AACxB,UAAI,OAAO;AACX,UAAI,OAAO;AACX,UAAI,cAAc,KAAK;AAEvB,YAAM;AAAA,IACV;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB;AACb,SAAK,SAAS,cAAc;AAAA,EAChC;AACJ;AC7jBA,WAAW,OAAO,mBAAmB,UAAU;"}
|
|
1
|
+
{"version":3,"file":"wje-file-upload.js","sources":["../packages/wje-file-upload/service/service.js","../packages/wje-file-upload/file-upload.element.js","../packages/wje-file-upload/file-upload.js"],"sourcesContent":["/**\n * Returns a list of file type categories and their corresponding icon names.\n * @returns {Array<object>} An array of objects representing file type categories.\n * Each object contains the following properties:\n * - `type` {Array<string>} A list of file extensions and MIME subtypes associated with the category.\n * - `name` {string} The name of the icon representing the category.\n * @example\n * const types = fileType();\n * console.log(types);\n * // [\n * // { type: [\"jpg\", \"jpeg\", \"png\", \"gif\", \"bpm\", \"tiff\", \"svg\"], name: \"photo\" },\n * // { type: [\"zip\", \"rar\", \"cab\", \"jar\", \"tar\", \"gzip\", \"uue\", \"bz2\", \"scorm\", \"war\"], name: \"file-type-zip\" },\n * // ...\n * // ]\n */\nfunction fileType() {\n return [\n {\n type: ['jpg', 'jpeg', 'png', 'gif', 'bpm', 'tiff', 'svg'],\n name: 'photo',\n },\n {\n type: ['zip', 'rar', 'cab', 'jar', 'tar', 'gzip', 'uue', 'bz2', 'scorm', 'war'],\n name: 'file-type-zip',\n },\n {\n type: ['mov', 'mp4', 'avi', 'flv'],\n name: 'video',\n },\n {\n type: ['m4a', 'mp3', 'wav'],\n name: 'audio',\n },\n {\n type: ['html', 'html'],\n name: 'file-type-html',\n },\n {\n type: ['css'],\n name: 'code',\n },\n {\n type: ['txt'],\n name: 'file-type-txt',\n },\n {\n type: [\n 'doc',\n 'docx',\n 'msword',\n 'vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'vnd.ms-word.document.macroenabled.12',\n 'vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'vnd.ms-word.template.macroenabled.12',\n 'vnd.oasis.opendocument.text',\n ],\n name: 'file-type-doc',\n },\n {\n type: [\n 'xls',\n 'xlsx',\n 'vnd.ms-excel',\n 'vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'vnd.ms-excel.sheet.macroenabled.12',\n 'vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'vnd.ms-excel.template.macroenabled.12',\n 'vnd.ms-excel.addin.macroenabled.12',\n 'vnd.ms-excel.sheet.binary.macroenabled.12',\n 'vnd.oasis.opendocument.spreadsheet',\n ],\n name: 'file-type-xls',\n },\n {\n type: ['pdf'],\n name: 'file-type-pdf',\n },\n {\n type: [\n 'ppt',\n 'pptx',\n 'odp',\n 'vnd.ms-powerpoint',\n 'vnd.openxmlformats-officedocument.presentationml.presentation',\n 'vnd.ms-powerpoint.presentation.macroenabled.12',\n 'vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'vnd.ms-powerpoint.slideshow.macroenabled.12',\n 'vnd.openxmlformats-officedocument.presentationml.template',\n 'vnd.ms-powerpoint.template.macroenabled.12',\n 'vnd.oasis.opendocument.presentation',\n ],\n name: 'file-type-ppt',\n },\n ];\n}\n\n/**\n * Retrieves the icon name for a given file type.\n * @param {string} type The file extension, MIME subtype or category (e.g., \"pdf\", \"vnd.ms-excel\", \"folder\").\n * @returns {string} The name of the icon associated with the file type.\n * @example\n * getFileTypeIcon('pdf'); // Returns the icon name for PDF files.\n * getFileTypeIcon('folder'); // Returns 'folder'.\n */\nexport function getFileTypeIcon(type) {\n let searchType;\n if (!type) {\n return searchType;\n }\n\n if (type.toLowerCase() !== 'folder') {\n fileType().forEach((i) => {\n if (i.type.includes(type.toLowerCase())) {\n searchType = i.name;\n }\n });\n } else {\n searchType = 'folder';\n }\n\n return searchType;\n}\n\n/**\n * Returns a function for uploading files either in chunks or as a whole file, based on the provided options.\n * @param {string} url The URL to which the file will be uploaded.\n * @param {number} [chunkSize] The size of each chunk in bytes when uploading in chunks (default is 1MB).\n * @param {boolean} [wholeFile] Whether to upload the file as a whole. If `true`, the entire file is uploaded at once.\n * @returns {Function} A function that takes a file and a preview element as arguments and uploads the file.\n * @example\n * // Upload a file in chunks\n * const uploadInChunks = upload('/upload', 1024 * 512); // 512KB chunks\n * uploadInChunks(file, previewElement);\n * @example\n * // Upload a whole file\n * const uploadWhole = upload('/upload', undefined, true);\n * uploadWhole(file, previewElement);\n */\nexport function upload(url, chunkSize = 1024 * 1024, wholeFile = false) {\n if (wholeFile) {\n return (file, preview) => uploadWholeFile(url, file, preview);\n }\n return (file, preview) => uploadFileInChunks(url, file, preview, chunkSize);\n}\n\n/**\n * Uploads a file in chunks to a specified URL, allowing for progress tracking and resuming in case of errors.\n * @param {string} url The URL to which the file chunks will be uploaded.\n * @param {File} file The file to be uploaded in chunks.\n * @param {HTMLElement} preview The element used to display upload progress.\n * @param {number} [chunkSize] The size of each chunk in bytes (default is 1MB).\n * @returns {Promise<object>} Resolves with the response of the last chunk uploaded, parsed as JSON.\n * @throws {Error} - Throws an error if a chunk fails to upload.\n */\nexport async function uploadFileInChunks(url, file, preview, chunkSize = 1024 * 1024) {\n let offset = 0;\n const totalChunks = Math.ceil(file.size / chunkSize);\n const partResponses = [];\n\n while (offset < file.size) {\n const chunk = file.slice(offset, offset + chunkSize);\n\n // Creating a custom ReadableStream to track progress of the current chunk\n const stream = new ReadableStream({\n start(controller) {\n const reader = chunk.stream().getReader();\n let uploadedBytes = 0;\n\n reader.read().then(function process({ done, value }) {\n if (done) {\n controller.close();\n return Promise.resolve();\n }\n\n // Track progress\n uploadedBytes += value.byteLength;\n const percentComplete = ((offset + uploadedBytes) / file.size) * 100;\n preview.setAttribute('uploaded', offset + uploadedBytes);\n\n // Enqueue chunk data into the stream\n controller.enqueue(value);\n\n // Read the next chunk\n return reader.read().then(process);\n });\n },\n });\n\n const formData = new FormData();\n formData.append('file', new Blob([stream])); // Send the current stream (chunk)\n formData.append('chunkIndex', Math.floor(offset / chunkSize)); // Send chunk index\n formData.append('totalChunks', totalChunks); // Send total chunks\n formData.append('fileName', file.name); // Send file name\n\n try {\n // Send the current chunk via Fetch\n const response = await fetch(url, {\n method: 'POST',\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(`Failed to upload chunk ${Math.floor(offset / chunkSize) + 1}: ${response.statusText}`);\n }\n\n partResponses.push(response);\n } catch (error) {\n console.error('Error uploading chunk:', error);\n break;\n }\n\n // Move to the next chunk\n offset += chunkSize;\n }\n\n const response = await partResponses.at(-1).json();\n\n return {\n data: response,\n file,\n };\n}\n\n/**\n * Uploads a file to a specified URL using a `POST` request and updates the preview element with the uploaded file size.\n * @param {string} url The URL to which the file will be uploaded.\n * @param {File} file The file to be uploaded.\n * @param {HTMLElement} preview The element that displays the upload preview. It will be updated with the file size.\n * @returns {Promise<{data: object, file: File}>} - A promise that resolves with the server response and the uploaded file.\n * @throws {Error} - Logs an error to the console if the request fails.\n */\nexport function uploadWholeFile(url, file, preview) {\n const formData = new FormData();\n formData.append('file', file);\n\n //use fetch\n return fetch(url, {\n method: 'POST',\n body: formData,\n })\n .then((response) => response.json())\n .then((data) => {\n preview.setAttribute('uploaded', file.size);\n return {\n data,\n file,\n };\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n}\n","import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport Button from '../wje-button/button.js';\nimport { isValidFileType } from '../utils/utils.js';\nimport { getFileTypeIcon, upload } from './service/service.js';\n\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary FileUpload is a custom web component for uploading files.\n * It extends from WJElement and provides functionalities for file upload.\n * @documentation https://elements.webjet.sk/components/file-upload\n * @status stable\n * @augments WJElement\n * @slot - This is a default/unnamed slot.\n * @csspart native - The native file upload part.\n * @csspart file-list - The file list part.\n * @csspart upload-button - The label part.\n * @event change - Fires when the file input changes.\n * @event drop - Fires when a file is dropped into the component.\n * @attribute {string} accepted-types - The accepted file types for upload.\n * @attribute {number} chunk-size - The chunk size for file upload.\n * @attribute {number} max-file-size - The maximum file size for upload.\n * @attribute {string} upload-url - The URL to set as the upload URL.\n * @attribute {boolean} auto-process-files - The auto process files attribute.\n * @attribute {boolean} no-upload-button - The no upload button attribute.\n * @tag wje-file-upload\n */\nexport default class FileUpload extends WJElement {\n /**\n * Constructor for FileUpload.\n * Initializes a new instance of the Localizer.\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n this._uploadedFiles = [];\n this._queuedFiles = [];\n }\n\n /**\n * Dependencies for the FileUpload component.\n * @type {object}\n */\n dependencies = {\n 'wje-button': Button,\n };\n\n /**\n * Setter for acceptedTypes attribute.\n * @param {string} value The accepted file types for upload.\n */\n set acceptedTypes(value) {\n this.setAttribute('accepted-types', value);\n }\n\n /**\n * Getter for acceptedTypes attribute.\n * @returns {string} The accepted file types for upload.\n */\n get acceptedTypes() {\n const accepted = this.getAttribute('accepted-types');\n return this.hasAttribute('accepted-types') ? accepted : 'image/*';\n }\n\n /**\n * Setter for chunkSize attribute.\n * @param {number} value The chunk size for file upload.\n */\n set chunkSize(value) {\n this.setAttribute('chunk-size', value);\n }\n\n /**\n * Getter for chunkSize attribute.\n * @returns {number} The chunk size for file upload.\n */\n get chunkSize() {\n const chunk = this.getAttribute('chunk-size');\n return this.hasAttribute('chunk-size') ? chunk : 1024 * 1024;\n }\n\n /**\n * Setter for maxFileSize attribute.\n * @param {number} value The maximum file size for upload.\n */\n set maxFileSize(value) {\n this.setAttribute('max-file-size', value);\n }\n\n /**\n * Getter for maxFileSize attribute.\n * @returns {number} The maximum file size for upload.\n */\n get maxFileSize() {\n const fileSize = this.getAttribute('max-file-size');\n return this.hasAttribute('max-file-size') ? fileSize * 1024 * 1024 : 1024 * 1024;\n }\n\n /**\n * Setter for label attribute.\n * @param {string} value The URL to set as the upload URL.\n */\n set uploadUrl(value) {\n this.setAttribute('upload-url', value);\n }\n\n /**\n * Gets the upload URL for the file upload element.\n * @returns {string} The upload URL for the file upload element.\n */\n get uploadUrl() {\n return this.getAttribute('upload-url') ?? '/upload';\n }\n\n /**\n * Sets the autoProcessFiles attribute.\n * @param value\n */\n set autoProcessFiles(value) {\n this.setAttribute('auto-process-files', value);\n }\n\n /**\n * Gets the autoProcessFiles attribute.\n * @returns {any|boolean}\n */\n get autoProcessFiles() {\n return JSON.parse(this.getAttribute('auto-process-files')) ?? true;\n }\n\n /**\n * Sets the noUploadButton attribute.\n * @param value\n */\n set noUploadButton(value) {\n this.setAttribute('no-upload-button', value);\n }\n\n /**\n * Gets the noUploadButton attribute.\n * @returns {boolean}\n */\n get noUploadButton() {\n return this.hasAttribute('no-upload-button');\n }\n\n /**\n * Sets the uploaded files.\n * @param value\n */\n set uploadedFiles(value) {\n this._uploadedFiles = value;\n }\n\n /**\n * Return the uploaded files.\n * @returns {[]}\n */\n get uploadedFiles() {\n return this._uploadedFiles;\n }\n\n /**\n * Sets the to-chunk attribute.\n * @param value\n */\n set toChunk(value) {\n this.setAttribute('to-chunk', value);\n }\n\n /**\n * Gets the to-chunk attribute.\n * @returns {boolean}\n */\n get toChunk() {\n return this.hasAttribute('to-chunk');\n }\n\n /**\n * Sets the maximum number of files that can be uploaded or managed.\n * Assigns the specified value to the 'max-files' attribute.\n * @param {number} value The maximum allowable number of files.\n */\n set maxFiles(value) {\n this.setAttribute('max-files', value);\n }\n\n /**\n * Sets the label attribute for the upload button.\n * @param {string} value\n */\n set label(value) {\n this.setAttribute('label', value);\n }\n\n /**\n * Gets the label attribute for the upload button.\n * @returns {string}\n */\n get label() {\n return this.getAttribute('label') || '';\n }\n\n /**\n * Retrieves the maximum number of files allowed from the `max-files` attribute.\n * If the attribute is not set or is invalid, defaults to 0.\n * @returns {number} The maximum number of files allowed.\n */\n get maxFiles() {\n return parseInt(this.getAttribute('max-files')) || 10;\n }\n\n className = 'FileUpload';\n\n /**\n * Getter for cssStyleSheet.\n * @returns {string} The CSS styles for the component.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for observedAttributes.\n * @returns {Array} An empty array as no attributes are observed.\n */\n static get observedAttributes() {\n return ['label'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n if (name === 'label' && this.button) {\n const nextLabel = this.label || this.localizer.translate('wj.file.upload.button');\n this.button.innerText = nextLabel;\n this.button.setAttribute('aria-label', nextLabel);\n }\n }\n\n /**\n * Method to setup attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({\n role: 'group',\n });\n }\n\n beforeDraw() {\n this.uploadFunction = upload(this.uploadUrl, this.chunkSize, !this.toChunk);\n }\n\n /**\n * Method to draw the component on the screen.\n * @returns {DocumentFragment} The fragment containing the component.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-file-upload');\n native.setAttribute('part', 'native');\n\n let label = document.createElement('div');\n label.setAttribute('part', 'file-label');\n label.classList.add('file-label');\n\n let fileList = document.createElement('slot');\n fileList.setAttribute('name', 'item');\n fileList.setAttribute('part', 'items');\n fileList.classList.add('file-list');\n\n let slot = document.createElement('slot');\n label.appendChild(slot);\n\n let fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('multiple', '');\n fileInput.setAttribute('style', 'display:none;');\n fileInput.setAttribute('aria-hidden', 'true');\n\n if (!this.noUploadButton) {\n let button = document.createElement('wje-button');\n button.innerText = this.label || this.localizer.translate('wj.file.upload.button');\n button.setAttribute('part', 'upload-button');\n button.setAttribute('aria-label', button.innerText);\n\n label.appendChild(button);\n\n this.button = button;\n }\n\n native.appendChild(fileInput);\n native.appendChild(label);\n native.appendChild(fileList);\n\n fragment.appendChild(native);\n\n this.native = native;\n this.fileList = fileList;\n this.fileInput = fileInput;\n\n return fragment;\n }\n\n /**\n * Method to perform actions after the component is drawn.\n */\n afterDraw() {\n this.button?.addEventListener('click', () => {\n this.fileInput.click();\n });\n\n this.fileInput.addEventListener('change', this.handleInputChange);\n this.native.addEventListener('drop', this.handleDrop);\n\n let dragEventCounter = 0;\n\n this.native.addEventListener('dragenter', (e) => {handleInputChange\n e.preventDefault();\n\n if (dragEventCounter === 0) {\n this.native.classList.add('highlight');\n }\n\n dragEventCounter += 1;\n });\n\n this.native.addEventListener('dragover', (e) => {\n e.preventDefault();\n\n if (dragEventCounter === 0) {\n dragEventCounter = 1;\n }\n });\n\n this.native.addEventListener('dragleave', (e) => {\n e.preventDefault();\n\n dragEventCounter -= 1;\n\n if (dragEventCounter <= 0) {\n dragEventCounter = 0;\n this.native.classList.remove('highlight');\n }\n });\n\n this.native.addEventListener('drop', (e) => {\n event.preventDefault();\n\n dragEventCounter = 0;\n this.native.classList.remove('highlight');\n });\n\n this.addEventListener('wje-file-upload-item:remove', (e) => {\n const file = e.detail;\n\n if (!(file instanceof File)) {\n return;\n }\n\n let count = this.uploadedFiles.length;\n\n this.uploadedFiles = this.uploadedFiles.filter((entry) => {\n return entry?.file?.lastModified !== file.lastModified;\n });\n\n if(count !== this.uploadedFiles.length)\n event.dispatchCustomEvent(this, 'wje-file-upload:file-removed', file);\n });\n }\n\n /**\n * Method to handle form submission.\n * @param {Event} e The form submission event.\n */\n handleSubmit(e) {\n e.preventDefault();\n\n this.addFilesToQueue(this.fileInput.files);\n }\n\n /**\n * Method to handle file drop event.\n * @param {Event} e The file drop event object.\n */\n handleDrop = (e) => {\n const fileList = e.dataTransfer.files;\n\n this.resetFormState();\n\n this.addFilesToQueue(fileList);\n };\n\n /**\n * Method to handle file input change event.\n * @param {Event} e The file input change event object.\n */\n handleInputChange = (e) => {\n const files = Array.from(e.target.files);\n\n event.dispatchCustomEvent(this, 'wje-file-upload:files-selected', files);\n\n this.resetFormState();\n\n try {\n this.handleSubmit(e);\n } catch (err) {\n console.error(err);\n }\n };\n\n /**\n * Method to add files to the queue.\n * @param files\n */\n addFilesToQueue(files) {\n const currentCount = (Array.isArray(this.uploadedFiles) ? this.uploadedFiles.length : 0) + (Array.isArray(this._queuedFiles) ? this._queuedFiles.length : 0);\n const newTotal = currentCount + files.length;\n\n if (this.maxFiles && newTotal > this.maxFiles) {\n const detail = {\n code: 'MAX-FILES-EXCEEDED',\n files,\n maxFiles: this.maxFiles,\n currentCount,\n attemptedToAdd: files.length,\n allowedRemaining: Math.max(this.maxFiles - currentCount, 0),\n };\n\n event.dispatchCustomEvent(this, 'wje-file-upload:error', detail);\n\n return;\n }\n\n this._queuedFiles = [...(this._queuedFiles || []), ...files];\n\n event.dispatchCustomEvent(this, 'wje-file-upload:files-added', files);\n\n this.onAddedFiles?.();\n\n if (this.autoProcessFiles) {\n this.uploadFiles();\n }\n\n this.fileInput.value = '';\n }\n\n /**\n * Method to upload files.\n */\n uploadFiles() {\n if (this._queuedFiles.length === 0) {\n return;\n }\n\n const uploadPromises = this._queuedFiles.map((file) => this.createUploadPromise(file));\n uploadPromises\n .reduce((prev, curr) => {\n return prev.then(() => {\n return curr;\n });\n }, Promise.resolve())\n .then(() => {\n event.dispatchCustomEvent(this, 'wje-file-upload:files-uploaded', this.uploadedFiles);\n\n this.onAllFilesUploaded?.();\n this._queuedFiles = [];\n }).catch((err) => {\n this._queuedFiles = this._queuedFiles.filter((file) => file !== err.file);\n\n event.dispatchCustomEvent(this,'wje-file-upload:error', err);\n });\n }\n\n /**\n * Method to create an upload promise.\n * @param file\n * @returns {Promise<unknown>}\n */\n createUploadPromise = (file) => {\n return new Promise((resolve, reject) => {\n this.assertFilesValid(file);\n let preview;\n\n let reader = new FileReader();\n reader.onload = () => {\n event.dispatchCustomEvent(this, 'wje-file-upload:started', file);\n\n this.onUploadStarted?.(file);\n\n preview = this.createPreview(file, reader);\n this.appendChild(preview);\n\n this.uploadFunction(file, preview).then((res) => {\n res.item = preview;\n\n event.dispatchCustomEvent(this, 'wje-file-upload:file-uploaded', res);\n\n this.onUploadedFileComplete?.(res);\n\n this.uploadedFiles.push(res);\n\n resolve(res);\n });\n };\n\n reader.readAsDataURL(file);\n });\n };\n\n /**\n * Method to create a preview for the file.\n * @param {File} file The file for which the preview is to be created.\n * @param {FileReader} reader The FileReader instance to read the file.\n * @returns {HTMLElement} The created preview.\n */\n createPreview(file, reader) {\n let preview = document.createElement('wje-file-upload-item');\n let fileType = file.type ? file.type.split('/')[1] : file.name.split('.').pop();\n let icon = getFileTypeIcon(fileType) || 'file';\n\n preview.setAttribute('slot', 'item');\n preview.setAttribute('name', file.name);\n preview.setAttribute('size', file.size);\n preview.setAttribute('uploaded', '0');\n preview.innerHTML = `<wje-icon slot=\"img\" name=\"${icon}\" size=\"large\"></wje-icon>`;\n preview.data = file;\n\n return preview;\n }\n\n /**\n * Method to create a thumbnail for the file.\n * @param {File} file The file for which the thumbnail is to be created.\n * @param {FileReader} reader The FileReader instance to read the file.\n * @returns {HTMLElement} The created thumbnail.\n */\n createThumbnail(file, reader) {\n let img = document.createElement('img');\n img.setAttribute('src', reader.result);\n\n return img;\n }\n\n /**\n * Method to validate the files.\n * @param {File} file The file to be validated.\n * TODO: alowed types a size limit by malo byt cez attributy\n */\n assertFilesValid(file) {\n const { name: fileName, size: fileSize } = file;\n\n if (!isValidFileType(file, this.acceptedTypes)) {\n const err = new Error('');\n err.code = 'INVALID-FILE-TYPE';\n err.file = file;\n err.acceptedTypes = this.acceptedTypes;\n\n throw err;\n }\n\n if (fileSize > this.maxFileSize) {\n const err = new Error('');\n err.code = 'FILE-TOO-LARGE';\n err.file = file;\n err.maxFileSize = this.maxFileSize;\n\n throw err;\n }\n }\n\n /**\n * Method to reset the form state.\n */\n resetFormState() {\n this.fileList.textContent = '';\n }\n}\n","import FileUpload from './file-upload.element.js';\n\nexport default FileUpload;\n\nFileUpload.define('wje-file-upload', FileUpload);\n"],"names":["response","_a","fileType"],"mappings":";;;;;;;;AAeA,SAAS,WAAW;AAChB,SAAO;AAAA,IACH;AAAA,MACI,MAAM,CAAC,OAAO,QAAQ,OAAO,OAAO,OAAO,QAAQ,KAAK;AAAA,MACxD,MAAM;AAAA,IACl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KAAK;AAEvB,YAAM;AAAA,IACV;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAiB;AACb,SAAK,SAAS,cAAc;AAAA,EAChC;AACJ;AChkBA,WAAW,OAAO,mBAAmB,UAAU;"}
|
package/dist/wje-master.js
CHANGED
|
@@ -122,7 +122,8 @@ const skSk = {
|
|
|
122
122
|
"wj.pagination.first": "Prvá stránka",
|
|
123
123
|
"wj.pagination.prev": "Predchádzajúca",
|
|
124
124
|
"wj.pagination.next": "Ďalšia",
|
|
125
|
-
"wj.pagination.last": "Posledná stránka"
|
|
125
|
+
"wj.pagination.last": "Posledná stránka",
|
|
126
|
+
"wj.select.empty": "Žiadne dáta"
|
|
126
127
|
};
|
|
127
128
|
Localizer.registerTranslation(skSk);
|
|
128
129
|
const enGb = {
|
|
@@ -141,7 +142,8 @@ const enGb = {
|
|
|
141
142
|
"wj.pagination.first": "First page",
|
|
142
143
|
"wj.pagination.prev": "Previous",
|
|
143
144
|
"wj.pagination.next": "Next",
|
|
144
|
-
"wj.pagination.last": "Last page"
|
|
145
|
+
"wj.pagination.last": "Last page",
|
|
146
|
+
"wj.select.empty": "No data"
|
|
145
147
|
};
|
|
146
148
|
Localizer.registerTranslation(enGb);
|
|
147
149
|
const styles$1 = ".native-timeline {\n position: relative;\n}\n\n.vertical-line {\n position: absolute;\n margin-left: calc(var(--wje-spacing-x-large) + 1px);\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: var(--wje-color-info-3);\n}\n";
|
package/dist/wje-master.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-master.js","sources":["../packages/translations/sk-sk.js","../packages/translations/en-gb.js","../packages/wje-timeline/timeline.element.js","../packages/wje-timeline/timeline.js","../packages/wje-timeline-item/timeline-item.element.js","../packages/wje-timeline-item/timeline-item.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\n\nexport const skSk = {\n code: 'sk-sk',\n name: 'Slovak',\n dir: 'ltr',\n\n welcome: 'Vitajte',\n 'wj.file.upload.button': 'Vybrať súbor',\n 'wj.file.upload.uploaded': 'Nahraných: ',\n 'wj.file.upload.from': 'z',\n 'wj.stepper.button.next': 'Ďalej',\n 'wj.stepper.button.finish': 'Dokončiť',\n 'wj.stepper.button.previous': 'Späť',\n 'wj.stepper.step': 'Krok',\n 'wj.pagination.of': 'z',\n 'wj.pagination.first': 'Prvá stránka',\n 'wj.pagination.prev': 'Predchádzajúca',\n 'wj.pagination.next': 'Ďalšia',\n 'wj.pagination.last': 'Posledná stránka',\n};\n\nLocalizer.registerTranslation(skSk);\n","import { Localizer } from '../utils/localize.js';\n\nexport const enGb = {\n code: 'en-gb',\n name: 'English',\n dir: 'ltr',\n\n welcome: 'Welcome',\n 'wj.file.upload.button': 'Browse files',\n 'wj.file.upload.uploaded': 'Uploaded: ',\n 'wj.file.upload.from': 'from',\n 'wj.stepper.button.next': 'Next',\n 'wj.stepper.button.finish': 'Finish',\n 'wj.stepper.button.previous': 'Previous',\n 'wj.stepper.step': 'Step',\n 'wj.pagination.of': 'of',\n 'wj.pagination.first': 'First page',\n 'wj.pagination.prev': 'Previous',\n 'wj.pagination.next': 'Next',\n 'wj.pagination.last': 'Last page',\n};\n\nLocalizer.registerTranslation(enGb);\n","import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Timeline` is a custom web component that represents a timeline.\n * @summary This element represents a timeline.\n * @documentation https://elements.webjet.sk/components/timeline\n * @status stable\n * @augments WJElement\n * @slot - Slot for the timeline items.\n * @csspart native - The native part of the rating component.\n * @csspart vertical-line - The vertical line part of the rating component.\n * @tag wje-timeline\n */\nexport default class Timeline extends WJElement {\n /**\n * Creates an instance of Timeline.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n */\n className = 'Timeline';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component for the timeline.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n const native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-timeline');\n\n const verticalLine = document.createElement('div');\n verticalLine.setAttribute('part', 'vertical-line');\n verticalLine.classList.add('vertical-line');\n\n const slot = document.createElement('slot');\n\n native.appendChild(verticalLine);\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'list' });\n }\n }\n}\n","import Timeline from './timeline.element.js';\n\nexport default Timeline;\n\nTimeline.define('wje-timeline', Timeline);\n","import { formatDate } from '../utils/date.js';\nimport { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * The TimelineItem component.\n * @summary This element represents a timeline item.\n * @documentation https://elements.webjet.sk/components/timeline-item\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the timeline item.\n * @csspart content-container - The content container part of the timeline item.\n * @csspart default-icon - The default icon part of the timeline item.\n * @slot - Slot for the content of the timeline item.\n * @slot status - Slot for the status of the timeline item.\n * @tag wje-timeline-item\n */\nexport default class TimelineItem extends WJElement {\n constructor() {\n super();\n }\n\n /**\n * Returns the class name of the tab.\n * @returns {string} The class name of the tab.\n */\n className = 'TimelineItem';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAttribute('relative-time', '');\n }\n\n /**\n * Draws the component for the timeline item.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-timeline-item');\n\n let contentContainer = document.createElement('div');\n contentContainer.setAttribute('part', 'content-container');\n contentContainer.classList.add('content-container');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('text', this.getAttribute('tooltip') || '');\n tooltip.setAttribute('position', 'top');\n tooltip.setAttribute('content', formatDate(this.datetime, 'dd.MM.yyyy HH:mm'));\n\n let relativeTime = document.createElement('wje-relative-time');\n relativeTime.setAttribute('date', this.datetime || '');\n relativeTime.setAttribute('format', this.getAttribute('format') || '');\n\n tooltip.appendChild(relativeTime);\n\n let event = document.createElement('h3');\n event.classList.add('event');\n event.textContent = this.getAttribute('event') || '';\n\n // additional text content\n let slot = document.createElement('slot');\n\n // status slot\n let slotStatus = document.createElement('wje-icon');\n slotStatus.setAttribute('name', 'circle-dot');\n slotStatus.setAttribute('filled', '');\n slotStatus.setAttribute('part', 'default-icon');\n\n // if status slot is present\n if (this.querySelector('[slot=\"status\"]')) {\n slotStatus = document.createElement('slot');\n slotStatus.setAttribute('name', 'status');\n }\n\n contentContainer.appendChild(tooltip);\n contentContainer.appendChild(event);\n contentContainer.appendChild(slot);\n\n native.appendChild(slotStatus);\n native.appendChild(contentContainer);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import TimelineItem from './timeline-item.element.js';\n\nexport default TimelineItem;\n\nTimelineItem.define('wje-timeline-item', TimelineItem);\n"],"names":["styles","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEY,MAAC,OAAO;AAAA,EAChB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS;AAAA,EACT,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,mBAAmB;A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,SAAS,cAAc,MAAM;AAGxC,QAAI,aAAa,SAAS,cAAc,UAAU;AAClD,eAAW,aAAa,QAAQ,YAAY;AAC5C,eAAW,aAAa,UAAU,EAAE;AACpC,eAAW,aAAa,QAAQ,cAAc;AAG9C,QAAI,KAAK,cAAc,iBAAiB,GAAG;AACvC,mBAAa,SAAS,cAAc,MAAM;AAC1C,iBAAW,aAAa,QAAQ,QAAQ;AAAA,IAC5C;AAEA,qBAAiB,YAAY,OAAO;AACpC,qBAAiB,YAAYA,MAAK;AAClC,qBAAiB,YAAY,IAAI;AAEjC,WAAO,YAAY,UAAU;AAC7B,WAAO,YAAY,gBAAgB;AAEnC,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACX;AACJ;ACjGA,aAAa,OAAO,qBAAqB,YAAY;"}
|
|
1
|
+
{"version":3,"file":"wje-master.js","sources":["../packages/translations/sk-sk.js","../packages/translations/en-gb.js","../packages/wje-timeline/timeline.element.js","../packages/wje-timeline/timeline.js","../packages/wje-timeline-item/timeline-item.element.js","../packages/wje-timeline-item/timeline-item.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\n\nexport const skSk = {\n code: 'sk-sk',\n name: 'Slovak',\n dir: 'ltr',\n\n welcome: 'Vitajte',\n 'wj.file.upload.button': 'Vybrať súbor',\n 'wj.file.upload.uploaded': 'Nahraných: ',\n 'wj.file.upload.from': 'z',\n 'wj.stepper.button.next': 'Ďalej',\n 'wj.stepper.button.finish': 'Dokončiť',\n 'wj.stepper.button.previous': 'Späť',\n 'wj.stepper.step': 'Krok',\n 'wj.pagination.of': 'z',\n 'wj.pagination.first': 'Prvá stránka',\n 'wj.pagination.prev': 'Predchádzajúca',\n 'wj.pagination.next': 'Ďalšia',\n 'wj.pagination.last': 'Posledná stránka',\n 'wj.select.empty': 'Žiadne dáta',\n};\n\nLocalizer.registerTranslation(skSk);\n","import { Localizer } from '../utils/localize.js';\n\nexport const enGb = {\n code: 'en-gb',\n name: 'English',\n dir: 'ltr',\n\n welcome: 'Welcome',\n 'wj.file.upload.button': 'Browse files',\n 'wj.file.upload.uploaded': 'Uploaded: ',\n 'wj.file.upload.from': 'from',\n 'wj.stepper.button.next': 'Next',\n 'wj.stepper.button.finish': 'Finish',\n 'wj.stepper.button.previous': 'Previous',\n 'wj.stepper.step': 'Step',\n 'wj.pagination.of': 'of',\n 'wj.pagination.first': 'First page',\n 'wj.pagination.prev': 'Previous',\n 'wj.pagination.next': 'Next',\n 'wj.pagination.last': 'Last page',\n 'wj.select.empty': 'No data',\n};\n\nLocalizer.registerTranslation(enGb);\n","import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Timeline` is a custom web component that represents a timeline.\n * @summary This element represents a timeline.\n * @documentation https://elements.webjet.sk/components/timeline\n * @status stable\n * @augments WJElement\n * @slot - Slot for the timeline items.\n * @csspart native - The native part of the rating component.\n * @csspart vertical-line - The vertical line part of the rating component.\n * @tag wje-timeline\n */\nexport default class Timeline extends WJElement {\n /**\n * Creates an instance of Timeline.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n */\n className = 'Timeline';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component for the timeline.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n const native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-timeline');\n\n const verticalLine = document.createElement('div');\n verticalLine.setAttribute('part', 'vertical-line');\n verticalLine.classList.add('vertical-line');\n\n const slot = document.createElement('slot');\n\n native.appendChild(verticalLine);\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'list' });\n }\n }\n}\n","import Timeline from './timeline.element.js';\n\nexport default Timeline;\n\nTimeline.define('wje-timeline', Timeline);\n","import { formatDate } from '../utils/date.js';\nimport { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * The TimelineItem component.\n * @summary This element represents a timeline item.\n * @documentation https://elements.webjet.sk/components/timeline-item\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the timeline item.\n * @csspart content-container - The content container part of the timeline item.\n * @csspart default-icon - The default icon part of the timeline item.\n * @slot - Slot for the content of the timeline item.\n * @slot status - Slot for the status of the timeline item.\n * @tag wje-timeline-item\n */\nexport default class TimelineItem extends WJElement {\n constructor() {\n super();\n }\n\n /**\n * Returns the class name of the tab.\n * @returns {string} The class name of the tab.\n */\n className = 'TimelineItem';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAttribute('relative-time', '');\n }\n\n /**\n * Draws the component for the timeline item.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-timeline-item');\n\n let contentContainer = document.createElement('div');\n contentContainer.setAttribute('part', 'content-container');\n contentContainer.classList.add('content-container');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('text', this.getAttribute('tooltip') || '');\n tooltip.setAttribute('position', 'top');\n tooltip.setAttribute('content', formatDate(this.datetime, 'dd.MM.yyyy HH:mm'));\n\n let relativeTime = document.createElement('wje-relative-time');\n relativeTime.setAttribute('date', this.datetime || '');\n relativeTime.setAttribute('format', this.getAttribute('format') || '');\n\n tooltip.appendChild(relativeTime);\n\n let event = document.createElement('h3');\n event.classList.add('event');\n event.textContent = this.getAttribute('event') || '';\n\n // additional text content\n let slot = document.createElement('slot');\n\n // status slot\n let slotStatus = document.createElement('wje-icon');\n slotStatus.setAttribute('name', 'circle-dot');\n slotStatus.setAttribute('filled', '');\n slotStatus.setAttribute('part', 'default-icon');\n\n // if status slot is present\n if (this.querySelector('[slot=\"status\"]')) {\n slotStatus = document.createElement('slot');\n slotStatus.setAttribute('name', 'status');\n }\n\n contentContainer.appendChild(tooltip);\n contentContainer.appendChild(event);\n contentContainer.appendChild(slot);\n\n native.appendChild(slotStatus);\n native.appendChild(contentContainer);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import TimelineItem from './timeline-item.element.js';\n\nexport default TimelineItem;\n\nTimelineItem.define('wje-timeline-item', TimelineItem);\n"],"names":["styles","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEY,MAAC,OAAO;AAAA,EAChB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS;AAAA,EACT,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,mBAAmB;AACvB;AAEA,UAAU,oBAAoB,IAAI;ACrBtB,MAAC,OAAO;AAAA,EAChB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS;AAAA,EACT,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAC9B,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,uBA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YAAY,gBAAgB;AAEnC,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACX;AACJ;ACjGA,aAAa,OAAO,qBAAqB,YAAY;"}
|
package/dist/wje-select.js
CHANGED
|
@@ -9,9 +9,10 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _addedOptions, _htmlOptions, _Select_instances, htmlSelectedItem_fn, getSelectedOptions_fn, _applySearchFilter, _onMenuItemClickCapture, syncOptionCheckbox_fn;
|
|
12
|
+
var _addedOptions, _htmlOptions, _Select_instances, htmlSelectedItem_fn, getSelectedOptions_fn, hasVisibleOptions_fn, updateEmptyState_fn, _applySearchFilter, _onMenuItemClickCapture, syncOptionCheckbox_fn;
|
|
13
13
|
import { F as FormAssociatedElement } from "./form-associated-element-DEQ4y-jn.js";
|
|
14
14
|
import { event } from "./event.js";
|
|
15
|
+
import { Localizer } from "./localize.js";
|
|
15
16
|
import Button from "./wje-button.js";
|
|
16
17
|
import "./wje-popup.js";
|
|
17
18
|
import { I as Icon } from "./icon-DVyMc4Wv.js";
|
|
@@ -22,7 +23,7 @@ import Option from "./wje-option.js";
|
|
|
22
23
|
import Options from "./wje-options.js";
|
|
23
24
|
import Checkbox from "./wje-checkbox.js";
|
|
24
25
|
import { P as Popup } from "./popup.element-DklicGea.js";
|
|
25
|
-
const styles = "/*\n[ WJ Select ]\n*/\n\n:host {\n margin-bottom: var(--wje-select-margin-bottom);\n width: 100%;\n display: block;\n [slot='arrow'] {\n transform: rotate(0deg);\n transition: all 0.2s ease-in;\n }\n label {\n margin: var(--wje-select-label-margin);\n padding: var(--wje-select-label-padding);\n display: var(--wje-select-label-display);\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-select-label-line-height);\n font-size: var(--wje-select-label-font-size);\n }\n}\n\n.native-select {\n position: relative;\n &.default {\n .wrapper {\n display: block;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n padding-inline: 0.5rem;\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n }\n .input-wrapper {\n padding: 0;\n min-height: 28px;\n margin-top: -4px;\n }\n &.focused {\n wje-label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n label {\n &.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n }\n &.standard {\n .wrapper {\n height: var(--wje-select-height);\n box-sizing: border-box;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n }\n .input-wrapper {\n background: transparent;\n width: 100%;\n }\n slot[name='error'] {\n position: static;\n\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n }\n }\n}\n\n.wrapper {\n display: flex;\n width: 100%;\n}\n\n.input-wrapper {\n display: grid;\n grid-template-columns: auto 1fr auto auto auto;\n align-items: center;\n background-color: var(--wje-select-background);\n /*min-height: 28px;*/\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n appearance: none;\n padding: 2px 0.5rem;\n font-size: 14px !important;\n font-weight: normal;\n vertical-align: middle;\n input[readonly] {\n pointer-events: none;\n caret-color: transparent;\n }\n}\n\ninput {\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n font-size: 14px !important;\n font-weight: 400;\n letter-spacing: 0.01em;\n border: medium;\n height: 25px;\n min-height: 25px;\n padding: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n outline: 0;\n font-size: 14px !important;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n:host [active] {\n .wrapper {\n border-radius: var(--wje-select-border-radius);\n }\n [slot='arrow'] {\n transform: rotate(180deg);\n transition: all 0.2s ease-in;\n }\n}\n\n.options-wrapper {\n border-width: var(--wje-select-options-border-width);\n border-style: var(--wje-select-options-border-style);\n border-color: var(--wje-select-options-border-color);\n border-radius: var(--wje-select-options-border-radius);\n margin-top: calc(0px - var(--wje-select-border-width));\n background-color: var(--wje-select-options-background-color);\n overflow: hidden;\n}\n\n.find {\n margin-block: var(--wje-select-find-margin-block);\n margin-inline: var(--wje-select-find-margin-inline);\n width: var(--wje-select-find-width);\n}\n\n.list {\n overflow: auto;\n height: 100%;\n}\n\n.options-wrapper:has(.find) .list {\n height: calc(100% - 32px - 2 * var(--wje-select-find-margin-block));\n}\n\n:host([multiple]) input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n opacity: 0;\n}\n\n:host([multiple]) .chips {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--wje-spacing-3x-small);\n}\n\n:host([disabled]) .input-wrapper {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.counter {\n padding-inline: 0.5rem;\n}\n\nwje-chip {\n --wje-chip-margin: 0 0.25rem 0 0;\n}\n\nwje-button {\n --wje-padding-top: 0.25rem;\n --wje-padding-start: 0.25rem;\n --wje-padding-end: 0.25rem;\n --wje-padding-bottom: 0.25rem;\n --wje-button-margin-inline: 0 0.25rem;\n}\n\n.slot-start,\n.slot-end {\n &:not(:empty) {\n margin-right: 0.5rem;\n }\n}\n\nslot[name='error'] {\n display: none;\n}\n\n:host([invalid]) slot[name='error'] {\n display: block;\n}\n\nslot[name='error'] {\n display: none;\n position: absolute;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background: black;\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: var(--wje-font-size-small);\n width: max-content;\n line-height: normal;\n}\n\n.input-hidden{\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n}\n\n:host([required]) .wrapper::after {\n color: var(--wje-input-color-invalid);\n content: var(--wje-input-required-symbol);\n font-size: 24px;\n position: absolute;\n right: 12px;\n top: 0;\n}\n\n:host([required]) .standard .input-wrapper::after {\n right: 13px;\n top: -20px;\n}";
|
|
26
|
+
const styles = "/*\n[ WJ Select ]\n*/\n\n:host {\n margin-bottom: var(--wje-select-margin-bottom);\n width: 100%;\n display: block;\n [slot='arrow'] {\n transform: rotate(0deg);\n transition: all 0.2s ease-in;\n }\n label {\n margin: var(--wje-select-label-margin);\n padding: var(--wje-select-label-padding);\n display: var(--wje-select-label-display);\n opacity: 1;\n cursor: text;\n transition: opacity 0.2s ease;\n line-height: var(--wje-select-label-line-height);\n font-size: var(--wje-select-label-font-size);\n }\n}\n\n.native-select {\n position: relative;\n &.default {\n .wrapper {\n display: block;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n padding-inline: 0.5rem;\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n }\n .input-wrapper {\n padding: 0;\n min-height: 28px;\n margin-top: -4px;\n }\n &.focused {\n wje-label {\n opacity: 0.67;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n label {\n &.fade {\n opacity: 0.5;\n font-size: 12px;\n letter-spacing: normal;\n }\n }\n }\n &.standard {\n .wrapper {\n height: var(--wje-select-height);\n box-sizing: border-box;\n background-color: var(--wje-select-background);\n border-width: var(--wje-select-border-width);\n border-style: var(--wje-select-border-style);\n border-color: var(--wje-select-border-color);\n border-radius: var(--wje-select-border-radius);\n }\n .input-wrapper {\n background: transparent;\n width: 100%;\n }\n slot[name='error'] {\n position: static;\n\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-input-color-invalid);\n font-size: 12px;\n line-height: normal;\n }\n }\n}\n\n.wrapper {\n display: flex;\n width: 100%;\n}\n\n.input-wrapper {\n display: grid;\n grid-template-columns: auto 1fr auto auto auto;\n align-items: center;\n background-color: var(--wje-select-background);\n /*min-height: 28px;*/\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n appearance: none;\n padding: 2px 0.5rem;\n font-size: 14px !important;\n font-weight: normal;\n vertical-align: middle;\n input[readonly] {\n pointer-events: none;\n caret-color: transparent;\n }\n}\n\ninput {\n color: var(--wje-select-color);\n line-height: var(--wje-select-line-height);\n font-size: 14px !important;\n font-weight: 400;\n letter-spacing: 0.01em;\n border: medium;\n height: 25px;\n min-height: 25px;\n padding: 0;\n background: none;\n box-shadow: none;\n width: 100%;\n outline: 0;\n font-size: 14px !important;\n}\n\n::placeholder {\n opacity: 1;\n}\n\n:host [active] {\n .wrapper {\n border-radius: var(--wje-select-border-radius);\n }\n [slot='arrow'] {\n transform: rotate(180deg);\n transition: all 0.2s ease-in;\n }\n}\n\n.options-wrapper {\n border-width: var(--wje-select-options-border-width);\n border-style: var(--wje-select-options-border-style);\n border-color: var(--wje-select-options-border-color);\n border-radius: var(--wje-select-options-border-radius);\n margin-top: calc(0px - var(--wje-select-border-width));\n background-color: var(--wje-select-options-background-color);\n overflow: hidden;\n}\n\n.find {\n margin-block: var(--wje-select-find-margin-block);\n margin-inline: var(--wje-select-find-margin-inline);\n width: var(--wje-select-find-width);\n}\n\n.list {\n overflow: auto;\n height: 100%;\n position: relative;\n}\n\n.list:has(.empty:not([hidden])) {\n min-height: 44px;\n}\n\n.empty {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--wje-spacing-small);\n color: var(--wje-select-color);\n text-align: center;\n background-color: var(--wje-select-options-background-color);\n pointer-events: none;\n}\n\n.empty[hidden] {\n display: none;\n}\n\n.options-wrapper:has(.find) .list {\n height: calc(100% - 32px - 2 * var(--wje-select-find-margin-block));\n}\n\n:host([multiple]) input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n opacity: 0;\n}\n\n:host([multiple]) .chips {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--wje-spacing-3x-small);\n}\n\n:host([disabled]) .input-wrapper {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.counter {\n padding-inline: 0.5rem;\n}\n\nwje-chip {\n --wje-chip-margin: 0 0.25rem 0 0;\n}\n\nwje-button {\n --wje-padding-top: 0.25rem;\n --wje-padding-start: 0.25rem;\n --wje-padding-end: 0.25rem;\n --wje-padding-bottom: 0.25rem;\n --wje-button-margin-inline: 0 0.25rem;\n}\n\n.slot-start,\n.slot-end {\n &:not(:empty) {\n margin-right: 0.5rem;\n }\n}\n\nslot[name='error'] {\n display: none;\n}\n\n:host([invalid]) slot[name='error'] {\n display: block;\n}\n\nslot[name='error'] {\n display: none;\n position: absolute;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n background: black;\n padding: 0.25rem 0.5rem;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: var(--wje-font-size-small);\n width: max-content;\n line-height: normal;\n}\n\n.input-hidden{\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n}\n\n:host([required]) .wrapper::after {\n color: var(--wje-input-color-invalid);\n content: var(--wje-input-required-symbol);\n font-size: 24px;\n position: absolute;\n right: 12px;\n top: 0;\n}\n\n:host([required]) .standard .input-wrapper::after {\n right: 13px;\n top: -20px;\n}\n";
|
|
26
27
|
const _Select = class _Select extends FormAssociatedElement {
|
|
27
28
|
constructor() {
|
|
28
29
|
super();
|
|
@@ -142,6 +143,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
142
143
|
option.style.display = "none";
|
|
143
144
|
}
|
|
144
145
|
});
|
|
146
|
+
__privateMethod(this, _Select_instances, updateEmptyState_fn).call(this);
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
149
|
/**
|
|
@@ -161,6 +163,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
161
163
|
}
|
|
162
164
|
e.stopPropagation();
|
|
163
165
|
});
|
|
166
|
+
this.localizer = new Localizer(this);
|
|
164
167
|
this.counterEl = null;
|
|
165
168
|
this._wasOppened = false;
|
|
166
169
|
this.native = null;
|
|
@@ -172,6 +175,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
172
175
|
this.chips = null;
|
|
173
176
|
this.clear = null;
|
|
174
177
|
this.list = null;
|
|
178
|
+
this.emptyState = null;
|
|
175
179
|
this._value = [];
|
|
176
180
|
this._selectedOptions = [];
|
|
177
181
|
this._instanceId = ++_Select._instanceId;
|
|
@@ -530,6 +534,14 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
530
534
|
list.setAttribute("role", "listbox");
|
|
531
535
|
if (this.hasAttribute("multiple")) list.setAttribute("aria-multiselectable", "true");
|
|
532
536
|
let slot = document.createElement("slot");
|
|
537
|
+
let emptyState = document.createElement("div");
|
|
538
|
+
emptyState.setAttribute("part", "empty");
|
|
539
|
+
emptyState.setAttribute("role", "option");
|
|
540
|
+
emptyState.setAttribute("aria-disabled", "true");
|
|
541
|
+
emptyState.setAttribute("aria-selected", "false");
|
|
542
|
+
emptyState.classList.add("empty");
|
|
543
|
+
emptyState.hidden = true;
|
|
544
|
+
emptyState.textContent = this.localizer.translate("wj.select.empty");
|
|
533
545
|
let clear = document.createElement("wje-button");
|
|
534
546
|
clear.setAttribute("fill", "link");
|
|
535
547
|
clear.setAttribute("part", "clear");
|
|
@@ -569,7 +581,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
569
581
|
if (this.hasAttribute("clearable")) inputWrapper.append(clear);
|
|
570
582
|
inputWrapper.appendChild(slotEnd);
|
|
571
583
|
inputWrapper.appendChild(arrow);
|
|
572
|
-
list.
|
|
584
|
+
list.append(slot, emptyState);
|
|
573
585
|
if (this.hasAttribute("find")) {
|
|
574
586
|
let find = document.createElement("wje-input");
|
|
575
587
|
find.setAttribute("variant", "standard");
|
|
@@ -602,6 +614,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
602
614
|
this.chips = chips;
|
|
603
615
|
this.clear = clear;
|
|
604
616
|
this.list = list;
|
|
617
|
+
this.emptyState = emptyState;
|
|
605
618
|
this.slotFooter = slotFooter;
|
|
606
619
|
this.syncAria();
|
|
607
620
|
return fragment;
|
|
@@ -705,6 +718,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
705
718
|
});
|
|
706
719
|
this.selectedOptions = __privateMethod(this, _Select_instances, getSelectedOptions_fn).call(this);
|
|
707
720
|
this.selections(true);
|
|
721
|
+
__privateMethod(this, _Select_instances, updateEmptyState_fn).call(this);
|
|
708
722
|
this.list.scrollTo(0, 0);
|
|
709
723
|
event.dispatchCustomEvent(this.popup, "wje-popup:content-ready");
|
|
710
724
|
});
|
|
@@ -712,6 +726,7 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
712
726
|
event.addListener(this.findEl, "keyup", "", __privateGet(this, _applySearchFilter));
|
|
713
727
|
event.addListener(this.findEl, "wje-input:clear", "", __privateGet(this, _applySearchFilter));
|
|
714
728
|
}
|
|
729
|
+
__privateMethod(this, _Select_instances, updateEmptyState_fn).call(this);
|
|
715
730
|
}
|
|
716
731
|
/**
|
|
717
732
|
* Returns all the options as HTML.
|
|
@@ -864,10 +879,12 @@ const _Select = class _Select extends FormAssociatedElement {
|
|
|
864
879
|
const optionsElement = this.querySelector("wje-options");
|
|
865
880
|
if (optionsElement) {
|
|
866
881
|
optionsElement.addOption(optionData, silent, map);
|
|
882
|
+
__privateMethod(this, _Select_instances, updateEmptyState_fn).call(this);
|
|
867
883
|
return;
|
|
868
884
|
}
|
|
869
885
|
let option = this.htmlOption(optionData, map);
|
|
870
886
|
this.appendChild(option);
|
|
887
|
+
__privateMethod(this, _Select_instances, updateEmptyState_fn).call(this);
|
|
871
888
|
}
|
|
872
889
|
/**
|
|
873
890
|
* Adds one or more options to a collection. If the input is an array, it adds each option within the array.
|
|
@@ -1017,6 +1034,26 @@ htmlSelectedItem_fn = function(item) {
|
|
|
1017
1034
|
getSelectedOptions_fn = function() {
|
|
1018
1035
|
return Array.from(this.querySelectorAll("wje-option[selected]"));
|
|
1019
1036
|
};
|
|
1037
|
+
/**
|
|
1038
|
+
* Determines whether the select currently contains at least one visible option.
|
|
1039
|
+
* @returns {boolean} Returns true when at least one option is visible, otherwise false.
|
|
1040
|
+
*/
|
|
1041
|
+
hasVisibleOptions_fn = function() {
|
|
1042
|
+
return Array.from(this.getAllOptions()).some((option) => {
|
|
1043
|
+
if (option.hidden || option.hasAttribute("hidden")) {
|
|
1044
|
+
return false;
|
|
1045
|
+
}
|
|
1046
|
+
return getComputedStyle(option).display !== "none";
|
|
1047
|
+
});
|
|
1048
|
+
};
|
|
1049
|
+
/**
|
|
1050
|
+
* Toggles the empty state message based on whether any visible options are available.
|
|
1051
|
+
* @returns {void} Does not return a value.
|
|
1052
|
+
*/
|
|
1053
|
+
updateEmptyState_fn = function() {
|
|
1054
|
+
if (!(this.emptyState instanceof HTMLElement)) return;
|
|
1055
|
+
this.emptyState.hidden = __privateMethod(this, _Select_instances, hasVisibleOptions_fn).call(this);
|
|
1056
|
+
};
|
|
1020
1057
|
_applySearchFilter = new WeakMap();
|
|
1021
1058
|
_onMenuItemClickCapture = new WeakMap();
|
|
1022
1059
|
syncOptionCheckbox_fn = function(option) {
|
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\tstatic _instanceId = 0;\n\t#addedOptions = [];\n\t#htmlOptions = [];\n\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\tthis._instanceId = ++Select._instanceId;\n\t}\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 originalValue = value;\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\t\t\tlet dataString = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t} else {\n\t\t\t\tdataString = data.join(' ');\n\t\t\t}\n\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\n\t\t\tthis.setAttribute('value', dataString);\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t\tthis.removeAttribute('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\n\t\t\tthis.input?.setAttribute('disabled', '');\n\t\t\tthis.displayInput?.setAttribute('disabled', '');\n\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\n\t\t\tthis.input?.removeAttribute('disabled');\n\t\t\tthis.displayInput?.removeAttribute('disabled');\n\n\t\t\tthis.popup?.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('readonly', '');\n\n\t\t\t// inputs nemusia existovať ešte pred draw()\n\t\t\tthis.input?.setAttribute('readonly', '');\n\t\t\tthis.displayInput?.setAttribute('readonly', '');\n\n\t\t\t// popup môže existovať, ak to toggle-uješ po renderi\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('readonly');\n\n\t\t\tthis.input?.removeAttribute('readonly');\n\t\t\tthis.displayInput?.removeAttribute('readonly');\n\n\t\t\tthis.popup?.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', 'disabled', 'readonly'];\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\tthis.syncAria();\n\t}\n\n\tbeforeDraw() {\n\t\tif (this.hasAttribute('value')) {\n\t\t\t// If a value attribute is explicitly provided, respect it.\n\t\t\tthis.value = this.getAttribute('value');\n\t\t} else {\n\t\t\t// No explicit value – derive initial value from currently selected options.\n\t\t\tconst selectedOptions = this.#getSelectedOptions();\n\n\t\t\tif (selectedOptions.length > 0) {\n\t\t\t\tconst values = selectedOptions.map((opt) => opt.value);\n\t\t\t\tthis.value = this.hasAttribute('multiple') ? values : values[0];\n\t\t\t}\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('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\t// Apply initial disabled/readonly state during first render\n\t\tif (this.disabled) {\n\t\t\tinput.setAttribute('disabled', '');\n\t\t\tdisplay.setAttribute('disabled', '');\n\t\t}\n\n\t\tif (this.readonly) {\n\t\t\tinput.setAttribute('readonly', '');\n\t\t\tdisplay.setAttribute('readonly', '');\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\t\tthis._ariaListId = this.id ? `${this.id}-listbox` : `wje-select-${this._instanceId}-listbox`;\n\t\tlist.id = this._ariaListId;\n\t\tlist.setAttribute('role', 'listbox');\n\t\tif (this.hasAttribute('multiple')) list.setAttribute('aria-multiselectable', 'true');\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')) && !this._wasOppened) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.disabled) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('disabled');\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\tlet slotFooter = document.createElement('slot');\n\t\tslotFooter.setAttribute('name', 'footer');\n\n\t\t// APPEND\n\t\toptionsWrapper.append(list);\n\t\toptionsWrapper.append(slotFooter);\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\t\tthis.slotFooter = slotFooter;\n\n\t\tthis.syncAria();\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\t\tdocument.addEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t\tthis.syncAria();\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, true);\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\tevent.addListener(this.popup, 'wje-popup:aftershow', null, () => {\n\t\t\tconst assignedElements = this.slotFooter.assignedElements();\n\n\t\t\tif (assignedElements.length > 0) {\n\t\t\t\tconst el = assignedElements[0];\n\t\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\t\tlet totalHeight = 0;\n\n\t\t\t\tif(this.hasAttribute('find')) {\n\t\t\t\t\tlet style = getComputedStyle(this.findEl);\n\n\t\t\t\t\tlet height = this.findEl.offsetHeight;\n\t\t\t\t\tlet marginTop = parseFloat(style.marginTop);\n\t\t\t\t\tlet marginBottom = parseFloat(style.marginBottom);\n\n\t\t\t\t\ttotalHeight = height + marginTop + marginBottom;\n\t\t\t\t}\n\n\t\t\t\tlet subtractHeight = rect.height + totalHeight;\n\n\t\t\t\tthis.list.style.height = `calc(100% - ${subtractHeight}px)`;\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\t\tevent.addListener(this.popup, 'wje-popup:show', null, () => this.syncAria());\n\t\tevent.addListener(this.popup, 'wje-popup:hide', null, () => this.syncAria());\n\n\t\tthis.addEventListener('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\tif (this.readonly || this.disabled) return;\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\tif (this.readonly || this.disabled) return;\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\tthis.syncAria();\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\n\t\t\tthis.getAllOptions().forEach((o) => this.#syncOptionCheckbox(o));\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\n\t\t\t\tif (optionSlotEnd && optionSlotEnd instanceof HTMLElement && optionSlotEnd.tagName !== 'WJE-DROPDOWN' && optionSlotEnd.tagName !== 'WJE-BUTTON') {\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\tthis.syncAria();\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 = !this.readonly;\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\tconst option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\t\tif (!option) return;\n\n\t\tif (silent) {\n\t\t\tif (!option.hasAttribute('selected')) {\n\t\t\t\toption.selected = true;\n\t\t\t}\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t} else {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) {\n\t\t\tthis.selections(silent);\n\t\t}\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 * If the option already contains a custom element with slot=\"check\" (e.g. <wje-status slot=\"check\">),\n\t * it is left untouched and no template icon is added.\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 existingCheckSlot = option.querySelector('[slot=\"check\"]');\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName !== 'WJE-CHECKBOX') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName === 'WJE-CHECKBOX') {\n\t\t\tconst isSelectedExisting = option.hasAttribute('selected');\n\n\t\t\t// zosúladenie stavu\n\t\t\texistingCheckSlot.checked = isSelectedExisting;\n\t\t\tif (isSelectedExisting) {\n\t\t\t\texistingCheckSlot.setAttribute('checked', '');\n\t\t\t} else {\n\t\t\t\texistingCheckSlot.removeAttribute('checked');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\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\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\tdisconnectedCallback() {\n\t\tdocument.removeEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tconst expanded = this.popup?.hasAttribute('active') || this.classList.contains('active');\n\t\tthis.setAriaState({\n\t\t\trole: 'combobox',\n\t\t\thaspopup: 'listbox',\n\t\t\texpanded,\n\t\t\tcontrols: this._ariaListId,\n\t\t\tdisabled: this.disabled,\n\t\t\trequired: this.required,\n\t\t\tinvalid: this.invalid || this.hasAttribute('invalid'),\n\t\t});\n\t}\n\n\t/**\n\t * Prevent closing the parent <wje-select>'s popup when a nested <wje-dropdown>\n\t * menu item is clicked. Closes only the dropdown that owns the clicked item.\n\t * This captures the event at the document level (useCapture=true) so it can\n\t * stop the global outside-click logic that would otherwise hide the select's popup.\n\t */\n\t#onMenuItemClickCapture = (e) => {\n\t\tconst target = (e.target);\n\t\tif (!target || !target.closest) return;\n\n\t\tconst menuItem = target.closest('wje-menu-item');\n\t\tif (!menuItem) return;\n\n\t\tconst dropdown = target.closest('wje-dropdown');\n\t\tif (dropdown && typeof dropdown.hide === 'function') {\n\t\t\tdropdown.hide();\n\t\t}\n\n\t\te.stopPropagation();\n\t}\n\n\t#syncOptionCheckbox(option) {\n\t\tconst checkbox = option.querySelector('wje-checkbox[slot=\"check\"]');\n\t\tif (!checkbox) return;\n\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\tcheckbox.checked = isSelected;\n\t\tif (isSelected) {\n\t\t\tcheckbox.setAttribute('checked', '');\n\t\t} else {\n\t\t\tcheckbox.removeAttribute('checked');\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,UAAN,MAAM,gBAAe,sBAAsB;AAAA,EAKjD,cAAc;A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,eAAc;AAE/F,SAAO,KAAK,iBAAiB,KAAK;AACnC;AAAA;AAAA;AAAA;AAAA;AAMA,wBAAmB,WAAG;AACrB,SAAO,MAAM,KAAK,KAAK,iBAAiB,sBAAsB,CAAC;AAChE;AAUA;AA8CA;AAeA,wBAAmB,SAAC,QAAQ;AAC3B,QAAM,WAAW,OAAO,cAAc,4BAA4B;AAClE,MAAI,CAAC,SAAU;AAEf,QAAM,aAAa,OAAO,aAAa,UAAU;AACjD,WAAS,UAAU;AACnB,MAAI,YAAY;AACf,aAAS,aAAa,WAAW,EAAE;AAAA,EACpC,OAAO;AACN,aAAS,gBAAgB,SAAS;AAAA,EACnC;AACD;AA9uCA,cADY,SACL,eAAc;AADf,IAAM,SAAN;ACTP,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 { Localizer } from '../utils/localize.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\tstatic _instanceId = 0;\n\t#addedOptions = [];\n\t#htmlOptions = [];\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.localizer = new Localizer(this);\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\t/**\n\t\t * @type {HTMLElement|null}\n\t\t * @description A reference to the empty state element, initially null.\n\t\t */\n\t\tthis.emptyState = null;\n\n\t\tthis._value = [];\n\t\tthis._selectedOptions = [];\n\t\tthis._instanceId = ++Select._instanceId;\n\t}\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 originalValue = value;\n\t\tconst formData = new FormData();\n\n\t\tif (value) {\n\t\t\tlet data = value;\n\t\t\tlet dataString = value;\n\n\t\t\tif (!Array.isArray(data)) {\n\t\t\t\tdata = data.split(' ');\n\t\t\t} else {\n\t\t\t\tdataString = data.join(' ');\n\t\t\t}\n\n\t\t\tdata.forEach(v => {\n\t\t\t\tformData.append(this.name, v)\n\t\t\t});\n\n\t\t\tvalue = formData;\n\n\t\t\tthis._value = data;\n\n\t\t\tthis.setAttribute('value', dataString);\n\t\t} else {\n\t\t\tformData.delete(this.name);\n\t\t\tvalue = formData;\n\t\t\tthis._value = [];\n\t\t\tthis.removeAttribute('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\n\t\t\tthis.input?.setAttribute('disabled', '');\n\t\t\tthis.displayInput?.setAttribute('disabled', '');\n\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('disabled');\n\n\t\t\tthis.input?.removeAttribute('disabled');\n\t\t\tthis.displayInput?.removeAttribute('disabled');\n\n\t\t\tthis.popup?.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('readonly', '');\n\n\t\t\t// inputs nemusia existovať ešte pred draw()\n\t\t\tthis.input?.setAttribute('readonly', '');\n\t\t\tthis.displayInput?.setAttribute('readonly', '');\n\n\t\t\t// popup môže existovať, ak to toggle-uješ po renderi\n\t\t\tthis.popup?.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('readonly');\n\n\t\t\tthis.input?.removeAttribute('readonly');\n\t\t\tthis.displayInput?.removeAttribute('readonly');\n\n\t\t\tthis.popup?.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', 'disabled', 'readonly'];\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\tthis.syncAria();\n\t}\n\n\tbeforeDraw() {\n\t\tif (this.hasAttribute('value')) {\n\t\t\t// If a value attribute is explicitly provided, respect it.\n\t\t\tthis.value = this.getAttribute('value');\n\t\t} else {\n\t\t\t// No explicit value – derive initial value from currently selected options.\n\t\t\tconst selectedOptions = this.#getSelectedOptions();\n\n\t\t\tif (selectedOptions.length > 0) {\n\t\t\t\tconst values = selectedOptions.map((opt) => opt.value);\n\t\t\t\tthis.value = this.hasAttribute('multiple') ? values : values[0];\n\t\t\t}\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('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\t// Apply initial disabled/readonly state during first render\n\t\tif (this.disabled) {\n\t\t\tinput.setAttribute('disabled', '');\n\t\t\tdisplay.setAttribute('disabled', '');\n\t\t}\n\n\t\tif (this.readonly) {\n\t\t\tinput.setAttribute('readonly', '');\n\t\t\tdisplay.setAttribute('readonly', '');\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\t\tthis._ariaListId = this.id ? `${this.id}-listbox` : `wje-select-${this._instanceId}-listbox`;\n\t\tlist.id = this._ariaListId;\n\t\tlist.setAttribute('role', 'listbox');\n\t\tif (this.hasAttribute('multiple')) list.setAttribute('aria-multiselectable', 'true');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet emptyState = document.createElement('div');\n\t\temptyState.setAttribute('part', 'empty');\n\t\temptyState.setAttribute('role', 'option');\n\t\temptyState.setAttribute('aria-disabled', 'true');\n\t\temptyState.setAttribute('aria-selected', 'false');\n\t\temptyState.classList.add('empty');\n\t\temptyState.hidden = true;\n\t\temptyState.textContent = this.localizer.translate('wj.select.empty');\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')) && !this._wasOppened) {\n\t\t\tpopup.setAttribute('loader', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('loader');\n\t\t}\n\n\t\tif (this.disabled) {\n\t\t\tpopup.setAttribute('disabled', '');\n\t\t} else {\n\t\t\tpopup.removeAttribute('disabled');\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.append(slot, emptyState);\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\tlet slotFooter = document.createElement('slot');\n\t\tslotFooter.setAttribute('name', 'footer');\n\n\t\t// APPEND\n\t\toptionsWrapper.append(list);\n\t\toptionsWrapper.append(slotFooter);\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\t\tthis.emptyState = emptyState;\n\t\tthis.slotFooter = slotFooter;\n\n\t\tthis.syncAria();\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\t\tdocument.addEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\n\t\tthis.validate();\n\n\t\tif (this.hasAttribute('invalid')) {\n\t\t\tthis.showInvalidMessage();\n\t\t}\n\t\tthis.syncAria();\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, true);\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\tevent.addListener(this.popup, 'wje-popup:aftershow', null, () => {\n\t\t\tconst assignedElements = this.slotFooter.assignedElements();\n\n\t\t\tif (assignedElements.length > 0) {\n\t\t\t\tconst el = assignedElements[0];\n\t\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\t\tlet totalHeight = 0;\n\n\t\t\t\tif(this.hasAttribute('find')) {\n\t\t\t\t\tlet style = getComputedStyle(this.findEl);\n\n\t\t\t\t\tlet height = this.findEl.offsetHeight;\n\t\t\t\t\tlet marginTop = parseFloat(style.marginTop);\n\t\t\t\t\tlet marginBottom = parseFloat(style.marginBottom);\n\n\t\t\t\t\ttotalHeight = height + marginTop + marginBottom;\n\t\t\t\t}\n\n\t\t\t\tlet subtractHeight = rect.height + totalHeight;\n\n\t\t\t\tthis.list.style.height = `calc(100% - ${subtractHeight}px)`;\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\t\tevent.addListener(this.popup, 'wje-popup:show', null, () => this.syncAria());\n\t\tevent.addListener(this.popup, 'wje-popup:hide', null, () => this.syncAria());\n\n\t\tthis.addEventListener('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\tif (this.readonly || this.disabled) return;\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\t\t\tthis.#updateEmptyState();\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\n\t\tthis.#updateEmptyState();\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\tif (this.readonly || this.disabled) return;\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\tthis.syncAria();\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\n\t\t\tthis.getAllOptions().forEach((o) => this.#syncOptionCheckbox(o));\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\n\t\t\t\tif (optionSlotEnd && optionSlotEnd instanceof HTMLElement && optionSlotEnd.tagName !== 'WJE-DROPDOWN' && optionSlotEnd.tagName !== 'WJE-BUTTON') {\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\tthis.syncAria();\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 = !this.readonly;\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\tthis.#updateEmptyState();\n\t\t\treturn;\n\t\t}\n\t\tlet option = this.htmlOption(optionData, map);\n\t\tthis.appendChild(option);\n\t\tthis.#updateEmptyState();\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\tconst option = this.querySelector(`wje-option[value=\"${value}\"]`);\n\t\tif (!option) return;\n\n\t\tif (silent) {\n\t\t\tif (!option.hasAttribute('selected')) {\n\t\t\t\toption.selected = true;\n\t\t\t}\n\t\t\tthis.selectedOptions = this.#getSelectedOptions();\n\t\t} else {\n\t\t\tthis.processClickedOption(option, this.hasAttribute('multiple'));\n\t\t}\n\n\t\tif (this.drawingStatus > this.drawingStatuses.START) {\n\t\t\tthis.selections(silent);\n\t\t}\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 * If the option already contains a custom element with slot=\"check\" (e.g. <wje-status slot=\"check\">),\n\t * it is left untouched and no template icon is added.\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 existingCheckSlot = option.querySelector('[slot=\"check\"]');\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName !== 'WJE-CHECKBOX') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (existingCheckSlot && existingCheckSlot.tagName === 'WJE-CHECKBOX') {\n\t\t\tconst isSelectedExisting = option.hasAttribute('selected');\n\n\t\t\t// zosúladenie stavu\n\t\t\texistingCheckSlot.checked = isSelectedExisting;\n\t\t\tif (isSelectedExisting) {\n\t\t\t\texistingCheckSlot.setAttribute('checked', '');\n\t\t\t} else {\n\t\t\t\texistingCheckSlot.removeAttribute('checked');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\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\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 * Determines whether the select currently contains at least one visible option.\n\t * @returns {boolean} Returns true when at least one option is visible, otherwise false.\n\t */\n\t#hasVisibleOptions() {\n\t\treturn Array.from(this.getAllOptions()).some((option) => {\n\t\t\tif (option.hidden || option.hasAttribute('hidden')) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn getComputedStyle(option).display !== 'none';\n\t\t});\n\t}\n\n\t/**\n\t * Toggles the empty state message based on whether any visible options are available.\n\t * @returns {void} Does not return a value.\n\t */\n\t#updateEmptyState() {\n\t\tif (!(this.emptyState instanceof HTMLElement)) return;\n\n\t\tthis.emptyState.hidden = this.#hasVisibleOptions();\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\n\t\t\tthis.#updateEmptyState();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tdocument.removeEventListener('mousedown', this.#onMenuItemClickCapture, true);\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tconst expanded = this.popup?.hasAttribute('active') || this.classList.contains('active');\n\t\tthis.setAriaState({\n\t\t\trole: 'combobox',\n\t\t\thaspopup: 'listbox',\n\t\t\texpanded,\n\t\t\tcontrols: this._ariaListId,\n\t\t\tdisabled: this.disabled,\n\t\t\trequired: this.required,\n\t\t\tinvalid: this.invalid || this.hasAttribute('invalid'),\n\t\t});\n\t}\n\n\t/**\n\t * Prevent closing the parent <wje-select>'s popup when a nested <wje-dropdown>\n\t * menu item is clicked. Closes only the dropdown that owns the clicked item.\n\t * This captures the event at the document level (useCapture=true) so it can\n\t * stop the global outside-click logic that would otherwise hide the select's popup.\n\t */\n\t#onMenuItemClickCapture = (e) => {\n\t\tconst target = (e.target);\n\t\tif (!target || !target.closest) return;\n\n\t\tconst menuItem = target.closest('wje-menu-item');\n\t\tif (!menuItem) return;\n\n\t\tconst dropdown = target.closest('wje-dropdown');\n\t\tif (dropdown && typeof dropdown.hide === 'function') {\n\t\t\tdropdown.hide();\n\t\t}\n\n\t\te.stopPropagation();\n\t}\n\n\t#syncOptionCheckbox(option) {\n\t\tconst checkbox = option.querySelector('wje-checkbox[slot=\"check\"]');\n\t\tif (!checkbox) return;\n\n\t\tconst isSelected = option.hasAttribute('selected');\n\t\tcheckbox.checked = isSelected;\n\t\tif (isSelected) {\n\t\t\tcheckbox.setAttribute('checked', '');\n\t\t} else {\n\t\t\tcheckbox.removeAttribute('checked');\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,UAAN,MAAM,gBAAe,sBAAsB;AAAA,EAKjD,cAAc;AACb,UAAK;AANA;AAEN,sCAAgB,CAAA;AAChB,qCAAe,CAAA;AAmGf;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,IAClB;AA6SC,qCAAY;AA+YZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,CAAC,MAAM;AACrB,QAAE,eAAc;AAChB,QAAE,gBAAe;AACjB,QAAE,yBAAwB;AAE1B,UAAI,KAAK,YAAY,KAAK,SAAU;AAEpC,UAAI,aAAa,KAAK,cAAa;AAEnC,UAAI,CAAC,KAAK,aAAa,UAAU,GAAG;AACnC,mBAAW,QAAQ,CAAC,WAAW;AAC9B,cAAI,OAAO,UAAU,EAAE,OAAO,OAAO;AACpC,iBAAK,qBAAqB,MAAM;AAAA,UACjC,OAAO;AACN,mBAAO,WAAW;AAAA,UACnB;AAAA,QACD,CAAC;AACD,aAAK,MAAM,KAAK,KAAK;AAAA,MACtB,OAAO;AACN,aAAK,qBAAqB,EAAE,QAAQ,IAAI;AAAA,MACzC;AAEA,WAAK,WAAU;AAEf,WAAK,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SAAS,sBAAK,yCAAL;AAC1B;AAUA;AAgDA;AAeA,wBAAmB,SAAC,QAAQ;AAC3B,QAAM,WAAW,OAAO,cAAc,4BAA4B;AAClE,MAAI,CAAC,SAAU;AAEf,QAAM,aAAa,OAAO,aAAa,UAAU;AACjD,WAAS,UAAU;AACnB,MAAI,YAAY;AACf,aAAS,aAAa,WAAW,EAAE;AAAA,EACpC,OAAO;AACN,aAAS,gBAAgB,SAAS;AAAA,EACnC;AACD;AA9xCA,cADY,SACL,eAAc;AADf,IAAM,SAAN;ACVP,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.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|