@mgdis/mg-components 6.19.0 → 6.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1757 -80
- package/dist/cjs/{index-TUElr4Wv.js → index-CCsGMNyq.js} +46 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +735 -337
- package/dist/cjs/mg-alert.cjs.entry.js +17 -9
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
- package/dist/cjs/mg-input-combobox.cjs.entry.js +63 -29
- package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +30 -18
- package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
- package/dist/cjs/mg-loader.cjs.entry.js +8 -6
- package/dist/cjs/mg-progress.cjs.entry.js +19 -9
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +15 -11
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +12 -12
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +72 -84
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +11 -0
- package/dist/collection/locales/fr/messages.json +11 -0
- package/dist/components/events.utils.js +1 -23
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -408
- package/dist/components/index3.js +1 -476
- package/dist/components/mg-action-more.js +1 -254
- package/dist/components/mg-alert.js +1 -224
- package/dist/components/mg-badge.js +1 -6
- package/dist/components/mg-badge2.js +1 -113
- package/dist/components/mg-button.js +1 -6
- package/dist/components/mg-button2.js +1 -275
- package/dist/components/mg-card.js +1 -6
- package/dist/components/mg-card2.js +1 -92
- package/dist/components/mg-character-left.js +1 -6
- package/dist/components/mg-character-left2.js +1 -75
- package/dist/components/mg-details.js +1 -104
- package/dist/components/mg-divider.js +1 -6
- package/dist/components/mg-divider2.js +1 -49
- package/dist/components/mg-fieldset.js +1 -209
- package/dist/components/mg-form.js +1 -302
- package/dist/components/mg-icon.js +1 -6
- package/dist/components/mg-icon2.js +1 -188
- package/dist/components/mg-illustrated-message.js +1 -129
- package/dist/components/mg-input-checkbox-paginated.js +1 -6
- package/dist/components/mg-input-checkbox-paginated2.js +1 -135
- package/dist/components/mg-input-checkbox.js +1 -762
- package/dist/components/mg-input-combobox.js +1 -936
- package/dist/components/mg-input-date.js +1 -463
- package/dist/components/mg-input-file.d.ts +11 -0
- package/dist/components/mg-input-file.js +1 -0
- package/dist/components/mg-input-numeric.js +1 -592
- package/dist/components/mg-input-password.js +1 -360
- package/dist/components/mg-input-radio.js +1 -392
- package/dist/components/mg-input-rich-text-editor.js +1 -16797
- package/dist/components/mg-input-select.js +1 -6
- package/dist/components/mg-input-select2.js +1 -481
- package/dist/components/mg-input-text.js +1 -6
- package/dist/components/mg-input-text2.js +1 -514
- package/dist/components/mg-input-textarea.js +1 -412
- package/dist/components/mg-input-title.js +1 -6
- package/dist/components/mg-input-title2.js +1 -81
- package/dist/components/mg-input-toggle.js +1 -386
- package/dist/components/mg-input.conf.js +1 -0
- package/dist/components/mg-input.js +1 -6
- package/dist/components/mg-input2.js +1 -459
- package/dist/components/mg-item-more.js +1 -6
- package/dist/components/mg-item-more2.js +1 -505
- package/dist/components/mg-loader.js +1 -6
- package/dist/components/mg-loader2.js +1 -74
- package/dist/components/mg-menu-item.js +1 -6
- package/dist/components/mg-menu-item2.js +1 -485
- package/dist/components/mg-menu.js +1 -6
- package/dist/components/mg-message.js +1 -6
- package/dist/components/mg-message2.js +1 -146
- package/dist/components/mg-modal.js +1 -184
- package/dist/components/mg-pagination.js +1 -234
- package/dist/components/mg-panel.js +1 -350
- package/dist/components/mg-popover-content.js +1 -6
- package/dist/components/mg-popover-content2.js +1 -96
- package/dist/components/mg-popover.js +1 -6
- package/dist/components/mg-popover2.js +1 -312
- package/dist/components/mg-progress.js +1 -123
- package/dist/components/mg-skip-links.js +1 -78
- package/dist/components/mg-table.js +1 -319
- package/dist/components/mg-tabs.js +1 -6
- package/dist/components/mg-tabs2.js +1 -315
- package/dist/components/mg-tag.js +1 -133
- package/dist/components/mg-tooltip-content.js +1 -6
- package/dist/components/mg-tooltip-content2.js +1 -42
- package/dist/components/mg-tooltip.js +1 -6
- package/dist/components/mg-tooltip2.js +1 -421
- package/dist/components/popper.js +1 -1790
- package/dist/esm/{index-CNX6lq0x.js → index-D-uaxCxH.js} +46 -1
- package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1757 -80
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +735 -337
- package/dist/esm/mg-alert.entry.js +17 -9
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +24 -7
- package/dist/esm/mg-input-combobox.entry.js +63 -29
- package/dist/esm/mg-input-file.entry.js +382 -0
- package/dist/esm/mg-input-rich-text-editor.entry.js +30 -18
- package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
- package/dist/esm/mg-loader.entry.js +8 -6
- package/dist/esm/mg-progress.entry.js +19 -9
- package/dist/mg-components/locales/en/messages.json +11 -0
- package/dist/mg-components/locales/fr/messages.json +11 -0
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-d5a276eb.entry.js → p-08fa327b.entry.js} +1 -1
- package/dist/mg-components/p-4175dcbe.entry.js +1 -0
- package/dist/mg-components/p-6b57f249.entry.js +1 -0
- package/dist/mg-components/p-6b655830.entry.js +1 -0
- package/dist/mg-components/p-988c282e.entry.js +1 -0
- package/dist/mg-components/p-C9rmNQIL.js +1 -0
- package/dist/mg-components/p-D-uaxCxH.js +1 -0
- package/dist/mg-components/p-DFwaH2hS.js +2 -0
- package/dist/mg-components/p-a79b1f19.entry.js +1 -0
- package/dist/mg-components/{p-916dfb6d.entry.js → p-c3d116b9.entry.js} +1 -1
- package/dist/mg-components/p-dd1934f4.entry.js +1 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +4 -4
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +13 -16
- package/dist/types/components.d.ts +217 -18
- package/dist/types/stencil-public-runtime.d.ts +76 -12
- package/ide/intellij/web-types.json +373 -26
- package/ide/vscode/css-custom-data.json +12 -0
- package/ide/vscode/html-custom-data.json +341 -79
- package/package.json +22 -22
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
- package/dist/mg-components/p-016bd291.entry.js +0 -1
- package/dist/mg-components/p-186a6139.entry.js +0 -1
- package/dist/mg-components/p-66a1cb83.entry.js +0 -1
- package/dist/mg-components/p-6efd819f.entry.js +0 -1
- package/dist/mg-components/p-BluNKQ3L.js +0 -2
- package/dist/mg-components/p-CNX6lq0x.js +0 -1
- package/dist/mg-components/p-DDnrE1hD.js +0 -1
- package/dist/mg-components/p-d2c72f09.entry.js +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +0 -8
|
@@ -460,7 +460,7 @@ export class MgInputNumeric {
|
|
|
460
460
|
* @returns HTML Element
|
|
461
461
|
*/
|
|
462
462
|
render() {
|
|
463
|
-
return (h("mg-input", { key: '
|
|
463
|
+
return (h("mg-input", { key: 'b158c0ec7f43ee02bbdbb275c169876fcdff92ac', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
|
|
464
464
|
? this.readonlyValue && this.renderReadonly()
|
|
465
465
|
: [
|
|
466
466
|
h("input", { key: "input", type: "text", class: "mg-c-input__box mg-c-input__box--width", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
|
|
@@ -248,7 +248,7 @@ export class MgInputPassword {
|
|
|
248
248
|
* @returns HTML Element
|
|
249
249
|
*/
|
|
250
250
|
render() {
|
|
251
|
-
return (h("mg-input", { key: '
|
|
251
|
+
return (h("mg-input", { key: '403d92641197b3ad397a0db527944dba4137f83a', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value !== undefined && h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (h("span", { class: "mg-c-input__input-group" }, h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
252
252
|
if (el !== null)
|
|
253
253
|
this.input = el;
|
|
254
254
|
} }), h("mg-button", { label: this.messages.input.password[this.displayPassword ? 'hide' : 'display'], disabled: this.disabled, variant: "flat", class: "mg-c-input__append-button", "is-icon": true, onClick: this.toggleDisplayPassword, "aria-controls": this.identifier }, h("mg-icon", { class: "mg-c-input__input-icon", icon: this.displayPassword ? 'eye-slash' : 'eye' }))))));
|
|
@@ -284,7 +284,7 @@ export class MgInputRadio {
|
|
|
284
284
|
* @returns HTML Element
|
|
285
285
|
*/
|
|
286
286
|
render() {
|
|
287
|
-
return (h("mg-input", { key: '
|
|
287
|
+
return (h("mg-input", { key: '8d26edd50d44fbba4fee5fa6ef36aa3c455b1e5b', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("ul", { class: "mg-c-input__input-group-container", role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
|
|
288
288
|
if (el !== null)
|
|
289
289
|
this.inputs[index] = el;
|
|
290
290
|
} }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
|
|
@@ -166,10 +166,10 @@ export class MgInputRichTextEditor {
|
|
|
166
166
|
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.focus();
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* Get editor content
|
|
169
|
+
* Get editor content in HTML format
|
|
170
170
|
* @returns HTML content of the editor
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
getEditorHTML() {
|
|
173
173
|
return new Promise(resolve => {
|
|
174
174
|
requestAnimationFrame(() => {
|
|
175
175
|
resolve(this.editor.getSemanticHTML());
|
|
@@ -177,10 +177,10 @@ export class MgInputRichTextEditor {
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
* Get editor content
|
|
180
|
+
* Get editor content in plain text format
|
|
181
181
|
* @returns Plain text content of the editor
|
|
182
182
|
*/
|
|
183
|
-
async
|
|
183
|
+
async getEditorText() {
|
|
184
184
|
return new Promise(resolve => {
|
|
185
185
|
requestAnimationFrame(() => {
|
|
186
186
|
resolve(this.editor.getText());
|
|
@@ -317,7 +317,7 @@ export class MgInputRichTextEditor {
|
|
|
317
317
|
* @returns HTML mg-input Element
|
|
318
318
|
*/
|
|
319
319
|
render() {
|
|
320
|
-
return (h("mg-input", { key: '
|
|
320
|
+
return (h("mg-input", { key: '26e4f26987e66541a6b21c7888ed7acd4e4ccad6', identifier: this.identifier, class: this.classCollection.join(), label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, helpText: this.helpText, errorMessage: this.hasDisplayedError ? this.errorMessage : undefined }, this.readonly ? (h("div", { class: "mg-c-input__readonly-value", innerHTML: this.value })) : (h("div", { ref: el => {
|
|
321
321
|
this.wrapperElement = el;
|
|
322
322
|
}, id: this.identifier, class: "mg-c-input__wrapper" }, h("div", null)))));
|
|
323
323
|
}
|
|
@@ -325,12 +325,12 @@ export class MgInputRichTextEditor {
|
|
|
325
325
|
static get encapsulation() { return "shadow"; }
|
|
326
326
|
static get originalStyleUrls() {
|
|
327
327
|
return {
|
|
328
|
-
"$": ["
|
|
328
|
+
"$": ["../../../../../node_modules/quill/dist/quill.snow.css", "../../../../../node_modules/@mgdis/styles/dist/components/mg-input-rich-text-editor.css"]
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
331
|
static get styleUrls() {
|
|
332
332
|
return {
|
|
333
|
-
"$": ["
|
|
333
|
+
"$": ["../../../../../node_modules/quill/dist/quill.snow.css", "../../../../../node_modules/@mgdis/styles/dist/components/mg-input-rich-text-editor.css"]
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
static get properties() {
|
|
@@ -639,7 +639,7 @@ export class MgInputRichTextEditor {
|
|
|
639
639
|
"mutable": false,
|
|
640
640
|
"complexType": {
|
|
641
641
|
"original": "EditorOptionsType['modules']",
|
|
642
|
-
"resolved": "
|
|
642
|
+
"resolved": "string | unknown",
|
|
643
643
|
"references": {
|
|
644
644
|
"EditorOptionsType": {
|
|
645
645
|
"location": "import",
|
|
@@ -755,7 +755,7 @@ export class MgInputRichTextEditor {
|
|
|
755
755
|
"tags": []
|
|
756
756
|
}
|
|
757
757
|
},
|
|
758
|
-
"
|
|
758
|
+
"getEditorHTML": {
|
|
759
759
|
"complexType": {
|
|
760
760
|
"signature": "() => Promise<string>",
|
|
761
761
|
"parameters": [],
|
|
@@ -768,14 +768,14 @@ export class MgInputRichTextEditor {
|
|
|
768
768
|
"return": "Promise<string>"
|
|
769
769
|
},
|
|
770
770
|
"docs": {
|
|
771
|
-
"text": "Get editor content
|
|
771
|
+
"text": "Get editor content in HTML format",
|
|
772
772
|
"tags": [{
|
|
773
773
|
"name": "returns",
|
|
774
774
|
"text": "HTML content of the editor"
|
|
775
775
|
}]
|
|
776
776
|
}
|
|
777
777
|
},
|
|
778
|
-
"
|
|
778
|
+
"getEditorText": {
|
|
779
779
|
"complexType": {
|
|
780
780
|
"signature": "() => Promise<string>",
|
|
781
781
|
"parameters": [],
|
|
@@ -788,7 +788,7 @@ export class MgInputRichTextEditor {
|
|
|
788
788
|
"return": "Promise<string>"
|
|
789
789
|
},
|
|
790
790
|
"docs": {
|
|
791
|
-
"text": "Get editor content
|
|
791
|
+
"text": "Get editor content in plain text format",
|
|
792
792
|
"tags": [{
|
|
793
793
|
"name": "returns",
|
|
794
794
|
"text": "Plain text content of the editor"
|
|
@@ -372,7 +372,7 @@ export class MgInputSelect {
|
|
|
372
372
|
*/
|
|
373
373
|
render() {
|
|
374
374
|
const readonlyValue = this.getReadonlyValue();
|
|
375
|
-
return (h("mg-input", { key: '
|
|
375
|
+
return (h("mg-input", { key: 'e7857da9c724cb582217b944cb723308d7efedbe', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
376
376
|
if (el !== null)
|
|
377
377
|
this.input = el;
|
|
378
378
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -375,7 +375,7 @@ export class MgInputText {
|
|
|
375
375
|
* @returns HTML Element
|
|
376
376
|
*/
|
|
377
377
|
render() {
|
|
378
|
-
return (h("mg-input", { key: '
|
|
378
|
+
return (h("mg-input", { key: 'cefd22e81ad535ff0ffd99d274c5eb616110ddd6', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly
|
|
379
379
|
? this.value && this.renderReadonly()
|
|
380
380
|
: [
|
|
381
381
|
h("div", { key: "input", class: "mg-c-input__input-group-container", style: {
|
|
@@ -549,7 +549,7 @@ export class MgInputText {
|
|
|
549
549
|
"mutable": false,
|
|
550
550
|
"complexType": {
|
|
551
551
|
"original": "IconType",
|
|
552
|
-
"resolved": "\"
|
|
552
|
+
"resolved": "\"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"table\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
|
|
553
553
|
"references": {
|
|
554
554
|
"IconType": {
|
|
555
555
|
"location": "import",
|
|
@@ -284,7 +284,7 @@ export class MgInputTextarea {
|
|
|
284
284
|
* @returns HTML Element
|
|
285
285
|
*/
|
|
286
286
|
render() {
|
|
287
|
-
return (h("mg-input", { key: '
|
|
287
|
+
return (h("mg-input", { key: 'dc646a42eee0c10394666218521ebfc1ab79a789', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (h("div", { class: "mg-c-input__input-group-container" }, h("textarea", { class: {
|
|
288
288
|
'mg-c-input__box': true,
|
|
289
289
|
'mg-c-input__box--width': true,
|
|
290
290
|
'mg-c-input__box--resizable': this.resizable === 'both',
|
|
@@ -6,7 +6,7 @@ import { classDisabled, classReadonly } from "../mg-input/mg-input.conf";
|
|
|
6
6
|
* @param option - radio option
|
|
7
7
|
* @returns toggle option type is valid
|
|
8
8
|
*/
|
|
9
|
-
const isOption = (option) => typeof option === 'object' && typeof option.title === 'string'
|
|
9
|
+
const isOption = (option) => typeof option === 'object' && typeof option.title === 'string';
|
|
10
10
|
/**
|
|
11
11
|
* @slot item-1 - Left option toggle content
|
|
12
12
|
* @slot item-2 - Right option toggle content
|
|
@@ -56,10 +56,6 @@ export class MgInputToggle {
|
|
|
56
56
|
* Component classes
|
|
57
57
|
*/
|
|
58
58
|
this.classCollection = new ClassList(['mg-c-input--toggle']);
|
|
59
|
-
/**
|
|
60
|
-
* Checked internal value
|
|
61
|
-
*/
|
|
62
|
-
this.checked = false;
|
|
63
59
|
/**
|
|
64
60
|
* Set input error message
|
|
65
61
|
* @param errorMessage - errorMessage override
|
|
@@ -73,10 +69,11 @@ export class MgInputToggle {
|
|
|
73
69
|
}
|
|
74
70
|
};
|
|
75
71
|
/**
|
|
76
|
-
*
|
|
72
|
+
* Handle switch button to update value
|
|
77
73
|
*/
|
|
78
|
-
this.
|
|
79
|
-
|
|
74
|
+
this.handleSwitchButton = () => {
|
|
75
|
+
const currentOptionIndex = this.getCurrentOptionIndex(this.value);
|
|
76
|
+
this.value = this.options[currentOptionIndex === 0 ? 1 : 0].value;
|
|
80
77
|
};
|
|
81
78
|
/**
|
|
82
79
|
* Slots validation
|
|
@@ -114,24 +111,51 @@ export class MgInputToggle {
|
|
|
114
111
|
* @param checked - checked item
|
|
115
112
|
* @returns toggle value
|
|
116
113
|
*/
|
|
117
|
-
this.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
this.getCurrentOptionIndex = (value) => {
|
|
115
|
+
return this.options.findIndex(option => toString(option.value) === toString(value)) === 1 ? 1 : 0;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Check if value is checked
|
|
119
|
+
* @param value - toggle value
|
|
120
|
+
* @returns truthy if value is checked
|
|
121
|
+
*/
|
|
122
|
+
this.isChecked = (value) => {
|
|
123
|
+
return this.getCurrentOptionIndex(value) === 1;
|
|
125
124
|
};
|
|
126
125
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
watchValue(newValue, oldValue) {
|
|
127
|
+
// A "true" attribute can be represented by an empty string
|
|
128
|
+
// We need to convert it to a boolean true value
|
|
129
|
+
if (newValue === '') {
|
|
130
|
+
this.value = true;
|
|
131
|
+
// Return early to prevent infinite loop
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// https://stenciljs.com/docs/properties
|
|
135
|
+
// According to the Stencil documentation, when a prop is declared as `any`, boolean values can be bound as boolean attributes.
|
|
136
|
+
// However, depending on the integration context (e.g., Vue.js), they may also be interpreted as string attributes.
|
|
137
|
+
// To avoid incorrect type interpretation when a boolean is received as a string,
|
|
138
|
+
// we normalize the value and convert it to a proper boolean before internal use.
|
|
139
|
+
else if (['true', 'false'].includes(newValue) && this.options.every(option => typeof option.value === 'boolean')) {
|
|
140
|
+
this.value = newValue === 'true';
|
|
141
|
+
// Return early to prevent infinite loop
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (this.isChecked(newValue)) {
|
|
145
|
+
this.classCollection.add(this.classIsActive);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.classCollection.delete(this.classIsActive);
|
|
149
|
+
}
|
|
150
|
+
// when value is reassigned programmatically from previous `watchValue` call
|
|
151
|
+
// `oldValue` can be a string while `newValue` is boolean or vice versa
|
|
152
|
+
// so we need to compare them as strings to prevent infinite loop and unnecessary event emission
|
|
153
|
+
if (toString(newValue) !== toString(oldValue)) {
|
|
154
|
+
// Emit value-change event
|
|
155
|
+
this.valueChange.emit(newValue);
|
|
156
|
+
}
|
|
133
157
|
}
|
|
134
|
-
|
|
158
|
+
watchItems(newValue) {
|
|
135
159
|
if (typeof newValue === 'object' && this.items.length !== 2) {
|
|
136
160
|
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${toString(newValue)}.`);
|
|
137
161
|
}
|
|
@@ -144,7 +168,7 @@ export class MgInputToggle {
|
|
|
144
168
|
this.options = newValue;
|
|
145
169
|
}
|
|
146
170
|
else {
|
|
147
|
-
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type:
|
|
171
|
+
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleOption. Passed value: ${toString(newValue)}.`);
|
|
148
172
|
}
|
|
149
173
|
}
|
|
150
174
|
watchIsOnOff(newValue) {
|
|
@@ -177,15 +201,6 @@ export class MgInputToggle {
|
|
|
177
201
|
else
|
|
178
202
|
this.classCollection.delete(classDisabled);
|
|
179
203
|
}
|
|
180
|
-
handleChecked(newValue) {
|
|
181
|
-
// style
|
|
182
|
-
if (newValue)
|
|
183
|
-
this.classCollection.add(this.classIsActive);
|
|
184
|
-
else
|
|
185
|
-
this.classCollection.delete(this.classIsActive);
|
|
186
|
-
// update value
|
|
187
|
-
this.value = this.getCheckedItem(newValue).value;
|
|
188
|
-
}
|
|
189
204
|
/**
|
|
190
205
|
* Set focus on input.
|
|
191
206
|
*/
|
|
@@ -220,7 +235,6 @@ export class MgInputToggle {
|
|
|
220
235
|
async reset() {
|
|
221
236
|
if (!this.readonly) {
|
|
222
237
|
this.value = this.options[0].value;
|
|
223
|
-
this.setChecked();
|
|
224
238
|
// Use `Promise` as requested for stencil method
|
|
225
239
|
// Use `requestAnimationFrame` to ensure:
|
|
226
240
|
// - DOM is fully updated before validation
|
|
@@ -235,28 +249,6 @@ export class MgInputToggle {
|
|
|
235
249
|
});
|
|
236
250
|
}
|
|
237
251
|
}
|
|
238
|
-
/**
|
|
239
|
-
* set checked state
|
|
240
|
-
*/
|
|
241
|
-
setChecked() {
|
|
242
|
-
const optionTrueValueIndex = this.options.map(option => option.value).findIndex(value => value === true);
|
|
243
|
-
if ([0, 1].includes(optionTrueValueIndex)) {
|
|
244
|
-
// has "value" props type is not a boolean, it is bind/render as an attributes/props
|
|
245
|
-
// true props will be represent by "true" string so we convert it has boolean
|
|
246
|
-
// true attribute will be represent by "" string so we convert it has boolean
|
|
247
|
-
// https://stenciljs.com/docs/properties
|
|
248
|
-
if (['', 'true'].includes(this.value) && this.options.find(option => option.value) !== undefined) {
|
|
249
|
-
this.value = true;
|
|
250
|
-
}
|
|
251
|
-
// when options are boolean values and ordered as [true,false] instead [false,true]
|
|
252
|
-
// we need to reversed the checked value logic
|
|
253
|
-
const selectedValue = this.value === this.options[optionTrueValueIndex].value;
|
|
254
|
-
this.checked = optionTrueValueIndex === 0 ? !selectedValue : selectedValue;
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
this.checked = this.value === this.options[1].value;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
252
|
/*************
|
|
261
253
|
* Lifecycle *
|
|
262
254
|
*************/
|
|
@@ -264,13 +256,9 @@ export class MgInputToggle {
|
|
|
264
256
|
* Check if component props are well configured on init
|
|
265
257
|
*/
|
|
266
258
|
componentWillLoad() {
|
|
267
|
-
|
|
268
|
-
this.validateItems(this.items);
|
|
269
|
-
// Check slots
|
|
259
|
+
this.watchItems(this.items);
|
|
270
260
|
this.validateSlots();
|
|
271
|
-
|
|
272
|
-
this.setChecked();
|
|
273
|
-
// apply handler
|
|
261
|
+
this.watchValue(this.value);
|
|
274
262
|
this.watchIsIcon(this.isIcon);
|
|
275
263
|
this.watchIsOnOff(this.isOnOff);
|
|
276
264
|
this.watchReadonly(this.readonly);
|
|
@@ -281,8 +269,8 @@ export class MgInputToggle {
|
|
|
281
269
|
* @returns HTML Element
|
|
282
270
|
*/
|
|
283
271
|
render() {
|
|
284
|
-
const
|
|
285
|
-
return (h("mg-input", { key: '
|
|
272
|
+
const currentOption = this.options[this.getCurrentOptionIndex(this.value)];
|
|
273
|
+
return (h("mg-input", { key: '75a58e79ddd78a6a5656b6a3ef497087fbbb0638', 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 ? (currentOption && h("b", { class: "mg-c-input__readonly-value" }, currentOption.title)) : (h("button", { type: "button", role: "switch", "aria-checked": this.isChecked(this.value).toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.handleSwitchButton, ref: el => {
|
|
286
274
|
if (el !== null)
|
|
287
275
|
this.button = el;
|
|
288
276
|
} }, 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" }))))));
|
|
@@ -302,12 +290,18 @@ export class MgInputToggle {
|
|
|
302
290
|
static get properties() {
|
|
303
291
|
return {
|
|
304
292
|
"value": {
|
|
305
|
-
"type": "
|
|
293
|
+
"type": "unknown",
|
|
306
294
|
"mutable": true,
|
|
307
295
|
"complexType": {
|
|
308
|
-
"original": "
|
|
309
|
-
"resolved": "
|
|
310
|
-
"references": {
|
|
296
|
+
"original": "ToggleOption['value']",
|
|
297
|
+
"resolved": "unknown",
|
|
298
|
+
"references": {
|
|
299
|
+
"ToggleOption": {
|
|
300
|
+
"location": "import",
|
|
301
|
+
"path": "../../../../types",
|
|
302
|
+
"id": "src/types/index.ts::Option"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
311
305
|
},
|
|
312
306
|
"required": false,
|
|
313
307
|
"optional": false,
|
|
@@ -316,21 +310,19 @@ export class MgInputToggle {
|
|
|
316
310
|
"text": "Component value"
|
|
317
311
|
},
|
|
318
312
|
"getter": false,
|
|
319
|
-
"setter": false
|
|
320
|
-
"reflect": false,
|
|
321
|
-
"attribute": "value"
|
|
313
|
+
"setter": false
|
|
322
314
|
},
|
|
323
315
|
"items": {
|
|
324
316
|
"type": "unknown",
|
|
325
317
|
"mutable": false,
|
|
326
318
|
"complexType": {
|
|
327
|
-
"original": "string[] |
|
|
328
|
-
"resolved": "
|
|
319
|
+
"original": "string[] | ToggleOption[]",
|
|
320
|
+
"resolved": "Option[] | string[]",
|
|
329
321
|
"references": {
|
|
330
|
-
"
|
|
322
|
+
"ToggleOption": {
|
|
331
323
|
"location": "import",
|
|
332
|
-
"path": "
|
|
333
|
-
"id": "src/
|
|
324
|
+
"path": "../../../../types",
|
|
325
|
+
"id": "src/types/index.ts::Option"
|
|
334
326
|
}
|
|
335
327
|
}
|
|
336
328
|
},
|
|
@@ -592,8 +584,7 @@ export class MgInputToggle {
|
|
|
592
584
|
"classCollection": {},
|
|
593
585
|
"options": {},
|
|
594
586
|
"errorMessage": {},
|
|
595
|
-
"valid": {}
|
|
596
|
-
"checked": {}
|
|
587
|
+
"valid": {}
|
|
597
588
|
};
|
|
598
589
|
}
|
|
599
590
|
static get events() {
|
|
@@ -609,7 +600,7 @@ export class MgInputToggle {
|
|
|
609
600
|
},
|
|
610
601
|
"complexType": {
|
|
611
602
|
"original": "HTMLMgInputToggleElement['value']",
|
|
612
|
-
"resolved": "
|
|
603
|
+
"resolved": "unknown",
|
|
613
604
|
"references": {
|
|
614
605
|
"HTMLMgInputToggleElement": {
|
|
615
606
|
"location": "global",
|
|
@@ -707,10 +698,10 @@ export class MgInputToggle {
|
|
|
707
698
|
static get watchers() {
|
|
708
699
|
return [{
|
|
709
700
|
"propName": "value",
|
|
710
|
-
"methodName": "
|
|
701
|
+
"methodName": "watchValue"
|
|
711
702
|
}, {
|
|
712
703
|
"propName": "items",
|
|
713
|
-
"methodName": "
|
|
704
|
+
"methodName": "watchItems"
|
|
714
705
|
}, {
|
|
715
706
|
"propName": "isOnOff",
|
|
716
707
|
"methodName": "watchIsOnOff"
|
|
@@ -723,9 +714,6 @@ export class MgInputToggle {
|
|
|
723
714
|
}, {
|
|
724
715
|
"propName": "disabled",
|
|
725
716
|
"methodName": "watchDisabled"
|
|
726
|
-
}, {
|
|
727
|
-
"propName": "checked",
|
|
728
|
-
"methodName": "handleChecked"
|
|
729
717
|
}];
|
|
730
718
|
}
|
|
731
719
|
}
|
|
@@ -141,7 +141,7 @@ export class MgActionMore {
|
|
|
141
141
|
[`${this.classBase}__chevron--rotate`]: this.expanded === true,
|
|
142
142
|
} }, h("mg-icon", { icon: "chevron-down" })));
|
|
143
143
|
}
|
|
144
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: 'bef7d0e0c5a991f321ca930d65fa458873fc7564', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '4e47d1513749cc1ac15ef8febd2fb914e362bbee', class: this.classBase }, h("mg-popover", { key: 'ab6dfc93422f03b49a78d2896196aa6901841aef', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '921f17c4ede5f1783dc336429539b0b082902fdd', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: '19bf9e015cbd82d8dffc62269de735607ab4f2bb' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '56a43a5adebd31264742c0ef8905ccb0bd8fb581', slot: "content" }, h("mg-menu", { key: '70520957ac07a3190ef753ee435996af96dbc5b5', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
145
145
|
var _a, _b;
|
|
146
146
|
return isMgActionMoreDivider(item) ? (h("mg-divider", { class: "mg-c-action-more__divider", key: "divider", "full-width": true })) : (h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, target: item.target, href: item.href,
|
|
147
147
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -142,7 +142,7 @@ export class MgAlert {
|
|
|
142
142
|
* @returns HTML Element
|
|
143
143
|
*/
|
|
144
144
|
render() {
|
|
145
|
-
return (h("mg-message", { key: '
|
|
145
|
+
return (h("mg-message", { key: '6085a45d00c4762bae88d98e89f44c20d5f9b6c4', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '55491d1b41609883958680c14a2ddb8dd84a3bd4' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
|
|
146
146
|
}
|
|
147
147
|
static get is() { return "mg-alert"; }
|
|
148
148
|
static get encapsulation() { return "shadow"; }
|
|
@@ -53,7 +53,7 @@ export class MgDetails {
|
|
|
53
53
|
* @returns HTML Element
|
|
54
54
|
*/
|
|
55
55
|
render() {
|
|
56
|
-
return (h("details", { key: '
|
|
56
|
+
return (h("details", { key: '17840b16bee77489062320bd7a679d6e4765a6f6', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: 'be713c922be8c97cdfb803cd1a59a34de708fe5e' }, h("slot", { key: 'cebdbaee05189542496143208945ab1f685702ef', name: "summary" }), h("span", { key: '7a2ad4790c1a1b905e5fc65fc518c133139c0889', class: "mg-c-details__toggle" }, h("mg-icon", { key: '628862cb0c1768c44c07033f2148ed7979bdad2b', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'b2bb91aa70f91ea654d944d7f00c21d6ab0e3ebf', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '9432a42632e4c002d717a2851e372d6b40296c6f', class: "mg-c-details__details" }, h("slot", { key: '008041bac5a1c3bf5eb7a172537750e6fa38aabc', name: "details" }))));
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "mg-details"; }
|
|
59
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { ClassList, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
-
import { classReadonly } from "../inputs/mg-input/mg-input.conf";
|
|
3
|
+
import { classReadonly, isMgInputFile } from "../inputs/mg-input/mg-input.conf";
|
|
4
4
|
export class MgFieldset {
|
|
5
5
|
constructor() {
|
|
6
6
|
/**
|
|
@@ -44,7 +44,16 @@ export class MgFieldset {
|
|
|
44
44
|
// Set inputs readonly or disabled based on form configuration
|
|
45
45
|
// Othewise listen to events
|
|
46
46
|
this.mgInputs.forEach(input => {
|
|
47
|
-
|
|
47
|
+
// manage special display case for mg-input-file
|
|
48
|
+
if (input.nodeName === 'MG-INPUT-FILE') {
|
|
49
|
+
if (this.readonly) {
|
|
50
|
+
input.setAttribute('hidden', '');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
input.removeAttribute('hidden');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (this.readonly && !isMgInputFile(input)) {
|
|
48
57
|
input.readonly = true;
|
|
49
58
|
}
|
|
50
59
|
else if (this.disabled) {
|
|
@@ -124,7 +133,7 @@ export class MgFieldset {
|
|
|
124
133
|
* @returns HTML Element
|
|
125
134
|
*/
|
|
126
135
|
render() {
|
|
127
|
-
return (h("mg-input", { key: '
|
|
136
|
+
return (h("mg-input", { key: '31ccb9f783687845080fc7f184cc54b7343fab65', label: this.legend, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: !this.legendHide, labelHeading: this.legendHeading, labelBorderDisplay: this.legendHeading && this.legendBorderDisplay, labelHide: this.legendHide, inputsOnBottom: this.legendHeading !== undefined, tooltip: this.tooltip, tooltipPosition: 'label', helpText: this.helpText, errorMessage: !this.valid && isValidString(this.errorMessage) ? this.errorMessage : undefined }, h("span", { key: 'eedf1c66eaf88bee037c11b812844bb5a92175c1', class: "mg-c-input__input-group" }, h("slot", { key: 'a28f6759a63873ef4a228820b4310b42fcf1d3c7' }))));
|
|
128
137
|
}
|
|
129
138
|
static get is() { return "mg-fieldset"; }
|
|
130
139
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createID, ClassList, toString, isValideID } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { initLocales } from "../../../locales";
|
|
4
|
+
import { isMgInputFile } from "../inputs/mg-input/mg-input.conf";
|
|
4
5
|
import { requiredMessageStatus, roles } from "./mg-form.conf";
|
|
5
6
|
/**
|
|
6
7
|
* @slot - Form content
|
|
@@ -111,7 +112,16 @@ export class MgForm {
|
|
|
111
112
|
if (this.labelOnTop) {
|
|
112
113
|
input.labelOnTop = true;
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
// manage special display case for mg-input-file
|
|
116
|
+
if (input.nodeName === 'MG-INPUT-FILE') {
|
|
117
|
+
if (this.readonly) {
|
|
118
|
+
input.setAttribute('hidden', '');
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
input.removeAttribute('hidden');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (this.readonly && !isMgInputFile(input)) {
|
|
115
125
|
input.readonly = true;
|
|
116
126
|
}
|
|
117
127
|
else if (this.disabled) {
|
|
@@ -232,7 +242,7 @@ export class MgForm {
|
|
|
232
242
|
* @returns HTML Element
|
|
233
243
|
*/
|
|
234
244
|
render() {
|
|
235
|
-
return (h("form", { key: '
|
|
245
|
+
return (h("form", { key: 'b2e3d218d978f1194b2c461ab75cae7d491bc2c3', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: 'dd6db1a740f5fe525c3b652c2128aba6185970b8', innerHTML: this.requiredMessageText }), h("slot", { key: '5221d0c8fa5e30749c82d01490b402d9e46a63cd' }), !this.readonly && !this.disabled && h("slot", { key: 'fb2595b8c5df85b9cefac0f43e54e463d529fff4', name: "actions" })));
|
|
236
246
|
}
|
|
237
247
|
static get is() { return "mg-form"; }
|
|
238
248
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js
CHANGED
|
@@ -81,7 +81,7 @@ export class MgIllustratedMessage {
|
|
|
81
81
|
* @returns HTML Element
|
|
82
82
|
*/
|
|
83
83
|
render() {
|
|
84
|
-
return (h("div", { key: '
|
|
84
|
+
return (h("div", { key: 'f2bcf91e8d639736514a55a73d0182339eda1455', class: this.classCollection.join() }, h("div", { key: '46f862fc2a3daf2f217c55feebd41abb76252de2', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: 'e2a0e9752a6739a684fd2668a8e8f0f792a0c38b', name: "illustration" })), h("div", { key: 'b037dd43ae59c07ca122b68b56dc3230a7aa94f2', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '3a99f08cfb68bd51fbd015d213bb462acbfdda1a', name: "title" }), h("slot", { key: '14490ee1e7f9470f433c6249d502bd0a4dd77ca3', name: "details" }))));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "mg-illustrated-message"; }
|
|
87
87
|
static get encapsulation() { return "shadow"; }
|