@mgdis/mg-components 6.15.0 → 6.16.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-T3-qWqFE.js} +2 -2
- package/dist/cjs/{index-iUZvsp-F.js → index-YM1EJx9X.js} +8 -20
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +68 -305
- 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 +3 -3
- 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/molecules/inputs/mg-input/mg-input.conf.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +22 -93
- 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.js +13 -69
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +54 -136
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -63
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +6 -54
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +9 -142
- package/dist/collection/locales/en/messages.json +3 -8
- package/dist/collection/locales/fr/messages.json +3 -8
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +8 -20
- package/dist/components/mg-details.js +97 -1
- package/dist/components/mg-input-checkbox-paginated2.js +1 -2
- package/dist/components/mg-input-checkbox.js +19 -63
- package/dist/components/mg-input-combobox.js +60 -130
- package/dist/components/mg-input-date.js +1 -7
- package/dist/components/mg-input-numeric.js +1 -7
- package/dist/components/mg-input-password.js +2 -8
- package/dist/components/mg-input-radio.js +12 -53
- package/dist/components/mg-input-rich-text-editor.js +1 -7
- package/dist/components/mg-input-select2.js +8 -44
- package/dist/components/mg-input-text2.js +2 -8
- package/dist/components/mg-input-textarea.js +2 -8
- package/dist/components/mg-input-toggle.js +11 -96
- package/dist/components/mg-input2.js +22 -99
- package/dist/components/mg-pagination.js +2 -8
- package/dist/components/mg-panel.js +7 -13
- package/dist/esm/events.utils-yMGqY8YG.js +23 -0
- package/dist/esm/{index-CKB-AnCZ.js → index-Bab8_u8S.js} +8 -20
- package/dist/esm/{index-DhAOnZJn.js → index-JHj_9FSs.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +64 -301
- 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 +3 -3
- 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 +3 -8
- package/dist/mg-components/locales/fr/messages.json +3 -8
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-420daa1e.entry.js → p-42a90251.entry.js} +1 -1
- package/dist/mg-components/p-54156253.entry.js +1 -0
- package/dist/mg-components/{p-47e19783.entry.js → p-658f828c.entry.js} +1 -1
- package/dist/mg-components/{p-67af6274.entry.js → p-82455ac7.entry.js} +1 -1
- package/dist/mg-components/p-Bab8_u8S.js +1 -0
- package/dist/mg-components/p-CNgv8hc5.js +1 -0
- package/dist/mg-components/{p-DhAOnZJn.js → p-JHj_9FSs.js} +1 -1
- package/dist/mg-components/p-abbd151c.entry.js +1 -0
- package/dist/mg-components/{p-a0fa44cf.entry.js → p-c85b5d10.entry.js} +1 -1
- package/dist/mg-components/p-yMGqY8YG.js +1 -0
- 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/ide/intellij/web-types.json +10 -136
- package/ide/vscode/html-custom-data.json +6 -104
- package/package.json +20 -20
- 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-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
|
|
@@ -69,29 +66,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
69
66
|
* Checked internal value
|
|
70
67
|
*/
|
|
71
68
|
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
69
|
/**
|
|
96
70
|
* Set input error message
|
|
97
71
|
* @param errorMessage - errorMessage override
|
|
@@ -100,13 +74,8 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
100
74
|
// Set error message
|
|
101
75
|
this.errorMessage = undefined;
|
|
102
76
|
// 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
|
-
}
|
|
77
|
+
if (!this.valid && errorMessage !== undefined) {
|
|
78
|
+
this.errorMessage = errorMessage;
|
|
110
79
|
}
|
|
111
80
|
};
|
|
112
81
|
/**
|
|
@@ -121,7 +90,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
121
90
|
this.validateSlots = () => {
|
|
122
91
|
const slots = Array.from(this.element.children);
|
|
123
92
|
if (slots.length !== 2) {
|
|
124
|
-
|
|
93
|
+
throw new Error('<mg-input-toggle> 2 slots are required.');
|
|
125
94
|
}
|
|
126
95
|
else if (!this.isIcon) {
|
|
127
96
|
// Due to text-overflow set to ellipsis
|
|
@@ -152,28 +121,16 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
152
121
|
this.valueChange.emit(newValue);
|
|
153
122
|
}
|
|
154
123
|
validateItems(newValue) {
|
|
155
|
-
if (
|
|
156
|
-
this.options = [];
|
|
157
|
-
this.displayError();
|
|
158
|
-
}
|
|
159
|
-
else if (Array.isArray(newValue) && this.items.length !== 2) {
|
|
124
|
+
if (typeof newValue === 'object' && this.items.length !== 2) {
|
|
160
125
|
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${toString(newValue)}.`);
|
|
161
126
|
}
|
|
162
127
|
// String array
|
|
163
128
|
else if (allItemsAreString(newValue)) {
|
|
164
129
|
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
130
|
}
|
|
170
131
|
// Object array
|
|
171
132
|
else if (Array.isArray(newValue) && newValue.every(isOption)) {
|
|
172
133
|
this.options = newValue;
|
|
173
|
-
// force to reset error when noValueError is displaied
|
|
174
|
-
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
175
|
-
this.resetErrorMessage();
|
|
176
|
-
}
|
|
177
134
|
}
|
|
178
135
|
else {
|
|
179
136
|
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 +192,8 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
235
192
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string.');
|
|
236
193
|
}
|
|
237
194
|
else {
|
|
238
|
-
this.
|
|
195
|
+
this.valid = valid;
|
|
196
|
+
this.inputValid.emit(valid);
|
|
239
197
|
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
240
198
|
}
|
|
241
199
|
}
|
|
@@ -254,43 +212,12 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
254
212
|
// - Keep everything in sync both inside and outside the component
|
|
255
213
|
return new Promise(resolve => {
|
|
256
214
|
requestAnimationFrame(() => {
|
|
257
|
-
this.
|
|
215
|
+
this.errorMessage = undefined;
|
|
258
216
|
resolve();
|
|
259
217
|
});
|
|
260
218
|
});
|
|
261
219
|
}
|
|
262
220
|
}
|
|
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
221
|
/**
|
|
295
222
|
* set checked state
|
|
296
223
|
*/
|
|
@@ -309,9 +236,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
309
236
|
const selectedValue = this.value === this.options[optionTrueValueIndex].value;
|
|
310
237
|
this.checked = optionTrueValueIndex === 0 ? !selectedValue : selectedValue;
|
|
311
238
|
}
|
|
312
|
-
else if (Array.isArray(this.options) && this.options.length === 0) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
239
|
else {
|
|
316
240
|
this.checked = this.value === this.options[1].value;
|
|
317
241
|
}
|
|
@@ -323,8 +247,6 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
323
247
|
* Check if component props are well configured on init
|
|
324
248
|
*/
|
|
325
249
|
componentWillLoad() {
|
|
326
|
-
// Get locales
|
|
327
|
-
this.messages = initLocales(this.element).messages;
|
|
328
250
|
// Check items format
|
|
329
251
|
this.validateItems(this.items);
|
|
330
252
|
// Check slots
|
|
@@ -343,7 +265,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
343
265
|
*/
|
|
344
266
|
render() {
|
|
345
267
|
const checkedItem = this.getCheckedItem(this.checked);
|
|
346
|
-
return (h("mg-input", { key: '
|
|
268
|
+
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
269
|
if (el !== null)
|
|
348
270
|
this.button = el;
|
|
349
271
|
} }, 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 +296,10 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
374
296
|
"tooltip": [1],
|
|
375
297
|
"tooltipPosition": [1, "tooltip-position"],
|
|
376
298
|
"helpText": [1, "help-text"],
|
|
377
|
-
"noValueErrorDetail": [1, "no-value-error-detail"],
|
|
378
|
-
"valid": [1028],
|
|
379
|
-
"invalid": [1028],
|
|
380
299
|
"classCollection": [32],
|
|
381
300
|
"options": [32],
|
|
382
301
|
"errorMessage": [32],
|
|
302
|
+
"valid": [32],
|
|
383
303
|
"checked": [32],
|
|
384
304
|
"setFocus": [64],
|
|
385
305
|
"setError": [64],
|
|
@@ -397,18 +317,13 @@ function defineCustomElement$1() {
|
|
|
397
317
|
if (typeof customElements === "undefined") {
|
|
398
318
|
return;
|
|
399
319
|
}
|
|
400
|
-
const components = ["mg-input-toggle", "mg-
|
|
320
|
+
const components = ["mg-input-toggle", "mg-icon", "mg-input", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
401
321
|
components.forEach(tagName => { switch (tagName) {
|
|
402
322
|
case "mg-input-toggle":
|
|
403
323
|
if (!customElements.get(tagName)) {
|
|
404
324
|
customElements.define(tagName, MgInputToggle$1);
|
|
405
325
|
}
|
|
406
326
|
break;
|
|
407
|
-
case "mg-details":
|
|
408
|
-
if (!customElements.get(tagName)) {
|
|
409
|
-
defineCustomElement$7();
|
|
410
|
-
}
|
|
411
|
-
break;
|
|
412
327
|
case "mg-icon":
|
|
413
328
|
if (!customElements.get(tagName)) {
|
|
414
329
|
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,16 +17,9 @@ 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
24
|
constructor() {
|
|
34
25
|
super();
|
|
@@ -36,8 +27,6 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
36
27
|
this.__attachShadow();
|
|
37
28
|
this.slotLabel = 'label';
|
|
38
29
|
this.slotError = 'error';
|
|
39
|
-
this.slotSummary = 'summary';
|
|
40
|
-
this.slotDetails = 'details';
|
|
41
30
|
this.slotHelpText = 'help-text';
|
|
42
31
|
// style
|
|
43
32
|
this.classInput = 'mg-c-input';
|
|
@@ -79,44 +68,6 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
79
68
|
* Element is disabled
|
|
80
69
|
*/
|
|
81
70
|
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
71
|
/**
|
|
121
72
|
* Get tooltip node
|
|
122
73
|
* @returns mg-tooltip
|
|
@@ -154,14 +105,16 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
154
105
|
}
|
|
155
106
|
}
|
|
156
107
|
watchErrorMessage(newValue) {
|
|
157
|
-
|
|
108
|
+
var _a;
|
|
109
|
+
if (newValue !== undefined) {
|
|
158
110
|
this.element.classList.add(this.classHasError);
|
|
111
|
+
this.renderErrorMessage();
|
|
159
112
|
}
|
|
160
113
|
else {
|
|
161
114
|
this.element.classList.remove(this.classHasError);
|
|
115
|
+
(_a = this.errorMessageSlotElement) === null || _a === void 0 ? void 0 : _a.remove();
|
|
116
|
+
this.errorMessageSlotElement = undefined;
|
|
162
117
|
}
|
|
163
|
-
// update error message slot
|
|
164
|
-
this.renderErrorMessageSlot();
|
|
165
118
|
}
|
|
166
119
|
watchHelpText(newValue) {
|
|
167
120
|
var _a;
|
|
@@ -190,12 +143,14 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
190
143
|
// Help text
|
|
191
144
|
if (this.helpText !== undefined) {
|
|
192
145
|
this.renderHelpText();
|
|
193
|
-
ariaDescribedbyIDs.
|
|
146
|
+
if (!ariaDescribedbyIDs.has(this.helpTextId))
|
|
147
|
+
ariaDescribedbyIDs.add(this.helpTextId);
|
|
194
148
|
}
|
|
195
149
|
// Error Message
|
|
196
150
|
if (this.errorMessage !== undefined) {
|
|
197
|
-
this.
|
|
198
|
-
ariaDescribedbyIDs.
|
|
151
|
+
this.renderErrorMessage();
|
|
152
|
+
if (!ariaDescribedbyIDs.has(this.helpTextErrorId))
|
|
153
|
+
ariaDescribedbyIDs.add(this.helpTextErrorId);
|
|
199
154
|
}
|
|
200
155
|
this.element.querySelectorAll('input,select,textarea,[role="switch"]').forEach(element => {
|
|
201
156
|
if (ariaDescribedbyIDs.size > 0) {
|
|
@@ -261,41 +216,17 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
261
216
|
this.element.appendChild(labelSlotElement);
|
|
262
217
|
}
|
|
263
218
|
/**
|
|
264
|
-
* Render error message
|
|
219
|
+
* Render error message
|
|
265
220
|
*/
|
|
266
|
-
|
|
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
|
|
281
|
-
*/
|
|
282
|
-
renderErrorMessageSlot() {
|
|
283
|
-
var _a;
|
|
221
|
+
renderErrorMessage() {
|
|
284
222
|
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
|
-
}
|
|
223
|
+
if (this.errorMessageSlotElement === null) {
|
|
224
|
+
this.errorMessageSlotElement = document.createElement('div');
|
|
292
225
|
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;
|
|
226
|
+
this.element.appendChild(this.errorMessageSlotElement);
|
|
298
227
|
}
|
|
228
|
+
this.errorMessageSlotElement.setAttribute('id', this.helpTextErrorId);
|
|
229
|
+
this.errorMessageSlotElement.innerHTML = this.errorMessage;
|
|
299
230
|
}
|
|
300
231
|
/**
|
|
301
232
|
* Render help text message
|
|
@@ -317,9 +248,6 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
317
248
|
* Check if component props are well configured on init
|
|
318
249
|
*/
|
|
319
250
|
componentWillLoad() {
|
|
320
|
-
// Get locales
|
|
321
|
-
this.messages = initLocales(this.element).messages;
|
|
322
|
-
// Validate
|
|
323
251
|
this.watchIdentifier(this.identifier);
|
|
324
252
|
this.watchLabel();
|
|
325
253
|
this.watchClass();
|
|
@@ -344,7 +272,7 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
344
272
|
*/
|
|
345
273
|
render() {
|
|
346
274
|
const isGroup = this.isFieldset && !this.isReadonly;
|
|
347
|
-
return (h(Host, { key: '
|
|
275
|
+
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
276
|
}
|
|
349
277
|
get element() { return this; }
|
|
350
278
|
static get watchers() { return {
|
|
@@ -395,18 +323,13 @@ function defineCustomElement() {
|
|
|
395
323
|
if (typeof customElements === "undefined") {
|
|
396
324
|
return;
|
|
397
325
|
}
|
|
398
|
-
const components = ["mg-input", "mg-
|
|
326
|
+
const components = ["mg-input", "mg-icon", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
399
327
|
components.forEach(tagName => { switch (tagName) {
|
|
400
328
|
case "mg-input":
|
|
401
329
|
if (!customElements.get(tagName)) {
|
|
402
330
|
customElements.define(tagName, MgInput);
|
|
403
331
|
}
|
|
404
332
|
break;
|
|
405
|
-
case "mg-details":
|
|
406
|
-
if (!customElements.get(tagName)) {
|
|
407
|
-
defineCustomElement$5();
|
|
408
|
-
}
|
|
409
|
-
break;
|
|
410
333
|
case "mg-icon":
|
|
411
334
|
if (!customElements.get(tagName)) {
|
|
412
335
|
defineCustomElement$4();
|
|
@@ -431,4 +354,4 @@ function defineCustomElement() {
|
|
|
431
354
|
}
|
|
432
355
|
defineCustomElement();
|
|
433
356
|
|
|
434
|
-
export {
|
|
357
|
+
export { MgInput as M, classDisabled as a, classFieldset as b, classReadonly as c, defineCustomElement as d, classVerticalList as e, widths as w };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as createID, a as isValideID, t as toString, i as isValidString } from './index2.js';
|
|
3
3
|
import { i as initLocales } from './index3.js';
|
|
4
|
-
import { d as defineCustomElement$
|
|
5
|
-
import { d as defineCustomElement$8 } from './mg-details2.js';
|
|
4
|
+
import { d as defineCustomElement$8 } from './mg-button2.js';
|
|
6
5
|
import { d as defineCustomElement$7 } from './mg-icon2.js';
|
|
7
6
|
import { d as defineCustomElement$6 } from './mg-input2.js';
|
|
8
7
|
import { d as defineCustomElement$5 } from './mg-input-select2.js';
|
|
@@ -181,7 +180,7 @@ function defineCustomElement$1() {
|
|
|
181
180
|
if (typeof customElements === "undefined") {
|
|
182
181
|
return;
|
|
183
182
|
}
|
|
184
|
-
const components = ["mg-pagination", "mg-button", "mg-
|
|
183
|
+
const components = ["mg-pagination", "mg-button", "mg-icon", "mg-input", "mg-input-select", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
185
184
|
components.forEach(tagName => { switch (tagName) {
|
|
186
185
|
case "mg-pagination":
|
|
187
186
|
if (!customElements.get(tagName)) {
|
|
@@ -189,11 +188,6 @@ function defineCustomElement$1() {
|
|
|
189
188
|
}
|
|
190
189
|
break;
|
|
191
190
|
case "mg-button":
|
|
192
|
-
if (!customElements.get(tagName)) {
|
|
193
|
-
defineCustomElement$9();
|
|
194
|
-
}
|
|
195
|
-
break;
|
|
196
|
-
case "mg-details":
|
|
197
191
|
if (!customElements.get(tagName)) {
|
|
198
192
|
defineCustomElement$8();
|
|
199
193
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as createID, C as ClassList, a as isValideID, t as toString, i as isValidString } from './index2.js';
|
|
3
3
|
import { i as initLocales } from './index3.js';
|
|
4
|
-
import { d as defineCustomElement$
|
|
5
|
-
import { d as defineCustomElement$
|
|
6
|
-
import { d as defineCustomElement$
|
|
7
|
-
import { d as defineCustomElement$8 } from './mg-details2.js';
|
|
4
|
+
import { d as defineCustomElement$a } from './mg-button2.js';
|
|
5
|
+
import { d as defineCustomElement$9 } from './mg-card2.js';
|
|
6
|
+
import { d as defineCustomElement$8 } from './mg-character-left2.js';
|
|
8
7
|
import { d as defineCustomElement$7 } from './mg-icon2.js';
|
|
9
8
|
import { d as defineCustomElement$6 } from './mg-input2.js';
|
|
10
9
|
import { d as defineCustomElement$5 } from './mg-input-text2.js';
|
|
@@ -21,7 +20,7 @@ const expandToggleDisplays = ['text', 'icon'];
|
|
|
21
20
|
*/
|
|
22
21
|
const titlePositions = ['left', 'right'];
|
|
23
22
|
|
|
24
|
-
const mgPanelCss = "/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-
|
|
23
|
+
const mgPanelCss = "/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-panel-border-radius);--mg-c-card-color-background:var(--mg-c-panel-color-background);--mg-c-card-box-shadow:var(--mg-c-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 var(--mg-b-size-4)}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:var(--mg-b-size-4) 0}.mg-c-panel__header-content{min-height:var(--mg-b-size-min-height);flex:1 auto;align-items:center;padding-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--mg-b-font-size:var(--mg-b-font-size-h5);--mg-c-button-font-weight:600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-c-panel-content-spacing)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:var(--mg-b-spacing-actions)}.mg-c-panel ::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}";
|
|
25
24
|
|
|
26
25
|
const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLElement {
|
|
27
26
|
constructor() {
|
|
@@ -258,7 +257,7 @@ function defineCustomElement$1() {
|
|
|
258
257
|
if (typeof customElements === "undefined") {
|
|
259
258
|
return;
|
|
260
259
|
}
|
|
261
|
-
const components = ["mg-panel", "mg-button", "mg-card", "mg-character-left", "mg-
|
|
260
|
+
const components = ["mg-panel", "mg-button", "mg-card", "mg-character-left", "mg-icon", "mg-input", "mg-input-text", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
|
|
262
261
|
components.forEach(tagName => { switch (tagName) {
|
|
263
262
|
case "mg-panel":
|
|
264
263
|
if (!customElements.get(tagName)) {
|
|
@@ -266,21 +265,16 @@ function defineCustomElement$1() {
|
|
|
266
265
|
}
|
|
267
266
|
break;
|
|
268
267
|
case "mg-button":
|
|
269
|
-
if (!customElements.get(tagName)) {
|
|
270
|
-
defineCustomElement$b();
|
|
271
|
-
}
|
|
272
|
-
break;
|
|
273
|
-
case "mg-card":
|
|
274
268
|
if (!customElements.get(tagName)) {
|
|
275
269
|
defineCustomElement$a();
|
|
276
270
|
}
|
|
277
271
|
break;
|
|
278
|
-
case "mg-
|
|
272
|
+
case "mg-card":
|
|
279
273
|
if (!customElements.get(tagName)) {
|
|
280
274
|
defineCustomElement$9();
|
|
281
275
|
}
|
|
282
276
|
break;
|
|
283
|
-
case "mg-
|
|
277
|
+
case "mg-character-left":
|
|
284
278
|
if (!customElements.get(tagName)) {
|
|
285
279
|
defineCustomElement$8();
|
|
286
280
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard keys
|
|
3
|
+
*/
|
|
4
|
+
const Keys = {
|
|
5
|
+
TAB: 'Tab',
|
|
6
|
+
ENTER: 'Enter',
|
|
7
|
+
DOWN: 'Down',
|
|
8
|
+
UP: 'Up',
|
|
9
|
+
LEFT: 'Left',
|
|
10
|
+
RIGHT: 'Right',
|
|
11
|
+
ARROWDOWN: 'ArrowDown',
|
|
12
|
+
ARROWUP: 'ArrowUp',
|
|
13
|
+
ARROWRIGHT: 'ArrowRight',
|
|
14
|
+
ARROWLEFT: 'ArrowLeft',
|
|
15
|
+
HOME: 'Home',
|
|
16
|
+
END: 'End',
|
|
17
|
+
ESC: 'Esc',
|
|
18
|
+
ESCAPE: 'Escape',
|
|
19
|
+
NUMPADENTER: 'NumpadEnter',
|
|
20
|
+
SPACE: 'Space',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { Keys as K };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const errors$1 = {
|
|
2
|
-
required: "This field is required."
|
|
3
|
-
noValue: "No value."
|
|
2
|
+
required: "This field is required."
|
|
4
3
|
};
|
|
5
4
|
const nbCharLeft$1 = "{counter} characters left.";
|
|
6
5
|
const input$1 = {
|
|
@@ -117,8 +116,8 @@ const general$1 = {
|
|
|
117
116
|
confirm: "Confirm",
|
|
118
117
|
cancel: "Cancel",
|
|
119
118
|
close: "Close",
|
|
120
|
-
next: "
|
|
121
|
-
previous: "
|
|
119
|
+
next: "Next",
|
|
120
|
+
previous: "Previous",
|
|
122
121
|
reset: "reset"
|
|
123
122
|
};
|
|
124
123
|
const menuItem$1 = {
|
|
@@ -137,10 +136,6 @@ const loader$1 = {
|
|
|
137
136
|
const table$1 = {
|
|
138
137
|
sortableCaption: "(column headers with buttons are sortable)"
|
|
139
138
|
};
|
|
140
|
-
const details$1 = {
|
|
141
|
-
toggleClosed: "Show details",
|
|
142
|
-
toggleOpened: "Hide details"
|
|
143
|
-
};
|
|
144
139
|
var en = {
|
|
145
140
|
errors: errors$1,
|
|
146
141
|
nbCharLeft: nbCharLeft$1,
|
|
@@ -156,13 +151,11 @@ var en = {
|
|
|
156
151
|
itemMore: itemMore$1,
|
|
157
152
|
actionMore: actionMore$1,
|
|
158
153
|
loader: loader$1,
|
|
159
|
-
table: table$1
|
|
160
|
-
details: details$1
|
|
154
|
+
table: table$1
|
|
161
155
|
};
|
|
162
156
|
|
|
163
157
|
const errors = {
|
|
164
|
-
required: "Ce champ est obligatoire."
|
|
165
|
-
noValue: "Aucune valeur."
|
|
158
|
+
required: "Ce champ est obligatoire."
|
|
166
159
|
};
|
|
167
160
|
const nbCharLeft = "{counter} caractères disponibles.";
|
|
168
161
|
const input = {
|
|
@@ -279,8 +272,8 @@ const general = {
|
|
|
279
272
|
confirm: "Valider",
|
|
280
273
|
cancel: "Annuler",
|
|
281
274
|
close: "Fermer",
|
|
282
|
-
next: "
|
|
283
|
-
previous: "
|
|
275
|
+
next: "Suivant",
|
|
276
|
+
previous: "Précédent",
|
|
284
277
|
reset: "réinitialiser"
|
|
285
278
|
};
|
|
286
279
|
const menuItem = {
|
|
@@ -299,10 +292,6 @@ const loader = {
|
|
|
299
292
|
const table = {
|
|
300
293
|
sortableCaption: "(les en-têtes de colonnes avec des boutons peuvent être triés)"
|
|
301
294
|
};
|
|
302
|
-
const details = {
|
|
303
|
-
toggleClosed: "Voir le detail",
|
|
304
|
-
toggleOpened: "Masquer le detail"
|
|
305
|
-
};
|
|
306
295
|
var fr = {
|
|
307
296
|
errors: errors,
|
|
308
297
|
nbCharLeft: nbCharLeft,
|
|
@@ -318,8 +307,7 @@ var fr = {
|
|
|
318
307
|
itemMore: itemMore,
|
|
319
308
|
actionMore: actionMore,
|
|
320
309
|
loader: loader,
|
|
321
|
-
table: table
|
|
322
|
-
details: details
|
|
310
|
+
table: table
|
|
323
311
|
};
|
|
324
312
|
|
|
325
313
|
/**
|