@maggioli-design-system/mds-progress 2.8.0 → 2.8.2

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.
Files changed (67) hide show
  1. package/dist/cjs/{index-4c39a7df.js → index-53e759e9.js} +60 -23
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mds-progress.cjs.entry.js +36 -36
  4. package/dist/cjs/mds-progress.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/aria.js +18 -18
  7. package/dist/collection/common/keyboard-manager.js +38 -38
  8. package/dist/collection/common/unit.js +7 -7
  9. package/dist/collection/components/mds-progress/mds-progress.css +5 -0
  10. package/dist/collection/components/mds-progress/mds-progress.js +142 -142
  11. package/dist/collection/components/mds-progress/meta/dictionary.js +2 -2
  12. package/dist/collection/components/mds-progress/test/mds-progress.e2e.js +7 -7
  13. package/dist/collection/components/mds-progress/test/mds-progress.stories.js +20 -20
  14. package/dist/collection/dictionary/autocomplete.js +56 -56
  15. package/dist/collection/dictionary/button.js +19 -19
  16. package/dist/collection/dictionary/color.js +14 -14
  17. package/dist/collection/dictionary/floating-ui.js +14 -14
  18. package/dist/collection/dictionary/input.js +31 -15
  19. package/dist/collection/dictionary/loading.js +2 -2
  20. package/dist/collection/dictionary/typography.js +46 -46
  21. package/dist/collection/dictionary/variant.js +54 -54
  22. package/dist/collection/fixtures/cities.js +107 -107
  23. package/dist/components/mds-progress.d.ts +2 -2
  24. package/dist/components/mds-progress.js +58 -58
  25. package/dist/documentation.json +2 -2
  26. package/dist/esm/{index-84dce283.js → index-d7c3a08c.js} +60 -23
  27. package/dist/esm/loader.js +2 -2
  28. package/dist/esm/mds-progress.entry.js +36 -36
  29. package/dist/esm/mds-progress.js +3 -3
  30. package/dist/esm-es5/index-d7c3a08c.js +1 -0
  31. package/dist/esm-es5/loader.js +1 -1
  32. package/dist/esm-es5/mds-progress.entry.js +1 -1
  33. package/dist/esm-es5/mds-progress.js +1 -1
  34. package/dist/mds-progress/mds-progress.esm.js +1 -1
  35. package/dist/mds-progress/mds-progress.js +15 -15
  36. package/dist/mds-progress/p-3fd7c0e1.system.js +2 -0
  37. package/dist/mds-progress/{p-8adca417.system.js → p-72564754.system.js} +1 -1
  38. package/{www/build/p-1ab5e470.entry.js → dist/mds-progress/p-ba0c7117.entry.js} +1 -1
  39. package/dist/mds-progress/p-e157ffcb.js +2 -0
  40. package/dist/mds-progress/p-efdf2de7.system.entry.js +1 -0
  41. package/dist/stats.json +30 -30
  42. package/dist/types/common/keyboard-manager.d.ts +9 -9
  43. package/dist/types/components/mds-progress/mds-progress.d.ts +24 -24
  44. package/dist/types/components/mds-progress/test/mds-progress.stories.d.ts +37 -37
  45. package/dist/types/dictionary/input.d.ts +2 -1
  46. package/dist/types/interface/input-value.d.ts +1 -1
  47. package/dist/types/stencil-public-runtime.d.ts +8 -0
  48. package/documentation.json +14 -4
  49. package/package.json +3 -3
  50. package/src/components/mds-progress/mds-progress.css +1 -1
  51. package/src/dictionary/input.ts +18 -0
  52. package/src/fixtures/icons.json +3 -0
  53. package/src/fixtures/iconsauce.json +3 -0
  54. package/www/build/mds-progress.esm.js +1 -1
  55. package/www/build/mds-progress.js +15 -15
  56. package/www/build/p-3fd7c0e1.system.js +2 -0
  57. package/www/build/{p-8adca417.system.js → p-72564754.system.js} +1 -1
  58. package/{dist/mds-progress/p-1ab5e470.entry.js → www/build/p-ba0c7117.entry.js} +1 -1
  59. package/www/build/p-e157ffcb.js +2 -0
  60. package/www/build/p-efdf2de7.system.entry.js +1 -0
  61. package/dist/esm-es5/index-84dce283.js +0 -1
  62. package/dist/mds-progress/p-576b3fa7.js +0 -2
  63. package/dist/mds-progress/p-a257dbdb.system.js +0 -2
  64. package/dist/mds-progress/p-aeb5044e.system.entry.js +0 -1
  65. package/www/build/p-576b3fa7.js +0 -2
  66. package/www/build/p-a257dbdb.system.js +0 -2
  67. package/www/build/p-aeb5044e.system.entry.js +0 -1
@@ -49,6 +49,13 @@ const uniqueTime = (key, measureText) => {
49
49
  }
50
50
  };
51
51
  const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
52
+ /**
53
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
54
+ *
55
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
56
+ * support as of Stencil v4.
57
+ */
58
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
52
59
  /**
53
60
  * Default style mode id
54
61
  */
@@ -268,6 +275,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
268
275
  }
269
276
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
270
277
  }
278
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
279
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
280
+ styleElm.innerHTML += SLOT_FB_CSS;
281
+ }
271
282
  if (appliedStyles) {
272
283
  appliedStyles.add(scopeId);
273
284
  }
@@ -377,7 +388,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
377
388
  elm[memberName] = newValue;
378
389
  }
379
390
  }
380
- 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
+ }
381
396
  }
382
397
  if (newValue == null || newValue === false) {
383
398
  if (newValue !== false || elm.getAttribute(memberName) === '') {
@@ -396,6 +411,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
396
411
  }
397
412
  };
398
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
+ */
399
419
  const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
400
420
  const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
401
421
  // if the element passed in is a shadow root, which is a document fragment
@@ -1105,13 +1125,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1105
1125
  */
1106
1126
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1107
1127
  var _a;
1128
+ const prototype = Cstr.prototype;
1108
1129
  if (cmpMeta.$members$) {
1109
1130
  if (Cstr.watchers) {
1110
1131
  cmpMeta.$watchers$ = Cstr.watchers;
1111
1132
  }
1112
1133
  // It's better to have a const than two Object.entries()
1113
1134
  const members = Object.entries(cmpMeta.$members$);
1114
- const prototype = Cstr.prototype;
1115
1135
  members.map(([memberName, [memberFlags]]) => {
1116
1136
  if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1117
1137
  ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
@@ -1134,6 +1154,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1134
1154
  const attrNameToPropName = new Map();
1135
1155
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1136
1156
  plt.jmp(() => {
1157
+ var _a;
1137
1158
  const propName = attrNameToPropName.get(attrName);
1138
1159
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1139
1160
  // in the case where an attribute was set inline.
@@ -1189,11 +1210,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1189
1210
  // 1. The instance is ready
1190
1211
  // 2. The watchers are ready
1191
1212
  // 3. The value has changed
1192
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1213
+ if (flags &&
1214
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1193
1215
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1194
1216
  newValue !== oldValue) {
1195
1217
  const instance = hostRef.$lazyInstance$ ;
1196
- const entry = cmpMeta.$watchers$[attrName];
1218
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1197
1219
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1198
1220
  if (instance[callbackName] != null) {
1199
1221
  instance[callbackName].call(instance, newValue, oldValue, attrName);
@@ -1215,10 +1237,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1215
1237
  ...members
1216
1238
  .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1217
1239
  .map(([propName, m]) => {
1240
+ var _a;
1218
1241
  const attrName = m[1] || propName;
1219
1242
  attrNameToPropName.set(attrName, propName);
1220
1243
  if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1221
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1244
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1222
1245
  }
1223
1246
  return attrName;
1224
1247
  }),
@@ -1385,12 +1408,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1385
1408
  const customElements = win.customElements;
1386
1409
  const head = doc.head;
1387
1410
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1388
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1411
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1389
1412
  const deferredConnectedCallbacks = [];
1390
1413
  let appLoadFallback;
1391
1414
  let isBootstrapping = true;
1392
1415
  Object.assign(plt, options);
1393
1416
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1417
+ let hasSlotRelocation = false;
1394
1418
  lazyBundles.map((lazyBundle) => {
1395
1419
  lazyBundle[1].map((compactMeta) => {
1396
1420
  var _a;
@@ -1400,6 +1424,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1400
1424
  $members$: compactMeta[2],
1401
1425
  $listeners$: compactMeta[3],
1402
1426
  };
1427
+ // Check if we are using slots outside the shadow DOM in this component.
1428
+ // We'll use this information later to add styles for `slot-fb` elements
1429
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1430
+ hasSlotRelocation = true;
1431
+ }
1403
1432
  {
1404
1433
  cmpMeta.$members$ = compactMeta[2];
1405
1434
  }
@@ -1456,15 +1485,23 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1456
1485
  }
1457
1486
  });
1458
1487
  });
1488
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1489
+ if (hasSlotRelocation) {
1490
+ dataStyles.innerHTML += SLOT_FB_CSS;
1491
+ }
1492
+ // Add hydration styles
1459
1493
  {
1460
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1461
- visibilityStyle.setAttribute('data-styles', '');
1494
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
1495
+ }
1496
+ // If we have styles, add them to the DOM
1497
+ if (dataStyles.innerHTML.length) {
1498
+ dataStyles.setAttribute('data-styles', '');
1499
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1462
1500
  // Apply CSP nonce to the style tag if it exists
1463
1501
  const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1464
1502
  if (nonce != null) {
1465
- visibilityStyle.setAttribute('nonce', nonce);
1503
+ dataStyles.setAttribute('nonce', nonce);
1466
1504
  }
1467
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1468
1505
  }
1469
1506
  // Process deferred connectedCallbacks now all components have been registered
1470
1507
  isBootstrapping = false;
@@ -1542,19 +1579,19 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1542
1579
  return module[exportName];
1543
1580
  }
1544
1581
 
1545
- if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1546
- const processMod = importedModule => {
1547
- cmpModules.set(bundleId, importedModule);
1548
- return importedModule[exportName];
1549
- }
1550
- switch(bundleId) {
1551
-
1552
- case 'mds-progress.cjs':
1553
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1554
- /* webpackMode: "lazy" */
1555
- './mds-progress.cjs.entry.js')); }).then(processMod, consoleError);
1582
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1583
+ const processMod = importedModule => {
1584
+ cmpModules.set(bundleId, importedModule);
1585
+ return importedModule[exportName];
1586
+ }
1587
+ switch(bundleId) {
1588
+
1589
+ case 'mds-progress.cjs':
1590
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1591
+ /* webpackMode: "lazy" */
1592
+ './mds-progress.cjs.entry.js')); }).then(processMod, consoleError);
1593
+ }
1556
1594
  }
1557
- }
1558
1595
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1559
1596
  /* @vite-ignore */
1560
1597
  /* webpackInclude: /\.entry\.js$/ */
@@ -1629,7 +1666,7 @@ const flush = () => {
1629
1666
  }
1630
1667
  }
1631
1668
  };
1632
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1669
+ const nextTick = (cb) => promiseResolve().then(cb);
1633
1670
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1634
1671
 
1635
1672
  exports.Host = Host;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4c39a7df.js');
5
+ const index = require('./index-53e759e9.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-4c39a7df.js');
5
+ const index = require('./index-53e759e9.js');
6
6
 
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))}";
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}.text{font-size:1rem}.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
- 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';
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
- 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
- }; }
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-4c39a7df.js');
5
+ const index = require('./index-53e759e9.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.7.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.8.0 | 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));
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.7.1",
7
+ "version": "4.8.0",
8
8
  "typescriptVersion": "5.2.2"
9
9
  },
10
10
  "collections": [],
@@ -1,29 +1,29 @@
1
1
  const hash = (s) => {
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();
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
- 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;
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
- 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;
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
- const randomValue = randomInt(1000000);
24
- if (value) {
25
- return `${value}-${hash(randomValue.toString())}`;
26
- }
27
- return hash(randomValue.toString());
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
- 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
- }
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
- 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;
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, };
@@ -60,6 +60,11 @@
60
60
  border-width: 1px;
61
61
  }
62
62
 
63
+ .text{
64
+
65
+ font-size: 1rem;
66
+ }
67
+
63
68
  .shadow{
64
69
 
65
70
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);