@mgdis/mg-components 5.6.0 → 5.7.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-4dcc1812.js → index-5e7ede97.js} +109 -3
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +623 -445
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +5 -4
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +7 -21
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +27 -27
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +12 -15
- package/dist/collection/components/molecules/inputs/MgInput.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -4
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +2 -3
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +2 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +31 -11
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.css +38 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +252 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
- package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +0 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +17 -4
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +2 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +2 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +9 -8
- package/dist/collection/locales/en/messages.json +6 -1
- package/dist/collection/locales/fr/messages.json +6 -1
- package/dist/collection/locales/index.js +1 -1
- package/dist/collection/styles/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +2 -1
- package/dist/collection/utils/behaviors.utils.js +16 -34
- package/dist/collection/utils/components.utils.js +3 -1
- package/dist/collection/utils/locale.utils.js +9 -9
- package/dist/collection/utils/unit.test.utils.js +32 -4
- package/dist/collection/variables.css +2 -1
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +3 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index2.js +26 -14
- package/dist/components/mg-action-more.d.ts +11 -0
- package/dist/components/mg-action-more.js +215 -0
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-button2.js +2 -2
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +30 -30
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +2 -2
- package/dist/components/mg-input-numeric.js +2 -2
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +2 -2
- package/dist/components/mg-input-select2.js +2 -2
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +2 -2
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-menu-item2.js +75 -72
- package/dist/components/mg-menu.js +1 -246
- package/dist/components/mg-menu2.js +247 -0
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +2 -2
- package/dist/components/mg-popover2.js +17 -3
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs.js +10 -9
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip2.js +12 -15
- package/dist/esm/{index-dc9a2348.js → index-03cceb11.js} +109 -4
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +623 -446
- package/dist/esm/mg-components.js +4 -3
- package/dist/mg-components/locales/en/messages.json +6 -1
- package/dist/mg-components/locales/fr/messages.json +6 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-4cfd5423.entry.js +1 -0
- package/dist/mg-components/p-e126dd84.js +2 -0
- package/dist/mg-components/styles/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +2 -1
- package/dist/mg-components/variables.css +2 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +7 -1
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +42 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +81 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +2 -1
- package/dist/types/components.d.ts +54 -0
- package/dist/types/locales/index.d.ts +12 -2
- package/dist/types/stencil-public-runtime.d.ts +9 -0
- package/dist/types/utils/behaviors.utils.d.ts +1 -7
- package/dist/types/utils/locale.utils.d.ts +5 -5
- package/dist/types/utils/unit.test.utils.d.ts +20 -2
- package/loader/index.d.ts +9 -0
- package/package.json +17 -16
- package/readme.md +0 -18
- package/dist/.storybook/utils.js +0 -24
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -27
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -38
- package/dist/collection/components/atoms/mg-card/doc/mg-card.stories.js +0 -18
- package/dist/collection/components/atoms/mg-character-left/doc/mg-character-left.stories.js +0 -20
- package/dist/collection/components/atoms/mg-divider/doc/mg-divider.stories.js +0 -18
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +0 -41
- package/dist/collection/components/atoms/mg-input-title/doc/mg-input-title.stories.js +0 -21
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +0 -22
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +0 -43
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +0 -68
- package/dist/collection/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.js +0 -46
- package/dist/collection/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.js +0 -59
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +0 -77
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +0 -110
- package/dist/collection/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.js +0 -54
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +0 -51
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +0 -119
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -34
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +0 -24
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +0 -47
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +0 -19
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +0 -39
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +0 -39
- package/dist/collection/components/molecules/mg-pagination/doc/mg-pagination.stories.js +0 -20
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +0 -22
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +0 -34
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +0 -24
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +0 -53
- package/dist/collection/stories/grids.stories.js +0 -7
- package/dist/collection/stories/helpers.stories.js +0 -23
- package/dist/collection/stories/icons.stories.js +0 -25
- package/dist/collection/stories/typography.stories.js +0 -24
- package/dist/mg-components/p-182bd802.js +0 -2
- package/dist/mg-components/p-f7da9dd2.entry.js +0 -1
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -16
- package/dist/types/components/atoms/mg-card/doc/mg-card.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-character-left/doc/mg-character-left.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-divider/doc/mg-divider.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-icon/doc/mg-icon.stories.d.ts +0 -26
- package/dist/types/components/atoms/mg-input-title/doc/mg-input-title.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.d.ts +0 -32
- package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +0 -22
- package/dist/types/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.d.ts +0 -20
- package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +0 -34
- package/dist/types/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.d.ts +0 -39
- package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +0 -19
- package/dist/types/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.d.ts +0 -12
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +0 -22
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +0 -12
- package/dist/types/components/molecules/mg-details/doc/mg-details.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-form/doc/mg-form.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.d.ts +0 -6
- package/dist/types/components/molecules/mg-message/doc/mg-message.stories.d.ts +0 -26
- package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +0 -13
- package/dist/types/components/molecules/mg-pagination/doc/mg-pagination.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +0 -22
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +0 -20
- package/dist/types/home/runner/work/mg-components/mg-components/.stencil/.storybook/utils.d.ts +0 -1
- package/dist/types/stories/grids.stories.d.ts +0 -5
- package/dist/types/stories/helpers.stories.d.ts +0 -13
- package/dist/types/stories/icons.stories.d.ts +0 -13
- package/dist/types/stories/typography.stories.d.ts +0 -5
|
@@ -31,6 +31,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
34
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
34
35
|
/**
|
|
35
36
|
* Default style mode id
|
|
36
37
|
*/
|
|
@@ -50,6 +51,18 @@ const isComplexType = (o) => {
|
|
|
50
51
|
o = typeof o;
|
|
51
52
|
return o === 'object' || o === 'function';
|
|
52
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
56
|
+
* out of a DOM's head.
|
|
57
|
+
*
|
|
58
|
+
* @param doc The DOM containing the `head` to query against
|
|
59
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
60
|
+
* exists or the tag has no content.
|
|
61
|
+
*/
|
|
62
|
+
function queryNonceMetaTagContent(doc) {
|
|
63
|
+
var _a, _b, _c;
|
|
64
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
65
|
+
}
|
|
53
66
|
/**
|
|
54
67
|
* Production h() function based on Preact by
|
|
55
68
|
* Jason Miller (@developit)
|
|
@@ -62,6 +75,7 @@ const isComplexType = (o) => {
|
|
|
62
75
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
63
76
|
const h = (nodeName, vnodeData, ...children) => {
|
|
64
77
|
let child = null;
|
|
78
|
+
let key = null;
|
|
65
79
|
let slotName = null;
|
|
66
80
|
let simple = false;
|
|
67
81
|
let lastSimple = false;
|
|
@@ -90,6 +104,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
90
104
|
};
|
|
91
105
|
walk(children);
|
|
92
106
|
if (vnodeData) {
|
|
107
|
+
// normalize class / classname attributes
|
|
108
|
+
if (vnodeData.key) {
|
|
109
|
+
key = vnodeData.key;
|
|
110
|
+
}
|
|
93
111
|
if (vnodeData.name) {
|
|
94
112
|
slotName = vnodeData.name;
|
|
95
113
|
}
|
|
@@ -114,6 +132,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
114
132
|
if (vNodeChildren.length > 0) {
|
|
115
133
|
vnode.$children$ = vNodeChildren;
|
|
116
134
|
}
|
|
135
|
+
{
|
|
136
|
+
vnode.$key$ = key;
|
|
137
|
+
}
|
|
117
138
|
{
|
|
118
139
|
vnode.$name$ = slotName;
|
|
119
140
|
}
|
|
@@ -130,6 +151,9 @@ const newVNode = (tag, text) => {
|
|
|
130
151
|
{
|
|
131
152
|
vnode.$attrs$ = null;
|
|
132
153
|
}
|
|
154
|
+
{
|
|
155
|
+
vnode.$key$ = null;
|
|
156
|
+
}
|
|
133
157
|
{
|
|
134
158
|
vnode.$name$ = null;
|
|
135
159
|
}
|
|
@@ -265,6 +289,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
265
289
|
styles.set(scopeId, style);
|
|
266
290
|
};
|
|
267
291
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
292
|
+
var _a;
|
|
268
293
|
let scopeId = getScopeId(cmpMeta);
|
|
269
294
|
const style = styles.get(scopeId);
|
|
270
295
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -284,6 +309,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
284
309
|
styleElm = doc.createElement('style');
|
|
285
310
|
styleElm.innerHTML = style;
|
|
286
311
|
}
|
|
312
|
+
// Apply CSP nonce to the style tag if it exists
|
|
313
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
314
|
+
if (nonce != null) {
|
|
315
|
+
styleElm.setAttribute('nonce', nonce);
|
|
316
|
+
}
|
|
287
317
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
288
318
|
}
|
|
289
319
|
if (appliedStyles) {
|
|
@@ -364,6 +394,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
364
394
|
}
|
|
365
395
|
}
|
|
366
396
|
}
|
|
397
|
+
else if (memberName === 'key')
|
|
398
|
+
;
|
|
367
399
|
else if (memberName === 'ref') {
|
|
368
400
|
// minifier will clean this up
|
|
369
401
|
if (newValue) {
|
|
@@ -430,16 +462,36 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
430
462
|
}
|
|
431
463
|
catch (e) { }
|
|
432
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Need to manually update attribute if:
|
|
467
|
+
* - memberName is not an attribute
|
|
468
|
+
* - if we are rendering the host element in order to reflect attribute
|
|
469
|
+
* - if it's a SVG, since properties might not work in <svg>
|
|
470
|
+
* - if the newValue is null/undefined or 'false'.
|
|
471
|
+
*/
|
|
472
|
+
let xlink = false;
|
|
473
|
+
{
|
|
474
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
475
|
+
memberName = ln;
|
|
476
|
+
xlink = true;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
433
479
|
if (newValue == null || newValue === false) {
|
|
434
480
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
435
|
-
{
|
|
481
|
+
if (xlink) {
|
|
482
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
436
485
|
elm.removeAttribute(memberName);
|
|
437
486
|
}
|
|
438
487
|
}
|
|
439
488
|
}
|
|
440
489
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
441
490
|
newValue = newValue === true ? '' : newValue;
|
|
442
|
-
{
|
|
491
|
+
if (xlink) {
|
|
492
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
443
495
|
elm.setAttribute(memberName, newValue);
|
|
444
496
|
}
|
|
445
497
|
}
|
|
@@ -709,6 +761,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
709
761
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
710
762
|
let oldStartIdx = 0;
|
|
711
763
|
let newStartIdx = 0;
|
|
764
|
+
let idxInOld = 0;
|
|
765
|
+
let i = 0;
|
|
712
766
|
let oldEndIdx = oldCh.length - 1;
|
|
713
767
|
let oldStartVnode = oldCh[0];
|
|
714
768
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -716,6 +770,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
716
770
|
let newStartVnode = newCh[0];
|
|
717
771
|
let newEndVnode = newCh[newEndIdx];
|
|
718
772
|
let node;
|
|
773
|
+
let elmToMove;
|
|
719
774
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
720
775
|
if (oldStartVnode == null) {
|
|
721
776
|
// VNode might have been moved left
|
|
@@ -817,7 +872,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
817
872
|
newStartVnode = newCh[++newStartIdx];
|
|
818
873
|
}
|
|
819
874
|
else {
|
|
875
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
876
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
877
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
878
|
+
// component.
|
|
879
|
+
//
|
|
880
|
+
// First we check to see if there are any nodes in the array of old
|
|
881
|
+
// children which have the same key as the first node in the new
|
|
882
|
+
// children.
|
|
883
|
+
idxInOld = -1;
|
|
820
884
|
{
|
|
885
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
886
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
887
|
+
idxInOld = i;
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (idxInOld >= 0) {
|
|
893
|
+
// We found a node in the old children which matches up with the first
|
|
894
|
+
// node in the new children! So let's deal with that
|
|
895
|
+
elmToMove = oldCh[idxInOld];
|
|
896
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
897
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
898
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
patch(elmToMove, newStartVnode);
|
|
902
|
+
// invalidate the matching old node so that we won't try to update it
|
|
903
|
+
// again later on
|
|
904
|
+
oldCh[idxInOld] = undefined;
|
|
905
|
+
node = elmToMove.$elm$;
|
|
906
|
+
}
|
|
907
|
+
newStartVnode = newCh[++newStartIdx];
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
821
910
|
// We either didn't find an element in the old children that matches
|
|
822
911
|
// the key of the first new child OR the build is not using `key`
|
|
823
912
|
// attributes at all. In either case we need to create a new element
|
|
@@ -868,7 +957,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
868
957
|
if (leftVNode.$tag$ === 'slot') {
|
|
869
958
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
870
959
|
}
|
|
871
|
-
|
|
960
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
961
|
+
{
|
|
962
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
963
|
+
}
|
|
872
964
|
}
|
|
873
965
|
return false;
|
|
874
966
|
};
|
|
@@ -1672,6 +1764,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1672
1764
|
}
|
|
1673
1765
|
};
|
|
1674
1766
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1767
|
+
var _a;
|
|
1675
1768
|
const endBootstrap = createTime();
|
|
1676
1769
|
const cmpTags = [];
|
|
1677
1770
|
const exclude = options.exclude || [];
|
|
@@ -1754,6 +1847,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1754
1847
|
{
|
|
1755
1848
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1756
1849
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1850
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1851
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1852
|
+
if (nonce != null) {
|
|
1853
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1854
|
+
}
|
|
1757
1855
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1758
1856
|
}
|
|
1759
1857
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1803,6 +1901,13 @@ const getHostListenerTarget = (elm, flags) => {
|
|
|
1803
1901
|
};
|
|
1804
1902
|
// prettier-ignore
|
|
1805
1903
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1904
|
+
/**
|
|
1905
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1906
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1907
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1908
|
+
* @returns void
|
|
1909
|
+
*/
|
|
1910
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1806
1911
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1807
1912
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1808
1913
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1913,4 +2018,4 @@ const flush = () => {
|
|
|
1913
2018
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1914
2019
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1915
2020
|
|
|
1916
|
-
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|
|
2021
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-03cceb11.js';
|
|
2
|
+
export { s as setNonce } from './index-03cceb11.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
5
|
+
Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchEsm = () => {
|
|
7
8
|
return promiseResolve();
|
|
@@ -10,7 +11,7 @@ const patchEsm = () => {
|
|
|
10
11
|
const defineCustomElements = (win, options) => {
|
|
11
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
13
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["mg-
|
|
14
|
+
return bootstrapLazy([["mg-action-more_31",[[1,"mg-action-more",{"icon":[16],"button":[16],"items":[16],"displayChevron":[4,"display-chevron"],"expanded":[32]}],[1,"mg-panel",{"identifier":[1],"panelTitle":[1025,"panel-title"],"titlePattern":[1025,"title-pattern"],"titlePatternErrorMessage":[1025,"title-pattern-error-message"],"expanded":[1028],"expandToggleDisabled":[1028,"expand-toggle-disabled"],"titleEditable":[4,"title-editable"],"classList":[32],"isEditing":[32],"updatedPanelTitle":[32]}],[1,"mg-pagination",{"identifier":[1],"label":[1025],"hideNavigationLabels":[4,"hide-navigation-labels"],"totalPages":[2,"total-pages"],"currentPage":[1538,"current-page"]}],[1,"mg-input-textarea",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"rows":[2],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"resizable":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-checkbox",{"value":[1040],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"checkboxItems":[32],"displayError":[64]}],[1,"mg-input-date",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"min":[1],"max":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-numeric",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"type":[1],"currency":[1],"max":[2],"min":[2],"integerLength":[2,"integer-length"],"decimalLength":[2,"decimal-length"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"hasFocus":[32],"displayError":[64]}],[1,"mg-input-password",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-radio",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"displayError":[64]}],[1,"mg-input-toggle",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"isOnOff":[4,"is-on-off"],"isIcon":[4,"is-icon"],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"classList":[32],"options":[32],"checked":[32]}],[1,"mg-message",{"identifier":[1],"delay":[2],"variant":[1],"closeButton":[1028,"close-button"],"hide":[1028],"classList":[32],"hasActions":[32]}],[1,"mg-modal",{"identifier":[1],"modalTitle":[1,"modal-title"],"closeButton":[1028,"close-button"],"hide":[1028],"hasActions":[32],"hasContent":[32],"classList":[32]},[[8,"keydown","handleKeyDown"]]],[1,"mg-tabs",{"identifier":[1],"label":[1],"size":[1],"items":[16],"activeTab":[1538,"active-tab"],"tabs":[32],"classList":[32]}],[1,"mg-details",{"toggleClosed":[1,"toggle-closed"],"toggleOpened":[1,"toggle-opened"],"hideSummary":[4,"hide-summary"],"expanded":[1028]}],[1,"mg-divider",{"size":[1]}],[1,"mg-form",{"identifier":[1],"name":[1],"readonly":[4],"disabled":[4],"valid":[1028],"invalid":[1028],"classList":[32],"requiredMessage":[32],"displayError":[64]}],[1,"mg-illustrated-message",{"size":[1],"direction":[1]}],[1,"mg-skip-links",{"links":[1040]}],[1,"mg-tag",{"variant":[1],"outline":[4],"soft":[4],"classList":[32]}],[1,"mg-input-text",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"type":[1],"icon":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"setFocus":[64],"displayError":[64]}],[1,"mg-input-select",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1025],"placeholderHide":[4,"placeholder-hide"],"placeholderDisabled":[4,"placeholder-disabled"],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"valueExist":[32],"readonlyValue":[32],"displayError":[64]}],[1,"mg-menu",{"label":[1],"direction":[513],"moreitem":[16],"size":[1],"isChildMenu":[32],"hasOverflow":[32]}],[1,"mg-menu-item",{"href":[1],"status":[1537],"expanded":[1028],"size":[32],"navigationButtonClassList":[32],"direction":[32],"isInMainMenu":[32],"hasChildren":[32],"displayNotificationBadge":[32]}],[1,"mg-popover",{"identifier":[1],"placement":[1],"arrowHide":[4,"arrow-hide"],"closeButton":[4,"close-button"],"display":[1028],"disabled":[1028],"classList":[32]}],[2,"mg-character-left",{"identifier":[1],"characters":[1],"maxlength":[2]}],[1,"mg-badge",{"value":[1032],"label":[1],"variant":[1],"outline":[4],"classList":[32]}],[1,"mg-card"],[1,"mg-button",{"variant":[1],"identifier":[1],"label":[1],"type":[1],"fullWidth":[1028,"full-width"],"form":[1025],"disabled":[1028],"isIcon":[4,"is-icon"],"disableOnClick":[4,"disable-on-click"],"loading":[32],"classList":[32]}],[6,"mg-input-title",{"identifier":[1],"required":[4],"isLegend":[4,"is-legend"],"tagName":[32]}],[1,"mg-tooltip",{"identifier":[1],"message":[1],"placement":[1],"display":[1028],"disabled":[1028]}],[1,"mg-icon",{"icon":[1],"size":[1],"variant":[1],"spin":[4],"classList":[32]}]]]], options);
|
|
14
15
|
});
|
|
15
16
|
};
|
|
16
17
|
|