@mgdis/mg-components 5.28.1 → 5.29.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-ce4f7698.js → index-8a3adbd1.js} +40 -8
- package/dist/cjs/index-8a3adbd1.js.map +1 -0
- package/dist/cjs/{index-d8721674.js → index-e1a25816.js} +48 -47
- package/dist/cjs/index-e1a25816.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +112 -103
- package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-loader.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-button/mg-button.js +2 -2
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +2 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- 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.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -7
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -2
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
- package/dist/components/index.es.js +41 -40
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +2 -2
- package/dist/components/mg-badge2.js +3 -3
- package/dist/components/mg-button2.js +5 -5
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-card2.js +2 -2
- package/dist/components/mg-details.js +2 -2
- package/dist/components/mg-form.js +3 -3
- package/dist/components/mg-icon2.js +2 -2
- package/dist/components/mg-illustrated-message.js +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js +1 -3
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +5 -5
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +11 -11
- package/dist/components/mg-input-numeric.js +5 -5
- package/dist/components/mg-input-password.js +3 -3
- package/dist/components/mg-input-radio.js +21 -9
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-select2.js +8 -8
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +6 -6
- package/dist/components/mg-input-textarea.js +6 -6
- package/dist/components/mg-input-title2.js +2 -2
- package/dist/components/mg-input-toggle.js +4 -4
- package/dist/components/mg-input2.js +3 -3
- package/dist/components/mg-item-more2.js +3 -3
- package/dist/components/mg-loader.js +2 -2
- package/dist/components/mg-menu-item2.js +5 -5
- package/dist/components/mg-message.js +3 -3
- package/dist/components/mg-modal.js +6 -6
- package/dist/components/mg-pagination2.js +2 -2
- package/dist/components/mg-panel.js +4 -4
- package/dist/components/mg-popover-content2.js +3 -3
- package/dist/components/mg-popover2.js +3 -3
- package/dist/components/mg-skip-links.js +3 -3
- package/dist/components/mg-skip-links.js.map +1 -1
- package/dist/components/mg-tabs.js +6 -6
- package/dist/components/mg-tag.js +3 -3
- package/dist/components/mg-tooltip2.js +6 -6
- package/dist/esm/{index-9ed65b6d.js → index-0df3b137.js} +40 -8
- package/dist/esm/index-0df3b137.js.map +1 -0
- package/dist/esm/{index-817d7645.js → index-eed80cc2.js} +43 -42
- package/dist/esm/index-eed80cc2.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +112 -103
- package/dist/esm/mg-action-more_36.entry.js.map +1 -1
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-loader.entry.js +3 -3
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -1
- package/dist/mg-components/{p-ef541188.entry.js → p-88f6c2f9.entry.js} +2 -2
- package/dist/mg-components/p-88f6c2f9.entry.js.map +1 -0
- package/dist/mg-components/{p-c4207303.entry.js → p-e5db08c5.entry.js} +2 -2
- package/dist/mg-components/p-efce3d8c.js +2 -0
- package/dist/mg-components/p-efce3d8c.js.map +1 -0
- package/dist/mg-components/p-f95b4418.js +3 -0
- package/dist/mg-components/p-f95b4418.js.map +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
- package/dist/types/components.d.ts +10 -10
- package/ide/intellij/web-types.json +4 -4
- package/ide/vscode/html-custom-data.json +3 -3
- package/package.json +25 -26
- package/dist/cjs/index-ce4f7698.js.map +0 -1
- package/dist/cjs/index-d8721674.js.map +0 -1
- package/dist/esm/index-817d7645.js.map +0 -1
- package/dist/esm/index-9ed65b6d.js.map +0 -1
- package/dist/mg-components/p-06a9d801.js +0 -3
- package/dist/mg-components/p-06a9d801.js.map +0 -1
- package/dist/mg-components/p-eb6ec303.js +0 -2
- package/dist/mg-components/p-eb6ec303.js.map +0 -1
- package/dist/mg-components/p-ef541188.entry.js.map +0 -1
- /package/dist/mg-components/{p-c4207303.entry.js.map → p-e5db08c5.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as Ze, z as ze, I as Ie, Y as Ye } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$6 } from './mg-badge2.js';
|
|
5
5
|
import { d as defineCustomElement$5 } from './mg-button2.js';
|
|
@@ -112,7 +112,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
112
112
|
throw new Error(`<${this.name}> slot "label" is required.`);
|
|
113
113
|
['label', 'metadata'].forEach(slot => {
|
|
114
114
|
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
115
|
-
if (!
|
|
115
|
+
if (!Ze(element.textContent))
|
|
116
116
|
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
117
117
|
if ((guard && element.getAttribute('title') === null) || !guard)
|
|
118
118
|
element.setAttribute('title', element.textContent);
|
|
@@ -181,13 +181,13 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
181
181
|
* @returns HTML Element
|
|
182
182
|
*/
|
|
183
183
|
this.renderSlot = () => h("slot", null);
|
|
184
|
-
this.identifier =
|
|
184
|
+
this.identifier = ze('mg-menu-item');
|
|
185
185
|
this.href = undefined;
|
|
186
186
|
this.target = undefined;
|
|
187
187
|
this.status = Status.VISIBLE;
|
|
188
188
|
this.expanded = false;
|
|
189
189
|
this.size = 'regular';
|
|
190
|
-
this.navigationButtonClassList = new
|
|
190
|
+
this.navigationButtonClassList = new Ie([this.navigationButton]);
|
|
191
191
|
this.direction = undefined;
|
|
192
192
|
this.isInMainMenu = undefined;
|
|
193
193
|
this.isItemMore = undefined;
|
|
@@ -334,7 +334,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
334
334
|
* Emit event when component is updated
|
|
335
335
|
*/
|
|
336
336
|
componentShouldUpdate() {
|
|
337
|
-
return
|
|
337
|
+
return Ye(() => {
|
|
338
338
|
this.itemUpdated.emit();
|
|
339
339
|
});
|
|
340
340
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { z as ze, I as Ie } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$4 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './mg-card2.js';
|
|
@@ -83,13 +83,13 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTM
|
|
|
83
83
|
return 'exclamation-circle';
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
this.identifier =
|
|
86
|
+
this.identifier = ze('mg-message');
|
|
87
87
|
this.delay = undefined;
|
|
88
88
|
this.variant = variants[0];
|
|
89
89
|
this.closeButton = false;
|
|
90
90
|
this.hide = false;
|
|
91
91
|
this.noAriaRole = undefined;
|
|
92
|
-
this.classCollection = new
|
|
92
|
+
this.classCollection = new Ie(['mg-c-message']);
|
|
93
93
|
this.hasActions = false;
|
|
94
94
|
}
|
|
95
95
|
validateDelay(newValue) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { K as Ke, z as ze, I as Ie, Z as Ze } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$4 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './mg-card2.js';
|
|
@@ -59,12 +59,12 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
59
59
|
*/
|
|
60
60
|
this.setFocus = () => {
|
|
61
61
|
// Get all focusable elements
|
|
62
|
-
const slottedFocusableElements = Array.from(this.element.querySelectorAll(
|
|
62
|
+
const slottedFocusableElements = Array.from(this.element.querySelectorAll(Ke));
|
|
63
63
|
// If close button is enabled or at least one of the slotted element is focusable
|
|
64
64
|
if (this.closeButton || slottedFocusableElements.length > 0) {
|
|
65
65
|
// Check if slotted focusable elements have shadowDom with focusable elements
|
|
66
66
|
this.modalFocusableElements = slottedFocusableElements.reduce((acc, focusableElement) => {
|
|
67
|
-
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(
|
|
67
|
+
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(Ke) || focusableElement : focusableElement);
|
|
68
68
|
return acc;
|
|
69
69
|
}, []);
|
|
70
70
|
// When close button is enabled it's the first focusable element.
|
|
@@ -86,21 +86,21 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
86
86
|
this.handleClose = () => {
|
|
87
87
|
this.hide = true;
|
|
88
88
|
};
|
|
89
|
-
this.identifier =
|
|
89
|
+
this.identifier = ze('mg-modal');
|
|
90
90
|
this.dialogRole = dialogRoles[0];
|
|
91
91
|
this.modalTitle = undefined;
|
|
92
92
|
this.closeButton = false;
|
|
93
93
|
this.hide = undefined;
|
|
94
94
|
this.hasActions = false;
|
|
95
95
|
this.hasContent = false;
|
|
96
|
-
this.classCollection = new
|
|
96
|
+
this.classCollection = new Ie(['mg-c-modal']);
|
|
97
97
|
}
|
|
98
98
|
validateDialogRole(newValue) {
|
|
99
99
|
if (!dialogRoles.includes(newValue))
|
|
100
100
|
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}.`);
|
|
101
101
|
}
|
|
102
102
|
validateModalTitle(newValue) {
|
|
103
|
-
if (!
|
|
103
|
+
if (!Ze(newValue)) {
|
|
104
104
|
throw new Error('<mg-modal> prop "modalTitle" is required.');
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { z as ze } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$7 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$6 } from './mg-icon2.js';
|
|
@@ -72,7 +72,7 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
72
72
|
this.handleGoToPage = (action, disabled) => {
|
|
73
73
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
74
74
|
};
|
|
75
|
-
this.identifier =
|
|
75
|
+
this.identifier = ze('mg-pagination');
|
|
76
76
|
this.label = undefined;
|
|
77
77
|
this.hideNavigationLabels = undefined;
|
|
78
78
|
this.hidePageCount = undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { z as ze, I as Ie, Z as Ze } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$a } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './mg-card2.js';
|
|
@@ -122,7 +122,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
122
122
|
];
|
|
123
123
|
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
124
124
|
};
|
|
125
|
-
this.identifier =
|
|
125
|
+
this.identifier = ze('mg-panel');
|
|
126
126
|
this.panelTitle = undefined;
|
|
127
127
|
this.titlePattern = undefined;
|
|
128
128
|
this.titlePatternErrorMessage = undefined;
|
|
@@ -131,12 +131,12 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
131
131
|
this.expanded = false;
|
|
132
132
|
this.expandToggleDisplay = expandToggleDisplays[0];
|
|
133
133
|
this.expandToggleDisabled = undefined;
|
|
134
|
-
this.classCollection = new
|
|
134
|
+
this.classCollection = new Ie(['mg-c-panel']);
|
|
135
135
|
this.isEditing = false;
|
|
136
136
|
this.updatedPanelTitle = undefined;
|
|
137
137
|
}
|
|
138
138
|
validatePanelTitle(newValue) {
|
|
139
|
-
if (!
|
|
139
|
+
if (!Ze(newValue))
|
|
140
140
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
141
141
|
this.titleChange.emit(newValue);
|
|
142
142
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { I as Ie, X as Xe } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './mg-card2.js';
|
|
@@ -21,7 +21,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
21
21
|
this.hideContent.emit();
|
|
22
22
|
};
|
|
23
23
|
this.closeButton = false;
|
|
24
|
-
this.classCollection = new
|
|
24
|
+
this.classCollection = new Ie(['mg-c-popover-content']);
|
|
25
25
|
}
|
|
26
26
|
/*************
|
|
27
27
|
* Lifecycle *
|
|
@@ -39,7 +39,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
39
39
|
componentDidLoad() {
|
|
40
40
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
41
41
|
const slottedTitleElement = this.element.querySelector('[slot="title"]');
|
|
42
|
-
if (slottedTitleElement && !
|
|
42
|
+
if (slottedTitleElement && !Xe(slottedTitleElement, headingTags)) {
|
|
43
43
|
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { z as ze, Q as Qe } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$4 } from './mg-button2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './mg-card2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
@@ -103,7 +103,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
|
|
|
103
103
|
mgPopoverContent.setAttribute('id', this.identifier);
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
this.identifier =
|
|
106
|
+
this.identifier = ze('mg-popover');
|
|
107
107
|
this.placement = 'bottom';
|
|
108
108
|
this.arrowHide = false;
|
|
109
109
|
this.closeButton = false;
|
|
@@ -146,7 +146,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
|
|
|
146
146
|
*/
|
|
147
147
|
componentWillLoad() {
|
|
148
148
|
// Get windows to attach events
|
|
149
|
-
this.windows =
|
|
149
|
+
this.windows = Qe(window);
|
|
150
150
|
// render mg-popover-content slot
|
|
151
151
|
this.renderPopoverContent();
|
|
152
152
|
this.validateCloseButton(this.closeButton);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { i as initLocales } from './index2.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Z as Ze } from './index.es.js';
|
|
4
4
|
|
|
5
5
|
const mgSkipLinksCss = ".mg-c-skip-links{position:absolute;background:hsl(var(--color-light));opacity:0;transform:translateY(-100%)}.mg-c-skip-links:focus-within{position:relative;opacity:1;transform:translateY(0)}.mg-c-skip-links__list{display:flex;flex-wrap:wrap;align-items:center;padding:.64rem 1.8rem;margin:0;gap:.6rem;list-style:none}.mg-c-skip-links__link{display:inline-block;padding:1.2rem;color:hsl(var(--color-dark))}.mg-c-skip-links__link:hover{background:hsl(var(--color-dark)/10%)}";
|
|
6
6
|
const MgSkipLinksStyle0 = mgSkipLinksCss;
|
|
@@ -25,7 +25,7 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class MgSkipLinks extends
|
|
|
25
25
|
this.links = undefined;
|
|
26
26
|
}
|
|
27
27
|
validateLinks(links) {
|
|
28
|
-
if (links === undefined || links.length === 0 || links.some(link => !
|
|
28
|
+
if (links === undefined || links.length === 0 || links.some(link => !Ze(link.href) || !link.href.startsWith('#') || !Ze(link.label))) {
|
|
29
29
|
throw new Error(`<mg-skip-links> prop "links": Cannot be empty and each link must contains an href starting with a "#" and a non empty label attributes.`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -44,7 +44,7 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class MgSkipLinks extends
|
|
|
44
44
|
* @returns HTML Element
|
|
45
45
|
*/
|
|
46
46
|
render() {
|
|
47
|
-
return (h("nav", { key: '
|
|
47
|
+
return (h("nav", { key: 'e5a7020edfe2e491af48785f3d9fa9bede770ae5', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'da692631900bb61269803e93718d0dacdb6a5e8a', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
48
48
|
}
|
|
49
49
|
get element() { return this; }
|
|
50
50
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"mg-skip-links.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,0dAA0d,CAAC;AAClf,0BAAe,cAAc;;
|
|
1
|
+
{"file":"mg-skip-links.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,0dAA0d,CAAC;AAClf,0BAAe,cAAc;;MCShBA,aAAW;;;;;;;;;;;;;QAwCd,oBAAe,GAAG,CAAC,KAAkD;YAC3E,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;SAChE,CAAC;;;IAtBF,aAAa,CAAC,KAAiB;QAC7B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAACC,EAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAACA,EAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;YAC1J,MAAM,IAAI,KAAK,CAAC,yIAAyI,CAAC,CAAC;SAC5J;KACF;;;;;;;IA2BD,iBAAiB;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;KACpD;;;;;IAMD,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,YAAY,gBAAa,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,IACzF,2DAAI,KAAK,EAAC,uBAAuB,EAAC,IAAI,EAAC,MAAM,IAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAClB,UAAI,GAAG,EAAE,IAAI,CAAC,IAAI,IAChB,SAAG,KAAK,EAAC,uBAAuB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,IAC5E,IAAI,CAAC,KAAK,CACT,CACD,CACN,CAAC,CACC,CACD,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgSkipLinks","isValidString"],"sources":["../styles/dist/components/mg-skip-links.css?tag=mg-skip-links&encapsulation=shadow","src/components/molecules/mg-skip-links/mg-skip-links.tsx"],"sourcesContent":[".mg-c-skip-links{position:absolute;background:hsl(var(--color-light));opacity:0;transform:translateY(-100%)}.mg-c-skip-links:focus-within{position:relative;opacity:1;transform:translateY(0)}.mg-c-skip-links__list{display:flex;flex-wrap:wrap;align-items:center;padding:.64rem 1.8rem;margin:0;gap:.6rem;list-style:none}.mg-c-skip-links__link{display:inline-block;padding:1.2rem;color:hsl(var(--color-dark))}.mg-c-skip-links__link:hover{background:hsl(var(--color-dark)/10%)}/*# sourceMappingURL=mg-skip-links.css.map */\n","import { Component, Element, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\nimport { SkipLink } from './mg-skip-links.conf';\nimport { initLocales } from '../../../locales';\nimport { isValidString } from '@mgdis/stencil-helpers';\n\n@Component({\n tag: 'mg-skip-links',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-skip-links.css',\n shadow: true,\n})\nexport class MgSkipLinks {\n /************\n * Internal *\n ************/\n\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgSkipLinksElement;\n\n /**\n * Skip links\n */\n @Prop() links: SkipLink[];\n @Watch('links')\n validateLinks(links: SkipLink[]): void {\n if (links === undefined || links.length === 0 || links.some(link => !isValidString(link.href) || !link.href.startsWith('#') || !isValidString(link.label))) {\n throw new Error(`<mg-skip-links> prop \"links\": Cannot be empty and each link must contains an href starting with a \"#\" and a non empty label attributes.`);\n }\n }\n\n /**\n * Emited event when link is clicked\n */\n @Event({ eventName: 'go-to-anchor' }) goToAnchor: EventEmitter<string>;\n\n /***********\n * Methods *\n **********/\n\n /**\n * Handle link click and emit go-to-anchor event\n * @param event - mouse event\n */\n private handleLinkCLick = (event: MouseEvent & { currentTarget: HTMLElement }): void => {\n event.currentTarget.blur();\n this.goToAnchor.emit(event.currentTarget.getAttribute('href'));\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateLinks(this.links);\n this.messages = initLocales(this.element).messages;\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <nav class=\"mg-c-skip-links\" role=\"navigation\" aria-label={this.messages.skipLinks.navLabel}>\n <ul class=\"mg-c-skip-links__list\" role=\"list\">\n {this.links.map(link => (\n <li key={link.href}>\n <a class=\"mg-c-skip-links__link\" href={link.href} onClick={this.handleLinkCLick}>\n {link.label}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as Ye, z as ze, I as Ie, Z as Ze, G as Ge } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './mg-badge2.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
5
5
|
|
|
@@ -129,7 +129,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
129
129
|
*/
|
|
130
130
|
this.resetFocus = () => {
|
|
131
131
|
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
132
|
-
|
|
132
|
+
Ye(() => {
|
|
133
133
|
this.tabFocus = undefined;
|
|
134
134
|
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
135
135
|
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
@@ -144,16 +144,16 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
144
144
|
if (slots.length !== this.tabs.length)
|
|
145
145
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
146
146
|
};
|
|
147
|
-
this.identifier =
|
|
147
|
+
this.identifier = ze('mg-tabs');
|
|
148
148
|
this.label = undefined;
|
|
149
149
|
this.size = 'regular';
|
|
150
150
|
this.items = undefined;
|
|
151
151
|
this.activeTab = undefined;
|
|
152
152
|
this.tabs = [];
|
|
153
|
-
this.classCollection = new
|
|
153
|
+
this.classCollection = new Ie(['mg-c-tabs']);
|
|
154
154
|
}
|
|
155
155
|
validateLabel(newValue) {
|
|
156
|
-
if (!
|
|
156
|
+
if (!Ze(newValue)) {
|
|
157
157
|
throw new Error('<mg-tabs> prop "label" is required.');
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -165,7 +165,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLEleme
|
|
|
165
165
|
}
|
|
166
166
|
validateItems(newValue) {
|
|
167
167
|
// String array
|
|
168
|
-
if (
|
|
168
|
+
if (Ge(newValue))
|
|
169
169
|
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
170
170
|
// Object array
|
|
171
171
|
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { I as Ie, Z as Ze } from './index.es.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* List of all possibles variants
|
|
@@ -23,7 +23,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
|
|
|
23
23
|
this.variant = variants[0];
|
|
24
24
|
this.outline = undefined;
|
|
25
25
|
this.soft = undefined;
|
|
26
|
-
this.classCollection = new
|
|
26
|
+
this.classCollection = new Ie(['mg-c-tag']);
|
|
27
27
|
}
|
|
28
28
|
validateVariant(newValue, oldValue) {
|
|
29
29
|
if (!variants.includes(newValue)) {
|
|
@@ -60,7 +60,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
|
|
|
60
60
|
* @param textContent - html element textContent property
|
|
61
61
|
*/
|
|
62
62
|
validateTextContent(textContent) {
|
|
63
|
-
if (!
|
|
63
|
+
if (!Ze(textContent))
|
|
64
64
|
throw new Error('<mg-tag> slot must contain a text content.');
|
|
65
65
|
}
|
|
66
66
|
/*************
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as Ye, z as ze, Z as Ze, Q as Qe, K as Ke } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
|
|
4
4
|
import { c as createPopper } from './popper.js';
|
|
5
5
|
|
|
@@ -34,7 +34,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
34
34
|
// Enable the event listeners
|
|
35
35
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
36
36
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
37
|
-
|
|
37
|
+
Ye(() => {
|
|
38
38
|
this.windows.forEach((localWindow) => {
|
|
39
39
|
localWindow.addEventListener('click', this.handleClickOutside, false);
|
|
40
40
|
localWindow.addEventListener('keydown', this.handlePressEscape, false);
|
|
@@ -224,7 +224,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
224
224
|
element.setAttribute('aria-describedby', `${[...new Set([...ariaDescribedby.split(' '), this.identifier])].join(' ')}`);
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
this.identifier =
|
|
227
|
+
this.identifier = ze('mg-tooltip');
|
|
228
228
|
this.message = undefined;
|
|
229
229
|
this.placement = 'bottom';
|
|
230
230
|
this.display = false;
|
|
@@ -235,7 +235,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
235
235
|
this.renderTooltipContent();
|
|
236
236
|
}
|
|
237
237
|
watchMessage(newValue) {
|
|
238
|
-
if (!
|
|
238
|
+
if (!Ze(newValue)) {
|
|
239
239
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
240
240
|
}
|
|
241
241
|
this.mgTooltipContent.message = newValue;
|
|
@@ -290,7 +290,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
290
290
|
*/
|
|
291
291
|
componentWillLoad() {
|
|
292
292
|
// Get windows to attach events
|
|
293
|
-
this.windows =
|
|
293
|
+
this.windows = Qe(window);
|
|
294
294
|
// Get tooltip element
|
|
295
295
|
this.renderTooltipContent();
|
|
296
296
|
//validate properties
|
|
@@ -308,7 +308,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
308
308
|
// get slotted element wich is not the tooltip
|
|
309
309
|
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
310
310
|
// Get interactive element
|
|
311
|
-
const interactiveElement = slotElement.matches(
|
|
311
|
+
const interactiveElement = slotElement.matches(Ke) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(Ke);
|
|
312
312
|
this.setTooltipedElement(interactiveElement || slotElement);
|
|
313
313
|
// Check if slotted element is a disabled mg-button
|
|
314
314
|
// In this case we wrap the mg-button into a div to enable the tooltip
|
|
@@ -2,7 +2,7 @@ const NAMESPACE = 'mg-components';
|
|
|
2
2
|
const BUILD = /* mg-components */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: true, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.21.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -414,7 +414,20 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
414
414
|
if (nonce != null) {
|
|
415
415
|
styleElm.setAttribute("nonce", nonce);
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
418
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
419
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
420
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : document.querySelector("style");
|
|
421
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
422
|
+
} else if ("host" in styleContainerNode) {
|
|
423
|
+
styleContainerNode.prepend(styleElm);
|
|
424
|
+
} else {
|
|
425
|
+
styleContainerNode.append(styleElm);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
429
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
430
|
+
}
|
|
418
431
|
}
|
|
419
432
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
420
433
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -437,7 +450,7 @@ var attachStyles = (hostRef) => {
|
|
|
437
450
|
const scopeId2 = addStyle(
|
|
438
451
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
439
452
|
cmpMeta);
|
|
440
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
453
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
441
454
|
elm["s-sc"] = scopeId2;
|
|
442
455
|
elm.classList.add(scopeId2 + "-h");
|
|
443
456
|
if (flags & 2 /* scopedCssEncapsulation */) {
|
|
@@ -509,7 +522,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
509
522
|
if (memberName === "list") {
|
|
510
523
|
isProp = false;
|
|
511
524
|
} else if (oldValue == null || elm[memberName] != n) {
|
|
512
|
-
elm
|
|
525
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
526
|
+
elm[memberName] = n;
|
|
527
|
+
} else {
|
|
528
|
+
elm.setAttribute(memberName, n);
|
|
529
|
+
}
|
|
513
530
|
}
|
|
514
531
|
} else {
|
|
515
532
|
elm[memberName] = newValue;
|
|
@@ -618,7 +635,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
618
635
|
{
|
|
619
636
|
updateElement(null, newVNode2, isSvgMode);
|
|
620
637
|
}
|
|
621
|
-
|
|
638
|
+
const rootNode = elm.getRootNode();
|
|
639
|
+
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
640
|
+
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
622
641
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
623
642
|
}
|
|
624
643
|
{
|
|
@@ -805,6 +824,15 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
805
824
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
806
825
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
807
826
|
if (leftVNode.$tag$ === "slot") {
|
|
827
|
+
if (
|
|
828
|
+
// The component gets hydrated and no VDOM has been initialized.
|
|
829
|
+
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
830
|
+
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
831
|
+
// hydration comments to be removed
|
|
832
|
+
leftVNode.$elm$.nodeType !== 8
|
|
833
|
+
) {
|
|
834
|
+
return false;
|
|
835
|
+
}
|
|
808
836
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
809
837
|
}
|
|
810
838
|
if (!isInitialRender) {
|
|
@@ -838,7 +866,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
838
866
|
elm.textContent = "";
|
|
839
867
|
}
|
|
840
868
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
841
|
-
} else if (
|
|
869
|
+
} else if (
|
|
870
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
871
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
872
|
+
) {
|
|
842
873
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
843
874
|
}
|
|
844
875
|
} else if ((defaultHolder = elm["s-cr"])) {
|
|
@@ -1330,7 +1361,8 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1330
1361
|
if (this.hasOwnProperty(propName)) {
|
|
1331
1362
|
newValue = this[propName];
|
|
1332
1363
|
delete this[propName];
|
|
1333
|
-
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" &&
|
|
1364
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1365
|
+
this[propName] == newValue) {
|
|
1334
1366
|
return;
|
|
1335
1367
|
} else if (propName == null) {
|
|
1336
1368
|
const hostRef = getHostRef(this);
|
|
@@ -1673,4 +1705,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1673
1705
|
|
|
1674
1706
|
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1675
1707
|
|
|
1676
|
-
//# sourceMappingURL=index-
|
|
1708
|
+
//# sourceMappingURL=index-0df3b137.js.map
|