@preline/accordion 4.1.2 → 4.1.3

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 (3) hide show
  1. package/index.js +3 -3
  2. package/index.mjs +3 -3
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(self,(()=>(()=>{"use strict";var e={292:function(e,t){
2
2
  /*
3
- * @version: 4.1.2
3
+ * @version: 4.1.3
4
4
  * @author: Preline Labs Ltd.
5
5
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
6
6
  * Copyright 2024 Preline Labs Ltd.
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchHistory=t.isScrollable=t.isParentOrElementHidden=t.isJson=t.isIpadOS=t.isIOS=t.isFormElement=t.isFocused=t.isEnoughSpace=t.isDirectChild=t.htmlToElement=t.getZIndex=t.getHighestZIndex=t.getClassPropertyAlt=t.getClassProperty=t.dispatch=t.debounce=t.classToClassList=t.afterTransition=void 0;t.stringToBoolean=e=>"true"===e;t.getClassProperty=(e,t,o="")=>(window.getComputedStyle(e).getPropertyValue(t)||o).replace(" ","");t.getClassPropertyAlt=(e,t,o="")=>{let i="";return e.classList.forEach((e=>{e.includes(t)&&(i=e)})),i.match(/:(.*)]/)?i.match(/:(.*)]/)[1]:o};const o=e=>window.getComputedStyle(e).getPropertyValue("z-index");t.getZIndex=o;t.getHighestZIndex=e=>{let t=Number.NEGATIVE_INFINITY;return e.forEach((e=>{let i=o(e);"auto"!==i&&(i=parseInt(i,10),i>t&&(t=i))})),t};t.isDirectChild=(e,t)=>{const o=e.children;for(let e=0;e<o.length;e++)if(o[e]===t)return!0;return!1};t.isEnoughSpace=(e,t,o="auto",i=10,n=null)=>{const s=t.getBoundingClientRect(),l=n?n.getBoundingClientRect():null,r=window.innerHeight,c=l?s.top-l.top:s.top,a=(n?l.bottom:r)-s.bottom,h=e.clientHeight+i;return"bottom"===o?a>=h:"top"===o?c>=h:c>=h||a>=h};t.isFocused=e=>document.activeElement===e;t.isFormElement=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement;t.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);t.isJson=e=>{if("string"!=typeof e)return!1;const t=e.trim()[0],o=e.trim().slice(-1);if("{"===t&&"}"===o||"["===t&&"]"===o)try{return JSON.parse(e),!0}catch(e){return!1}return!1};const i=e=>{if(!e)return!1;return"none"===window.getComputedStyle(e).display||i(e.parentElement)};t.isParentOrElementHidden=i;t.isScrollable=e=>{const t=window.getComputedStyle(e),o=t.overflowY,i=t.overflowX,n=("scroll"===o||"auto"===o)&&e.scrollHeight>e.clientHeight,s=("scroll"===i||"auto"===i)&&e.scrollWidth>e.clientWidth;return n||s};t.debounce=(e,t=200)=>{let o;return(...i)=>{clearTimeout(o),o=setTimeout((()=>{e.apply(this,i)}),t)}};t.dispatch=(e,t,o=null)=>{const i=new CustomEvent(e,{detail:{payload:o},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)};t.afterTransition=(e,t)=>{const o=()=>{t(),e.removeEventListener("transitionend",o,!0)},i=window.getComputedStyle(e),n=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(n)>0?e.addEventListener("transitionend",o,!0):t()};t.htmlToElement=e=>{const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild};t.classToClassList=(e,t,o=" ",i="add")=>{e.split(o).forEach((e=>{e.trim()&&("add"===i?t.classList.add(e):t.classList.remove(e))}))};const n={historyIndex:-1,addHistory(e){this.historyIndex=e},existsInHistory(e){return e>this.historyIndex},clearHistory(){this.historyIndex=-1}};t.menuSearchHistory=n},2961:(e,t)=>{
9
9
  /*
10
10
  * HSBasePlugin
11
- * @version: 4.1.2
11
+ * @version: 4.1.3
12
12
  * @author: Preline Labs Ltd.
13
13
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
14
  * Copyright 2024 Preline Labs Ltd.
@@ -16,7 +16,7 @@ Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBoolean=t.menuSearchH
16
16
  Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}createCollection(e,t){var o,i;let n=e;if(!Array.isArray(n)&&"undefined"!=typeof window){const e=null===(o=this.constructor)||void 0===o?void 0:o.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),n=window[t])}Array.isArray(n)&&n.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||n.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},6621:function(e,t,o){
17
17
  /*
18
18
  * HSAccordion
19
- * @version: 4.1.2
19
+ * @version: 4.1.3
20
20
  * @author: Preline Labs Ltd.
21
21
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
22
  * Copyright 2024 Preline Labs Ltd.
package/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  var e={615:(e,t,o)=>{o.d(t,{A:()=>i});
2
2
  /*
3
3
  * HSBasePlugin
4
- * @version: 4.1.2
4
+ * @version: 4.1.3
5
5
  * @author: Preline Labs Ltd.
6
6
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
7
7
  * Copyright 2024 Preline Labs Ltd.
8
8
  */
9
9
  class i{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this.options=t,this.events={}}createCollection(e,t){var o,i;let n=e;if(!Array.isArray(n)&&"undefined"!=typeof window){const e=null===(o=this.constructor)||void 0===o?void 0:o.name,t="string"==typeof e&&e.startsWith("HS")?`$hs${e.slice(2)}Collection`:null;t&&(Array.isArray(window[t])||(window[t]=[]),n=window[t])}Array.isArray(n)&&n.push({id:(null===(i=null==t?void 0:t.el)||void 0===i?void 0:i.id)||n.length+1,element:t})}fireEvent(e,t=null){if(this.events.hasOwnProperty(e))return this.events[e](t)}on(e,t){this.events[e]=t}}},926:(e,t,o)=>{o.d(t,{JD:()=>s,PK:()=>i,gj:()=>n,yd:()=>l});
10
10
  /*
11
- * @version: 4.1.2
11
+ * @version: 4.1.3
12
12
  * @author: Preline Labs Ltd.
13
13
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
14
  * Copyright 2024 Preline Labs Ltd.
@@ -16,7 +16,7 @@ class i{constructor(e,t,o){this.el=e,this.options=t,this.events=o,this.el=e,this
16
16
  const i=e=>"true"===e,n=(e,t,o="")=>(window.getComputedStyle(e).getPropertyValue(t)||o).replace(" ",""),s=(e,t,o=null)=>{const i=new CustomEvent(e,{detail:{payload:o},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(i)},l=(e,t)=>{const o=()=>{t(),e.removeEventListener("transitionend",o,!0)},i=window.getComputedStyle(e),n=i.getPropertyValue("transition-duration");"none"!==i.getPropertyValue("transition-property")&&parseFloat(n)>0?e.addEventListener("transitionend",o,!0):t()}}},t={};function o(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,o),s.exports}o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};o.d(i,{A:()=>c});var n=o(926),s=o(615);
17
17
  /*
18
18
  * HSAccordion
19
- * @version: 4.1.2
19
+ * @version: 4.1.3
20
20
  * @author: Preline Labs Ltd.
21
21
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
22
  * Copyright 2024 Preline Labs Ltd.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preline/accordion",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",