@maggioli-design-system/mds-accordion-timer 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mds-accordion-timer.cjs.entry.js +2 -5
  3. package/dist/cjs/mds-accordion-timer.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +1 -1
  5. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +2 -5
  6. package/dist/collection/dictionary/typography.js +3 -3
  7. package/dist/components/mds-accordion-timer.js +2 -5
  8. package/dist/esm/loader.js +1 -1
  9. package/dist/esm/mds-accordion-timer.entry.js +2 -5
  10. package/dist/esm/mds-accordion-timer.js +1 -1
  11. package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
  12. package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
  13. package/dist/mds-accordion-timer/mds-accordion-timer.js +1 -1
  14. package/dist/mds-accordion-timer/p-6bb3b141.system.entry.js +1 -0
  15. package/{www/build/p-a617eaf9.system.js → dist/mds-accordion-timer/p-94dc5a3c.system.js} +1 -1
  16. package/dist/mds-accordion-timer/p-ff15a152.entry.js +1 -0
  17. package/dist/stats.json +17 -17
  18. package/dist/types/stencil-public-runtime.d.ts +5 -0
  19. package/dist/types/types/typography.d.ts +3 -3
  20. package/package.json +4 -4
  21. package/src/dictionary/typography.ts +3 -3
  22. package/src/fixtures/icons.json +2 -2
  23. package/src/types/typography.ts +3 -3
  24. package/www/build/mds-accordion-timer.esm.js +1 -1
  25. package/www/build/mds-accordion-timer.js +1 -1
  26. package/www/build/p-6bb3b141.system.entry.js +1 -0
  27. package/{dist/mds-accordion-timer/p-a617eaf9.system.js → www/build/p-94dc5a3c.system.js} +1 -1
  28. package/www/build/p-ff15a152.entry.js +1 -0
  29. package/dist/mds-accordion-timer/p-30c950ab.system.entry.js +0 -1
  30. package/dist/mds-accordion-timer/p-9784c024.entry.js +0 -1
  31. package/www/build/p-30c950ab.system.entry.js +0 -1
  32. package/www/build/p-9784c024.entry.js +0 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-bd5d8a33.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -10,11 +10,6 @@ const MdsAccordionTimer = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.itemActivated = index.createEvent(this, "itemActivated", 7);
13
- this.time = 0;
14
- /**
15
- * Sets the duration of the single accordion item
16
- */
17
- this.duration = 10000;
18
13
  this.clearIntervals = () => {
19
14
  window.clearInterval(this.timer);
20
15
  window.clearInterval(this.timeChecker);
@@ -79,6 +74,8 @@ const MdsAccordionTimer = class {
79
74
  this.clearIntervals();
80
75
  this.time = null;
81
76
  };
77
+ this.time = 0;
78
+ this.duration = 10000;
82
79
  }
83
80
  componentDidLoad() {
84
81
  this.children = this.element.querySelectorAll('mds-accordion-timer-item');
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-bd5d8a33.js');
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  const patchBrowser = () => {
9
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-accordion-timer.cjs.js', document.baseURI).href));
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.18.1",
7
+ "version": "2.19.3",
8
8
  "typescriptVersion": "4.7.4"
9
9
  },
10
10
  "collections": [],
@@ -1,11 +1,6 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  export class MdsAccordionTimer {
3
3
  constructor() {
4
- this.time = 0;
5
- /**
6
- * Sets the duration of the single accordion item
7
- */
8
- this.duration = 10000;
9
4
  this.clearIntervals = () => {
10
5
  window.clearInterval(this.timer);
11
6
  window.clearInterval(this.timeChecker);
@@ -70,6 +65,8 @@ export class MdsAccordionTimer {
70
65
  this.clearIntervals();
71
66
  this.time = null;
72
67
  };
68
+ this.time = 0;
69
+ this.duration = 10000;
73
70
  }
74
71
  componentDidLoad() {
75
72
  this.children = this.element.querySelectorAll('mds-accordion-timer-item');
@@ -1,7 +1,7 @@
1
1
  const typographyDictionary = [
2
2
  'action',
3
3
  'caption',
4
- 'code',
4
+ 'snippet',
5
5
  'detail',
6
6
  'h1',
7
7
  'h2',
@@ -19,10 +19,10 @@ const typographyVariationsDictionary = [
19
19
  'title',
20
20
  'info',
21
21
  'read',
22
- 'mono',
22
+ 'code',
23
23
  ];
24
24
  const typographyMonoDictionary = [
25
- 'code',
25
+ 'snippet',
26
26
  'hack',
27
27
  ];
28
28
  const typographyTitleDictionary = [
@@ -8,11 +8,6 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
8
8
  this.__registerHost();
9
9
  this.__attachShadow();
10
10
  this.itemActivated = createEvent(this, "itemActivated", 7);
11
- this.time = 0;
12
- /**
13
- * Sets the duration of the single accordion item
14
- */
15
- this.duration = 10000;
16
11
  this.clearIntervals = () => {
17
12
  window.clearInterval(this.timer);
18
13
  window.clearInterval(this.timeChecker);
@@ -77,6 +72,8 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
77
72
  this.clearIntervals();
78
73
  this.time = null;
79
74
  };
75
+ this.time = 0;
76
+ this.duration = 10000;
80
77
  }
81
78
  componentDidLoad() {
82
79
  this.children = this.element.querySelectorAll('mds-accordion-timer-item');
@@ -1,7 +1,7 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-afb1c64b.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchEsm = () => {
7
7
  return promiseResolve();
@@ -6,11 +6,6 @@ const MdsAccordionTimer = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.itemActivated = createEvent(this, "itemActivated", 7);
9
- this.time = 0;
10
- /**
11
- * Sets the duration of the single accordion item
12
- */
13
- this.duration = 10000;
14
9
  this.clearIntervals = () => {
15
10
  window.clearInterval(this.timer);
16
11
  window.clearInterval(this.timeChecker);
@@ -75,6 +70,8 @@ const MdsAccordionTimer = class {
75
70
  this.clearIntervals();
76
71
  this.time = null;
77
72
  };
73
+ this.time = 0;
74
+ this.duration = 10000;
78
75
  }
79
76
  componentDidLoad() {
80
77
  this.children = this.element.querySelectorAll('mds-accordion-timer-item');
@@ -1,7 +1,7 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-afb1c64b.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchBrowser = () => {
7
7
  const importMeta = import.meta.url;
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-afb1c64b.js";var mdsAccordionTimerCss=":host{display:block}";var MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.itemActivated=createEvent(this,"itemActivated",7);this.time=0;this.duration=1e4;this.clearIntervals=function(){window.clearInterval(t.timer);window.clearInterval(t.timeChecker);t.timer=null;t.timeChecker=null};this.progress=function(){return Math.abs(t.remainingTime()/t.duration-1)};this.addTimeListener=function(){t.timeChecker=window.setInterval((function(){var e=t.progress();if(t.activeItem!==undefined){t.activeItem.progress=e}if(e===1){t.activeItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.activeItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setActiveItem=function(e){t.children.forEach((function(i,n){if(n===e){i.active=true;t.activeItem=i;t.itemActivated.emit(e)}else{i.active=false}}))};this.startNext=function(){var e=t.activeItem.uuid+1>t.children.length-1?0:t.activeItem.uuid+1;t.setActiveItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.activeItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.activeItemDurationTime=t.remainingTime()};this.stopTimer=function(){t.clearIntervals();t.time=null}}e.prototype.componentDidLoad=function(){var e=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(t,i){t.uuid=i;if(t.active){e.activeItem=t}}))};e.prototype.connectedCallback=function(){this.startTimer()};e.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};e.prototype.onClickActive=function(e){if(e.detail===this.activeItem.description){return}var t;this.children.forEach((function(i){i.progress=0;if(i.description===e.detail){t=i.uuid}}));this.setActiveItem(t);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterActive=function(){this.pauseTimer()};e.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};e.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsAccordionTimer.style=mdsAccordionTimerCss;export{MdsAccordionTimer as mds_accordion_timer};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-afb1c64b.js";var mdsAccordionTimerCss=":host{display:block}";var MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.itemActivated=createEvent(this,"itemActivated",7);this.clearIntervals=function(){window.clearInterval(t.timer);window.clearInterval(t.timeChecker);t.timer=null;t.timeChecker=null};this.progress=function(){return Math.abs(t.remainingTime()/t.duration-1)};this.addTimeListener=function(){t.timeChecker=window.setInterval((function(){var e=t.progress();if(t.activeItem!==undefined){t.activeItem.progress=e}if(e===1){t.activeItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.activeItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setActiveItem=function(e){t.children.forEach((function(i,n){if(n===e){i.active=true;t.activeItem=i;t.itemActivated.emit(e)}else{i.active=false}}))};this.startNext=function(){var e=t.activeItem.uuid+1>t.children.length-1?0:t.activeItem.uuid+1;t.setActiveItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.activeItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.activeItemDurationTime=t.remainingTime()};this.stopTimer=function(){t.clearIntervals();t.time=null};this.time=0;this.duration=1e4}e.prototype.componentDidLoad=function(){var e=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(t,i){t.uuid=i;if(t.active){e.activeItem=t}}))};e.prototype.connectedCallback=function(){this.startTimer()};e.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};e.prototype.onClickActive=function(e){if(e.detail===this.activeItem.description){return}var t;this.children.forEach((function(i){i.progress=0;if(i.description===e.detail){t=i.uuid}}));this.setActiveItem(t);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterActive=function(){this.pauseTimer()};e.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};e.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsAccordionTimer.style=mdsAccordionTimerCss;export{MdsAccordionTimer as mds_accordion_timer};
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-d5616601.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-9784c024",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)));
1
+ import{p as e,b as t}from"./p-d5616601.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-ff15a152",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-a617eaf9.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-94dc5a3c.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
@@ -0,0 +1 @@
1
+ System.register(["./p-e2fa938f.system.js"],(function(t){"use strict";var e,i,n,r,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;c=t.g}],execute:function(){var a=":host{display:block}";var s=t("mds_accordion_timer",function(){function t(t){var n=this;e(this,t);this.itemActivated=i(this,"itemActivated",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timer=null;n.timeChecker=null};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var t=n.progress();if(n.activeItem!==undefined){n.activeItem.progress=t}if(t===1){n.activeItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var t=n.activeItemDurationTime-((new Date).getTime()-n.timeStarted);return t>=0?t:0};this.setActiveItem=function(t){n.children.forEach((function(e,i){if(i===t){e.active=true;n.activeItem=e;n.itemActivated.emit(t)}else{e.active=false}}))};this.startNext=function(){var t=n.activeItem.uuid+1>n.children.length-1?0:n.activeItem.uuid+1;n.setActiveItem(t);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.activeItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.activeItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.time=null};this.time=0;this.duration=1e4}t.prototype.componentDidLoad=function(){var t=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(e,i){e.uuid=i;if(e.active){t.activeItem=e}}))};t.prototype.connectedCallback=function(){this.startTimer()};t.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};t.prototype.onClickActive=function(t){if(t.detail===this.activeItem.description){return}var e;this.children.forEach((function(i){i.progress=0;if(i.description===t.detail){e=i.uuid}}));this.setActiveItem(e);this.startTimer();this.pauseTimer()};t.prototype.onMouseEnterActive=function(){this.pauseTimer()};t.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};t.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return c(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1 +1 @@
1
- System.register(["./p-e2fa938f.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(e){r=e.p;n=e.b}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-30c950ab.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)}))}}}));
1
+ System.register(["./p-e2fa938f.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(e){r=e.p;n=e.b}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-6bb3b141.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)}))}}}));
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,H as h,g as e}from"./p-d5616601.js";const n=class{constructor(s){t(this,s),this.itemActivated=i(this,"itemActivated",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timer=null,this.timeChecker=null},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.activeItem&&(this.activeItem.progress=t),1===t&&(this.activeItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.activeItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setActiveItem=t=>{this.children.forEach(((i,s)=>{s===t?(i.active=!0,this.activeItem=i,this.itemActivated.emit(t)):i.active=!1}))},this.startNext=()=>{this.setActiveItem(this.activeItem.uuid+1>this.children.length-1?0:this.activeItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.activeItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.activeItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals(),this.time=null},this.time=0,this.duration=1e4}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,i)=>{t.uuid=i,t.active&&(this.activeItem=t)}))}connectedCallback(){this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(t.detail===this.activeItem.description)return;let i;this.children.forEach((s=>{s.progress=0,s.description===t.detail&&(i=s.uuid)})),this.setActiveItem(i),this.startTimer(),this.pauseTimer()}onMouseEnterActive(){this.pauseTimer()}onMouseLeaveActive(){null===this.timeChecker&&this.playTimer()}render(){return s(h,null,s("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-11-18T09:21:53",
2
+ "timestamp": "2022-12-06T12:51:11",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -74,21 +74,21 @@
74
74
  "./dist/mds-accordion-timer/index.esm.js",
75
75
  "./dist/mds-accordion-timer/mds-accordion-timer.esm.js",
76
76
  "./dist/mds-accordion-timer/mds-accordion-timer.js",
77
- "./dist/mds-accordion-timer/p-30c950ab.system.entry.js",
78
77
  "./dist/mds-accordion-timer/p-50ea2036.system.js",
79
- "./dist/mds-accordion-timer/p-9784c024.entry.js",
80
- "./dist/mds-accordion-timer/p-a617eaf9.system.js",
78
+ "./dist/mds-accordion-timer/p-6bb3b141.system.entry.js",
79
+ "./dist/mds-accordion-timer/p-94dc5a3c.system.js",
81
80
  "./dist/mds-accordion-timer/p-d5616601.js",
82
81
  "./dist/mds-accordion-timer/p-e2fa938f.system.js",
82
+ "./dist/mds-accordion-timer/p-ff15a152.entry.js",
83
83
  "./www/build/index.esm.js",
84
84
  "./www/build/mds-accordion-timer.esm.js",
85
85
  "./www/build/mds-accordion-timer.js",
86
- "./www/build/p-30c950ab.system.entry.js",
87
86
  "./www/build/p-50ea2036.system.js",
88
- "./www/build/p-9784c024.entry.js",
89
- "./www/build/p-a617eaf9.system.js",
87
+ "./www/build/p-6bb3b141.system.entry.js",
88
+ "./www/build/p-94dc5a3c.system.js",
90
89
  "./www/build/p-d5616601.js",
91
- "./www/build/p-e2fa938f.system.js"
90
+ "./www/build/p-e2fa938f.system.js",
91
+ "./www/build/p-ff15a152.entry.js"
92
92
  ]
93
93
  },
94
94
  {
@@ -121,12 +121,12 @@
121
121
  "components": [
122
122
  "mds-accordion-timer"
123
123
  ],
124
- "bundleId": "p-9784c024",
125
- "fileName": "p-9784c024.entry.js",
124
+ "bundleId": "p-ff15a152",
125
+ "fileName": "p-ff15a152.entry.js",
126
126
  "imports": [
127
127
  "p-d5616601.js"
128
128
  ],
129
- "originalByteSize": 3502
129
+ "originalByteSize": 3432
130
130
  }
131
131
  ],
132
132
  "esm": [
@@ -140,7 +140,7 @@
140
140
  "imports": [
141
141
  "index-afb1c64b.js"
142
142
  ],
143
- "originalByteSize": 3506
143
+ "originalByteSize": 3436
144
144
  }
145
145
  ],
146
146
  "es5": [
@@ -154,7 +154,7 @@
154
154
  "imports": [
155
155
  "index-afb1c64b.js"
156
156
  ],
157
- "originalByteSize": 3506
157
+ "originalByteSize": 3436
158
158
  }
159
159
  ],
160
160
  "system": [
@@ -163,12 +163,12 @@
163
163
  "components": [
164
164
  "mds-accordion-timer"
165
165
  ],
166
- "bundleId": "p-30c950ab.system",
167
- "fileName": "p-30c950ab.system.entry.js",
166
+ "bundleId": "p-6bb3b141.system",
167
+ "fileName": "p-6bb3b141.system.entry.js",
168
168
  "imports": [
169
169
  "p-e2fa938f.system.js"
170
170
  ],
171
- "originalByteSize": 4466
171
+ "originalByteSize": 4378
172
172
  }
173
173
  ],
174
174
  "commonjs": [
@@ -182,7 +182,7 @@
182
182
  "imports": [
183
183
  "index-bd5d8a33.js"
184
184
  ],
185
- "originalByteSize": 3553
185
+ "originalByteSize": 3483
186
186
  }
187
187
  ]
188
188
  },
@@ -223,6 +223,7 @@ export declare const setMode: (handler: ResolutionHandler) => void;
223
223
  /**
224
224
  * `getMode()` is used for libraries which provide multiple "modes" for styles.
225
225
  * @param ref a reference to the node to get styles for
226
+ * @returns the current mode or undefined, if not found
226
227
  */
227
228
  export declare function getMode<T = string | undefined>(ref: any): T;
228
229
  export declare function setPlatformHelpers(helpers: {
@@ -237,6 +238,7 @@ export declare function setPlatformHelpers(helpers: {
237
238
  * if the path needs to be customized.
238
239
  * @param path the path to use in calculating the asset path. this value will be
239
240
  * used in conjunction with the base asset path
241
+ * @returns the base path
240
242
  */
241
243
  export declare function getAssetPath(path: string): string;
242
244
  /**
@@ -252,11 +254,13 @@ export declare function getAssetPath(path: string): string;
252
254
  * bundling, and where your assets can be loaded from. Additionally custom bundling
253
255
  * will have to ensure the static assets are copied to its build directory.
254
256
  * @param path the asset path to set
257
+ * @returns the set path
255
258
  */
256
259
  export declare function setAssetPath(path: string): string;
257
260
  /**
258
261
  * Retrieve a Stencil element for a given reference
259
262
  * @param ref the ref to get the Stencil element for
263
+ * @returns a reference to the element
260
264
  */
261
265
  export declare function getElement(ref: any): HTMLStencilElement;
262
266
  /**
@@ -269,6 +273,7 @@ export declare function getElement(ref: any): HTMLStencilElement;
269
273
  export declare function forceUpdate(ref: any): void;
270
274
  /**
271
275
  * getRenderingRef
276
+ * @returns the rendering ref
272
277
  */
273
278
  export declare function getRenderingRef(): any;
274
279
  export interface HTMLStencilElement extends HTMLElement {
@@ -1,8 +1,8 @@
1
- export declare type TypographyType = 'action' | 'caption' | 'code' | 'detail' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hack' | 'label' | 'option' | 'paragraph' | 'tip';
2
- export declare type TypographyVariants = 'title' | 'info' | 'read' | 'mono';
1
+ export declare type TypographyType = 'action' | 'caption' | 'snippet' | 'detail' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hack' | 'label' | 'option' | 'paragraph' | 'tip';
2
+ export declare type TypographyVariants = 'title' | 'info' | 'read' | 'code';
3
3
  export declare type TypographyTitleType = 'action' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
4
  export declare type TypographyInfoType = 'caption' | 'detail' | 'label' | 'option' | 'paragraph' | 'tip';
5
5
  export declare type TypographyReadType = 'caption' | 'detail' | 'paragraph';
6
6
  export declare type TypographySmallerType = 'tip' | 'option';
7
- export declare type TypographyMonoType = 'code' | 'hack';
7
+ export declare type TypographyMonoType = 'snippet' | 'hack';
8
8
  export declare type TypographyTooltipType = 'caption' | 'detail' | 'tip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-accordion-timer",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "mds-accordion-timer is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -23,9 +23,9 @@
23
23
  "test": "stencil test --spec --e2e"
24
24
  },
25
25
  "dependencies": {
26
- "@maggioli-design-system/mds-accordion-timer-item": "^2.1.0",
27
- "@maggioli-design-system/styles": "^9.0.0",
28
- "@stencil/core": "^2.18.1"
26
+ "@maggioli-design-system/mds-accordion-timer-item": "^2.1.1",
27
+ "@maggioli-design-system/styles": "^10.0.0",
28
+ "@stencil/core": "^2.19.3"
29
29
  },
30
30
  "license": "MIT",
31
31
  "author": {
@@ -1,7 +1,7 @@
1
1
  const typographyDictionary = [
2
2
  'action',
3
3
  'caption',
4
- 'code',
4
+ 'snippet',
5
5
  'detail',
6
6
  'h1',
7
7
  'h2',
@@ -20,11 +20,11 @@ const typographyVariationsDictionary = [
20
20
  'title',
21
21
  'info',
22
22
  'read',
23
- 'mono',
23
+ 'code',
24
24
  ]
25
25
 
26
26
  const typographyMonoDictionary = [
27
- 'code',
27
+ 'snippet',
28
28
  'hack',
29
29
  ]
30
30
 
@@ -18,17 +18,17 @@
18
18
  "mi/baseline/badge",
19
19
  "mi/baseline/book",
20
20
  "mi/baseline/border-all",
21
+ "mi/baseline/cancel",
21
22
  "mi/baseline/check-box",
22
23
  "mi/baseline/check-box-outline-blank",
23
24
  "mi/baseline/check-circle",
24
- "mi/baseline/check-circle-outline",
25
25
  "mi/baseline/close",
26
26
  "mi/baseline/css",
27
27
  "mi/baseline/description",
28
28
  "mi/baseline/done",
29
29
  "mi/baseline/eco",
30
30
  "mi/baseline/email",
31
- "mi/baseline/error-outline",
31
+ "mi/baseline/error",
32
32
  "mi/baseline/explore",
33
33
  "mi/baseline/folder-zip",
34
34
  "mi/baseline/groups",
@@ -1,7 +1,7 @@
1
1
  export type TypographyType =
2
2
  | 'action'
3
3
  | 'caption'
4
- | 'code'
4
+ | 'snippet'
5
5
  | 'detail'
6
6
  | 'h1'
7
7
  | 'h2'
@@ -19,7 +19,7 @@ export type TypographyVariants =
19
19
  | 'title'
20
20
  | 'info'
21
21
  | 'read'
22
- | 'mono'
22
+ | 'code'
23
23
 
24
24
  export type TypographyTitleType =
25
25
  | 'action'
@@ -48,7 +48,7 @@ export type TypographySmallerType =
48
48
  | 'option'
49
49
 
50
50
  export type TypographyMonoType =
51
- | 'code'
51
+ | 'snippet'
52
52
  | 'hack'
53
53
 
54
54
  export type TypographyTooltipType =
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-d5616601.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-9784c024",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)));
1
+ import{p as e,b as t}from"./p-d5616601.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-ff15a152",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-a617eaf9.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-94dc5a3c.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
@@ -0,0 +1 @@
1
+ System.register(["./p-e2fa938f.system.js"],(function(t){"use strict";var e,i,n,r,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;c=t.g}],execute:function(){var a=":host{display:block}";var s=t("mds_accordion_timer",function(){function t(t){var n=this;e(this,t);this.itemActivated=i(this,"itemActivated",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timer=null;n.timeChecker=null};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var t=n.progress();if(n.activeItem!==undefined){n.activeItem.progress=t}if(t===1){n.activeItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var t=n.activeItemDurationTime-((new Date).getTime()-n.timeStarted);return t>=0?t:0};this.setActiveItem=function(t){n.children.forEach((function(e,i){if(i===t){e.active=true;n.activeItem=e;n.itemActivated.emit(t)}else{e.active=false}}))};this.startNext=function(){var t=n.activeItem.uuid+1>n.children.length-1?0:n.activeItem.uuid+1;n.setActiveItem(t);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.activeItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.activeItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.time=null};this.time=0;this.duration=1e4}t.prototype.componentDidLoad=function(){var t=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(e,i){e.uuid=i;if(e.active){t.activeItem=e}}))};t.prototype.connectedCallback=function(){this.startTimer()};t.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};t.prototype.onClickActive=function(t){if(t.detail===this.activeItem.description){return}var e;this.children.forEach((function(i){i.progress=0;if(i.description===t.detail){e=i.uuid}}));this.setActiveItem(e);this.startTimer();this.pauseTimer()};t.prototype.onMouseEnterActive=function(){this.pauseTimer()};t.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};t.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return c(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1 +1 @@
1
- System.register(["./p-e2fa938f.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(e){r=e.p;n=e.b}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-30c950ab.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)}))}}}));
1
+ System.register(["./p-e2fa938f.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(e){r=e.p;n=e.b}],execute:function(){var e=function(){var e=t.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return r(n)};e().then((function(e){return n([["p-6bb3b141.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"clickActive","onClickActive"],[0,"mouseEnterActive","onMouseEnterActive"],[0,"mouseLeaveActive","onMouseLeaveActive"]]]]]],e)}))}}}));
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,H as h,g as e}from"./p-d5616601.js";const n=class{constructor(s){t(this,s),this.itemActivated=i(this,"itemActivated",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timer=null,this.timeChecker=null},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.activeItem&&(this.activeItem.progress=t),1===t&&(this.activeItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.activeItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setActiveItem=t=>{this.children.forEach(((i,s)=>{s===t?(i.active=!0,this.activeItem=i,this.itemActivated.emit(t)):i.active=!1}))},this.startNext=()=>{this.setActiveItem(this.activeItem.uuid+1>this.children.length-1?0:this.activeItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.activeItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.activeItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals(),this.time=null},this.time=0,this.duration=1e4}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,i)=>{t.uuid=i,t.active&&(this.activeItem=t)}))}connectedCallback(){this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(t.detail===this.activeItem.description)return;let i;this.children.forEach((s=>{s.progress=0,s.description===t.detail&&(i=s.uuid)})),this.setActiveItem(i),this.startTimer(),this.pauseTimer()}onMouseEnterActive(){this.pauseTimer()}onMouseLeaveActive(){null===this.timeChecker&&this.playTimer()}render(){return s(h,null,s("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}
@@ -1 +0,0 @@
1
- System.register(["./p-e2fa938f.system.js"],(function(t){"use strict";var e,i,n,r,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;c=t.g}],execute:function(){var a=":host{display:block}";var s=t("mds_accordion_timer",function(){function t(t){var n=this;e(this,t);this.itemActivated=i(this,"itemActivated",7);this.time=0;this.duration=1e4;this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timer=null;n.timeChecker=null};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var t=n.progress();if(n.activeItem!==undefined){n.activeItem.progress=t}if(t===1){n.activeItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var t=n.activeItemDurationTime-((new Date).getTime()-n.timeStarted);return t>=0?t:0};this.setActiveItem=function(t){n.children.forEach((function(e,i){if(i===t){e.active=true;n.activeItem=e;n.itemActivated.emit(t)}else{e.active=false}}))};this.startNext=function(){var t=n.activeItem.uuid+1>n.children.length-1?0:n.activeItem.uuid+1;n.setActiveItem(t);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.activeItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.activeItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.time=null}}t.prototype.componentDidLoad=function(){var t=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(e,i){e.uuid=i;if(e.active){t.activeItem=e}}))};t.prototype.connectedCallback=function(){this.startTimer()};t.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};t.prototype.onClickActive=function(t){if(t.detail===this.activeItem.description){return}var e;this.children.forEach((function(i){i.progress=0;if(i.description===t.detail){e=i.uuid}}));this.setActiveItem(e);this.startTimer();this.pauseTimer()};t.prototype.onMouseEnterActive=function(){this.pauseTimer()};t.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};t.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return c(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as h,g as e}from"./p-d5616601.js";const n=class{constructor(s){t(this,s),this.itemActivated=i(this,"itemActivated",7),this.time=0,this.duration=1e4,this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timer=null,this.timeChecker=null},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.activeItem&&(this.activeItem.progress=t),1===t&&(this.activeItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.activeItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setActiveItem=t=>{this.children.forEach(((i,s)=>{s===t?(i.active=!0,this.activeItem=i,this.itemActivated.emit(t)):i.active=!1}))},this.startNext=()=>{this.setActiveItem(this.activeItem.uuid+1>this.children.length-1?0:this.activeItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.activeItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.activeItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals(),this.time=null}}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,i)=>{t.uuid=i,t.active&&(this.activeItem=t)}))}connectedCallback(){this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(t.detail===this.activeItem.description)return;let i;this.children.forEach((s=>{s.progress=0,s.description===t.detail&&(i=s.uuid)})),this.setActiveItem(i),this.startTimer(),this.pauseTimer()}onMouseEnterActive(){this.pauseTimer()}onMouseLeaveActive(){null===this.timeChecker&&this.playTimer()}render(){return s(h,null,s("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}
@@ -1 +0,0 @@
1
- System.register(["./p-e2fa938f.system.js"],(function(t){"use strict";var e,i,n,r,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;c=t.g}],execute:function(){var a=":host{display:block}";var s=t("mds_accordion_timer",function(){function t(t){var n=this;e(this,t);this.itemActivated=i(this,"itemActivated",7);this.time=0;this.duration=1e4;this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timer=null;n.timeChecker=null};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var t=n.progress();if(n.activeItem!==undefined){n.activeItem.progress=t}if(t===1){n.activeItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var t=n.activeItemDurationTime-((new Date).getTime()-n.timeStarted);return t>=0?t:0};this.setActiveItem=function(t){n.children.forEach((function(e,i){if(i===t){e.active=true;n.activeItem=e;n.itemActivated.emit(t)}else{e.active=false}}))};this.startNext=function(){var t=n.activeItem.uuid+1>n.children.length-1?0:n.activeItem.uuid+1;n.setActiveItem(t);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.activeItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.activeItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.time=null}}t.prototype.componentDidLoad=function(){var t=this;this.children=this.element.querySelectorAll("mds-accordion-timer-item");this.children.forEach((function(e,i){e.uuid=i;if(e.active){t.activeItem=e}}))};t.prototype.connectedCallback=function(){this.startTimer()};t.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};t.prototype.onClickActive=function(t){if(t.detail===this.activeItem.description){return}var e;this.children.forEach((function(i){i.progress=0;if(i.description===t.detail){e=i.uuid}}));this.setActiveItem(e);this.startTimer();this.pauseTimer()};t.prototype.onMouseEnterActive=function(){this.pauseTimer()};t.prototype.onMouseLeaveActive=function(){if(this.timeChecker===null){this.playTimer()}};t.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return c(this)},enumerable:false,configurable:true});return t}());s.style=a}}}));
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as h,g as e}from"./p-d5616601.js";const n=class{constructor(s){t(this,s),this.itemActivated=i(this,"itemActivated",7),this.time=0,this.duration=1e4,this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timer=null,this.timeChecker=null},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.activeItem&&(this.activeItem.progress=t),1===t&&(this.activeItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.activeItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setActiveItem=t=>{this.children.forEach(((i,s)=>{s===t?(i.active=!0,this.activeItem=i,this.itemActivated.emit(t)):i.active=!1}))},this.startNext=()=>{this.setActiveItem(this.activeItem.uuid+1>this.children.length-1?0:this.activeItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.activeItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.activeItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals(),this.time=null}}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,i)=>{t.uuid=i,t.active&&(this.activeItem=t)}))}connectedCallback(){this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(t.detail===this.activeItem.description)return;let i;this.children.forEach((s=>{s.progress=0,s.description===t.detail&&(i=s.uuid)})),this.setActiveItem(i),this.startTimer(),this.pauseTimer()}onMouseEnterActive(){this.pauseTimer()}onMouseLeaveActive(){null===this.timeChecker&&this.playTimer()}render(){return s(h,null,s("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}