wj-elements 0.1.158 → 0.1.160
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/{infinite-scroll.element-DUjjOm1e.js → infinite-scroll.element-Cj53cbpC.js} +42 -5
- package/dist/infinite-scroll.element-Cj53cbpC.js.map +1 -0
- package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +7 -0
- package/dist/wje-element.js +7 -7
- package/dist/wje-element.js.map +1 -1
- package/dist/wje-icon-picker.js +1 -1
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-master.js +1 -1
- package/dist/wje-options.js +1 -1
- package/dist/wje-sliding-container.js +3 -0
- package/dist/wje-sliding-container.js.map +1 -1
- package/package.json +2 -2
- package/dist/infinite-scroll.element-DUjjOm1e.js.map +0 -1
|
@@ -53,6 +53,7 @@ class InfiniteScroll extends WJElement {
|
|
|
53
53
|
this._loading = this.loadPages(this.currentPage);
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
+
__publicField(this, "compareFunction", (i, item) => i.id === item.id);
|
|
56
57
|
/**
|
|
57
58
|
* Converts a data item into an HTML element based on a template.
|
|
58
59
|
* This function takes a data item, interpolates it into a predefined template,
|
|
@@ -76,6 +77,7 @@ class InfiniteScroll extends WJElement {
|
|
|
76
77
|
__publicField(this, "customForeach", (data) => {
|
|
77
78
|
data.forEach((item) => {
|
|
78
79
|
let element = this.dataToHtml(item);
|
|
80
|
+
this._dataToElementWeakMap.set(element, item);
|
|
79
81
|
event.addListener(element, "click", "wje-infinite-scroll:click-item", null);
|
|
80
82
|
this.placementObj.insertAdjacentElement("beforeend", element);
|
|
81
83
|
});
|
|
@@ -110,6 +112,10 @@ class InfiniteScroll extends WJElement {
|
|
|
110
112
|
this._infiniteScrollTemplate = null;
|
|
111
113
|
this._abortController = new AbortController();
|
|
112
114
|
this._signal = this._abortController.signal;
|
|
115
|
+
this._dataToElementWeakMap = /* @__PURE__ */ new WeakMap();
|
|
116
|
+
this._drawnItems = [];
|
|
117
|
+
this._loadedItems = [];
|
|
118
|
+
this._actualDrawnIndex = 0;
|
|
113
119
|
}
|
|
114
120
|
/**
|
|
115
121
|
* Dependencies of the InfiniteScroll component.
|
|
@@ -178,10 +184,20 @@ class InfiniteScroll extends WJElement {
|
|
|
178
184
|
* @returns {void} No return value.
|
|
179
185
|
*/
|
|
180
186
|
beforeDraw() {
|
|
181
|
-
var _a, _b;
|
|
187
|
+
var _a, _b, _c;
|
|
188
|
+
this._loadedItems = [];
|
|
189
|
+
this._drawnItems = [];
|
|
190
|
+
this._dataToElementWeakMap = /* @__PURE__ */ new WeakMap();
|
|
182
191
|
this.iterate = this.querySelector("[iterate]");
|
|
183
|
-
|
|
184
|
-
|
|
192
|
+
if (this.iterate) {
|
|
193
|
+
if (this.iterate.nodeName !== "TEMPLATE") {
|
|
194
|
+
console.error("The iterate attribute must be a template element");
|
|
195
|
+
this.infiniteScrollTemplate = (_a = this.iterate) == null ? void 0 : _a.outerHTML;
|
|
196
|
+
} else {
|
|
197
|
+
this.infiniteScrollTemplate = (_b = this.iterate) == null ? void 0 : _b.innerHTML;
|
|
198
|
+
}
|
|
199
|
+
(_c = this.iterate) == null ? void 0 : _c.remove();
|
|
200
|
+
}
|
|
185
201
|
this.setAttribute("style", "height: " + this.height);
|
|
186
202
|
if (this._signal) {
|
|
187
203
|
this._abortController.abort();
|
|
@@ -291,7 +307,10 @@ class InfiniteScroll extends WJElement {
|
|
|
291
307
|
if (this.hasAttribute("placement")) this.placementObj = this.querySelector(this.placement);
|
|
292
308
|
event.dispatchCustomEvent(this, "wje-infinite-scroll:load", response);
|
|
293
309
|
this.response = response;
|
|
294
|
-
this.
|
|
310
|
+
this._loadedItems = this.objectName ? response[this.objectName] : response;
|
|
311
|
+
const notDrawnItems = this._loadedItems.filter((item) => !this._drawnItems.some(this.compareFunction.bind(this, item)));
|
|
312
|
+
this.customForeach(notDrawnItems);
|
|
313
|
+
this._drawnItems.push(...notDrawnItems);
|
|
295
314
|
this.isLoading.push(page);
|
|
296
315
|
} else {
|
|
297
316
|
event.dispatchCustomEvent(this, "wje-infinite-scroll:complete");
|
|
@@ -303,8 +322,26 @@ class InfiniteScroll extends WJElement {
|
|
|
303
322
|
this.hideLoader();
|
|
304
323
|
}
|
|
305
324
|
}
|
|
325
|
+
addItem(item, place = "beforeend") {
|
|
326
|
+
let element = this.dataToHtml(item);
|
|
327
|
+
this._dataToElementWeakMap.set(element, item);
|
|
328
|
+
this.placementObj.insertAdjacentElement(place, element);
|
|
329
|
+
this._drawnItems.push(item);
|
|
330
|
+
if (this._drawnItems.length > this.size * this.currentPage) {
|
|
331
|
+
this.totalPages += 1;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
removeItem(item) {
|
|
335
|
+
let element = this._dataToElementWeakMap.get(item);
|
|
336
|
+
element.remove();
|
|
337
|
+
this._drawnItems = this._drawnItems.filter((i) => i !== item);
|
|
338
|
+
if (this._drawnItems.length < this.size * this.currentPage) {
|
|
339
|
+
this.isLoading = this.isLoading.filter((i) => i !== this.currentPage);
|
|
340
|
+
this.currentPage--;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
306
343
|
}
|
|
307
344
|
export {
|
|
308
345
|
InfiniteScroll as I
|
|
309
346
|
};
|
|
310
|
-
//# sourceMappingURL=infinite-scroll.element-
|
|
347
|
+
//# sourceMappingURL=infinite-scroll.element-Cj53cbpC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infinite-scroll.element-Cj53cbpC.js","sources":["../packages/wje-infinite-scroll/infinite-scroll.element.js"],"sourcesContent":["import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `InfiniteScroll` is a custom web component that represents an infinite scroll.\n * It extends from `WJElement`.\n * @summary This element allows users to scroll through a potentially infinite amount of content.\n * @documentation https://elements.webjet.sk/components/infinite-scroll\n * @status stable\n * @augments {WJElement}\n * @csspart loader - The loader part of the infinite scroll.\n * @slot - The default slot for the infinite scroll.\n * @cssproperty [--wje-infinite-scroll-width=100%] - Sets the width of the infinite scroll container. his property determines how wide the infinite scroll area will be relative to its parent element. Accepts any valid CSS width value, such as percentages (`%`), pixels (`px`), or viewport units (`vw`). The default value is `100%`, which makes it span the full width of its container.\n * @cssproperty [--wje-infinite-scroll-height=300px] - Defines the height of the infinite scroll container. This property specifies how tall the infinite scroll area should be. Accepts any valid CSS height value, such as pixels (`px`), percentages (`%`), or viewport units (`vh`). The default value is `300px`, providing a fixed height suitable for most use cases.\n * //@fires wje-infinite-scroll:click-item - Event fired when an item is clicked.\n * @tag wje-infinite-scroll\n */\n\nexport default class InfiniteScroll extends WJElement {\n /**\n * Creates an instance of InfiniteScroll.\n */\n constructor() {\n super();\n\n this.totalPages = 0;\n this.isLoading = [];\n this._response = {};\n this.iterate = null;\n this._infiniteScrollTemplate = null;\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n this._dataToElementWeakMap = new WeakMap();\n this._drawnItems = [];\n this._loadedItems = [];\n this._actualDrawnIndex = 0;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set infiniteScrollTemplate(value) {\n this._infiniteScrollTemplate = value;\n }\n\n /**\n * Getter for the infiniteScrollTemplate property.\n * @returns {null}\n */\n get infiniteScrollTemplate() {\n return this._infiniteScrollTemplate;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set response(value) {\n this._response = value;\n }\n\n /**\n * Getter for the response property.\n * @returns {*|{}}\n */\n get response() {\n return this._response;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set objectName(value) {\n this.setAttribute('object-name', value);\n }\n\n get objectName() {\n return this.getAttribute('object-name') ?? 'data';\n }\n\n className = 'InfiniteScroll';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Prepares the component for updates before it is drawn.\n * This method handles the removal of templates for iteration, adjusts the height styling of the component,\n * and manages abort signals for loading operations.\n * @returns {void} No return value.\n */\n beforeDraw() {\n this._loadedItems = [];\n this._drawnItems = [];\n this._dataToElementWeakMap = new WeakMap();\n\n this.iterate = this.querySelector('[iterate]');\n\n if (this.iterate) {\n if (this.iterate.nodeName !== 'TEMPLATE') {\n console.error('The iterate attribute must be a template element');\n this.infiniteScrollTemplate = this.iterate?.outerHTML;\n } else {\n this.infiniteScrollTemplate = this.iterate?.innerHTML;\n }\n\n this.iterate?.remove(); // remove template\n }\n\n this.setAttribute('style', 'height: ' + this.height);\n\n // if this._loading is not fulfilled then cancel the promise\n if (this._signal) {\n this._abortController.abort();\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n }\n }\n\n /**\n * Creates and returns a document fragment containing the structure for an infinite scroll component.\n * The structure includes native elements, slots for customization, and optional loading content.\n * @returns {DocumentFragment} The document fragment containing the component's DOM structure.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native');\n native.setAttribute('part', 'native-infinite-scroll');\n\n let slot = document.createElement('slot');\n\n let ending = document.createElement('slot');\n ending.setAttribute('name', 'ending');\n\n if (WjElementUtils.hasSlot(this, 'loader')) {\n let loading = document.createElement('div');\n loading.classList.add('loading');\n\n let loader = document.createElement('slot');\n loader.setAttribute('name', 'loader');\n\n loading.appendChild(loader);\n\n this.loadingEl = loading;\n\n fragment.appendChild(loading);\n }\n\n native.appendChild(slot);\n native.appendChild(ending);\n\n fragment.appendChild(native);\n\n this.endingEl = ending;\n\n return fragment;\n }\n\n /**\n * Called after the component has been drawn.\n */\n async afterDraw() {\n this.queryParams = this.queryParams || '';\n this.size = +this.size || 10;\n this.currentPage = 0;\n\n this.scrollEvent();\n this._loading = this.loadPages(this.currentPage);\n await this._loading;\n }\n\n /**\n * Attaches a scroll event listener to the current object.\n * The `scrollEvent` function binds the `onScroll` method to the 'scroll' event\n * of the current object. This enables handling of scroll events for\n * specific functionality such as updating UI elements, loading content dynamically,\n * or tracking user interaction with scrollable content.\n */\n scrollEvent = () => {\n this.addEventListener('scroll', this.onScroll);\n };\n\n /**\n * A function that removes the scroll event listener from the current context.\n * This function is used to unbind the `onScroll` event listener\n * from the `scroll` event of the current object. It ensures that\n * the scroll event no longer triggers the `onScroll` handler.\n * @function\n */\n unScrollEvent = () => {\n this.removeEventListener('scroll', this.onScroll);\n };\n\n /**\n * A scroll event handler function that checks the scroll position and triggers loading additional content\n * when the user scrolls near the bottom of the page.\n * Properties accessed:\n * - `scrollTop`: The number of pixels that the content of an element is scrolled vertically.\n * - `scrollHeight`: The total height of the element's content.\n * - `clientHeight`: The inner height of the element in pixels, including padding but excluding borders and scrollbars.\n * Conditions:\n * - Determines if the scroll position is within 300 pixels of the bottom of the element.\n * - Verifies that the current page number is less than or equal to the total number of pages.\n * - Checks if the current page is already in the loading state.\n * Actions:\n * - Increments the current page number when the conditions are met.\n * - Initiates loading for the next page by calling the `loadPages` function.\n * @param {Event} e The scroll event object.\n */\n onScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n\n if (\n scrollTop + clientHeight >= scrollHeight - 300 &&\n this.currentPage <= this.totalPages &&\n this.isLoading.includes(this.currentPage)\n ) {\n this.currentPage++;\n this._loading = this.loadPages(this.currentPage);\n }\n };\n\n /**\n * Fetches the pages from the server.\n * @param {number} page The page number.\n * @returns {Promise<object>} The response from the server.\n */\n async getPages(page) {\n let hasParams = this.url.includes('?');\n const response = await fetch(\n `${this.url}${hasParams ? '&' : '?'}page=${page}&size=${this.size}${this?.queryParams}`,\n {\n signal: this._signal,\n }\n );\n\n if (!response.ok) {\n throw new Error(`An error occurred: ${response.status}`);\n }\n return await response.json();\n }\n\n /**\n * Hides the loader.\n */\n hideLoader() {\n this?.loadingEl?.classList.remove('show');\n }\n\n /**\n * Displays the loader element by adding the 'show' class to its class list.\n * This method is useful for indicating a loading or processing state in the UI.\n * @returns {void} No return value.\n */\n showLoader() {\n this?.loadingEl?.classList.add('show');\n }\n\n /**\n * Checks if there are more pages to load.\n * @param {number} page The page number.\n * @returns {boolean} Whether there are more pages to load.\n */\n hasMorePages(page) {\n return this.totalPages === 0 || page < this.totalPages;\n }\n\n /**\n * Loads the pages.\n * @param {number} page The page number.\n */\n async loadPages(page) {\n this.showLoader();\n try {\n if (this.hasMorePages(page)) {\n let response;\n this.parser = new DOMParser();\n\n if (typeof this.setCustomData === 'function') {\n response = await this.setCustomData(page, this._signal);\n } else {\n response = await this.getPages(page);\n }\n\n this.totalPages = response?.totalPages;\n this.currentPage = page;\n\n this.placementObj = this;\n\n // if there is a \"container\" attribute, find the element\n if (this.hasAttribute('placement')) this.placementObj = this.querySelector(this.placement);\n\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:load', response);\n\n this.response = response;\n this._loadedItems = this.objectName ? response[this.objectName] : response;\n const notDrawnItems = this._loadedItems.filter((item) => !this._drawnItems.some(this.compareFunction.bind(this, item)));\n this.customForeach(notDrawnItems);\n this._drawnItems.push(...notDrawnItems);\n\n this.isLoading.push(page);\n } else {\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:complete');\n this.endingEl.classList.add('show');\n }\n } catch (error) {\n console.log(error);\n } finally {\n this.hideLoader();\n }\n }\n\n compareFunction = (i, item) => i.id === item.id\n\n /**\n * Converts a data item into an HTML element based on a template.\n * This function takes a data item, interpolates it into a predefined template,\n * parses the resulting HTML string, and returns the first child element of the parsed HTML content.\n * @param {object} item The data object to interpolate into the HTML template.\n * @returns {Element} The first child element generated from the interpolated HTML string.\n */\n dataToHtml = (item) => {\n let interpolateItem = this.interpolate(this.infiniteScrollTemplate, item);\n let doc = this.parser.parseFromString(interpolateItem, 'text/html');\n let element = doc.activeElement.firstElementChild;\n\n return element;\n };\n\n /**\n * A custom implementation of the forEach method designed to iterate over an array of data,\n * transform each item into an HTML element, and append the element to a specified placement object.\n * Additionally, it adds an event listener to each generated element for handling click events.\n * @param {Array} data An array of items to process. Each item is transformed into an HTML element\n * and appended to the placement object specified in the context of `this`.\n */\n customForeach = (data) => {\n data.forEach((item) => {\n let element = this.dataToHtml(item);\n this._dataToElementWeakMap.set(element, item);\n\n event.addListener(element, 'click', 'wje-infinite-scroll:click-item', null);\n\n this.placementObj.insertAdjacentElement('beforeend', element);\n });\n };\n\n /**\n * Interpolates a string template with values from the provided parameters object.\n * The template contains placeholders in the format `{{key}}` or `{{key.subkey}}`,\n * which are replaced with the corresponding values from the `params` object.\n * Placeholders support dot notation for accessing nested properties within the `params` object.\n * @param {string} template The string template containing placeholders to be replaced.\n * @param {object} params The object containing key-value pairs used for substitution in the template.\n * @returns {string} A string with all placeholders replaced by their respective values from the `params` object.\n */\n interpolate = (template, params) => {\n let keys = template.match(/\\{{.*?\\}}/g);\n\n if (keys) {\n for (let key of keys) {\n let cleanKey = key.replace('{{', '').replace('}}', '');\n let val = '';\n cleanKey.split('.').forEach((k) => {\n val = val === '' ? params[k] : val[k];\n });\n\n template = template.replace(key, val);\n }\n }\n return template;\n };\n\n addItem(item, place = 'beforeend') {\n let element = this.dataToHtml(item);\n this._dataToElementWeakMap.set(element, item);\n this.placementObj.insertAdjacentElement(place, element);\n\n this._drawnItems.push(item);\n\n // if drawnItems are more than page * size then add the page to isLoading\n if (this._drawnItems.length > this.size * this.currentPage) {\n this.totalPages += 1;\n }\n }\n\n removeItem(item) {\n let element = this._dataToElementWeakMap.get(item);\n element.remove();\n this._drawnItems = this._drawnItems.filter((i) => i !== item);\n // if drawnItems are less than page * size then remove the page from isLoading\n if (this._drawnItems.length < this.size * this.currentPage) {\n this.isLoading = this.isLoading.filter((i) => i !== this.currentPage);\n this.currentPage--;\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAkBe,MAAM,uBAAuB,UAAU;AAAA;AAAA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AA,IAC/B;AAAA,EACA;AAAA,EAEI,WAAW,MAAM;AACb,QAAI,UAAU,KAAK,sBAAsB,IAAI,IAAI;AACjD,YAAQ,OAAQ;AAChB,SAAK,cAAc,KAAK,YAAY,OAAO,CAAC,MAAM,MAAM,IAAI;AAE5D,QAAI,KAAK,YAAY,SAAS,KAAK,OAAO,KAAK,aAAa;AACxD,WAAK,YAAY,KAAK,UAAU,OAAO,CAAC,MAAM,MAAM,KAAK,WAAW;AACpE,WAAK;AAAA,IACjB;AAAA,EACA;AACA;"}
|
|
@@ -33,6 +33,10 @@ export default class InfiniteScroll extends WJElement {
|
|
|
33
33
|
_infiniteScrollTemplate: any;
|
|
34
34
|
_abortController: AbortController;
|
|
35
35
|
_signal: AbortSignal;
|
|
36
|
+
_dataToElementWeakMap: WeakMap<WeakKey, any>;
|
|
37
|
+
_drawnItems: any[];
|
|
38
|
+
_loadedItems: any[];
|
|
39
|
+
_actualDrawnIndex: number;
|
|
36
40
|
/**
|
|
37
41
|
* Dependencies of the InfiniteScroll component.
|
|
38
42
|
* @param value
|
|
@@ -144,6 +148,7 @@ export default class InfiniteScroll extends WJElement {
|
|
|
144
148
|
loadPages(page: number): Promise<void>;
|
|
145
149
|
parser: DOMParser;
|
|
146
150
|
placementObj: any;
|
|
151
|
+
compareFunction: (i: any, item: any) => boolean;
|
|
147
152
|
/**
|
|
148
153
|
* Converts a data item into an HTML element based on a template.
|
|
149
154
|
* This function takes a data item, interpolates it into a predefined template,
|
|
@@ -170,4 +175,6 @@ export default class InfiniteScroll extends WJElement {
|
|
|
170
175
|
* @returns {string} A string with all placeholders replaced by their respective values from the `params` object.
|
|
171
176
|
*/
|
|
172
177
|
interpolate: (template: string, params: object) => string;
|
|
178
|
+
addItem(item: any, place?: string): void;
|
|
179
|
+
removeItem(item: any): void;
|
|
173
180
|
}
|
package/dist/wje-element.js
CHANGED
|
@@ -500,10 +500,10 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
500
500
|
this.rafId = null;
|
|
501
501
|
this.originalVisibility = null;
|
|
502
502
|
this.params = {};
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
503
|
+
this.updateComplete = new Promise((resolve, reject) => {
|
|
504
|
+
this.finisPromise = resolve;
|
|
505
|
+
this.rejectPromise = reject;
|
|
506
|
+
});
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
* Sets the value of the 'permission' attribute.
|
|
@@ -877,7 +877,7 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
877
877
|
async render() {
|
|
878
878
|
this.drawingStatus = this.drawingStatuses.DRAWING;
|
|
879
879
|
let _draw = this.draw(this.context, this.store, WjElementUtils.getAttributes(this));
|
|
880
|
-
if (_draw instanceof Promise) {
|
|
880
|
+
if (_draw instanceof Promise || (_draw == null ? void 0 : _draw.constructor.name) === "Promise") {
|
|
881
881
|
_draw = await _draw;
|
|
882
882
|
}
|
|
883
883
|
let rend = _draw;
|
|
@@ -964,12 +964,12 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
964
964
|
return new Promise(async (resolve, reject) => {
|
|
965
965
|
var _a;
|
|
966
966
|
const __beforeDraw = this.beforeDraw(this.context, this.store, WjElementUtils.getAttributes(this));
|
|
967
|
-
if (__beforeDraw instanceof Promise) {
|
|
967
|
+
if (__beforeDraw instanceof Promise || (__beforeDraw == null ? void 0 : __beforeDraw.constructor.name) === "Promise") {
|
|
968
968
|
await __beforeDraw;
|
|
969
969
|
}
|
|
970
970
|
await this.render();
|
|
971
971
|
const __afterDraw = (_a = this.afterDraw) == null ? void 0 : _a.call(this, this.context, this.store, WjElementUtils.getAttributes(this));
|
|
972
|
-
if (__afterDraw instanceof Promise) {
|
|
972
|
+
if (__afterDraw instanceof Promise || (__afterDraw == null ? void 0 : __afterDraw.constructor.name) === "Promise") {
|
|
973
973
|
await __afterDraw;
|
|
974
974
|
}
|
|
975
975
|
this.rendering = false;
|
package/dist/wje-element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-element.js","sources":["../packages/wje-element/service/universal-service.js","../packages/utils/permissions-api.js","../packages/utils/element-utils.js","../packages/utils/event.js","../packages/wje-element/element.js"],"sourcesContent":["export class UniversalService {\n constructor(props = {}) {\n this._store = props.store;\n }\n\n findByKey = (attrName, key, keyValue) => {\n if (this._store.getState()[attrName] instanceof Array) {\n return this._store.getState()[attrName].find((item) => item[key] === keyValue);\n } else {\n console.warn(` Attribute ${attrName} is not array`);\n return null;\n }\n };\n\n findById = (attrName, id) => {\n if (this._store.getState()[attrName] instanceof Array) {\n return this._store.getState()[attrName].find((item) => item.id === id);\n } else {\n console.warn(` Attribute ${attrName} is not array`);\n return null;\n }\n };\n\n findAttributeValue = (attrName) => {\n return this._store.getState()[attrName];\n };\n\n update = (data, action) => {\n this._store.dispatch(action(data));\n };\n\n add = (data, action) => {\n this._store.dispatch(action(data));\n };\n\n _save(url, data, action, dispatchMethod, method) {\n let promise = fetch(url, {\n method: method,\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n return response.json();\n }\n });\n\n return this.dispatch(promise, dispatchMethod, action);\n }\n\n _get(url, action, dispatchMethod, signal) {\n let promise = fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n ...(signal ? { signal } : {}),\n }).then(async (response) => {\n let responseText;\n try {\n responseText = await response.text();\n return JSON.parse(responseText);\n } catch (err) {\n console.error(err);\n return responseText;\n }\n });\n\n return this.dispatch(promise, dispatchMethod, action);\n }\n\n put(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'PUT');\n }\n\n post(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'POST');\n }\n\n delete(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'DELETE');\n }\n\n get(url, action, dispatchMethod = true) {\n return this._get(url, action, dispatchMethod);\n }\n\n dispatch(promise, dispatchMethod, action) {\n if (dispatchMethod) {\n return promise\n .then((data) => {\n this._store.dispatch(action(data.data));\n return data;\n })\n .catch((error) => {\n console.error(error);\n });\n }\n return promise;\n }\n\n loadPromise = (\n url,\n action,\n method = 'GET',\n data = '',\n permissionCallBack = () => {\n //\n // No empty function\n }\n ) => {\n return fetch(url, {\n method: method,\n body: data,\n headers: {\n 'Content-Type': 'application/json',\n },\n async: true,\n })\n .then((response, e) => {\n let permissions = response.headers.get('permissions')?.split(',');\n permissionCallBack(permissions);\n\n if (response.ok) {\n return response.json();\n } else {\n throw response.json();\n }\n })\n .then((responseData) => {\n this._store.dispatch(action(responseData));\n return responseData;\n });\n };\n\n loadOnePromise = (url, action) => {\n return fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => {\n const responseData = response.json();\n if (action) {\n this._store.dispatch(action(responseData));\n }\n return responseData;\n });\n };\n}\n","export class WjePermissionsApi {\n static _permissionKey = 'permissions';\n\n /**\n * Sets the permission key.\n * @param value\n */\n static set permissionKey(value) {\n WjePermissionsApi._permissionKey = value || 'permissions';\n }\n\n /**\n * Returns the permission key.\n * @returns {*|string}\n */\n static get permissionKey() {\n return WjePermissionsApi._permissionKey;\n }\n\n /**\n * Sets the permissions.\n * @param value\n */\n static set permissions(value) {\n window.localStorage.setItem(WjePermissionsApi.permissionKey, JSON.stringify(value));\n }\n\n /**\n * Returns the permissions.\n * @returns {string[]}\n */\n static get permissions() {\n return JSON.parse(window.localStorage.getItem(WjePermissionsApi.permissionKey)) || [];\n }\n\n /**\n * Checks if the permission is included.\n * @param key\n * @returns {boolean}\n */\n static includesKey(key) {\n return WjePermissionsApi.permissions.includes(key);\n }\n\n /**\n * Checks if the permission is fulfilled.\n * @returns {boolean}\n */\n static isPermissionFulfilled(permissions) {\n return permissions.some((perm) => WjePermissionsApi.permissions.includes(perm));\n }\n}\n","export class WjElementUtils {\n /**\n * This function creates an element.\n * @param element : HTMLElement - The element value.\n * @param object : Object - The object value.\n */\n static setAttributesToElement(element, object) {\n Object.entries(object).forEach(([key, value]) => {\n element.setAttribute(key, value);\n });\n }\n\n /**\n * This function gets the attributes from an element.\n * @param {string|HTMLElement} el The element or selector to retrieve attributes from.\n * @returns {object} - An object containing the element's attributes as key-value pairs.\n */\n static getAttributes(el) {\n if (typeof el === 'string') el = document.querySelector(el);\n\n return Array.from(el.attributes)\n .filter((a) => !a.name.startsWith('@'))\n .map((a) => [\n a.name\n .split('-')\n .map((s, i) => {\n if (i !== 0) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n } else {\n return s;\n }\n })\n .join(''),\n a.value,\n ])\n .reduce((acc, attr) => {\n acc[attr[0]] = attr[1];\n return acc;\n }, {});\n }\n\n /**\n * This function gets the events from an element.\n * @param {string|HTMLElement} el The element or selector to retrieve events from.\n * @returns {Map<any, any>} - The map value.\n */\n static getEvents(el) {\n if (typeof el === 'string') el = document.querySelector(el);\n\n return Array.from(el.attributes)\n .filter((a) => a.name.startsWith('@wje'))\n .map((a) => [a.name.substring(3).split('-').join(''), a.value])\n .reduce((acc, attr) => {\n acc.set(attr[0], attr[1]);\n return acc;\n }, new Map());\n }\n\n /**\n * This function converts an object to a string.\n * @param {object} object The object to convert.\n * @returns {string} - The string value.\n */\n static attributesToString(object) {\n return Object.entries(object)\n .map(([key, value]) => {\n return `${key}=\"${value}\"`;\n })\n .join(' ');\n }\n\n /**\n * This function checks if the slot exists.\n * @param {string|HTMLElement} el The element or selector to check for slots.\n * @param slotName The slot name to check for.\n * @returns {boolean} - The boolean value.\n */\n static hasSlot(el, slotName = null) {\n let selector = slotName ? `[slot=\"${slotName}\"]` : '[slot]';\n\n return el.querySelectorAll(selector).length > 0 ? true : false;\n }\n\n /**\n * This function checks if the slot has content.\n * @param {string|HTMLElement} el The element or selector to check for slot content\n * @param slotName The slot name to check for.\n * @returns {boolean} - The boolean value.\n */\n static hasSlotContent(el, slotName = null) {\n let slotElement = el.querySelector(`slot`);\n if (slotName) {\n slotElement = el.querySelector(`slot[name=\"${slotName}\"]`);\n }\n\n if (slotElement) {\n const assignedElements = slotElement.assignedElements();\n return assignedElements.length > 0;\n }\n\n return false;\n }\n\n /**\n * This function converts a string to a boolean.\n * @param {string | object} value The value to convert to a boolean. If the value is a boolean, it will be returned as is.\n * @returns {boolean} - The boolean value.\n */\n static stringToBoolean(value) {\n if (typeof value === 'boolean') return value;\n\n return !['false', '0', 0].includes(value);\n }\n}\n","var self; // eslint-disable-line no-var\n\nclass Event {\n constructor() {\n this.customEventWeakMap = new WeakMap();\n self = this;\n }\n\n /**\n * Dispatch event to the element and trigger the listener.\n * @param e\n */\n #dispatch(e) {\n let element = this;\n // let record = self.findRecordByElement(element);\n let record = self.customEventWeakMap.get(this);\n\n if (!record) return;\n\n let listeners = record[e.type];\n\n listeners.forEach((listener) => {\n self.dispatchCustomEvent(element, listener.event, {\n originalEvent: e?.type || null,\n context: element,\n event: self,\n });\n\n if (listener.options && listener.options.stopPropagation === true) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n });\n }\n\n /**\n * Dispatch custom event to the element with the specified event name and detail.\n * @param element\n * @param event\n * @param detail\n */\n dispatchCustomEvent(element, event, detail) {\n element.dispatchEvent(\n new CustomEvent(event, {\n detail: detail || {\n context: element,\n event: self,\n },\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n /**\n * Find record by element in the storage.\n * @param element\n * @returns {*}\n */\n\n findRecordByElement(element) {\n return this.customEventWeakMap.get(element);\n }\n\n /**\n * Add listener to the element. If the element is an array, the listener will be added to all elements in the array.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n addListener(element, originalEvent, event, listener, options) {\n if (!element) return;\n\n if (!Array.isArray(element)) element = [element];\n\n element.forEach((el) => {\n this.writeRecord(el, originalEvent, event, listener, options);\n });\n }\n\n /**\n * Write record to the storage.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n writeRecord(element, originalEvent, event, listener, options) {\n let recordListeners = this.findRecordByElement(element);\n\n if (!recordListeners) {\n this.customEventWeakMap.set(element, {\n [originalEvent]: [],\n });\n\n recordListeners = this.findRecordByElement(element);\n } else {\n recordListeners[originalEvent] = recordListeners[originalEvent] || [];\n }\n\n listener = listener || this.#dispatch;\n let obj = {\n listener: listener,\n options: options,\n event: event,\n };\n\n // skontrolujeme ci uz tento listener neexistuje\n if (!this.listenerExists(element, originalEvent, obj)) {\n recordListeners[originalEvent].push(obj);\n element.addEventListener(originalEvent, listener, options);\n obj.unbind = () => {\n element.removeEventListener(originalEvent, listener, options);\n };\n } else {\n // in case we want to add the same listener multiple times trigger a warning for a better debugging\n //console.info(\"Listener already exists\", element, originalEvent);\n }\n }\n\n /**\n * Performs a deep equality check between two objects.\n * @param x The first object to compare.\n * @param y The second object to compare.\n * @returns - Returns `true` if the objects are deeply equal, `false` otherwise.\n */\n deepEqual(x, y) {\n return x && y && typeof x === 'object' && typeof x === typeof y\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every((key) => this.deepEqual(x[key], y[key]))\n : x === y;\n }\n\n /**\n * Check if the listener already exists on the element.\n * @param element\n * @param event\n * @param listener\n * @returns\n */\n listenerExists(element, event, listener) {\n let record = this.findRecordByElement(element);\n return record[event].some((e) => this.deepEqual(e, listener));\n }\n\n /**\n * Remove listener from the element and delete the listener from the custom event storage.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n removeListener(element, originalEvent, event, listener, options) {\n let records = this.findRecordByElement(element);\n let listeners = records?.[originalEvent];\n listener = listener || this.#dispatch;\n\n if (listeners) {\n let listenerOfWeakMap = listeners.find((e) => e.listener === listener);\n\n if (listenerOfWeakMap) {\n listeners.splice(listeners.indexOf(listenerOfWeakMap), 1);\n }\n\n if (!listeners.length) {\n delete records[originalEvent];\n }\n }\n\n element?.removeEventListener(originalEvent, listener, options);\n }\n\n /**\n * Remove all event listeners from the specified element and delete the element from the custom event storage.\n * @param {HTMLElement} element The element from which all listeners will be removed.\n */\n removeElement(element) {\n // remove all listeners from the element\n let listeners = this.customEventWeakMap.get(element);\n if (listeners) {\n queueMicrotask(() => {\n for (let event in listeners) {\n listeners[event].forEach((e) => {\n element.removeEventListener(event, e.listener, e.options);\n });\n }\n\n this.customEventWeakMap.delete(element);\n });\n }\n }\n\n // TODO\n createPromiseFromEvent(element, event) {\n return new Promise((resolve) => {\n let success = () => {\n element.removeEventListener(event, success);\n resolve();\n };\n\n element.addEventListener(event, success);\n });\n }\n}\n\nlet event = new Event();\nexport { event };\n","import { UniversalService } from './service/universal-service.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\nimport { WjePermissionsApi } from '../utils/permissions-api.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\nexport default class WJElement extends HTMLElement {\n /**\n * Initializes a new instance of the WJElement class.\n */\n\n constructor() {\n super();\n\n this.isAttached = false;\n this.service = new UniversalService({\n store: store,\n });\n\n // definujeme vsetky zavislosti.\n // Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n this.defineDependencies();\n\n this.rendering = false;\n this._dependencies = {};\n\n /**\n * @typedef {CREATED | ATTACHED | BEGINING | START | DRAWING | DONE | DISCONNECTED} DrawingStatus\n * @property {number} CREATED - The component has been created.\n * @property {number} ATTACHED - The component has been attached to the DOM.\n * @property {number} BEGINING - The component is beginning to draw.\n * @property {number} START - The component has started drawing.\n * @property {number} DRAWING - The component is drawing.\n * @property {number} DONE - The component has finished drawing.\n * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n */\n this.drawingStatuses = {\n CREATED: 0,\n ATTACHED: 1,\n BEGINING: 2,\n START: 3,\n DRAWING: 4,\n DONE: 5,\n DISCONNECTED: 6,\n };\n\n this.drawingStatus = this.drawingStatuses.CREATED;\n\n this._pristine = true;\n this._pristineCauseWeakMap = new WeakMap();\n\n this.isRendering = false;\n this.rafId = null;\n this.originalVisibility = null;\n this.params = {};\n\n const { promise, resolve, reject } = Promise.withResolvers();\n this.updateComplete = promise;\n this.finisPromise = resolve;\n this.rejectPromise = reject;\n }\n\n /**\n * Sets the value of the 'permission' attribute.\n * @param {string[]} value The value to set for the 'permission' attribute.\n */\n set permission(value) {\n this.setAttribute('permission', value.join(','));\n }\n\n /**\n * Gets the value of the 'permission-check' attribute.\n * @returns {string[]} The value of the 'permission' attribute.\n */\n get permission() {\n return this.getAttribute('permission')?.split(',') || [];\n }\n\n /**\n * Sets the 'permission-check' attribute.\n * @param {boolean} value The value to set for the 'permission-check' attribute.\n */\n set isPermissionCheck(value) {\n if (value) this.setAttribute('permission-check', '');\n else this.removeAttribute('permission-check');\n }\n\n /**\n * Checks if the 'permission-check' attribute is present.\n * @returns {boolean} True if the 'permission-check' attribute is present.\n */\n get isPermissionCheck() {\n return this.hasAttribute('permission-check');\n }\n\n set noShow(value) {\n if (value) this.setAttribute('no-show', '');\n else this.removeAttribute('no-show');\n }\n\n /**\n * Checks if the 'show' attribute is present.\n * @returns {boolean} True if the 'show' attribute is present.\n */\n get noShow() {\n return this.hasAttribute('no-show');\n }\n\n /**\n * Sets the 'shadow' attribute.\n * @param {string} value The value to set for the 'shadow' attribute.\n */\n set isShadowRoot(value) {\n return this.setAttribute('shadow', value);\n }\n\n get isShadowRoot() {\n return this.getAttribute('shadow');\n }\n\n /**\n * Checks if the 'shadow' attribute is present.\n * @returns {boolean} True if the 'shadow' attribute is present.\n */\n get hasShadowRoot() {\n return this.hasAttribute('shadow');\n }\n\n /**\n * Gets the value of the 'shadow' attribute or 'open' if not set.\n * @returns {string} The value of the 'shadow' attribute or 'open'.\n */\n get shadowType() {\n return this.getAttribute('shadow') || 'open';\n }\n\n /**\n * Gets the rendering context, either the shadow root or the component itself.\n * @returns The rendering context.\n */\n get context() {\n if (this.hasShadowRoot) {\n return this.shadowRoot;\n } else {\n return this;\n }\n }\n\n /**\n * Gets the store instance.\n * @returns {object} The store instance.\n */\n get store() {\n return store;\n }\n\n /**\n * @typedef {object} ArrayActions\n * @property {Function} addAction - Adds an item to the array.\n * @property {Function} deleteAction - Deletes an item from the array.\n * @property {Function} loadAction - Loads an array.\n * @property {Function} updateAction - Updates an item in the array.\n * @property {Function} addManyAction - Adds many items to the array.\n */\n\n /**\n * @typedef {object} ObjectActions\n * @property {Function} addAction - Replace old object with new object\n * @property {Function} deleteAction - Delete item based on key\n * @property {Function} updateAction - Update item based on key\n */\n\n /**\n * Gets the default store actions.\n * @returns The default store actions for arrays and objects.\n */\n get defaultStoreActions() {\n return defaultStoreActions;\n }\n\n /**\n * Gets the classes to be removed after the component is connected.\n * @returns An array of class names to remove.\n */\n get removeClassAfterConnect() {\n return this.getAttribute('remove-class-after-connect')?.split(' ');\n }\n\n /**\n * Sets the component dependencies.\n * @param value The dependencies to set.\n */\n set dependencies(value) {\n this._dependencies = value;\n }\n\n /**\n * Gets the component dependencies.\n * @returns The component dependencies.\n */\n get dependencies() {\n return this._dependencies;\n }\n\n /**\n * Processes and combines two templates into one.\n * @param pTemplate The primary template.\n * @param inputTemplate The secondary template.\n * @returns The combined template.\n */\n static processTemplates = (pTemplate, inputTemplate) => {\n const newTemplate = document.createElement('template');\n newTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n return newTemplate;\n };\n\n /**\n * Defines a custom element if not already defined.\n * @param name The name of the custom element.\n * @param [elementConstructor] The constructor for the custom element.\n * @param [options] Additional options for defining the element.\n */\n static define(name, elementConstructor = this, options = {}) {\n const definedElement = customElements.get(name);\n\n if (!definedElement) {\n customElements.define(name, elementConstructor, options);\n }\n }\n\n /**\n * Defines component dependencies by registering custom elements.\n */\n defineDependencies() {\n if (this.dependencies)\n Object.entries(this.dependencies).forEach((name, component) => WJElement.define(name, component));\n }\n\n /**\n * Hook for extending behavior before drawing the component.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n */\n beforeDraw(context, appStoreObj, params) {\n // Hook for extending behavior before drawing\n }\n\n /**\n * Renders the component within the provided context.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj\n * @param params Additional parameters or attributes for rendering the component.\n * @returns This implementation does not render anything and returns `null`.\n * @description\n * The `draw` method is responsible for rendering the component's content.\n * Override this method in subclasses to define custom rendering logic.\n * @example\n * class MyComponent extends WJElement {\n * draw(context, appStoreObj, params) {\n * const div = document.createElement('div');\n * div.textContent = 'Hello, world!';\n * context.appendChild(div);\n * }\n * }\n */\n draw(context, appStoreObj, params) {\n return null;\n }\n\n /**\n * Hook for extending behavior after drawing the component.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n */\n afterDraw(context, appStoreObj, params) {\n // Hook for extending behavior after drawing\n }\n\n /**\n * Lifecycle method invoked when the component is connected to the DOM.\n */\n connectedCallback() {\n if (!this.isRendering) {\n this.originalVisibility = this.originalVisibility ?? this.style.visibility;\n this.style.visibility = 'hidden';\n\n this.setupAttributes?.();\n this.setUpAccessors();\n\n this.drawingStatus = this.drawingStatuses.ATTACHED;\n this._pristine = false;\n this.enqueueUpdate();\n }\n }\n\n /**\n * Initializes the component, setting up attributes and rendering.\n * @param [force] Whether to force initialization.\n * @returns A promise that resolves when initialization is complete.\n */\n initWjElement = (force = false) => {\n return new Promise(async (resolve, reject) => {\n this.drawingStatus = this.drawingStatuses.BEGINING;\n\n this.setupAttributes?.();\n if (this.hasShadowRoot) {\n if (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open' });\n }\n this.setUpAccessors();\n\n this.drawingStatus = this.drawingStatuses.START;\n await this.display(force);\n\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(this.constructor.cssStyleSheet);\n\n this.context.adoptedStyleSheets = [sheet];\n\n resolve();\n });\n };\n\n /**\n * Sets up attributes and event listeners for the component.\n * This method retrieves all custom events defined for the component\n * and adds event listeners for each of them. When an event is triggered,\n * it calls the corresponding method on the host element.\n */\n setupAttributes() {\n // Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n let allEvents = WjElementUtils.getEvents(this);\n allEvents.forEach((customEvent, domEvent) => {\n this.addEventListener(domEvent, (e) => {\n this.getRootNode().host[customEvent]?.();\n });\n });\n }\n\n /**\n * Hook for extending behavior before disconnecting the component.\n */\n beforeDisconnect() {\n // Hook for extending behavior before disconnecting\n }\n\n /**\n * Hook for extending behavior after disconnecting the component.\n */\n afterDisconnect() {\n // Hook for extending behavior after disconnecting\n }\n\n /**\n * Hook for extending behavior before redrawing the component.\n */\n beforeRedraw() {\n // Hook for extending behavior before redrawing\n }\n\n /**\n * Cleans up resources and event listeners for the component.\n */\n componentCleanup() {\n // Hook for cleaning up the component\n }\n\n /**\n * Lifecycle method invoked when the component is disconnected from the DOM.\n */\n disconnectedCallback() {\n if (this.isAttached) {\n this.beforeDisconnect?.();\n this.context.innerHTML = '';\n this.afterDisconnect?.();\n this.isAttached = false;\n this.style.visibility = this.originalVisibility;\n this.originalVisibility = null;\n }\n\n if (this.isRendering) {\n this.stopRenderLoop();\n }\n\n this.drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n this.componentCleanup();\n }\n\n /**\n * Enqueues an update for the component.\n * This method processes the current render promise and then refreshes the component.\n */\n enqueueUpdate() {\n if (!this.rafId) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n }\n }\n\n /**\n * Lifecycle method invoked when an observed attribute changes.\n * @param name The name of the attribute that changed.\n * @param old The old value of the attribute.\n * @param newName The new value of the attribute.\n */\n attributeChangedCallback(name, old, newName) {\n if (old !== newName) {\n this._pristine = false;\n this.enqueueUpdate();\n }\n }\n\n refresh() {\n this._pristine = false;\n this.enqueueUpdate();\n }\n\n /**\n * Refreshes the component by reinitializing it if it is in a drawing state.\n * This method checks if the component's drawing status is at least in the START state.\n * If so, it performs the following steps:\n * 1. Calls the `beforeRedraw` hook if defined.\n * 2. Calls the `beforeDisconnect` hook if defined.\n * 3. Refreshes the update promise to manage the rendering lifecycle.\n * 4. Calls the `afterDisconnect` hook if defined.\n * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n * If the component is not in a drawing state, it simply returns a resolved promise.\n */\n async _refresh() {\n if (this.isRendering) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n return; // Skip if async render is still processing\n }\n\n if (!this._pristine) {\n this._pristine = true;\n this.isRendering = true;\n\n if (this.isAttached) {\n this.beforeRedraw?.();\n this.beforeDisconnect?.();\n this.afterDisconnect?.();\n } else {\n this.stopRenderLoop();\n }\n\n try {\n await this.initWjElement(true);\n } catch (error) {\n console.error('Render error:', error);\n } finally {\n this.isRendering = false;\n\n if (!this._pristine) {\n this._pristine = false;\n this.enqueueUpdate();\n } else {\n this.finisPromise();\n this.style.visibility = this.originalVisibility;\n }\n }\n }\n\n if (this.isAttached && !this.isRendering) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n }\n }\n\n stopRenderLoop() {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n }\n\n /**\n * Renders the component within the provided context.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStore The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n * @returns This implementation does not render anything and returns `null`.\n * @description\n * The `draw` method is responsible for rendering the component's content.\n * Override this method in subclasses to define custom rendering logic.\n * @example\n * class MyComponent extends WJElement {\n * draw(context, appStore, params) {\n * const div = document.createElement('div');\n * div.textContent = 'Hello, world!';\n * context.appendChild(div);\n * }\n * }\n */\n draw(context, appStore, params) {\n return null;\n }\n\n /**\n * Displays the component's content, optionally forcing a re-render.\n * @param [force] Whether to force a re-render.\n * @returns A promise that resolves when the display is complete.\n */\n display(force = false) {\n this.template = this.constructor.customTemplate || document.createElement('template');\n\n if (force) {\n [...this.context.childNodes].forEach(this.context.removeChild.bind(this.context));\n //this.isAttached = false;\n }\n\n this.context.append(this.template.content.cloneNode(true));\n\n if (this.noShow || (this.isPermissionCheck && !WjePermissionsApi.isPermissionFulfilled(this.permission))) {\n this.remove();\n return Promise.resolve();\n }\n\n return this._resolveRender();\n }\n\n /**\n * Renders the component's content.\n */\n async render() {\n this.drawingStatus = this.drawingStatuses.DRAWING;\n\n let _draw = this.draw(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (_draw instanceof Promise) {\n _draw = await _draw;\n }\n\n let rend = _draw;\n let element;\n\n if (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n element = rend;\n } else {\n let inputTemplate = document.createElement('template');\n inputTemplate.innerHTML = rend;\n element = inputTemplate.content.cloneNode(true);\n }\n\n let rendered = element;\n\n this.context.appendChild(rendered);\n }\n\n /**\n * Sanitizes a given name by converting it from kebab-case to camelCase.\n * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n * @example\n * // Returns 'exampleName'\n * sanitizeName('example-name');\n * @example\n * // Returns 'myCustomComponent'\n * sanitizeName('my-custom-component');\n */\n sanitizeName(name) {\n let parts = name.split('-');\n return [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n }\n\n /**\n * Checks if a property on an object has a getter or setter method defined.\n * @param {object} obj The object on which the property is defined.\n * @param {string} property The name of the property to check.\n * @returns {object} An object indicating the presence of getter and setter methods.\n * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n * @example\n * const obj = {\n * get name() { return 'value'; },\n * set name(val) { console.log(val); }\n * };\n * // Returns { hasGetter: [Function: get name], hasSetter: [Function: set name] }\n * checkGetterSetter(obj, 'name');\n * @example\n * const obj = { prop: 42 };\n * // Returns { hasGetter: null, hasSetter: null }\n * checkGetterSetter(obj, 'prop');\n */\n checkGetterSetter(obj, property) {\n let descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n // Check if the descriptor is found on the object itself\n if (descriptor) {\n return {\n hasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n hasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n };\n }\n\n // Otherwise, check the prototype chain\n let proto = Object.getPrototypeOf(obj);\n if (proto) {\n return this.checkGetterSetter(proto, property);\n }\n\n // If the property doesn't exist at all\n return { hasGetter: null, hasSetter: null };\n }\n\n /**\n * Sets up property accessors for the component's attributes.\n */\n setUpAccessors() {\n let attrs = this.getAttributeNames();\n attrs.forEach((name) => {\n const sanitizedName = this.sanitizeName(name);\n\n const { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n Object.defineProperty(this, sanitizedName, {\n set: hasSetter ?? ((value) => this.setAttribute(name, value)),\n get: hasGetter ?? (() => this.getAttribute(name)),\n });\n });\n }\n\n /**\n * Resolves the rendering process of the component.\n * @returns A promise that resolves when rendering is complete.\n * @private\n */\n _resolveRender() {\n this.params = WjElementUtils.getAttributes(this);\n\n return new Promise(async (resolve, reject) => {\n const __beforeDraw = this.beforeDraw(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (__beforeDraw instanceof Promise) {\n await __beforeDraw;\n }\n\n await this.render();\n\n const __afterDraw = this.afterDraw?.(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (__afterDraw instanceof Promise) {\n await __afterDraw;\n }\n\n // RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n // toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n this.rendering = false;\n this.isAttached = true;\n\n if (this.removeClassAfterConnect) {\n this.classList.remove(...this.removeClassAfterConnect);\n }\n\n this.drawingStatus = this.drawingStatuses.DONE;\n\n resolve();\n }).catch((e) => {\n console.log(e);\n });\n }\n}\n\nlet __esModule = 'true';\nexport { __esModule, WjePermissionsApi, WjElementUtils, event };\n"],"names":["event"],"mappings":";;;;;;;;;;;AAAO,MAAM,iBAAiB;AAAA,EAC1B,YAAY,QAAQ,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W,KAAK,SAAS,KAAK,OAAO,eAAe,cAAc,IAAI,CAAC;AAEjG,UAAI,wBAAwB,SAAS;AACjC,cAAM;AAAA,MACtB;AAEY,YAAM,KAAK,OAAQ;AAEnB,YAAM,eAAc,UAAK,cAAL,8BAAiB,KAAK,SAAS,KAAK,OAAO,eAAe,cAAc,IAAI;AAEhG,UAAI,uBAAuB,SAAS;AAChC,cAAM;AAAA,MACtB;AAIY,WAAK,YAAY;AACjB,WAAK,aAAa;AAElB,UAAI,KAAK,yBAAyB;AAC9B,aAAK,UAAU,OAAO,GAAG,KAAK,uBAAuB;AAAA,MACrE;AAEY,WAAK,gBAAgB,KAAK,gBAAgB;AAE1C,cAAS;AAAA,IACrB,CAAS,EAAE,MAAM,CAAC,MAAM;AACZ,cAAQ,IAAI,CAAC;AAAA,IACzB,CAAS;AAAA,EACT;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AApcI,cA5MiB,YA4MV,oBAAmB,CAAC,WAAW,kBAAkB;AACpD,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACV;AAhNU,IAAM,YAAN;AAkpBZ,IAAC,aAAa;"}
|
|
1
|
+
{"version":3,"file":"wje-element.js","sources":["../packages/wje-element/service/universal-service.js","../packages/utils/permissions-api.js","../packages/utils/element-utils.js","../packages/utils/event.js","../packages/wje-element/element.js"],"sourcesContent":["export class UniversalService {\n constructor(props = {}) {\n this._store = props.store;\n }\n\n findByKey = (attrName, key, keyValue) => {\n if (this._store.getState()[attrName] instanceof Array) {\n return this._store.getState()[attrName].find((item) => item[key] === keyValue);\n } else {\n console.warn(` Attribute ${attrName} is not array`);\n return null;\n }\n };\n\n findById = (attrName, id) => {\n if (this._store.getState()[attrName] instanceof Array) {\n return this._store.getState()[attrName].find((item) => item.id === id);\n } else {\n console.warn(` Attribute ${attrName} is not array`);\n return null;\n }\n };\n\n findAttributeValue = (attrName) => {\n return this._store.getState()[attrName];\n };\n\n update = (data, action) => {\n this._store.dispatch(action(data));\n };\n\n add = (data, action) => {\n this._store.dispatch(action(data));\n };\n\n _save(url, data, action, dispatchMethod, method) {\n let promise = fetch(url, {\n method: method,\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n return response.json();\n }\n });\n\n return this.dispatch(promise, dispatchMethod, action);\n }\n\n _get(url, action, dispatchMethod, signal) {\n let promise = fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n ...(signal ? { signal } : {}),\n }).then(async (response) => {\n let responseText;\n try {\n responseText = await response.text();\n return JSON.parse(responseText);\n } catch (err) {\n console.error(err);\n return responseText;\n }\n });\n\n return this.dispatch(promise, dispatchMethod, action);\n }\n\n put(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'PUT');\n }\n\n post(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'POST');\n }\n\n delete(url, data, action, dispatchMethod = true) {\n return this._save(url, data, action, dispatchMethod, 'DELETE');\n }\n\n get(url, action, dispatchMethod = true) {\n return this._get(url, action, dispatchMethod);\n }\n\n dispatch(promise, dispatchMethod, action) {\n if (dispatchMethod) {\n return promise\n .then((data) => {\n this._store.dispatch(action(data.data));\n return data;\n })\n .catch((error) => {\n console.error(error);\n });\n }\n return promise;\n }\n\n loadPromise = (\n url,\n action,\n method = 'GET',\n data = '',\n permissionCallBack = () => {\n //\n // No empty function\n }\n ) => {\n return fetch(url, {\n method: method,\n body: data,\n headers: {\n 'Content-Type': 'application/json',\n },\n async: true,\n })\n .then((response, e) => {\n let permissions = response.headers.get('permissions')?.split(',');\n permissionCallBack(permissions);\n\n if (response.ok) {\n return response.json();\n } else {\n throw response.json();\n }\n })\n .then((responseData) => {\n this._store.dispatch(action(responseData));\n return responseData;\n });\n };\n\n loadOnePromise = (url, action) => {\n return fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => {\n const responseData = response.json();\n if (action) {\n this._store.dispatch(action(responseData));\n }\n return responseData;\n });\n };\n}\n","export class WjePermissionsApi {\n static _permissionKey = 'permissions';\n\n /**\n * Sets the permission key.\n * @param value\n */\n static set permissionKey(value) {\n WjePermissionsApi._permissionKey = value || 'permissions';\n }\n\n /**\n * Returns the permission key.\n * @returns {*|string}\n */\n static get permissionKey() {\n return WjePermissionsApi._permissionKey;\n }\n\n /**\n * Sets the permissions.\n * @param value\n */\n static set permissions(value) {\n window.localStorage.setItem(WjePermissionsApi.permissionKey, JSON.stringify(value));\n }\n\n /**\n * Returns the permissions.\n * @returns {string[]}\n */\n static get permissions() {\n return JSON.parse(window.localStorage.getItem(WjePermissionsApi.permissionKey)) || [];\n }\n\n /**\n * Checks if the permission is included.\n * @param key\n * @returns {boolean}\n */\n static includesKey(key) {\n return WjePermissionsApi.permissions.includes(key);\n }\n\n /**\n * Checks if the permission is fulfilled.\n * @returns {boolean}\n */\n static isPermissionFulfilled(permissions) {\n return permissions.some((perm) => WjePermissionsApi.permissions.includes(perm));\n }\n}\n","export class WjElementUtils {\n /**\n * This function creates an element.\n * @param element : HTMLElement - The element value.\n * @param object : Object - The object value.\n */\n static setAttributesToElement(element, object) {\n Object.entries(object).forEach(([key, value]) => {\n element.setAttribute(key, value);\n });\n }\n\n /**\n * This function gets the attributes from an element.\n * @param {string|HTMLElement} el The element or selector to retrieve attributes from.\n * @returns {object} - An object containing the element's attributes as key-value pairs.\n */\n static getAttributes(el) {\n if (typeof el === 'string') el = document.querySelector(el);\n\n return Array.from(el.attributes)\n .filter((a) => !a.name.startsWith('@'))\n .map((a) => [\n a.name\n .split('-')\n .map((s, i) => {\n if (i !== 0) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n } else {\n return s;\n }\n })\n .join(''),\n a.value,\n ])\n .reduce((acc, attr) => {\n acc[attr[0]] = attr[1];\n return acc;\n }, {});\n }\n\n /**\n * This function gets the events from an element.\n * @param {string|HTMLElement} el The element or selector to retrieve events from.\n * @returns {Map<any, any>} - The map value.\n */\n static getEvents(el) {\n if (typeof el === 'string') el = document.querySelector(el);\n\n return Array.from(el.attributes)\n .filter((a) => a.name.startsWith('@wje'))\n .map((a) => [a.name.substring(3).split('-').join(''), a.value])\n .reduce((acc, attr) => {\n acc.set(attr[0], attr[1]);\n return acc;\n }, new Map());\n }\n\n /**\n * This function converts an object to a string.\n * @param {object} object The object to convert.\n * @returns {string} - The string value.\n */\n static attributesToString(object) {\n return Object.entries(object)\n .map(([key, value]) => {\n return `${key}=\"${value}\"`;\n })\n .join(' ');\n }\n\n /**\n * This function checks if the slot exists.\n * @param {string|HTMLElement} el The element or selector to check for slots.\n * @param slotName The slot name to check for.\n * @returns {boolean} - The boolean value.\n */\n static hasSlot(el, slotName = null) {\n let selector = slotName ? `[slot=\"${slotName}\"]` : '[slot]';\n\n return el.querySelectorAll(selector).length > 0 ? true : false;\n }\n\n /**\n * This function checks if the slot has content.\n * @param {string|HTMLElement} el The element or selector to check for slot content\n * @param slotName The slot name to check for.\n * @returns {boolean} - The boolean value.\n */\n static hasSlotContent(el, slotName = null) {\n let slotElement = el.querySelector(`slot`);\n if (slotName) {\n slotElement = el.querySelector(`slot[name=\"${slotName}\"]`);\n }\n\n if (slotElement) {\n const assignedElements = slotElement.assignedElements();\n return assignedElements.length > 0;\n }\n\n return false;\n }\n\n /**\n * This function converts a string to a boolean.\n * @param {string | object} value The value to convert to a boolean. If the value is a boolean, it will be returned as is.\n * @returns {boolean} - The boolean value.\n */\n static stringToBoolean(value) {\n if (typeof value === 'boolean') return value;\n\n return !['false', '0', 0].includes(value);\n }\n}\n","var self; // eslint-disable-line no-var\n\nclass Event {\n constructor() {\n this.customEventWeakMap = new WeakMap();\n self = this;\n }\n\n /**\n * Dispatch event to the element and trigger the listener.\n * @param e\n */\n #dispatch(e) {\n let element = this;\n // let record = self.findRecordByElement(element);\n let record = self.customEventWeakMap.get(this);\n\n if (!record) return;\n\n let listeners = record[e.type];\n\n listeners.forEach((listener) => {\n self.dispatchCustomEvent(element, listener.event, {\n originalEvent: e?.type || null,\n context: element,\n event: self,\n });\n\n if (listener.options && listener.options.stopPropagation === true) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n });\n }\n\n /**\n * Dispatch custom event to the element with the specified event name and detail.\n * @param element\n * @param event\n * @param detail\n */\n dispatchCustomEvent(element, event, detail) {\n element.dispatchEvent(\n new CustomEvent(event, {\n detail: detail || {\n context: element,\n event: self,\n },\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n /**\n * Find record by element in the storage.\n * @param element\n * @returns {*}\n */\n\n findRecordByElement(element) {\n return this.customEventWeakMap.get(element);\n }\n\n /**\n * Add listener to the element. If the element is an array, the listener will be added to all elements in the array.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n addListener(element, originalEvent, event, listener, options) {\n if (!element) return;\n\n if (!Array.isArray(element)) element = [element];\n\n element.forEach((el) => {\n this.writeRecord(el, originalEvent, event, listener, options);\n });\n }\n\n /**\n * Write record to the storage.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n writeRecord(element, originalEvent, event, listener, options) {\n let recordListeners = this.findRecordByElement(element);\n\n if (!recordListeners) {\n this.customEventWeakMap.set(element, {\n [originalEvent]: [],\n });\n\n recordListeners = this.findRecordByElement(element);\n } else {\n recordListeners[originalEvent] = recordListeners[originalEvent] || [];\n }\n\n listener = listener || this.#dispatch;\n let obj = {\n listener: listener,\n options: options,\n event: event,\n };\n\n // skontrolujeme ci uz tento listener neexistuje\n if (!this.listenerExists(element, originalEvent, obj)) {\n recordListeners[originalEvent].push(obj);\n element.addEventListener(originalEvent, listener, options);\n obj.unbind = () => {\n element.removeEventListener(originalEvent, listener, options);\n };\n } else {\n // in case we want to add the same listener multiple times trigger a warning for a better debugging\n //console.info(\"Listener already exists\", element, originalEvent);\n }\n }\n\n /**\n * Performs a deep equality check between two objects.\n * @param x The first object to compare.\n * @param y The second object to compare.\n * @returns - Returns `true` if the objects are deeply equal, `false` otherwise.\n */\n deepEqual(x, y) {\n return x && y && typeof x === 'object' && typeof x === typeof y\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every((key) => this.deepEqual(x[key], y[key]))\n : x === y;\n }\n\n /**\n * Check if the listener already exists on the element.\n * @param element\n * @param event\n * @param listener\n * @returns\n */\n listenerExists(element, event, listener) {\n let record = this.findRecordByElement(element);\n return record[event].some((e) => this.deepEqual(e, listener));\n }\n\n /**\n * Remove listener from the element and delete the listener from the custom event storage.\n * @param element\n * @param originalEvent\n * @param event\n * @param listener\n * @param options\n */\n removeListener(element, originalEvent, event, listener, options) {\n let records = this.findRecordByElement(element);\n let listeners = records?.[originalEvent];\n listener = listener || this.#dispatch;\n\n if (listeners) {\n let listenerOfWeakMap = listeners.find((e) => e.listener === listener);\n\n if (listenerOfWeakMap) {\n listeners.splice(listeners.indexOf(listenerOfWeakMap), 1);\n }\n\n if (!listeners.length) {\n delete records[originalEvent];\n }\n }\n\n element?.removeEventListener(originalEvent, listener, options);\n }\n\n /**\n * Remove all event listeners from the specified element and delete the element from the custom event storage.\n * @param {HTMLElement} element The element from which all listeners will be removed.\n */\n removeElement(element) {\n // remove all listeners from the element\n let listeners = this.customEventWeakMap.get(element);\n if (listeners) {\n queueMicrotask(() => {\n for (let event in listeners) {\n listeners[event].forEach((e) => {\n element.removeEventListener(event, e.listener, e.options);\n });\n }\n\n this.customEventWeakMap.delete(element);\n });\n }\n }\n\n // TODO\n createPromiseFromEvent(element, event) {\n return new Promise((resolve) => {\n let success = () => {\n element.removeEventListener(event, success);\n resolve();\n };\n\n element.addEventListener(event, success);\n });\n }\n}\n\nlet event = new Event();\nexport { event };\n","import { UniversalService } from './service/universal-service.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\nimport { WjePermissionsApi } from '../utils/permissions-api.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\nexport default class WJElement extends HTMLElement {\n /**\n * Initializes a new instance of the WJElement class.\n */\n\n constructor() {\n super();\n\n this.isAttached = false;\n this.service = new UniversalService({\n store: store,\n });\n\n // definujeme vsetky zavislosti.\n // Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n this.defineDependencies();\n\n this.rendering = false;\n this._dependencies = {};\n\n /**\n * @typedef {CREATED | ATTACHED | BEGINING | START | DRAWING | DONE | DISCONNECTED} DrawingStatus\n * @property {number} CREATED - The component has been created.\n * @property {number} ATTACHED - The component has been attached to the DOM.\n * @property {number} BEGINING - The component is beginning to draw.\n * @property {number} START - The component has started drawing.\n * @property {number} DRAWING - The component is drawing.\n * @property {number} DONE - The component has finished drawing.\n * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n */\n this.drawingStatuses = {\n CREATED: 0,\n ATTACHED: 1,\n BEGINING: 2,\n START: 3,\n DRAWING: 4,\n DONE: 5,\n DISCONNECTED: 6,\n };\n\n this.drawingStatus = this.drawingStatuses.CREATED;\n\n this._pristine = true;\n this._pristineCauseWeakMap = new WeakMap();\n\n this.isRendering = false;\n this.rafId = null;\n this.originalVisibility = null;\n this.params = {};\n\n this.updateComplete = new Promise((resolve, reject) => {\n this.finisPromise = resolve;\n this.rejectPromise = reject;\n });\n }\n\n /**\n * Sets the value of the 'permission' attribute.\n * @param {string[]} value The value to set for the 'permission' attribute.\n */\n set permission(value) {\n this.setAttribute('permission', value.join(','));\n }\n\n /**\n * Gets the value of the 'permission-check' attribute.\n * @returns {string[]} The value of the 'permission' attribute.\n */\n get permission() {\n return this.getAttribute('permission')?.split(',') || [];\n }\n\n /**\n * Sets the 'permission-check' attribute.\n * @param {boolean} value The value to set for the 'permission-check' attribute.\n */\n set isPermissionCheck(value) {\n if (value) this.setAttribute('permission-check', '');\n else this.removeAttribute('permission-check');\n }\n\n /**\n * Checks if the 'permission-check' attribute is present.\n * @returns {boolean} True if the 'permission-check' attribute is present.\n */\n get isPermissionCheck() {\n return this.hasAttribute('permission-check');\n }\n\n set noShow(value) {\n if (value) this.setAttribute('no-show', '');\n else this.removeAttribute('no-show');\n }\n\n /**\n * Checks if the 'show' attribute is present.\n * @returns {boolean} True if the 'show' attribute is present.\n */\n get noShow() {\n return this.hasAttribute('no-show');\n }\n\n /**\n * Sets the 'shadow' attribute.\n * @param {string} value The value to set for the 'shadow' attribute.\n */\n set isShadowRoot(value) {\n return this.setAttribute('shadow', value);\n }\n\n get isShadowRoot() {\n return this.getAttribute('shadow');\n }\n\n /**\n * Checks if the 'shadow' attribute is present.\n * @returns {boolean} True if the 'shadow' attribute is present.\n */\n get hasShadowRoot() {\n return this.hasAttribute('shadow');\n }\n\n /**\n * Gets the value of the 'shadow' attribute or 'open' if not set.\n * @returns {string} The value of the 'shadow' attribute or 'open'.\n */\n get shadowType() {\n return this.getAttribute('shadow') || 'open';\n }\n\n /**\n * Gets the rendering context, either the shadow root or the component itself.\n * @returns The rendering context.\n */\n get context() {\n if (this.hasShadowRoot) {\n return this.shadowRoot;\n } else {\n return this;\n }\n }\n\n /**\n * Gets the store instance.\n * @returns {object} The store instance.\n */\n get store() {\n return store;\n }\n\n /**\n * @typedef {object} ArrayActions\n * @property {Function} addAction - Adds an item to the array.\n * @property {Function} deleteAction - Deletes an item from the array.\n * @property {Function} loadAction - Loads an array.\n * @property {Function} updateAction - Updates an item in the array.\n * @property {Function} addManyAction - Adds many items to the array.\n */\n\n /**\n * @typedef {object} ObjectActions\n * @property {Function} addAction - Replace old object with new object\n * @property {Function} deleteAction - Delete item based on key\n * @property {Function} updateAction - Update item based on key\n */\n\n /**\n * Gets the default store actions.\n * @returns The default store actions for arrays and objects.\n */\n get defaultStoreActions() {\n return defaultStoreActions;\n }\n\n /**\n * Gets the classes to be removed after the component is connected.\n * @returns An array of class names to remove.\n */\n get removeClassAfterConnect() {\n return this.getAttribute('remove-class-after-connect')?.split(' ');\n }\n\n /**\n * Sets the component dependencies.\n * @param value The dependencies to set.\n */\n set dependencies(value) {\n this._dependencies = value;\n }\n\n /**\n * Gets the component dependencies.\n * @returns The component dependencies.\n */\n get dependencies() {\n return this._dependencies;\n }\n\n /**\n * Processes and combines two templates into one.\n * @param pTemplate The primary template.\n * @param inputTemplate The secondary template.\n * @returns The combined template.\n */\n static processTemplates = (pTemplate, inputTemplate) => {\n const newTemplate = document.createElement('template');\n newTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n return newTemplate;\n };\n\n /**\n * Defines a custom element if not already defined.\n * @param name The name of the custom element.\n * @param [elementConstructor] The constructor for the custom element.\n * @param [options] Additional options for defining the element.\n */\n static define(name, elementConstructor = this, options = {}) {\n const definedElement = customElements.get(name);\n\n if (!definedElement) {\n customElements.define(name, elementConstructor, options);\n }\n }\n\n /**\n * Defines component dependencies by registering custom elements.\n */\n defineDependencies() {\n if (this.dependencies)\n Object.entries(this.dependencies).forEach((name, component) => WJElement.define(name, component));\n }\n\n /**\n * Hook for extending behavior before drawing the component.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n */\n beforeDraw(context, appStoreObj, params) {\n // Hook for extending behavior before drawing\n }\n\n /**\n * Renders the component within the provided context.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj\n * @param params Additional parameters or attributes for rendering the component.\n * @returns This implementation does not render anything and returns `null`.\n * @description\n * The `draw` method is responsible for rendering the component's content.\n * Override this method in subclasses to define custom rendering logic.\n * @example\n * class MyComponent extends WJElement {\n * draw(context, appStoreObj, params) {\n * const div = document.createElement('div');\n * div.textContent = 'Hello, world!';\n * context.appendChild(div);\n * }\n * }\n */\n draw(context, appStoreObj, params) {\n return null;\n }\n\n /**\n * Hook for extending behavior after drawing the component.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStoreObj The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n */\n afterDraw(context, appStoreObj, params) {\n // Hook for extending behavior after drawing\n }\n\n /**\n * Lifecycle method invoked when the component is connected to the DOM.\n */\n connectedCallback() {\n if (!this.isRendering) {\n this.originalVisibility = this.originalVisibility ?? this.style.visibility;\n this.style.visibility = 'hidden';\n\n this.setupAttributes?.();\n this.setUpAccessors();\n\n this.drawingStatus = this.drawingStatuses.ATTACHED;\n this._pristine = false;\n this.enqueueUpdate();\n }\n }\n\n /**\n * Initializes the component, setting up attributes and rendering.\n * @param [force] Whether to force initialization.\n * @returns A promise that resolves when initialization is complete.\n */\n initWjElement = (force = false) => {\n return new Promise(async (resolve, reject) => {\n this.drawingStatus = this.drawingStatuses.BEGINING;\n\n this.setupAttributes?.();\n if (this.hasShadowRoot) {\n if (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open' });\n }\n this.setUpAccessors();\n\n this.drawingStatus = this.drawingStatuses.START;\n await this.display(force);\n\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(this.constructor.cssStyleSheet);\n\n this.context.adoptedStyleSheets = [sheet];\n\n resolve();\n });\n };\n\n /**\n * Sets up attributes and event listeners for the component.\n * This method retrieves all custom events defined for the component\n * and adds event listeners for each of them. When an event is triggered,\n * it calls the corresponding method on the host element.\n */\n setupAttributes() {\n // Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n let allEvents = WjElementUtils.getEvents(this);\n allEvents.forEach((customEvent, domEvent) => {\n this.addEventListener(domEvent, (e) => {\n this.getRootNode().host[customEvent]?.();\n });\n });\n }\n\n /**\n * Hook for extending behavior before disconnecting the component.\n */\n beforeDisconnect() {\n // Hook for extending behavior before disconnecting\n }\n\n /**\n * Hook for extending behavior after disconnecting the component.\n */\n afterDisconnect() {\n // Hook for extending behavior after disconnecting\n }\n\n /**\n * Hook for extending behavior before redrawing the component.\n */\n beforeRedraw() {\n // Hook for extending behavior before redrawing\n }\n\n /**\n * Cleans up resources and event listeners for the component.\n */\n componentCleanup() {\n // Hook for cleaning up the component\n }\n\n /**\n * Lifecycle method invoked when the component is disconnected from the DOM.\n */\n disconnectedCallback() {\n if (this.isAttached) {\n this.beforeDisconnect?.();\n this.context.innerHTML = '';\n this.afterDisconnect?.();\n this.isAttached = false;\n this.style.visibility = this.originalVisibility;\n this.originalVisibility = null;\n }\n\n if (this.isRendering) {\n this.stopRenderLoop();\n }\n\n this.drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n this.componentCleanup();\n }\n\n /**\n * Enqueues an update for the component.\n * This method processes the current render promise and then refreshes the component.\n */\n enqueueUpdate() {\n if (!this.rafId) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n }\n }\n\n /**\n * Lifecycle method invoked when an observed attribute changes.\n * @param name The name of the attribute that changed.\n * @param old The old value of the attribute.\n * @param newName The new value of the attribute.\n */\n attributeChangedCallback(name, old, newName) {\n if (old !== newName) {\n this._pristine = false;\n this.enqueueUpdate();\n }\n }\n\n refresh() {\n this._pristine = false;\n this.enqueueUpdate();\n }\n\n /**\n * Refreshes the component by reinitializing it if it is in a drawing state.\n * This method checks if the component's drawing status is at least in the START state.\n * If so, it performs the following steps:\n * 1. Calls the `beforeRedraw` hook if defined.\n * 2. Calls the `beforeDisconnect` hook if defined.\n * 3. Refreshes the update promise to manage the rendering lifecycle.\n * 4. Calls the `afterDisconnect` hook if defined.\n * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n * If the component is not in a drawing state, it simply returns a resolved promise.\n */\n async _refresh() {\n if (this.isRendering) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n return; // Skip if async render is still processing\n }\n\n if (!this._pristine) {\n this._pristine = true;\n this.isRendering = true;\n\n if (this.isAttached) {\n this.beforeRedraw?.();\n this.beforeDisconnect?.();\n this.afterDisconnect?.();\n } else {\n this.stopRenderLoop();\n }\n\n try {\n await this.initWjElement(true);\n } catch (error) {\n console.error('Render error:', error);\n } finally {\n this.isRendering = false;\n\n if (!this._pristine) {\n this._pristine = false;\n this.enqueueUpdate();\n } else {\n this.finisPromise();\n this.style.visibility = this.originalVisibility;\n }\n }\n }\n\n if (this.isAttached && !this.isRendering) {\n this.rafId = requestAnimationFrame(() => this._refresh());\n }\n }\n\n stopRenderLoop() {\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n }\n\n /**\n * Renders the component within the provided context.\n * @param context The rendering context, usually the element's shadow root or main DOM element.\n * @param appStore The global application store for managing state.\n * @param params Additional parameters or attributes for rendering the component.\n * @returns This implementation does not render anything and returns `null`.\n * @description\n * The `draw` method is responsible for rendering the component's content.\n * Override this method in subclasses to define custom rendering logic.\n * @example\n * class MyComponent extends WJElement {\n * draw(context, appStore, params) {\n * const div = document.createElement('div');\n * div.textContent = 'Hello, world!';\n * context.appendChild(div);\n * }\n * }\n */\n draw(context, appStore, params) {\n return null;\n }\n\n /**\n * Displays the component's content, optionally forcing a re-render.\n * @param [force] Whether to force a re-render.\n * @returns A promise that resolves when the display is complete.\n */\n display(force = false) {\n this.template = this.constructor.customTemplate || document.createElement('template');\n\n if (force) {\n [...this.context.childNodes].forEach(this.context.removeChild.bind(this.context));\n //this.isAttached = false;\n }\n\n this.context.append(this.template.content.cloneNode(true));\n\n if (this.noShow || (this.isPermissionCheck && !WjePermissionsApi.isPermissionFulfilled(this.permission))) {\n this.remove();\n return Promise.resolve();\n }\n\n return this._resolveRender();\n }\n\n /**\n * Renders the component's content.\n */\n async render() {\n this.drawingStatus = this.drawingStatuses.DRAWING;\n\n let _draw = this.draw(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (_draw instanceof Promise || _draw?.constructor.name === \"Promise\") {\n _draw = await _draw;\n }\n\n let rend = _draw;\n let element;\n\n if (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n element = rend;\n } else {\n let inputTemplate = document.createElement('template');\n inputTemplate.innerHTML = rend;\n element = inputTemplate.content.cloneNode(true);\n }\n\n let rendered = element;\n\n this.context.appendChild(rendered);\n }\n\n /**\n * Sanitizes a given name by converting it from kebab-case to camelCase.\n * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n * @example\n * // Returns 'exampleName'\n * sanitizeName('example-name');\n * @example\n * // Returns 'myCustomComponent'\n * sanitizeName('my-custom-component');\n */\n sanitizeName(name) {\n let parts = name.split('-');\n return [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n }\n\n /**\n * Checks if a property on an object has a getter or setter method defined.\n * @param {object} obj The object on which the property is defined.\n * @param {string} property The name of the property to check.\n * @returns {object} An object indicating the presence of getter and setter methods.\n * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n * @example\n * const obj = {\n * get name() { return 'value'; },\n * set name(val) { console.log(val); }\n * };\n * // Returns { hasGetter: [Function: get name], hasSetter: [Function: set name] }\n * checkGetterSetter(obj, 'name');\n * @example\n * const obj = { prop: 42 };\n * // Returns { hasGetter: null, hasSetter: null }\n * checkGetterSetter(obj, 'prop');\n */\n checkGetterSetter(obj, property) {\n let descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n // Check if the descriptor is found on the object itself\n if (descriptor) {\n return {\n hasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n hasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n };\n }\n\n // Otherwise, check the prototype chain\n let proto = Object.getPrototypeOf(obj);\n if (proto) {\n return this.checkGetterSetter(proto, property);\n }\n\n // If the property doesn't exist at all\n return { hasGetter: null, hasSetter: null };\n }\n\n /**\n * Sets up property accessors for the component's attributes.\n */\n setUpAccessors() {\n let attrs = this.getAttributeNames();\n attrs.forEach((name) => {\n const sanitizedName = this.sanitizeName(name);\n\n const { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n Object.defineProperty(this, sanitizedName, {\n set: hasSetter ?? ((value) => this.setAttribute(name, value)),\n get: hasGetter ?? (() => this.getAttribute(name)),\n });\n });\n }\n\n /**\n * Resolves the rendering process of the component.\n * @returns A promise that resolves when rendering is complete.\n * @private\n */\n _resolveRender() {\n this.params = WjElementUtils.getAttributes(this);\n\n return new Promise(async (resolve, reject) => {\n const __beforeDraw = this.beforeDraw(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (__beforeDraw instanceof Promise || __beforeDraw?.constructor.name === \"Promise\") {\n await __beforeDraw;\n }\n\n await this.render();\n\n const __afterDraw = this.afterDraw?.(this.context, this.store, WjElementUtils.getAttributes(this));\n\n if (__afterDraw instanceof Promise || __afterDraw?.constructor.name === \"Promise\") {\n await __afterDraw;\n }\n\n // RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n // toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n this.rendering = false;\n this.isAttached = true;\n\n if (this.removeClassAfterConnect) {\n this.classList.remove(...this.removeClassAfterConnect);\n }\n\n this.drawingStatus = this.drawingStatuses.DONE;\n\n resolve();\n }).catch((e) => {\n console.log(e);\n });\n }\n}\n\nlet __esModule = 'true';\nexport { __esModule, WjePermissionsApi, WjElementUtils, event };\n"],"names":["event"],"mappings":";;;;;;;;;;;AAAO,MAAM,iBAAiB;AAAA,EAC1B,YAAY,QAAQ,IAAI;AAIxB,qCAAY,CAAC,UAAU,KAAK,aAAa;AACrC,UAAI,KAAK,OAAO,SAAU,EAAC,QAAQ,aAAa,OAAO;AACnD,eAAO,KAAK,OAAO,SAAQ,EAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,GAAG,MAAM,QAAQ;AAAA,MACzF,OAAe;AACH,gBAAQ,KAAK,cAAc,QAAQ,eAAe;AAClD,eAAO;AAAA,MACnB;AAAA,IACK;AAED,oCAAW,CAAC,UAAU,OAAO;AACzB,UAAI,KAAK,OAAO,SAAU,EAAC,QAAQ,aAAa,OAAO;AACnD,eAAO,KAAK,O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AAC9B,aAAK,UAAU,OAAO,GAAG,KAAK,uBAAuB;AAAA,MACrE;AAEY,WAAK,gBAAgB,KAAK,gBAAgB;AAE1C,cAAS;AAAA,IACrB,CAAS,EAAE,MAAM,CAAC,MAAM;AACZ,cAAQ,IAAI,CAAC;AAAA,IACzB,CAAS;AAAA,EACT;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AApcI,cA5MiB,YA4MV,oBAAmB,CAAC,WAAW,kBAAkB;AACpD,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACV;AAhNU,IAAM,YAAN;AAkpBZ,IAAC,aAAa;"}
|
package/dist/wje-icon-picker.js
CHANGED
|
@@ -7,7 +7,7 @@ import Input from "./wje-input.js";
|
|
|
7
7
|
import "./wje-popup.js";
|
|
8
8
|
import Tooltip from "./wje-tooltip.js";
|
|
9
9
|
import { P as Popup } from "./popup.element-AaduHP2r.js";
|
|
10
|
-
import { I as InfiniteScroll } from "./infinite-scroll.element-
|
|
10
|
+
import { I as InfiniteScroll } from "./infinite-scroll.element-Cj53cbpC.js";
|
|
11
11
|
const styles = "/*\n[ Wj Icon Picker ]\n*/\n\n:host {\n padding: 0 1rem;\n}\n\n.anchor {\n width: var(--wje-icon-picker-icon-size);\n height: var(--wje-icon-picker-icon-size);\n padding: var(--wje-icon-picker-padding);\n border-width: var(--wje-icon-picker-border-width);\n border-style: var(--wje-icon-picker-border-style);\n border-color: var(--wje-icon-picker-border-color);\n box-sizing: border-box;\n border-radius: var(--wje-icon-picker-radius);\n}\n\n.picker {\n width: 320px;\n height: 271px;\n box-shadow:\n 0 0 5px rgba(0, 0, 0, 0.05),\n 0 5px 20px rgba(0, 0, 0, 0.1);\n border-radius: var(--wje-icon-picker-radius);\n border-width: var(--wje-icon-picker-border-width);\n border-style: var(--wje-icon-picker-border-style);\n border-color: var(--wje-icon-picker-border-color);\n overflow: auto;\n padding: 1rem;\n background: var(--wje-background);\n}\n\n.icon-items {\n --icon-min-width: 2rem;\n display: grid;\n grid-gap: 0.5rem;\n grid-template-columns: repeat(auto-fit, minmax(var(--icon-min-width), 1fr));\n}\n\n.icon-item {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: inherit;\n padding: 0.25rem;\n min-height: var(--wje-icon-picker-icon-size);\n min-width: var(--wje-icon-picker-icon-size);\n text-decoration: none;\n\n &:hover {\n border-radius: 0.25rem;\n background: var(--wje-border-color);\n }\n}\n\n.wje-size {\n --wje-icon-size: 24px !important;\n}\n\nicon-item svg {\n width: var(--wje-icon-picker-icon-size);\n height: var(--wje-icon-picker-icon-size);\n}\n\nwje-input {\n --wje-input-border-radius: 4px;\n --wje-input-margin-bottom: 0;\n}\n\nwje-infinite-scroll {\n margin-top: 1rem;\n}\n\nwje-select {\n --wje-select-border-width: 0 0 1px 0 !important;\n --wje-select-border-radius: 0 !important;\n margin-bottom: 1rem;\n}\n\n.anchor wje-icon {\n --wje-icon-size: 100% !important;\n}\n";
|
|
12
12
|
class IconPicker extends WJElement {
|
|
13
13
|
/**
|
package/dist/wje-master.js
CHANGED
|
@@ -100,7 +100,7 @@ import { default as default88 } from "./wje-tooltip.js";
|
|
|
100
100
|
import { default as default89 } from "./wje-tree.js";
|
|
101
101
|
import { default as default90 } from "./wje-tree-item.js";
|
|
102
102
|
import { default as default91 } from "./wje-visually-hidden.js";
|
|
103
|
-
import { I } from "./infinite-scroll.element-
|
|
103
|
+
import { I } from "./infinite-scroll.element-Cj53cbpC.js";
|
|
104
104
|
import { L } from "./list.element-Ce1vIm1O.js";
|
|
105
105
|
import { P } from "./popup.element-AaduHP2r.js";
|
|
106
106
|
function formatDate(input, format) {
|
package/dist/wje-options.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement, { event } from "./wje-element.js";
|
|
5
|
-
import { I as InfiniteScroll } from "./infinite-scroll.element-
|
|
5
|
+
import { I as InfiniteScroll } from "./infinite-scroll.element-Cj53cbpC.js";
|
|
6
6
|
import { L as List } from "./list.element-Ce1vIm1O.js";
|
|
7
7
|
import Option from "./wje-option.js";
|
|
8
8
|
class Options extends WJElement {
|
|
@@ -112,6 +112,9 @@ class SlidingContainer extends WJElement {
|
|
|
112
112
|
set addToHeight(value) {
|
|
113
113
|
this.setAttribute("add-to-height", value);
|
|
114
114
|
}
|
|
115
|
+
get isOpen() {
|
|
116
|
+
return this._isOpen;
|
|
117
|
+
}
|
|
115
118
|
/**
|
|
116
119
|
* Returns the observed attributes for the component.
|
|
117
120
|
* @returns {string[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-sliding-container.js","sources":["../experimental-packages/wje-sliding-container/sliding-container.element.js","../experimental-packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement } from '../../packages/wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return [\n 'max-width',\n 'max-height',\n 'trigger',\n 'direction',\n 'variant',\n 'screen-break-point',\n 'remove-child-after-close',\n 'animation-duration',\n 'animation-easing',\n 'has-opacity',\n ];\n }\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n this.style.position = 'relative';\n this.style.height = '100%';\n this.style.right = 'unset';\n this.style.left = 'unset';\n\n this.wrapperDiv = document.createElement('div');\n this.wrapperDiv.classList.add('sliding-container-wrapper');\n\n this.transparentDiv = document.createElement('div');\n this.transparentDiv.classList.add('sliding-container-transparent');\n if (this._isOpen) {\n this.transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.style.position = 'absolute';\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n native.style.height = '100%';\n\n native.classList.add('native-sliding-container');\n native.setAttribute('part', 'sliding-container');\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.height = '100%';\n nativeInner.style.position = 'absolute';\n nativeInner.style.width = this.maxWidth;\n\n nativeInner.appendChild(slot);\n nativeInner.appendChild(this.getCloseButton());\n\n native.appendChild(nativeInner);\n this.wrapperDiv.appendChild(this.transparentDiv);\n this.wrapperDiv.appendChild(native);\n fragment.appendChild(this.wrapperDiv);\n\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Creates and returns a close button element.\n * @returns {HTMLElement} The close button element.\n */\n getCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.style.position = 'absolute';\n closeButton.style.top = '0';\n closeButton.style.right = '0';\n closeButton.style.zIndex = '1000';\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n closeButton.appendChild(icon);\n\n closeButton.addEventListener('click', () => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Checks for a specific variant and applies corresponding styles.\n * @param {string} variant The variant to check for.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of the element's width from 0 to the maximum width or vice versa.\n * @returns {Promise<void>} A promise that resolves when the animation is complete.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the container with an animation.\n * @returns {Promise<void>} A promise that resolves when the container is opened.\n */\n async open(event) {\n await Promise.resolve(this.beforeOpen(event)).then(async () => {\n if (!this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeOpen', {\n bubbles: true,\n composed: true,\n })\n );\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(event)).then(() => {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:open', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Closes the animation container.\n * @returns {Promise<void>} A promise that resolves when the container is closed.\n */\n async close(event) {\n await Promise.resolve(this.beforeClose(event)).then(async () => {\n if (this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeClose', {\n bubbles: true,\n composed: true,\n })\n );\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(event)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:close', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Toggles the state of the element.\n * If the element is open, it will be closed. If it is closed, it will be opened.\n * @returns {Promise<void>} A promise that resolves when the toggle operation is complete.\n */\n async toggle(event) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingContainer);\n"],"names":[],"mappings":";;;;;AAkCe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;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,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,MAAM,MAAM,OAAO;AACf,UAAM,QAAQ,QAAQ,KAAK,YAAY,KAAK,CAAC,EAAE,KAAK,YAAY;AAC5D,UAAI,KAAK,SAAS;AACd,aAAK;AAAA,UACD,IAAI,YAAY,qCAAqC;AAAA,YACjD,SAAS;AAAA,YACT,UAAU;AAAA,UACb,CAAA;AAAA,QACJ;AAED,cAAM,KAAK,oBAAqB;AAEhC,cAAM,QAAQ,QAAQ,KAAK,WAAW,KAAK,CAAC,EAAE,KAAK,MAAM;AACrD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAQ;AAAA,YAC1C,CAAyB;AAAA,UACzB;AAEoB,eAAK;AAAA,YACD,IAAI,YAAY,+BAA+B;AAAA,cAC3C,SAAS;AAAA,cACT,UAAU;AAAA,YACb,CAAA;AAAA,UACJ;AAAA,QACrB,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,OAAO,OAAO;AAChB,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA,EAEI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;ACvkBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
|
|
1
|
+
{"version":3,"file":"wje-sliding-container.js","sources":["../experimental-packages/wje-sliding-container/sliding-container.element.js","../experimental-packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement } from '../../packages/wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n get isOpen() {\n return this._isOpen;\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return [\n 'max-width',\n 'max-height',\n 'trigger',\n 'direction',\n 'variant',\n 'screen-break-point',\n 'remove-child-after-close',\n 'animation-duration',\n 'animation-easing',\n 'has-opacity',\n ];\n }\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n this.style.position = 'relative';\n this.style.height = '100%';\n this.style.right = 'unset';\n this.style.left = 'unset';\n\n this.wrapperDiv = document.createElement('div');\n this.wrapperDiv.classList.add('sliding-container-wrapper');\n\n this.transparentDiv = document.createElement('div');\n this.transparentDiv.classList.add('sliding-container-transparent');\n if (this._isOpen) {\n this.transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.style.position = 'absolute';\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n native.style.height = '100%';\n\n native.classList.add('native-sliding-container');\n native.setAttribute('part', 'sliding-container');\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.height = '100%';\n nativeInner.style.position = 'absolute';\n nativeInner.style.width = this.maxWidth;\n\n nativeInner.appendChild(slot);\n nativeInner.appendChild(this.getCloseButton());\n\n native.appendChild(nativeInner);\n this.wrapperDiv.appendChild(this.transparentDiv);\n this.wrapperDiv.appendChild(native);\n fragment.appendChild(this.wrapperDiv);\n\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Creates and returns a close button element.\n * @returns {HTMLElement} The close button element.\n */\n getCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.style.position = 'absolute';\n closeButton.style.top = '0';\n closeButton.style.right = '0';\n closeButton.style.zIndex = '1000';\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n closeButton.appendChild(icon);\n\n closeButton.addEventListener('click', () => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Checks for a specific variant and applies corresponding styles.\n * @param {string} variant The variant to check for.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of the element's width from 0 to the maximum width or vice versa.\n * @returns {Promise<void>} A promise that resolves when the animation is complete.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the container with an animation.\n * @returns {Promise<void>} A promise that resolves when the container is opened.\n */\n async open(event) {\n await Promise.resolve(this.beforeOpen(event)).then(async () => {\n if (!this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeOpen', {\n bubbles: true,\n composed: true,\n })\n );\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(event)).then(() => {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:open', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Closes the animation container.\n * @returns {Promise<void>} A promise that resolves when the container is closed.\n */\n async close(event) {\n await Promise.resolve(this.beforeClose(event)).then(async () => {\n if (this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeClose', {\n bubbles: true,\n composed: true,\n })\n );\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(event)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:close', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Toggles the state of the element.\n * If the element is open, it will be closed. If it is closed, it will be opened.\n * @returns {Promise<void>} A promise that resolves when the toggle operation is complete.\n */\n async toggle(event) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingContainer);\n"],"names":[],"mappings":";;;;;AAkCe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAO;AAsHX,qCAAY;AAsNZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,OAAO,MAAM;AACxB,UAAI,KAAK,eAAe,KAAK,gBAAgB,EAAE,aAAY,EAAG,CAAC,GAAG;AAE9D,cAAM,KAAK,KAAK,CAAC;AAAA,MAC7B,OAAe;AAEH,cAAM,KAAK,OAAO,CAAC;AAAA,MAC/B;AAEQ,WAAK,cAAc,EAAE,aAAY,EAAG,CAAC;AAAA,IACxC;AApVG,SAAK,UAAU;AACf,SAAK,cAAc;AAEnB,SAAK,kBAAkB,IAAI,eAAe,CAAC,YAAY;AACnD,eAAS,SAAS,SAAS;AACvB,YAAI,MAAM,gBAAgB;AACtB,cAAI,KAAK,gBAAgB,EAAG;AAE5B,cAAI,KAAK,oBAAoB,OAAO,cAAc,KAAK,kBAAkB;AACrE,gBAAI,KAAK,YAAY,QAAQ;AACzB,mBAAK,UAAU;AAAA,YAC3C,OAA+B;AACH,mBAAK,gBAAgB,KAAK,OAAO;AAAA,YAC7D;AAAA,UACA,OAA2B;AACH,gBAAI,KAAK,YAAY,YAAY;AAC7B,mBAAK,UAAU;AAAA,YAC3C,OAA+B;AACH,mBAAK,gBAAgB,KAAK,OAAO;AAAA,YAC7D;AAAA,UACA;AAAA,QACA;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MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA,EAEI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;AC3kBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.160",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"create-element": "node wje-cli-script/create-element.cjs",
|
|
39
39
|
"copy-dist": "node wje-cli-script/copy-dist.cjs",
|
|
40
40
|
"build:copy-dist": "npm run build && npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/parcels/node_modules/wj-elements",
|
|
41
|
-
"target:copy-dist": "npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/
|
|
41
|
+
"target:copy-dist": "npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/parcels/node_modules/wj-elements",
|
|
42
42
|
"test": "web-test-runner --group default",
|
|
43
43
|
"test:watch": "web-test-runner --watch --group default",
|
|
44
44
|
"lint": "eslint packages experimental-packages --max-warnings 0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infinite-scroll.element-DUjjOm1e.js","sources":["../packages/wje-infinite-scroll/infinite-scroll.element.js"],"sourcesContent":["import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `InfiniteScroll` is a custom web component that represents an infinite scroll.\n * It extends from `WJElement`.\n * @summary This element allows users to scroll through a potentially infinite amount of content.\n * @documentation https://elements.webjet.sk/components/infinite-scroll\n * @status stable\n * @augments {WJElement}\n * @csspart loader - The loader part of the infinite scroll.\n * @slot - The default slot for the infinite scroll.\n * @cssproperty [--wje-infinite-scroll-width=100%] - Sets the width of the infinite scroll container. his property determines how wide the infinite scroll area will be relative to its parent element. Accepts any valid CSS width value, such as percentages (`%`), pixels (`px`), or viewport units (`vw`). The default value is `100%`, which makes it span the full width of its container.\n * @cssproperty [--wje-infinite-scroll-height=300px] - Defines the height of the infinite scroll container. This property specifies how tall the infinite scroll area should be. Accepts any valid CSS height value, such as pixels (`px`), percentages (`%`), or viewport units (`vh`). The default value is `300px`, providing a fixed height suitable for most use cases.\n * //@fires wje-infinite-scroll:click-item - Event fired when an item is clicked.\n * @tag wje-infinite-scroll\n */\n\nexport default class InfiniteScroll extends WJElement {\n /**\n * Creates an instance of InfiniteScroll.\n */\n constructor() {\n super();\n\n this.totalPages = 0;\n this.isLoading = [];\n this._response = {};\n this.iterate = null;\n this._infiniteScrollTemplate = null;\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set infiniteScrollTemplate(value) {\n this._infiniteScrollTemplate = value;\n }\n\n /**\n * Getter for the infiniteScrollTemplate property.\n * @returns {null}\n */\n get infiniteScrollTemplate() {\n return this._infiniteScrollTemplate;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set response(value) {\n this._response = value;\n }\n\n /**\n * Getter for the response property.\n * @returns {*|{}}\n */\n get response() {\n return this._response;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set objectName(value) {\n this.setAttribute('object-name', value);\n }\n\n get objectName() {\n return this.getAttribute('object-name') ?? 'data';\n }\n\n className = 'InfiniteScroll';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Prepares the component for updates before it is drawn.\n * This method handles the removal of templates for iteration, adjusts the height styling of the component,\n * and manages abort signals for loading operations.\n * @returns {void} No return value.\n */\n beforeDraw() {\n this.iterate = this.querySelector('[iterate]');\n this.infiniteScrollTemplate = this.iterate?.outerHTML;\n this.iterate?.remove(); // remove template\n\n this.setAttribute('style', 'height: ' + this.height);\n\n // if this._loading is not fulfilled then cancel the promise\n if (this._signal) {\n this._abortController.abort();\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n }\n }\n\n /**\n * Creates and returns a document fragment containing the structure for an infinite scroll component.\n * The structure includes native elements, slots for customization, and optional loading content.\n * @returns {DocumentFragment} The document fragment containing the component's DOM structure.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native');\n native.setAttribute('part', 'native-infinite-scroll');\n\n let slot = document.createElement('slot');\n\n let ending = document.createElement('slot');\n ending.setAttribute('name', 'ending');\n\n if (WjElementUtils.hasSlot(this, 'loader')) {\n let loading = document.createElement('div');\n loading.classList.add('loading');\n\n let loader = document.createElement('slot');\n loader.setAttribute('name', 'loader');\n\n loading.appendChild(loader);\n\n this.loadingEl = loading;\n\n fragment.appendChild(loading);\n }\n\n native.appendChild(slot);\n native.appendChild(ending);\n\n fragment.appendChild(native);\n\n this.endingEl = ending;\n\n return fragment;\n }\n\n /**\n * Called after the component has been drawn.\n */\n async afterDraw() {\n this.queryParams = this.queryParams || '';\n this.size = +this.size || 10;\n this.currentPage = 0;\n\n this.scrollEvent();\n this._loading = this.loadPages(this.currentPage);\n await this._loading;\n }\n\n /**\n * Attaches a scroll event listener to the current object.\n * The `scrollEvent` function binds the `onScroll` method to the 'scroll' event\n * of the current object. This enables handling of scroll events for\n * specific functionality such as updating UI elements, loading content dynamically,\n * or tracking user interaction with scrollable content.\n */\n scrollEvent = () => {\n this.addEventListener('scroll', this.onScroll);\n };\n\n /**\n * A function that removes the scroll event listener from the current context.\n * This function is used to unbind the `onScroll` event listener\n * from the `scroll` event of the current object. It ensures that\n * the scroll event no longer triggers the `onScroll` handler.\n * @function\n */\n unScrollEvent = () => {\n this.removeEventListener('scroll', this.onScroll);\n };\n\n /**\n * A scroll event handler function that checks the scroll position and triggers loading additional content\n * when the user scrolls near the bottom of the page.\n * Properties accessed:\n * - `scrollTop`: The number of pixels that the content of an element is scrolled vertically.\n * - `scrollHeight`: The total height of the element's content.\n * - `clientHeight`: The inner height of the element in pixels, including padding but excluding borders and scrollbars.\n * Conditions:\n * - Determines if the scroll position is within 300 pixels of the bottom of the element.\n * - Verifies that the current page number is less than or equal to the total number of pages.\n * - Checks if the current page is already in the loading state.\n * Actions:\n * - Increments the current page number when the conditions are met.\n * - Initiates loading for the next page by calling the `loadPages` function.\n * @param {Event} e The scroll event object.\n */\n onScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n\n if (\n scrollTop + clientHeight >= scrollHeight - 300 &&\n this.currentPage <= this.totalPages &&\n this.isLoading.includes(this.currentPage)\n ) {\n this.currentPage++;\n this._loading = this.loadPages(this.currentPage);\n }\n };\n\n /**\n * Fetches the pages from the server.\n * @param {number} page The page number.\n * @returns {Promise<object>} The response from the server.\n */\n async getPages(page) {\n let hasParams = this.url.includes('?');\n const response = await fetch(\n `${this.url}${hasParams ? '&' : '?'}page=${page}&size=${this.size}${this?.queryParams}`,\n {\n signal: this._signal,\n }\n );\n\n if (!response.ok) {\n throw new Error(`An error occurred: ${response.status}`);\n }\n return await response.json();\n }\n\n /**\n * Hides the loader.\n */\n hideLoader() {\n this?.loadingEl?.classList.remove('show');\n }\n\n /**\n * Displays the loader element by adding the 'show' class to its class list.\n * This method is useful for indicating a loading or processing state in the UI.\n * @returns {void} No return value.\n */\n showLoader() {\n this?.loadingEl?.classList.add('show');\n }\n\n /**\n * Checks if there are more pages to load.\n * @param {number} page The page number.\n * @returns {boolean} Whether there are more pages to load.\n */\n hasMorePages(page) {\n return this.totalPages === 0 || page < this.totalPages;\n }\n\n /**\n * Loads the pages.\n * @param {number} page The page number.\n */\n async loadPages(page) {\n this.showLoader();\n try {\n if (this.hasMorePages(page)) {\n let response;\n this.parser = new DOMParser();\n\n if (typeof this.setCustomData === 'function') {\n response = await this.setCustomData(page, this._signal);\n } else {\n response = await this.getPages(page);\n }\n\n this.totalPages = response?.totalPages;\n this.currentPage = page;\n\n this.placementObj = this;\n\n // if there is a \"container\" attribute, find the element\n if (this.hasAttribute('placement')) this.placementObj = this.querySelector(this.placement);\n\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:load', response);\n\n this.response = response;\n\n this.customForeach(this.objectName ? response[this.objectName] : response);\n\n this.isLoading.push(page);\n } else {\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:complete');\n this.endingEl.classList.add('show');\n }\n } catch (error) {\n console.log(error);\n } finally {\n this.hideLoader();\n }\n }\n\n /**\n * Converts a data item into an HTML element based on a template.\n * This function takes a data item, interpolates it into a predefined template,\n * parses the resulting HTML string, and returns the first child element of the parsed HTML content.\n * @param {object} item The data object to interpolate into the HTML template.\n * @returns {Element} The first child element generated from the interpolated HTML string.\n */\n dataToHtml = (item) => {\n let interpolateItem = this.interpolate(this.infiniteScrollTemplate, item);\n let doc = this.parser.parseFromString(interpolateItem, 'text/html');\n let element = doc.activeElement.firstElementChild;\n\n return element;\n };\n\n /**\n * A custom implementation of the forEach method designed to iterate over an array of data,\n * transform each item into an HTML element, and append the element to a specified placement object.\n * Additionally, it adds an event listener to each generated element for handling click events.\n * @param {Array} data An array of items to process. Each item is transformed into an HTML element\n * and appended to the placement object specified in the context of `this`.\n */\n customForeach = (data) => {\n data.forEach((item) => {\n let element = this.dataToHtml(item);\n event.addListener(element, 'click', 'wje-infinite-scroll:click-item', null);\n\n this.placementObj.insertAdjacentElement('beforeend', element);\n });\n };\n\n /**\n * Interpolates a string template with values from the provided parameters object.\n * The template contains placeholders in the format `{{key}}` or `{{key.subkey}}`,\n * which are replaced with the corresponding values from the `params` object.\n * Placeholders support dot notation for accessing nested properties within the `params` object.\n * @param {string} template The string template containing placeholders to be replaced.\n * @param {object} params The object containing key-value pairs used for substitution in the template.\n * @returns {string} A string with all placeholders replaced by their respective values from the `params` object.\n */\n interpolate = (template, params) => {\n let keys = template.match(/\\{{.*?\\}}/g);\n\n if (keys) {\n for (let key of keys) {\n let cleanKey = key.replace('{{', '').replace('}}', '');\n let val = '';\n cleanKey.split('.').forEach((k) => {\n val = val === '' ? params[k] : val[k];\n });\n\n template = template.replace(key, val);\n }\n }\n return template;\n };\n}\n"],"names":[],"mappings":";;;;;AAkBe,MAAM,uBAAuB,UAAU;AAAA;AAAA;AAAA;AAAA,EAIlD,cAAc;AACV,UAAO;AAuDX,qCAAY;AA6GZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAc,MAAM;AAChB,WAAK,iBAAiB,UAAU,KAAK,QAAQ;AAAA,IAChD;AASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,MAAM;AAClB,WAAK,oBAAoB,UAAU,KAAK,QAAQ;AAAA,IACnD;AAkBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAW,CAAC,MAAM;AACd,YAAM,EAAE,WAAW,cAAc,aAAc,IAAG,EAAE;AAEpD,UACI,YAAY,gBAAgB,eAAe,OAC3C,KAAK,eAAe,KAAK,cACzB,KAAK,UAAU,SAAS,KAAK,WAAW,GAC1C;AACE,aAAK;AACL,aAAK,WAAW,KAAK,UAAU,KAAK,WAAW;AAAA,MAC3D;AAAA,IACK;AAiGD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAa,CAAC,SAAS;AACnB,UAAI,kBAA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