@maggioli-design-system/mds-modal 4.3.0 → 4.4.1
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-2ef62850.js} +219 -51
- package/dist/cjs/loader.cjs.js +3 -12
- package/dist/cjs/mds-modal.cjs.entry.js +2 -2
- package/dist/cjs/mds-modal.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/common/aria.js +9 -1
- package/dist/collection/components/mds-modal/mds-modal.css +37 -39
- package/dist/collection/components/mds-modal/mds-modal.js +12 -5
- 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/icon.js +2 -2
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +1 -2
- package/dist/components/mds-modal.js +6 -3
- package/dist/documentation.d.ts +361 -88
- package/dist/documentation.json +69 -7
- package/dist/esm/{index-118e6bec.js → index-822a7c21.js} +219 -51
- package/dist/esm/loader.js +4 -13
- package/dist/esm/mds-modal.entry.js +2 -2
- package/dist/esm/mds-modal.js +4 -4
- package/dist/esm-es5/index-822a7c21.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-e2fdb863.system.js → p-0e1a634c.system.js} +1 -1
- package/dist/mds-modal/p-62ef7bee.system.entry.js +1 -0
- package/dist/mds-modal/p-6acd79b6.system.js +2 -0
- package/dist/mds-modal/p-cc1354fb.js +2 -0
- package/dist/mds-modal/p-f67f79a7.entry.js +1 -0
- package/dist/stats.json +74 -40
- package/dist/types/common/aria.d.ts +2 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +32 -17
- package/documentation.json +416 -9
- package/loader/index.d.ts +2 -2
- package/package.json +4 -4
- package/readme.md +20 -1
- package/src/common/aria.ts +12 -0
- package/src/components/mds-modal/css/mds-modal-animate-bottom.css +2 -1
- package/src/components/mds-modal/css/mds-modal-animate-center.css +2 -1
- package/src/components/mds-modal/css/mds-modal-animate-left.css +1 -1
- package/src/components/mds-modal/css/mds-modal-animate-right.css +1 -1
- package/src/components/mds-modal/css/mds-modal-animate-top.css +2 -1
- package/src/components/mds-modal/mds-modal.css +18 -21
- package/src/components/mds-modal/mds-modal.tsx +7 -0
- package/src/components/mds-modal/readme.md +11 -1
- package/src/components/mds-modal/test/mds-modal.e2e.ts +1 -1
- package/src/components/mds-modal/test/mds-modal.stories.mdx +1 -3
- package/src/components.d.ts +1 -0
- package/src/fixtures/icons.json +4 -0
- package/src/fixtures/iconsauce.json +1 -0
- package/www/build/mds-modal.esm.js +1 -1
- package/www/build/mds-modal.js +2 -6
- package/www/build/{p-e2fdb863.system.js → p-0e1a634c.system.js} +1 -1
- package/www/build/p-62ef7bee.system.entry.js +1 -0
- package/www/build/p-6acd79b6.system.js +2 -0
- package/www/build/p-cc1354fb.js +2 -0
- package/www/build/p-f67f79a7.entry.js +1 -0
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/index-118e6bec.js +0 -2
- package/dist/mds-modal/p-24b3f7bd.entry.js +0 -1
- package/dist/mds-modal/p-3aeea0b7.system.js +0 -2
- package/dist/mds-modal/p-4fdbb5fc.js +0 -2
- package/dist/mds-modal/p-b2f313ba.system.entry.js +0 -1
- package/www/build/p-24b3f7bd.entry.js +0 -1
- package/www/build/p-3aeea0b7.system.js +0 -2
- package/www/build/p-4fdbb5fc.js +0 -2
- package/www/build/p-b2f313ba.system.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);
|
|
@@ -1026,6 +1150,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1026
1150
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1027
1151
|
*/
|
|
1028
1152
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1153
|
+
var _a;
|
|
1029
1154
|
if (cmpMeta.$members$) {
|
|
1030
1155
|
if (Cstr.watchers) {
|
|
1031
1156
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
@@ -1053,7 +1178,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1053
1178
|
});
|
|
1054
1179
|
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1055
1180
|
const attrNameToPropName = new Map();
|
|
1056
|
-
prototype.attributeChangedCallback = function (attrName,
|
|
1181
|
+
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1057
1182
|
plt.jmp(() => {
|
|
1058
1183
|
const propName = attrNameToPropName.get(attrName);
|
|
1059
1184
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
@@ -1076,12 +1201,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1076
1201
|
// customElements.define('my-component', MyComponent);
|
|
1077
1202
|
// </script>
|
|
1078
1203
|
// ```
|
|
1079
|
-
// In this case if we do not
|
|
1204
|
+
// In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
|
|
1080
1205
|
// will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
|
|
1081
1206
|
// to the value that was set inline i.e. "some-value" from above example. When
|
|
1082
|
-
// the connectedCallback attempts to
|
|
1207
|
+
// the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
|
|
1083
1208
|
//
|
|
1084
|
-
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/
|
|
1209
|
+
// The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
|
|
1085
1210
|
// by connectedCallback as this attributeChangedCallback will not fire.
|
|
1086
1211
|
//
|
|
1087
1212
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
@@ -1101,21 +1226,49 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1101
1226
|
// `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
|
|
1102
1227
|
return;
|
|
1103
1228
|
}
|
|
1229
|
+
else if (propName == null) {
|
|
1230
|
+
// At this point we should know this is not a "member", so we can treat it like watching an attribute
|
|
1231
|
+
// on a vanilla web component
|
|
1232
|
+
const hostRef = getHostRef(this);
|
|
1233
|
+
const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
|
|
1234
|
+
// We only want to trigger the callback(s) if:
|
|
1235
|
+
// 1. The instance is ready
|
|
1236
|
+
// 2. The watchers are ready
|
|
1237
|
+
// 3. The value has changed
|
|
1238
|
+
if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1239
|
+
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1240
|
+
newValue !== oldValue) {
|
|
1241
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1242
|
+
const entry = cmpMeta.$watchers$[attrName];
|
|
1243
|
+
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1244
|
+
if (instance[callbackName] != null) {
|
|
1245
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1104
1251
|
this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
|
|
1105
1252
|
});
|
|
1106
1253
|
};
|
|
1107
|
-
//
|
|
1108
|
-
//
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1254
|
+
// Create an array of attributes to observe
|
|
1255
|
+
// This list in comprised of all strings used within a `@Watch()` decorator
|
|
1256
|
+
// on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
|
|
1257
|
+
// As such, there is no way to guarantee type-safety here that a user hasn't entered
|
|
1258
|
+
// an invalid attribute.
|
|
1259
|
+
Cstr.observedAttributes = Array.from(new Set([
|
|
1260
|
+
...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
|
|
1261
|
+
...members
|
|
1262
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
|
|
1263
|
+
.map(([propName, m]) => {
|
|
1264
|
+
const attrName = m[1] || propName;
|
|
1265
|
+
attrNameToPropName.set(attrName, propName);
|
|
1266
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1267
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1268
|
+
}
|
|
1269
|
+
return attrName;
|
|
1270
|
+
}),
|
|
1271
|
+
]));
|
|
1119
1272
|
}
|
|
1120
1273
|
}
|
|
1121
1274
|
return Cstr;
|
|
@@ -1123,9 +1276,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1123
1276
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1124
1277
|
// initializeComponent
|
|
1125
1278
|
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1279
|
+
// Let the runtime know that the component has been initialized
|
|
1280
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1126
1281
|
{
|
|
1127
|
-
// we haven't initialized this element yet
|
|
1128
|
-
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1129
1282
|
// lazy loaded components
|
|
1130
1283
|
// request the component's implementation to be
|
|
1131
1284
|
// wired up with the host element
|
|
@@ -1198,6 +1351,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1198
1351
|
schedule();
|
|
1199
1352
|
}
|
|
1200
1353
|
};
|
|
1354
|
+
const fireConnectedCallback = (instance) => {
|
|
1355
|
+
};
|
|
1201
1356
|
const connectedCallback = (elm) => {
|
|
1202
1357
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1203
1358
|
const hostRef = getHostRef(elm);
|
|
@@ -1241,22 +1396,34 @@ const connectedCallback = (elm) => {
|
|
|
1241
1396
|
// reattach any event listeners to the host
|
|
1242
1397
|
// since they would have been removed when disconnected
|
|
1243
1398
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1399
|
+
// fire off connectedCallback() on component instance
|
|
1400
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
|
|
1401
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1402
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1403
|
+
}
|
|
1244
1404
|
}
|
|
1245
1405
|
endConnected();
|
|
1246
1406
|
}
|
|
1247
1407
|
};
|
|
1248
|
-
const
|
|
1408
|
+
const disconnectInstance = (instance) => {
|
|
1409
|
+
{
|
|
1410
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
const disconnectedCallback = async (elm) => {
|
|
1249
1414
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1250
1415
|
const hostRef = getHostRef(elm);
|
|
1251
|
-
const instance = hostRef.$lazyInstance$ ;
|
|
1252
1416
|
{
|
|
1253
1417
|
if (hostRef.$rmListeners$) {
|
|
1254
1418
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1255
1419
|
hostRef.$rmListeners$ = undefined;
|
|
1256
1420
|
}
|
|
1257
1421
|
}
|
|
1258
|
-
{
|
|
1259
|
-
|
|
1422
|
+
if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
|
|
1423
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1424
|
+
}
|
|
1425
|
+
else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
|
|
1426
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1260
1427
|
}
|
|
1261
1428
|
}
|
|
1262
1429
|
};
|
|
@@ -1276,6 +1443,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1276
1443
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
1277
1444
|
lazyBundles.map((lazyBundle) => {
|
|
1278
1445
|
lazyBundle[1].map((compactMeta) => {
|
|
1446
|
+
var _a;
|
|
1279
1447
|
const cmpMeta = {
|
|
1280
1448
|
$flags$: compactMeta[0],
|
|
1281
1449
|
$tagName$: compactMeta[1],
|
|
@@ -1292,7 +1460,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1292
1460
|
cmpMeta.$attrsToReflect$ = [];
|
|
1293
1461
|
}
|
|
1294
1462
|
{
|
|
1295
|
-
cmpMeta.$watchers$ = {};
|
|
1463
|
+
cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
|
|
1296
1464
|
}
|
|
1297
1465
|
const tagName = cmpMeta.$tagName$;
|
|
1298
1466
|
const HostElement = class extends HTMLElement {
|
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-2ef62850.js');
|
|
13
6
|
|
|
14
7
|
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return
|
|
16
|
-
return
|
|
17
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]]]]]], options);
|
|
18
|
-
});
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
9
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"position":["positionChange"],"opened":["openedChange"]}]]]], options);
|
|
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-2ef62850.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);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}}";
|
|
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);-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);-ms-flex-align:center;align-items:center;background-color:rgba(var(--mds-modal-overlay-color) / 0);display:-ms-flexbox;display:flex;fill:rgb(var(--tone-neutral));inset:0;-ms-flex-pack:center;justify-content:center;-webkit-perspective:600px;perspective:600px;pointer-events:none;position:fixed;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){-webkit-transition-duration:500ms;transition-duration:500ms;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}.close{top:0px;height:2.25rem;width:2.25rem;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);cursor:pointer;fill:inherit;position:absolute;-webkit-transform-origin:center;transform-origin:center;-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{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);display:grid;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){padding:2rem}@media (max-width: 767px){:host(.to-bottom){padding:1rem}}:host(.to-bottom){-ms-flex-pack:center;justify-content:center}: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){padding:2rem}@media (max-width: 767px){:host(.to-center){padding:1rem}}:host(.to-center){-ms-flex-pack:center;justify-content:center}: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){padding:2rem}@media (max-width: 767px){:host(.to-top){padding:1rem}}:host(.to-top){-ms-flex-pack:center;justify-content:center}: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) {
|
|
@@ -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-2ef62850.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser
|
|
8
|
+
Stencil Client Patch Browser v4.3.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchBrowser = () => {
|
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-modal.cjs.js', document.baseURI).href));
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]]]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"mdsModalClose","onModalCloseListener"],[4,"mdsBannerClose","onBannerCloseListener"]],{"position":["positionChange"],"opened":["openedChange"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -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": "
|
|
8
|
-
"typescriptVersion": "
|
|
7
|
+
"version": "4.3.0",
|
|
8
|
+
"typescriptVersion": "5.1.6"
|
|
9
9
|
},
|
|
10
10
|
"collections": [],
|
|
11
11
|
"bundles": []
|
|
@@ -5,6 +5,7 @@ const hash = (s) => {
|
|
|
5
5
|
}
|
|
6
6
|
return h.toString();
|
|
7
7
|
};
|
|
8
|
+
const randomInt = (max) => Math.floor(Math.random() * max);
|
|
8
9
|
const unslugName = (name) => {
|
|
9
10
|
var _a, _b, _c;
|
|
10
11
|
return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
|
|
@@ -18,4 +19,11 @@ const setAttributeIfEmpty = (element, attribute, value) => {
|
|
|
18
19
|
return value;
|
|
19
20
|
};
|
|
20
21
|
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
21
|
-
|
|
22
|
+
const hashRandomValue = (value) => {
|
|
23
|
+
const randomValue = randomInt(1000000);
|
|
24
|
+
if (value) {
|
|
25
|
+
return `${value}-${hash(randomValue.toString())}`;
|
|
26
|
+
}
|
|
27
|
+
return hash(randomValue.toString());
|
|
28
|
+
};
|
|
29
|
+
export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
|