@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
|
@@ -59,6 +59,15 @@ const toneVariantDictionary = [
|
|
|
59
59
|
'quiet',
|
|
60
60
|
]
|
|
61
61
|
|
|
62
|
+
const toneActionVariantDictionary = [
|
|
63
|
+
'primary',
|
|
64
|
+
'secondary',
|
|
65
|
+
'tertiary',
|
|
66
|
+
'strong',
|
|
67
|
+
'weak',
|
|
68
|
+
'quiet',
|
|
69
|
+
]
|
|
70
|
+
|
|
62
71
|
const toneSimpleVariantDictionary = [
|
|
63
72
|
'strong',
|
|
64
73
|
'weak',
|
|
@@ -76,6 +85,7 @@ export {
|
|
|
76
85
|
themeLuminanceVariantDictionary,
|
|
77
86
|
themeStatusVariantDictionary,
|
|
78
87
|
themeVariantDictionary,
|
|
88
|
+
toneActionVariantDictionary,
|
|
79
89
|
toneMinimalVariantDictionary,
|
|
80
90
|
toneSimpleVariantDictionary,
|
|
81
91
|
toneVariantDictionary,
|
package/src/fixtures/icons.json
CHANGED
|
@@ -28,18 +28,22 @@
|
|
|
28
28
|
"mgg/adv-denied",
|
|
29
29
|
"mgg/area-edificabile",
|
|
30
30
|
"mgg/area-weather",
|
|
31
|
+
"mgg/bill",
|
|
31
32
|
"mgg/box-multiple",
|
|
32
33
|
"mgg/breadcrumb",
|
|
33
34
|
"mgg/calendar-euro",
|
|
34
35
|
"mgg/calendar-multiple",
|
|
35
36
|
"mgg/calendar-schedule",
|
|
37
|
+
"mgg/cancelled-sheet",
|
|
36
38
|
"mgg/car-license",
|
|
37
39
|
"mgg/card-stamping",
|
|
38
40
|
"mgg/checklist",
|
|
39
41
|
"mgg/checklist-settings",
|
|
40
42
|
"mgg/citizenship",
|
|
41
43
|
"mgg/city-bin",
|
|
44
|
+
"mgg/classic-permission",
|
|
42
45
|
"mgg/copy-paste",
|
|
46
|
+
"mgg/d-instrumental-buildings",
|
|
43
47
|
"mgg/data-analytics-alt",
|
|
44
48
|
"mgg/data-analytics-search",
|
|
45
49
|
"mgg/data-analytics-time",
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
"mgg/data-end-civil-union",
|
|
51
55
|
"mgg/data-end-marriage",
|
|
52
56
|
"mgg/dataset",
|
|
57
|
+
"mgg/delivered-to-the-recipient",
|
|
53
58
|
"mgg/document-magic",
|
|
54
59
|
"mgg/document-rename",
|
|
55
60
|
"mgg/electronic-document",
|
|
@@ -78,9 +83,13 @@
|
|
|
78
83
|
"mgg/finance-euro-cashback",
|
|
79
84
|
"mgg/fit-horizontal",
|
|
80
85
|
"mgg/fit-vertical",
|
|
86
|
+
"mgg/forwarded-with-a-single-sending",
|
|
81
87
|
"mgg/fullscreen-on-alt",
|
|
82
88
|
"mgg/google-check-small",
|
|
83
89
|
"mgg/google-place-item",
|
|
90
|
+
"mgg/group-assigned-automatically-system",
|
|
91
|
+
"mgg/group-ceased",
|
|
92
|
+
"mgg/group-inherited",
|
|
84
93
|
"mgg/heart",
|
|
85
94
|
"mgg/heart-outline",
|
|
86
95
|
"mgg/historic-building",
|
|
@@ -91,6 +100,7 @@
|
|
|
91
100
|
"mgg/input-calendar-costs",
|
|
92
101
|
"mgg/input-calendar-period",
|
|
93
102
|
"mgg/input-calendar-time",
|
|
103
|
+
"mgg/instrumental-buildings",
|
|
94
104
|
"mgg/isbn",
|
|
95
105
|
"mgg/judge-hammer",
|
|
96
106
|
"mgg/land-registry",
|
|
@@ -112,6 +122,8 @@
|
|
|
112
122
|
"mgg/multiple-payments",
|
|
113
123
|
"mgg/national-document",
|
|
114
124
|
"mgg/national-document-off",
|
|
125
|
+
"mgg/not-instrumental-d-buildings",
|
|
126
|
+
"mgg/not-sent-yet",
|
|
115
127
|
"mgg/order-return-down-left-to-right",
|
|
116
128
|
"mgg/order-return-down-left-to-up",
|
|
117
129
|
"mgg/order-return-down-right-to-left",
|
|
@@ -130,8 +142,10 @@
|
|
|
130
142
|
"mgg/order-zigzag-up-right-to-left",
|
|
131
143
|
"mgg/other-properties",
|
|
132
144
|
"mgg/other-properties-off",
|
|
145
|
+
"mgg/other-residential-buildings",
|
|
133
146
|
"mgg/partial-wall",
|
|
134
147
|
"mgg/payment-settings",
|
|
148
|
+
"mgg/pec-sent-to-the-not-pec-recipient",
|
|
135
149
|
"mgg/places-green",
|
|
136
150
|
"mgg/places-green-doc",
|
|
137
151
|
"mgg/places-green-history",
|
|
@@ -145,10 +159,12 @@
|
|
|
145
159
|
"mgg/relevance",
|
|
146
160
|
"mgg/reporting-abuse",
|
|
147
161
|
"mgg/residency-permit",
|
|
162
|
+
"mgg/roles-permission",
|
|
148
163
|
"mgg/rubber-stamp",
|
|
149
164
|
"mgg/rurale",
|
|
150
165
|
"mgg/search-maggioli",
|
|
151
166
|
"mgg/send-progress",
|
|
167
|
+
"mgg/sending-error",
|
|
152
168
|
"mgg/settings-attachment",
|
|
153
169
|
"mgg/sign-shop",
|
|
154
170
|
"mgg/square-viewfinder",
|
|
@@ -158,6 +174,7 @@
|
|
|
158
174
|
"mgg/status-progress-half",
|
|
159
175
|
"mgg/status-progress-three-quarter",
|
|
160
176
|
"mgg/stuck-codes",
|
|
177
|
+
"mgg/subtractive-permission",
|
|
161
178
|
"mgg/tea-light",
|
|
162
179
|
"mgg/terminal",
|
|
163
180
|
"mgg/todo",
|
|
@@ -174,12 +191,14 @@
|
|
|
174
191
|
"mgg/todo-suspended",
|
|
175
192
|
"mgg/traffic-cone",
|
|
176
193
|
"mgg/trending-down",
|
|
194
|
+
"mgg/tribute",
|
|
177
195
|
"mgg/tributes",
|
|
178
196
|
"mgg/urban-city",
|
|
179
197
|
"mgg/user-dead",
|
|
180
198
|
"mgg/user-family",
|
|
181
199
|
"mgg/user-location",
|
|
182
200
|
"mgg/user-location-off",
|
|
201
|
+
"mgg/user-signed-out",
|
|
183
202
|
"mgg/view-chart-gantt",
|
|
184
203
|
"mgg/view-side-by-side",
|
|
185
204
|
"mgg/work-book",
|
|
@@ -221,6 +240,7 @@
|
|
|
221
240
|
"mi/baseline/navigate-next",
|
|
222
241
|
"mi/baseline/panorama",
|
|
223
242
|
"mi/baseline/person",
|
|
243
|
+
"mi/baseline/pets",
|
|
224
244
|
"mi/baseline/radio-button-checked",
|
|
225
245
|
"mi/baseline/radio-button-unchecked",
|
|
226
246
|
"mi/baseline/route",
|
|
@@ -17,18 +17,22 @@
|
|
|
17
17
|
"mgg/adv-denied",
|
|
18
18
|
"mgg/area-edificabile",
|
|
19
19
|
"mgg/area-weather",
|
|
20
|
+
"mgg/bill",
|
|
20
21
|
"mgg/box-multiple",
|
|
21
22
|
"mgg/breadcrumb",
|
|
22
23
|
"mgg/calendar-euro",
|
|
23
24
|
"mgg/calendar-multiple",
|
|
24
25
|
"mgg/calendar-schedule",
|
|
26
|
+
"mgg/cancelled-sheet",
|
|
25
27
|
"mgg/car-license",
|
|
26
28
|
"mgg/card-stamping",
|
|
27
29
|
"mgg/checklist-settings",
|
|
28
30
|
"mgg/checklist",
|
|
29
31
|
"mgg/citizenship",
|
|
30
32
|
"mgg/city-bin",
|
|
33
|
+
"mgg/classic-permission",
|
|
31
34
|
"mgg/copy-paste",
|
|
35
|
+
"mgg/d-instrumental-buildings",
|
|
32
36
|
"mgg/data-analytics-alt",
|
|
33
37
|
"mgg/data-analytics-search",
|
|
34
38
|
"mgg/data-analytics-time",
|
|
@@ -39,6 +43,7 @@
|
|
|
39
43
|
"mgg/data-end-civil-union",
|
|
40
44
|
"mgg/data-end-marriage",
|
|
41
45
|
"mgg/dataset",
|
|
46
|
+
"mgg/delivered-to-the-recipient",
|
|
42
47
|
"mgg/document-magic",
|
|
43
48
|
"mgg/document-rename",
|
|
44
49
|
"mgg/electronic-document",
|
|
@@ -67,9 +72,13 @@
|
|
|
67
72
|
"mgg/finance-euro-cashback",
|
|
68
73
|
"mgg/fit-horizontal",
|
|
69
74
|
"mgg/fit-vertical",
|
|
75
|
+
"mgg/forwarded-with-a-single-sending",
|
|
70
76
|
"mgg/fullscreen-on-alt",
|
|
71
77
|
"mgg/google-check-small",
|
|
72
78
|
"mgg/google-place-item",
|
|
79
|
+
"mgg/group-assigned-automatically-system",
|
|
80
|
+
"mgg/group-ceased",
|
|
81
|
+
"mgg/group-inherited",
|
|
73
82
|
"mgg/heart-outline",
|
|
74
83
|
"mgg/heart",
|
|
75
84
|
"mgg/historic-building-unusable",
|
|
@@ -80,6 +89,7 @@
|
|
|
80
89
|
"mgg/input-calendar-costs",
|
|
81
90
|
"mgg/input-calendar-period",
|
|
82
91
|
"mgg/input-calendar-time",
|
|
92
|
+
"mgg/instrumental-buildings",
|
|
83
93
|
"mgg/isbn",
|
|
84
94
|
"mgg/judge-hammer",
|
|
85
95
|
"mgg/land-registry",
|
|
@@ -101,6 +111,8 @@
|
|
|
101
111
|
"mgg/multiple-payments",
|
|
102
112
|
"mgg/national-document-off",
|
|
103
113
|
"mgg/national-document",
|
|
114
|
+
"mgg/not-instrumental-d-buildings",
|
|
115
|
+
"mgg/not-sent-yet",
|
|
104
116
|
"mgg/order-return-down-left-to-right",
|
|
105
117
|
"mgg/order-return-down-left-to-up",
|
|
106
118
|
"mgg/order-return-down-right-to-left",
|
|
@@ -119,8 +131,10 @@
|
|
|
119
131
|
"mgg/order-zigzag-up-right-to-left",
|
|
120
132
|
"mgg/other-properties-off",
|
|
121
133
|
"mgg/other-properties",
|
|
134
|
+
"mgg/other-residential-buildings",
|
|
122
135
|
"mgg/partial-wall",
|
|
123
136
|
"mgg/payment-settings",
|
|
137
|
+
"mgg/pec-sent-to-the-not-pec-recipient",
|
|
124
138
|
"mgg/places-green-doc",
|
|
125
139
|
"mgg/places-green-history",
|
|
126
140
|
"mgg/places-green-info",
|
|
@@ -134,10 +148,12 @@
|
|
|
134
148
|
"mgg/relevance",
|
|
135
149
|
"mgg/reporting-abuse",
|
|
136
150
|
"mgg/residency-permit",
|
|
151
|
+
"mgg/roles-permission",
|
|
137
152
|
"mgg/rubber-stamp",
|
|
138
153
|
"mgg/rurale",
|
|
139
154
|
"mgg/search-maggioli",
|
|
140
155
|
"mgg/send-progress",
|
|
156
|
+
"mgg/sending-error",
|
|
141
157
|
"mgg/settings-attachment",
|
|
142
158
|
"mgg/sign-shop",
|
|
143
159
|
"mgg/square-viewfinder",
|
|
@@ -147,6 +163,7 @@
|
|
|
147
163
|
"mgg/status-progress-half",
|
|
148
164
|
"mgg/status-progress-three-quarter",
|
|
149
165
|
"mgg/stuck-codes",
|
|
166
|
+
"mgg/subtractive-permission",
|
|
150
167
|
"mgg/tea-light",
|
|
151
168
|
"mgg/terminal",
|
|
152
169
|
"mgg/todo-completed-re-executable",
|
|
@@ -163,12 +180,14 @@
|
|
|
163
180
|
"mgg/todo",
|
|
164
181
|
"mgg/traffic-cone",
|
|
165
182
|
"mgg/trending-down",
|
|
183
|
+
"mgg/tribute",
|
|
166
184
|
"mgg/tributes",
|
|
167
185
|
"mgg/urban-city",
|
|
168
186
|
"mgg/user-dead",
|
|
169
187
|
"mgg/user-family",
|
|
170
188
|
"mgg/user-location-off",
|
|
171
189
|
"mgg/user-location",
|
|
190
|
+
"mgg/user-signed-out",
|
|
172
191
|
"mgg/view-chart-gantt",
|
|
173
192
|
"mgg/view-side-by-side",
|
|
174
193
|
"mgg/work-book"
|
package/src/type/button.ts
CHANGED
package/src/type/variant.ts
CHANGED
|
@@ -57,6 +57,15 @@ export type StateVariantType =
|
|
|
57
57
|
| 'focused'
|
|
58
58
|
| 'readonly'
|
|
59
59
|
|
|
60
|
+
export type ToneActionVariantType =
|
|
61
|
+
| 'primary' // background strong
|
|
62
|
+
| 'secondary' // background weak
|
|
63
|
+
| 'tertiary' // no background, no border
|
|
64
|
+
| 'strong' // background strong
|
|
65
|
+
| 'weak' // background weak
|
|
66
|
+
| 'ghost' // bordered
|
|
67
|
+
| 'quiet' // no background, no border
|
|
68
|
+
|
|
60
69
|
export type ToneVariantType =
|
|
61
70
|
| 'strong' // background strong
|
|
62
71
|
| 'weak' // background weak
|
|
@@ -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-
|
|
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-778834a9",[[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-
|
|
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
|
+
System.register(["./p-5029b85d.system.js"],(function(e){"use strict";var t,i,r,n,s;return{setters:[function(e){t=e.r;i=e.c;r=e.h;n=e.H;s=e.g}],execute:function(){var c=":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 o=e("mds_accordion_timer",function(){function e(e){var r=this;t(this,e);this.changeEvent=i(this,"mdsAccordionTimerChange",7);this.clearIntervals=function(){window.clearInterval(r.timer);window.clearInterval(r.timeChecker);r.timeChecker=0};this.progress=function(){return Math.abs(r.remainingTime()/r.duration-1)};this.addTimeListener=function(){r.timeChecker=window.setInterval((function(){var e=r.progress();if(r.selectedItem!==undefined){r.selectedItem.progress=e}if(e===1){r.selectedItem.progress=0;r.startNext()}}),100)};this.beginningTime=function(){r.timeStarted=(new Date).getTime();return r.timeStarted};this.remainingTime=function(){var e=r.selectedItemDurationTime-((new Date).getTime()-r.timeStarted);return e>=0?e:0};this.setSelectedItem=function(e){r.children.forEach((function(t,i){if(i===e){t.selected=true;r.selectedItem=t;r.changeEvent.emit()}else{t.selected=false}}))};this.startNext=function(){var e=r.selectedItem.uuid+1>r.children.length-1?0:r.selectedItem.uuid+1;r.setSelectedItem(e);r.startTimer()};this.startTimer=function(){r.clearIntervals();r.time=r.beginningTime();r.selectedItemDurationTime=r.duration;r.addTimeListener()};this.playTimer=function(){r.beginningTime();r.addTimeListener()};this.pauseTimer=function(){r.clearIntervals();r.selectedItemDurationTime=r.remainingTime()};this.stopTimer=function(){r.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 r(n,null,r("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-
|
|
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-2a65b768.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,H as h,g as o}from"./p-a7b74010.js";const r=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 o(this)}};r.style=":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}";export{r 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()}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()):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,19 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing'
|
|
2
|
-
import { MdsAccordionTimer } from '../mds-accordion-timer'
|
|
3
|
-
|
|
4
|
-
describe('mds-accordion-timer', () => {
|
|
5
|
-
it('renders', async () => {
|
|
6
|
-
const page = await newSpecPage({
|
|
7
|
-
components: [MdsAccordionTimer],
|
|
8
|
-
html: '<mds-accordion-timer></mds-accordion-timer>',
|
|
9
|
-
})
|
|
10
|
-
// expect(page.root).toEqualHtml(`
|
|
11
|
-
// <mds-accordion-timer>
|
|
12
|
-
// <mock:shadow-root>
|
|
13
|
-
// <slot></slot>
|
|
14
|
-
// </mock:shadow-root>
|
|
15
|
-
// </mds-accordion-timer>
|
|
16
|
-
// `)
|
|
17
|
-
expect(true).toBe(true)
|
|
18
|
-
})
|
|
19
|
-
})
|
|
@@ -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()}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()):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}
|