@preline/accordion 1.2.0

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/LICENSE.txt +15 -0
  2. package/index.js +2 -0
  3. package/package.json +36 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Component
3
+ * @version: 1.0.0
4
+ * @author: HtmlStream
5
+ * @license: Licensed under MIT (https://preline.co/docs/license.html)
6
+ * Copyright 2022 Htmlstream
7
+ */
8
+
9
+ /*
10
+ * HSAccordion
11
+ * @version: 1.0.0
12
+ * @author: HtmlStream
13
+ * @license: Licensed under MIT (https://preline.co/docs/license.html)
14
+ * Copyright 2022 Htmlstream
15
+ */
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see hs-accordion.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(){return(()=>{"use strict";var e={765:(e,t,n)=>{function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}n.d(t,{Z:()=>r});var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$collection=[],this.selector=t,this.config=n,this.events={}}var t,n;return t=e,n=[{key:"_fireEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.events.hasOwnProperty(e)&&this.events[e](t)}},{key:"_dispatch",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=new CustomEvent(e,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});t.dispatchEvent(o)}},{key:"on",value:function(e,t){this.events[e]=t}},{key:"afterTransition",value:function(e,t){"all 0s ease 0s"!==window.getComputedStyle(e,null).getPropertyValue("transition")?e.addEventListener("transitionend",(function n(){t(),e.removeEventListener("transitionend",n,!0)}),!0):t()}},{key:"getClassProperty",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=(window.getComputedStyle(e).getPropertyValue(t)||n).replace(" ","");return o}}],n&&o(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function i(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}n.r(o);var a=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}(u,e);var n,o,a,s,l=(a=u,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(a);if(s){var n=c(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return i(this,e)});function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),l.call(this,".hs-accordion")}return n=u,(o=[{key:"init",value:function(){var e=this;document.addEventListener("click",(function(t){var n=t.target,o=n.closest(e.selector),r=n.closest(".hs-accordion-toggle"),i=n.closest(".hs-accordion-group");o&&i&&r&&(e._hideAll(o),e.show(o))}))}},{key:"show",value:function(e){var t=this;if(e.classList.contains("active"))return this.hide(e);e.classList.add("active");var n=e.querySelector(".hs-accordion-content");n.style.display="block",n.style.height=0,setTimeout((function(){n.style.height="".concat(n.scrollHeight,"px")})),this.afterTransition(n,(function(){e.classList.contains("active")&&(n.style.height="",t._fireEvent("open",e),t._dispatch("open.hs.accordion",e,e))}))}},{key:"hide",value:function(e){var t=this,n=e.querySelector(".hs-accordion-content");n.style.height="".concat(n.scrollHeight,"px"),setTimeout((function(){n.style.height=0})),this.afterTransition(n,(function(){e.classList.contains("active")||(n.style.display="",t._fireEvent("hide",e),t._dispatch("hide.hs.accordion",e,e))})),e.classList.remove("active")}},{key:"_hideAll",value:function(e){var t=this,n=e.closest(".hs-accordion-group");n.hasAttribute("data-hs-accordion-always-open")||n.querySelectorAll(this.selector).forEach((function(n){e!==n&&t.hide(n)}))}}])&&t(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),u}(n(765).Z);window.HSAccordion=new a,document.addEventListener("load",window.HSAccordion.init())})(),o})()}));
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@preline/accordion",
3
+ "version": "1.2.0",
4
+ "description": "Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.",
5
+ "main": "index.js",
6
+ "repository": "https://github.com/htmlstreamofficial/preline.git",
7
+ "keywords": [
8
+ "preline",
9
+ "html",
10
+ "css",
11
+ "next",
12
+ "nuxt",
13
+ "vue",
14
+ "react",
15
+ "angular",
16
+ "javascript",
17
+ "tailwind",
18
+ "tailwind components",
19
+ "tailwind elements",
20
+ "tailwind library",
21
+ "tailwind sections",
22
+ "tailwind css",
23
+ "tailwind ui",
24
+ "tailwind css react",
25
+ "tailwind css vue",
26
+ "tailwind css angular",
27
+ "tailwind css laravel",
28
+ "tailwindcss plugin",
29
+ "tailwindcss plugins"
30
+ ],
31
+ "author": "Htmlstream",
32
+ "license": "MIT",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }