@mgdis/mg-components 5.25.1 → 5.26.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-0256ee6d.js → index-0a2783ee.js} +1 -1
- package/dist/cjs/{index-0256ee6d.js.map → index-0a2783ee.js.map} +1 -1
- package/dist/cjs/{index-f699ee11.js → index-c585c382.js} +37 -37
- package/dist/cjs/index-c585c382.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_34.cjs.entry.js +90 -90
- package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +2 -2
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +3 -3
- package/dist/cjs/mg-loader.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
- package/dist/components/MgInput.js +3 -3
- package/dist/components/index.es.js +29 -29
- 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 +4 -4
- package/dist/components/mg-badge2.js.map +1 -1
- package/dist/components/mg-button2.js +4 -4
- 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.js +4 -4
- 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 +4 -4
- package/dist/components/mg-input-select2.js +6 -6
- package/dist/components/mg-input-text2.js +6 -6
- package/dist/components/mg-input-textarea.js +7 -7
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title2.js +2 -2
- package/dist/components/mg-input-toggle.js +4 -4
- package/dist/components/mg-item-more.js +2 -2
- package/dist/components/mg-loader.js +2 -2
- package/dist/components/mg-menu-item2.js +4 -4
- 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 +2 -2
- 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-4ad17402.js → index-ad78ece7.js} +1 -1
- package/dist/esm/{index-4ad17402.js.map → index-ad78ece7.js.map} +1 -1
- package/dist/esm/{index-d2fc6ec0.js → index-bb17de92.js} +31 -31
- package/dist/esm/index-bb17de92.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mg-action-more_34.entry.js +90 -90
- package/dist/esm/mg-action-more_34.entry.js.map +1 -1
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-item-more.entry.js +3 -3
- 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-568c9ea9.entry.js → p-2db8355d.entry.js} +2 -2
- package/dist/mg-components/p-95653110.entry.js +2 -0
- package/dist/mg-components/p-95653110.entry.js.map +1 -0
- package/dist/mg-components/{p-f761ebcd.js → p-bc62d75e.js} +1 -1
- package/dist/mg-components/{p-f761ebcd.js.map → p-bc62d75e.js.map} +1 -1
- package/dist/mg-components/{p-29b5a514.js → p-d41aa78b.js} +2 -2
- package/dist/mg-components/p-d41aa78b.js.map +1 -0
- package/dist/mg-components/{p-22f575c5.entry.js → p-d80b844d.entry.js} +2 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/ide/intellij/web-types.json +5810 -0
- package/ide/vscode/html-custom-data.json +5083 -0
- package/package.json +22 -15
- package/dist/cjs/index-f699ee11.js.map +0 -1
- package/dist/esm/index-d2fc6ec0.js.map +0 -1
- package/dist/mg-components/p-29b5a514.js.map +0 -1
- package/dist/mg-components/p-f99684db.entry.js +0 -2
- package/dist/mg-components/p-f99684db.entry.js.map +0 -1
- /package/dist/mg-components/{p-568c9ea9.entry.js.map → p-2db8355d.entry.js.map} +0 -0
- /package/dist/mg-components/{p-22f575c5.entry.js.map → p-d80b844d.entry.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { M as MgInput } from './MgInput.js';
|
|
3
|
-
import {
|
|
3
|
+
import { M as Me, O as Oe, B as Be } from './index.es.js';
|
|
4
4
|
import { d as defineCustomElement$5 } from './mg-icon2.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './mg-input-title2.js';
|
|
6
6
|
import { d as defineCustomElement$3 } from './mg-tooltip2.js';
|
|
@@ -90,7 +90,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
90
90
|
this.tooltip = undefined;
|
|
91
91
|
this.tooltipPosition = 'input';
|
|
92
92
|
this.helpText = undefined;
|
|
93
|
-
this.classCollection = new
|
|
93
|
+
this.classCollection = new Me(['mg-c-input--toggle']);
|
|
94
94
|
this.options = undefined;
|
|
95
95
|
this.errorMessage = undefined;
|
|
96
96
|
this.valid = undefined;
|
|
@@ -107,7 +107,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
107
107
|
throw new Error('<mg-input-toggle> prop "items" require 2 items.');
|
|
108
108
|
}
|
|
109
109
|
// String array
|
|
110
|
-
else if (
|
|
110
|
+
else if (Oe(newValue)) {
|
|
111
111
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
112
112
|
}
|
|
113
113
|
// Object array
|
|
@@ -157,7 +157,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
157
157
|
if (typeof valid !== 'boolean') {
|
|
158
158
|
throw new Error('<mg-input-toggle> method "setError()" param "valid" must be a boolean');
|
|
159
159
|
}
|
|
160
|
-
else if (!
|
|
160
|
+
else if (!Be(errorMessage)) {
|
|
161
161
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string');
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { i as initLocales } from './index2.js';
|
|
3
3
|
import { D as Direction } from './mg-menu.conf.js';
|
|
4
|
-
import {
|
|
4
|
+
import { B as Be } from './index.es.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './mg-badge2.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './mg-button2.js';
|
|
7
7
|
import { d as defineCustomElement$7 } from './mg-card2.js';
|
|
@@ -187,7 +187,7 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends H
|
|
|
187
187
|
navElement.click();
|
|
188
188
|
});
|
|
189
189
|
// add id suffix to prevent duplicate key. default html id is: '';
|
|
190
|
-
if (
|
|
190
|
+
if (Be(proxy.id))
|
|
191
191
|
proxy.id = `${proxy.id}-proxy`;
|
|
192
192
|
// manage status change miror in proxy
|
|
193
193
|
allMenuItem[index].addEventListener('status-change', (event) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { i as initLocales } from './index2.js';
|
|
3
|
-
import {
|
|
3
|
+
import { B as Be } from './index.es.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
5
5
|
|
|
6
6
|
const mgLoaderCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.4rem;text-align:center}";
|
|
@@ -15,7 +15,7 @@ const MgLoader$1 = /*@__PURE__*/ proxyCustomElement(class MgLoader extends HTMLE
|
|
|
15
15
|
this.messageHide = undefined;
|
|
16
16
|
}
|
|
17
17
|
watchMessage(newValue) {
|
|
18
|
-
if (newValue && !
|
|
18
|
+
if (newValue && !Be(newValue))
|
|
19
19
|
throw new Error('<mg-loader> prop "message" must be a valid string.');
|
|
20
20
|
}
|
|
21
21
|
/*************
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { B as Be, R as Re, M as Me } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { D as Direction } from './mg-menu.conf.js';
|
|
5
5
|
import { d as defineCustomElement$6 } from './mg-badge2.js';
|
|
@@ -95,7 +95,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
95
95
|
throw new Error(`<${this.name}> slot "label" is required.`);
|
|
96
96
|
['label', 'metadata'].forEach(slot => {
|
|
97
97
|
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
98
|
-
if (!
|
|
98
|
+
if (!Be(element.textContent))
|
|
99
99
|
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
100
100
|
if ((guard && element.getAttribute('title') === null) || !guard)
|
|
101
101
|
element.setAttribute('title', element.textContent);
|
|
@@ -164,12 +164,12 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
164
164
|
* @returns HTML Element
|
|
165
165
|
*/
|
|
166
166
|
this.renderSlot = () => h("slot", null);
|
|
167
|
-
this.identifier =
|
|
167
|
+
this.identifier = Re('mg-menu-item');
|
|
168
168
|
this.href = undefined;
|
|
169
169
|
this.status = Status.VISIBLE;
|
|
170
170
|
this.expanded = false;
|
|
171
171
|
this.size = 'regular';
|
|
172
|
-
this.navigationButtonClassList = new
|
|
172
|
+
this.navigationButtonClassList = new Me([this.navigationButton]);
|
|
173
173
|
this.direction = undefined;
|
|
174
174
|
this.isInMainMenu = undefined;
|
|
175
175
|
this.isItemMore = undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { R as Re, M as Me } 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 = Re('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 Me(['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 { D as De, R as Re, M as Me, B as Be } 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(De));
|
|
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(De) || 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 = Re('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 Me(['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 (!Be(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 { R as Re } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$6 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$5 } from './mg-icon2.js';
|
|
@@ -71,7 +71,7 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
71
71
|
this.handleGoToPage = (action, disabled) => {
|
|
72
72
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
73
73
|
};
|
|
74
|
-
this.identifier =
|
|
74
|
+
this.identifier = Re('mg-pagination');
|
|
75
75
|
this.label = undefined;
|
|
76
76
|
this.hideNavigationLabels = undefined;
|
|
77
77
|
this.hidePageCount = undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { R as Re, M as Me, B as Be } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$9 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$8 } from './mg-card2.js';
|
|
@@ -121,7 +121,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
121
121
|
];
|
|
122
122
|
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
123
123
|
};
|
|
124
|
-
this.identifier =
|
|
124
|
+
this.identifier = Re('mg-panel');
|
|
125
125
|
this.panelTitle = undefined;
|
|
126
126
|
this.titlePattern = undefined;
|
|
127
127
|
this.titlePatternErrorMessage = undefined;
|
|
@@ -130,12 +130,12 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
130
130
|
this.expanded = false;
|
|
131
131
|
this.expandToggleDisplay = expandToggleDisplays[0];
|
|
132
132
|
this.expandToggleDisabled = undefined;
|
|
133
|
-
this.classCollection = new
|
|
133
|
+
this.classCollection = new Me(['mg-c-panel']);
|
|
134
134
|
this.isEditing = false;
|
|
135
135
|
this.updatedPanelTitle = undefined;
|
|
136
136
|
}
|
|
137
137
|
validatePanelTitle(newValue) {
|
|
138
|
-
if (!
|
|
138
|
+
if (!Be(newValue))
|
|
139
139
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
140
140
|
this.titleChange.emit(newValue);
|
|
141
141
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { M as Me, F as Fe } 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 Me(['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 && !Fe(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 { R as Re, _ as _e } 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 = Re('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 = _e(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 { B as Be } 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 => !Be(link.href) || !link.href.startsWith('#') || !Be(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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { U as Ue, R as Re, M as Me, B as Be, O as Oe } 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
|
+
Ue(() => {
|
|
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 = Re('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 Me(['mg-c-tabs']);
|
|
154
154
|
}
|
|
155
155
|
validateLabel(newValue) {
|
|
156
|
-
if (!
|
|
156
|
+
if (!Be(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 (Oe(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 { M as Me, B as Be } 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 Me(['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 (!Be(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 { U as Ue, R as Re, B as Be, _ as _e, D as De } 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
|
|
|
@@ -33,7 +33,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
33
33
|
// Enable the event listeners
|
|
34
34
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
35
35
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
36
|
-
|
|
36
|
+
Ue(() => {
|
|
37
37
|
this.windows.forEach((localWindow) => {
|
|
38
38
|
localWindow.addEventListener('click', this.clickOutside, false);
|
|
39
39
|
localWindow.addEventListener('keydown', this.pressEscape, false);
|
|
@@ -198,7 +198,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
198
198
|
});
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
|
-
this.identifier =
|
|
201
|
+
this.identifier = Re('mg-tooltip');
|
|
202
202
|
this.message = undefined;
|
|
203
203
|
this.placement = 'bottom';
|
|
204
204
|
this.display = false;
|
|
@@ -209,7 +209,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
209
209
|
this.renderTooltipContent();
|
|
210
210
|
}
|
|
211
211
|
validateMessage(newValue) {
|
|
212
|
-
if (!
|
|
212
|
+
if (!Be(newValue)) {
|
|
213
213
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
214
214
|
}
|
|
215
215
|
this.mgTooltipContent.message = newValue;
|
|
@@ -258,7 +258,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
258
258
|
*/
|
|
259
259
|
componentWillLoad() {
|
|
260
260
|
// Get windows to attach events
|
|
261
|
-
this.windows =
|
|
261
|
+
this.windows = _e(window);
|
|
262
262
|
// Get tooltip element
|
|
263
263
|
this.renderTooltipContent();
|
|
264
264
|
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
@@ -277,7 +277,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
277
277
|
// get slotted element wich is not the tooltip
|
|
278
278
|
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
279
279
|
// Get interactive element
|
|
280
|
-
const interactiveElement = slotElement.matches(
|
|
280
|
+
const interactiveElement = slotElement.matches(De) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(De);
|
|
281
281
|
// define selected element to become tooltip selector
|
|
282
282
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
283
283
|
// Check if slotted element is a disabled mg-button
|
|
@@ -2493,4 +2493,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
|
2493
2493
|
|
|
2494
2494
|
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2495
2495
|
|
|
2496
|
-
//# sourceMappingURL=index-
|
|
2496
|
+
//# sourceMappingURL=index-ad78ece7.js.map
|