@maggioli-design-system/mds-accordion-timer 1.0.0 → 2.0.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-dc0bb58e.js → index-71ce67f9.js} +32 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-accordion-timer.cjs.entry.js +3 -3
- package/dist/cjs/mds-accordion-timer.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/mds-accordion-timer/mds-accordion-timer.js +2 -2
- package/dist/collection/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +25 -23
- package/dist/collection/dictionary/floating-ui.js +19 -0
- package/dist/collection/dictionary/icon.js +2 -2
- package/dist/collection/dictionary/typography.js +25 -3
- package/dist/collection/dictionary/variant.js +1 -0
- package/dist/collection/types/floating-ui.js +1 -0
- package/dist/{custom-elements → components}/index.d.ts +3 -26
- package/dist/components/index.js +2 -0
- package/dist/components/mds-accordion-timer.d.ts +11 -0
- package/dist/{custom-elements/index.js → components/mds-accordion-timer.js} +23 -18
- package/dist/esm/{index-468ab090.js → index-131803de.js} +32 -4
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-accordion-timer.entry.js +3 -3
- package/dist/esm/mds-accordion-timer.js +2 -2
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/index-131803de.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 +1 -1
- package/dist/mds-accordion-timer/p-4f6d2878.entry.js +1 -0
- package/dist/mds-accordion-timer/{p-104355eb.system.entry.js → p-6384c515.system.entry.js} +1 -1
- package/dist/mds-accordion-timer/p-65dca5f5.system.js +2 -0
- package/dist/mds-accordion-timer/p-9bd89dcd.js +2 -0
- package/dist/mds-accordion-timer/{p-74539cca.system.js → p-b55643bd.system.js} +1 -1
- package/dist/stats.json +52 -42
- package/dist/types/components/mds-accordion-timer/test/mds-accordion-timer.stories.d.ts +15 -0
- package/dist/types/components.d.ts +5 -1
- package/dist/types/dictionary/floating-ui.d.ts +3 -0
- package/dist/types/dictionary/typography.d.ts +7 -3
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/types/floating-ui.d.ts +2 -0
- package/dist/types/types/typography.d.ts +7 -3
- package/dist/types/types/variant.d.ts +1 -1
- package/package.json +9 -7
- package/readme.md +1 -1
- package/src/components/mds-accordion-timer/.gitlab-ci.yml +25 -0
- package/src/components/mds-accordion-timer/mds-accordion-timer.tsx +1 -1
- package/src/components/mds-accordion-timer/readme.md +1 -1
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.e2e.ts +2 -1
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.spec.tsx +8 -7
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.tsx +47 -0
- package/src/components.d.ts +5 -1
- package/src/dictionary/floating-ui.ts +25 -0
- package/src/dictionary/icon.ts +2 -2
- package/src/dictionary/typography.ts +34 -4
- package/src/dictionary/variant.ts +1 -0
- package/src/fixtures/icons.json +64 -0
- package/src/tailwind/components.css +14 -0
- package/src/types/floating-ui.ts +17 -0
- package/src/types/typography.ts +24 -2
- package/src/types/variant.ts +2 -1
- package/www/build/mds-accordion-timer.esm.js +1 -1
- package/www/build/mds-accordion-timer.js +1 -1
- package/www/build/p-4f6d2878.entry.js +1 -0
- package/www/build/{p-104355eb.system.entry.js → p-6384c515.system.entry.js} +1 -1
- package/www/build/p-65dca5f5.system.js +2 -0
- package/www/build/p-9bd89dcd.js +2 -0
- package/www/build/{p-74539cca.system.js → p-b55643bd.system.js} +1 -1
- package/dist/esm-es5/index-468ab090.js +0 -1
- package/dist/mds-accordion-timer/p-2c75936b.entry.js +0 -1
- package/dist/mds-accordion-timer/p-a652c8b3.system.js +0 -1
- package/dist/mds-accordion-timer/p-ac3fdd27.js +0 -1
- package/src/components/mds-accordion-timer/test/mds-accordion-timer.stories.js +0 -32
- package/www/build/p-2c75936b.entry.js +0 -1
- package/www/build/p-a652c8b3.system.js +0 -1
- package/www/build/p-ac3fdd27.js +0 -1
|
@@ -104,7 +104,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
104
104
|
};
|
|
105
105
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
106
106
|
let scopeId = getScopeId(cmpMeta);
|
|
107
|
-
|
|
107
|
+
const style = styles.get(scopeId);
|
|
108
108
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
109
109
|
// so the fallback is to always use the document for the root node in those cases
|
|
110
110
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -176,7 +176,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
176
176
|
let child = null;
|
|
177
177
|
let simple = false;
|
|
178
178
|
let lastSimple = false;
|
|
179
|
-
|
|
179
|
+
const vNodeChildren = [];
|
|
180
180
|
const walk = (c) => {
|
|
181
181
|
for (let i = 0; i < c.length; i++) {
|
|
182
182
|
child = c[i];
|
|
@@ -221,7 +221,7 @@ const Host = {};
|
|
|
221
221
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
222
222
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
223
223
|
// tslint:disable-next-line: prefer-const
|
|
224
|
-
|
|
224
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
225
225
|
let i = 0;
|
|
226
226
|
let elm;
|
|
227
227
|
let childNode;
|
|
@@ -568,6 +568,29 @@ const then = (promise, thenFn) => {
|
|
|
568
568
|
};
|
|
569
569
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
570
570
|
;
|
|
571
|
+
/**
|
|
572
|
+
* Parse a new property value for a given property type.
|
|
573
|
+
*
|
|
574
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
575
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
576
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
577
|
+
* 2. the type stored from `propType`.
|
|
578
|
+
*
|
|
579
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
580
|
+
*
|
|
581
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
582
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
583
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
584
|
+
* ```tsx
|
|
585
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
586
|
+
* ```
|
|
587
|
+
*
|
|
588
|
+
* HTML prop values on the other hand, will always a string
|
|
589
|
+
*
|
|
590
|
+
* @param propValue the new value to coerce to some type
|
|
591
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
592
|
+
* @returns the parsed/coerced value
|
|
593
|
+
*/
|
|
571
594
|
const parsePropertyValue = (propValue, propType) => {
|
|
572
595
|
// ensure this value is of the correct prop type
|
|
573
596
|
if (propValue != null && !isComplexType(propValue)) {
|
|
@@ -590,7 +613,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
590
613
|
const flags = hostRef.$flags$;
|
|
591
614
|
const instance = hostRef.$lazyInstance$ ;
|
|
592
615
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
593
|
-
|
|
616
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
617
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
618
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
619
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
594
620
|
// gadzooks! the property's value has changed!!
|
|
595
621
|
// set our new value!
|
|
596
622
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
@@ -953,7 +979,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
953
979
|
if (module) {
|
|
954
980
|
return module[exportName];
|
|
955
981
|
}
|
|
982
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
956
983
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
984
|
+
/* @vite-ignore */
|
|
957
985
|
/* webpackInclude: /\.entry\.js$/ */
|
|
958
986
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
959
987
|
/* webpackMode: "lazy" */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-71ce67f9.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-71ce67f9.js');
|
|
6
6
|
|
|
7
7
|
const mdsAccordionTimerCss = ":host{display:block}";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const MdsAccordionTimer = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
12
|
this.itemActivated = index.createEvent(this, "itemActivated", 7);
|
|
@@ -14,7 +14,7 @@ let MdsAccordionTimer = class {
|
|
|
14
14
|
/**
|
|
15
15
|
* Sets the duration of the single accordion item
|
|
16
16
|
*/
|
|
17
|
-
this.duration =
|
|
17
|
+
this.duration = 10000;
|
|
18
18
|
this.clearIntervals = () => {
|
|
19
19
|
window.clearInterval(this.timer);
|
|
20
20
|
window.clearInterval(this.timeChecker);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-71ce67f9.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-accordion-timer.cjs.js', document.baseURI).href));
|
|
@@ -5,7 +5,7 @@ export class MdsAccordionTimer {
|
|
|
5
5
|
/**
|
|
6
6
|
* Sets the duration of the single accordion item
|
|
7
7
|
*/
|
|
8
|
-
this.duration =
|
|
8
|
+
this.duration = 10000;
|
|
9
9
|
this.clearIntervals = () => {
|
|
10
10
|
window.clearInterval(this.timer);
|
|
11
11
|
window.clearInterval(this.timeChecker);
|
|
@@ -139,7 +139,7 @@ export class MdsAccordionTimer {
|
|
|
139
139
|
},
|
|
140
140
|
"attribute": "duration",
|
|
141
141
|
"reflect": false,
|
|
142
|
-
"defaultValue": "
|
|
142
|
+
"defaultValue": "10000"
|
|
143
143
|
}
|
|
144
144
|
}; }
|
|
145
145
|
static get states() { return {
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import faker from 'faker'
|
|
4
|
-
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { lokiDisabled } from '@test/loki-disabled';
|
|
5
3
|
export default {
|
|
6
4
|
title: 'UI / Accordion Timer',
|
|
7
|
-
component: MdsAccordionTimer,
|
|
8
5
|
argTypes: {
|
|
9
6
|
duration: {
|
|
10
|
-
type: { name: 'number'
|
|
7
|
+
type: { name: 'number' },
|
|
11
8
|
description: 'Sets the duration of the single accordion item',
|
|
12
9
|
},
|
|
13
10
|
},
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export const Default = Template.bind({})
|
|
28
|
-
|
|
29
|
-
export const Duration = Template.bind({})
|
|
11
|
+
};
|
|
12
|
+
const Template = args => h("div", null,
|
|
13
|
+
h("mds-accordion-timer", Object.assign({}, args),
|
|
14
|
+
h("mds-accordion-timer-item", { active: true, description: "Blipbug" },
|
|
15
|
+
h("mds-text", null, "Blipbug presenta delle fattezze riconducibili agli insetti nello stadio pre-crisalide. Il suo corpo si sviluppa in lunghezza, ed \u00E8 formato principalmente da tre parti: la sua grande testa, il suo collo (molto simile ad un collare), e il corpo vero e proprio. La prima di queste \u00E8 suddivisa in una parte color crema e una parte color denim; dello stesso colore sono le appenidici a forma di \"V\" che si trovano sopra e ai lati della testa. I suoi occhi sono enormi e grigi, ed hanno delle sottilissime sopracciglia sopra di essi. Il suo \"collare\", anch'esso color denim, presenta delle \"setole\" giallo sabbia, con le quali percepisce i segnali esterni: stesso colore si presenta nel segmento centrale della sua parte inferiore, dove sono presenti un primo paio di zampe crema. Il segmento superiore del corpo \u00E8 bianco e ospita delle zampe anteriori color crema, ed infine, la parte finale, o la \"coda\", \u00E8 color denim e finisce con un'appendice a \"V\" un po' pi\u00FA grossa.")),
|
|
16
|
+
h("mds-accordion-timer-item", { description: "Drednaw" },
|
|
17
|
+
h("mds-text", null, "Drednaw \u00E8 un Pok\u00E9mon quadrupede simile ad una tartaruga alligatore. Il corpo \u00E8 principalmente di colore turchese cos\u00EC come le zampe cilindriche e tozze, le quali terminano con tre unghie allungate e bianche. Sulle zampe anteriori, circa sulla loro met\u00E0, spuntanto delle protuberanze simili a scaglie di roccia color marroncino, ricorrenti anche nel resto del corpo: ad esempio, sul muso c'\u00E8 una protuberanza a zig-zag che ospita le sue narici; sulla coda sono alternate delle scaglie e attorno al guscio c'\u00E8 una cornice dello stesso colore; anche le placche superiori sembrano essere fatte di roccia, ma sono di un colore marrone scuro, invece che chiaro. Queste parti rocciose sembrano essere frastagliate, per niente levigate. Il suo volto presenta occhi bassi e imbronciati, con delle guance arancioni e sporgenti ed una bocca a zig-zag, la cui parte inferiore \u00E8 simile al beige, colore presente anche nelle placche del guscio inferiori, che stavolta fanno vedere la pelle a volte grinzosa del Pok\u00E9mon (in particolare attorno al collo e sulle zampe). Le sue scaglie di roccia sono spesso rivolte verso di dietro, dando l'idea di una roccia grezza e non liscia e lavorata.")),
|
|
18
|
+
h("mds-accordion-timer-item", { description: "Orbeetle" },
|
|
19
|
+
h("mds-text", null, "Orbeetle presenta aspetti comuni ad una coccinella ormai matura. Il suo corpo si sviluppa attorno al guscio che \u00E8 di forma semisferica ed \u00E8 metallizzato in grigio (lo si pu\u00F2 vedere in particolare dalla parte inferiore di esso): la sua scocca \u00E8 rossa, con dei pois denim sopra di essa; \u00E8 bisezionata per permettere di aprirsi e attaccare con degli strani poteri. All'estremit\u00E0 del taglio intermedio \u00E8 incastonato il volto di Orbeetle, il quale presenta delle guance bianche con occhi imbronciati celesti, aventi sclere concentriche; sopra di essi ci sono due lunghe sopracciglia dorate a forma di \"V\" e ad incorniciare la faccia del Pok\u00E9mon \u00E8 una cornice grigia, che finisce, con delle striature, sul naso dello stesso. La bocca, assieme alle ginocchia e alla pancia, \u00E8 rossa. Il suo corpo \u00E8 piccolo ed \u00E8 costituito da una vita stretta con una bacino largo, da dove si sviluppano due cosce secche ed esili per poi finire con appuntiti gambali dorati; le sue braccia sono magre e biforcute, come se avessero artigli.")),
|
|
20
|
+
h("mds-accordion-timer-item", { description: "Dottler" },
|
|
21
|
+
h("mds-text", null, "Dottler pu\u00F2 essere considerato la \"crisalide\" della linea evolutiva di Blipbug, vista la sua forma e il suo comportamento. Presenta un guscio di forma poligonale (molto simile a quella di un radar Doppler o di un radome) di color giallo sabbia, con dei pois blu scuro sugli spigoli; leggermente in basso \u00E8 presente la sua faccia di color arancione chiaro, sulla quale ci sono degli occhi celesti attorniati da un contorno arancione, da linee sottili e nere e da delle appendici blu simili a quelle dei Blipbug. Il Pok\u00E9mon non sembra essere dedito a muoversi se non fosse per le quattro zampette blu scuro su cui cammina.")),
|
|
22
|
+
h("mds-accordion-timer-item", { description: "Centiskorch" },
|
|
23
|
+
h("mds-text", null, "Con l'evoluzione Sizzlipede diventa pi\u00F9 aggressivo, soprattutto grazie alla sua stazza pi\u00F9 grande e al suo enorme potenziale. Il corpo diventa pi\u00F9 lungo e si \"seziona\" in dodici parti, anche qui un'estremit\u00E0 \u00E8 la \"coda\" e l'altra \u00E8 la testa, queste due parti, assieme all'intera parte inferiore del corpo sono del rosso mattone presente nella sua pre-evo, mentre le \"parti\" comprese tra la coda e la testa restano marroni/bordeaux; questa volte, dello stesso colore della \"schiena\" sono le zampe, le quali son diventate pi\u00F9 minacciose e uncinate, questa volta sono dieci per ogni lato; marrone/bordeaux sono anche delle tenaglie. presenti in paia, sulla coda e sulla testa; su queste estremit\u00E0 son presenti quattro sbuffi o \"baffi\" di fuoco. Sulla testa \u00E8 presente un simbolo arancione chiaro a forma di punto esclamativo; stessa gamma cromatica \u00E8 presente nei segni circolari situati nella zona inferiore del corpo, i quali son formati, per\u00F2, anche da un anello e da un cerchio, pi\u00F9 interno, di colore giallo sabbia; non sono altro che i punti che Sizzlipede riscalda per attaccare e scottare le prede. I suoi occhi sono giallo elettrico con pupille triangolari color marrone e rovesciati."))));
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
Default.story = lokiDisabled;
|
|
26
|
+
export const Duration = Template.bind({});
|
|
30
27
|
Duration.args = {
|
|
31
28
|
duration: 1000,
|
|
32
|
-
}
|
|
29
|
+
};
|
|
30
|
+
Duration.story = lokiDisabled;
|
|
31
|
+
export const LokiTest = Template.bind({});
|
|
32
|
+
LokiTest.args = {
|
|
33
|
+
duration: 0,
|
|
34
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const floatingUIPlacementDictionary = [
|
|
2
|
+
'bottom',
|
|
3
|
+
'bottom-end',
|
|
4
|
+
'bottom-start',
|
|
5
|
+
'left',
|
|
6
|
+
'left-end',
|
|
7
|
+
'left-start',
|
|
8
|
+
'right',
|
|
9
|
+
'right-end',
|
|
10
|
+
'right-start',
|
|
11
|
+
'top',
|
|
12
|
+
'top-end',
|
|
13
|
+
'top-start',
|
|
14
|
+
];
|
|
15
|
+
const floatingUIStrategyDictionary = [
|
|
16
|
+
'absolute',
|
|
17
|
+
'fixed',
|
|
18
|
+
];
|
|
19
|
+
export { floatingUIPlacementDictionary, floatingUIStrategyDictionary, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
const iconsDictionary =
|
|
1
|
+
import jsonIconsDictionary from '../fixtures/icons.json';
|
|
2
|
+
const iconsDictionary = jsonIconsDictionary;
|
|
3
3
|
export { iconsDictionary, };
|
|
@@ -13,12 +13,19 @@ const typographyDictionary = [
|
|
|
13
13
|
'label',
|
|
14
14
|
'option',
|
|
15
15
|
'paragraph',
|
|
16
|
+
'tip',
|
|
17
|
+
];
|
|
18
|
+
const typographyVariationsDictionary = [
|
|
19
|
+
'title',
|
|
20
|
+
'info',
|
|
21
|
+
'read',
|
|
22
|
+
'mono',
|
|
16
23
|
];
|
|
17
24
|
const typographyMonoDictionary = [
|
|
18
25
|
'code',
|
|
19
26
|
'hack',
|
|
20
27
|
];
|
|
21
|
-
const
|
|
28
|
+
const typographyTitleDictionary = [
|
|
22
29
|
'action',
|
|
23
30
|
'h1',
|
|
24
31
|
'h2',
|
|
@@ -27,11 +34,26 @@ const typographyPrimaryDictionary = [
|
|
|
27
34
|
'h5',
|
|
28
35
|
'h6',
|
|
29
36
|
];
|
|
30
|
-
const
|
|
37
|
+
const typographyInfoDictionary = [
|
|
31
38
|
'caption',
|
|
32
39
|
'detail',
|
|
33
40
|
'label',
|
|
34
41
|
'option',
|
|
35
42
|
'paragraph',
|
|
43
|
+
'tip',
|
|
44
|
+
];
|
|
45
|
+
const typographyReadDictionary = [
|
|
46
|
+
'caption',
|
|
47
|
+
'detail',
|
|
48
|
+
'paragraph',
|
|
49
|
+
];
|
|
50
|
+
const typographySmallerDictionary = [
|
|
51
|
+
'option',
|
|
52
|
+
'tip',
|
|
53
|
+
];
|
|
54
|
+
const typographyTooltipDictionary = [
|
|
55
|
+
'caption',
|
|
56
|
+
'detail',
|
|
57
|
+
'tip',
|
|
36
58
|
];
|
|
37
|
-
export { typographyDictionary, typographyMonoDictionary,
|
|
59
|
+
export { typographyDictionary, typographyVariationsDictionary, typographyMonoDictionary, typographyTitleDictionary, typographyInfoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
/* MdsAccordionTimer custom elements
|
|
2
|
-
|
|
3
|
-
import type { Components, JSX } from "../types/components";
|
|
4
|
-
|
|
5
|
-
interface MdsAccordionTimer extends Components.MdsAccordionTimer, HTMLElement {}
|
|
6
|
-
export const MdsAccordionTimer: {
|
|
7
|
-
prototype: MdsAccordionTimer;
|
|
8
|
-
new (): MdsAccordionTimer;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Utility to define all custom elements within this package using the tag name provided in the component's source.
|
|
13
|
-
* When defining each custom element, it will also check it's safe to define by:
|
|
14
|
-
*
|
|
15
|
-
* 1. Ensuring the "customElements" registry is available in the global context (window).
|
|
16
|
-
* 2. The component tag name is not already defined.
|
|
17
|
-
*
|
|
18
|
-
* Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)
|
|
19
|
-
* method instead to define custom elements individually, or to provide a different tag name.
|
|
20
|
-
*/
|
|
21
|
-
export declare const defineCustomElements: (opts?: any) => void;
|
|
1
|
+
/* MdsAccordionTimer custom elements */
|
|
2
|
+
export { MdsAccordionTimer as MdsAccordionTimer } from '../types/components/mds-accordion-timer/mds-accordion-timer';
|
|
22
3
|
|
|
23
4
|
/**
|
|
24
5
|
* Used to manually set the base path where assets can be found.
|
|
@@ -27,7 +8,7 @@ export declare const defineCustomElements: (opts?: any) => void;
|
|
|
27
8
|
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
28
9
|
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
29
10
|
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
30
|
-
*
|
|
11
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
31
12
|
* will have to ensure the static assets are copied to its build directory.
|
|
32
13
|
*/
|
|
33
14
|
export declare const setAssetPath: (path: string) => void;
|
|
@@ -36,10 +17,6 @@ export interface SetPlatformOptions {
|
|
|
36
17
|
raf?: (c: FrameRequestCallback) => number;
|
|
37
18
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
38
19
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
39
|
-
ce?: (eventName: string, opts?: any) => CustomEvent;
|
|
40
20
|
}
|
|
41
21
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
42
|
-
|
|
43
|
-
export type { Components, JSX };
|
|
44
|
-
|
|
45
22
|
export * from '../types/components';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface MdsAccordionTimer extends Components.MdsAccordionTimer, HTMLElement {}
|
|
4
|
+
export const MdsAccordionTimer: {
|
|
5
|
+
prototype: MdsAccordionTimer;
|
|
6
|
+
new (): MdsAccordionTimer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { createEvent, h, Host
|
|
2
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
3
2
|
|
|
4
3
|
const mdsAccordionTimerCss = ":host{display:block}";
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
const MdsAccordionTimer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
6
|
constructor() {
|
|
8
7
|
super();
|
|
9
8
|
this.__registerHost();
|
|
@@ -13,7 +12,7 @@ let MdsAccordionTimer$1 = class extends HTMLElement {
|
|
|
13
12
|
/**
|
|
14
13
|
* Sets the duration of the single accordion item
|
|
15
14
|
*/
|
|
16
|
-
this.duration =
|
|
15
|
+
this.duration = 10000;
|
|
17
16
|
this.clearIntervals = () => {
|
|
18
17
|
window.clearInterval(this.timer);
|
|
19
18
|
window.clearInterval(this.timeChecker);
|
|
@@ -123,19 +122,25 @@ let MdsAccordionTimer$1 = class extends HTMLElement {
|
|
|
123
122
|
}
|
|
124
123
|
get element() { return this; }
|
|
125
124
|
static get style() { return mdsAccordionTimerCss; }
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
].forEach(cmp => {
|
|
134
|
-
if (!customElements.get(cmp.is)) {
|
|
135
|
-
customElements.define(cmp.is, cmp, opts);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
125
|
+
}, [1, "mds-accordion-timer", {
|
|
126
|
+
"duration": [2],
|
|
127
|
+
"time": [32]
|
|
128
|
+
}, [[0, "clickActive", "onClickActive"], [0, "mouseEnterActive", "onMouseEnterActive"], [0, "mouseLeaveActive", "onMouseLeaveActive"]]]);
|
|
129
|
+
function defineCustomElement$1() {
|
|
130
|
+
if (typeof customElements === "undefined") {
|
|
131
|
+
return;
|
|
138
132
|
}
|
|
139
|
-
|
|
133
|
+
const components = ["mds-accordion-timer"];
|
|
134
|
+
components.forEach(tagName => { switch (tagName) {
|
|
135
|
+
case "mds-accordion-timer":
|
|
136
|
+
if (!customElements.get(tagName)) {
|
|
137
|
+
customElements.define(tagName, MdsAccordionTimer$1);
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
} });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const MdsAccordionTimer = MdsAccordionTimer$1;
|
|
144
|
+
const defineCustomElement = defineCustomElement$1;
|
|
140
145
|
|
|
141
|
-
export { MdsAccordionTimer,
|
|
146
|
+
export { MdsAccordionTimer, defineCustomElement };
|
|
@@ -82,7 +82,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
82
82
|
};
|
|
83
83
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
84
84
|
let scopeId = getScopeId(cmpMeta);
|
|
85
|
-
|
|
85
|
+
const style = styles.get(scopeId);
|
|
86
86
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
87
87
|
// so the fallback is to always use the document for the root node in those cases
|
|
88
88
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -154,7 +154,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
154
154
|
let child = null;
|
|
155
155
|
let simple = false;
|
|
156
156
|
let lastSimple = false;
|
|
157
|
-
|
|
157
|
+
const vNodeChildren = [];
|
|
158
158
|
const walk = (c) => {
|
|
159
159
|
for (let i = 0; i < c.length; i++) {
|
|
160
160
|
child = c[i];
|
|
@@ -199,7 +199,7 @@ const Host = {};
|
|
|
199
199
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
200
200
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
201
201
|
// tslint:disable-next-line: prefer-const
|
|
202
|
-
|
|
202
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
203
203
|
let i = 0;
|
|
204
204
|
let elm;
|
|
205
205
|
let childNode;
|
|
@@ -546,6 +546,29 @@ const then = (promise, thenFn) => {
|
|
|
546
546
|
};
|
|
547
547
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
548
548
|
;
|
|
549
|
+
/**
|
|
550
|
+
* Parse a new property value for a given property type.
|
|
551
|
+
*
|
|
552
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
553
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
554
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
555
|
+
* 2. the type stored from `propType`.
|
|
556
|
+
*
|
|
557
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
558
|
+
*
|
|
559
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
560
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
561
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
562
|
+
* ```tsx
|
|
563
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
564
|
+
* ```
|
|
565
|
+
*
|
|
566
|
+
* HTML prop values on the other hand, will always a string
|
|
567
|
+
*
|
|
568
|
+
* @param propValue the new value to coerce to some type
|
|
569
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
570
|
+
* @returns the parsed/coerced value
|
|
571
|
+
*/
|
|
549
572
|
const parsePropertyValue = (propValue, propType) => {
|
|
550
573
|
// ensure this value is of the correct prop type
|
|
551
574
|
if (propValue != null && !isComplexType(propValue)) {
|
|
@@ -568,7 +591,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
568
591
|
const flags = hostRef.$flags$;
|
|
569
592
|
const instance = hostRef.$lazyInstance$ ;
|
|
570
593
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
571
|
-
|
|
594
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
595
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
596
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
597
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
572
598
|
// gadzooks! the property's value has changed!!
|
|
573
599
|
// set our new value!
|
|
574
600
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
@@ -931,7 +957,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
931
957
|
if (module) {
|
|
932
958
|
return module[exportName];
|
|
933
959
|
}
|
|
960
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
934
961
|
return import(
|
|
962
|
+
/* @vite-ignore */
|
|
935
963
|
/* webpackInclude: /\.entry\.js$/ */
|
|
936
964
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
937
965
|
/* webpackMode: "lazy" */
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-131803de.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
4
|
+
Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchEsm = () => {
|
|
7
7
|
return promiseResolve();
|
|
@@ -1,8 +1,8 @@
|
|
|
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-131803de.js';
|
|
2
2
|
|
|
3
3
|
const mdsAccordionTimerCss = ":host{display:block}";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const MdsAccordionTimer = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.itemActivated = createEvent(this, "itemActivated", 7);
|
|
@@ -10,7 +10,7 @@ let MdsAccordionTimer = class {
|
|
|
10
10
|
/**
|
|
11
11
|
* Sets the duration of the single accordion item
|
|
12
12
|
*/
|
|
13
|
-
this.duration =
|
|
13
|
+
this.duration = 10000;
|
|
14
14
|
this.clearIntervals = () => {
|
|
15
15
|
window.clearInterval(this.timer);
|
|
16
16
|
window.clearInterval(this.timeChecker);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-131803de.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
4
|
+
Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchBrowser = () => {
|
|
7
7
|
const importMeta = import.meta.url;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.substr(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\."+t,"."+r)}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t=s.scopeId+"-"+this.count,o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
1
|
+
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|