@maggioli-design-system/mds-modal 4.2.0 → 4.4.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-f216518d.js → index-0ac65212.js} +175 -37
- package/dist/cjs/loader.cjs.js +2 -11
- package/dist/cjs/mds-modal.cjs.entry.js +3 -3
- package/dist/cjs/mds-modal.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-modal/mds-modal.css +4 -2
- package/dist/collection/components/mds-modal/mds-modal.js +13 -6
- package/dist/collection/components/mds-modal/test/mds-modal.e2e.js +55 -0
- package/dist/collection/components/mds-modal/test/mds-modal.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-modal.js +3 -3
- package/dist/documentation.d.ts +361 -88
- package/dist/documentation.json +75 -8
- package/dist/esm/{index-118e6bec.js → index-6f346db2.js} +175 -37
- package/dist/esm/loader.js +3 -12
- package/dist/esm/mds-modal.entry.js +3 -3
- package/dist/esm/mds-modal.js +3 -3
- package/dist/esm-es5/index-6f346db2.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-modal.js +1 -1
- package/dist/mds-modal/mds-modal.esm.js +1 -1
- package/dist/mds-modal/mds-modal.js +2 -6
- package/dist/mds-modal/p-3bcc29b0.js +2 -0
- package/dist/mds-modal/{p-e2fdb863.system.js → p-5561703a.system.js} +1 -1
- package/dist/mds-modal/p-5c4c27fb.entry.js +1 -0
- package/dist/mds-modal/p-7a7afece.system.entry.js +1 -0
- package/dist/mds-modal/p-d94af3e0.system.js +2 -0
- package/dist/stats.json +80 -41
- package/dist/types/common/unit.d.ts +2 -0
- package/dist/types/components.d.ts +1 -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 +410 -8
- package/loader/index.d.ts +2 -2
- package/package.json +3 -3
- package/readme.md +17 -0
- package/src/common/unit.ts +14 -0
- package/src/components/mds-modal/mds-modal.css +2 -1
- package/src/components/mds-modal/mds-modal.tsx +9 -1
- package/src/components/mds-modal/readme.md +17 -0
- package/src/components/mds-modal/test/mds-modal.e2e.ts +2 -2
- package/src/components.d.ts +1 -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-modal.esm.js +1 -1
- package/www/build/mds-modal.js +2 -6
- package/www/build/p-3bcc29b0.js +2 -0
- package/www/build/{p-e2fdb863.system.js → p-5561703a.system.js} +1 -1
- package/www/build/p-5c4c27fb.entry.js +1 -0
- package/www/build/p-7a7afece.system.entry.js +1 -0
- package/www/build/p-d94af3e0.system.js +2 -0
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/index-118e6bec.js +0 -2
- package/dist/mds-modal/p-3aeea0b7.system.js +0 -2
- package/dist/mds-modal/p-4fdbb5fc.js +0 -2
- package/dist/mds-modal/p-8363eae7.system.entry.js +0 -1
- package/dist/mds-modal/p-a7878434.entry.js +0 -1
- package/src/components/mds-modal/test/mds-modal.spec.tsx +0 -19
- package/www/build/p-3aeea0b7.system.js +0 -2
- package/www/build/p-4fdbb5fc.js +0 -2
- package/www/build/p-8363eae7.system.entry.js +0 -1
- package/www/build/p-a7878434.entry.js +0 -1
|
@@ -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) {
|
|
@@ -248,9 +256,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
248
256
|
}
|
|
249
257
|
styles.set(scopeId, style);
|
|
250
258
|
};
|
|
251
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
|
259
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
252
260
|
var _a;
|
|
253
|
-
|
|
261
|
+
const scopeId = getScopeId(cmpMeta);
|
|
254
262
|
const style = styles.get(scopeId);
|
|
255
263
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
256
264
|
// so the fallback is to always use the document for the root node in those cases
|
|
@@ -265,10 +273,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
265
273
|
}
|
|
266
274
|
if (!appliedStyles.has(scopeId)) {
|
|
267
275
|
{
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
styleElm.innerHTML = style;
|
|
271
|
-
}
|
|
276
|
+
styleElm = doc.createElement('style');
|
|
277
|
+
styleElm.innerHTML = style;
|
|
272
278
|
// Apply CSP nonce to the style tag if it exists
|
|
273
279
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
274
280
|
if (nonce != null) {
|
|
@@ -315,6 +321,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
|
315
321
|
*
|
|
316
322
|
* Modified for Stencil's compiler and vdom
|
|
317
323
|
*/
|
|
324
|
+
/**
|
|
325
|
+
* When running a VDom render set properties present on a VDom node onto the
|
|
326
|
+
* corresponding HTML element.
|
|
327
|
+
*
|
|
328
|
+
* Note that this function has special functionality for the `class`,
|
|
329
|
+
* `style`, `key`, and `ref` attributes, as well as event handlers (like
|
|
330
|
+
* `onClick`, etc). All others are just passed through as-is.
|
|
331
|
+
*
|
|
332
|
+
* @param elm the HTMLElement onto which attributes should be set
|
|
333
|
+
* @param memberName the name of the attribute to set
|
|
334
|
+
* @param oldValue the old value for the attribute
|
|
335
|
+
* @param newValue the new value for the attribute
|
|
336
|
+
* @param isSvg whether we're in an svg context or not
|
|
337
|
+
* @param flags bitflags for Vdom variables
|
|
338
|
+
*/
|
|
318
339
|
const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
319
340
|
if (oldValue !== newValue) {
|
|
320
341
|
let isProp = isMemberInElement(elm, memberName);
|
|
@@ -513,15 +534,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
513
534
|
* @param vnodes a list of virtual DOM nodes to remove
|
|
514
535
|
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
515
536
|
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
516
|
-
* @param vnode a VNode
|
|
517
|
-
* @param elm an element
|
|
518
537
|
*/
|
|
519
|
-
const removeVnodes = (vnodes, startIdx, endIdx
|
|
520
|
-
for (
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
elm
|
|
538
|
+
const removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
539
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
540
|
+
const vnode = vnodes[index];
|
|
541
|
+
if (vnode) {
|
|
542
|
+
const elm = vnode.$elm$;
|
|
543
|
+
if (elm) {
|
|
544
|
+
// remove the vnode's element from the dom
|
|
545
|
+
elm.remove();
|
|
546
|
+
}
|
|
525
547
|
}
|
|
526
548
|
}
|
|
527
549
|
};
|
|
@@ -783,17 +805,44 @@ const patch = (oldVNode, newVNode) => {
|
|
|
783
805
|
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
784
806
|
* the DOM node into which it should be rendered.
|
|
785
807
|
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
808
|
+
* @param isInitialLoad whether or not this is the first call after page load
|
|
786
809
|
*/
|
|
787
|
-
const renderVdom = (hostRef, renderFnResults) => {
|
|
810
|
+
const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
788
811
|
const hostElm = hostRef.$hostElement$;
|
|
789
812
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
790
813
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
814
|
+
// if `renderFnResults` is a Host node then we can use it directly. If not,
|
|
815
|
+
// we need to call `h` again to wrap the children of our component in a
|
|
816
|
+
// 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
|
|
817
|
+
// implicitly that the top-level vdom node is 1) an only child and 2)
|
|
818
|
+
// contains attrs that need to be set on the host element.
|
|
791
819
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
792
820
|
hostTagName = hostElm.tagName;
|
|
793
821
|
if (cmpMeta.$attrsToReflect$) {
|
|
794
822
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
795
823
|
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
796
824
|
}
|
|
825
|
+
// On the first render and *only* on the first render we want to check for
|
|
826
|
+
// any attributes set on the host element which are also set on the vdom
|
|
827
|
+
// node. If we find them, we override the value on the VDom node attrs with
|
|
828
|
+
// the value from the host element, which allows developers building apps
|
|
829
|
+
// with Stencil components to override e.g. the `role` attribute on a
|
|
830
|
+
// component even if it's already set on the `Host`.
|
|
831
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
832
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
833
|
+
// We have a special implementation in `setAccessor` for `style` and
|
|
834
|
+
// `class` which reconciles values coming from the VDom with values
|
|
835
|
+
// already present on the DOM element, so we don't want to override those
|
|
836
|
+
// attributes on the VDom tree with values from the host element if they
|
|
837
|
+
// are present.
|
|
838
|
+
//
|
|
839
|
+
// Likewise, `ref` and `key` are special internal values for the Stencil
|
|
840
|
+
// runtime and we don't want to override those either.
|
|
841
|
+
if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
|
|
842
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
797
846
|
rootVnode.$tag$ = null;
|
|
798
847
|
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
799
848
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -824,30 +873,96 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
|
824
873
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
825
874
|
return writeTask(dispatch) ;
|
|
826
875
|
};
|
|
876
|
+
/**
|
|
877
|
+
* Dispatch initial-render and update lifecycle hooks, enqueuing calls to
|
|
878
|
+
* component lifecycle methods like `componentWillLoad` as well as
|
|
879
|
+
* {@link updateComponent}, which will kick off the virtual DOM re-render.
|
|
880
|
+
*
|
|
881
|
+
* @param hostRef a reference to a host DOM node
|
|
882
|
+
* @param isInitialLoad whether we're on the initial load or not
|
|
883
|
+
* @returns an empty Promise which is used to enqueue a series of operations for
|
|
884
|
+
* the component
|
|
885
|
+
*/
|
|
827
886
|
const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
828
887
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
829
888
|
const instance = hostRef.$lazyInstance$ ;
|
|
830
|
-
|
|
889
|
+
// We're going to use this variable together with `enqueue` to implement a
|
|
890
|
+
// little promise-based queue. We start out with it `undefined`. When we add
|
|
891
|
+
// the first function to the queue we'll set this variable to be that
|
|
892
|
+
// function's return value. When we attempt to add subsequent values to the
|
|
893
|
+
// queue we'll check that value and, if it was a `Promise`, we'll then chain
|
|
894
|
+
// the new function off of that `Promise` using `.then()`. This will give our
|
|
895
|
+
// queue two nice properties:
|
|
896
|
+
//
|
|
897
|
+
// 1. If all functions added to the queue are synchronous they'll be called
|
|
898
|
+
// synchronously right away.
|
|
899
|
+
// 2. If all functions added to the queue are asynchronous they'll all be
|
|
900
|
+
// called in order after `dispatchHooks` exits.
|
|
901
|
+
let maybePromise;
|
|
831
902
|
if (isInitialLoad) {
|
|
832
903
|
{
|
|
833
904
|
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
834
905
|
if (hostRef.$queuedListeners$) {
|
|
835
906
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
836
|
-
hostRef.$queuedListeners$ =
|
|
907
|
+
hostRef.$queuedListeners$ = undefined;
|
|
837
908
|
}
|
|
838
909
|
}
|
|
839
910
|
{
|
|
840
|
-
|
|
911
|
+
// If `componentWillLoad` returns a `Promise` then we want to wait on
|
|
912
|
+
// whatever's going on in that `Promise` before we launch into
|
|
913
|
+
// rendering the component, doing other lifecycle stuff, etc. So
|
|
914
|
+
// in that case we assign the returned promise to the variable we
|
|
915
|
+
// declared above to hold a possible 'queueing' Promise
|
|
916
|
+
maybePromise = safeCall(instance, 'componentWillLoad');
|
|
841
917
|
}
|
|
842
918
|
}
|
|
843
919
|
{
|
|
844
|
-
|
|
920
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
|
|
845
921
|
}
|
|
846
922
|
endSchedule();
|
|
847
|
-
return
|
|
923
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
848
924
|
};
|
|
925
|
+
/**
|
|
926
|
+
* This function uses a Promise to implement a simple first-in, first-out queue
|
|
927
|
+
* of functions to be called.
|
|
928
|
+
*
|
|
929
|
+
* The queue is ordered on the basis of the first argument. If it's
|
|
930
|
+
* `undefined`, then nothing is on the queue yet, so the provided function can
|
|
931
|
+
* be called synchronously (although note that this function may return a
|
|
932
|
+
* `Promise`). The idea is that then the return value of that enqueueing
|
|
933
|
+
* operation is kept around, so that if it was a `Promise` then subsequent
|
|
934
|
+
* functions can be enqueued by calling this function again with that `Promise`
|
|
935
|
+
* as the first argument.
|
|
936
|
+
*
|
|
937
|
+
* @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
|
|
938
|
+
* @param fn a function to enqueue
|
|
939
|
+
* @returns either a `Promise` or the return value of the provided function
|
|
940
|
+
*/
|
|
941
|
+
const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
|
|
942
|
+
/**
|
|
943
|
+
* Check that a value is a `Promise`. To check, we first see if the value is an
|
|
944
|
+
* instance of the `Promise` global. In a few circumstances, in particular if
|
|
945
|
+
* the global has been overwritten, this is could be misleading, so we also do
|
|
946
|
+
* a little 'duck typing' check to see if the `.then` property of the value is
|
|
947
|
+
* defined and a function.
|
|
948
|
+
*
|
|
949
|
+
* @param maybePromise it might be a promise!
|
|
950
|
+
* @returns whether it is or not
|
|
951
|
+
*/
|
|
952
|
+
const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
|
|
953
|
+
(maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
|
|
954
|
+
/**
|
|
955
|
+
* Update a component given reference to its host elements and so on.
|
|
956
|
+
*
|
|
957
|
+
* @param hostRef an object containing references to the element's host node,
|
|
958
|
+
* VDom nodes, and other metadata
|
|
959
|
+
* @param instance a reference to the underlying host element where it will be
|
|
960
|
+
* rendered
|
|
961
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
962
|
+
* the first render cycle
|
|
963
|
+
*/
|
|
849
964
|
const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
850
|
-
|
|
965
|
+
var _a;
|
|
851
966
|
const elm = hostRef.$hostElement$;
|
|
852
967
|
const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
|
853
968
|
const rc = elm['s-rc'];
|
|
@@ -857,7 +972,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
857
972
|
}
|
|
858
973
|
const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
|
859
974
|
{
|
|
860
|
-
callRender(hostRef, instance);
|
|
975
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
861
976
|
}
|
|
862
977
|
if (rc) {
|
|
863
978
|
// ok, so turns out there are some child host elements
|
|
@@ -869,7 +984,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
869
984
|
endRender();
|
|
870
985
|
endUpdate();
|
|
871
986
|
{
|
|
872
|
-
const childrenPromises = elm['s-p'];
|
|
987
|
+
const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
|
|
873
988
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
874
989
|
if (childrenPromises.length === 0) {
|
|
875
990
|
postUpdate();
|
|
@@ -881,7 +996,19 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
881
996
|
}
|
|
882
997
|
}
|
|
883
998
|
};
|
|
884
|
-
|
|
999
|
+
/**
|
|
1000
|
+
* Handle making the call to the VDom renderer with the proper context given
|
|
1001
|
+
* various build variables
|
|
1002
|
+
*
|
|
1003
|
+
* @param hostRef an object containing references to the element's host node,
|
|
1004
|
+
* VDom nodes, and other metadata
|
|
1005
|
+
* @param instance a reference to the underlying host element where it will be
|
|
1006
|
+
* rendered
|
|
1007
|
+
* @param elm the Host element for the component
|
|
1008
|
+
* @param isInitialLoad whether or not this function is being called as part of
|
|
1009
|
+
* @returns an empty promise
|
|
1010
|
+
*/
|
|
1011
|
+
const callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
885
1012
|
try {
|
|
886
1013
|
instance = instance.render() ;
|
|
887
1014
|
{
|
|
@@ -896,7 +1023,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
896
1023
|
// or we need to update the css class/attrs on the host element
|
|
897
1024
|
// DOM WRITE!
|
|
898
1025
|
{
|
|
899
|
-
renderVdom(hostRef, instance);
|
|
1026
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
900
1027
|
}
|
|
901
1028
|
}
|
|
902
1029
|
}
|
|
@@ -967,9 +1094,6 @@ const safeCall = (instance, method, arg) => {
|
|
|
967
1094
|
}
|
|
968
1095
|
return undefined;
|
|
969
1096
|
};
|
|
970
|
-
const then = (promise, thenFn) => {
|
|
971
|
-
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
972
|
-
};
|
|
973
1097
|
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
974
1098
|
;
|
|
975
1099
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
@@ -1076,12 +1200,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1076
1200
|
// customElements.define('my-component', MyComponent);
|
|
1077
1201
|
// </script>
|
|
1078
1202
|
// ```
|
|
1079
|
-
// In this case if we do not
|
|
1203
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1080
1204
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1081
1205
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1082
|
-
// the connectedCallback attempts to
|
|
1206
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1083
1207
|
//
|
|
1084
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1208
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1085
1209
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1086
1210
|
//
|
|
1087
1211
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1123,9 +1247,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1123
1247
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1124
1248
|
// initializeComponent
|
|
1125
1249
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1250
|
+
// Let the runtime know that the component has been initialized
|
|
1251
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1126
1252
|
{
|
|
1127
|
-
// we haven't initialized this element yet
|
|
1128
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1129
1253
|
// lazy loaded components
|
|
1130
1254
|
// request the component's implementation to be
|
|
1131
1255
|
// wired up with the host element
|
|
@@ -1198,6 +1322,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1198
1322
|
schedule();
|
|
1199
1323
|
}
|
|
1200
1324
|
};
|
|
1325
|
+
const fireConnectedCallback = (instance) => {
|
|
1326
|
+
};
|
|
1201
1327
|
const connectedCallback = (elm) => {
|
|
1202
1328
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1203
1329
|
const hostRef = getHostRef(elm);
|
|
@@ -1241,22 +1367,34 @@ const connectedCallback = (elm) => {
|
|
|
1241
1367
|
// reattach any event listeners to the host
|
|
1242
1368
|
// since they would have been removed when disconnected
|
|
1243
1369
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1370
|
+
// fire off connectedCallback() on component instance
|
|
1371
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1372
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1373
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1374
|
+
}
|
|
1244
1375
|
}
|
|
1245
1376
|
endConnected();
|
|
1246
1377
|
}
|
|
1247
1378
|
};
|
|
1248
|
-
const
|
|
1379
|
+
const disconnectInstance = (instance) => {
|
|
1380
|
+
{
|
|
1381
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
const disconnectedCallback = async (elm) => {
|
|
1249
1385
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1250
1386
|
const hostRef = getHostRef(elm);
|
|
1251
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1252
1387
|
{
|
|
1253
1388
|
if (hostRef.$rmListeners$) {
|
|
1254
1389
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1255
1390
|
hostRef.$rmListeners$ = undefined;
|
|
1256
1391
|
}
|
|
1257
1392
|
}
|
|
1258
|
-
{
|
|
1259
|
-
|
|
1393
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
1394
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1395
|
+
}
|
|
1396
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1397
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1260
1398
|
}
|
|
1261
1399
|
}
|
|
1262
1400
|
};
|
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-0ac65212.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-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]]]]]], 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-0ac65212.js');
|
|
6
6
|
|
|
7
7
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
8
8
|
|
|
@@ -49,7 +49,7 @@ class KeyboardManager {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const mdsModalCss = "@tailwind components; @tailwind utilities; .focus-off,.focusable,.focusable-light,.focusable-light-off{-webkit-transition-duration:200ms;transition-duration:200ms;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1);outline-offset:var(--magma-outline-blur-offset);outline:var(--magma-outline-blur);-webkit-transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform}.focus-on,.focusable-light:focus-visible,.focusable:focus-visible{--magma-outline-blur-offset:var(--magma-outline-focus-offset);--magma-outline-blur:var(--magma-outline-focus)}.focus-light-on,.focusable-light:focus-visible{--magma-outline-blur:2px solid rgb(var(--tone-neutral))}.svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1 / 1;height:100%;width:100%}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.fixed{position:fixed}.absolute{position:absolute}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.ml-auto{margin-left:auto}.flex{display:-ms-flexbox;display:flex}.w-16{width:4rem}.min-w-0{min-width:0px}.max-w-lg{max-width:32rem}.max-w-xl{max-width:36rem}.items-center{-ms-flex-align:center;align-items:center}.gap-4{gap:1rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-tone-neutral-09{--tw-border-opacity:1;border-color:rgba(var(--tone-neutral-09), var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.p-4{padding:1rem}.p-8{padding:2rem}.text-tone-neutral-02{--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgba(var(--tone-neutral-04), var(--tw-text-opacity))}.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{--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-overflow:auto;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-z-index:var(--magma-modal-z-index);pointer-events:none;position:fixed;inset:0px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition-duration:700ms;transition-duration:700ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1);background-color:rgba(var(--mds-modal-overlay-color) / 0);-webkit-perspective:600px;perspective:600px;z-index:var(--mds-modal-z-index, 1000)}:host([position=top]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=bottom]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host(.to-bottom-opened),:host(.to-center-opened),:host(.to-left-opened),:host(.to-right-opened),:host(.to-top-opened){pointer-events:auto;-webkit-transition-duration:500ms;transition-duration:500ms;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity))}.close{position:absolute;top:0px;height:2.25rem;width:2.25rem;-webkit-transform-origin:center;transform-origin:center;cursor:pointer;border-radius:9999px;fill:rgb(var(--tone-neutral-10));font-size:2.25rem;line-height:2.5rem;opacity:0;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg);-webkit-transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, transform;transition-property:opacity, outline, outline-offset, transform, -webkit-transform}.window{display:grid;height:100%;gap:0px;background-color:var(--mds-modal-window-background);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);grid-template-rows:1fr;max-width:calc(100vw - 80px);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.to-bottom){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-bottom){padding:1rem}}:host(.to-bottom) .window,:host(.to-bottom)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-bottom-intro) .window,:host(.to-bottom-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-bottom-opened.to-bottom-outro) .window,:host(.to-bottom-opened.to-bottom-outro)>::slotted([slot=\"window\"]),:host(.to-bottom-opened) .window,:host(.to-bottom-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-bottom-outro) .window,:host(.to-bottom-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-center){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-center){padding:1rem}}:host(.to-center) .window,:host(.to-center)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-center-intro) .window,:host(.to-center-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-center-opened.to-center-outro) .window,:host(.to-center-opened.to-center-outro)>::slotted([slot=\"window\"]),:host(.to-center-opened) .window,:host(.to-center-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-center-outro) .window,:host(.to-center-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-left){-ms-flex-pack:start;justify-content:flex-start}:host(.to-left) .window,:host(.to-left)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-left-intro) .window,:host(.to-left-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-opened.to-left-outro) .window,:host(.to-left-opened.to-left-outro)>::slotted([slot=\"window\"]),:host(.to-left-opened) .window,:host(.to-left-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-left-opened) .close,:host(.to-left-opened.to-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.to-left-outro) .window,:host(.to-left-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.to-left) .close{right:0px;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}:host(.to-right){-ms-flex-pack:end;justify-content:flex-end}:host(.to-right) .window,:host(.to-right)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-right-intro) .window,:host(.to-right-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-opened.to-right-outro) .window,:host(.to-right-opened.to-right-outro)>::slotted([slot=\"window\"]),:host(.to-right-opened) .window,:host(.to-right-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-right-opened) .close,:host(.to-right-opened.to-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.to-right-outro) .window,:host(.to-right-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.to-right) .close{left:0px;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.to-top){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-top){padding:1rem}}:host(.to-top) .window,:host(.to-top)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-top-intro) .window,:host(.to-top-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-top-opened.to-top-outro) .window,:host(.to-top-opened.to-top-outro)>::slotted([slot=\"window\"]),:host(.to-top-opened) .window,:host(.to-top-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-top-outro) .window,:host(.to-top-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}@media (max-width: 767px){.mobile\\:w-12{width:3rem}}";
|
|
52
|
+
const mdsModalCss = "@tailwind components; @tailwind utilities; .focus-off,.focusable,.focusable-light,.focusable-light-off{-webkit-transition-duration:200ms;transition-duration:200ms;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1);outline-offset:var(--magma-outline-blur-offset);outline:var(--magma-outline-blur);-webkit-transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;transition-property:background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform}.focus-on,.focusable-light:focus-visible,.focusable:focus-visible{--magma-outline-blur-offset:var(--magma-outline-focus-offset);--magma-outline-blur:var(--magma-outline-focus)}.focus-light-on,.focusable-light:focus-visible{--magma-outline-blur:2px solid rgb(var(--tone-neutral))}.svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1 / 1;height:100%;width:100%}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.fixed{position:fixed}.absolute{position:absolute}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.ml-auto{margin-left:auto}.flex{display:-ms-flexbox;display:flex}.w-16{width:4rem}.min-w-0{min-width:0px}.max-w-lg{max-width:32rem}.max-w-xl{max-width:36rem}.items-center{-ms-flex-align:center;align-items:center}.gap-4{gap:1rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-tone-neutral-09{--tw-border-opacity:1;border-color:rgba(var(--tone-neutral-09), var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.p-4{padding:1rem}.p-8{padding:2rem}.text-tone-neutral-02{--tw-text-opacity:1;color:rgba(var(--tone-neutral-02), var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgba(var(--tone-neutral-04), var(--tw-text-opacity))}.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{--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-overflow:auto;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-z-index:var(--magma-modal-z-index);pointer-events:none;position:fixed;inset:0px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition-duration:700ms;transition-duration:700ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1);background-color:rgba(var(--mds-modal-overlay-color) / 0);fill:rgb(var(--tone-neutral));-webkit-perspective:600px;perspective:600px;z-index:var(--mds-modal-z-index, 1000)}:host([position=top]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=bottom]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host(.to-bottom-opened),:host(.to-center-opened),:host(.to-left-opened),:host(.to-right-opened),:host(.to-top-opened){pointer-events:auto;-webkit-transition-duration:500ms;transition-duration:500ms;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity))}.close{position:absolute;top:0px;height:2.25rem;width:2.25rem;-webkit-transform-origin:center;transform-origin:center;cursor:pointer;border-radius:9999px;font-size:2.25rem;line-height:2.5rem;opacity:0;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);fill:inherit;-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg);-webkit-transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, transform;transition-property:opacity, outline, outline-offset, transform, -webkit-transform}.window{display:grid;height:100%;gap:0px;background-color:var(--mds-modal-window-background);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);grid-template-rows:1fr;max-width:calc(100vw - 80px);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.to-bottom){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-bottom){padding:1rem}}:host(.to-bottom) .window,:host(.to-bottom)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-bottom-intro) .window,:host(.to-bottom-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-bottom-opened.to-bottom-outro) .window,:host(.to-bottom-opened.to-bottom-outro)>::slotted([slot=\"window\"]),:host(.to-bottom-opened) .window,:host(.to-bottom-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-bottom-outro) .window,:host(.to-bottom-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-center){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-center){padding:1rem}}:host(.to-center) .window,:host(.to-center)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-center-intro) .window,:host(.to-center-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-center-opened.to-center-outro) .window,:host(.to-center-opened.to-center-outro)>::slotted([slot=\"window\"]),:host(.to-center-opened) .window,:host(.to-center-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-center-outro) .window,:host(.to-center-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-left){-ms-flex-pack:start;justify-content:flex-start}:host(.to-left) .window,:host(.to-left)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-left-intro) .window,:host(.to-left-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-opened.to-left-outro) .window,:host(.to-left-opened.to-left-outro)>::slotted([slot=\"window\"]),:host(.to-left-opened) .window,:host(.to-left-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-left-opened) .close,:host(.to-left-opened.to-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.to-left-outro) .window,:host(.to-left-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.to-left) .close{right:0px;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}:host(.to-right){-ms-flex-pack:end;justify-content:flex-end}:host(.to-right) .window,:host(.to-right)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-right-intro) .window,:host(.to-right-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-opened.to-right-outro) .window,:host(.to-right-opened.to-right-outro)>::slotted([slot=\"window\"]),:host(.to-right-opened) .window,:host(.to-right-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-right-opened) .close,:host(.to-right-opened.to-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.to-right-outro) .window,:host(.to-right-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.to-right) .close{left:0px;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.to-top){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.to-top){padding:1rem}}:host(.to-top) .window,:host(.to-top)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-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:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.to-top-intro) .window,:host(.to-top-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-top-opened.to-top-outro) .window,:host(.to-top-opened.to-top-outro)>::slotted([slot=\"window\"]),:host(.to-top-opened) .window,:host(.to-top-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-top-outro) .window,:host(.to-top-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}@media (max-width: 767px){.mobile\\:w-12{width:3rem}}";
|
|
53
53
|
|
|
54
54
|
const MdsModal = class {
|
|
55
55
|
constructor(hostRef) {
|
|
@@ -134,7 +134,7 @@ const MdsModal = class {
|
|
|
134
134
|
render() {
|
|
135
135
|
return (index.h(index.Host, { "aria-modal": clsx(this.opened ? 'true' : 'false'), class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } }, this.window
|
|
136
136
|
? index.h("slot", { name: "window" })
|
|
137
|
-
: index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog" }, this.top &&
|
|
137
|
+
: index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
|
|
138
138
|
index.h("slot", { name: "top" }), index.h("slot", null), this.bottom &&
|
|
139
139
|
index.h("slot", { name: "bottom" })), !this.window && index.h("i", { innerHTML: miBaselineClose, tabindex: "0", onClick: (e) => { this.closeModal(e); }, class: "svg close focusable-light" })));
|
|
140
140
|
}
|
|
@@ -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-0ac65212.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-modal.cjs.js', document.baseURI).href));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
3
|
+
"components/mds-modal/mds-modal.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, };
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
.focus-on,
|
|
22
22
|
.focusable-light:focus-visible,
|
|
23
23
|
.focusable:focus-visible {
|
|
24
|
+
|
|
24
25
|
--magma-outline-blur-offset: var(--magma-outline-focus-offset);
|
|
25
26
|
--magma-outline-blur: var(--magma-outline-focus);
|
|
26
27
|
}
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
|
|
29
30
|
.focus-light-on,
|
|
30
31
|
.focusable-light:focus-visible {
|
|
32
|
+
|
|
31
33
|
--magma-outline-blur: 2px solid rgb(var(--tone-neutral));
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -188,6 +190,7 @@
|
|
|
188
190
|
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
189
191
|
|
|
190
192
|
background-color: rgba(var(--mds-modal-overlay-color) / 0);
|
|
193
|
+
fill: rgb(var(--tone-neutral));
|
|
191
194
|
perspective: 600px;
|
|
192
195
|
z-index: var(--mds-modal-z-index, 1000);
|
|
193
196
|
}
|
|
@@ -235,8 +238,6 @@
|
|
|
235
238
|
|
|
236
239
|
border-radius: 9999px;
|
|
237
240
|
|
|
238
|
-
fill: rgb(var(--tone-neutral-10));
|
|
239
|
-
|
|
240
241
|
font-size: 2.25rem;
|
|
241
242
|
|
|
242
243
|
line-height: 2.5rem;
|
|
@@ -247,6 +248,7 @@
|
|
|
247
248
|
|
|
248
249
|
transition-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
|
|
249
250
|
|
|
251
|
+
fill: inherit;
|
|
250
252
|
transform: translate(0, 24px) rotate(90deg);
|
|
251
253
|
transition-property: opacity, outline, outline-offset, transform;
|
|
252
254
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import clsx from
|
|
2
|
-
import miBaselineClose from
|
|
3
|
-
import { Host, h } from
|
|
4
|
-
import { KeyboardManager } from
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import miBaselineClose from "@icon/mi/baseline/close.svg";
|
|
3
|
+
import { Host, h } from "@stencil/core";
|
|
4
|
+
import { KeyboardManager } from "../../common/keyboard-manager";
|
|
5
|
+
/**
|
|
6
|
+
* @slot default - Contents that will be placed in the center of the window. Add `text string`, `HTML elements` or `components` to this slot.
|
|
7
|
+
* @slot bottom - Contents that will be placed on bottom of the window. Add `text string`, `HTML elements` or `components` to this slot.
|
|
8
|
+
* @slot top - Contents that will be placed on top of the window. Add `text string`, `HTML elements` or `components` to this slot.
|
|
9
|
+
* @slot window - Use directly a window component if you need it. Add `text string`, `HTML elements` or `components` to this slot.
|
|
10
|
+
*/
|
|
5
11
|
export class MdsModal {
|
|
6
12
|
constructor() {
|
|
7
13
|
this.window = false;
|
|
@@ -83,7 +89,7 @@ export class MdsModal {
|
|
|
83
89
|
render() {
|
|
84
90
|
return (h(Host, { "aria-modal": clsx(this.opened ? 'true' : 'false'), class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } }, this.window
|
|
85
91
|
? h("slot", { name: "window" })
|
|
86
|
-
: h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog" }, this.top &&
|
|
92
|
+
: h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
|
|
87
93
|
h("slot", { name: "top" }), h("slot", null), this.bottom &&
|
|
88
94
|
h("slot", { name: "bottom" })), !this.window && h("i", { innerHTML: miBaselineClose, tabindex: "0", onClick: (e) => { this.closeModal(e); }, class: "svg close focusable-light" })));
|
|
89
95
|
}
|
|
@@ -128,7 +134,8 @@ export class MdsModal {
|
|
|
128
134
|
"references": {
|
|
129
135
|
"ModalPositionType": {
|
|
130
136
|
"location": "import",
|
|
131
|
-
"path": "./meta/types"
|
|
137
|
+
"path": "./meta/types",
|
|
138
|
+
"id": "src/components/mds-modal/meta/types.ts::ModalPositionType"
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
},
|