wj-elements 0.1.192 → 0.1.194
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/packages/wje-reorder/reorder.element.d.ts +1 -1
- package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +1 -1
- package/dist/wje-reorder.js +6 -5
- package/dist/wje-reorder.js.map +1 -1
- package/dist/wje-sliding-container.js +8 -9
- package/dist/wje-sliding-container.js.map +1 -1
- package/package.json +1 -1
|
@@ -115,5 +115,5 @@ export default class Reorder extends WJElement {
|
|
|
115
115
|
* // @fires wje-reorder:change - Dispatched when the reordering is completed.
|
|
116
116
|
* The event includes details about the initial position, the new position, and the new order.
|
|
117
117
|
*/
|
|
118
|
-
dispatchChange(from: number, to: number, order: Array<number
|
|
118
|
+
dispatchChange(from: number, to: number, order: Array<number>, orderElements: any): void;
|
|
119
119
|
}
|
|
@@ -193,7 +193,7 @@ export default class SlidingContainer extends WJElement {
|
|
|
193
193
|
* including an event listener to trigger the close method.
|
|
194
194
|
* @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.
|
|
195
195
|
*/
|
|
196
|
-
|
|
196
|
+
htmlCloseButton(): HTMLElement;
|
|
197
197
|
/**
|
|
198
198
|
* Retrieves the parent element of the current element.
|
|
199
199
|
* If the parent element is not found, it attempts to find the root host element.
|
package/dist/wje-reorder.js
CHANGED
|
@@ -219,15 +219,16 @@ class Reorder extends WJElement {
|
|
|
219
219
|
this.dragEl.style.top = "";
|
|
220
220
|
const parent = this.dragEl.parentNode;
|
|
221
221
|
const newIndex = Array.from(parent.children).indexOf(this.dragEl);
|
|
222
|
-
const
|
|
222
|
+
const newOrderElements = Array.from(parent.children).map((el) => {
|
|
223
223
|
const clonedNode = el.cloneNode(true);
|
|
224
224
|
const handle = clonedNode.querySelector(".handle");
|
|
225
225
|
if (handle) {
|
|
226
226
|
handle.remove();
|
|
227
227
|
}
|
|
228
|
-
return clonedNode
|
|
228
|
+
return clonedNode;
|
|
229
229
|
});
|
|
230
|
-
|
|
230
|
+
const newOrder = orderElements.map((el) => el.innerText.trim());
|
|
231
|
+
this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);
|
|
231
232
|
document.body.style.userSelect = "";
|
|
232
233
|
}
|
|
233
234
|
/**
|
|
@@ -266,10 +267,10 @@ class Reorder extends WJElement {
|
|
|
266
267
|
* // @fires wje-reorder:change - Dispatched when the reordering is completed.
|
|
267
268
|
* The event includes details about the initial position, the new position, and the new order.
|
|
268
269
|
*/
|
|
269
|
-
dispatchChange(from, to, order) {
|
|
270
|
+
dispatchChange(from, to, order, orderElements2) {
|
|
270
271
|
this.dispatchEvent(
|
|
271
272
|
new CustomEvent("wje-reorder:change", {
|
|
272
|
-
detail: { from, to, order }
|
|
273
|
+
detail: { from, to, order, orderElements: orderElements2 }
|
|
273
274
|
})
|
|
274
275
|
);
|
|
275
276
|
}
|
package/dist/wje-reorder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\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 * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrder = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode.innerText.trim();\n });\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder);\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define('wje-reorder', Reorder);\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAcX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAbR,SAAK,SAAS;AACd,SAAK,QAAQ,CAAE;AACf,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,UAAM,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;AACnC,SAAK,QAAQ,MAAM,aAAa;AAEhC,aAAS,KAAK,YAAY,KAAK,OAAO;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,aAAa,gBAAgB;AACzB,UAAM,SAAS,eAAe;AAC9B,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,KAAK,MAAM;AACjE,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,cAAc;AAEpE,WAAO,YAAY;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,eAAe,MAAM,IAAI,OAAO;AAC5B,SAAK;AAAA,MACD,IAAI,YAAY,sBAAsB;AAAA,QAClC,QAAQ,EAAE,MAAM,IAAI,MAAO;AAAA,MAC9B,CAAA;AAAA,IACJ;AAAA,EACT;AACA;AC3UA,QAAQ,OAAO,eAAe,OAAO;"}
|
|
1
|
+
{"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\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 * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrderElements = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode;\n });\n\n const newOrder = orderElements.map(el => el.innerText.trim());\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);\n\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order, orderElements) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order, orderElements },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define('wje-reorder', Reorder);\n"],"names":["orderElements"],"mappings":";;;;;AAgBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAcX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAbR,SAAK,SAAS;AACd,SAAK,QAAQ,CAAE;AACf,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAA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,UAAU,IAAI;AACzC,SAAK,QAAQ,MAAM,WAAW;AAC9B,SAAK,QAAQ,MAAM,gBAAgB;AACnC,SAAK,QAAQ,MAAM,aAAa;AAEhC,aAAS,KAAK,YAAY,KAAK,OAAO;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,aAAa,gBAAgB;AACzB,UAAM,SAAS,eAAe;AAC9B,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,KAAK,MAAM;AACjE,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,cAAc;AAEpE,WAAO,YAAY;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,eAAe,MAAM,IAAI,OAAOA,gBAAe;AAC3C,SAAK;AAAA,MACD,IAAI,YAAY,sBAAsB;AAAA,QAClC,QAAQ,EAAE,MAAM,IAAI,OAAO,eAAAA,eAAe;AAAA,MAC7C,CAAA;AAAA,IACJ;AAAA,EACT;AACA;AC9UA,QAAQ,OAAO,eAAe,OAAO;"}
|
|
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement from "./wje-element.js";
|
|
5
5
|
import { event } from "./event.js";
|
|
6
|
-
const styles = ":host {\n display: block;\n z-index: 9999;\n position: relative;\n height: 100%;\n right: unset;\n left: unset;\n
|
|
6
|
+
const styles = ":host {\n display: block;\n z-index: 9999;\n position: relative;\n height: 100%;\n right: unset;\n left: unset;\n .close-button {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1000;\n }\n}\n\n:host([hide-button]) {\n .close-button {\n display: none;\n }\n}\n\n.sliding-container-wrapper {\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.native-sliding-container {\n\n position: absolute;\n width: 0;\n height: 100%;\n}\n\n.native-sliding-container-inner {\n height: 100%;\n position: absolute;\n}\n";
|
|
7
7
|
class SlidingContainer extends WJElement {
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of SlidingContainer.
|
|
@@ -284,7 +284,7 @@ class SlidingContainer extends WJElement {
|
|
|
284
284
|
nativeInner.classList.add("native-sliding-container-inner");
|
|
285
285
|
nativeInner.style.width = this.maxWidth;
|
|
286
286
|
nativeInner.append(slot);
|
|
287
|
-
nativeInner.append(this.
|
|
287
|
+
nativeInner.append(this.htmlCloseButton());
|
|
288
288
|
native.append(nativeInner);
|
|
289
289
|
wrapperDiv.append(transparentDiv);
|
|
290
290
|
wrapperDiv.append(native);
|
|
@@ -312,18 +312,15 @@ class SlidingContainer extends WJElement {
|
|
|
312
312
|
* including an event listener to trigger the close method.
|
|
313
313
|
* @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.
|
|
314
314
|
*/
|
|
315
|
-
|
|
315
|
+
htmlCloseButton() {
|
|
316
316
|
let closeButton = document.createElement("wje-button");
|
|
317
317
|
closeButton.setAttribute("part", "close-button");
|
|
318
|
-
closeButton.
|
|
319
|
-
closeButton.style.top = "0";
|
|
320
|
-
closeButton.style.right = "0";
|
|
321
|
-
closeButton.style.zIndex = "1000";
|
|
318
|
+
closeButton.classList.add("close-button");
|
|
322
319
|
let icon = document.createElement("wje-icon");
|
|
323
320
|
icon.setAttribute("slot", "icon-only");
|
|
324
321
|
icon.setAttribute("name", "x");
|
|
325
|
-
closeButton.
|
|
326
|
-
|
|
322
|
+
closeButton.append(icon);
|
|
323
|
+
event.addListener(closeButton, "wje-button:click", null, (e) => {
|
|
327
324
|
this.close();
|
|
328
325
|
});
|
|
329
326
|
return closeButton;
|
|
@@ -502,6 +499,7 @@ class SlidingContainer extends WJElement {
|
|
|
502
499
|
async open(e) {
|
|
503
500
|
await Promise.resolve(this.beforeOpen(e)).then(async () => {
|
|
504
501
|
if (!this._isOpen) {
|
|
502
|
+
this.classList.add("open");
|
|
505
503
|
event.dispatchCustomEvent(this, "wje-sliding-container:beforeOpen");
|
|
506
504
|
this.checkForVariant(this.variant);
|
|
507
505
|
await this.doAnimateTransition();
|
|
@@ -519,6 +517,7 @@ class SlidingContainer extends WJElement {
|
|
|
519
517
|
async close(e) {
|
|
520
518
|
await Promise.resolve(this.beforeClose(e)).then(async () => {
|
|
521
519
|
if (this._isOpen) {
|
|
520
|
+
this.classList.remove("open");
|
|
522
521
|
event.dispatchCustomEvent(this, "wje-sliding-container:beforeClose");
|
|
523
522
|
await this.doAnimateTransition();
|
|
524
523
|
await Promise.resolve(this.afterClose(e)).then(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-sliding-container.js","sources":["../packages/wje-sliding-container/sliding-container.element.js","../packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement, event } from '../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 /**\n * Sets the maximum width of an element by updating the 'max-width' attribute.\n * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).\n */\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n /**\n * Gets the maximum width value of the element.\n * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.\n * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.\n */\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n /**\n * Sets the maximum height for the element.\n * @param {string} value The maximum height value to be applied to the element. This can include units such as \"px\", \"em\", \"%\", etc.\n */\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n /**\n * Retrieves the maximum height value of the element, or returns 'auto' if not set.\n * @returns {string} The maximum height value or 'auto' if the attribute is not specified.\n */\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n /**\n * Sets the 'trigger' attribute for the element.\n * @param {string} value The value to set for the 'trigger' attribute.\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.\n * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.\n */\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n /**\n * Sets the direction attribute for the element.\n * @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.\n */\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n /**\n * Retrieves the direction attribute of the instance.\n * If the direction attribute is not set, it defaults to 'right'.\n * @returns {string} The value of the direction attribute or 'right' if not set.\n */\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n /**\n * Sets the value of the `remove-child-after-close` attribute.\n * This attribute determines if a child element should be removed after a close operation.\n * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.\n */\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n /**\n * Gets the value indicating whether the child element should be removed after closing.\n *\n * This property checks the presence of the 'remove-child-after-close' attribute on the element.\n * Returns `false` if the attribute does not exist.\n * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.\n */\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n /**\n * Sets the 'variant' attribute to the specified value.\n * @param {string} value The value to set for the 'variant' attribute.\n */\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n /**\n * Retrieves the value of the \"variant\" attribute. If the attribute is not set,\n * it returns the default value 'in-place'.\n * @returns {string} The variant value or the default value 'in-place'.\n */\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n /**\n * Retrieves the value of the 'screen-break-point' attribute.\n * @returns {string} The value of the 'screen-break-point' attribute.\n */\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n /**\n * Sets the screen break point value to determine responsive behavior.\n * @param {string} value The value to set as the screen break point.\n */\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n /**\n * Sets the duration of the animation by updating the `animation-duration` attribute.\n * @param {string} value The duration value for the animation, specified in a format\n * such as seconds (e.g., \"2s\") or milliseconds (e.g., \"200ms\").\n */\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n /**\n * Gets the animation duration for an element.\n * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.\n * @returns {string} The value of the animation duration, either from the attribute or the default '500'.\n */\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n /**\n * Sets the easing function for the animation.\n * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as \"ease\", \"linear\", \"ease-in\", \"ease-out\", etc.\n */\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n /**\n * Retrieves the easing function for the animation.\n * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.\n */\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n /**\n * Determines if the element has an 'has-opacity' attribute.\n * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.\n */\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n /**\n * Sets the value of the 'add-to-height' attribute.\n * This attribute is used to modify or adjust the height dynamically.\n * @param {string} value The value to be assigned to the 'add-to-height' attribute.\n */\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n /**\n * Retrieves the value of the 'add-to-height' attribute from the element.\n * If the attribute is not set, it defaults to '0'.\n * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.\n */\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n /**\n * Determines whether the current state is open.\n * @returns {boolean} True if the state is open, otherwise false.\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 ['max-width', 'max-height', 'trigger', 'direction', 'variant', 'screen-break-point', 'remove-child-after-close', 'animation-duration', 'animation-easing', 'has-opacity'];\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 * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\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 let wrapperDiv = document.createElement('div');\n wrapperDiv.classList.add('sliding-container-wrapper');\n\n let transparentDiv = document.createElement('div');\n transparentDiv.classList.add('sliding-container-transparent');\n\n if (this._isOpen) {\n transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.setAttribute('part', 'sliding-container');\n native.classList.add('native-sliding-container');\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 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.width = this.maxWidth;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.getCloseButton());\n\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(wrapperDiv);\n\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv\n this.nativeElement = native;\n\n return fragment;\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 /**\n * Creates and returns a styled close button element with an icon,\n * including an event listener to trigger the close method.\n * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.\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 * Retrieves the parent element of the current element.\n * If the parent element is not found, it attempts to find the root host element.\n * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.\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 * Adjusts the position and dimensions of the current element based on the specified variant.\n *\n * The method handles modifications to the element's positioning style, aligns it relative to its parent,\n * and manages alignment to its siblings based on the specified direction.\n * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.\n * @returns {void} No value is returned, the method modifies the element's style properties directly.\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(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\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(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of elements with specified options, toggling the visibility and/or dimensions\n * of the associated elements based on their current state.\n *\n * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)\n * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided\n * elements before initiating a new animation sequence.\n * @returns {Promise<void>} A promise that resolves when the transition animation is completed.\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 sliding container by performing necessary preparatory and transitional operations.\n * @param {Event} e The event that triggered the open operation.\n * @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.\n */\n async open(e) {\n await Promise.resolve(this.beforeOpen(e)).then(async () => {\n if (!this._isOpen) {\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeOpen')\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(e)).then(() => {\n event.dispatchCustomEvent(this, 'wje-sliding-container:open')\n });\n }\n });\n }\n\n /**\n * Closes the sliding container and performs associated operations such as animations and event dispatches.\n * @param {Event} e The event object associated with the close action.\n * @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.\n */\n async close(e) {\n await Promise.resolve(this.beforeClose(e)).then(async () => {\n if (this._isOpen) {\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeClose');\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(e)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:afterClose');\n });\n }\n });\n }\n\n /**\n * Toggles the state between open and closed.\n * @param {Event} e The event object triggering the toggle.\n * @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.\n */\n async toggle(e) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n /**\n * Cleans up resources associated with the component by disconnecting\n * the resize observer and setting it to null.\n * @returns {void} Does not return a value.\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;AAyNX,qCAAY;AAiNZ;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,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,UAAU,CAAC,CAAC,EAAE,KAAK,MAAM;AAChD,gBAAM,oBAAoB,MAAM,4BAA4B;AAAA,QAChF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,MAAM,GAAG;AACX,UAAM,QAAQ,QAAQ,KAAK,YAAY,CAAC,CAAC,EAAE,KAAK,YAAY;AACxD,UAAI,KAAK,SAAS;AACd,cAAM,oBAAoB,MAAM,mCAAmC;AAEnE,cAAM,KAAK,oBAAqB;AAEhC,cAAM,QAAQ,QAAQ,KAAK,WAAW,CAAC,CAAC,EAAE,KAAK,MAAM;AACjD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAQ;AAAA,YAC1C,CAAyB;AAAA,UACzB;AAEoB,gBAAM,oBAAoB,MAAM,kCAAkC;AAAA,QACtF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,OAAO,GAAG;AACZ,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;ACjqBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
|
|
1
|
+
{"version":3,"file":"wje-sliding-container.js","sources":["../packages/wje-sliding-container/sliding-container.element.js","../packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement, event } from '../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 /**\n * Sets the maximum width of an element by updating the 'max-width' attribute.\n * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).\n */\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n /**\n * Gets the maximum width value of the element.\n * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.\n * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.\n */\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n /**\n * Sets the maximum height for the element.\n * @param {string} value The maximum height value to be applied to the element. This can include units such as \"px\", \"em\", \"%\", etc.\n */\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n /**\n * Retrieves the maximum height value of the element, or returns 'auto' if not set.\n * @returns {string} The maximum height value or 'auto' if the attribute is not specified.\n */\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n /**\n * Sets the 'trigger' attribute for the element.\n * @param {string} value The value to set for the 'trigger' attribute.\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.\n * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.\n */\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n /**\n * Sets the direction attribute for the element.\n * @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.\n */\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n /**\n * Retrieves the direction attribute of the instance.\n * If the direction attribute is not set, it defaults to 'right'.\n * @returns {string} The value of the direction attribute or 'right' if not set.\n */\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n /**\n * Sets the value of the `remove-child-after-close` attribute.\n * This attribute determines if a child element should be removed after a close operation.\n * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.\n */\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n /**\n * Gets the value indicating whether the child element should be removed after closing.\n *\n * This property checks the presence of the 'remove-child-after-close' attribute on the element.\n * Returns `false` if the attribute does not exist.\n * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.\n */\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n /**\n * Sets the 'variant' attribute to the specified value.\n * @param {string} value The value to set for the 'variant' attribute.\n */\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n /**\n * Retrieves the value of the \"variant\" attribute. If the attribute is not set,\n * it returns the default value 'in-place'.\n * @returns {string} The variant value or the default value 'in-place'.\n */\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n /**\n * Retrieves the value of the 'screen-break-point' attribute.\n * @returns {string} The value of the 'screen-break-point' attribute.\n */\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n /**\n * Sets the screen break point value to determine responsive behavior.\n * @param {string} value The value to set as the screen break point.\n */\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n /**\n * Sets the duration of the animation by updating the `animation-duration` attribute.\n * @param {string} value The duration value for the animation, specified in a format\n * such as seconds (e.g., \"2s\") or milliseconds (e.g., \"200ms\").\n */\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n /**\n * Gets the animation duration for an element.\n * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.\n * @returns {string} The value of the animation duration, either from the attribute or the default '500'.\n */\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n /**\n * Sets the easing function for the animation.\n * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as \"ease\", \"linear\", \"ease-in\", \"ease-out\", etc.\n */\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n /**\n * Retrieves the easing function for the animation.\n * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.\n */\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n /**\n * Determines if the element has an 'has-opacity' attribute.\n * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.\n */\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n /**\n * Sets the value of the 'add-to-height' attribute.\n * This attribute is used to modify or adjust the height dynamically.\n * @param {string} value The value to be assigned to the 'add-to-height' attribute.\n */\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n /**\n * Retrieves the value of the 'add-to-height' attribute from the element.\n * If the attribute is not set, it defaults to '0'.\n * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.\n */\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n /**\n * Determines whether the current state is open.\n * @returns {boolean} True if the state is open, otherwise false.\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 ['max-width', 'max-height', 'trigger', 'direction', 'variant', 'screen-break-point', 'remove-child-after-close', 'animation-duration', 'animation-easing', 'has-opacity'];\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 * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\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 let wrapperDiv = document.createElement('div');\n wrapperDiv.classList.add('sliding-container-wrapper');\n\n let transparentDiv = document.createElement('div');\n transparentDiv.classList.add('sliding-container-transparent');\n\n if (this._isOpen) {\n transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.setAttribute('part', 'sliding-container');\n native.classList.add('native-sliding-container');\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 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.width = this.maxWidth;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(wrapperDiv);\n\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv\n this.nativeElement = native;\n\n return fragment;\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 /**\n * Creates and returns a styled close button element with an icon,\n * including an event listener to trigger the close method.\n * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.\n */\n htmlCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.classList.add('close-button');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n\n closeButton.append(icon);\n\n event.addListener(closeButton, 'wje-button:click', null,(e) => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Retrieves the parent element of the current element.\n * If the parent element is not found, it attempts to find the root host element.\n * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.\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 * Adjusts the position and dimensions of the current element based on the specified variant.\n *\n * The method handles modifications to the element's positioning style, aligns it relative to its parent,\n * and manages alignment to its siblings based on the specified direction.\n * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.\n * @returns {void} No value is returned, the method modifies the element's style properties directly.\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(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\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(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of elements with specified options, toggling the visibility and/or dimensions\n * of the associated elements based on their current state.\n *\n * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)\n * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided\n * elements before initiating a new animation sequence.\n * @returns {Promise<void>} A promise that resolves when the transition animation is completed.\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 sliding container by performing necessary preparatory and transitional operations.\n * @param {Event} e The event that triggered the open operation.\n * @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.\n */\n async open(e) {\n await Promise.resolve(this.beforeOpen(e)).then(async () => {\n if (!this._isOpen) {\n this.classList.add('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeOpen')\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(e)).then(() => {\n event.dispatchCustomEvent(this, 'wje-sliding-container:open')\n });\n }\n });\n }\n\n /**\n * Closes the sliding container and performs associated operations such as animations and event dispatches.\n * @param {Event} e The event object associated with the close action.\n * @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.\n */\n async close(e) {\n await Promise.resolve(this.beforeClose(e)).then(async () => {\n if (this._isOpen) {\n this.classList.remove('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeClose');\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(e)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:afterClose');\n });\n }\n });\n }\n\n /**\n * Toggles the state between open and closed.\n * @param {Event} e The event object triggering the toggle.\n * @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.\n */\n async toggle(e) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n /**\n * Cleans up resources associated with the component by disconnecting\n * the resize observer and setting it to null.\n * @returns {void} Does not return a value.\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;AAyNX,qCAAY;AA+MZ;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;AAhbG,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;AAAA,MACA;AAAA,IACA,CAAS;AAED,SAAK,gBAAgB,QAAQ,SAAS,eAAe;AAAA,EAC7D;AAAA;AAAA;AAAA;AA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;AAAA,EAOI,MAAM,OAAO,GAAG;AACZ,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;ACnqBA,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.194",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|