wj-elements 0.1.138 → 0.1.139
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/light.css +3 -2
- package/dist/localize.js +6 -4
- package/dist/localize.js.map +1 -1
- package/dist/packages/bundle.d.ts +0 -0
- package/dist/packages/localize/localize.d.ts +1 -1
- package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +7 -5
- package/dist/packages/wje-tree/tree.element.d.ts +59 -3
- package/dist/packages/wje-tree-item/tree-item.element.d.ts +131 -24
- package/dist/wje-file-upload-item.js +6 -4
- package/dist/wje-file-upload-item.js.map +1 -1
- package/dist/wje-master.js +249 -24
- package/dist/wje-master.js.map +1 -1
- package/package.json +3 -2
package/dist/light.css
CHANGED
|
@@ -528,7 +528,8 @@
|
|
|
528
528
|
--wje-tooltip-spacing: var(--wje-spacing-x-small);
|
|
529
529
|
--wje-tooltip-border-radius: var(--wje-border-radius-medium);
|
|
530
530
|
|
|
531
|
-
/* Tree */
|
|
532
|
-
--wje-tree-item-indent:
|
|
531
|
+
/* Tree - Item */
|
|
532
|
+
--wje-tree-item-indent: var(--wje-spacing-large);
|
|
533
533
|
--wje-tree-item-indent-guid-width: 0px;
|
|
534
|
+
--wje-tree-item-border-radius: var(--wje-border-radius-medium);
|
|
534
535
|
}
|
package/dist/localize.js
CHANGED
|
@@ -3,6 +3,7 @@ class LocalizerDefault {
|
|
|
3
3
|
this.element = element;
|
|
4
4
|
this.lang = this.element.lang || document.documentElement.lang || "en-gb";
|
|
5
5
|
this.dir = this.element.dir || document.documentElement.dir || "ltr";
|
|
6
|
+
this.currentLang = "en-gb";
|
|
6
7
|
this.setLanguage();
|
|
7
8
|
}
|
|
8
9
|
get languages() {
|
|
@@ -10,7 +11,8 @@ class LocalizerDefault {
|
|
|
10
11
|
}
|
|
11
12
|
// Nastavenie aktuálneho jazyka
|
|
12
13
|
setLanguage() {
|
|
13
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
if ((_a = this.languages) == null ? void 0 : _a.has(this.lang)) {
|
|
14
16
|
this.currentLang = this.lang;
|
|
15
17
|
} else {
|
|
16
18
|
console.error(`Language "${this.lang}" not loaded.`);
|
|
@@ -18,9 +20,9 @@ class LocalizerDefault {
|
|
|
18
20
|
}
|
|
19
21
|
// Vyhľadávanie prekladu podľa kľúča
|
|
20
22
|
translate(key) {
|
|
21
|
-
|
|
22
|
-
const langMap = this.languages.get(this.currentLang);
|
|
23
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
const langMap = (_a = this.languages) == null ? void 0 : _a.get(this.currentLang);
|
|
25
|
+
if (!langMap) return key;
|
|
24
26
|
return langMap ? langMap[key] || key : key;
|
|
25
27
|
}
|
|
26
28
|
// Vyhľadávanie prekladu podľa kľúča a typu čísla
|
package/dist/localize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element.lang || document.documentElement.lang || 'en-gb';\n this.dir = this.element.dir || document.documentElement.dir || 'ltr';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages
|
|
1
|
+
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element.lang || document.documentElement.lang || 'en-gb';\n this.dir = this.element.dir || document.documentElement.dir || 'ltr';\n this.currentLang = 'en-gb';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n // Vyhľadávanie prekladu podľa kľúča\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n // Vyhľadávanie prekladu podľa kľúča a typu čísla\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.lang, { type: type });\n\n if (count !== undefined) key += '.' + plural.select(count);\n\n return this.translate(key);\n }\n\n // Formátovanie čísla podľa aktuálneho jazyka\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n // Formátovanie dátumu podľa aktuálneho jazyka\n formatDate(date) {\n return new Intl.DateTimeFormat(this.currentLang).format(new Date(date));\n }\n\n relativeTime(lang, value = 0, unit = 'day', options = { numeric: 'auto' }) {\n lang = lang || this.currentLang;\n return new Intl.RelativeTimeFormat(lang, options).format(value, unit);\n }\n}\n\nexport function registerTranslation(...translation) {\n translation.forEach((t) => {\n if (!t.code) {\n console.error(\"Translation object is missing 'code' property:\", t);\n return;\n }\n\n const code = t.code.toLowerCase();\n if (window.translations.has(code)) {\n window.translations.set(code, { ...window.translations.get(code), ...t });\n } else {\n window.translations.set(code, t);\n }\n });\n}\n","import { LocalizerDefault, registerTranslation } from '../localize/localize.js';\n\nexport class Localizer extends LocalizerDefault {\n constructor(element) {\n super(element);\n }\n static registerTranslation(...translation) {\n registerTranslation(...translation);\n }\n}\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB;AAAA,EAC1B,YAAY,SAAS;AACjB,SAAK,UAAU;AAEf,SAAK,OAAO,KAAK,QAAQ,QAAQ,SAAS,gBAAgB,QAAQ;AAClE,SAAK,MAAM,KAAK,QAAQ,OAAO,SAAS,gBAAgB,OAAO;AAC/D,SAAK,cAAc;AAEnB,SAAK,YAAa;AAAA,EAC1B;AAAA,EAEI,IAAI,YAAY;AACZ,WAAO,OAAO;AAAA,EACtB;AAAA;AAAA,EAGI,cAAc;AAlBlB;AAmBQ,SAAI,UAAK,cAAL,mBAAgB,IAAI,KAAK,OAAO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CAAE;AAAA,IACpF,OAAe;AACH,aAAO,aAAa,IAAI,MAAM,CAAC;AAAA,IAC3C;AAAA,EACA,CAAK;AACL;ACtEO,MAAM,kBAAkB,iBAAiB;AAAA,EAC5C,YAAY,SAAS;AACjB,UAAM,OAAO;AAAA,EACrB;AAAA,EACI,OAAO,uBAAuB,aAAa;AACvC,wBAAoB,GAAG,WAAW;AAAA,EAC1C;AACA;"}
|
|
File without changes
|
|
@@ -4,9 +4,9 @@ export class LocalizerDefault {
|
|
|
4
4
|
element: any;
|
|
5
5
|
lang: any;
|
|
6
6
|
dir: any;
|
|
7
|
+
currentLang: string;
|
|
7
8
|
get languages(): any;
|
|
8
9
|
setLanguage(): void;
|
|
9
|
-
currentLang: any;
|
|
10
10
|
translate(key: any): any;
|
|
11
11
|
translatePlural(key: any, count?: number, type?: string): any;
|
|
12
12
|
formatNumber(number: any, options: any): string;
|
|
@@ -39,12 +39,14 @@ export default class FileUploadItem extends WJElement {
|
|
|
39
39
|
*/
|
|
40
40
|
dependencies: object;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param {string}
|
|
45
|
-
* @param {string}
|
|
42
|
+
* Handles updates to the attributes of a custom element whenever one of the observed attributes is changed.
|
|
43
|
+
* Updates the related elements based on the changed attribute and its new value.
|
|
44
|
+
* @param {string} name The name of the attribute being changed.
|
|
45
|
+
* @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set.
|
|
46
|
+
* @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed.
|
|
47
|
+
* @returns {void} Does not return a value.
|
|
46
48
|
*/
|
|
47
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
49
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
48
50
|
/**
|
|
49
51
|
* Method to draw the component on the screen.
|
|
50
52
|
* @returns {DocumentFragment} The fragment containing the component.
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { default as WJElement } from '../wje-element/element.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* `Tree` is a custom web component that represents a hierarchical tree structure.
|
|
4
|
+
* It extends from `WJElement`.
|
|
5
|
+
* @summary This element visually represents a tree structure, supporting single or multiple selection modes and hierarchy management.
|
|
6
|
+
* @documentation https://elements.webjet.sk/components/tree
|
|
7
|
+
* @status stable
|
|
8
|
+
* @augments {WJElement}
|
|
9
|
+
* @csspart native - The native container part of the tree.
|
|
10
|
+
* @slot - The default slot to place `wje-tree-item` child components.
|
|
11
|
+
* @tag wje-tree
|
|
5
12
|
*/
|
|
6
13
|
export default class Tree extends WJElement {
|
|
7
14
|
/**
|
|
@@ -10,9 +17,24 @@ export default class Tree extends WJElement {
|
|
|
10
17
|
* @returns {CSSStyleSheet} The CSS stylesheet
|
|
11
18
|
*/
|
|
12
19
|
static get cssStyleSheet(): CSSStyleSheet;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the selection attribute for the element.
|
|
22
|
+
* @param {string} value The value to set as the selection attribute.
|
|
23
|
+
*/
|
|
13
24
|
set selection(value: string);
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current selection mode for the element.
|
|
27
|
+
* If no selection is explicitly set, it defaults to 'single'.
|
|
28
|
+
* @returns {string} The current selection mode, either set by the element's attribute or the default value 'single'.
|
|
29
|
+
*/
|
|
14
30
|
get selection(): string;
|
|
15
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A method called before the drawing or rendering process of tree items.
|
|
33
|
+
* It iterates through all `wje-tree-item` elements, updating their selection state
|
|
34
|
+
* and managing their expand/collapse icons accordingly.
|
|
35
|
+
* @returns {void} This method does not return a value.
|
|
36
|
+
*/
|
|
37
|
+
beforeDraw(): void;
|
|
16
38
|
/**
|
|
17
39
|
* Draw method for the toast notification.
|
|
18
40
|
* @returns {object} Document fragment
|
|
@@ -45,4 +67,38 @@ export default class Tree extends WJElement {
|
|
|
45
67
|
* @returns {void} This method does not return a value. If the icon matching the given status is not found, a warning is logged.
|
|
46
68
|
*/
|
|
47
69
|
getExpandCollapseIcon(item: HTMLElement, status: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Updates the state of a checkbox, syncing the state both upwards to parent elements
|
|
72
|
+
* and downwards to child elements as necessary.
|
|
73
|
+
* @param {object} changedItem The specific item whose checkbox state has changed.
|
|
74
|
+
* @param {boolean} [isInitialSync] Indicates whether the state update is part of the initial synchronization process.
|
|
75
|
+
* @returns {void} This method does not return a value.
|
|
76
|
+
*/
|
|
77
|
+
updateCheckboxState(changedItem: object, isInitialSync?: boolean): void;
|
|
78
|
+
isInitialSync: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Updates the state of the parent item based on the state of its child items.
|
|
81
|
+
* Recursively propagates changes up to all parent items to reflect the selection
|
|
82
|
+
* or indeterminate state accurately.
|
|
83
|
+
* @param {object} item The current tree item whose parent state needs to be updated.
|
|
84
|
+
* It is expected to have properties `selected`, `indeterminate`,
|
|
85
|
+
* and a method `getChildrenItems({ includeDisabled: boolean })`.
|
|
86
|
+
* @returns {void} This method does not return a value.
|
|
87
|
+
*/
|
|
88
|
+
updateParentState(item: object): void;
|
|
89
|
+
/**
|
|
90
|
+
* Propagates the state changes of an item upwards through its ancestors in the hierarchy.
|
|
91
|
+
* Calls the `updateParentState` method for each parent element until no parent exists.
|
|
92
|
+
* @param {HTMLElement} item The current item whose state to propagate to its parent.
|
|
93
|
+
* @returns {void} This method does not return a value.
|
|
94
|
+
*/
|
|
95
|
+
propagateStateUpwards(item: HTMLElement): void;
|
|
96
|
+
/**
|
|
97
|
+
* Propagates the selected state of an item to its children recursively. Depending on the `isInitialSync` flag,
|
|
98
|
+
* it also determines how the state should be applied to the child items and updates the parent state if needed.
|
|
99
|
+
* @param {object} item The item whose state is being propagated to its child items. The item must have properties
|
|
100
|
+
* such as `selected` and methods like `getChildrenItems` to retrieve its child elements.
|
|
101
|
+
* @returns {void} This method does not return a value.
|
|
102
|
+
*/
|
|
103
|
+
propagateStateDownwards(item: object): void;
|
|
48
104
|
}
|
|
@@ -1,48 +1,155 @@
|
|
|
1
|
-
import { default as WJElement } from '../wje-element/element.js';
|
|
2
1
|
/**
|
|
3
|
-
* `
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
2
|
+
* `wje-tree-item` is a custom web component used as a child of the `wje-tree`.
|
|
3
|
+
* It represents a node within a tree structure, capable of nesting other items.
|
|
4
|
+
* @summary Represents a single item in a tree structure.
|
|
5
|
+
* @documentation https://elements.webjet.sk/components/tree-item
|
|
6
6
|
* @status stable
|
|
7
|
-
* @augments {
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @cssproperty
|
|
11
|
-
* @cssproperty
|
|
12
|
-
* @cssproperty
|
|
13
|
-
* @
|
|
14
|
-
* @cssproperty {boolean} countdown - Indicates whether a countdown is displayed in the toast. When `true`, a visual countdown timer is shown to indicate the remaining time before the toast closes.
|
|
15
|
-
* @slot - The content of the toast.
|
|
16
|
-
* @slot media - The media of the toast.
|
|
17
|
-
* // @fires wje-toast:after-show - Fired after the toast is shown.
|
|
18
|
-
* // @fires wje-toast:after-hide - Fired after the toast is hidden.
|
|
7
|
+
* @augments {HTMLElement}
|
|
8
|
+
* @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).
|
|
9
|
+
* @csspart native - The native container of the tree item.
|
|
10
|
+
* @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.
|
|
11
|
+
* @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.
|
|
12
|
+
* @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item’s container.
|
|
13
|
+
* @tag wje-tree-item
|
|
19
14
|
*/
|
|
20
|
-
export default class TreeItem extends
|
|
15
|
+
export default class TreeItem extends HTMLElement {
|
|
21
16
|
/**
|
|
22
17
|
* Returns the CSS stylesheet for the component.
|
|
23
18
|
* @static
|
|
24
19
|
* @returns {CSSStyleSheet} The CSS stylesheet
|
|
25
20
|
*/
|
|
26
21
|
static get cssStyleSheet(): CSSStyleSheet;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the list of attributes to observe for changes.
|
|
24
|
+
* @static
|
|
25
|
+
* @returns {Array<string>}
|
|
26
|
+
*/
|
|
27
|
+
static get observedAttributes(): Array<string>;
|
|
27
28
|
_selection: string;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the expanded state of the element. When set to a truthy value,
|
|
31
|
+
* the 'expanded' attribute will be added to the element. When set to a falsy
|
|
32
|
+
* value, the 'expanded' attribute will be removed.
|
|
33
|
+
* @param {boolean} value A boolean value indicating whether the
|
|
34
|
+
* element should be expanded (true) or collapsed (false).
|
|
35
|
+
*/
|
|
36
|
+
set expanded(value: boolean);
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves the value of the 'expanded' state for the current element.
|
|
39
|
+
* This getter checks whether the 'expanded' attribute is present on the element.
|
|
40
|
+
* If the attribute exists, it returns true, representing that the element is expanded.
|
|
41
|
+
* Otherwise, it returns false, indicating that the element is not expanded.
|
|
42
|
+
* @returns {boolean} True if the 'expanded' attribute is present, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
get expanded(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.
|
|
47
|
+
* @param {boolean} value The value indicating whether the element should have the 'selected' attribute.
|
|
48
|
+
*/
|
|
28
49
|
set selected(value: boolean);
|
|
50
|
+
/**
|
|
51
|
+
* Getter method for determining if the 'selected' attribute is present on the element.
|
|
52
|
+
* @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.
|
|
53
|
+
*/
|
|
29
54
|
get selected(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Sets the selection mode for the component.
|
|
57
|
+
* @param {string} value The selection mode to apply. Defaults to 'single'
|
|
58
|
+
* if no value is provided. Possible options may be
|
|
59
|
+
* specific to the implementation of the component
|
|
60
|
+
* (e.g., 'single', 'multiple').
|
|
61
|
+
*/
|
|
30
62
|
set selection(value: string);
|
|
31
|
-
get selection(): string;
|
|
32
|
-
beforeDraw(context: any, appStoreObj: any, params: any): void;
|
|
33
63
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @returns {
|
|
64
|
+
* Retrieves the current selection.
|
|
65
|
+
* @returns {*} The value of the current selection.
|
|
66
|
+
*/
|
|
67
|
+
get selection(): any;
|
|
68
|
+
/**
|
|
69
|
+
* Sets or removes the 'indeterminate' attribute based on the provided value.
|
|
70
|
+
* This can be used to visually indicate an indeterminate state for elements like checkboxes.
|
|
71
|
+
* @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.
|
|
72
|
+
* If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.
|
|
73
|
+
*/
|
|
74
|
+
set indeterminate(value: boolean);
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the state of the indeterminate attribute.
|
|
77
|
+
* @returns {boolean} True if the indeterminate attribute is present, otherwise false.
|
|
78
|
+
*/
|
|
79
|
+
get indeterminate(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Setup attributes for the Button element.
|
|
36
82
|
*/
|
|
37
|
-
|
|
83
|
+
setupAttributes(): void;
|
|
84
|
+
isShadowRoot: string;
|
|
85
|
+
/**
|
|
86
|
+
* Handles updates when observed attributes of the element are changed.
|
|
87
|
+
* Updates the checkbox state based on changes to the "selected" or "indeterminate" attributes.
|
|
88
|
+
* @param {string} name The name of the attribute that was changed.
|
|
89
|
+
* @param {string|null} oldValue The previous value of the attribute before the change.
|
|
90
|
+
* @param {string|null} newValue The new value of the attribute after the change.
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
94
|
+
/**
|
|
95
|
+
* Custom logic executed before the draw process begins.
|
|
96
|
+
* Determines and sets the appropriate slot if the current item is nested.
|
|
97
|
+
* @returns {void} No return value.
|
|
98
|
+
*/
|
|
99
|
+
beforeDraw(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Creates and returns a document fragment representing the structure of a tree item component.
|
|
102
|
+
* The method constructs the DOM elements including the native container, indentation, toggle button,
|
|
103
|
+
* selection checkbox, label, and children container, along with their respective slots and attributes.
|
|
104
|
+
* It dynamically handles the creation of expand and collapse icons, as well as appending slots for
|
|
105
|
+
* child components.
|
|
106
|
+
* @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.
|
|
107
|
+
*/
|
|
108
|
+
draw(): DocumentFragment;
|
|
38
109
|
checkbox: HTMLElement;
|
|
39
110
|
native: HTMLDivElement;
|
|
40
111
|
button: HTMLDivElement;
|
|
41
112
|
childrenElement: HTMLDivElement;
|
|
42
113
|
childrenSlot: HTMLSlotElement;
|
|
114
|
+
/**
|
|
115
|
+
* Executes operations to be performed after the draw action is completed.
|
|
116
|
+
* If the state indicates it is expanded, toggles its children.
|
|
117
|
+
* Additionally, sets up an event listener on the button element to handle toggling children upon click.
|
|
118
|
+
* @returns {void} Does not return a value.
|
|
119
|
+
*/
|
|
43
120
|
afterDraw(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Determines if the current item is a nested item within a tree structure.
|
|
123
|
+
* Checks if the item's parent element exists and is also a tree item.
|
|
124
|
+
* @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.
|
|
125
|
+
*/
|
|
44
126
|
isNestedItem(): boolean;
|
|
45
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Checks whether the given node is a tree item.
|
|
129
|
+
* @param {object} node The node to check.
|
|
130
|
+
* @returns {boolean} Returns true if the node is an Element and has a class name of 'TreeItem', otherwise false.
|
|
131
|
+
*/
|
|
132
|
+
isTreeItem(node: object): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Toggles the visibility state of the children element and updates the class of the parent element.
|
|
135
|
+
* The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,
|
|
136
|
+
* effectively showing or hiding the children and indicating the expanded state.
|
|
137
|
+
* @returns {void} Does not return a value.
|
|
138
|
+
*/
|
|
46
139
|
toggleChildren(): void;
|
|
47
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Retrieves the child items from the `childrenSlot` that match specific criteria.
|
|
142
|
+
* @param {object} [options] Configuration options.
|
|
143
|
+
* @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.
|
|
144
|
+
* @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.
|
|
145
|
+
*/
|
|
146
|
+
getChildrenItems(options?: {
|
|
147
|
+
includeDisabled?: boolean;
|
|
148
|
+
}): any[];
|
|
149
|
+
/**
|
|
150
|
+
* Retrieves all descendant children of the current object in a flattened array structure.
|
|
151
|
+
* @param {object} [options] An optional object specifying filters or configurations for retrieving children.
|
|
152
|
+
* @returns {Array} An array containing all children and their descendants in a flat structure.
|
|
153
|
+
*/
|
|
154
|
+
getAllChildrenFlat(options?: object): any[];
|
|
48
155
|
}
|
|
@@ -57,10 +57,12 @@ class FileUploadItem extends WJElement {
|
|
|
57
57
|
return ["uploaded"];
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @param {string}
|
|
63
|
-
* @param {string}
|
|
60
|
+
* Handles updates to the attributes of a custom element whenever one of the observed attributes is changed.
|
|
61
|
+
* Updates the related elements based on the changed attribute and its new value.
|
|
62
|
+
* @param {string} name The name of the attribute being changed.
|
|
63
|
+
* @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set.
|
|
64
|
+
* @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed.
|
|
65
|
+
* @returns {void} Does not return a value.
|
|
64
66
|
*/
|
|
65
67
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
66
68
|
if (name === "uploaded" && oldValue !== newValue && this.uploadedEl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-file-upload-item.js","sources":["../packages/wje-file-upload-item/file-upload-item.element.js","../packages/wje-file-upload-item/file-upload-item.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\nimport Button from '../wje-button/button.js';\nimport { default as WJElement } from '../wje-element/element.js';\nimport FormatDigital from '../wje-format-digital/format-digital.js';\nimport Icon from '../wje-icon/icon.js';\nimport Slider from '../wje-slider/slider.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This element allows users to upload files.\n * `FileUploadItem` is a custom web component that represents a file upload item.\n * It extends from `WJElement` and uses the `Localizer` utility for localization.\n * @documentation https://elements.webjet.sk/components/file-upload\n * @status stable\n * @augments WJElement\n * @csspart button - The delete button part\n * @csspart image - The image part\n * @csspart name - The name part\n * @csspart size - The size part\n * @slot img - Slot for the image\n * @slot action - Slot for the action buttons\n * @cssproperty --primary-color - The primary color of the file upload item.\n * //@fires wje-button:click - Dispatches when the delete button is clicked\n * @tag wje-file-upload\n */\nexport default class FileUploadItem extends WJElement {\n /**\n * Creates an instance of FileUploadItem.\n * @class\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n }\n\n set size(value) {\n this.setAttribute('size', value);\n }\n\n get size() {\n return this.getAttribute('size');\n }\n\n /**\n * Dependencies for the component.\n * @type {object}\n */\n dependencies = {\n 'wje-format-digital': FormatDigital,\n 'wje-button': Button,\n 'wje-slider': Slider,\n 'wje-icon': Icon,\n };\n\n className = 'FileUploadItem';\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 * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['uploaded'];\n }\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"wje-file-upload-item.js","sources":["../packages/wje-file-upload-item/file-upload-item.element.js","../packages/wje-file-upload-item/file-upload-item.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\nimport Button from '../wje-button/button.js';\nimport { default as WJElement } from '../wje-element/element.js';\nimport FormatDigital from '../wje-format-digital/format-digital.js';\nimport Icon from '../wje-icon/icon.js';\nimport Slider from '../wje-slider/slider.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This element allows users to upload files.\n * `FileUploadItem` is a custom web component that represents a file upload item.\n * It extends from `WJElement` and uses the `Localizer` utility for localization.\n * @documentation https://elements.webjet.sk/components/file-upload\n * @status stable\n * @augments WJElement\n * @csspart button - The delete button part\n * @csspart image - The image part\n * @csspart name - The name part\n * @csspart size - The size part\n * @slot img - Slot for the image\n * @slot action - Slot for the action buttons\n * @cssproperty --primary-color - The primary color of the file upload item.\n * //@fires wje-button:click - Dispatches when the delete button is clicked\n * @tag wje-file-upload\n */\nexport default class FileUploadItem extends WJElement {\n /**\n * Creates an instance of FileUploadItem.\n * @class\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n }\n\n set size(value) {\n this.setAttribute('size', value);\n }\n\n get size() {\n return this.getAttribute('size');\n }\n\n /**\n * Dependencies for the component.\n * @type {object}\n */\n dependencies = {\n 'wje-format-digital': FormatDigital,\n 'wje-button': Button,\n 'wje-slider': Slider,\n 'wje-icon': Icon,\n };\n\n className = 'FileUploadItem';\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 * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['uploaded'];\n }\n\n /**\n * Handles updates to the attributes of a custom element whenever one of the observed attributes is changed.\n * Updates the related elements based on the changed attribute and its new value.\n * @param {string} name The name of the attribute being changed.\n * @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set.\n * @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed.\n * @returns {void} Does not return a value.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'uploaded' && oldValue !== newValue && this.uploadedEl) {\n this.uploadedEl.setAttribute('value', newValue);\n\n let progress = ((+newValue / +this.size) * 100) || 0;\n\n this.sliderEl.setAttribute(\"progress\", Math.round(progress, 0));\n }\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\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-item');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'img');\n\n let image = document.createElement('div');\n image.setAttribute('part', 'image');\n image.classList.add('image');\n\n let name = document.createElement('span');\n name.classList.add('name');\n name.innerText = this.name;\n\n let actions = document.createElement('slot');\n actions.classList.add('actions');\n actions.setAttribute('name', 'action');\n\n let button = document.createElement('wje-button');\n button.setAttribute('fill', 'link');\n button.setAttribute('size', 'small');\n button.innerHTML = `<wje-icon name=\"x\" size=\"small\"></wje-icon>`;\n\n let sizeWrapper = document.createElement('span');\n sizeWrapper.classList.add('size');\n\n let uploaded = document.createElement('wje-format-digital');\n uploaded.setAttribute('value', this.uploaded || 0);\n uploaded.innerHTML = `<span slot=\"start\">${this.localizer.translate('wj.file.upload.uploaded')}</span>`;\n\n let size = document.createElement('wje-format-digital');\n size.setAttribute('value', this.size || 0);\n size.innerHTML = `<span slot=\"start\"> ${this.localizer.translate('wj.file.upload.from')} </span>`;\n\n let slider = document.createElement('wje-progress-bar');\n slider.classList.add('file-progress');\n slider.setAttribute('id', 'id-' + this.lastModified);\n slider.setAttribute('progress', this.progress);\n slider.setAttribute('color', 'success');\n\n image.appendChild(slot);\n actions.appendChild(button);\n\n sizeWrapper.appendChild(uploaded);\n sizeWrapper.appendChild(size);\n\n native.appendChild(image);\n native.appendChild(name);\n native.appendChild(sizeWrapper);\n native.appendChild(actions);\n native.appendChild(slider);\n\n fragment.appendChild(native);\n\n this.button = button;\n this.uploadedEl = uploaded;\n this.sliderEl = slider;\n\n return fragment;\n }\n\n /**\n * Called after the component has been drawn.\n */\n afterDraw() {\n this.button.addEventListener('wje-button:click', this.onDelete);\n }\n\n /**\n * Handles the delete action.\n */\n onDelete = () => {\n this.remove();\n };\n}\n","import FileUploadItem from './file-upload-item.element.js';\n\nexport default FileUploadItem;\n\nFileUploadItem.define('wje-file-upload-item', FileUploadItem);\n"],"names":[],"mappings":";;;;;;;;;;AAyBe,MAAM,uBAAuB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlD,cAAc;AACV,UAAO;AAgBX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,sBAAsB;AAAA,MACtB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,YAAY;AAAA,IACf;AAED,qCAAY;AA2HZ;AAAA;AAAA;AAAA,oCAAW,MAAM;AACb,WAAK,OAAQ;AAAA,IAChB;AAnJG,SAAK,YAAY,IAAI,UAAU,IAAI;AAAA,EAC3C;AAAA,EAEI,IAAI,KAAK,OAAO;AACZ,SAAK,aAAa,QAAQ,KAAK;AAAA,EACvC;AAAA,EAEI,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAC,UAAU;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,yBAAyB,MAAM,UAAU,UAAU;AAC/C,QAAI,SAAS,cAAc,aAAa,YAAY,KAAK,YAAY;AACjE,WAAK,WAAW,aAAa,SAAS,QAAQ;AAE9C,UAAI,WAAa,CAAC,WAAW,CAAC,KAAK,OAAQ,OAAQ;AAEnD,WAAK,SAAS,aAAa,YAAY,KAAK,MAAM,UAAU,CAAC,CAAC;AAAA,IAC1E;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA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Y,IAAI;AAE5B,WAAO,YAAY,KAAK;AACxB,WAAO,YAAY,IAAI;AACvB,WAAO,YAAY,WAAW;AAC9B,WAAO,YAAY,OAAO;AAC1B,WAAO,YAAY,MAAM;AAEzB,aAAS,YAAY,MAAM;AAE3B,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,WAAW;AAEhB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,OAAO,iBAAiB,oBAAoB,KAAK,QAAQ;AAAA,EACtE;AAQA;AChLA,eAAe,OAAO,wBAAwB,cAAc;"}
|
package/dist/wje-master.js
CHANGED
|
@@ -266,7 +266,7 @@ class TimelineItem extends WJElement {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
TimelineItem.define("wje-timeline-item", TimelineItem);
|
|
269
|
-
const styles$1 = "/*\n[ WJ Tree ]\n*/\n\n:host {\n position: relative;\n
|
|
269
|
+
const styles$1 = "/*\n[ WJ Tree ]\n*/\n\n:host {\n position: relative;\n width: 100%;\n font-size: 0;\n}\n";
|
|
270
270
|
class Tree extends WJElement {
|
|
271
271
|
/**
|
|
272
272
|
* Creates an instance of Toast.
|
|
@@ -287,7 +287,12 @@ class Tree extends WJElement {
|
|
|
287
287
|
*/
|
|
288
288
|
__publicField(this, "handleClick", (e) => {
|
|
289
289
|
let selectedItem = e.target.closest("wje-tree-item");
|
|
290
|
-
|
|
290
|
+
let isClickButton = e.composedPath().some((el) => {
|
|
291
|
+
var _a;
|
|
292
|
+
return (_a = el == null ? void 0 : el.classList) == null ? void 0 : _a.contains("toggle");
|
|
293
|
+
});
|
|
294
|
+
if (isClickButton)
|
|
295
|
+
return;
|
|
291
296
|
if (this.selection === "single") {
|
|
292
297
|
if (selectedItem) {
|
|
293
298
|
for (let item of this.getAllItems()) {
|
|
@@ -295,20 +300,25 @@ class Tree extends WJElement {
|
|
|
295
300
|
}
|
|
296
301
|
}
|
|
297
302
|
} else if (this.selection === "multiple") {
|
|
298
|
-
let childrens = selectedItem.getChildrenItems();
|
|
299
303
|
selectedItem.selected = !selectedItem.selected;
|
|
300
|
-
|
|
301
|
-
item.selected = !item.selected;
|
|
302
|
-
}
|
|
303
|
-
console.log("multiple selection", childrens);
|
|
304
|
+
this.updateCheckboxState(selectedItem);
|
|
304
305
|
}
|
|
305
306
|
});
|
|
306
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Sets the selection attribute for the element.
|
|
310
|
+
* @param {string} value The value to set as the selection attribute.
|
|
311
|
+
*/
|
|
307
312
|
set selection(value) {
|
|
308
|
-
this.setAttribute("selection", value
|
|
313
|
+
this.setAttribute("selection", value);
|
|
309
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Gets the current selection mode for the element.
|
|
317
|
+
* If no selection is explicitly set, it defaults to 'single'.
|
|
318
|
+
* @returns {string} The current selection mode, either set by the element's attribute or the default value 'single'.
|
|
319
|
+
*/
|
|
310
320
|
get selection() {
|
|
311
|
-
return this.getAttribute("selection");
|
|
321
|
+
return this.getAttribute("selection") || "single";
|
|
312
322
|
}
|
|
313
323
|
/**
|
|
314
324
|
* Returns the CSS stylesheet for the component.
|
|
@@ -324,7 +334,13 @@ class Tree extends WJElement {
|
|
|
324
334
|
setupAttributes() {
|
|
325
335
|
this.isShadowRoot = "open";
|
|
326
336
|
}
|
|
327
|
-
|
|
337
|
+
/**
|
|
338
|
+
* A method called before the drawing or rendering process of tree items.
|
|
339
|
+
* It iterates through all `wje-tree-item` elements, updating their selection state
|
|
340
|
+
* and managing their expand/collapse icons accordingly.
|
|
341
|
+
* @returns {void} This method does not return a value.
|
|
342
|
+
*/
|
|
343
|
+
beforeDraw() {
|
|
328
344
|
const items = this.querySelectorAll("wje-tree-item");
|
|
329
345
|
items == null ? void 0 : items.forEach((item) => {
|
|
330
346
|
item.selection = this.selection;
|
|
@@ -377,9 +393,78 @@ class Tree extends WJElement {
|
|
|
377
393
|
let iconClone = icon.cloneNode(true);
|
|
378
394
|
item.appendChild(iconClone);
|
|
379
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Updates the state of a checkbox, syncing the state both upwards to parent elements
|
|
398
|
+
* and downwards to child elements as necessary.
|
|
399
|
+
* @param {object} changedItem The specific item whose checkbox state has changed.
|
|
400
|
+
* @param {boolean} [isInitialSync] Indicates whether the state update is part of the initial synchronization process.
|
|
401
|
+
* @returns {void} This method does not return a value.
|
|
402
|
+
*/
|
|
403
|
+
updateCheckboxState(changedItem, isInitialSync = false) {
|
|
404
|
+
this.isInitialSync = isInitialSync;
|
|
405
|
+
this.propagateStateDownwards(changedItem);
|
|
406
|
+
this.propagateStateUpwards(changedItem);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Updates the state of the parent item based on the state of its child items.
|
|
410
|
+
* Recursively propagates changes up to all parent items to reflect the selection
|
|
411
|
+
* or indeterminate state accurately.
|
|
412
|
+
* @param {object} item The current tree item whose parent state needs to be updated.
|
|
413
|
+
* It is expected to have properties `selected`, `indeterminate`,
|
|
414
|
+
* and a method `getChildrenItems({ includeDisabled: boolean })`.
|
|
415
|
+
* @returns {void} This method does not return a value.
|
|
416
|
+
*/
|
|
417
|
+
updateParentState(item) {
|
|
418
|
+
var _a;
|
|
419
|
+
const children = item.getChildrenItems({ includeDisabled: false });
|
|
420
|
+
if (children.length) {
|
|
421
|
+
const areAllChildrenChecked = children.every((child) => child.selected);
|
|
422
|
+
const areSomeChildrenChecked = children.some((child) => child.selected);
|
|
423
|
+
const areSomeChildrenIndeterminate = children.some((child) => child.indeterminate);
|
|
424
|
+
item.selected = areAllChildrenChecked;
|
|
425
|
+
item.indeterminate = areSomeChildrenIndeterminate || areSomeChildrenChecked && !areAllChildrenChecked;
|
|
426
|
+
} else {
|
|
427
|
+
item.indeterminate = false;
|
|
428
|
+
}
|
|
429
|
+
const parent = (_a = item.parentElement) == null ? void 0 : _a.closest("wje-tree-item");
|
|
430
|
+
if (parent) {
|
|
431
|
+
this.updateParentState(parent);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Propagates the state changes of an item upwards through its ancestors in the hierarchy.
|
|
436
|
+
* Calls the `updateParentState` method for each parent element until no parent exists.
|
|
437
|
+
* @param {HTMLElement} item The current item whose state to propagate to its parent.
|
|
438
|
+
* @returns {void} This method does not return a value.
|
|
439
|
+
*/
|
|
440
|
+
propagateStateUpwards(item) {
|
|
441
|
+
var _a;
|
|
442
|
+
const parent = (_a = item.parentElement) == null ? void 0 : _a.closest("wje-tree-item");
|
|
443
|
+
if (parent) {
|
|
444
|
+
this.updateParentState(parent);
|
|
445
|
+
this.propagateStateUpwards(parent);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Propagates the selected state of an item to its children recursively. Depending on the `isInitialSync` flag,
|
|
450
|
+
* it also determines how the state should be applied to the child items and updates the parent state if needed.
|
|
451
|
+
* @param {object} item The item whose state is being propagated to its child items. The item must have properties
|
|
452
|
+
* such as `selected` and methods like `getChildrenItems` to retrieve its child elements.
|
|
453
|
+
* @returns {void} This method does not return a value.
|
|
454
|
+
*/
|
|
455
|
+
propagateStateDownwards(item) {
|
|
456
|
+
const isChecked = item.selected;
|
|
457
|
+
item.getChildrenItems().forEach((child) => {
|
|
458
|
+
child.selected = this.isInitialSync ? isChecked || child.selected : !child.disabled && isChecked;
|
|
459
|
+
this.propagateStateDownwards(child);
|
|
460
|
+
});
|
|
461
|
+
if (this.isInitialSync) {
|
|
462
|
+
this.updateParentState(item);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
380
465
|
}
|
|
381
466
|
Tree.define("wje-tree", Tree);
|
|
382
|
-
const styles = '/*\n[ WJ Tree Item ]\n*/\n\n:host {\n .native-tree-item {\n position: relative;\n display: flex;\n align-items: stretch;\n flex-direction: column;\n\n .item {\n display: flex;\n align-items: center;\n .toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n width: var(--wje-tree-item-indent);\n height: var(--wje-tree-item-indent);\n flex-shrink: 0;\n }\n wje-checkbox {\n margin: 0;\n }\n slot {\n display: flex;\n align-items: center;\n }\n slot:not([name])::slotted(wje-icon) {\n margin-right: var(--wje-spacing-2x-small);\n }\n }\n .children {\n
|
|
467
|
+
const styles = '/*\n[ WJ Tree Item ]\n*/\n\n:host {\n .native-tree-item {\n position: relative;\n display: flex;\n align-items: stretch;\n flex-direction: column;\n &.multiple {\n .item {\n border-radius: 0 !important;\n }\n }\n .item {\n display: flex;\n align-items: center;\n\n /*--toggle-width: var(--wje-tree-item-indent);*/\n /*--spacer-col: var(--wje-tree-item-indent);*/\n\n /*display: grid;*/\n /*grid-template-columns: var(--spacer-col) var(--wje-tree-item-indent) 1fr;*/\n /*grid-template-areas: "indent toggle content";*/\n\n padding-inline: var(--wje-spacing-3x-small);\n padding-block: var(--wje-spacing-3x-small);\n border-radius: var(--wje-tree-item-border-radius);\n /*padding-left: var(--wje-tree-item-indent);*/\n &:hover {\n background-color: var(--wje-color-contrast-1);\n }\n .indent {\n /*grid-area: indent;*/\n display: block;\n /*width: var(--wje-tree-item-indent);*/\n width: 1em;\n }\n .toggle {\n font-size: var(--wje-font-size-medium);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n width: var(--wje-tree-item-indent);\n height: var(--wje-tree-item-indent);\n flex-shrink: 0;\n /*grid-area: toggle;*/\n }\n wje-checkbox {\n font-size: var(--wje-font-size-medium);\n margin: 0;\n }\n .content {\n font-size: var(--wje-font-size-medium);\n grid-area: content;\n }\n slot {\n display: flex;\n align-items: center;\n }\n slot:not([name])::slotted(wje-icon) {\n margin-right: var(--wje-spacing-2x-small);\n }\n }\n .children {\n font-size: calc(1em + var(--wje-tree-item-indent, var(--wje-spacing-medium)));\n display: none;\n &.open {\n display: block;\n\n ::before {\n content: "";\n position: absolute;\n top: var(--wje-tree-item-indent);\n bottom: 5px;\n left: calc(1em - (var(--wje-spacing-3x-small) * 2) - (var(--wje-tree-item-indent-guid-width) / 2));\n border-inline-end: var(--wje-tree-item-indent-guid-width) solid var(--wje-border-color);\n z-index: 1;\n }\n }\n }\n }\n\n .native-tree-item.expanded .item slot[name="expand"], .native-tree-item:not(.expanded) slot[name="collapse"] {\n display: none;\n }\n}\n\n:host([selected]) {\n .item {\n background-color: var(--wje-color-contrast-2);\n }\n}';
|
|
383
468
|
class TreeItem extends WJElement {
|
|
384
469
|
/**
|
|
385
470
|
* Creates an instance of Toast.
|
|
@@ -393,20 +478,81 @@ class TreeItem extends WJElement {
|
|
|
393
478
|
__publicField(this, "className", "TreeItem");
|
|
394
479
|
this._selection = "single";
|
|
395
480
|
}
|
|
481
|
+
/**
|
|
482
|
+
* Sets the expanded state of the element. When set to a truthy value,
|
|
483
|
+
* the 'expanded' attribute will be added to the element. When set to a falsy
|
|
484
|
+
* value, the 'expanded' attribute will be removed.
|
|
485
|
+
* @param {boolean} value A boolean value indicating whether the
|
|
486
|
+
* element should be expanded (true) or collapsed (false).
|
|
487
|
+
*/
|
|
488
|
+
set expanded(value) {
|
|
489
|
+
if (value) {
|
|
490
|
+
this.setAttribute("expanded", "");
|
|
491
|
+
} else {
|
|
492
|
+
this.removeAttribute("expanded");
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Retrieves the value of the 'expanded' state for the current element.
|
|
497
|
+
* This getter checks whether the 'expanded' attribute is present on the element.
|
|
498
|
+
* If the attribute exists, it returns true, representing that the element is expanded.
|
|
499
|
+
* Otherwise, it returns false, indicating that the element is not expanded.
|
|
500
|
+
* @returns {boolean} True if the 'expanded' attribute is present, false otherwise.
|
|
501
|
+
*/
|
|
502
|
+
get expanded() {
|
|
503
|
+
return this.hasAttribute("expanded");
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.
|
|
507
|
+
* @param {boolean} value The value indicating whether the element should have the 'selected' attribute.
|
|
508
|
+
*/
|
|
396
509
|
set selected(value) {
|
|
397
510
|
this.removeAttribute("selected");
|
|
398
511
|
if (value)
|
|
399
512
|
this.setAttribute("selected", "");
|
|
400
513
|
}
|
|
514
|
+
/**
|
|
515
|
+
* Getter method for determining if the 'selected' attribute is present on the element.
|
|
516
|
+
* @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.
|
|
517
|
+
*/
|
|
401
518
|
get selected() {
|
|
402
519
|
return this.hasAttribute("selected");
|
|
403
520
|
}
|
|
521
|
+
/**
|
|
522
|
+
* Sets the selection mode for the component.
|
|
523
|
+
* @param {string} value The selection mode to apply. Defaults to 'single'
|
|
524
|
+
* if no value is provided. Possible options may be
|
|
525
|
+
* specific to the implementation of the component
|
|
526
|
+
* (e.g., 'single', 'multiple').
|
|
527
|
+
*/
|
|
404
528
|
set selection(value) {
|
|
405
529
|
this._selection = value || "single";
|
|
406
530
|
}
|
|
531
|
+
/**
|
|
532
|
+
* Retrieves the current selection.
|
|
533
|
+
* @returns {*} The value of the current selection.
|
|
534
|
+
*/
|
|
407
535
|
get selection() {
|
|
408
536
|
return this._selection;
|
|
409
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* Sets or removes the 'indeterminate' attribute based on the provided value.
|
|
540
|
+
* This can be used to visually indicate an indeterminate state for elements like checkboxes.
|
|
541
|
+
* @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.
|
|
542
|
+
* If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.
|
|
543
|
+
*/
|
|
544
|
+
set indeterminate(value) {
|
|
545
|
+
this.removeAttribute("indeterminate");
|
|
546
|
+
if (value)
|
|
547
|
+
this.setAttribute("indeterminate", "");
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Retrieves the state of the indeterminate attribute.
|
|
551
|
+
* @returns {boolean} True if the indeterminate attribute is present, otherwise false.
|
|
552
|
+
*/
|
|
553
|
+
get indeterminate() {
|
|
554
|
+
return this.hasAttribute("indeterminate");
|
|
555
|
+
}
|
|
410
556
|
/**
|
|
411
557
|
* Returns the CSS stylesheet for the component.
|
|
412
558
|
* @static
|
|
@@ -421,19 +567,60 @@ class TreeItem extends WJElement {
|
|
|
421
567
|
setupAttributes() {
|
|
422
568
|
this.isShadowRoot = "open";
|
|
423
569
|
}
|
|
424
|
-
|
|
570
|
+
/**
|
|
571
|
+
* Returns the list of attributes to observe for changes.
|
|
572
|
+
* @static
|
|
573
|
+
* @returns {Array<string>}
|
|
574
|
+
*/
|
|
575
|
+
static get observedAttributes() {
|
|
576
|
+
return ["selected", "indeterminate"];
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Handles updates when observed attributes of the element are changed.
|
|
580
|
+
* Updates the checkbox state based on changes to the "selected" or "indeterminate" attributes.
|
|
581
|
+
* @param {string} name The name of the attribute that was changed.
|
|
582
|
+
* @param {string|null} oldValue The previous value of the attribute before the change.
|
|
583
|
+
* @param {string|null} newValue The new value of the attribute after the change.
|
|
584
|
+
* @returns {void}
|
|
585
|
+
*/
|
|
586
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
587
|
+
if (name === "selected") {
|
|
588
|
+
this.checkbox.removeAttribute("indeterminate");
|
|
589
|
+
if (this.selected) {
|
|
590
|
+
this.checkbox.setAttribute("checked", "");
|
|
591
|
+
} else {
|
|
592
|
+
this.checkbox.removeAttribute("checked");
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
if (name === "indeterminate" && !this.selected) {
|
|
596
|
+
this.checkbox.removeAttribute("indeterminate");
|
|
597
|
+
this.checkbox.removeAttribute("checked");
|
|
598
|
+
if (this.indeterminate)
|
|
599
|
+
this.checkbox.setAttribute("indeterminate", "");
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Custom logic executed before the draw process begins.
|
|
604
|
+
* Determines and sets the appropriate slot if the current item is nested.
|
|
605
|
+
* @returns {void} No return value.
|
|
606
|
+
*/
|
|
607
|
+
beforeDraw() {
|
|
425
608
|
if (this.isNestedItem())
|
|
426
609
|
this.slot = "children";
|
|
427
610
|
}
|
|
428
611
|
/**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
612
|
+
* Creates and returns a document fragment representing the structure of a tree item component.
|
|
613
|
+
* The method constructs the DOM elements including the native container, indentation, toggle button,
|
|
614
|
+
* selection checkbox, label, and children container, along with their respective slots and attributes.
|
|
615
|
+
* It dynamically handles the creation of expand and collapse icons, as well as appending slots for
|
|
616
|
+
* child components.
|
|
617
|
+
* @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.
|
|
431
618
|
*/
|
|
432
619
|
draw() {
|
|
433
620
|
let fragment = document.createDocumentFragment();
|
|
434
621
|
let native = document.createElement("div");
|
|
435
622
|
native.setAttribute("part", "native");
|
|
436
|
-
native.classList.add("native-tree-item");
|
|
623
|
+
native.classList.add("native-tree-item", this.selection === "multiple" ? "multiple" : "single");
|
|
437
624
|
let item = document.createElement("div");
|
|
438
625
|
item.classList.add("item");
|
|
439
626
|
let indent = document.createElement("div");
|
|
@@ -443,12 +630,15 @@ class TreeItem extends WJElement {
|
|
|
443
630
|
let checkbox = document.createElement("wje-checkbox");
|
|
444
631
|
if (this.selected)
|
|
445
632
|
checkbox.setAttribute("checked", "");
|
|
446
|
-
let label = document.createElement("
|
|
633
|
+
let label = document.createElement("div");
|
|
634
|
+
label.classList.add("content");
|
|
635
|
+
let slotElement = document.createElement("slot");
|
|
447
636
|
let children = document.createElement("div");
|
|
448
637
|
children.classList.add("children");
|
|
449
638
|
let slot = document.createElement("slot");
|
|
450
639
|
slot.setAttribute("name", "children");
|
|
451
640
|
children.appendChild(slot);
|
|
641
|
+
item.appendChild(indent);
|
|
452
642
|
if (this.querySelectorAll(":scope > wje-tree-item").length > 0) {
|
|
453
643
|
if (this.querySelectorAll('[slot="expand"]').length < 1) {
|
|
454
644
|
let expandIcon = document.createElement("wje-icon");
|
|
@@ -472,6 +662,7 @@ class TreeItem extends WJElement {
|
|
|
472
662
|
item.appendChild(button);
|
|
473
663
|
if (this.selection === "multiple")
|
|
474
664
|
item.appendChild(checkbox);
|
|
665
|
+
label.appendChild(slotElement);
|
|
475
666
|
item.appendChild(label);
|
|
476
667
|
native.appendChild(item);
|
|
477
668
|
native.appendChild(children);
|
|
@@ -483,33 +674,67 @@ class TreeItem extends WJElement {
|
|
|
483
674
|
this.childrenSlot = slot;
|
|
484
675
|
return fragment;
|
|
485
676
|
}
|
|
677
|
+
/**
|
|
678
|
+
* Executes operations to be performed after the draw action is completed.
|
|
679
|
+
* If the state indicates it is expanded, toggles its children.
|
|
680
|
+
* Additionally, sets up an event listener on the button element to handle toggling children upon click.
|
|
681
|
+
* @returns {void} Does not return a value.
|
|
682
|
+
*/
|
|
486
683
|
afterDraw() {
|
|
684
|
+
if (this.expanded)
|
|
685
|
+
this.toggleChildren();
|
|
487
686
|
this.button.addEventListener("click", this.toggleChildren.bind(this));
|
|
488
|
-
this.checkbox.addEventListener("wje-toggle:change", (e) => {
|
|
489
|
-
console.log("CHECKBOX CHANGED", e);
|
|
490
|
-
this.selected = e.detail.checked;
|
|
491
|
-
});
|
|
492
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* Determines if the current item is a nested item within a tree structure.
|
|
690
|
+
* Checks if the item's parent element exists and is also a tree item.
|
|
691
|
+
* @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.
|
|
692
|
+
*/
|
|
493
693
|
isNestedItem() {
|
|
494
694
|
const parent = this.parentElement;
|
|
495
695
|
return !!parent && this.isTreeItem(parent);
|
|
496
696
|
}
|
|
697
|
+
/**
|
|
698
|
+
* Checks whether the given node is a tree item.
|
|
699
|
+
* @param {object} node The node to check.
|
|
700
|
+
* @returns {boolean} Returns true if the node is an Element and has a class name of 'TreeItem', otherwise false.
|
|
701
|
+
*/
|
|
497
702
|
isTreeItem(node) {
|
|
498
|
-
console.log(node, node instanceof Element, node.className === "TreeItem");
|
|
499
703
|
return node instanceof Element && node.className === "TreeItem";
|
|
500
704
|
}
|
|
705
|
+
/**
|
|
706
|
+
* Toggles the visibility state of the children element and updates the class of the parent element.
|
|
707
|
+
* The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,
|
|
708
|
+
* effectively showing or hiding the children and indicating the expanded state.
|
|
709
|
+
* @returns {void} Does not return a value.
|
|
710
|
+
*/
|
|
501
711
|
toggleChildren() {
|
|
502
|
-
console.log("SOM TU 1");
|
|
503
712
|
this.childrenElement.classList.toggle("open");
|
|
504
713
|
this.native.classList.toggle("expanded");
|
|
505
|
-
console.log("SOM TU 2");
|
|
506
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* Retrieves the child items from the `childrenSlot` that match specific criteria.
|
|
717
|
+
* @param {object} [options] Configuration options.
|
|
718
|
+
* @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.
|
|
719
|
+
* @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.
|
|
720
|
+
*/
|
|
507
721
|
getChildrenItems(options = {}) {
|
|
508
722
|
const includeDisabled = options.includeDisabled ?? true;
|
|
509
723
|
if (!this.childrenSlot) {
|
|
510
724
|
return [];
|
|
511
725
|
}
|
|
512
|
-
return [...this.childrenSlot.assignedElements({ flatten: true })].filter((item) => item
|
|
726
|
+
return [...this.childrenSlot.assignedElements({ flatten: true })].filter((item) => this.isTreeItem(item) && (includeDisabled || !item.disabled));
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Retrieves all descendant children of the current object in a flattened array structure.
|
|
730
|
+
* @param {object} [options] An optional object specifying filters or configurations for retrieving children.
|
|
731
|
+
* @returns {Array} An array containing all children and their descendants in a flat structure.
|
|
732
|
+
*/
|
|
733
|
+
getAllChildrenFlat(options = {}) {
|
|
734
|
+
const directChildren = this.getChildrenItems(options);
|
|
735
|
+
return directChildren.flatMap(
|
|
736
|
+
(child) => [child, ...child.getAllChildrenFlat(options)]
|
|
737
|
+
);
|
|
513
738
|
}
|
|
514
739
|
}
|
|
515
740
|
TreeItem.define("wje-tree-item", TreeItem);
|
package/dist/wje-master.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-master.js","sources":["../packages/utils/date.js","../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","../packages/wje-tree/tree.element.js","../packages/wje-tree/tree.js","../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["export function formatDate(input, format) {\n let date;\n\n // Rozpoznanie typu vstupu a jeho konverzia na objekt Date\n if (typeof input === 'string') {\n date = new Date(input); // Predpokladáme, že je to ISO reťazec\n } else if (typeof input === 'number') {\n date = new Date(input); // Predpokladáme, že je to timestamp\n } else if (input instanceof Date) {\n date = input; // Je to objekt Date\n } else {\n throw new Error('Invalid date input');\n }\n\n const map = {\n yyyy: date.getFullYear(),\n MM: String(date.getMonth() + 1).padStart(2, '0'), // Mesiace sú indexované od 0\n dd: String(date.getDate()).padStart(2, '0'),\n HH: String(date.getHours()).padStart(2, '0'),\n mm: String(date.getMinutes()).padStart(2, '0'),\n ss: String(date.getSeconds()).padStart(2, '0'),\n MMMM: date.toLocaleString('en-US', { month: 'long' }), // Full month name\n MMM: date.toLocaleString('en-US', { month: 'short' }), // Short month name\n };\n\n return format.replace(/yyyy|MM|dd|HH|mm|ss|MMMM|MMM/g, (matched) => map[matched]);\n}\n","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};\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};\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 }\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","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","import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n\n/**\n * Represents a custom Tree component that extends the functionality of WJElement.\n * This component is used to create a hierarchical tree structure with selectable items.\n */\n\nexport default class Tree extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n }\n\n set selection(value) {\n this.setAttribute('selection', value || 'single');\n }\n\n get selection() {\n return this.getAttribute('selection');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tree';\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 * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n beforeDraw(context, appStoreObj, params) {\n const items = this.querySelectorAll('wje-tree-item');\n items?.forEach(item => {\n item.selection = this.selection;\n\n this.getExpandCollapseIcon(item,'expand');\n this.getExpandCollapseIcon(item,'collapse');\n\n });\n }\n\n /**\n * Draw method for the toast notification.\n * @returns {object} Document fragment\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-tree');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Called after the draw process of the component is completed.\n * Typically used to add event listeners or perform operations\n * that are dependent on the component's drawn state.\n * @returns {void} This method does not return a value.\n */\n afterDraw() {\n this.addEventListener('click', this.handleClick);\n }\n\n /**\n * Handles the click event triggered by the user interaction.\n * Identifies the closest tree item element to the event target and sets it\n * as the selected item. Ensures that only one item is selected at a time, resetting\n * the selection state for all other items.\n * @param {Event} e The click event object.\n */\n handleClick = (e) => {\n let selectedItem = e.target.closest('wje-tree-item');\n console.log('HANDLE CLICK', this.selection);\n if (this.selection === 'single') {\n if (selectedItem) {\n for (let item of this.getAllItems()) {\n item.selected = item === selectedItem;\n }\n }\n } else if (this.selection === 'multiple') {\n let childrens = selectedItem.getChildrenItems();\n selectedItem.selected = !selectedItem.selected;\n\n for(let item of childrens) {\n item.selected = !item.selected;\n }\n\n console.log('multiple selection', childrens);\n }\n }\n\n /**\n * Retrieves all items that match the selector 'wje-tree-item' within the current context.\n * @returns {Array<Element>} An array of all matching DOM elements.\n */\n getAllItems() {\n return [...this.querySelectorAll('wje-tree-item')];\n }\n\n /**\n * Retrieves and appends an expand/collapse icon to a given item based on the provided status.\n * @param {HTMLElement} item The DOM element to which the icon will be appended.\n * @param {string} status The status indicating which icon to retrieve (e.g., \"expand\" or \"collapse\").\n * @returns {void} This method does not return a value. If the icon matching the given status is not found, a warning is logged.\n */\n getExpandCollapseIcon(item, status) {\n let icon = this.querySelector(`[slot=\"${status}\"]`);\n if (!icon) {\n console.warn(`Icon with slot \"${status}\" was not found.`);\n return;\n }\n\n let iconClone = icon.cloneNode(true);\n item.appendChild(iconClone);\n // return this.querySelector('.expand-collapse-icon');\n }\n}","import Tree from './tree.element.js';\n\nexport default Tree;\n\nTree.define('wje-tree', Tree);\n","import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Toast` is a custom web component that represents a toast notification.\n * @summary This element represents a toast notification.\n * @documentation https://elements.webjet.sk/components/toast\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part\n * @cssproperty {string} headline - Specifies the headline text of the toast. Represents the main title or heading displayed in the toast.\n * @cssproperty {boolean} open - Indicates whether the toast is currently open (visible). A value of `true` shows the toast, while `false` hides it.\n * @cssproperty {number} duration - Determines the duration (in milliseconds) for which the toast is displayed. After this time, the toast will automatically close unless it is manually closed.\n * @cssproperty {boolean} closable - Specifies whether the toast can be manually closed by the user. If `true`, the toast will include a close button or mechanism.\n * @cssproperty {string} color - Defines the color of the toast. Accepts any valid CSS color value such as `hex`, `RGB`, or named colors.\n * @cssproperty {boolean} countdown - Indicates whether a countdown is displayed in the toast. When `true`, a visual countdown timer is shown to indicate the remaining time before the toast closes.\n * @slot - The content of the toast.\n * @slot media - The media of the toast.\n * // @fires wje-toast:after-show - Fired after the toast is shown.\n * // @fires wje-toast:after-hide - Fired after the toast is hidden.\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n set selected(value) {\n this.removeAttribute('selected');\n\n if(value)\n this.setAttribute('selected', '');\n }\n\n get selected() {\n return this.hasAttribute('selected');\n }\n\n set selection(value) {\n this._selection = value || 'single';\n }\n\n get selection() {\n return this._selection;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\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 * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n beforeDraw(context, appStoreObj, params) {\n if (this.isNestedItem())\n this.slot = 'children';\n }\n\n /**\n * Draw method for the toast notification.\n * @returns {object} Document fragment\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-tree-item');\n\n let item = document.createElement('div');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if(this.selected)\n checkbox.setAttribute('checked', '');\n\n let label = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n // item.appendChild(indent);\n if(this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if(this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if(this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if(this.selection === 'multiple')\n item.appendChild(checkbox);\n item.appendChild(label);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n afterDraw() {\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n this.checkbox.addEventListener('wje-toggle:change', (e) => {\n\n console.log(\"CHECKBOX CHANGED\", e);\n this.selected = e.detail.checked;\n // e.stopPropagation();\n });\n }\n\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n isTreeItem(node) {\n console.log(node, node instanceof Element, node.className === 'TreeItem');\n // return true;\n return node instanceof Element && node.className === 'TreeItem';\n }\n\n toggleChildren() {\n console.log(\"SOM TU 1\");\n this.childrenElement.classList.toggle('open');\n this.native.classList.toggle('expanded');\n console.log(\"SOM TU 2\");\n }\n\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true; // Ak nie je zadané, predvolená hodnota je true\n\n if (!this.childrenSlot) {\n return []; // Ak `childrenSlot` neexistuje, vráti prázdne pole\n }\n\n return [...this.childrenSlot.assignedElements({ flatten: true })]\n .filter(item => item.tagName === 'WJE-TREE-ITEM' && (includeDisabled || !item.disabled));\n }\n}","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":["styles","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,WAAW,OAAO,QAAQ;AACtC,MAAI;AAGJ,MAAI,OAAO,UAAU,UAAU;AAC3B,WAAO,IAAI,KAAK,KAAK;AAAA,EAC7B,WAAe,OAAO,UAAU,UAAU;AAClC,WAAO,IAAI,KAAK,KAAK;AAAA,EAC7B,WAAe,iBAAiB,MAAM;AAC9B,WAAO;AAAA,EACf,OAAW;AACH,UAAM,IAAI,MAAM,oBAAoB;AAAA,EAC5C;AAEI,QAAM,MAAM;AAAA,IACR,MAAM,KAAK,YAAa;AAAA,IACxB,IAAI,OAAO,KAAK,SAAQ,IAAK,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA;AAAA,IAC/C,IAAI,OAAO,KAAK,QAAS,CAAA,EAAE,SAAS,GAAG,GAAG;AAAA,IAC1C,IAAI,OAAO,KAAK,SAAU,CAAA,EAAE,SAAS,GAAG,GAAG;AAAA,IAC3C,IAAI,OAAO,KAAK,WAAY,CAAA,EAAE,SAAS,GAAG,GAAG;AAAA,IAC7C,IAAI,OAAO,KAAK,WAAY,CAAA,EAAE,SAAS,GAAG,GAAG;AAAA,IAC7C,MAAM,KAAK,eAAe,SAAS,EAAE,OAAO,QAAQ;AAAA;AAAA,IACpD,KAAK,KAAK,eAAe,SAAS,EAAE,OAAO,SAAS;AAAA;AAAA,EACvD;AAED,SAAO,OAAO,QAAQ,iCAAiC,CAAC,YAAY,IAAI,OAAO,CAAC;AACpF;ACxBY,MAAC,O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,MAAM;AACb,YAAQ,IAAI,MAAM,gBAAgB,SAAS,KAAK,cAAc,UAAU;AAExE,WAAO,gBAAgB,WAAW,KAAK,cAAc;AAAA,EAC7D;AAAA,EAEI,iBAAiB;AACb,YAAQ,IAAI,UAAU;AACtB,SAAK,gBAAgB,UAAU,OAAO,MAAM;AAC5C,SAAK,OAAO,UAAU,OAAO,UAAU;AACvC,YAAQ,IAAI,UAAU;AAAA,EAC9B;AAAA,EAEI,iBAAiB,UAAU,IAAI;AAC3B,UAAM,kBAAkB,QAAQ,mBAAmB;AAEnD,QAAI,CAAC,KAAK,cAAc;AACpB,aAAO;IACnB;AAEQ,WAAO,CAAC,GAAG,KAAK,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC,EAC7D,OAAO,UAAQ,KAAK,YAAY,oBAAoB,mBAAmB,CAAC,KAAK,SAAS;AAAA,EACjG;AACA;ACjMA,SAAS,OAAO,iBAAiB,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"wje-master.js","sources":["../packages/utils/date.js","../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","../packages/wje-tree/tree.element.js","../packages/wje-tree/tree.js","../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["export function formatDate(input, format) {\n let date;\n\n // Rozpoznanie typu vstupu a jeho konverzia na objekt Date\n if (typeof input === 'string') {\n date = new Date(input); // Predpokladáme, že je to ISO reťazec\n } else if (typeof input === 'number') {\n date = new Date(input); // Predpokladáme, že je to timestamp\n } else if (input instanceof Date) {\n date = input; // Je to objekt Date\n } else {\n throw new Error('Invalid date input');\n }\n\n const map = {\n yyyy: date.getFullYear(),\n MM: String(date.getMonth() + 1).padStart(2, '0'), // Mesiace sú indexované od 0\n dd: String(date.getDate()).padStart(2, '0'),\n HH: String(date.getHours()).padStart(2, '0'),\n mm: String(date.getMinutes()).padStart(2, '0'),\n ss: String(date.getSeconds()).padStart(2, '0'),\n MMMM: date.toLocaleString('en-US', { month: 'long' }), // Full month name\n MMM: date.toLocaleString('en-US', { month: 'short' }), // Short month name\n };\n\n return format.replace(/yyyy|MM|dd|HH|mm|ss|MMMM|MMM/g, (matched) => map[matched]);\n}\n","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};\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};\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 }\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","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","import { default as WJElement } from \"../wje-element/element.js\";\nimport styles from \"./styles/styles.css?inline\";\n\n/**\n * `Tree` is a custom web component that represents a hierarchical tree structure.\n * It extends from `WJElement`.\n * @summary This element visually represents a tree structure, supporting single or multiple selection modes and hierarchy management.\n * @documentation https://elements.webjet.sk/components/tree\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native container part of the tree.\n * @slot - The default slot to place `wje-tree-item` child components.\n * @tag wje-tree\n */\n\nexport default class Tree extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the selection attribute for the element.\n * @param {string} value The value to set as the selection attribute.\n */\n set selection(value) {\n this.setAttribute('selection', value);\n }\n\n /**\n * Gets the current selection mode for the element.\n * If no selection is explicitly set, it defaults to 'single'.\n * @returns {string} The current selection mode, either set by the element's attribute or the default value 'single'.\n */\n get selection() {\n return this.getAttribute('selection') || 'single';\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tree';\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 * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * A method called before the drawing or rendering process of tree items.\n * It iterates through all `wje-tree-item` elements, updating their selection state\n * and managing their expand/collapse icons accordingly.\n * @returns {void} This method does not return a value.\n */\n beforeDraw() {\n const items = this.querySelectorAll('wje-tree-item');\n items?.forEach(item => {\n item.selection = this.selection;\n\n this.getExpandCollapseIcon(item,'expand');\n this.getExpandCollapseIcon(item,'collapse');\n\n });\n }\n\n /**\n * Draw method for the toast notification.\n * @returns {object} Document fragment\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-tree');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Called after the draw process of the component is completed.\n * Typically used to add event listeners or perform operations\n * that are dependent on the component's drawn state.\n * @returns {void} This method does not return a value.\n */\n afterDraw() {\n this.addEventListener('click', this.handleClick);\n }\n\n /**\n * Handles the click event triggered by the user interaction.\n * Identifies the closest tree item element to the event target and sets it\n * as the selected item. Ensures that only one item is selected at a time, resetting\n * the selection state for all other items.\n * @param {Event} e The click event object.\n */\n handleClick = (e) => {\n let selectedItem = e.target.closest('wje-tree-item');\n let isClickButton = e.composedPath().some((el) => el?.classList?.contains('toggle'));\n if(isClickButton)\n return;\n\n if (this.selection === 'single') {\n if (selectedItem) {\n for (let item of this.getAllItems()) {\n item.selected = item === selectedItem;\n }\n }\n } else if (this.selection === 'multiple') {\n // let children = selectedItem.getAllChildrenFlat();\n selectedItem.selected = !selectedItem.selected;\n\n this.updateCheckboxState(selectedItem);\n }\n }\n\n /**\n * Retrieves all items that match the selector 'wje-tree-item' within the current context.\n * @returns {Array<Element>} An array of all matching DOM elements.\n */\n getAllItems() {\n return [...this.querySelectorAll('wje-tree-item')];\n }\n\n /**\n * Retrieves and appends an expand/collapse icon to a given item based on the provided status.\n * @param {HTMLElement} item The DOM element to which the icon will be appended.\n * @param {string} status The status indicating which icon to retrieve (e.g., \"expand\" or \"collapse\").\n * @returns {void} This method does not return a value. If the icon matching the given status is not found, a warning is logged.\n */\n getExpandCollapseIcon(item, status) {\n let icon = this.querySelector(`[slot=\"${status}\"]`);\n if (!icon) {\n console.warn(`Icon with slot \"${status}\" was not found.`);\n return;\n }\n\n let iconClone = icon.cloneNode(true);\n item.appendChild(iconClone);\n }\n\n\n /**\n * Updates the state of a checkbox, syncing the state both upwards to parent elements\n * and downwards to child elements as necessary.\n * @param {object} changedItem The specific item whose checkbox state has changed.\n * @param {boolean} [isInitialSync] Indicates whether the state update is part of the initial synchronization process.\n * @returns {void} This method does not return a value.\n */\n updateCheckboxState(changedItem, isInitialSync = false) {\n this.isInitialSync = isInitialSync;\n this.propagateStateDownwards(changedItem);\n this.propagateStateUpwards(changedItem);\n }\n\n /**\n * Updates the state of the parent item based on the state of its child items.\n * Recursively propagates changes up to all parent items to reflect the selection\n * or indeterminate state accurately.\n * @param {object} item The current tree item whose parent state needs to be updated.\n * It is expected to have properties `selected`, `indeterminate`,\n * and a method `getChildrenItems({ includeDisabled: boolean })`.\n * @returns {void} This method does not return a value.\n */\n updateParentState(item) {\n const children = item.getChildrenItems({ includeDisabled: false });\n\n if (children.length) {\n const areAllChildrenChecked = children.every(child => child.selected);\n const areSomeChildrenChecked = children.some(child => child.selected);\n const areSomeChildrenIndeterminate = children.some(child => child.indeterminate);\n\n item.selected = areAllChildrenChecked;\n item.indeterminate = areSomeChildrenIndeterminate || (areSomeChildrenChecked && !areAllChildrenChecked);\n } else {\n item.indeterminate = false;\n }\n\n const parent = item.parentElement?.closest('wje-tree-item');\n if (parent) {\n this.updateParentState(parent);\n }\n }\n\n /**\n * Propagates the state changes of an item upwards through its ancestors in the hierarchy.\n * Calls the `updateParentState` method for each parent element until no parent exists.\n * @param {HTMLElement} item The current item whose state to propagate to its parent.\n * @returns {void} This method does not return a value.\n */\n propagateStateUpwards(item) {\n const parent = item.parentElement?.closest('wje-tree-item');\n\n if (parent) {\n this.updateParentState(parent);\n this.propagateStateUpwards(parent);\n }\n }\n\n /**\n * Propagates the selected state of an item to its children recursively. Depending on the `isInitialSync` flag,\n * it also determines how the state should be applied to the child items and updates the parent state if needed.\n * @param {object} item The item whose state is being propagated to its child items. The item must have properties\n * such as `selected` and methods like `getChildrenItems` to retrieve its child elements.\n * @returns {void} This method does not return a value.\n */\n propagateStateDownwards(item) {\n const isChecked = item.selected;\n\n item.getChildrenItems().forEach(child => {\n child.selected = this.isInitialSync ? (isChecked || child.selected) : (!child.disabled && isChecked);\n this.propagateStateDownwards(child);\n });\n\n if (this.isInitialSync) {\n this.updateParentState(item);\n }\n }\n}","import Tree from './tree.element.js';\n\nexport default Tree;\n\nTree.define('wje-tree', Tree);\n","import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `wje-tree-item` is a custom web component used as a child of the `wje-tree`.\n * It represents a node within a tree structure, capable of nesting other items.\n * @summary Represents a single item in a tree structure.\n * @documentation https://elements.webjet.sk/components/tree-item\n * @status stable\n * @augments {HTMLElement}\n * @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).\n * @csspart native - The native container of the tree item.\n * @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.\n * @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item’s container.\n * @tag wje-tree-item\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n /**\n * Sets the expanded state of the element. When set to a truthy value,\n * the 'expanded' attribute will be added to the element. When set to a falsy\n * value, the 'expanded' attribute will be removed.\n * @param {boolean} value A boolean value indicating whether the\n * element should be expanded (true) or collapsed (false).\n */\n set expanded(value) {\n if (value) {\n this.setAttribute('expanded', '');\n } else {\n this.removeAttribute('expanded');\n }\n }\n\n /**\n * Retrieves the value of the 'expanded' state for the current element.\n * This getter checks whether the 'expanded' attribute is present on the element.\n * If the attribute exists, it returns true, representing that the element is expanded.\n * Otherwise, it returns false, indicating that the element is not expanded.\n * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.\n */\n get expanded() {\n return this.hasAttribute('expanded');\n }\n\n /**\n * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.\n * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.\n */\n set selected(value) {\n this.removeAttribute('selected');\n\n if(value)\n this.setAttribute('selected', '');\n }\n\n /**\n * Getter method for determining if the 'selected' attribute is present on the element.\n * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n /**\n * Sets the selection mode for the component.\n * @param {string} value The selection mode to apply. Defaults to 'single'\n * if no value is provided. Possible options may be\n * specific to the implementation of the component\n * (e.g., 'single', 'multiple').\n */\n set selection(value) {\n this._selection = value || 'single';\n }\n\n /**\n * Retrieves the current selection.\n * @returns {*} The value of the current selection.\n */\n get selection() {\n return this._selection;\n }\n\n /**\n * Sets or removes the 'indeterminate' attribute based on the provided value.\n * This can be used to visually indicate an indeterminate state for elements like checkboxes.\n * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.\n * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.\n */\n set indeterminate(value) {\n this.removeAttribute('indeterminate');\n\n if(value)\n this.setAttribute('indeterminate', '');\n }\n\n /**\n * Retrieves the state of the indeterminate attribute.\n * @returns {boolean} True if the indeterminate attribute is present, otherwise false.\n */\n get indeterminate() {\n return this.hasAttribute('indeterminate');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\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 * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['selected', 'indeterminate'];\n }\n\n /**\n * Handles updates when observed attributes of the element are changed.\n * Updates the checkbox state based on changes to the \"selected\" or \"indeterminate\" attributes.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before the change.\n * @param {string|null} newValue The new value of the attribute after the change.\n * @returns {void}\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected') {\n this.checkbox.removeAttribute('indeterminate');\n if (this.selected) {\n this.checkbox.setAttribute('checked', '');\n } else {\n this.checkbox.removeAttribute('checked');\n }\n }\n\n if (name === 'indeterminate' && !this.selected) {\n this.checkbox.removeAttribute('indeterminate');\n this.checkbox.removeAttribute('checked');\n\n if (this.indeterminate)\n this.checkbox.setAttribute('indeterminate', '');\n }\n }\n\n /**\n * Custom logic executed before the draw process begins.\n * Determines and sets the appropriate slot if the current item is nested.\n * @returns {void} No return value.\n */\n beforeDraw() {\n if (this.isNestedItem())\n this.slot = 'children';\n }\n \n /**\n * Creates and returns a document fragment representing the structure of a tree item component.\n * The method constructs the DOM elements including the native container, indentation, toggle button,\n * selection checkbox, label, and children container, along with their respective slots and attributes.\n * It dynamically handles the creation of expand and collapse icons, as well as appending slots for\n * child components.\n * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.\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-tree-item', this.selection === 'multiple' ? 'multiple' : 'single');\n\n let item = document.createElement('div');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if(this.selected)\n checkbox.setAttribute('checked', '');\n\n let label = document.createElement('div');\n label.classList.add('content');\n\n let slotElement = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n item.appendChild(indent);\n\n if(this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if(this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if(this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if(this.selection === 'multiple')\n item.appendChild(checkbox);\n\n label.appendChild(slotElement);\n item.appendChild(label);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n /**\n * Executes operations to be performed after the draw action is completed.\n * If the state indicates it is expanded, toggles its children.\n * Additionally, sets up an event listener on the button element to handle toggling children upon click.\n * @returns {void} Does not return a value.\n */\n afterDraw() {\n if(this.expanded)\n this.toggleChildren();\n\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n }\n\n /**\n * Determines if the current item is a nested item within a tree structure.\n * Checks if the item's parent element exists and is also a tree item.\n * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.\n */\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n /**\n * Checks whether the given node is a tree item.\n * @param {object} node The node to check.\n * @returns {boolean} Returns true if the node is an Element and has a class name of 'TreeItem', otherwise false.\n */\n isTreeItem(node) {\n return node instanceof Element && node.className === 'TreeItem';\n }\n\n /**\n * Toggles the visibility state of the children element and updates the class of the parent element.\n * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,\n * effectively showing or hiding the children and indicating the expanded state.\n * @returns {void} Does not return a value.\n */\n toggleChildren() {\n this.childrenElement.classList.toggle('open');\n this.native.classList.toggle('expanded');\n }\n\n /**\n * Retrieves the child items from the `childrenSlot` that match specific criteria.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.\n * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.\n */\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true; // Ak nie je zadané, predvolená hodnota je true\n\n if (!this.childrenSlot) {\n return []; // Ak `childrenSlot` neexistuje, vráti prázdne pole\n }\n\n return [...this.childrenSlot.assignedElements({ flatten: true })]\n .filter(item => this.isTreeItem(item) && (includeDisabled || !item.disabled));\n }\n\n /**\n * Retrieves all descendant children of the current object in a flattened array structure.\n * @param {object} [options] An optional object specifying filters or configurations for retrieving children.\n * @returns {Array} An array containing all children and their descendants in a flat structure.\n */\n getAllChildrenFlat(options = {}) {\n const directChildren = this.getChildrenItems(options);\n return directChildren.flatMap(child =>\n [child, ...child.getAllChildrenFlat(options)]\n );\n }\n}","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":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AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,MAAM;AACb,WAAO,gBAAgB,WAAW,KAAK,cAAc;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,iBAAiB;AACb,SAAK,gBAAgB,UAAU,OAAO,MAAM;AAC5C,SAAK,OAAO,UAAU,OAAO,UAAU;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,iBAAiB,UAAU,IAAI;AAC3B,UAAM,kBAAkB,QAAQ,mBAAmB;AAEnD,QAAI,CAAC,KAAK,cAAc;AACpB,aAAO;IACnB;AAEQ,WAAO,CAAC,GAAG,KAAK,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC,EAC7D,OAAO,UAAQ,KAAK,WAAW,IAAI,MAAM,mBAAmB,CAAC,KAAK,SAAS;AAAA,EACtF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,UAAU,IAAI;AAC7B,UAAM,iBAAiB,KAAK,iBAAiB,OAAO;AACpD,WAAO,eAAe;AAAA,MAAQ,WAC5B,CAAC,OAAO,GAAG,MAAM,mBAAmB,OAAO,CAAC;AAAA,IAC7C;AAAA,EACT;AACA;ACnVA,SAAS,OAAO,iBAAiB,QAAQ;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.139",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"@crowdin/cli": "^3.19.2",
|
|
73
73
|
"@faker-js/faker": "^8.0.0",
|
|
74
74
|
"@floating-ui/dom": "^1.5.1",
|
|
75
|
+
"ajv": "^8.17.1",
|
|
75
76
|
"animate.css": "^4.1.1",
|
|
76
77
|
"qrious": "^4.0.2",
|
|
77
78
|
"slick-router": "^3.0.1",
|
|
@@ -106,4 +107,4 @@
|
|
|
106
107
|
"vite-plugin-dts": "^4.5.0",
|
|
107
108
|
"vite-plugin-javascript-obfuscator": "^3.1.0"
|
|
108
109
|
}
|
|
109
|
-
}
|
|
110
|
+
}
|