@mgdis/mg-components 5.25.2 → 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 +89 -89
- 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 +6 -6
- 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 +89 -89
- 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 +21 -14
- 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-57614d95.entry.js +0 -2
- package/dist/mg-components/p-57614d95.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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
5
|
+
const index = require('./index-0a2783ee.js');
|
|
6
|
+
const index$1 = require('./index-c585c382.js');
|
|
7
7
|
const mgMenu_conf = require('./mg-menu.conf-c291eee6.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -63,7 +63,7 @@ const MgActionMore = class {
|
|
|
63
63
|
************/
|
|
64
64
|
this.name = 'mg-action-more';
|
|
65
65
|
this.classBase = 'mg-c-action-more';
|
|
66
|
-
this.mgPopoverIdentifier = index$1.
|
|
66
|
+
this.mgPopoverIdentifier = index$1.Re(this.name);
|
|
67
67
|
/************
|
|
68
68
|
* Methods *
|
|
69
69
|
***********/
|
|
@@ -187,7 +187,7 @@ const MgBadge = class {
|
|
|
187
187
|
this.label = undefined;
|
|
188
188
|
this.variant = variants$5[0];
|
|
189
189
|
this.outline = undefined;
|
|
190
|
-
this.classCollection = new index$1.
|
|
190
|
+
this.classCollection = new index$1.Me(['mg-c-badge']);
|
|
191
191
|
}
|
|
192
192
|
validateValue(newValue) {
|
|
193
193
|
if (/^(\d+\+*|[?*!a-z])$/i.exec(`${newValue}`) === null) {
|
|
@@ -195,7 +195,7 @@ const MgBadge = class {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
validateLabel(newValue) {
|
|
198
|
-
if (!index$1.
|
|
198
|
+
if (!index$1.Be(newValue)) {
|
|
199
199
|
throw new Error('<mg-badge> prop "label" is required.');
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -230,7 +230,7 @@ const MgBadge = class {
|
|
|
230
230
|
* @returns HTML Element
|
|
231
231
|
*/
|
|
232
232
|
render() {
|
|
233
|
-
return (index.h("span", { key: '
|
|
233
|
+
return (index.h("span", { key: 'f6f1baa91f4a9e55af711f0a84eaca74b97962b3', class: this.classCollection.join() }, index.h("span", { key: '9c61217b74129839f600617d5e6e6bc7a2863667', class: "mg-c-badge__value" }, this.value), index.h("span", { key: '2fd7529d5d9a9b32da2c4a80a70a09396ffb9100', class: "mg-u-visually-hidden" }, this.label)));
|
|
234
234
|
}
|
|
235
235
|
static get watchers() { return {
|
|
236
236
|
"value": ["validateValue"],
|
|
@@ -306,7 +306,7 @@ const MgButton = class {
|
|
|
306
306
|
this.isIcon = false;
|
|
307
307
|
this.disableOnClick = false;
|
|
308
308
|
this.loading = false;
|
|
309
|
-
this.classCollection = new index$1.
|
|
309
|
+
this.classCollection = new index$1.Me(['mg-c-button']);
|
|
310
310
|
}
|
|
311
311
|
validateVariant(newValue, oldValue) {
|
|
312
312
|
if (!variants$4.includes(newValue)) {
|
|
@@ -365,7 +365,7 @@ const MgButton = class {
|
|
|
365
365
|
this.validateFullWidth(this.fullWidth);
|
|
366
366
|
if (this.isIcon) {
|
|
367
367
|
this.classCollection.add(`mg-c-button--icon`);
|
|
368
|
-
if (!index$1.
|
|
368
|
+
if (!index$1.Be(this.label)) {
|
|
369
369
|
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
@@ -377,7 +377,7 @@ const MgButton = class {
|
|
|
377
377
|
* Add listners
|
|
378
378
|
*/
|
|
379
379
|
componentDidLoad() {
|
|
380
|
-
index$1.
|
|
380
|
+
index$1.Ue(() => {
|
|
381
381
|
var _a;
|
|
382
382
|
const closestForm = this.element.closest('form') || ((_a = this.element.closest('mg-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('form'));
|
|
383
383
|
// submit buttons should trigger form submition;
|
|
@@ -436,7 +436,7 @@ const MgCard = class {
|
|
|
436
436
|
};
|
|
437
437
|
this.variant = undefined;
|
|
438
438
|
this.variantStyle = undefined;
|
|
439
|
-
this.classCollection = new index$1.
|
|
439
|
+
this.classCollection = new index$1.Me([this.classBase]);
|
|
440
440
|
}
|
|
441
441
|
validateVariant(newValue, oldValue) {
|
|
442
442
|
if (newValue && !variants$3.includes(newValue))
|
|
@@ -541,7 +541,7 @@ const MgDetails = class {
|
|
|
541
541
|
this.expanded = false;
|
|
542
542
|
}
|
|
543
543
|
validateTitles(newValue) {
|
|
544
|
-
if (!index$1.
|
|
544
|
+
if (!index$1.Be(newValue)) {
|
|
545
545
|
throw new Error('<mg-details> prop "toggleClosed" and "toggleOpened" must be defined.');
|
|
546
546
|
}
|
|
547
547
|
}
|
|
@@ -699,7 +699,7 @@ const MgForm = class {
|
|
|
699
699
|
}
|
|
700
700
|
});
|
|
701
701
|
};
|
|
702
|
-
this.identifier = index$1.
|
|
702
|
+
this.identifier = index$1.Re('mg-form');
|
|
703
703
|
this.name = this.identifier;
|
|
704
704
|
this.readonly = false;
|
|
705
705
|
this.requiredMessage = undefined;
|
|
@@ -708,7 +708,7 @@ const MgForm = class {
|
|
|
708
708
|
this.disabled = false;
|
|
709
709
|
this.valid = undefined;
|
|
710
710
|
this.invalid = undefined;
|
|
711
|
-
this.classCollection = new index$1.
|
|
711
|
+
this.classCollection = new index$1.Me(['mg-c-form']);
|
|
712
712
|
this.requiredMessageText = undefined;
|
|
713
713
|
}
|
|
714
714
|
validateRequiredMessage(newValue) {
|
|
@@ -1261,7 +1261,7 @@ const MgIcon = class {
|
|
|
1261
1261
|
this.variant = undefined;
|
|
1262
1262
|
this.variantStyle = undefined;
|
|
1263
1263
|
this.spin = false;
|
|
1264
|
-
this.classCollection = new index$1.
|
|
1264
|
+
this.classCollection = new index$1.Me(['mg-c-icon']);
|
|
1265
1265
|
}
|
|
1266
1266
|
validateIcon(newValue, oldValue) {
|
|
1267
1267
|
if (!iconList.includes(newValue))
|
|
@@ -1360,7 +1360,7 @@ const MgIllustratedMessage = class {
|
|
|
1360
1360
|
componentDidLoad() {
|
|
1361
1361
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
1362
1362
|
const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
|
|
1363
|
-
if (!index$1.
|
|
1363
|
+
if (!index$1.Fe(this.element.querySelector('[slot="title"]'), headingTags)) {
|
|
1364
1364
|
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
1365
1365
|
}
|
|
1366
1366
|
else if (slottedIllustrations.length !== 1) {
|
|
@@ -1440,10 +1440,10 @@ const manageClasses = (props) => {
|
|
|
1440
1440
|
* @param props - MgInput Interface Props
|
|
1441
1441
|
*/
|
|
1442
1442
|
const checkPropsConfig = (props) => {
|
|
1443
|
-
if (!index$1.
|
|
1443
|
+
if (!index$1.Be(props.identifier)) {
|
|
1444
1444
|
throw new Error('<mg-input> prop "identifier" is required.');
|
|
1445
1445
|
}
|
|
1446
|
-
if (!index$1.
|
|
1446
|
+
if (!index$1.Be(props.label)) {
|
|
1447
1447
|
throw new Error('<mg-input> prop "label" is required.');
|
|
1448
1448
|
}
|
|
1449
1449
|
if (props.labelOnTop && props.labelHide) {
|
|
@@ -1720,7 +1720,7 @@ const MgInputCheckbox = class {
|
|
|
1720
1720
|
* Method to update searchResults
|
|
1721
1721
|
*/
|
|
1722
1722
|
this.updateSearchResults = () => {
|
|
1723
|
-
this.searchResults = this.checkboxItems.filter(item => index$1.
|
|
1723
|
+
this.searchResults = this.checkboxItems.filter(item => index$1.Ne(item.title).includes(index$1.Ne(this.searchValue)));
|
|
1724
1724
|
};
|
|
1725
1725
|
/**
|
|
1726
1726
|
* Methode to validate if one of inputs value is checked id required
|
|
@@ -1794,7 +1794,7 @@ const MgInputCheckbox = class {
|
|
|
1794
1794
|
this.helpText = undefined;
|
|
1795
1795
|
this.valid = undefined;
|
|
1796
1796
|
this.invalid = undefined;
|
|
1797
|
-
this.classCollection = new index$1.
|
|
1797
|
+
this.classCollection = new index$1.Me([this.baseClassName]);
|
|
1798
1798
|
this.errorMessage = undefined;
|
|
1799
1799
|
this.checkboxItems = [];
|
|
1800
1800
|
this.displaySearchInput = undefined;
|
|
@@ -1881,7 +1881,7 @@ const MgInputCheckbox = class {
|
|
|
1881
1881
|
if (typeof valid !== 'boolean') {
|
|
1882
1882
|
throw new Error('<mg-input-checkbox> method "setError()" param "valid" must be a boolean');
|
|
1883
1883
|
}
|
|
1884
|
-
else if (!index$1.
|
|
1884
|
+
else if (!index$1.Be(errorMessage)) {
|
|
1885
1885
|
throw new Error('<mg-input-checkbox> method "setError()" param "errorMessage" must be a string');
|
|
1886
1886
|
}
|
|
1887
1887
|
else {
|
|
@@ -2146,10 +2146,10 @@ const MgInputDate = class {
|
|
|
2146
2146
|
*/
|
|
2147
2147
|
this.formatHelpText = (helpText) => {
|
|
2148
2148
|
const defaultHelpTextVariable = '{defaultHelpText}';
|
|
2149
|
-
let text = index$1.
|
|
2149
|
+
let text = index$1.Be(helpText) ? helpText : this.messages.input.date.helpText;
|
|
2150
2150
|
if (text.includes(defaultHelpTextVariable))
|
|
2151
2151
|
text = text.replace(defaultHelpTextVariable, this.formatHelpText(this.messages.input.date.helpText));
|
|
2152
|
-
return text.replace('{pattern}', this.renderPattern()).replace('{date}', index$1.
|
|
2152
|
+
return text.replace('{pattern}', this.renderPattern()).replace('{date}', index$1.ge(index$1.We(new Date('2023-12-24')), this.systemLocale));
|
|
2153
2153
|
};
|
|
2154
2154
|
/**
|
|
2155
2155
|
* Handle input event
|
|
@@ -2222,8 +2222,8 @@ const MgInputDate = class {
|
|
|
2222
2222
|
// min, max & minMax
|
|
2223
2223
|
else if ([InputError$1.MIN, InputError$1.MAX, InputError$1.MINMAX].includes(inputError)) {
|
|
2224
2224
|
this.errorMessage = this.messages.errors.date[inputError]
|
|
2225
|
-
.replace('{min}', index$1.
|
|
2226
|
-
.replace('{max}', index$1.
|
|
2225
|
+
.replace('{min}', index$1.ge(this.min, this.systemLocale))
|
|
2226
|
+
.replace('{max}', index$1.ge(this.max, this.systemLocale));
|
|
2227
2227
|
}
|
|
2228
2228
|
// wrong date format
|
|
2229
2229
|
// element.validity.badInput is default error message
|
|
@@ -2237,7 +2237,7 @@ const MgInputDate = class {
|
|
|
2237
2237
|
* @returns translated html pattern
|
|
2238
2238
|
*/
|
|
2239
2239
|
this.renderPattern = () => {
|
|
2240
|
-
let patternLocal = index$1.
|
|
2240
|
+
let patternLocal = index$1.Pe(this.systemLocale);
|
|
2241
2241
|
for (const key in this.messages.input.date.pattern) {
|
|
2242
2242
|
patternLocal = patternLocal.replace(key, this.messages.input.date.pattern[key]);
|
|
2243
2243
|
}
|
|
@@ -2259,14 +2259,14 @@ const MgInputDate = class {
|
|
|
2259
2259
|
this.helpText = undefined;
|
|
2260
2260
|
this.valid = undefined;
|
|
2261
2261
|
this.invalid = undefined;
|
|
2262
|
-
this.classCollection = new index$1.
|
|
2262
|
+
this.classCollection = new index$1.Me(['mg-c-input--date']);
|
|
2263
2263
|
this.errorMessage = undefined;
|
|
2264
2264
|
}
|
|
2265
2265
|
validateValue(newValue) {
|
|
2266
2266
|
// When the input is not fully completed or has been cleared, the value becomes an empty string.
|
|
2267
2267
|
if (newValue === '')
|
|
2268
2268
|
newValue = null;
|
|
2269
|
-
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !index$1.
|
|
2269
|
+
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !index$1.de.test(newValue))) {
|
|
2270
2270
|
throw new Error("<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd");
|
|
2271
2271
|
}
|
|
2272
2272
|
else {
|
|
@@ -2274,7 +2274,7 @@ const MgInputDate = class {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
2276
|
validateMinMax(newValue) {
|
|
2277
|
-
if ((newValue === null || newValue === void 0 ? void 0 : newValue.length) === 0 || ((newValue === null || newValue === void 0 ? void 0 : newValue.length) > 0 && !(typeof newValue === 'string' && index$1.
|
|
2277
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.length) === 0 || ((newValue === null || newValue === void 0 ? void 0 : newValue.length) > 0 && !(typeof newValue === 'string' && index$1.de.test(newValue)))) {
|
|
2278
2278
|
throw new Error("<mg-input-date> props 'min/max' doesn't match pattern: yyyy-mm-dd");
|
|
2279
2279
|
}
|
|
2280
2280
|
}
|
|
@@ -2308,7 +2308,7 @@ const MgInputDate = class {
|
|
|
2308
2308
|
if (typeof valid !== 'boolean') {
|
|
2309
2309
|
throw new Error('<mg-input-date> method "setError()" param "valid" must be a boolean');
|
|
2310
2310
|
}
|
|
2311
|
-
else if (!index$1.
|
|
2311
|
+
else if (!index$1.Be(errorMessage)) {
|
|
2312
2312
|
throw new Error('<mg-input-date> method "setError()" param "errorMessage" must be a string');
|
|
2313
2313
|
}
|
|
2314
2314
|
else {
|
|
@@ -2360,7 +2360,7 @@ const MgInputDate = class {
|
|
|
2360
2360
|
* @returns HTML Element
|
|
2361
2361
|
*/
|
|
2362
2362
|
render() {
|
|
2363
|
-
return (index.h(MgInput, { key: 'd6e63d2f60d8c1b977181b35ad1c5393ebbf9f2d', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: index$1.
|
|
2363
|
+
return (index.h(MgInput, { key: 'd6e63d2f60d8c1b977181b35ad1c5393ebbf9f2d', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: index$1.ge(this.value, this.locale), tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage, isFieldset: false }, index.h("input", { key: 'd94cfb21684af81db4dc3fc3ba1cc1fdfdaa2793', type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
2364
2364
|
if (el !== null)
|
|
2365
2365
|
this.input = el;
|
|
2366
2366
|
} })));
|
|
@@ -2493,9 +2493,9 @@ const MgInputNumeric = class {
|
|
|
2493
2493
|
this.formatValue = (value) => {
|
|
2494
2494
|
switch (this.format) {
|
|
2495
2495
|
case 'number':
|
|
2496
|
-
return index$1.
|
|
2496
|
+
return index$1.qe(value, this.locale);
|
|
2497
2497
|
case 'currency':
|
|
2498
|
-
return index$1.
|
|
2498
|
+
return index$1.ze(value, this.locale, this.currency);
|
|
2499
2499
|
case 'none':
|
|
2500
2500
|
return value.toString();
|
|
2501
2501
|
}
|
|
@@ -2532,7 +2532,7 @@ const MgInputNumeric = class {
|
|
|
2532
2532
|
this.decimalLength = 2;
|
|
2533
2533
|
this.valid = undefined;
|
|
2534
2534
|
this.invalid = undefined;
|
|
2535
|
-
this.classCollection = new index$1.
|
|
2535
|
+
this.classCollection = new index$1.Me(['mg-c-input--numeric']);
|
|
2536
2536
|
this.errorMessage = undefined;
|
|
2537
2537
|
this.hasFocus = undefined;
|
|
2538
2538
|
}
|
|
@@ -2607,7 +2607,7 @@ const MgInputNumeric = class {
|
|
|
2607
2607
|
if (typeof valid !== 'boolean') {
|
|
2608
2608
|
throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
|
|
2609
2609
|
}
|
|
2610
|
-
else if (!index$1.
|
|
2610
|
+
else if (!index$1.Be(errorMessage)) {
|
|
2611
2611
|
throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
|
|
2612
2612
|
}
|
|
2613
2613
|
else {
|
|
@@ -2790,7 +2790,7 @@ const MgInputPassword = class {
|
|
|
2790
2790
|
this.helpText = undefined;
|
|
2791
2791
|
this.valid = undefined;
|
|
2792
2792
|
this.invalid = undefined;
|
|
2793
|
-
this.classCollection = new index$1.
|
|
2793
|
+
this.classCollection = new index$1.Me(['mg-c-input--password']);
|
|
2794
2794
|
this.errorMessage = undefined;
|
|
2795
2795
|
}
|
|
2796
2796
|
handleValue(newValue) {
|
|
@@ -2826,7 +2826,7 @@ const MgInputPassword = class {
|
|
|
2826
2826
|
if (typeof valid !== 'boolean') {
|
|
2827
2827
|
throw new Error('<mg-input-password> method "setError()" param "valid" must be a boolean');
|
|
2828
2828
|
}
|
|
2829
|
-
else if (!index$1.
|
|
2829
|
+
else if (!index$1.Be(errorMessage)) {
|
|
2830
2830
|
throw new Error('<mg-input-password> method "setError()" param "errorMessage" must be a string');
|
|
2831
2831
|
}
|
|
2832
2832
|
else {
|
|
@@ -2967,7 +2967,7 @@ const MgInputRadio = class {
|
|
|
2967
2967
|
this.helpText = undefined;
|
|
2968
2968
|
this.valid = undefined;
|
|
2969
2969
|
this.invalid = undefined;
|
|
2970
|
-
this.classCollection = new index$1.
|
|
2970
|
+
this.classCollection = new index$1.Me(['mg-c-input--radio']);
|
|
2971
2971
|
this.errorMessage = undefined;
|
|
2972
2972
|
this.options = undefined;
|
|
2973
2973
|
}
|
|
@@ -2980,7 +2980,7 @@ const MgInputRadio = class {
|
|
|
2980
2980
|
throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
|
|
2981
2981
|
}
|
|
2982
2982
|
// String array
|
|
2983
|
-
else if (index$1.
|
|
2983
|
+
else if (index$1.Oe(newValue)) {
|
|
2984
2984
|
this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
|
|
2985
2985
|
}
|
|
2986
2986
|
// Object array
|
|
@@ -3021,7 +3021,7 @@ const MgInputRadio = class {
|
|
|
3021
3021
|
if (typeof valid !== 'boolean') {
|
|
3022
3022
|
throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
|
|
3023
3023
|
}
|
|
3024
|
-
else if (!index$1.
|
|
3024
|
+
else if (!index$1.Be(errorMessage)) {
|
|
3025
3025
|
throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
|
|
3026
3026
|
}
|
|
3027
3027
|
else {
|
|
@@ -3163,7 +3163,7 @@ const MgInputSelect = class {
|
|
|
3163
3163
|
if (this.input.value === '') {
|
|
3164
3164
|
this.setValue(null);
|
|
3165
3165
|
}
|
|
3166
|
-
else if (index$1.
|
|
3166
|
+
else if (index$1.Oe(this.items) && this.items.includes(this.input.value)) {
|
|
3167
3167
|
this.setValue(this.input.value);
|
|
3168
3168
|
}
|
|
3169
3169
|
else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
|
|
@@ -3238,7 +3238,7 @@ const MgInputSelect = class {
|
|
|
3238
3238
|
this.helpText = undefined;
|
|
3239
3239
|
this.valid = undefined;
|
|
3240
3240
|
this.invalid = undefined;
|
|
3241
|
-
this.classCollection = new index$1.
|
|
3241
|
+
this.classCollection = new index$1.Me(['mg-c-input--select']);
|
|
3242
3242
|
this.errorMessage = undefined;
|
|
3243
3243
|
this.options = undefined;
|
|
3244
3244
|
this.valueExist = undefined;
|
|
@@ -3246,7 +3246,7 @@ const MgInputSelect = class {
|
|
|
3246
3246
|
}
|
|
3247
3247
|
validateValue(newValue) {
|
|
3248
3248
|
var _a, _b;
|
|
3249
|
-
if (index$1.
|
|
3249
|
+
if (index$1.Oe(this.items) && typeof newValue === 'string') {
|
|
3250
3250
|
this.readonlyValue = ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) ? this.input.value : newValue;
|
|
3251
3251
|
}
|
|
3252
3252
|
else if (allItemsAreOptions(this.items)) {
|
|
@@ -3263,7 +3263,7 @@ const MgInputSelect = class {
|
|
|
3263
3263
|
this.options = [];
|
|
3264
3264
|
}
|
|
3265
3265
|
// String array
|
|
3266
|
-
else if (index$1.
|
|
3266
|
+
else if (index$1.Oe(newValue)) {
|
|
3267
3267
|
if (typeof this.value === 'string')
|
|
3268
3268
|
this.valueExist = newValue.includes(this.value);
|
|
3269
3269
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
@@ -3314,7 +3314,7 @@ const MgInputSelect = class {
|
|
|
3314
3314
|
if (typeof valid !== 'boolean') {
|
|
3315
3315
|
throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean');
|
|
3316
3316
|
}
|
|
3317
|
-
else if (!index$1.
|
|
3317
|
+
else if (!index$1.Be(errorMessage)) {
|
|
3318
3318
|
throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string');
|
|
3319
3319
|
}
|
|
3320
3320
|
else {
|
|
@@ -3414,7 +3414,7 @@ const MgInputText = class {
|
|
|
3414
3414
|
*/
|
|
3415
3415
|
this.handleFocus = () => {
|
|
3416
3416
|
this.classCollection.add(this.classFocus);
|
|
3417
|
-
this.classCollection = new index$1.
|
|
3417
|
+
this.classCollection = new index$1.Me(this.classCollection.classes);
|
|
3418
3418
|
};
|
|
3419
3419
|
/**
|
|
3420
3420
|
* Handle blur event
|
|
@@ -3422,7 +3422,7 @@ const MgInputText = class {
|
|
|
3422
3422
|
this.handleBlur = () => {
|
|
3423
3423
|
// Manage focus
|
|
3424
3424
|
this.classCollection.delete(this.classFocus);
|
|
3425
|
-
this.classCollection = new index$1.
|
|
3425
|
+
this.classCollection = new index$1.Me(this.classCollection.classes);
|
|
3426
3426
|
// Display Error
|
|
3427
3427
|
this.handlerInProgress = Handler.BLUR;
|
|
3428
3428
|
this.displayError().finally(() => {
|
|
@@ -3498,7 +3498,7 @@ const MgInputText = class {
|
|
|
3498
3498
|
this.helpText = undefined;
|
|
3499
3499
|
this.valid = undefined;
|
|
3500
3500
|
this.invalid = undefined;
|
|
3501
|
-
this.classCollection = new index$1.
|
|
3501
|
+
this.classCollection = new index$1.Me(['mg-c-input--text']);
|
|
3502
3502
|
this.errorMessage = undefined;
|
|
3503
3503
|
}
|
|
3504
3504
|
handleValue(newValue) {
|
|
@@ -3528,7 +3528,7 @@ const MgInputText = class {
|
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
3530
|
validatePattern(newValue) {
|
|
3531
|
-
if (newValue !== undefined && !(index$1.
|
|
3531
|
+
if (newValue !== undefined && !(index$1.Be(this.pattern) && index$1.Be(this.patternErrorMessage))) {
|
|
3532
3532
|
throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3533
3533
|
}
|
|
3534
3534
|
}
|
|
@@ -3558,7 +3558,7 @@ const MgInputText = class {
|
|
|
3558
3558
|
if (typeof valid !== 'boolean') {
|
|
3559
3559
|
throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
|
|
3560
3560
|
}
|
|
3561
|
-
else if (!index$1.
|
|
3561
|
+
else if (!index$1.Be(errorMessage)) {
|
|
3562
3562
|
throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
|
|
3563
3563
|
}
|
|
3564
3564
|
else {
|
|
@@ -3663,7 +3663,7 @@ const MgInputTextarea = class {
|
|
|
3663
3663
|
*/
|
|
3664
3664
|
this.handleFocus = () => {
|
|
3665
3665
|
this.classCollection.add(this.classFocus);
|
|
3666
|
-
this.classCollection = new index$1.
|
|
3666
|
+
this.classCollection = new index$1.Me(this.classCollection.classes);
|
|
3667
3667
|
};
|
|
3668
3668
|
/**
|
|
3669
3669
|
* Handle blur event
|
|
@@ -3671,7 +3671,7 @@ const MgInputTextarea = class {
|
|
|
3671
3671
|
this.handleBlur = () => {
|
|
3672
3672
|
// Manage focus
|
|
3673
3673
|
this.classCollection.delete(this.classFocus);
|
|
3674
|
-
this.classCollection = new index$1.
|
|
3674
|
+
this.classCollection = new index$1.Me(this.classCollection.classes);
|
|
3675
3675
|
// Display Error
|
|
3676
3676
|
this.handlerInProgress = Handler.BLUR;
|
|
3677
3677
|
this.displayError().finally(() => {
|
|
@@ -3735,7 +3735,7 @@ const MgInputTextarea = class {
|
|
|
3735
3735
|
this.valid = undefined;
|
|
3736
3736
|
this.invalid = undefined;
|
|
3737
3737
|
this.resizable = 'none';
|
|
3738
|
-
this.classCollection = new index$1.
|
|
3738
|
+
this.classCollection = new index$1.Me(['mg-c-input--textarea']);
|
|
3739
3739
|
this.errorMessage = undefined;
|
|
3740
3740
|
}
|
|
3741
3741
|
handleValue(newValue) {
|
|
@@ -3753,7 +3753,7 @@ const MgInputTextarea = class {
|
|
|
3753
3753
|
}
|
|
3754
3754
|
}
|
|
3755
3755
|
validatePattern(newValue) {
|
|
3756
|
-
if (newValue !== undefined && !(index$1.
|
|
3756
|
+
if (newValue !== undefined && !(index$1.Be(this.pattern) && index$1.Be(this.patternErrorMessage))) {
|
|
3757
3757
|
throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3758
3758
|
}
|
|
3759
3759
|
}
|
|
@@ -3785,7 +3785,7 @@ const MgInputTextarea = class {
|
|
|
3785
3785
|
if (typeof valid !== 'boolean') {
|
|
3786
3786
|
throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
|
|
3787
3787
|
}
|
|
3788
|
-
else if (!index$1.
|
|
3788
|
+
else if (!index$1.Be(errorMessage)) {
|
|
3789
3789
|
throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
|
|
3790
3790
|
}
|
|
3791
3791
|
else {
|
|
@@ -3869,7 +3869,7 @@ const MgInputTitle = class {
|
|
|
3869
3869
|
this.tagName = 'label';
|
|
3870
3870
|
}
|
|
3871
3871
|
validateIdentifier(newValue) {
|
|
3872
|
-
if (!index$1.
|
|
3872
|
+
if (!index$1.Be(newValue)) {
|
|
3873
3873
|
throw new Error('<mg-input-title> prop "identifier" is required.');
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
@@ -3984,7 +3984,7 @@ const MgInputToggle = class {
|
|
|
3984
3984
|
this.tooltip = undefined;
|
|
3985
3985
|
this.tooltipPosition = 'input';
|
|
3986
3986
|
this.helpText = undefined;
|
|
3987
|
-
this.classCollection = new index$1.
|
|
3987
|
+
this.classCollection = new index$1.Me(['mg-c-input--toggle']);
|
|
3988
3988
|
this.options = undefined;
|
|
3989
3989
|
this.errorMessage = undefined;
|
|
3990
3990
|
this.valid = undefined;
|
|
@@ -4001,7 +4001,7 @@ const MgInputToggle = class {
|
|
|
4001
4001
|
throw new Error('<mg-input-toggle> prop "items" require 2 items.');
|
|
4002
4002
|
}
|
|
4003
4003
|
// String array
|
|
4004
|
-
else if (index$1.
|
|
4004
|
+
else if (index$1.Oe(newValue)) {
|
|
4005
4005
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
4006
4006
|
}
|
|
4007
4007
|
// Object array
|
|
@@ -4051,7 +4051,7 @@ const MgInputToggle = class {
|
|
|
4051
4051
|
if (typeof valid !== 'boolean') {
|
|
4052
4052
|
throw new Error('<mg-input-toggle> method "setError()" param "valid" must be a boolean');
|
|
4053
4053
|
}
|
|
4054
|
-
else if (!index$1.
|
|
4054
|
+
else if (!index$1.Be(errorMessage)) {
|
|
4055
4055
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string');
|
|
4056
4056
|
}
|
|
4057
4057
|
else {
|
|
@@ -4354,7 +4354,7 @@ const MgMenuItem = class {
|
|
|
4354
4354
|
throw new Error(`<${this.name}> slot "label" is required.`);
|
|
4355
4355
|
['label', 'metadata'].forEach(slot => {
|
|
4356
4356
|
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
4357
|
-
if (!index$1.
|
|
4357
|
+
if (!index$1.Be(element.textContent))
|
|
4358
4358
|
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
4359
4359
|
if ((guard && element.getAttribute('title') === null) || !guard)
|
|
4360
4360
|
element.setAttribute('title', element.textContent);
|
|
@@ -4423,12 +4423,12 @@ const MgMenuItem = class {
|
|
|
4423
4423
|
* @returns HTML Element
|
|
4424
4424
|
*/
|
|
4425
4425
|
this.renderSlot = () => index.h("slot", null);
|
|
4426
|
-
this.identifier = index$1.
|
|
4426
|
+
this.identifier = index$1.Re('mg-menu-item');
|
|
4427
4427
|
this.href = undefined;
|
|
4428
4428
|
this.status = Status$1.VISIBLE;
|
|
4429
4429
|
this.expanded = false;
|
|
4430
4430
|
this.size = 'regular';
|
|
4431
|
-
this.navigationButtonClassList = new index$1.
|
|
4431
|
+
this.navigationButtonClassList = new index$1.Me([this.navigationButton]);
|
|
4432
4432
|
this.direction = undefined;
|
|
4433
4433
|
this.isInMainMenu = undefined;
|
|
4434
4434
|
this.isItemMore = undefined;
|
|
@@ -4662,13 +4662,13 @@ const MgMessage = class {
|
|
|
4662
4662
|
return 'exclamation-circle';
|
|
4663
4663
|
}
|
|
4664
4664
|
};
|
|
4665
|
-
this.identifier = index$1.
|
|
4665
|
+
this.identifier = index$1.Re('mg-message');
|
|
4666
4666
|
this.delay = undefined;
|
|
4667
4667
|
this.variant = variants$1[0];
|
|
4668
4668
|
this.closeButton = false;
|
|
4669
4669
|
this.hide = false;
|
|
4670
4670
|
this.noAriaRole = undefined;
|
|
4671
|
-
this.classCollection = new index$1.
|
|
4671
|
+
this.classCollection = new index$1.Me(['mg-c-message']);
|
|
4672
4672
|
this.hasActions = false;
|
|
4673
4673
|
}
|
|
4674
4674
|
validateDelay(newValue) {
|
|
@@ -4811,12 +4811,12 @@ const MgModal = class {
|
|
|
4811
4811
|
*/
|
|
4812
4812
|
this.setFocus = () => {
|
|
4813
4813
|
// Get all focusable elements
|
|
4814
|
-
const slottedFocusableElements = Array.from(this.element.querySelectorAll(index$1.
|
|
4814
|
+
const slottedFocusableElements = Array.from(this.element.querySelectorAll(index$1.De));
|
|
4815
4815
|
// If close button is enabled or at least one of the slotted element is focusable
|
|
4816
4816
|
if (this.closeButton || slottedFocusableElements.length > 0) {
|
|
4817
4817
|
// Check if slotted focusable elements have shadowDom with focusable elements
|
|
4818
4818
|
this.modalFocusableElements = slottedFocusableElements.reduce((acc, focusableElement) => {
|
|
4819
|
-
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(index$1.
|
|
4819
|
+
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(index$1.De) || focusableElement : focusableElement);
|
|
4820
4820
|
return acc;
|
|
4821
4821
|
}, []);
|
|
4822
4822
|
// When close button is enabled it's the first focusable element.
|
|
@@ -4838,21 +4838,21 @@ const MgModal = class {
|
|
|
4838
4838
|
this.handleClose = () => {
|
|
4839
4839
|
this.hide = true;
|
|
4840
4840
|
};
|
|
4841
|
-
this.identifier = index$1.
|
|
4841
|
+
this.identifier = index$1.Re('mg-modal');
|
|
4842
4842
|
this.dialogRole = dialogRoles[0];
|
|
4843
4843
|
this.modalTitle = undefined;
|
|
4844
4844
|
this.closeButton = false;
|
|
4845
4845
|
this.hide = undefined;
|
|
4846
4846
|
this.hasActions = false;
|
|
4847
4847
|
this.hasContent = false;
|
|
4848
|
-
this.classCollection = new index$1.
|
|
4848
|
+
this.classCollection = new index$1.Me(['mg-c-modal']);
|
|
4849
4849
|
}
|
|
4850
4850
|
validateDialogRole(newValue) {
|
|
4851
4851
|
if (!dialogRoles.includes(newValue))
|
|
4852
4852
|
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}.`);
|
|
4853
4853
|
}
|
|
4854
4854
|
validateModalTitle(newValue) {
|
|
4855
|
-
if (!index$1.
|
|
4855
|
+
if (!index$1.Be(newValue)) {
|
|
4856
4856
|
throw new Error('<mg-modal> prop "modalTitle" is required.');
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
@@ -4999,7 +4999,7 @@ const MgPagination = class {
|
|
|
4999
4999
|
this.handleGoToPage = (action, disabled) => {
|
|
5000
5000
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
5001
5001
|
};
|
|
5002
|
-
this.identifier = index$1.
|
|
5002
|
+
this.identifier = index$1.Re('mg-pagination');
|
|
5003
5003
|
this.label = undefined;
|
|
5004
5004
|
this.hideNavigationLabels = undefined;
|
|
5005
5005
|
this.hidePageCount = undefined;
|
|
@@ -5164,7 +5164,7 @@ const MgPanel = class {
|
|
|
5164
5164
|
];
|
|
5165
5165
|
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
5166
5166
|
};
|
|
5167
|
-
this.identifier = index$1.
|
|
5167
|
+
this.identifier = index$1.Re('mg-panel');
|
|
5168
5168
|
this.panelTitle = undefined;
|
|
5169
5169
|
this.titlePattern = undefined;
|
|
5170
5170
|
this.titlePatternErrorMessage = undefined;
|
|
@@ -5173,12 +5173,12 @@ const MgPanel = class {
|
|
|
5173
5173
|
this.expanded = false;
|
|
5174
5174
|
this.expandToggleDisplay = expandToggleDisplays[0];
|
|
5175
5175
|
this.expandToggleDisabled = undefined;
|
|
5176
|
-
this.classCollection = new index$1.
|
|
5176
|
+
this.classCollection = new index$1.Me(['mg-c-panel']);
|
|
5177
5177
|
this.isEditing = false;
|
|
5178
5178
|
this.updatedPanelTitle = undefined;
|
|
5179
5179
|
}
|
|
5180
5180
|
validatePanelTitle(newValue) {
|
|
5181
|
-
if (!index$1.
|
|
5181
|
+
if (!index$1.Be(newValue))
|
|
5182
5182
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
5183
5183
|
this.titleChange.emit(newValue);
|
|
5184
5184
|
}
|
|
@@ -7129,7 +7129,7 @@ const MgPopover = class {
|
|
|
7129
7129
|
mgPopoverContent.setAttribute('id', this.identifier);
|
|
7130
7130
|
}
|
|
7131
7131
|
};
|
|
7132
|
-
this.identifier = index$1.
|
|
7132
|
+
this.identifier = index$1.Re('mg-popover');
|
|
7133
7133
|
this.placement = 'bottom';
|
|
7134
7134
|
this.arrowHide = false;
|
|
7135
7135
|
this.closeButton = false;
|
|
@@ -7172,7 +7172,7 @@ const MgPopover = class {
|
|
|
7172
7172
|
*/
|
|
7173
7173
|
componentWillLoad() {
|
|
7174
7174
|
// Get windows to attach events
|
|
7175
|
-
this.windows = index$1.
|
|
7175
|
+
this.windows = index$1._e(window);
|
|
7176
7176
|
// render mg-popover-content slot
|
|
7177
7177
|
this.renderPopoverContent();
|
|
7178
7178
|
this.validateCloseButton(this.closeButton);
|
|
@@ -7260,7 +7260,7 @@ const MgPopoverContent = class {
|
|
|
7260
7260
|
this.hideContent.emit();
|
|
7261
7261
|
};
|
|
7262
7262
|
this.closeButton = false;
|
|
7263
|
-
this.classCollection = new index$1.
|
|
7263
|
+
this.classCollection = new index$1.Me(['mg-c-popover-content']);
|
|
7264
7264
|
}
|
|
7265
7265
|
/*************
|
|
7266
7266
|
* Lifecycle *
|
|
@@ -7278,7 +7278,7 @@ const MgPopoverContent = class {
|
|
|
7278
7278
|
componentDidLoad() {
|
|
7279
7279
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
7280
7280
|
const slottedTitleElement = this.element.querySelector('[slot="title"]');
|
|
7281
|
-
if (slottedTitleElement && !index$1.
|
|
7281
|
+
if (slottedTitleElement && !index$1.Fe(slottedTitleElement, headingTags)) {
|
|
7282
7282
|
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
7283
7283
|
}
|
|
7284
7284
|
}
|
|
@@ -7314,7 +7314,7 @@ const MgSkipLinks = class {
|
|
|
7314
7314
|
this.links = undefined;
|
|
7315
7315
|
}
|
|
7316
7316
|
validateLinks(links) {
|
|
7317
|
-
if (links === undefined || links.length === 0 || links.some(link => !index$1.
|
|
7317
|
+
if (links === undefined || links.length === 0 || links.some(link => !index$1.Be(link.href) || !link.href.startsWith('#') || !index$1.Be(link.label))) {
|
|
7318
7318
|
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.`);
|
|
7319
7319
|
}
|
|
7320
7320
|
}
|
|
@@ -7466,7 +7466,7 @@ const MgTabs = class {
|
|
|
7466
7466
|
*/
|
|
7467
7467
|
this.resetFocus = () => {
|
|
7468
7468
|
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
7469
|
-
index$1.
|
|
7469
|
+
index$1.Ue(() => {
|
|
7470
7470
|
this.tabFocus = undefined;
|
|
7471
7471
|
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
7472
7472
|
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
@@ -7481,16 +7481,16 @@ const MgTabs = class {
|
|
|
7481
7481
|
if (slots.length !== this.tabs.length)
|
|
7482
7482
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
7483
7483
|
};
|
|
7484
|
-
this.identifier = index$1.
|
|
7484
|
+
this.identifier = index$1.Re('mg-tabs');
|
|
7485
7485
|
this.label = undefined;
|
|
7486
7486
|
this.size = 'regular';
|
|
7487
7487
|
this.items = undefined;
|
|
7488
7488
|
this.activeTab = undefined;
|
|
7489
7489
|
this.tabs = [];
|
|
7490
|
-
this.classCollection = new index$1.
|
|
7490
|
+
this.classCollection = new index$1.Me(['mg-c-tabs']);
|
|
7491
7491
|
}
|
|
7492
7492
|
validateLabel(newValue) {
|
|
7493
|
-
if (!index$1.
|
|
7493
|
+
if (!index$1.Be(newValue)) {
|
|
7494
7494
|
throw new Error('<mg-tabs> prop "label" is required.');
|
|
7495
7495
|
}
|
|
7496
7496
|
}
|
|
@@ -7502,7 +7502,7 @@ const MgTabs = class {
|
|
|
7502
7502
|
}
|
|
7503
7503
|
validateItems(newValue) {
|
|
7504
7504
|
// String array
|
|
7505
|
-
if (index$1.
|
|
7505
|
+
if (index$1.Oe(newValue))
|
|
7506
7506
|
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
7507
7507
|
// Object array
|
|
7508
7508
|
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
@@ -7602,7 +7602,7 @@ const MgTag = class {
|
|
|
7602
7602
|
this.variant = variants[0];
|
|
7603
7603
|
this.outline = undefined;
|
|
7604
7604
|
this.soft = undefined;
|
|
7605
|
-
this.classCollection = new index$1.
|
|
7605
|
+
this.classCollection = new index$1.Me(['mg-c-tag']);
|
|
7606
7606
|
}
|
|
7607
7607
|
validateVariant(newValue, oldValue) {
|
|
7608
7608
|
if (!variants.includes(newValue)) {
|
|
@@ -7639,7 +7639,7 @@ const MgTag = class {
|
|
|
7639
7639
|
* @param textContent - html element textContent property
|
|
7640
7640
|
*/
|
|
7641
7641
|
validateTextContent(textContent) {
|
|
7642
|
-
if (!index$1.
|
|
7642
|
+
if (!index$1.Be(textContent))
|
|
7643
7643
|
throw new Error('<mg-tag> slot must contain a text content.');
|
|
7644
7644
|
}
|
|
7645
7645
|
/*************
|
|
@@ -7698,7 +7698,7 @@ const MgTooltip = class {
|
|
|
7698
7698
|
// Enable the event listeners
|
|
7699
7699
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
7700
7700
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
7701
|
-
index$1.
|
|
7701
|
+
index$1.Ue(() => {
|
|
7702
7702
|
this.windows.forEach((localWindow) => {
|
|
7703
7703
|
localWindow.addEventListener('click', this.clickOutside, false);
|
|
7704
7704
|
localWindow.addEventListener('keydown', this.pressEscape, false);
|
|
@@ -7863,7 +7863,7 @@ const MgTooltip = class {
|
|
|
7863
7863
|
});
|
|
7864
7864
|
});
|
|
7865
7865
|
};
|
|
7866
|
-
this.identifier = index$1.
|
|
7866
|
+
this.identifier = index$1.Re('mg-tooltip');
|
|
7867
7867
|
this.message = undefined;
|
|
7868
7868
|
this.placement = 'bottom';
|
|
7869
7869
|
this.display = false;
|
|
@@ -7874,7 +7874,7 @@ const MgTooltip = class {
|
|
|
7874
7874
|
this.renderTooltipContent();
|
|
7875
7875
|
}
|
|
7876
7876
|
validateMessage(newValue) {
|
|
7877
|
-
if (!index$1.
|
|
7877
|
+
if (!index$1.Be(newValue)) {
|
|
7878
7878
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
7879
7879
|
}
|
|
7880
7880
|
this.mgTooltipContent.message = newValue;
|
|
@@ -7923,7 +7923,7 @@ const MgTooltip = class {
|
|
|
7923
7923
|
*/
|
|
7924
7924
|
componentWillLoad() {
|
|
7925
7925
|
// Get windows to attach events
|
|
7926
|
-
this.windows = index$1.
|
|
7926
|
+
this.windows = index$1._e(window);
|
|
7927
7927
|
// Get tooltip element
|
|
7928
7928
|
this.renderTooltipContent();
|
|
7929
7929
|
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
@@ -7942,7 +7942,7 @@ const MgTooltip = class {
|
|
|
7942
7942
|
// get slotted element wich is not the tooltip
|
|
7943
7943
|
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
7944
7944
|
// Get interactive element
|
|
7945
|
-
const interactiveElement = slotElement.matches(index$1.
|
|
7945
|
+
const interactiveElement = slotElement.matches(index$1.De) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(index$1.De);
|
|
7946
7946
|
// define selected element to become tooltip selector
|
|
7947
7947
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
7948
7948
|
// Check if slotted element is a disabled mg-button
|