@mgdis/mg-components 6.10.1 → 6.11.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-CL_COdxv.js → index-B_WwxtkQ.js} +4 -4
- package/dist/cjs/{index-CL_COdxv.js.map → index-B_WwxtkQ.js.map} +1 -1
- package/dist/cjs/{index.es-DaPqByCe.js → index.es-C-3Gv8Eu.js} +47 -43
- package/dist/cjs/index.es-C-3Gv8Eu.js.map +1 -0
- package/dist/cjs/mg-action-more_37.cjs.entry.js +186 -187
- package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +6 -6
- package/dist/cjs/mg-input-combobox.cjs.entry.js +74 -71
- package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +6 -6
- package/dist/cjs/mg-loader.cjs.entry.js +3 -3
- package/dist/cjs/mg-progress.cjs.entry.js +9 -9
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +67 -45
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +25 -30
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/components/index.es.js +40 -37
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +6 -6
- package/dist/components/mg-alert.js +5 -5
- package/dist/components/mg-badge2.js +5 -5
- package/dist/components/mg-button2.js +6 -6
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-character-left2.js +4 -4
- package/dist/components/mg-details.js +6 -2
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +7 -7
- package/dist/components/mg-icon2.js +6 -6
- package/dist/components/mg-illustrated-message.js +5 -5
- package/dist/components/mg-input-checkbox.js +5 -5
- package/dist/components/mg-input-combobox.js +73 -70
- package/dist/components/mg-input-combobox.js.map +1 -1
- package/dist/components/mg-input-date.js +14 -14
- package/dist/components/mg-input-numeric.js +11 -11
- package/dist/components/mg-input-password.js +2 -2
- package/dist/components/mg-input-radio.js +6 -6
- package/dist/components/mg-input-rich-text-editor.js +5 -5
- package/dist/components/mg-input-select2.js +31 -36
- 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 +5 -5
- package/dist/components/mg-input-title2.js +3 -3
- package/dist/components/mg-input-toggle.js +5 -5
- package/dist/components/mg-input2.js +6 -6
- package/dist/components/mg-item-more2.js +7 -7
- package/dist/components/mg-loader2.js +2 -2
- package/dist/components/mg-menu-item2.js +8 -8
- package/dist/components/mg-message2.js +4 -4
- package/dist/components/mg-modal.js +7 -7
- package/dist/components/mg-pagination2.js +6 -6
- package/dist/components/mg-panel.js +8 -8
- package/dist/components/mg-popover-content2.js +3 -3
- package/dist/components/mg-popover2.js +5 -5
- package/dist/components/mg-progress.js +9 -9
- package/dist/components/mg-table.js +5 -5
- package/dist/components/mg-tabs.js +11 -11
- package/dist/components/mg-tag.js +3 -3
- package/dist/components/mg-tooltip2.js +8 -8
- package/dist/esm/{index-DALWFL9i.js → index-DHpyFawS.js} +4 -4
- package/dist/esm/{index-DALWFL9i.js.map → index-DHpyFawS.js.map} +1 -1
- package/dist/esm/{index.es-hNwGkhG6.js → index.es-lyrZ9KRh.js} +42 -39
- package/dist/esm/index.es-lyrZ9KRh.js.map +1 -0
- package/dist/esm/mg-action-more_37.entry.js +186 -187
- package/dist/esm/mg-action-more_37.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +6 -6
- package/dist/esm/mg-input-combobox.entry.js +74 -71
- package/dist/esm/mg-input-combobox.entry.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +6 -6
- package/dist/esm/mg-loader.entry.js +3 -3
- package/dist/esm/mg-progress.entry.js +9 -9
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
- package/dist/mg-components/{p-bf5de898.entry.js → p-596c0e08.entry.js} +2 -2
- package/dist/mg-components/p-8a3bd8ad.entry.js +2 -0
- package/dist/mg-components/p-8a3bd8ad.entry.js.map +1 -0
- package/dist/mg-components/p-98a74b62.entry.js +2 -0
- package/dist/mg-components/{p-a52a168c.entry.js.map → p-98a74b62.entry.js.map} +1 -1
- package/dist/mg-components/{p-Cg3R_y_o.js → p-C-vIqOyI.js} +2 -2
- package/dist/mg-components/{p-Cg3R_y_o.js.map → p-C-vIqOyI.js.map} +1 -1
- package/dist/mg-components/{p-e33557f9.entry.js → p-d4ed3aad.entry.js} +2 -2
- package/dist/mg-components/p-e822bd96.entry.js +2 -0
- package/dist/mg-components/{p-352cfc01.entry.js.map → p-e822bd96.entry.js.map} +1 -1
- package/dist/mg-components/p-fc7b96e6.entry.js +2 -0
- package/dist/mg-components/p-fc7b96e6.entry.js.map +1 -0
- package/dist/mg-components/p-lyrZ9KRh.js +2 -0
- package/dist/mg-components/p-lyrZ9KRh.js.map +1 -0
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -0
- package/dist/types/components.d.ts +5 -0
- package/ide/intellij/web-types.json +6 -2
- package/ide/vscode/html-custom-data.json +1 -1
- package/package.json +8 -8
- package/dist/cjs/index.es-DaPqByCe.js.map +0 -1
- package/dist/esm/index.es-hNwGkhG6.js.map +0 -1
- package/dist/mg-components/p-352cfc01.entry.js +0 -2
- package/dist/mg-components/p-68f7de47.entry.js +0 -2
- package/dist/mg-components/p-68f7de47.entry.js.map +0 -1
- package/dist/mg-components/p-a52a168c.entry.js +0 -2
- package/dist/mg-components/p-dcefa0b0.entry.js +0 -2
- package/dist/mg-components/p-dcefa0b0.entry.js.map +0 -1
- package/dist/mg-components/p-hNwGkhG6.js +0 -2
- package/dist/mg-components/p-hNwGkhG6.js.map +0 -1
- /package/dist/mg-components/{p-bf5de898.entry.js.map → p-596c0e08.entry.js.map} +0 -0
- /package/dist/mg-components/{p-e33557f9.entry.js.map → p-d4ed3aad.entry.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-CAuxALt5.js';
|
|
2
|
-
import {
|
|
3
|
-
import { i as initLocales } from './index-
|
|
2
|
+
import { D as Dt, Y as Yt, q as qt, b as qe, e as er, B as Bt, c as Jt, V as Vt, P as Pt, Z as Zt, u as ur, f as fr, g as gr, d as dr, $ as $r, p as pr, a as Gt, i as Kt, X as Xt } from './index.es-lyrZ9KRh.js';
|
|
3
|
+
import { i as initLocales } from './index-DHpyFawS.js';
|
|
4
4
|
import { K as Keys } from './events.utils-yMGqY8YG.js';
|
|
5
5
|
import { t as tooltipPositions, b as classFieldset, c as classReadonly, a as classDisabled, d as classVerticalList, w as widths } from './mg-input.conf-CNgv8hc5.js';
|
|
6
6
|
|
|
@@ -74,7 +74,7 @@ const MgActionMore = class {
|
|
|
74
74
|
************/
|
|
75
75
|
this.name = 'mg-action-more';
|
|
76
76
|
this.classBase = 'mg-c-action-more';
|
|
77
|
-
this.mgPopoverIdentifier =
|
|
77
|
+
this.mgPopoverIdentifier = Dt(this.name);
|
|
78
78
|
/**
|
|
79
79
|
* Define button properties
|
|
80
80
|
*/
|
|
@@ -121,15 +121,15 @@ const MgActionMore = class {
|
|
|
121
121
|
}
|
|
122
122
|
validateItems(newValue) {
|
|
123
123
|
if (!isMgActionMoreItems(newValue)) {
|
|
124
|
-
throw new Error(`<${this.name}> prop "items" is required and all values must be the same type, MgActionMoreItemType or MgActionMoreDividerType. Passed value: ${
|
|
124
|
+
throw new Error(`<${this.name}> prop "items" is required and all values must be the same type, MgActionMoreItemType or MgActionMoreDividerType. Passed value: ${Yt(newValue)}.`);
|
|
125
125
|
}
|
|
126
126
|
else if (isMgActionMoreItems(newValue) && newValue.length > 0 && (isMgActionMoreDivider(newValue[0]) || isMgActionMoreDivider(newValue[newValue.length - 1]))) {
|
|
127
|
-
throw new Error(`<${this.name}> prop "items" can’t have a divider at the beginning or the end of the array. Passed value: ${
|
|
127
|
+
throw new Error(`<${this.name}> prop "items" can’t have a divider at the beginning or the end of the array. Passed value: ${Yt(newValue)}.`);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
validateIcon(newValue) {
|
|
131
131
|
if (newValue && !isMgActionMoreIcon(newValue)) {
|
|
132
|
-
throw new Error(`<${this.name}> prop "icon" must match MgActionMoreIconType. Passed value: ${
|
|
132
|
+
throw new Error(`<${this.name}> prop "icon" must match MgActionMoreIconType. Passed value: ${Yt(newValue)}.`);
|
|
133
133
|
}
|
|
134
134
|
else if ((newValue === null || newValue === void 0 ? void 0 : newValue.icon) === undefined && Boolean(this.button.isIcon)) {
|
|
135
135
|
this.icon = { icon: 'ellipsis' };
|
|
@@ -137,7 +137,7 @@ const MgActionMore = class {
|
|
|
137
137
|
}
|
|
138
138
|
validateButton(newValue) {
|
|
139
139
|
if (newValue && !isMgActionMoreButton(newValue)) {
|
|
140
|
-
throw new Error(`<${this.name}> prop "button" must match MgActionMoreButtonType. Passed value: ${
|
|
140
|
+
throw new Error(`<${this.name}> prop "button" must match MgActionMoreButtonType. Passed value: ${Yt(newValue)}.`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
validateDisplayChevron(newValue) {
|
|
@@ -214,21 +214,21 @@ const MgBadge = class {
|
|
|
214
214
|
/**
|
|
215
215
|
* Component classes
|
|
216
216
|
*/
|
|
217
|
-
this.classCollection = new
|
|
217
|
+
this.classCollection = new qt(['mg-c-badge']);
|
|
218
218
|
}
|
|
219
219
|
validateValue(newValue) {
|
|
220
220
|
if (/^[^A-Z]+$/i.exec(`${newValue}`) === null) {
|
|
221
|
-
throw new Error(`<mg-badge> prop "value" is required and must be integer and/or special character. Passed value: ${
|
|
221
|
+
throw new Error(`<mg-badge> prop "value" is required and must be integer and/or special character. Passed value: ${Yt(newValue)}.`);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
validateLabel(newValue) {
|
|
225
225
|
if (!qe(newValue)) {
|
|
226
|
-
throw new Error(`<mg-badge> prop "label" is required and must be a string. Passed value: ${
|
|
226
|
+
throw new Error(`<mg-badge> prop "label" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
validateVariant(newValue, oldValue) {
|
|
230
230
|
if (!variants$4.includes(newValue)) {
|
|
231
|
-
throw new Error(`<mg-badge> prop "variant" must be one of: ${variants$4.join(', ')}. Passed value: ${
|
|
231
|
+
throw new Error(`<mg-badge> prop "variant" must be one of: ${variants$4.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
234
|
if (oldValue !== undefined) {
|
|
@@ -321,7 +321,7 @@ const MgButton = class {
|
|
|
321
321
|
/**
|
|
322
322
|
* Component classes
|
|
323
323
|
*/
|
|
324
|
-
this.classCollection = new
|
|
324
|
+
this.classCollection = new qt(['mg-c-button']);
|
|
325
325
|
/**
|
|
326
326
|
* Trigger actions onClick event
|
|
327
327
|
* @param event - click event
|
|
@@ -379,7 +379,7 @@ const MgButton = class {
|
|
|
379
379
|
this.variant = variants$3[0];
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
|
-
throw new Error(`<mg-button> prop "variant" must be one of: ${variants$3.join(', ')}. Passed value: ${
|
|
382
|
+
throw new Error(`<mg-button> prop "variant" must be one of: ${variants$3.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
383
383
|
}
|
|
384
384
|
else {
|
|
385
385
|
if (oldValue !== undefined) {
|
|
@@ -391,7 +391,7 @@ const MgButton = class {
|
|
|
391
391
|
validateSize(newValue, oldValue) {
|
|
392
392
|
// validate new value
|
|
393
393
|
if (!sizes$4.includes(newValue)) {
|
|
394
|
-
throw new Error(`<mg-button> prop "size" must be one of: ${sizes$4.join(', ')}. Passed value: ${
|
|
394
|
+
throw new Error(`<mg-button> prop "size" must be one of: ${sizes$4.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
395
395
|
}
|
|
396
396
|
else {
|
|
397
397
|
if (oldValue !== undefined) {
|
|
@@ -464,7 +464,7 @@ const MgButton = class {
|
|
|
464
464
|
* Add listners
|
|
465
465
|
*/
|
|
466
466
|
componentDidLoad() {
|
|
467
|
-
|
|
467
|
+
er(() => {
|
|
468
468
|
var _a;
|
|
469
469
|
const closestForm = this.element.closest('form') || ((_a = this.element.closest('mg-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('form'));
|
|
470
470
|
// submit buttons should trigger form submition;
|
|
@@ -481,7 +481,7 @@ const MgButton = class {
|
|
|
481
481
|
*/
|
|
482
482
|
render() {
|
|
483
483
|
var _a;
|
|
484
|
-
return (h(Host, { key: '
|
|
484
|
+
return (h(Host, { key: '75cfc1c3626cb040323feaccc4d6926a142a1cec', role: "button", tabIndex: this.element.getAttribute('tabindex') || 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": (_a = this.disabled) === null || _a === void 0 ? void 0 : _a.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { key: 'cf20f508a4ee0e9674fde4bc5307f2e16cf2894e', class: this.classCollection.join() }, this.loading && h("mg-icon", { key: 'b378739392aa99ed04299c702aed4d87a2e81a72', icon: "loader", spin: true }), h("div", { key: '02dcdb164ca3963c0f1740fd3742d178c2b951b5', class: "mg-c-button__content" }, h("slot", { key: 'fb29ea2b9a9a9bf3d22b283227fe60b7a0ce697e' })))));
|
|
485
485
|
}
|
|
486
486
|
get element() { return getElement(this); }
|
|
487
487
|
static get watchers() { return {
|
|
@@ -525,13 +525,13 @@ const MgCharacterLeft = class {
|
|
|
525
525
|
this.characters = '';
|
|
526
526
|
}
|
|
527
527
|
watchIdentifier(newValue) {
|
|
528
|
-
if (newValue !== undefined && !
|
|
529
|
-
console.error(`<mg-character-left> prop "identifier" value is invalid. Passed value: ${
|
|
528
|
+
if (newValue !== undefined && !Bt(newValue)) {
|
|
529
|
+
console.error(`<mg-character-left> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
validateMaxlength(newValue) {
|
|
533
533
|
if (typeof newValue !== 'number') {
|
|
534
|
-
throw new Error(`<mg-character-left> prop "maxlength" is required and must be a number. Passed value: ${
|
|
534
|
+
throw new Error(`<mg-character-left> prop "maxlength" is required and must be a number. Passed value: ${Yt(newValue)}.`);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
/*************
|
|
@@ -560,7 +560,7 @@ const MgCharacterLeft = class {
|
|
|
560
560
|
};
|
|
561
561
|
MgCharacterLeft.style = mgCharacterLeftCss;
|
|
562
562
|
|
|
563
|
-
const mgDetailsCss = ".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}}/*!\n * @prop --mg-c-details-spacing: Defines the spacing between the summary and the details. Default value: `--mg-b-size-8`.\n */.mg-c-details summary{display:inline-flex;align-items:baseline;cursor:pointer;gap:var(--mg-b-size-16)}.mg-c-details summary::-webkit-details-marker{display:none}.mg-c-details__toggle{display:flex;min-height:calc(var(--mg-b-font-size)*var(--mg-b-line-height));flex-shrink:0;align-items:center;align-self:flex-start;gap:var(--mg-b-size-4)}.mg-c-details__toggle-icon.mg-c-details__toggle-icon--reverse{transform:rotate(180deg)}.mg-c-details__details{margin-top:var(--mg-c-details-spacing)}@media (width < 43.75rem){.mg-c-details__toggle>span{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}}";
|
|
563
|
+
const mgDetailsCss = ".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}}/*!\n * @prop --mg-c-details-spacing: Defines the spacing between the summary and the details. Default value: `--mg-b-size-8`.\n */.mg-c-details summary{display:inline-flex;align-items:baseline;cursor:pointer;gap:var(--mg-b-size-16)}.mg-c-details summary::-webkit-details-marker{display:none}.mg-c-details.mg-c-details--empty-summary summary{gap:unset}.mg-c-details__toggle{display:flex;min-height:calc(var(--mg-b-font-size)*var(--mg-b-line-height));flex-shrink:0;align-items:center;align-self:flex-start;gap:var(--mg-b-size-4)}.mg-c-details__toggle-icon.mg-c-details__toggle-icon--reverse{transform:rotate(180deg)}.mg-c-details__details{margin-top:var(--mg-c-details-spacing)}@media (width < 43.75rem){.mg-c-details:not(.mg-c-details--empty-summary) .mg-c-details__toggle>span{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}}";
|
|
564
564
|
|
|
565
565
|
const MgDetails = class {
|
|
566
566
|
constructor(hostRef) {
|
|
@@ -598,6 +598,10 @@ const MgDetails = class {
|
|
|
598
598
|
componentWillLoad() {
|
|
599
599
|
this.validateTitles(this.toggleClosed);
|
|
600
600
|
this.validateTitles(this.toggleOpened);
|
|
601
|
+
// Check if summary slot is empty
|
|
602
|
+
const summarySlot = this.element.querySelector('[slot="summary"]');
|
|
603
|
+
this.isEmptySummary = summarySlot === null || !qe(summarySlot.textContent);
|
|
604
|
+
// Add event listener to prevent default action on summary click
|
|
601
605
|
this.element.addEventListener('click', (event) => {
|
|
602
606
|
if (event.target.closest('[slot="summary"] mg-button, mg-button[slot="summary"]') !== null) {
|
|
603
607
|
event.preventDefault();
|
|
@@ -609,7 +613,7 @@ const MgDetails = class {
|
|
|
609
613
|
* @returns HTML Element
|
|
610
614
|
*/
|
|
611
615
|
render() {
|
|
612
|
-
return (h("details", { key: '
|
|
616
|
+
return (h("details", { key: '7ec633056f7e127154b9d8f30f77bd9d03a78591', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '4947a7a5d1971feb4f7b27c5bc161b0599b640c1' }, h("slot", { key: '6505ae282f5cc53ac3b5f924caee6347e958b03f', name: "summary" }), h("span", { key: 'fcf391abf5a99f3ff9f5a006698e9ef646ca159e', class: "mg-c-details__toggle" }, h("mg-icon", { key: '5d02b782ce1f762612ae5881cd85d65680addaa9', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: '0dbd12e051714756a633146a99303088cbab4fa7', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '607ae907cce5efd3fa56d9ed62cf9f4091abf262', class: "mg-c-details__details" }, h("slot", { key: '0e1eda9ec27c618aee1929727676d9450e457b42', name: "details" }))));
|
|
613
617
|
}
|
|
614
618
|
get element() { return getElement(this); }
|
|
615
619
|
static get watchers() { return {
|
|
@@ -669,7 +673,7 @@ const MgForm = class {
|
|
|
669
673
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
670
674
|
* If not set, it will be created.
|
|
671
675
|
*/
|
|
672
|
-
this.identifier =
|
|
676
|
+
this.identifier = Dt('mg-form');
|
|
673
677
|
/**
|
|
674
678
|
* Input name
|
|
675
679
|
* If not set the value equals the identifier
|
|
@@ -690,7 +694,7 @@ const MgForm = class {
|
|
|
690
694
|
/**
|
|
691
695
|
* Component classes
|
|
692
696
|
*/
|
|
693
|
-
this.classCollection = new
|
|
697
|
+
this.classCollection = new qt(['mg-c-form']);
|
|
694
698
|
/**
|
|
695
699
|
* Define required message based on mg-inputs required elements
|
|
696
700
|
*/
|
|
@@ -778,18 +782,18 @@ const MgForm = class {
|
|
|
778
782
|
};
|
|
779
783
|
}
|
|
780
784
|
watchIdentifier(newValue) {
|
|
781
|
-
if (!
|
|
782
|
-
console.error(`<mg-form> prop "identifier" value is invalid. Passed value: ${
|
|
785
|
+
if (!Bt(newValue)) {
|
|
786
|
+
console.error(`<mg-form> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
783
787
|
}
|
|
784
788
|
}
|
|
785
789
|
validateRequiredMessage(newValue) {
|
|
786
790
|
if (newValue && !requiredMessageStatus.includes(newValue)) {
|
|
787
|
-
throw new Error(`<mg-form> prop "requiredMessage" must be one of: ${requiredMessageStatus.join(', ')}. Passed value: ${
|
|
791
|
+
throw new Error(`<mg-form> prop "requiredMessage" must be one of: ${requiredMessageStatus.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
788
792
|
}
|
|
789
793
|
}
|
|
790
794
|
validateAriaRole(newValue) {
|
|
791
795
|
if (newValue && !roles.includes(newValue)) {
|
|
792
|
-
throw new Error(`<mg-form> prop "ariaRole" must be one of: ${roles.join(', ')}. Passed value: ${
|
|
796
|
+
throw new Error(`<mg-form> prop "ariaRole" must be one of: ${roles.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
793
797
|
}
|
|
794
798
|
}
|
|
795
799
|
handlelabelOnTop(newValue) {
|
|
@@ -923,7 +927,7 @@ const MgIcon = class {
|
|
|
923
927
|
/**
|
|
924
928
|
* Component classes
|
|
925
929
|
*/
|
|
926
|
-
this.classCollection = new
|
|
930
|
+
this.classCollection = new qt(['mg-c-icon']);
|
|
927
931
|
/**
|
|
928
932
|
* Method to set default varianStyle props
|
|
929
933
|
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
@@ -954,7 +958,7 @@ const MgIcon = class {
|
|
|
954
958
|
}
|
|
955
959
|
validateIcon(newValue, oldValue) {
|
|
956
960
|
if (!Object.keys(icons).includes(newValue)) {
|
|
957
|
-
throw new Error(`<mg-icon> prop "icon" must be one of: ${Object.keys(icons).join(', ')}. Passed value: ${
|
|
961
|
+
throw new Error(`<mg-icon> prop "icon" must be one of: ${Object.keys(icons).join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
958
962
|
}
|
|
959
963
|
else {
|
|
960
964
|
if (oldValue !== undefined) {
|
|
@@ -970,7 +974,7 @@ const MgIcon = class {
|
|
|
970
974
|
newValue = 'medium';
|
|
971
975
|
}
|
|
972
976
|
if (!sizes$3.includes(newValue)) {
|
|
973
|
-
throw new Error(`<mg-icon> prop "size" must be one of: ${sizes$3.join(', ')}. Passed value: ${
|
|
977
|
+
throw new Error(`<mg-icon> prop "size" must be one of: ${sizes$3.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
974
978
|
}
|
|
975
979
|
else {
|
|
976
980
|
if (oldValue !== undefined) {
|
|
@@ -982,7 +986,7 @@ const MgIcon = class {
|
|
|
982
986
|
validateVariant(newValue, oldValue) {
|
|
983
987
|
if (newValue !== undefined) {
|
|
984
988
|
if (!variants$2.includes(newValue))
|
|
985
|
-
throw new Error(`<mg-icon> prop "variant" must be one of: ${variants$2.join(', ')}. Passed value: ${
|
|
989
|
+
throw new Error(`<mg-icon> prop "variant" must be one of: ${variants$2.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
986
990
|
else {
|
|
987
991
|
this.setDefaultVariantStyle();
|
|
988
992
|
if (oldValue !== undefined)
|
|
@@ -994,7 +998,7 @@ const MgIcon = class {
|
|
|
994
998
|
validateVariantStyle(newValue, oldValue) {
|
|
995
999
|
if (newValue !== undefined) {
|
|
996
1000
|
if (!variantStyles$1.includes(newValue))
|
|
997
|
-
throw new Error(`<mg-icon> prop "variantStyle" must be one of: ${variantStyles$1.join(', ')}. Passed value: ${
|
|
1001
|
+
throw new Error(`<mg-icon> prop "variantStyle" must be one of: ${variantStyles$1.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
998
1002
|
else {
|
|
999
1003
|
if (oldValue !== undefined)
|
|
1000
1004
|
this.classCollection.delete(`mg-c-icon--variant-style-${oldValue}`);
|
|
@@ -1064,11 +1068,11 @@ const MgIllustratedMessage = class {
|
|
|
1064
1068
|
/**
|
|
1065
1069
|
* Component classes
|
|
1066
1070
|
*/
|
|
1067
|
-
this.classCollection = new
|
|
1071
|
+
this.classCollection = new qt(['mg-c-illustrated-message']);
|
|
1068
1072
|
}
|
|
1069
1073
|
watchSize(newValue, oldValue) {
|
|
1070
1074
|
if (!sizes$2.includes(newValue)) {
|
|
1071
|
-
throw new Error(`<mg-illustrated-message> prop "size" must be one of: ${sizes$2.join(', ')}. Passed value: ${
|
|
1075
|
+
throw new Error(`<mg-illustrated-message> prop "size" must be one of: ${sizes$2.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
1072
1076
|
}
|
|
1073
1077
|
else {
|
|
1074
1078
|
if (oldValue !== undefined) {
|
|
@@ -1079,7 +1083,7 @@ const MgIllustratedMessage = class {
|
|
|
1079
1083
|
}
|
|
1080
1084
|
watchDirection(newValue, oldValue) {
|
|
1081
1085
|
if (newValue !== undefined && !directions.includes(newValue)) {
|
|
1082
|
-
throw new Error(`<mg-illustrated-message> prop "direction" must be one of: ${directions.join(', ')}. Passed value: ${
|
|
1086
|
+
throw new Error(`<mg-illustrated-message> prop "direction" must be one of: ${directions.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
1083
1087
|
}
|
|
1084
1088
|
else if (newValue === 'horizontal') {
|
|
1085
1089
|
this.classCollection.add('mg-c-illustrated-message--direction-horizontal');
|
|
@@ -1102,7 +1106,7 @@ const MgIllustratedMessage = class {
|
|
|
1102
1106
|
if (slottedDetails.length === 0 && slottedTitle === null) {
|
|
1103
1107
|
throw new Error('<mg-illustrated-message> Slot "title" or "details" must be present.');
|
|
1104
1108
|
}
|
|
1105
|
-
else if (slottedTitle !== null && !
|
|
1109
|
+
else if (slottedTitle !== null && !Jt(slottedTitle, headingTags)) {
|
|
1106
1110
|
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}.`);
|
|
1107
1111
|
}
|
|
1108
1112
|
else if (slottedIllustrations.length !== 1) {
|
|
@@ -1188,10 +1192,10 @@ const MgInput = class {
|
|
|
1188
1192
|
}
|
|
1189
1193
|
watchIdentifier(newValue) {
|
|
1190
1194
|
if (!qe(newValue)) {
|
|
1191
|
-
throw new Error(`<mg-input> prop "identifier" is required and must be a string. Passed value: ${
|
|
1195
|
+
throw new Error(`<mg-input> prop "identifier" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
1192
1196
|
}
|
|
1193
|
-
else if (!
|
|
1194
|
-
console.error(`<mg-input> prop "identifier" value is invalid. Passed value: ${
|
|
1197
|
+
else if (!Bt(newValue)) {
|
|
1198
|
+
console.error(`<mg-input> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
1195
1199
|
}
|
|
1196
1200
|
else {
|
|
1197
1201
|
this.helpTextId = `${this.identifier}-help-text`;
|
|
@@ -1213,7 +1217,7 @@ const MgInput = class {
|
|
|
1213
1217
|
}
|
|
1214
1218
|
watchTooltipPosition(newValue) {
|
|
1215
1219
|
if (!tooltipPositions.includes(newValue)) {
|
|
1216
|
-
throw new Error(`<mg-input> prop "tooltipPosition" must be one of: ${tooltipPositions.join(', ')}. Passed value: ${
|
|
1220
|
+
throw new Error(`<mg-input> prop "tooltipPosition" must be one of: ${tooltipPositions.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
1217
1221
|
}
|
|
1218
1222
|
}
|
|
1219
1223
|
watchErrorMessage(newValue) {
|
|
@@ -1283,7 +1287,7 @@ const MgInput = class {
|
|
|
1283
1287
|
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
1284
1288
|
watchLabel() {
|
|
1285
1289
|
if (!qe(this.label)) {
|
|
1286
|
-
throw new Error(`<mg-input> prop "label" is required and must be a string. Passed value: ${
|
|
1290
|
+
throw new Error(`<mg-input> prop "label" is required and must be a string. Passed value: ${Yt(this.label)}.`);
|
|
1287
1291
|
}
|
|
1288
1292
|
else {
|
|
1289
1293
|
this.watchAriaDescribedbyIDs();
|
|
@@ -1487,7 +1491,7 @@ const MgInputCheckbox = class {
|
|
|
1487
1491
|
/**
|
|
1488
1492
|
* Component classes
|
|
1489
1493
|
*/
|
|
1490
|
-
this.classCollection = new
|
|
1494
|
+
this.classCollection = new qt([this.baseClassName, classFieldset]);
|
|
1491
1495
|
/**
|
|
1492
1496
|
* Formated value to display in list
|
|
1493
1497
|
*/
|
|
@@ -1605,7 +1609,7 @@ const MgInputCheckbox = class {
|
|
|
1605
1609
|
* Method to update searchResults
|
|
1606
1610
|
*/
|
|
1607
1611
|
this.updateSearchResults = () => {
|
|
1608
|
-
this.searchResults = this.checkboxItems.filter(item =>
|
|
1612
|
+
this.searchResults = this.checkboxItems.filter(item => Vt(item.title).includes(Vt(this.searchValue)));
|
|
1609
1613
|
};
|
|
1610
1614
|
/**
|
|
1611
1615
|
* Method to validate if one of inputs value is checked id required
|
|
@@ -1699,12 +1703,12 @@ const MgInputCheckbox = class {
|
|
|
1699
1703
|
this.valueChange.emit(newValue);
|
|
1700
1704
|
}
|
|
1701
1705
|
else {
|
|
1702
|
-
throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type, CheckboxItem. Passed value: ${
|
|
1706
|
+
throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type, CheckboxItem. Passed value: ${Yt(newValue)}.`);
|
|
1703
1707
|
}
|
|
1704
1708
|
}
|
|
1705
1709
|
validateType(newValue) {
|
|
1706
1710
|
if (newValue !== undefined && !checkboxTypes.includes(newValue)) {
|
|
1707
|
-
throw new Error(`<mg-input-checkbox> prop "type" must be a CheckboxType. Passed value: ${
|
|
1711
|
+
throw new Error(`<mg-input-checkbox> prop "type" must be a CheckboxType. Passed value: ${Yt(newValue)}.`);
|
|
1708
1712
|
}
|
|
1709
1713
|
else if (newValue === undefined) {
|
|
1710
1714
|
this.mode = 'auto';
|
|
@@ -2122,13 +2126,13 @@ const MgInputDate = class {
|
|
|
2122
2126
|
/**
|
|
2123
2127
|
* Component classes
|
|
2124
2128
|
*/
|
|
2125
|
-
this.classCollection = new
|
|
2129
|
+
this.classCollection = new qt(['mg-c-input--date']);
|
|
2126
2130
|
/**
|
|
2127
2131
|
* Method to validate date pattern string
|
|
2128
2132
|
* @param value - value to test
|
|
2129
2133
|
* @returns truthy when value match the pattern
|
|
2130
2134
|
*/
|
|
2131
|
-
this.isValidPattern = (value) => qe(value) &&
|
|
2135
|
+
this.isValidPattern = (value) => qe(value) && Pt.test(value);
|
|
2132
2136
|
/**
|
|
2133
2137
|
* Format help text to display
|
|
2134
2138
|
* @param helpText - help text format
|
|
@@ -2148,17 +2152,17 @@ const MgInputDate = class {
|
|
|
2148
2152
|
text = text.replace(defaultHelpTextVariable, this.formatHelpText(this.messages.input.date.helpText.expectedFormat));
|
|
2149
2153
|
}
|
|
2150
2154
|
// Replace pattern and date variables
|
|
2151
|
-
text = text.replace('{pattern}', this.renderPattern()).replace('{date}',
|
|
2155
|
+
text = text.replace('{pattern}', this.renderPattern()).replace('{date}', Zt(ur(new Date('2025-12-24')), this.systemLocale));
|
|
2152
2156
|
// Add additional message for min/max if necessary
|
|
2153
2157
|
let rangeMessage;
|
|
2154
2158
|
if (((_a = this.min) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.max !== DEFAULT_MAX_DATE) {
|
|
2155
|
-
rangeMessage = this.messages.input.date.helpText.minMax.replace('{min}',
|
|
2159
|
+
rangeMessage = this.messages.input.date.helpText.minMax.replace('{min}', Zt(this.min, this.systemLocale)).replace('{max}', Zt(this.max, this.systemLocale));
|
|
2156
2160
|
}
|
|
2157
2161
|
else if (((_b = this.min) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
2158
|
-
rangeMessage = this.messages.input.date.helpText.min.replace('{min}',
|
|
2162
|
+
rangeMessage = this.messages.input.date.helpText.min.replace('{min}', Zt(this.min, this.systemLocale));
|
|
2159
2163
|
}
|
|
2160
2164
|
else if (this.max !== DEFAULT_MAX_DATE) {
|
|
2161
|
-
rangeMessage = this.messages.input.date.helpText.max.replace('{max}',
|
|
2165
|
+
rangeMessage = this.messages.input.date.helpText.max.replace('{max}', Zt(this.max, this.systemLocale));
|
|
2162
2166
|
}
|
|
2163
2167
|
// Combine custom helpText with range message if both exist
|
|
2164
2168
|
if (text !== undefined && rangeMessage !== undefined) {
|
|
@@ -2255,15 +2259,15 @@ const MgInputDate = class {
|
|
|
2255
2259
|
// min, max & minMax
|
|
2256
2260
|
else if (['min', 'max', 'minMax'].includes(inputError)) {
|
|
2257
2261
|
this.errorMessage = this.messages.input.date.helpText[inputError]
|
|
2258
|
-
.replace('{min}',
|
|
2259
|
-
.replace('{max}',
|
|
2262
|
+
.replace('{min}', Zt(this.min, this.systemLocale))
|
|
2263
|
+
.replace('{max}', Zt(this.max, this.systemLocale));
|
|
2260
2264
|
}
|
|
2261
2265
|
// wrong date format
|
|
2262
2266
|
// element.validity.badInput is default error message
|
|
2263
2267
|
else {
|
|
2264
2268
|
this.errorMessage = this.messages.input.date.error.badInput
|
|
2265
2269
|
.replace('{pattern}', this.renderPattern())
|
|
2266
|
-
.replace('{date}',
|
|
2270
|
+
.replace('{date}', Zt(ur(new Date('2025-12-24')), this.systemLocale));
|
|
2267
2271
|
}
|
|
2268
2272
|
}
|
|
2269
2273
|
};
|
|
@@ -2272,7 +2276,7 @@ const MgInputDate = class {
|
|
|
2272
2276
|
* @returns translated html pattern
|
|
2273
2277
|
*/
|
|
2274
2278
|
this.renderPattern = () => {
|
|
2275
|
-
let patternLocal =
|
|
2279
|
+
let patternLocal = fr(this.systemLocale);
|
|
2276
2280
|
for (const key in this.messages.input.date.pattern) {
|
|
2277
2281
|
patternLocal = patternLocal.replace(key, this.messages.input.date.pattern[key]);
|
|
2278
2282
|
}
|
|
@@ -2289,7 +2293,7 @@ const MgInputDate = class {
|
|
|
2289
2293
|
}
|
|
2290
2294
|
else if (newValue && !qe(newValue)) {
|
|
2291
2295
|
// check value validity
|
|
2292
|
-
throw new Error(`<mg-input-date> props 'value' must be a valid string. Passed value: ${
|
|
2296
|
+
throw new Error(`<mg-input-date> props 'value' must be a valid string. Passed value: ${Yt(newValue)}.`);
|
|
2293
2297
|
}
|
|
2294
2298
|
else if (newValue === null || this.isValidPattern(newValue)) {
|
|
2295
2299
|
this.valueChange.emit(newValue);
|
|
@@ -2306,7 +2310,7 @@ const MgInputDate = class {
|
|
|
2306
2310
|
}
|
|
2307
2311
|
validateMinMax(newValue) {
|
|
2308
2312
|
if (newValue && !this.isValidPattern(newValue)) {
|
|
2309
|
-
throw new Error(`<mg-input-date> props 'min/max' doesn't match pattern: 'yyyy-mm-dd'. Passed value: ${
|
|
2313
|
+
throw new Error(`<mg-input-date> props 'min/max' doesn't match pattern: 'yyyy-mm-dd'. Passed value: ${Yt(newValue)}.`);
|
|
2310
2314
|
}
|
|
2311
2315
|
}
|
|
2312
2316
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
@@ -2422,7 +2426,7 @@ const MgInputDate = class {
|
|
|
2422
2426
|
* @returns HTML Element
|
|
2423
2427
|
*/
|
|
2424
2428
|
render() {
|
|
2425
|
-
return (h("mg-input", { key: '504777cb807b9747a6c854d7056cb5420eb2cdcf', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === null ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" },
|
|
2429
|
+
return (h("mg-input", { key: '504777cb807b9747a6c854d7056cb5420eb2cdcf', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === null ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, Zt(this.value, this.locale))) : (h("input", { 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, onKeyDown: this.handleKeyDown, ref: (el) => {
|
|
2426
2430
|
if (el !== null)
|
|
2427
2431
|
this.input = el;
|
|
2428
2432
|
} }))));
|
|
@@ -2513,7 +2517,7 @@ const MgInputNumeric = class {
|
|
|
2513
2517
|
/**
|
|
2514
2518
|
* Component classes
|
|
2515
2519
|
*/
|
|
2516
|
-
this.classCollection = new
|
|
2520
|
+
this.classCollection = new qt(['mg-c-input--numeric']);
|
|
2517
2521
|
/**
|
|
2518
2522
|
* Handle input event
|
|
2519
2523
|
*/
|
|
@@ -2556,7 +2560,7 @@ const MgInputNumeric = class {
|
|
|
2556
2560
|
* @param value - value to format
|
|
2557
2561
|
* @returns formatted value according to locale
|
|
2558
2562
|
*/
|
|
2559
|
-
this.formatErrorValue = (value) =>
|
|
2563
|
+
this.formatErrorValue = (value) => gr(value, this.locale, !Number.isInteger(value) && this.type === 'decimal' ? this.decimalLength : 0);
|
|
2560
2564
|
/**
|
|
2561
2565
|
* Set input error message
|
|
2562
2566
|
* @param errorMessage - errorMessage override
|
|
@@ -2611,13 +2615,13 @@ const MgInputNumeric = class {
|
|
|
2611
2615
|
this.formatValue = (value) => {
|
|
2612
2616
|
switch (this.format) {
|
|
2613
2617
|
case 'number':
|
|
2614
|
-
return
|
|
2618
|
+
return gr(value, this.locale, this.type === 'decimal' ? this.decimalLength : undefined);
|
|
2615
2619
|
case 'currency':
|
|
2616
|
-
return
|
|
2620
|
+
return pr(value, this.locale, this.currency);
|
|
2617
2621
|
case 'percent':
|
|
2618
|
-
return
|
|
2622
|
+
return $r(value / 100, this.locale, this.type === 'decimal' ? this.decimalLength : undefined);
|
|
2619
2623
|
case 'unit':
|
|
2620
|
-
return
|
|
2624
|
+
return dr(value, this.locale, this.unit, this.unitDisplay, this.type === 'decimal' ? this.decimalLength : undefined);
|
|
2621
2625
|
case 'none':
|
|
2622
2626
|
return value.toString();
|
|
2623
2627
|
}
|
|
@@ -2732,22 +2736,22 @@ const MgInputNumeric = class {
|
|
|
2732
2736
|
}
|
|
2733
2737
|
validateType(newValue) {
|
|
2734
2738
|
if (!types.includes(newValue)) {
|
|
2735
|
-
throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}. Passed value: ${
|
|
2739
|
+
throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
2736
2740
|
}
|
|
2737
2741
|
}
|
|
2738
2742
|
watchFormat(newValue) {
|
|
2739
2743
|
if (!formats.includes(newValue)) {
|
|
2740
|
-
throw new Error(`<mg-input-numeric> prop "format" must be one of: ${formats.join(', ')}. Passed value: ${
|
|
2744
|
+
throw new Error(`<mg-input-numeric> prop "format" must be one of: ${formats.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
2741
2745
|
}
|
|
2742
2746
|
}
|
|
2743
2747
|
validateIntegerLength(newValue) {
|
|
2744
2748
|
if (newValue < 1) {
|
|
2745
|
-
throw new Error(`<mg-input-numeric> prop "integer-length" must be a positive number. Passed value: ${
|
|
2749
|
+
throw new Error(`<mg-input-numeric> prop "integer-length" must be a positive number. Passed value: ${Yt(newValue)}.`);
|
|
2746
2750
|
}
|
|
2747
2751
|
}
|
|
2748
2752
|
validateDecimalLength(newValue) {
|
|
2749
2753
|
if (newValue < 1) {
|
|
2750
|
-
throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead. Passed value: ${
|
|
2754
|
+
throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead. Passed value: ${Yt(newValue)}.`);
|
|
2751
2755
|
}
|
|
2752
2756
|
}
|
|
2753
2757
|
/**
|
|
@@ -2954,7 +2958,7 @@ const MgInputPassword = class {
|
|
|
2954
2958
|
/**
|
|
2955
2959
|
* Component classes
|
|
2956
2960
|
*/
|
|
2957
|
-
this.classCollection = new
|
|
2961
|
+
this.classCollection = new qt(['mg-c-input--password']);
|
|
2958
2962
|
/**
|
|
2959
2963
|
* Indicates if password is displayed or not
|
|
2960
2964
|
*/
|
|
@@ -3205,7 +3209,7 @@ const MgInputRadio = class {
|
|
|
3205
3209
|
/**
|
|
3206
3210
|
* Component classes
|
|
3207
3211
|
*/
|
|
3208
|
-
this.classCollection = new
|
|
3212
|
+
this.classCollection = new qt(['mg-c-input--radio', classFieldset]);
|
|
3209
3213
|
/**
|
|
3210
3214
|
* Handle input event
|
|
3211
3215
|
* @param event - input event
|
|
@@ -3256,7 +3260,7 @@ const MgInputRadio = class {
|
|
|
3256
3260
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3257
3261
|
watchValue(newValue) {
|
|
3258
3262
|
var _a;
|
|
3259
|
-
if (
|
|
3263
|
+
if (Gt(this.items) && typeof newValue === 'string') {
|
|
3260
3264
|
this.readonlyValue = newValue;
|
|
3261
3265
|
}
|
|
3262
3266
|
else if (Array.isArray(this.items) && this.items.every(isOption$3)) {
|
|
@@ -3270,10 +3274,10 @@ const MgInputRadio = class {
|
|
|
3270
3274
|
validateItems(newValue) {
|
|
3271
3275
|
// Validate if items have required min length
|
|
3272
3276
|
if (typeof newValue === 'object' && newValue.length < 2) {
|
|
3273
|
-
throw new Error(`<mg-input-radio> prop "items" require at least 2 items. Passed value: ${
|
|
3277
|
+
throw new Error(`<mg-input-radio> prop "items" require at least 2 items. Passed value: ${Yt(newValue)}.`);
|
|
3274
3278
|
}
|
|
3275
3279
|
// String array
|
|
3276
|
-
else if (
|
|
3280
|
+
else if (Gt(newValue)) {
|
|
3277
3281
|
this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
|
|
3278
3282
|
}
|
|
3279
3283
|
// Object array
|
|
@@ -3281,7 +3285,7 @@ const MgInputRadio = class {
|
|
|
3281
3285
|
this.options = newValue;
|
|
3282
3286
|
}
|
|
3283
3287
|
else {
|
|
3284
|
-
throw new Error(`<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption. Passed value: ${
|
|
3288
|
+
throw new Error(`<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption. Passed value: ${Yt(newValue)}.`);
|
|
3285
3289
|
}
|
|
3286
3290
|
}
|
|
3287
3291
|
watchInputVerticalList(newValue) {
|
|
@@ -3511,48 +3515,35 @@ const MgInputSelect = class {
|
|
|
3511
3515
|
/**
|
|
3512
3516
|
* Component classes
|
|
3513
3517
|
*/
|
|
3514
|
-
this.classCollection = new
|
|
3518
|
+
this.classCollection = new qt(['mg-c-input--select']);
|
|
3515
3519
|
/**
|
|
3516
3520
|
* Handle input event
|
|
3517
3521
|
*/
|
|
3518
3522
|
this.handleInput = () => {
|
|
3519
|
-
this.updateValue();
|
|
3520
|
-
if (this.hasDisplayedError)
|
|
3521
|
-
this.setErrorMessage();
|
|
3522
|
-
};
|
|
3523
|
-
/**
|
|
3524
|
-
* Method to compare item.title with input.value
|
|
3525
|
-
* @param item - item to compare with
|
|
3526
|
-
* @returns truthy if input.value is an item
|
|
3527
|
-
*/
|
|
3528
|
-
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
3529
|
-
/**
|
|
3530
|
-
* value props setter
|
|
3531
|
-
* @param newValue - value to update with
|
|
3532
|
-
*/
|
|
3533
|
-
this.setValue = (newValue) => {
|
|
3534
|
-
this.checkValidity();
|
|
3535
|
-
this.value = newValue;
|
|
3536
|
-
};
|
|
3537
|
-
/**
|
|
3538
|
-
* Update value from input.value
|
|
3539
|
-
*/
|
|
3540
|
-
this.updateValue = () => {
|
|
3541
3523
|
if (this.input.value === '') {
|
|
3542
|
-
this.
|
|
3524
|
+
this.value = null;
|
|
3543
3525
|
}
|
|
3544
|
-
else if (
|
|
3545
|
-
this.
|
|
3526
|
+
else if (Gt(this.items) && this.items.includes(this.input.value)) {
|
|
3527
|
+
this.value = this.input.value;
|
|
3546
3528
|
}
|
|
3547
3529
|
else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
|
|
3548
|
-
this.
|
|
3530
|
+
this.value = this.items.find(this.isInputValue).value;
|
|
3549
3531
|
}
|
|
3550
3532
|
else {
|
|
3551
|
-
//
|
|
3533
|
+
// Add the unknown input.value to the options array as a disabled option before setting it as the new value
|
|
3552
3534
|
this.options.push({ title: this.input.value, value: this.input.value, disabled: true });
|
|
3553
|
-
this.
|
|
3535
|
+
this.value = this.input.value;
|
|
3536
|
+
}
|
|
3537
|
+
if (this.hasDisplayedError) {
|
|
3538
|
+
this.setErrorMessage();
|
|
3554
3539
|
}
|
|
3555
3540
|
};
|
|
3541
|
+
/**
|
|
3542
|
+
* Method to compare item.title with input.value
|
|
3543
|
+
* @param item - item to compare with
|
|
3544
|
+
* @returns truthy if input.value is an item
|
|
3545
|
+
*/
|
|
3546
|
+
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
3556
3547
|
/**
|
|
3557
3548
|
* Handle blur event
|
|
3558
3549
|
*/
|
|
@@ -3599,7 +3590,7 @@ const MgInputSelect = class {
|
|
|
3599
3590
|
}
|
|
3600
3591
|
validateValue(newValue) {
|
|
3601
3592
|
var _a, _b;
|
|
3602
|
-
if (
|
|
3593
|
+
if (Gt(this.items) && typeof newValue === 'string') {
|
|
3603
3594
|
this.readonlyValue = ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) !== undefined ? this.input.value : newValue;
|
|
3604
3595
|
}
|
|
3605
3596
|
else if (allItemsAreOptions(this.items)) {
|
|
@@ -3608,6 +3599,12 @@ const MgInputSelect = class {
|
|
|
3608
3599
|
else {
|
|
3609
3600
|
this.readonlyValue = null;
|
|
3610
3601
|
}
|
|
3602
|
+
setTimeout(() => {
|
|
3603
|
+
this.checkValidity();
|
|
3604
|
+
if (this.hasDisplayedError) {
|
|
3605
|
+
this.setErrorMessage();
|
|
3606
|
+
}
|
|
3607
|
+
}, 0);
|
|
3611
3608
|
this.valueChange.emit(newValue);
|
|
3612
3609
|
}
|
|
3613
3610
|
validateItems(newValue) {
|
|
@@ -3616,9 +3613,10 @@ const MgInputSelect = class {
|
|
|
3616
3613
|
this.options = [];
|
|
3617
3614
|
}
|
|
3618
3615
|
// String array
|
|
3619
|
-
else if (
|
|
3620
|
-
if (typeof this.value === 'string')
|
|
3616
|
+
else if (Gt(newValue)) {
|
|
3617
|
+
if (typeof this.value === 'string') {
|
|
3621
3618
|
this.valueExist = newValue.includes(this.value);
|
|
3619
|
+
}
|
|
3622
3620
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
3623
3621
|
}
|
|
3624
3622
|
// Object array
|
|
@@ -3634,7 +3632,7 @@ const MgInputSelect = class {
|
|
|
3634
3632
|
}
|
|
3635
3633
|
}
|
|
3636
3634
|
else {
|
|
3637
|
-
throw new Error(`<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${
|
|
3635
|
+
throw new Error(`<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${Yt(newValue)}.`);
|
|
3638
3636
|
}
|
|
3639
3637
|
}
|
|
3640
3638
|
watchReadonly(newValue) {
|
|
@@ -3728,8 +3726,9 @@ const MgInputSelect = class {
|
|
|
3728
3726
|
this.valid = newValue;
|
|
3729
3727
|
this.invalid = !this.valid;
|
|
3730
3728
|
// We need to send valid event even if it is the same value
|
|
3731
|
-
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue))
|
|
3729
|
+
if (this.handlerInProgress === undefined || (this.handlerInProgress === 'blur' && this.valid !== oldValidValue)) {
|
|
3732
3730
|
this.inputValid.emit(this.valid);
|
|
3731
|
+
}
|
|
3733
3732
|
}
|
|
3734
3733
|
/*************
|
|
3735
3734
|
* Lifecycle *
|
|
@@ -3763,7 +3762,7 @@ const MgInputSelect = class {
|
|
|
3763
3762
|
* @returns HTML Element
|
|
3764
3763
|
*/
|
|
3765
3764
|
render() {
|
|
3766
|
-
return (h("mg-input", { key: '
|
|
3765
|
+
return (h("mg-input", { key: 'e5f8f97d2ebe984532bc25b7be94053c2e6ddf43', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
3767
3766
|
if (el !== null)
|
|
3768
3767
|
this.input = el;
|
|
3769
3768
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -3802,7 +3801,7 @@ const isOption$1 = (option) => typeof option === 'object' && typeof option.title
|
|
|
3802
3801
|
* @param options - Datalist options to check.
|
|
3803
3802
|
* @returns True if datalist is well structured.
|
|
3804
3803
|
*/
|
|
3805
|
-
const isDatalistOptions = (options) =>
|
|
3804
|
+
const isDatalistOptions = (options) => Gt(options) || (Array.isArray(options) && options.every(isOption$1));
|
|
3806
3805
|
const MgInputText = class {
|
|
3807
3806
|
constructor(hostRef) {
|
|
3808
3807
|
registerInstance(this, hostRef);
|
|
@@ -3867,7 +3866,7 @@ const MgInputText = class {
|
|
|
3867
3866
|
/**
|
|
3868
3867
|
* Component classes
|
|
3869
3868
|
*/
|
|
3870
|
-
this.classCollection = new
|
|
3869
|
+
this.classCollection = new qt(['mg-c-input--text']);
|
|
3871
3870
|
/**
|
|
3872
3871
|
* Validate pattern configuration
|
|
3873
3872
|
*/
|
|
@@ -3893,7 +3892,7 @@ const MgInputText = class {
|
|
|
3893
3892
|
*/
|
|
3894
3893
|
this.handleFocus = () => {
|
|
3895
3894
|
this.classCollection.add(this.classFocus);
|
|
3896
|
-
this.classCollection = new
|
|
3895
|
+
this.classCollection = new qt(this.classCollection.classes);
|
|
3897
3896
|
};
|
|
3898
3897
|
/**
|
|
3899
3898
|
* Handle blur event
|
|
@@ -3901,7 +3900,7 @@ const MgInputText = class {
|
|
|
3901
3900
|
this.handleBlur = () => {
|
|
3902
3901
|
// Manage focus
|
|
3903
3902
|
this.classCollection.delete(this.classFocus);
|
|
3904
|
-
this.classCollection = new
|
|
3903
|
+
this.classCollection = new qt(this.classCollection.classes);
|
|
3905
3904
|
// Display Error
|
|
3906
3905
|
this.handlerInProgress = 'blur';
|
|
3907
3906
|
this.displayError().finally(() => {
|
|
@@ -3996,7 +3995,7 @@ const MgInputText = class {
|
|
|
3996
3995
|
}
|
|
3997
3996
|
validateDatalistoptions(newValue) {
|
|
3998
3997
|
if (Boolean(newValue) && !isDatalistOptions(newValue)) {
|
|
3999
|
-
throw new Error(`<mg-input-text> prop "datalistoptions" values must be the same type, string or OptionType. Passed value: ${
|
|
3998
|
+
throw new Error(`<mg-input-text> prop "datalistoptions" values must be the same type, string or OptionType. Passed value: ${Yt(newValue)}.`);
|
|
4000
3999
|
}
|
|
4001
4000
|
}
|
|
4002
4001
|
watchReadonly(newValue) {
|
|
@@ -4237,7 +4236,7 @@ const MgInputTextarea = class {
|
|
|
4237
4236
|
/**
|
|
4238
4237
|
* Component classes
|
|
4239
4238
|
*/
|
|
4240
|
-
this.classCollection = new
|
|
4239
|
+
this.classCollection = new qt(['mg-c-input--textarea']);
|
|
4241
4240
|
/**
|
|
4242
4241
|
* Handle input event
|
|
4243
4242
|
*/
|
|
@@ -4253,7 +4252,7 @@ const MgInputTextarea = class {
|
|
|
4253
4252
|
*/
|
|
4254
4253
|
this.handleFocus = () => {
|
|
4255
4254
|
this.classCollection.add(this.classFocus);
|
|
4256
|
-
this.classCollection = new
|
|
4255
|
+
this.classCollection = new qt(this.classCollection.classes);
|
|
4257
4256
|
};
|
|
4258
4257
|
/**
|
|
4259
4258
|
* Handle blur event
|
|
@@ -4261,7 +4260,7 @@ const MgInputTextarea = class {
|
|
|
4261
4260
|
this.handleBlur = () => {
|
|
4262
4261
|
// Manage focus
|
|
4263
4262
|
this.classCollection.delete(this.classFocus);
|
|
4264
|
-
this.classCollection = new
|
|
4263
|
+
this.classCollection = new qt(this.classCollection.classes);
|
|
4265
4264
|
// Display Error
|
|
4266
4265
|
this.handlerInProgress = 'blur';
|
|
4267
4266
|
this.displayError().finally(() => {
|
|
@@ -4340,7 +4339,7 @@ const MgInputTextarea = class {
|
|
|
4340
4339
|
}
|
|
4341
4340
|
validatePattern(newValue) {
|
|
4342
4341
|
if (newValue !== undefined && !(qe(this.pattern) && qe(this.patternErrorMessage))) {
|
|
4343
|
-
throw new Error(`<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${
|
|
4342
|
+
throw new Error(`<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${Yt(this.pattern)}'" and "patternErrorMessage='${Yt(this.patternErrorMessage)}'".`);
|
|
4344
4343
|
}
|
|
4345
4344
|
}
|
|
4346
4345
|
validatecharacterLeftHide(newValue) {
|
|
@@ -4487,8 +4486,8 @@ const MgInputTitle = class {
|
|
|
4487
4486
|
if (!qe(newValue)) {
|
|
4488
4487
|
throw new Error('<mg-input-title> prop "identifier" is required.');
|
|
4489
4488
|
}
|
|
4490
|
-
else if (!
|
|
4491
|
-
console.error(`<mg-input-title> prop "identifier" value is invalid. Passed value: ${
|
|
4489
|
+
else if (!Bt(newValue)) {
|
|
4490
|
+
console.error(`<mg-input-title> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
4492
4491
|
}
|
|
4493
4492
|
}
|
|
4494
4493
|
validateIsLegend(newValue) {
|
|
@@ -4576,7 +4575,7 @@ const MgInputToggle = class {
|
|
|
4576
4575
|
/**
|
|
4577
4576
|
* Component classes
|
|
4578
4577
|
*/
|
|
4579
|
-
this.classCollection = new
|
|
4578
|
+
this.classCollection = new qt(['mg-c-input--toggle']);
|
|
4580
4579
|
/**
|
|
4581
4580
|
* Checked internal value
|
|
4582
4581
|
*/
|
|
@@ -4637,10 +4636,10 @@ const MgInputToggle = class {
|
|
|
4637
4636
|
}
|
|
4638
4637
|
validateItems(newValue) {
|
|
4639
4638
|
if (typeof newValue === 'object' && this.items.length !== 2) {
|
|
4640
|
-
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${
|
|
4639
|
+
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${Yt(newValue)}.`);
|
|
4641
4640
|
}
|
|
4642
4641
|
// String array
|
|
4643
|
-
else if (
|
|
4642
|
+
else if (Gt(newValue)) {
|
|
4644
4643
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
4645
4644
|
}
|
|
4646
4645
|
// Object array
|
|
@@ -4648,7 +4647,7 @@ const MgInputToggle = class {
|
|
|
4648
4647
|
this.options = newValue;
|
|
4649
4648
|
}
|
|
4650
4649
|
else {
|
|
4651
|
-
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue. Passed value: ${
|
|
4650
|
+
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue. Passed value: ${Yt(newValue)}.`);
|
|
4652
4651
|
}
|
|
4653
4652
|
}
|
|
4654
4653
|
watchIsOnOff(newValue) {
|
|
@@ -4878,17 +4877,17 @@ const MgItemMore = class {
|
|
|
4878
4877
|
}
|
|
4879
4878
|
validateIcon(newValue) {
|
|
4880
4879
|
if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.icon !== 'string'))
|
|
4881
|
-
throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type. Passed value: ${
|
|
4880
|
+
throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type. Passed value: ${Yt(newValue)}.`);
|
|
4882
4881
|
}
|
|
4883
4882
|
validateSlotLabel(newValue) {
|
|
4884
4883
|
if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.display !== 'boolean'))
|
|
4885
|
-
throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type. Passed value: ${
|
|
4884
|
+
throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type. Passed value: ${Yt(newValue)}.`);
|
|
4886
4885
|
else if (typeof newValue.label !== 'string')
|
|
4887
4886
|
this.slotlabel.label = this.messages.menuLabel;
|
|
4888
4887
|
}
|
|
4889
4888
|
validateSize(newValue) {
|
|
4890
4889
|
if (newValue && !sizes$5.includes(newValue))
|
|
4891
|
-
throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type. Passed value: ${
|
|
4890
|
+
throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type. Passed value: ${Yt(newValue)}.`);
|
|
4892
4891
|
}
|
|
4893
4892
|
/*************
|
|
4894
4893
|
* Lifecycle *
|
|
@@ -5021,12 +5020,12 @@ const MgMenu = class {
|
|
|
5021
5020
|
}
|
|
5022
5021
|
validateLabel(newValue) {
|
|
5023
5022
|
if (newValue === undefined && !this.element.hasAttribute('aria-label')) {
|
|
5024
|
-
throw new Error(`<${this.name}> prop "label" is required. Passed value: ${
|
|
5023
|
+
throw new Error(`<${this.name}> prop "label" is required. Passed value: ${Yt(newValue)}.`);
|
|
5025
5024
|
}
|
|
5026
5025
|
}
|
|
5027
5026
|
validateDirection(newValue) {
|
|
5028
5027
|
if (![directions$1.VERTICAL, directions$1.HORIZONTAL].includes(newValue)) {
|
|
5029
|
-
throw new Error(`<${this.name}> prop "direction" must be one of: ${directions$1.HORIZONTAL}, ${directions$1.VERTICAL}. Passed value: ${
|
|
5028
|
+
throw new Error(`<${this.name}> prop "direction" must be one of: ${directions$1.HORIZONTAL}, ${directions$1.VERTICAL}. Passed value: ${Yt(newValue)}.`);
|
|
5030
5029
|
}
|
|
5031
5030
|
else {
|
|
5032
5031
|
this.updateMenuItems();
|
|
@@ -5042,7 +5041,7 @@ const MgMenu = class {
|
|
|
5042
5041
|
}
|
|
5043
5042
|
validateSize(newValue) {
|
|
5044
5043
|
if (!sizes$5.includes(newValue)) {
|
|
5045
|
-
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes$5.join(', ')}. Passed value: ${
|
|
5044
|
+
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes$5.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
5046
5045
|
}
|
|
5047
5046
|
}
|
|
5048
5047
|
/**
|
|
@@ -5140,7 +5139,7 @@ const MgMenuItem = class {
|
|
|
5140
5139
|
/**
|
|
5141
5140
|
* Identifier is used to control mg-popover
|
|
5142
5141
|
*/
|
|
5143
|
-
this.identifier =
|
|
5142
|
+
this.identifier = Dt('mg-menu-item');
|
|
5144
5143
|
/**
|
|
5145
5144
|
* Define menu-item status.
|
|
5146
5145
|
*/
|
|
@@ -5159,7 +5158,7 @@ const MgMenuItem = class {
|
|
|
5159
5158
|
/**
|
|
5160
5159
|
* Component button classes
|
|
5161
5160
|
*/
|
|
5162
|
-
this.navigationButtonClassList = new
|
|
5161
|
+
this.navigationButtonClassList = new qt([this.navigationButton]);
|
|
5163
5162
|
/**
|
|
5164
5163
|
* Does component have children.
|
|
5165
5164
|
*/
|
|
@@ -5318,8 +5317,8 @@ const MgMenuItem = class {
|
|
|
5318
5317
|
this.renderSlot = () => h("slot", null);
|
|
5319
5318
|
}
|
|
5320
5319
|
watchIdentifier(newValue) {
|
|
5321
|
-
if (!
|
|
5322
|
-
console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${
|
|
5320
|
+
if (!Bt(newValue)) {
|
|
5321
|
+
console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
5323
5322
|
}
|
|
5324
5323
|
else {
|
|
5325
5324
|
this.popoverIdentifier = `${this.identifier}-popover`;
|
|
@@ -5327,7 +5326,7 @@ const MgMenuItem = class {
|
|
|
5327
5326
|
}
|
|
5328
5327
|
watchTarget(newValue) {
|
|
5329
5328
|
if (newValue && !targets.includes(newValue)) {
|
|
5330
|
-
throw new Error(`<mg-link> prop "target" must be one of: ${targets.join(', ')}. Passed value: ${
|
|
5329
|
+
throw new Error(`<mg-link> prop "target" must be one of: ${targets.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
5331
5330
|
}
|
|
5332
5331
|
}
|
|
5333
5332
|
watchStatus(newValue, oldValue) {
|
|
@@ -5337,7 +5336,7 @@ const MgMenuItem = class {
|
|
|
5337
5336
|
}
|
|
5338
5337
|
watchExpanded(newValue) {
|
|
5339
5338
|
if (typeof newValue !== 'boolean') {
|
|
5340
|
-
throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${
|
|
5339
|
+
throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${Yt(newValue)}.`);
|
|
5341
5340
|
}
|
|
5342
5341
|
else {
|
|
5343
5342
|
this.updateExpanded(newValue);
|
|
@@ -5452,7 +5451,7 @@ const MgMenuItem = class {
|
|
|
5452
5451
|
* @returns promise process wich emit the 'item-updated' event
|
|
5453
5452
|
*/
|
|
5454
5453
|
componentShouldUpdate() {
|
|
5455
|
-
return
|
|
5454
|
+
return er(() => {
|
|
5456
5455
|
this.itemUpdated.emit();
|
|
5457
5456
|
});
|
|
5458
5457
|
}
|
|
@@ -5529,7 +5528,7 @@ const MgMessage = class {
|
|
|
5529
5528
|
/**
|
|
5530
5529
|
* Component classes
|
|
5531
5530
|
*/
|
|
5532
|
-
this.classCollection = new
|
|
5531
|
+
this.classCollection = new qt(['mg-c-message']);
|
|
5533
5532
|
/**
|
|
5534
5533
|
* Define if component is using actions slot
|
|
5535
5534
|
*/
|
|
@@ -5553,7 +5552,7 @@ const MgMessage = class {
|
|
|
5553
5552
|
}
|
|
5554
5553
|
watchVariant(newValue, oldValue) {
|
|
5555
5554
|
if (!variants$1.includes(newValue)) {
|
|
5556
|
-
throw new Error(`<mg-message> prop "variant" must be one of: ${variants$1.join(', ')}. Passed value: ${
|
|
5555
|
+
throw new Error(`<mg-message> prop "variant" must be one of: ${variants$1.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
5557
5556
|
}
|
|
5558
5557
|
else {
|
|
5559
5558
|
if (newValue !== undefined)
|
|
@@ -5564,7 +5563,7 @@ const MgMessage = class {
|
|
|
5564
5563
|
}
|
|
5565
5564
|
watchVariantStyle(newValue, oldValue) {
|
|
5566
5565
|
if (!variantStyles.includes(newValue)) {
|
|
5567
|
-
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${
|
|
5566
|
+
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
5568
5567
|
}
|
|
5569
5568
|
else {
|
|
5570
5569
|
if (newValue !== undefined)
|
|
@@ -5623,7 +5622,7 @@ const MgModal = class {
|
|
|
5623
5622
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
5624
5623
|
* If not set, it will be created.
|
|
5625
5624
|
*/
|
|
5626
|
-
this.identifier =
|
|
5625
|
+
this.identifier = Dt('mg-modal');
|
|
5627
5626
|
/**
|
|
5628
5627
|
* Modal dialog role.
|
|
5629
5628
|
*/
|
|
@@ -5643,7 +5642,7 @@ const MgModal = class {
|
|
|
5643
5642
|
/**
|
|
5644
5643
|
* Component classes
|
|
5645
5644
|
*/
|
|
5646
|
-
this.classCollection = new
|
|
5645
|
+
this.classCollection = new qt(['mg-c-modal']);
|
|
5647
5646
|
/***********
|
|
5648
5647
|
* Handles *
|
|
5649
5648
|
***********/
|
|
@@ -5656,17 +5655,17 @@ const MgModal = class {
|
|
|
5656
5655
|
};
|
|
5657
5656
|
}
|
|
5658
5657
|
watchIdentifier(newValue) {
|
|
5659
|
-
if (!
|
|
5660
|
-
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${
|
|
5658
|
+
if (!Bt(newValue)) {
|
|
5659
|
+
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
5661
5660
|
}
|
|
5662
5661
|
}
|
|
5663
5662
|
validateDialogRole(newValue) {
|
|
5664
5663
|
if (!dialogRoles.includes(newValue))
|
|
5665
|
-
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${
|
|
5664
|
+
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
5666
5665
|
}
|
|
5667
5666
|
validateModalTitle(newValue) {
|
|
5668
5667
|
if (!qe(newValue)) {
|
|
5669
|
-
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${
|
|
5668
|
+
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${Yt(newValue)}.`);
|
|
5670
5669
|
}
|
|
5671
5670
|
}
|
|
5672
5671
|
watchOpen(newValue) {
|
|
@@ -5768,7 +5767,7 @@ const MgPagination = class {
|
|
|
5768
5767
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
5769
5768
|
* If not set, it will be created.
|
|
5770
5769
|
*/
|
|
5771
|
-
this.identifier =
|
|
5770
|
+
this.identifier = Dt('mg-pagination');
|
|
5772
5771
|
/**
|
|
5773
5772
|
* Hide navigation label
|
|
5774
5773
|
*/
|
|
@@ -5813,18 +5812,18 @@ const MgPagination = class {
|
|
|
5813
5812
|
};
|
|
5814
5813
|
}
|
|
5815
5814
|
watchIdentifier(newValue) {
|
|
5816
|
-
if (!
|
|
5817
|
-
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${
|
|
5815
|
+
if (!Bt(newValue)) {
|
|
5816
|
+
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
5818
5817
|
}
|
|
5819
5818
|
}
|
|
5820
5819
|
validateTotalPages(newValue) {
|
|
5821
5820
|
if (newValue < 1) {
|
|
5822
|
-
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${
|
|
5821
|
+
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${Yt(newValue)}.`);
|
|
5823
5822
|
}
|
|
5824
5823
|
}
|
|
5825
5824
|
validateCurrentPage(newValue) {
|
|
5826
5825
|
if (newValue < 1) {
|
|
5827
|
-
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${
|
|
5826
|
+
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${Yt(newValue)}.`);
|
|
5828
5827
|
}
|
|
5829
5828
|
else if (newValue > this.totalPages) {
|
|
5830
5829
|
throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page.');
|
|
@@ -5888,7 +5887,7 @@ const MgPanel = class {
|
|
|
5888
5887
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
5889
5888
|
* If not set, it will be created.
|
|
5890
5889
|
*/
|
|
5891
|
-
this.identifier =
|
|
5890
|
+
this.identifier = Dt('mg-panel');
|
|
5892
5891
|
/**
|
|
5893
5892
|
* Define if panel title is editable
|
|
5894
5893
|
*/
|
|
@@ -5912,7 +5911,7 @@ const MgPanel = class {
|
|
|
5912
5911
|
/**
|
|
5913
5912
|
* Component classes
|
|
5914
5913
|
*/
|
|
5915
|
-
this.classCollection = new
|
|
5914
|
+
this.classCollection = new qt(['mg-c-panel']);
|
|
5916
5915
|
/**
|
|
5917
5916
|
* Title is in edition mode
|
|
5918
5917
|
*/
|
|
@@ -6011,13 +6010,13 @@ const MgPanel = class {
|
|
|
6011
6010
|
};
|
|
6012
6011
|
}
|
|
6013
6012
|
watchIdentifier(newValue) {
|
|
6014
|
-
if (!
|
|
6015
|
-
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${
|
|
6013
|
+
if (!Bt(newValue)) {
|
|
6014
|
+
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
6016
6015
|
}
|
|
6017
6016
|
}
|
|
6018
6017
|
validatePanelTitle(newValue) {
|
|
6019
6018
|
if (!qe(newValue))
|
|
6020
|
-
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${
|
|
6019
|
+
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
6021
6020
|
this.titleChange.emit(newValue);
|
|
6022
6021
|
}
|
|
6023
6022
|
validateTitlePattern(newValue) {
|
|
@@ -6026,14 +6025,14 @@ const MgPanel = class {
|
|
|
6026
6025
|
}
|
|
6027
6026
|
validateTitlePosition(newValue) {
|
|
6028
6027
|
if (!titlePositions.includes(newValue))
|
|
6029
|
-
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${
|
|
6028
|
+
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
6030
6029
|
}
|
|
6031
6030
|
handleExpanded(newValue) {
|
|
6032
6031
|
this.expandedChange.emit(newValue);
|
|
6033
6032
|
}
|
|
6034
6033
|
validateExpandToggleDisplay(newValue) {
|
|
6035
6034
|
if (!expandToggleDisplays.includes(newValue))
|
|
6036
|
-
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${
|
|
6035
|
+
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
6037
6036
|
if (newValue === 'icon' && this.titleEditable)
|
|
6038
6037
|
this.titleEditable = false;
|
|
6039
6038
|
}
|
|
@@ -7883,7 +7882,7 @@ const MgPopover = class {
|
|
|
7883
7882
|
* Sets an `id` attribute.
|
|
7884
7883
|
* Needed by the input for accessibility `aria-decribedby`.
|
|
7885
7884
|
*/
|
|
7886
|
-
this.identifier =
|
|
7885
|
+
this.identifier = Dt('mg-popover');
|
|
7887
7886
|
/**
|
|
7888
7887
|
* Popover placement
|
|
7889
7888
|
*/
|
|
@@ -8002,8 +8001,8 @@ const MgPopover = class {
|
|
|
8002
8001
|
};
|
|
8003
8002
|
}
|
|
8004
8003
|
validateIdentifier(newValue) {
|
|
8005
|
-
if (!
|
|
8006
|
-
throw new Error(`<mg-popover> prop "identifier" value is invalid. Passed value: ${
|
|
8004
|
+
if (!Bt(newValue)) {
|
|
8005
|
+
throw new Error(`<mg-popover> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
8007
8006
|
}
|
|
8008
8007
|
// use renderPopoverContent to update popover-content id
|
|
8009
8008
|
this.renderPopoverContent();
|
|
@@ -8040,7 +8039,7 @@ const MgPopover = class {
|
|
|
8040
8039
|
*/
|
|
8041
8040
|
componentWillLoad() {
|
|
8042
8041
|
// Get windows to attach events
|
|
8043
|
-
this.windows =
|
|
8042
|
+
this.windows = Kt(window);
|
|
8044
8043
|
// render mg-popover-content slot
|
|
8045
8044
|
this.renderPopoverContent();
|
|
8046
8045
|
this.validateCloseButton(this.closeButton);
|
|
@@ -8138,7 +8137,7 @@ const MgPopoverContent = class {
|
|
|
8138
8137
|
/**
|
|
8139
8138
|
* Component classes
|
|
8140
8139
|
*/
|
|
8141
|
-
this.classCollection = new
|
|
8140
|
+
this.classCollection = new qt(['mg-c-popover-content']);
|
|
8142
8141
|
/**
|
|
8143
8142
|
* Handle action for close button
|
|
8144
8143
|
*/
|
|
@@ -8162,7 +8161,7 @@ const MgPopoverContent = class {
|
|
|
8162
8161
|
componentDidLoad() {
|
|
8163
8162
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
8164
8163
|
const slottedTitleElement = this.element.querySelector('[slot="title"]');
|
|
8165
|
-
if (slottedTitleElement && !
|
|
8164
|
+
if (slottedTitleElement && !Jt(slottedTitleElement, headingTags)) {
|
|
8166
8165
|
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}.`);
|
|
8167
8166
|
}
|
|
8168
8167
|
}
|
|
@@ -8302,11 +8301,11 @@ const MgTable = class {
|
|
|
8302
8301
|
/**
|
|
8303
8302
|
* Class collection
|
|
8304
8303
|
*/
|
|
8305
|
-
this.classCollection = new
|
|
8304
|
+
this.classCollection = new qt([this.componentClass]);
|
|
8306
8305
|
}
|
|
8307
8306
|
watchSize(newValue, oldValue) {
|
|
8308
8307
|
if (!sizes$1.includes(newValue)) {
|
|
8309
|
-
throw new Error(`<mg-table> prop "size" must be one of: ${sizes$1.join(', ')}. Passed value: ${
|
|
8308
|
+
throw new Error(`<mg-table> prop "size" must be one of: ${sizes$1.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
8310
8309
|
}
|
|
8311
8310
|
else {
|
|
8312
8311
|
if (oldValue !== undefined) {
|
|
@@ -8325,7 +8324,7 @@ const MgTable = class {
|
|
|
8325
8324
|
}
|
|
8326
8325
|
watchColumns(newValue) {
|
|
8327
8326
|
if (newValue !== undefined && !isValidColumnsObject(newValue)) {
|
|
8328
|
-
throw new Error(`<mg-table> prop "columns" must be a ColumnsType object. Passed value: ${
|
|
8327
|
+
throw new Error(`<mg-table> prop "columns" must be a ColumnsType object. Passed value: ${Yt(newValue)}.`);
|
|
8329
8328
|
}
|
|
8330
8329
|
}
|
|
8331
8330
|
/**
|
|
@@ -8455,7 +8454,7 @@ const MgTable = class {
|
|
|
8455
8454
|
captionTable.className = 'mg-u-visually-hidden';
|
|
8456
8455
|
// Link caption to div
|
|
8457
8456
|
if (!qe(captionTable.id)) {
|
|
8458
|
-
captionTable.setAttribute('id',
|
|
8457
|
+
captionTable.setAttribute('id', Dt(`${this.componentClass}-caption`));
|
|
8459
8458
|
}
|
|
8460
8459
|
divWrapper.setAttribute('aria-labelledby', captionTable.id);
|
|
8461
8460
|
// Add sortable caption if neeeded
|
|
@@ -8539,7 +8538,7 @@ const MgTabs = class {
|
|
|
8539
8538
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
8540
8539
|
* If not set, it will be created.
|
|
8541
8540
|
*/
|
|
8542
|
-
this.identifier =
|
|
8541
|
+
this.identifier = Dt('mg-tabs');
|
|
8543
8542
|
/**
|
|
8544
8543
|
* Define tabs size
|
|
8545
8544
|
*/
|
|
@@ -8551,7 +8550,7 @@ const MgTabs = class {
|
|
|
8551
8550
|
/**
|
|
8552
8551
|
* Component classes
|
|
8553
8552
|
*/
|
|
8554
|
-
this.classCollection = new
|
|
8553
|
+
this.classCollection = new qt(['mg-c-tabs']);
|
|
8555
8554
|
/**
|
|
8556
8555
|
* Validate that new tab status can be `Status.ACTIVE`
|
|
8557
8556
|
* @param tab - tab item
|
|
@@ -8649,7 +8648,7 @@ const MgTabs = class {
|
|
|
8649
8648
|
*/
|
|
8650
8649
|
this.resetFocus = () => {
|
|
8651
8650
|
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
8652
|
-
|
|
8651
|
+
er(() => {
|
|
8653
8652
|
this.tabFocus = undefined;
|
|
8654
8653
|
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
8655
8654
|
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
@@ -8666,30 +8665,30 @@ const MgTabs = class {
|
|
|
8666
8665
|
};
|
|
8667
8666
|
}
|
|
8668
8667
|
watchIdentifier(newValue) {
|
|
8669
|
-
if (!
|
|
8670
|
-
console.error(`<mg-tabs> prop "identifier" value is invalid. Passed value: ${
|
|
8668
|
+
if (!Bt(newValue)) {
|
|
8669
|
+
console.error(`<mg-tabs> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
8671
8670
|
}
|
|
8672
8671
|
}
|
|
8673
8672
|
validateLabel(newValue) {
|
|
8674
8673
|
if (!qe(newValue)) {
|
|
8675
|
-
throw new Error(`<mg-tabs> prop "label" is required and must be a string. Passed value: ${
|
|
8674
|
+
throw new Error(`<mg-tabs> prop "label" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
8676
8675
|
}
|
|
8677
8676
|
}
|
|
8678
8677
|
validateSize(newValue) {
|
|
8679
8678
|
if (!sizes.includes(newValue)) {
|
|
8680
|
-
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${
|
|
8679
|
+
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
8681
8680
|
}
|
|
8682
8681
|
this.classCollection.add(`mg-c-tabs--size-${this.size}`);
|
|
8683
8682
|
}
|
|
8684
8683
|
validateItems(newValue) {
|
|
8685
8684
|
// String array
|
|
8686
|
-
if (
|
|
8685
|
+
if (Gt(newValue))
|
|
8687
8686
|
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
8688
8687
|
// Object array
|
|
8689
8688
|
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
8690
8689
|
this.tabs = newValue;
|
|
8691
8690
|
else
|
|
8692
|
-
throw new Error(`<mg-tabs> prop "items" is required and all items must be the same type: TabItem. Passed value: ${
|
|
8691
|
+
throw new Error(`<mg-tabs> prop "items" is required and all items must be the same type: TabItem. Passed value: ${Yt(newValue)}.`);
|
|
8693
8692
|
}
|
|
8694
8693
|
validateActiveTab(newValue) {
|
|
8695
8694
|
// when `active-tab` is undefined we set default value by searching an item with `Status.ACTIVE` or we use the `startIndex` has fallback value
|
|
@@ -8714,7 +8713,7 @@ const MgTabs = class {
|
|
|
8714
8713
|
this.activeTabChange.emit(newValue);
|
|
8715
8714
|
}
|
|
8716
8715
|
else {
|
|
8717
|
-
throw new Error(`<mg-tabs> prop "activeTab" must be a number between ${this.startIndex} and ${this.tabs.length} and new value must be "activable". Passed value: ${
|
|
8716
|
+
throw new Error(`<mg-tabs> prop "activeTab" must be a number between ${this.startIndex} and ${this.tabs.length} and new value must be "activable". Passed value: ${Yt(newValue)}.`);
|
|
8718
8717
|
}
|
|
8719
8718
|
}
|
|
8720
8719
|
/*************
|
|
@@ -8799,11 +8798,11 @@ const MgTag = class {
|
|
|
8799
8798
|
/**
|
|
8800
8799
|
* Component classes
|
|
8801
8800
|
*/
|
|
8802
|
-
this.classCollection = new
|
|
8801
|
+
this.classCollection = new qt(['mg-c-tag']);
|
|
8803
8802
|
}
|
|
8804
8803
|
validateVariant(newValue, oldValue) {
|
|
8805
8804
|
if (!variants.includes(newValue)) {
|
|
8806
|
-
throw new Error(`<mg-tag> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${
|
|
8805
|
+
throw new Error(`<mg-tag> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
8807
8806
|
}
|
|
8808
8807
|
else {
|
|
8809
8808
|
if (oldValue !== undefined) {
|
|
@@ -8889,7 +8888,7 @@ const MgTooltip = class {
|
|
|
8889
8888
|
* Sets an `id` attribute.
|
|
8890
8889
|
* Needed by the input for accessibility `aria-decribedby`.
|
|
8891
8890
|
*/
|
|
8892
|
-
this.identifier =
|
|
8891
|
+
this.identifier = Dt('mg-tooltip');
|
|
8893
8892
|
/**
|
|
8894
8893
|
* Tooltip placement
|
|
8895
8894
|
*/
|
|
@@ -8911,7 +8910,7 @@ const MgTooltip = class {
|
|
|
8911
8910
|
// Enable the event listeners
|
|
8912
8911
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
8913
8912
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
8914
|
-
|
|
8913
|
+
er(() => {
|
|
8915
8914
|
this.windows.forEach((localWindow) => {
|
|
8916
8915
|
localWindow.addEventListener('click', this.handleClickOutside, false);
|
|
8917
8916
|
localWindow.addEventListener('keydown', this.handlePressEscape, false);
|
|
@@ -9109,15 +9108,15 @@ const MgTooltip = class {
|
|
|
9109
9108
|
};
|
|
9110
9109
|
}
|
|
9111
9110
|
watchIdentifier(newValue) {
|
|
9112
|
-
if (!
|
|
9113
|
-
throw new Error(`<mg-tooltip> prop "identifier" value is invalid. Passed value: ${
|
|
9111
|
+
if (!Bt(newValue)) {
|
|
9112
|
+
throw new Error(`<mg-tooltip> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
9114
9113
|
}
|
|
9115
9114
|
// use renderTooltipContent to update tooltip-content id
|
|
9116
9115
|
this.renderTooltipContent();
|
|
9117
9116
|
}
|
|
9118
9117
|
watchMessage(newValue) {
|
|
9119
9118
|
if (!qe(newValue)) {
|
|
9120
|
-
throw new Error(`<mg-tooltip> prop "message" is required and must be a string. Passed value: ${
|
|
9119
|
+
throw new Error(`<mg-tooltip> prop "message" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
9121
9120
|
}
|
|
9122
9121
|
if (this.mgTooltipContent !== undefined)
|
|
9123
9122
|
this.mgTooltipContent.message = newValue;
|
|
@@ -9172,7 +9171,7 @@ const MgTooltip = class {
|
|
|
9172
9171
|
*/
|
|
9173
9172
|
componentWillLoad() {
|
|
9174
9173
|
// Get windows to attach events
|
|
9175
|
-
this.windows =
|
|
9174
|
+
this.windows = Kt(window);
|
|
9176
9175
|
// Get tooltip element
|
|
9177
9176
|
this.renderTooltipContent();
|
|
9178
9177
|
//validate properties
|
|
@@ -9190,7 +9189,7 @@ const MgTooltip = class {
|
|
|
9190
9189
|
// get slotted element wich is not the tooltip
|
|
9191
9190
|
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
9192
9191
|
// Get interactive element
|
|
9193
|
-
const interactiveElement = slotElement.matches(
|
|
9192
|
+
const interactiveElement = slotElement.matches(Xt) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(Xt);
|
|
9194
9193
|
this.setTooltipedElement(interactiveElement || slotElement);
|
|
9195
9194
|
// Check if slotted element is a disabled mg-button
|
|
9196
9195
|
// In this case we wrap the mg-button into a div to enable the tooltip
|