wj-elements 0.2.0-alpha.11 → 0.2.0-alpha.13
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/dark.css +9 -1
- package/dist/light.css +2 -1
- package/dist/localize.js +3 -2
- package/dist/localize.js.map +1 -1
- package/dist/packages/wje-card/card.element.d.ts +0 -8
- package/dist/packages/wje-element/element.d.ts +42 -24
- package/dist/skeleton.css +187 -0
- package/dist/wje-carousel.js +14 -4
- package/dist/wje-carousel.js.map +1 -1
- package/dist/wje-element.js +55 -242
- package/dist/wje-element.js.map +1 -1
- package/package.json +1 -1
package/dist/dark.css
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
:host,
|
|
6
6
|
.wje-theme-dark,
|
|
7
|
-
.dark
|
|
7
|
+
.dark,
|
|
8
|
+
[data-theme=dark] {
|
|
8
9
|
color-scheme: dark;
|
|
9
10
|
|
|
10
11
|
--wje-font-family:
|
|
@@ -134,6 +135,13 @@
|
|
|
134
135
|
--wje-color-contrast-10: hsla(0, 0%, 98%, 1);
|
|
135
136
|
--wje-color-contrast-11: hsla(0, 0%, 100%, 1);
|
|
136
137
|
|
|
138
|
+
/*
|
|
139
|
+
[ Skeleton ]
|
|
140
|
+
*/
|
|
141
|
+
--wje-skeleton-bg: var(--wje-color-contrast-3);
|
|
142
|
+
--wje-skeleton-bg-strong: var(--wje-color-contrast-4);
|
|
143
|
+
--wje-skeleton-highlight: rgba(255, 255, 255, 0.45);
|
|
144
|
+
|
|
137
145
|
/*
|
|
138
146
|
[ Elements ]
|
|
139
147
|
*/
|
package/dist/light.css
CHANGED
package/dist/localize.js
CHANGED
|
@@ -4,9 +4,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
class LocalizerDefault {
|
|
5
5
|
constructor(element) {
|
|
6
6
|
__publicField(this, "convertLangCode", (lang) => lang.replace("-", "_").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`));
|
|
7
|
+
var _a, _b, _c, _d;
|
|
7
8
|
this.element = element;
|
|
8
|
-
this.lang = this.element.lang || document.documentElement.lang || "en-GB";
|
|
9
|
-
this.dir = this.element.dir || document.documentElement.dir || "ltr";
|
|
9
|
+
this.lang = ((_a = this.element) == null ? void 0 : _a.lang) || ((_b = document.documentElement) == null ? void 0 : _b.lang) || "en-GB";
|
|
10
|
+
this.dir = ((_c = this.element) == null ? void 0 : _c.dir) || ((_d = document.documentElement) == null ? void 0 : _d.dir) || "ltr";
|
|
10
11
|
this.currentLang = "en-GB";
|
|
11
12
|
this.setLanguage();
|
|
12
13
|
}
|
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
|
|
1
|
+
{"version":3,"file":"localize.js","sources":["../packages/localize/localize.js","../packages/utils/localize.js"],"sourcesContent":["// export const translations = new Map();\n\nexport class LocalizerDefault {\n constructor(element) {\n this.element = element;\n\n this.lang = this.element?.lang || document.documentElement?.lang || 'en-GB';\n this.dir = this.element?.dir || document.documentElement?.dir || 'ltr';\n this.currentLang = 'en-GB';\n\n this.setLanguage();\n }\n\n get languages() {\n return window.translations;\n }\n\n // Nastavenie aktuálneho jazyka\n setLanguage() {\n if (this.languages?.has(this.lang)) {\n this.currentLang = this.lang;\n } else {\n console.error(`Language \"${this.lang}\" not loaded.`);\n }\n }\n\n convertLangCode = (lang) => lang.replace(\"-\", \"_\").replace(/_([a-z]{2})$/, (_, code) => `_${code.toUpperCase()}`);\n\n /**\n * Translates a given translation key based on the currently selected language.\n * @param {string} key The key representing the text to be translated.\n * @returns {string} The translated text if available; otherwise, returns the original key.\n */\n translate(key) {\n const langMap = this.languages?.get(this.currentLang);\n if (!langMap) return key;\n return langMap ? langMap[key] || key : key;\n }\n\n /**\n * Translates a key into a localized string based on the provided count and pluralization type.\n * @param {string} key The base translation key to be used for fetching the localized string.\n * @param {number} [count=0] The count value used to determine the pluralization form.\n * @param {string} [type='cardinal'] The type of pluralization to use, such as 'cardinal' or 'ordinal'.\n * @returns {string} The translated string, adapted to the pluralization rules and count.\n */\n translatePlural(key, count = 0, type = 'cardinal') {\n const plural = new Intl.PluralRules(this.lang, { type: type });\n\n if (count !== undefined) key += '.' + plural.select(count);\n\n return this.translate(key);\n }\n\n /**\n * Formats a number according to the specified locale and formatting options.\n * @param {number} number The numeric value to format.\n * @param {object} options An object containing formatting options for the number.\n * @returns {string} The formatted number as a string.\n */\n formatNumber(number, options) {\n return new Intl.NumberFormat(this.currentLang, options).format(number);\n }\n\n /**\n * Formats a given date based on the specified options and the current language setting.\n * @param {string|Date|number} date The date to format. Can be a Date object, a timestamp, or a date string.\n * @param {object} options The formatting options to customize the output, as supported by Intl.DateTimeFormat.\n * @returns {string} The formatted date string based on the specified options and current language.\n */\n formatDate(date, options) {\n return new Intl.DateTimeFormat(this.currentLang, options).format(new Date(date));\n }\n\n /**\n * Formats a relative time string based on a given language, value, unit, and formatting options.\n * @param {string} lang The language to use for formatting. Defaults to `this.currentLang` if not provided.\n * @param {number} value The numerical value to format, representing the time difference.\n * @param {string} [unit] The unit of time to use (e.g., \"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\").\n * @param {object} [options] An object containing formatting options, such as the style for the numeric representation.\n * @returns {string} The formatted relative time string in the specified language.\n */\n relativeTime(lang, value = 0, unit = 'day', options = { numeric: 'auto' }) {\n lang = lang || this.currentLang;\n return new Intl.RelativeTimeFormat(lang, options).format(value, unit);\n }\n}\n\nexport function registerTranslation(...translation) {\n translation.forEach((t) => {\n if (!t.code) {\n console.error(\"Translation object is missing 'code' property:\", t);\n return;\n }\n\n const code = t.code.toLowerCase();\n if (window.translations.has(code)) {\n window.translations.set(code, { ...window.translations.get(code), ...t });\n } else {\n window.translations.set(code, t);\n }\n });\n}\n","import { LocalizerDefault, registerTranslation } from '../localize/localize.js';\n\nexport class Localizer extends LocalizerDefault {\n constructor(element) {\n super(element);\n }\n static registerTranslation(...translation) {\n registerTranslation(...translation);\n }\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB;AAAA,EAC1B,YAAY,SAAS;AAuBrB,2CAAkB,CAAC,SAAS,KAAK,QAAQ,KAAK,GAAG,EAAE,QAAQ,gBAAgB,CAAC,GAAG,SAAS,IAAI,KAAK,YAAa,CAAA,EAAE;AA1BpH;AAIQ,SAAK,UAAU;AAEf,SAAK,SAAO,UAAK,YAAL,mBAAc,WAAQ,cAAS,oBAAT,mBAA0B,SAAQ;AACpE,SAAK,QAAM,UAAK,YAAL,mBAAc,UAAO,cAAS,oBAAT,mBAA0B,QAAO;AACjE,SAAK,cAAc;AAEnB,SAAK,YAAa;AAAA,EAC1B;AAAA,EAEI,IAAI,YAAY;AACZ,WAAO,OAAO;AAAA,EACtB;AAAA;AAAA,EAGI,cAAc;AAlBlB;AAmBQ,SAAI,UAAK,cAAL,mBAAgB,IAAI,KAAK,OAAO;AAChC,WAAK,cAAc,KAAK;AAAA,IACpC,OAAe;AACH,cAAQ,MAAM,aAAa,KAAK,IAAI,eAAe;AAAA,IAC/D;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,UAAU,KAAK;AAjCnB;AAkCQ,UAAM,WAAU,UAAK,cAAL,mBAAgB,IAAI,KAAK;AACzC,QAAI,CAAC,QAAS,QAAO;AACrB,WAAO,UAAU,QAAQ,GAAG,KAAK,MAAM;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,gBAAgB,KAAK,QAAQ,GAAG,OAAO,YAAY;AAC/C,UAAM,SAAS,IAAI,KAAK,YAAY,KAAK,MAAM,EAAE,MAAY;AAE7D,QAAI,UAAU,OAAW,QAAO,MAAM,OAAO,OAAO,KAAK;AAEzD,WAAO,KAA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|
static get cssStyleSheet(): object;
|
|
23
|
-
/**
|
|
24
|
-
* Draw method for the Card element.
|
|
25
|
-
* @param {object} context The context object
|
|
26
|
-
* @param {object} store The store object
|
|
27
|
-
* @param {object} params The parameters
|
|
28
|
-
* @returns {object} fragment - The document fragment
|
|
29
|
-
*/
|
|
30
|
-
draw(context: object, store: object, params: object): object;
|
|
31
23
|
}
|
|
@@ -185,25 +185,6 @@ export default class WJElement extends HTMLElement {
|
|
|
185
185
|
* }
|
|
186
186
|
*/
|
|
187
187
|
draw(context: any, appStoreObj: any, params: any): any;
|
|
188
|
-
/**
|
|
189
|
-
* Renders the component within the provided context.
|
|
190
|
-
* @param context The rendering context, usually the element's shadow root or main DOM element.
|
|
191
|
-
* @param appStore The global application store for managing state.
|
|
192
|
-
* @param params Additional parameters or attributes for rendering the component.
|
|
193
|
-
* @returns This implementation does not render anything and returns `null`.
|
|
194
|
-
* @description
|
|
195
|
-
* The `draw` method is responsible for rendering the component's content.
|
|
196
|
-
* Override this method in subclasses to define custom rendering logic.
|
|
197
|
-
* @example
|
|
198
|
-
* class MyComponent extends WJElement {
|
|
199
|
-
* draw(context, appStore, params) {
|
|
200
|
-
* const div = document.createElement('div');
|
|
201
|
-
* div.textContent = 'Hello, world!';
|
|
202
|
-
* context.appendChild(div);
|
|
203
|
-
* }
|
|
204
|
-
* }
|
|
205
|
-
*/
|
|
206
|
-
draw(context: any, appStore: any, params: any): any;
|
|
207
188
|
/**
|
|
208
189
|
* Hook for extending behavior after drawing the component.
|
|
209
190
|
* @param context The rendering context, usually the element's shadow root or main DOM element.
|
|
@@ -217,18 +198,29 @@ export default class WJElement extends HTMLElement {
|
|
|
217
198
|
* Return: string | Node | DocumentFragment | null | Promise of those.
|
|
218
199
|
*/
|
|
219
200
|
renderSkeleton(params: any): any;
|
|
220
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Sets the delay for the skeleton loading indicator.
|
|
203
|
+
* @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,
|
|
204
|
+
* a string that can be converted to a number, null, or undefined.
|
|
205
|
+
* If null or undefined is provided, the skeleton delay will be cleared.
|
|
206
|
+
*/
|
|
207
|
+
set skeletonDelay(value: string | number | null | undefined);
|
|
221
208
|
/**
|
|
222
209
|
* Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.
|
|
223
210
|
* The method prioritizes in the following order:
|
|
224
|
-
* 1. A finite number set as the `
|
|
211
|
+
* 1. A finite number set as the `_wjSkeletonDelayOverride` property.
|
|
225
212
|
* 2. A valid numeric value from the `skeleton-delay` attribute.
|
|
226
213
|
* 3. The `skeletonDelayMs` property, if defined with a finite number.
|
|
227
214
|
* 4. A default value of 150 if none of the above are set.
|
|
228
215
|
* @returns {number} The delay in milliseconds before the skeleton is displayed.
|
|
229
216
|
*/
|
|
230
217
|
get skeletonDelay(): number;
|
|
231
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,
|
|
220
|
+
* the override for the minimum duration is removed.
|
|
221
|
+
* @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.
|
|
222
|
+
*/
|
|
223
|
+
set skeletonMinDuration(value: string | number | null | undefined);
|
|
232
224
|
/**
|
|
233
225
|
* Retrieves the minimum duration for the skeleton animation.
|
|
234
226
|
* The method checks for an internally stored finite value. If unavailable,
|
|
@@ -238,9 +230,22 @@ export default class WJElement extends HTMLElement {
|
|
|
238
230
|
* @returns {number} The minimum duration for the skeleton animation in milliseconds.
|
|
239
231
|
*/
|
|
240
232
|
get skeletonMinDuration(): number;
|
|
241
|
-
|
|
233
|
+
_wjSkeletonMinDurationOverride: number;
|
|
234
|
+
/**
|
|
235
|
+
* Sets or removes the 'skeleton' attribute based on the provided value.
|
|
236
|
+
* @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.
|
|
237
|
+
*/
|
|
242
238
|
set skeleton(value: boolean);
|
|
239
|
+
/**
|
|
240
|
+
* Checks if the 'skeleton' attribute is present on the element.
|
|
241
|
+
* @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.
|
|
242
|
+
*/
|
|
243
243
|
get skeleton(): boolean;
|
|
244
|
+
_wjSkeletonDelayOverride: number;
|
|
245
|
+
/**
|
|
246
|
+
* Retrieves the delay value used for skeleton loading.
|
|
247
|
+
* @returns {number} The delay value for the skeleton loader.
|
|
248
|
+
*/
|
|
244
249
|
get skeletonDelayValue(): number;
|
|
245
250
|
/**
|
|
246
251
|
* Lifecycle method invoked when the component is connected to the DOM.
|
|
@@ -286,7 +291,17 @@ export default class WJElement extends HTMLElement {
|
|
|
286
291
|
* @param newName The new value of the attribute.
|
|
287
292
|
*/
|
|
288
293
|
attributeChangedCallback(name: any, old: any, newName: any): void;
|
|
294
|
+
/**
|
|
295
|
+
* Triggers a refresh operation by initializing the update lifecycle and setting up promises
|
|
296
|
+
* to track its completion or failure status. Marks the instance as not pristine and queues
|
|
297
|
+
* an update.
|
|
298
|
+
* @returns {void} Does not return a value.
|
|
299
|
+
*/
|
|
289
300
|
refresh(): void;
|
|
301
|
+
/**
|
|
302
|
+
* Stops the current render loop if it is running by canceling the requestAnimationFrame.
|
|
303
|
+
* @returns {void} This method does not return a value.
|
|
304
|
+
*/
|
|
290
305
|
stopRenderLoop(): void;
|
|
291
306
|
/**
|
|
292
307
|
* Displays the component's content, optionally forcing a re-render.
|
|
@@ -332,7 +347,10 @@ export default class WJElement extends HTMLElement {
|
|
|
332
347
|
*/
|
|
333
348
|
checkGetterSetter(obj: object, property: string): object;
|
|
334
349
|
/**
|
|
335
|
-
* Sets up
|
|
350
|
+
* Sets up accessors (getter and setter) for all attributes of the current object.
|
|
351
|
+
* This method retrieves the attribute names, sanitizes them, and dynamically defines
|
|
352
|
+
* property accessors for each attribute using `Object.defineProperty`.
|
|
353
|
+
* @returns {void} This method does not return any value.
|
|
336
354
|
*/
|
|
337
355
|
setUpAccessors(): void;
|
|
338
356
|
#private;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
[ Skeleton ]
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@keyframes wje-skeleton-shimmer {
|
|
6
|
+
from {
|
|
7
|
+
transform: translateX(-100%);
|
|
8
|
+
}
|
|
9
|
+
to {
|
|
10
|
+
transform: translateX(100%);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wje-skeleton {
|
|
15
|
+
cursor: progress;
|
|
16
|
+
user-select: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.wje-skeleton-overlay {
|
|
20
|
+
display: grid;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.wje-skeleton-overlay-content,
|
|
24
|
+
.wje-skeleton-overlay-skeleton {
|
|
25
|
+
grid-area: 1 / 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wje-skeleton-overlay-skeleton {
|
|
29
|
+
display: none; /* shown in loading state */
|
|
30
|
+
pointer-events: none; /* skeleton should not be interactive */
|
|
31
|
+
align-self: stretch;
|
|
32
|
+
justify-self: stretch;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wje-skeleton-overlay-skeleton > .wje-skeleton {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Base "shape" primitives */
|
|
42
|
+
.wje-skeleton-line,
|
|
43
|
+
.wje-skeleton-head,
|
|
44
|
+
.wje-skeleton-circle,
|
|
45
|
+
.wje-skeleton-square {
|
|
46
|
+
position: relative;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
background-color: var(--wje-skeleton-bg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.wje-skeleton-line {
|
|
52
|
+
display: block;
|
|
53
|
+
height: var(--wje-skeleton-height);
|
|
54
|
+
border-radius: var(--wje-skeleton-radius);
|
|
55
|
+
width: 100%;
|
|
56
|
+
flex: 0 0 auto;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wje-skeleton-flex-row {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--wje-skeleton-gap);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.wje-skeleton-flex-column {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: var(--wje-skeleton-gap);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.wje-skeleton-line + .wje-skeleton-line,
|
|
73
|
+
.wje-skeleton-line + .wje-skeleton-head,
|
|
74
|
+
.wje-skeleton-head + .wje-skeleton-line,
|
|
75
|
+
.wje-skeleton-head + .wje-skeleton-head,
|
|
76
|
+
.wje-skeleton-circle + .wje-skeleton-line,
|
|
77
|
+
.wje-skeleton-line + .wje-skeleton-circle {
|
|
78
|
+
/*margin-top: var(--wje-skeleton-gap);*/
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.wje-skeleton-head {
|
|
82
|
+
display: block;
|
|
83
|
+
height: var(--wje-skeleton-head-height);
|
|
84
|
+
border-radius: var(--wje-skeleton-radius);
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.wje-skeleton-circle {
|
|
89
|
+
display: block;
|
|
90
|
+
flex: 1 1 0;
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
aspect-ratio: 1 / 1;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.wje-skeleton-square {
|
|
97
|
+
display: block;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 150px;
|
|
100
|
+
border-radius: var(--wje-skeleton-radius);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Shimmer layer */
|
|
104
|
+
.wje-skeleton-line::after,
|
|
105
|
+
.wje-skeleton-head::after,
|
|
106
|
+
.wje-skeleton-circle::after,
|
|
107
|
+
.wje-skeleton-square::after {
|
|
108
|
+
content: '';
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
transform: translateX(-100%);
|
|
112
|
+
animation: wje-skeleton-shimmer var(--wje-skeleton-duration) infinite;
|
|
113
|
+
background: linear-gradient(90deg, transparent, var(--wje-skeleton-highlight), transparent);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* "Stronger" variant */
|
|
117
|
+
.wje-skeleton-strong .wje-skeleton-line,
|
|
118
|
+
.wje-skeleton-strong .wje-skeleton-head,
|
|
119
|
+
.wje-skeleton-strong .wje-skeleton-circle,
|
|
120
|
+
.wje-skeleton-strong .wje-skeleton-square {
|
|
121
|
+
background-color: var(--wje-skeleton-bg-strong);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Simple layout helpers (opt-in) */
|
|
125
|
+
.wje-skeleton .flex { display: flex; }
|
|
126
|
+
.wje-skeleton .inline-flex { display: inline-flex; }
|
|
127
|
+
.wje-skeleton .align-center { align-items: center; }
|
|
128
|
+
.wje-skeleton .align-start { align-items: flex-start; }
|
|
129
|
+
.wje-skeleton .align-end { align-items: flex-end; }
|
|
130
|
+
.wje-skeleton .justify-start { justify-content: flex-start; }
|
|
131
|
+
.wje-skeleton .justify-end { justify-content: flex-end; }
|
|
132
|
+
.wje-skeleton .justify-between { justify-content: space-between; }
|
|
133
|
+
.wje-skeleton .justify-center { justify-content: center; }
|
|
134
|
+
.wje-skeleton .justify-around { justify-content: space-around; }
|
|
135
|
+
|
|
136
|
+
.wje-skeleton .gap { gap: var(--wje-skeleton-gap); }
|
|
137
|
+
|
|
138
|
+
.wje-skeleton .w-5 { width: 5%; }
|
|
139
|
+
.wje-skeleton .w-10 { width: 10%; }
|
|
140
|
+
.wje-skeleton .w-15 { width: 15%; }
|
|
141
|
+
.wje-skeleton .w-20 { width: 20%; }
|
|
142
|
+
.wje-skeleton .w-25 { width: 25%; }
|
|
143
|
+
.wje-skeleton .w-30 { width: 30%; }
|
|
144
|
+
.wje-skeleton .w-35 { width: 35%; }
|
|
145
|
+
.wje-skeleton .w-40 { width: 40%; }
|
|
146
|
+
.wje-skeleton .w-45 { width: 45%; }
|
|
147
|
+
.wje-skeleton .w-50 { width: 50%; }
|
|
148
|
+
.wje-skeleton .w-55 { width: 55%; }
|
|
149
|
+
.wje-skeleton .w-60 { width: 60%; }
|
|
150
|
+
.wje-skeleton .w-65 { width: 65%; }
|
|
151
|
+
.wje-skeleton .w-70 { width: 70%; }
|
|
152
|
+
.wje-skeleton .w-75 { width: 75%; }
|
|
153
|
+
.wje-skeleton .w-80 { width: 80%; }
|
|
154
|
+
.wje-skeleton .w-85 { width: 85%; }
|
|
155
|
+
.wje-skeleton .w-90 { width: 90%; }
|
|
156
|
+
.wje-skeleton .w-95 { width: 95%; }
|
|
157
|
+
.wje-skeleton .w-100 { width: 100%; }
|
|
158
|
+
|
|
159
|
+
.wje-skeleton .mb { margin-bottom: 16px; }
|
|
160
|
+
.wje-skeleton .mt { margin-top: 16px; }
|
|
161
|
+
.wje-skeleton .mr { margin-right: 16px; }
|
|
162
|
+
.wje-skeleton .ml { margin-left: 16px; }
|
|
163
|
+
.wje-skeleton .mbs { margin-bottom: 8px; }
|
|
164
|
+
.wje-skeleton .mts { margin-top: 8px; }
|
|
165
|
+
.wje-skeleton .mrs { margin-right: 8px; }
|
|
166
|
+
.wje-skeleton .mls { margin-left: 8px; }
|
|
167
|
+
|
|
168
|
+
/* Optional state helpers */
|
|
169
|
+
.wje-skeleton-loading .wje-skeleton-overlay-content {
|
|
170
|
+
visibility: hidden;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.wje-skeleton-loading .wje-skeleton-overlay-skeleton {
|
|
175
|
+
display: block;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@media (prefers-reduced-motion: reduce) {
|
|
179
|
+
.wje-skeleton-line::after,
|
|
180
|
+
.wje-skeleton-head::after,
|
|
181
|
+
.wje-skeleton-circle::after,
|
|
182
|
+
.wje-skeleton-square::after {
|
|
183
|
+
animation: none;
|
|
184
|
+
transform: none;
|
|
185
|
+
opacity: 0.35;
|
|
186
|
+
}
|
|
187
|
+
}
|
package/dist/wje-carousel.js
CHANGED
|
@@ -116,10 +116,20 @@ class Carousel extends WJElement {
|
|
|
116
116
|
slides.append(slot);
|
|
117
117
|
native.append(wrapper);
|
|
118
118
|
if (this.navigation) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this.
|
|
122
|
-
this.
|
|
119
|
+
let existingPrev = this.querySelector('[slot="prev"]');
|
|
120
|
+
let existingNext = this.querySelector('[slot="next"]');
|
|
121
|
+
this.prevButton = existingPrev || this.createPreviousButton();
|
|
122
|
+
this.nextButton = existingNext || this.createNextButton();
|
|
123
|
+
if (this.prevButton && !this.prevButton.dataset.wjeCarouselNavBound) {
|
|
124
|
+
this.prevButton.addEventListener("click", () => this.previousSlide());
|
|
125
|
+
this.prevButton.dataset.wjeCarouselNavBound = "true";
|
|
126
|
+
}
|
|
127
|
+
if (this.nextButton && !this.nextButton.dataset.wjeCarouselNavBound) {
|
|
128
|
+
this.nextButton.addEventListener("click", () => this.nextSlide());
|
|
129
|
+
this.nextButton.dataset.wjeCarouselNavBound = "true";
|
|
130
|
+
}
|
|
131
|
+
if (!existingPrev) this.append(this.prevButton);
|
|
132
|
+
if (!existingNext) this.append(this.nextButton);
|
|
123
133
|
wrapper.append(slotPrev);
|
|
124
134
|
wrapper.append(slotNext);
|
|
125
135
|
}
|
package/dist/wje-carousel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-carousel.js","sources":["../packages/wje-carousel/carousel.element.js","../packages/wje-carousel/carousel.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Carousel class that extends WJElement.\n * @documentation https://elements.webjet.sk/components/carousel\n * @status stable\n * @augments WJElement\n * @slot - The carousel main content.\n * @cssproperty [--wje-carousel-size=100%] - Size of the carousel component;\n */\nexport default class Carousel extends WJElement {\n /**\n * Carousel constructor method.\n */\n constructor() {\n super();\n\n this.slidePerPage = 1;\n }\n\n /**\n * Active slide attribute.\n * @param value\n */\n set activeSlide(value) {\n this.setAttribute('active-slide', value);\n }\n\n /**\n * Active slide attribute.\n * @returns {number|number}\n */\n get activeSlide() {\n return +this.getAttribute('active-slide') || 0;\n }\n\n /**\n * Pagination attribute.\n * @returns {boolean}\n */\n get pagination() {\n return this.hasAttribute('pagination');\n }\n\n /**\n * Navigation attribute.\n * @returns {boolean}\n */\n get navigation() {\n return this.hasAttribute('navigation');\n }\n\n /**\n * Thumbnails attribute.\n * @returns {boolean}\n */\n get thumbnails() {\n return this.hasAttribute('thumbnails');\n }\n\n /**\n * Loop attribute.\n * @returns {boolean}\n */\n get loop() {\n return this.hasAttribute('loop');\n }\n\n /**\n * Class name for the Carousel.\n * @type {string}\n */\n className = 'Carousel';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active-slide'];\n }\n\n /**\n * Sets up the attributes for the Carousel.\n * @param name\n * @param old\n * @param newName\n */\n attributeChangedCallback(name, old, newName) {\n if (name === 'active-slide') {\n if (this.pagination) this.changePagination();\n\n if (this.thumbnails) this.changeThumbnails();\n }\n }\n\n /**\n * Sets up the attributes for the Carousel.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Before draw method for the Carousel.\n */\n beforeDraw() {\n this.cloneFirstAndLastItems();\n }\n\n /**\n * Draw method for the Carousel.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-carousel');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('slides-wrapper');\n\n let slides = document.createElement('div');\n slides.classList.add('carousel-slides');\n\n let slot = document.createElement('slot');\n\n let slotPrev = document.createElement('slot');\n slotPrev.setAttribute('name', 'prev');\n\n let slotNext = document.createElement('slot');\n slotNext.setAttribute('name', 'next');\n\n slides.append(slot);\n native.append(wrapper);\n\n if (this.navigation) {\n this.prevButton = this.createPreviousButton();\n this.nextButton = this.createNextButton();\n\n this.append(this.prevButton);\n this.append(this.nextButton);\n\n wrapper.append(slotPrev);\n wrapper.append(slotNext);\n }\n\n wrapper.append(slides);\n\n if (this.pagination) native.append(this.createPagination());\n\n if (this.thumbnails) native.append(this.createThumbnails());\n\n fragment.append(native);\n\n this.slides = slides;\n\n return fragment;\n }\n\n /**\n * After draw method for the Carousel.\n */\n afterDraw() {\n this.setIntersectionObserver();\n this.getSlidesWithClones().forEach((slide, i) => {\n this.intersectionObserver.observe(slide);\n });\n\n this.slidePerPage = this.getAttribute('slide-per-page') || 1;\n let carouselSize = 100 / +this.slidePerPage;\n this.style.setProperty('--wje-carousel-size', carouselSize + '%');\n\n this.goToSlide(this.activeSlide, 'auto');\n\n requestAnimationFrame(() => requestAnimationFrame(() => this.syncActiveToCenter()));\n\n this.slides.addEventListener('scrollend', (e) => {\n this.syncActiveToCenter();\n });\n }\n\n /**\n * Sync `activeSlide` to the slide whose center is closest to the container center.\n */\n syncActiveToCenter() {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!withClones.length) return;\n\n const containerRect = this.slides.getBoundingClientRect();\n const containerCenterX = containerRect.left + containerRect.width / 2;\n\n let best = null;\n let bestDist = Infinity;\n withClones.forEach((el) => {\n const r = el.getBoundingClientRect();\n const center = r.left + r.width / 2;\n const dist = Math.abs(center - containerCenterX);\n if (dist < bestDist) {\n bestDist = dist;\n best = el;\n }\n });\n\n if (!best) return;\n\n const vIndex = withClones.indexOf(best);\n if (vIndex === -1) return;\n\n const logicalIndex = this.getLogicalIndexForVisual(vIndex);\n this.activeSlide = logicalIndex;\n\n // If we landed on a clone, silently snap to the corresponding real slide\n if (this.loop && (vIndex === 0 || vIndex === withClones.length - 1)) {\n this.goToSlide(logicalIndex, 'auto');\n }\n }\n\n /**\n * Sets up the IntersectionObserver for the Carousel.\n */\n setIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n },\n {\n root: this.context.querySelector('.carousel-slides'),\n threshold: 0.5,\n }\n );\n\n this.entriesMap = new Map();\n this.records = this.intersectionObserver.takeRecords();\n this.records.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n }\n\n /**\n * Goes to the slide.\n * @param index\n * @param behavior\n * @param next\n */\n goToSlide(index, behavior = 'smooth', next = true) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n\n // remove active class from all slides (including clones)\n withClones.forEach(slide => slide.classList.remove('active'));\n\n // compute logical index: wrap when loop=true, else clamp\n const maxIndex = Math.max(slides.length - 1, 0);\n let logical;\n if (this.loop && slides.length > 0) {\n logical = ((index % slides.length) + slides.length) % slides.length; // safe modulo\n } else {\n logical = Math.min(Math.max(index, 0), maxIndex);\n }\n this.activeSlide = logical;\n\n // compute visual target considering clones when loop=true\n const vIndex = this.getVisualIndexForLogical(logical);\n const targetEl = withClones[vIndex];\n if (!targetEl) return;\n\n targetEl.classList.add('active');\n\n const targetRect = targetEl.getBoundingClientRect();\n const containerRect = this.slides.getBoundingClientRect();\n\n this.slides.scrollTo({\n left: targetRect.left - containerRect.left + this.slides.scrollLeft,\n top: targetRect.top - containerRect.top + this.slides.scrollTop,\n behavior: behavior === 'smooth' ? 'smooth' : 'auto',\n });\n\n if (this.navigation && !this.loop) {\n this.nextButton.removeAttribute('disabled');\n this.prevButton.removeAttribute('disabled');\n\n if (this.activeSlide === slides.length - 1) this.nextButton.setAttribute('disabled', '');\n if (this.activeSlide === 0) this.prevButton.setAttribute('disabled', '');\n }\n }\n\n /**\n * Clones the first and last items.\n */\n cloneFirstAndLastItems() {\n const items = this.getSlides();\n\n if (items.length && this.loop) {\n // Clone first -> append to end\n const firstItemClone = items[0].cloneNode(true);\n firstItemClone.classList.add('clone');\n this.append(firstItemClone);\n\n // Clone last -> insert before the first original item so it becomes the leading clone\n const lastItemClone = items[items.length - 1].cloneNode(true);\n lastItemClone.classList.add('clone');\n this.insertBefore(lastItemClone, items[0]);\n }\n }\n\n /**\n * Goes to the next slide.\n */\n removeActiveSlide() {\n this.getSlidesWithClones().forEach((slide, i) => {\n slide.classList.remove('active');\n });\n\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item) => {\n item.classList.remove('active');\n });\n }\n\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item) => {\n item.classList.remove('active');\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changePagination() {\n if (this.pagination) {\n this.removeActiveSlide();\n this.context.querySelectorAll('.pagination-item').forEach((item, i) => {\n if (i === this.activeSlide) {\n item.classList.add('active');\n }\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changeThumbnails() {\n if (this.thumbnails) {\n this.removeActiveSlide();\n this.context.querySelectorAll('wje-thumbnail').forEach((item, i) => {\n if (i === this.activeSlide) {\n item.classList.add('active');\n }\n });\n }\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createNextButton() {\n const nextButton = document.createElement('wje-button');\n nextButton.setAttribute('part', 'next-button');\n nextButton.setAttribute('circle', '');\n nextButton.setAttribute('fill', 'link');\n nextButton.setAttribute('slot', 'next');\n nextButton.innerHTML = '<wje-icon name=\"chevron-right\" size=\"large\"></wje-icon>';\n nextButton.classList.add('next');\n nextButton.addEventListener('click', (e) => {\n this.nextSlide();\n });\n\n return nextButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPreviousButton() {\n const previousButton = document.createElement('wje-button');\n previousButton.setAttribute('part', 'previous-button');\n previousButton.setAttribute('circle', '');\n previousButton.setAttribute('fill', 'link');\n previousButton.setAttribute('slot', 'prev');\n previousButton.innerHTML = '<wje-icon name=\"chevron-left\" size=\"large\"></wje-icon>';\n previousButton.classList.add('prev');\n previousButton.addEventListener('click', (e) => {\n this.previousSlide();\n });\n\n return previousButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPagination() {\n const pagination = document.createElement('div');\n pagination.setAttribute('part', 'pagination');\n pagination.classList.add('pagination');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const paginationItem = document.createElement('div');\n paginationItem.classList.add('pagination-item');\n paginationItem.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.classList.add('active');\n this.goToSlide(i);\n });\n pagination.append(paginationItem);\n });\n\n return pagination;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createThumbnails() {\n const thumbnails = document.createElement('div');\n thumbnails.classList.add('thumbnails');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const thumbnail = document.createElement('wje-thumbnail');\n thumbnail.innerHTML = `<img src=\"${slide.querySelector('wje-img').getAttribute('src')}\"></img>`;\n thumbnail.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.closest('wje-thumbnail').classList.add('active');\n this.goToSlide(i);\n });\n thumbnails.append(thumbnail);\n });\n\n return thumbnails;\n }\n\n /**\n * Goes to the next slide.\n */\n nextSlide() {\n this.goToSlide(this.activeSlide + this.slidePerPage);\n }\n\n /**\n * Goes to the previous slide.\n */\n previousSlide() {\n this.goToSlide(this.activeSlide - this.slidePerPage);\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlides() {\n return Array.from(this.querySelectorAll('wje-carousel-item:not(.clone)'));\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlidesWithClones() {\n return Array.from(this.querySelectorAll('wje-carousel-item'));\n }\n\n /** Maps logical index -> visual index (accounts for leading clone when loop=true) */\n getVisualIndexForLogical(index) {\n return this.loop ? index + 1 : index;\n }\n\n /** Maps visual index -> logical index (handles clones at 0 and last when loop=true) */\n getLogicalIndexForVisual(vIndex) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!this.loop) return vIndex;\n if (vIndex === 0) return slides.length - 1; // leading clone\n if (vIndex === withClones.length - 1) return 0; // trailing clone\n return vIndex - 1;\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoNext() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft < (el.scrollWidth - el.clientWidth);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoPrevious() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft > 0;\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Carousel from './carousel.element.js';\n\n// export * from \"./carousel.element.js\";\nexport default Carousel;\n\nWJElement.define('wje-carousel', Carousel);\n"],"names":[],"mappings":";;;;;AAWe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAO;AAyDX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAvDR,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,YAAY,OAAO;AACnB,SAAK,aAAa,gBAAgB,KAAK;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,cAAc;AACd,WAAO,CAAC,KAAK,aAAa,cAAc,KAAK;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM;AAAA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YAAY;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA,EAKI,gBAAgB;AACZ,SAAK,UAAU,KAAK,cAAc,KAAK,YAAY;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,WAAO,MAAM,KAAK,KAAK,iBAAiB,+BAA+B,CAAC;AAAA,EAChF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,sBAAsB;AAClB,WAAO,MAAM,KAAK,KAAK,iBAAiB,mBAAmB,CAAC;AAAA,EACpE;AAAA;AAAA,EAGI,yBAAyB,OAAO;AAC5B,WAAO,KAAK,OAAO,QAAQ,IAAI;AAAA,EACvC;AAAA;AAAA,EAGI,yBAAyB,QAAQ;AAC7B,UAAM,SAAS,KAAK,UAAW;AAC/B,UAAM,aAAa,KAAK,oBAAqB;AAC7C,QAAI,CAAC,KAAK,KAAM,QAAO;AACvB,QAAI,WAAW,EAAG,QAAO,OAAO,SAAS;AACzC,QAAI,WAAW,WAAW,SAAS,EAAG,QAAO;AAC7C,WAAO,SAAS;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAc,GAAG,cAAc,GAAG;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,gBAAgB;AACZ,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAa;AAAA,EAC/B;AACA;AC7fA,UAAU,OAAO,gBAAgB,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"wje-carousel.js","sources":["../packages/wje-carousel/carousel.element.js","../packages/wje-carousel/carousel.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Carousel class that extends WJElement.\n * @documentation https://elements.webjet.sk/components/carousel\n * @status stable\n * @augments WJElement\n * @slot - The carousel main content.\n * @cssproperty [--wje-carousel-size=100%] - Size of the carousel component;\n */\nexport default class Carousel extends WJElement {\n /**\n * Carousel constructor method.\n */\n constructor() {\n super();\n\n this.slidePerPage = 1;\n }\n\n /**\n * Active slide attribute.\n * @param value\n */\n set activeSlide(value) {\n this.setAttribute('active-slide', value);\n }\n\n /**\n * Active slide attribute.\n * @returns {number|number}\n */\n get activeSlide() {\n return +this.getAttribute('active-slide') || 0;\n }\n\n /**\n * Pagination attribute.\n * @returns {boolean}\n */\n get pagination() {\n return this.hasAttribute('pagination');\n }\n\n /**\n * Navigation attribute.\n * @returns {boolean}\n */\n get navigation() {\n return this.hasAttribute('navigation');\n }\n\n /**\n * Thumbnails attribute.\n * @returns {boolean}\n */\n get thumbnails() {\n return this.hasAttribute('thumbnails');\n }\n\n /**\n * Loop attribute.\n * @returns {boolean}\n */\n get loop() {\n return this.hasAttribute('loop');\n }\n\n /**\n * Class name for the Carousel.\n * @type {string}\n */\n className = 'Carousel';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active-slide'];\n }\n\n /**\n * Sets up the attributes for the Carousel.\n * @param name\n * @param old\n * @param newName\n */\n attributeChangedCallback(name, old, newName) {\n if (name === 'active-slide') {\n if (this.pagination) this.changePagination();\n\n if (this.thumbnails) this.changeThumbnails();\n }\n }\n\n /**\n * Sets up the attributes for the Carousel.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Before draw method for the Carousel.\n */\n beforeDraw() {\n this.cloneFirstAndLastItems();\n }\n\n /**\n * Draw method for the Carousel.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-carousel');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('slides-wrapper');\n\n let slides = document.createElement('div');\n slides.classList.add('carousel-slides');\n\n let slot = document.createElement('slot');\n\n let slotPrev = document.createElement('slot');\n slotPrev.setAttribute('name', 'prev');\n\n let slotNext = document.createElement('slot');\n slotNext.setAttribute('name', 'next');\n\n slides.append(slot);\n native.append(wrapper);\n\n if (this.navigation) {\n let existingPrev = this.querySelector('[slot=\"prev\"]');\n let existingNext = this.querySelector('[slot=\"next\"]');\n\n this.prevButton = existingPrev || this.createPreviousButton();\n this.nextButton = existingNext || this.createNextButton();\n\n if (this.prevButton && !this.prevButton.dataset.wjeCarouselNavBound) {\n this.prevButton.addEventListener('click', () => this.previousSlide());\n this.prevButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (this.nextButton && !this.nextButton.dataset.wjeCarouselNavBound) {\n this.nextButton.addEventListener('click', () => this.nextSlide());\n this.nextButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (!existingPrev) this.append(this.prevButton);\n if (!existingNext) this.append(this.nextButton);\n\n wrapper.append(slotPrev);\n wrapper.append(slotNext);\n }\n\n wrapper.append(slides);\n\n if (this.pagination) native.append(this.createPagination());\n\n if (this.thumbnails) native.append(this.createThumbnails());\n\n fragment.append(native);\n\n this.slides = slides;\n\n return fragment;\n }\n\n /**\n * After draw method for the Carousel.\n */\n afterDraw() {\n this.setIntersectionObserver();\n this.getSlidesWithClones().forEach((slide, i) => {\n this.intersectionObserver.observe(slide);\n });\n\n this.slidePerPage = this.getAttribute('slide-per-page') || 1;\n let carouselSize = 100 / +this.slidePerPage;\n this.style.setProperty('--wje-carousel-size', carouselSize + '%');\n\n this.goToSlide(this.activeSlide, 'auto');\n\n requestAnimationFrame(() => requestAnimationFrame(() => this.syncActiveToCenter()));\n\n this.slides.addEventListener('scrollend', (e) => {\n this.syncActiveToCenter();\n });\n }\n\n /**\n * Sync `activeSlide` to the slide whose center is closest to the container center.\n */\n syncActiveToCenter() {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!withClones.length) return;\n\n const containerRect = this.slides.getBoundingClientRect();\n const containerCenterX = containerRect.left + containerRect.width / 2;\n\n let best = null;\n let bestDist = Infinity;\n withClones.forEach((el) => {\n const r = el.getBoundingClientRect();\n const center = r.left + r.width / 2;\n const dist = Math.abs(center - containerCenterX);\n if (dist < bestDist) {\n bestDist = dist;\n best = el;\n }\n });\n\n if (!best) return;\n\n const vIndex = withClones.indexOf(best);\n if (vIndex === -1) return;\n\n const logicalIndex = this.getLogicalIndexForVisual(vIndex);\n this.activeSlide = logicalIndex;\n\n // If we landed on a clone, silently snap to the corresponding real slide\n if (this.loop && (vIndex === 0 || vIndex === withClones.length - 1)) {\n this.goToSlide(logicalIndex, 'auto');\n }\n }\n\n /**\n * Sets up the IntersectionObserver for the Carousel.\n */\n setIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n },\n {\n root: this.context.querySelector('.carousel-slides'),\n threshold: 0.5,\n }\n );\n\n this.entriesMap = new Map();\n this.records = this.intersectionObserver.takeRecords();\n this.records.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n }\n\n /**\n * Goes to the slide.\n * @param index\n * @param behavior\n * @param next\n */\n goToSlide(index, behavior = 'smooth', next = true) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n\n // remove active class from all slides (including clones)\n withClones.forEach(slide => slide.classList.remove('active'));\n\n // compute logical index: wrap when loop=true, else clamp\n const maxIndex = Math.max(slides.length - 1, 0);\n let logical;\n if (this.loop && slides.length > 0) {\n logical = ((index % slides.length) + slides.length) % slides.length; // safe modulo\n } else {\n logical = Math.min(Math.max(index, 0), maxIndex);\n }\n this.activeSlide = logical;\n\n // compute visual target considering clones when loop=true\n const vIndex = this.getVisualIndexForLogical(logical);\n const targetEl = withClones[vIndex];\n if (!targetEl) return;\n\n targetEl.classList.add('active');\n\n const targetRect = targetEl.getBoundingClientRect();\n const containerRect = this.slides.getBoundingClientRect();\n\n this.slides.scrollTo({\n left: targetRect.left - containerRect.left + this.slides.scrollLeft,\n top: targetRect.top - containerRect.top + this.slides.scrollTop,\n behavior: behavior === 'smooth' ? 'smooth' : 'auto',\n });\n\n if (this.navigation && !this.loop) {\n this.nextButton.removeAttribute('disabled');\n this.prevButton.removeAttribute('disabled');\n\n if (this.activeSlide === slides.length - 1) this.nextButton.setAttribute('disabled', '');\n if (this.activeSlide === 0) this.prevButton.setAttribute('disabled', '');\n }\n }\n\n /**\n * Clones the first and last items.\n */\n cloneFirstAndLastItems() {\n const items = this.getSlides();\n\n if (items.length && this.loop) {\n // Clone first -> append to end\n const firstItemClone = items[0].cloneNode(true);\n firstItemClone.classList.add('clone');\n this.append(firstItemClone);\n\n // Clone last -> insert before the first original item so it becomes the leading clone\n const lastItemClone = items[items.length - 1].cloneNode(true);\n lastItemClone.classList.add('clone');\n this.insertBefore(lastItemClone, items[0]);\n }\n }\n\n /**\n * Goes to the next slide.\n */\n removeActiveSlide() {\n this.getSlidesWithClones().forEach((slide, i) => {\n slide.classList.remove('active');\n });\n\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item) => {\n item.classList.remove('active');\n });\n }\n\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item) => {\n item.classList.remove('active');\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changePagination() {\n if (this.pagination) {\n this.removeActiveSlide();\n this.context.querySelectorAll('.pagination-item').forEach((item, i) => {\n if (i === this.activeSlide) {\n item.classList.add('active');\n }\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changeThumbnails() {\n if (this.thumbnails) {\n this.removeActiveSlide();\n this.context.querySelectorAll('wje-thumbnail').forEach((item, i) => {\n if (i === this.activeSlide) {\n item.classList.add('active');\n }\n });\n }\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createNextButton() {\n const nextButton = document.createElement('wje-button');\n nextButton.setAttribute('part', 'next-button');\n nextButton.setAttribute('circle', '');\n nextButton.setAttribute('fill', 'link');\n nextButton.setAttribute('slot', 'next');\n nextButton.innerHTML = '<wje-icon name=\"chevron-right\" size=\"large\"></wje-icon>';\n nextButton.classList.add('next');\n nextButton.addEventListener('click', (e) => {\n this.nextSlide();\n });\n\n return nextButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPreviousButton() {\n const previousButton = document.createElement('wje-button');\n previousButton.setAttribute('part', 'previous-button');\n previousButton.setAttribute('circle', '');\n previousButton.setAttribute('fill', 'link');\n previousButton.setAttribute('slot', 'prev');\n previousButton.innerHTML = '<wje-icon name=\"chevron-left\" size=\"large\"></wje-icon>';\n previousButton.classList.add('prev');\n previousButton.addEventListener('click', (e) => {\n this.previousSlide();\n });\n\n return previousButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPagination() {\n const pagination = document.createElement('div');\n pagination.setAttribute('part', 'pagination');\n pagination.classList.add('pagination');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const paginationItem = document.createElement('div');\n paginationItem.classList.add('pagination-item');\n paginationItem.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.classList.add('active');\n this.goToSlide(i);\n });\n pagination.append(paginationItem);\n });\n\n return pagination;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createThumbnails() {\n const thumbnails = document.createElement('div');\n thumbnails.classList.add('thumbnails');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const thumbnail = document.createElement('wje-thumbnail');\n thumbnail.innerHTML = `<img src=\"${slide.querySelector('wje-img').getAttribute('src')}\"></img>`;\n thumbnail.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.closest('wje-thumbnail').classList.add('active');\n this.goToSlide(i);\n });\n thumbnails.append(thumbnail);\n });\n\n return thumbnails;\n }\n\n /**\n * Goes to the next slide.\n */\n nextSlide() {\n this.goToSlide(this.activeSlide + this.slidePerPage);\n }\n\n /**\n * Goes to the previous slide.\n */\n previousSlide() {\n this.goToSlide(this.activeSlide - this.slidePerPage);\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlides() {\n return Array.from(this.querySelectorAll('wje-carousel-item:not(.clone)'));\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlidesWithClones() {\n return Array.from(this.querySelectorAll('wje-carousel-item'));\n }\n\n /** Maps logical index -> visual index (accounts for leading clone when loop=true) */\n getVisualIndexForLogical(index) {\n return this.loop ? index + 1 : index;\n }\n\n /** Maps visual index -> logical index (handles clones at 0 and last when loop=true) */\n getLogicalIndexForVisual(vIndex) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!this.loop) return vIndex;\n if (vIndex === 0) return slides.length - 1; // leading clone\n if (vIndex === withClones.length - 1) return 0; // trailing clone\n return vIndex - 1;\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoNext() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft < (el.scrollWidth - el.clientWidth);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoPrevious() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft > 0;\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Carousel from './carousel.element.js';\n\n// export * from \"./carousel.element.js\";\nexport default Carousel;\n\nWJElement.define('wje-carousel', Carousel);\n"],"names":[],"mappings":";;;;;AAWe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAO;AAyDX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAvDR,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,YAAY,OAAO;AACnB,SAAK,aAAa,gBAAgB,KAAK;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,cAAc;AACd,WAAO,CAAC,KAAK,aAAa,cAAc,KAAK;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAA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AAC,KAAK,KAAM,QAAO;AACvB,QAAI,WAAW,EAAG,QAAO,OAAO,SAAS;AACzC,QAAI,WAAW,WAAW,SAAS,EAAG,QAAO;AAC7C,WAAO,SAAS;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAc,GAAG,cAAc,GAAG;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,gBAAgB;AACZ,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAa;AAAA,EAC/B;AACA;AC1gBA,UAAU,OAAO,gBAAgB,QAAQ;"}
|
package/dist/wje-element.js
CHANGED
|
@@ -15,201 +15,8 @@ import { Permissions } from "./permissions.js";
|
|
|
15
15
|
import { WjElementUtils } from "./element-utils.js";
|
|
16
16
|
import { event } from "./event.js";
|
|
17
17
|
import { store, defaultStoreActions } from "./wje-store.js";
|
|
18
|
-
const skeletonCss = `/*
|
|
19
|
-
[ Skeleton ]
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
@keyframes wje-skeleton-shimmer {
|
|
23
|
-
from {
|
|
24
|
-
transform: translateX(-100%);
|
|
25
|
-
}
|
|
26
|
-
to {
|
|
27
|
-
transform: translateX(100%);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.wje-skeleton {
|
|
32
|
-
cursor: progress;
|
|
33
|
-
user-select: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.wje-skeleton-overlay {
|
|
37
|
-
display: grid;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.wje-skeleton-overlay-content,
|
|
41
|
-
.wje-skeleton-overlay-skeleton {
|
|
42
|
-
grid-area: 1 / 1;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.wje-skeleton-overlay-skeleton {
|
|
46
|
-
display: none; /* shown in loading state */
|
|
47
|
-
pointer-events: none; /* skeleton should not be interactive */
|
|
48
|
-
align-self: stretch;
|
|
49
|
-
justify-self: stretch;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.wje-skeleton-overlay-skeleton > .wje-skeleton {
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: 100%;
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* Base "shape" primitives */
|
|
59
|
-
.wje-skeleton-line,
|
|
60
|
-
.wje-skeleton-head,
|
|
61
|
-
.wje-skeleton-circle,
|
|
62
|
-
.wje-skeleton-square {
|
|
63
|
-
position: relative;
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
background-color: var(--wje-skeleton-bg);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.wje-skeleton-line {
|
|
69
|
-
display: block;
|
|
70
|
-
height: var(--wje-skeleton-height);
|
|
71
|
-
border-radius: var(--wje-skeleton-radius);
|
|
72
|
-
width: 100%;
|
|
73
|
-
flex: 0 0 auto;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.wje-skeleton-flex-row {
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-direction: row;
|
|
79
|
-
align-items: center;
|
|
80
|
-
gap: var(--wje-skeleton-gap);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.wje-skeleton-flex-column {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
gap: var(--wje-skeleton-gap);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.wje-skeleton-line + .wje-skeleton-line,
|
|
90
|
-
.wje-skeleton-line + .wje-skeleton-head,
|
|
91
|
-
.wje-skeleton-head + .wje-skeleton-line,
|
|
92
|
-
.wje-skeleton-head + .wje-skeleton-head,
|
|
93
|
-
.wje-skeleton-circle + .wje-skeleton-line,
|
|
94
|
-
.wje-skeleton-line + .wje-skeleton-circle {
|
|
95
|
-
/*margin-top: var(--wje-skeleton-gap);*/
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.wje-skeleton-head {
|
|
99
|
-
display: block;
|
|
100
|
-
height: var(--wje-skeleton-head-height);
|
|
101
|
-
border-radius: var(--wje-skeleton-radius);
|
|
102
|
-
width: 100%;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.wje-skeleton-circle {
|
|
106
|
-
display: block;
|
|
107
|
-
/* Take remaining width in flex row (e.g. 40% if sibling is w-60) */
|
|
108
|
-
flex: 1 1 0;
|
|
109
|
-
max-width: 100%;
|
|
110
|
-
aspect-ratio: 1 / 1;
|
|
111
|
-
border-radius: 50%;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.wje-skeleton-square {
|
|
115
|
-
display: block;
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: 150px;
|
|
118
|
-
border-radius: 8px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/* Shimmer layer */
|
|
122
|
-
.wje-skeleton-line::after,
|
|
123
|
-
.wje-skeleton-head::after,
|
|
124
|
-
.wje-skeleton-circle::after,
|
|
125
|
-
.wje-skeleton-square::after {
|
|
126
|
-
content: '';
|
|
127
|
-
position: absolute;
|
|
128
|
-
inset: 0;
|
|
129
|
-
transform: translateX(-100%);
|
|
130
|
-
animation: wje-skeleton-shimmer var(--wje-skeleton-duration) infinite;
|
|
131
|
-
background: linear-gradient(90deg, transparent, var(--wje-skeleton-highlight), transparent);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* "Stronger" variant */
|
|
135
|
-
.wje-skeleton-strong .wje-skeleton-line,
|
|
136
|
-
.wje-skeleton-strong .wje-skeleton-head,
|
|
137
|
-
.wje-skeleton-strong .wje-skeleton-circle,
|
|
138
|
-
.wje-skeleton-strong .wje-skeleton-square {
|
|
139
|
-
background-color: var(--wje-skeleton-bg-strong);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* Simple layout helpers (opt-in) */
|
|
143
|
-
.wje-skeleton .flex { display: flex; }
|
|
144
|
-
.wje-skeleton .inline-flex { display: inline-flex; }
|
|
145
|
-
.wje-skeleton .align-center { align-items: center; }
|
|
146
|
-
.wje-skeleton .align-start { align-items: flex-start; }
|
|
147
|
-
.wje-skeleton .align-end { align-items: flex-end; }
|
|
148
|
-
.wje-skeleton .justify-start { justify-content: flex-start; }
|
|
149
|
-
.wje-skeleton .justify-end { justify-content: flex-end; }
|
|
150
|
-
.wje-skeleton .justify-between { justify-content: space-between; }
|
|
151
|
-
.wje-skeleton .justify-center { justify-content: center; }
|
|
152
|
-
.wje-skeleton .justify-around { justify-content: space-around; }
|
|
153
|
-
|
|
154
|
-
.wje-skeleton .gap { gap: var(--wje-skeleton-gap); }
|
|
155
|
-
|
|
156
|
-
.wje-skeleton .w-5 { width: 5%; }
|
|
157
|
-
.wje-skeleton .w-10 { width: 10%; }
|
|
158
|
-
.wje-skeleton .w-15 { width: 15%; }
|
|
159
|
-
.wje-skeleton .w-20 { width: 20%; }
|
|
160
|
-
.wje-skeleton .w-25 { width: 25%; }
|
|
161
|
-
.wje-skeleton .w-30 { width: 30%; }
|
|
162
|
-
.wje-skeleton .w-35 { width: 35%; }
|
|
163
|
-
.wje-skeleton .w-40 { width: 40%; }
|
|
164
|
-
.wje-skeleton .w-45 { width: 45%; }
|
|
165
|
-
.wje-skeleton .w-50 { width: 50%; }
|
|
166
|
-
.wje-skeleton .w-55 { width: 55%; }
|
|
167
|
-
.wje-skeleton .w-60 { width: 60%; }
|
|
168
|
-
.wje-skeleton .w-65 { width: 65%; }
|
|
169
|
-
.wje-skeleton .w-70 { width: 70%; }
|
|
170
|
-
.wje-skeleton .w-75 { width: 75%; }
|
|
171
|
-
.wje-skeleton .w-80 { width: 80%; }
|
|
172
|
-
.wje-skeleton .w-85 { width: 85%; }
|
|
173
|
-
.wje-skeleton .w-90 { width: 90%; }
|
|
174
|
-
.wje-skeleton .w-95 { width: 95%; }
|
|
175
|
-
.wje-skeleton .w-100 { width: 100%; }
|
|
176
|
-
|
|
177
|
-
.wje-skeleton .mb { margin-bottom: 16px; }
|
|
178
|
-
.wje-skeleton .mt { margin-top: 16px; }
|
|
179
|
-
.wje-skeleton .mr { margin-right: 16px; }
|
|
180
|
-
.wje-skeleton .ml { margin-left: 16px; }
|
|
181
|
-
.wje-skeleton .mbs { margin-bottom: 8px; }
|
|
182
|
-
.wje-skeleton .mts { margin-top: 8px; }
|
|
183
|
-
.wje-skeleton .mrs { margin-right: 8px; }
|
|
184
|
-
.wje-skeleton .mls { margin-left: 8px; }
|
|
185
|
-
|
|
186
|
-
/* Optional state helpers */
|
|
187
|
-
.wje-skeleton-loading .wje-skeleton-overlay-content {
|
|
188
|
-
visibility: hidden;
|
|
189
|
-
pointer-events: none;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.wje-skeleton-loading .wje-skeleton-overlay-skeleton {
|
|
193
|
-
display: block;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
@media (prefers-reduced-motion: reduce) {
|
|
197
|
-
.wje-skeleton-line::after,
|
|
198
|
-
.wje-skeleton-head::after,
|
|
199
|
-
.wje-skeleton-circle::after,
|
|
200
|
-
.wje-skeleton-square::after {
|
|
201
|
-
animation: none;
|
|
202
|
-
transform: none;
|
|
203
|
-
opacity: 0.35;
|
|
204
|
-
}
|
|
205
|
-
}`;
|
|
206
18
|
const template = document.createElement("template");
|
|
207
19
|
template.innerHTML = ``;
|
|
208
|
-
const wjSkeletonSheet = new CSSStyleSheet();
|
|
209
|
-
try {
|
|
210
|
-
wjSkeletonSheet.replaceSync(skeletonCss);
|
|
211
|
-
} catch (e) {
|
|
212
|
-
}
|
|
213
20
|
const _WJElement = class _WJElement extends HTMLElement {
|
|
214
21
|
/**
|
|
215
22
|
* Initializes a new instance of the WJElement class.
|
|
@@ -242,9 +49,6 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
242
49
|
if (this.shadowRoot) {
|
|
243
50
|
const existing = this.shadowRoot.adoptedStyleSheets || [];
|
|
244
51
|
const next = [...existing];
|
|
245
|
-
if (!next.includes(wjSkeletonSheet) && wjSkeletonSheet.cssRules !== void 0) {
|
|
246
|
-
next.push(wjSkeletonSheet);
|
|
247
|
-
}
|
|
248
52
|
if (!next.includes(sheet)) next.push(sheet);
|
|
249
53
|
this.shadowRoot.adoptedStyleSheets = next;
|
|
250
54
|
}
|
|
@@ -476,16 +280,16 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
476
280
|
/**
|
|
477
281
|
* Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.
|
|
478
282
|
* The method prioritizes in the following order:
|
|
479
|
-
* 1. A finite number set as the `
|
|
283
|
+
* 1. A finite number set as the `_wjSkeletonDelayOverride` property.
|
|
480
284
|
* 2. A valid numeric value from the `skeleton-delay` attribute.
|
|
481
285
|
* 3. The `skeletonDelayMs` property, if defined with a finite number.
|
|
482
286
|
* 4. A default value of 150 if none of the above are set.
|
|
483
287
|
* @returns {number} The delay in milliseconds before the skeleton is displayed.
|
|
484
288
|
*/
|
|
485
289
|
get skeletonDelay() {
|
|
486
|
-
if (Number.isFinite(this.
|
|
290
|
+
if (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;
|
|
487
291
|
const v = this.getAttribute("skeleton-delay");
|
|
488
|
-
const n = v
|
|
292
|
+
const n = v === null || v === void 0 ? NaN : Number(v);
|
|
489
293
|
if (Number.isFinite(n)) return n;
|
|
490
294
|
if (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;
|
|
491
295
|
return 150;
|
|
@@ -499,44 +303,66 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
499
303
|
* @returns {number} The minimum duration for the skeleton animation in milliseconds.
|
|
500
304
|
*/
|
|
501
305
|
get skeletonMinDuration() {
|
|
502
|
-
if (Number.isFinite(this.
|
|
306
|
+
if (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;
|
|
503
307
|
const v = this.getAttribute("skeleton-min-duration");
|
|
504
|
-
const n = v
|
|
308
|
+
const n = v === null || v === void 0 ? NaN : Number(v);
|
|
505
309
|
if (Number.isFinite(n)) return n;
|
|
506
310
|
return 300;
|
|
507
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,
|
|
314
|
+
* the override for the minimum duration is removed.
|
|
315
|
+
* @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.
|
|
316
|
+
*/
|
|
508
317
|
set skeletonMinDuration(value) {
|
|
509
318
|
if (value === null || value === void 0 || value === "") {
|
|
510
|
-
delete this.
|
|
319
|
+
delete this._wjSkeletonMinDurationOverride;
|
|
511
320
|
this.removeAttribute("skeleton-min-duration");
|
|
512
321
|
return;
|
|
513
322
|
}
|
|
514
323
|
const n = Number(value);
|
|
515
324
|
if (Number.isFinite(n)) {
|
|
516
|
-
this.
|
|
325
|
+
this._wjSkeletonMinDurationOverride = n;
|
|
517
326
|
this.setAttribute("skeleton-min-duration", String(n));
|
|
518
327
|
}
|
|
519
328
|
}
|
|
520
|
-
|
|
329
|
+
/**
|
|
330
|
+
* Sets or removes the 'skeleton' attribute based on the provided value.
|
|
331
|
+
* @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.
|
|
332
|
+
*/
|
|
521
333
|
set skeleton(value) {
|
|
522
334
|
if (value) this.setAttribute("skeleton", "");
|
|
523
335
|
else this.removeAttribute("skeleton");
|
|
524
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* Checks if the 'skeleton' attribute is present on the element.
|
|
339
|
+
* @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.
|
|
340
|
+
*/
|
|
525
341
|
get skeleton() {
|
|
526
342
|
return this.hasAttribute("skeleton");
|
|
527
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Sets the delay for the skeleton loading indicator.
|
|
346
|
+
* @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,
|
|
347
|
+
* a string that can be converted to a number, null, or undefined.
|
|
348
|
+
* If null or undefined is provided, the skeleton delay will be cleared.
|
|
349
|
+
*/
|
|
528
350
|
set skeletonDelay(value) {
|
|
529
351
|
if (value === null || value === void 0 || value === "") {
|
|
530
|
-
delete this.
|
|
352
|
+
delete this._wjSkeletonDelayOverride;
|
|
531
353
|
this.removeAttribute("skeleton-delay");
|
|
532
354
|
return;
|
|
533
355
|
}
|
|
534
356
|
const n = Number(value);
|
|
535
357
|
if (Number.isFinite(n)) {
|
|
536
|
-
this.
|
|
358
|
+
this._wjSkeletonDelayOverride = n;
|
|
537
359
|
this.setAttribute("skeleton-delay", String(n));
|
|
538
360
|
}
|
|
539
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Retrieves the delay value used for skeleton loading.
|
|
364
|
+
* @returns {number} The delay value for the skeleton loader.
|
|
365
|
+
*/
|
|
540
366
|
get skeletonDelayValue() {
|
|
541
367
|
return this.skeletonDelay;
|
|
542
368
|
}
|
|
@@ -621,6 +447,12 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
621
447
|
__privateMethod(this, _WJElement_instances, enqueueUpdate_fn).call(this);
|
|
622
448
|
}
|
|
623
449
|
}
|
|
450
|
+
/**
|
|
451
|
+
* Triggers a refresh operation by initializing the update lifecycle and setting up promises
|
|
452
|
+
* to track its completion or failure status. Marks the instance as not pristine and queues
|
|
453
|
+
* an update.
|
|
454
|
+
* @returns {void} Does not return a value.
|
|
455
|
+
*/
|
|
624
456
|
refresh() {
|
|
625
457
|
this.updateComplete = new Promise((resolve, reject) => {
|
|
626
458
|
this.finisPromise = resolve;
|
|
@@ -629,33 +461,16 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
629
461
|
__privateSet(this, _pristine, false);
|
|
630
462
|
__privateMethod(this, _WJElement_instances, enqueueUpdate_fn).call(this);
|
|
631
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* Stops the current render loop if it is running by canceling the requestAnimationFrame.
|
|
466
|
+
* @returns {void} This method does not return a value.
|
|
467
|
+
*/
|
|
632
468
|
stopRenderLoop() {
|
|
633
469
|
if (this.rafId) {
|
|
634
470
|
cancelAnimationFrame(this.rafId);
|
|
635
471
|
this.rafId = null;
|
|
636
472
|
}
|
|
637
473
|
}
|
|
638
|
-
/**
|
|
639
|
-
* Renders the component within the provided context.
|
|
640
|
-
* @param context The rendering context, usually the element's shadow root or main DOM element.
|
|
641
|
-
* @param appStore The global application store for managing state.
|
|
642
|
-
* @param params Additional parameters or attributes for rendering the component.
|
|
643
|
-
* @returns This implementation does not render anything and returns `null`.
|
|
644
|
-
* @description
|
|
645
|
-
* The `draw` method is responsible for rendering the component's content.
|
|
646
|
-
* Override this method in subclasses to define custom rendering logic.
|
|
647
|
-
* @example
|
|
648
|
-
* class MyComponent extends WJElement {
|
|
649
|
-
* draw(context, appStore, params) {
|
|
650
|
-
* const div = document.createElement('div');
|
|
651
|
-
* div.textContent = 'Hello, world!';
|
|
652
|
-
* context.appendChild(div);
|
|
653
|
-
* }
|
|
654
|
-
* }
|
|
655
|
-
*/
|
|
656
|
-
draw(context, appStore, params) {
|
|
657
|
-
return null;
|
|
658
|
-
}
|
|
659
474
|
/**
|
|
660
475
|
* Displays the component's content, optionally forcing a re-render.
|
|
661
476
|
* @param [force] Whether to force a re-render.
|
|
@@ -682,14 +497,15 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
682
497
|
var _a, _b;
|
|
683
498
|
const slotted = this.querySelector('[slot="skeleton"]');
|
|
684
499
|
if (slotted) {
|
|
685
|
-
this.
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
500
|
+
if (this.hasShadowRoot) {
|
|
501
|
+
const frag3 = document.createDocumentFragment();
|
|
502
|
+
const slot = document.createElement("slot");
|
|
503
|
+
slot.name = "skeleton";
|
|
504
|
+
frag3.append(slot);
|
|
505
|
+
return frag3;
|
|
506
|
+
}
|
|
691
507
|
const frag2 = document.createDocumentFragment();
|
|
692
|
-
frag2.append(
|
|
508
|
+
frag2.append(slotted.cloneNode(true));
|
|
693
509
|
return frag2;
|
|
694
510
|
}
|
|
695
511
|
const frag = document.createDocumentFragment();
|
|
@@ -697,7 +513,7 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
697
513
|
if (skel instanceof Promise || ((_b = skel == null ? void 0 : skel.constructor) == null ? void 0 : _b.name) === "Promise") {
|
|
698
514
|
skel = await skel;
|
|
699
515
|
}
|
|
700
|
-
if (skel
|
|
516
|
+
if (skel === null || skel === void 0) return null;
|
|
701
517
|
let node;
|
|
702
518
|
if (skel instanceof HTMLElement || skel instanceof DocumentFragment) {
|
|
703
519
|
node = skel;
|
|
@@ -721,12 +537,6 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
721
537
|
} catch (e) {
|
|
722
538
|
}
|
|
723
539
|
if (this.hasShadowRoot) {
|
|
724
|
-
if (this.shadowRoot) {
|
|
725
|
-
const existing = this.shadowRoot.adoptedStyleSheets || [];
|
|
726
|
-
if (!existing.includes(wjSkeletonSheet) && wjSkeletonSheet.cssRules !== void 0) {
|
|
727
|
-
this.shadowRoot.adoptedStyleSheets = [...existing, wjSkeletonSheet];
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
540
|
this.shadowRoot.replaceChildren(frag);
|
|
731
541
|
} else {
|
|
732
542
|
this.replaceChildren(frag);
|
|
@@ -874,7 +684,10 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
874
684
|
return { hasGetter: null, hasSetter: null };
|
|
875
685
|
}
|
|
876
686
|
/**
|
|
877
|
-
* Sets up
|
|
687
|
+
* Sets up accessors (getter and setter) for all attributes of the current object.
|
|
688
|
+
* This method retrieves the attribute names, sanitizes them, and dynamically defines
|
|
689
|
+
* property accessors for each attribute using `Object.defineProperty`.
|
|
690
|
+
* @returns {void} This method does not return any value.
|
|
878
691
|
*/
|
|
879
692
|
setUpAccessors() {
|
|
880
693
|
let attrs = this.getAttributeNames();
|
package/dist/wje-element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\nimport skeletonCss from '../styles/skeleton.css?inline';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\n// Shared skeleton helpers for Shadow DOM (global CSS doesn't cross the shadow boundary)\nconst wjSkeletonSheet = new CSSStyleSheet();\ntry {\n\twjSkeletonSheet.replaceSync(skeletonCss);\n} catch (e) {\n\t// ignore (older browsers / non-constructable stylesheets)\n}\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonSlotClone` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\t// 1) property override\n\t\tif (Number.isFinite(this._wjSkeletonSlotClone)) return this._wjSkeletonSlotClone;\n\n\t\t// 2) attribute override\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = v == null ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\t// 3) backward compat (if some components still set this)\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\t// 4) default\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonSlotClone)) return this._wjSkeletonSlotClone;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = v == null ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\t// 3) default\n\t\treturn 300;\n\t}\n\n\tset skeletonMinDuration(value) {\n\t\t// allow null/undefined to reset\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonSlotClone;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonSlotClone = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t// Public API: property-based control\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\tset skeletonDelay(value) {\n\t\t// allow null/undefined to reset\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonSlotClone;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonSlotClone = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(wjSkeletonSheet) && wjSkeletonSheet.cssRules !== undefined) {\n\t\t\t\t\tnext.push(wjSkeletonSheet);\n\t\t\t\t}\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStore The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStore, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStore, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\t\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\t// Prefer declarative skeleton in light DOM.\n\t\t\t// NOTE: after the first render we may `replaceChildren()` on the host, which removes light DOM.\n\t\t\t// Persist a clone so skeleton keeps working on subsequent refreshes.\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\t\t\tif (slotted) {\n\t\t\t\tthis._wjSkeletonSlotClone = slotted.cloneNode(true);\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(this._wjSkeletonSlotClone.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\t// If light DOM was replaced by render, use the persisted clone\n\t\t\tif (this._wjSkeletonSlotClone) {\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(this._wjSkeletonSlotClone.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\t// Fallback to hook\n\t\t\tconst frag = document.createDocumentFragment();\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\t\t\tif (skel == null) return null;\n\n\t\t\tlet node;\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\t// Ensure the host has a box to render into (custom elements default to display:inline)\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t// Ensure skeleton styles are present in shadowRoot\n\t\t\t\tif (this.shadowRoot) {\n\t\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\t\tif (!existing.includes(wjSkeletonSheet) && wjSkeletonSheet.cssRules !== undefined) {\n\t\t\t\t\t\tthis.shadowRoot.adoptedStyleSheets = [...existing, wjSkeletonSheet];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\t// If the element is hidden during initial render, allow skeleton to be visible\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\t// Schedule skeleton only after a short delay to avoid flashing on fast renders\n\t\tlet skeletonPlannedAt;\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\t// Real render finished; cancel pending skeleton\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\t// Skeleton never shown (render was fast)\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\t// If skeleton was visible, it has just been removed by the swap\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\t// If render failed, ensure skeleton timer is cleared and notify\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\t// Check if the descriptor is found on the object itself\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\t// Otherwise, check the prototype chain\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\t// If the property doesn't exist at all\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up property accessors for the component's attributes.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAGrB,MAAM,kBAAkB,IAAI,cAAe;AAC3C,IAAI;AACH,kBAAgB,YAAY,WAAW;AACxC,SAAS,GAAG;AAEZ;AAEe,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAO;AAZM;AACd;AACA;AACA;AACA;AACA;AAmaA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,CAAC,QAAQ,UAAU;AAClC,aAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,2BAAK,gBAAiB,KAAK,gBAAgB;AAE3C,mBAAK,oBAAL;AACA,YAAI,KAAK,eAAe;AACvB,cAAI,CAAC,KAAK,WAAY,MAAK,aAAa,EAAE,MAAM,KAAK,cAAc,QAAQ,gBAAgB,KAAI,CAAE;AAAA,QACrG;AACG,aAAK,eAAgB;AAErB,2BAAK,gBAAiB,KAAK,gBAAgB;AAG3C,cAAM,QAAQ,IAAI,cAAe;AACjC,cAAM,YAAY,KAAK,YAAY,aAAa;AAEhD,YAAI,KA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ACV;AAEG,UAAM,KAAK,OAAO,aAAa;AAE/B,QAAI,CAAC,eAAe;AACnB,YAAM,cAAa,UAAK,cAAL,8BAAiB,eAAe,KAAK,OAAO,eAAe,cAAc,IAAI;AAEhG,UAAI,sBAAsB,YAAW,yCAAY,YAAY,UAAS,WAAW;AAChF,cAAM;AAAA,MACX;AAAA,IACA;AAIG,uBAAK,cAAe;AACpB,uBAAK,aAAc;AAEnB,QAAI,KAAK,yBAAyB;AACjC,WAAK,UAAU,OAAO,GAAG,KAAK,uBAAuB;AAAA,IACzD;AAEG,uBAAK,gBAAiB,KAAK,gBAAgB;AAE3C,YAAS;AAAA,EACZ,CAAG,EAAE,MAAM,CAAC,MAAM;AACf,YAAQ,MAAM,CAAC;AAAA,EAClB,CAAG;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAxtBC,cA7OoB,YA6Ob,oBAAmB,CAAC,WAAW,kBAAkB;AACvD,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACP;AAjPa,IAAM,YAAN;AAw8BZ,IAAC,aAAa;"}
|
|
1
|
+
{"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonDelayOverride` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\tif (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;\n\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\treturn 300;\n\t}\n\n\t/**\n\t * Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,\n\t * the override for the minimum duration is removed.\n\t * @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.\n\t */\n\tset skeletonMinDuration(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonMinDurationOverride;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonMinDurationOverride = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Sets or removes the 'skeleton' attribute based on the provided value.\n\t * @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.\n\t */\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\n\t/**\n\t * Checks if the 'skeleton' attribute is present on the element.\n\t * @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.\n\t */\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\t/**\n\t * Sets the delay for the skeleton loading indicator.\n\t * @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,\n\t * a string that can be converted to a number, null, or undefined.\n\t * If null or undefined is provided, the skeleton delay will be cleared.\n\t */\n\tset skeletonDelay(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonDelayOverride;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonDelayOverride = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the delay value used for skeleton loading.\n\t * @returns {number} The delay value for the skeleton loader.\n\t */\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a refresh operation by initializing the update lifecycle and setting up promises\n\t * to track its completion or failure status. Marks the instance as not pristine and queues\n\t * an update.\n\t * @returns {void} Does not return a value.\n\t */\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops the current render loop if it is running by canceling the requestAnimationFrame.\n\t * @returns {void} This method does not return a value.\n\t */\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\n\t\t\tif (slotted) {\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\tslot.name = 'skeleton';\n\t\t\t\t\tfrag.append(slot);\n\t\t\t\t\treturn frag;\n\t\t\t\t}\n\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(slotted.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\tconst frag = document.createDocumentFragment();\n\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\n\t\t\tif (skel === null || skel === undefined) return null;\n\n\t\t\tlet node;\n\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\tlet skeletonPlannedAt;\n\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up accessors (getter and setter) for all attributes of the current object.\n\t * This method retrieves the attribute names, sanitizes them, and dynamically defines\n\t * property accessors for each attribute using `Object.defineProperty`.\n\t * @returns {void} This method does not return any value.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAEN,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAO;AAZM;AACd;AACA;AACA;AACA;AACA;AAmbA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,CAAC,QAAQ,UAAU;AAClC,aAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,2BAAK,gBAAiB,KAAK,gBAAgB;AAE3C,mBAAK,oBAAL;AACA,YAAI,KAAK,eAAe;AACvB,cAAI,CAAC,KAAK,WAAY,MAAK,aAAa,EAAE,MAAM,KAAK,cAAc,QAAQ,gBAAgB,KAAI,CAAE;AAAA,QACrG;AACG,aAAK,eAAgB;AAErB,2BAAK,gBAAiB,KAAK,gBAAgB;AAG3C,cAAM,QAAQ,IAAI,cAAe;AACjC,cAAM,YAAY,KAAK,YAAY,aAAa;AAEhD,YAAI,KAAK,YAAY;AACpB,gBAAM,WAAW,KAAK,WAAW,sBAAsB,CAAE;AACzD,gBAAM,OAAO,CAAC,GAAG,QAAQ;AAEzB,cAAI,CAAC,KAAK,SAAS,KAAK,EAAG,MAAK,KAAK,KAAK;AAE1C,eAAK,WAAW,qBAAqB;AAAA,QACzC;AAEG,cAAM,KAAK,QAAQ,KAAK;AAExB,gBAAS;AAAA,MACZ,CAAG;AAAA,IACD;AAvcA,uBAAK,aAAc;AACnB,SAAK,UAAU,IAAI,iBAAiB;AAAA,M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D,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACP;AAjPa,IAAM,YAAN;AA47BZ,IAAC,aAAa;"}
|
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.2.0-alpha.
|
|
4
|
+
"version": "0.2.0-alpha.13",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|