@maggioli-design-system/mds-accordion-timer 3.3.0 → 3.4.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.
- package/dist/cjs/{index-b99075ba.js → index-569353a6.js} +191 -45
- package/dist/cjs/loader.cjs.js +2 -11
- package/dist/cjs/mds-accordion-timer.cjs.entry.js +1 -1
- package/dist/cjs/mds-accordion-timer.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/common/aria.js +9 -1
- package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +4 -1
- package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.e2e.js +10 -0
- package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +2 -2
- package/dist/collection/dictionary/icon.js +2 -2
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +1 -2
- package/dist/components/mds-accordion-timer.js +1 -1
- package/dist/documentation.d.ts +361 -88
- package/dist/documentation.json +28 -7
- package/dist/esm/{index-bd689d6a.js → index-8c22e0f7.js} +191 -45
- package/dist/esm/loader.js +3 -12
- package/dist/esm/mds-accordion-timer.entry.js +1 -1
- package/dist/esm/mds-accordion-timer.js +3 -3
- package/dist/esm-es5/index-8c22e0f7.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-accordion-timer.entry.js +1 -1
- package/dist/esm-es5/mds-accordion-timer.js +1 -1
- package/dist/mds-accordion-timer/mds-accordion-timer.esm.js +1 -1
- package/dist/mds-accordion-timer/mds-accordion-timer.js +2 -6
- package/dist/mds-accordion-timer/p-0bdccf30.js +2 -0
- package/dist/mds-accordion-timer/{p-778834a9.entry.js → p-8c113821.entry.js} +1 -1
- package/dist/mds-accordion-timer/{p-5e09eed0.system.js → p-9036e977.system.js} +1 -1
- package/dist/mds-accordion-timer/{p-2a65b768.system.entry.js → p-bb796904.system.entry.js} +1 -1
- package/dist/mds-accordion-timer/p-df0a41f6.system.js +2 -0
- package/dist/stats.json +41 -33
- package/dist/types/common/aria.d.ts +2 -1
- package/dist/types/components/mds-accordion-timer/mds-accordion-timer.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +32 -17
- package/documentation.json +381 -9
- package/loader/index.d.ts +2 -2
- package/package.json +5 -5
- package/readme.md +10 -1
- package/src/common/aria.ts +12 -0
- package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +4 -0
- package/src/components/mds-accordion-timer/readme.md +8 -1
- package/src/fixtures/icons.json +22 -0
- package/src/fixtures/iconsauce.json +19 -0
- package/www/build/mds-accordion-timer.esm.js +1 -1
- package/www/build/mds-accordion-timer.js +2 -6
- package/www/build/p-0bdccf30.js +2 -0
- package/www/build/{p-778834a9.entry.js → p-8c113821.entry.js} +1 -1
- package/www/build/{p-5e09eed0.system.js → p-9036e977.system.js} +1 -1
- package/www/build/{p-2a65b768.system.entry.js → p-bb796904.system.entry.js} +1 -1
- package/www/build/p-df0a41f6.system.js +2 -0
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/index-bd689d6a.js +0 -2
- package/dist/mds-accordion-timer/p-5029b85d.system.js +0 -2
- package/dist/mds-accordion-timer/p-a7b74010.js +0 -2
- package/www/build/p-5029b85d.system.js +0 -2
- package/www/build/p-a7b74010.js +0 -2
|
@@ -27,6 +27,13 @@ const uniqueTime = (key, measureText) => {
|
|
|
27
27
|
};
|
|
28
28
|
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
29
29
|
const isDef = (v) => v != null;
|
|
30
|
+
/**
|
|
31
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
32
|
+
* function.
|
|
33
|
+
*
|
|
34
|
+
* @param o the value to check
|
|
35
|
+
* @returns whether it's a complex type or not
|
|
36
|
+
*/
|
|
30
37
|
const isComplexType = (o) => {
|
|
31
38
|
// https://jsperf.com/typeof-fn-object/5
|
|
32
39
|
o = typeof o;
|
|
@@ -195,9 +202,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
195
202
|
}
|
|
196
203
|
styles.set(scopeId, style);
|
|
197
204
|
};
|
|
198
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
205
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
199
206
|
var _a;
|
|
200
|
-
|
|
207
|
+
const scopeId = getScopeId(cmpMeta);
|
|
201
208
|
const style = styles.get(scopeId);
|
|
202
209
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
203
210
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -212,10 +219,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
212
219
|
}
|
|
213
220
|
if (!appliedStyles.has(scopeId)) {
|
|
214
221
|
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
styleElm.innerHTML = style;
|
|
218
|
-
}
|
|
222
|
+
styleElm = doc.createElement('style');
|
|
223
|
+
styleElm.innerHTML = style;
|
|
219
224
|
// Apply CSP nonce to the style tag if it exists
|
|
220
225
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
221
226
|
if (nonce != null) {
|
|
@@ -333,15 +338,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
333
338
|
* @param vnodes a list of virtual DOM nodes to remove
|
|
334
339
|
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
335
340
|
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
336
|
-
* @param vnode a VNode
|
|
337
|
-
* @param elm an element
|
|
338
341
|
*/
|
|
339
|
-
const removeVnodes = (vnodes, startIdx, endIdx
|
|
340
|
-
for (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
elm
|
|
342
|
+
const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
343
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
344
|
+
const vnode = vnodes[index];
|
|
345
|
+
if (vnode) {
|
|
346
|
+
const elm = vnode.$elm$;
|
|
347
|
+
if (elm) {
|
|
348
|
+
// remove the vnode's element from the dom
|
|
349
|
+
elm.remove();
|
|
350
|
+
}
|
|
345
351
|
}
|
|
346
352
|
}
|
|
347
353
|
};
|
|
@@ -581,12 +587,39 @@ const patch = (oldVNode, newVNode) => {
|
|
|
581
587
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
582
588
|
* the DOM node into which it should be rendered.
|
|
583
589
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
590
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
584
591
|
*/
|
|
585
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
592
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
586
593
|
const hostElm = hostRef.$hostElement$;
|
|
587
594
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
595
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
596
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
597
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
598
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
599
|
+
// contains attrs that need to be set on the host element.
|
|
588
600
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
589
601
|
hostTagName = hostElm.tagName;
|
|
602
|
+
// On the first render and *only* on the first render we want to check for
|
|
603
|
+
// any attributes set on the host element which are also set on the vdom
|
|
604
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
605
|
+
// the value from the host element, which allows developers building apps
|
|
606
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
607
|
+
// component even if it's already set on the `Host`.
|
|
608
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
609
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
610
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
611
|
+
// `class` which reconciles values coming from the VDom with values
|
|
612
|
+
// already present on the DOM element, so we don't want to override those
|
|
613
|
+
// attributes on the VDom tree with values from the host element if they
|
|
614
|
+
// are present.
|
|
615
|
+
//
|
|
616
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
617
|
+
// runtime and we don't want to override those either.
|
|
618
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
619
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
590
623
|
rootVnode.$tag$ = null;
|
|
591
624
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
592
625
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -617,24 +650,85 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
617
650
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
618
651
|
return writeTask(dispatch) ;
|
|
619
652
|
};
|
|
653
|
+
/**
|
|
654
|
+
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
655
|
+
* component lifecycle methods like `componentWillLoad` as well as
|
|
656
|
+
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
657
|
+
*
|
|
658
|
+
* @param hostRef a reference to a host DOM node
|
|
659
|
+
* @param isInitialLoad whether we're on the initial load or not
|
|
660
|
+
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
661
|
+
* the component
|
|
662
|
+
*/
|
|
620
663
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
621
664
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
622
665
|
const instance = hostRef.$lazyInstance$ ;
|
|
623
|
-
|
|
666
|
+
// We're going to use this variable together with `enqueue` to implement a
|
|
667
|
+
// little promise-based queue. We start out with it `undefined`. When we add
|
|
668
|
+
// the first function to the queue we'll set this variable to be that
|
|
669
|
+
// function's return value. When we attempt to add subsequent values to the
|
|
670
|
+
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
671
|
+
// the new function off of that `Promise` using `.then()`. This will give our
|
|
672
|
+
// queue two nice properties:
|
|
673
|
+
//
|
|
674
|
+
// 1. If all functions added to the queue are synchronous they'll be called
|
|
675
|
+
// synchronously right away.
|
|
676
|
+
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
677
|
+
// called in order after `dispatchHooks` exits.
|
|
678
|
+
let maybePromise;
|
|
624
679
|
if (isInitialLoad) {
|
|
625
680
|
{
|
|
626
681
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
627
682
|
if (hostRef.$queuedListeners$) {
|
|
628
683
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
629
|
-
hostRef.$queuedListeners$ =
|
|
684
|
+
hostRef.$queuedListeners$ = undefined;
|
|
630
685
|
}
|
|
631
686
|
}
|
|
632
687
|
}
|
|
633
688
|
endSchedule();
|
|
634
|
-
return
|
|
689
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
635
690
|
};
|
|
691
|
+
/**
|
|
692
|
+
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
693
|
+
* of functions to be called.
|
|
694
|
+
*
|
|
695
|
+
* The queue is ordered on the basis of the first argument. If it's
|
|
696
|
+
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
697
|
+
* be called synchronously (although note that this function may return a
|
|
698
|
+
* `Promise`). The idea is that then the return value of that enqueueing
|
|
699
|
+
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
700
|
+
* functions can be enqueued by calling this function again with that `Promise`
|
|
701
|
+
* as the first argument.
|
|
702
|
+
*
|
|
703
|
+
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
704
|
+
* @param fn a function to enqueue
|
|
705
|
+
* @returns either a `Promise` or the return value of the provided function
|
|
706
|
+
*/
|
|
707
|
+
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
708
|
+
/**
|
|
709
|
+
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
710
|
+
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
711
|
+
* the global has been overwritten, this is could be misleading, so we also do
|
|
712
|
+
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
713
|
+
* defined and a function.
|
|
714
|
+
*
|
|
715
|
+
* @param maybePromise it might be a promise!
|
|
716
|
+
* @returns whether it is or not
|
|
717
|
+
*/
|
|
718
|
+
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
719
|
+
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
720
|
+
/**
|
|
721
|
+
* Update a component given reference to its host elements and so on.
|
|
722
|
+
*
|
|
723
|
+
* @param hostRef an object containing references to the element's host node,
|
|
724
|
+
* VDom nodes, and other metadata
|
|
725
|
+
* @param instance a reference to the underlying host element where it will be
|
|
726
|
+
* rendered
|
|
727
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
728
|
+
* the first render cycle
|
|
729
|
+
*/
|
|
636
730
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
637
|
-
|
|
731
|
+
var _a;
|
|
638
732
|
const elm = hostRef.$hostElement$;
|
|
639
733
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
640
734
|
const rc = elm['s-rc'];
|
|
@@ -644,7 +738,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
644
738
|
}
|
|
645
739
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
646
740
|
{
|
|
647
|
-
callRender(hostRef, instance);
|
|
741
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
648
742
|
}
|
|
649
743
|
if (rc) {
|
|
650
744
|
// ok, so turns out there are some child host elements
|
|
@@ -656,7 +750,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
656
750
|
endRender();
|
|
657
751
|
endUpdate();
|
|
658
752
|
{
|
|
659
|
-
const childrenPromises = elm['s-p'];
|
|
753
|
+
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
660
754
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
661
755
|
if (childrenPromises.length === 0) {
|
|
662
756
|
postUpdate();
|
|
@@ -668,7 +762,19 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
668
762
|
}
|
|
669
763
|
}
|
|
670
764
|
};
|
|
671
|
-
|
|
765
|
+
/**
|
|
766
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
767
|
+
* various build variables
|
|
768
|
+
*
|
|
769
|
+
* @param hostRef an object containing references to the element's host node,
|
|
770
|
+
* VDom nodes, and other metadata
|
|
771
|
+
* @param instance a reference to the underlying host element where it will be
|
|
772
|
+
* rendered
|
|
773
|
+
* @param elm the Host element for the component
|
|
774
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
775
|
+
* @returns an empty promise
|
|
776
|
+
*/
|
|
777
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
672
778
|
try {
|
|
673
779
|
instance = instance.render() ;
|
|
674
780
|
{
|
|
@@ -683,7 +789,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
683
789
|
// or we need to update the css class/attrs on the host element
|
|
684
790
|
// DOM WRITE!
|
|
685
791
|
{
|
|
686
|
-
renderVdom(hostRef, instance);
|
|
792
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
687
793
|
}
|
|
688
794
|
}
|
|
689
795
|
}
|
|
@@ -754,9 +860,6 @@ const safeCall = (instance, method, arg) => {
|
|
|
754
860
|
}
|
|
755
861
|
return undefined;
|
|
756
862
|
};
|
|
757
|
-
const then = (promise, thenFn) => {
|
|
758
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
759
|
-
};
|
|
760
863
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
761
864
|
;
|
|
762
865
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -796,6 +899,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
796
899
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
797
900
|
*/
|
|
798
901
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
902
|
+
var _a;
|
|
799
903
|
if (cmpMeta.$members$) {
|
|
800
904
|
// It's better to have a const than two Object.entries()
|
|
801
905
|
const members = Object.entries(cmpMeta.$members$);
|
|
@@ -820,7 +924,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
820
924
|
});
|
|
821
925
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
822
926
|
const attrNameToPropName = new Map();
|
|
823
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
927
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
824
928
|
plt.jmp(() => {
|
|
825
929
|
const propName = attrNameToPropName.get(attrName);
|
|
826
930
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
@@ -843,12 +947,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
843
947
|
// customElements.define('my-component', MyComponent);
|
|
844
948
|
// </script>
|
|
845
949
|
// ```
|
|
846
|
-
// In this case if we do not
|
|
950
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
847
951
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
848
952
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
849
|
-
// the connectedCallback attempts to
|
|
953
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
850
954
|
//
|
|
851
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
955
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
852
956
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
853
957
|
//
|
|
854
958
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -868,18 +972,46 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
868
972
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
869
973
|
return;
|
|
870
974
|
}
|
|
975
|
+
else if (propName == null) {
|
|
976
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
977
|
+
// on a vanilla web component
|
|
978
|
+
const hostRef = getHostRef(this);
|
|
979
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
980
|
+
// We only want to trigger the callback(s) if:
|
|
981
|
+
// 1. The instance is ready
|
|
982
|
+
// 2. The watchers are ready
|
|
983
|
+
// 3. The value has changed
|
|
984
|
+
if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
985
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
986
|
+
newValue !== oldValue) {
|
|
987
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
988
|
+
const entry = cmpMeta.$watchers$[attrName];
|
|
989
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
990
|
+
if (instance[callbackName] != null) {
|
|
991
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
871
997
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
872
998
|
});
|
|
873
999
|
};
|
|
874
|
-
//
|
|
875
|
-
//
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1000
|
+
// Create an array of attributes to observe
|
|
1001
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1002
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1003
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1004
|
+
// an invalid attribute.
|
|
1005
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1006
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1007
|
+
...members
|
|
1008
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1009
|
+
.map(([propName, m]) => {
|
|
1010
|
+
const attrName = m[1] || propName;
|
|
1011
|
+
attrNameToPropName.set(attrName, propName);
|
|
1012
|
+
return attrName;
|
|
1013
|
+
}),
|
|
1014
|
+
]));
|
|
883
1015
|
}
|
|
884
1016
|
}
|
|
885
1017
|
return Cstr;
|
|
@@ -887,9 +1019,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
887
1019
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
888
1020
|
// initializeComponent
|
|
889
1021
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1022
|
+
// Let the runtime know that the component has been initialized
|
|
1023
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
890
1024
|
{
|
|
891
|
-
// we haven't initialized this element yet
|
|
892
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
893
1025
|
// lazy loaded components
|
|
894
1026
|
// request the component's implementation to be
|
|
895
1027
|
// wired up with the host element
|
|
@@ -953,6 +1085,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
953
1085
|
schedule();
|
|
954
1086
|
}
|
|
955
1087
|
};
|
|
1088
|
+
const fireConnectedCallback = (instance) => {
|
|
1089
|
+
};
|
|
956
1090
|
const connectedCallback = (elm) => {
|
|
957
1091
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
958
1092
|
const hostRef = getHostRef(elm);
|
|
@@ -996,22 +1130,34 @@ const connectedCallback = (elm) => {
|
|
|
996
1130
|
// reattach any event listeners to the host
|
|
997
1131
|
// since they would have been removed when disconnected
|
|
998
1132
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1133
|
+
// fire off connectedCallback() on component instance
|
|
1134
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1135
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1136
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1137
|
+
}
|
|
999
1138
|
}
|
|
1000
1139
|
endConnected();
|
|
1001
1140
|
}
|
|
1002
1141
|
};
|
|
1003
|
-
const
|
|
1142
|
+
const disconnectInstance = (instance) => {
|
|
1143
|
+
{
|
|
1144
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
const disconnectedCallback = async (elm) => {
|
|
1004
1148
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1005
1149
|
const hostRef = getHostRef(elm);
|
|
1006
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1007
1150
|
{
|
|
1008
1151
|
if (hostRef.$rmListeners$) {
|
|
1009
1152
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1010
1153
|
hostRef.$rmListeners$ = undefined;
|
|
1011
1154
|
}
|
|
1012
1155
|
}
|
|
1013
|
-
{
|
|
1014
|
-
|
|
1156
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
1157
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1158
|
+
}
|
|
1159
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1160
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1015
1161
|
}
|
|
1016
1162
|
}
|
|
1017
1163
|
};
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { s as setNonce } from './index-
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
6
|
-
*/
|
|
7
|
-
const patchEsm = () => {
|
|
8
|
-
return promiseResolve();
|
|
9
|
-
};
|
|
1
|
+
import { b as bootstrapLazy } from './index-8c22e0f7.js';
|
|
2
|
+
export { s as setNonce } from './index-8c22e0f7.js';
|
|
10
3
|
|
|
11
4
|
const defineCustomElements = (win, options) => {
|
|
12
|
-
if (typeof window === 'undefined') return
|
|
13
|
-
return patchEsm().then(() => {
|
|
5
|
+
if (typeof window === 'undefined') return undefined;
|
|
14
6
|
return bootstrapLazy([["mds-accordion-timer",[[1,"mds-accordion-timer",{"duration":[2],"time":[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]], options);
|
|
15
|
-
});
|
|
16
7
|
};
|
|
17
8
|
|
|
18
9
|
export { defineCustomElements };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8c22e0f7.js';
|
|
2
2
|
|
|
3
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
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-8c22e0f7.js';
|
|
2
|
+
export { s as setNonce } from './index-8c22e0f7.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Browser
|
|
5
|
+
Stencil Client Patch Browser v4.3.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchBrowser = () => {
|
|
8
8
|
const importMeta = import.meta.url;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):a(e.value).then(i,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(n=0)),n)try{if(r=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;a=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];a=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++){if(o||!(r in t)){if(!o)o=Array.prototype.slice.call(t,0,r);o[r]=t[r]}}return e.concat(o||Array.prototype.slice.call(t))};var NAMESPACE="mds-accordion-timer";var scopeId;var hostTagName;var queuePending=false;var createTime=function(e,t){if(t===void 0){t=""}{return function(){return}}};var uniqueTime=function(e,t){{return function(){return}}};var HYDRATED_CSS="{visibility:hidden}[hydrated]{visibility:inherit}";var isDef=function(e){return e!=null};var isComplexType=function(e){e=typeof e;return e==="object"||e==="function"};function queryNonceMetaTagContent(e){var t,n,r;return(r=(n=(t=e.head)===null||t===void 0?void 0:t.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&r!==void 0?r:undefined}var h=function(e,t){var n=[];for(var r=2;r<arguments.length;r++){n[r-2]=arguments[r]}var a=null;var o=false;var i=false;var s=[];var l=function(t){for(var n=0;n<t.length;n++){a=t[n];if(Array.isArray(a)){l(a)}else if(a!=null&&typeof a!=="boolean"){if(o=typeof e!=="function"&&!isComplexType(a)){a=String(a)}if(o&&i){s[s.length-1].$text$+=a}else{s.push(o?newVNode(null,a):a)}i=o}}};l(n);var u=newVNode(e,null);u.$attrs$=t;if(s.length>0){u.$children$=s}return u};var newVNode=function(e,t){var n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return n};var Host={};var isHost=function(e){return e&&e.$tag$===Host};var parsePropertyValue=function(e,t){if(e!=null&&!isComplexType(e)){if(t&2){return parseFloat(e)}return e}return e};var getElement=function(e){return getHostRef(e).$hostElement$};var createEvent=function(e,t,n){var r=getElement(e);return{emit:function(e){return emitEvent(r,t,{bubbles:!!(n&4),composed:!!(n&2),cancelable:!!(n&1),detail:e})}}};var emitEvent=function(e,t,n){var r=plt.ce(t,n);e.dispatchEvent(r);return r};var rootAppliedStyles=new WeakMap;var registerStyle=function(e,t,n){var r=styles.get(e);if(supportsConstructableStylesheets&&n){r=r||new CSSStyleSheet;if(typeof r==="string"){r=t}else{r.replaceSync(t)}}else{r=t}styles.set(e,r)};var addStyle=function(e,t,n){var r;var a=getScopeId(t);var o=styles.get(a);e=e.nodeType===11?e:doc;if(o){if(typeof o==="string"){e=e.head||e;var i=rootAppliedStyles.get(e);var s=void 0;if(!i){rootAppliedStyles.set(e,i=new Set)}if(!i.has(a)){{s=doc.createElement("style");s.innerHTML=o;var l=(r=plt.$nonce$)!==null&&r!==void 0?r:queryNonceMetaTagContent(doc);if(l!=null){s.setAttribute("nonce",l)}e.insertBefore(s,e.querySelector("link"))}if(i){i.add(a)}}}else if(!e.adoptedStyleSheets.includes(o)){e.adoptedStyleSheets=__spreadArray(__spreadArray([],e.adoptedStyleSheets,true),[o],false)}}return a};var attachStyles=function(e){var t=e.$cmpMeta$;var n=e.$hostElement$;var r=t.$flags$;var a=createTime("attachStyles",t.$tagName$);var o=addStyle(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);if(r&10){n["s-sc"]=o;n.classList.add(o+"-h")}a()};var getScopeId=function(e,t){return"sc-"+e.$tagName$};var createElm=function(e,t,n,r){var a=t.$children$[n];var o=0;var i;var s;{i=a.$elm$=doc.createElement(a.$tag$);if(isDef(scopeId)&&i["s-si"]!==scopeId){i.classList.add(i["s-si"]=scopeId)}if(a.$children$){for(o=0;o<a.$children$.length;++o){s=createElm(e,a,o);if(s){i.appendChild(s)}}}}return i};var addVnodes=function(e,t,n,r,a,o){var i=e;var s;if(i.shadowRoot&&i.tagName===hostTagName){i=i.shadowRoot}for(;a<=o;++a){if(r[a]){s=createElm(null,n,a);if(s){r[a].$elm$=s;i.insertBefore(s,t)}}}};var removeVnodes=function(e,t,n){for(var r=t;r<=n;++r){var a=e[r];if(a){var o=a.$elm$;if(o){o.remove()}}}};var updateChildren=function(e,t,n,r){var a=0;var o=0;var i=t.length-1;var s=t[0];var l=t[i];var u=r.length-1;var c=r[0];var f=r[u];var $;while(a<=i&&o<=u){if(s==null){s=t[++a]}else if(l==null){l=t[--i]}else if(c==null){c=r[++o]}else if(f==null){f=r[--u]}else if(isSameVnode(s,c)){patch(s,c);s=t[++a];c=r[++o]}else if(isSameVnode(l,f)){patch(l,f);l=t[--i];f=r[--u]}else if(isSameVnode(s,f)){patch(s,f);e.insertBefore(s.$elm$,l.$elm$.nextSibling);s=t[++a];f=r[--u]}else if(isSameVnode(l,c)){patch(l,c);e.insertBefore(l.$elm$,s.$elm$);l=t[--i];c=r[++o]}else{{$=createElm(t&&t[o],n,o);c=r[++o]}if($){{s.$elm$.parentNode.insertBefore($,s.$elm$)}}}}if(a>i){addVnodes(e,r[u+1]==null?null:r[u+1].$elm$,n,r,o,u)}else if(o>u){removeVnodes(t,a,i)}};var isSameVnode=function(e,t){if(e.$tag$===t.$tag$){return true}return false};var patch=function(e,t){var n=t.$elm$=e.$elm$;var r=e.$children$;var a=t.$children$;{if(r!==null&&a!==null){updateChildren(n,r,t,a)}else if(a!==null){addVnodes(n,null,t,a,0,a.length-1)}else if(r!==null){removeVnodes(r,0,r.length-1)}}};var renderVdom=function(e,t,n){if(n===void 0){n=false}var r=e.$hostElement$;var a=e.$vnode$||newVNode(null,null);var o=isHost(t)?t:h(null,null,t);hostTagName=r.tagName;if(n&&o.$attrs$){for(var i=0,s=Object.keys(o.$attrs$);i<s.length;i++){var l=s[i];if(r.hasAttribute(l)&&!["key","ref","style","class"].includes(l)){o.$attrs$[l]=r[l]}}}o.$tag$=null;o.$flags$|=4;e.$vnode$=o;o.$elm$=a.$elm$=r.shadowRoot||r;{scopeId=r["s-sc"]}patch(a,o)};var attachToAncestor=function(e,t){if(t&&!e.$onRenderResolve$&&t["s-p"]){t["s-p"].push(new Promise((function(t){return e.$onRenderResolve$=t})))}};var scheduleUpdate=function(e,t){{e.$flags$|=16}if(e.$flags$&4){e.$flags$|=512;return}attachToAncestor(e,e.$ancestorComponent$);var n=function(){return dispatchHooks(e,t)};return writeTask(n)};var dispatchHooks=function(e,t){var n=createTime("scheduleUpdate",e.$cmpMeta$.$tagName$);var r=e.$lazyInstance$;var a;if(t){{e.$flags$|=256;if(e.$queuedListeners$){e.$queuedListeners$.map((function(e){var t=e[0],n=e[1];return safeCall(r,t,n)}));e.$queuedListeners$=undefined}}}n();return enqueue(a,(function(){return updateComponent(e,r,t)}))};var enqueue=function(e,t){return isPromisey(e)?e.then(t):t()};var isPromisey=function(e){return e instanceof Promise||e&&e.then&&typeof e.then==="function"};var updateComponent=function(e,t,n){return __awaiter(void 0,void 0,void 0,(function(){var r,a,o,i,s,l,u;return __generator(this,(function(c){a=e.$hostElement$;o=createTime("update",e.$cmpMeta$.$tagName$);i=a["s-rc"];if(n){attachStyles(e)}s=createTime("render",e.$cmpMeta$.$tagName$);{callRender(e,t,a,n)}if(i){i.map((function(e){return e()}));a["s-rc"]=undefined}s();o();{l=(r=a["s-p"])!==null&&r!==void 0?r:[];u=function(){return postUpdateComponent(e)};if(l.length===0){u()}else{Promise.all(l).then(u);e.$flags$|=4;l.length=0}}return[2]}))}))};var callRender=function(e,t,n,r){try{t=t.render();{e.$flags$&=~16}{e.$flags$|=2}{{{renderVdom(e,t,r)}}}}catch(t){consoleError(t,e.$hostElement$)}return null};var postUpdateComponent=function(e){var t=e.$cmpMeta$.$tagName$;var n=e.$hostElement$;var r=createTime("postUpdate",t);var a=e.$lazyInstance$;var o=e.$ancestorComponent$;if(!(e.$flags$&64)){e.$flags$|=64;{addHydratedFlag(n)}{safeCall(a,"componentDidLoad")}r();{e.$onReadyResolve$(n);if(!o){appDidLoad()}}}else{r()}{if(e.$onRenderResolve$){e.$onRenderResolve$();e.$onRenderResolve$=undefined}if(e.$flags$&512){nextTick((function(){return scheduleUpdate(e,false)}))}e.$flags$&=~(4|512)}};var appDidLoad=function(e){{addHydratedFlag(doc.documentElement)}nextTick((function(){return emitEvent(win,"appload",{detail:{namespace:NAMESPACE}})}))};var safeCall=function(e,t,n){if(e&&e[t]){try{return e[t](n)}catch(e){consoleError(e)}}return undefined};var addHydratedFlag=function(e){return e.setAttribute("hydrated","")};var getValue=function(e,t){return getHostRef(e).$instanceValues$.get(t)};var setValue=function(e,t,n,r){var a=getHostRef(e);var o=a.$instanceValues$.get(t);var i=a.$flags$;var s=a.$lazyInstance$;n=parsePropertyValue(n,r.$members$[t][0]);var l=Number.isNaN(o)&&Number.isNaN(n);var u=n!==o&&!l;if((!(i&8)||o===undefined)&&u){a.$instanceValues$.set(t,n);if(s){if((i&(2|16))===2){scheduleUpdate(a,false)}}}};var proxyComponent=function(e,t,n){var r;if(t.$members$){var a=Object.entries(t.$members$);var o=e.prototype;a.map((function(e){var r=e[0],a=e[1][0];if(a&31||n&2&&a&32){Object.defineProperty(o,r,{get:function(){return getValue(this,r)},set:function(e){setValue(this,r,e,t)},configurable:true,enumerable:true})}}));if(n&1){var i=new Map;o.attributeChangedCallback=function(e,n,r){var a=this;plt.jmp((function(){var s=i.get(e);if(a.hasOwnProperty(s)){r=a[s];delete a[s]}else if(o.hasOwnProperty(s)&&typeof a[s]==="number"&&a[s]==r){return}else if(s==null){var l=getHostRef(a);var u=l===null||l===void 0?void 0:l.$flags$;if(!(u&8)&&u&128&&r!==n){var c=l.$lazyInstance$;var f=t.$watchers$[e];f===null||f===void 0?void 0:f.forEach((function(t){if(c[t]!=null){c[t].call(c,r,n,e)}}))}return}a[s]=r===null&&typeof a[s]==="boolean"?false:r}))};e.observedAttributes=Array.from(new Set(__spreadArray(__spreadArray([],Object.keys((r=t.$watchers$)!==null&&r!==void 0?r:{}),true),a.filter((function(e){var t=e[0],n=e[1];return n[0]&15})).map((function(e){var t=e[0],n=e[1];var r=n[1]||t;i.set(r,t);return r})),true)))}}return e};var initializeComponent=function(e,t,n,r,a){return __awaiter(void 0,void 0,void 0,(function(){var e,r,o,i,s,l,u;return __generator(this,(function(c){switch(c.label){case 0:if(!((t.$flags$&32)===0))return[3,3];t.$flags$|=32;a=loadModule(n);if(!a.then)return[3,2];e=uniqueTime();return[4,a];case 1:a=c.sent();e();c.label=2;case 2:if(!a.isProxied){proxyComponent(a,n,2);a.isProxied=true}r=createTime("createInstance",n.$tagName$);{t.$flags$|=8}try{new a(t)}catch(e){consoleError(e)}{t.$flags$&=~8}r();if(a.style){o=a.style;i=getScopeId(n);if(!styles.has(i)){s=createTime("registerStyles",n.$tagName$);registerStyle(i,o,!!(n.$flags$&1));s()}}c.label=3;case 3:l=t.$ancestorComponent$;u=function(){return scheduleUpdate(t,true)};if(l&&l["s-rc"]){l["s-rc"].push(u)}else{u()}return[2]}}))}))};var fireConnectedCallback=function(e){};var connectedCallback=function(e){if((plt.$flags$&1)===0){var t=getHostRef(e);var n=t.$cmpMeta$;var r=createTime("connectedCallback",n.$tagName$);if(!(t.$flags$&1)){t.$flags$|=1;{var a=e;while(a=a.parentNode||a.host){if(a["s-p"]){attachToAncestor(t,t.$ancestorComponent$=a);break}}}if(n.$members$){Object.entries(n.$members$).map((function(t){var n=t[0],r=t[1][0];if(r&31&&e.hasOwnProperty(n)){var a=e[n];delete e[n];e[n]=a}}))}{initializeComponent(e,t,n)}}else{addHostEventListeners(e,t,n.$listeners$);if(t===null||t===void 0?void 0:t.$lazyInstance$);else if(t===null||t===void 0?void 0:t.$onReadyPromise$){t.$onReadyPromise$.then((function(){return fireConnectedCallback()}))}}r()}};var disconnectInstance=function(e){{safeCall(e,"disconnectedCallback")}};var disconnectedCallback=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(n){if((plt.$flags$&1)===0){t=getHostRef(e);{if(t.$rmListeners$){t.$rmListeners$.map((function(e){return e()}));t.$rmListeners$=undefined}}if(t===null||t===void 0?void 0:t.$lazyInstance$){disconnectInstance(t.$lazyInstance$)}else if(t===null||t===void 0?void 0:t.$onReadyPromise$){t.$onReadyPromise$.then((function(){return disconnectInstance(t.$lazyInstance$)}))}}return[2]}))}))};var bootstrapLazy=function(e,t){if(t===void 0){t={}}var n;var r=createTime();var a=[];var o=t.exclude||[];var i=win.customElements;var s=doc.head;var l=s.querySelector("meta[charset]");var u=doc.createElement("style");var c=[];var f;var $=true;Object.assign(plt,t);plt.$resourcesUrl$=new URL(t.resourcesUrl||"./",doc.baseURI).href;e.map((function(e){e[1].map((function(t){var n={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};{n.$members$=t[2]}{n.$listeners$=t[3]}var r=n.$tagName$;var s=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;t=r;registerHost(t,n);if(n.$flags$&1){{{t.attachShadow({mode:"open"})}}}return r}t.prototype.connectedCallback=function(){var e=this;if(f){clearTimeout(f);f=null}if($){c.push(this)}else{plt.jmp((function(){return connectedCallback(e)}))}};t.prototype.disconnectedCallback=function(){var e=this;plt.jmp((function(){return disconnectedCallback(e)}))};t.prototype.componentOnReady=function(){return getHostRef(this).$onReadyPromise$};return t}(HTMLElement);n.$lazyBundleId$=e[0];if(!o.includes(r)&&!i.get(r)){a.push(r);i.define(r,proxyComponent(s,n,1))}}))}));{u.innerHTML=a+HYDRATED_CSS;u.setAttribute("data-styles","");var d=(n=plt.$nonce$)!==null&&n!==void 0?n:queryNonceMetaTagContent(doc);if(d!=null){u.setAttribute("nonce",d)}s.insertBefore(u,l?l.nextSibling:s.firstChild)}$=false;if(c.length){c.map((function(e){return e.connectedCallback()}))}else{{plt.jmp((function(){return f=setTimeout(appDidLoad,30)}))}}r()};var addHostEventListeners=function(e,t,n,r){if(n){n.map((function(n){var r=n[0],a=n[1],o=n[2];var i=e;var s=hostListenerProxy(t,o);var l=hostListenerOpts(r);plt.ael(i,a,s,l);(t.$rmListeners$=t.$rmListeners$||[]).push((function(){return plt.rel(i,a,s,l)}))}))}};var hostListenerProxy=function(e,t){return function(n){try{{if(e.$flags$&256){e.$lazyInstance$[t](n)}else{(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}}}catch(e){consoleError(e)}}};var hostListenerOpts=function(e){return(e&2)!==0};var setNonce=function(e){return plt.$nonce$=e};var hostRefs=new WeakMap;var getHostRef=function(e){return hostRefs.get(e)};var registerInstance=function(e,t){return hostRefs.set(t.$lazyInstance$=e,t)};var registerHost=function(e,t){var n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};{n.$onReadyPromise$=new Promise((function(e){return n.$onReadyResolve$=e}));e["s-p"]=[];e["s-rc"]=[]}addHostEventListeners(e,n,t.$listeners$);return hostRefs.set(e,n)};var consoleError=function(e,t){return(0,console.error)(e,t)};var cmpModules=new Map;var loadModule=function(e,t,n){var r=e.$tagName$.replace(/-/g,"_");var a=e.$lazyBundleId$;var o=cmpModules.get(a);if(o){return o[r]}
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import("./".concat(a,".entry.js").concat("")).then((function(e){{cmpModules.set(a,e)}return e[r]}),consoleError)};var styles=new Map;var win=typeof window!=="undefined"?window:{};var doc=win.document||{head:{}};var plt={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,n,r){return e.addEventListener(t,n,r)},rel:function(e,t,n,r){return e.removeEventListener(t,n,r)},ce:function(e,t){return new CustomEvent(e,t)}};var promiseResolve=function(e){return Promise.resolve(e)};var supportsConstructableStylesheets=function(){try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false}();var queueDomReads=[];var queueDomWrites=[];var queueTask=function(e,t){return function(n){e.push(n);if(!queuePending){queuePending=true;if(t&&plt.$flags$&4){nextTick(flush)}else{plt.raf(flush)}}}};var consume=function(e){for(var t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){consoleError(e)}}e.length=0};var flush=function(){consume(queueDomReads);{consume(queueDomWrites);if(queuePending=queueDomReads.length>0){plt.raf(flush)}}};var nextTick=function(e){return promiseResolve().then(e)};var writeTask=queueTask(queueDomWrites,true);export{Host as H,bootstrapLazy as b,createEvent as c,getElement as g,h,promiseResolve as p,registerInstance as r,setNonce as s};
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as bootstrapLazy}from"./index-8c22e0f7.js";export{s as setNonce}from"./index-8c22e0f7.js";var defineCustomElements=function(e,o){if(typeof window==="undefined")return undefined;return bootstrapLazy([["mds-accordion-timer",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],o)};export{defineCustomElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-8c22e0f7.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as promiseResolve,b as bootstrapLazy}from"./index-
|
|
1
|
+
import{p as promiseResolve,b as bootstrapLazy}from"./index-8c22e0f7.js";export{s as setNonce}from"./index-8c22e0f7.js";var patchBrowser=function(){var e=import.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return promiseResolve(r)};patchBrowser().then((function(e){return bootstrapLazy([["mds-accordion-timer",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as c}from"./p-0bdccf30.js";export{s as setNonce}from"./p-0bdccf30.js";(()=>{const c=import.meta.url,o={};return""!==c&&(o.resourcesUrl=new URL(".",c).href),e(o)})().then((e=>c([["p-8c113821",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)));
|
|
@@ -115,15 +115,11 @@ 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-9036e977.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
|
|
119
119
|
System.import(url.href);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
window.__cssshim.i().then(start);
|
|
124
|
-
} else {
|
|
125
|
-
start();
|
|
126
|
-
}
|
|
122
|
+
start();
|
|
127
123
|
|
|
128
124
|
// Note: using .call(window) here because the self-executing function needs
|
|
129
125
|
// to be scoped to the window object for the ES6Promise polyfill to work
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let n,e,t=!1;const l=n=>"object"==(n=typeof n)||"function"===n;function o(n){var e,t,l;return null!==(l=null===(t=null===(e=n.head)||void 0===e?void 0:e.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const s=(n,e,...t)=>{let o=null,s=!1,i=!1;const r=[],u=e=>{for(let t=0;t<e.length;t++)o=e[t],Array.isArray(o)?u(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof n&&!l(o))&&(o+=""),s&&i?r[r.length-1].t+=o:r.push(s?c(null,o):o),i=s)};u(t);const a=c(n,null);return a.l=e,r.length>0&&(a.o=r),a},c=(n,e)=>({i:0,u:n,t:e,m:null,o:null}),i={},r=n=>R(n).h,u=(n,e,t)=>{const l=r(n);return{emit:n=>a(l,e,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:n})}},a=(n,e,t)=>{const l=G.ce(e,t);return n.dispatchEvent(l),l},f=new WeakMap,d=n=>"sc-"+n.p,m=(e,t,l)=>{const o=t.o[l];let s,c,i=0;if(s=o.m=B.createElement(o.u),null!=n&&s["s-si"]!==n&&s.classList.add(s["s-si"]=n),o.o)for(i=0;i<o.o.length;++i)c=m(e,o,i),c&&s.appendChild(c);return s},y=(n,t,l,o,s,c)=>{let i,r=n;for(r.shadowRoot&&r.tagName===e&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=m(null,l,s),i&&(o[s].m=i,r.insertBefore(i,t)))},h=(n,e,t)=>{for(let l=e;l<=t;++l){const e=n[l];if(e){const n=e.m;n&&n.remove()}}},p=(n,e)=>n.u===e.u,$=(n,e)=>{const t=e.m=n.m,l=n.o,o=e.o;null!==l&&null!==o?((n,e,t,l)=>{let o,s=0,c=0,i=e.length-1,r=e[0],u=e[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=e[++s]:null==u?u=e[--i]:null==f?f=l[++c]:null==d?d=l[--a]:p(r,f)?($(r,f),r=e[++s],f=l[++c]):p(u,d)?($(u,d),u=e[--i],d=l[--a]):p(r,d)?($(r,d),n.insertBefore(r.m,u.m.nextSibling),r=e[++s],d=l[--a]):p(u,f)?($(u,f),n.insertBefore(u.m,r.m),u=e[--i],f=l[++c]):(o=m(e&&e[c],t,c),f=l[++c],o&&r.m.parentNode.insertBefore(o,r.m));s>i?y(n,null==l[a+1]?null:l[a+1].m,t,l,c,a):c>a&&h(e,s,i)})(t,l,e,o):null!==o?y(t,null,e,o,0,o.length-1):null!==l&&h(l,0,l.length-1)},v=(n,e)=>{e&&!n.$&&e["s-p"]&&e["s-p"].push(new Promise((e=>n.$=e)))},b=(n,e)=>{if(n.i|=16,!(4&n.i))return v(n,n.v),en((()=>w(n,e)));n.i|=512},w=(n,e)=>{const t=n.S;return e&&(n.i|=256,n.g&&(n.g.map((([n,e])=>O(t,n,e))),n.g=void 0)),S(void 0,(()=>j(n,t,e)))},S=(n,e)=>g(n)?n.then(e):e(),g=n=>n instanceof Promise||n&&n.then&&"function"==typeof n.then,j=async(n,e,t)=>{var l;const s=n.h,c=s["s-rc"];t&&(n=>{const e=n.j,t=n.h,l=e.i,s=((n,e)=>{var t;const l=d(e),s=_.get(l);if(n=11===n.nodeType?n:B,s)if("string"==typeof s){let e,c=f.get(n=n.head||n);if(c||f.set(n,c=new Set),!c.has(l)){{e=B.createElement("style"),e.innerHTML=s;const l=null!==(t=G.k)&&void 0!==t?t:o(B);null!=l&&e.setAttribute("nonce",l),n.insertBefore(e,n.querySelector("link"))}c&&c.add(l)}}else n.adoptedStyleSheets.includes(s)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),e);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(n);k(n,e,s,t),c&&(c.map((n=>n())),s["s-rc"]=void 0);{const e=null!==(l=s["s-p"])&&void 0!==l?l:[],t=()=>M(n);0===e.length?t():(Promise.all(e).then(t),n.i|=4,e.length=0)}},k=(t,l,o,r)=>{try{l=l.render(),t.i&=-17,t.i|=2,((t,l,o=!1)=>{const r=t.h,u=t.M||c(null,null),a=(n=>n&&n.u===i)(l)?l:s(null,null,l);if(e=r.tagName,o&&a.l)for(const n of Object.keys(a.l))r.hasAttribute(n)&&!["key","ref","style","class"].includes(n)&&(a.l[n]=r[n]);a.u=null,a.i|=4,t.M=a,a.m=u.m=r.shadowRoot||r,n=r["s-sc"],$(u,a)})(t,l,r)}catch(n){q(n,t.h)}return null},M=n=>{const e=n.h,t=n.S,l=n.v;64&n.i||(n.i|=64,P(e),O(t,"componentDidLoad"),n.C(e),l||C()),n.$&&(n.$(),n.$=void 0),512&n.i&&nn((()=>b(n,!1))),n.i&=-517},C=()=>{P(B.documentElement),nn((()=>a(z,"appload",{detail:{namespace:"mds-accordion-timer"}})))},O=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(n){q(n)}},P=n=>n.setAttribute("hydrated",""),x=(n,e,t)=>{var o;if(e.O){const s=Object.entries(e.O),c=n.prototype;if(s.map((([n,[o]])=>{(31&o||2&t&&32&o)&&Object.defineProperty(c,n,{get(){return((n,e)=>R(this).P.get(e))(0,n)},set(t){((n,e,t,o)=>{const s=R(n),c=s.P.get(e),i=s.i,r=s.S;t=((n,e)=>null==n||l(n)?n:2&e?parseFloat(n):n)(t,o.O[e][0]),8&i&&void 0!==c||t===c||Number.isNaN(c)&&Number.isNaN(t)||(s.P.set(e,t),r&&2==(18&i)&&b(s,!1))})(this,n,t,e)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;c.attributeChangedCallback=function(n,l,o){G.jmp((()=>{const s=t.get(n);if(this.hasOwnProperty(s))o=this[s],delete this[s];else{if(c.hasOwnProperty(s)&&"number"==typeof this[s]&&this[s]==o)return;if(null==s){const t=R(this),s=null==t?void 0:t.i;if(!(8&s)&&128&s&&o!==l){const s=t.S,c=e.A[n];null==c||c.forEach((e=>{null!=s[e]&&s[e].call(s,o,l,n)}))}return}}this[s]=(null!==o||"boolean"!=typeof this[s])&&o}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!==(o=e.A)&&void 0!==o?o:{}),...s.filter((([n,e])=>15&e[0])).map((([n,e])=>{const l=e[1]||n;return t.set(l,n),l}))]))}}return n},A=n=>{O(n,"disconnectedCallback")},E=(n,e={})=>{var t;const l=[],s=e.exclude||[],c=z.customElements,i=B.head,r=i.querySelector("meta[charset]"),u=B.createElement("style"),a=[];let f,m=!0;Object.assign(G,e),G.L=new URL(e.resourcesUrl||"./",B.baseURI).href,n.map((n=>{n[1].map((e=>{const t={i:e[0],p:e[1],O:e[2],N:e[3]};t.O=e[2],t.N=e[3];const o=t.p,i=class extends HTMLElement{constructor(n){super(n),W(n=this,t),1&t.i&&n.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),m?a.push(this):G.jmp((()=>(n=>{if(0==(1&G.i)){const e=R(n),t=e.j,l=()=>{};if(1&e.i)L(n,e,t.N),(null==e?void 0:e.S)||(null==e?void 0:e.T)&&e.T.then((()=>{}));else{e.i|=1;{let t=n;for(;t=t.parentNode||t.host;)if(t["s-p"]){v(e,e.v=t);break}}t.O&&Object.entries(t.O).map((([e,[t]])=>{if(31&t&&n.hasOwnProperty(e)){const t=n[e];delete n[e],n[e]=t}})),(async(n,e,t,l,o)=>{if(0==(32&e.i)){e.i|=32;{if((o=V(t)).then){const n=()=>{};o=await o,n()}o.isProxied||(x(o,t,2),o.isProxied=!0);const n=()=>{};e.i|=8;try{new o(e)}catch(n){q(n)}e.i&=-9,n()}if(o.style){let n=o.style;const e=d(t);if(!_.has(e)){const l=()=>{};((n,e,t)=>{let l=_.get(n);J&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,_.set(n,l)})(e,n,!!(1&t.i)),l()}}}const s=e.v,c=()=>b(e,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,e,t)}l()}})(this)))}disconnectedCallback(){G.jmp((()=>(async()=>{if(0==(1&G.i)){const n=R(this);n.F&&(n.F.map((n=>n())),n.F=void 0),(null==n?void 0:n.S)?A(n.S):(null==n?void 0:n.T)&&n.T.then((()=>A(n.S)))}})()))}componentOnReady(){return R(this).T}};t.H=n[0],s.includes(o)||c.get(o)||(l.push(o),c.define(o,x(i,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}[hydrated]{visibility:inherit}",u.setAttribute("data-styles","");const n=null!==(t=G.k)&&void 0!==t?t:o(B);null!=n&&u.setAttribute("nonce",n),i.insertBefore(u,r?r.nextSibling:i.firstChild)}m=!1,a.length?a.map((n=>n.connectedCallback())):G.jmp((()=>f=setTimeout(C,30)))},L=(n,e,t)=>{t&&t.map((([t,l,o])=>{const s=n,c=N(e,o),i=T(t);G.ael(s,l,c,i),(e.F=e.F||[]).push((()=>G.rel(s,l,c,i)))}))},N=(n,e)=>t=>{try{256&n.i?n.S[e](t):(n.g=n.g||[]).push([e,t])}catch(n){q(n)}},T=n=>0!=(2&n),F=n=>G.k=n,H=new WeakMap,R=n=>H.get(n),U=(n,e)=>H.set(e.S=n,e),W=(n,e)=>{const t={i:0,h:n,j:e,P:new Map};return t.T=new Promise((n=>t.C=n)),n["s-p"]=[],n["s-rc"]=[],L(n,t,e.N),H.set(n,t)},q=(n,e)=>(0,console.error)(n,e),D=new Map,V=n=>{const e=n.p.replace(/-/g,"_"),t=n.H,l=D.get(t);return l?l[e]:import(`./${t}.entry.js`).then((n=>(D.set(t,n),n[e])),q)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},_=new Map,z="undefined"!=typeof window?window:{},B=z.document||{head:{}},G={i:0,L:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,l)=>n.addEventListener(e,t,l),rel:(n,e,t,l)=>n.removeEventListener(e,t,l),ce:(n,e)=>new CustomEvent(n,e)},I=n=>Promise.resolve(n),J=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(n){}return!1})(),K=[],Q=[],X=(n,e)=>l=>{n.push(l),t||(t=!0,e&&4&G.i?nn(Z):G.raf(Z))},Y=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(n){q(n)}n.length=0},Z=()=>{Y(K),Y(Q),(t=K.length>0)&&G.raf(Z)},nn=n=>I().then(n),en=X(Q,!0);export{i as H,E as b,u as c,r as g,s as h,I as p,U as r,F as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as h,g as o}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i,H as h,g as o}from"./p-0bdccf30.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 +1 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-df0a41f6.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-bb796904.system",[[1,"mds-accordion-timer",{duration:[2],time:[32]},[[0,"mdsAccordionTimerItemClickSelect","onClickActive"],[0,"mdsAccordionTimerItemMouseEnterSelect","onMouseEnterSelect"],[0,"mdsAccordionTimerItemMouseLeaveSelect","onMouseLeaveSelect"]]]]]],e)}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-df0a41f6.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}}}));
|