wj-elements 0.4.2 → 0.4.4

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.
Files changed (41) hide show
  1. package/dist/base-path.js.map +1 -1
  2. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +2 -2
  3. package/dist/packages/wje-avatar/service/service.d.ts +0 -1
  4. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +1 -2
  5. package/dist/packages/wje-button/button.element.d.ts +4 -0
  6. package/dist/packages/wje-carousel/carousel.element.d.ts +6 -6
  7. package/dist/packages/wje-copy-button/copy-button.element.d.ts +5 -3
  8. package/dist/packages/wje-element/element.d.ts +1 -1
  9. package/dist/packages/wje-input/input.element.d.ts +1 -0
  10. package/dist/{popup.element-DklicGea.js → popup.element-C8-g3WLs.js} +3 -3
  11. package/dist/{popup.element-DklicGea.js.map → popup.element-C8-g3WLs.js.map} +1 -1
  12. package/dist/wje-accordion-item.js.map +1 -1
  13. package/dist/wje-avatar.js.map +1 -1
  14. package/dist/wje-breadcrumb.js +0 -1
  15. package/dist/wje-breadcrumb.js.map +1 -1
  16. package/dist/wje-button.js +19 -19
  17. package/dist/wje-button.js.map +1 -1
  18. package/dist/wje-carousel.js +6 -6
  19. package/dist/wje-carousel.js.map +1 -1
  20. package/dist/wje-copy-button.js +21 -12
  21. package/dist/wje-copy-button.js.map +1 -1
  22. package/dist/wje-dropdown.js +1 -1
  23. package/dist/wje-element.js +1 -1
  24. package/dist/wje-element.js.map +1 -1
  25. package/dist/wje-file-upload.js +0 -1
  26. package/dist/wje-file-upload.js.map +1 -1
  27. package/dist/wje-input.js +50 -6
  28. package/dist/wje-input.js.map +1 -1
  29. package/dist/wje-master.js +1 -1
  30. package/dist/wje-options.js +15 -2
  31. package/dist/wje-options.js.map +1 -1
  32. package/dist/wje-popup.js +1 -1
  33. package/dist/wje-select.js +14 -3
  34. package/dist/wje-select.js.map +1 -1
  35. package/dist/wje-tab-group.js +9 -2
  36. package/dist/wje-tab-group.js.map +1 -1
  37. package/dist/wje-tab.js.map +1 -1
  38. package/dist/wje-tooltip.js +1 -1
  39. package/package.json +5 -4
  40. package/dist/custom-elements.json +0 -21140
  41. package/dist/web-types.json +0 -3842
@@ -1 +1 @@
1
- {"version":3,"file":"wje-carousel.js","sources":["../packages/wje-carousel/carousel.element.js","../packages/wje-carousel/carousel.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Carousel class that extends WJElement.\n * @documentation https://elements.webjet.sk/components/carousel\n * @status stable\n * @augments WJElement\n * @slot - The carousel main content.\n * @cssproperty [--wje-carousel-size=100%] - Effective size of one carousel item.\n * @cssproperty [--wje-carousel-gap=0.5rem] - Gap between carousel items.\n */\nexport default class Carousel extends WJElement {\n /**\n * Carousel constructor method.\n */\n constructor() {\n super();\n\n this.slidePerPage = 1;\n }\n\n /**\n * Active slide attribute.\n * @param value\n */\n set activeSlide(value) {\n this.setAttribute('active-slide', value);\n }\n\n /**\n * Active slide attribute.\n * @returns {number|number}\n */\n get activeSlide() {\n return +this.getAttribute('active-slide') || 0;\n }\n\n /**\n * Pagination attribute.\n * @returns {boolean}\n */\n get pagination() {\n return this.hasAttribute('pagination');\n }\n\n /**\n * Navigation attribute.\n * @returns {boolean}\n */\n get navigation() {\n return this.hasAttribute('navigation');\n }\n\n /**\n * Thumbnails attribute.\n * @returns {boolean}\n */\n get thumbnails() {\n return this.hasAttribute('thumbnails');\n }\n\n /**\n * Loop attribute.\n * @returns {boolean}\n */\n get loop() {\n return this.hasAttribute('loop');\n }\n\n /**\n * Continuous loop attribute.\n * @returns {boolean}\n */\n get continuousLoop() {\n return this.hasAttribute('continuous-loop');\n }\n\n /**\n * Class name for the Carousel.\n * @type {string}\n */\n className = 'Carousel';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active-slide', 'slide-per-page', 'continuous-loop'];\n }\n\n /**\n * Sets up the attributes for the Carousel.\n * @param name\n * @param old\n * @param newName\n */\n attributeChangedCallback(name, old, newName) {\n if (name === 'active-slide') {\n if (this.pagination) this.changePagination();\n\n if (this.thumbnails) this.changeThumbnails();\n }\n\n if (['slide-per-page', 'continuous-loop'].includes(name) && old !== newName && this.slides) {\n this.syncSlideMetrics();\n\n if (this.loop) {\n this.refresh();\n return;\n }\n\n this.goToSlide(this.activeSlide, 'auto');\n }\n }\n\n /**\n * Sets up the attributes for the Carousel.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Before draw method for the Carousel.\n */\n beforeDraw() {\n this.syncSlideMetrics();\n this.removeLoopClones();\n this.cloneFirstAndLastItems();\n }\n\n /**\n * Draw method for the Carousel.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-carousel');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('slides-wrapper');\n\n let slides = document.createElement('div');\n slides.classList.add('carousel-slides');\n\n let slot = document.createElement('slot');\n\n let slotPrev = document.createElement('slot');\n slotPrev.setAttribute('name', 'prev');\n\n let slotNext = document.createElement('slot');\n slotNext.setAttribute('name', 'next');\n\n slides.append(slot);\n native.append(wrapper);\n\n if (this.navigation) {\n let existingPrev = this.querySelector('[slot=\"prev\"]');\n let existingNext = this.querySelector('[slot=\"next\"]');\n\n this.prevButton = existingPrev || this.createPreviousButton();\n this.nextButton = existingNext || this.createNextButton();\n\n if (this.prevButton && !this.prevButton.dataset.wjeCarouselNavBound) {\n this.prevButton.addEventListener('click', () => this.previousSlide());\n this.prevButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (this.nextButton && !this.nextButton.dataset.wjeCarouselNavBound) {\n this.nextButton.addEventListener('click', () => this.nextSlide());\n this.nextButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (!existingPrev) this.append(this.prevButton);\n if (!existingNext) this.append(this.nextButton);\n\n wrapper.append(slotPrev);\n wrapper.append(slotNext);\n }\n\n wrapper.append(slides);\n\n if (this.pagination) native.append(this.createPagination());\n\n if (this.thumbnails) native.append(this.createThumbnails());\n\n fragment.append(native);\n\n this.slides = slides;\n\n return fragment;\n }\n\n /**\n * After draw method for the Carousel.\n */\n afterDraw() {\n this.setIntersectionObserver();\n this.getSlidesWithClones().forEach((slide, i) => {\n this.intersectionObserver.observe(slide);\n });\n\n this.syncSlideMetrics();\n\n this.goToSlide(this.activeSlide, 'auto');\n\n requestAnimationFrame(() => requestAnimationFrame(() => this.syncActiveToSnapStart()));\n\n this.slides.addEventListener('scrollend', (e) => {\n this.syncActiveToSnapStart();\n });\n\n this.syncAria();\n }\n\n /**\n * Sync `activeSlide` to the slide whose leading edge is closest to the snap start.\n */\n syncActiveToSnapStart() {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!withClones.length) return;\n\n const containerRect = this.slides.getBoundingClientRect();\n const snapStartX = containerRect.left + this.getScrollPaddingInlineStart();\n\n let best = null;\n let bestDist = Infinity;\n withClones.forEach((el) => {\n const r = el.getBoundingClientRect();\n const dist = Math.abs(r.left - snapStartX);\n if (dist < bestDist) {\n bestDist = dist;\n best = el;\n }\n });\n\n if (!best) return;\n\n const vIndex = withClones.indexOf(best);\n if (vIndex === -1) return;\n\n const logicalIndex = this.getLogicalIndexForVisual(vIndex);\n this.activeSlide = logicalIndex;\n this.setActiveVisualSlide(vIndex);\n\n const canonicalVisualIndex = this.getVisualIndexForLogical(logicalIndex);\n if (canonicalVisualIndex !== vIndex) {\n this.goToSlide(logicalIndex, 'auto');\n }\n }\n\n /**\n * Syncs computed CSS variables derived from `slide-per-page`.\n */\n syncSlideMetrics() {\n this.slidePerPage = Math.max(parseInt(this.getAttribute('slide-per-page'), 10) || 1, 1);\n const visibleGapCount = Math.max(this.slidePerPage - 1, 0);\n const computedItemSize = `calc((100% - (${visibleGapCount} * var(--wje-carousel-gap, 0.5rem))) / ${this.slidePerPage})`;\n\n this.style.setProperty('--wje-carousel-slides-per-page', `${this.slidePerPage}`);\n this.style.setProperty('--wje-carousel-visible-gap-count', `${visibleGapCount}`);\n this.style.setProperty('--wje-carousel-size', computedItemSize);\n this.style.setProperty('--wje-carousel-item-basis', 'var(--wje-carousel-size)');\n }\n\n /**\n * Returns the inline scroll padding used by the snap area.\n * @returns {number}\n */\n getScrollPaddingInlineStart() {\n if (!this.slides) return 0;\n\n const styles = getComputedStyle(this.slides);\n return parseFloat(styles.scrollPaddingInlineStart || styles.scrollPaddingLeft || '0') || 0;\n }\n\n /**\n * Returns the interaction scroll behavior for UI controls.\n * Continuous multi-slide loops use instant snapping to avoid blank edge states\n * while the browser is still animating a previous smooth scroll.\n * @returns {ScrollBehavior|string}\n */\n getControlBehavior() {\n return this.continuousLoop && this.slidePerPage > 1 ? 'auto' : 'smooth';\n }\n\n /**\n * Sets up the IntersectionObserver for the Carousel.\n */\n setIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n },\n {\n root: this.context.querySelector('.carousel-slides'),\n threshold: 0.5,\n }\n );\n\n this.entriesMap = new Map();\n this.records = this.intersectionObserver.takeRecords();\n this.records.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n }\n\n /**\n * Goes to the slide.\n * @param index\n * @param behavior\n * @param next\n */\n goToSlide(index, behavior = 'smooth', next = true) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n\n // compute logical index: wrap when loop=true, else clamp\n const maxIndex = this.getMaxVisibleStartIndex(slides.length);\n let logical;\n if (this.loop && slides.length > 0) {\n logical = this.normalizeLoopIndex(index, slides.length);\n } else {\n logical = Math.min(Math.max(index, 0), maxIndex);\n }\n this.activeSlide = logical;\n\n // compute visual target considering clones when loop=true\n const vIndex = this.getVisualIndexForLogical(logical);\n const targetEl = withClones[vIndex];\n if (!targetEl) return;\n\n this.setActiveVisualSlide(vIndex);\n this.scrollToVisualIndex(vIndex, behavior);\n\n if (this.navigation && !this.loop) {\n this.nextButton.removeAttribute('disabled');\n this.prevButton.removeAttribute('disabled');\n\n if (this.activeSlide === maxIndex) this.nextButton.setAttribute('disabled', '');\n if (this.activeSlide === 0) this.prevButton.setAttribute('disabled', '');\n }\n\n this.syncAria();\n }\n\n /**\n * Sets the active class on the currently targeted visual slide and removes it elsewhere.\n * @param {number} vIndex\n */\n setActiveVisualSlide(vIndex) {\n this.getSlidesWithClones().forEach((slide, index) => {\n slide.classList.toggle('active', index === vIndex);\n });\n }\n\n /**\n * Syncs ARIA attributes on the carousel and slides.\n */\n syncAria() {\n this.setAriaState({\n role: 'region',\n roledescription: 'carousel',\n });\n\n const slides = this.getSlides();\n const total = slides.length;\n slides.forEach((slide, index) => {\n slide.setAttribute('role', 'group');\n slide.setAttribute('aria-roledescription', 'slide');\n slide.setAttribute('aria-label', `Slide ${index + 1} of ${total}`);\n slide.setAttribute('aria-hidden', slide.classList.contains('active') ? 'false' : 'true');\n });\n\n const clones = this.querySelectorAll('.clone');\n clones.forEach((slide) => {\n slide.setAttribute('aria-hidden', 'true');\n });\n }\n\n /**\n * Clones the first and last items.\n */\n cloneFirstAndLastItems() {\n const items = this.getSlides();\n\n if (items.length && this.loop) {\n const cloneCount = this.getLoopCloneCount(items.length);\n const firstOriginal = items[0];\n\n items.slice(items.length - cloneCount).forEach((item) => {\n const clone = this.createLoopClone(item);\n this.insertBefore(clone, firstOriginal);\n });\n\n items.slice(0, cloneCount).forEach((item) => {\n const clone = this.createLoopClone(item);\n this.append(clone);\n });\n }\n }\n\n /**\n * Creates a sanitized loop clone that does not inherit transient render state\n * such as inline `visibility: hidden` from the source slide.\n * @param {HTMLElement} item\n * @returns {HTMLElement}\n */\n createLoopClone(item) {\n const clone = item.cloneNode(true);\n clone.classList.add('clone');\n clone.classList.remove('active');\n clone.style.removeProperty('visibility');\n\n if (!clone.getAttribute('style')?.trim()) {\n clone.removeAttribute('style');\n }\n\n return clone;\n }\n\n /**\n * Removes loop clones so they can be rebuilt for the current configuration.\n */\n removeLoopClones() {\n this.querySelectorAll('wje-carousel-item.clone').forEach((clone) => clone.remove());\n }\n\n /**\n * Returns how many slides should be cloned on each side when loop is enabled.\n * @param {number} totalSlides\n * @returns {number}\n */\n getLoopCloneCount(totalSlides = this.getSlides().length) {\n if (!this.loop || !totalSlides) return 0;\n\n return this.continuousLoop ? Math.min(this.slidePerPage, totalSlides) : 1;\n }\n\n /**\n * Scrolls the carousel to a visual slide index.\n * @param {number} vIndex\n * @param {ScrollBehavior|string} behavior\n */\n scrollToVisualIndex(vIndex, behavior = 'smooth') {\n const withClones = this.getSlidesWithClones();\n const firstEl = withClones[0];\n const targetEl = withClones[vIndex];\n\n if (!firstEl || !targetEl || !this.slides) return;\n\n const firstRect = firstEl.getBoundingClientRect();\n const targetRect = targetEl.getBoundingClientRect();\n const contentOffsetLeft = targetRect.left - firstRect.left;\n const nextLeft = contentOffsetLeft - this.getScrollPaddingInlineStart();\n const targetLeft = Math.max(nextLeft, 0);\n\n if (behavior === 'smooth') {\n this.slides.scrollTo({\n left: targetLeft,\n top: this.slides.scrollTop,\n behavior: 'smooth',\n });\n return;\n }\n\n if (this.snapRestoreFrame) {\n cancelAnimationFrame(this.snapRestoreFrame);\n }\n\n const inlineSnapType = this.slides.style.scrollSnapType;\n this.slides.style.scrollSnapType = 'none';\n this.slides.scrollTo({\n left: targetLeft,\n top: this.slides.scrollTop,\n behavior: 'auto',\n });\n this.snapRestoreFrame = requestAnimationFrame(() => {\n this.slides.style.scrollSnapType = inlineSnapType;\n this.snapRestoreFrame = null;\n });\n }\n\n /**\n * Goes to the next slide.\n */\n removeActiveSlide() {\n this.getSlidesWithClones().forEach((slide, i) => {\n slide.classList.remove('active');\n });\n\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item) => {\n item.classList.remove('active');\n });\n }\n\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item) => {\n item.classList.remove('active');\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changePagination() {\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item, i) => {\n item.classList.toggle('active', i === this.activeSlide);\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changeThumbnails() {\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item, i) => {\n item.classList.toggle('active', i === this.activeSlide);\n });\n }\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createNextButton() {\n const nextButton = document.createElement('wje-button');\n nextButton.setAttribute('part', 'next-button');\n nextButton.setAttribute('circle', '');\n nextButton.setAttribute('fill', 'link');\n nextButton.setAttribute('slot', 'next');\n nextButton.innerHTML = '<wje-icon name=\"chevron-right\" size=\"large\"></wje-icon>';\n nextButton.classList.add('next');\n\n return nextButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPreviousButton() {\n const previousButton = document.createElement('wje-button');\n previousButton.setAttribute('part', 'previous-button');\n previousButton.setAttribute('circle', '');\n previousButton.setAttribute('fill', 'link');\n previousButton.setAttribute('slot', 'prev');\n previousButton.innerHTML = '<wje-icon name=\"chevron-left\" size=\"large\"></wje-icon>';\n previousButton.classList.add('prev');\n\n return previousButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPagination() {\n const pagination = document.createElement('div');\n pagination.setAttribute('part', 'pagination');\n pagination.classList.add('pagination');\n\n this.getPaginationIndexes().forEach((i) => {\n const paginationItem = document.createElement('div');\n paginationItem.classList.add('pagination-item');\n paginationItem.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.classList.add('active');\n this.goToSlide(i, this.getControlBehavior());\n });\n pagination.append(paginationItem);\n });\n\n return pagination;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createThumbnails() {\n const thumbnails = document.createElement('div');\n thumbnails.classList.add('thumbnails');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const thumbnail = document.createElement('wje-thumbnail');\n thumbnail.innerHTML = `<img src=\"${slide.querySelector('wje-img').getAttribute('src')}\"></img>`;\n thumbnail.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.closest('wje-thumbnail').classList.add('active');\n this.goToSlide(i, this.getControlBehavior());\n });\n thumbnails.append(thumbnail);\n });\n\n return thumbnails;\n }\n\n /**\n * Goes to the next slide.\n */\n nextSlide() {\n this.goToSlide(this.activeSlide + 1, this.getControlBehavior());\n }\n\n /**\n * Goes to the previous slide.\n */\n previousSlide() {\n this.goToSlide(this.activeSlide - 1, this.getControlBehavior());\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlides() {\n return Array.from(this.querySelectorAll('wje-carousel-item:not(.clone)'));\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlidesWithClones() {\n return Array.from(this.querySelectorAll('wje-carousel-item'));\n }\n\n /** Maps logical index -> visual index (accounts for leading clone when loop=true) */\n getVisualIndexForLogical(index) {\n return this.loop ? index + this.getLoopCloneCount() : index;\n }\n\n /** Maps visual index -> logical index (handles clones at 0 and last when loop=true) */\n getLogicalIndexForVisual(vIndex) {\n const slides = this.getSlides();\n const maxIndex = this.getMaxVisibleStartIndex(slides.length);\n const cloneCount = this.getLoopCloneCount(slides.length);\n if (!this.loop) return Math.min(Math.max(vIndex, 0), maxIndex);\n if (this.continuousLoop) {\n if (vIndex < cloneCount) return slides.length - cloneCount + vIndex;\n if (vIndex >= cloneCount + slides.length) return vIndex - (cloneCount + slides.length);\n return vIndex - cloneCount;\n }\n\n if (vIndex < cloneCount) return maxIndex;\n if (vIndex >= cloneCount + slides.length) return 0;\n return Math.min(Math.max(vIndex - cloneCount, 0), maxIndex);\n }\n\n /**\n * Returns the maximum logical slide index that can still render a full viewport.\n * @param {number} totalSlides\n * @returns {number}\n */\n getMaxVisibleStartIndex(totalSlides = this.getSlides().length) {\n const visibleSlides = Math.min(this.slidePerPage, totalSlides);\n return Math.max(totalSlides - visibleSlides, 0);\n }\n\n /**\n * Normalizes a logical index for the active loop mode.\n * @param {number} index\n * @param {number} totalSlides\n * @returns {number}\n */\n normalizeLoopIndex(index, totalSlides = this.getSlides().length) {\n const logicalCount = this.getLoopLogicalCount(totalSlides);\n if (!logicalCount) return 0;\n\n return ((index % logicalCount) + logicalCount) % logicalCount;\n }\n\n /**\n * Returns how many logical positions are reachable for the current loop mode.\n * @param {number} totalSlides\n * @returns {number}\n */\n getLoopLogicalCount(totalSlides = this.getSlides().length) {\n if (!totalSlides) return 0;\n\n return this.continuousLoop ? totalSlides : this.getMaxVisibleStartIndex(totalSlides) + 1;\n }\n\n /**\n * Returns the pagination indexes for the current carousel mode.\n * @returns {number[]}\n */\n getPaginationIndexes() {\n return Array.from({ length: this.getLoopLogicalCount() }, (_, index) => index);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoNext() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft < (el.scrollWidth - el.clientWidth);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoPrevious() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft > 0;\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Carousel from './carousel.element.js';\n\n// export * from \"./carousel.element.js\";\nexport default Carousel;\n\nWJElement.define('wje-carousel', Carousel);\n"],"names":["styles"],"mappings":";;;;;AAYe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAK;AAiET;AAAA;AAAA;AAAA;AAAA,qCAAY;AA/DR,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,YAAY,OAAO;AACnB,SAAK,aAAa,gBAAgB,KAAK;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,cAAc;AACd,WAAO,CAAC,KAAK,aAAa,cA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,eAAe,CAAC;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,mBAAmB,OAAO,cAAc,KAAK,UAAS,EAAG,QAAQ;AAC7D,UAAM,eAAe,KAAK,oBAAoB,WAAW;AACzD,QAAI,CAAC,aAAc,QAAO;AAE1B,YAAS,QAAQ,eAAgB,gBAAgB;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,oBAAoB,cAAc,KAAK,UAAS,EAAG,QAAQ;AACvD,QAAI,CAAC,YAAa,QAAO;AAEzB,WAAO,KAAK,iBAAiB,cAAc,KAAK,wBAAwB,WAAW,IAAI;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,uBAAuB;AACnB,WAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,oBAAmB,EAAE,GAAI,CAAC,GAAG,UAAU,KAAK;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAY;AACR,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAc,GAAG,cAAc,GAAG;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAgB;AACZ,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAa;AAAA,EAC3B;AACJ;ACrtBA,UAAU,OAAO,gBAAgB,QAAQ;"}
1
+ {"version":3,"file":"wje-carousel.js","sources":["../packages/wje-carousel/carousel.element.js","../packages/wje-carousel/carousel.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Carousel class that extends WJElement.\n * @documentation https://elements.webjet.sk/components/carousel\n * @status stable\n * @augments WJElement\n * @slot - The carousel main content.\n * @cssproperty [--wje-carousel-size=100%] - Effective size of one carousel item.\n * @cssproperty [--wje-carousel-gap=0.5rem] - Gap between carousel items.\n */\nexport default class Carousel extends WJElement {\n /**\n * Carousel constructor method.\n */\n constructor() {\n super();\n\n this.slidePerPage = 1;\n }\n\n /**\n * Active slide attribute.\n * @param value\n */\n set activeSlide(value) {\n this.setAttribute('active-slide', value);\n }\n\n /**\n * Active slide attribute.\n * @returns {number|number}\n */\n get activeSlide() {\n return +this.getAttribute('active-slide') || 0;\n }\n\n /**\n * Pagination attribute.\n * @returns {boolean}\n */\n get pagination() {\n return this.hasAttribute('pagination');\n }\n\n /**\n * Navigation attribute.\n * @returns {boolean}\n */\n get navigation() {\n return this.hasAttribute('navigation');\n }\n\n /**\n * Thumbnails attribute.\n * @returns {boolean}\n */\n get thumbnails() {\n return this.hasAttribute('thumbnails');\n }\n\n /**\n * Loop attribute.\n * @returns {boolean}\n */\n get loop() {\n return this.hasAttribute('loop');\n }\n\n /**\n * Continuous loop attribute.\n * @returns {boolean}\n */\n get continuousLoop() {\n return this.hasAttribute('continuous-loop');\n }\n\n /**\n * Class name for the Carousel.\n * @type {string}\n */\n className = 'Carousel';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active-slide', 'slide-per-page', 'continuous-loop'];\n }\n\n /**\n * Sets up the attributes for the Carousel.\n * @param name\n * @param old\n * @param newName\n */\n attributeChangedCallback(name, old, newName) {\n if (name === 'active-slide') {\n if (this.pagination) this.changePagination();\n\n if (this.thumbnails) this.changeThumbnails();\n }\n\n if (['slide-per-page', 'continuous-loop'].includes(name) && old !== newName && this.slides) {\n this.syncSlideMetrics();\n\n if (this.loop) {\n this.refresh();\n return;\n }\n\n this.goToSlide(this.activeSlide, 'auto');\n }\n }\n\n /**\n * Sets up the attributes for the Carousel.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Before draw method for the Carousel.\n */\n beforeDraw() {\n this.syncSlideMetrics();\n this.removeLoopClones();\n this.cloneFirstAndLastItems();\n }\n\n /**\n * Draw method for the Carousel.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-carousel');\n\n let wrapper = document.createElement('div');\n wrapper.classList.add('slides-wrapper');\n\n let slides = document.createElement('div');\n slides.classList.add('carousel-slides');\n\n let slot = document.createElement('slot');\n\n let slotPrev = document.createElement('slot');\n slotPrev.setAttribute('name', 'prev');\n\n let slotNext = document.createElement('slot');\n slotNext.setAttribute('name', 'next');\n\n slides.append(slot);\n native.append(wrapper);\n\n if (this.navigation) {\n let existingPrev = this.querySelector('[slot=\"prev\"]');\n let existingNext = this.querySelector('[slot=\"next\"]');\n\n this.prevButton = existingPrev || this.createPreviousButton();\n this.nextButton = existingNext || this.createNextButton();\n\n if (this.prevButton && !this.prevButton.dataset.wjeCarouselNavBound) {\n this.prevButton.addEventListener('click', () => this.previousSlide());\n this.prevButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (this.nextButton && !this.nextButton.dataset.wjeCarouselNavBound) {\n this.nextButton.addEventListener('click', () => this.nextSlide());\n this.nextButton.dataset.wjeCarouselNavBound = 'true';\n }\n\n if (!existingPrev) this.append(this.prevButton);\n if (!existingNext) this.append(this.nextButton);\n\n wrapper.append(slotPrev);\n wrapper.append(slotNext);\n }\n\n wrapper.append(slides);\n\n if (this.pagination) native.append(this.createPagination());\n\n if (this.thumbnails) native.append(this.createThumbnails());\n\n fragment.append(native);\n\n this.slides = slides;\n\n return fragment;\n }\n\n /**\n * After draw method for the Carousel.\n */\n afterDraw() {\n this.setIntersectionObserver();\n this.getSlidesWithClones().forEach((slide, i) => {\n this.intersectionObserver.observe(slide);\n });\n\n this.syncSlideMetrics();\n\n this.goToSlide(this.activeSlide, 'auto');\n\n requestAnimationFrame(() => requestAnimationFrame(() => this.syncActiveToSnapStart()));\n\n this.slides.addEventListener('scrollend', (e) => {\n this.syncActiveToSnapStart();\n });\n\n this.syncAria();\n }\n\n /**\n * Sync `activeSlide` to the slide whose leading edge is closest to the snap start.\n */\n syncActiveToSnapStart() {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n if (!withClones.length) return;\n\n const containerRect = this.slides.getBoundingClientRect();\n const snapStartX = containerRect.left + this.getScrollPaddingInlineStart();\n\n let best = null;\n let bestDist = Infinity;\n withClones.forEach((el) => {\n const r = el.getBoundingClientRect();\n const dist = Math.abs(r.left - snapStartX);\n if (dist < bestDist) {\n bestDist = dist;\n best = el;\n }\n });\n\n if (!best) return;\n\n const vIndex = withClones.indexOf(best);\n if (vIndex === -1) return;\n\n const logicalIndex = this.getLogicalIndexForVisual(vIndex);\n this.activeSlide = logicalIndex;\n this.setActiveVisualSlide(vIndex);\n\n const canonicalVisualIndex = this.getVisualIndexForLogical(logicalIndex);\n if (canonicalVisualIndex !== vIndex) {\n this.goToSlide(logicalIndex, 'auto');\n }\n }\n\n /**\n * Syncs computed CSS variables derived from `slide-per-page`.\n */\n syncSlideMetrics() {\n this.slidePerPage = Math.max(parseInt(this.getAttribute('slide-per-page'), 10) || 1, 1);\n const visibleGapCount = Math.max(this.slidePerPage - 1, 0);\n const computedItemSize = `calc((100% - (${visibleGapCount} * var(--wje-carousel-gap, 0.5rem))) / ${this.slidePerPage})`;\n\n this.style.setProperty('--wje-carousel-slides-per-page', `${this.slidePerPage}`);\n this.style.setProperty('--wje-carousel-visible-gap-count', `${visibleGapCount}`);\n this.style.setProperty('--wje-carousel-size', computedItemSize);\n this.style.setProperty('--wje-carousel-item-basis', 'var(--wje-carousel-size)');\n }\n\n /**\n * Returns the inline scroll padding used by the snap area.\n * @returns {number}\n */\n getScrollPaddingInlineStart() {\n if (!this.slides) return 0;\n\n const slideStyles = getComputedStyle(this.slides);\n return parseFloat(slideStyles.scrollPaddingInlineStart || slideStyles.scrollPaddingLeft || '0') || 0;\n }\n\n /**\n * Returns the interaction scroll behavior for UI controls.\n * Continuous multi-slide loops use instant snapping to avoid blank edge states\n * while the browser is still animating a previous smooth scroll.\n * @returns {string}\n */\n getControlBehavior() {\n return this.continuousLoop && this.slidePerPage > 1 ? 'auto' : 'smooth';\n }\n\n /**\n * Sets up the IntersectionObserver for the Carousel.\n */\n setIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n },\n {\n root: this.context.querySelector('.carousel-slides'),\n threshold: 0.5,\n }\n );\n\n this.entriesMap = new Map();\n this.records = this.intersectionObserver.takeRecords();\n this.records.forEach((entry) => {\n this.entriesMap.set(entry.target, entry);\n });\n }\n\n /**\n * Goes to the slide.\n * @param index\n * @param behavior\n * @param next\n */\n goToSlide(index, behavior = 'smooth', next = true) {\n const slides = this.getSlides();\n const withClones = this.getSlidesWithClones();\n\n // compute logical index: wrap when loop=true, else clamp\n const maxIndex = this.getMaxVisibleStartIndex(slides.length);\n let logical;\n if (this.loop && slides.length > 0) {\n logical = this.normalizeLoopIndex(index, slides.length);\n } else {\n logical = Math.min(Math.max(index, 0), maxIndex);\n }\n this.activeSlide = logical;\n\n // compute visual target considering clones when loop=true\n const vIndex = this.getVisualIndexForLogical(logical);\n const targetEl = withClones[vIndex];\n if (!targetEl) return;\n\n this.setActiveVisualSlide(vIndex);\n this.scrollToVisualIndex(vIndex, behavior);\n\n if (this.navigation && !this.loop) {\n this.nextButton.removeAttribute('disabled');\n this.prevButton.removeAttribute('disabled');\n\n if (this.activeSlide === maxIndex) this.nextButton.setAttribute('disabled', '');\n if (this.activeSlide === 0) this.prevButton.setAttribute('disabled', '');\n }\n\n this.syncAria();\n }\n\n /**\n * Sets the active class on the currently targeted visual slide and removes it elsewhere.\n * @param {number} vIndex\n */\n setActiveVisualSlide(vIndex) {\n this.getSlidesWithClones().forEach((slide, index) => {\n slide.classList.toggle('active', index === vIndex);\n });\n }\n\n /**\n * Syncs ARIA attributes on the carousel and slides.\n */\n syncAria() {\n this.setAriaState({\n role: 'region',\n roledescription: 'carousel',\n });\n\n const slides = this.getSlides();\n const total = slides.length;\n slides.forEach((slide, index) => {\n slide.setAttribute('role', 'group');\n slide.setAttribute('aria-roledescription', 'slide');\n slide.setAttribute('aria-label', `Slide ${index + 1} of ${total}`);\n slide.setAttribute('aria-hidden', slide.classList.contains('active') ? 'false' : 'true');\n });\n\n const clones = this.querySelectorAll('.clone');\n clones.forEach((slide) => {\n slide.setAttribute('aria-hidden', 'true');\n });\n }\n\n /**\n * Clones the first and last items.\n */\n cloneFirstAndLastItems() {\n const items = this.getSlides();\n\n if (items.length && this.loop) {\n const cloneCount = this.getLoopCloneCount(items.length);\n const firstOriginal = items[0];\n\n items.slice(items.length - cloneCount).forEach((item) => {\n const clone = this.createLoopClone(item);\n this.insertBefore(clone, firstOriginal);\n });\n\n items.slice(0, cloneCount).forEach((item) => {\n const clone = this.createLoopClone(item);\n this.append(clone);\n });\n }\n }\n\n /**\n * Creates a sanitized loop clone that does not inherit transient render state\n * such as inline `visibility: hidden` from the source slide.\n * @param {HTMLElement} item\n * @returns {HTMLElement}\n */\n createLoopClone(item) {\n const clone = item.cloneNode(true);\n clone.classList.add('clone');\n clone.classList.remove('active');\n clone.style.removeProperty('visibility');\n\n if (!clone.getAttribute('style')?.trim()) {\n clone.removeAttribute('style');\n }\n\n return clone;\n }\n\n /**\n * Removes loop clones so they can be rebuilt for the current configuration.\n */\n removeLoopClones() {\n this.querySelectorAll('wje-carousel-item.clone').forEach((clone) => clone.remove());\n }\n\n /**\n * Returns how many slides should be cloned on each side when loop is enabled.\n * @param {number} totalSlides\n * @returns {number}\n */\n getLoopCloneCount(totalSlides = this.getSlides().length) {\n if (!this.loop || !totalSlides) return 0;\n\n return this.continuousLoop ? Math.min(this.slidePerPage, totalSlides) : 1;\n }\n\n /**\n * Scrolls the carousel to a visual slide index.\n * @param {number} vIndex\n * @param {string} behavior\n */\n scrollToVisualIndex(vIndex, behavior = 'smooth') {\n const withClones = this.getSlidesWithClones();\n const firstEl = withClones[0];\n const targetEl = withClones[vIndex];\n\n if (!firstEl || !targetEl || !this.slides) return;\n\n const firstRect = firstEl.getBoundingClientRect();\n const targetRect = targetEl.getBoundingClientRect();\n const contentOffsetLeft = targetRect.left - firstRect.left;\n const nextLeft = contentOffsetLeft - this.getScrollPaddingInlineStart();\n const targetLeft = Math.max(nextLeft, 0);\n\n if (behavior === 'smooth') {\n this.slides.scrollTo({\n left: targetLeft,\n top: this.slides.scrollTop,\n behavior: 'smooth',\n });\n return;\n }\n\n if (this.snapRestoreFrame) {\n cancelAnimationFrame(this.snapRestoreFrame);\n }\n\n const inlineSnapType = this.slides.style.scrollSnapType;\n this.slides.style.scrollSnapType = 'none';\n this.slides.scrollTo({\n left: targetLeft,\n top: this.slides.scrollTop,\n behavior: 'auto',\n });\n this.snapRestoreFrame = requestAnimationFrame(() => {\n this.slides.style.scrollSnapType = inlineSnapType;\n this.snapRestoreFrame = null;\n });\n }\n\n /**\n * Goes to the next slide.\n */\n removeActiveSlide() {\n this.getSlidesWithClones().forEach((slide, i) => {\n slide.classList.remove('active');\n });\n\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item) => {\n item.classList.remove('active');\n });\n }\n\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item) => {\n item.classList.remove('active');\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changePagination() {\n if (this.pagination) {\n this.context.querySelectorAll('.pagination-item').forEach((item, i) => {\n item.classList.toggle('active', i === this.activeSlide);\n });\n }\n }\n\n /**\n * Goes to the next slide.\n */\n changeThumbnails() {\n if (this.thumbnails) {\n this.context.querySelectorAll('wje-thumbnail').forEach((item, i) => {\n item.classList.toggle('active', i === this.activeSlide);\n });\n }\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createNextButton() {\n const nextButton = document.createElement('wje-button');\n nextButton.setAttribute('part', 'next-button');\n nextButton.setAttribute('circle', '');\n nextButton.setAttribute('fill', 'link');\n nextButton.setAttribute('slot', 'next');\n nextButton.innerHTML = '<wje-icon name=\"chevron-right\" size=\"large\"></wje-icon>';\n nextButton.classList.add('next');\n\n return nextButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPreviousButton() {\n const previousButton = document.createElement('wje-button');\n previousButton.setAttribute('part', 'previous-button');\n previousButton.setAttribute('circle', '');\n previousButton.setAttribute('fill', 'link');\n previousButton.setAttribute('slot', 'prev');\n previousButton.innerHTML = '<wje-icon name=\"chevron-left\" size=\"large\"></wje-icon>';\n previousButton.classList.add('prev');\n\n return previousButton;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createPagination() {\n const pagination = document.createElement('div');\n pagination.setAttribute('part', 'pagination');\n pagination.classList.add('pagination');\n\n this.getPaginationIndexes().forEach((i) => {\n const paginationItem = document.createElement('div');\n paginationItem.classList.add('pagination-item');\n paginationItem.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.classList.add('active');\n this.goToSlide(i, this.getControlBehavior());\n });\n pagination.append(paginationItem);\n });\n\n return pagination;\n }\n\n /**\n * Goes to the next slide.\n * @returns {Element}\n */\n createThumbnails() {\n const thumbnails = document.createElement('div');\n thumbnails.classList.add('thumbnails');\n\n const slides = this.getSlides();\n slides.forEach((slide, i) => {\n const thumbnail = document.createElement('wje-thumbnail');\n thumbnail.innerHTML = `<img src=\"${slide.querySelector('wje-img').getAttribute('src')}\"></img>`;\n thumbnail.addEventListener('click', (e) => {\n this.removeActiveSlide();\n e.target.closest('wje-thumbnail').classList.add('active');\n this.goToSlide(i, this.getControlBehavior());\n });\n thumbnails.append(thumbnail);\n });\n\n return thumbnails;\n }\n\n /**\n * Goes to the next slide.\n */\n nextSlide() {\n this.goToSlide(this.activeSlide + 1, this.getControlBehavior());\n }\n\n /**\n * Goes to the previous slide.\n */\n previousSlide() {\n this.goToSlide(this.activeSlide - 1, this.getControlBehavior());\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlides() {\n return Array.from(this.querySelectorAll('wje-carousel-item:not(.clone)'));\n }\n\n /**\n * Goes to the slide.\n * @returns {Array}\n */\n getSlidesWithClones() {\n return Array.from(this.querySelectorAll('wje-carousel-item'));\n }\n\n /** Maps logical index to visual index, including leading clones when loop is enabled. */\n getVisualIndexForLogical(index) {\n return this.loop ? index + this.getLoopCloneCount() : index;\n }\n\n /** Maps visual index to logical index, including edge clones when loop is enabled. */\n getLogicalIndexForVisual(vIndex) {\n const slides = this.getSlides();\n const maxIndex = this.getMaxVisibleStartIndex(slides.length);\n const cloneCount = this.getLoopCloneCount(slides.length);\n if (!this.loop) return Math.min(Math.max(vIndex, 0), maxIndex);\n if (this.continuousLoop) {\n if (vIndex < cloneCount) return slides.length - cloneCount + vIndex;\n if (vIndex >= cloneCount + slides.length) return vIndex - (cloneCount + slides.length);\n return vIndex - cloneCount;\n }\n\n if (vIndex < cloneCount) return maxIndex;\n if (vIndex >= cloneCount + slides.length) return 0;\n return Math.min(Math.max(vIndex - cloneCount, 0), maxIndex);\n }\n\n /**\n * Returns the maximum logical slide index that can still render a full viewport.\n * @param {number} totalSlides\n * @returns {number}\n */\n getMaxVisibleStartIndex(totalSlides = this.getSlides().length) {\n const visibleSlides = Math.min(this.slidePerPage, totalSlides);\n return Math.max(totalSlides - visibleSlides, 0);\n }\n\n /**\n * Normalizes a logical index for the active loop mode.\n * @param {number} index\n * @param {number} totalSlides\n * @returns {number}\n */\n normalizeLoopIndex(index, totalSlides = this.getSlides().length) {\n const logicalCount = this.getLoopLogicalCount(totalSlides);\n if (!logicalCount) return 0;\n\n return ((index % logicalCount) + logicalCount) % logicalCount;\n }\n\n /**\n * Returns how many logical positions are reachable for the current loop mode.\n * @param {number} totalSlides\n * @returns {number}\n */\n getLoopLogicalCount(totalSlides = this.getSlides().length) {\n if (!totalSlides) return 0;\n\n return this.continuousLoop ? totalSlides : this.getMaxVisibleStartIndex(totalSlides) + 1;\n }\n\n /**\n * Returns the pagination indexes for the current carousel mode.\n * @returns {number[]}\n */\n getPaginationIndexes() {\n return Array.from({ length: this.getLoopLogicalCount() }, (_, index) => index);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoNext() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft < (el.scrollWidth - el.clientWidth);\n }\n\n /**\n * Goes to the slide.\n * @returns {boolean}\n */\n canGoPrevious() {\n const el = this.context.querySelector('.carousel-slides');\n return el.scrollLeft > 0;\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport Carousel from './carousel.element.js';\n\n// export * from \"./carousel.element.js\";\nexport default Carousel;\n\nWJElement.define('wje-carousel', Carousel);\n"],"names":[],"mappings":";;;;;AAYe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAK;AAiET;AAAA;AAAA;AAAA;AAAA,qCAAY;AA/DR,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,YAAY,OAAO;AACnB,SAAK,aAAa,gBAAgB,KAAK;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,cAAc;AACd,WAAO,CAAC,KAAK,aAAa,cAAc,KAAK;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,aAAa;AACb,WAAO,KAAK,aAAa,YAAY;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,iBAAiB;AACjB,WAAO,KAAK,aAAa,iBAAiB;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,WAAW,gBAAgB;AACvB,WAAO;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UAAU,KAAK;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAY;AACR,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAc,GAAG,cAAc,GAAG;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAgB;AACZ,UAAM,KAAK,KAAK,QAAQ,cAAc,kBAAkB;AACxD,WAAO,GAAG,aAAa;AAAA,EAC3B;AACJ;ACrtBA,UAAU,OAAO,gBAAgB,QAAQ;"}
@@ -91,20 +91,23 @@ class CopyButton extends WJElement {
91
91
  /**
92
92
  * Handles the copied event.
93
93
  * You can override this method to customize the behavior when the text is copied.
94
- * @param {Event} e The event object.
95
94
  */
96
- __publicField(this, "copied", (e) => {
95
+ __publicField(this, "copied", () => {
97
96
  if (this.hasOwnProperty("icon")) {
98
97
  this.icon.setAttribute("color", "success");
99
98
  this.icon.setAttribute("name", "check");
100
99
  }
101
- this.tooltip.setAttribute("content", this.labelSuccess || "Copied");
100
+ if (this._tooltipElement) {
101
+ this._tooltipElement.setAttribute("content", this.labelSuccess || "Copied");
102
+ }
102
103
  setTimeout(() => {
103
104
  if (this.hasOwnProperty("icon")) {
104
105
  this.icon.removeAttribute("color");
105
106
  this.icon.setAttribute("name", "clipboard");
106
107
  }
107
- this.tooltip.setAttribute("content", this.label || "Copy");
108
+ if (this._tooltipElement) {
109
+ this._tooltipElement.setAttribute("content", this.getAttribute("tooltip") || this.label || "Copy");
110
+ }
108
111
  }, this.timeout);
109
112
  });
110
113
  this.timeout = 1e3;
@@ -150,20 +153,26 @@ class CopyButton extends WJElement {
150
153
  */
151
154
  draw() {
152
155
  let fragment = document.createDocumentFragment();
153
- let tooltip = document.createElement("wje-tooltip");
154
- tooltip.setAttribute("offset", "5");
155
- tooltip.setAttribute("content", this.label || "Copy");
156
+ let content;
157
+ this._tooltipElement = null;
156
158
  if (WjElementUtils.hasSlot(this)) {
157
- let slot = document.createElement("slot");
158
- tooltip.appendChild(slot);
159
+ content = document.createElement("slot");
159
160
  } else {
160
161
  let icon = document.createElement("wje-icon");
161
162
  icon.setAttribute("name", "clipboard");
162
- tooltip.appendChild(icon);
163
+ content = icon;
163
164
  this.icon = icon;
164
165
  }
165
- fragment.appendChild(tooltip);
166
- this.tooltip = tooltip;
166
+ if (this.hasAttribute("tooltip")) {
167
+ let tooltip = document.createElement("wje-tooltip");
168
+ tooltip.setAttribute("offset", "5");
169
+ tooltip.setAttribute("content", this.getAttribute("tooltip") || this.label || "Copy");
170
+ tooltip.appendChild(content);
171
+ fragment.appendChild(tooltip);
172
+ this._tooltipElement = tooltip;
173
+ } else {
174
+ fragment.appendChild(content);
175
+ }
167
176
  return fragment;
168
177
  }
169
178
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wje-copy-button.js","sources":["../packages/wje-copy-button/service/service.js","../packages/wje-copy-button/copy-button.element.js","../packages/wje-copy-button/copy-button.js"],"sourcesContent":["/**\n * Create a node with the text content.\n * @param text\n * @returns {Element}\n */\nfunction createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\n\n/**\n * Copy the node to the clipboard.\n * @param node\n * @returns {Promise<never>|Promise<void>}\n */\nexport function copyNode(node) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(node.textContent || '');\n }\n\n const selection = getSelection(); // Firefox return null\n if (selection === null) {\n return Promise.reject(new Error());\n }\n\n selection.removeAllRanges();\n\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n\n // document.execCommand(\"copy\")\n selection.removeAllRanges();\n return Promise.resolve();\n}\n\n/**\n * Copy the text to the clipboard.\n * @param text\n * @returns {Promise<never>|Promise<void>}\n */\nexport function copyText(text) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(text);\n }\n\n const body = document.body;\n if (!body) {\n return Promise.reject(new Error());\n }\n\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n","import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport Input from '../wje-input/input.js';\nimport { copyNode, copyText } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary CopyButton is a custom web component that extends WJElement.\n * It provides a button that, when clicked, copies a specified text to the clipboard.\n * The text to be copied can be specified through the `value` attribute.\n * The CopyButton also supports keyboard interaction, copying the text when the space or enter key is pressed.\n * @documentation https://elements.webjet.sk/components/copy-button\n * @status stable\n * @augments WJElement\n * @attribute {string} for - The id of the element to copy content from.\n * @attribute {string} value - The text to be copied.\n * @slot - This is a default/unnamed slot.\n * @csspart button - Styles the button element.\n * @cssproperty --text-color - Controls the color of the text.\n * @cssproperty --background-color - Controls the background color of the button.\n * //@fires wje:copy-button - Dispatched when the button is clicked and the text is copied.\n * @tag wje-copy-button\n */\nexport default class CopyButton extends WJElement {\n /**\n * Constructor for the CopyButton class.\n * Initializes the timeout property.\n */\n constructor() {\n super();\n\n this.timeout = 1000;\n }\n\n /**\n * Setter for the value property.\n * @param {string} value The value to be set.\n */\n set value(value) {\n this.setAttribute('value', value);\n }\n\n /**\n * Getter for the value property.\n * @returns {string} The value of the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n className = 'CopyButton';\n\n /**\n * Getter for the cssStyleSheet property.\n * @returns {string} The CSS styles.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes property.\n * @returns {Array} An empty array.\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the CopyButton.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the ColorPicker element.\n * @returns {DocumentFragment} The created document fragment.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('offset', '5');\n tooltip.setAttribute('content', this.label || 'Copy');\n\n if (WjElementUtils.hasSlot(this)) {\n let slot = document.createElement('slot');\n tooltip.appendChild(slot);\n } else {\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'clipboard');\n\n tooltip.appendChild(icon);\n this.icon = icon;\n }\n\n fragment.appendChild(tooltip);\n\n this.tooltip = tooltip;\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the click, focus, and blur events.\n */\n afterDraw() {\n this.syncAria();\n event.addListener(this, 'click', null, this.clicked);\n event.addListener(this, 'focus', null, this.focused);\n event.addListener(this, 'blur', null, this.blurred);\n\n event.addListener(this, 'wje-copy-button:click', null, this.copied);\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'button' });\n }\n\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n const ariaLabel = this.getAttribute('aria-label');\n const label = this.getAttribute('label') || this.label || 'Copy';\n if (!ariaLabel && label) {\n this.setAriaState({ label });\n }\n\n if (this.hasAttribute('disabled')) {\n this.setAriaState({ disabled: true });\n }\n }\n\n /**\n * Handles the click event.\n * @param {Event} e The event object.\n */\n clicked = (e) => {\n const button = e.currentTarget;\n if (button instanceof HTMLElement) {\n this.copy(button);\n }\n };\n\n /**\n * Handles the keydown event.\n * @param {Event} e The event object.\n */\n keydown = (e) => {\n if (e.key === ' ' || e.key === 'Enter') {\n const button = e.currentTarget;\n if (button instanceof HTMLElement) {\n this.copy(button);\n }\n }\n };\n\n /**\n * Handles the focus event.\n * @param {Event} e The event object.\n */\n focused = (e) => {\n e.currentTarget.addEventListener('keydown', this.keydown);\n };\n\n /**\n * Handles the blur event.\n * @param {Event} e The event object.\n */\n blurred = (e) => {\n e.currentTarget.removeEventListener('keydown', this.keydown);\n };\n\n /**\n * Handles the copied event.\n * You can override this method to customize the behavior when the text is copied.\n * @param {Event} e The event object.\n */\n copied = (e) => {\n if (this.hasOwnProperty('icon')) {\n this.icon.setAttribute('color', 'success');\n this.icon.setAttribute('name', 'check');\n }\n this.tooltip.setAttribute('content', this.labelSuccess || 'Copied');\n\n setTimeout(() => {\n if (this.hasOwnProperty('icon')) {\n this.icon.removeAttribute('color');\n this.icon.setAttribute('name', 'clipboard');\n }\n this.tooltip.setAttribute('content', this.label || 'Copy');\n }, this.timeout);\n };\n\n /**\n * Copies the specified text or node.\n * @param {HTMLElement} button The button element.\n */\n async copy(button) {\n const id = this.getAttribute('for');\n const text = this.getAttribute('value');\n\n if (button.getAttribute('aria-disabled') === 'true') {\n return;\n }\n\n if (text) {\n await copyText(text);\n event.dispatchCustomEvent(this, 'wje-copy-button:click');\n } else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot))) return;\n\n const node = root.getElementById(id);\n if (node) {\n await this.copyTarget(node);\n event.dispatchCustomEvent(this, 'wje-copy-button:click');\n }\n }\n }\n\n /**\n * Copies the target content.\n * @param {HTMLElement} content The content to be copied.\n * @returns {Promise} A promise that resolves when the content is copied.\n */\n copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement || content instanceof Input) {\n return copyText(content.value);\n } else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n } else {\n return copyNode(content);\n }\n }\n}\n","import CopyButton from './copy-button.element.js';\n\nexport default CopyButton;\n\nCopyButton.define('wje-copy-button', CopyButton);\n"],"names":[],"mappings":";;;;;;;AAKA,SAAS,WAAW,MAAM;AACtB,QAAM,OAAO,SAAS,cAAc,KAAK;AACzC,OAAK,MAAM,QAAQ;AACnB,OAAK,MAAM,SAAS;AACpB,OAAK,MAAM,WAAW;AACtB,OAAK,MAAM,MAAM;AACjB,OAAK,cAAc;AACnB,SAAO;AACX;AAOO,SAAS,SAAS,MAAM;AAC3B,MAAI,eAAe,WAAW;AAC1B,WAAO,UAAU,UAAU,UAAU,KAAK,eAAe,EAAE;AAAA,EAC/D;A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AI;AACX,YAAM,OAAO,iBAAiB,QAAQ,YAAY,OAAO,YAAW,IAAK,OAAO;AAChF,UAAI,EAAE,gBAAgB,YAAa,gBAAgB,UAAU,gBAAgB,YAAc;AAE3F,YAAM,OAAO,KAAK,eAAe,EAAE;AACnC,UAAI,MAAM;AACN,cAAM,KAAK,WAAW,IAAI;AAC1B,cAAM,oBAAoB,MAAM,uBAAuB;AAAA,MAC3D;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAW,SAAS;AAChB,QAAI,mBAAmB,oBAAoB,mBAAmB,uBAAuB,mBAAmB,OAAO;AAC3G,aAAO,SAAS,QAAQ,KAAK;AAAA,IACjC,WAAW,mBAAmB,qBAAqB,QAAQ,aAAa,MAAM,GAAG;AAC7E,aAAO,SAAS,QAAQ,IAAI;AAAA,IAChC,OAAO;AACH,aAAO,SAAS,OAAO;AAAA,IAC3B;AAAA,EACJ;AACJ;AC7OA,WAAW,OAAO,mBAAmB,UAAU;"}
1
+ {"version":3,"file":"wje-copy-button.js","sources":["../packages/wje-copy-button/service/service.js","../packages/wje-copy-button/copy-button.element.js","../packages/wje-copy-button/copy-button.js"],"sourcesContent":["/**\n * Create a node with the text content.\n * @param text\n * @returns {Element}\n */\nfunction createNode(text) {\n const node = document.createElement('pre');\n node.style.width = '1px';\n node.style.height = '1px';\n node.style.position = 'fixed';\n node.style.top = '5px';\n node.textContent = text;\n return node;\n}\n\n/**\n * Copy the node to the clipboard.\n * @param node\n * @returns {Promise<never>|Promise<void>}\n */\nexport function copyNode(node) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(node.textContent || '');\n }\n\n const selection = getSelection(); // Firefox return null\n if (selection === null) {\n return Promise.reject(new Error());\n }\n\n selection.removeAllRanges();\n\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.addRange(range);\n\n // document.execCommand(\"copy\")\n selection.removeAllRanges();\n return Promise.resolve();\n}\n\n/**\n * Copy the text to the clipboard.\n * @param text\n * @returns {Promise<never>|Promise<void>}\n */\nexport function copyText(text) {\n if ('clipboard' in navigator) {\n return navigator.clipboard.writeText(text);\n }\n\n const body = document.body;\n if (!body) {\n return Promise.reject(new Error());\n }\n\n const node = createNode(text);\n body.appendChild(node);\n copyNode(node);\n body.removeChild(node);\n return Promise.resolve();\n}\n","import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport Input from '../wje-input/input.js';\nimport { copyNode, copyText } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary CopyButton is a custom web component that extends WJElement.\n * It provides a button that, when clicked, copies a specified text to the clipboard.\n * The text to be copied can be specified through the `value` attribute.\n * The CopyButton also supports keyboard interaction, copying the text when the space or enter key is pressed.\n * @documentation https://elements.webjet.sk/components/copy-button\n * @status stable\n * @augments WJElement\n * @attribute {string} for - The id of the element to copy content from.\n * @attribute {string} label - Accessible label for the button. Also used as fallback tooltip text when the `tooltip` attribute is present without a value.\n * @attribute {string} label-success - Text displayed in the tooltip after a successful copy. Used only when the `tooltip` attribute is present.\n * @attribute {string} tooltip - Enables the tooltip. When set to a string, the value is used as the default tooltip content.\n * @attribute {string} value - The text to be copied.\n * @slot - This is a default/unnamed slot.\n * @csspart button - Styles the button element.\n * @cssproperty --text-color - Controls the color of the text.\n * @cssproperty --background-color - Controls the background color of the button.\n * //@fires wje:copy-button - Dispatched when the button is clicked and the text is copied.\n * @tag wje-copy-button\n */\nexport default class CopyButton extends WJElement {\n /**\n * Constructor for the CopyButton class.\n * Initializes the timeout property.\n */\n constructor() {\n super();\n\n this.timeout = 1000;\n }\n\n /**\n * Setter for the value property.\n * @param {string} value The value to be set.\n */\n set value(value) {\n this.setAttribute('value', value);\n }\n\n /**\n * Getter for the value property.\n * @returns {string} The value of the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n className = 'CopyButton';\n\n /**\n * Getter for the cssStyleSheet property.\n * @returns {string} The CSS styles.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes property.\n * @returns {Array} An empty array.\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the CopyButton.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the ColorPicker element.\n * @returns {DocumentFragment} The created document fragment.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n let content;\n this._tooltipElement = null;\n\n if (WjElementUtils.hasSlot(this)) {\n content = document.createElement('slot');\n } else {\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'clipboard');\n\n content = icon;\n this.icon = icon;\n }\n\n if (this.hasAttribute('tooltip')) {\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('offset', '5');\n tooltip.setAttribute('content', this.getAttribute('tooltip') || this.label || 'Copy');\n\n tooltip.appendChild(content);\n fragment.appendChild(tooltip);\n\n this._tooltipElement = tooltip;\n } else {\n fragment.appendChild(content);\n }\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the click, focus, and blur events.\n */\n afterDraw() {\n this.syncAria();\n event.addListener(this, 'click', null, this.clicked);\n event.addListener(this, 'focus', null, this.focused);\n event.addListener(this, 'blur', null, this.blurred);\n\n event.addListener(this, 'wje-copy-button:click', null, this.copied);\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'button' });\n }\n\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n const ariaLabel = this.getAttribute('aria-label');\n const label = this.getAttribute('label') || this.label || 'Copy';\n if (!ariaLabel && label) {\n this.setAriaState({ label });\n }\n\n if (this.hasAttribute('disabled')) {\n this.setAriaState({ disabled: true });\n }\n }\n\n /**\n * Handles the click event.\n * @param {Event} e The event object.\n */\n clicked = (e) => {\n const button = e.currentTarget;\n if (button instanceof HTMLElement) {\n this.copy(button);\n }\n };\n\n /**\n * Handles the keydown event.\n * @param {Event} e The event object.\n */\n keydown = (e) => {\n if (e.key === ' ' || e.key === 'Enter') {\n const button = e.currentTarget;\n if (button instanceof HTMLElement) {\n this.copy(button);\n }\n }\n };\n\n /**\n * Handles the focus event.\n * @param {Event} e The event object.\n */\n focused = (e) => {\n e.currentTarget.addEventListener('keydown', this.keydown);\n };\n\n /**\n * Handles the blur event.\n * @param {Event} e The event object.\n */\n blurred = (e) => {\n e.currentTarget.removeEventListener('keydown', this.keydown);\n };\n\n /**\n * Handles the copied event.\n * You can override this method to customize the behavior when the text is copied.\n */\n copied = () => {\n if (this.hasOwnProperty('icon')) {\n this.icon.setAttribute('color', 'success');\n this.icon.setAttribute('name', 'check');\n }\n\n if (this._tooltipElement) {\n this._tooltipElement.setAttribute('content', this.labelSuccess || 'Copied');\n }\n\n setTimeout(() => {\n if (this.hasOwnProperty('icon')) {\n this.icon.removeAttribute('color');\n this.icon.setAttribute('name', 'clipboard');\n }\n\n if (this._tooltipElement) {\n this._tooltipElement.setAttribute('content', this.getAttribute('tooltip') || this.label || 'Copy');\n }\n }, this.timeout);\n };\n\n /**\n * Copies the specified text or node.\n * @param {HTMLElement} button The button element.\n */\n async copy(button) {\n const id = this.getAttribute('for');\n const text = this.getAttribute('value');\n\n if (button.getAttribute('aria-disabled') === 'true') {\n return;\n }\n\n if (text) {\n await copyText(text);\n event.dispatchCustomEvent(this, 'wje-copy-button:click');\n } else if (id) {\n const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument;\n if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot))) return;\n\n const node = root.getElementById(id);\n if (node) {\n await this.copyTarget(node);\n event.dispatchCustomEvent(this, 'wje-copy-button:click');\n }\n }\n }\n\n /**\n * Copies the target content.\n * @param {HTMLElement} content The content to be copied.\n * @returns {Promise} A promise that resolves when the content is copied.\n */\n copyTarget(content) {\n if (content instanceof HTMLInputElement || content instanceof HTMLTextAreaElement || content instanceof Input) {\n return copyText(content.value);\n } else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {\n return copyText(content.href);\n } else {\n return copyNode(content);\n }\n }\n}\n","import CopyButton from './copy-button.element.js';\n\nexport default CopyButton;\n\nCopyButton.define('wje-copy-button', CopyButton);\n"],"names":[],"mappings":";;;;;;;AAKA,SAAS,WAAW,MAAM;AACtB,QAAM,OAAO,SAAS,cAAc,KAAK;AACzC,OAAK,MAAM,QAAQ;AACnB,OAAK,MAAM,SAAS;AACpB,OAAK,MAAM,WAAW;AACtB,OAAK,MAAM,MAAM;AACjB,OAAK,cAAc;AACnB,SAAO;AACX;AAOO,SAAS,SAAS,MAAM;AAC3B,MAAI,eAAe,WAAW;AAC1B,WAAO,UAAU,UAAU,UAAU,KAAK,eAAe,EAAE;AAAA,EAC/D;AAEA,QAAM,YAAY;AAClB,MAAI,cAAc,MAAM;AACpB,WAAO,QAAQ,OAAO,IAAI,OAAO;AAAA,EACrC;AAEA,YAAU,gBAAe;AAEzB,QAAM,QAAQ,SAAS,YAAW;AAClC,QAAM,mBAAmB,IAAI;AAC7B,YAAU,SAAS,KAAK;AAGxB,YAAU,gBAAe;AACzB,SAAO,QAAQ,QAAO;AAC1B;AAOO,SAAS,SAAS,MAAM;AAC3B,MAAI,eAAe,WAAW;AAC1B,WAAO,UAAU,UAAU,UAAU,IAAI;AAAA,EAC7C;AAEA,QAAM,OAAO,SAAS;AACtB,MAAI,CAAC,MAAM;AACP,WAAO,QAAQ,OAAO,IAAI,OAAO;AAAA,EACrC;AAEA,QAAM,OAAO,WAAW,IAAI;AAC5B,OAAK,YAAY,IAAI;AACrB,WAAS,IAAI;AACb,OAAK,YAAY,IAAI;AACrB,SAAO,QAAQ,QAAO;AAC1B;;ACpCe,MAAM,mBAAmB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9C,cAAc;AACV,UAAK;AAqBT,qCAAY;AAoGZ;AAAA;AAAA;AAAA;AAAA,mCAAU,CAAC,MAAM;AACb,YAAM,SAAS,EAAE;AACjB,UAAI,kBAAkB,aAAa;AAC/B,aAAK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AAS,OAAO;AAAA,IAC3B;AAAA,EACJ;AACJ;AC3PA,WAAW,OAAO,mBAAmB,UAAU;"}
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var _onMenuItemCustom;
11
11
  import WJElement from "./wje-element.js";
12
- import { P as Popup } from "./popup.element-DklicGea.js";
12
+ import { P as Popup } from "./popup.element-C8-g3WLs.js";
13
13
  import { event } from "./event.js";
14
14
  const _Dropdown = class _Dropdown extends WJElement {
15
15
  /**
@@ -182,7 +182,7 @@ const _WJElement = class _WJElement extends HTMLElement {
182
182
  /**
183
183
  * Sets ARIA state via attributes.
184
184
  * Accepts camelCase keys without the "aria" prefix, plus "role".
185
- * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' })
185
+ * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' }).
186
186
  * @param {object} state
187
187
  */
188
188
  setAriaState(state = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Initialize ElementInternals when supported.\n\t\tif (typeof this.attachInternals === 'function') {\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * Returns ElementInternals when available.\n\t * @returns {ElementInternals|null}\n\t */\n\tgetInternals() {\n\t\treturn this.internals || null;\n\t}\n\n\t/**\n\t * Sets ARIA state via attributes.\n\t * Accepts camelCase keys without the \"aria\" prefix, plus \"role\".\n\t * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' })\n\t * @param {object} state\n\t */\n\tsetAriaState(state = {}) {\n\t\tif (!state || typeof state !== 'object') return;\n\n\t\tObject.entries(state).forEach(([key, value]) => {\n\t\t\tif (value === undefined || value === null) return;\n\n\t\t\tif (key === 'role') {\n\t\t\t\tthis.setAttribute('role', value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet attr;\n\t\t\tif (key === 'labelledBy') attr = 'aria-labelledby';\n\t\t\telse if (key === 'describedBy') attr = 'aria-describedby';\n\t\t\telse attr = `aria-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n\t\t\t// Convert booleans to \"true\"/\"false\" strings for aria attributes.\n\t\t\tconst normalized = (typeof value === 'boolean') ? (value ? 'true' : 'false') : value;\n\t\t\tthis.setAttribute(attr, normalized);\n\t\t});\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonDelayOverride` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\tif (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;\n\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\treturn 300;\n\t}\n\n\t/**\n\t * Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,\n\t * the override for the minimum duration is removed.\n\t * @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.\n\t */\n\tset skeletonMinDuration(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonMinDurationOverride;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonMinDurationOverride = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Sets or removes the 'skeleton' attribute based on the provided value.\n\t * @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.\n\t */\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\n\t/**\n\t * Checks if the 'skeleton' attribute is present on the element.\n\t * @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.\n\t */\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\t/**\n\t * Sets the delay for the skeleton loading indicator.\n\t * @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,\n\t * a string that can be converted to a number, null, or undefined.\n\t * If null or undefined is provided, the skeleton delay will be cleared.\n\t */\n\tset skeletonDelay(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonDelayOverride;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonDelayOverride = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the delay value used for skeleton loading.\n\t * @returns {number} The delay value for the skeleton loader.\n\t */\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a refresh operation by initializing the update lifecycle and setting up promises\n\t * to track its completion or failure status. Marks the instance as not pristine and queues\n\t * an update.\n\t * @returns {void} Does not return a value.\n\t */\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops the current render loop if it is running by canceling the requestAnimationFrame.\n\t * @returns {void} This method does not return a value.\n\t */\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\n\t\t\tif (slotted) {\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\tslot.name = 'skeleton';\n\t\t\t\t\tfrag.append(slot);\n\t\t\t\t\treturn frag;\n\t\t\t\t}\n\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(slotted.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\tconst frag = document.createDocumentFragment();\n\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\n\t\t\tif (skel === null || skel === undefined) return null;\n\n\t\t\tlet node;\n\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\tlet skeletonPlannedAt;\n\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up accessors (getter and setter) for all attributes of the current object.\n\t * This method retrieves the attribute names, sanitizes them, and dynamically defines\n\t * property accessors for each attribute using `Object.defineProperty`.\n\t * @returns {void} This method does not return any value.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAEN,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAK;AAZQ;AACd;AACA;AACA;AACA;AACA;AA2dA;AAAA;AAAA;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K,gBAAgB;AAE3C,YAAO;AAAA,EACR,CAAC,EAAE,MAAM,CAAC,MAAM;AACf,YAAQ,MAAM,CAAC;AAAA,EAChB,CAAC;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA5sBA,cArRoB,YAqRb,oBAAmB,CAAC,WAAW,kBAAkB;AACvD,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACR;AAzRc,IAAM,YAAN;AAo+BZ,IAAC,aAAa;"}
1
+ {"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Initialize ElementInternals when supported.\n\t\tif (typeof this.attachInternals === 'function') {\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * Returns ElementInternals when available.\n\t * @returns {ElementInternals|null}\n\t */\n\tgetInternals() {\n\t\treturn this.internals || null;\n\t}\n\n\t\t/**\n\t\t * Sets ARIA state via attributes.\n\t\t * Accepts camelCase keys without the \"aria\" prefix, plus \"role\".\n\t\t * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' }).\n\t\t * @param {object} state\n\t\t */\n\tsetAriaState(state = {}) {\n\t\tif (!state || typeof state !== 'object') return;\n\n\t\tObject.entries(state).forEach(([key, value]) => {\n\t\t\tif (value === undefined || value === null) return;\n\n\t\t\tif (key === 'role') {\n\t\t\t\tthis.setAttribute('role', value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet attr;\n\t\t\tif (key === 'labelledBy') attr = 'aria-labelledby';\n\t\t\telse if (key === 'describedBy') attr = 'aria-describedby';\n\t\t\telse attr = `aria-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n\t\t\t// Convert booleans to \"true\"/\"false\" strings for aria attributes.\n\t\t\tconst normalized = (typeof value === 'boolean') ? (value ? 'true' : 'false') : value;\n\t\t\tthis.setAttribute(attr, normalized);\n\t\t});\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonDelayOverride` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\tif (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;\n\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\treturn 300;\n\t}\n\n\t/**\n\t * Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,\n\t * the override for the minimum duration is removed.\n\t * @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.\n\t */\n\tset skeletonMinDuration(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonMinDurationOverride;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonMinDurationOverride = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Sets or removes the 'skeleton' attribute based on the provided value.\n\t * @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.\n\t */\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\n\t/**\n\t * Checks if the 'skeleton' attribute is present on the element.\n\t * @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.\n\t */\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\t/**\n\t * Sets the delay for the skeleton loading indicator.\n\t * @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,\n\t * a string that can be converted to a number, null, or undefined.\n\t * If null or undefined is provided, the skeleton delay will be cleared.\n\t */\n\tset skeletonDelay(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonDelayOverride;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonDelayOverride = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the delay value used for skeleton loading.\n\t * @returns {number} The delay value for the skeleton loader.\n\t */\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a refresh operation by initializing the update lifecycle and setting up promises\n\t * to track its completion or failure status. Marks the instance as not pristine and queues\n\t * an update.\n\t * @returns {void} Does not return a value.\n\t */\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops the current render loop if it is running by canceling the requestAnimationFrame.\n\t * @returns {void} This method does not return a value.\n\t */\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\n\t\t\tif (slotted) {\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\tslot.name = 'skeleton';\n\t\t\t\t\tfrag.append(slot);\n\t\t\t\t\treturn frag;\n\t\t\t\t}\n\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(slotted.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\tconst frag = document.createDocumentFragment();\n\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\n\t\t\tif (skel === null || skel === undefined) return null;\n\n\t\t\tlet node;\n\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\tlet skeletonPlannedAt;\n\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj-skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up accessors (getter and setter) for all attributes of the current object.\n\t * This method retrieves the attribute names, sanitizes them, and dynamically defines\n\t * property accessors for each attribute using `Object.defineProperty`.\n\t * @returns {void} This method does not return any value.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAEN,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAK;AAZQ;AACd;AACA;AACA;AACA;AACA;AA2dA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,CAAC,QAAQ,UAAU;AAClC,aAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,2BAAK,gBAAiB,KAAK,gBAAgB;AAE3C,mBAAK,oBAAL;AACA,YAAI,KAAK,eAAe;AACvB,cAAI,CAAC,KAAK,WAAY,MAAK,aAAa,EAAE,MAAM,KAAK,cAAc,QAAQ,gBAAgB,KAAI,CAAE;AAAA,QAClG;AACA,aAAK,eAAc;AAEnB,2BA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AE;AACrF,SAAO;AACR;AAzRc,IAAM,YAAN;AAo+BZ,IAAC,aAAa;"}
@@ -476,7 +476,6 @@ class FileUpload extends WJElement {
476
476
  this.native.addEventListener("drop", this.handleDrop);
477
477
  let dragEventCounter = 0;
478
478
  this.native.addEventListener("dragenter", (e) => {
479
- handleInputChange;
480
479
  e.preventDefault();
481
480
  if (dragEventCounter === 0) {
482
481
  this.native.classList.add("highlight");