@mgdis/mg-components 5.23.2 → 5.25.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/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/{index-775fad7b.js → index-ebdb6669.js} +29 -22
- package/dist/cjs/index-ebdb6669.js.map +1 -0
- package/dist/cjs/{mg-menu.conf-0229bb75.js → index-f699ee11.js} +14 -20
- package/dist/cjs/index-f699ee11.js.map +1 -0
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/mg-action-more_34.cjs.entry.js +312 -215
- package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +6 -4
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +5 -4
- package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-loader.cjs.entry.js +49 -0
- package/dist/cjs/mg-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/mg-menu.conf-c291eee6.js +18 -0
- package/dist/cjs/mg-menu.conf-c291eee6.js.map +1 -0
- package/dist/collection/assets/icons/index.js +25 -13
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +34 -27
- package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +4 -6
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -5
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +27 -5
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +86 -9
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +26 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +26 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +26 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +29 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +27 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +43 -14
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +45 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +90 -0
- package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +5 -2
- package/dist/collection/locales/fr/messages.json +4 -1
- package/dist/collection/styles/global.css +1 -1
- package/dist/components/MgInput.js +39 -30
- package/dist/components/MgInput.js.map +1 -1
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +13 -5
- package/dist/components/index2.js.map +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-divider.js +1 -1
- package/dist/components/mg-form.js +29 -7
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon2.js +37 -13
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-input-checkbox-paginated2.js +5 -7
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +20 -6
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +5 -6
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.js +30 -5
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.js +4 -2
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.js +4 -2
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-select2.js +4 -2
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +6 -4
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.js +4 -2
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title2.js +2 -2
- package/dist/components/mg-input-title2.js.map +1 -1
- package/dist/components/mg-input-toggle.js +21 -14
- package/dist/components/mg-input-toggle.js.map +1 -1
- package/dist/components/mg-loader.d.ts +11 -0
- package/dist/components/mg-loader.js +76 -0
- package/dist/components/mg-loader.js.map +1 -0
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-modal.js +2 -2
- package/dist/components/mg-pagination2.js +2 -2
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/{index-9aa447a7.js → index-2d384413.js} +29 -22
- package/dist/esm/index-2d384413.js.map +1 -0
- package/dist/esm/{mg-menu.conf-4b2d2eab.js → index-d2fc6ec0.js} +15 -20
- package/dist/esm/index-d2fc6ec0.js.map +1 -0
- package/dist/esm/loader.js +6 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/mg-action-more_34.entry.js +213 -116
- package/dist/esm/mg-action-more_34.entry.js.map +1 -1
- package/dist/esm/mg-components.js +7 -5
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-item-more.entry.js +3 -2
- package/dist/esm/mg-item-more.entry.js.map +1 -1
- package/dist/esm/mg-loader.entry.js +45 -0
- package/dist/esm/mg-loader.entry.js.map +1 -0
- package/dist/esm/mg-menu.conf-9609bcb2.js +16 -0
- package/dist/esm/mg-menu.conf-9609bcb2.js.map +1 -0
- package/dist/mg-components/locales/en/messages.json +5 -2
- package/dist/mg-components/locales/fr/messages.json +4 -1
- package/dist/mg-components/mg-components.css +1 -1
- 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-29b5a514.js +2 -0
- package/dist/mg-components/p-29b5a514.js.map +1 -0
- package/dist/mg-components/p-2de004ac.entry.js +2 -0
- package/dist/mg-components/{p-06715c36.entry.js.map → p-2de004ac.entry.js.map} +1 -1
- package/dist/mg-components/{p-4e7a7f68.js → p-5505ce04.js} +2 -2
- package/dist/mg-components/p-5505ce04.js.map +1 -0
- package/dist/mg-components/p-7f0e10ef.entry.js +2 -0
- package/dist/mg-components/p-7f0e10ef.entry.js.map +1 -0
- package/dist/mg-components/p-c265fca1.entry.js +2 -0
- package/dist/mg-components/p-c265fca1.entry.js.map +1 -0
- package/dist/mg-components/p-e1255160.js +2 -0
- package/dist/mg-components/p-e1255160.js.map +1 -0
- package/dist/mg-components/p-fe935e54.js +2 -0
- package/dist/mg-components/p-fe935e54.js.map +1 -0
- package/dist/mg-components/styles/global.css +1 -1
- package/dist/types/assets/icons/index.d.ts +12 -0
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +26 -0
- package/dist/types/components/molecules/inputs/MgInput.d.ts +1 -22
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +10 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -1
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +14 -2
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +5 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +5 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +6 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +6 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +16 -7
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +6 -0
- package/dist/types/components/molecules/mg-loader/mg-loader.d.ts +34 -0
- package/dist/types/components.d.ts +127 -8
- package/package.json +29 -29
- package/dist/cjs/index-775fad7b.js.map +0 -1
- package/dist/cjs/mg-menu.conf-0229bb75.js.map +0 -1
- package/dist/collection/locales/index.spec.js +0 -27
- package/dist/collection/locales/index.spec.js.map +0 -1
- package/dist/collection/stories/icon-gallery.js +0 -10
- package/dist/collection/stories/icon-gallery.js.map +0 -1
- package/dist/collection/utils/behaviors.utils.spec.js +0 -61
- package/dist/collection/utils/behaviors.utils.spec.js.map +0 -1
- package/dist/esm/index-9aa447a7.js.map +0 -1
- package/dist/esm/mg-menu.conf-4b2d2eab.js.map +0 -1
- package/dist/mg-components/p-06715c36.entry.js +0 -2
- package/dist/mg-components/p-1564df7a.js +0 -2
- package/dist/mg-components/p-1564df7a.js.map +0 -1
- package/dist/mg-components/p-4e7a7f68.js.map +0 -1
- package/dist/mg-components/p-fee35953.entry.js +0 -2
- package/dist/mg-components/p-fee35953.entry.js.map +0 -1
- package/dist/types/stories/icon-gallery.d.ts +0 -6
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
5
|
+
const index = require('./index-ebdb6669.js');
|
|
6
|
+
const index$1 = require('./index-f699ee11.js');
|
|
7
|
+
const mgMenu_conf = require('./mg-menu.conf-c291eee6.js');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Available menu-item positions
|
|
@@ -62,7 +63,7 @@ const MgActionMore = class {
|
|
|
62
63
|
************/
|
|
63
64
|
this.name = 'mg-action-more';
|
|
64
65
|
this.classBase = 'mg-c-action-more';
|
|
65
|
-
this.mgPopoverIdentifier =
|
|
66
|
+
this.mgPopoverIdentifier = index$1.je(this.name);
|
|
66
67
|
/************
|
|
67
68
|
* Methods *
|
|
68
69
|
***********/
|
|
@@ -130,7 +131,7 @@ const MgActionMore = class {
|
|
|
130
131
|
* Validate props
|
|
131
132
|
*/
|
|
132
133
|
componentWillLoad() {
|
|
133
|
-
this.messages =
|
|
134
|
+
this.messages = index$1.initLocales(this.element).messages.actionMore;
|
|
134
135
|
this.validateItems(this.items);
|
|
135
136
|
this.validateButton(this.button);
|
|
136
137
|
this.validateIcon(this.icon);
|
|
@@ -186,7 +187,7 @@ const MgBadge = class {
|
|
|
186
187
|
this.label = undefined;
|
|
187
188
|
this.variant = variants$5[0];
|
|
188
189
|
this.outline = undefined;
|
|
189
|
-
this.classCollection = new
|
|
190
|
+
this.classCollection = new index$1.Fe(['mg-c-badge']);
|
|
190
191
|
}
|
|
191
192
|
validateValue(newValue) {
|
|
192
193
|
if (/^(\d+\+*|[?*!a-z])$/i.exec(`${newValue}`) === null) {
|
|
@@ -194,7 +195,7 @@ const MgBadge = class {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
validateLabel(newValue) {
|
|
197
|
-
if (!
|
|
198
|
+
if (!index$1.He(newValue)) {
|
|
198
199
|
throw new Error('<mg-badge> prop "label" is required.');
|
|
199
200
|
}
|
|
200
201
|
}
|
|
@@ -305,7 +306,7 @@ const MgButton = class {
|
|
|
305
306
|
this.isIcon = false;
|
|
306
307
|
this.disableOnClick = false;
|
|
307
308
|
this.loading = false;
|
|
308
|
-
this.classCollection = new
|
|
309
|
+
this.classCollection = new index$1.Fe(['mg-c-button']);
|
|
309
310
|
}
|
|
310
311
|
validateVariant(newValue, oldValue) {
|
|
311
312
|
if (!variants$4.includes(newValue)) {
|
|
@@ -364,7 +365,7 @@ const MgButton = class {
|
|
|
364
365
|
this.validateFullWidth(this.fullWidth);
|
|
365
366
|
if (this.isIcon) {
|
|
366
367
|
this.classCollection.add(`mg-c-button--icon`);
|
|
367
|
-
if (!
|
|
368
|
+
if (!index$1.He(this.label)) {
|
|
368
369
|
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
369
370
|
}
|
|
370
371
|
}
|
|
@@ -376,7 +377,7 @@ const MgButton = class {
|
|
|
376
377
|
* Add listners
|
|
377
378
|
*/
|
|
378
379
|
componentDidLoad() {
|
|
379
|
-
|
|
380
|
+
index$1.Pe(() => {
|
|
380
381
|
var _a;
|
|
381
382
|
const closestForm = this.element.closest('form') || ((_a = this.element.closest('mg-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('form'));
|
|
382
383
|
// submit buttons should trigger form submition;
|
|
@@ -435,7 +436,7 @@ const MgCard = class {
|
|
|
435
436
|
};
|
|
436
437
|
this.variant = undefined;
|
|
437
438
|
this.variantStyle = undefined;
|
|
438
|
-
this.classCollection = new
|
|
439
|
+
this.classCollection = new index$1.Fe([this.classBase]);
|
|
439
440
|
}
|
|
440
441
|
validateVariant(newValue, oldValue) {
|
|
441
442
|
if (newValue && !variants$3.includes(newValue))
|
|
@@ -473,7 +474,7 @@ const MgCard = class {
|
|
|
473
474
|
*/
|
|
474
475
|
render() {
|
|
475
476
|
var _a;
|
|
476
|
-
return (index.h("div", { key: '
|
|
477
|
+
return (index.h("div", { key: '8eb3843ddbe71df4ae6a6f56896c1c68b5d8c17f', class: this.classCollection.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && index.h("span", { class: "mg-c-card__bar" }), index.h("slot", { key: '77d242d0d83844071e1ee8b62d1816cd732e13c1' })));
|
|
477
478
|
}
|
|
478
479
|
static get watchers() { return {
|
|
479
480
|
"variant": ["validateVariant"],
|
|
@@ -505,14 +506,14 @@ const MgCharacterLeft = class {
|
|
|
505
506
|
*/
|
|
506
507
|
componentWillLoad() {
|
|
507
508
|
this.validateMaxlength(this.maxlength);
|
|
508
|
-
this.messages =
|
|
509
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
509
510
|
}
|
|
510
511
|
/**
|
|
511
512
|
* Render component
|
|
512
513
|
* @returns HTML Element
|
|
513
514
|
*/
|
|
514
515
|
render() {
|
|
515
|
-
return (index.h("span", { key: '
|
|
516
|
+
return (index.h("span", { key: 'c18bde23c2d962cd943540eb182381de1c6dd791', id: this.identifier, "aria-live": "polite" }, index.h("span", { key: 'bf678c1d055607bbdc32a34fbf247fdd189f2d99', "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), index.h("span", { key: 'd18fc90eae95b1c807f6024a9681269b6552a1cf', class: "mg-u-visually-hidden" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
|
|
516
517
|
}
|
|
517
518
|
get element() { return index.getElement(this); }
|
|
518
519
|
static get watchers() { return {
|
|
@@ -540,7 +541,7 @@ const MgDetails = class {
|
|
|
540
541
|
this.expanded = false;
|
|
541
542
|
}
|
|
542
543
|
validateTitles(newValue) {
|
|
543
|
-
if (!
|
|
544
|
+
if (!index$1.He(newValue)) {
|
|
544
545
|
throw new Error('<mg-details> prop "toggleClosed" and "toggleOpened" must be defined.');
|
|
545
546
|
}
|
|
546
547
|
}
|
|
@@ -585,7 +586,7 @@ const MgDivider = class {
|
|
|
585
586
|
* @returns HTML Element
|
|
586
587
|
*/
|
|
587
588
|
render() {
|
|
588
|
-
return (index.h("div", { key: '
|
|
589
|
+
return (index.h("div", { key: 'fd34b566182d17e5cadbb19a923ce07b53cd749d', class: {
|
|
589
590
|
'mg-c-divider': true,
|
|
590
591
|
'mg-c-divider--full': this.size === 'full',
|
|
591
592
|
} }));
|
|
@@ -602,7 +603,7 @@ const roles = ['form', 'search', 'none', 'presentation'];
|
|
|
602
603
|
*/
|
|
603
604
|
const requiredMessageStatus = ['default', 'hide'];
|
|
604
605
|
|
|
605
|
-
const mgFormCss = ".mg-u-is-asterisk{color:hsl(var(--color-danger))}.mg-c-form{--mg-inputs-title-width:var(--mg-form-inputs-title-width,
|
|
606
|
+
const mgFormCss = ".mg-u-form-legacy{--mg-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk{color:hsl(var(--color-danger))}.mg-c-form{--mg-inputs-title-width:var(--mg-form-inputs-title-width, 23rem);--mg-inputs-margin-bottom:1.5rem;--mg-inputs-title-horizontal-space:3rem}.mg-c-form.mg-c-form--all-required{--mg-input-title-display:none}.mg-c-form.mg-c-form--label-on-top{--mg-inputs-margin-bottom:2.5rem}.mg-c-form>p{font-size:1.2rem}";
|
|
606
607
|
const MgFormStyle0 = mgFormCss;
|
|
607
608
|
|
|
608
609
|
const MgForm = class {
|
|
@@ -612,6 +613,7 @@ const MgForm = class {
|
|
|
612
613
|
this.formSubmit = index.createEvent(this, "form-submit", 7);
|
|
613
614
|
// Classes
|
|
614
615
|
this.classAllRequired = 'mg-c-form--all-required';
|
|
616
|
+
this.classLabelOnTop = 'mg-c-form--label-on-top';
|
|
615
617
|
/**
|
|
616
618
|
* Define required message based on mg-inputs required elements
|
|
617
619
|
*/
|
|
@@ -683,32 +685,49 @@ const MgForm = class {
|
|
|
683
685
|
// Set inputs readonly or disabled based on form configuration
|
|
684
686
|
// Othewise listen to events
|
|
685
687
|
this.mgInputs.forEach(input => {
|
|
686
|
-
if (this.
|
|
688
|
+
if (this.labelOnTop) {
|
|
689
|
+
input.labelOnTop = true;
|
|
690
|
+
}
|
|
691
|
+
if (this.readonly) {
|
|
687
692
|
input.readonly = true;
|
|
688
|
-
|
|
693
|
+
}
|
|
694
|
+
else if (this.disabled) {
|
|
689
695
|
input.disabled = true;
|
|
690
|
-
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
691
698
|
input.addEventListener('input-valid', this.checkValidity);
|
|
699
|
+
}
|
|
692
700
|
});
|
|
693
701
|
};
|
|
694
|
-
this.identifier =
|
|
702
|
+
this.identifier = index$1.je('mg-form');
|
|
695
703
|
this.name = this.identifier;
|
|
696
704
|
this.readonly = false;
|
|
697
705
|
this.requiredMessage = undefined;
|
|
698
706
|
this.ariaRole = undefined;
|
|
707
|
+
this.labelOnTop = undefined;
|
|
699
708
|
this.disabled = false;
|
|
700
709
|
this.valid = undefined;
|
|
701
710
|
this.invalid = undefined;
|
|
702
|
-
this.classCollection = new
|
|
711
|
+
this.classCollection = new index$1.Fe(['mg-c-form']);
|
|
703
712
|
this.requiredMessageText = undefined;
|
|
704
713
|
}
|
|
705
714
|
validateRequiredMessage(newValue) {
|
|
706
|
-
if (newValue && !requiredMessageStatus.includes(newValue))
|
|
715
|
+
if (newValue && !requiredMessageStatus.includes(newValue)) {
|
|
707
716
|
throw new Error(`<mg-form> prop "requiredMessage" must be one of: ${requiredMessageStatus.join(', ')}.`);
|
|
717
|
+
}
|
|
708
718
|
}
|
|
709
719
|
validateAriaRole(newValue) {
|
|
710
|
-
if (newValue && !roles.includes(newValue))
|
|
720
|
+
if (newValue && !roles.includes(newValue)) {
|
|
711
721
|
throw new Error(`<mg-form> prop "ariaRole" must be one of: ${roles.join(', ')}.`);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
handlelabelOnTop(newValue) {
|
|
725
|
+
if (newValue) {
|
|
726
|
+
this.classCollection.add(this.classLabelOnTop);
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
this.classCollection.delete(this.classLabelOnTop);
|
|
730
|
+
}
|
|
712
731
|
}
|
|
713
732
|
handleAttributeChange() {
|
|
714
733
|
this.setMgInputs();
|
|
@@ -734,9 +753,10 @@ const MgForm = class {
|
|
|
734
753
|
*/
|
|
735
754
|
componentWillLoad() {
|
|
736
755
|
// Get locales
|
|
737
|
-
this.messages =
|
|
756
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
738
757
|
this.validateAriaRole(this.ariaRole);
|
|
739
758
|
this.validateRequiredMessage(this.requiredMessage);
|
|
759
|
+
this.handlelabelOnTop(this.labelOnTop);
|
|
740
760
|
// Get slotted mgButtons
|
|
741
761
|
this.mgButtons = Array.from(this.element.querySelectorAll('mg-button'));
|
|
742
762
|
// Set button form identifier
|
|
@@ -770,12 +790,13 @@ const MgForm = class {
|
|
|
770
790
|
* @returns HTML Element
|
|
771
791
|
*/
|
|
772
792
|
render() {
|
|
773
|
-
return (index.h("form", { key: '
|
|
793
|
+
return (index.h("form", { key: 'd47d8321976d3daabbb72eacc0f951899b571ce0', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && index.h("p", { innerHTML: this.requiredMessageText }), index.h("slot", { key: '7f95819efbe74deb72e74fff313b4f6e0a8ae3a6' }), !this.readonly && !this.disabled && index.h("slot", { name: "actions" })));
|
|
774
794
|
}
|
|
775
795
|
get element() { return index.getElement(this); }
|
|
776
796
|
static get watchers() { return {
|
|
777
797
|
"requiredMessage": ["validateRequiredMessage", "handleAttributeChange"],
|
|
778
798
|
"ariaRole": ["validateAriaRole"],
|
|
799
|
+
"labelOnTop": ["handlelabelOnTop"],
|
|
779
800
|
"readonly": ["handleAttributeChange"],
|
|
780
801
|
"disabled": ["handleAttributeChange"]
|
|
781
802
|
}; }
|
|
@@ -857,6 +878,9 @@ const iconList = [
|
|
|
857
878
|
"conversation",
|
|
858
879
|
"conversation-outline",
|
|
859
880
|
"copy",
|
|
881
|
+
"copy-file",
|
|
882
|
+
"copy-file-outline",
|
|
883
|
+
"copy-outline",
|
|
860
884
|
"credit-card",
|
|
861
885
|
"cross",
|
|
862
886
|
"cross-circle",
|
|
@@ -893,7 +917,9 @@ const iconList = [
|
|
|
893
917
|
"file-word",
|
|
894
918
|
"file-word-outline",
|
|
895
919
|
"filter",
|
|
920
|
+
"filter-outline",
|
|
896
921
|
"floppy-disk",
|
|
922
|
+
"floppy-disk-outline",
|
|
897
923
|
"folder",
|
|
898
924
|
"folder-check",
|
|
899
925
|
"folder-check-outline",
|
|
@@ -921,12 +947,14 @@ const iconList = [
|
|
|
921
947
|
"laptop",
|
|
922
948
|
"life-ring",
|
|
923
949
|
"lines-rectangle",
|
|
950
|
+
"lines-rectangle-outline",
|
|
924
951
|
"link",
|
|
925
952
|
"list",
|
|
926
953
|
"loader",
|
|
927
954
|
"location",
|
|
928
955
|
"location-outline",
|
|
929
956
|
"lock",
|
|
957
|
+
"lock-outline",
|
|
930
958
|
"log-in",
|
|
931
959
|
"log-out",
|
|
932
960
|
"magnifying-glass",
|
|
@@ -950,11 +978,13 @@ const iconList = [
|
|
|
950
978
|
"phone",
|
|
951
979
|
"phone-outline",
|
|
952
980
|
"picture",
|
|
981
|
+
"picture-outline",
|
|
953
982
|
"play-circle",
|
|
954
983
|
"plus",
|
|
955
984
|
"plus-circle",
|
|
956
985
|
"question-circle",
|
|
957
986
|
"share",
|
|
987
|
+
"share-outline",
|
|
958
988
|
"shuffle",
|
|
959
989
|
"sitemap",
|
|
960
990
|
"sliders",
|
|
@@ -965,6 +995,8 @@ const iconList = [
|
|
|
965
995
|
"table",
|
|
966
996
|
"tag",
|
|
967
997
|
"tags",
|
|
998
|
+
"thumb-down",
|
|
999
|
+
"thumb-down-outline",
|
|
968
1000
|
"thumb-up",
|
|
969
1001
|
"thumb-up-outline",
|
|
970
1002
|
"thumbtack",
|
|
@@ -974,6 +1006,7 @@ const iconList = [
|
|
|
974
1006
|
"universal-access",
|
|
975
1007
|
"unlink",
|
|
976
1008
|
"unlock",
|
|
1009
|
+
"unlock-outline",
|
|
977
1010
|
"upload",
|
|
978
1011
|
"user",
|
|
979
1012
|
"user-circle",
|
|
@@ -1021,8 +1054,8 @@ const icons = {
|
|
|
1021
1054
|
'bell-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" d="M11.47 8.3v.297l.26.142 1.508.822c.455.248.28.939-.239.939H3.002c-.514 0-.694-.681-.247-.935l1.461-.83.253-.144V6a3.5 3.5 0 0 1 7 0zm-3.473 5.2a1.5 1.5 0 0 1-1.415-1h2.83a1.5 1.5 0 0 1-1.415 1Z"/></svg>',
|
|
1022
1055
|
'book': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-2H1.5a.5.5 0 0 1 0-1H3V9H1.5a.5.5 0 0 1 0-1H3V7H1.5a.5.5 0 0 1 0-1H3zm8 0H9v4h2z" clip-rule="evenodd"/></svg>',
|
|
1023
1056
|
'book-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M4 2a1 1 0 0 0-1 1v3H1.5a.5.5 0 0 0 0 1H3v1H1.5a.5.5 0 0 0 0 1H3v1H1.5a.5.5 0 0 0 0 1H3v2a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zm5 1H4v3h.5a.5.5 0 0 1 0 1H4v1h.5a.5.5 0 0 1 0 1H4v1h.5a.5.5 0 0 1 0 1H4v2h8V3h-1v4H9z" clip-rule="evenodd"/></svg>',
|
|
1024
|
-
'briefcase': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1025
|
-
'briefcase-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1057
|
+
'briefcase': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M5 4v1H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-3V4a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1m5 1V4H6v1z" clip-rule="evenodd"/></svg>',
|
|
1058
|
+
'briefcase-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M5 5V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1h3a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1-1h4v1H6zM2 6v7h12V6z" clip-rule="evenodd"/></svg>',
|
|
1026
1059
|
'building-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M4 2h8v12H9v-1a1 1 0 1 0-2 0v1H4zm4 13h4a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1zM7 4H5v2h2zm2 0h2v2H9zm2 4H9v2h2zM5 8h2v2H5z" clip-rule="evenodd"/></svg>',
|
|
1027
1060
|
'calculator': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.8.7H3.2c-.3 0-.5.2-.5.5v13.7c0 .3.2.5.5.5h9.7c.3 0 .5-.2.5-.5V1.2c-.1-.3-.3-.5-.6-.5M5.6 13.4q0 .3-.3.3H4.1q-.3 0-.3-.3v-1.2q0-.3.3-.3h1.2q.3 0 .3.3zm0-3.3q0 .3-.3.3H4.1q-.3 0-.3-.3V8.9q0-.3.3-.3h1.2q.3 0 .3.3zm3.3 3.3q0 .3-.3.3H7.4q-.3 0-.3-.3v-1.2q0-.3.3-.3h1.2q.3 0 .3.3zm0-3.3q0 .3-.3.3H7.4q-.3 0-.3-.3V8.9q0-.3.3-.3h1.2q.3 0 .3.3zm3.3 3.3q0 .3-.3.3h-1.2q-.3 0-.3-.3V8.9q0-.3.3-.3h1.2q.3 0 .3.3zm0-7.2q0 .3-.3.3H4.1q-.3 0-.3-.3V2.6q0-.3.3-.3h7.8q.3 0 .3.3z"/></svg>',
|
|
1028
1061
|
'calendar': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M14 3.5c0-.55-.45-1-1-1h-1v-1h-1v1H5v-1H4v1H3c-.55 0-1 .45-1 1v.98s0 .02.02.02H2v9c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-9h-.02s.02 0 .02-.02zm-11 10v-8h10v8z"/></svg>',
|
|
@@ -1051,7 +1084,10 @@ const icons = {
|
|
|
1051
1084
|
'comment-sms': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 2.67c-3.37 0-6.1 2.21-6.1 4.95.02 1.18.51 2.3 1.36 3.11-.26.85-.71 1.62-1.3 2.28a.2.2 0 0 0-.04.21c.03.07.1.11.17.11 1.22-.02 2.4-.45 3.34-1.22.82.31 1.68.46 2.56.46 3.37 0 6.1-2.22 6.1-4.95S11.37 2.67 8 2.67M4.95 8.39a.76.76 0 1 1 0-1.52.76.76 0 0 1 0 1.52m3.05 0a.76.76 0 1 1 0-1.52.76.76 0 0 1 0 1.52m3.05 0a.76.76 0 1 1-.02-1.52c.42 0 .77.33.77.75v.01c0 .42-.34.76-.76.76"/></svg>',
|
|
1052
1085
|
'conversation': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M1.01 6.51c0-1.93 2.23-3.5 4.99-3.5s4.99 1.57 4.99 3.5-2.23 3.5-4.99 3.5c-.36 0-.71-.03-1.05-.08l-2.26 1.05c-.06.03-.11.03-.17.03-.27 0-.5-.21-.5-.5V8.6c-.62-.58-1.01-1.3-1.01-2.09m10.48-.01c0-.5-.13-.97-.36-1.41h.01c2.22.36 3.88 1.75 3.88 3.41 0 .79-.39 1.5-1.02 2.09v1.91a.5.5 0 0 1-.67.47l-2.26-1.05c-.34.05-.69.08-1.05.08-1.69 0-3.19-.59-4.09-1.5h.12c3.03 0 5.44-1.81 5.44-4" clip-rule="evenodd"/></svg>',
|
|
1053
1086
|
'conversation-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10 6.5C10 5.14 8.17 4 6 4l-.01.01c-2.17 0-4 1.14-4 2.5 0 .59.38 1.06.7 1.36l.32.3v1.55l1.51-.7.27-.13.3.04c.31.05.62.07.91.07 2.17 0 4-1.14 4-2.5m-9.01.01c0-1.929 2.237-3.498 4.995-3.5 2.758.002 4.995 1.571 4.995 3.5s-2.24 3.5-5 3.5c-.36 0-.71-.03-1.05-.08l-2.26 1.05c-.06.03-.11.03-.17.03-.26 0-.5-.21-.5-.5V8.6C1.38 8.02.99 7.3.99 6.51m4.995-3.5h.005-.01zm8.005 7.58c.62-.58 1.01-1.3 1.01-2.09q0-.18-.03-.36c-.01-.11-.04-.22-.07-.33a2.3 2.3 0 0 0-.17-.45 3.55 3.55 0 0 0-1.1-1.26c-.1-.07-.19-.13-.3-.2a5 5 0 0 0-.65-.35c-.23-.1-.48-.19-.73-.27a4 4 0 0 1-.19-.06c.14.36.22.74.23 1.13C13.18 6.78 14 7.59 14 8.5c0 .59-.38 1.07-.7 1.36l-.31.3-.01.43v1.12l-1.5-.7-.28-.12-.29.04c-.31.05-.62.07-.91.07-.67 0-1.3-.1-1.86-.29-.51.15-1.06.24-1.64.27.06.05.12.09.18.13l.42.24c.36.18.76.33 1.18.43.15.04.3.08.46.1.02.01.03.01.05.01.17.04.34.07.52.07.22.03.46.04.69.04.36 0 .71-.03 1.05-.08l2.26 1.05q.09.03.18.03c.26 0 .49-.21.5-.5z" clip-rule="evenodd"/></svg>',
|
|
1054
|
-
'copy': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1087
|
+
'copy': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M4 2h6V1H4a1 1 0 0 0-1 1v9h1z"/><path fill="currentColor" d="M5 4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1z"/></svg>',
|
|
1088
|
+
'copy-file': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M4 2h6V1H4a1 1 0 0 0-1 1v9h1z"/><path fill="currentColor" d="M6 3h3v4h4v7a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"/><path fill="currentColor" d="m13 6-3-3v3z"/></svg>',
|
|
1089
|
+
'copy-file-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m10 3 3 3v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm0 1.414V6h1.586zM12 7H9V4H6v10h6z" clip-rule="evenodd"/><path fill="currentColor" d="M4 2h6V1H4a1 1 0 0 0-1 1v9h1z"/></svg>',
|
|
1090
|
+
'copy-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M10 2H4v9H3V2a1 1 0 0 1 1-1h6z"/><path fill="currentColor" fill-rule="evenodd" d="M5 4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1zm1 0h6v10H6z" clip-rule="evenodd"/></svg>',
|
|
1055
1091
|
'credit-card': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M3 9h3v2H3z"/><path fill="currentColor" fill-rule="evenodd" d="M2 13a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1zm0-9h12v1H2zm12 3v5H2V7z" clip-rule="evenodd"/></svg>',
|
|
1056
1092
|
'cross': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M14 3.05 12.95 2 8 6.95 3.05 2 2 3.05 6.95 8 2 12.95 3.05 14 8 9.05 12.95 14 14 12.95 9.05 8z"/></svg>',
|
|
1057
1093
|
'cross-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>',
|
|
@@ -1065,7 +1101,7 @@ const icons = {
|
|
|
1065
1101
|
'ellipsis-vertical': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0 4a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0 4a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/></svg>',
|
|
1066
1102
|
'euro': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m12.08 11.02 1.42 1.42a5.95 5.95 0 0 1-4 1.56c-2.6 0-4.8-1.64-5.62-3.94H1.5v-1.5h2.04C3.5 8.38 3.5 8.18 3.5 8c0-.16 0-.34.04-.5H1.5V6h2.36c.8-2.34 3.02-4 5.64-4 1.54 0 2.94.6 4 1.56l-1.42 1.42c-.7-.6-1.6-.98-2.58-.98-1.48 0-2.76.8-3.46 2h3.52v1.5H5.54c-.02.16-.04.32-.04.5 0 .2.02.38.04.56h4.02v1.5H6.08C6.78 11.22 8.06 12 9.5 12c.98 0 1.88-.38 2.58-.98"/></svg>',
|
|
1067
1103
|
'euro-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" d="M8 .67C3.95.67.67 3.95.67 8S3.95 15.33 8 15.33s7.33-3.28 7.33-7.33S12.05.67 8 .67m2.27 11.4c-.38.09-.76.14-1.15.14a4.04 4.04 0 0 1-3.99-2.92h-.58c-.12 0-.23-.09-.23-.22v-.54c0-.12.11-.22.23-.22h.41a5 5 0 0 1 0-.8h-.41c-.12 0-.23-.09-.23-.22v-.58c0-.12.1-.22.23-.22h.63c.6-1.65 2.18-2.74 3.94-2.71.34 0 .68.03 1.02.1.12.03.19.16.16.28l-.23.84c-.03.12-.15.19-.27.17-.24-.05-.48-.08-.73-.08A2.42 2.42 0 0 0 6.81 6.5h2.71c.12.03.2.15.17.27l-.13.58c-.02.1-.11.18-.22.18H6.52c-.03.27-.03.53 0 .8h2.63c.12.03.2.15.17.27l-.11.52c-.03.1-.12.17-.22.18H6.8c.36.96 1.28 1.6 2.31 1.61.3 0 .59-.04.88-.1.12-.02.24.06.27.18l.17.84c.02.12-.05.24-.17.27v-.03z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>',
|
|
1068
|
-
'exclamation-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor"
|
|
1104
|
+
'exclamation-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8m7.75-4v5h-1.5V4zm0 8v-1.5h-1.5V12z" clip-rule="evenodd"/></svg>',
|
|
1069
1105
|
'exclamation-circle-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8.75 4v5h-1.5V4zm0 8v-1.5h-1.5V12z"/><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1M2 8a6 6 0 1 0 12 0A6 6 0 0 0 2 8" clip-rule="evenodd"/></svg>',
|
|
1070
1106
|
'exclamation-stamp': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m15 8-1.55-1.86.22-2.46-2.3-.55L10.17 1 8 1.98 5.84 1 4.63 3.13l-2.29.54.22 2.46L1.01 8l1.55 1.86-.22 2.47 2.3.55 1.2 2.13L8 14.03l2.17.98 1.2-2.13 2.3-.55-.22-2.46L15 8.01zm-6.36 3.35H7.36v-1.34h1.28zm0-2.67H7.36V4.67h1.28z"/></svg>',
|
|
1071
1107
|
'exclamation-triangle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m8 2 7 12H1zm-.75 4.5h1.5V10h-1.5zm1.5 6V11h-1.5v1.5z" clip-rule="evenodd"/></svg>',
|
|
@@ -1087,8 +1123,10 @@ const icons = {
|
|
|
1087
1123
|
'file-upload': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M13.12 3.67 10.41.87a.63.63 0 0 0-.47-.2h-.17v3.66h3.54v-.17c0-.18-.06-.36-.19-.49m.19 11V5.25H9.55c-.37 0-.67-.31-.66-.68V.67H3.35a.68.68 0 0 0-.66.66v13.32c0 .37.29.67.66.68h9.3c.36-.01.65-.3.66-.66m-3-4.64H8.93c-.1 0-.19.07-.2.18v2.61c0 .1-.09.18-.19.18H6.91a.18.18 0 0 1-.18-.18V10.2c0-.1-.07-.19-.18-.2H5.19s-.09.01-.14 0a.19.19 0 0 1 0-.27L7.6 7.14c.07-.07.19-.07.26 0l2.54 2.54s.06.09.06.14c0 .1-.09.18-.19.18z"/></svg>',
|
|
1088
1124
|
'file-word': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M9 5V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V5zM5 7l1.091 5h1.002L8 8.262 8.91 12h.98L11 7h-.93l-.701 3.492L8.568 7H7.47l-.836 3.435L5.944 7z" clip-rule="evenodd"/><path fill="currentColor" d="M10 4V1l3 3z"/></svg>',
|
|
1089
1125
|
'file-word-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m5 7 1.091 5h1.002L8 8.262 8.91 12h.98L11 7h-.93l-.701 3.492L8.568 7H7.47l-.836 3.435L5.944 7z"/><path fill="currentColor" fill-rule="evenodd" d="M4 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4l-3-3zm6 3V2.537L11.254 4zm2 1v9H4V2h5v3z" clip-rule="evenodd"/></svg>',
|
|
1090
|
-
'filter': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1091
|
-
'
|
|
1126
|
+
'filter': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 2a1 1 0 0 0-1 1v1.586a1 1 0 0 0 .293.707L6 9v2.5a1 1 0 0 0 .4.8l2 1.5A1 1 0 0 0 10 13V9l3.707-3.707A1 1 0 0 0 14 4.586V3a1 1 0 0 0-1-1z" clip-rule="evenodd"/></svg>',
|
|
1127
|
+
'filter-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 3h10v1.586l-4 4V13l-2-1.5V8.586l-4-4zm3 7V9L2.293 5.293A1 1 0 0 1 2 4.586V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1.586a1 1 0 0 1-.293.707L10 9v4a1 1 0 0 1-1.6.8l-2-1.5a1 1 0 0 1-.4-.8z" clip-rule="evenodd"/></svg>',
|
|
1128
|
+
'floppy-disk': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2 3a1 1 0 0 1 1-1h7.586a1 1 0 0 1 .707.293l2.414 2.414a1 1 0 0 1 .293.707V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm2 0h6v3H4zm4 5a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/></svg>',
|
|
1129
|
+
'floppy-disk-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 3v10h10V5.414l-1.207-1.207L10.586 3H10v3H4V3zm2 0h4v2H5zm4-1h1.586a1 1 0 0 1 .707.293L12.5 3.5l1.207 1.207a1 1 0 0 1 .293.707V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm-1 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2m-2-1a2 2 0 1 1 4 0 2 2 0 0 1-4 0" clip-rule="evenodd"/></svg>',
|
|
1092
1130
|
'folder': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M7 4h7c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h4z"/></svg>',
|
|
1093
1131
|
'folder-check': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M14 4H7L6 3H2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1M5.705 8.185 7 9.48l3.295-3.295.705.705-4 4-2-2z" clip-rule="evenodd"/></svg>',
|
|
1094
1132
|
'folder-check-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M5.705 8.185 7 9.48l3.295-3.295.705.705-4 4-2-2z"/><path fill="currentColor" fill-rule="evenodd" d="m6 3 1 1.001h7c.55 0 1 .45 1 1.001v6.997c0 .55-.45 1.001-1 1.001H2c-.55 0-1-.45-1-1.001V4.001C1 3.451 1.45 3 2 3zm-.41 1.001H2v8.008h12V5.002H6.59z" clip-rule="evenodd"/></svg>',
|
|
@@ -1113,15 +1151,17 @@ const icons = {
|
|
|
1113
1151
|
'interrogation-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M15.039 8.146a7 7 0 1 1-14 0 7 7 0 0 1 14 0m-6.974-.5a1 1 0 1 0-.942-1.335l-1.43-.458A2.501 2.501 0 1 1 8.79 9.04v.606h-1.5v-2zm-.026 3a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5" clip-rule="evenodd"/></svg>',
|
|
1114
1152
|
'interrogation-circle-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M7.824 7.646a1 1 0 1 0-.943-1.335l-1.429-.458A2.501 2.501 0 1 1 8.548 9.04v.606h-1.5v-2zm-.776 3.75a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0"/><path fill="currentColor" fill-rule="evenodd" d="M7.798 15.146a7 7 0 1 0 0-14 7 7 0 0 0 0 14m0-1a6 6 0 1 0 0-12 6 6 0 0 0 0 12" clip-rule="evenodd"/></svg>',
|
|
1115
1153
|
'key': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8.44 6.67a3.994 3.994 0 0 0-5.1-2.44A3.986 3.986 0 0 0 .9 9.33 3.994 3.994 0 0 0 6 11.77c1.14-.4 2.04-1.3 2.44-2.44h2.89V12H14V9.33h1.33V6.67zM4.67 9.33c-.73 0-1.33-.6-1.33-1.33s.6-1.33 1.33-1.33S6 7.27 6 8s-.58 1.32-1.31 1.33z"/></svg>',
|
|
1116
|
-
'laptop': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1154
|
+
'laptop': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M6.5 5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z"/><path fill="currentColor" fill-rule="evenodd" d="M3 3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1H1a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1h-2a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm10 1H3v7h10z" clip-rule="evenodd"/></svg>',
|
|
1117
1155
|
'life-ring': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" d="M8 .67a7.33 7.33 0 1 0 0 14.66A7.33 7.33 0 0 0 8 .67m5.14 3.53-1.88 1.88a3.9 3.9 0 0 0-1.34-1.34l1.88-1.88c.51.38.96.83 1.34 1.34M8 10.84a2.84 2.84 0 1 1 0-5.68 2.84 2.84 0 0 1 0 5.68m-3.8-8 1.88 1.9c-.55.33-1.01.79-1.34 1.34L2.86 4.2c.38-.51.83-.96 1.34-1.34zM2.86 11.8l1.88-1.88c.33.55.79 1.01 1.34 1.34L4.2 13.14c-.51-.38-.96-.83-1.34-1.34m8.94 1.34-1.88-1.88a3.9 3.9 0 0 0 1.34-1.34l1.88 1.88c-.38.51-.83.96-1.34 1.34"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>',
|
|
1118
|
-
'lines-rectangle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1156
|
+
'lines-rectangle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm2 4h6v1H5zm4 3H5v1h4z" clip-rule="evenodd"/></svg>',
|
|
1157
|
+
'lines-rectangle-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M5 6h6v1H5zm4 3H5v1h4z"/><path fill="currentColor" fill-rule="evenodd" d="M4 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zm8 1H4v12h8z" clip-rule="evenodd"/></svg>',
|
|
1119
1158
|
'link': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M9.75 6.25a3.75 3.75 0 0 1 0 5.31l-1.66 1.67a3.76 3.76 0 0 1-5.32 0 3.76 3.76 0 0 1 0-5.32l.92-.92c.15-.15.4-.16.56 0 .07.07.11.16.12.26.02.44.1.88.24 1.3.05.14.01.3-.09.41l-.32.32c-.72.67-.76 1.8-.09 2.52s1.8.76 2.52.09c.03-.02.05-.05.07-.07l1.66-1.66a1.775 1.775 0 0 0-.26-2.73.4.4 0 0 1-.17-.31.98.98 0 0 1 .29-.74l.52-.52c.14-.14.35-.15.51-.04.18.13.35.27.51.43zm3.49-3.48a3.76 3.76 0 0 0-5.32 0L6.26 4.43a3.772 3.772 0 0 0 .52 5.75c.16.11.37.09.51-.04l.52-.52c.2-.19.3-.46.29-.74a.38.38 0 0 0-.17-.31 1.775 1.775 0 0 1-.26-2.73l1.66-1.66c.68-.71 1.81-.74 2.52-.06s.74 1.81.06 2.52c-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.14.42.22.86.24 1.3 0 .22.19.39.41.38.1 0 .19-.05.26-.12l.92-.92a3.76 3.76 0 0 0 0-5.32z"/></svg>',
|
|
1120
1159
|
'list': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M1.9 2.68c-.67 0-1.22.56-1.21 1.23 0 .67.56 1.22 1.23 1.21.67 0 1.22-.56 1.21-1.23 0-.32-.13-.63-.36-.86s-.54-.36-.87-.35m0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46m0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46m13 .41H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41zm0-8.18H5.18c-.23 0-.41.18-.41.41v.81c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41V3.5c0-.23-.18-.41-.41-.41zm0 4.09H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41z"/></svg>',
|
|
1121
1160
|
'loader': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-opacity=".2" d="M13.657 8A5.657 5.657 0 1 1 2.343 8a5.657 5.657 0 0 1 11.314 0M3.475 8a4.526 4.526 0 1 0 9.05 0 4.526 4.526 0 0 0-9.05 0"/><path fill="currentColor" d="M2.343 8A5.657 5.657 0 0 1 8 2.343v1.132A4.525 4.525 0 0 0 3.475 8z"/></svg>',
|
|
1122
1161
|
'location': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M8 14.997c2.5-2.5 5-6.236 5-8.997A5 5 0 0 0 3 6c0 2.761 2.5 6.496 5 8.997m0-7.499a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3" clip-rule="evenodd"/></svg>',
|
|
1123
1162
|
'location-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10 6.002a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-1 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M13 6.002c0 2.506-2.06 5.814-4.309 8.273q-.344.376-.691.723a23 23 0 0 1-.691-.723C5.059 11.816 3 8.508 3 6.002a5 5 0 0 1 10 0m-1 0c0 1.116-.52 2.554-1.424 4.088A21.5 21.5 0 0 1 8 13.55a21.5 21.5 0 0 1-2.576-3.459C4.52 8.556 4 7.118 4 6.002a4 4 0 1 1 8 0" clip-rule="evenodd"/></svg>',
|
|
1124
|
-
'lock': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1163
|
+
'lock': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M5 4v3H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-1V4a3 3 0 0 0-6 0m5 3V4a2 2 0 1 0-4 0v3zm-2 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2" clip-rule="evenodd"/></svg>',
|
|
1164
|
+
'lock-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path fill="currentColor" fill-rule="evenodd" d="M5 4v3H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-1V4a3 3 0 0 0-6 0m5 3V4a2 2 0 1 0-4 0v3zm2 1v6H4V8z" clip-rule="evenodd"/></svg>',
|
|
1125
1165
|
'log-in': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m10.97 7.78-4-4a.29.29 0 0 0-.42 0c-.07.06-.12.15-.13.24v2.07c0 .17-.13.3-.3.32H1.97c-.16 0-.29.12-.3.28v2.58c0 .16.12.29.28.3h4.16c.17 0 .3.14.3.31v2.14c0 .16.12.29.28.3.11.01.21-.03.28-.11l4-4c.11-.12.11-.3 0-.42zm1.81 4.96V3.26H9.31a.3.3 0 0 1-.3-.3v-.97c0-.16.13-.3.3-.3h4.74c.16 0 .3.13.3.3v12.03a.3.3 0 0 1-.3.3H9.31a.3.3 0 0 1-.3-.3v-.97c0-.16.13-.3.3-.3h3.47z"/></svg>',
|
|
1126
1166
|
'log-out': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m14.23 7.79-4-4a.29.29 0 0 0-.42 0c-.07.06-.12.15-.13.24V6.1c0 .17-.13.3-.3.32H5.23c-.16 0-.29.12-.3.28v2.58c0 .16.12.29.28.3h4.16c.17 0 .3.14.3.31v2.14c0 .16.12.29.28.3.11.01.21-.03.28-.11l4-4c.11-.12.11-.3 0-.42zm-11-4.53v9.5H6.7c.16 0 .3.13.3.3v.97a.3.3 0 0 1-.3.3H1.97a.3.3 0 0 1-.3-.3V1.99c0-.16.13-.3.3-.3H6.7c.16 0 .3.13.3.3v.97a.3.3 0 0 1-.3.3z"/></svg>',
|
|
1127
1167
|
'magnifying-glass': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2 7a5 5 0 1 1 8.872 3.164l3.127 3.128-.707.707-3.128-3.128A5 5 0 0 1 2 7m5 4a4 4 0 1 1 0-8 4 4 0 0 1 0 8" clip-rule="evenodd"/></svg>',
|
|
@@ -1144,12 +1184,14 @@ const icons = {
|
|
|
1144
1184
|
'pen-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.295 2.293a1 1 0 0 0-1.414 0L9.467 3.707l2.828 2.829 1.414-1.415a1 1 0 0 0 0-1.414z"/><path fill="currentColor" fill-rule="evenodd" d="m2.003 13.999 2.825.003 6.757-6.756-2.829-2.829L2 11.174zM3 11.587l5.756-5.755 1.414 1.414-5.755 5.756L3.002 13z" clip-rule="evenodd"/></svg>',
|
|
1145
1185
|
'phone': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="m10 10.53 1.034-1.035a1.01 1.01 0 0 1 1.08-.221l1.259.503A1.01 1.01 0 0 1 14 10.7v2.308a1 1 0 0 1-1.052.992C4.124 13.45 2.343 5.974 2.006 3.112A1.002 1.002 0 0 1 3.007 2h2.228a1 1 0 0 1 .923.628l.503 1.26a1 1 0 0 1-.217 1.08L5.41 6.002s.595 4.029 4.59 4.527"/></svg>',
|
|
1146
1186
|
'phone-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.62 14h-.079C3.472 13.479 2.184 5.826 2.004 3.49A1.384 1.384 0 0 1 3.278 2h2.543a.92.92 0 0 1 .859.582l.701 1.726a.92.92 0 0 1-.203.997l-.983.992a4.325 4.325 0 0 0 3.499 3.508l1.001-.993a.92.92 0 0 1 1.002-.189l1.74.697a.92.92 0 0 1 .567.858v2.437A1.385 1.385 0 0 1 12.62 14M3.389 2.923a.46.46 0 0 0-.462.462v.037c.213 2.732 1.574 9.193 9.665 9.655a.46.46 0 0 0 .49-.434v-2.465l-1.74-.696-1.325 1.315-.222-.028c-4.015-.503-4.56-4.518-4.56-4.56l-.028-.221 1.311-1.325-.692-1.74z"/></svg>',
|
|
1147
|
-
'picture': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M14
|
|
1148
|
-
'
|
|
1187
|
+
'picture': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M14 3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1zM4 5a1 1 0 1 0 2 0 1 1 0 0 0-2 0m7.134 2.514L13 10.023V13H3v-2.494l.896-1.064c.203-.242.305-.362.425-.408a.5.5 0 0 1 .358 0c.12.046.222.166.425.408l1.767 2.098 2.995-4.026c.21-.282.316-.423.444-.476a.5.5 0 0 1 .38 0c.129.053.234.194.444.476" clip-rule="evenodd"/></svg>',
|
|
1188
|
+
'picture-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M5 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2"/><path fill="currentColor" fill-rule="evenodd" d="M14 13a1 1 0 0 1-1 1H2h.994A1 1 0 0 1 2 13V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1zM3 3h10v5.315l-1.069-1.43a6 6 0 0 0-.29-.368 1.5 1.5 0 0 0-.555-.41 1.5 1.5 0 0 0-1.14-.001c-.27.11-.448.288-.556.408-.098.11-.2.246-.291.366L6.822 9.911l-.974-1.14a5 5 0 0 0-.283-.314 1.5 1.5 0 0 0-.53-.353 1.5 1.5 0 0 0-1.064 0c-.248.094-.42.245-.529.352a5 5 0 0 0-.283.314L3 8.956zm0 10v-2.506l.903-1.055c.202-.237.303-.355.423-.4a.5.5 0 0 1 .355 0c.12.045.22.164.422.4l1.769 2.07 3.01-4.006c.21-.28.315-.42.443-.472a.5.5 0 0 1 .38 0c.127.053.232.193.441.474L13 9.985V13z" clip-rule="evenodd"/></svg>',
|
|
1189
|
+
'play-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1m3.724 7.447-6 3A.5.5 0 0 1 5 11V5a.5.5 0 0 1 .724-.447l6 3a.5.5 0 0 1 0 .894"/></svg>',
|
|
1149
1190
|
'plus': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M9.41 6.59V1.92a.24.24 0 0 0-.24-.25H6.84a.24.24 0 0 0-.25.24v4.68H1.92a.24.24 0 0 0-.25.24v2.33a.24.24 0 0 0 .24.25h4.68v4.67a.24.24 0 0 0 .24.25h2.33a.24.24 0 0 0 .25-.24V9.41h4.67a.24.24 0 0 0 .25-.24V6.84a.24.24 0 0 0-.24-.25z"/></svg>',
|
|
1150
1191
|
'plus-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" d="M8 .67C3.95.67.67 3.95.67 8S3.95 15.33 8 15.33s7.33-3.28 7.33-7.33S12.05.67 8 .67m4.26 8.16c0 .19-.17.35-.36.35H9.18v2.72c0 .19-.16.35-.35.36H7.17c-.19 0-.35-.17-.35-.36V9.18H4.1a.37.37 0 0 1-.36-.35V7.17c0-.19.17-.35.36-.35h2.72V4.1c0-.19.16-.35.35-.36h1.66c.19 0 .35.17.35.36v2.72h2.72c.19 0 .35.16.36.35z"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>',
|
|
1151
1192
|
'question-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M15.039 8.146a7 7 0 1 1-14 0 7 7 0 0 1 14 0m-6.974-.5a1 1 0 1 0-.942-1.335l-1.43-.458A2.501 2.501 0 1 1 8.79 9.04v.606h-1.5v-2zm-.026 3a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5" clip-rule="evenodd"/></svg>',
|
|
1152
|
-
'share': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1193
|
+
'share': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M14 4.5a2.5 2.5 0 0 1-4.467 1.543L6.915 7.35a2.5 2.5 0 0 1 0 1.298l2.618 1.308a2.5 2.5 0 1 1-.448.894L6.467 9.544a2.5 2.5 0 1 1 0-3.085l2.618-1.31A2.503 2.503 0 0 1 11.5 2 2.5 2.5 0 0 1 14 4.5"/></svg>',
|
|
1194
|
+
'share-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M13 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m1 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0M6 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m.623 1.32a2.5 2.5 0 1 1-.156-2.863L9.085 5.15c.088.33.243.633.448.894L6.915 7.35a2.5 2.5 0 0 1 0 1.298l2.618 1.308a2.5 2.5 0 1 1-.448.894L6.467 9.544q.084-.107.156-.223M11.5 13a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3" clip-rule="evenodd"/></svg>',
|
|
1153
1195
|
'shuffle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M15.13 10.45a.51.51 0 0 1 0 .81l-2.29 1.91c-.29.24-.71.24-1 0-.12-.1-.2-.24-.2-.4v-.95H10c-.09 0-.18-.03-.25-.09l-2-1.8 1.49-1.37 1.51 1.35h.92V9c.04-.35.34-.6.69-.57.18 0 .35.06.48.17l2.29 1.9zM1 6.09h2.42l1.51 1.35 1.53-1.36-2-1.8a.4.4 0 0 0-.26-.09H1a.33.33 0 0 0-.34.29v1.33c.02.17.17.3.34.28m10.66 0v1c.04.35.34.6.69.57.18 0 .35-.06.48-.17l2.29-1.9a.51.51 0 0 0 0-.81l-2.28-1.95a.81.81 0 0 0-1 0c-.12.1-.2.25-.2.41v1H10c-.09 0-.18.03-.25.09L3.42 9.91H1a.313.313 0 0 0-.34.28v1.33c.02.17.17.3.34.29h3.18c.09 0 .19-.03.26-.09l6.31-5.62h.91z"/></svg>',
|
|
1154
1196
|
'sitemap': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M3.33 10h-2c-.37 0-.66.3-.66.67v2c0 .36.3.65.66.66h2c.37 0 .66-.29.67-.66v-2c0-.37-.3-.67-.67-.67m-.5-1.67H7.5v1h1v-1h4.67v1h1v-1.2c0-.44-.36-.8-.8-.8H8.5V6h.83c.37 0 .67-.3.67-.67v-2c0-.37-.3-.66-.67-.66H6.67c-.37 0-.66.29-.67.66v2c0 .37.3.67.67.67h.83v1.33H2.63c-.44 0-.8.36-.8.8v1.2h1zM9 10H7c-.37 0-.67.3-.67.67v2c0 .37.3.66.67.66h2c.37 0 .66-.29.67-.66v-2c0-.37-.3-.67-.67-.67m5.67 0h-2c-.37 0-.67.3-.67.67v2c0 .37.3.66.67.66h2c.36 0 .65-.3.66-.66v-2c0-.37-.29-.66-.66-.67"/></svg>',
|
|
1155
1197
|
'sliders': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.95 4H15v1h-2.05v.002a2.5 2.5 0 0 1-2.672 1.988A2.52 2.52 0 0 1 8.05 5.002V5H1V4h7.05v-.002a2.5 2.5 0 0 1 2.672-1.988 2.52 2.52 0 0 1 2.228 1.988zm-9.9 8H1v-1h2.05v-.002A2.52 2.52 0 0 1 5.5 9a2.5 2.5 0 0 1 2.45 1.999V11H15v1H7.95v.002A2.52 2.52 0 0 1 5.5 14a2.5 2.5 0 0 1-2.45-1.998z"/></svg>',
|
|
@@ -1160,6 +1202,8 @@ const icons = {
|
|
|
1160
1202
|
'table': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2 13a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1zm1-3v3h3v-3zm4 0v3h6v-3zm6-1H7V6h6zM6 9H3V6h3zM3 5V3h10v2z" clip-rule="evenodd"/></svg>',
|
|
1161
1203
|
'tag': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M1.67 7.9V2.85a1.18 1.18 0 0 1 1.18-1.18H7.9a1.18 1.18 0 0 1 .84.33L14 7.26a1.2 1.2 0 0 1 0 1.68L8.94 14a1.2 1.2 0 0 1-1.68 0L2 8.74a1.18 1.18 0 0 1-.33-.84m2.77-4.65a1.19 1.19 0 1 0-.02 2.38 1.19 1.19 0 0 0 .02-2.38"/></svg>',
|
|
1162
1204
|
'tags': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.22 3 4.86 4.37a.94.94 0 0 1 0 1.38L7.4 13a1.17 1.17 0 0 1-1.55 0L1 8.63a1 1 0 0 1-.33-.71V3.71a1 1 0 0 1 1.1-1h4.67a1.12 1.12 0 0 1 .78.29M2.602 5.94a1.13 1.13 0 1 0 1.256-1.88 1.13 1.13 0 0 0-1.256 1.88M10.15 3 15 7.37a.94.94 0 0 1 0 1.42L10.32 13a1.17 1.17 0 0 1-1.55 0l3.99-3.55a1.758 1.758 0 0 0 0-2.65l-4.5-4.09h1.12c.284-.005.56.1.77.29" clip-rule="evenodd"/></svg>',
|
|
1205
|
+
'thumb-down': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M11.202 11.934a1.506 1.506 0 0 1-2.438 1.651L5.5 10.461V2h4.922c1.081 0 2.058.715 2.484 1.818l.944 3.394c.51 1.32-.362 2.788-1.656 2.788h-1.772zM4.5 10H2V2h2.5z"/></svg>',
|
|
1206
|
+
'thumb-down-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M11.204 11.934 10.424 10h1.772c1.294 0 2.166-1.468 1.656-2.788l-.944-3.394C12.484 2.715 11.507 2 10.426 2H5v.003H2v8h3.023l3.744 3.582a1.506 1.506 0 0 0 2.437-1.651m.755-7.797C11.657 3.4 11.033 3 10.425 3H6.002l.017 6.572 3.439 3.29a.506.506 0 0 0 .819-.554L8.943 9h3.253c.24 0 .48-.131.645-.41.167-.28.218-.657.079-1.018l-.018-.045zM3 9.003h2v-6H3z" clip-rule="evenodd"/></svg>',
|
|
1163
1207
|
'thumb-up': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M11.202 4.069a1.506 1.506 0 0 0-2.438-1.651L5.5 5.542v8.46h4.922c1.081 0 2.058-.714 2.484-1.817l.944-3.394c.51-1.32-.362-2.788-1.656-2.788h-1.772zM4.5 6.003H2v8h2.5z"/></svg>',
|
|
1164
1208
|
'thumb-up-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m11.204 4.069-.78 1.934h1.772c1.294 0 2.166 1.468 1.656 2.788l-.944 3.394c-.425 1.103-1.402 1.818-2.483 1.818H5V14H2V6h3.023l3.744-3.582a1.506 1.506 0 0 1 2.437 1.65m.755 7.797c-.302.738-.926 1.137-1.534 1.137H6.002L6.02 6.43l3.439-3.29a.506.506 0 0 1 .819.554L8.943 7.003h3.253c.24 0 .48.13.645.41.167.28.218.657.079 1.018l-.018.045zM3 7h2v6H3z" clip-rule="evenodd"/></svg>',
|
|
1165
1209
|
'thumbtack': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m8.91 2-1.2 3.594L2.364 7.09 5.274 10l-.707.706-1.687 1.687-.264.264-.09.09-.209.498L2 14l.755-.317.498-.21.09-.089.264-.264 1.687-1.687.706-.706 2.91 2.908 1.496-5.347L14 7.09z" clip-rule="evenodd"/></svg>',
|
|
@@ -1168,7 +1212,8 @@ const icons = {
|
|
|
1168
1212
|
'trash-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M7 6H6v6h1zm2 0h1v6H9z"/><path fill="currentColor" fill-rule="evenodd" d="M11 3V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v1H2v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3zM6 2v1h4V2zm6 2v10H4V4z" clip-rule="evenodd"/></svg>',
|
|
1169
1213
|
'universal-access': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" d="M8 15.33A7.33 7.33 0 1 1 15.33 8 7.34 7.34 0 0 1 8 15.33M8 1.71a6.29 6.29 0 1 0 0 12.58A6.29 6.29 0 0 0 8 1.71M13.74 8A5.74 5.74 0 1 1 8 2.25 5.75 5.75 0 0 1 13.74 8M8 3.77a1.07 1.07 0 1 0 0 2.14 1.07 1.07 0 0 0 0-2.14M4.67 5.63c-.6-.14-.87.86-.32 1s1.79.43 2.57.55a11.25 11.25 0 0 1-.72 4.47.54.54 0 0 0 .85.65 6.9 6.9 0 0 0 .78-2.42c0-.07.31-.11.33 0 .11.768.322 1.518.63 2.23.3.65 1.31.26 1-.38a11.5 11.5 0 0 1-.76-4.58 21 21 0 0 0 2.41-.45.55.55 0 1 0-.2-1.08 11.47 11.47 0 0 1-6.57.01"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>',
|
|
1170
1214
|
'unlink': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M9.74 6.25c-.16-.17-.32-.3-.5-.43-.14-.09-.31-.1-.44 0l1.81 1.81c-.17-.5-.47-.98-.87-1.38m-1.1 3.51c-.07.15-.17.28-.29.4l-1.66 1.66s-.04.05-.07.07c-.72.67-1.85.63-2.52-.09s-.63-1.85.09-2.52l.32-.32c.1-.11.14-.27.09-.41-.14-.42-.22-.86-.24-1.3a.42.42 0 0 0-.12-.26.395.395 0 0 0-.56 0l-.92.92a3.76 3.76 0 0 0 0 5.32 3.76 3.76 0 0 0 5.32 0l1.66-1.67c.12-.12.23-.25.32-.38zm4.61-7h-.02a3.78 3.78 0 0 0-5.32 0L6.83 3.84l1.41 1.41 1.08-1.08c.68-.71 1.81-.74 2.52-.06s.74 1.81.06 2.52c-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.13.4.21.81.23 1.23l.44.44c.09 0 .18-.05.24-.11l.92-.92a3.76 3.76 0 0 0 0-5.32zm.97 10.52-1.03 1.03-5.14-5.14c-.04.17-.12.33-.25.45l-.52.52c-.14.13-.35.15-.51.04-.18-.13-.35-.27-.5-.42-.74-.74-1.11-1.7-1.11-2.67 0-.24.02-.49.08-.73l-3.6-3.6 1.03-1.03z"/></svg>',
|
|
1171
|
-
'unlock': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1215
|
+
'unlock': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10 7V4a2 2 0 1 0-4 0v1H5V4a3 3 0 0 1 6 0v3h1a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm-3 4a1 1 0 1 1 2 0 1 1 0 0 1-2 0" clip-rule="evenodd"/></svg>',
|
|
1216
|
+
'unlock-outline': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M8 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path fill="currentColor" fill-rule="evenodd" d="M10 4v3H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-1V4a3 3 0 0 0-6 0v1h1V4a2 2 0 1 1 4 0m2 4v6H4V8z" clip-rule="evenodd"/></svg>',
|
|
1172
1217
|
'upload': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M9.58 10.74V6.59a.31.31 0 0 1 .31-.3H12a.3.3 0 0 0 .21-.52l-4-4a.29.29 0 0 0-.42 0l-4 4a.3.3 0 0 0 .21.52h2.11a.31.31 0 0 1 .31.3v4.15a.3.3 0 0 0 .3.3h2.56a.3.3 0 0 0 .3-.3M14.33 14v-1a.29.29 0 0 0-.29-.3H2a.29.29 0 0 0-.29.3v1a.29.29 0 0 0 .29.29h12a.29.29 0 0 0 .33-.29"/></svg>',
|
|
1173
1218
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6M6 9a4 4 0 0 0-4 4 1 1 0 0 0 1 1h10a1 1 0 0 0 1-1 4 4 0 0 0-4-4z" clip-rule="evenodd"/></svg>',
|
|
1174
1219
|
'user-circle': '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill="currentColor" d="M8 .62C3.95.61.66 3.9.65 7.95c0 4.05 3.28 7.34 7.33 7.35 4.04 0 7.33-3.26 7.35-7.3.02-4.05-3.25-7.36-7.3-7.38zm0 .75c3.64 0 6.59 2.96 6.58 6.6V8c0 1.35-.41 2.66-1.19 3.76a2.71 2.71 0 0 0-2.66-2.37H9.54c-.98.46-2.1.46-3.08 0H5.28c-1.36 0-2.5 1.02-2.67 2.37A6.5 6.5 0 0 1 1.42 8a6.59 6.59 0 0 1 6.55-6.63zM5 5.63c0-1.68 1.37-3.05 3.05-3.05s3.05 1.37 3.05 3.05-1.37 3.05-3.05 3.05H8c-1.66-.03-3-1.39-3-3.05"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg>',
|
|
@@ -1216,7 +1261,7 @@ const MgIcon = class {
|
|
|
1216
1261
|
this.variant = undefined;
|
|
1217
1262
|
this.variantStyle = undefined;
|
|
1218
1263
|
this.spin = false;
|
|
1219
|
-
this.classCollection = new
|
|
1264
|
+
this.classCollection = new index$1.Fe(['mg-c-icon']);
|
|
1220
1265
|
}
|
|
1221
1266
|
validateIcon(newValue, oldValue) {
|
|
1222
1267
|
if (!iconList.includes(newValue))
|
|
@@ -1315,7 +1360,7 @@ const MgIllustratedMessage = class {
|
|
|
1315
1360
|
componentDidLoad() {
|
|
1316
1361
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
1317
1362
|
const slottedIllustrations = this.element.querySelectorAll('[slot="illustration"]');
|
|
1318
|
-
if (!
|
|
1363
|
+
if (!index$1._e(this.element.querySelector('[slot="title"]'), headingTags)) {
|
|
1319
1364
|
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
1320
1365
|
}
|
|
1321
1366
|
else if (slottedIllustrations.length !== 1) {
|
|
@@ -1352,6 +1397,7 @@ var Handler;
|
|
|
1352
1397
|
Handler["BLUR"] = "blur";
|
|
1353
1398
|
Handler["FOCUS"] = "focus";
|
|
1354
1399
|
})(Handler || (Handler = {}));
|
|
1400
|
+
const tooltipPositions = ['input', 'label'];
|
|
1355
1401
|
|
|
1356
1402
|
/**
|
|
1357
1403
|
* Apply in all input child node the aria-describedby attribute
|
|
@@ -1389,12 +1435,33 @@ const manageClasses = (props) => {
|
|
|
1389
1435
|
if (props.mgWidth !== undefined)
|
|
1390
1436
|
props.classCollection.add(`mg-c-input--width-${props.mgWidth}`);
|
|
1391
1437
|
};
|
|
1438
|
+
/**
|
|
1439
|
+
* Check props configuration
|
|
1440
|
+
* @param props - MgInput Interface Props
|
|
1441
|
+
*/
|
|
1442
|
+
const checkPropsConfig = (props) => {
|
|
1443
|
+
if (!index$1.He(props.identifier)) {
|
|
1444
|
+
throw new Error('<mg-input> prop "identifier" is required.');
|
|
1445
|
+
}
|
|
1446
|
+
if (!index$1.He(props.label)) {
|
|
1447
|
+
throw new Error('<mg-input> prop "label" is required.');
|
|
1448
|
+
}
|
|
1449
|
+
if (props.labelOnTop && props.labelHide) {
|
|
1450
|
+
throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide".');
|
|
1451
|
+
}
|
|
1452
|
+
if (!tooltipPositions.includes(props.tooltipPosition)) {
|
|
1453
|
+
throw new Error(`<mg-input> prop "tooltipPosition" must be one of: ${tooltipPositions.join(', ')}`);
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1392
1456
|
/**
|
|
1393
1457
|
* Get tagname
|
|
1394
1458
|
* @param isFieldset - is fieldset
|
|
1395
1459
|
* @returns tag name
|
|
1396
1460
|
*/
|
|
1397
1461
|
const getTagName = (isFieldset, readOnly) => (!isFieldset || readOnly ? 'div' : 'fieldset');
|
|
1462
|
+
/**
|
|
1463
|
+
* MgInput Interface
|
|
1464
|
+
*/
|
|
1398
1465
|
/**
|
|
1399
1466
|
* Get input template
|
|
1400
1467
|
* @param props - MgInput Interface Props
|
|
@@ -1404,17 +1471,9 @@ const getTagName = (isFieldset, readOnly) => (!isFieldset || readOnly ? 'div' :
|
|
|
1404
1471
|
*/
|
|
1405
1472
|
const MgInput = (props, children, utils) => {
|
|
1406
1473
|
/**
|
|
1407
|
-
* Check
|
|
1474
|
+
* Check props config
|
|
1408
1475
|
*/
|
|
1409
|
-
|
|
1410
|
-
throw new Error('<mg-input> prop "identifier" is required.');
|
|
1411
|
-
}
|
|
1412
|
-
if (!mgMenu_conf.He(props.label)) {
|
|
1413
|
-
throw new Error('<mg-input> prop "label" is required.');
|
|
1414
|
-
}
|
|
1415
|
-
if (props.labelOnTop && props.labelHide) {
|
|
1416
|
-
throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide".');
|
|
1417
|
-
}
|
|
1476
|
+
checkPropsConfig(props);
|
|
1418
1477
|
/**
|
|
1419
1478
|
* Set readonly value
|
|
1420
1479
|
*/
|
|
@@ -1441,15 +1500,15 @@ const MgInput = (props, children, utils) => {
|
|
|
1441
1500
|
/**
|
|
1442
1501
|
* Return template
|
|
1443
1502
|
*
|
|
1444
|
-
*
|
|
1445
|
-
* | label | input | tooltip |
|
|
1446
|
-
*
|
|
1447
|
-
* |
|
|
1448
|
-
* |
|
|
1449
|
-
* |
|
|
1450
|
-
* |
|
|
1451
|
-
* |
|
|
1452
|
-
*
|
|
1503
|
+
* +--------+---------+--------------+---------+
|
|
1504
|
+
* | label | tooltip | input | tooltip |
|
|
1505
|
+
* |--------+---------+--------------+---------+
|
|
1506
|
+
* | | nb Char Left |
|
|
1507
|
+
* | +------------------------+
|
|
1508
|
+
* | | Help Text |
|
|
1509
|
+
* | +------------------------+
|
|
1510
|
+
* | | Error |
|
|
1511
|
+
* +------------------+------------------------+
|
|
1453
1512
|
*
|
|
1454
1513
|
* Error message is based on this aria method: https://www.w3.org/WAI/tutorials/forms/notifications/#on-focus-change
|
|
1455
1514
|
*/
|
|
@@ -1460,22 +1519,17 @@ const MgInput = (props, children, utils) => {
|
|
|
1460
1519
|
*/
|
|
1461
1520
|
const getTooltip = () => (index.h("mg-tooltip", { identifier: `${props.identifier}-tooltip`, message: props.tooltip },
|
|
1462
1521
|
index.h("mg-icon", { icon: "info-circle" })));
|
|
1463
|
-
/**
|
|
1464
|
-
* Get input title (label) node
|
|
1465
|
-
* Display asterisk only if not disabled and not readonly
|
|
1466
|
-
* @returns mg-input-title
|
|
1467
|
-
*/
|
|
1468
|
-
const getInputTitle = () => (index.h("mg-input-title", { identifier: props.identifier, readonly: props.readonly, class: props.labelHide ? 'mg-u-visually-hidden' : undefined, required: props.required && !props.disabled && !props.readonly, "is-legend": props.isFieldset }, props.label));
|
|
1469
1522
|
return (index.h(TagName, { class: props.classCollection.join() },
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
!props.readonly && props.
|
|
1523
|
+
index.h("div", { class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': props.labelHide } },
|
|
1524
|
+
index.h("mg-input-title", { identifier: props.identifier, readonly: props.readonly, required: props.required && !props.disabled && !props.readonly, "is-legend": props.isFieldset }, props.label),
|
|
1525
|
+
props.tooltip && !props.readonly && (props.tooltipPosition === 'label' || props.labelOnTop) && !props.labelHide && getTooltip()),
|
|
1473
1526
|
props.readonly ? (index.h("div", { class: "mg-c-input__input-container" },
|
|
1474
|
-
index.h("
|
|
1527
|
+
Array.isArray(props.readonlyValue) ? (index.h("ul", null, props.readonlyValue.map(value => (index.h("li", { key: value },
|
|
1528
|
+
index.h("strong", null, value)))))) : (index.h("strong", null, props.readonlyValue)),
|
|
1475
1529
|
children.filter(child => Object.values(child).includes('append-input')))) : (index.h("div", { class: "mg-c-input__input-container" },
|
|
1476
1530
|
index.h("div", { class: { 'mg-c-input__input': true, 'mg-c-input__input--has-error': props.errorMessage !== undefined } },
|
|
1477
1531
|
applyAriadescribedBy(children, ariaDescribedbyIDs, utils),
|
|
1478
|
-
!props.labelOnTop && props.
|
|
1532
|
+
props.tooltip && !props.readonly && !props.labelOnTop && (props.tooltipPosition === 'input' || props.labelHide) && getTooltip()),
|
|
1479
1533
|
props.helpText && index.h("div", { id: helpTextId, class: "mg-c-input__help-text", innerHTML: props.helpText }),
|
|
1480
1534
|
props.errorMessage && !props.readonly && !props.disabled && (index.h("div", { id: helpTextErrorId, class: "mg-c-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" }))))));
|
|
1481
1535
|
};
|
|
@@ -1519,18 +1573,16 @@ const MgInputCheckboxList = (props) => (
|
|
|
1519
1573
|
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
1520
1574
|
index.h("ul", { class: {
|
|
1521
1575
|
'mg-c-input__input-group-container': true,
|
|
1522
|
-
'mg-c-input__input-group-container--vertical': props.inputVerticalList ||
|
|
1523
|
-
'mg-c-input__input-checkbox-multi-inputs': props.type === 'multi'
|
|
1524
|
-
}, role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes
|
|
1525
|
-
.filter(item => !props.readonly || item.value)
|
|
1526
|
-
.map(input => {
|
|
1576
|
+
'mg-c-input__input-group-container--vertical': props.inputVerticalList || props.type === 'multi',
|
|
1577
|
+
'mg-c-input__input-checkbox-multi-inputs': props.type === 'multi',
|
|
1578
|
+
}, role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes.map(input => {
|
|
1527
1579
|
var _a, _b;
|
|
1528
1580
|
return (index.h("li", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } },
|
|
1529
|
-
index.h("input", { type: "checkbox", id: input._id, name: props.name, value: (_a = input.value) === null || _a === void 0 ? void 0 : _a.toString(), checked: Boolean(input.value), required: input.required, "aria-invalid": ((_b = props.invalid) === null || _b === void 0 ? void 0 : _b.toString()) || 'false', disabled: props.
|
|
1581
|
+
index.h("input", { type: "checkbox", id: input._id, name: props.name, value: (_a = input.value) === null || _a === void 0 ? void 0 : _a.toString(), checked: Boolean(input.value), required: input.required, "aria-invalid": ((_b = props.invalid) === null || _b === void 0 ? void 0 : _b.toString()) || 'false', disabled: props.disabled || input.disabled, indeterminate: input.value === null, onInput: input._handleInput, onBlur: input._handleBlur, onKeyDown: input._handleKeydown }),
|
|
1530
1582
|
index.h("label", { htmlFor: input._id }, input.title)));
|
|
1531
1583
|
})));
|
|
1532
1584
|
|
|
1533
|
-
const mgInputCheckboxCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
1585
|
+
const mgInputCheckboxCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);gap:1rem 2.3rem;list-style:none}.mg-c-input__input-group-container--vertical{flex-direction:column}fieldset.mg-c-input{padding:0;border:0;margin-right:0;margin-left:0}fieldset.mg-c-input input[type=radio],fieldset.mg-c-input input[type=checkbox]{width:var(--mg-input-check-size);height:var(--mg-input-check-size);flex-shrink:0;margin:calc((var(--font-size)*var(--line-height) - var(--mg-input-check-size))/2) .6rem 0 0}fieldset.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:.7rem}.mg-c-input__input-container mg-tooltip{margin-left:3rem}.mg-c-input__input-group{display:flex;align-items:start}.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}}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi{display:flex;flex-wrap:wrap;column-gap:calc(var(--mg-inputs-spacer)*1.2)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi--with-values.mg-c-input__input-checkbox-multi{gap:.4rem}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi .mg-c-input__input-checkbox-multi-content{display:flex;flex-flow:column nowrap;gap:calc(0.4rem*2)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi .mg-c-input__input-checkbox-multi-content .mg-c-input__input-group{margin-left:calc(0.4rem*2)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi--search-mode.mg-c-input__input-checkbox-multi .mg-c-input__input-checkbox-multi-content{width:37rem;height:40rem}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-values-container{display:flex;flex-flow:row wrap;gap:calc(0.4rem*1);padding:0;margin:0;list-style:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-value{display:inline-flex;min-width:var(--default-size);min-height:var(--default-size);box-sizing:border-box;align-items:center;justify-content:center;padding:calc((var(--default-size) - .2rem - var(--font-size)*var(--line-height))/2) 1.1rem;border-radius:.3rem;background-color:hsl(var(--mg-color-dark-5-hsl));font-size:var(--font-size)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-no-result{text-align:center}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-text,.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-title{display:inline;margin:0;color:hsl(var(--mg-color-dark-40-hsl))}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-title{margin:0 1.1rem}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-sections{display:flex;flex-flow:column wrap;gap:calc(0.4rem*1)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-sections-container{display:flex;flex-flow:column nowrap;gap:calc(0.4rem*0);max-height:80vh;padding-right:1rem;overflow-y:auto}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-section-header{display:flex;flex-flow:row wrap;gap:calc(0.4rem*2);min-height:var(--default-size);flex-wrap:nowrap;align-items:center;text-wrap:nowrap}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-section-header-tootlip{display:inline-block;width:auto;height:auto;margin:0}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-section-header-label{font-size:var(--font-size)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-checkbox-multi-inputs{padding:.4rem calc(0.4rem*2) .4rem calc(0.4rem/2);margin:0}.mg-c-input.mg-c-input--checkbox-multi:not(.mg-c-input--label-on-top) mg-tooltip:not(.mg-c-input__input-checkbox-multi-section-header-tootlip){margin-left:var(--mg-inputs-spacer)}.mg-c-input.mg-c-input--checkbox-multi mg-popover{--mg-popover-min-width:7rem;--mg-card-padding:calc(0.4rem * 2)}.mg-c-input.mg-c-input--checkbox-multi mg-input-text{--mg-inputs-margin-bottom:0}";
|
|
1534
1586
|
const MgInputCheckboxStyle0 = mgInputCheckboxCss;
|
|
1535
1587
|
|
|
1536
1588
|
/**
|
|
@@ -1649,6 +1701,16 @@ const MgInputCheckbox = class {
|
|
|
1649
1701
|
return o;
|
|
1650
1702
|
});
|
|
1651
1703
|
};
|
|
1704
|
+
/**
|
|
1705
|
+
* Get readonly values
|
|
1706
|
+
* @returns formated readonly value
|
|
1707
|
+
*/
|
|
1708
|
+
this.getReadonlyValues = () => this.inputVerticalList
|
|
1709
|
+
? this.value.filter(({ value }) => value).map(({ title }) => title)
|
|
1710
|
+
: this.value
|
|
1711
|
+
.filter(({ value }) => value)
|
|
1712
|
+
.map(({ title }) => title)
|
|
1713
|
+
.join(', ');
|
|
1652
1714
|
/**
|
|
1653
1715
|
* has invalid input
|
|
1654
1716
|
* @returns true if at least one input is invalid
|
|
@@ -1658,7 +1720,7 @@ const MgInputCheckbox = class {
|
|
|
1658
1720
|
* Method to update searchResults
|
|
1659
1721
|
*/
|
|
1660
1722
|
this.updateSearchResults = () => {
|
|
1661
|
-
this.searchResults = this.checkboxItems.filter(item =>
|
|
1723
|
+
this.searchResults = this.checkboxItems.filter(item => index$1.Ce(item.title).includes(index$1.Ce(this.searchValue)));
|
|
1662
1724
|
};
|
|
1663
1725
|
/**
|
|
1664
1726
|
* Methode to validate if one of inputs value is checked id required
|
|
@@ -1728,10 +1790,11 @@ const MgInputCheckbox = class {
|
|
|
1728
1790
|
this.displaySelectedValues = undefined;
|
|
1729
1791
|
this.disabled = false;
|
|
1730
1792
|
this.tooltip = undefined;
|
|
1793
|
+
this.tooltipPosition = 'input';
|
|
1731
1794
|
this.helpText = undefined;
|
|
1732
1795
|
this.valid = undefined;
|
|
1733
1796
|
this.invalid = undefined;
|
|
1734
|
-
this.classCollection = new
|
|
1797
|
+
this.classCollection = new index$1.Fe([this.baseClassName]);
|
|
1735
1798
|
this.errorMessage = undefined;
|
|
1736
1799
|
this.checkboxItems = [];
|
|
1737
1800
|
this.displaySearchInput = undefined;
|
|
@@ -1818,7 +1881,7 @@ const MgInputCheckbox = class {
|
|
|
1818
1881
|
if (typeof valid !== 'boolean') {
|
|
1819
1882
|
throw new Error('<mg-input-checkbox> method "setError()" param "valid" must be a boolean');
|
|
1820
1883
|
}
|
|
1821
|
-
else if (!
|
|
1884
|
+
else if (!index$1.He(errorMessage)) {
|
|
1822
1885
|
throw new Error('<mg-input-checkbox> method "setError()" param "errorMessage" must be a string');
|
|
1823
1886
|
}
|
|
1824
1887
|
else {
|
|
@@ -1861,7 +1924,7 @@ const MgInputCheckbox = class {
|
|
|
1861
1924
|
*/
|
|
1862
1925
|
componentWillLoad() {
|
|
1863
1926
|
// Get locales
|
|
1864
|
-
this.messages =
|
|
1927
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
1865
1928
|
// Validate
|
|
1866
1929
|
// `validateType` must be done before `validateValue` because we need to set mode['auto'|'custom'] from type
|
|
1867
1930
|
// and `validateValue` updates `this.checkboxItems` watcher which requires a defined `this.type`.
|
|
@@ -1881,9 +1944,11 @@ const MgInputCheckbox = class {
|
|
|
1881
1944
|
*/
|
|
1882
1945
|
componentDidLoad() {
|
|
1883
1946
|
var _a, _b;
|
|
1884
|
-
this.
|
|
1885
|
-
|
|
1886
|
-
|
|
1947
|
+
if (!this.readonly) {
|
|
1948
|
+
this.element.shadowRoot.querySelector('legend').setAttribute('id', this.legendId);
|
|
1949
|
+
this.searchInput = (_a = this.element.shadowRoot.querySelector('mg-input-text')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('input');
|
|
1950
|
+
(_b = this.searchInput) === null || _b === void 0 ? void 0 : _b.addEventListener('keydown', this.handleKeydown);
|
|
1951
|
+
}
|
|
1887
1952
|
}
|
|
1888
1953
|
/**
|
|
1889
1954
|
* Render checkboxes by section
|
|
@@ -1925,7 +1990,7 @@ const MgInputCheckbox = class {
|
|
|
1925
1990
|
index.h("mg-input-text", { key: "input-search", identifier: `${this.identifier}-input-search`, icon: "magnifying-glass", type: "search", placeholder: this.messages.input.checkbox.label, label: this.messages.input.checkbox.label, mgWidth: "full", value: this.searchValue, labelHide: true, displayCharacterLeft: false, name: "q", "onValue-change": this.handleSearchChange, "aria-controls": "search-results items-list" }),
|
|
1926
1991
|
index.h("p", { key: "search-results", role: "status", class: "mg-u-visually-hidden", id: "search-results" }, `${checkboxes.length} ${this.messages.input.checkbox[checkboxes.length > 0 ? 'results' : 'result']}`),
|
|
1927
1992
|
index.h("div", { key: "sections-container", class: "mg-c-input__input-checkbox-multi-sections-container" }, this.renderCheckboxBySection(checkboxes)),
|
|
1928
|
-
]) : (index.h(MgInputCheckboxList, { checkboxes: checkboxes, inputVerticalList: true, type: this.type,
|
|
1993
|
+
]) : (index.h(MgInputCheckboxList, { checkboxes: checkboxes, inputVerticalList: true, type: this.type, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name, invalid: this.invalid })), this.displaySearchInput && checkboxes.length === 0 && index.h("p", { class: "mg-c-input__input-checkbox-multi-no-result" }, this.messages.input.checkbox.noResult))), this.displaySelectedValues ? (selectedValuesNb > 0 && (index.h("ul", { role: "list", class: "mg-c-input__input-checkbox-multi-values-container" }, this.getSelectedItems().map(({ title }) => (index.h("li", { class: "mg-c-input__input-checkbox-multi-value", key: title }, title)))))) : (index.h("strong", null, this.messages.input.checkbox[selectedValuesNb > 1 ? 'selectedValues' : 'selectedValue'].replace('{nb}', selectedValuesNb)))));
|
|
1929
1994
|
}
|
|
1930
1995
|
/**
|
|
1931
1996
|
* Render
|
|
@@ -1933,7 +1998,7 @@ const MgInputCheckbox = class {
|
|
|
1933
1998
|
*/
|
|
1934
1999
|
render() {
|
|
1935
2000
|
var _a;
|
|
1936
|
-
return (index.h(MgInput, { key: '
|
|
2001
|
+
return (index.h(MgInput, { key: 'a36e398ac67e25249ea078b9ad70af146f045fde', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString(), readonlyValue: this.getReadonlyValues(), tooltip: !this.readonly ? this.tooltip : undefined, tooltipPosition: this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined, isFieldset: true }, this.type === 'checkbox' ? (index.h(MgInputCheckboxList, { checkboxes: this.checkboxItems, inputVerticalList: this.inputVerticalList, type: this.type, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name, invalid: this.invalid })) : (this.renderCheckboxMulti())));
|
|
1937
2002
|
}
|
|
1938
2003
|
get element() { return index.getElement(this); }
|
|
1939
2004
|
static get watchers() { return {
|
|
@@ -2048,7 +2113,7 @@ const MgInputCheckboxPaginated = class {
|
|
|
2048
2113
|
const getText = (checkboxes) => (index.h("em", { key: '28eedd949445bc6c7a5a750359af7159055657d8', class: "mg-c-input__input-checkbox-multi-section-header-label" }, `${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`));
|
|
2049
2114
|
const [from, to] = this.getFromToIndexes();
|
|
2050
2115
|
const itemsContainerId = `items-${this.sectionKind}-container`;
|
|
2051
|
-
return (index.h(index.Host, { key: 'a7ade87a72bb1cba4d0c20dde425cefc5c7fbff4', hidden: this.checkboxes.length < 1 }, index.h("div", { key: '38711edade3945e940ba29b44492424c3e5b7063', class: "mg-c-input__input-checkbox-multi-section-header" }, this.titleKind === SectionTitleKind.BUTTON ? (index.h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, index.h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down', size: "small" }), index.h("span", { class: "mg-c-input__input-checkbox-multi-text" }, getText(this.checkboxes)))) : (index.h("p", { class: "mg-c-input__input-checkbox-multi-title" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (index.h("mg-tooltip", { class: "mg-c-input__input-checkbox-multi-section-header-tootlip", message: this.messages.tooltip, "data-popper-strategy": "absolute" }, index.h("mg-button", { variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (index.h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), index.h("div", { key: '3a514d5711da9ebb57d21e70609b7f6f2d1e621e', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__input-checkbox-multi-section-content" }, index.h(MgInputCheckboxList, { key: '
|
|
2116
|
+
return (index.h(index.Host, { key: 'a7ade87a72bb1cba4d0c20dde425cefc5c7fbff4', hidden: this.checkboxes.length < 1 }, index.h("div", { key: '38711edade3945e940ba29b44492424c3e5b7063', class: "mg-c-input__input-checkbox-multi-section-header" }, this.titleKind === SectionTitleKind.BUTTON ? (index.h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, index.h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down', size: "small" }), index.h("span", { class: "mg-c-input__input-checkbox-multi-text" }, getText(this.checkboxes)))) : (index.h("p", { class: "mg-c-input__input-checkbox-multi-title" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (index.h("mg-tooltip", { class: "mg-c-input__input-checkbox-multi-section-header-tootlip", message: this.messages.tooltip, "data-popper-strategy": "absolute" }, index.h("mg-button", { variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (index.h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), index.h("div", { key: '3a514d5711da9ebb57d21e70609b7f6f2d1e621e', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__input-checkbox-multi-section-content" }, index.h(MgInputCheckboxList, { key: '84223d73e67e355ce01a4f70ef75a42a18fd96b4', checkboxes: this.getArrayRange(this.checkboxes, from, to), inputVerticalList: true, type: 'multi', displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
|
|
2052
2117
|
}
|
|
2053
2118
|
static get watchers() { return {
|
|
2054
2119
|
"checkboxes": ["validateCheckboxes"],
|
|
@@ -2064,7 +2129,7 @@ var InputError$1;
|
|
|
2064
2129
|
InputError["REQUIRED"] = "required";
|
|
2065
2130
|
})(InputError$1 || (InputError$1 = {}));
|
|
2066
2131
|
|
|
2067
|
-
const mgInputDateCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
2132
|
+
const mgInputDateCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.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}}";
|
|
2068
2133
|
const MgInputDateStyle0 = mgInputDateCss;
|
|
2069
2134
|
|
|
2070
2135
|
const MgInputDate = class {
|
|
@@ -2081,10 +2146,10 @@ const MgInputDate = class {
|
|
|
2081
2146
|
*/
|
|
2082
2147
|
this.formatHelpText = (helpText) => {
|
|
2083
2148
|
const defaultHelpTextVariable = '{defaultHelpText}';
|
|
2084
|
-
let text =
|
|
2149
|
+
let text = index$1.He(helpText) ? helpText : this.messages.input.date.helpText;
|
|
2085
2150
|
if (text.includes(defaultHelpTextVariable))
|
|
2086
2151
|
text = text.replace(defaultHelpTextVariable, this.formatHelpText(this.messages.input.date.helpText));
|
|
2087
|
-
return text.replace('{pattern}', this.renderPattern()).replace('{date}',
|
|
2152
|
+
return text.replace('{pattern}', this.renderPattern()).replace('{date}', index$1.be(index$1.Ae(new Date('2023-12-24')), this.systemLocale));
|
|
2088
2153
|
};
|
|
2089
2154
|
/**
|
|
2090
2155
|
* Handle input event
|
|
@@ -2143,7 +2208,6 @@ const MgInputDate = class {
|
|
|
2143
2208
|
* @param errorMessage - errorMessage override
|
|
2144
2209
|
*/
|
|
2145
2210
|
this.setErrorMessage = (errorMessage) => {
|
|
2146
|
-
var _a;
|
|
2147
2211
|
// Set error message
|
|
2148
2212
|
this.errorMessage = undefined;
|
|
2149
2213
|
if (!this.valid) {
|
|
@@ -2158,15 +2222,13 @@ const MgInputDate = class {
|
|
|
2158
2222
|
// min, max & minMax
|
|
2159
2223
|
else if ([InputError$1.MIN, InputError$1.MAX, InputError$1.MINMAX].includes(inputError)) {
|
|
2160
2224
|
this.errorMessage = this.messages.errors.date[inputError]
|
|
2161
|
-
.replace('{min}',
|
|
2162
|
-
.replace('{max}',
|
|
2225
|
+
.replace('{min}', index$1.be(this.min, this.systemLocale))
|
|
2226
|
+
.replace('{max}', index$1.be(this.max, this.systemLocale));
|
|
2163
2227
|
}
|
|
2164
2228
|
// wrong date format
|
|
2165
2229
|
// element.validity.badInput is default error message
|
|
2166
2230
|
else {
|
|
2167
|
-
this.errorMessage = this.messages.errors.date.badInput
|
|
2168
|
-
.replace('{min}', ((_a = this.min) === null || _a === void 0 ? void 0 : _a.length) > 0 ? mgMenu_conf.be(this.min, this.systemLocale) : mgMenu_conf.be('1900-01-01', this.systemLocale))
|
|
2169
|
-
.replace('{pattern}', this.renderPattern());
|
|
2231
|
+
this.errorMessage = this.messages.errors.date.badInput.replace('{pattern}', this.renderPattern());
|
|
2170
2232
|
}
|
|
2171
2233
|
}
|
|
2172
2234
|
};
|
|
@@ -2175,7 +2237,7 @@ const MgInputDate = class {
|
|
|
2175
2237
|
* @returns translated html pattern
|
|
2176
2238
|
*/
|
|
2177
2239
|
this.renderPattern = () => {
|
|
2178
|
-
let patternLocal =
|
|
2240
|
+
let patternLocal = index$1.Ee(this.systemLocale);
|
|
2179
2241
|
for (const key in this.messages.input.date.pattern) {
|
|
2180
2242
|
patternLocal = patternLocal.replace(key, this.messages.input.date.pattern[key]);
|
|
2181
2243
|
}
|
|
@@ -2193,17 +2255,18 @@ const MgInputDate = class {
|
|
|
2193
2255
|
this.max = undefined;
|
|
2194
2256
|
this.disabled = false;
|
|
2195
2257
|
this.tooltip = undefined;
|
|
2258
|
+
this.tooltipPosition = 'input';
|
|
2196
2259
|
this.helpText = undefined;
|
|
2197
2260
|
this.valid = undefined;
|
|
2198
2261
|
this.invalid = undefined;
|
|
2199
|
-
this.classCollection = new
|
|
2262
|
+
this.classCollection = new index$1.Fe(['mg-c-input--date']);
|
|
2200
2263
|
this.errorMessage = undefined;
|
|
2201
2264
|
}
|
|
2202
2265
|
validateValue(newValue) {
|
|
2203
2266
|
// When the input is not fully completed or has been cleared, the value becomes an empty string.
|
|
2204
2267
|
if (newValue === '')
|
|
2205
2268
|
newValue = null;
|
|
2206
|
-
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !
|
|
2269
|
+
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !index$1.Se.test(newValue))) {
|
|
2207
2270
|
throw new Error("<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd");
|
|
2208
2271
|
}
|
|
2209
2272
|
else {
|
|
@@ -2211,7 +2274,7 @@ const MgInputDate = class {
|
|
|
2211
2274
|
}
|
|
2212
2275
|
}
|
|
2213
2276
|
validateMinMax(newValue) {
|
|
2214
|
-
if ((newValue === null || newValue === void 0 ? void 0 : newValue.length) === 0 || ((newValue === null || newValue === void 0 ? void 0 : newValue.length) > 0 && !(typeof newValue === 'string' &&
|
|
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.Se.test(newValue)))) {
|
|
2215
2278
|
throw new Error("<mg-input-date> props 'min/max' doesn't match pattern: yyyy-mm-dd");
|
|
2216
2279
|
}
|
|
2217
2280
|
}
|
|
@@ -2245,7 +2308,7 @@ const MgInputDate = class {
|
|
|
2245
2308
|
if (typeof valid !== 'boolean') {
|
|
2246
2309
|
throw new Error('<mg-input-date> method "setError()" param "valid" must be a boolean');
|
|
2247
2310
|
}
|
|
2248
|
-
else if (!
|
|
2311
|
+
else if (!index$1.He(errorMessage)) {
|
|
2249
2312
|
throw new Error('<mg-input-date> method "setError()" param "errorMessage" must be a string');
|
|
2250
2313
|
}
|
|
2251
2314
|
else {
|
|
@@ -2275,7 +2338,7 @@ const MgInputDate = class {
|
|
|
2275
2338
|
*/
|
|
2276
2339
|
componentWillLoad() {
|
|
2277
2340
|
// Get locales
|
|
2278
|
-
const locales =
|
|
2341
|
+
const locales = index$1.initLocales(this.element);
|
|
2279
2342
|
this.locale = locales.locale;
|
|
2280
2343
|
this.messages = locales.messages;
|
|
2281
2344
|
// as a native input use the OS locale to define the date pattern
|
|
@@ -2297,7 +2360,7 @@ const MgInputDate = class {
|
|
|
2297
2360
|
* @returns HTML Element
|
|
2298
2361
|
*/
|
|
2299
2362
|
render() {
|
|
2300
|
-
return (index.h(MgInput, { key: '
|
|
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.be(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) => {
|
|
2301
2364
|
if (el !== null)
|
|
2302
2365
|
this.input = el;
|
|
2303
2366
|
} })));
|
|
@@ -2318,6 +2381,7 @@ MgInputDate.style = MgInputDateStyle0;
|
|
|
2318
2381
|
* List of all possibles types
|
|
2319
2382
|
*/
|
|
2320
2383
|
const types = ['decimal', 'integer', 'currency'];
|
|
2384
|
+
const formats = ['none', 'number', 'currency'];
|
|
2321
2385
|
var InputError;
|
|
2322
2386
|
(function (InputError) {
|
|
2323
2387
|
InputError["MIN"] = "min";
|
|
@@ -2326,7 +2390,7 @@ var InputError;
|
|
|
2326
2390
|
InputError["REQUIRED"] = "required";
|
|
2327
2391
|
})(InputError || (InputError = {}));
|
|
2328
2392
|
|
|
2329
|
-
const mgInputNumericCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
2393
|
+
const mgInputNumericCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.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}}.mg-c-input .mg-c-input__box{text-align:var(--mg-inputs-text-align, right)}";
|
|
2330
2394
|
const MgInputNumericStyle0 = mgInputNumericCss;
|
|
2331
2395
|
|
|
2332
2396
|
const MgInputNumeric = class {
|
|
@@ -2426,7 +2490,16 @@ const MgInputNumeric = class {
|
|
|
2426
2490
|
* @param value - value to format
|
|
2427
2491
|
* @returns formated local value
|
|
2428
2492
|
*/
|
|
2429
|
-
this.formatValue = (value) =>
|
|
2493
|
+
this.formatValue = (value) => {
|
|
2494
|
+
switch (this.format) {
|
|
2495
|
+
case 'number':
|
|
2496
|
+
return index$1.Me(value, this.locale);
|
|
2497
|
+
case 'currency':
|
|
2498
|
+
return index$1.Re(value, this.locale, this.currency);
|
|
2499
|
+
case 'none':
|
|
2500
|
+
return value.toString();
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2430
2503
|
/**
|
|
2431
2504
|
* Validate append slot
|
|
2432
2505
|
*/
|
|
@@ -2450,14 +2523,16 @@ const MgInputNumeric = class {
|
|
|
2450
2523
|
this.disabled = false;
|
|
2451
2524
|
this.mgWidth = undefined;
|
|
2452
2525
|
this.tooltip = undefined;
|
|
2526
|
+
this.tooltipPosition = 'input';
|
|
2453
2527
|
this.helpText = undefined;
|
|
2454
|
-
this.type =
|
|
2528
|
+
this.type = 'decimal';
|
|
2529
|
+
this.format = 'number';
|
|
2455
2530
|
this.currency = 'USD';
|
|
2456
2531
|
this.integerLength = 13;
|
|
2457
2532
|
this.decimalLength = 2;
|
|
2458
2533
|
this.valid = undefined;
|
|
2459
2534
|
this.invalid = undefined;
|
|
2460
|
-
this.classCollection = new
|
|
2535
|
+
this.classCollection = new index$1.Fe(['mg-c-input--numeric']);
|
|
2461
2536
|
this.errorMessage = undefined;
|
|
2462
2537
|
this.hasFocus = undefined;
|
|
2463
2538
|
}
|
|
@@ -2493,6 +2568,14 @@ const MgInputNumeric = class {
|
|
|
2493
2568
|
if (!types.includes(newValue)) {
|
|
2494
2569
|
throw new Error(`<mg-input-numeric> prop "type" must be one of: ${types.join(', ')}`);
|
|
2495
2570
|
}
|
|
2571
|
+
else if (newValue === 'currency') {
|
|
2572
|
+
this.format = 'currency';
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
watchFormat(newValue) {
|
|
2576
|
+
if (!formats.includes(newValue)) {
|
|
2577
|
+
throw new Error(`<mg-input-numeric> prop "format" must be one of: ${formats.join(', ')}`);
|
|
2578
|
+
}
|
|
2496
2579
|
}
|
|
2497
2580
|
validateIntegerLength(newValue) {
|
|
2498
2581
|
if (newValue < 1) {
|
|
@@ -2524,7 +2607,7 @@ const MgInputNumeric = class {
|
|
|
2524
2607
|
if (typeof valid !== 'boolean') {
|
|
2525
2608
|
throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
|
|
2526
2609
|
}
|
|
2527
|
-
else if (!
|
|
2610
|
+
else if (!index$1.He(errorMessage)) {
|
|
2528
2611
|
throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
|
|
2529
2612
|
}
|
|
2530
2613
|
else {
|
|
@@ -2593,10 +2676,11 @@ const MgInputNumeric = class {
|
|
|
2593
2676
|
*/
|
|
2594
2677
|
componentWillLoad() {
|
|
2595
2678
|
// Get locales
|
|
2596
|
-
const locales =
|
|
2679
|
+
const locales = index$1.initLocales(this.element);
|
|
2597
2680
|
this.locale = locales.locale;
|
|
2598
2681
|
this.messages = locales.messages;
|
|
2599
2682
|
// Validate component config
|
|
2683
|
+
this.watchFormat(this.format);
|
|
2600
2684
|
this.validateType(this.type);
|
|
2601
2685
|
this.validateIntegerLength(this.integerLength);
|
|
2602
2686
|
this.validateDecimalLength(this.decimalLength);
|
|
@@ -2615,10 +2699,10 @@ const MgInputNumeric = class {
|
|
|
2615
2699
|
* @returns HTML Element
|
|
2616
2700
|
*/
|
|
2617
2701
|
render() {
|
|
2618
|
-
return (index.h(MgInput, { key: '
|
|
2702
|
+
return (index.h(MgInput, { key: 'f4b30471e47f934e0fa1b132f6fc3605ba0ce8f0', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("input", { key: '39a6e888cfc819c4685c93731e05da29249fb408', type: "text", class: "mg-c-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
|
|
2619
2703
|
if (el !== null)
|
|
2620
2704
|
this.input = el;
|
|
2621
|
-
} }), index.h("slot", { key: '
|
|
2705
|
+
} }), index.h("slot", { key: '6db575640ca6f6e7074517547d26cc096912e2a4', name: "append-input" })));
|
|
2622
2706
|
}
|
|
2623
2707
|
get element() { return index.getElement(this); }
|
|
2624
2708
|
static get watchers() { return {
|
|
@@ -2629,13 +2713,14 @@ const MgInputNumeric = class {
|
|
|
2629
2713
|
"min": ["handleValidityChange"],
|
|
2630
2714
|
"max": ["handleValidityChange"],
|
|
2631
2715
|
"type": ["validateType"],
|
|
2716
|
+
"format": ["watchFormat"],
|
|
2632
2717
|
"integerLength": ["validateIntegerLength"],
|
|
2633
2718
|
"decimalLength": ["validateDecimalLength"]
|
|
2634
2719
|
}; }
|
|
2635
2720
|
};
|
|
2636
2721
|
MgInputNumeric.style = MgInputNumericStyle0;
|
|
2637
2722
|
|
|
2638
|
-
const mgInputPasswordCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
2723
|
+
const mgInputPasswordCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.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}}";
|
|
2639
2724
|
const MgInputPasswordStyle0 = mgInputPasswordCss;
|
|
2640
2725
|
|
|
2641
2726
|
const MgInputPassword = class {
|
|
@@ -2701,10 +2786,11 @@ const MgInputPassword = class {
|
|
|
2701
2786
|
this.disabled = false;
|
|
2702
2787
|
this.mgWidth = 'full';
|
|
2703
2788
|
this.tooltip = undefined;
|
|
2789
|
+
this.tooltipPosition = 'input';
|
|
2704
2790
|
this.helpText = undefined;
|
|
2705
2791
|
this.valid = undefined;
|
|
2706
2792
|
this.invalid = undefined;
|
|
2707
|
-
this.classCollection = new
|
|
2793
|
+
this.classCollection = new index$1.Fe(['mg-c-input--password']);
|
|
2708
2794
|
this.errorMessage = undefined;
|
|
2709
2795
|
}
|
|
2710
2796
|
handleValue(newValue) {
|
|
@@ -2740,7 +2826,7 @@ const MgInputPassword = class {
|
|
|
2740
2826
|
if (typeof valid !== 'boolean') {
|
|
2741
2827
|
throw new Error('<mg-input-password> method "setError()" param "valid" must be a boolean');
|
|
2742
2828
|
}
|
|
2743
|
-
else if (!
|
|
2829
|
+
else if (!index$1.He(errorMessage)) {
|
|
2744
2830
|
throw new Error('<mg-input-password> method "setError()" param "errorMessage" must be a string');
|
|
2745
2831
|
}
|
|
2746
2832
|
else {
|
|
@@ -2770,7 +2856,7 @@ const MgInputPassword = class {
|
|
|
2770
2856
|
*/
|
|
2771
2857
|
componentWillLoad() {
|
|
2772
2858
|
// Get locales
|
|
2773
|
-
this.messages =
|
|
2859
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
2774
2860
|
// Check validity when component is ready
|
|
2775
2861
|
// return a promise to process action only in the FIRST render().
|
|
2776
2862
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -2783,7 +2869,7 @@ const MgInputPassword = class {
|
|
|
2783
2869
|
* @returns HTML Element
|
|
2784
2870
|
*/
|
|
2785
2871
|
render() {
|
|
2786
|
-
return (index.h(MgInput, { key: '
|
|
2872
|
+
return (index.h(MgInput, { key: 'c450a9e75c592dab0f28fcd01d380cdc3d3eec92', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.value !== undefined ? '•'.repeat(this.value.length) : undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("input", { key: '30c51bb8881526c2a4037236dbba0bd5668ae8cf', type: "password", class: "mg-c-input__box", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
2787
2873
|
if (el !== null)
|
|
2788
2874
|
this.input = el;
|
|
2789
2875
|
} })));
|
|
@@ -2798,7 +2884,7 @@ const MgInputPassword = class {
|
|
|
2798
2884
|
};
|
|
2799
2885
|
MgInputPassword.style = MgInputPasswordStyle0;
|
|
2800
2886
|
|
|
2801
|
-
const mgInputRadioCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
2887
|
+
const mgInputRadioCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);gap:1rem 2.3rem;list-style:none}.mg-c-input__input-group-container--vertical{flex-direction:column}fieldset.mg-c-input{padding:0;border:0;margin-right:0;margin-left:0}fieldset.mg-c-input input[type=radio],fieldset.mg-c-input input[type=checkbox]{width:var(--mg-input-check-size);height:var(--mg-input-check-size);flex-shrink:0;margin:calc((var(--font-size)*var(--line-height) - var(--mg-input-check-size))/2) .6rem 0 0}fieldset.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:.7rem}.mg-c-input__input-container mg-tooltip{margin-left:3rem}.mg-c-input__input-group{display:flex;align-items:start}.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}}";
|
|
2802
2888
|
const MgInputRadioStyle0 = mgInputRadioCss;
|
|
2803
2889
|
|
|
2804
2890
|
/**
|
|
@@ -2877,10 +2963,11 @@ const MgInputRadio = class {
|
|
|
2877
2963
|
this.readonly = false;
|
|
2878
2964
|
this.disabled = false;
|
|
2879
2965
|
this.tooltip = undefined;
|
|
2966
|
+
this.tooltipPosition = 'input';
|
|
2880
2967
|
this.helpText = undefined;
|
|
2881
2968
|
this.valid = undefined;
|
|
2882
2969
|
this.invalid = undefined;
|
|
2883
|
-
this.classCollection = new
|
|
2970
|
+
this.classCollection = new index$1.Fe(['mg-c-input--radio']);
|
|
2884
2971
|
this.errorMessage = undefined;
|
|
2885
2972
|
this.options = undefined;
|
|
2886
2973
|
}
|
|
@@ -2893,7 +2980,7 @@ const MgInputRadio = class {
|
|
|
2893
2980
|
throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
|
|
2894
2981
|
}
|
|
2895
2982
|
// String array
|
|
2896
|
-
else if (
|
|
2983
|
+
else if (index$1.De(newValue)) {
|
|
2897
2984
|
this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
|
|
2898
2985
|
}
|
|
2899
2986
|
// Object array
|
|
@@ -2934,7 +3021,7 @@ const MgInputRadio = class {
|
|
|
2934
3021
|
if (typeof valid !== 'boolean') {
|
|
2935
3022
|
throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
|
|
2936
3023
|
}
|
|
2937
|
-
else if (!
|
|
3024
|
+
else if (!index$1.He(errorMessage)) {
|
|
2938
3025
|
throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
|
|
2939
3026
|
}
|
|
2940
3027
|
else {
|
|
@@ -2964,7 +3051,7 @@ const MgInputRadio = class {
|
|
|
2964
3051
|
*/
|
|
2965
3052
|
componentWillLoad() {
|
|
2966
3053
|
// Get locales
|
|
2967
|
-
this.messages =
|
|
3054
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
2968
3055
|
// Validate
|
|
2969
3056
|
this.validateItems(this.items);
|
|
2970
3057
|
// Check validity when component is ready
|
|
@@ -2979,7 +3066,7 @@ const MgInputRadio = class {
|
|
|
2979
3066
|
* @returns HTML Element
|
|
2980
3067
|
*/
|
|
2981
3068
|
render() {
|
|
2982
|
-
return (index.h(MgInput, { key: '
|
|
3069
|
+
return (index.h(MgInput, { key: 'f726d14cdde45bbeb1aea5dee0bc220d68bf1726', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, index.h("ul", { key: '7909a5bf6872c20c28f0f30aa1afa53a959c4298', class: { 'mg-c-input__input-group-container': true, 'mg-c-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index$1) => (index.h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "radio", id: this.identifier + '_' + index$1, name: this.identifier, value: index$1, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index$1].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
|
|
2983
3070
|
if (el !== null)
|
|
2984
3071
|
this.inputs[index$1] = el;
|
|
2985
3072
|
} }), index.h("label", { htmlFor: this.identifier + '_' + index$1 }, input.title)))))));
|
|
@@ -2995,7 +3082,7 @@ const MgInputRadio = class {
|
|
|
2995
3082
|
};
|
|
2996
3083
|
MgInputRadio.style = MgInputRadioStyle0;
|
|
2997
3084
|
|
|
2998
|
-
const mgInputSelectCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
3085
|
+
const mgInputSelectCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.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}}.mg-c-input__box{width:100%;padding-top:0;padding-right:1rem;padding-bottom:0}:host(:not([mg-width])) .mg-c-input--select:not(.mg-c-input--label-on-top) .mg-c-input__box{max-width:unset}";
|
|
2999
3086
|
const MgInputSelectStyle0 = mgInputSelectCss;
|
|
3000
3087
|
|
|
3001
3088
|
/**
|
|
@@ -3076,7 +3163,7 @@ const MgInputSelect = class {
|
|
|
3076
3163
|
if (this.input.value === '') {
|
|
3077
3164
|
this.setValue(null);
|
|
3078
3165
|
}
|
|
3079
|
-
else if (
|
|
3166
|
+
else if (index$1.De(this.items) && this.items.includes(this.input.value)) {
|
|
3080
3167
|
this.setValue(this.input.value);
|
|
3081
3168
|
}
|
|
3082
3169
|
else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
|
|
@@ -3147,10 +3234,11 @@ const MgInputSelect = class {
|
|
|
3147
3234
|
this.disabled = false;
|
|
3148
3235
|
this.mgWidth = undefined;
|
|
3149
3236
|
this.tooltip = undefined;
|
|
3237
|
+
this.tooltipPosition = 'input';
|
|
3150
3238
|
this.helpText = undefined;
|
|
3151
3239
|
this.valid = undefined;
|
|
3152
3240
|
this.invalid = undefined;
|
|
3153
|
-
this.classCollection = new
|
|
3241
|
+
this.classCollection = new index$1.Fe(['mg-c-input--select']);
|
|
3154
3242
|
this.errorMessage = undefined;
|
|
3155
3243
|
this.options = undefined;
|
|
3156
3244
|
this.valueExist = undefined;
|
|
@@ -3158,7 +3246,7 @@ const MgInputSelect = class {
|
|
|
3158
3246
|
}
|
|
3159
3247
|
validateValue(newValue) {
|
|
3160
3248
|
var _a, _b;
|
|
3161
|
-
if (
|
|
3249
|
+
if (index$1.De(this.items) && typeof newValue === 'string') {
|
|
3162
3250
|
this.readonlyValue = ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) ? this.input.value : newValue;
|
|
3163
3251
|
}
|
|
3164
3252
|
else if (allItemsAreOptions(this.items)) {
|
|
@@ -3175,7 +3263,7 @@ const MgInputSelect = class {
|
|
|
3175
3263
|
this.options = [];
|
|
3176
3264
|
}
|
|
3177
3265
|
// String array
|
|
3178
|
-
else if (
|
|
3266
|
+
else if (index$1.De(newValue)) {
|
|
3179
3267
|
if (typeof this.value === 'string')
|
|
3180
3268
|
this.valueExist = newValue.includes(this.value);
|
|
3181
3269
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
@@ -3226,7 +3314,7 @@ const MgInputSelect = class {
|
|
|
3226
3314
|
if (typeof valid !== 'boolean') {
|
|
3227
3315
|
throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean');
|
|
3228
3316
|
}
|
|
3229
|
-
else if (!
|
|
3317
|
+
else if (!index$1.He(errorMessage)) {
|
|
3230
3318
|
throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string');
|
|
3231
3319
|
}
|
|
3232
3320
|
else {
|
|
@@ -3256,7 +3344,7 @@ const MgInputSelect = class {
|
|
|
3256
3344
|
*/
|
|
3257
3345
|
componentWillLoad() {
|
|
3258
3346
|
// Get locales
|
|
3259
|
-
this.messages =
|
|
3347
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
3260
3348
|
// Validate
|
|
3261
3349
|
this.validateItems(this.items);
|
|
3262
3350
|
this.validateValue(this.value);
|
|
@@ -3276,7 +3364,7 @@ const MgInputSelect = class {
|
|
|
3276
3364
|
* @returns HTML Element
|
|
3277
3365
|
*/
|
|
3278
3366
|
render() {
|
|
3279
|
-
return (index.h(MgInput, { key: '
|
|
3367
|
+
return (index.h(MgInput, { key: 'd87b66d5c851e222a80331812969c08601f3d84b', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: undefined, readonlyValue: this.readonlyValue, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("select", { key: 'c7804f7d8c652e566d2d4cbf015c70517cf5537c', 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) => {
|
|
3280
3368
|
if (el !== null)
|
|
3281
3369
|
this.input = el;
|
|
3282
3370
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -3293,7 +3381,7 @@ const MgInputSelect = class {
|
|
|
3293
3381
|
};
|
|
3294
3382
|
MgInputSelect.style = MgInputSelectStyle0;
|
|
3295
3383
|
|
|
3296
|
-
const mgInputTextCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
3384
|
+
const mgInputTextCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.mg-c-input mg-character-left{font-size:1.1rem;opacity:.6}.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__help-text,.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__error{margin-top:0}.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}}.mg-c-input__with-character-left{position:relative;display:inline-flex}.mg-c-input--width-full .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left .mg-c-input__box{padding-right:calc(var(--mg-character-left-message-length)*1ch + .8rem)}.mg-c-input__with-character-left mg-character-left{position:absolute;top:50%;right:1rem;display:none;font-size:1.1rem;opacity:.6;transform:translateY(-50%)}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{display:block}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-c-input.mg-c-input--has-icon .mg-c-input__with-character-left .mg-c-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer)*2)}";
|
|
3297
3385
|
const MgInputTextStyle0 = mgInputTextCss;
|
|
3298
3386
|
|
|
3299
3387
|
const isDatalistOption = (options) => Array.isArray(options) && options.every(option => typeof option === 'string');
|
|
@@ -3326,7 +3414,7 @@ const MgInputText = class {
|
|
|
3326
3414
|
*/
|
|
3327
3415
|
this.handleFocus = () => {
|
|
3328
3416
|
this.classCollection.add(this.classFocus);
|
|
3329
|
-
this.classCollection = new
|
|
3417
|
+
this.classCollection = new index$1.Fe(this.classCollection.classes);
|
|
3330
3418
|
};
|
|
3331
3419
|
/**
|
|
3332
3420
|
* Handle blur event
|
|
@@ -3334,7 +3422,7 @@ const MgInputText = class {
|
|
|
3334
3422
|
this.handleBlur = () => {
|
|
3335
3423
|
// Manage focus
|
|
3336
3424
|
this.classCollection.delete(this.classFocus);
|
|
3337
|
-
this.classCollection = new
|
|
3425
|
+
this.classCollection = new index$1.Fe(this.classCollection.classes);
|
|
3338
3426
|
// Display Error
|
|
3339
3427
|
this.handlerInProgress = Handler.BLUR;
|
|
3340
3428
|
this.displayError().finally(() => {
|
|
@@ -3405,11 +3493,12 @@ const MgInputText = class {
|
|
|
3405
3493
|
this.pattern = undefined;
|
|
3406
3494
|
this.patternErrorMessage = undefined;
|
|
3407
3495
|
this.tooltip = undefined;
|
|
3496
|
+
this.tooltipPosition = 'input';
|
|
3408
3497
|
this.displayCharacterLeft = true;
|
|
3409
3498
|
this.helpText = undefined;
|
|
3410
3499
|
this.valid = undefined;
|
|
3411
3500
|
this.invalid = undefined;
|
|
3412
|
-
this.classCollection = new
|
|
3501
|
+
this.classCollection = new index$1.Fe(['mg-c-input--text']);
|
|
3413
3502
|
this.errorMessage = undefined;
|
|
3414
3503
|
}
|
|
3415
3504
|
handleValue(newValue) {
|
|
@@ -3439,7 +3528,7 @@ const MgInputText = class {
|
|
|
3439
3528
|
}
|
|
3440
3529
|
}
|
|
3441
3530
|
validatePattern(newValue) {
|
|
3442
|
-
if (newValue !== undefined && !(
|
|
3531
|
+
if (newValue !== undefined && !(index$1.He(this.pattern) && index$1.He(this.patternErrorMessage))) {
|
|
3443
3532
|
throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3444
3533
|
}
|
|
3445
3534
|
}
|
|
@@ -3469,7 +3558,7 @@ const MgInputText = class {
|
|
|
3469
3558
|
if (typeof valid !== 'boolean') {
|
|
3470
3559
|
throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
|
|
3471
3560
|
}
|
|
3472
|
-
else if (!
|
|
3561
|
+
else if (!index$1.He(errorMessage)) {
|
|
3473
3562
|
throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
|
|
3474
3563
|
}
|
|
3475
3564
|
else {
|
|
@@ -3499,7 +3588,7 @@ const MgInputText = class {
|
|
|
3499
3588
|
*/
|
|
3500
3589
|
componentWillLoad() {
|
|
3501
3590
|
// Get locales
|
|
3502
|
-
this.messages =
|
|
3591
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
3503
3592
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3504
3593
|
this.datalistId = `${this.identifier}-datalist`;
|
|
3505
3594
|
// Validate
|
|
@@ -3520,14 +3609,14 @@ const MgInputText = class {
|
|
|
3520
3609
|
* @returns HTML Element
|
|
3521
3610
|
*/
|
|
3522
3611
|
render() {
|
|
3523
|
-
return (index.h(MgInput, { key: '
|
|
3612
|
+
return (index.h(MgInput, { key: '588874f4ce3dfe230190636fdb985f1c7cd667f6', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("div", { key: '0c543cdc61727ffac94b2b550257e69e12c6c2bf', class: "mg-c-input__with-character-left", style: {
|
|
3524
3613
|
'--mg-character-left-message-length': (this.displayCharacterLeft
|
|
3525
3614
|
? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
|
|
3526
3615
|
: 0).toString(),
|
|
3527
|
-
} }, this.icon !== undefined && index.h("mg-icon", { icon: this.icon }), index.h("input", { key: '
|
|
3616
|
+
} }, this.icon !== undefined && index.h("mg-icon", { icon: this.icon }), index.h("input", { key: '7ec8b525e055f345e21af55bc7d68c92241c3cd8', type: this.type, class: "mg-c-input__box", value: this.value, id: this.identifier, list: this.hasDatalist() ? this.datalistId : undefined, autocomplete: this.hasDatalist() ? 'off' : undefined, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), pattern: this.pattern, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
|
|
3528
3617
|
if (el !== null)
|
|
3529
3618
|
this.input = el;
|
|
3530
|
-
} }), this.hasDatalist() && (index.h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (index.h("option", { value: option, key: option }))))), this.displayCharacterLeft && this.maxlength > 0 && (index.h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), index.h("slot", { key: '
|
|
3619
|
+
} }), this.hasDatalist() && (index.h("datalist", { id: this.datalistId }, this.datalistoptions.map(option => (index.h("option", { value: option, key: option }))))), this.displayCharacterLeft && this.maxlength > 0 && (index.h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))), index.h("slot", { key: 'b68af1be76d8513119dd9b3c50f1feedd0a011f5', name: "append-input" })));
|
|
3531
3620
|
}
|
|
3532
3621
|
get element() { return index.getElement(this); }
|
|
3533
3622
|
static get watchers() { return {
|
|
@@ -3543,7 +3632,7 @@ const MgInputText = class {
|
|
|
3543
3632
|
};
|
|
3544
3633
|
MgInputText.style = MgInputTextStyle0;
|
|
3545
3634
|
|
|
3546
|
-
const mgInputTextareaCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
3635
|
+
const mgInputTextareaCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.mg-c-input__box{height:var(--default-size);box-sizing:border-box;padding:calc((var(--default-size) - var(--font-size)*var(--line-height))/2) var(--mg-inputs-spacer);border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));color:hsl(var(--color-dark));font-family:inherit;font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-c-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-c-input__box:focus{box-shadow:0 0 .6rem hsl(var(--mg-inputs-color-shadow-focus-hsl)/50%)}.mg-c-input__box:disabled{opacity:.3}.mg-c-input.mg-c-input--label-on-top .mg-c-input__box{width:auto;max-width:100%}.mg-c-input.mg-c-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box{margin-right:-0.1rem;border-bottom-right-radius:0;border-top-right-radius:0}.mg-c-input.mg-c-input--is-input-group-append .mg-c-input__box:focus-visible{outline-offset:-0.2rem;outline-style:solid;outline-width:.2rem}.mg-c-input.mg-c-input--is-input-group-append.mg-c-input--readonly slot[name=append-input]{display:none}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-c-input.mg-c-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-c-input.mg-c-input--is-append-input-slot-content:not(.mg-c-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input:not(.mg-c-input--label-on-top) .mg-c-input__box{width:100%;min-width:5rem;max-width:calc(17.7rem + var(--mg-inputs-spacer)*2)}.mg-c-input.mg-c-input--width-full:not(.mg-c-input--label-on-top){justify-content:space-between}.mg-c-input.mg-c-input--width-full.mg-c-input--label-on-top .mg-c-input__box{width:100%}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container{width:100%;flex:auto}.mg-c-input.mg-c-input--width-full .mg-c-input__input-container .mg-c-input__box{max-width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__input{width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__with-character-left{width:100%}.mg-c-input.mg-c-input--width-16 .mg-c-input__input-container .mg-c-input__box{min-width:100%;max-width:21rem}.mg-c-input.mg-c-input--width-4 .mg-c-input__input-container .mg-c-input__box{max-width:7rem}.mg-c-input.mg-c-input--width-2 .mg-c-input__input-container .mg-c-input__box{max-width:5rem}.mg-c-input mg-character-left{font-size:1.1rem;opacity:.6}.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__help-text,.mg-c-input.mg-c-input--has-display-character-left .mg-c-input__input+.mg-c-input__error{margin-top:0}.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}}.mg-c-input__box{display:block;height:auto;resize:none}.mg-c-input__box.mg-c-input__box--resizable{resize:both}.mg-c-input__box.mg-c-input__box--resizable-horizontal{resize:horizontal}.mg-c-input__box.mg-c-input__box--resizable-vertical{resize:vertical}.mg-c-input__with-character-left{width:100%}.mg-c-input__with-character-left mg-character-left{display:block;margin-top:.2rem;text-align:end;visibility:hidden}.mg-c-input.mg-u-is-focused .mg-c-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-c-input__box{overflow-x:hidden}}";
|
|
3547
3636
|
const MgInputTextareaStyle0 = mgInputTextareaCss;
|
|
3548
3637
|
|
|
3549
3638
|
const MgInputTextarea = class {
|
|
@@ -3574,7 +3663,7 @@ const MgInputTextarea = class {
|
|
|
3574
3663
|
*/
|
|
3575
3664
|
this.handleFocus = () => {
|
|
3576
3665
|
this.classCollection.add(this.classFocus);
|
|
3577
|
-
this.classCollection = new
|
|
3666
|
+
this.classCollection = new index$1.Fe(this.classCollection.classes);
|
|
3578
3667
|
};
|
|
3579
3668
|
/**
|
|
3580
3669
|
* Handle blur event
|
|
@@ -3582,7 +3671,7 @@ const MgInputTextarea = class {
|
|
|
3582
3671
|
this.handleBlur = () => {
|
|
3583
3672
|
// Manage focus
|
|
3584
3673
|
this.classCollection.delete(this.classFocus);
|
|
3585
|
-
this.classCollection = new
|
|
3674
|
+
this.classCollection = new index$1.Fe(this.classCollection.classes);
|
|
3586
3675
|
// Display Error
|
|
3587
3676
|
this.handlerInProgress = Handler.BLUR;
|
|
3588
3677
|
this.displayError().finally(() => {
|
|
@@ -3640,12 +3729,13 @@ const MgInputTextarea = class {
|
|
|
3640
3729
|
this.patternErrorMessage = undefined;
|
|
3641
3730
|
this.rows = 3;
|
|
3642
3731
|
this.tooltip = undefined;
|
|
3732
|
+
this.tooltipPosition = 'input';
|
|
3643
3733
|
this.displayCharacterLeft = true;
|
|
3644
3734
|
this.helpText = undefined;
|
|
3645
3735
|
this.valid = undefined;
|
|
3646
3736
|
this.invalid = undefined;
|
|
3647
3737
|
this.resizable = 'none';
|
|
3648
|
-
this.classCollection = new
|
|
3738
|
+
this.classCollection = new index$1.Fe(['mg-c-input--textarea']);
|
|
3649
3739
|
this.errorMessage = undefined;
|
|
3650
3740
|
}
|
|
3651
3741
|
handleValue(newValue) {
|
|
@@ -3663,7 +3753,7 @@ const MgInputTextarea = class {
|
|
|
3663
3753
|
}
|
|
3664
3754
|
}
|
|
3665
3755
|
validatePattern(newValue) {
|
|
3666
|
-
if (newValue !== undefined && !(
|
|
3756
|
+
if (newValue !== undefined && !(index$1.He(this.pattern) && index$1.He(this.patternErrorMessage))) {
|
|
3667
3757
|
throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3668
3758
|
}
|
|
3669
3759
|
}
|
|
@@ -3695,7 +3785,7 @@ const MgInputTextarea = class {
|
|
|
3695
3785
|
if (typeof valid !== 'boolean') {
|
|
3696
3786
|
throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
|
|
3697
3787
|
}
|
|
3698
|
-
else if (!
|
|
3788
|
+
else if (!index$1.He(errorMessage)) {
|
|
3699
3789
|
throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
|
|
3700
3790
|
}
|
|
3701
3791
|
else {
|
|
@@ -3725,7 +3815,7 @@ const MgInputTextarea = class {
|
|
|
3725
3815
|
*/
|
|
3726
3816
|
componentWillLoad() {
|
|
3727
3817
|
// Get locales
|
|
3728
|
-
this.messages =
|
|
3818
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
3729
3819
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3730
3820
|
// Validate
|
|
3731
3821
|
this.validateDisplayCharacterLeft(this.displayCharacterLeft);
|
|
@@ -3743,7 +3833,7 @@ const MgInputTextarea = class {
|
|
|
3743
3833
|
* @returns HTML Element
|
|
3744
3834
|
*/
|
|
3745
3835
|
render() {
|
|
3746
|
-
return (index.h(MgInput, { key: '
|
|
3836
|
+
return (index.h(MgInput, { key: '787cd8f44ee98c6f337c3718450f87bf95ecfa90', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("div", { key: '4d9efd68e2f172b3e44198c82e66866d7975a1b0', class: "mg-c-input__with-character-left" }, index.h("textarea", { key: '1e4b6e771fe376eb3214fbedf0af09887e887e1f', class: {
|
|
3747
3837
|
'mg-c-input__box': true,
|
|
3748
3838
|
'mg-c-input__box--resizable': this.resizable === 'both',
|
|
3749
3839
|
'mg-c-input__box--resizable-horizontal': this.resizable === 'horizontal',
|
|
@@ -3766,7 +3856,7 @@ const MgInputTextarea = class {
|
|
|
3766
3856
|
};
|
|
3767
3857
|
MgInputTextarea.style = MgInputTextareaStyle0;
|
|
3768
3858
|
|
|
3769
|
-
const mgInputTitleCss = ".mg-u-is-asterisk.sc-mg-input-title{color:hsl(var(--color-danger))}legend.mg-c-input-title.sc-mg-input-title{padding-right:0;padding-left:0}.mg-c-input-title__required.sc-mg-input-title{display:var(--mg-input-title-display, unset)}";
|
|
3859
|
+
const mgInputTitleCss = ".mg-u-form-legacy.sc-mg-input-title{--mg-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk.sc-mg-input-title{color:hsl(var(--color-danger))}legend.mg-c-input-title.sc-mg-input-title{padding-right:0;padding-left:0}.mg-c-input-title__required.sc-mg-input-title{display:var(--mg-input-title-display, unset)}";
|
|
3770
3860
|
const MgInputTitleStyle0 = mgInputTitleCss;
|
|
3771
3861
|
|
|
3772
3862
|
const MgInputTitle = class {
|
|
@@ -3779,7 +3869,7 @@ const MgInputTitle = class {
|
|
|
3779
3869
|
this.tagName = 'label';
|
|
3780
3870
|
}
|
|
3781
3871
|
validateIdentifier(newValue) {
|
|
3782
|
-
if (!
|
|
3872
|
+
if (!index$1.He(newValue)) {
|
|
3783
3873
|
throw new Error('<mg-input-title> prop "identifier" is required.');
|
|
3784
3874
|
}
|
|
3785
3875
|
}
|
|
@@ -3803,7 +3893,7 @@ const MgInputTitle = class {
|
|
|
3803
3893
|
render() {
|
|
3804
3894
|
const TagName = this.readonly ? 'span' : this.tagName;
|
|
3805
3895
|
// \u00A0 represent a
|
|
3806
|
-
return (index.h(TagName, { key: '
|
|
3896
|
+
return (index.h(TagName, { key: '0fbbce483f0d178036c4bf8ada139ddba9c16694', class: "mg-c-input-title", htmlFor: this.isLegend ? undefined : this.identifier }, index.h("slot", { key: '1db71caf002de0874f566d55b4bd0031ddf10650' }), this.required && (index.h("span", { class: "mg-c-input-title__required" }, "\u00A0", index.h("span", { class: "mg-u-is-asterisk" }, "*")))));
|
|
3807
3897
|
}
|
|
3808
3898
|
static get watchers() { return {
|
|
3809
3899
|
"identifier": ["validateIdentifier"],
|
|
@@ -3812,7 +3902,7 @@ const MgInputTitle = class {
|
|
|
3812
3902
|
};
|
|
3813
3903
|
MgInputTitle.style = MgInputTitleStyle0;
|
|
3814
3904
|
|
|
3815
|
-
const mgInputToggleCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-
|
|
3905
|
+
const mgInputToggleCss = ":host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;max-width:100%;min-height:var(--default-size);align-items:flex-start;margin-bottom:var(--mg-inputs-margin-bottom, 0)}.mg-c-input__error{display:inline-block;padding:.3rem .8rem;border-radius:.3rem;margin-top:.2rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-c-input__input-container{min-height:var(--default-size)}.mg-c-input__input-container>ul{display:flex;flex-flow:column wrap;padding:0;margin:0;list-style:none;row-gap:.8rem}.mg-c-input__input-container>strong{display:inline-block}.mg-c-input__input-container>strong,.mg-c-input__input-container>ul{min-height:var(--font-size);margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-c-input__input-container .mg-c-input__help-text,.mg-c-input__input-container .mg-c-input__error{font-size:1.2rem;text-align:start}.mg-c-input__input{display:flex}.mg-c-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size))/2)}.mg-c-input__input.mg-c-input__input--has-error .mg-c-input__box{border-color:hsl(var(--color-danger))}.mg-c-input__input+.mg-c-input__help-text,.mg-c-input__input+.mg-c-input__error{margin-top:.5rem}.mg-c-input__input .mg-c-input__box:disabled,.mg-c-input__input-group--disabled label,.mg-c-input.mg-c-input--toggle-disabled .mg-c-input__input .mg-c-input__button-toggle,.mg-c-input.mg-c-input--checkbox-multi-disabled .mg-c-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-c-input__title{display:flex;width:var(--mg-inputs-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--default-size) - var(--font-size)*var(--line-height))/2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-c-input__title mg-input-title+mg-tooltip{margin-left:.4rem}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input.mg-c-input--label-on-top{flex-direction:column}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input.mg-c-input--label-on-top .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input.mg-c-input--label-on-top .mg-c-input__input-container{width:100%}@media screen and (max-width: 767px){.mg-c-input{flex-direction:column}.mg-c-input .mg-c-input__title{width:auto;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:.3rem;text-align:left}.mg-c-input .mg-c-input__title mg-input-title{width:100%;flex-shrink:1}.mg-c-input .mg-c-input__input-container{width:100%}}.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}}.mg-c-input__toggle-item-container{overflow:hidden;box-sizing:border-box;padding:.5rem .9rem;border:0;border-radius:calc((var(--font-size)*var(--line-height) + 1rem)/var(--mg-input-toggle-border-radius-ratio));background-color:unset;color:hsl(var(--color-dark));font-weight:unset;text-overflow:ellipsis;white-space:nowrap}.mg-c-input__toggle-item-container:first-of-type{background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%));color:hsl(var(--color-info));font-weight:600}.mg-c-input__button-toggle{display:flex;min-width:0;padding:.2rem;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:calc((var(--font-size)*var(--line-height) + 2*(.7rem + var(--mg-inputs-border-width)))/var(--mg-input-toggle-border-radius-ratio));background-color:hsl(var(--color-light));cursor:pointer;font-family:var(--font-family);font-size:inherit;line-height:inherit}.mg-c-input__button-toggle:disabled{cursor:default}.mg-c-input.mg-c-input--toggle .mg-c-input__input-container{min-width:0;flex:auto}.mg-c-input.mg-c-input--toggle-is-active .mg-c-input__toggle-item-container:first-of-type{background-color:unset;color:hsl(var(--color-dark));font-weight:unset}.mg-c-input.mg-c-input--toggle-is-active .mg-c-input__toggle-item-container:last-of-type{background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%));color:hsl(var(--color-info));font-weight:600}.mg-c-input.mg-c-input--toggle-icon .mg-c-input__toggle-item-container{display:flex;width:calc(var(--font-size)*var(--line-height) + 1rem);height:calc(var(--font-size)*var(--line-height) + 1rem);align-items:center;justify-content:center;padding:0;visibility:hidden}.mg-c-input.mg-c-input--toggle-icon .mg-c-input__toggle-item-container:first-of-type{visibility:visible}.mg-c-input.mg-c-input--toggle-icon .mg-c-input__toggle-item-container ::slotted(mg-icon){display:flex}.mg-c-input.mg-c-input--toggle-icon.mg-c-input--toggle-is-active .mg-c-input__toggle-item-container:first-of-type{visibility:hidden}.mg-c-input.mg-c-input--toggle-icon.mg-c-input--toggle-is-active .mg-c-input__toggle-item-container:last-of-type{visibility:visible}.mg-c-input.mg-c-input--toggle-on-off .mg-c-input__toggle-item-container:first-of-type{background-color:hsl(var(--color-dark-h), calc(var(--color-dark-s) - 30%), calc(var(--color-dark-l) + 75%));color:hsl(var(--color-dark));font-weight:600}.mg-c-input.mg-c-input--toggle-on-off.mg-c-input--toggle-is-active .mg-c-input__toggle-item-container:first-of-type{background-color:unset;color:hsl(var(--color-dark));font-weight:unset}";
|
|
3816
3906
|
const MgInputToggleStyle0 = mgInputToggleCss;
|
|
3817
3907
|
|
|
3818
3908
|
/**
|
|
@@ -3830,7 +3920,6 @@ const MgInputToggle = class {
|
|
|
3830
3920
|
* Internal *
|
|
3831
3921
|
************/
|
|
3832
3922
|
// Classes
|
|
3833
|
-
this.classReadonly = 'mg-c-input--toggle-readonly';
|
|
3834
3923
|
this.classDisabled = 'mg-c-input--toggle-disabled';
|
|
3835
3924
|
this.classIsActive = 'mg-c-input--toggle-is-active';
|
|
3836
3925
|
this.classOnOff = 'mg-c-input--toggle-on-off';
|
|
@@ -3867,6 +3956,20 @@ const MgInputToggle = class {
|
|
|
3867
3956
|
slots.forEach(slot => slot.setAttribute('title', slot.textContent));
|
|
3868
3957
|
}
|
|
3869
3958
|
};
|
|
3959
|
+
/**
|
|
3960
|
+
* Get checked item
|
|
3961
|
+
* @param checked
|
|
3962
|
+
* @returns toggle value
|
|
3963
|
+
*/
|
|
3964
|
+
this.getCheckedItem = (checked) => {
|
|
3965
|
+
var _a;
|
|
3966
|
+
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) === 2) {
|
|
3967
|
+
return this.options[checked ? 1 : 0];
|
|
3968
|
+
}
|
|
3969
|
+
else {
|
|
3970
|
+
return null;
|
|
3971
|
+
}
|
|
3972
|
+
};
|
|
3870
3973
|
this.value = undefined;
|
|
3871
3974
|
this.items = undefined;
|
|
3872
3975
|
this.identifier = undefined;
|
|
@@ -3879,8 +3982,9 @@ const MgInputToggle = class {
|
|
|
3879
3982
|
this.readonly = false;
|
|
3880
3983
|
this.disabled = false;
|
|
3881
3984
|
this.tooltip = undefined;
|
|
3985
|
+
this.tooltipPosition = 'input';
|
|
3882
3986
|
this.helpText = undefined;
|
|
3883
|
-
this.classCollection = new
|
|
3987
|
+
this.classCollection = new index$1.Fe(['mg-c-input--toggle']);
|
|
3884
3988
|
this.options = undefined;
|
|
3885
3989
|
this.errorMessage = undefined;
|
|
3886
3990
|
this.valid = undefined;
|
|
@@ -3897,11 +4001,11 @@ const MgInputToggle = class {
|
|
|
3897
4001
|
throw new Error('<mg-input-toggle> prop "items" require 2 items.');
|
|
3898
4002
|
}
|
|
3899
4003
|
// String array
|
|
3900
|
-
else if (
|
|
4004
|
+
else if (index$1.De(newValue)) {
|
|
3901
4005
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
3902
4006
|
}
|
|
3903
4007
|
// Object array
|
|
3904
|
-
else if (newValue && newValue.every(
|
|
4008
|
+
else if (Array.isArray(newValue) && newValue.every(isOption)) {
|
|
3905
4009
|
this.options = newValue;
|
|
3906
4010
|
}
|
|
3907
4011
|
else {
|
|
@@ -3920,12 +4024,6 @@ const MgInputToggle = class {
|
|
|
3920
4024
|
else
|
|
3921
4025
|
this.classCollection.delete(this.classIcon);
|
|
3922
4026
|
}
|
|
3923
|
-
handleReadonly(newValue) {
|
|
3924
|
-
if (newValue)
|
|
3925
|
-
this.classCollection.add(this.classReadonly);
|
|
3926
|
-
else
|
|
3927
|
-
this.classCollection.delete(this.classReadonly);
|
|
3928
|
-
}
|
|
3929
4027
|
handleDisabled(newValue) {
|
|
3930
4028
|
if (newValue)
|
|
3931
4029
|
this.classCollection.add(this.classDisabled);
|
|
@@ -3939,7 +4037,7 @@ const MgInputToggle = class {
|
|
|
3939
4037
|
else
|
|
3940
4038
|
this.classCollection.delete(this.classIsActive);
|
|
3941
4039
|
// update value
|
|
3942
|
-
this.value = this.
|
|
4040
|
+
this.value = this.getCheckedItem(newValue).value;
|
|
3943
4041
|
}
|
|
3944
4042
|
/**
|
|
3945
4043
|
* Set an error and display a custom error message.
|
|
@@ -3953,7 +4051,7 @@ const MgInputToggle = class {
|
|
|
3953
4051
|
if (typeof valid !== 'boolean') {
|
|
3954
4052
|
throw new Error('<mg-input-toggle> method "setError()" param "valid" must be a boolean');
|
|
3955
4053
|
}
|
|
3956
|
-
else if (!
|
|
4054
|
+
else if (!index$1.He(errorMessage)) {
|
|
3957
4055
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string');
|
|
3958
4056
|
}
|
|
3959
4057
|
else {
|
|
@@ -4000,7 +4098,6 @@ const MgInputToggle = class {
|
|
|
4000
4098
|
// apply handler
|
|
4001
4099
|
this.handleIsOnOff(this.isOnOff);
|
|
4002
4100
|
this.handleIsIcon(this.isIcon);
|
|
4003
|
-
this.handleReadonly(this.readonly);
|
|
4004
4101
|
this.handleDisabled(this.disabled);
|
|
4005
4102
|
}
|
|
4006
4103
|
/**
|
|
@@ -4008,7 +4105,8 @@ const MgInputToggle = class {
|
|
|
4008
4105
|
* @returns HTML Element
|
|
4009
4106
|
*/
|
|
4010
4107
|
render() {
|
|
4011
|
-
|
|
4108
|
+
var _a, _b;
|
|
4109
|
+
return (index.h(MgInput, { key: '4b4de955511ce4cd03903cee22eaa0f53e20b1e9', identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString(), readonlyValue: (_b = this.getCheckedItem(this.checked)) === null || _b === void 0 ? void 0 : _b.title, tooltip: !this.readonly && this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, index.h("button", { key: '22820821bace18ec43016ce2eed7ecec1bf62ed7', type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, index.h("span", { key: '131797d194c1e8c2c3397a1ba4aa90da16d77b3a', "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { key: 'a5c20ae8b49aadd1cc59737c94983bfa4c19166f', name: "item-1" })), index.h("span", { key: '9286d8a410eb920d6c535ec548388b823a49048d', "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { key: '1b9b0bdde12e6812bf7c5b04a2f02fa052ce7ac9', name: "item-2" })))));
|
|
4012
4110
|
}
|
|
4013
4111
|
get element() { return index.getElement(this); }
|
|
4014
4112
|
static get watchers() { return {
|
|
@@ -4016,7 +4114,6 @@ const MgInputToggle = class {
|
|
|
4016
4114
|
"items": ["validateItems"],
|
|
4017
4115
|
"isOnOff": ["handleIsOnOff"],
|
|
4018
4116
|
"isIcon": ["handleIsIcon"],
|
|
4019
|
-
"readonly": ["handleReadonly"],
|
|
4020
4117
|
"disabled": ["handleDisabled"],
|
|
4021
4118
|
"checked": ["handleChecked"]
|
|
4022
4119
|
}; }
|
|
@@ -4257,7 +4354,7 @@ const MgMenuItem = class {
|
|
|
4257
4354
|
throw new Error(`<${this.name}> slot "label" is required.`);
|
|
4258
4355
|
['label', 'metadata'].forEach(slot => {
|
|
4259
4356
|
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
4260
|
-
if (!
|
|
4357
|
+
if (!index$1.He(element.textContent))
|
|
4261
4358
|
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
4262
4359
|
if ((guard && element.getAttribute('title') === null) || !guard)
|
|
4263
4360
|
element.setAttribute('title', element.textContent);
|
|
@@ -4326,12 +4423,12 @@ const MgMenuItem = class {
|
|
|
4326
4423
|
* @returns HTML Element
|
|
4327
4424
|
*/
|
|
4328
4425
|
this.renderSlot = () => index.h("slot", null);
|
|
4329
|
-
this.identifier =
|
|
4426
|
+
this.identifier = index$1.je('mg-menu-item');
|
|
4330
4427
|
this.href = undefined;
|
|
4331
4428
|
this.status = Status$1.VISIBLE;
|
|
4332
4429
|
this.expanded = false;
|
|
4333
4430
|
this.size = 'regular';
|
|
4334
|
-
this.navigationButtonClassList = new
|
|
4431
|
+
this.navigationButtonClassList = new index$1.Fe([this.navigationButton]);
|
|
4335
4432
|
this.direction = undefined;
|
|
4336
4433
|
this.isInMainMenu = undefined;
|
|
4337
4434
|
this.isItemMore = undefined;
|
|
@@ -4406,7 +4503,7 @@ const MgMenuItem = class {
|
|
|
4406
4503
|
// has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element
|
|
4407
4504
|
// we store only matching elements
|
|
4408
4505
|
this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));
|
|
4409
|
-
this.badgeLabel =
|
|
4506
|
+
this.badgeLabel = index$1.initLocales(this.element).messages.plusMenu.badgeLabel;
|
|
4410
4507
|
this.isItemMore = this.element.dataset.overflowMore !== undefined;
|
|
4411
4508
|
// Validate props
|
|
4412
4509
|
this.validateStatus(this.status);
|
|
@@ -4565,13 +4662,13 @@ const MgMessage = class {
|
|
|
4565
4662
|
return 'exclamation-circle';
|
|
4566
4663
|
}
|
|
4567
4664
|
};
|
|
4568
|
-
this.identifier =
|
|
4665
|
+
this.identifier = index$1.je('mg-message');
|
|
4569
4666
|
this.delay = undefined;
|
|
4570
4667
|
this.variant = variants$1[0];
|
|
4571
4668
|
this.closeButton = false;
|
|
4572
4669
|
this.hide = false;
|
|
4573
4670
|
this.noAriaRole = undefined;
|
|
4574
|
-
this.classCollection = new
|
|
4671
|
+
this.classCollection = new index$1.Fe(['mg-c-message']);
|
|
4575
4672
|
this.hasActions = false;
|
|
4576
4673
|
}
|
|
4577
4674
|
validateDelay(newValue) {
|
|
@@ -4629,7 +4726,7 @@ const MgMessage = class {
|
|
|
4629
4726
|
*/
|
|
4630
4727
|
componentWillLoad() {
|
|
4631
4728
|
// Get locales
|
|
4632
|
-
this.messages =
|
|
4729
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
4633
4730
|
// Validate
|
|
4634
4731
|
this.validateVariant(this.variant);
|
|
4635
4732
|
// Check if close button is an can be activated
|
|
@@ -4650,7 +4747,7 @@ const MgMessage = class {
|
|
|
4650
4747
|
let role;
|
|
4651
4748
|
if (!this.noAriaRole)
|
|
4652
4749
|
role = this.variant === 'info' ? 'status' : 'alert';
|
|
4653
|
-
return (index.h("div", { key: '
|
|
4750
|
+
return (index.h("div", { key: 'fb10ca559b2039f9d7842e4b2ce88e25a1999c96', id: this.identifier, class: this.classCollection.join(), role: role }, index.h("mg-card", { key: 'c0afc8ad8c56f9e5fb5041aaa201de208f3fc6fd', variant: this.variant, "variant-style": "bar-left" }, index.h("span", { key: '949f48302c8feb721f1b9acb663bf21acfc166e1', class: "mg-c-message__icon" }, index.h("mg-icon", { key: 'a3daa1da6d312c6b6b921cc01edae9763a81225f', icon: this.getIcon() })), index.h("div", { key: 'c53239107f094fe341f6abb1441096767b648796', class: "mg-c-message__content" }, index.h("span", { key: 'fb4da55da5853179204771cf9f5d01a02ed8a9ce', class: "mg-c-message__content-slot" }, index.h("slot", { key: 'e7339501b750d02a3e433e40903d460588dd4b33' })), this.hasActions && index.h("span", { class: "mg-c-message__content-separator" }), this.hasActions && (index.h("span", { class: "mg-c-message__content-actions-slot" }, index.h("slot", { name: "actions" })))), this.closeButton && (index.h("span", { class: "mg-c-message__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, index.h("mg-icon", { icon: "cross" })))))));
|
|
4654
4751
|
}
|
|
4655
4752
|
get element() { return index.getElement(this); }
|
|
4656
4753
|
static get watchers() { return {
|
|
@@ -4714,12 +4811,12 @@ const MgModal = class {
|
|
|
4714
4811
|
*/
|
|
4715
4812
|
this.setFocus = () => {
|
|
4716
4813
|
// Get all focusable elements
|
|
4717
|
-
const slottedFocusableElements = Array.from(this.element.querySelectorAll(
|
|
4814
|
+
const slottedFocusableElements = Array.from(this.element.querySelectorAll(index$1.Be));
|
|
4718
4815
|
// If close button is enabled or at least one of the slotted element is focusable
|
|
4719
4816
|
if (this.closeButton || slottedFocusableElements.length > 0) {
|
|
4720
4817
|
// Check if slotted focusable elements have shadowDom with focusable elements
|
|
4721
4818
|
this.modalFocusableElements = slottedFocusableElements.reduce((acc, focusableElement) => {
|
|
4722
|
-
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(
|
|
4819
|
+
acc.push(focusableElement.shadowRoot !== null ? focusableElement.shadowRoot.querySelector(index$1.Be) || focusableElement : focusableElement);
|
|
4723
4820
|
return acc;
|
|
4724
4821
|
}, []);
|
|
4725
4822
|
// When close button is enabled it's the first focusable element.
|
|
@@ -4741,21 +4838,21 @@ const MgModal = class {
|
|
|
4741
4838
|
this.handleClose = () => {
|
|
4742
4839
|
this.hide = true;
|
|
4743
4840
|
};
|
|
4744
|
-
this.identifier =
|
|
4841
|
+
this.identifier = index$1.je('mg-modal');
|
|
4745
4842
|
this.dialogRole = dialogRoles[0];
|
|
4746
4843
|
this.modalTitle = undefined;
|
|
4747
4844
|
this.closeButton = false;
|
|
4748
4845
|
this.hide = undefined;
|
|
4749
4846
|
this.hasActions = false;
|
|
4750
4847
|
this.hasContent = false;
|
|
4751
|
-
this.classCollection = new
|
|
4848
|
+
this.classCollection = new index$1.Fe(['mg-c-modal']);
|
|
4752
4849
|
}
|
|
4753
4850
|
validateDialogRole(newValue) {
|
|
4754
4851
|
if (!dialogRoles.includes(newValue))
|
|
4755
4852
|
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}.`);
|
|
4756
4853
|
}
|
|
4757
4854
|
validateModalTitle(newValue) {
|
|
4758
|
-
if (!
|
|
4855
|
+
if (!index$1.He(newValue)) {
|
|
4759
4856
|
throw new Error('<mg-modal> prop "modalTitle" is required.');
|
|
4760
4857
|
}
|
|
4761
4858
|
}
|
|
@@ -4797,7 +4894,7 @@ const MgModal = class {
|
|
|
4797
4894
|
// Store body overflow
|
|
4798
4895
|
this.bodyOverflow = document.body.style.overflow;
|
|
4799
4896
|
// Get locales
|
|
4800
|
-
this.messages =
|
|
4897
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
4801
4898
|
// Validate
|
|
4802
4899
|
this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
|
|
4803
4900
|
this.hasContent = this.element.querySelector('[slot="content"]') !== null;
|
|
@@ -4823,14 +4920,14 @@ const MgModal = class {
|
|
|
4823
4920
|
* @returns HTML Element
|
|
4824
4921
|
*/
|
|
4825
4922
|
render() {
|
|
4826
|
-
return (index.h("div", { key: '
|
|
4923
|
+
return (index.h("div", { key: '5cf37ab3cd51af984852f3ef6dfeb9e9adf851aa', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, index.h("mg-card", { key: 'e9246015018d985cb28396f1f3ab01466e763f0c' }, index.h("div", { key: '3b94fd3d16a8f54e63fd75ef7fb13c7c17ff16b6', class: "mg-c-modal__dialog" }, index.h("header", { key: '5f6cd3f002c135c62e0b4851f483a5581bcf50d2', class: "mg-c-modal__header" }, this.closeButton && (index.h("span", { class: "mg-c-modal__close-button" }, index.h("mg-button", { identifier: `${this.identifier}-close-button`, "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose, ref: (el) => {
|
|
4827
4924
|
if (el !== null) {
|
|
4828
4925
|
// store closeButton Element
|
|
4829
4926
|
this.closeButtonElement = el;
|
|
4830
4927
|
// add close button element to modalFocusableElements when it is render
|
|
4831
4928
|
this.modalFocusableElements.unshift(this.closeButtonElement);
|
|
4832
4929
|
}
|
|
4833
|
-
} }, index.h("mg-icon", { icon: "cross" })))), index.h("h1", { key: '
|
|
4930
|
+
} }, index.h("mg-icon", { icon: "cross" })))), index.h("h1", { key: '2bbb2a19e3936bc5487bfdb90d8d952ba49844be', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (index.h("article", { class: "mg-c-modal__content" }, index.h("slot", { name: "content" }))), this.hasActions && (index.h("footer", { class: "mg-c-modal__footer" }, index.h("slot", { name: "actions" })))))));
|
|
4834
4931
|
}
|
|
4835
4932
|
get element() { return index.getElement(this); }
|
|
4836
4933
|
static get watchers() { return {
|
|
@@ -4902,7 +4999,7 @@ const MgPagination = class {
|
|
|
4902
4999
|
this.handleGoToPage = (action, disabled) => {
|
|
4903
5000
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
4904
5001
|
};
|
|
4905
|
-
this.identifier =
|
|
5002
|
+
this.identifier = index$1.je('mg-pagination');
|
|
4906
5003
|
this.label = undefined;
|
|
4907
5004
|
this.hideNavigationLabels = undefined;
|
|
4908
5005
|
this.hidePageCount = undefined;
|
|
@@ -4931,7 +5028,7 @@ const MgPagination = class {
|
|
|
4931
5028
|
*/
|
|
4932
5029
|
componentWillLoad() {
|
|
4933
5030
|
// Get locales
|
|
4934
|
-
this.messages =
|
|
5031
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
4935
5032
|
// Validate
|
|
4936
5033
|
this.validateTotalPages(this.totalPages);
|
|
4937
5034
|
this.validateCurrentPage(this.currentPage);
|
|
@@ -4945,10 +5042,10 @@ const MgPagination = class {
|
|
|
4945
5042
|
* @returns HTML Element
|
|
4946
5043
|
*/
|
|
4947
5044
|
render() {
|
|
4948
|
-
const navigationActionButton = (disabled, action) => (index.h("mg-button", { key: '
|
|
5045
|
+
const navigationActionButton = (disabled, action) => (index.h("mg-button", { key: '117897c3594d7b6322e85c659020083a78710979', identifier: `${this.identifier}-button-${action}`, label: this.messages.pagination[`${action}Page`],
|
|
4949
5046
|
// eslint-disable-next-line react/jsx-no-bind
|
|
4950
5047
|
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && index.h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && index.h("mg-icon", { icon: "chevron-right" })));
|
|
4951
|
-
return (index.h(index.Host, { key: '
|
|
5048
|
+
return (index.h(index.Host, { key: '83d52cfe35e330057417a26bdb7ae528255e3e5e', hidden: this.totalPages < 2 }, index.h("nav", { key: 'cdd2ab05092bfea927719b354c12629f90e44472', role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (index.h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true })), index.h("span", { key: '501099379d9ca210abed5bb10726c56383b15c6f', class: "mg-u-visually-hidden" }, this.messages.pagination.page, " ", this.currentPage), index.h("span", { key: 'e3ce99fb7aaf68322176c6135d70e90f910f6bdd', class: { 'mg-u-visually-hidden': this.hidePageCount } }, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
|
|
4952
5049
|
}
|
|
4953
5050
|
get element() { return index.getElement(this); }
|
|
4954
5051
|
static get watchers() { return {
|
|
@@ -5067,7 +5164,7 @@ const MgPanel = class {
|
|
|
5067
5164
|
];
|
|
5068
5165
|
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
5069
5166
|
};
|
|
5070
|
-
this.identifier =
|
|
5167
|
+
this.identifier = index$1.je('mg-panel');
|
|
5071
5168
|
this.panelTitle = undefined;
|
|
5072
5169
|
this.titlePattern = undefined;
|
|
5073
5170
|
this.titlePatternErrorMessage = undefined;
|
|
@@ -5076,12 +5173,12 @@ const MgPanel = class {
|
|
|
5076
5173
|
this.expanded = false;
|
|
5077
5174
|
this.expandToggleDisplay = expandToggleDisplays[0];
|
|
5078
5175
|
this.expandToggleDisabled = undefined;
|
|
5079
|
-
this.classCollection = new
|
|
5176
|
+
this.classCollection = new index$1.Fe(['mg-c-panel']);
|
|
5080
5177
|
this.isEditing = false;
|
|
5081
5178
|
this.updatedPanelTitle = undefined;
|
|
5082
5179
|
}
|
|
5083
5180
|
validatePanelTitle(newValue) {
|
|
5084
|
-
if (!
|
|
5181
|
+
if (!index$1.He(newValue))
|
|
5085
5182
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
5086
5183
|
this.titleChange.emit(newValue);
|
|
5087
5184
|
}
|
|
@@ -5110,7 +5207,7 @@ const MgPanel = class {
|
|
|
5110
5207
|
*/
|
|
5111
5208
|
componentWillLoad() {
|
|
5112
5209
|
// Get locales
|
|
5113
|
-
this.messages =
|
|
5210
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
5114
5211
|
// Validate
|
|
5115
5212
|
this.validateTitlePattern(this.titlePattern);
|
|
5116
5213
|
this.validateTitlePattern(this.titlePatternErrorMessage);
|
|
@@ -5132,7 +5229,7 @@ const MgPanel = class {
|
|
|
5132
5229
|
*/
|
|
5133
5230
|
render() {
|
|
5134
5231
|
const headerId = `${this.identifier}-header`;
|
|
5135
|
-
return (index.h("section", { key: '
|
|
5232
|
+
return (index.h("section", { key: '75410a66bcf5910175605ee2e4c7a56efb2d5d21', class: this.classCollection.join(), id: this.identifier }, index.h("mg-card", { key: '208cdc102ba7874b90f2eecd91026b5ed0c609af' }, index.h("header", { key: '2beb22b8e9e8e985db5a169207b13e10ed63fa8e', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), index.h("article", { key: '06cf2f69238065eb7388c9dc4c836eb033336a31', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, index.h("slot", { key: '0b64911842875cb212136ffde476136d925dde01' })))));
|
|
5136
5233
|
}
|
|
5137
5234
|
get element() { return index.getElement(this); }
|
|
5138
5235
|
static get watchers() { return {
|
|
@@ -7032,7 +7129,7 @@ const MgPopover = class {
|
|
|
7032
7129
|
mgPopoverContent.setAttribute('id', this.identifier);
|
|
7033
7130
|
}
|
|
7034
7131
|
};
|
|
7035
|
-
this.identifier =
|
|
7132
|
+
this.identifier = index$1.je('mg-popover');
|
|
7036
7133
|
this.placement = 'bottom';
|
|
7037
7134
|
this.arrowHide = false;
|
|
7038
7135
|
this.closeButton = false;
|
|
@@ -7075,7 +7172,7 @@ const MgPopover = class {
|
|
|
7075
7172
|
*/
|
|
7076
7173
|
componentWillLoad() {
|
|
7077
7174
|
// Get windows to attach events
|
|
7078
|
-
this.windows =
|
|
7175
|
+
this.windows = index$1.Ne(window);
|
|
7079
7176
|
// render mg-popover-content slot
|
|
7080
7177
|
this.renderPopoverContent();
|
|
7081
7178
|
this.validateCloseButton(this.closeButton);
|
|
@@ -7163,7 +7260,7 @@ const MgPopoverContent = class {
|
|
|
7163
7260
|
this.hideContent.emit();
|
|
7164
7261
|
};
|
|
7165
7262
|
this.closeButton = false;
|
|
7166
|
-
this.classCollection = new
|
|
7263
|
+
this.classCollection = new index$1.Fe(['mg-c-popover-content']);
|
|
7167
7264
|
}
|
|
7168
7265
|
/*************
|
|
7169
7266
|
* Lifecycle *
|
|
@@ -7173,7 +7270,7 @@ const MgPopoverContent = class {
|
|
|
7173
7270
|
*/
|
|
7174
7271
|
componentWillLoad() {
|
|
7175
7272
|
// Get locales
|
|
7176
|
-
this.messages =
|
|
7273
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
7177
7274
|
}
|
|
7178
7275
|
/**
|
|
7179
7276
|
* Check if component slots are valide
|
|
@@ -7181,7 +7278,7 @@ const MgPopoverContent = class {
|
|
|
7181
7278
|
componentDidLoad() {
|
|
7182
7279
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
7183
7280
|
const slottedTitleElement = this.element.querySelector('[slot="title"]');
|
|
7184
|
-
if (slottedTitleElement && !
|
|
7281
|
+
if (slottedTitleElement && !index$1._e(slottedTitleElement, headingTags)) {
|
|
7185
7282
|
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
7186
7283
|
}
|
|
7187
7284
|
}
|
|
@@ -7190,7 +7287,7 @@ const MgPopoverContent = class {
|
|
|
7190
7287
|
* @returns HTML Element
|
|
7191
7288
|
*/
|
|
7192
7289
|
render() {
|
|
7193
|
-
return (index.h(index.Host, { key: '
|
|
7290
|
+
return (index.h(index.Host, { key: '571f8154dbfa075c6fedcff3e2b8f5e9daf374fe' }, index.h("mg-card", { key: '4c173845a5baa5afd18464789c281e6d2663a754', class: this.classCollection.join() }, this.closeButton && (index.h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, index.h("mg-icon", { icon: "cross" }))), index.h("div", { key: '89d60fc8aecfe7b743331354f13b4c0222046f84', class: "mg-c-popover-content__title" }, index.h("slot", { key: '0547a80a3b8dfd76eaafbc252b2473de1c997c02', name: "title" })), index.h("slot", { key: '3c0a7a30ea07b17d33dc54f91b9eb53079f8f720', name: "content" })), index.h("slot", { key: 'b75f725bcc46602e0159f1bc2c699f253ad36be9', name: "arrow" })));
|
|
7194
7291
|
}
|
|
7195
7292
|
get element() { return index.getElement(this); }
|
|
7196
7293
|
};
|
|
@@ -7217,7 +7314,7 @@ const MgSkipLinks = class {
|
|
|
7217
7314
|
this.links = undefined;
|
|
7218
7315
|
}
|
|
7219
7316
|
validateLinks(links) {
|
|
7220
|
-
if (links === undefined || links.length === 0 || links.some(link => !
|
|
7317
|
+
if (links === undefined || links.length === 0 || links.some(link => !index$1.He(link.href) || !link.href.startsWith('#') || !index$1.He(link.label))) {
|
|
7221
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.`);
|
|
7222
7319
|
}
|
|
7223
7320
|
}
|
|
@@ -7229,14 +7326,14 @@ const MgSkipLinks = class {
|
|
|
7229
7326
|
*/
|
|
7230
7327
|
componentWillLoad() {
|
|
7231
7328
|
this.validateLinks(this.links);
|
|
7232
|
-
this.messages =
|
|
7329
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
7233
7330
|
}
|
|
7234
7331
|
/**
|
|
7235
7332
|
* Render
|
|
7236
7333
|
* @returns HTML Element
|
|
7237
7334
|
*/
|
|
7238
7335
|
render() {
|
|
7239
|
-
return (index.h("nav", { key: '
|
|
7336
|
+
return (index.h("nav", { key: '8fcbba136f23c73d6bc500eae107ac7d72caf9e3', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, index.h("ul", { key: '003daec99013a9274ed48f11d0afbeb6cd3a5dc0', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (index.h("li", { key: link.href }, index.h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
7240
7337
|
}
|
|
7241
7338
|
get element() { return index.getElement(this); }
|
|
7242
7339
|
static get watchers() { return {
|
|
@@ -7369,7 +7466,7 @@ const MgTabs = class {
|
|
|
7369
7466
|
*/
|
|
7370
7467
|
this.resetFocus = () => {
|
|
7371
7468
|
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
7372
|
-
|
|
7469
|
+
index$1.Pe(() => {
|
|
7373
7470
|
this.tabFocus = undefined;
|
|
7374
7471
|
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
7375
7472
|
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
@@ -7384,16 +7481,16 @@ const MgTabs = class {
|
|
|
7384
7481
|
if (slots.length !== this.tabs.length)
|
|
7385
7482
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
7386
7483
|
};
|
|
7387
|
-
this.identifier =
|
|
7484
|
+
this.identifier = index$1.je('mg-tabs');
|
|
7388
7485
|
this.label = undefined;
|
|
7389
7486
|
this.size = 'regular';
|
|
7390
7487
|
this.items = undefined;
|
|
7391
7488
|
this.activeTab = undefined;
|
|
7392
7489
|
this.tabs = [];
|
|
7393
|
-
this.classCollection = new
|
|
7490
|
+
this.classCollection = new index$1.Fe(['mg-c-tabs']);
|
|
7394
7491
|
}
|
|
7395
7492
|
validateLabel(newValue) {
|
|
7396
|
-
if (!
|
|
7493
|
+
if (!index$1.He(newValue)) {
|
|
7397
7494
|
throw new Error('<mg-tabs> prop "label" is required.');
|
|
7398
7495
|
}
|
|
7399
7496
|
}
|
|
@@ -7405,7 +7502,7 @@ const MgTabs = class {
|
|
|
7405
7502
|
}
|
|
7406
7503
|
validateItems(newValue) {
|
|
7407
7504
|
// String array
|
|
7408
|
-
if (
|
|
7505
|
+
if (index$1.De(newValue))
|
|
7409
7506
|
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
7410
7507
|
// Object array
|
|
7411
7508
|
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
@@ -7467,7 +7564,7 @@ const MgTabs = class {
|
|
|
7467
7564
|
* @returns HTML Element
|
|
7468
7565
|
*/
|
|
7469
7566
|
render() {
|
|
7470
|
-
return (index.h("div", { key: '
|
|
7567
|
+
return (index.h("div", { key: '20e5f42bd37175f245a7169f58f1eabc37c13e01', class: this.classCollection.join() }, index.h("header", { key: 'f4bbc2c7818e1eb3f5e1878f392e7ad683a7e2f1', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index$1) => (index.h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index$1), class: {
|
|
7471
7568
|
[`${this.buttonTabBaseClass}`]: true,
|
|
7472
7569
|
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
7473
7570
|
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|
|
@@ -7505,7 +7602,7 @@ const MgTag = class {
|
|
|
7505
7602
|
this.variant = variants[0];
|
|
7506
7603
|
this.outline = undefined;
|
|
7507
7604
|
this.soft = undefined;
|
|
7508
|
-
this.classCollection = new
|
|
7605
|
+
this.classCollection = new index$1.Fe(['mg-c-tag']);
|
|
7509
7606
|
}
|
|
7510
7607
|
validateVariant(newValue, oldValue) {
|
|
7511
7608
|
if (!variants.includes(newValue)) {
|
|
@@ -7542,7 +7639,7 @@ const MgTag = class {
|
|
|
7542
7639
|
* @param textContent - html element textContent property
|
|
7543
7640
|
*/
|
|
7544
7641
|
validateTextContent(textContent) {
|
|
7545
|
-
if (!
|
|
7642
|
+
if (!index$1.He(textContent))
|
|
7546
7643
|
throw new Error('<mg-tag> slot must contain a text content.');
|
|
7547
7644
|
}
|
|
7548
7645
|
/*************
|
|
@@ -7580,7 +7677,7 @@ var Guard;
|
|
|
7580
7677
|
Guard["HOVER_TOOLTIPED_ELEMENT"] = "hoverTooltipedGuard";
|
|
7581
7678
|
})(Guard || (Guard = {}));
|
|
7582
7679
|
|
|
7583
|
-
const mgTooltipCss = ":host{display:inline-block}";
|
|
7680
|
+
const mgTooltipCss = ":host{display:inline-block}mg-tooltip-content{font-family:var(--font-family);font-size:var(--font-size);font-weight:200}";
|
|
7584
7681
|
const MgTooltipStyle0 = mgTooltipCss;
|
|
7585
7682
|
|
|
7586
7683
|
/**
|
|
@@ -7601,7 +7698,7 @@ const MgTooltip = class {
|
|
|
7601
7698
|
// Enable the event listeners
|
|
7602
7699
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
7603
7700
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
7604
|
-
|
|
7701
|
+
index$1.Pe(() => {
|
|
7605
7702
|
this.windows.forEach((localWindow) => {
|
|
7606
7703
|
localWindow.addEventListener('click', this.clickOutside, false);
|
|
7607
7704
|
localWindow.addEventListener('keydown', this.pressEscape, false);
|
|
@@ -7766,7 +7863,7 @@ const MgTooltip = class {
|
|
|
7766
7863
|
});
|
|
7767
7864
|
});
|
|
7768
7865
|
};
|
|
7769
|
-
this.identifier =
|
|
7866
|
+
this.identifier = index$1.je('mg-tooltip');
|
|
7770
7867
|
this.message = undefined;
|
|
7771
7868
|
this.placement = 'bottom';
|
|
7772
7869
|
this.display = false;
|
|
@@ -7777,7 +7874,7 @@ const MgTooltip = class {
|
|
|
7777
7874
|
this.renderTooltipContent();
|
|
7778
7875
|
}
|
|
7779
7876
|
validateMessage(newValue) {
|
|
7780
|
-
if (!
|
|
7877
|
+
if (!index$1.He(newValue)) {
|
|
7781
7878
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
7782
7879
|
}
|
|
7783
7880
|
this.mgTooltipContent.message = newValue;
|
|
@@ -7826,7 +7923,7 @@ const MgTooltip = class {
|
|
|
7826
7923
|
*/
|
|
7827
7924
|
componentWillLoad() {
|
|
7828
7925
|
// Get windows to attach events
|
|
7829
|
-
this.windows =
|
|
7926
|
+
this.windows = index$1.Ne(window);
|
|
7830
7927
|
// Get tooltip element
|
|
7831
7928
|
this.renderTooltipContent();
|
|
7832
7929
|
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
@@ -7845,7 +7942,7 @@ const MgTooltip = class {
|
|
|
7845
7942
|
// get slotted element wich is not the tooltip
|
|
7846
7943
|
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
7847
7944
|
// Get interactive element
|
|
7848
|
-
const interactiveElement = slotElement.matches(
|
|
7945
|
+
const interactiveElement = slotElement.matches(index$1.Be) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(index$1.Be);
|
|
7849
7946
|
// define selected element to become tooltip selector
|
|
7850
7947
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
7851
7948
|
// Check if slotted element is a disabled mg-button
|