@maggioli-design-system/mds-progress 2.8.1 → 2.8.3
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-87340659.js → index-ef941864.js} +51 -31
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-progress.cjs.entry.js +35 -35
- package/dist/cjs/mds-progress.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/aria.js +18 -18
- package/dist/collection/common/keyboard-manager.js +38 -38
- package/dist/collection/common/unit.js +7 -7
- package/dist/collection/components/mds-progress/mds-progress.js +142 -142
- package/dist/collection/components/mds-progress/meta/dictionary.js +2 -2
- package/dist/collection/components/mds-progress/test/mds-progress.e2e.js +7 -7
- package/dist/collection/components/mds-progress/test/mds-progress.stories.js +20 -20
- package/dist/collection/dictionary/autocomplete.js +56 -56
- package/dist/collection/dictionary/button.js +19 -19
- package/dist/collection/dictionary/color.js +14 -14
- package/dist/collection/dictionary/floating-ui.js +14 -14
- package/dist/collection/dictionary/input.js +31 -15
- package/dist/collection/dictionary/loading.js +2 -2
- package/dist/collection/dictionary/typography.js +46 -46
- package/dist/collection/dictionary/variant.js +54 -54
- package/dist/collection/fixtures/cities.js +107 -107
- package/dist/components/mds-progress.d.ts +2 -2
- package/dist/components/mds-progress.js +57 -57
- package/dist/documentation.d.ts +1 -21
- package/dist/documentation.json +2 -2
- package/dist/esm/{index-641b8321.js → index-370f577b.js} +51 -31
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-progress.entry.js +35 -35
- package/dist/esm/mds-progress.js +3 -3
- package/dist/esm-es5/index-370f577b.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-progress.entry.js +1 -1
- package/dist/esm-es5/mds-progress.js +1 -1
- package/dist/mds-progress/mds-progress.esm.js +1 -1
- package/dist/mds-progress/mds-progress.js +15 -15
- package/dist/mds-progress/{p-82cf4718.entry.js → p-3e473a5b.entry.js} +1 -1
- package/dist/mds-progress/{p-5cb282f0.system.js → p-690d2715.system.js} +1 -1
- package/dist/mds-progress/p-87430859.js +2 -0
- package/{www/build/p-3f2f6022.system.entry.js → dist/mds-progress/p-9135177f.system.entry.js} +1 -1
- package/dist/mds-progress/p-bf3c5077.system.js +2 -0
- package/dist/stats.json +37 -34
- package/dist/types/common/keyboard-manager.d.ts +9 -9
- package/dist/types/components/mds-progress/mds-progress.d.ts +24 -24
- package/dist/types/components/mds-progress/test/mds-progress.stories.d.ts +37 -37
- package/dist/types/dictionary/input.d.ts +2 -1
- package/dist/types/interface/input-value.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/documentation.json +14 -4
- package/package.json +3 -3
- package/src/components/mds-progress/mds-progress.css +1 -1
- package/src/dictionary/input.ts +18 -0
- package/src/fixtures/icons.json +3 -0
- package/src/fixtures/iconsauce.json +3 -0
- package/www/build/mds-progress.esm.js +1 -1
- package/www/build/mds-progress.js +15 -15
- package/www/build/{p-82cf4718.entry.js → p-3e473a5b.entry.js} +1 -1
- package/www/build/{p-5cb282f0.system.js → p-690d2715.system.js} +1 -1
- package/www/build/p-87430859.js +2 -0
- package/{dist/mds-progress/p-3f2f6022.system.entry.js → www/build/p-9135177f.system.entry.js} +1 -1
- package/www/build/p-bf3c5077.system.js +2 -0
- package/dist/esm-es5/index-641b8321.js +0 -1
- package/dist/mds-progress/p-ae73d6e3.system.js +0 -2
- package/dist/mds-progress/p-eef73ce9.js +0 -2
- package/www/build/p-ae73d6e3.system.js +0 -2
- package/www/build/p-eef73ce9.js +0 -2
|
@@ -388,7 +388,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
388
388
|
elm[memberName] = newValue;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
catch (e) {
|
|
391
|
+
catch (e) {
|
|
392
|
+
/**
|
|
393
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
394
|
+
*/
|
|
395
|
+
}
|
|
392
396
|
}
|
|
393
397
|
if (newValue == null || newValue === false) {
|
|
394
398
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
@@ -407,6 +411,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
407
411
|
}
|
|
408
412
|
};
|
|
409
413
|
const parseClassListRegex = /\s/;
|
|
414
|
+
/**
|
|
415
|
+
* Parsed a string of classnames into an array
|
|
416
|
+
* @param value className string, e.g. "foo bar baz"
|
|
417
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
418
|
+
*/
|
|
410
419
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
411
420
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
412
421
|
// if the element passed in is a shadow root, which is a document fragment
|
|
@@ -470,6 +479,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
470
479
|
}
|
|
471
480
|
}
|
|
472
481
|
}
|
|
482
|
+
// This needs to always happen so we can hide nodes that are projected
|
|
483
|
+
// to another component but don't end up in a slot
|
|
484
|
+
elm['s-hn'] = hostTagName;
|
|
473
485
|
return elm;
|
|
474
486
|
};
|
|
475
487
|
/**
|
|
@@ -593,8 +605,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
593
605
|
* @param oldCh the old children of the parent node
|
|
594
606
|
* @param newVNode the new VNode which will replace the parent
|
|
595
607
|
* @param newCh the new children of the parent node
|
|
608
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
596
609
|
*/
|
|
597
|
-
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
610
|
+
const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
|
|
598
611
|
let oldStartIdx = 0;
|
|
599
612
|
let newStartIdx = 0;
|
|
600
613
|
let oldEndIdx = oldCh.length - 1;
|
|
@@ -618,25 +631,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
618
631
|
else if (newEndVnode == null) {
|
|
619
632
|
newEndVnode = newCh[--newEndIdx];
|
|
620
633
|
}
|
|
621
|
-
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
634
|
+
else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
622
635
|
// if the start nodes are the same then we should patch the new VNode
|
|
623
636
|
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
624
637
|
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
625
638
|
// since things are matched up in order.
|
|
626
|
-
patch(oldStartVnode, newStartVnode);
|
|
639
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
627
640
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
628
641
|
newStartVnode = newCh[++newStartIdx];
|
|
629
642
|
}
|
|
630
|
-
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
643
|
+
else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
631
644
|
// likewise, if the end nodes are the same we patch new onto old and
|
|
632
645
|
// decrement our end indices, and also likewise in this case we don't
|
|
633
646
|
// need to move any DOM Nodes.
|
|
634
|
-
patch(oldEndVnode, newEndVnode);
|
|
647
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
635
648
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
636
649
|
newEndVnode = newCh[--newEndIdx];
|
|
637
650
|
}
|
|
638
|
-
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
639
|
-
patch(oldStartVnode, newEndVnode);
|
|
651
|
+
else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
652
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
640
653
|
// We need to move the element for `oldStartVnode` into a position which
|
|
641
654
|
// will be appropriate for `newEndVnode`. For this we can use
|
|
642
655
|
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
@@ -658,8 +671,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
658
671
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
659
672
|
newEndVnode = newCh[--newEndIdx];
|
|
660
673
|
}
|
|
661
|
-
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
662
|
-
patch(oldEndVnode, newStartVnode);
|
|
674
|
+
else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
675
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
663
676
|
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
664
677
|
// the same node, so since we're here we know that they are not. Thus we
|
|
665
678
|
// can move the element for `oldEndVnode` _before_ the element for
|
|
@@ -713,9 +726,10 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
713
726
|
*
|
|
714
727
|
* @param leftVNode the first VNode to check
|
|
715
728
|
* @param rightVNode the second VNode to check
|
|
729
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
716
730
|
* @returns whether they're equal or not
|
|
717
731
|
*/
|
|
718
|
-
const isSameVnode = (leftVNode, rightVNode) => {
|
|
732
|
+
const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
719
733
|
// compare if two vnode to see if they're "technically" the same
|
|
720
734
|
// need to have the same element tag, and same key to be the same
|
|
721
735
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
@@ -730,8 +744,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
730
744
|
*
|
|
731
745
|
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
732
746
|
* @param newVNode a new VNode representing an updated version of the old one
|
|
747
|
+
* @param isInitialRender whether or not this is the first render of the vdom
|
|
733
748
|
*/
|
|
734
|
-
const patch = (oldVNode, newVNode) => {
|
|
749
|
+
const patch = (oldVNode, newVNode, isInitialRender = false) => {
|
|
735
750
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
736
751
|
const oldChildren = oldVNode.$children$;
|
|
737
752
|
const newChildren = newVNode.$children$;
|
|
@@ -747,7 +762,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
747
762
|
if (oldChildren !== null && newChildren !== null) {
|
|
748
763
|
// looks like there's child vnodes for both the old and new vnodes
|
|
749
764
|
// so we need to call `updateChildren` to reconcile them
|
|
750
|
-
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
765
|
+
updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
|
|
751
766
|
}
|
|
752
767
|
else if (newChildren !== null) {
|
|
753
768
|
// add the new vnode children
|
|
@@ -816,7 +831,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
816
831
|
scopeId = hostElm['s-sc'];
|
|
817
832
|
}
|
|
818
833
|
// synchronous patch
|
|
819
|
-
patch(oldVNode, rootVnode);
|
|
834
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
820
835
|
};
|
|
821
836
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
822
837
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
@@ -1116,13 +1131,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1116
1131
|
*/
|
|
1117
1132
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1118
1133
|
var _a;
|
|
1134
|
+
const prototype = Cstr.prototype;
|
|
1119
1135
|
if (cmpMeta.$members$) {
|
|
1120
1136
|
if (Cstr.watchers) {
|
|
1121
1137
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1122
1138
|
}
|
|
1123
1139
|
// It's better to have a const than two Object.entries()
|
|
1124
1140
|
const members = Object.entries(cmpMeta.$members$);
|
|
1125
|
-
const prototype = Cstr.prototype;
|
|
1126
1141
|
members.map(([memberName, [memberFlags]]) => {
|
|
1127
1142
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1128
1143
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1145,6 +1160,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1145
1160
|
const attrNameToPropName = new Map();
|
|
1146
1161
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1147
1162
|
plt.jmp(() => {
|
|
1163
|
+
var _a;
|
|
1148
1164
|
const propName = attrNameToPropName.get(attrName);
|
|
1149
1165
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1150
1166
|
// in the case where an attribute was set inline.
|
|
@@ -1200,11 +1216,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1200
1216
|
// 1. The instance is ready
|
|
1201
1217
|
// 2. The watchers are ready
|
|
1202
1218
|
// 3. The value has changed
|
|
1203
|
-
if (
|
|
1219
|
+
if (flags &&
|
|
1220
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1204
1221
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1205
1222
|
newValue !== oldValue) {
|
|
1206
1223
|
const instance = hostRef.$lazyInstance$ ;
|
|
1207
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1224
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1208
1225
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1209
1226
|
if (instance[callbackName] != null) {
|
|
1210
1227
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
@@ -1226,10 +1243,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1226
1243
|
...members
|
|
1227
1244
|
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1228
1245
|
.map(([propName, m]) => {
|
|
1246
|
+
var _a;
|
|
1229
1247
|
const attrName = m[1] || propName;
|
|
1230
1248
|
attrNameToPropName.set(attrName, propName);
|
|
1231
1249
|
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1232
|
-
cmpMeta.$attrsToReflect
|
|
1250
|
+
(_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
|
|
1233
1251
|
}
|
|
1234
1252
|
return attrName;
|
|
1235
1253
|
}),
|
|
@@ -1484,12 +1502,14 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1484
1502
|
// If we have styles, add them to the DOM
|
|
1485
1503
|
if (dataStyles.innerHTML.length) {
|
|
1486
1504
|
dataStyles.setAttribute('data-styles', '');
|
|
1487
|
-
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1488
1505
|
// Apply CSP nonce to the style tag if it exists
|
|
1489
1506
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1490
1507
|
if (nonce != null) {
|
|
1491
1508
|
dataStyles.setAttribute('nonce', nonce);
|
|
1492
1509
|
}
|
|
1510
|
+
// Insert the styles into the document head
|
|
1511
|
+
// NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
|
|
1512
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1493
1513
|
}
|
|
1494
1514
|
// Process deferred connectedCallbacks now all components have been registered
|
|
1495
1515
|
isBootstrapping = false;
|
|
@@ -1567,19 +1587,19 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1567
1587
|
return module[exportName];
|
|
1568
1588
|
}
|
|
1569
1589
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1590
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1591
|
+
const processMod = importedModule => {
|
|
1592
|
+
cmpModules.set(bundleId, importedModule);
|
|
1593
|
+
return importedModule[exportName];
|
|
1594
|
+
}
|
|
1595
|
+
switch(bundleId) {
|
|
1596
|
+
|
|
1597
|
+
case 'mds-progress.cjs':
|
|
1598
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1599
|
+
/* webpackMode: "lazy" */
|
|
1600
|
+
'./mds-progress.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1601
|
+
}
|
|
1581
1602
|
}
|
|
1582
|
-
}
|
|
1583
1603
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1584
1604
|
/* @vite-ignore */
|
|
1585
1605
|
/* webpackInclude: /\.entry\.js$/ */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ef941864.js');
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -2,46 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ef941864.js');
|
|
6
6
|
|
|
7
7
|
const mdsProgressCss = "@tailwind utilities; :host{--mds-progress-background:rgb(var(--tone-neutral-08));--mds-progress-color:rgb(var(--brand-maggioli-03));--mds-progress-duration:750ms;--mds-progress-radius:0.5rem;--mds-progress-thickness:0.5rem;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;background-color:var(--mds-progress-background);border-radius:var(--mds-progress-radius);display:-ms-flexbox;display:flex;height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness);overflow:hidden;width:100%}:host([direction=\"vertical\"]){-ms-flex-direction:column;flex-direction:column;height:unset;min-height:var(--mds-progress-thickness);width:var(--mds-progress-thickness)}.progress{-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:var(--mds-progress-color);border-radius:var(--mds-progress-radius);-webkit-transition-duration:var(--mds-progress-duration);transition-duration:var(--mds-progress-duration);-webkit-transition-property:background-color, flex-grow;transition-property:background-color, flex-grow;transition-property:background-color, flex-grow, -ms-flex-positive}.fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([variant=\"dark\"]){--mds-progress-color:rgb(var(--tone-neutral-04));--mds-progress-background:rgb(var(--tone-neutral-08))}:host([variant=\"light\"]){--mds-progress-color:rgb(var(--tone-neutral));--mds-progress-background:rgb(var(--tone-neutral-05))}:host([variant=\"error\"]){--mds-progress-color:rgb(var(--status-error-06));--mds-progress-background:rgb(var(--status-error-09))}:host([variant=\"warning\"]){--mds-progress-color:rgb(var(--status-warning-06));--mds-progress-background:rgb(var(--status-warning-09))}:host([variant=\"success\"]){--mds-progress-color:rgb(var(--status-success-06));--mds-progress-background:rgb(var(--status-success-09))}:host([variant=\"info\"]){--mds-progress-color:rgb(var(--status-info-06));--mds-progress-background:rgb(var(--status-info-09))}:host([variant=\"primary\"]){--mds-progress-color:rgb(var(--brand-maggioli-03));--mds-progress-background:rgb(var(--tone-neutral-08))}";
|
|
8
8
|
|
|
9
9
|
const MdsProgress = class {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
componentWillLoad() {
|
|
20
|
-
this.stepsList = this.steps.split(',');
|
|
21
|
-
this.setProgress(this.progress);
|
|
22
|
-
}
|
|
23
|
-
setProgress(progress) {
|
|
24
|
-
if (this.steps) {
|
|
25
|
-
this.currentStep = this.stepsList[Math.round(progress * (this.stepsList.length - 1))];
|
|
26
|
-
this.element.setAttribute('aria-valuetext', this.currentStep);
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.stepsList = new Array();
|
|
13
|
+
this.currentStep = undefined;
|
|
14
|
+
this.progress = 0;
|
|
15
|
+
this.direction = 'horizontal';
|
|
16
|
+
this.variant = 'primary';
|
|
17
|
+
this.steps = 'Inizio,Un quarto,Metà,Tre quarti,Fine';
|
|
27
18
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this.stepsList = this.steps.split(',');
|
|
21
|
+
this.setProgress(this.progress);
|
|
22
|
+
}
|
|
23
|
+
setProgress(progress) {
|
|
24
|
+
if (this.steps) {
|
|
25
|
+
this.currentStep = this.stepsList[Math.round(progress * (this.stepsList.length - 1))];
|
|
26
|
+
this.element.setAttribute('aria-valuetext', this.currentStep);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
progressChanged(progress) {
|
|
30
|
+
this.setProgress(progress);
|
|
31
|
+
}
|
|
32
|
+
stepsChanged(steps) {
|
|
33
|
+
this.stepsList = steps.split(',');
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return (index.h(index.Host, { "aria-valuemax": "100", "aria-valuemin": "0", "aria-valuenow": Math.round(this.progress * 100), role: "progressbar" }, index.h("div", { class: "progress", style: this.direction === 'horizontal'
|
|
37
|
+
? { flexGrow: `${this.progress}` }
|
|
38
|
+
: { flexGrow: `${this.progress}`, width: '100%' } })));
|
|
39
|
+
}
|
|
40
|
+
get element() { return index.getElement(this); }
|
|
41
|
+
static get watchers() { return {
|
|
42
|
+
"progress": ["progressChanged"],
|
|
43
|
+
"steps": ["stepsChanged"]
|
|
44
|
+
}; }
|
|
45
45
|
};
|
|
46
46
|
MdsProgress.style = mdsProgressCss;
|
|
47
47
|
|
|
@@ -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-ef941864.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.9.1 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchBrowser = () => {
|
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-progress.cjs.js', document.baseURI).href));
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
const hash = (s) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
let i, h;
|
|
3
|
+
for (i = 0, h = 0; i < s.length; i++) {
|
|
4
|
+
h = Math.imul(31, h) + s.charCodeAt(i) | 0;
|
|
5
|
+
}
|
|
6
|
+
return h.toString();
|
|
7
7
|
};
|
|
8
8
|
const randomInt = (max) => Math.floor(Math.random() * max);
|
|
9
9
|
const unslugName = (name) => {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
|
|
12
12
|
};
|
|
13
13
|
const setAttributeIfEmpty = (element, attribute, value) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
var _a;
|
|
15
|
+
if (element.hasAttribute(attribute)) {
|
|
16
|
+
return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
|
|
17
|
+
}
|
|
18
|
+
element.setAttribute(attribute, value);
|
|
19
|
+
return value;
|
|
20
20
|
};
|
|
21
21
|
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
22
22
|
const hashRandomValue = (value) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const randomValue = randomInt(1000000);
|
|
24
|
+
if (value) {
|
|
25
|
+
return `${value}-${hash(randomValue.toString())}`;
|
|
26
|
+
}
|
|
27
|
+
return hash(randomValue.toString());
|
|
28
28
|
};
|
|
29
29
|
export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
export class KeyboardManager {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
constructor() {
|
|
3
|
+
this.elements = [];
|
|
4
|
+
this.handleClickBehaviorDispatchEvent = (event) => {
|
|
5
|
+
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
|
|
6
|
+
event.target.click();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
this.handleEscapeBehaviorDispatchEvent = (event) => {
|
|
10
|
+
if (event.code === 'Escape' && this.escapeCallback) {
|
|
11
|
+
this.escapeCallback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.addElement = (el, name = 'element') => {
|
|
15
|
+
this.elements[name] = el;
|
|
16
|
+
};
|
|
17
|
+
this.attachClickBehavior = (name = 'element') => {
|
|
18
|
+
if (this.elements[name]) {
|
|
19
|
+
this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.detachClickBehavior = (name = 'element') => {
|
|
23
|
+
if (this.elements[name]) {
|
|
24
|
+
this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.attachEscapeBehavior = (callBack) => {
|
|
28
|
+
this.escapeCallback = callBack;
|
|
29
|
+
if (window !== undefined) {
|
|
30
|
+
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.detachEscapeBehavior = () => {
|
|
34
|
+
this.escapeCallback = () => { return; };
|
|
35
|
+
if (window !== undefined) {
|
|
36
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
40
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
if (duration.includes('s')) {
|
|
3
|
+
return Number(duration.replace('s', '')) * 1000;
|
|
4
|
+
}
|
|
5
|
+
if (duration.includes('ms')) {
|
|
6
|
+
return Number(duration.replace('s', ''));
|
|
7
|
+
}
|
|
8
|
+
return defaultValue;
|
|
9
9
|
};
|
|
10
10
|
export { cssDurationToMilliseconds, };
|