@maggioli-design-system/mds-progress 2.6.0 → 2.6.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.
- package/dist/cjs/{index-8d1e9d2a.js → index-4c39a7df.js} +116 -21
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-progress.cjs.entry.js +2 -2
- package/dist/cjs/mds-progress.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/aria.js +9 -1
- package/dist/collection/common/keyboard-manager.js +2 -2
- package/dist/collection/components/mds-progress/mds-progress.css +4 -10
- package/dist/components/mds-progress.js +4 -1
- package/dist/documentation.json +3 -3
- package/dist/esm/{index-b34e0eee.js → index-84dce283.js} +116 -21
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-progress.entry.js +2 -2
- package/dist/esm/mds-progress.js +4 -4
- package/dist/esm-es5/index-84dce283.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 +1 -1
- package/dist/mds-progress/p-1ab5e470.entry.js +1 -0
- package/dist/mds-progress/p-576b3fa7.js +2 -0
- package/dist/mds-progress/p-a257dbdb.system.js +2 -0
- package/dist/mds-progress/p-aeb5044e.system.entry.js +1 -0
- package/dist/mds-progress/p-f0741149.system.js +1 -0
- package/dist/stats.json +32 -30
- package/dist/types/common/aria.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +19 -0
- package/documentation.json +15 -5
- package/package.json +3 -3
- package/readme.md +3 -1
- package/src/common/aria.ts +12 -0
- package/src/common/keyboard-manager.ts +2 -2
- package/src/components/mds-progress/mds-progress.css +6 -11
- package/src/components/mds-progress/readme.md +1 -1
- package/src/fixtures/icons.json +2 -0
- package/www/build/mds-progress.esm.js +1 -1
- package/www/build/mds-progress.js +1 -1
- package/www/build/p-1ab5e470.entry.js +1 -0
- package/www/build/p-576b3fa7.js +2 -0
- package/www/build/p-a257dbdb.system.js +2 -0
- package/www/build/p-aeb5044e.system.entry.js +1 -0
- package/www/build/p-f0741149.system.js +1 -0
- package/dist/esm-es5/index-b34e0eee.js +0 -2
- package/dist/mds-progress/p-1b808e2f.entry.js +0 -1
- package/dist/mds-progress/p-747d7cb5.system.js +0 -2
- package/dist/mds-progress/p-82d66bad.js +0 -2
- package/dist/mds-progress/p-b7abdcbf.system.entry.js +0 -1
- package/dist/mds-progress/p-da577edc.system.js +0 -1
- package/www/build/p-1b808e2f.entry.js +0 -1
- package/www/build/p-747d7cb5.system.js +0 -2
- package/www/build/p-82d66bad.js +0 -2
- package/www/build/p-b7abdcbf.system.entry.js +0 -1
- package/www/build/p-da577edc.system.js +0 -1
|
@@ -954,6 +954,10 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
954
954
|
*/
|
|
955
955
|
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
956
956
|
try {
|
|
957
|
+
/**
|
|
958
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
959
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
960
|
+
*/
|
|
957
961
|
instance = instance.render() ;
|
|
958
962
|
{
|
|
959
963
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1023,6 +1027,16 @@ const appDidLoad = (who) => {
|
|
|
1023
1027
|
}
|
|
1024
1028
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1025
1029
|
};
|
|
1030
|
+
/**
|
|
1031
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1032
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1033
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1034
|
+
* output bundle and this function returns `undefined`.
|
|
1035
|
+
* @param instance any object that may or may not contain methods
|
|
1036
|
+
* @param method method name
|
|
1037
|
+
* @param arg single arbitrary argument
|
|
1038
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1039
|
+
*/
|
|
1026
1040
|
const safeCall = (instance, method, arg) => {
|
|
1027
1041
|
if (instance && instance[method]) {
|
|
1028
1042
|
try {
|
|
@@ -1090,6 +1104,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1090
1104
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1091
1105
|
*/
|
|
1092
1106
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1107
|
+
var _a;
|
|
1093
1108
|
if (cmpMeta.$members$) {
|
|
1094
1109
|
if (Cstr.watchers) {
|
|
1095
1110
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -1117,7 +1132,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1117
1132
|
});
|
|
1118
1133
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1119
1134
|
const attrNameToPropName = new Map();
|
|
1120
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
1135
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1121
1136
|
plt.jmp(() => {
|
|
1122
1137
|
const propName = attrNameToPropName.get(attrName);
|
|
1123
1138
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
@@ -1165,26 +1180,65 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1165
1180
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1166
1181
|
return;
|
|
1167
1182
|
}
|
|
1183
|
+
else if (propName == null) {
|
|
1184
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
1185
|
+
// on a vanilla web component
|
|
1186
|
+
const hostRef = getHostRef(this);
|
|
1187
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
1188
|
+
// We only want to trigger the callback(s) if:
|
|
1189
|
+
// 1. The instance is ready
|
|
1190
|
+
// 2. The watchers are ready
|
|
1191
|
+
// 3. The value has changed
|
|
1192
|
+
if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1193
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1194
|
+
newValue !== oldValue) {
|
|
1195
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1196
|
+
const entry = cmpMeta.$watchers$[attrName];
|
|
1197
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1198
|
+
if (instance[callbackName] != null) {
|
|
1199
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1168
1205
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1169
1206
|
});
|
|
1170
1207
|
};
|
|
1171
|
-
//
|
|
1172
|
-
//
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1208
|
+
// Create an array of attributes to observe
|
|
1209
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1210
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1211
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1212
|
+
// an invalid attribute.
|
|
1213
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1214
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1215
|
+
...members
|
|
1216
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1217
|
+
.map(([propName, m]) => {
|
|
1218
|
+
const attrName = m[1] || propName;
|
|
1219
|
+
attrNameToPropName.set(attrName, propName);
|
|
1220
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1221
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1222
|
+
}
|
|
1223
|
+
return attrName;
|
|
1224
|
+
}),
|
|
1225
|
+
]));
|
|
1183
1226
|
}
|
|
1184
1227
|
}
|
|
1185
1228
|
return Cstr;
|
|
1186
1229
|
};
|
|
1187
|
-
|
|
1230
|
+
/**
|
|
1231
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
1232
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
1233
|
+
* and (optionally) an HMR version ID.
|
|
1234
|
+
*
|
|
1235
|
+
* @param elm a host element
|
|
1236
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
1237
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
1238
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
1239
|
+
*/
|
|
1240
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1241
|
+
let Cstr;
|
|
1188
1242
|
// initializeComponent
|
|
1189
1243
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1190
1244
|
// Let the runtime know that the component has been initialized
|
|
@@ -1339,6 +1393,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1339
1393
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1340
1394
|
lazyBundles.map((lazyBundle) => {
|
|
1341
1395
|
lazyBundle[1].map((compactMeta) => {
|
|
1396
|
+
var _a;
|
|
1342
1397
|
const cmpMeta = {
|
|
1343
1398
|
$flags$: compactMeta[0],
|
|
1344
1399
|
$tagName$: compactMeta[1],
|
|
@@ -1352,7 +1407,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1352
1407
|
cmpMeta.$attrsToReflect$ = [];
|
|
1353
1408
|
}
|
|
1354
1409
|
{
|
|
1355
|
-
cmpMeta.$watchers$ = {};
|
|
1410
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
1356
1411
|
}
|
|
1357
1412
|
const tagName = cmpMeta.$tagName$;
|
|
1358
1413
|
const HostElement = class extends HTMLElement {
|
|
@@ -1431,22 +1486,49 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1431
1486
|
* @returns void
|
|
1432
1487
|
*/
|
|
1433
1488
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1489
|
+
/**
|
|
1490
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
1491
|
+
* instances.
|
|
1492
|
+
*/
|
|
1434
1493
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1494
|
+
/**
|
|
1495
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
1496
|
+
*
|
|
1497
|
+
* @param ref the runtime ref of interest
|
|
1498
|
+
* @returns the Host reference (if found) or undefined
|
|
1499
|
+
*/
|
|
1435
1500
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1501
|
+
/**
|
|
1502
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
1503
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
1504
|
+
*
|
|
1505
|
+
* @param lazyInstance the lazy instance of interest
|
|
1506
|
+
* @param hostRef that instances `HostRef` object
|
|
1507
|
+
* @returns a reference to the host ref WeakMap
|
|
1508
|
+
*/
|
|
1436
1509
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1437
|
-
|
|
1510
|
+
/**
|
|
1511
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
1512
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
1513
|
+
* metadata.
|
|
1514
|
+
*
|
|
1515
|
+
* @param hostElement the host element to register
|
|
1516
|
+
* @param cmpMeta runtime metadata for that component
|
|
1517
|
+
* @returns a reference to the host ref WeakMap
|
|
1518
|
+
*/
|
|
1519
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
1438
1520
|
const hostRef = {
|
|
1439
1521
|
$flags$: 0,
|
|
1440
|
-
$hostElement$:
|
|
1522
|
+
$hostElement$: hostElement,
|
|
1441
1523
|
$cmpMeta$: cmpMeta,
|
|
1442
1524
|
$instanceValues$: new Map(),
|
|
1443
1525
|
};
|
|
1444
1526
|
{
|
|
1445
1527
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1446
|
-
|
|
1447
|
-
|
|
1528
|
+
hostElement['s-p'] = [];
|
|
1529
|
+
hostElement['s-rc'] = [];
|
|
1448
1530
|
}
|
|
1449
|
-
return hostRefs.set(
|
|
1531
|
+
return hostRefs.set(hostElement, hostRef);
|
|
1450
1532
|
};
|
|
1451
1533
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1452
1534
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -1459,7 +1541,20 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1459
1541
|
if (module) {
|
|
1460
1542
|
return module[exportName];
|
|
1461
1543
|
}
|
|
1462
|
-
|
|
1544
|
+
|
|
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);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1463
1558
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1464
1559
|
/* @vite-ignore */
|
|
1465
1560
|
/* webpackInclude: /\.entry\.js$/ */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-4c39a7df.js');
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]},null,{"progress":["progressChanged"],"steps":["stepsChanged"]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-4c39a7df.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
|
|
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
10
|
constructor(hostRef) {
|
|
@@ -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-4c39a7df.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.5.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));
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]},null,{"progress":["progressChanged"],"steps":["stepsChanged"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -5,6 +5,7 @@ const hash = (s) => {
|
|
|
5
5
|
}
|
|
6
6
|
return h.toString();
|
|
7
7
|
};
|
|
8
|
+
const randomInt = (max) => Math.floor(Math.random() * max);
|
|
8
9
|
const unslugName = (name) => {
|
|
9
10
|
var _a, _b, _c;
|
|
10
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;
|
|
@@ -18,4 +19,11 @@ const setAttributeIfEmpty = (element, attribute, value) => {
|
|
|
18
19
|
return value;
|
|
19
20
|
};
|
|
20
21
|
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
21
|
-
|
|
22
|
+
const hashRandomValue = (value) => {
|
|
23
|
+
const randomValue = randomInt(1000000);
|
|
24
|
+
if (value) {
|
|
25
|
+
return `${value}-${hash(randomValue.toString())}`;
|
|
26
|
+
}
|
|
27
|
+
return hash(randomValue.toString());
|
|
28
|
+
};
|
|
29
|
+
export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
|
|
@@ -26,13 +26,13 @@ export class KeyboardManager {
|
|
|
26
26
|
};
|
|
27
27
|
this.attachEscapeBehavior = (callBack) => {
|
|
28
28
|
this.escapeCallback = callBack;
|
|
29
|
-
if (
|
|
29
|
+
if (window !== undefined) {
|
|
30
30
|
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.detachEscapeBehavior = () => {
|
|
34
34
|
this.escapeCallback = () => { return; };
|
|
35
|
-
if (
|
|
35
|
+
if (window !== undefined) {
|
|
36
36
|
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
@@ -15,27 +15,21 @@
|
|
|
15
15
|
--mds-progress-duration: 750ms;
|
|
16
16
|
--mds-progress-radius: 0.5rem;
|
|
17
17
|
--mds-progress-thickness: 0.5rem;
|
|
18
|
-
display: flex;
|
|
19
|
-
width: 100%;
|
|
20
|
-
overflow: hidden;
|
|
21
18
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
22
19
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
23
20
|
transition-duration: 150ms;
|
|
24
21
|
|
|
25
22
|
background-color: var(--mds-progress-background);
|
|
26
23
|
border-radius: var(--mds-progress-radius);
|
|
24
|
+
display: flex;
|
|
27
25
|
height: var(--mds-progress-thickness);
|
|
28
26
|
min-width: var(--mds-progress-thickness);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
:host( [direction="vertical"] ){
|
|
32
|
-
|
|
33
|
-
height: 100%;
|
|
34
|
-
|
|
35
|
-
width: auto;
|
|
36
|
-
|
|
31
|
+
:host( [direction="vertical"] ) {
|
|
37
32
|
flex-direction: column;
|
|
38
|
-
|
|
39
33
|
height: unset;
|
|
40
34
|
min-height: var(--mds-progress-thickness);
|
|
41
35
|
width: var(--mds-progress-thickness);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
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
|
|
3
|
+
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))}";
|
|
4
4
|
|
|
5
5
|
const MdsProgress$1 = /*@__PURE__*/ proxyCustomElement(class MdsProgress extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -47,6 +47,9 @@ const MdsProgress$1 = /*@__PURE__*/ proxyCustomElement(class MdsProgress extends
|
|
|
47
47
|
"variant": [513],
|
|
48
48
|
"steps": [1],
|
|
49
49
|
"currentStep": [32]
|
|
50
|
+
}, undefined, {
|
|
51
|
+
"progress": ["progressChanged"],
|
|
52
|
+
"steps": ["stepsChanged"]
|
|
50
53
|
}]);
|
|
51
54
|
function defineCustomElement$1() {
|
|
52
55
|
if (typeof customElements === "undefined") {
|
package/dist/documentation.json
CHANGED
|
@@ -932,6 +932,10 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
932
932
|
*/
|
|
933
933
|
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
934
934
|
try {
|
|
935
|
+
/**
|
|
936
|
+
* minification optimization: `allRenderFn` is `true` if all components have a `render`
|
|
937
|
+
* method, so we can call the method immediately. If not, check before calling it.
|
|
938
|
+
*/
|
|
935
939
|
instance = instance.render() ;
|
|
936
940
|
{
|
|
937
941
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
@@ -1001,6 +1005,16 @@ const appDidLoad = (who) => {
|
|
|
1001
1005
|
}
|
|
1002
1006
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
1003
1007
|
};
|
|
1008
|
+
/**
|
|
1009
|
+
* Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
|
|
1010
|
+
* e.g. custom element node. If a build figures out that e.g. no component
|
|
1011
|
+
* has a `componentDidLoad` method, the instance method gets removed from the
|
|
1012
|
+
* output bundle and this function returns `undefined`.
|
|
1013
|
+
* @param instance any object that may or may not contain methods
|
|
1014
|
+
* @param method method name
|
|
1015
|
+
* @param arg single arbitrary argument
|
|
1016
|
+
* @returns result of method call if it exists, otherwise `undefined`
|
|
1017
|
+
*/
|
|
1004
1018
|
const safeCall = (instance, method, arg) => {
|
|
1005
1019
|
if (instance && instance[method]) {
|
|
1006
1020
|
try {
|
|
@@ -1068,6 +1082,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1068
1082
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1069
1083
|
*/
|
|
1070
1084
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1085
|
+
var _a;
|
|
1071
1086
|
if (cmpMeta.$members$) {
|
|
1072
1087
|
if (Cstr.watchers) {
|
|
1073
1088
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -1095,7 +1110,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1095
1110
|
});
|
|
1096
1111
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1097
1112
|
const attrNameToPropName = new Map();
|
|
1098
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
1113
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1099
1114
|
plt.jmp(() => {
|
|
1100
1115
|
const propName = attrNameToPropName.get(attrName);
|
|
1101
1116
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
@@ -1143,26 +1158,65 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1143
1158
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1144
1159
|
return;
|
|
1145
1160
|
}
|
|
1161
|
+
else if (propName == null) {
|
|
1162
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
1163
|
+
// on a vanilla web component
|
|
1164
|
+
const hostRef = getHostRef(this);
|
|
1165
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
1166
|
+
// We only want to trigger the callback(s) if:
|
|
1167
|
+
// 1. The instance is ready
|
|
1168
|
+
// 2. The watchers are ready
|
|
1169
|
+
// 3. The value has changed
|
|
1170
|
+
if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1171
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1172
|
+
newValue !== oldValue) {
|
|
1173
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1174
|
+
const entry = cmpMeta.$watchers$[attrName];
|
|
1175
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1176
|
+
if (instance[callbackName] != null) {
|
|
1177
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1146
1183
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1147
1184
|
});
|
|
1148
1185
|
};
|
|
1149
|
-
//
|
|
1150
|
-
//
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1186
|
+
// Create an array of attributes to observe
|
|
1187
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1188
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1189
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1190
|
+
// an invalid attribute.
|
|
1191
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1192
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1193
|
+
...members
|
|
1194
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1195
|
+
.map(([propName, m]) => {
|
|
1196
|
+
const attrName = m[1] || propName;
|
|
1197
|
+
attrNameToPropName.set(attrName, propName);
|
|
1198
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1199
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1200
|
+
}
|
|
1201
|
+
return attrName;
|
|
1202
|
+
}),
|
|
1203
|
+
]));
|
|
1161
1204
|
}
|
|
1162
1205
|
}
|
|
1163
1206
|
return Cstr;
|
|
1164
1207
|
};
|
|
1165
|
-
|
|
1208
|
+
/**
|
|
1209
|
+
* Initialize a Stencil component given a reference to its host element, its
|
|
1210
|
+
* runtime bookkeeping data structure, runtime metadata about the component,
|
|
1211
|
+
* and (optionally) an HMR version ID.
|
|
1212
|
+
*
|
|
1213
|
+
* @param elm a host element
|
|
1214
|
+
* @param hostRef the element's runtime bookkeeping object
|
|
1215
|
+
* @param cmpMeta runtime metadata for the Stencil component
|
|
1216
|
+
* @param hmrVersionId an (optional) HMR version ID
|
|
1217
|
+
*/
|
|
1218
|
+
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1219
|
+
let Cstr;
|
|
1166
1220
|
// initializeComponent
|
|
1167
1221
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1168
1222
|
// Let the runtime know that the component has been initialized
|
|
@@ -1317,6 +1371,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1317
1371
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1318
1372
|
lazyBundles.map((lazyBundle) => {
|
|
1319
1373
|
lazyBundle[1].map((compactMeta) => {
|
|
1374
|
+
var _a;
|
|
1320
1375
|
const cmpMeta = {
|
|
1321
1376
|
$flags$: compactMeta[0],
|
|
1322
1377
|
$tagName$: compactMeta[1],
|
|
@@ -1330,7 +1385,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1330
1385
|
cmpMeta.$attrsToReflect$ = [];
|
|
1331
1386
|
}
|
|
1332
1387
|
{
|
|
1333
|
-
cmpMeta.$watchers$ = {};
|
|
1388
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
1334
1389
|
}
|
|
1335
1390
|
const tagName = cmpMeta.$tagName$;
|
|
1336
1391
|
const HostElement = class extends HTMLElement {
|
|
@@ -1409,22 +1464,49 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1409
1464
|
* @returns void
|
|
1410
1465
|
*/
|
|
1411
1466
|
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1467
|
+
/**
|
|
1468
|
+
* A WeakMap mapping runtime component references to their corresponding host reference
|
|
1469
|
+
* instances.
|
|
1470
|
+
*/
|
|
1412
1471
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1472
|
+
/**
|
|
1473
|
+
* Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
|
|
1474
|
+
*
|
|
1475
|
+
* @param ref the runtime ref of interest
|
|
1476
|
+
* @returns the Host reference (if found) or undefined
|
|
1477
|
+
*/
|
|
1413
1478
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1479
|
+
/**
|
|
1480
|
+
* Register a lazy instance with the {@link hostRefs} object so it's
|
|
1481
|
+
* corresponding {@link d.HostRef} can be retrieved later.
|
|
1482
|
+
*
|
|
1483
|
+
* @param lazyInstance the lazy instance of interest
|
|
1484
|
+
* @param hostRef that instances `HostRef` object
|
|
1485
|
+
* @returns a reference to the host ref WeakMap
|
|
1486
|
+
*/
|
|
1414
1487
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1415
|
-
|
|
1488
|
+
/**
|
|
1489
|
+
* Register a host element for a Stencil component, setting up various metadata
|
|
1490
|
+
* and callbacks based on {@link BUILD} flags as well as the component's runtime
|
|
1491
|
+
* metadata.
|
|
1492
|
+
*
|
|
1493
|
+
* @param hostElement the host element to register
|
|
1494
|
+
* @param cmpMeta runtime metadata for that component
|
|
1495
|
+
* @returns a reference to the host ref WeakMap
|
|
1496
|
+
*/
|
|
1497
|
+
const registerHost = (hostElement, cmpMeta) => {
|
|
1416
1498
|
const hostRef = {
|
|
1417
1499
|
$flags$: 0,
|
|
1418
|
-
$hostElement$:
|
|
1500
|
+
$hostElement$: hostElement,
|
|
1419
1501
|
$cmpMeta$: cmpMeta,
|
|
1420
1502
|
$instanceValues$: new Map(),
|
|
1421
1503
|
};
|
|
1422
1504
|
{
|
|
1423
1505
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1424
|
-
|
|
1425
|
-
|
|
1506
|
+
hostElement['s-p'] = [];
|
|
1507
|
+
hostElement['s-rc'] = [];
|
|
1426
1508
|
}
|
|
1427
|
-
return hostRefs.set(
|
|
1509
|
+
return hostRefs.set(hostElement, hostRef);
|
|
1428
1510
|
};
|
|
1429
1511
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
1430
1512
|
const consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -1437,7 +1519,20 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1437
1519
|
if (module) {
|
|
1438
1520
|
return module[exportName];
|
|
1439
1521
|
}
|
|
1440
|
-
|
|
1522
|
+
|
|
1523
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
1524
|
+
const processMod = importedModule => {
|
|
1525
|
+
cmpModules.set(bundleId, importedModule);
|
|
1526
|
+
return importedModule[exportName];
|
|
1527
|
+
}
|
|
1528
|
+
switch(bundleId) {
|
|
1529
|
+
|
|
1530
|
+
case 'mds-progress':
|
|
1531
|
+
return import(
|
|
1532
|
+
/* webpackMode: "lazy" */
|
|
1533
|
+
'./mds-progress.entry.js').then(processMod, consoleError);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1441
1536
|
return import(
|
|
1442
1537
|
/* @vite-ignore */
|
|
1443
1538
|
/* webpackInclude: /\.entry\.js$/ */
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-84dce283.js';
|
|
2
|
+
export { s as setNonce } from './index-84dce283.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
|
-
return bootstrapLazy([["mds-progress",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
|
|
6
|
+
return bootstrapLazy([["mds-progress",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]},null,{"progress":["progressChanged"],"steps":["stepsChanged"]}]]]], options);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { defineCustomElements };
|