@mgdis/mg-components 5.5.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-c3450336.js → index-5e7ede97.js} +120 -4
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +1223 -547
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +13 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -4
- package/dist/collection/components/atoms/mg-button/mg-button.css +9 -22
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +38 -28
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +4 -4
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +14 -17
- 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 +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +7 -3
- 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 +7 -3
- 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 +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +7 -3
- 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.conf.js +17 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +27 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +141 -19
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +0 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +48 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +139 -71
- 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-illustrated-message/mg-illustrated-message.js +4 -3
- package/dist/collection/components/molecules/mg-message/mg-message.css +7 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +54 -13
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +64 -7
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +33 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +12 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +105 -57
- package/dist/collection/locales/en/messages.json +10 -1
- package/dist/collection/locales/fr/messages.json +10 -1
- package/dist/collection/locales/index.js +3 -26
- package/dist/collection/styles/a11y.scss +32 -0
- package/dist/collection/styles/components.scss +3 -0
- package/dist/collection/styles/fonts.scss +21 -0
- package/dist/collection/styles/form.scss +3 -0
- package/dist/collection/styles/global.scss +87 -0
- package/dist/collection/styles/layout.scss +29 -0
- package/dist/collection/styles/main.scss +23 -0
- package/dist/collection/styles/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +77 -0
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/collection/styles/typography.scss +75 -0
- package/dist/collection/styles/utilities.scss +21 -0
- package/dist/collection/utils/behaviors.utils.js +151 -0
- package/dist/collection/utils/components.utils.js +52 -0
- package/dist/collection/utils/locale.utils.js +28 -6
- package/dist/collection/utils/unit.test.utils.js +65 -32
- package/dist/collection/variables.css +11 -10
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +53 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index2.js +79 -20
- 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 +5 -5
- package/dist/components/mg-button2.js +2 -2
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +41 -31
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +7 -5
- package/dist/components/mg-input-numeric.js +3 -4
- 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 +9 -5
- 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-item.js +1 -253
- package/dist/components/mg-menu-item2.js +520 -0
- package/dist/components/mg-menu.js +1 -129
- package/dist/components/mg-menu2.js +247 -0
- package/dist/components/mg-message.js +55 -14
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +3 -3
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +226 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +104 -55
- package/dist/components/mg-tag.js +5 -5
- package/dist/components/mg-tooltip2.js +15 -18
- package/dist/esm/{index-78edde1d.js → index-03cceb11.js} +120 -5
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +1223 -548
- package/dist/esm/mg-components.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +10 -1
- package/dist/mg-components/locales/fr/messages.json +10 -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/a11y.scss +32 -0
- package/dist/mg-components/styles/components.scss +3 -0
- package/dist/mg-components/styles/fonts.scss +21 -0
- package/dist/mg-components/styles/form.scss +3 -0
- package/dist/mg-components/styles/global.scss +87 -0
- package/dist/mg-components/styles/layout.scss +29 -0
- package/dist/mg-components/styles/main.scss +23 -0
- package/dist/mg-components/styles/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +77 -0
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/mg-components/styles/typography.scss +75 -0
- package/dist/mg-components/styles/utilities.scss +21 -0
- package/dist/mg-components/variables.css +11 -10
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +37 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +51 -3
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +0 -8
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +61 -15
- 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-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +13 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +15 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +22 -12
- package/dist/types/components.d.ts +98 -12
- package/dist/types/locales/index.d.ts +21 -10
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/behaviors.utils.d.ts +77 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +16 -3
- package/dist/types/utils/unit.test.utils.d.ts +68 -14
- package/loader/index.d.ts +9 -0
- package/package.json +28 -27
- package/readme.md +22 -31
- 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 -87
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -39
- 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 -51
- 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/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-125c54ca.js +0 -2
- package/dist/mg-components/p-4961c96c.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 -17
- 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)
|
|
@@ -80,11 +93,11 @@ const isComplexType = (o) => {
|
|
|
80
93
|
*
|
|
81
94
|
* Modified for Stencil's compiler and vdom
|
|
82
95
|
*/
|
|
83
|
-
// const stack: any[] = [];
|
|
84
96
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
85
97
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
86
98
|
const h = (nodeName, vnodeData, ...children) => {
|
|
87
99
|
let child = null;
|
|
100
|
+
let key = null;
|
|
88
101
|
let slotName = null;
|
|
89
102
|
let simple = false;
|
|
90
103
|
let lastSimple = false;
|
|
@@ -113,6 +126,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
113
126
|
};
|
|
114
127
|
walk(children);
|
|
115
128
|
if (vnodeData) {
|
|
129
|
+
// normalize class / classname attributes
|
|
130
|
+
if (vnodeData.key) {
|
|
131
|
+
key = vnodeData.key;
|
|
132
|
+
}
|
|
116
133
|
if (vnodeData.name) {
|
|
117
134
|
slotName = vnodeData.name;
|
|
118
135
|
}
|
|
@@ -137,6 +154,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
137
154
|
if (vNodeChildren.length > 0) {
|
|
138
155
|
vnode.$children$ = vNodeChildren;
|
|
139
156
|
}
|
|
157
|
+
{
|
|
158
|
+
vnode.$key$ = key;
|
|
159
|
+
}
|
|
140
160
|
{
|
|
141
161
|
vnode.$name$ = slotName;
|
|
142
162
|
}
|
|
@@ -153,6 +173,9 @@ const newVNode = (tag, text) => {
|
|
|
153
173
|
{
|
|
154
174
|
vnode.$attrs$ = null;
|
|
155
175
|
}
|
|
176
|
+
{
|
|
177
|
+
vnode.$key$ = null;
|
|
178
|
+
}
|
|
156
179
|
{
|
|
157
180
|
vnode.$name$ = null;
|
|
158
181
|
}
|
|
@@ -160,6 +183,13 @@ const newVNode = (tag, text) => {
|
|
|
160
183
|
};
|
|
161
184
|
const Host = {};
|
|
162
185
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
186
|
+
/**
|
|
187
|
+
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
188
|
+
*
|
|
189
|
+
* Note that these functions convert from {@link d.VNode} to
|
|
190
|
+
* {@link d.ChildNode} to give functional component developers a friendly
|
|
191
|
+
* interface.
|
|
192
|
+
*/
|
|
163
193
|
const vdomFnUtils = {
|
|
164
194
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
165
195
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
@@ -281,6 +311,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
281
311
|
styles.set(scopeId, style);
|
|
282
312
|
};
|
|
283
313
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
314
|
+
var _a;
|
|
284
315
|
let scopeId = getScopeId(cmpMeta);
|
|
285
316
|
const style = styles.get(scopeId);
|
|
286
317
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -300,6 +331,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
300
331
|
styleElm = doc.createElement('style');
|
|
301
332
|
styleElm.innerHTML = style;
|
|
302
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
|
+
}
|
|
303
339
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
304
340
|
}
|
|
305
341
|
if (appliedStyles) {
|
|
@@ -380,6 +416,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
380
416
|
}
|
|
381
417
|
}
|
|
382
418
|
}
|
|
419
|
+
else if (memberName === 'key')
|
|
420
|
+
;
|
|
383
421
|
else if (memberName === 'ref') {
|
|
384
422
|
// minifier will clean this up
|
|
385
423
|
if (newValue) {
|
|
@@ -446,16 +484,36 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
446
484
|
}
|
|
447
485
|
catch (e) { }
|
|
448
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
|
+
}
|
|
449
501
|
if (newValue == null || newValue === false) {
|
|
450
502
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
451
|
-
{
|
|
503
|
+
if (xlink) {
|
|
504
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
452
507
|
elm.removeAttribute(memberName);
|
|
453
508
|
}
|
|
454
509
|
}
|
|
455
510
|
}
|
|
456
511
|
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
457
512
|
newValue = newValue === true ? '' : newValue;
|
|
458
|
-
{
|
|
513
|
+
if (xlink) {
|
|
514
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
459
517
|
elm.setAttribute(memberName, newValue);
|
|
460
518
|
}
|
|
461
519
|
}
|
|
@@ -725,6 +783,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
725
783
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
726
784
|
let oldStartIdx = 0;
|
|
727
785
|
let newStartIdx = 0;
|
|
786
|
+
let idxInOld = 0;
|
|
787
|
+
let i = 0;
|
|
728
788
|
let oldEndIdx = oldCh.length - 1;
|
|
729
789
|
let oldStartVnode = oldCh[0];
|
|
730
790
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -732,6 +792,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
732
792
|
let newStartVnode = newCh[0];
|
|
733
793
|
let newEndVnode = newCh[newEndIdx];
|
|
734
794
|
let node;
|
|
795
|
+
let elmToMove;
|
|
735
796
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
736
797
|
if (oldStartVnode == null) {
|
|
737
798
|
// VNode might have been moved left
|
|
@@ -833,7 +894,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
833
894
|
newStartVnode = newCh[++newStartIdx];
|
|
834
895
|
}
|
|
835
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;
|
|
836
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 {
|
|
837
932
|
// We either didn't find an element in the old children that matches
|
|
838
933
|
// the key of the first new child OR the build is not using `key`
|
|
839
934
|
// attributes at all. In either case we need to create a new element
|
|
@@ -884,7 +979,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
884
979
|
if (leftVNode.$tag$ === 'slot') {
|
|
885
980
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
886
981
|
}
|
|
887
|
-
|
|
982
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
983
|
+
{
|
|
984
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
985
|
+
}
|
|
888
986
|
}
|
|
889
987
|
return false;
|
|
890
988
|
};
|
|
@@ -1675,15 +1773,20 @@ const setContentReference = (elm) => {
|
|
|
1675
1773
|
const disconnectedCallback = (elm) => {
|
|
1676
1774
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1677
1775
|
const hostRef = getHostRef(elm);
|
|
1776
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1678
1777
|
{
|
|
1679
1778
|
if (hostRef.$rmListeners$) {
|
|
1680
1779
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1681
1780
|
hostRef.$rmListeners$ = undefined;
|
|
1682
1781
|
}
|
|
1683
1782
|
}
|
|
1783
|
+
{
|
|
1784
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1785
|
+
}
|
|
1684
1786
|
}
|
|
1685
1787
|
};
|
|
1686
1788
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1789
|
+
var _a;
|
|
1687
1790
|
const endBootstrap = createTime();
|
|
1688
1791
|
const cmpTags = [];
|
|
1689
1792
|
const exclude = options.exclude || [];
|
|
@@ -1766,6 +1869,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1766
1869
|
{
|
|
1767
1870
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1768
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
|
+
}
|
|
1769
1877
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1770
1878
|
}
|
|
1771
1879
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1815,6 +1923,13 @@ const getHostListenerTarget = (elm, flags) => {
|
|
|
1815
1923
|
};
|
|
1816
1924
|
// prettier-ignore
|
|
1817
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);
|
|
1818
1933
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1819
1934
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1820
1935
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1932,3 +2047,4 @@ exports.getElement = getElement;
|
|
|
1932
2047
|
exports.h = h;
|
|
1933
2048
|
exports.promiseResolve = promiseResolve;
|
|
1934
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;
|