@maggioli-design-system/mds-accordion-timer 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-accordion-timer.cjs.entry.js +6 -15
- package/dist/cjs/mds-accordion-timer.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/aria.js +4 -2
- package/dist/collection/common/keyboard-manager.js +1 -1
- package/dist/collection/common/unit.js +10 -0
- package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
- package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +6 -15
- package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +1 -1
- package/dist/collection/dictionary/button.js +5 -1
- package/dist/collection/dictionary/variant.js +9 -1
- package/dist/components/mds-accordion-timer.js +6 -15
- package/dist/documentation.d.ts +148 -0
- package/dist/documentation.json +98 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mds-accordion-timer.entry.js +6 -15
- package/dist/esm/mds-accordion-timer.js +1 -1
- package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
- package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
- package/dist/mds-accordion-timer/mds-accordion-timer.js +1 -1
- package/dist/mds-accordion-timer/p-2a65b768.system.entry.js +1 -0
- package/{www/build/p-4620ac30.system.js → dist/mds-accordion-timer/p-5e09eed0.system.js} +1 -1
- package/dist/mds-accordion-timer/p-778834a9.entry.js +1 -0
- package/dist/stats.json +49 -21
- package/dist/types/common/unit.d.ts +2 -0
- package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +3 -2
- package/dist/types/components.d.ts +1 -1
- package/dist/types/dictionary/button.d.ts +2 -1
- package/dist/types/dictionary/variant.d.ts +2 -1
- package/dist/types/interface/input-value.d.ts +1 -1
- package/dist/types/type/button.d.ts +1 -0
- package/dist/types/type/variant.d.ts +1 -0
- package/documentation.json +99 -0
- package/package.json +11 -5
- package/readme.md +11 -0
- package/src/common/aria.ts +2 -2
- package/src/common/keyboard-manager.ts +1 -1
- package/src/common/unit.ts +14 -0
- package/src/components/mds-accordion-timer/mds-accordion-timer.css +14 -0
- package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +8 -16
- package/src/components/mds-accordion-timer/readme.md +11 -0
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx +1 -1
- package/src/components.d.ts +1 -1
- package/src/dictionary/button.ts +7 -1
- package/src/dictionary/variant.ts +10 -0
- package/src/fixtures/icons.json +20 -0
- package/src/fixtures/iconsauce.json +19 -0
- package/src/interface/input-value.ts +1 -1
- package/src/type/button.ts +4 -0
- package/src/type/variant.ts +9 -0
- package/www/build/mds-accordion-timer.esm.js +1 -1
- package/www/build/mds-accordion-timer.js +1 -1
- package/www/build/p-2a65b768.system.entry.js +1 -0
- package/{dist/mds-accordion-timer/p-4620ac30.system.js → www/build/p-5e09eed0.system.js} +1 -1
- package/www/build/p-778834a9.entry.js +1 -0
- package/dist/mds-accordion-timer/p-2bfbd758.system.entry.js +0 -1
- package/dist/mds-accordion-timer/p-8d875f1d.entry.js +0 -1
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.spec.tsx +0 -19
- package/www/build/p-2bfbd758.system.entry.js +0 -1
- package/www/build/p-8d875f1d.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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.
|
|
8
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b99075ba.js');
|
|
6
6
|
|
|
7
|
-
const mdsAccordionTimerCss = ":host{display:block}";
|
|
7
|
+
const mdsAccordionTimerCss = ":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;display:block}";
|
|
8
8
|
|
|
9
9
|
const MdsAccordionTimer = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -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.
|
|
17
|
-
this.timeChecker = null;
|
|
16
|
+
this.timeChecker = 0;
|
|
18
17
|
};
|
|
19
18
|
this.progress = () => {
|
|
20
19
|
return Math.abs(this.remainingTime() / this.duration - 1);
|
|
@@ -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
|
|
98
|
-
|
|
95
|
+
if (this.selectedItem) {
|
|
96
|
+
this.selectedItem.progress = 0;
|
|
99
97
|
}
|
|
100
|
-
|
|
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 ===
|
|
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.
|
|
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));
|
|
@@ -6,11 +6,13 @@ const hash = (s) => {
|
|
|
6
6
|
return h.toString();
|
|
7
7
|
};
|
|
8
8
|
const unslugName = (name) => {
|
|
9
|
-
|
|
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 =
|
|
34
|
+
this.escapeCallback = () => { return; };
|
|
35
35
|
if (typeof window !== undefined) {
|
|
36
36
|
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
37
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
2
|
+
if (duration.includes('s')) {
|
|
3
|
+
return Number(duration.replace('s', '')) * 1000;
|
|
4
|
+
}
|
|
5
|
+
if (duration.includes('ms')) {
|
|
6
|
+
return Number(duration.replace('s', ''));
|
|
7
|
+
}
|
|
8
|
+
return defaultValue;
|
|
9
|
+
};
|
|
10
|
+
export { cssDurationToMilliseconds, };
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @prop --mds-accordion-timer-progress-bar-color: Sets the color of the progress bar when the mds-accordion-timer-item is selected
|
|
3
|
+
* @prop --mds-accordion-timer-progress-bar-background: Sets the background-color of the progress bar when the mds-accordion-timer-item is selected
|
|
4
|
+
* @prop --mds-accordion-timer-color: Sets the text color of the component mds-accordion-timer-item
|
|
5
|
+
* @prop --mds-accordion-timer-progress-bar-thickness: Sets thickness of the progress bar of the mds-accordion-timer-item
|
|
6
|
+
* @prop --mds-accordion-timer-duration: Sets the transition duration of open/close animation of the mds-accordion-timer-item
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
:host {
|
|
10
|
+
|
|
11
|
+
--mds-accordion-timer-progress-bar-color: rgb(var(--tone-neutral-03));
|
|
12
|
+
--mds-accordion-timer-progress-bar-background: rgb(var(--tone-neutral-08));
|
|
13
|
+
--mds-accordion-timer-progress-bar-thickness: 0.25rem;
|
|
14
|
+
--mds-accordion-timer-duration: 500ms;
|
|
15
|
+
|
|
2
16
|
display: block;
|
|
3
17
|
}
|
|
@@ -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.
|
|
8
|
-
this.timeChecker = null;
|
|
7
|
+
this.timeChecker = 0;
|
|
9
8
|
};
|
|
10
9
|
this.progress = () => {
|
|
11
10
|
return Math.abs(this.remainingTime() / this.duration - 1);
|
|
@@ -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
|
|
89
|
-
|
|
86
|
+
if (this.selectedItem) {
|
|
87
|
+
this.selectedItem.progress = 0;
|
|
90
88
|
}
|
|
91
|
-
|
|
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 ===
|
|
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":
|
|
127
|
+
"optional": false,
|
|
137
128
|
"docs": {
|
|
138
129
|
"tags": [],
|
|
139
130
|
"text": "Sets the duration of the single accordion item"
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
|
-
const Template = args => h("div", null, h("mds-accordion-timer", Object.assign({}, args), h("mds-accordion-timer-item", { description: "Blipbug" }, h("mds-text", null, "Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed \u00E8 formato principalmente da tre parti: la sua grande testa, il suo collo (molto simile ad un collare), e il corpo vero e proprio. La prima di queste \u00E8 suddivisa in una parte color crema e una parte color denim; dello stesso colore sono le appenidici a forma di \"V\" che si trovano sopra e ai lati della testa. I suoi occhi sono enormi e grigi, ed hanno delle sottilissime sopracciglia sopra di essi. Il suo \"collare\", anch'esso color denim, presenta delle \"setole\" giallo sabbia, con le quali percepisce i segnali esterni: stesso colore si presenta nel segmento centrale della sua parte inferiore, dove sono presenti un primo paio di zampe crema. Il segmento superiore del corpo \u00E8 bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la \"coda\", \u00E8 color denim e finisce con un'appendice a \"V\" un po' pi\u00FA grossa.")), h("mds-accordion-timer-item", { description: "Drednaw" }, h("mds-text", null, "Drednaw \u00E8 un Pok\u00E9mon quadrupede simile ad una tartaruga alligatore. Il corpo \u00E8 principalmente di colore turchese cos\u00EC come le zampe cilindriche e tozze, le quali terminano con tre unghie allungate e bianche. Sulle zampe anteriori, circa sulla loro met\u00E0, spuntanto delle protuberanze simili a scaglie di roccia color marroncino, ricorrenti anche nel resto del corpo: ad esempio, sul muso c'\u00E8 una protuberanza a zig-zag che ospita le sue narici; sulla coda sono alternate delle scaglie e attorno al guscio c'\u00E8 una cornice dello stesso colore; anche le placche superiori sembrano essere fatte di roccia, ma sono di un colore marrone scuro, invece che chiaro. Queste parti rocciose sembrano essere frastagliate, per niente levigate. Il suo volto presenta occhi bassi e imbronciati, con delle guance arancioni e sporgenti ed una bocca a zig-zag, la cui parte inferiore \u00E8 simile al beige, colore presente anche nelle placche del guscio inferiori, che stavolta fanno vedere la pelle a volte grinzosa del Pok\u00E9mon (in particolare attorno al collo e sulle zampe). Le sue scaglie di roccia sono spesso rivolte verso di dietro, dando l'idea di una roccia grezza e non liscia e lavorata.")), h("mds-accordion-timer-item", { description: "Orbeetle" }, h("mds-text", null, "Orbeetle presenta aspetti comuni ad una coccinella ormai matura. Il suo corpo si sviluppa attorno al guscio che \u00E8 di forma semisferica ed \u00E8 metallizzato in grigio (lo si pu\u00F2 vedere in particolare dalla parte inferiore di esso): la sua scocca \u00E8 rossa, con dei pois denim sopra di essa; \u00E8 bisezionata per permettere di aprirsi e attaccare con degli strani poteri. All'estremit\u00E0 del taglio intermedio \u00E8 incastonato il volto di Orbeetle, il quale presenta delle guance bianche con occhi imbronciati celesti, aventi sclere concentriche; sopra di essi ci sono due lunghe sopracciglia dorate a forma di \"V\" e ad incorniciare la faccia del Pok\u00E9mon \u00E8 una cornice grigia, che finisce, con delle striature, sul naso dello stesso. La bocca, assieme alle ginocchia e alla pancia, \u00E8 rossa. Il suo corpo \u00E8 piccolo ed \u00E8 costituito da una vita stretta con una bacino largo, da dove si sviluppano due cosce secche ed esili per poi finire con appuntiti gambali dorati; le sue braccia sono magre e biforcute, come se avessero artigli.")), h("mds-accordion-timer-item", { description: "Dottler" }, h("mds-text", null, "Dottler pu\u00F2 essere considerato la \"crisalide\" della linea evolutiva di Blipbug, vista la sua forma e il suo comportamento. Presenta un guscio di forma poligonale (molto simile a quella di un radar Doppler o di un radome) di color giallo sabbia, con dei pois blu scuro sugli spigoli; leggermente in basso \u00E8 presente la sua faccia di color arancione chiaro, sulla quale ci sono degli occhi celesti attorniati da un contorno arancione, da linee sottili e nere e da delle appendici blu simili a quelle dei Blipbug. Il Pok\u00E9mon non sembra essere dedito a muoversi se non fosse per le quattro zampette blu scuro su cui cammina.")), h("mds-accordion-timer-item", { description: "Centiskorch" }, h("mds-text", null, "Con l'evoluzione Sizzlipede diventa pi\u00F9 aggressivo, soprattutto grazie alla sua stazza pi\u00F9 grande e al suo enorme potenziale. Il corpo diventa pi\u00F9 lungo e si \"seziona\" in dodici parti, anche qui un'estremit\u00E0 \u00E8 la \"coda\" e l'altra \u00E8 la testa, queste due parti, assieme all'intera parte inferiore del corpo sono del rosso mattone presente nella sua pre-evo, mentre le \"parti\" comprese tra la coda e la testa restano marroni/bordeaux; questa volte, dello stesso colore della \"schiena\" sono le zampe, le quali son diventate pi\u00F9 minacciose e uncinate, questa volta sono dieci per ogni lato; marrone/bordeaux sono anche delle tenaglie. presenti in paia, sulla coda e sulla testa; su queste estremit\u00E0 son presenti quattro sbuffi o \"baffi\" di fuoco. Sulla testa \u00E8 presente un simbolo arancione chiaro a forma di punto esclamativo; stessa gamma cromatica \u00E8 presente nei segni circolari situati nella zona inferiore del corpo, i quali son formati, per\u00F2, anche da un anello e da un cerchio, pi\u00F9 interno, di colore giallo sabbia; non sono altro che i punti che Sizzlipede riscalda per attaccare e scottare le prede. I suoi occhi sono giallo elettrico con pupille triangolari color marrone e rovesciati."))));
|
|
12
|
+
const Template = args => h("div", null, h("mds-accordion-timer", Object.assign({}, args), h("mds-accordion-timer-item", { selected: true, description: "Blipbug" }, h("mds-text", null, "Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed \u00E8 formato principalmente da tre parti: la sua grande testa, il suo collo (molto simile ad un collare), e il corpo vero e proprio. La prima di queste \u00E8 suddivisa in una parte color crema e una parte color denim; dello stesso colore sono le appenidici a forma di \"V\" che si trovano sopra e ai lati della testa. I suoi occhi sono enormi e grigi, ed hanno delle sottilissime sopracciglia sopra di essi. Il suo \"collare\", anch'esso color denim, presenta delle \"setole\" giallo sabbia, con le quali percepisce i segnali esterni: stesso colore si presenta nel segmento centrale della sua parte inferiore, dove sono presenti un primo paio di zampe crema. Il segmento superiore del corpo \u00E8 bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la \"coda\", \u00E8 color denim e finisce con un'appendice a \"V\" un po' pi\u00FA grossa.")), h("mds-accordion-timer-item", { description: "Drednaw" }, h("mds-text", null, "Drednaw \u00E8 un Pok\u00E9mon quadrupede simile ad una tartaruga alligatore. Il corpo \u00E8 principalmente di colore turchese cos\u00EC come le zampe cilindriche e tozze, le quali terminano con tre unghie allungate e bianche. Sulle zampe anteriori, circa sulla loro met\u00E0, spuntanto delle protuberanze simili a scaglie di roccia color marroncino, ricorrenti anche nel resto del corpo: ad esempio, sul muso c'\u00E8 una protuberanza a zig-zag che ospita le sue narici; sulla coda sono alternate delle scaglie e attorno al guscio c'\u00E8 una cornice dello stesso colore; anche le placche superiori sembrano essere fatte di roccia, ma sono di un colore marrone scuro, invece che chiaro. Queste parti rocciose sembrano essere frastagliate, per niente levigate. Il suo volto presenta occhi bassi e imbronciati, con delle guance arancioni e sporgenti ed una bocca a zig-zag, la cui parte inferiore \u00E8 simile al beige, colore presente anche nelle placche del guscio inferiori, che stavolta fanno vedere la pelle a volte grinzosa del Pok\u00E9mon (in particolare attorno al collo e sulle zampe). Le sue scaglie di roccia sono spesso rivolte verso di dietro, dando l'idea di una roccia grezza e non liscia e lavorata.")), h("mds-accordion-timer-item", { description: "Orbeetle" }, h("mds-text", null, "Orbeetle presenta aspetti comuni ad una coccinella ormai matura. Il suo corpo si sviluppa attorno al guscio che \u00E8 di forma semisferica ed \u00E8 metallizzato in grigio (lo si pu\u00F2 vedere in particolare dalla parte inferiore di esso): la sua scocca \u00E8 rossa, con dei pois denim sopra di essa; \u00E8 bisezionata per permettere di aprirsi e attaccare con degli strani poteri. All'estremit\u00E0 del taglio intermedio \u00E8 incastonato il volto di Orbeetle, il quale presenta delle guance bianche con occhi imbronciati celesti, aventi sclere concentriche; sopra di essi ci sono due lunghe sopracciglia dorate a forma di \"V\" e ad incorniciare la faccia del Pok\u00E9mon \u00E8 una cornice grigia, che finisce, con delle striature, sul naso dello stesso. La bocca, assieme alle ginocchia e alla pancia, \u00E8 rossa. Il suo corpo \u00E8 piccolo ed \u00E8 costituito da una vita stretta con una bacino largo, da dove si sviluppano due cosce secche ed esili per poi finire con appuntiti gambali dorati; le sue braccia sono magre e biforcute, come se avessero artigli.")), h("mds-accordion-timer-item", { description: "Dottler" }, h("mds-text", null, "Dottler pu\u00F2 essere considerato la \"crisalide\" della linea evolutiva di Blipbug, vista la sua forma e il suo comportamento. Presenta un guscio di forma poligonale (molto simile a quella di un radar Doppler o di un radome) di color giallo sabbia, con dei pois blu scuro sugli spigoli; leggermente in basso \u00E8 presente la sua faccia di color arancione chiaro, sulla quale ci sono degli occhi celesti attorniati da un contorno arancione, da linee sottili e nere e da delle appendici blu simili a quelle dei Blipbug. Il Pok\u00E9mon non sembra essere dedito a muoversi se non fosse per le quattro zampette blu scuro su cui cammina.")), h("mds-accordion-timer-item", { description: "Centiskorch" }, h("mds-text", null, "Con l'evoluzione Sizzlipede diventa pi\u00F9 aggressivo, soprattutto grazie alla sua stazza pi\u00F9 grande e al suo enorme potenziale. Il corpo diventa pi\u00F9 lungo e si \"seziona\" in dodici parti, anche qui un'estremit\u00E0 \u00E8 la \"coda\" e l'altra \u00E8 la testa, queste due parti, assieme all'intera parte inferiore del corpo sono del rosso mattone presente nella sua pre-evo, mentre le \"parti\" comprese tra la coda e la testa restano marroni/bordeaux; questa volte, dello stesso colore della \"schiena\" sono le zampe, le quali son diventate pi\u00F9 minacciose e uncinate, questa volta sono dieci per ogni lato; marrone/bordeaux sono anche delle tenaglie. presenti in paia, sulla coda e sulla testa; su queste estremit\u00E0 son presenti quattro sbuffi o \"baffi\" di fuoco. Sulla testa \u00E8 presente un simbolo arancione chiaro a forma di punto esclamativo; stessa gamma cromatica \u00E8 presente nei segni circolari situati nella zona inferiore del corpo, i quali son formati, per\u00F2, anche da un anello e da un cerchio, pi\u00F9 interno, di colore giallo sabbia; non sono altro che i punti che Sizzlipede riscalda per attaccare e scottare le prede. I suoi occhi sono giallo elettrico con pupille triangolari color marrone e rovesciati."))));
|
|
13
13
|
export const Default = Template.bind({});
|
|
14
14
|
Default.story = lokiDisabled;
|
|
15
15
|
export const Duration = Template.bind({});
|
|
@@ -13,6 +13,10 @@ const buttonToneVariantDictionary = [
|
|
|
13
13
|
'ghost',
|
|
14
14
|
'quiet',
|
|
15
15
|
];
|
|
16
|
+
const buttonTargetDictionary = [
|
|
17
|
+
'blank',
|
|
18
|
+
'self',
|
|
19
|
+
];
|
|
16
20
|
const buttonSizeDictionary = [
|
|
17
21
|
'sm',
|
|
18
22
|
'md',
|
|
@@ -23,4 +27,4 @@ const buttonIconPositionDictionary = [
|
|
|
23
27
|
'left',
|
|
24
28
|
'right',
|
|
25
29
|
];
|
|
26
|
-
export { buttonSizeDictionary, buttonToneVariantDictionary, buttonVariantDictionary,
|
|
30
|
+
export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonVariantDictionary, };
|
|
@@ -53,6 +53,14 @@ const toneVariantDictionary = [
|
|
|
53
53
|
'ghost',
|
|
54
54
|
'quiet',
|
|
55
55
|
];
|
|
56
|
+
const toneActionVariantDictionary = [
|
|
57
|
+
'primary',
|
|
58
|
+
'secondary',
|
|
59
|
+
'tertiary',
|
|
60
|
+
'strong',
|
|
61
|
+
'weak',
|
|
62
|
+
'quiet',
|
|
63
|
+
];
|
|
56
64
|
const toneSimpleVariantDictionary = [
|
|
57
65
|
'strong',
|
|
58
66
|
'weak',
|
|
@@ -62,4 +70,4 @@ const toneMinimalVariantDictionary = [
|
|
|
62
70
|
'strong',
|
|
63
71
|
'weak',
|
|
64
72
|
];
|
|
65
|
-
export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
|
|
73
|
+
export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const mdsAccordionTimerCss = ":host{display:block}";
|
|
3
|
+
const mdsAccordionTimerCss = ":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;display:block}";
|
|
4
4
|
|
|
5
5
|
const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -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.
|
|
15
|
-
this.timeChecker = null;
|
|
14
|
+
this.timeChecker = 0;
|
|
16
15
|
};
|
|
17
16
|
this.progress = () => {
|
|
18
17
|
return Math.abs(this.remainingTime() / this.duration - 1);
|
|
@@ -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
|
|
96
|
-
|
|
93
|
+
if (this.selectedItem) {
|
|
94
|
+
this.selectedItem.progress = 0;
|
|
97
95
|
}
|
|
98
|
-
|
|
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 ===
|
|
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,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timestamp": "2023-06-23T10:11:40",
|
|
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
|
+
{
|
|
66
|
+
"name": "--mds-accordion-timer-color",
|
|
67
|
+
"annotation": "prop",
|
|
68
|
+
"docs": "Sets the text color of the component mds-accordion-timer-item"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "--mds-accordion-timer-duration",
|
|
72
|
+
"annotation": "prop",
|
|
73
|
+
"docs": "Sets the transition duration of open/close animation of the mds-accordion-timer-item"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "--mds-accordion-timer-progress-bar-background",
|
|
77
|
+
"annotation": "prop",
|
|
78
|
+
"docs": "Sets the background-color of the progress bar when the mds-accordion-timer-item is selected"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "--mds-accordion-timer-progress-bar-color",
|
|
82
|
+
"annotation": "prop",
|
|
83
|
+
"docs": "Sets the color of the progress bar when the mds-accordion-timer-item is selected"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "--mds-accordion-timer-progress-bar-thickness",
|
|
87
|
+
"annotation": "prop",
|
|
88
|
+
"docs": "Sets thickness of the progress bar of the mds-accordion-timer-item"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"slots": [],
|
|
92
|
+
"parts": [],
|
|
93
|
+
"dependents": [],
|
|
94
|
+
"dependencies": [],
|
|
95
|
+
"dependencyGraph": {}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
package/dist/esm/loader.js
CHANGED
|
@@ -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.
|
|
5
|
+
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchEsm = () => {
|
|
8
8
|
return promiseResolve();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-bd689d6a.js';
|
|
2
2
|
|
|
3
|
-
const mdsAccordionTimerCss = ":host{display:block}";
|
|
3
|
+
const mdsAccordionTimerCss = ":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;display:block}";
|
|
4
4
|
|
|
5
5
|
const MdsAccordionTimer = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -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.
|
|
13
|
-
this.timeChecker = null;
|
|
12
|
+
this.timeChecker = 0;
|
|
14
13
|
};
|
|
15
14
|
this.progress = () => {
|
|
16
15
|
return Math.abs(this.remainingTime() / this.duration - 1);
|
|
@@ -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
|
|
94
|
-
|
|
91
|
+
if (this.selectedItem) {
|
|
92
|
+
this.selectedItem.progress = 0;
|
|
95
93
|
}
|
|
96
|
-
|
|
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 ===
|
|
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.
|
|
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.
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bd689d6a.js";var mdsAccordionTimerCss=":host{--mds-accordion-timer-progress-bar-color:rgb(var(--tone-neutral-03));--mds-accordion-timer-progress-bar-background:rgb(var(--tone-neutral-08));--mds-accordion-timer-progress-bar-thickness:0.25rem;--mds-accordion-timer-duration:500ms;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,r){if(r===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};
|