wj-elements 0.7.0 → 0.7.1

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.
@@ -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\nlet documentScrollLocks = 0;\nlet documentScrollState = null;\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 backdrop - Styles the mobile bottom sheet backdrop.\n * @csspart sliding-container - Styles the native sliding panel.\n * @csspart close-button - Styles the generated close button.\n * @csspart sheet-handle-area - Styles the draggable resize handle hit area.\n * @csspart sheet-handle - Styles the visible draggable resize handle.\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 * @property {string} mobilePresentation - Enables mobile presentation, for example 'bottom-sheet'.\n * @property {string} mobileBreakPoint - The viewport width where mobile presentation becomes active.\n * @property {boolean} backdropDismiss - Closes the mobile bottom sheet when the backdrop is clicked.\n * @property {boolean} sheetResizable - Enables mobile bottom sheet resizing.\n * @property {string} sheetScope - Defines whether the mobile bottom sheet is scoped to the container or viewport.\n * @property {string} sheetBoundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet.\n * @property {string} sheetHeight - The mobile bottom sheet height after opening.\n * @property {string} sheetMinHeight - The minimum mobile bottom sheet height while resizing.\n * @property {string} sheetMaxHeight - The maximum mobile bottom sheet height while resizing.\n * @attribute {string} mobile-presentation - Enables responsive mobile presentation. Use \"bottom-sheet\".\n * @attribute {string} mobile-break-point - Viewport width where mobile presentation becomes active. Defaults to \"768\".\n * @attribute {boolean} backdrop-dismiss - Closes the mobile bottom sheet when the backdrop is clicked.\n * @attribute {boolean} sheet-resizable - Enables resizing the mobile bottom sheet with a handle.\n * @attribute {string} sheet-scope - Defines whether the sheet is scoped to \"viewport\", \"parent\", or a bounded container.\n * @attribute {string} sheet-boundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet.\n * @attribute {string} sheet-height - The mobile bottom sheet height after opening.\n * @attribute {string} sheet-min-height - The minimum mobile bottom sheet height while resizing.\n * @attribute {string} sheet-max-height - The maximum mobile bottom sheet height while resizing.\n * @cssproperty [--wje-sliding-container-background=var(--wje-background)] - Background of the sliding panel.\n * @cssproperty [--wje-sliding-container-backdrop-background=var(--wje-backdrop)] - Background of the mobile bottom sheet backdrop.\n * @cssproperty [--wje-sliding-container-backdrop-opacity=1] - Backdrop opacity while the mobile bottom sheet is open.\n * @cssproperty [--wje-sliding-container-box-shadow=var(--wje-sliding-container-shadow)] - Shadow of the mobile bottom sheet panel.\n * @cssproperty [--wje-sliding-container-sheet-border-radius=var(--wje-sliding-container-border-radius) var(--wje-sliding-container-border-radius) 0 0] - Border radius of the mobile bottom sheet panel.\n * @cssproperty [--wje-sliding-container-sheet-handle-area-height=24px] - Height of the resize handle hit area.\n * @cssproperty [--wje-sliding-container-sheet-handle-width=36px] - Width of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-height=2px] - Height of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-background=var(--wje-border-color)] - Background of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-radius=999px] - Border radius of the visible resize handle.\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 this._sheetDrag = null;\n this._sheetIgnoreDismissUntil = 0;\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = 0;\n this._hasLockedDocumentScroll = false;\n this._bottomSheetScopeFrame = 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.isBottomSheet()) {\n this.checkForVariant(this.variant);\n } else 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 mobile presentation mode.\n * @param {string} value The mobile presentation mode.\n */\n set mobilePresentation(value) {\n this.setAttribute('mobile-presentation', value);\n }\n\n /**\n * Gets mobile presentation mode.\n * @returns {string|null} The mobile presentation mode.\n */\n get mobilePresentation() {\n return this.getAttribute('mobile-presentation');\n }\n\n /**\n * Sets the breakpoint for mobile presentation.\n * @param {string} value The mobile breakpoint.\n */\n set mobileBreakPoint(value) {\n this.setAttribute('mobile-break-point', value);\n }\n\n /**\n * Gets the breakpoint for mobile presentation.\n * @returns {string} The mobile breakpoint.\n */\n get mobileBreakPoint() {\n return this.getAttribute('mobile-break-point') || '768';\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 * Determines if the bottom sheet should close when the backdrop is clicked.\n * @returns {boolean} True if backdrop dismiss is enabled.\n */\n get backdropDismiss() {\n return this.hasAttribute('backdrop-dismiss') ?? false;\n }\n\n /**\n * Enables resizing for the mobile bottom sheet.\n * @returns {boolean} True if the sheet can be resized.\n */\n get sheetResizable() {\n return this.hasAttribute('sheet-resizable') ?? false;\n }\n\n /**\n * Sets resizing for the mobile bottom sheet.\n * @param {boolean|string} value The value to set.\n */\n set sheetResizable(value) {\n this.setAttribute('sheet-resizable', value);\n }\n\n /**\n * Gets the mobile bottom sheet scope.\n * @returns {string} Either 'viewport', 'container', or 'parent'.\n */\n get sheetScope() {\n return this.getAttribute('sheet-scope') || 'viewport';\n }\n\n /**\n * Sets the mobile bottom sheet scope.\n * @param {string} value The new boundary mode for the mobile sheet.\n */\n set sheetScope(value) {\n this.setAttribute('sheet-scope', value);\n }\n\n /**\n * Gets the selector used for container-scoped mobile bottom sheets.\n * @returns {string|null} A CSS selector used to find the composed boundary ancestor.\n */\n get sheetBoundary() {\n return this.getAttribute('sheet-boundary');\n }\n\n /**\n * Sets the selector used for container-scoped mobile bottom sheets.\n * @param {string} value Selector for the boundary element.\n */\n set sheetBoundary(value) {\n this.setAttribute('sheet-boundary', value);\n }\n\n /**\n * Gets the mobile bottom sheet opening height.\n * @returns {string|null} The opening height.\n */\n get sheetHeight() {\n return this.getAttribute('sheet-height');\n }\n\n /**\n * Sets the mobile bottom sheet opening height.\n * @param {string} value The opening height.\n */\n set sheetHeight(value) {\n this.setAttribute('sheet-height', value);\n }\n\n /**\n * Gets the minimum mobile bottom sheet height while resizing.\n * @returns {string|null} The minimum height.\n */\n get sheetMinHeight() {\n return this.getAttribute('sheet-min-height');\n }\n\n /**\n * Sets the minimum mobile bottom sheet height while resizing.\n * @param {string} value The minimum height.\n */\n set sheetMinHeight(value) {\n this.setAttribute('sheet-min-height', value);\n }\n\n /**\n * Gets the maximum mobile bottom sheet height while resizing.\n * @returns {string|null} The maximum height.\n */\n get sheetMaxHeight() {\n return this.getAttribute('sheet-max-height');\n }\n\n /**\n * Sets the maximum mobile bottom sheet height while resizing.\n * @param {string} value The maximum height.\n */\n set sheetMaxHeight(value) {\n this.setAttribute('sheet-max-height', value);\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', 'mobile-presentation', 'mobile-break-point', 'backdrop-dismiss', 'sheet-resizable', 'sheet-scope', 'sheet-boundary', 'sheet-height', 'sheet-min-height', 'sheet-max-height'];\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 this.syncAria();\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n this.endSheetDrag();\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 const isBottomSheet = this.isBottomSheet();\n\n let backdrop = document.createElement('div');\n backdrop.setAttribute('part', 'backdrop');\n backdrop.classList.add('sliding-container-backdrop');\n if (this._isOpen && isBottomSheet) {\n backdrop.style.opacity = 'var(--wje-sliding-container-backdrop-opacity, 1)';\n }\n backdrop.addEventListener('wheel', this.preventBottomSheetScroll, { passive: false });\n backdrop.addEventListener('touchmove', this.preventBottomSheetScroll, { passive: false });\n\n if (this.backdropDismiss) {\n backdrop.addEventListener('pointerdown', this.handleBackdropPointerStart);\n backdrop.addEventListener('pointermove', this.handleBackdropPointerMove);\n backdrop.addEventListener('pointerup', this.handleBackdropPointerEnd);\n backdrop.addEventListener('pointercancel', this.handleBackdropPointerCancel);\n backdrop.addEventListener('click', (e) => {\n if (this.isEventInsideSheet(e) || Date.now() < this._sheetIgnoreDismissUntil || Date.now() < this._sheetBackdropHandledUntil) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n if (e.target === backdrop) {\n this.close(e);\n }\n });\n }\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 && !isBottomSheet) {\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 = isBottomSheet ? '100%' : 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = isBottomSheet ? '100%' : this.maxWidth;\n if (isBottomSheet) {\n native.style.transform = 'translateY(0)';\n }\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n } else if (isBottomSheet) {\n native.style.transform = 'translateY(100%)';\n }\n\n if (isBottomSheet) {\n native.style.left = 0;\n native.style.right = 0;\n native.style.bottom = 0;\n native.style.maxHeight = this.maxHeight;\n } else if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.width = isBottomSheet ? '100%' : this.maxWidth;\n if (isBottomSheet) {\n nativeInner.style.maxHeight = this.maxHeight;\n }\n\n let slot = document.createElement('slot');\n this.sheetHandleArea = null;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n if (this.sheetResizable) {\n native.append(this.htmlSheetHandle());\n }\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(backdrop);\n fragment.append(wrapperDiv);\n\n this.backdropElement = backdrop;\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv;\n this.nativeElement = native;\n this.nativeInner = nativeInner;\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 this.syncAria();\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (!this.isBottomSheet() && this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n /**\n * Returns whether the mobile bottom sheet presentation is active.\n * @returns {boolean}\n */\n isBottomSheet() {\n return this.mobilePresentation === 'bottom-sheet' && window.innerWidth <= +this.mobileBreakPoint;\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'region' });\n }\n\n this.setAriaState({ hidden: !this.isOpen });\n\n const ariaLabel = this.getAttribute('aria-label');\n const label = this.getAttribute('label');\n if (!ariaLabel && label) {\n this.setAriaState({ label });\n }\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 * Creates the mobile bottom sheet resize handle.\n * @returns {HTMLElement} The resize handle element.\n */\n htmlSheetHandle() {\n const handleArea = document.createElement('div');\n handleArea.setAttribute('part', 'sheet-handle-area');\n handleArea.setAttribute('role', 'separator');\n handleArea.setAttribute('aria-orientation', 'horizontal');\n handleArea.classList.add('sliding-container-sheet-handle-area');\n\n const handle = document.createElement('div');\n handle.setAttribute('part', 'sheet-handle');\n handle.classList.add('sliding-container-sheet-handle');\n\n handleArea.append(handle);\n handleArea.addEventListener('pointerdown', this.handleSheetDragStart, { capture: true });\n handleArea.addEventListener('touchstart', this.handleSheetTouchStart, { capture: true, passive: false });\n handleArea.addEventListener('click', this.stopSheetHandleEvent, { capture: true });\n handleArea.addEventListener('mousedown', this.stopSheetHandleEvent, { capture: true });\n handleArea.addEventListener('mouseup', this.stopSheetHandleEvent, { capture: true });\n\n this.sheetHandleArea = handleArea;\n\n return handleArea;\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 * Finds the closest element across shadow DOM boundaries.\n * @param {string} selector The selector to match.\n * @returns {Element|null} The matched composed ancestor.\n */\n getClosestComposedElement(selector) {\n let currentElement = this;\n\n while (currentElement) {\n let matches = false;\n\n try {\n matches = currentElement instanceof Element && currentElement.matches(selector);\n } catch {\n return null;\n }\n\n if (matches) {\n return currentElement;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n continue;\n }\n\n const root = currentElement.getRootNode?.();\n currentElement = root instanceof ShadowRoot ? root.host : null;\n }\n\n return null;\n }\n\n /**\n * Returns the viewport frame.\n * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}}\n */\n getViewportFrame() {\n return {\n top: 0,\n left: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n width: window.innerWidth,\n height: window.innerHeight,\n };\n }\n\n /**\n * Returns the element that bounds the mobile bottom sheet.\n * @returns {Element|null} The scope element, or null for viewport scope.\n */\n getBottomSheetScopeElement() {\n if (this.sheetScope === 'viewport') return null;\n if (this.sheetScope === 'parent') return this.getParentElement();\n if (this.sheetBoundary) return this.getClosestComposedElement(this.sheetBoundary);\n\n return this.getParentElement();\n }\n\n /**\n * Returns the frame used by the mobile bottom sheet.\n * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}}\n */\n getBottomSheetScopeFrame() {\n const scopeElement = this.getBottomSheetScopeElement();\n if (!scopeElement) return this.getViewportFrame();\n\n const rect = scopeElement.getBoundingClientRect();\n const top = Math.max(rect.top, 0);\n const left = Math.max(rect.left, 0);\n const right = Math.min(rect.right, window.innerWidth);\n const bottom = Math.min(rect.bottom, window.innerHeight);\n const width = right - left;\n const height = bottom - top;\n\n if (width <= 0 || height <= 0) {\n return this.getViewportFrame();\n }\n\n return {\n top,\n left,\n right,\n bottom,\n width,\n height,\n };\n }\n\n /**\n * Applies a fixed frame to a bottom sheet layer.\n * @param {HTMLElement|SlidingContainer} element The element to update.\n * @param {object} frame The frame to apply.\n */\n setBottomSheetLayerFrame(element, frame) {\n element.style.top = frame.top + 'px';\n element.style.left = frame.left + 'px';\n element.style.right = 'auto';\n element.style.bottom = 'auto';\n element.style.width = frame.width + 'px';\n element.style.height = frame.height + 'px';\n }\n\n /**\n * Removes fixed frame styles from a bottom sheet layer.\n * @param {HTMLElement|SlidingContainer} element The element to reset.\n */\n resetBottomSheetLayerFrame(element) {\n element?.style.removeProperty('top');\n element?.style.removeProperty('left');\n element?.style.removeProperty('right');\n element?.style.removeProperty('bottom');\n element?.style.removeProperty('width');\n element?.style.removeProperty('height');\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 (this.isBottomSheet()) {\n this.setBottomSheetVariant();\n return;\n }\n\n this.resetBottomSheetVariant();\n\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 * Applies the mobile bottom sheet layout.\n */\n setBottomSheetVariant() {\n const scopeFrame = this.getBottomSheetScopeFrame();\n this._bottomSheetScopeFrame = scopeFrame;\n\n this.classList.add('bottom-sheet');\n this.style.position = 'fixed';\n this.setBottomSheetLayerFrame(this, scopeFrame);\n this.setBottomSheetLayerFrame(this.backdropElement, scopeFrame);\n this.setBottomSheetLayerFrame(this.wrapperDiv, scopeFrame);\n\n this.wrapperDiv.style.height = '100%';\n this.transparentDiv.style.width = 0;\n\n this.nativeElement.style.left = scopeFrame.left + 'px';\n this.nativeElement.style.right = 'auto';\n this.nativeElement.style.bottom = window.innerHeight - scopeFrame.bottom + 'px';\n this.nativeElement.style.top = 'auto';\n this.nativeElement.style.width = scopeFrame.width + 'px';\n if (this._sheetDrag) {\n this.nativeElement.style.maxHeight = this.getSheetMaxHeightInPixels() + 'px';\n } else {\n this.setSheetHeight();\n }\n this.setBottomSheetVisualState(this.classList.contains('open'));\n\n this.nativeInner.style.width = '100%';\n this.nativeInner.style.maxHeight = this.nativeElement.style.maxHeight;\n }\n\n /**\n * Removes layout styles managed by the mobile bottom sheet mode.\n */\n resetBottomSheetVariant() {\n if (!this.classList.contains('bottom-sheet')) return;\n\n this.classList.remove('bottom-sheet');\n this.style.removeProperty('position');\n this.resetBottomSheetLayerFrame(this);\n\n this.resetBottomSheetLayerFrame(this.backdropElement);\n this.resetBottomSheetLayerFrame(this.wrapperDiv);\n if (this.transparentDiv) {\n this.transparentDiv.style.width = this._isOpen ? this.maxWidth : 0;\n }\n this.nativeElement?.style.removeProperty('left');\n this.nativeElement?.style.removeProperty('right');\n this.nativeElement?.style.removeProperty('bottom');\n this.nativeElement?.style.removeProperty('top');\n this.nativeElement?.style.removeProperty('height');\n this.nativeElement?.style.removeProperty('max-height');\n this.nativeElement?.style.removeProperty('transform');\n if (this.nativeElement) {\n if (this.direction === 'right') {\n this.nativeElement.style.right = 0;\n } else {\n this.nativeElement.style.left = 0;\n }\n this.nativeElement.style.width = this._isOpen ? this.maxWidth : 0;\n }\n this.nativeInner?.style.removeProperty('max-height');\n if (this.nativeInner) {\n this.nativeInner.style.width = this.maxWidth;\n }\n this.backdropElement?.style.removeProperty('opacity');\n this._bottomSheetScopeFrame = null;\n this.endSheetDrag();\n this.unlockDocumentScroll();\n }\n\n /**\n * Applies the current visual open or closed state to the mobile bottom sheet.\n * @param {boolean} isOpen True when the sheet should be visible.\n */\n setBottomSheetVisualState(isOpen) {\n this.nativeElement.style.transform = isOpen ? 'translateY(0)' : 'translateY(100%)';\n\n if (this.hasOpacity) {\n this.nativeElement.style.opacity = isOpen ? 1 : 0;\n }\n\n this.backdropElement.style.opacity = isOpen ? 'var(--wje-sliding-container-backdrop-opacity, 1)' : 0;\n }\n\n /**\n * Gets the CSS height limit used for the mobile bottom sheet.\n * @returns {string} The CSS max height.\n */\n getSheetMaxHeight() {\n return this.sheetMaxHeight || this.maxHeight;\n }\n\n /**\n * Applies the configured bottom sheet opening height.\n */\n setSheetHeight() {\n const maxHeightInPixels = this.getSheetMaxHeightInPixels();\n\n this.nativeElement.style.maxHeight = maxHeightInPixels + 'px';\n\n if (!this.sheetHeight) {\n this.nativeElement.style.removeProperty('height');\n return;\n }\n\n const minHeight = Math.min(this.getSheetMinHeightInPixels(), maxHeightInPixels);\n const height = this.resolveCssHeight(this.sheetHeight, maxHeightInPixels);\n const clampedHeight = this.clamp(height, minHeight, maxHeightInPixels);\n\n this.nativeElement.style.height = clampedHeight + 'px';\n }\n\n /**\n * Resolves the sheet minimum height in pixels.\n * @returns {number} The minimum height.\n */\n getSheetMinHeightInPixels() {\n const availableHeight = this.getBottomSheetAvailableHeight();\n\n return Math.min(\n this.resolveCssHeight(this.sheetMinHeight || '30vh', availableHeight * 0.3),\n availableHeight\n );\n }\n\n /**\n * Resolves the sheet maximum height in pixels.\n * @returns {number} The maximum height.\n */\n getSheetMaxHeightInPixels() {\n const availableHeight = this.getBottomSheetAvailableHeight();\n\n return Math.min(\n this.resolveCssHeight(this.getSheetMaxHeight(), availableHeight * 0.9),\n availableHeight\n );\n }\n\n /**\n * Returns available height for the bottom sheet scope.\n * @returns {number} Pixel height that can be used inside the current sheet frame.\n */\n getBottomSheetAvailableHeight() {\n return this._bottomSheetScopeFrame?.height || this.getBottomSheetScopeFrame().height || window.innerHeight;\n }\n\n /**\n * Resolves a CSS height value against the viewport.\n * @param {string} value The configured sheet height.\n * @param {number} fallback The fallback height in pixels.\n * @returns {number} The resolved height.\n */\n resolveCssHeight(value, fallback) {\n if (!value || value === 'auto') return fallback;\n\n const normalizedValue = `${value}`.trim();\n const parsedValue = Number.parseFloat(normalizedValue);\n\n if (Number.isNaN(parsedValue)) return fallback;\n if (normalizedValue.endsWith('px')) return parsedValue;\n if (normalizedValue.endsWith('vh')) return window.innerHeight * parsedValue / 100;\n if (normalizedValue.endsWith('vw')) return window.innerWidth * parsedValue / 100;\n if (normalizedValue.endsWith('%')) return window.innerHeight * parsedValue / 100;\n if (/^-?\\d+(\\.\\d+)?$/.test(normalizedValue)) return parsedValue;\n\n return fallback;\n }\n\n /**\n * Clamps a number between min and max.\n * @param {number} value The measured height.\n * @param {number} min The minimum.\n * @param {number} max The maximum.\n * @returns {number} The clamped value.\n */\n clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n }\n\n /**\n * Stops a handle interaction from dismissing the bottom sheet.\n * @param {Event} e The interaction emitted by the resize handle.\n */\n stopSheetHandleEvent = (e) => {\n if (!this.isBottomSheet()) return;\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n };\n\n /**\n * Checks whether an event came from the resize handle.\n * @param {Event} e The event to check.\n * @returns {boolean} True when the event belongs to the resize handle.\n */\n isSheetHandleEvent(e) {\n if (!e?.composedPath) return false;\n\n return e.composedPath().includes(this.sheetHandleArea);\n }\n\n /**\n * Checks whether an event happened inside the visible bottom sheet.\n * @param {Event} e The event to check.\n * @returns {boolean} True when the event coordinates are inside the sheet.\n */\n isEventInsideSheet(e) {\n if (!this.nativeElement || typeof e?.clientX !== 'number' || typeof e?.clientY !== 'number') return false;\n\n const rect = this.nativeElement.getBoundingClientRect();\n\n return e.clientX >= rect.left\n && e.clientX <= rect.right\n && e.clientY >= rect.top\n && e.clientY <= rect.bottom;\n }\n\n /**\n * Prevents scroll events from reaching the page behind the bottom sheet.\n * @param {Event} e The scroll event.\n */\n preventBottomSheetScroll = (e) => {\n if (!this.isBottomSheet() || !this.classList.contains('open')) return;\n\n e.preventDefault();\n e.stopPropagation();\n };\n\n /**\n * Prevents the page behind the mobile bottom sheet from scrolling.\n */\n lockDocumentScroll() {\n if (!this.isBottomSheet() || this.sheetScope !== 'viewport' || this._hasLockedDocumentScroll) return;\n\n if (documentScrollLocks === 0) {\n documentScrollState = {\n bodyOverflow: document.body.style.overflow,\n documentOverflow: document.documentElement.style.overflow,\n bodyOverscrollBehavior: document.body.style.overscrollBehavior,\n documentOverscrollBehavior: document.documentElement.style.overscrollBehavior,\n bodyPosition: document.body.style.position,\n bodyTop: document.body.style.top,\n bodyLeft: document.body.style.left,\n bodyRight: document.body.style.right,\n bodyWidth: document.body.style.width,\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n };\n\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n document.body.style.overscrollBehavior = 'none';\n document.documentElement.style.overscrollBehavior = 'none';\n document.body.style.position = 'fixed';\n document.body.style.top = `-${documentScrollState.scrollY}px`;\n document.body.style.left = `-${documentScrollState.scrollX}px`;\n document.body.style.right = '0';\n document.body.style.width = '100%';\n }\n\n documentScrollLocks++;\n this._hasLockedDocumentScroll = true;\n }\n\n /**\n * Restores page scrolling after the mobile bottom sheet is closed.\n */\n unlockDocumentScroll() {\n if (!this._hasLockedDocumentScroll) return;\n\n documentScrollLocks = Math.max(documentScrollLocks - 1, 0);\n this._hasLockedDocumentScroll = false;\n\n if (documentScrollLocks > 0 || !documentScrollState) return;\n\n document.body.style.overflow = documentScrollState.bodyOverflow;\n document.documentElement.style.overflow = documentScrollState.documentOverflow;\n document.body.style.overscrollBehavior = documentScrollState.bodyOverscrollBehavior;\n document.documentElement.style.overscrollBehavior = documentScrollState.documentOverscrollBehavior;\n document.body.style.position = documentScrollState.bodyPosition;\n document.body.style.top = documentScrollState.bodyTop;\n document.body.style.left = documentScrollState.bodyLeft;\n document.body.style.right = documentScrollState.bodyRight;\n document.body.style.width = documentScrollState.bodyWidth;\n window.scrollTo(documentScrollState.scrollX, documentScrollState.scrollY);\n documentScrollState = null;\n }\n\n /**\n * Stores the initial drag state for the mobile bottom sheet.\n * @param {number|string} pointerId The pointer identifier.\n * @param {number} startY The starting Y coordinate.\n */\n startSheetDrag(pointerId, startY) {\n if (this.classList.contains('open')) {\n this.setBottomSheetVisualState(true);\n }\n\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n this.animation = null;\n this.nativeAnimation = null;\n\n const fallbackHeight = this.resolveCssHeight(this.sheetHeight, window.innerHeight * 0.5);\n const currentHeight = this.nativeElement.getBoundingClientRect().height || fallbackHeight;\n\n this._sheetDrag = {\n pointerId,\n startY,\n startHeight: currentHeight,\n minHeight: this.getSheetMinHeightInPixels(),\n maxHeight: this.getSheetMaxHeightInPixels(),\n hasMoved: false,\n };\n }\n\n /**\n * Applies a new height while the bottom sheet is being dragged.\n * @param {number} clientY The current Y coordinate.\n */\n updateSheetDrag(clientY) {\n const distance = this._sheetDrag.startY - clientY;\n if (Math.abs(distance) > 3) {\n this._sheetDrag.hasMoved = true;\n }\n\n const height = this.clamp(\n this._sheetDrag.startHeight + distance,\n this._sheetDrag.minHeight,\n this._sheetDrag.maxHeight\n );\n\n this.nativeElement.style.height = height + 'px';\n }\n\n /**\n * Starts mobile bottom sheet resizing.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragStart = (e) => {\n if (!this.sheetResizable || !this.isBottomSheet()) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n\n if (this._sheetDrag) return;\n\n this.startSheetDrag(e.pointerId, e.clientY);\n\n try {\n this.sheetHandleArea?.setPointerCapture(e.pointerId);\n } catch {\n // Synthetic pointer events in tests may not own a pointer capture.\n }\n\n window.addEventListener('pointermove', this.handleSheetDragMove);\n window.addEventListener('pointerup', this.handleSheetDragEnd);\n window.addEventListener('pointercancel', this.handleSheetDragEnd);\n };\n\n /**\n * Starts mobile bottom sheet resizing from a touch event.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchStart = (e) => {\n if (!this.sheetResizable || !this.isBottomSheet() || this._sheetDrag) return;\n\n const touch = e.touches?.[0];\n if (!touch) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n this.startSheetDrag('touch', touch.clientY);\n\n window.addEventListener('touchmove', this.handleSheetTouchMove, { passive: false });\n window.addEventListener('touchend', this.handleSheetTouchEnd, { passive: false });\n window.addEventListener('touchcancel', this.handleSheetTouchEnd, { passive: false });\n };\n\n /**\n * Starts tracking a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerStart = (e) => {\n if (!this.isBottomSheet()\n || e.target !== this.backdropElement\n || this.isEventInsideSheet(e)\n || Date.now() < this._sheetIgnoreDismissUntil) {\n this._sheetBackdropGesture = null;\n return;\n }\n\n this._sheetBackdropGesture = {\n pointerId: e.pointerId,\n startX: e.clientX,\n startY: e.clientY,\n hasMoved: false,\n };\n };\n\n /**\n * Tracks movement during a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerMove = (e) => {\n if (!this._sheetBackdropGesture || e.pointerId !== this._sheetBackdropGesture.pointerId) return;\n\n const distanceX = Math.abs(e.clientX - this._sheetBackdropGesture.startX);\n const distanceY = Math.abs(e.clientY - this._sheetBackdropGesture.startY);\n\n if (distanceX > 8 || distanceY > 8) {\n this._sheetBackdropGesture.hasMoved = true;\n }\n };\n\n /**\n * Finishes a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerEnd = (e) => {\n if (!this._sheetBackdropGesture || e.pointerId !== this._sheetBackdropGesture.pointerId) return;\n\n const shouldClose = !this._sheetBackdropGesture.hasMoved\n && e.target === this.backdropElement\n && !this.isEventInsideSheet(e)\n && Date.now() >= this._sheetIgnoreDismissUntil;\n\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = Date.now() + 350;\n\n if (shouldClose) {\n e.preventDefault();\n e.stopPropagation();\n this.close(e);\n }\n };\n\n /**\n * Cancels a possible backdrop dismiss tap.\n */\n handleBackdropPointerCancel = () => {\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = Date.now() + 350;\n };\n\n /**\n * Resizes the mobile bottom sheet during dragging.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragMove = (e) => {\n if (!this._sheetDrag || e.pointerId !== this._sheetDrag.pointerId) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this.updateSheetDrag(e.clientY);\n };\n\n /**\n * Resizes the mobile bottom sheet during touch dragging.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchMove = (e) => {\n if (!this._sheetDrag || this._sheetDrag.pointerId !== 'touch') return;\n\n const touch = e.touches?.[0];\n if (!touch) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this.updateSheetDrag(touch.clientY);\n };\n\n /**\n * Ends mobile bottom sheet resizing.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragEnd = (e) => {\n const hasMoved = this._sheetDrag?.hasMoved;\n\n if (this._sheetDrag && e?.pointerId === this._sheetDrag.pointerId) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n try {\n this.sheetHandleArea?.releasePointerCapture(e.pointerId);\n } catch {\n // Synthetic pointer events in tests may not own a pointer capture.\n }\n }\n\n if (hasMoved) {\n this._sheetIgnoreDismissUntil = Date.now() + 350;\n } else {\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n }\n\n this.endSheetDrag();\n };\n\n /**\n * Ends mobile bottom sheet resizing from a touch event.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchEnd = (e) => {\n if (!this._sheetDrag || this._sheetDrag.pointerId !== 'touch') return;\n\n const hasMoved = this._sheetDrag.hasMoved;\n\n if (e.type !== 'touchcancel') {\n e.preventDefault();\n }\n e.stopPropagation();\n if (e.type !== 'touchcancel') {\n e.stopImmediatePropagation?.();\n }\n\n this._sheetIgnoreDismissUntil = Date.now() + (hasMoved ? 350 : 700);\n this.endSheetDrag();\n };\n\n /**\n * Cleans up mobile bottom sheet resizing listeners.\n */\n endSheetDrag() {\n window.removeEventListener('pointermove', this.handleSheetDragMove);\n window.removeEventListener('pointerup', this.handleSheetDragEnd);\n window.removeEventListener('pointercancel', this.handleSheetDragEnd);\n window.removeEventListener('touchmove', this.handleSheetTouchMove);\n window.removeEventListener('touchend', this.handleSheetTouchEnd);\n window.removeEventListener('touchcancel', this.handleSheetTouchEnd);\n this._sheetDrag = null;\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 after the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\n // Hook for extending behavior before the dialog closes\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(e) {\n // Hook for extending behavior after the dialog closes\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.isBottomSheet()) {\n return this.doAnimateBottomSheetTransition(options);\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) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Animates the mobile bottom sheet and its backdrop.\n * @param {object} options Web Animation options.\n * @returns {Promise<void>}\n */\n doAnimateBottomSheetTransition(options) {\n const shouldOpen = !this._isOpen;\n const closedBackdrop = {\n opacity: 0,\n };\n const openBackdrop = {\n opacity: 'var(--wje-sliding-container-backdrop-opacity, 1)',\n };\n const closedSheet = {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n transform: 'translateY(100%)',\n };\n const openSheet = {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n transform: 'translateY(0)',\n };\n\n if (this.animation && this.animation?.effect?.target !== this.backdropElement) {\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 (shouldOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.backdropElement.animate([closedBackdrop, openBackdrop], options);\n this.nativeAnimation = this.nativeElement.animate([closedSheet, openSheet], options);\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.backdropElement.animate([openBackdrop, closedBackdrop], options);\n this.nativeAnimation = this.nativeElement.animate([openSheet, closedSheet], options);\n }\n }\n\n return new Promise((resolve) => {\n let isFinished = false;\n const finish = () => {\n if (isFinished) return;\n\n isFinished = true;\n this._isOpen = shouldOpen;\n this.classList.toggle('open', shouldOpen);\n this.setBottomSheetVisualState(shouldOpen);\n resolve();\n };\n\n this.nativeAnimation.onfinish = finish;\n this.nativeAnimation.oncancel = finish;\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 this.lockDocumentScroll();\n\n await this.doAnimateTransition();\n this.syncAria();\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 if (this.isBottomSheet()\n && e instanceof Event\n && (this.isSheetHandleEvent(e) || (e.target === this.backdropElement && Date.now() < this._sheetIgnoreDismissUntil))) {\n return;\n }\n\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().catch(() => {\n if (this.isBottomSheet()) {\n this.setBottomSheetClosedState();\n }\n });\n this.syncAria();\n this.unlockDocumentScroll();\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 * Forces the closed visual state for the mobile bottom sheet.\n */\n setBottomSheetClosedState() {\n this._isOpen = false;\n this.classList.remove('open');\n this.setBottomSheetVisualState(false);\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(e);\n } else {\n await this.open(e);\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.endSheetDrag();\n this.unlockDocumentScroll();\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":";;;;;;AAGA,IAAI,sBAAsB;AAC1B,IAAI,sBAAsB;AAiEX,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAK;AAyWT,qCAAY;AAqmBZ;AAAA;AAAA;AAAA;AAAA,gDAAuB,CAAC,MAAM;;AAC1B,UAAI,CAAC,KAAK,gBAAiB;AAE3B,WAAK,2BAA2B,KAAK,IAAG,IAAK;AAC7C,QAAE,eAAc;AAChB,QAAE,gBAAe;AACjB,cAAE,6BAAF;AAAA,IACJ;AAiCA;AAAA;AAAA;AAAA;AAAA,oDAA2B,CAAC,MAAM;AAC9B,UAAI,CAAC,KAAK,mBAAmB,CAAC,KAAK,UAAU,SAAS,MAAM,EAAG;AAE/D,QAAE,eAAc;AAChB,QAAE,gBAAe;AAAA,IACrB;AAiHA;AAAA;AAAA;AAAA;AAAA,gDAAuB,CAAC,MAAM;;AAC1B,UAAI,CAAC,KAAK,kBAAkB,CAAC,KAAK,cAAa,EAAI;AAEnD,QAAE,eAAc;AAChB,QAAE,gBAAe;AACjB,cAAE,6BAAF;AAEA,WAAK,2BAA2B,KAAK,IAAG,IAAK;AAE7C,UAAI,KAAK,WAAY;AAErB,WAAK,eAAe,EAAE,WAAW,EAAE,OAAO;AAE1C,UAAI;AACA,mBAAK,oBAAL,mBAAsB,kBAAkB,EAAE;AAAA,MAC9C,QAAQ;AAAA,MAER;AAEA,aAAO,iBAAiB,eAAe,KAAK,mBAAmB;AAC/D,aAAO,iBAAiB,aA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ACjB,SAAK,qBAAoB;AACzB,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC3B;AACJ;AC7rDA,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 backdrop - Styles the mobile bottom sheet backdrop.\n * @csspart sliding-container - Styles the native sliding panel.\n * @csspart close-button - Styles the generated close button.\n * @csspart sheet-handle-area - Styles the draggable resize handle hit area.\n * @csspart sheet-handle - Styles the visible draggable resize handle.\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 * @property {string} mobilePresentation - Enables mobile presentation, for example 'bottom-sheet'.\n * @property {string} mobileBreakPoint - The viewport width where mobile presentation becomes active.\n * @property {boolean} backdropDismiss - Closes the mobile bottom sheet when the backdrop is clicked.\n * @property {boolean} sheetResizable - Enables mobile bottom sheet resizing.\n * @property {string} sheetScope - Defines whether the mobile bottom sheet panel is scoped to the container or viewport.\n * @property {string} sheetBoundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet panel.\n * @property {string} sheetHeight - The mobile bottom sheet height after opening.\n * @property {string} sheetMinHeight - The minimum mobile bottom sheet height while resizing.\n * @property {string} sheetMaxHeight - The maximum mobile bottom sheet height while resizing.\n * @attribute {string} mobile-presentation - Enables responsive mobile presentation. Use \"bottom-sheet\".\n * @attribute {string} mobile-break-point - Viewport width where mobile presentation becomes active. Defaults to \"768\".\n * @attribute {boolean} backdrop-dismiss - Closes the mobile bottom sheet when the backdrop is clicked.\n * @attribute {boolean} sheet-resizable - Enables resizing the mobile bottom sheet with a handle.\n * @attribute {string} sheet-scope - Defines whether the sheet panel is scoped to \"viewport\", \"parent\", or a bounded container.\n * @attribute {string} sheet-boundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet panel.\n * @attribute {string} sheet-height - The mobile bottom sheet height after opening.\n * @attribute {string} sheet-min-height - The minimum mobile bottom sheet height while resizing.\n * @attribute {string} sheet-max-height - The maximum mobile bottom sheet height while resizing.\n * @cssproperty [--wje-sliding-container-background=var(--wje-background)] - Background of the sliding panel.\n * @cssproperty [--wje-sliding-container-z-index=1000] - z-index of the side sliding container.\n * @cssproperty [--wje-sliding-container-bottom-sheet-z-index=var(--wje-sliding-container-z-index, 1000)] - z-index of the mobile bottom sheet host.\n * @cssproperty [--wje-sliding-container-bottom-sheet-backdrop-z-index=0] - z-index of the mobile bottom sheet backdrop inside the host layer.\n * @cssproperty [--wje-sliding-container-bottom-sheet-panel-z-index=1] - z-index of the mobile bottom sheet panel inside the host layer.\n * @cssproperty [--wje-sliding-container-portal-backdrop-z-index] - z-index of the body-level mobile bottom sheet backdrop.\n * @cssproperty [--wje-sliding-container-backdrop-background=var(--wje-backdrop)] - Background of the mobile bottom sheet backdrop.\n * @cssproperty [--wje-sliding-container-backdrop-opacity=1] - Backdrop opacity while the mobile bottom sheet is open.\n * @cssproperty [--wje-sliding-container-box-shadow=var(--wje-sliding-container-shadow)] - Shadow of the mobile bottom sheet panel.\n * @cssproperty [--wje-sliding-container-sheet-border-radius=var(--wje-sliding-container-border-radius) var(--wje-sliding-container-border-radius) 0 0] - Border radius of the mobile bottom sheet panel.\n * @cssproperty [--wje-sliding-container-sheet-handle-area-height=24px] - Height of the resize handle hit area.\n * @cssproperty [--wje-sliding-container-sheet-handle-width=36px] - Width of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-height=2px] - Height of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-background=var(--wje-border-color)] - Background of the visible resize handle.\n * @cssproperty [--wje-sliding-container-sheet-handle-radius=999px] - Border radius of the visible resize handle.\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 this._sheetDrag = null;\n this._sheetIgnoreDismissUntil = 0;\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = 0;\n this._bottomSheetScopeFrame = 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.isBottomSheet()) {\n this.checkForVariant(this.variant);\n } else 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 mobile presentation mode.\n * @param {string} value The mobile presentation mode.\n */\n set mobilePresentation(value) {\n this.setAttribute('mobile-presentation', value);\n }\n\n /**\n * Gets mobile presentation mode.\n * @returns {string|null} The mobile presentation mode.\n */\n get mobilePresentation() {\n return this.getAttribute('mobile-presentation');\n }\n\n /**\n * Sets the breakpoint for mobile presentation.\n * @param {string} value The mobile breakpoint.\n */\n set mobileBreakPoint(value) {\n this.setAttribute('mobile-break-point', value);\n }\n\n /**\n * Gets the breakpoint for mobile presentation.\n * @returns {string} The mobile breakpoint.\n */\n get mobileBreakPoint() {\n return this.getAttribute('mobile-break-point') || '768';\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 * Determines if the bottom sheet should close when the backdrop is clicked.\n * @returns {boolean} True if backdrop dismiss is enabled.\n */\n get backdropDismiss() {\n return this.hasAttribute('backdrop-dismiss') ?? false;\n }\n\n /**\n * Enables resizing for the mobile bottom sheet.\n * @returns {boolean} True if the sheet can be resized.\n */\n get sheetResizable() {\n return this.hasAttribute('sheet-resizable') ?? false;\n }\n\n /**\n * Sets resizing for the mobile bottom sheet.\n * @param {boolean|string} value The value to set.\n */\n set sheetResizable(value) {\n this.setAttribute('sheet-resizable', value);\n }\n\n /**\n * Gets the mobile bottom sheet panel scope. The backdrop always covers the viewport.\n * @returns {string} Either 'viewport', 'container', or 'parent'.\n */\n get sheetScope() {\n return this.getAttribute('sheet-scope') || 'viewport';\n }\n\n /**\n * Sets the mobile bottom sheet panel scope.\n * @param {string} value The new boundary mode for the mobile sheet.\n */\n set sheetScope(value) {\n this.setAttribute('sheet-scope', value);\n }\n\n /**\n * Gets the selector used for container-scoped mobile bottom sheet panels.\n * @returns {string|null} A CSS selector used to find the composed boundary ancestor.\n */\n get sheetBoundary() {\n return this.getAttribute('sheet-boundary');\n }\n\n /**\n * Sets the selector used for container-scoped mobile bottom sheet panels.\n * @param {string} value Selector for the boundary element.\n */\n set sheetBoundary(value) {\n this.setAttribute('sheet-boundary', value);\n }\n\n /**\n * Gets the mobile bottom sheet opening height.\n * @returns {string|null} The opening height.\n */\n get sheetHeight() {\n return this.getAttribute('sheet-height');\n }\n\n /**\n * Sets the mobile bottom sheet opening height.\n * @param {string} value The opening height.\n */\n set sheetHeight(value) {\n this.setAttribute('sheet-height', value);\n }\n\n /**\n * Gets the minimum mobile bottom sheet height while resizing.\n * @returns {string|null} The minimum height.\n */\n get sheetMinHeight() {\n return this.getAttribute('sheet-min-height');\n }\n\n /**\n * Sets the minimum mobile bottom sheet height while resizing.\n * @param {string} value The minimum height.\n */\n set sheetMinHeight(value) {\n this.setAttribute('sheet-min-height', value);\n }\n\n /**\n * Gets the maximum mobile bottom sheet height while resizing.\n * @returns {string|null} The maximum height.\n */\n get sheetMaxHeight() {\n return this.getAttribute('sheet-max-height');\n }\n\n /**\n * Sets the maximum mobile bottom sheet height while resizing.\n * @param {string} value The maximum height.\n */\n set sheetMaxHeight(value) {\n this.setAttribute('sheet-max-height', value);\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', 'mobile-presentation', 'mobile-break-point', 'backdrop-dismiss', 'sheet-resizable', 'sheet-scope', 'sheet-boundary', 'sheet-height', 'sheet-min-height', 'sheet-max-height'];\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 this.syncAria();\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n this.endSheetDrag();\n this.removePortalBackdrop();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Cleans up global listeners and portaled layers.\n */\n afterDisconnect() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n this.endSheetDrag();\n this.removePortalBackdrop();\n this._resizeObserver?.disconnect();\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 const isBottomSheet = this.isBottomSheet();\n\n let backdrop = document.createElement('div');\n backdrop.setAttribute('part', 'backdrop');\n backdrop.classList.add('sliding-container-backdrop');\n if (this._isOpen && isBottomSheet) {\n backdrop.style.opacity = 'var(--wje-sliding-container-backdrop-opacity, 1)';\n }\n this.addBackdropListeners(backdrop);\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 && !isBottomSheet) {\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 = isBottomSheet ? '100%' : 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = isBottomSheet ? '100%' : this.maxWidth;\n if (isBottomSheet) {\n native.style.transform = 'translateY(0)';\n }\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n } else if (isBottomSheet) {\n native.style.transform = 'translateY(100%)';\n }\n\n if (isBottomSheet) {\n native.style.left = 0;\n native.style.right = 0;\n native.style.bottom = 0;\n native.style.maxHeight = this.maxHeight;\n } else if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.width = isBottomSheet ? '100%' : this.maxWidth;\n if (isBottomSheet) {\n nativeInner.style.maxHeight = this.maxHeight;\n }\n\n let slot = document.createElement('slot');\n this.sheetHandleArea = null;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n if (this.sheetResizable) {\n native.append(this.htmlSheetHandle());\n }\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(backdrop);\n fragment.append(wrapperDiv);\n\n this.backdropElement = backdrop;\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv;\n this.nativeElement = native;\n this.nativeInner = nativeInner;\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 this.syncAria();\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (!this.isBottomSheet() && this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n /**\n * Returns whether the mobile bottom sheet presentation is active.\n * @returns {boolean}\n */\n isBottomSheet() {\n return this.mobilePresentation === 'bottom-sheet' && window.innerWidth <= +this.mobileBreakPoint;\n }\n\n /**\n * Adds interaction listeners to a backdrop element.\n * @param {HTMLElement} backdrop The backdrop element.\n */\n addBackdropListeners(backdrop) {\n backdrop.addEventListener('wheel', this.preventBottomSheetScroll, { passive: false });\n backdrop.addEventListener('touchmove', this.preventBottomSheetScroll, { passive: false });\n\n if (!this.backdropDismiss) return;\n\n backdrop.addEventListener('pointerdown', this.handleBackdropPointerStart);\n backdrop.addEventListener('pointermove', this.handleBackdropPointerMove);\n backdrop.addEventListener('pointerup', this.handleBackdropPointerEnd);\n backdrop.addEventListener('pointercancel', this.handleBackdropPointerCancel);\n backdrop.addEventListener('click', this.handleBackdropClick);\n }\n\n /**\n * Removes interaction listeners from a backdrop element.\n * @param {HTMLElement} backdrop The backdrop element.\n */\n removeBackdropListeners(backdrop) {\n backdrop.removeEventListener('wheel', this.preventBottomSheetScroll);\n backdrop.removeEventListener('touchmove', this.preventBottomSheetScroll);\n backdrop.removeEventListener('pointerdown', this.handleBackdropPointerStart);\n backdrop.removeEventListener('pointermove', this.handleBackdropPointerMove);\n backdrop.removeEventListener('pointerup', this.handleBackdropPointerEnd);\n backdrop.removeEventListener('pointercancel', this.handleBackdropPointerCancel);\n backdrop.removeEventListener('click', this.handleBackdropClick);\n }\n\n /**\n * Checks whether an element is one of this component's backdrop layers.\n * @param {EventTarget|null} element The event target.\n * @returns {boolean}\n */\n isBackdropElement(element) {\n return element === this.backdropElement || element === this._portalBackdropElement;\n }\n\n /**\n * Gets the backdrop element that is active for the current presentation.\n * @param {object} options Options for resolving the backdrop.\n * @param {boolean} options.createPortal Creates the body-level mobile backdrop when needed.\n * @returns {HTMLElement|null}\n */\n getBackdropElement({ createPortal = false } = {}) {\n if (!this.isBottomSheet()) return this.backdropElement;\n if (createPortal) return this.ensurePortalBackdrop();\n\n return this._portalBackdropElement || this.backdropElement;\n }\n\n /**\n * Creates the body-level backdrop used by mobile bottom sheets.\n * @returns {HTMLElement} Element appended to document.body for page-level dimming.\n */\n ensurePortalBackdrop() {\n if (!this._portalBackdropElement) {\n this._portalBackdropElement = document.createElement('div');\n this._portalBackdropElement.setAttribute('data-wje-sliding-container-backdrop', '');\n this._portalBackdropElement.classList.add('sliding-container-backdrop', 'sliding-container-backdrop-portal');\n this.addBackdropListeners(this._portalBackdropElement);\n document.body.append(this._portalBackdropElement);\n }\n\n this.syncPortalBackdropStyles();\n\n return this._portalBackdropElement;\n }\n\n /**\n * Removes the body-level mobile backdrop.\n */\n removePortalBackdrop() {\n if (!this._portalBackdropElement) return;\n\n this.removeBackdropListeners(this._portalBackdropElement);\n this._portalBackdropElement.remove();\n this._portalBackdropElement = null;\n }\n\n /**\n * Gets the full-page z-index for the body-level mobile backdrop.\n * @returns {string}\n */\n getPortalBackdropZIndex() {\n const hostStyle = getComputedStyle(this);\n const configuredZIndex = hostStyle.getPropertyValue('--wje-sliding-container-portal-backdrop-z-index').trim();\n if (configuredZIndex) return configuredZIndex;\n\n const hostZIndex = Number.parseInt(hostStyle.zIndex, 10);\n if (Number.isFinite(hostZIndex)) return String(hostZIndex - 1);\n\n return '999';\n }\n\n /**\n * Gets the target opacity for the active mobile backdrop.\n * @returns {string}\n */\n getBackdropOpenOpacity() {\n return getComputedStyle(this).getPropertyValue('--wje-sliding-container-backdrop-opacity').trim() || '1';\n }\n\n /**\n * Syncs visual styles from the component to the body-level backdrop.\n */\n syncPortalBackdropStyles() {\n if (!this._portalBackdropElement) return;\n\n const backdropStyle = this.backdropElement ? getComputedStyle(this.backdropElement) : null;\n this._portalBackdropElement.style.position = 'fixed';\n this._portalBackdropElement.style.inset = '0';\n this._portalBackdropElement.style.display = 'block';\n this._portalBackdropElement.style.opacity = this.classList.contains('open')\n ? this.getBackdropOpenOpacity()\n : '0';\n this._portalBackdropElement.style.pointerEvents = this.classList.contains('open') ? 'auto' : 'none';\n this._portalBackdropElement.style.touchAction = 'none';\n this._portalBackdropElement.style.overscrollBehavior = 'none';\n this._portalBackdropElement.style.background = backdropStyle?.background || 'rgba(0, 0, 0, .35)';\n this._portalBackdropElement.style.zIndex = this.getPortalBackdropZIndex();\n }\n\n /**\n * Handles backdrop click dismissal.\n * @param {MouseEvent} e The click event.\n */\n handleBackdropClick = (e) => {\n if (this.isEventInsideSheet(e)\n || Date.now() < this._sheetIgnoreDismissUntil\n || Date.now() < this._sheetBackdropHandledUntil) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n if (this.isBackdropElement(e.target)) {\n this.close(e);\n }\n };\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'region' });\n }\n\n this.setAriaState({ hidden: !this.isOpen });\n\n const ariaLabel = this.getAttribute('aria-label');\n const label = this.getAttribute('label');\n if (!ariaLabel && label) {\n this.setAriaState({ label });\n }\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 * Creates the mobile bottom sheet resize handle.\n * @returns {HTMLElement} The resize handle element.\n */\n htmlSheetHandle() {\n const handleArea = document.createElement('div');\n handleArea.setAttribute('part', 'sheet-handle-area');\n handleArea.setAttribute('role', 'separator');\n handleArea.setAttribute('aria-orientation', 'horizontal');\n handleArea.classList.add('sliding-container-sheet-handle-area');\n\n const handle = document.createElement('div');\n handle.setAttribute('part', 'sheet-handle');\n handle.classList.add('sliding-container-sheet-handle');\n\n handleArea.append(handle);\n handleArea.addEventListener('pointerdown', this.handleSheetDragStart, { capture: true });\n handleArea.addEventListener('touchstart', this.handleSheetTouchStart, { capture: true, passive: false });\n handleArea.addEventListener('click', this.stopSheetHandleEvent, { capture: true });\n handleArea.addEventListener('mousedown', this.stopSheetHandleEvent, { capture: true });\n handleArea.addEventListener('mouseup', this.stopSheetHandleEvent, { capture: true });\n\n this.sheetHandleArea = handleArea;\n\n return handleArea;\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 * Finds the closest element across shadow DOM boundaries.\n * @param {string} selector The selector to match.\n * @returns {Element|null} The matched composed ancestor.\n */\n getClosestComposedElement(selector) {\n let currentElement = this;\n\n while (currentElement) {\n let matches = false;\n\n try {\n matches = currentElement instanceof Element && currentElement.matches(selector);\n } catch {\n return null;\n }\n\n if (matches) {\n return currentElement;\n }\n\n if (currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n continue;\n }\n\n const root = currentElement.getRootNode?.();\n currentElement = root instanceof ShadowRoot ? root.host : null;\n }\n\n return null;\n }\n\n /**\n * Returns the viewport frame.\n * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}}\n */\n getViewportFrame() {\n return {\n top: 0,\n left: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n width: window.innerWidth,\n height: window.innerHeight,\n };\n }\n\n /**\n * Returns the element that bounds the mobile bottom sheet panel.\n * @returns {Element|null} The scope element, or null for viewport scope.\n */\n getBottomSheetScopeElement() {\n if (this.sheetScope === 'viewport') return null;\n if (this.sheetScope === 'parent') return this.getParentElement();\n if (this.sheetBoundary) return this.getClosestComposedElement(this.sheetBoundary);\n\n return this.getParentElement();\n }\n\n /**\n * Returns the frame used by the mobile bottom sheet panel.\n * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}}\n */\n getBottomSheetScopeFrame() {\n const scopeElement = this.getBottomSheetScopeElement();\n if (!scopeElement) return this.getViewportFrame();\n\n const rect = scopeElement.getBoundingClientRect();\n const top = Math.max(rect.top, 0);\n const left = Math.max(rect.left, 0);\n const right = Math.min(rect.right, window.innerWidth);\n const bottom = Math.min(rect.bottom, window.innerHeight);\n const width = right - left;\n const height = bottom - top;\n\n if (width <= 0 || height <= 0) {\n return this.getViewportFrame();\n }\n\n return {\n top,\n left,\n right,\n bottom,\n width,\n height,\n };\n }\n\n /**\n * Applies a fixed frame to a bottom sheet layer.\n * @param {HTMLElement|SlidingContainer} element The element to update.\n * @param {object} frame The frame to apply.\n */\n setBottomSheetLayerFrame(element, frame) {\n element.style.top = frame.top + 'px';\n element.style.left = frame.left + 'px';\n element.style.right = 'auto';\n element.style.bottom = 'auto';\n element.style.width = frame.width + 'px';\n element.style.height = frame.height + 'px';\n }\n\n /**\n * Removes fixed frame styles from a bottom sheet layer.\n * @param {HTMLElement|SlidingContainer} element The element to reset.\n */\n resetBottomSheetLayerFrame(element) {\n element?.style.removeProperty('top');\n element?.style.removeProperty('left');\n element?.style.removeProperty('right');\n element?.style.removeProperty('bottom');\n element?.style.removeProperty('width');\n element?.style.removeProperty('height');\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 (this.isBottomSheet()) {\n this.setBottomSheetVariant();\n return;\n }\n\n this.resetBottomSheetVariant();\n\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 * Applies the mobile bottom sheet layout.\n */\n setBottomSheetVariant() {\n const scopeFrame = this.getBottomSheetScopeFrame();\n const backdropFrame = this.getViewportFrame();\n const backdrop = this.getBackdropElement({\n createPortal: this.classList.contains('open') || this._isOpen,\n });\n this._bottomSheetScopeFrame = scopeFrame;\n\n this.classList.add('bottom-sheet');\n this.style.position = 'fixed';\n this.setBottomSheetLayerFrame(this, scopeFrame);\n this.setBottomSheetLayerFrame(backdrop, backdropFrame);\n this.setBottomSheetLayerFrame(this.wrapperDiv, scopeFrame);\n this.syncPortalBackdropStyles();\n\n this.wrapperDiv.style.height = '100%';\n this.transparentDiv.style.width = 0;\n\n this.nativeElement.style.left = scopeFrame.left + 'px';\n this.nativeElement.style.right = 'auto';\n this.nativeElement.style.bottom = window.innerHeight - scopeFrame.bottom + 'px';\n this.nativeElement.style.top = 'auto';\n this.nativeElement.style.width = scopeFrame.width + 'px';\n if (this._sheetDrag) {\n this.nativeElement.style.maxHeight = this.getSheetMaxHeightInPixels() + 'px';\n } else {\n this.setSheetHeight();\n }\n this.setBottomSheetVisualState(this.classList.contains('open'));\n\n this.nativeInner.style.width = '100%';\n this.nativeInner.style.maxHeight = this.nativeElement.style.maxHeight;\n }\n\n /**\n * Removes layout styles managed by the mobile bottom sheet mode.\n */\n resetBottomSheetVariant() {\n if (!this.classList.contains('bottom-sheet')) return;\n\n this.classList.remove('bottom-sheet');\n this.style.removeProperty('position');\n this.resetBottomSheetLayerFrame(this);\n\n this.resetBottomSheetLayerFrame(this.backdropElement);\n this.removePortalBackdrop();\n this.resetBottomSheetLayerFrame(this.wrapperDiv);\n if (this.transparentDiv) {\n this.transparentDiv.style.width = this._isOpen ? this.maxWidth : 0;\n }\n this.nativeElement?.style.removeProperty('left');\n this.nativeElement?.style.removeProperty('right');\n this.nativeElement?.style.removeProperty('bottom');\n this.nativeElement?.style.removeProperty('top');\n this.nativeElement?.style.removeProperty('height');\n this.nativeElement?.style.removeProperty('max-height');\n this.nativeElement?.style.removeProperty('transform');\n if (this.nativeElement) {\n if (this.direction === 'right') {\n this.nativeElement.style.right = 0;\n } else {\n this.nativeElement.style.left = 0;\n }\n this.nativeElement.style.width = this._isOpen ? this.maxWidth : 0;\n }\n this.nativeInner?.style.removeProperty('max-height');\n if (this.nativeInner) {\n this.nativeInner.style.width = this.maxWidth;\n }\n this.backdropElement?.style.removeProperty('opacity');\n this._bottomSheetScopeFrame = null;\n this.endSheetDrag();\n }\n\n /**\n * Applies the current visual open or closed state to the mobile bottom sheet.\n * @param {boolean} isOpen True when the sheet should be visible.\n */\n setBottomSheetVisualState(isOpen) {\n this.nativeElement.style.transform = isOpen ? 'translateY(0)' : 'translateY(100%)';\n const backdrop = this.getBackdropElement({ createPortal: isOpen || Boolean(this._portalBackdropElement) });\n\n if (this.hasOpacity) {\n this.nativeElement.style.opacity = isOpen ? 1 : 0;\n }\n\n if (backdrop) {\n backdrop.style.opacity = isOpen ? this.getBackdropOpenOpacity() : '0';\n backdrop.style.pointerEvents = isOpen ? 'auto' : 'none';\n }\n\n if (!isOpen) {\n this.removePortalBackdrop();\n }\n }\n\n /**\n * Gets the CSS height limit used for the mobile bottom sheet.\n * @returns {string} The CSS max height.\n */\n getSheetMaxHeight() {\n return this.sheetMaxHeight || this.maxHeight;\n }\n\n /**\n * Applies the configured bottom sheet opening height.\n */\n setSheetHeight() {\n const maxHeightInPixels = this.getSheetMaxHeightInPixels();\n\n this.nativeElement.style.maxHeight = maxHeightInPixels + 'px';\n\n if (!this.sheetHeight) {\n this.nativeElement.style.removeProperty('height');\n return;\n }\n\n const minHeight = Math.min(this.getSheetMinHeightInPixels(), maxHeightInPixels);\n const height = this.resolveCssHeight(this.sheetHeight, maxHeightInPixels);\n const clampedHeight = this.clamp(height, minHeight, maxHeightInPixels);\n\n this.nativeElement.style.height = clampedHeight + 'px';\n }\n\n /**\n * Resolves the sheet minimum height in pixels.\n * @returns {number} The minimum height.\n */\n getSheetMinHeightInPixels() {\n const availableHeight = this.getBottomSheetAvailableHeight();\n\n return Math.min(\n this.resolveCssHeight(this.sheetMinHeight || '30vh', availableHeight * 0.3),\n availableHeight\n );\n }\n\n /**\n * Resolves the sheet maximum height in pixels.\n * @returns {number} The maximum height.\n */\n getSheetMaxHeightInPixels() {\n const availableHeight = this.getBottomSheetAvailableHeight();\n\n return Math.min(\n this.resolveCssHeight(this.getSheetMaxHeight(), availableHeight * 0.9),\n availableHeight\n );\n }\n\n /**\n * Returns available height for the bottom sheet scope.\n * @returns {number} Pixel height that can be used inside the current sheet frame.\n */\n getBottomSheetAvailableHeight() {\n return this._bottomSheetScopeFrame?.height || this.getBottomSheetScopeFrame().height || window.innerHeight;\n }\n\n /**\n * Resolves a CSS height value against the viewport.\n * @param {string} value The configured sheet height.\n * @param {number} fallback The fallback height in pixels.\n * @returns {number} The resolved height.\n */\n resolveCssHeight(value, fallback) {\n if (!value || value === 'auto') return fallback;\n\n const normalizedValue = `${value}`.trim();\n const parsedValue = Number.parseFloat(normalizedValue);\n\n if (Number.isNaN(parsedValue)) return fallback;\n if (normalizedValue.endsWith('px')) return parsedValue;\n if (normalizedValue.endsWith('vh')) return window.innerHeight * parsedValue / 100;\n if (normalizedValue.endsWith('vw')) return window.innerWidth * parsedValue / 100;\n if (normalizedValue.endsWith('%')) return window.innerHeight * parsedValue / 100;\n if (/^-?\\d+(\\.\\d+)?$/.test(normalizedValue)) return parsedValue;\n\n return fallback;\n }\n\n /**\n * Clamps a number between min and max.\n * @param {number} value The measured height.\n * @param {number} min The minimum.\n * @param {number} max The maximum.\n * @returns {number} The clamped value.\n */\n clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n }\n\n /**\n * Stops a handle interaction from dismissing the bottom sheet.\n * @param {Event} e The interaction emitted by the resize handle.\n */\n stopSheetHandleEvent = (e) => {\n if (!this.isBottomSheet()) return;\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n };\n\n /**\n * Checks whether an event came from the resize handle.\n * @param {Event} e The event to check.\n * @returns {boolean} True when the event belongs to the resize handle.\n */\n isSheetHandleEvent(e) {\n if (!e?.composedPath) return false;\n\n return e.composedPath().includes(this.sheetHandleArea);\n }\n\n /**\n * Checks whether an event happened inside the visible bottom sheet.\n * @param {Event} e The event to check.\n * @returns {boolean} True when the event coordinates are inside the sheet.\n */\n isEventInsideSheet(e) {\n if (!this.nativeElement || typeof e?.clientX !== 'number' || typeof e?.clientY !== 'number') return false;\n\n const rect = this.nativeElement.getBoundingClientRect();\n\n return e.clientX >= rect.left\n && e.clientX <= rect.right\n && e.clientY >= rect.top\n && e.clientY <= rect.bottom;\n }\n\n /**\n * Prevents scroll events from reaching the page behind the bottom sheet.\n * @param {Event} e The scroll event.\n */\n preventBottomSheetScroll = (e) => {\n if (!this.isBottomSheet() || !this.classList.contains('open')) return;\n\n e.preventDefault();\n e.stopPropagation();\n };\n\n /**\n * Stores the initial drag state for the mobile bottom sheet.\n * @param {number|string} pointerId The pointer identifier.\n * @param {number} startY The starting Y coordinate.\n */\n startSheetDrag(pointerId, startY) {\n if (this.classList.contains('open')) {\n this.setBottomSheetVisualState(true);\n }\n\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n this.animation = null;\n this.nativeAnimation = null;\n\n const fallbackHeight = this.resolveCssHeight(this.sheetHeight, window.innerHeight * 0.5);\n const currentHeight = this.nativeElement.getBoundingClientRect().height || fallbackHeight;\n\n this._sheetDrag = {\n pointerId,\n startY,\n startHeight: currentHeight,\n minHeight: this.getSheetMinHeightInPixels(),\n maxHeight: this.getSheetMaxHeightInPixels(),\n hasMoved: false,\n };\n }\n\n /**\n * Applies a new height while the bottom sheet is being dragged.\n * @param {number} clientY The current Y coordinate.\n */\n updateSheetDrag(clientY) {\n const distance = this._sheetDrag.startY - clientY;\n if (Math.abs(distance) > 3) {\n this._sheetDrag.hasMoved = true;\n }\n\n const height = this.clamp(\n this._sheetDrag.startHeight + distance,\n this._sheetDrag.minHeight,\n this._sheetDrag.maxHeight\n );\n\n this.nativeElement.style.height = height + 'px';\n }\n\n /**\n * Starts mobile bottom sheet resizing.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragStart = (e) => {\n if (!this.sheetResizable || !this.isBottomSheet()) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n\n if (this._sheetDrag) return;\n\n this.startSheetDrag(e.pointerId, e.clientY);\n\n try {\n this.sheetHandleArea?.setPointerCapture(e.pointerId);\n } catch {\n // Synthetic pointer events in tests may not own a pointer capture.\n }\n\n window.addEventListener('pointermove', this.handleSheetDragMove);\n window.addEventListener('pointerup', this.handleSheetDragEnd);\n window.addEventListener('pointercancel', this.handleSheetDragEnd);\n };\n\n /**\n * Starts mobile bottom sheet resizing from a touch event.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchStart = (e) => {\n if (!this.sheetResizable || !this.isBottomSheet() || this._sheetDrag) return;\n\n const touch = e.touches?.[0];\n if (!touch) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n this.startSheetDrag('touch', touch.clientY);\n\n window.addEventListener('touchmove', this.handleSheetTouchMove, { passive: false });\n window.addEventListener('touchend', this.handleSheetTouchEnd, { passive: false });\n window.addEventListener('touchcancel', this.handleSheetTouchEnd, { passive: false });\n };\n\n /**\n * Starts tracking a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerStart = (e) => {\n if (!this.isBottomSheet()\n || !this.isBackdropElement(e.target)\n || this.isEventInsideSheet(e)\n || Date.now() < this._sheetIgnoreDismissUntil) {\n this._sheetBackdropGesture = null;\n return;\n }\n\n this._sheetBackdropGesture = {\n pointerId: e.pointerId,\n startX: e.clientX,\n startY: e.clientY,\n hasMoved: false,\n };\n };\n\n /**\n * Tracks movement during a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerMove = (e) => {\n if (!this._sheetBackdropGesture || e.pointerId !== this._sheetBackdropGesture.pointerId) return;\n\n const distanceX = Math.abs(e.clientX - this._sheetBackdropGesture.startX);\n const distanceY = Math.abs(e.clientY - this._sheetBackdropGesture.startY);\n\n if (distanceX > 8 || distanceY > 8) {\n this._sheetBackdropGesture.hasMoved = true;\n }\n };\n\n /**\n * Finishes a possible backdrop dismiss tap.\n * @param {PointerEvent} e The pointer event.\n */\n handleBackdropPointerEnd = (e) => {\n if (!this._sheetBackdropGesture || e.pointerId !== this._sheetBackdropGesture.pointerId) return;\n\n const shouldClose = !this._sheetBackdropGesture.hasMoved\n && this.isBackdropElement(e.target)\n && !this.isEventInsideSheet(e)\n && Date.now() >= this._sheetIgnoreDismissUntil;\n\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = Date.now() + 350;\n\n if (shouldClose) {\n e.preventDefault();\n e.stopPropagation();\n this.close(e);\n }\n };\n\n /**\n * Cancels a possible backdrop dismiss tap.\n */\n handleBackdropPointerCancel = () => {\n this._sheetBackdropGesture = null;\n this._sheetBackdropHandledUntil = Date.now() + 350;\n };\n\n /**\n * Resizes the mobile bottom sheet during dragging.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragMove = (e) => {\n if (!this._sheetDrag || e.pointerId !== this._sheetDrag.pointerId) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this.updateSheetDrag(e.clientY);\n };\n\n /**\n * Resizes the mobile bottom sheet during touch dragging.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchMove = (e) => {\n if (!this._sheetDrag || this._sheetDrag.pointerId !== 'touch') return;\n\n const touch = e.touches?.[0];\n if (!touch) return;\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n this.updateSheetDrag(touch.clientY);\n };\n\n /**\n * Ends mobile bottom sheet resizing.\n * @param {PointerEvent} e The pointer event.\n */\n handleSheetDragEnd = (e) => {\n const hasMoved = this._sheetDrag?.hasMoved;\n\n if (this._sheetDrag && e?.pointerId === this._sheetDrag.pointerId) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation?.();\n\n try {\n this.sheetHandleArea?.releasePointerCapture(e.pointerId);\n } catch {\n // Synthetic pointer events in tests may not own a pointer capture.\n }\n }\n\n if (hasMoved) {\n this._sheetIgnoreDismissUntil = Date.now() + 350;\n } else {\n this._sheetIgnoreDismissUntil = Date.now() + 500;\n }\n\n this.endSheetDrag();\n };\n\n /**\n * Ends mobile bottom sheet resizing from a touch event.\n * @param {TouchEvent} e The touch event.\n */\n handleSheetTouchEnd = (e) => {\n if (!this._sheetDrag || this._sheetDrag.pointerId !== 'touch') return;\n\n const hasMoved = this._sheetDrag.hasMoved;\n\n if (e.type !== 'touchcancel') {\n e.preventDefault();\n }\n e.stopPropagation();\n if (e.type !== 'touchcancel') {\n e.stopImmediatePropagation?.();\n }\n\n this._sheetIgnoreDismissUntil = Date.now() + (hasMoved ? 350 : 700);\n this.endSheetDrag();\n };\n\n /**\n * Cleans up mobile bottom sheet resizing listeners.\n */\n endSheetDrag() {\n window.removeEventListener('pointermove', this.handleSheetDragMove);\n window.removeEventListener('pointerup', this.handleSheetDragEnd);\n window.removeEventListener('pointercancel', this.handleSheetDragEnd);\n window.removeEventListener('touchmove', this.handleSheetTouchMove);\n window.removeEventListener('touchend', this.handleSheetTouchEnd);\n window.removeEventListener('touchcancel', this.handleSheetTouchEnd);\n this._sheetDrag = null;\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 after the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\n // Hook for extending behavior before the dialog closes\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(e) {\n // Hook for extending behavior after the dialog closes\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.isBottomSheet()) {\n return this.doAnimateBottomSheetTransition(options);\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) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Animates the mobile bottom sheet and its backdrop.\n * @param {object} options Web Animation options.\n * @returns {Promise<void>}\n */\n doAnimateBottomSheetTransition(options) {\n const shouldOpen = !this._isOpen;\n const backdropElement = this.getBackdropElement({ createPortal: true });\n const closedBackdrop = {\n opacity: 0,\n };\n const openBackdrop = {\n opacity: this.getBackdropOpenOpacity(),\n };\n const closedSheet = {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n transform: 'translateY(100%)',\n };\n const openSheet = {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n transform: 'translateY(0)',\n };\n\n if (this.animation && this.animation?.effect?.target !== backdropElement) {\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 (shouldOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = backdropElement.animate([closedBackdrop, openBackdrop], options);\n this.nativeAnimation = this.nativeElement.animate([closedSheet, openSheet], options);\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = backdropElement.animate([openBackdrop, closedBackdrop], options);\n this.nativeAnimation = this.nativeElement.animate([openSheet, closedSheet], options);\n }\n }\n\n return new Promise((resolve) => {\n let isFinished = false;\n const finish = () => {\n if (isFinished) return;\n\n isFinished = true;\n this._isOpen = shouldOpen;\n this.classList.toggle('open', shouldOpen);\n this.setBottomSheetVisualState(shouldOpen);\n resolve();\n };\n\n this.nativeAnimation.onfinish = finish;\n this.nativeAnimation.oncancel = finish;\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 this.syncAria();\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 if (this.isBottomSheet()\n && e instanceof Event\n && (this.isSheetHandleEvent(e) || (this.isBackdropElement(e.target) && Date.now() < this._sheetIgnoreDismissUntil))) {\n return;\n }\n\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().catch(() => {\n if (this.isBottomSheet()) {\n this.setBottomSheetClosedState();\n }\n });\n this.syncAria();\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 * Forces the closed visual state for the mobile bottom sheet.\n */\n setBottomSheetClosedState() {\n this._isOpen = false;\n this.classList.remove('open');\n this.setBottomSheetVisualState(false);\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(e);\n } else {\n await this.open(e);\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.endSheetDrag();\n this.removePortalBackdrop();\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":";;;;;;AAuEe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAK;AAwWT,qCAAY;AA6SZ;AAAA;AAAA;AAAA;AAAA,+CAAsB,CAAC,MAAM;AACzB,UAAI,KAAK,mBAAmB,CAAC,KACtB,KAAK,IAAG,IAAK,KAAK,4BAClB,KAAK,IAAG,IAAK,KAAK,4BAA4B;AACjD,UAAE,eAAc;AAChB,UAAE,gBAAe;AACjB;AAAA,MACJ;AAEA,UAAI,KAAK,kBAAkB,EAAE,MAAM,GAAG;AACl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AAAA,UAClC;AAAA,QACJ,CAAC;AACD,aAAK,SAAQ;AAEb,cAAM,QAAQ,QAAQ,KAAK,WAAW,CAAC,CAAC,EAAE,KAAK,MAAM;AACjD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAM;AAAA,YAChB,CAAC;AAAA,UACL;AAEA,gBAAM,oBAAoB,MAAM,kCAAkC;AAAA,QACtE,CAAC;AAAA,MACL;AAAA,IACJ,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKA,4BAA4B;AACxB,SAAK,UAAU;AACf,SAAK,UAAU,OAAO,MAAM;AAC5B,SAAK,0BAA0B,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,OAAO,GAAG;AACZ,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,CAAC;AAAA,IACtB,OAAO;AACH,YAAM,KAAK,KAAK,CAAC;AAAA,IACrB;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAmB;;AACf,SAAK,aAAY;AACjB,SAAK,qBAAoB;AACzB,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC3B;AACJ;ACxxDA,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.7.0",
4
+ "version": "0.7.1",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  ],
32
32
  "scripts": {
33
33
  "dev": "vite --mode development",
34
- "build": "vite build --mode production",
34
+ "build": "vite build --mode production && npm run analyze",
35
35
  "preview": "vite preview --mode production",
36
36
  "watch": "vite build --watch --mode development",
37
37
  "analyze": "cem analyze",