@mgdis/mg-components 6.15.0 → 6.17.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/events.utils-D5SAtkpQ.js +25 -0
- package/dist/cjs/{index-BGxkpQwi.js → index-DCZEYvlH.js} +48 -29
- package/dist/cjs/{index-iUZvsp-F.js → index-TUElr4Wv.js} +18 -30
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +100 -365
- package/dist/cjs/mg-alert.cjs.entry.js +2 -2
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +78 -140
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +4 -4
- package/dist/cjs/{mg-input.conf-CwjEAih3.js → mg-input.conf-WTsvDfpC.js} +0 -7
- package/dist/cjs/mg-loader.cjs.entry.js +2 -2
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +5 -5
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +7 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -6
- package/dist/collection/components/atoms/mg-button/mg-button.js +13 -13
- package/dist/collection/components/atoms/mg-card/mg-card.js +2 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +32 -26
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +2 -2
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +37 -108
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +6 -8
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -99
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +82 -167
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +27 -44
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +40 -55
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +26 -26
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +32 -86
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +26 -27
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +33 -82
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +33 -34
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +32 -32
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +27 -161
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +2 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +4 -5
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +7 -7
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -4
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +4 -4
- package/dist/collection/components/molecules/mg-details/mg-details.js +6 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +13 -13
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +2 -2
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +3 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +6 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -13
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +6 -6
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +6 -6
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +0 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +2 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +6 -7
- package/dist/collection/locales/en/messages.json +8 -13
- package/dist/collection/locales/fr/messages.json +8 -13
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +18 -30
- package/dist/components/mg-action-more.js +4 -2
- package/dist/components/mg-alert.js +4 -2
- package/dist/components/mg-badge2.js +4 -2
- package/dist/components/mg-button2.js +4 -2
- package/dist/components/mg-card2.js +4 -2
- package/dist/components/mg-character-left2.js +4 -2
- package/dist/components/mg-details.js +99 -1
- package/dist/components/mg-divider2.js +4 -2
- package/dist/components/mg-form.js +4 -2
- package/dist/components/mg-icon2.js +29 -21
- package/dist/components/mg-illustrated-message.js +4 -2
- package/dist/components/mg-input-checkbox-paginated2.js +6 -7
- package/dist/components/mg-input-checkbox.js +23 -65
- package/dist/components/mg-input-combobox.js +64 -132
- package/dist/components/mg-input-date.js +8 -29
- package/dist/components/mg-input-numeric.js +8 -27
- package/dist/components/mg-input-password.js +6 -10
- package/dist/components/mg-input-radio.js +16 -55
- package/dist/components/mg-input-rich-text-editor.js +6 -10
- package/dist/components/mg-input-select2.js +12 -46
- package/dist/components/mg-input-text2.js +6 -10
- package/dist/components/mg-input-textarea.js +6 -10
- package/dist/components/mg-input-title2.js +4 -2
- package/dist/components/mg-input-toggle.js +15 -98
- package/dist/components/mg-input2.js +26 -101
- package/dist/components/mg-item-more2.js +8 -4
- package/dist/components/mg-loader2.js +4 -2
- package/dist/components/mg-menu-item2.js +4 -2
- package/dist/components/mg-message2.js +4 -2
- package/dist/components/mg-modal.js +4 -2
- package/dist/components/mg-pagination.js +6 -10
- package/dist/components/mg-panel.js +11 -15
- package/dist/components/mg-popover-content2.js +4 -2
- package/dist/components/mg-popover2.js +4 -2
- package/dist/components/mg-progress.js +4 -2
- package/dist/components/mg-skip-links.js +4 -2
- package/dist/components/mg-table.js +4 -2
- package/dist/components/mg-tabs2.js +4 -2
- package/dist/components/mg-tag.js +4 -2
- package/dist/components/mg-tooltip-content2.js +4 -2
- package/dist/components/mg-tooltip2.js +4 -2
- package/dist/esm/events.utils-yMGqY8YG.js +23 -0
- package/dist/esm/{index-CKB-AnCZ.js → index-CNX6lq0x.js} +18 -30
- package/dist/esm/{index-DhAOnZJn.js → index-T6kOJXP1.js} +48 -29
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +96 -361
- package/dist/esm/mg-alert.entry.js +2 -2
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-input-combobox.entry.js +59 -121
- package/dist/esm/mg-input-rich-text-editor.entry.js +4 -4
- package/dist/esm/{mg-input.conf-BAUTlb6r.js → mg-input.conf-CNgv8hc5.js} +1 -7
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/locales/en/messages.json +8 -13
- package/dist/mg-components/locales/fr/messages.json +8 -13
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-47e19783.entry.js → p-0e6b40d6.entry.js} +1 -1
- package/dist/mg-components/{p-67af6274.entry.js → p-397bf67b.entry.js} +1 -1
- package/dist/mg-components/{p-a0fa44cf.entry.js → p-5dc3a1fb.entry.js} +1 -1
- package/dist/mg-components/p-8a69175b.entry.js +1 -0
- package/dist/mg-components/p-CNX6lq0x.js +1 -0
- package/dist/mg-components/p-CNgv8hc5.js +1 -0
- package/dist/mg-components/p-T6kOJXP1.js +2 -0
- package/dist/mg-components/{p-420daa1e.entry.js → p-c5da335e.entry.js} +1 -1
- package/dist/mg-components/p-d84d87ea.entry.js +1 -0
- package/dist/mg-components/p-yMGqY8YG.js +1 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +0 -13
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +4 -15
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +3 -21
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +2 -16
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +4 -40
- package/dist/types/components.d.ts +7 -63
- package/dist/types/stencil-public-runtime.d.ts +39 -2
- package/dist/types/types/index.d.ts +1 -1
- package/ide/intellij/web-types.json +23 -304
- package/ide/vscode/html-custom-data.json +18 -113
- package/package.json +22 -22
- package/dist/cjs/mg-input.utils-D-ASK4ua.js +0 -49
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +0 -21
- package/dist/components/mg-details2.js +0 -99
- package/dist/components/mg-input.utils.js +0 -24
- package/dist/esm/mg-input.utils-BYI03zSi.js +0 -46
- package/dist/mg-components/p-31856cff.entry.js +0 -1
- package/dist/mg-components/p-698dfc6c.entry.js +0 -1
- package/dist/mg-components/p-BAUTlb6r.js +0 -1
- package/dist/mg-components/p-CKB-AnCZ.js +0 -1
- package/dist/mg-components/p-DhAOnZJn.js +0 -2
- package/dist/mg-components/p-PuX-pdL4.js +0 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +0 -8
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { C as ClassList, t as toString, d as allItemsAreString, i as isValidString } from './index2.js';
|
|
3
3
|
import { d as defineCustomElement$5, c as classReadonly, a as classDisabled } from './mg-input2.js';
|
|
4
|
-
import { i as initLocales } from './index3.js';
|
|
5
|
-
import { d as defineErrorMessage } from './mg-input.utils.js';
|
|
6
|
-
import { d as defineCustomElement$7 } from './mg-details2.js';
|
|
7
4
|
import { d as defineCustomElement$6 } from './mg-icon2.js';
|
|
8
5
|
import { d as defineCustomElement$4 } from './mg-input-title2.js';
|
|
9
6
|
import { d as defineCustomElement$3 } from './mg-tooltip2.js';
|
|
10
7
|
import { d as defineCustomElement$2 } from './mg-tooltip-content2.js';
|
|
11
8
|
|
|
12
|
-
const mgInputToggleCss = ".mg-c-
|
|
9
|
+
const mgInputToggleCss = ".mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.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}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input__toggle-item-container{overflow:hidden;box-sizing:border-box;padding:var(--mg-b-size-4) var(--mg-b-size-8);border:0;border-radius:calc((var(--mg-b-font-size)*var(--mg-b-line-height) + 2*var(--mg-b-size-4))/var(--mg-c-input-toggle-border-radius-ratio));background-color:unset;color:var(--mg-b-color-dark);font-weight:unset;text-overflow:ellipsis;white-space:nowrap}.mg-c-input__toggle-item-container:first-of-type{background-color:color-mix(in srgb, var(--mg-b-color-app), white 80%);color:var(--mg-b-color-app);font-weight:600}.mg-c-input__button-toggle{display:flex;min-width:0;padding:var(--mg-b-size-4);border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:calc((var(--mg-b-font-size)*var(--mg-b-line-height) + 2*(var(--mg-b-size-4) + var(--mg-b-size-4) + var(--mg-c-input-border-width)))/var(--mg-c-input-toggle-border-radius-ratio));background-color:var(--mg-b-color-light);cursor:pointer;font-family:var(--mg-b-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:var(--mg-b-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:color-mix(in srgb, var(--mg-b-color-app), white 80%);color:var(--mg-b-color-info);font-weight:600}.mg-c-input.mg-c-input--toggle-icon .mg-c-input__toggle-item-container{display:flex;width:calc(var(--mg-b-font-size)*var(--mg-b-line-height) + 2*var(--mg-b-size-4));height:calc(var(--mg-b-font-size)*var(--mg-b-line-height) + 2*var(--mg-b-size-4));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:var(--mg-b-color-neutral-30);color:var(--mg-b-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:var(--mg-b-color-dark);font-weight:unset}";
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* type Option validation function
|
|
@@ -18,9 +15,11 @@ const mgInputToggleCss = ".mg-c-input__error-details{margin:0}.mg-c-input__reado
|
|
|
18
15
|
*/
|
|
19
16
|
const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
|
|
20
17
|
const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle extends HTMLElement {
|
|
21
|
-
constructor() {
|
|
18
|
+
constructor(registerHost) {
|
|
22
19
|
super();
|
|
23
|
-
|
|
20
|
+
if (registerHost !== false) {
|
|
21
|
+
this.__registerHost();
|
|
22
|
+
}
|
|
24
23
|
this.__attachShadow();
|
|
25
24
|
this.valueChange = createEvent(this, "value-change", 7);
|
|
26
25
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
@@ -69,29 +68,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
69
68
|
* Checked internal value
|
|
70
69
|
*/
|
|
71
70
|
this.checked = false;
|
|
72
|
-
/**
|
|
73
|
-
* Check if input is valid
|
|
74
|
-
*/
|
|
75
|
-
this.checkValidity = () => {
|
|
76
|
-
this.setValidity(this.readonly || this.disabled || this.hasInputItems());
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Reset error message
|
|
80
|
-
*/
|
|
81
|
-
this.resetErrorMessage = () => {
|
|
82
|
-
this.checkValidity();
|
|
83
|
-
this.errorMessage = undefined;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Test if component has items
|
|
87
|
-
* @returns truthy if component has items
|
|
88
|
-
*/
|
|
89
|
-
this.hasInputItems = () => { var _a; return ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0; };
|
|
90
|
-
/**
|
|
91
|
-
* Test if component has no value error message displayed
|
|
92
|
-
* @returns truthy if compent display no value error message
|
|
93
|
-
*/
|
|
94
|
-
this.hasNoValueErrorMessageDisplay = () => this.errorMessage === this.messages.errors.noValue;
|
|
95
71
|
/**
|
|
96
72
|
* Set input error message
|
|
97
73
|
* @param errorMessage - errorMessage override
|
|
@@ -100,13 +76,8 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
100
76
|
// Set error message
|
|
101
77
|
this.errorMessage = undefined;
|
|
102
78
|
// Does have a custom error message
|
|
103
|
-
if (!this.valid) {
|
|
104
|
-
|
|
105
|
-
this.errorMessage = errorMessage;
|
|
106
|
-
}
|
|
107
|
-
else if (!this.hasInputItems()) {
|
|
108
|
-
this.errorMessage = this.messages.errors.noValue;
|
|
109
|
-
}
|
|
79
|
+
if (!this.valid && errorMessage !== undefined) {
|
|
80
|
+
this.errorMessage = errorMessage;
|
|
110
81
|
}
|
|
111
82
|
};
|
|
112
83
|
/**
|
|
@@ -121,7 +92,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
121
92
|
this.validateSlots = () => {
|
|
122
93
|
const slots = Array.from(this.element.children);
|
|
123
94
|
if (slots.length !== 2) {
|
|
124
|
-
|
|
95
|
+
throw new Error('<mg-input-toggle> 2 slots are required.');
|
|
125
96
|
}
|
|
126
97
|
else if (!this.isIcon) {
|
|
127
98
|
// Due to text-overflow set to ellipsis
|
|
@@ -152,28 +123,16 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
152
123
|
this.valueChange.emit(newValue);
|
|
153
124
|
}
|
|
154
125
|
validateItems(newValue) {
|
|
155
|
-
if (
|
|
156
|
-
this.options = [];
|
|
157
|
-
this.displayError();
|
|
158
|
-
}
|
|
159
|
-
else if (Array.isArray(newValue) && this.items.length !== 2) {
|
|
126
|
+
if (typeof newValue === 'object' && this.items.length !== 2) {
|
|
160
127
|
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${toString(newValue)}.`);
|
|
161
128
|
}
|
|
162
129
|
// String array
|
|
163
130
|
else if (allItemsAreString(newValue)) {
|
|
164
131
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
165
|
-
// force to reset error when noValueError is displaied
|
|
166
|
-
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
167
|
-
this.resetErrorMessage();
|
|
168
|
-
}
|
|
169
132
|
}
|
|
170
133
|
// Object array
|
|
171
134
|
else if (Array.isArray(newValue) && newValue.every(isOption)) {
|
|
172
135
|
this.options = newValue;
|
|
173
|
-
// force to reset error when noValueError is displaied
|
|
174
|
-
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
175
|
-
this.resetErrorMessage();
|
|
176
|
-
}
|
|
177
136
|
}
|
|
178
137
|
else {
|
|
179
138
|
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue. Passed value: ${toString(newValue)}.`);
|
|
@@ -235,7 +194,8 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
235
194
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string.');
|
|
236
195
|
}
|
|
237
196
|
else {
|
|
238
|
-
this.
|
|
197
|
+
this.valid = valid;
|
|
198
|
+
this.inputValid.emit(valid);
|
|
239
199
|
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
240
200
|
}
|
|
241
201
|
}
|
|
@@ -254,43 +214,12 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
254
214
|
// - Keep everything in sync both inside and outside the component
|
|
255
215
|
return new Promise(resolve => {
|
|
256
216
|
requestAnimationFrame(() => {
|
|
257
|
-
this.
|
|
217
|
+
this.errorMessage = undefined;
|
|
258
218
|
resolve();
|
|
259
219
|
});
|
|
260
220
|
});
|
|
261
221
|
}
|
|
262
222
|
}
|
|
263
|
-
/**
|
|
264
|
-
* Display input error if it exists.
|
|
265
|
-
*/
|
|
266
|
-
displayError() {
|
|
267
|
-
// Use `Promise` as requested for stencil method
|
|
268
|
-
// Use `requestAnimationFrame` to ensure:
|
|
269
|
-
// - DOM is fully updated before validation
|
|
270
|
-
// - Async operations are completed
|
|
271
|
-
// - No timing issues with Stencil's render cycle
|
|
272
|
-
// - Keep everything in sync both inside and outside the component
|
|
273
|
-
return new Promise(resolve => {
|
|
274
|
-
requestAnimationFrame(() => {
|
|
275
|
-
this.checkValidity();
|
|
276
|
-
this.setErrorMessage();
|
|
277
|
-
resolve();
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Method to set validity values
|
|
283
|
-
* @param newValue - valid new value
|
|
284
|
-
*/
|
|
285
|
-
setValidity(newValue) {
|
|
286
|
-
const oldValidValue = this.valid;
|
|
287
|
-
this.valid = newValue;
|
|
288
|
-
this.invalid = !this.valid;
|
|
289
|
-
// We need to send valid event even if it is the same value
|
|
290
|
-
if (this.valid !== oldValidValue) {
|
|
291
|
-
this.inputValid.emit(this.valid);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
223
|
/**
|
|
295
224
|
* set checked state
|
|
296
225
|
*/
|
|
@@ -309,9 +238,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
309
238
|
const selectedValue = this.value === this.options[optionTrueValueIndex].value;
|
|
310
239
|
this.checked = optionTrueValueIndex === 0 ? !selectedValue : selectedValue;
|
|
311
240
|
}
|
|
312
|
-
else if (Array.isArray(this.options) && this.options.length === 0) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
241
|
else {
|
|
316
242
|
this.checked = this.value === this.options[1].value;
|
|
317
243
|
}
|
|
@@ -323,8 +249,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
323
249
|
* Check if component props are well configured on init
|
|
324
250
|
*/
|
|
325
251
|
componentWillLoad() {
|
|
326
|
-
// Get locales
|
|
327
|
-
this.messages = initLocales(this.element).messages;
|
|
328
252
|
// Check items format
|
|
329
253
|
this.validateItems(this.items);
|
|
330
254
|
// Check slots
|
|
@@ -343,7 +267,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
343
267
|
*/
|
|
344
268
|
render() {
|
|
345
269
|
const checkedItem = this.getCheckedItem(this.checked);
|
|
346
|
-
return (h("mg-input", { key: '
|
|
270
|
+
return (h("mg-input", { key: '7611cffaf1c01e30c3fa7a27555f94ab357dd374', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (checkedItem && h("b", { class: "mg-c-input__readonly-value" }, checkedItem.title)) : (h("button", { 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, ref: el => {
|
|
347
271
|
if (el !== null)
|
|
348
272
|
this.button = el;
|
|
349
273
|
} }, h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-2" }))))));
|
|
@@ -374,12 +298,10 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
374
298
|
"tooltip": [1],
|
|
375
299
|
"tooltipPosition": [1, "tooltip-position"],
|
|
376
300
|
"helpText": [1, "help-text"],
|
|
377
|
-
"noValueErrorDetail": [1, "no-value-error-detail"],
|
|
378
|
-
"valid": [1028],
|
|
379
|
-
"invalid": [1028],
|
|
380
301
|
"classCollection": [32],
|
|
381
302
|
"options": [32],
|
|
382
303
|
"errorMessage": [32],
|
|
304
|
+
"valid": [32],
|
|
383
305
|
"checked": [32],
|
|
384
306
|
"setFocus": [64],
|
|
385
307
|
"setError": [64],
|
|
@@ -397,18 +319,13 @@ function defineCustomElement$1() {
|
|
|
397
319
|
if (typeof customElements === "undefined") {
|
|
398
320
|
return;
|
|
399
321
|
}
|
|
400
|
-
const components = ["mg-input-toggle", "mg-
|
|
322
|
+
const components = ["mg-input-toggle", "mg-icon", "mg-input", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
401
323
|
components.forEach(tagName => { switch (tagName) {
|
|
402
324
|
case "mg-input-toggle":
|
|
403
325
|
if (!customElements.get(tagName)) {
|
|
404
326
|
customElements.define(tagName, MgInputToggle$1);
|
|
405
327
|
}
|
|
406
328
|
break;
|
|
407
|
-
case "mg-details":
|
|
408
|
-
if (!customElements.get(tagName)) {
|
|
409
|
-
defineCustomElement$7();
|
|
410
|
-
}
|
|
411
|
-
break;
|
|
412
329
|
case "mg-icon":
|
|
413
330
|
if (!customElements.get(tagName)) {
|
|
414
331
|
defineCustomElement$6();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { i as isValidString, t as toString, a as isValideID
|
|
3
|
-
import { i as initLocales } from './index3.js';
|
|
4
|
-
import { d as defineCustomElement$5 } from './mg-details2.js';
|
|
2
|
+
import { i as isValidString, t as toString, a as isValideID } from './index2.js';
|
|
5
3
|
import { d as defineCustomElement$4 } from './mg-icon2.js';
|
|
6
4
|
import { d as defineCustomElement$3 } from './mg-input-title2.js';
|
|
7
5
|
import { d as defineCustomElement$2 } from './mg-tooltip2.js';
|
|
@@ -19,25 +17,18 @@ const classFieldset = 'mg-c-input--fieldset';
|
|
|
19
17
|
const classDisabled = 'mg-c-input--disabled';
|
|
20
18
|
const classReadonly = 'mg-c-input--readonly';
|
|
21
19
|
const classVerticalList = 'mg-c-input--vertical-list';
|
|
22
|
-
/**
|
|
23
|
-
* Define cutom errors
|
|
24
|
-
*/
|
|
25
|
-
const CustomError = {
|
|
26
|
-
NoValue: 'noValue',
|
|
27
|
-
};
|
|
28
20
|
|
|
29
|
-
const mgInputCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-input-border-width: Defines the width of the input border. Default value is `--mg-b-size-border`.\n * @prop --mg-c-input-border-radius: Defines the border radius of the input. Default value is `--mg-b-size-radius`.\n * @prop --mg-c-input-color-border: Defines the color of the input border. Default value is `rgb(181, 194, 201)`.\n * @prop --mg-c-input-placeholder-color-text: Defines the color of the placeholder text. Default value is `rgb(181, 194, 201)`.\n * @prop --mg-c-input-color-box-shadow-focus: Defines the shadow color of the input when focused. Default value is `rgba(0, 221, 255, 0.5)`.\n * @prop --mg-c-input-error-color-background: Defines the background color of the input error message. Default value is `color-mix(in srgb, var(--mg-b-color-danger), white 95%)`.\n * @prop --mg-c-input-toggle-border-radius-ratio: Defines the border radius ratio of the input toggle. Default value is `2`.\n * @prop --mg-c-input-check-size: Defines the size of the input check. Default value is `--mg-b-size-16`.\n */:host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;min-height:var(--mg-b-size-min-height);align-items:flex-start}.mg-c-input__input-container{width:100%;min-height:var(--mg-b-size-min-height)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-b-size-16);height:var(--mg-b-size-16);margin-left:var(--mg-b-size-8)}@media print{.mg-c-input__input-container mg-tooltip{display:none}}.mg-c-input__input{display:flex;min-height:var(--mg-b-size-min-height);align-items:center;justify-content:start}.mg-c-input__input mg-tooltip{align-self:baseline;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input__input ::slotted(.mg-c-input__button-toggle:disabled){opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input__title{display:flex;width:var(--mg-c-input-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);margin-right:var(--mg-c-input-title-horizontal-space, var(--mg-b-size-8));text-align:right}.mg-c-input__title slot[name=label]+mg-tooltip{margin-left:var(--mg-b-size-4)}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__error{
|
|
21
|
+
const mgInputCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-input-border-width: Defines the width of the input border. Default value is `--mg-b-size-border`.\n * @prop --mg-c-input-border-radius: Defines the border radius of the input. Default value is `--mg-b-size-radius`.\n * @prop --mg-c-input-color-border: Defines the color of the input border. Default value is `rgb(181, 194, 201)`.\n * @prop --mg-c-input-placeholder-color-text: Defines the color of the placeholder text. Default value is `rgb(181, 194, 201)`.\n * @prop --mg-c-input-color-box-shadow-focus: Defines the shadow color of the input when focused. Default value is `rgba(0, 221, 255, 0.5)`.\n * @prop --mg-c-input-error-color-background: Defines the background color of the input error message. Default value is `color-mix(in srgb, var(--mg-b-color-danger), white 95%)`.\n * @prop --mg-c-input-toggle-border-radius-ratio: Defines the border radius ratio of the input toggle. Default value is `2`.\n * @prop --mg-c-input-check-size: Defines the size of the input check. Default value is `--mg-b-size-16`.\n */:host{display:block}.mg-c-input__input mg-icon,.mg-c-input__error mg-icon{display:flex}.mg-c-input{display:flex;min-height:var(--mg-b-size-min-height);align-items:flex-start}.mg-c-input__input-container{width:100%;min-height:var(--mg-b-size-min-height)}.mg-c-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-b-size-16);height:var(--mg-b-size-16);margin-left:var(--mg-b-size-8)}@media print{.mg-c-input__input-container mg-tooltip{display:none}}.mg-c-input__input{display:flex;min-height:var(--mg-b-size-min-height);align-items:center;justify-content:start}.mg-c-input__input mg-tooltip{align-self:baseline;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2)}.mg-c-input__input ::slotted(.mg-c-input__button-toggle:disabled){opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input__title{display:flex;width:var(--mg-c-input-title-width, auto);flex-shrink:0;align-items:baseline;justify-content:flex-end;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);margin-right:var(--mg-c-input-title-horizontal-space, var(--mg-b-size-8));text-align:right}.mg-c-input__title slot[name=label]+mg-tooltip{margin-left:var(--mg-b-size-4)}.mg-c-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-c-input__error{display:inline-block;padding:var(--mg-b-size-4) var(--mg-b-size-8);border-radius:var(--mg-b-size-radius);background:var(--mg-c-input-error-color-background);color:var(--mg-b-color-danger)}.mg-c-input__error ::slotted(*),.mg-c-input__help-text ::slotted(*){font-size:var(--mg-b-font-size-small);text-align:start}:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__error,:host(:not(.mg-c-input--textarea)) .mg-c-input__input+.mg-c-input__help-text{margin-top:var(--mg-b-size-4)}:host(.mg-c-input.mg-c-input--readonly) .mg-c-input__input mg-tooltip{margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}:host(.mg-c-input){display:flex;margin-bottom:var(--mg-c-input-margin-bottom, 0)}:host(.mg-c-input.mg-c-input--checkbox) .mg-c-input__input,:host(.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset;align-items:flex-start}:host(.mg-c-input.mg-c-input--checkbox,.mg-c-input.mg-c-input--radio) .mg-c-input__input{min-height:unset}:host(.mg-c-input.mg-c-input--fieldset:not(.mg-c-input--checkbox-multi,.mg-c-input--readonly)) .mg-c-input__input-container mg-tooltip{margin-left:var(--mg-b-size-32)}:host(.mg-c-input.mg-c-input--label-on-top){flex-direction:column}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:var(--mg-b-size-4);text-align:left}:host(.mg-c-input.mg-c-input--label-on-top) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}@media screen and (max-width: 767px){:host(.mg-c-input){flex-direction:column}:host(.mg-c-input) .mg-c-input__title{width:100%;flex:0;justify-content:flex-start;margin-top:0;margin-right:0;margin-bottom:var(--mg-b-size-4);text-align:left}:host(.mg-c-input) .mg-c-input__title ::slotted(mg-input-title){flex-shrink:1}}";
|
|
30
22
|
|
|
31
|
-
const isValidErrorMessageType = (msg) => isObject(msg) && ['summary', 'details'].every(key => typeof msg[key] === 'string');
|
|
32
23
|
const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLElement {
|
|
33
|
-
constructor() {
|
|
24
|
+
constructor(registerHost) {
|
|
34
25
|
super();
|
|
35
|
-
|
|
26
|
+
if (registerHost !== false) {
|
|
27
|
+
this.__registerHost();
|
|
28
|
+
}
|
|
36
29
|
this.__attachShadow();
|
|
37
30
|
this.slotLabel = 'label';
|
|
38
31
|
this.slotError = 'error';
|
|
39
|
-
this.slotSummary = 'summary';
|
|
40
|
-
this.slotDetails = 'details';
|
|
41
32
|
this.slotHelpText = 'help-text';
|
|
42
33
|
// style
|
|
43
34
|
this.classInput = 'mg-c-input';
|
|
@@ -79,44 +70,6 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
79
70
|
* Element is disabled
|
|
80
71
|
*/
|
|
81
72
|
this.isVerticalList = false;
|
|
82
|
-
/**
|
|
83
|
-
* Render error message details element
|
|
84
|
-
*/
|
|
85
|
-
this.renderErrorDetailsMessage = (message) => {
|
|
86
|
-
var _a, _b;
|
|
87
|
-
// remove error slot if it is NOT a MG-DETAIL
|
|
88
|
-
if (((_a = this.errorMessageSlotElement) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'MG-DETAILS') {
|
|
89
|
-
(_b = this.errorMessageSlotElement) === null || _b === void 0 ? void 0 : _b.remove();
|
|
90
|
-
}
|
|
91
|
-
// create OR update error summary
|
|
92
|
-
let summarySlotElement = this.element.querySelector(`[slot=${this.slotError}] [slot=${this.slotSummary}]`);
|
|
93
|
-
if (summarySlotElement === null) {
|
|
94
|
-
summarySlotElement = document.createElement('span');
|
|
95
|
-
summarySlotElement.setAttribute('slot', this.slotSummary);
|
|
96
|
-
}
|
|
97
|
-
summarySlotElement.innerHTML = message.summary;
|
|
98
|
-
// create OR update error details
|
|
99
|
-
let detailsSlotElement = this.element.querySelector(`[slot=${this.slotError}] [slot=${this.slotDetails}]`);
|
|
100
|
-
if (detailsSlotElement === null) {
|
|
101
|
-
detailsSlotElement = document.createElement('p');
|
|
102
|
-
detailsSlotElement.setAttribute('slot', this.slotDetails);
|
|
103
|
-
detailsSlotElement.classList.add('mg-c-input__error-details');
|
|
104
|
-
}
|
|
105
|
-
detailsSlotElement.innerHTML = message.details;
|
|
106
|
-
// create error mg-details
|
|
107
|
-
let mgDetails = this.element.querySelector(`mg-details[slot=${this.slotError}]`);
|
|
108
|
-
if (mgDetails === null) {
|
|
109
|
-
mgDetails = document.createElement('mg-details');
|
|
110
|
-
mgDetails.classList.add('mg-c-input__error');
|
|
111
|
-
mgDetails.toggleClosed = this.messages.details.toggleClosed;
|
|
112
|
-
mgDetails.toggleOpened = this.messages.details.toggleOpened;
|
|
113
|
-
mgDetails.hideSummary = true;
|
|
114
|
-
mgDetails.appendChild(summarySlotElement);
|
|
115
|
-
mgDetails.appendChild(detailsSlotElement);
|
|
116
|
-
this.element.appendChild(mgDetails);
|
|
117
|
-
}
|
|
118
|
-
this.errorMessageSlotElement = mgDetails;
|
|
119
|
-
};
|
|
120
73
|
/**
|
|
121
74
|
* Get tooltip node
|
|
122
75
|
* @returns mg-tooltip
|
|
@@ -154,14 +107,16 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
154
107
|
}
|
|
155
108
|
}
|
|
156
109
|
watchErrorMessage(newValue) {
|
|
157
|
-
|
|
110
|
+
var _a;
|
|
111
|
+
if (newValue !== undefined) {
|
|
158
112
|
this.element.classList.add(this.classHasError);
|
|
113
|
+
this.renderErrorMessage();
|
|
159
114
|
}
|
|
160
115
|
else {
|
|
161
116
|
this.element.classList.remove(this.classHasError);
|
|
117
|
+
(_a = this.errorMessageSlotElement) === null || _a === void 0 ? void 0 : _a.remove();
|
|
118
|
+
this.errorMessageSlotElement = undefined;
|
|
162
119
|
}
|
|
163
|
-
// update error message slot
|
|
164
|
-
this.renderErrorMessageSlot();
|
|
165
120
|
}
|
|
166
121
|
watchHelpText(newValue) {
|
|
167
122
|
var _a;
|
|
@@ -190,12 +145,14 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
190
145
|
// Help text
|
|
191
146
|
if (this.helpText !== undefined) {
|
|
192
147
|
this.renderHelpText();
|
|
193
|
-
ariaDescribedbyIDs.
|
|
148
|
+
if (!ariaDescribedbyIDs.has(this.helpTextId))
|
|
149
|
+
ariaDescribedbyIDs.add(this.helpTextId);
|
|
194
150
|
}
|
|
195
151
|
// Error Message
|
|
196
152
|
if (this.errorMessage !== undefined) {
|
|
197
|
-
this.
|
|
198
|
-
ariaDescribedbyIDs.
|
|
153
|
+
this.renderErrorMessage();
|
|
154
|
+
if (!ariaDescribedbyIDs.has(this.helpTextErrorId))
|
|
155
|
+
ariaDescribedbyIDs.add(this.helpTextErrorId);
|
|
199
156
|
}
|
|
200
157
|
this.element.querySelectorAll('input,select,textarea,[role="switch"]').forEach(element => {
|
|
201
158
|
if (ariaDescribedbyIDs.size > 0) {
|
|
@@ -261,41 +218,17 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
261
218
|
this.element.appendChild(labelSlotElement);
|
|
262
219
|
}
|
|
263
220
|
/**
|
|
264
|
-
* Render error message
|
|
265
|
-
*/
|
|
266
|
-
renderErrorStringMessage(message) {
|
|
267
|
-
var _a;
|
|
268
|
-
// remove error slot if it is a MG-DETAIL
|
|
269
|
-
if (((_a = this.errorMessageSlotElement) === null || _a === void 0 ? void 0 : _a.nodeName) === 'MG-DETAILS') {
|
|
270
|
-
this.errorMessageSlotElement.remove();
|
|
271
|
-
}
|
|
272
|
-
// create element if it does NOT exist
|
|
273
|
-
else if (this.errorMessageSlotElement === null) {
|
|
274
|
-
this.errorMessageSlotElement = document.createElement('div');
|
|
275
|
-
this.element.appendChild(this.errorMessageSlotElement);
|
|
276
|
-
}
|
|
277
|
-
this.errorMessageSlotElement.innerHTML = message;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Render error message slot element
|
|
221
|
+
* Render error message
|
|
281
222
|
*/
|
|
282
|
-
|
|
283
|
-
var _a;
|
|
223
|
+
renderErrorMessage() {
|
|
284
224
|
this.errorMessageSlotElement = this.element.querySelector(`[slot=${this.slotError}]`);
|
|
285
|
-
if (this.
|
|
286
|
-
|
|
287
|
-
this.renderErrorStringMessage(this.errorMessage);
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
this.renderErrorDetailsMessage(this.errorMessage);
|
|
291
|
-
}
|
|
225
|
+
if (this.errorMessageSlotElement === null) {
|
|
226
|
+
this.errorMessageSlotElement = document.createElement('div');
|
|
292
227
|
this.errorMessageSlotElement.setAttribute('slot', this.slotError);
|
|
293
|
-
this.
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
(_a = this.errorMessageSlotElement) === null || _a === void 0 ? void 0 : _a.remove();
|
|
297
|
-
this.errorMessageSlotElement = undefined;
|
|
228
|
+
this.element.appendChild(this.errorMessageSlotElement);
|
|
298
229
|
}
|
|
230
|
+
this.errorMessageSlotElement.setAttribute('id', this.helpTextErrorId);
|
|
231
|
+
this.errorMessageSlotElement.innerHTML = this.errorMessage;
|
|
299
232
|
}
|
|
300
233
|
/**
|
|
301
234
|
* Render help text message
|
|
@@ -317,9 +250,6 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
317
250
|
* Check if component props are well configured on init
|
|
318
251
|
*/
|
|
319
252
|
componentWillLoad() {
|
|
320
|
-
// Get locales
|
|
321
|
-
this.messages = initLocales(this.element).messages;
|
|
322
|
-
// Validate
|
|
323
253
|
this.watchIdentifier(this.identifier);
|
|
324
254
|
this.watchLabel();
|
|
325
255
|
this.watchClass();
|
|
@@ -344,7 +274,7 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
344
274
|
*/
|
|
345
275
|
render() {
|
|
346
276
|
const isGroup = this.isFieldset && !this.isReadonly;
|
|
347
|
-
return (h(Host, { key: '
|
|
277
|
+
return (h(Host, { key: '7c4c22aaa8f8d250eafa9159a103a11e637b0cca', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: '2215e7b2d96e08507579a39d8e05b3e8a3d901fb', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: 'a4dbf4e36dd3ae5437d6dcb05d807f4faa0924b7', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: '8e382a4857f469a9d6f77cad613183798df4d1e1', class: "mg-c-input__input-container" }, h("div", { key: 'f9897f90d44aab19614d4d40d77a8eb270c92847', class: "mg-c-input__input" }, h("slot", { key: 'c8d809d4ff0d0e660849825f016f9267da3a2d7e' }), this.tooltip && !this.labelOnTop && (this.tooltipPosition === 'input' || this.labelHide) && this.renderTooltip()), this.helptextMessageSlotElement && (h("div", { key: 'cebd6c083d088aebcdae6f032c6cdcf2387c3e27', class: "mg-c-input__help-text" }, h("slot", { key: '923fcc78b309d197e32522052b297ef0f58b1495', name: this.slotHelpText }))), !this.isDisabled && this.errorMessage && (h("div", { key: 'e706bff54ce21191a8c0940c60f6e99a91cfb9ec', class: "mg-c-input__error", "aria-live": "assertive" }, h("slot", { key: '6524debd3640df7b5e73ef4aa4415569eef1ecd8', name: this.slotError }))))));
|
|
348
278
|
}
|
|
349
279
|
get element() { return this; }
|
|
350
280
|
static get watchers() { return {
|
|
@@ -395,18 +325,13 @@ function defineCustomElement() {
|
|
|
395
325
|
if (typeof customElements === "undefined") {
|
|
396
326
|
return;
|
|
397
327
|
}
|
|
398
|
-
const components = ["mg-input", "mg-
|
|
328
|
+
const components = ["mg-input", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
399
329
|
components.forEach(tagName => { switch (tagName) {
|
|
400
330
|
case "mg-input":
|
|
401
331
|
if (!customElements.get(tagName)) {
|
|
402
332
|
customElements.define(tagName, MgInput);
|
|
403
333
|
}
|
|
404
334
|
break;
|
|
405
|
-
case "mg-details":
|
|
406
|
-
if (!customElements.get(tagName)) {
|
|
407
|
-
defineCustomElement$5();
|
|
408
|
-
}
|
|
409
|
-
break;
|
|
410
335
|
case "mg-icon":
|
|
411
336
|
if (!customElements.get(tagName)) {
|
|
412
337
|
defineCustomElement$4();
|
|
@@ -431,4 +356,4 @@ function defineCustomElement() {
|
|
|
431
356
|
}
|
|
432
357
|
defineCustomElement();
|
|
433
358
|
|
|
434
|
-
export {
|
|
359
|
+
export { MgInput as M, classDisabled as a, classFieldset as b, classReadonly as c, defineCustomElement as d, classVerticalList as e, widths as w };
|
|
@@ -92,9 +92,11 @@ class OverflowBehavior {
|
|
|
92
92
|
const mgMenuCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-menu-color-background: Defines the background color of the menu. Unset by default, fallback on `--mg-b-color-light`.\n */:host{display:inline-flex;width:100%;min-width:0;background-color:var(--mg-c-menu-color-background, var(--mg-b-color-light))}:host([direction=vertical]){display:flex;height:100%;flex-direction:column;overflow-y:auto}";
|
|
93
93
|
|
|
94
94
|
const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement {
|
|
95
|
-
constructor() {
|
|
95
|
+
constructor(registerHost) {
|
|
96
96
|
super();
|
|
97
|
-
|
|
97
|
+
if (registerHost !== false) {
|
|
98
|
+
this.__registerHost();
|
|
99
|
+
}
|
|
98
100
|
this.__attachShadow();
|
|
99
101
|
/************
|
|
100
102
|
* Internal *
|
|
@@ -336,9 +338,11 @@ defineCustomElement$1();
|
|
|
336
338
|
const mgItemMoreCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host:not([hidden]){display:flex}";
|
|
337
339
|
|
|
338
340
|
const MgItemMore = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends HTMLElement {
|
|
339
|
-
constructor() {
|
|
341
|
+
constructor(registerHost) {
|
|
340
342
|
super();
|
|
341
|
-
|
|
343
|
+
if (registerHost !== false) {
|
|
344
|
+
this.__registerHost();
|
|
345
|
+
}
|
|
342
346
|
this.__attachShadow();
|
|
343
347
|
/************
|
|
344
348
|
* Internal *
|
|
@@ -6,9 +6,11 @@ import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
|
6
6
|
const mgLoaderCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--mg-b-size-4);text-align:center}";
|
|
7
7
|
|
|
8
8
|
const MgLoader = /*@__PURE__*/ proxyCustomElement(class MgLoader extends HTMLElement {
|
|
9
|
-
constructor() {
|
|
9
|
+
constructor(registerHost) {
|
|
10
10
|
super();
|
|
11
|
-
|
|
11
|
+
if (registerHost !== false) {
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
}
|
|
12
14
|
this.__attachShadow();
|
|
13
15
|
/**
|
|
14
16
|
* Hide message
|
|
@@ -37,9 +37,11 @@ const sizes = ['medium', 'large', 'xlarge'];
|
|
|
37
37
|
const mgMenuItemCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-menu-item-color: Defines menu item global color, used for bottom line and active tabs. Default value: `--mg-b-color-app`.\n * @prop --mg-c-menu-item-color-text: Defines the color of the menu item. Unset by default, fallback on `--mg-b-color-dark`.\n * @prop --mg-c-menu-item-navigation-button-max-width: Defines the max-width property for the navigation button. Unset by default.\n */.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{height:var(--mg-b-size-40);padding:var(--mg-b-size-12) var(--mg-b-size-16)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:var(--mg-b-font-size)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-16)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{height:var(--mg-b-size-48);padding:var(--mg-b-size-12) var(--mg-b-size-32)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-32)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{height:var(--mg-b-size-72);padding:var(--mg-b-size-12) var(--mg-b-size-40)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-40)}.mg-c-menu-item__navigation-button{display:flex;box-sizing:border-box;align-items:center;border:none;background-color:unset;color:var(--mg-c-menu-item-color-text, var(--mg-b-color-dark));column-gap:var(--mg-c-menu-item-navigation-button-column-gap, var(--mg-b-size-8));cursor:pointer;font-family:var(--mg-b-font-family);font-weight:400;line-height:var(--mg-b-line-height);text-decoration:none;white-space:nowrap}.mg-c-menu-item__navigation-button:disabled,.mg-c-menu-item__navigation-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-menu-item__navigation-button:focus-visible{z-index:10}.mg-c-menu-item__navigation-button:hover:not(.mg-c-menu-item__navigation-button--disabled),.mg-c-menu-item__navigation-button:focus-visible:not(.mg-c-menu-item__navigation-button--disabled){background-color:color-mix(in srgb, var(--mg-c-menu-item-color), transparent 90%)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active{color:var(--mg-c-menu-item-color);font-weight:600}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--horizontal{box-shadow:inset 0 calc(-1*var(--mg-b-size-4)) var(--mg-c-menu-item-color)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--vertical{box-shadow:inset var(--mg-b-size-4) 0 var(--mg-c-menu-item-color)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--hidden{display:none}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(1*var(--mg-b-size-16))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(2*var(--mg-b-size-16))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(3*var(--mg-b-size-16))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(4*var(--mg-b-size-16))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(5*var(--mg-b-size-16))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(6*var(--mg-b-size-16))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(1*var(--mg-b-size-32))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(2*var(--mg-b-size-32))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(3*var(--mg-b-size-32))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(4*var(--mg-b-size-32))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(5*var(--mg-b-size-32))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(6*var(--mg-b-size-32))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(1*var(--mg-b-size-40))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(2*var(--mg-b-size-40))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(3*var(--mg-b-size-40))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(4*var(--mg-b-size-40))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(5*var(--mg-b-size-40))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(6*var(--mg-b-size-40))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}.mg-c-menu-item{max-width:var(--mg-c-menu-item-navigation-button-max-width)}.mg-c-menu-item__collapse-container{z-index:10;width:max-content}.mg-c-menu-item__navigation-button-center{min-width:0}.mg-c-menu-item__navigation-button-text-content{display:flex;width:100%;align-items:center}.mg-c-menu-item__navigation-button-text-content-notification,.mg-c-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:var(--mg-b-size-8);font-size:var(--mg-b-font-size)}.mg-c-menu-item__navigation-button-new-tab{margin-left:var(--mg-b-size-4)}.mg-c-menu-item__navigation-button-chevron{display:var(--mg-c-menu-item-chevron-display);margin-left:auto;transition:200ms}.mg-c-menu-item__navigation-button-chevron--rotate.mg-c-menu-item__navigation-button-chevron{transform:rotate(180deg)}:host{position:relative;display:flex;--mg-c-popover-padding-vertical:0;--mg-c-popover-padding-horizontal:0;--mg-c-popover-max-width:unset}:host([data-style-direction=vertical]){flex-direction:column}:host([data-style-direction=vertical]) .mg-c-menu-item__navigation-button{width:100%}:host([data-style-direction=vertical]) .mg-c-menu-item__collapse-container{position:unset;top:unset;left:unset;width:unset}:host([data-style-direction=vertical]) .mg-c-menu-item-chevron{margin-left:auto}:host([data-overflow-more]){--mg-c-menu-item-navigation-button-column-gap:0}:host([data-overflow-more]) .mg-c-menu-item__navigation-button-chevron{--mg-c-menu-item-chevron-display:none}:host([data-overflow-more]) .mg-c-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:0}:host([data-overflow-more]) ::slotted(mg-menu){--mg-c-menu-item-navigation-button-column-gap:var(--mg-b-size-8)}:host([data-style-direction=horizontal]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level,:host([data-overflow-more]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level{background-color:var(--mg-b-color-light)}:host([data-style-direction=horizontal]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level ::slotted(mg-menu),:host([data-overflow-more]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:var(--mg-b-size-8) 0}::slotted([slot=label]),::slotted([slot=metadata]){display:block;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}::slotted(*){display:flex;flex-direction:column}:host([status=disabled]){pointer-events:none}:host([hidden]){display:none}";
|
|
38
38
|
|
|
39
39
|
const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTMLElement {
|
|
40
|
-
constructor() {
|
|
40
|
+
constructor(registerHost) {
|
|
41
41
|
super();
|
|
42
|
-
|
|
42
|
+
if (registerHost !== false) {
|
|
43
|
+
this.__registerHost();
|
|
44
|
+
}
|
|
43
45
|
this.__attachShadow();
|
|
44
46
|
this.itemLoaded = createEvent(this, "item-loaded", 7);
|
|
45
47
|
this.itemUpdated = createEvent(this, "item-updated", 7);
|
|
@@ -15,9 +15,11 @@ const variantStyles = ['bar-left', 'background'];
|
|
|
15
15
|
const mgMessageCss = "/*!\n * @prop --mg-c-message-border-radius: Defines the border radius of the message. Default value: `--mg-b-size-radius`.\n */:host{--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-message-border-radius);--mg-c-card-border:none;--mg-c-card-overflow:hidden}.mg-c-message{display:inline-block;min-height:var(--mg-b-size-min-height)}.mg-c-message.mg-c-message--danger .mg-c-message__icon{color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-red-20, color-mix(in srgb, var(--mg-b-color-danger), white 80%))}.mg-c-message.mg-c-message--info .mg-c-message__icon{color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-blue-20, color-mix(in srgb, var(--mg-b-color-info), white 80%))}.mg-c-message.mg-c-message--success .mg-c-message__icon{color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-green-20, color-mix(in srgb, var(--mg-b-color-success), white 80%))}.mg-c-message.mg-c-message--warning .mg-c-message__icon{color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-yellow-20, color-mix(in srgb, var(--mg-b-color-warning), white 80%))}.mg-c-message ::slotted(*){padding:0;margin:0}.mg-c-message__icon{position:absolute;top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);left:calc(var(--mg-b-size-4) + var(--mg-b-size-8));line-height:1}.mg-c-message__content{display:flex;flex-wrap:wrap;padding:0 var(--mg-b-size-8) 0 calc(var(--mg-b-size-4) + var(--mg-b-size-8) + var(--mg-b-size-16) + var(--mg-b-size-8));place-content:stretch flex-end}.mg-c-message__content-slot{flex-grow:1;margin:var(--mg-b-size-8) 0}.mg-c-message__content-separator{display:inline-block;width:var(--mg-b-size-40);height:0}.mg-c-message__content-actions-slot{padding:var(--mg-b-size-8) 0;text-align:right}.mg-c-message__bar{position:absolute;top:0;left:0;width:var(--mg-b-size-4);height:100%}.mg-c-message ::slotted(*:not(mg-panel,mg-message,mg-modal)){--mg-c-card-border:var(--mg-c-card-border-default);--mg-c-card-spacing:var(--mg-c-card-spacing-default);--mg-c-card-border-radius:var(--mg-c-card-border-radius-default);--mg-c-card-color-background:var(--mg-c-card-color-background-default);--mg-c-card-box-shadow:var(--mg-c-card-box-shadow-default);--mg-c-card-max-width:unset;--mg-c-card-min-width:unset}.mg-c-message,.mg-c-message mg-message{max-width:100%}";
|
|
16
16
|
|
|
17
17
|
const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLElement {
|
|
18
|
-
constructor() {
|
|
18
|
+
constructor(registerHost) {
|
|
19
19
|
super();
|
|
20
|
-
|
|
20
|
+
if (registerHost !== false) {
|
|
21
|
+
this.__registerHost();
|
|
22
|
+
}
|
|
21
23
|
this.__attachShadow();
|
|
22
24
|
/************
|
|
23
25
|
* Internal *
|
|
@@ -13,9 +13,11 @@ const dialogRoles = ['dialog', 'alertdialog'];
|
|
|
13
13
|
const mgModalCss = "/*!\n * @prop --mg-c-modal-border-radius: Defines the border radius of the modal. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-modal-title-font-size: Defines the font size of the modal title. Default value: `--mg-b-font-size-h3`.\n */:host{--mg-c-card-border-radius:var(--mg-c-modal-border-radius);--mg-c-card-spacing:var(--mg-b-size-16) var(--mg-b-size-24);--mg-c-card-border:none}.mg-c-modal{border:none;background:none;color:inherit}.mg-c-modal[open]{display:flex;padding:var(--mg-b-size-24) var(--mg-b-size-8)}.mg-c-modal::backdrop{background-color:var(--mg-b-color-light);opacity:.85}.mg-c-modal mg-card{display:flex;width:calc(75*var(--mg-b-size-8));max-width:100%;max-height:100%}.mg-c-modal__dialog{position:relative;display:flex;height:fit-content;max-height:100%;flex-direction:column;align-self:center;row-gap:var(--mg-b-size-24)}.mg-c-modal__title{margin:0;font-family:var(--mg-b-font-family-heading);font-size:var(--mg-c-modal-title-font-size);font-weight:600}.mg-c-modal__close-button{height:var(--mg-c-modal-title-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-c-modal-title-font-size)*var(--mg-b-line-height))/2*-1);margin-right:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2*-1);margin-left:var(--mg-b-size-16);float:right}.mg-c-modal__content{padding:var(--mg-b-size-16);margin:calc(var(--mg-b-size-16)*-1);overflow-y:auto}.mg-c-modal ::slotted(*:not(mg-panel,mg-message,mg-modal)){--mg-c-card-border:var(--mg-c-card-border-default);--mg-c-card-spacing:var(--mg-c-card-spacing-default);--mg-c-card-border-radius:var(--mg-c-card-border-radius-default);--mg-c-card-color-background:var(--mg-c-card-color-background-default);--mg-c-card-box-shadow:var(--mg-c-card-box-shadow-default);--mg-c-card-max-width:unset;--mg-c-card-min-width:unset}";
|
|
14
14
|
|
|
15
15
|
const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLElement {
|
|
16
|
-
constructor() {
|
|
16
|
+
constructor(registerHost) {
|
|
17
17
|
super();
|
|
18
|
-
|
|
18
|
+
if (registerHost !== false) {
|
|
19
|
+
this.__registerHost();
|
|
20
|
+
}
|
|
19
21
|
this.__attachShadow();
|
|
20
22
|
this.componentShow = createEvent(this, "component-show", 7);
|
|
21
23
|
this.componentHide = createEvent(this, "component-hide", 7);
|