@maggioli-design-system/mds-accordion-timer 3.1.0 → 3.2.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 (42) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mds-accordion-timer.cjs.entry.js +6 -15
  3. package/dist/cjs/mds-accordion-timer.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +1 -1
  5. package/dist/collection/common/aria.js +4 -2
  6. package/dist/collection/common/keyboard-manager.js +1 -1
  7. package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +9 -18
  8. package/dist/components/mds-accordion-timer.js +6 -15
  9. package/dist/documentation.d.ts +148 -0
  10. package/dist/documentation.json +72 -0
  11. package/dist/esm/loader.js +1 -1
  12. package/dist/esm/mds-accordion-timer.entry.js +6 -15
  13. package/dist/esm/mds-accordion-timer.js +1 -1
  14. package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
  15. package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
  16. package/dist/mds-accordion-timer/mds-accordion-timer.js +1 -1
  17. package/dist/mds-accordion-timer/p-1442acbc.entry.js +1 -0
  18. package/dist/mds-accordion-timer/p-53e5fa07.system.entry.js +1 -0
  19. package/dist/mds-accordion-timer/{p-4620ac30.system.js → p-5e09eed0.system.js} +1 -1
  20. package/dist/stats.json +23 -23
  21. package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +4 -3
  22. package/dist/types/components.d.ts +2 -2
  23. package/dist/types/interface/input-value.d.ts +1 -1
  24. package/documentation.json +73 -0
  25. package/package.json +11 -5
  26. package/readme.md +3 -3
  27. package/src/common/aria.ts +2 -2
  28. package/src/common/keyboard-manager.ts +1 -1
  29. package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +10 -18
  30. package/src/components/mds-accordion-timer/readme.md +3 -3
  31. package/src/components.d.ts +2 -2
  32. package/src/fixtures/icons.json +1 -0
  33. package/src/interface/input-value.ts +1 -1
  34. package/www/build/mds-accordion-timer.esm.js +1 -1
  35. package/www/build/mds-accordion-timer.js +1 -1
  36. package/www/build/p-1442acbc.entry.js +1 -0
  37. package/www/build/p-53e5fa07.system.entry.js +1 -0
  38. package/www/build/{p-4620ac30.system.js → p-5e09eed0.system.js} +1 -1
  39. package/dist/mds-accordion-timer/p-7df47654.system.entry.js +0 -1
  40. package/dist/mds-accordion-timer/p-aae0027a.entry.js +0 -1
  41. package/www/build/p-7df47654.system.entry.js +0 -1
  42. package/www/build/p-aae0027a.entry.js +0 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-b99075ba.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -13,8 +13,7 @@ const MdsAccordionTimer = class {
13
13
  this.clearIntervals = () => {
14
14
  window.clearInterval(this.timer);
15
15
  window.clearInterval(this.timeChecker);
16
- this.timer = null;
17
- this.timeChecker = null;
16
+ this.timeChecker = 0;
18
17
  };
19
18
  this.progress = () => {
20
19
  return Math.abs(this.remainingTime() / this.duration - 1);
@@ -44,7 +43,7 @@ const MdsAccordionTimer = class {
44
43
  if (key === uuid) {
45
44
  item.selected = true;
46
45
  this.selectedItem = item;
47
- this.changeEvent.emit(uuid);
46
+ this.changeEvent.emit();
48
47
  }
49
48
  else {
50
49
  item.selected = false;
@@ -72,7 +71,6 @@ const MdsAccordionTimer = class {
72
71
  };
73
72
  this.stopTimer = () => {
74
73
  this.clearIntervals();
75
- this.time = null;
76
74
  };
77
75
  this.time = 0;
78
76
  this.duration = 10000;
@@ -94,17 +92,10 @@ const MdsAccordionTimer = class {
94
92
  this.clearIntervals();
95
93
  }
96
94
  onClickActive(event) {
97
- if (this.selectedItem && event.detail === this.selectedItem.description) {
98
- return;
95
+ if (this.selectedItem) {
96
+ this.selectedItem.progress = 0;
99
97
  }
100
- let selectedUuid;
101
- this.children.forEach(item => {
102
- item.progress = 0;
103
- if (item.description === event.detail) {
104
- selectedUuid = item.uuid;
105
- }
106
- });
107
- this.setSelectedItem(selectedUuid);
98
+ this.setSelectedItem(event.detail.uuid);
108
99
  this.startTimer();
109
100
  this.pauseTimer();
110
101
  }
@@ -112,7 +103,7 @@ const MdsAccordionTimer = class {
112
103
  this.pauseTimer();
113
104
  }
114
105
  onMouseLeaveSelect() {
115
- if (this.timeChecker === null) {
106
+ if (this.timeChecker === 0) {
116
107
  this.playTimer();
117
108
  }
118
109
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-b99075ba.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  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.22.2",
7
+ "version": "2.22.3",
8
8
  "typescriptVersion": "4.9.4"
9
9
  },
10
10
  "collections": [],
@@ -6,11 +6,13 @@ const hash = (s) => {
6
6
  return h.toString();
7
7
  };
8
8
  const unslugName = (name) => {
9
- return name.split('/').slice(-1).pop().replace(/-/g, ' ');
9
+ var _a, _b, _c;
10
+ return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
10
11
  };
11
12
  const setAttributeIfEmpty = (element, attribute, value) => {
13
+ var _a;
12
14
  if (element.hasAttribute(attribute)) {
13
- return element.getAttribute(attribute);
15
+ return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
14
16
  }
15
17
  element.setAttribute(attribute, value);
16
18
  return value;
@@ -31,7 +31,7 @@ export class KeyboardManager {
31
31
  }
32
32
  };
33
33
  this.detachEscapeBehavior = () => {
34
- this.escapeCallback = null;
34
+ this.escapeCallback = () => { return; };
35
35
  if (typeof window !== undefined) {
36
36
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
37
  }
@@ -4,8 +4,7 @@ export class MdsAccordionTimer {
4
4
  this.clearIntervals = () => {
5
5
  window.clearInterval(this.timer);
6
6
  window.clearInterval(this.timeChecker);
7
- this.timer = null;
8
- this.timeChecker = null;
7
+ this.timeChecker = 0;
9
8
  };
10
9
  this.progress = () => {
11
10
  return Math.abs(this.remainingTime() / this.duration - 1);
@@ -35,7 +34,7 @@ export class MdsAccordionTimer {
35
34
  if (key === uuid) {
36
35
  item.selected = true;
37
36
  this.selectedItem = item;
38
- this.changeEvent.emit(uuid);
37
+ this.changeEvent.emit();
39
38
  }
40
39
  else {
41
40
  item.selected = false;
@@ -63,7 +62,6 @@ export class MdsAccordionTimer {
63
62
  };
64
63
  this.stopTimer = () => {
65
64
  this.clearIntervals();
66
- this.time = null;
67
65
  };
68
66
  this.time = 0;
69
67
  this.duration = 10000;
@@ -85,17 +83,10 @@ export class MdsAccordionTimer {
85
83
  this.clearIntervals();
86
84
  }
87
85
  onClickActive(event) {
88
- if (this.selectedItem && event.detail === this.selectedItem.description) {
89
- return;
86
+ if (this.selectedItem) {
87
+ this.selectedItem.progress = 0;
90
88
  }
91
- let selectedUuid;
92
- this.children.forEach(item => {
93
- item.progress = 0;
94
- if (item.description === event.detail) {
95
- selectedUuid = item.uuid;
96
- }
97
- });
98
- this.setSelectedItem(selectedUuid);
89
+ this.setSelectedItem(event.detail.uuid);
99
90
  this.startTimer();
100
91
  this.pauseTimer();
101
92
  }
@@ -103,7 +94,7 @@ export class MdsAccordionTimer {
103
94
  this.pauseTimer();
104
95
  }
105
96
  onMouseLeaveSelect() {
106
- if (this.timeChecker === null) {
97
+ if (this.timeChecker === 0) {
107
98
  this.playTimer();
108
99
  }
109
100
  }
@@ -133,7 +124,7 @@ export class MdsAccordionTimer {
133
124
  "references": {}
134
125
  },
135
126
  "required": false,
136
- "optional": true,
127
+ "optional": false,
137
128
  "docs": {
138
129
  "tags": [],
139
130
  "text": "Sets the duration of the single accordion item"
@@ -161,8 +152,8 @@ export class MdsAccordionTimer {
161
152
  "text": "Emits when the accordion changes it's item"
162
153
  },
163
154
  "complexType": {
164
- "original": "number",
165
- "resolved": "number",
155
+ "original": "void",
156
+ "resolved": "void",
166
157
  "references": {}
167
158
  }
168
159
  }];
@@ -11,8 +11,7 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
11
11
  this.clearIntervals = () => {
12
12
  window.clearInterval(this.timer);
13
13
  window.clearInterval(this.timeChecker);
14
- this.timer = null;
15
- this.timeChecker = null;
14
+ this.timeChecker = 0;
16
15
  };
17
16
  this.progress = () => {
18
17
  return Math.abs(this.remainingTime() / this.duration - 1);
@@ -42,7 +41,7 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
42
41
  if (key === uuid) {
43
42
  item.selected = true;
44
43
  this.selectedItem = item;
45
- this.changeEvent.emit(uuid);
44
+ this.changeEvent.emit();
46
45
  }
47
46
  else {
48
47
  item.selected = false;
@@ -70,7 +69,6 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
70
69
  };
71
70
  this.stopTimer = () => {
72
71
  this.clearIntervals();
73
- this.time = null;
74
72
  };
75
73
  this.time = 0;
76
74
  this.duration = 10000;
@@ -92,17 +90,10 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
92
90
  this.clearIntervals();
93
91
  }
94
92
  onClickActive(event) {
95
- if (this.selectedItem && event.detail === this.selectedItem.description) {
96
- return;
93
+ if (this.selectedItem) {
94
+ this.selectedItem.progress = 0;
97
95
  }
98
- let selectedUuid;
99
- this.children.forEach(item => {
100
- item.progress = 0;
101
- if (item.description === event.detail) {
102
- selectedUuid = item.uuid;
103
- }
104
- });
105
- this.setSelectedItem(selectedUuid);
96
+ this.setSelectedItem(event.detail.uuid);
106
97
  this.startTimer();
107
98
  this.pauseTimer();
108
99
  }
@@ -110,7 +101,7 @@ const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
110
101
  this.pauseTimer();
111
102
  }
112
103
  onMouseLeaveSelect() {
113
- if (this.timeChecker === null) {
104
+ if (this.timeChecker === 0) {
114
105
  this.playTimer();
115
106
  }
116
107
  }
@@ -0,0 +1,148 @@
1
+
2
+ /**
3
+ * This is an autogenerated file created by the Stencil compiler.
4
+ * DO NOT MODIFY IT MANUALLY
5
+ */
6
+ export interface JsonDocs {
7
+ components: JsonDocsComponent[];
8
+ timestamp: string;
9
+ compiler: {
10
+ name: string;
11
+ version: string;
12
+ typescriptVersion: string;
13
+ };
14
+ }
15
+ export interface JsonDocsComponent {
16
+ dirPath?: string;
17
+ fileName?: string;
18
+ filePath?: string;
19
+ readmePath?: string;
20
+ usagesDir?: string;
21
+ encapsulation: 'shadow' | 'scoped' | 'none';
22
+ tag: string;
23
+ readme: string;
24
+ docs: string;
25
+ docsTags: JsonDocsTag[];
26
+ /**
27
+ * The text from the class-level JSDoc for a Stencil component, if present.
28
+ */
29
+ overview?: string;
30
+ usage: JsonDocsUsage;
31
+ props: JsonDocsProp[];
32
+ methods: JsonDocsMethod[];
33
+ events: JsonDocsEvent[];
34
+ listeners: JsonDocsListener[];
35
+ styles: JsonDocsStyle[];
36
+ slots: JsonDocsSlot[];
37
+ parts: JsonDocsPart[];
38
+ dependents: string[];
39
+ dependencies: string[];
40
+ dependencyGraph: JsonDocsDependencyGraph;
41
+ deprecation?: string;
42
+ }
43
+ export interface JsonDocsDependencyGraph {
44
+ [tagName: string]: string[];
45
+ }
46
+ export interface JsonDocsTag {
47
+ name: string;
48
+ text?: string;
49
+ }
50
+ export interface JsonDocsValue {
51
+ value?: string;
52
+ type: string;
53
+ }
54
+ /**
55
+ * A mapping of file names to their contents.
56
+ *
57
+ * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
58
+ * given directory structure:
59
+ * ```
60
+ * src/components/my-component
61
+ * ├── my-component.tsx
62
+ * └── usage
63
+ * ├── bar.md
64
+ * └── foo.md
65
+ * ```
66
+ * an instance of this type would include the name of the markdown file, mapped to its contents:
67
+ * ```ts
68
+ * {
69
+ * 'bar': STRING_CONTENTS_OF_BAR.MD
70
+ * 'foo': STRING_CONTENTS_OF_FOO.MD
71
+ * }
72
+ * ```
73
+ */
74
+ export interface JsonDocsUsage {
75
+ [key: string]: string;
76
+ }
77
+ export interface JsonDocsProp {
78
+ name: string;
79
+ type: string;
80
+ mutable: boolean;
81
+ /**
82
+ * The name of the attribute that is exposed to configure a compiled web component
83
+ */
84
+ attr?: string;
85
+ reflectToAttr: boolean;
86
+ docs: string;
87
+ docsTags: JsonDocsTag[];
88
+ default: string;
89
+ deprecation?: string;
90
+ values: JsonDocsValue[];
91
+ optional: boolean;
92
+ required: boolean;
93
+ }
94
+ export interface JsonDocsMethod {
95
+ name: string;
96
+ docs: string;
97
+ docsTags: JsonDocsTag[];
98
+ deprecation?: string;
99
+ signature: string;
100
+ returns: JsonDocsMethodReturn;
101
+ parameters: JsonDocMethodParameter[];
102
+ }
103
+ export interface JsonDocsMethodReturn {
104
+ type: string;
105
+ docs: string;
106
+ }
107
+ export interface JsonDocMethodParameter {
108
+ name: string;
109
+ type: string;
110
+ docs: string;
111
+ }
112
+ export interface JsonDocsEvent {
113
+ event: string;
114
+ bubbles: boolean;
115
+ cancelable: boolean;
116
+ composed: boolean;
117
+ docs: string;
118
+ docsTags: JsonDocsTag[];
119
+ deprecation?: string;
120
+ detail: string;
121
+ }
122
+ export interface JsonDocsStyle {
123
+ name: string;
124
+ docs: string;
125
+ annotation: string;
126
+ }
127
+ export interface JsonDocsListener {
128
+ event: string;
129
+ target?: string;
130
+ capture: boolean;
131
+ passive: boolean;
132
+ }
133
+ export interface JsonDocsSlot {
134
+ name: string;
135
+ docs: string;
136
+ }
137
+ export interface JsonDocsPart {
138
+ name: string;
139
+ docs: string;
140
+ }
141
+ export interface StyleDoc {
142
+ name: string;
143
+ docs: string;
144
+ annotation: 'prop';
145
+ }
146
+
147
+ declare const _default: JsonDocs;
148
+ export default _default;
@@ -0,0 +1,72 @@
1
+ {
2
+ "timestamp": "2023-04-14T10:13:48",
3
+ "compiler": {
4
+ "name": "@stencil/core",
5
+ "version": "2.22.3",
6
+ "typescriptVersion": "4.9.4"
7
+ },
8
+ "components": [
9
+ {
10
+ "filePath": "./src/components/mds-accordion-timer/mds-accordion-timer.tsx",
11
+ "encapsulation": "shadow",
12
+ "tag": "mds-accordion-timer",
13
+ "docs": "",
14
+ "docsTags": [],
15
+ "usage": {},
16
+ "props": [
17
+ {
18
+ "name": "duration",
19
+ "type": "number",
20
+ "mutable": false,
21
+ "attr": "duration",
22
+ "reflectToAttr": false,
23
+ "docs": "Sets the duration of the single accordion item",
24
+ "docsTags": [],
25
+ "default": "10000",
26
+ "values": [
27
+ {
28
+ "type": "number"
29
+ }
30
+ ],
31
+ "optional": false,
32
+ "required": false
33
+ }
34
+ ],
35
+ "methods": [],
36
+ "events": [
37
+ {
38
+ "event": "mdsAccordionTimerChange",
39
+ "detail": "void",
40
+ "bubbles": true,
41
+ "cancelable": true,
42
+ "composed": true,
43
+ "docs": "Emits when the accordion changes it's item",
44
+ "docsTags": []
45
+ }
46
+ ],
47
+ "listeners": [
48
+ {
49
+ "event": "mdsAccordionTimerItemClickSelect",
50
+ "capture": false,
51
+ "passive": false
52
+ },
53
+ {
54
+ "event": "mdsAccordionTimerItemMouseEnterSelect",
55
+ "capture": false,
56
+ "passive": false
57
+ },
58
+ {
59
+ "event": "mdsAccordionTimerItemMouseLeaveSelect",
60
+ "capture": false,
61
+ "passive": false
62
+ }
63
+ ],
64
+ "styles": [],
65
+ "slots": [],
66
+ "parts": [],
67
+ "dependents": [],
68
+ "dependencies": [],
69
+ "dependencyGraph": {}
70
+ }
71
+ ]
72
+ }
@@ -2,7 +2,7 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-bd689d6a.js';
2
2
  export { s as setNonce } from './index-bd689d6a.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchEsm = () => {
8
8
  return promiseResolve();
@@ -9,8 +9,7 @@ const MdsAccordionTimer = class {
9
9
  this.clearIntervals = () => {
10
10
  window.clearInterval(this.timer);
11
11
  window.clearInterval(this.timeChecker);
12
- this.timer = null;
13
- this.timeChecker = null;
12
+ this.timeChecker = 0;
14
13
  };
15
14
  this.progress = () => {
16
15
  return Math.abs(this.remainingTime() / this.duration - 1);
@@ -40,7 +39,7 @@ const MdsAccordionTimer = class {
40
39
  if (key === uuid) {
41
40
  item.selected = true;
42
41
  this.selectedItem = item;
43
- this.changeEvent.emit(uuid);
42
+ this.changeEvent.emit();
44
43
  }
45
44
  else {
46
45
  item.selected = false;
@@ -68,7 +67,6 @@ const MdsAccordionTimer = class {
68
67
  };
69
68
  this.stopTimer = () => {
70
69
  this.clearIntervals();
71
- this.time = null;
72
70
  };
73
71
  this.time = 0;
74
72
  this.duration = 10000;
@@ -90,17 +88,10 @@ const MdsAccordionTimer = class {
90
88
  this.clearIntervals();
91
89
  }
92
90
  onClickActive(event) {
93
- if (this.selectedItem && event.detail === this.selectedItem.description) {
94
- return;
91
+ if (this.selectedItem) {
92
+ this.selectedItem.progress = 0;
95
93
  }
96
- let selectedUuid;
97
- this.children.forEach(item => {
98
- item.progress = 0;
99
- if (item.description === event.detail) {
100
- selectedUuid = item.uuid;
101
- }
102
- });
103
- this.setSelectedItem(selectedUuid);
94
+ this.setSelectedItem(event.detail.uuid);
104
95
  this.startTimer();
105
96
  this.pauseTimer();
106
97
  }
@@ -108,7 +99,7 @@ const MdsAccordionTimer = class {
108
99
  this.pauseTimer();
109
100
  }
110
101
  onMouseLeaveSelect() {
111
- if (this.timeChecker === null) {
102
+ if (this.timeChecker === 0) {
112
103
  this.playTimer();
113
104
  }
114
105
  }
@@ -2,7 +2,7 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-bd689d6a.js';
2
2
  export { s as setNonce } from './index-bd689d6a.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;
@@ -1 +1 @@
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};
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.timeChecker=0};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()};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){this.selectedItem.progress=0}this.setSelectedItem(e.detail.uuid);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=function(){if(this.timeChecker===0){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 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)));
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,c={};return""!==o&&(c.resourcesUrl=new URL(".",o).href),e(c)})().then((e=>o([["p-1442acbc",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],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-4620ac30.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-5e09eed0.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
+ import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const o=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timeChecker=0},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.selectedItem&&(this.selectedItem.progress=t),1===t&&(this.selectedItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.selectedItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setSelectedItem=t=>{this.children.forEach(((s,i)=>{i===t?(s.selected=!0,this.selectedItem=s,this.changeEvent.emit()):s.selected=!1}))},this.startNext=()=>{this.setSelectedItem(this.selectedItem.uuid+1>this.children.length-1?0:this.selectedItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.selectedItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.selectedItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals()},this.time=0,this.duration=1e4}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,s)=>{t.uuid=s,t.selected&&(this.selectedItem=t)})),void 0!==this.selectedItem&&this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){this.selectedItem&&(this.selectedItem.progress=0),this.setSelectedItem(t.detail.uuid),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){0===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("slot",null))}get element(){return e(this)}};o.style=":host{display:block}";export{o as mds_accordion_timer}
@@ -0,0 +1 @@
1
+ System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timeChecker=0};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals()};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){this.selectedItem.progress=0}this.setSelectedItem(e.detail.uuid);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=function(){if(this.timeChecker===0){this.playTimer()}};e.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1 +1 @@
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)}))}}}));
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-53e5fa07.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-03-09T10:43:18",
2
+ "timestamp": "2023-04-14T10:13:48",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -75,21 +75,21 @@
75
75
  "./dist/mds-accordion-timer/index.esm.js",
76
76
  "./dist/mds-accordion-timer/mds-accordion-timer.esm.js",
77
77
  "./dist/mds-accordion-timer/mds-accordion-timer.js",
78
- "./dist/mds-accordion-timer/p-4620ac30.system.js",
78
+ "./dist/mds-accordion-timer/p-1442acbc.entry.js",
79
79
  "./dist/mds-accordion-timer/p-5029b85d.system.js",
80
80
  "./dist/mds-accordion-timer/p-50ea2036.system.js",
81
- "./dist/mds-accordion-timer/p-7df47654.system.entry.js",
81
+ "./dist/mds-accordion-timer/p-53e5fa07.system.entry.js",
82
+ "./dist/mds-accordion-timer/p-5e09eed0.system.js",
82
83
  "./dist/mds-accordion-timer/p-a7b74010.js",
83
- "./dist/mds-accordion-timer/p-aae0027a.entry.js",
84
84
  "./www/build/index.esm.js",
85
85
  "./www/build/mds-accordion-timer.esm.js",
86
86
  "./www/build/mds-accordion-timer.js",
87
- "./www/build/p-4620ac30.system.js",
87
+ "./www/build/p-1442acbc.entry.js",
88
88
  "./www/build/p-5029b85d.system.js",
89
89
  "./www/build/p-50ea2036.system.js",
90
- "./www/build/p-7df47654.system.entry.js",
91
- "./www/build/p-a7b74010.js",
92
- "./www/build/p-aae0027a.entry.js"
90
+ "./www/build/p-53e5fa07.system.entry.js",
91
+ "./www/build/p-5e09eed0.system.js",
92
+ "./www/build/p-a7b74010.js"
93
93
  ]
94
94
  },
95
95
  {
@@ -122,12 +122,12 @@
122
122
  "components": [
123
123
  "mds-accordion-timer"
124
124
  ],
125
- "bundleId": "p-aae0027a",
126
- "fileName": "p-aae0027a.entry.js",
125
+ "bundleId": "p-1442acbc",
126
+ "fileName": "p-1442acbc.entry.js",
127
127
  "imports": [
128
128
  "p-a7b74010.js"
129
129
  ],
130
- "originalByteSize": 3516
130
+ "originalByteSize": 3256
131
131
  }
132
132
  ],
133
133
  "esm": [
@@ -141,7 +141,7 @@
141
141
  "imports": [
142
142
  "index-bd689d6a.js"
143
143
  ],
144
- "originalByteSize": 3520
144
+ "originalByteSize": 3260
145
145
  }
146
146
  ],
147
147
  "es5": [
@@ -155,7 +155,7 @@
155
155
  "imports": [
156
156
  "index-bd689d6a.js"
157
157
  ],
158
- "originalByteSize": 3520
158
+ "originalByteSize": 3260
159
159
  }
160
160
  ],
161
161
  "system": [
@@ -164,12 +164,12 @@
164
164
  "components": [
165
165
  "mds-accordion-timer"
166
166
  ],
167
- "bundleId": "p-7df47654.system",
168
- "fileName": "p-7df47654.system.entry.js",
167
+ "bundleId": "p-53e5fa07.system",
168
+ "fileName": "p-53e5fa07.system.entry.js",
169
169
  "imports": [
170
170
  "p-5029b85d.system.js"
171
171
  ],
172
- "originalByteSize": 4462
172
+ "originalByteSize": 4148
173
173
  }
174
174
  ],
175
175
  "commonjs": [
@@ -183,7 +183,7 @@
183
183
  "imports": [
184
184
  "index-b99075ba.js"
185
185
  ],
186
- "originalByteSize": 3567
186
+ "originalByteSize": 3307
187
187
  }
188
188
  ]
189
189
  },
@@ -217,8 +217,8 @@
217
217
  "text": "Emits when the accordion changes it's item"
218
218
  },
219
219
  "complexType": {
220
- "original": "number",
221
- "resolved": "number",
220
+ "original": "void",
221
+ "resolved": "void",
222
222
  "references": {}
223
223
  },
224
224
  "internal": false
@@ -257,7 +257,7 @@
257
257
  "reflect": false,
258
258
  "mutable": false,
259
259
  "required": false,
260
- "optional": true,
260
+ "optional": false,
261
261
  "defaultValue": "10000",
262
262
  "complexType": {
263
263
  "original": "number",
@@ -298,7 +298,7 @@
298
298
  "reflect": false,
299
299
  "mutable": false,
300
300
  "required": false,
301
- "optional": true,
301
+ "optional": false,
302
302
  "defaultValue": "10000",
303
303
  "complexType": {
304
304
  "original": "number",
@@ -351,8 +351,8 @@
351
351
  "text": "Emits when the accordion changes it's item"
352
352
  },
353
353
  "complexType": {
354
- "original": "number",
355
- "resolved": "number",
354
+ "original": "void",
355
+ "resolved": "void",
356
356
  "references": {}
357
357
  },
358
358
  "internal": false
@@ -1,3 +1,4 @@
1
+ import { MdsAccordionTimerItemEventDetail } from '@component/mds-accordion-timer-item/meta/event-detail';
1
2
  import { EventEmitter } from '../../stencil-public-runtime';
2
3
  export declare class MdsAccordionTimer {
3
4
  private timer;
@@ -11,11 +12,11 @@ export declare class MdsAccordionTimer {
11
12
  /**
12
13
  * Sets the duration of the single accordion item
13
14
  */
14
- duration?: number;
15
+ duration: number;
15
16
  /**
16
17
  * Emits when the accordion changes it's item
17
18
  */
18
- changeEvent: EventEmitter<number>;
19
+ changeEvent: EventEmitter<void>;
19
20
  componentDidLoad(): void;
20
21
  private clearIntervals;
21
22
  disconnectedCallback(): void;
@@ -29,7 +30,7 @@ export declare class MdsAccordionTimer {
29
30
  private playTimer;
30
31
  private pauseTimer;
31
32
  private stopTimer;
32
- onClickActive(event: CustomEvent<string>): void;
33
+ onClickActive(event: CustomEvent<MdsAccordionTimerItemEventDetail>): void;
33
34
  onMouseEnterSelect(): void;
34
35
  onMouseLeaveSelect(): void;
35
36
  render(): any;
@@ -10,7 +10,7 @@ export namespace Components {
10
10
  /**
11
11
  * Sets the duration of the single accordion item
12
12
  */
13
- "duration"?: number;
13
+ "duration": number;
14
14
  }
15
15
  }
16
16
  export interface MdsAccordionTimerCustomEvent<T> extends CustomEvent<T> {
@@ -37,7 +37,7 @@ declare namespace LocalJSX {
37
37
  /**
38
38
  * Emits when the accordion changes it's item
39
39
  */
40
- "onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<number>) => void;
40
+ "onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<void>) => void;
41
41
  }
42
42
  interface IntrinsicElements {
43
43
  "mds-accordion-timer": MdsAccordionTimer;
@@ -1,4 +1,4 @@
1
- import { InputValueType } from '../types/input-value-type';
1
+ import { InputValueType } from '@type/input-value-type';
2
2
  export interface InputValue {
3
3
  value: InputValueType;
4
4
  }
@@ -0,0 +1,73 @@
1
+ {
2
+ "timestamp": "2023-04-14T09:57:39",
3
+ "compiler": {
4
+ "name": "@stencil/core",
5
+ "version": "2.22.3",
6
+ "typescriptVersion": "4.9.4"
7
+ },
8
+ "components": [
9
+ {
10
+ "filePath": "./src/components/mds-accordion-timer/mds-accordion-timer.tsx",
11
+ "encapsulation": "shadow",
12
+ "tag": "mds-accordion-timer",
13
+ "readme": "# mds-accordion-timer\n\n\n",
14
+ "docs": "",
15
+ "docsTags": [],
16
+ "usage": {},
17
+ "props": [
18
+ {
19
+ "name": "duration",
20
+ "type": "number",
21
+ "mutable": false,
22
+ "attr": "duration",
23
+ "reflectToAttr": false,
24
+ "docs": "Sets the duration of the single accordion item",
25
+ "docsTags": [],
26
+ "default": "10000",
27
+ "values": [
28
+ {
29
+ "type": "number"
30
+ }
31
+ ],
32
+ "optional": false,
33
+ "required": false
34
+ }
35
+ ],
36
+ "methods": [],
37
+ "events": [
38
+ {
39
+ "event": "mdsAccordionTimerChange",
40
+ "detail": "void",
41
+ "bubbles": true,
42
+ "cancelable": true,
43
+ "composed": true,
44
+ "docs": "Emits when the accordion changes it's item",
45
+ "docsTags": []
46
+ }
47
+ ],
48
+ "listeners": [
49
+ {
50
+ "event": "mdsAccordionTimerItemClickSelect",
51
+ "capture": false,
52
+ "passive": false
53
+ },
54
+ {
55
+ "event": "mdsAccordionTimerItemMouseEnterSelect",
56
+ "capture": false,
57
+ "passive": false
58
+ },
59
+ {
60
+ "event": "mdsAccordionTimerItemMouseLeaveSelect",
61
+ "capture": false,
62
+ "passive": false
63
+ }
64
+ ],
65
+ "styles": [],
66
+ "slots": [],
67
+ "parts": [],
68
+ "dependents": [],
69
+ "dependencies": [],
70
+ "dependencyGraph": {}
71
+ }
72
+ ]
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-accordion-timer",
3
- "version": "3.1.0",
3
+ "version": "3.2.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",
@@ -12,6 +12,7 @@
12
12
  "unpkg": "dist/mds-accordion-timer/mds-accordion-timer.esm.js",
13
13
  "files": [
14
14
  "dist/",
15
+ "documentation.json",
15
16
  "loader/",
16
17
  "readme.md",
17
18
  "src/",
@@ -23,9 +24,9 @@
23
24
  "test": "stencil test --spec --e2e"
24
25
  },
25
26
  "dependencies": {
26
- "@maggioli-design-system/mds-accordion-timer-item": "^3.0.1",
27
- "@maggioli-design-system/styles": "^11.2.1",
28
- "@stencil/core": "^2.22.2"
27
+ "@maggioli-design-system/mds-accordion-timer-item": "^3.1.1",
28
+ "@maggioli-design-system/styles": "^11.4.0",
29
+ "@stencil/core": "^2.22.3"
29
30
  },
30
31
  "license": "MIT",
31
32
  "author": {
@@ -39,10 +40,15 @@
39
40
  "email": "andrea.pruccoli@maggioli.it",
40
41
  "role": "Software Engineer"
41
42
  },
43
+ {
44
+ "name": "Nicola Tamburini",
45
+ "email": "nicola.tamburini@maggioli.it",
46
+ "role": "Software Engineer"
47
+ },
42
48
  {
43
49
  "name": "Vittorio Vittori",
44
50
  "email": "vittorio.vittori@maggioli.it",
45
- "role": "UX UI Designer"
51
+ "role": "Product Designer"
46
52
  }
47
53
  ]
48
54
  }
package/readme.md CHANGED
@@ -14,9 +14,9 @@
14
14
 
15
15
  ## Events
16
16
 
17
- | Event | Description | Type |
18
- | ------------------------- | ------------------------------------------ | --------------------- |
19
- | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<number>` |
17
+ | Event | Description | Type |
18
+ | ------------------------- | ------------------------------------------ | ------------------- |
19
+ | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` |
20
20
 
21
21
 
22
22
  ----------------------------------------------
@@ -7,12 +7,12 @@ const hash = (s: string): string => {
7
7
  }
8
8
 
9
9
  const unslugName = (name: string): string => {
10
- return name.split('/').slice(-1).pop().replace(/-/g, ' ')
10
+ return name.split('/')?.slice(-1).pop()?.replace(/-/g, ' ') ?? name
11
11
  }
12
12
 
13
13
  const setAttributeIfEmpty = (element: HTMLElement, attribute: string, value: string): string => {
14
14
  if (element.hasAttribute(attribute)) {
15
- return element.getAttribute(attribute)
15
+ return element.getAttribute(attribute) ?? ''
16
16
  }
17
17
  element.setAttribute(attribute, value)
18
18
  return value
@@ -38,7 +38,7 @@ export class KeyboardManager {
38
38
  }
39
39
 
40
40
  detachEscapeBehavior = (): void => {
41
- this.escapeCallback = null
41
+ this.escapeCallback = () => {return}
42
42
  if (typeof window !== undefined) {
43
43
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
44
44
  }
@@ -1,3 +1,4 @@
1
+ import { MdsAccordionTimerItemEventDetail } from '@component/mds-accordion-timer-item/meta/event-detail'
1
2
  import { Component, Host, Element, Event, EventEmitter, h, Prop, Listen, State } from '@stencil/core'
2
3
 
3
4
  @Component({
@@ -20,12 +21,12 @@ export class MdsAccordionTimer {
20
21
  /**
21
22
  * Sets the duration of the single accordion item
22
23
  */
23
- @Prop() duration?: number = 10000
24
+ @Prop() duration = 10000
24
25
 
25
26
  /**
26
27
  * Emits when the accordion changes it's item
27
28
  */
28
- @Event({ eventName: 'mdsAccordionTimerChange' }) changeEvent: EventEmitter<number>
29
+ @Event({ eventName: 'mdsAccordionTimerChange' }) changeEvent: EventEmitter<void>
29
30
 
30
31
  componentDidLoad (): void {
31
32
  this.children = this.element.querySelectorAll<HTMLMdsAccordionTimerItemElement>('mds-accordion-timer-item')
@@ -44,8 +45,7 @@ export class MdsAccordionTimer {
44
45
  private clearIntervals = (): void => {
45
46
  window.clearInterval(this.timer)
46
47
  window.clearInterval(this.timeChecker)
47
- this.timer = null
48
- this.timeChecker = null
48
+ this.timeChecker = 0
49
49
  }
50
50
 
51
51
  disconnectedCallback (): void {
@@ -85,7 +85,7 @@ export class MdsAccordionTimer {
85
85
  if (key === uuid) {
86
86
  item.selected = true
87
87
  this.selectedItem = item
88
- this.changeEvent.emit(uuid)
88
+ this.changeEvent.emit()
89
89
  } else {
90
90
  item.selected = false
91
91
  }
@@ -117,22 +117,14 @@ export class MdsAccordionTimer {
117
117
 
118
118
  private stopTimer = (): void => {
119
119
  this.clearIntervals()
120
- this.time = null
121
120
  }
122
121
 
123
122
  @Listen('mdsAccordionTimerItemClickSelect')
124
- onClickActive (event: CustomEvent<string>): void {
125
- if (this.selectedItem && event.detail === this.selectedItem.description) {
126
- return
123
+ onClickActive (event: CustomEvent<MdsAccordionTimerItemEventDetail>): void {
124
+ if (this.selectedItem) {
125
+ this.selectedItem.progress = 0
127
126
  }
128
- let selectedUuid: number
129
- this.children.forEach(item => {
130
- item.progress = 0
131
- if (item.description === event.detail) {
132
- selectedUuid = item.uuid
133
- }
134
- })
135
- this.setSelectedItem(selectedUuid)
127
+ this.setSelectedItem(event.detail.uuid)
136
128
  this.startTimer()
137
129
  this.pauseTimer()
138
130
  }
@@ -144,7 +136,7 @@ export class MdsAccordionTimer {
144
136
 
145
137
  @Listen('mdsAccordionTimerItemMouseLeaveSelect')
146
138
  onMouseLeaveSelect (): void {
147
- if (this.timeChecker === null) {
139
+ if (this.timeChecker === 0) {
148
140
  this.playTimer()
149
141
  }
150
142
  }
@@ -14,9 +14,9 @@
14
14
 
15
15
  ## Events
16
16
 
17
- | Event | Description | Type |
18
- | ------------------------- | ------------------------------------------ | --------------------- |
19
- | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<number>` |
17
+ | Event | Description | Type |
18
+ | ------------------------- | ------------------------------------------ | ------------------- |
19
+ | `mdsAccordionTimerChange` | Emits when the accordion changes it's item | `CustomEvent<void>` |
20
20
 
21
21
 
22
22
  ----------------------------------------------
@@ -10,7 +10,7 @@ export namespace Components {
10
10
  /**
11
11
  * Sets the duration of the single accordion item
12
12
  */
13
- "duration"?: number;
13
+ "duration": number;
14
14
  }
15
15
  }
16
16
  export interface MdsAccordionTimerCustomEvent<T> extends CustomEvent<T> {
@@ -37,7 +37,7 @@ declare namespace LocalJSX {
37
37
  /**
38
38
  * Emits when the accordion changes it's item
39
39
  */
40
- "onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<number>) => void;
40
+ "onMdsAccordionTimerChange"?: (event: MdsAccordionTimerCustomEvent<void>) => void;
41
41
  }
42
42
  interface IntrinsicElements {
43
43
  "mds-accordion-timer": MdsAccordionTimer;
@@ -221,6 +221,7 @@
221
221
  "mi/baseline/navigate-next",
222
222
  "mi/baseline/panorama",
223
223
  "mi/baseline/person",
224
+ "mi/baseline/pets",
224
225
  "mi/baseline/radio-button-checked",
225
226
  "mi/baseline/radio-button-unchecked",
226
227
  "mi/baseline/route",
@@ -1,4 +1,4 @@
1
- import { InputValueType } from '../types/input-value-type'
1
+ import { InputValueType } from '@type/input-value-type'
2
2
 
3
3
  export interface InputValue {
4
4
  value: InputValueType
@@ -1 +1 @@
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)));
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,c={};return""!==o&&(c.resourcesUrl=new URL(".",o).href),e(c)})().then((e=>o([["p-1442acbc",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],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-4620ac30.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-5e09eed0.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
+ import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const o=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",7),this.clearIntervals=()=>{window.clearInterval(this.timer),window.clearInterval(this.timeChecker),this.timeChecker=0},this.progress=()=>Math.abs(this.remainingTime()/this.duration-1),this.addTimeListener=()=>{this.timeChecker=window.setInterval((()=>{const t=this.progress();void 0!==this.selectedItem&&(this.selectedItem.progress=t),1===t&&(this.selectedItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.selectedItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setSelectedItem=t=>{this.children.forEach(((s,i)=>{i===t?(s.selected=!0,this.selectedItem=s,this.changeEvent.emit()):s.selected=!1}))},this.startNext=()=>{this.setSelectedItem(this.selectedItem.uuid+1>this.children.length-1?0:this.selectedItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.selectedItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.selectedItemDurationTime=this.remainingTime()},this.stopTimer=()=>{this.clearIntervals()},this.time=0,this.duration=1e4}componentDidLoad(){this.children=this.element.querySelectorAll("mds-accordion-timer-item"),this.children.forEach(((t,s)=>{t.uuid=s,t.selected&&(this.selectedItem=t)})),void 0!==this.selectedItem&&this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){this.selectedItem&&(this.selectedItem.progress=0),this.setSelectedItem(t.detail.uuid),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){0===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("slot",null))}get element(){return e(this)}};o.style=":host{display:block}";export{o as mds_accordion_timer}
@@ -0,0 +1 @@
1
+ System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(n.timer);window.clearInterval(n.timeChecker);n.timeChecker=0};this.progress=function(){return Math.abs(n.remainingTime()/n.duration-1)};this.addTimeListener=function(){n.timeChecker=window.setInterval((function(){var e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals()};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){this.selectedItem.progress=0}this.setSelectedItem(e.detail.uuid);this.startTimer();this.pauseTimer()};e.prototype.onMouseEnterSelect=function(){this.pauseTimer()};e.prototype.onMouseLeaveSelect=function(){if(this.timeChecker===0){this.playTimer()}};e.prototype.render=function(){return n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1 +1 @@
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)}))}}}));
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-53e5fa07.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",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 e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit(e)}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.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 n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const n=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",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.selectedItem&&(this.selectedItem.progress=t),1===t&&(this.selectedItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.selectedItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setSelectedItem=t=>{this.children.forEach(((s,i)=>{i===t?(s.selected=!0,this.selectedItem=s,this.changeEvent.emit(t)):s.selected=!1}))},this.startNext=()=>{this.setSelectedItem(this.selectedItem.uuid+1>this.children.length-1?0:this.selectedItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.selectedItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.selectedItemDurationTime=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,s)=>{t.uuid=s,t.selected&&(this.selectedItem=t)})),void 0!==this.selectedItem&&this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(this.selectedItem&&t.detail===this.selectedItem.description)return;let s;this.children.forEach((i=>{i.progress=0,i.description===t.detail&&(s=i.uuid)})),this.setSelectedItem(s),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){null===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("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-5029b85d.system.js"],(function(e){"use strict";var t,i,n,r,s;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.g}],execute:function(){var c=":host{display:block}";var o=e("mds_accordion_timer",function(){function e(e){var n=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",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 e=n.progress();if(n.selectedItem!==undefined){n.selectedItem.progress=e}if(e===1){n.selectedItem.progress=0;n.startNext()}}),100)};this.beginningTime=function(){n.timeStarted=(new Date).getTime();return n.timeStarted};this.remainingTime=function(){var e=n.selectedItemDurationTime-((new Date).getTime()-n.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){n.children.forEach((function(t,i){if(i===e){t.selected=true;n.selectedItem=t;n.changeEvent.emit(e)}else{t.selected=false}}))};this.startNext=function(){var e=n.selectedItem.uuid+1>n.children.length-1?0:n.selectedItem.uuid+1;n.setSelectedItem(e);n.startTimer()};this.startTimer=function(){n.clearIntervals();n.time=n.beginningTime();n.selectedItemDurationTime=n.duration;n.addTimeListener()};this.playTimer=function(){n.beginningTime();n.addTimeListener()};this.pauseTimer=function(){n.clearIntervals();n.selectedItemDurationTime=n.remainingTime()};this.stopTimer=function(){n.clearIntervals();n.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 n(r,null,n("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());o.style=c}}}));
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i,H as h,g as e}from"./p-a7b74010.js";const n=class{constructor(i){t(this,i),this.changeEvent=s(this,"mdsAccordionTimerChange",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.selectedItem&&(this.selectedItem.progress=t),1===t&&(this.selectedItem.progress=0,this.startNext())}),100)},this.beginningTime=()=>(this.timeStarted=(new Date).getTime(),this.timeStarted),this.remainingTime=()=>{const t=this.selectedItemDurationTime-((new Date).getTime()-this.timeStarted);return t>=0?t:0},this.setSelectedItem=t=>{this.children.forEach(((s,i)=>{i===t?(s.selected=!0,this.selectedItem=s,this.changeEvent.emit(t)):s.selected=!1}))},this.startNext=()=>{this.setSelectedItem(this.selectedItem.uuid+1>this.children.length-1?0:this.selectedItem.uuid+1),this.startTimer()},this.startTimer=()=>{this.clearIntervals(),this.time=this.beginningTime(),this.selectedItemDurationTime=this.duration,this.addTimeListener()},this.playTimer=()=>{this.beginningTime(),this.addTimeListener()},this.pauseTimer=()=>{this.clearIntervals(),this.selectedItemDurationTime=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,s)=>{t.uuid=s,t.selected&&(this.selectedItem=t)})),void 0!==this.selectedItem&&this.startTimer()}disconnectedCallback(){this.stopTimer(),this.clearIntervals()}onClickActive(t){if(this.selectedItem&&t.detail===this.selectedItem.description)return;let s;this.children.forEach((i=>{i.progress=0,i.description===t.detail&&(s=i.uuid)})),this.setSelectedItem(s),this.startTimer(),this.pauseTimer()}onMouseEnterSelect(){this.pauseTimer()}onMouseLeaveSelect(){null===this.timeChecker&&this.playTimer()}render(){return i(h,null,i("slot",null))}get element(){return e(this)}};n.style=":host{display:block}";export{n as mds_accordion_timer}