@maggioli-design-system/mds-accordion-timer
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -47,3 +47,3 @@ 'use strict'; | ||
this.selectedItem = item; | ||
this.changeEvent.emit(uuid); | ||
this.changeEvent.emit(); | ||
} | ||
@@ -50,0 +50,0 @@ else { |
@@ -38,3 +38,3 @@ import { Host, h } from '@stencil/core'; | ||
this.selectedItem = item; | ||
this.changeEvent.emit(uuid); | ||
this.changeEvent.emit(); | ||
} | ||
@@ -165,4 +165,4 @@ else { | ||
"complexType": { | ||
"original": "number", | ||
"resolved": "number", | ||
"original": "void", | ||
"resolved": "void", | ||
"references": {} | ||
@@ -169,0 +169,0 @@ } |
@@ -45,3 +45,3 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client'; | ||
this.selectedItem = item; | ||
this.changeEvent.emit(uuid); | ||
this.changeEvent.emit(); | ||
} | ||
@@ -48,0 +48,0 @@ else { |
@@ -1,1 +0,1 @@ | ||
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bd689d6a.js";var mdsAccordionTimerCss=":host{display:block}";var MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.changeEvent=createEvent(this,"mdsAccordionTimerChange",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.selectedItem!==undefined){t.selectedItem.progress=e}if(e===1){t.selectedItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.selectedItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){t.children.forEach((function(i,n){if(n===e){i.selected=true;t.selectedItem=i;t.changeEvent.emit(e)}else{i.selected=false}}))};this.startNext=function(){var e=t.selectedItem.uuid+1>t.children.length-1?0:t.selectedItem.uuid+1;t.setSelectedItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.selectedItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.selectedItemDurationTime=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.selected){e.selectedItem=t}}));if(this.selectedItem!==undefined){this.startTimer()}};e.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};e.prototype.onClickActive=function(e){if(this.selectedItem&&e.detail===this.selectedItem.description){return}var t;this.children.forEach((function(i){i.progress=0;if(i.description===e.detail){t=i.uuid}}));this.setSelectedItem(t);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=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}; | ||
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bd689d6a.js";var mdsAccordionTimerCss=":host{display:block}";var MdsAccordionTimer=function(){function e(e){var t=this;registerInstance(this,e);this.changeEvent=createEvent(this,"mdsAccordionTimerChange",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.selectedItem!==undefined){t.selectedItem.progress=e}if(e===1){t.selectedItem.progress=0;t.startNext()}}),100)};this.beginningTime=function(){t.timeStarted=(new Date).getTime();return t.timeStarted};this.remainingTime=function(){var e=t.selectedItemDurationTime-((new Date).getTime()-t.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){t.children.forEach((function(i,n){if(n===e){i.selected=true;t.selectedItem=i;t.changeEvent.emit()}else{i.selected=false}}))};this.startNext=function(){var e=t.selectedItem.uuid+1>t.children.length-1?0:t.selectedItem.uuid+1;t.setSelectedItem(e);t.startTimer()};this.startTimer=function(){t.clearIntervals();t.time=t.beginningTime();t.selectedItemDurationTime=t.duration;t.addTimeListener()};this.playTimer=function(){t.beginningTime();t.addTimeListener()};this.pauseTimer=function(){t.clearIntervals();t.selectedItemDurationTime=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.selected){e.selectedItem=t}}));if(this.selectedItem!==undefined){this.startTimer()}};e.prototype.disconnectedCallback=function(){this.stopTimer();this.clearIntervals()};e.prototype.onClickActive=function(e){if(this.selectedItem&&e.detail===this.selectedItem.description){return}var t;this.children.forEach((function(i){i.progress=0;if(i.description===e.detail){t=i.uuid}}));this.setSelectedItem(t);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=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}; |
@@ -43,3 +43,3 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-bd689d6a.js'; | ||
this.selectedItem = item; | ||
this.changeEvent.emit(uuid); | ||
this.changeEvent.emit(); | ||
} | ||
@@ -46,0 +46,0 @@ else { |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-aae0027a",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e))); | ||
import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8d875f1d",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e))); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],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-7df47654.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}})); | ||
System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],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-2bfbd758.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}})); |
{ | ||
"timestamp": "2023-03-09T10:43:18", | ||
"timestamp": "2023-03-14T14:54:29", | ||
"compiler": { | ||
@@ -78,17 +78,17 @@ "name": "node", | ||
"./dist/mds-accordion-timer/mds-accordion-timer.js", | ||
"./dist/mds-accordion-timer/p-2bfbd758.system.entry.js", | ||
"./dist/mds-accordion-timer/p-4620ac30.system.js", | ||
"./dist/mds-accordion-timer/p-5029b85d.system.js", | ||
"./dist/mds-accordion-timer/p-50ea2036.system.js", | ||
"./dist/mds-accordion-timer/p-7df47654.system.entry.js", | ||
"./dist/mds-accordion-timer/p-8d875f1d.entry.js", | ||
"./dist/mds-accordion-timer/p-a7b74010.js", | ||
"./dist/mds-accordion-timer/p-aae0027a.entry.js", | ||
"./www/build/index.esm.js", | ||
"./www/build/mds-accordion-timer.esm.js", | ||
"./www/build/mds-accordion-timer.js", | ||
"./www/build/p-2bfbd758.system.entry.js", | ||
"./www/build/p-4620ac30.system.js", | ||
"./www/build/p-5029b85d.system.js", | ||
"./www/build/p-50ea2036.system.js", | ||
"./www/build/p-7df47654.system.entry.js", | ||
"./www/build/p-a7b74010.js", | ||
"./www/build/p-aae0027a.entry.js" | ||
"./www/build/p-8d875f1d.entry.js", | ||
"./www/build/p-a7b74010.js" | ||
] | ||
@@ -126,8 +126,8 @@ }, | ||
], | ||
"bundleId": "p-aae0027a", | ||
"fileName": "p-aae0027a.entry.js", | ||
"bundleId": "p-8d875f1d", | ||
"fileName": "p-8d875f1d.entry.js", | ||
"imports": [ | ||
"p-a7b74010.js" | ||
], | ||
"originalByteSize": 3516 | ||
"originalByteSize": 3512 | ||
} | ||
@@ -146,3 +146,3 @@ ], | ||
], | ||
"originalByteSize": 3520 | ||
"originalByteSize": 3516 | ||
} | ||
@@ -161,3 +161,3 @@ ], | ||
], | ||
"originalByteSize": 3520 | ||
"originalByteSize": 3516 | ||
} | ||
@@ -171,8 +171,8 @@ ], | ||
], | ||
"bundleId": "p-7df47654.system", | ||
"fileName": "p-7df47654.system.entry.js", | ||
"bundleId": "p-2bfbd758.system", | ||
"fileName": "p-2bfbd758.system.entry.js", | ||
"imports": [ | ||
"p-5029b85d.system.js" | ||
], | ||
"originalByteSize": 4462 | ||
"originalByteSize": 4458 | ||
} | ||
@@ -191,3 +191,3 @@ ], | ||
], | ||
"originalByteSize": 3567 | ||
"originalByteSize": 3563 | ||
} | ||
@@ -226,4 +226,4 @@ ] | ||
"complexType": { | ||
"original": "number", | ||
"resolved": "number", | ||
"original": "void", | ||
"resolved": "void", | ||
"references": {} | ||
@@ -361,4 +361,4 @@ }, | ||
"complexType": { | ||
"original": "number", | ||
"resolved": "number", | ||
"original": "void", | ||
"resolved": "void", | ||
"references": {} | ||
@@ -365,0 +365,0 @@ }, |
@@ -40,3 +40,3 @@ /* eslint-disable */ | ||
*/ | ||
"onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<number>) => void; | ||
"onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<void>) => void; | ||
} | ||
@@ -43,0 +43,0 @@ interface IntrinsicElements { |
@@ -18,3 +18,3 @@ import { EventEmitter } from '../../stencil-public-runtime'; | ||
*/ | ||
changeEvent: EventEmitter<number>; | ||
changeEvent: EventEmitter<void>; | ||
componentDidLoad(): void; | ||
@@ -21,0 +21,0 @@ private clearIntervals; |
{ | ||
"name": "@maggioli-design-system/mds-accordion-timer", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"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.", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"@maggioli-design-system/mds-accordion-timer-item": "^3.0.1", | ||
"@maggioli-design-system/mds-accordion-timer-item": "^3.1.0", | ||
"@maggioli-design-system/styles": "^11.2.1", | ||
@@ -29,0 +29,0 @@ "@stencil/core": "^2.22.2" |
@@ -17,5 +17,5 @@ # mds-accordion-timer | ||
| Event | Description | Type | | ||
| ------------------------- | ------------------------------------------ | --------------------- | | ||
| `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<number>` | | ||
| Event | Description | Type | | ||
| ------------------------- | ------------------------------------------ | ------------------- | | ||
| `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` | | ||
@@ -22,0 +22,0 @@ |
@@ -40,3 +40,3 @@ /* eslint-disable */ | ||
*/ | ||
"onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<number>) => void; | ||
"onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<void>) => void; | ||
} | ||
@@ -43,0 +43,0 @@ interface IntrinsicElements { |
@@ -17,5 +17,5 @@ # mds-accordion-timer | ||
| Event | Description | Type | | ||
| ------------------------- | ------------------------------------------ | --------------------- | | ||
| `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<number>` | | ||
| Event | Description | Type | | ||
| ------------------------- | ------------------------------------------ | ------------------- | | ||
| `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` | | ||
@@ -22,0 +22,0 @@ |
@@ -1,1 +0,1 @@ | ||
import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-aae0027a",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e))); | ||
import{p as e,b as o}from"./p-a7b74010.js";export{s as setNonce}from"./p-a7b74010.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-8d875f1d",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e))); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],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-7df47654.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}})); | ||
System.register(["./p-5029b85d.system.js"],(function(e,t){"use strict";var r,n;return{setters:[function(t){r=t.p;n=t.b;e("setNonce",t.s)}],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-2bfbd758.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}})); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718889