@maggioli-design-system/mds-progress 2.5.0 → 2.6.0
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-1d846f7a.js → index-8d1e9d2a.js} +172 -33
- package/dist/cjs/loader.cjs.js +2 -11
- package/dist/cjs/mds-progress.cjs.entry.js +1 -1
- package/dist/cjs/mds-progress.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/common/unit.js +10 -0
- package/dist/collection/components/mds-progress/mds-progress.js +5 -3
- package/dist/collection/components/mds-progress/test/mds-progress.e2e.js +10 -0
- package/dist/collection/components/mds-progress/test/mds-progress.stories.js +3 -3
- package/dist/collection/dictionary/button.js +5 -1
- package/dist/collection/dictionary/icon.js +2 -2
- package/dist/collection/dictionary/variant.js +9 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +1 -2
- package/dist/components/mds-progress.js +1 -1
- package/dist/documentation.d.ts +361 -88
- package/dist/documentation.json +49 -5
- package/dist/esm/{index-b254472d.js → index-b34e0eee.js} +172 -33
- package/dist/esm/loader.js +3 -12
- package/dist/esm/mds-progress.entry.js +1 -1
- package/dist/esm/mds-progress.js +3 -3
- package/dist/esm-es5/index-b34e0eee.js +2 -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 +2 -6
- package/dist/mds-progress/{p-a8e1043f.entry.js → p-1b808e2f.entry.js} +1 -1
- package/dist/mds-progress/p-747d7cb5.system.js +2 -0
- package/dist/mds-progress/p-82d66bad.js +2 -0
- package/dist/mds-progress/{p-de434aaf.system.entry.js → p-b7abdcbf.system.entry.js} +1 -1
- package/dist/mds-progress/{p-a3294ed0.system.js → p-da577edc.system.js} +1 -1
- package/dist/stats.json +39 -35
- package/dist/types/common/unit.d.ts +2 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +2 -1
- package/dist/types/dictionary/variant.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +32 -17
- package/dist/types/type/button.d.ts +1 -0
- package/dist/types/type/variant.d.ts +1 -0
- package/documentation.json +379 -5
- package/loader/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/common/unit.ts +14 -0
- package/src/components.d.ts +2 -0
- package/src/dictionary/button.ts +7 -1
- package/src/dictionary/variant.ts +10 -0
- package/src/fixtures/icons.json +39 -0
- package/src/fixtures/iconsauce.json +38 -0
- package/src/type/button.ts +4 -0
- package/src/type/variant.ts +9 -0
- package/www/build/mds-progress.esm.js +1 -1
- package/www/build/mds-progress.js +2 -6
- package/www/build/{p-a8e1043f.entry.js → p-1b808e2f.entry.js} +1 -1
- package/www/build/p-747d7cb5.system.js +2 -0
- package/www/build/p-82d66bad.js +2 -0
- package/www/build/{p-de434aaf.system.entry.js → p-b7abdcbf.system.entry.js} +1 -1
- package/www/build/{p-a3294ed0.system.js → p-da577edc.system.js} +1 -1
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/index-b254472d.js +0 -2
- package/dist/mds-progress/p-86f204e8.system.js +0 -2
- package/dist/mds-progress/p-d657b3ae.js +0 -2
- package/src/components/mds-progress/test/mds-progress.spec.tsx +0 -19
- package/www/build/p-86f204e8.system.js +0 -2
- package/www/build/p-d657b3ae.js +0 -2
|
@@ -58,6 +58,13 @@ const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
|
58
58
|
*/
|
|
59
59
|
const EMPTY_OBJ = {};
|
|
60
60
|
const isDef = (v) => v != null;
|
|
61
|
+
/**
|
|
62
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
63
|
+
* function.
|
|
64
|
+
*
|
|
65
|
+
* @param o the value to check
|
|
66
|
+
* @returns whether it's a complex type or not
|
|
67
|
+
*/
|
|
61
68
|
const isComplexType = (o) => {
|
|
62
69
|
// https://jsperf.com/typeof-fn-object/5
|
|
63
70
|
o = typeof o;
|
|
@@ -114,6 +121,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
114
121
|
};
|
|
115
122
|
walk(children);
|
|
116
123
|
if (vnodeData) {
|
|
124
|
+
// normalize class / className attributes
|
|
117
125
|
{
|
|
118
126
|
const classData = vnodeData.className || vnodeData.class;
|
|
119
127
|
if (classData) {
|
|
@@ -234,9 +242,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
234
242
|
}
|
|
235
243
|
styles.set(scopeId, style);
|
|
236
244
|
};
|
|
237
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
245
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
238
246
|
var _a;
|
|
239
|
-
|
|
247
|
+
const scopeId = getScopeId(cmpMeta);
|
|
240
248
|
const style = styles.get(scopeId);
|
|
241
249
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
242
250
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -251,10 +259,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
251
259
|
}
|
|
252
260
|
if (!appliedStyles.has(scopeId)) {
|
|
253
261
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
styleElm.innerHTML = style;
|
|
257
|
-
}
|
|
262
|
+
styleElm = doc.createElement('style');
|
|
263
|
+
styleElm.innerHTML = style;
|
|
258
264
|
// Apply CSP nonce to the style tag if it exists
|
|
259
265
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
260
266
|
if (nonce != null) {
|
|
@@ -301,6 +307,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
301
307
|
*
|
|
302
308
|
* Modified for Stencil's compiler and vdom
|
|
303
309
|
*/
|
|
310
|
+
/**
|
|
311
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
312
|
+
* corresponding HTML element.
|
|
313
|
+
*
|
|
314
|
+
* Note that this function has special functionality for the `class`,
|
|
315
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
316
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
317
|
+
*
|
|
318
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
319
|
+
* @param memberName the name of the attribute to set
|
|
320
|
+
* @param oldValue the old value for the attribute
|
|
321
|
+
* @param newValue the new value for the attribute
|
|
322
|
+
* @param isSvg whether we're in an svg context or not
|
|
323
|
+
* @param flags bitflags for Vdom variables
|
|
324
|
+
*/
|
|
304
325
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
305
326
|
if (oldValue !== newValue) {
|
|
306
327
|
let isProp = isMemberInElement(elm, memberName);
|
|
@@ -481,15 +502,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
481
502
|
* @param vnodes a list of virtual DOM nodes to remove
|
|
482
503
|
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
483
504
|
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
484
|
-
* @param vnode a VNode
|
|
485
|
-
* @param elm an element
|
|
486
505
|
*/
|
|
487
|
-
const removeVnodes = (vnodes, startIdx, endIdx
|
|
488
|
-
for (
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
elm
|
|
506
|
+
const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
507
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
508
|
+
const vnode = vnodes[index];
|
|
509
|
+
if (vnode) {
|
|
510
|
+
const elm = vnode.$elm$;
|
|
511
|
+
if (elm) {
|
|
512
|
+
// remove the vnode's element from the dom
|
|
513
|
+
elm.remove();
|
|
514
|
+
}
|
|
493
515
|
}
|
|
494
516
|
}
|
|
495
517
|
};
|
|
@@ -737,17 +759,44 @@ const patch = (oldVNode, newVNode) => {
|
|
|
737
759
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
738
760
|
* the DOM node into which it should be rendered.
|
|
739
761
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
762
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
740
763
|
*/
|
|
741
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
764
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
742
765
|
const hostElm = hostRef.$hostElement$;
|
|
743
766
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
744
767
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
768
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
769
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
770
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
771
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
772
|
+
// contains attrs that need to be set on the host element.
|
|
745
773
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
746
774
|
hostTagName = hostElm.tagName;
|
|
747
775
|
if (cmpMeta.$attrsToReflect$) {
|
|
748
776
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
749
777
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
750
778
|
}
|
|
779
|
+
// On the first render and *only* on the first render we want to check for
|
|
780
|
+
// any attributes set on the host element which are also set on the vdom
|
|
781
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
782
|
+
// the value from the host element, which allows developers building apps
|
|
783
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
784
|
+
// component even if it's already set on the `Host`.
|
|
785
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
786
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
787
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
788
|
+
// `class` which reconciles values coming from the VDom with values
|
|
789
|
+
// already present on the DOM element, so we don't want to override those
|
|
790
|
+
// attributes on the VDom tree with values from the host element if they
|
|
791
|
+
// are present.
|
|
792
|
+
//
|
|
793
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
794
|
+
// runtime and we don't want to override those either.
|
|
795
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
796
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
751
800
|
rootVnode.$tag$ = null;
|
|
752
801
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
753
802
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -778,20 +827,86 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
778
827
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
779
828
|
return writeTask(dispatch) ;
|
|
780
829
|
};
|
|
830
|
+
/**
|
|
831
|
+
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
832
|
+
* component lifecycle methods like `componentWillLoad` as well as
|
|
833
|
+
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
834
|
+
*
|
|
835
|
+
* @param hostRef a reference to a host DOM node
|
|
836
|
+
* @param isInitialLoad whether we're on the initial load or not
|
|
837
|
+
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
838
|
+
* the component
|
|
839
|
+
*/
|
|
781
840
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
782
841
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
783
842
|
const instance = hostRef.$lazyInstance$ ;
|
|
784
|
-
|
|
843
|
+
// We're going to use this variable together with `enqueue` to implement a
|
|
844
|
+
// little promise-based queue. We start out with it `undefined`. When we add
|
|
845
|
+
// the first function to the queue we'll set this variable to be that
|
|
846
|
+
// function's return value. When we attempt to add subsequent values to the
|
|
847
|
+
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
848
|
+
// the new function off of that `Promise` using `.then()`. This will give our
|
|
849
|
+
// queue two nice properties:
|
|
850
|
+
//
|
|
851
|
+
// 1. If all functions added to the queue are synchronous they'll be called
|
|
852
|
+
// synchronously right away.
|
|
853
|
+
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
854
|
+
// called in order after `dispatchHooks` exits.
|
|
855
|
+
let maybePromise;
|
|
785
856
|
if (isInitialLoad) {
|
|
786
857
|
{
|
|
787
|
-
|
|
858
|
+
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
859
|
+
// whatever's going on in that `Promise` before we launch into
|
|
860
|
+
// rendering the component, doing other lifecycle stuff, etc. So
|
|
861
|
+
// in that case we assign the returned promise to the variable we
|
|
862
|
+
// declared above to hold a possible 'queueing' Promise
|
|
863
|
+
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
788
864
|
}
|
|
789
865
|
}
|
|
790
866
|
endSchedule();
|
|
791
|
-
return
|
|
867
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
792
868
|
};
|
|
869
|
+
/**
|
|
870
|
+
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
871
|
+
* of functions to be called.
|
|
872
|
+
*
|
|
873
|
+
* The queue is ordered on the basis of the first argument. If it's
|
|
874
|
+
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
875
|
+
* be called synchronously (although note that this function may return a
|
|
876
|
+
* `Promise`). The idea is that then the return value of that enqueueing
|
|
877
|
+
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
878
|
+
* functions can be enqueued by calling this function again with that `Promise`
|
|
879
|
+
* as the first argument.
|
|
880
|
+
*
|
|
881
|
+
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
882
|
+
* @param fn a function to enqueue
|
|
883
|
+
* @returns either a `Promise` or the return value of the provided function
|
|
884
|
+
*/
|
|
885
|
+
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
886
|
+
/**
|
|
887
|
+
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
888
|
+
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
889
|
+
* the global has been overwritten, this is could be misleading, so we also do
|
|
890
|
+
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
891
|
+
* defined and a function.
|
|
892
|
+
*
|
|
893
|
+
* @param maybePromise it might be a promise!
|
|
894
|
+
* @returns whether it is or not
|
|
895
|
+
*/
|
|
896
|
+
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
897
|
+
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
898
|
+
/**
|
|
899
|
+
* Update a component given reference to its host elements and so on.
|
|
900
|
+
*
|
|
901
|
+
* @param hostRef an object containing references to the element's host node,
|
|
902
|
+
* VDom nodes, and other metadata
|
|
903
|
+
* @param instance a reference to the underlying host element where it will be
|
|
904
|
+
* rendered
|
|
905
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
906
|
+
* the first render cycle
|
|
907
|
+
*/
|
|
793
908
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
794
|
-
|
|
909
|
+
var _a;
|
|
795
910
|
const elm = hostRef.$hostElement$;
|
|
796
911
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
797
912
|
const rc = elm['s-rc'];
|
|
@@ -801,7 +916,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
801
916
|
}
|
|
802
917
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
803
918
|
{
|
|
804
|
-
callRender(hostRef, instance);
|
|
919
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
805
920
|
}
|
|
806
921
|
if (rc) {
|
|
807
922
|
// ok, so turns out there are some child host elements
|
|
@@ -813,7 +928,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
813
928
|
endRender();
|
|
814
929
|
endUpdate();
|
|
815
930
|
{
|
|
816
|
-
const childrenPromises = elm['s-p'];
|
|
931
|
+
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
817
932
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
818
933
|
if (childrenPromises.length === 0) {
|
|
819
934
|
postUpdate();
|
|
@@ -825,7 +940,19 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
825
940
|
}
|
|
826
941
|
}
|
|
827
942
|
};
|
|
828
|
-
|
|
943
|
+
/**
|
|
944
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
945
|
+
* various build variables
|
|
946
|
+
*
|
|
947
|
+
* @param hostRef an object containing references to the element's host node,
|
|
948
|
+
* VDom nodes, and other metadata
|
|
949
|
+
* @param instance a reference to the underlying host element where it will be
|
|
950
|
+
* rendered
|
|
951
|
+
* @param elm the Host element for the component
|
|
952
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
953
|
+
* @returns an empty promise
|
|
954
|
+
*/
|
|
955
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
829
956
|
try {
|
|
830
957
|
instance = instance.render() ;
|
|
831
958
|
{
|
|
@@ -840,7 +967,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
840
967
|
// or we need to update the css class/attrs on the host element
|
|
841
968
|
// DOM WRITE!
|
|
842
969
|
{
|
|
843
|
-
renderVdom(hostRef, instance);
|
|
970
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
844
971
|
}
|
|
845
972
|
}
|
|
846
973
|
}
|
|
@@ -907,9 +1034,6 @@ const safeCall = (instance, method, arg) => {
|
|
|
907
1034
|
}
|
|
908
1035
|
return undefined;
|
|
909
1036
|
};
|
|
910
|
-
const then = (promise, thenFn) => {
|
|
911
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
912
|
-
};
|
|
913
1037
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
914
1038
|
;
|
|
915
1039
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -1016,12 +1140,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1016
1140
|
// customElements.define('my-component', MyComponent);
|
|
1017
1141
|
// </script>
|
|
1018
1142
|
// ```
|
|
1019
|
-
// In this case if we do not
|
|
1143
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1020
1144
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1021
1145
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1022
|
-
// the connectedCallback attempts to
|
|
1146
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1023
1147
|
//
|
|
1024
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1148
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1025
1149
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1026
1150
|
//
|
|
1027
1151
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1063,9 +1187,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1063
1187
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1064
1188
|
// initializeComponent
|
|
1065
1189
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1190
|
+
// Let the runtime know that the component has been initialized
|
|
1191
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1066
1192
|
{
|
|
1067
|
-
// we haven't initialized this element yet
|
|
1068
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1069
1193
|
// lazy loaded components
|
|
1070
1194
|
// request the component's implementation to be
|
|
1071
1195
|
// wired up with the host element
|
|
@@ -1138,6 +1262,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1138
1262
|
schedule();
|
|
1139
1263
|
}
|
|
1140
1264
|
};
|
|
1265
|
+
const fireConnectedCallback = (instance) => {
|
|
1266
|
+
};
|
|
1141
1267
|
const connectedCallback = (elm) => {
|
|
1142
1268
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1143
1269
|
const hostRef = getHostRef(elm);
|
|
@@ -1176,12 +1302,25 @@ const connectedCallback = (elm) => {
|
|
|
1176
1302
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1177
1303
|
}
|
|
1178
1304
|
}
|
|
1305
|
+
else {
|
|
1306
|
+
// fire off connectedCallback() on component instance
|
|
1307
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1308
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1309
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1179
1312
|
endConnected();
|
|
1180
1313
|
}
|
|
1181
1314
|
};
|
|
1182
|
-
const
|
|
1315
|
+
const disconnectInstance = (instance) => {
|
|
1316
|
+
};
|
|
1317
|
+
const disconnectedCallback = async (elm) => {
|
|
1183
1318
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1184
|
-
getHostRef(elm);
|
|
1319
|
+
const hostRef = getHostRef(elm);
|
|
1320
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1321
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1322
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1323
|
+
}
|
|
1185
1324
|
}
|
|
1186
1325
|
};
|
|
1187
1326
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,20 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
9
|
-
*/
|
|
10
|
-
const patchEsm = () => {
|
|
11
|
-
return index.promiseResolve();
|
|
12
|
-
};
|
|
5
|
+
const index = require('./index-8d1e9d2a.js');
|
|
13
6
|
|
|
14
7
|
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return
|
|
16
|
-
return patchEsm().then(() => {
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
17
9
|
return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
|
|
18
|
-
});
|
|
19
10
|
};
|
|
20
11
|
|
|
21
12
|
exports.setNonce = index.setNonce;
|
|
@@ -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-8d1e9d2a.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;display:-ms-flexbox;display:flex;width:100%;overflow:hidden;-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);height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness)}:host([direction=\"vertical\"]){height:100%;width:auto;-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
|
|
|
@@ -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-8d1e9d2a.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser
|
|
8
|
+
Stencil Client Patch Browser v4.2.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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
3
|
+
"components/mds-progress/mds-progress.js"
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "2.
|
|
8
|
-
"typescriptVersion": "
|
|
7
|
+
"version": "4.2.1",
|
|
8
|
+
"typescriptVersion": "5.1.6"
|
|
9
9
|
},
|
|
10
10
|
"collections": [],
|
|
11
11
|
"bundles": []
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
9
|
+
};
|
|
10
|
+
export { cssDurationToMilliseconds, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Host, h } from
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class MdsProgress {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.stepsList = new Array();
|
|
@@ -70,7 +70,8 @@ export class MdsProgress {
|
|
|
70
70
|
"references": {
|
|
71
71
|
"DirectionType": {
|
|
72
72
|
"location": "import",
|
|
73
|
-
"path": "./meta/types"
|
|
73
|
+
"path": "./meta/types",
|
|
74
|
+
"id": "src/components/mds-progress/meta/types.ts::DirectionType"
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
},
|
|
@@ -93,7 +94,8 @@ export class MdsProgress {
|
|
|
93
94
|
"references": {
|
|
94
95
|
"ThemeVariantType": {
|
|
95
96
|
"location": "import",
|
|
96
|
-
"path": "@type/variant"
|
|
97
|
+
"path": "@type/variant",
|
|
98
|
+
"id": "src/type/variant.ts::ThemeVariantType"
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe('mds-progress', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<mds-progress></mds-progress>');
|
|
6
|
+
const element = await page.find('mds-progress');
|
|
7
|
+
expect(element).toHaveAttribute('hydrated');
|
|
8
|
+
expect(true).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { directionDictionary } from
|
|
2
|
-
import { themeVariantDictionary } from
|
|
3
|
-
import { h } from
|
|
1
|
+
import { directionDictionary } from "../meta/dictionary";
|
|
2
|
+
import { themeVariantDictionary } from "../../../dictionary/variant";
|
|
3
|
+
import { h } from "@stencil/core";
|
|
4
4
|
export default {
|
|
5
5
|
title: 'UI / Progress',
|
|
6
6
|
argTypes: {
|
|
@@ -13,6 +13,10 @@ const buttonToneVariantDictionary = [
|
|
|
13
13
|
'ghost',
|
|
14
14
|
'quiet',
|
|
15
15
|
];
|
|
16
|
+
const buttonTargetDictionary = [
|
|
17
|
+
'blank',
|
|
18
|
+
'self',
|
|
19
|
+
];
|
|
16
20
|
const buttonSizeDictionary = [
|
|
17
21
|
'sm',
|
|
18
22
|
'md',
|
|
@@ -23,4 +27,4 @@ const buttonIconPositionDictionary = [
|
|
|
23
27
|
'left',
|
|
24
28
|
'right',
|
|
25
29
|
];
|
|
26
|
-
export { buttonSizeDictionary, buttonToneVariantDictionary, buttonVariantDictionary,
|
|
30
|
+
export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonVariantDictionary, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import jsonIconsDictionary from
|
|
2
|
-
import jsonMggIconsDictionary from
|
|
1
|
+
import jsonIconsDictionary from "../fixtures/icons.json";
|
|
2
|
+
import jsonMggIconsDictionary from "../fixtures/iconsauce.json";
|
|
3
3
|
const iconsDictionary = jsonIconsDictionary;
|
|
4
4
|
const mggIconsDictionary = jsonMggIconsDictionary;
|
|
5
5
|
export { iconsDictionary, mggIconsDictionary, };
|
|
@@ -53,6 +53,14 @@ const toneVariantDictionary = [
|
|
|
53
53
|
'ghost',
|
|
54
54
|
'quiet',
|
|
55
55
|
];
|
|
56
|
+
const toneActionVariantDictionary = [
|
|
57
|
+
'primary',
|
|
58
|
+
'secondary',
|
|
59
|
+
'tertiary',
|
|
60
|
+
'strong',
|
|
61
|
+
'weak',
|
|
62
|
+
'quiet',
|
|
63
|
+
];
|
|
56
64
|
const toneSimpleVariantDictionary = [
|
|
57
65
|
'strong',
|
|
58
66
|
'weak',
|
|
@@ -62,4 +70,4 @@ const toneMinimalVariantDictionary = [
|
|
|
62
70
|
'strong',
|
|
63
71
|
'weak',
|
|
64
72
|
];
|
|
65
|
-
export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
|
|
73
|
+
export { themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneVariantDictionary, };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Used to manually set the base path where assets can be found.
|
|
@@ -28,4 +31,3 @@ export interface SetPlatformOptions {
|
|
|
28
31
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
29
32
|
}
|
|
30
33
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
31
|
-
export * from '../types/components';
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { MdsProgress, defineCustomElement as defineCustomElementMdsProgress } from './mds-progress.js';
|
|
1
|
+
export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
|
|
3
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;display:-ms-flexbox;display:flex;width:100%;overflow:hidden;-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);height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness)}:host([direction=\"vertical\"]){height:100%;width:auto;-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
|
-
const MdsProgress$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
const MdsProgress$1 = /*@__PURE__*/ proxyCustomElement(class MdsProgress extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|