@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
|
@@ -53,6 +53,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
56
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
56
57
|
/**
|
|
57
58
|
* Default style mode id
|
|
58
59
|
*/
|
|
@@ -72,6 +73,18 @@ const isComplexType = (o) => {
|
|
|
72
73
|
o = typeof o;
|
|
73
74
|
return o === 'object' || o === 'function';
|
|
74
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
78
|
+
* out of a DOM's head.
|
|
79
|
+
*
|
|
80
|
+
* @param doc The DOM containing the `head` to query against
|
|
81
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
82
|
+
* exists or the tag has no content.
|
|
83
|
+
*/
|
|
84
|
+
function queryNonceMetaTagContent(doc) {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
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;
|
|
87
|
+
}
|
|
75
88
|
/**
|
|
76
89
|
* Production h() function based on Preact by
|
|
77
90
|
* Jason Miller (@developit)
|
|
@@ -84,6 +97,7 @@ const isComplexType = (o) => {
|
|
|
84
97
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
85
98
|
const h = (nodeName, vnodeData, ...children) => {
|
|
86
99
|
let child = null;
|
|
100
|
+
let key = null;
|
|
87
101
|
let slotName = null;
|
|
88
102
|
let simple = false;
|
|
89
103
|
let lastSimple = false;
|
|
@@ -112,6 +126,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
112
126
|
};
|
|
113
127
|
walk(children);
|
|
114
128
|
if (vnodeData) {
|
|
129
|
+
// normalize class / classname attributes
|
|
130
|
+
if (vnodeData.key) {
|
|
131
|
+
key = vnodeData.key;
|
|
132
|
+
}
|
|
115
133
|
if (vnodeData.name) {
|
|
116
134
|
slotName = vnodeData.name;
|
|
117
135
|
}
|
|
@@ -136,6 +154,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
136
154
|
if (vNodeChildren.length > 0) {
|
|
137
155
|
vnode.$children$ = vNodeChildren;
|
|
138
156
|
}
|
|
157
|
+
{
|
|
158
|
+
vnode.$key$ = key;
|
|
159
|
+
}
|
|
139
160
|
{
|
|
140
161
|
vnode.$name$ = slotName;
|
|
141
162
|
}
|
|
@@ -152,6 +173,9 @@ const newVNode = (tag, text) => {
|
|
|
152
173
|
{
|
|
153
174
|
vnode.$attrs$ = null;
|
|
154
175
|
}
|
|
176
|
+
{
|
|
177
|
+
vnode.$key$ = null;
|
|
178
|
+
}
|
|
155
179
|
{
|
|
156
180
|
vnode.$name$ = null;
|
|
157
181
|
}
|
|
@@ -287,6 +311,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
287
311
|
styles.set(scopeId, style);
|
|
288
312
|
};
|
|
289
313
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
314
|
+
var _a;
|
|
290
315
|
let scopeId = getScopeId(cmpMeta);
|
|
291
316
|
const style = styles.get(scopeId);
|
|
292
317
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -306,6 +331,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
306
331
|
styleElm = doc.createElement('style');
|
|
307
332
|
styleElm.innerHTML = style;
|
|
308
333
|
}
|
|
334
|
+
// Apply CSP nonce to the style tag if it exists
|
|
335
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
336
|
+
if (nonce != null) {
|
|
337
|
+
styleElm.setAttribute('nonce', nonce);
|
|
338
|
+
}
|
|
309
339
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
310
340
|
}
|
|
311
341
|
if (appliedStyles) {
|
|
@@ -386,6 +416,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
386
416
|
}
|
|
387
417
|
}
|
|
388
418
|
}
|
|
419
|
+
else if (memberName === 'key')
|
|
420
|
+
;
|
|
389
421
|
else if (memberName === 'ref') {
|
|
390
422
|
// minifier will clean this up
|
|
391
423
|
if (newValue) {
|
|
@@ -452,16 +484,36 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
452
484
|
}
|
|
453
485
|
catch (e) { }
|
|
454
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Need to manually update attribute if:
|
|
489
|
+
* - memberName is not an attribute
|
|
490
|
+
* - if we are rendering the host element in order to reflect attribute
|
|
491
|
+
* - if it's a SVG, since properties might not work in <svg>
|
|
492
|
+
* - if the newValue is null/undefined or 'false'.
|
|
493
|
+
*/
|
|
494
|
+
let xlink = false;
|
|
495
|
+
{
|
|
496
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
|
497
|
+
memberName = ln;
|
|
498
|
+
xlink = true;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
455
501
|
if (newValue == null || newValue === false) {
|
|
456
502
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
457
|
-
{
|
|
503
|
+
if (xlink) {
|
|
504
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
458
507
|
elm.removeAttribute(memberName);
|
|
459
508
|
}
|
|
460
509
|
}
|
|
461
510
|
}
|
|
462
511
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
463
512
|
newValue = newValue === true ? '' : newValue;
|
|
464
|
-
{
|
|
513
|
+
if (xlink) {
|
|
514
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
465
517
|
elm.setAttribute(memberName, newValue);
|
|
466
518
|
}
|
|
467
519
|
}
|
|
@@ -731,6 +783,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
731
783
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
732
784
|
let oldStartIdx = 0;
|
|
733
785
|
let newStartIdx = 0;
|
|
786
|
+
let idxInOld = 0;
|
|
787
|
+
let i = 0;
|
|
734
788
|
let oldEndIdx = oldCh.length - 1;
|
|
735
789
|
let oldStartVnode = oldCh[0];
|
|
736
790
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -738,6 +792,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
738
792
|
let newStartVnode = newCh[0];
|
|
739
793
|
let newEndVnode = newCh[newEndIdx];
|
|
740
794
|
let node;
|
|
795
|
+
let elmToMove;
|
|
741
796
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
742
797
|
if (oldStartVnode == null) {
|
|
743
798
|
// VNode might have been moved left
|
|
@@ -839,7 +894,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
839
894
|
newStartVnode = newCh[++newStartIdx];
|
|
840
895
|
}
|
|
841
896
|
else {
|
|
897
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
898
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
899
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
900
|
+
// component.
|
|
901
|
+
//
|
|
902
|
+
// First we check to see if there are any nodes in the array of old
|
|
903
|
+
// children which have the same key as the first node in the new
|
|
904
|
+
// children.
|
|
905
|
+
idxInOld = -1;
|
|
842
906
|
{
|
|
907
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
908
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
909
|
+
idxInOld = i;
|
|
910
|
+
break;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
if (idxInOld >= 0) {
|
|
915
|
+
// We found a node in the old children which matches up with the first
|
|
916
|
+
// node in the new children! So let's deal with that
|
|
917
|
+
elmToMove = oldCh[idxInOld];
|
|
918
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
919
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
920
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
patch(elmToMove, newStartVnode);
|
|
924
|
+
// invalidate the matching old node so that we won't try to update it
|
|
925
|
+
// again later on
|
|
926
|
+
oldCh[idxInOld] = undefined;
|
|
927
|
+
node = elmToMove.$elm$;
|
|
928
|
+
}
|
|
929
|
+
newStartVnode = newCh[++newStartIdx];
|
|
930
|
+
}
|
|
931
|
+
else {
|
|
843
932
|
// We either didn't find an element in the old children that matches
|
|
844
933
|
// the key of the first new child OR the build is not using `key`
|
|
845
934
|
// attributes at all. In either case we need to create a new element
|
|
@@ -890,7 +979,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
890
979
|
if (leftVNode.$tag$ === 'slot') {
|
|
891
980
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
892
981
|
}
|
|
893
|
-
|
|
982
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
983
|
+
{
|
|
984
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
985
|
+
}
|
|
894
986
|
}
|
|
895
987
|
return false;
|
|
896
988
|
};
|
|
@@ -1694,6 +1786,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1694
1786
|
}
|
|
1695
1787
|
};
|
|
1696
1788
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1789
|
+
var _a;
|
|
1697
1790
|
const endBootstrap = createTime();
|
|
1698
1791
|
const cmpTags = [];
|
|
1699
1792
|
const exclude = options.exclude || [];
|
|
@@ -1776,6 +1869,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1776
1869
|
{
|
|
1777
1870
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1778
1871
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1872
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1873
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1874
|
+
if (nonce != null) {
|
|
1875
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1876
|
+
}
|
|
1779
1877
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1780
1878
|
}
|
|
1781
1879
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1825,6 +1923,13 @@ const getHostListenerTarget = (elm, flags) => {
|
|
|
1825
1923
|
};
|
|
1826
1924
|
// prettier-ignore
|
|
1827
1925
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1926
|
+
/**
|
|
1927
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1928
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1929
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1930
|
+
* @returns void
|
|
1931
|
+
*/
|
|
1932
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1828
1933
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1829
1934
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1830
1935
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1942,3 +2047,4 @@ exports.getElement = getElement;
|
|
|
1942
2047
|
exports.h = h;
|
|
1943
2048
|
exports.promiseResolve = promiseResolve;
|
|
1944
2049
|
exports.registerInstance = registerInstance;
|
|
2050
|
+
exports.setNonce = setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-5e7ede97.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,8 +14,9 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["mg-
|
|
17
|
+
return index.bootstrapLazy([["mg-action-more_31.cjs",[[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);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
exports.setNonce = index.setNonce;
|
|
21
22
|
exports.defineCustomElements = defineCustomElements;
|