@mgdis/mg-components 6.24.0 → 6.26.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-Acmyl4hv.js +5 -0
- package/dist/cjs/{index-BxB20_Vw.js → index-B6J2EllP.js} +3 -1
- package/dist/cjs/{index-BEF-cqV9.js → index-BmFwLEZT.js} +5 -1
- package/dist/cjs/{index-CpENFzEo.js → index-DrZECzp6.js} +14 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +452 -261
- package/dist/cjs/mg-alert.cjs.entry.js +7 -8
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +27 -10
- package/dist/cjs/mg-components.cjs.js +2 -2
- package/dist/cjs/mg-fieldset.cjs.entry.js +8 -8
- package/dist/cjs/mg-illustration.cjs.entry.js +57 -0
- package/dist/cjs/mg-input-combobox.cjs.entry.js +40 -23
- package/dist/cjs/mg-input-file.cjs.entry.js +12 -11
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2565 -4013
- package/dist/cjs/mg-loader.cjs.entry.js +5 -5
- package/dist/cjs/mg-progress.cjs.entry.js +3 -3
- package/dist/collection/assets/illustrations/index.js +1 -0
- package/dist/collection/assets/jodit/jodit.css +5821 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +4 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.conf.js +4 -0
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +62 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/atoms/mg-illustration/mg-illustration.conf.js +1 -0
- package/dist/collection/components/atoms/mg-illustration/mg-illustration.js +95 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -7
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +84 -19
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +5 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +30 -22
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +69 -25
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +14 -8
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +8 -7
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +21 -12
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +9 -8
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +15 -10
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.css +50 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +29 -3
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +262 -9
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -19
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +18 -13
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +7 -7
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -9
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +7 -5
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +18 -17
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +7 -4
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +6 -7
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +49 -6
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +6 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +16 -13
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +4 -0
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +51 -2
- 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-pagination/mg-pagination.js +8 -4
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +24 -37
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -3
- package/dist/collection/components/molecules/mg-table/mg-table.js +10 -6
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +12 -9
- package/dist/collection/utils/behaviors.utils.js +3 -3
- package/dist/collection/utils/playwright.fixture.js +7 -2
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-breadcrumb.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-fieldset.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-illustration.d.ts +11 -0
- package/dist/components/mg-illustration.js +1 -0
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +294 -284
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-input2.js +1 -1
- package/dist/components/mg-item-more2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-table.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/custom-elements.json +197 -48
- package/dist/esm/{index-C7xjtdiw.js → index-91BOpzAB.js} +14 -6
- package/dist/esm/{index-DSEloqPn.js → index-BfblyCaJ.js} +3 -1
- package/dist/esm/index-Ci9Hv7DG.js +3 -0
- package/dist/esm/{index-DshvCiTL.js → index-D4bO_UCn.js} +5 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +449 -258
- package/dist/esm/mg-alert.entry.js +7 -8
- package/dist/esm/mg-breadcrumb.entry.js +27 -10
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-fieldset.entry.js +8 -8
- package/dist/esm/mg-illustration.entry.js +55 -0
- package/dist/esm/mg-input-combobox.entry.js +40 -23
- package/dist/esm/mg-input-file.entry.js +12 -11
- package/dist/esm/mg-input-rich-text-editor.entry.js +2550 -3998
- package/dist/esm/mg-loader.entry.js +5 -5
- package/dist/esm/mg-progress.entry.js +3 -3
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-206505b5.entry.js +1667 -0
- package/dist/mg-components/{p-cdb01923.entry.js → p-3ad7441c.entry.js} +1 -1
- package/dist/mg-components/p-413b4536.entry.js +1 -0
- package/dist/mg-components/p-5dff879a.entry.js +1 -0
- package/dist/mg-components/{p-08d3d957.entry.js → p-96fc508e.entry.js} +1 -1
- package/dist/mg-components/p-Ci9Hv7DG.js +1 -0
- package/dist/mg-components/p-D4bO_UCn.js +2 -0
- package/dist/mg-components/{p-d0b6d8f5.entry.js → p-ad533d08.entry.js} +1 -1
- package/dist/mg-components/p-b20f3698.entry.js +1 -0
- package/dist/mg-components/p-bf2252c9.entry.js +1 -0
- package/dist/mg-components/p-d0d12800.entry.js +1 -0
- package/dist/mg-components/p-f8e58181.entry.js +1 -0
- package/dist/types/assets/illustrations/index.d.ts +21 -0
- package/dist/types/components/atoms/mg-divider/mg-divider.conf.d.ts +9 -0
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +13 -0
- package/dist/types/components/atoms/mg-illustration/mg-illustration.conf.d.ts +5 -0
- package/dist/types/components/atoms/mg-illustration/mg-illustration.d.ts +24 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +19 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +10 -5
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +25 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +61 -2
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -2
- package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +2 -2
- package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +2 -2
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +11 -0
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +8 -0
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +9 -1
- package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -3
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -1
- package/dist/types/components.d.ts +158 -42
- package/ide/intellij/web-types.json +145 -65
- package/ide/vscode/css-custom-data.json +6 -2
- package/ide/vscode/html-custom-data.json +216 -33
- package/package.json +22 -22
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +0 -212
- package/dist/mg-components/p-13feb37a.entry.js +0 -1
- package/dist/mg-components/p-7c63e469.entry.js +0 -1
- package/dist/mg-components/p-7fd3e519.entry.js +0 -1
- package/dist/mg-components/p-9953b835.entry.js +0 -1
- package/dist/mg-components/p-9c0a9fc7.entry.js +0 -1657
- package/dist/mg-components/p-DshvCiTL.js +0 -2
- package/dist/mg-components/p-a338088e.entry.js +0 -1
- /package/dist/mg-components/{p-C7xjtdiw.js → p-91BOpzAB.js} +0 -0
- /package/dist/mg-components/{p-DSEloqPn.js → p-BfblyCaJ.js} +0 -0
|
@@ -54,17 +54,20 @@ export class MgForm {
|
|
|
54
54
|
}
|
|
55
55
|
// If the form is disabled or readonly none of them are required
|
|
56
56
|
// Check if all fields are not editable (readonly or disabled)
|
|
57
|
-
const isEditable = input => !(input.disabled || input.readonly);
|
|
58
|
-
const isMgInputToggle = input => input.nodeName === 'MG-INPUT-TOGGLE';
|
|
59
|
-
if (!this.disabled &&
|
|
57
|
+
const isEditable = (input) => !(input.disabled || input.readonly);
|
|
58
|
+
const isMgInputToggle = (input) => input.nodeName === 'MG-INPUT-TOGGLE';
|
|
59
|
+
if (!this.disabled &&
|
|
60
|
+
!this.readonly &&
|
|
61
|
+
this.mgInputs.some((input) => isEditable(input) && !isMgInputToggle(input))) {
|
|
60
62
|
// Get editable inputs
|
|
61
63
|
const editableInputs = this.mgInputs.filter(isEditable);
|
|
62
64
|
// Get required inputs
|
|
63
65
|
// mg-input-toggle can not be required
|
|
64
|
-
const requiredInputs = editableInputs.filter(input => !isMgInputToggle(input) && input.required);
|
|
66
|
+
const requiredInputs = editableInputs.filter((input) => !isMgInputToggle(input) && input.required);
|
|
65
67
|
// All inputs are required
|
|
66
|
-
if ([requiredInputs.length, editableInputs.length].every(length => length === 1) ||
|
|
67
|
-
(requiredInputs.length > 1 &&
|
|
68
|
+
if ([requiredInputs.length, editableInputs.length].every((length) => length === 1) ||
|
|
69
|
+
(requiredInputs.length > 1 &&
|
|
70
|
+
requiredInputs.length === editableInputs.filter((input) => !isMgInputToggle(input)).length)) {
|
|
68
71
|
this.requiredMessageText = this.getRequiredMessageBasedOnCount(requiredInputs, 'allRequiredSingle', 'allRequired');
|
|
69
72
|
this.classCollection.add(this.classAllRequired);
|
|
70
73
|
}
|
|
@@ -88,7 +91,7 @@ export class MgForm {
|
|
|
88
91
|
this.checkValidity = () => {
|
|
89
92
|
// Update required on input event
|
|
90
93
|
this.setRequiredMessage();
|
|
91
|
-
this.valid = !this.mgInputs.some(input => input.invalid);
|
|
94
|
+
this.valid = !this.mgInputs.some((input) => input.invalid);
|
|
92
95
|
this.invalid = !this.valid;
|
|
93
96
|
// We need to send valid event if it is the same value
|
|
94
97
|
this.formValid.emit(this.valid);
|
|
@@ -109,7 +112,7 @@ export class MgForm {
|
|
|
109
112
|
this.mgInputs = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT'));
|
|
110
113
|
// Set inputs readonly or disabled based on form configuration
|
|
111
114
|
// Othewise listen to events
|
|
112
|
-
this.mgInputs.forEach(input => {
|
|
115
|
+
this.mgInputs.forEach((input) => {
|
|
113
116
|
if (this.labelOnTop) {
|
|
114
117
|
input.labelOnTop = true;
|
|
115
118
|
}
|
|
@@ -167,7 +170,7 @@ export class MgForm {
|
|
|
167
170
|
async displayError() {
|
|
168
171
|
if (!this.readonly) {
|
|
169
172
|
const mgFieldsets = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-FIELDSET'));
|
|
170
|
-
[...mgFieldsets, ...this.mgInputs].forEach(input => {
|
|
173
|
+
[...mgFieldsets, ...this.mgInputs].forEach((input) => {
|
|
171
174
|
var _a;
|
|
172
175
|
(_a = input.displayError) === null || _a === void 0 ? void 0 : _a.call(input);
|
|
173
176
|
});
|
|
@@ -205,7 +208,7 @@ export class MgForm {
|
|
|
205
208
|
// Get slotted mgButtons
|
|
206
209
|
this.mgButtons = Array.from(this.element.querySelectorAll('mg-button'));
|
|
207
210
|
// Set button form identifier
|
|
208
|
-
this.mgButtons.forEach(mgButton => {
|
|
211
|
+
this.mgButtons.forEach((mgButton) => {
|
|
209
212
|
mgButton.setAttribute('form', this.identifier);
|
|
210
213
|
if (mgButton.type === 'reset') {
|
|
211
214
|
mgButton.addEventListener('click', () => {
|
|
@@ -232,8 +235,8 @@ export class MgForm {
|
|
|
232
235
|
componentDidLoad() {
|
|
233
236
|
// Update mgInputs when mgForm content change
|
|
234
237
|
const observerOptions = { childList: true, subtree: true };
|
|
235
|
-
new MutationObserver(mutations => {
|
|
236
|
-
if (mutations.some(mutation => Object.keys(observerOptions).includes(mutation.type))) {
|
|
238
|
+
new MutationObserver((mutations) => {
|
|
239
|
+
if (mutations.some((mutation) => Object.keys(observerOptions).includes(mutation.type))) {
|
|
237
240
|
this.setMgInputs();
|
|
238
241
|
this.checkValidity();
|
|
239
242
|
}
|
|
@@ -244,7 +247,7 @@ export class MgForm {
|
|
|
244
247
|
* @returns HTML Element
|
|
245
248
|
*/
|
|
246
249
|
render() {
|
|
247
|
-
return (h("form", { key: '
|
|
250
|
+
return (h("form", { key: '65d3e11931386af2dedd953f58505e2c71cd99ff', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '7546db3b8a4259fd7d092cc7b912b6593fab9d84', innerHTML: this.requiredMessageText }), h("slot", { key: '0023ed360230ea97395a249b230e02bb7a4bdbda' }), !this.readonly && !this.disabled && h("slot", { key: 'de84e088ff029eff487be1ed8b4766425c558c29', name: "actions" })));
|
|
248
251
|
}
|
|
249
252
|
static get is() { return "mg-form"; }
|
|
250
253
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { ClassList, isTagName, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
-
import { directions, sizes } from "./mg-illustrated-message.conf";
|
|
3
|
+
import { aligns, directions, sizes, } from "./mg-illustrated-message.conf";
|
|
4
4
|
/**
|
|
5
5
|
* @slot illustration - Illustration content
|
|
6
6
|
* @slot title - Title content
|
|
@@ -16,6 +16,13 @@ export class MgIllustratedMessage {
|
|
|
16
16
|
* Define component orientation
|
|
17
17
|
*/
|
|
18
18
|
this.direction = 'vertical';
|
|
19
|
+
/**
|
|
20
|
+
* Define the horizontal alignment of the message inside its container.
|
|
21
|
+
* The message is sized to its content, so `align` positions it in both the vertical and
|
|
22
|
+
* horizontal directions. When the content is wide enough to fill the container there is
|
|
23
|
+
* no room left, so `align` has no visible effect.
|
|
24
|
+
*/
|
|
25
|
+
this.align = 'center';
|
|
19
26
|
/**
|
|
20
27
|
* Component classes
|
|
21
28
|
*/
|
|
@@ -43,6 +50,17 @@ export class MgIllustratedMessage {
|
|
|
43
50
|
this.classCollection.delete('mg-c-illustrated-message--direction-horizontal');
|
|
44
51
|
}
|
|
45
52
|
}
|
|
53
|
+
watchAlign(newValue, oldValue) {
|
|
54
|
+
if (!aligns.includes(newValue)) {
|
|
55
|
+
throw new Error(`<mg-illustrated-message> prop "align" must be one of: ${aligns.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
if (oldValue !== undefined) {
|
|
59
|
+
this.classCollection.delete(`mg-c-illustrated-message--align-${oldValue}`);
|
|
60
|
+
}
|
|
61
|
+
this.classCollection.add(`mg-c-illustrated-message--align-${newValue}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
46
64
|
/***********
|
|
47
65
|
* Methods *
|
|
48
66
|
***********/
|
|
@@ -74,6 +92,7 @@ export class MgIllustratedMessage {
|
|
|
74
92
|
componentWillLoad() {
|
|
75
93
|
this.watchDirection(this.direction);
|
|
76
94
|
this.watchSize(this.size);
|
|
95
|
+
this.watchAlign(this.align);
|
|
77
96
|
this.validateSlots();
|
|
78
97
|
}
|
|
79
98
|
/**
|
|
@@ -81,7 +100,7 @@ export class MgIllustratedMessage {
|
|
|
81
100
|
* @returns HTML Element
|
|
82
101
|
*/
|
|
83
102
|
render() {
|
|
84
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'daffbfe09d4ccae7b2380d2dcd0f6157acf7a849', class: this.classCollection.join() }, h("div", { key: '503631e106a43186d1031ebfd8bb5fa9e7aaa568', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '6291af5e6155e38e3cfb63acf3ca774e22d385f6', name: "illustration" })), h("div", { key: '7c7518be3413c7e9cadb149a255505d20525b6c7', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '742dc8a06f3f7ab06e4e67b370a750100585c384', name: "title" }), h("slot", { key: '3da2b7d35d1076d4cb87337f9a21e149c72f9141', name: "details" }))));
|
|
85
104
|
}
|
|
86
105
|
static get is() { return "mg-illustrated-message"; }
|
|
87
106
|
static get encapsulation() { return "shadow"; }
|
|
@@ -150,6 +169,33 @@ export class MgIllustratedMessage {
|
|
|
150
169
|
"reflect": false,
|
|
151
170
|
"attribute": "direction",
|
|
152
171
|
"defaultValue": "'vertical'"
|
|
172
|
+
},
|
|
173
|
+
"align": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "IllustratedMessageAlignType",
|
|
178
|
+
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
179
|
+
"references": {
|
|
180
|
+
"IllustratedMessageAlignType": {
|
|
181
|
+
"location": "import",
|
|
182
|
+
"path": "./mg-illustrated-message.conf",
|
|
183
|
+
"id": "src/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.ts::IllustratedMessageAlignType",
|
|
184
|
+
"referenceLocation": "IllustratedMessageAlignType"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": false,
|
|
189
|
+
"optional": false,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Define the horizontal alignment of the message inside its container.\nThe message is sized to its content, so `align` positions it in both the vertical and\nhorizontal directions. When the content is wide enough to fill the container there is\nno room left, so `align` has no visible effect."
|
|
193
|
+
},
|
|
194
|
+
"getter": false,
|
|
195
|
+
"setter": false,
|
|
196
|
+
"reflect": false,
|
|
197
|
+
"attribute": "align",
|
|
198
|
+
"defaultValue": "'center'"
|
|
153
199
|
}
|
|
154
200
|
};
|
|
155
201
|
}
|
|
@@ -166,6 +212,9 @@ export class MgIllustratedMessage {
|
|
|
166
212
|
}, {
|
|
167
213
|
"propName": "direction",
|
|
168
214
|
"methodName": "watchDirection"
|
|
215
|
+
}, {
|
|
216
|
+
"propName": "align",
|
|
217
|
+
"methodName": "watchAlign"
|
|
169
218
|
}];
|
|
170
219
|
}
|
|
171
220
|
}
|
|
@@ -29,7 +29,7 @@ export class MgLoader {
|
|
|
29
29
|
* @returns HTML Element
|
|
30
30
|
*/
|
|
31
31
|
render() {
|
|
32
|
-
return (h("div", { key: '
|
|
32
|
+
return (h("div", { key: 'a2e3880baccec9691a9fd6abbdb9e01d452136aa', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '044153b87e799f1f51cb3c9c6236bf6b8b328cf5', icon: "loader", spin: true }), h("span", { key: '5e4293bd33bd2a51b7557ebf26037991e4fc853e', class: { 'mg-u-visually-hidden': this.messageHide } }, this.message || this.messages.loader.inProgress)));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "mg-loader"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,9 +100,9 @@ export class MgMessage {
|
|
|
100
100
|
* @returns HTML Element
|
|
101
101
|
*/
|
|
102
102
|
render() {
|
|
103
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'a182451917bfe33de32c893d9eeedd52b11f8b15', class: this.classCollection.join() }, h("mg-card", { key: '9dd0da031d97f669e885a1681b72e5a086e79c0b', shadow: this.variantStyle !== 'background' }, h("span", { key: '158c2470a10ab9d677e2031c28ad0d43c09e4cf2', class: "mg-c-message__icon" }, h("mg-icon", { key: 'f7d0cb02781d2bf5a71fbd7f9498ebf4dca31edf', icon: this.getIcon() })), h("div", { key: '56a7299983c30ea4527bb19a46ac0677b6e8c40e', class: "mg-c-message__content" }, h("span", { key: '744ad763177f92bdbac37d43a5a58f221ff97e69', class: "mg-c-message__content-slot" }, h("slot", { key: '14b7f22e206bd074336287809574b2a5abfe5bf5' })), this.hasActions && [
|
|
104
104
|
h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
|
|
105
|
-
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '
|
|
105
|
+
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '104be326f73ded002cba9a471491ca614227e3d5', name: "actions" })),
|
|
106
106
|
]))));
|
|
107
107
|
}
|
|
108
108
|
static get is() { return "mg-message"; }
|
|
@@ -106,11 +106,11 @@ export class MgModal {
|
|
|
106
106
|
* @returns HTML Element
|
|
107
107
|
*/
|
|
108
108
|
render() {
|
|
109
|
-
return (h("dialog", { key: '
|
|
109
|
+
return (h("dialog", { key: '3b802b99d96be80d8071c89be6537269866e6fff', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
|
|
110
110
|
if (el !== null) {
|
|
111
111
|
this.dialog = el;
|
|
112
112
|
}
|
|
113
|
-
} }, h("mg-card", { key: '
|
|
113
|
+
} }, h("mg-card", { key: '4985b4af69968577ffd36a6a2b1f96274703d146', shadow: true }, h("div", { key: 'c4aed6d29dc5ee00f323dcbaecff9532f370ec98', class: "mg-c-modal__dialog" }, h("header", { key: '3bfeb66d59144c0cba3fd82c1fb4dee2ed62cea7', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: '55205da6c8991444ff53da7224b28c7475b0e173', class: "mg-c-modal__close-button" }, h("mg-button", { key: 'da7fdea3a124a559cb637beea9d5565c1f777eea', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '77c2ab2bcacdda9fa179b480651507a1d6584686', icon: "cross" })))), h("h1", { key: 'cedb5efc709de2d18e81409139da790349a48bb8', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '7f24e65244836c08dbf7465f8c80970080003bcd', class: "mg-c-modal__content" }, h("slot", { key: '36d7c2a0ef1bb1024887da08298391962285bbf8' })), this.hasActions && (h("footer", { key: '5967d650e4e58726641a3c960d82aa7ee588e38f', class: "mg-c-modal__footer" }, h("slot", { key: 'c275b8235acb658ded3db7c69b931000a5ff14d2', name: "actions" })))))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "mg-modal"; }
|
|
116
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,7 +23,7 @@ import { initLocales } from "./../../../locales";
|
|
|
23
23
|
* @param step - step size
|
|
24
24
|
* @returns range numbers
|
|
25
25
|
*/
|
|
26
|
-
const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map(x => start + x * step);
|
|
26
|
+
const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map((x) => start + x * step);
|
|
27
27
|
export class MgPagination {
|
|
28
28
|
constructor() {
|
|
29
29
|
/**
|
|
@@ -71,7 +71,9 @@ export class MgPagination {
|
|
|
71
71
|
* @param disabled - button disable state
|
|
72
72
|
*/
|
|
73
73
|
this.handleGoToPage = (action, disabled) => {
|
|
74
|
-
!disabled
|
|
74
|
+
if (!disabled) {
|
|
75
|
+
this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
76
|
+
}
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
watchIdentifier(newValue) {
|
|
@@ -94,7 +96,9 @@ export class MgPagination {
|
|
|
94
96
|
this.currentPageChange.emit(newValue);
|
|
95
97
|
}
|
|
96
98
|
watchPaginationMessages(newValue) {
|
|
97
|
-
if (Boolean(newValue) &&
|
|
99
|
+
if (Boolean(newValue) &&
|
|
100
|
+
(typeof newValue !== 'object' ||
|
|
101
|
+
!['next', 'previous', 'nextLabel', 'previousLabel'].every((key) => isValidString(newValue[key])))) {
|
|
98
102
|
throw new Error('<mg-pagination> prop "messages" must be a valid "PaginationMessagesType".');
|
|
99
103
|
}
|
|
100
104
|
}
|
|
@@ -134,7 +138,7 @@ export class MgPagination {
|
|
|
134
138
|
// eslint-disable-next-line react/jsx-no-bind
|
|
135
139
|
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && navigationMessages[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
|
|
136
140
|
};
|
|
137
|
-
return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("div", { class: "mg-c-pagination__page-count" }, h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.localesMessages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "mg-u-visually-hidden" }, this.localesMessages.pagination.page, " ", this.currentPage), "/ ", this.totalPages,
|
|
141
|
+
return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("div", { class: "mg-c-pagination__page-count" }, h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map((page) => page.toString()), label: this.localesMessages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("p", { class: "mg-c-pagination__page-count-text" }, h("span", { class: "mg-u-visually-hidden" }, this.localesMessages.pagination.page, " ", this.currentPage), "/ ", this.totalPages, ' ', this.totalPages > 1 ? this.localesMessages.pagination.pages : this.localesMessages.pagination.page))), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
|
|
138
142
|
}
|
|
139
143
|
static get is() { return "mg-pagination"; }
|
|
140
144
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { ClassList, createID, isValidString, isValideID, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
|
|
4
4
|
import { initLocales } from "../../../locales";
|
|
5
|
-
import { expandToggleDisplays, titlePositions } from "./mg-panel.conf";
|
|
5
|
+
import { expandToggleDisplays, titlePositions, } from "./mg-panel.conf";
|
|
6
6
|
/**
|
|
7
7
|
* @slot - Panel content
|
|
8
8
|
* @slot panel-title - Panel title content (replaces panel-title prop when used)
|
|
@@ -110,7 +110,12 @@ export class MgPanel {
|
|
|
110
110
|
* Render collapse button
|
|
111
111
|
* @returns collpase button
|
|
112
112
|
*/
|
|
113
|
-
this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.expandToggleDisplay === 'icon' ? this.panelTitle : undefined }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: {
|
|
113
|
+
this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.expandToggleDisplay === 'icon' ? this.panelTitle : undefined }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: {
|
|
114
|
+
'mg-c-panel__collapse-button-icon': true,
|
|
115
|
+
'mg-c-panel__collapse-button-icon--reverse': !this.expanded,
|
|
116
|
+
} }), !this.isEditing &&
|
|
117
|
+
this.expandToggleDisplay !== 'icon' &&
|
|
118
|
+
(this.hasPanelTitleSlot() ? h("slot", { name: "panel-title" }) : this.panelTitle))));
|
|
114
119
|
/**
|
|
115
120
|
* Render edit button
|
|
116
121
|
* @returns edit Button
|
|
@@ -142,7 +147,11 @@ export class MgPanel {
|
|
|
142
147
|
*/
|
|
143
148
|
this.renderHeaderChildren = () => {
|
|
144
149
|
const children = [
|
|
145
|
-
h("div", { class: {
|
|
150
|
+
h("div", { class: {
|
|
151
|
+
'mg-c-panel__header-title': true,
|
|
152
|
+
'mg-c-panel__header-title--full': this.isEditing,
|
|
153
|
+
'mg-c-panel__header-title--reverse': this.titlePosition === 'right',
|
|
154
|
+
}, key: this.panelTitle }, this.renderTitle()),
|
|
146
155
|
h("div", { class: "mg-c-panel__header-content", key: "slot-header" }, h("slot", { name: "header-right" })),
|
|
147
156
|
];
|
|
148
157
|
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
@@ -236,7 +245,7 @@ export class MgPanel {
|
|
|
236
245
|
*/
|
|
237
246
|
render() {
|
|
238
247
|
const headerId = `${this.identifier}-header`;
|
|
239
|
-
return (h("section", { key: '
|
|
248
|
+
return (h("section", { key: '33e6da36cbb92f19bcd957de7758c1a13ced5e83', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: 'df278e46b4604d8c5dce2abeffb2e979b02f34e9', shadow: this.shadow }, h("header", { key: 'b68012115af4bb5b62b6357fc07cbf50876ac08f', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: '3dfec67e6531fc0dff866e102ac36bd6c6a48834', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '56c63dd0b0e98968594ff713c2c6ee2a3269b74b' })))));
|
|
240
249
|
}
|
|
241
250
|
static get is() { return "mg-panel"; }
|
|
242
251
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js
CHANGED
|
@@ -46,7 +46,7 @@ export class MgPopoverContent {
|
|
|
46
46
|
* @returns HTML Element
|
|
47
47
|
*/
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '7035d8f560b811596c9c641abc7fe28ee9fdf3a2' }, h("mg-card", { key: 'badc81425100283dac69cad111514d8c3edfba45', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'cb20d8c7db741051b532c3b1653d578df859f0d0', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '389dc26f4cfdbb899b2b9eb4b27ceb6369209b2f', icon: "cross" }))), h("div", { key: '29b6721af3b6e06760affd6565e740bbc667f457', class: "mg-c-popover-content__title" }, h("slot", { key: '5834364d298a4e65a9170f003d0ec1f5e8868c4a', name: "title" })), h("slot", { key: '8398f497064fe097151ca263225349a9d84d4f36', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "mg-popover-content"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -98,7 +98,7 @@ export class MgPopoverContent {
|
|
|
98
98
|
"composed": true,
|
|
99
99
|
"docs": {
|
|
100
100
|
"tags": [],
|
|
101
|
-
"text": "
|
|
101
|
+
"text": "Emitted event when close button is clicked"
|
|
102
102
|
},
|
|
103
103
|
"complexType": {
|
|
104
104
|
"original": "void",
|
|
@@ -16,11 +16,7 @@ export class MgPopover {
|
|
|
16
16
|
/**
|
|
17
17
|
* Popover placement
|
|
18
18
|
*/
|
|
19
|
-
this.placement = 'bottom';
|
|
20
|
-
/**
|
|
21
|
-
* Hide popover arrow
|
|
22
|
-
*/
|
|
23
|
-
this.arrowHide = false;
|
|
19
|
+
this.placement = 'bottom-start';
|
|
24
20
|
/**
|
|
25
21
|
* Define if popover has a cross button
|
|
26
22
|
*/
|
|
@@ -45,7 +41,8 @@ export class MgPopover {
|
|
|
45
41
|
// retargeted to the outer shadow host and `closest()` cannot reach the popover
|
|
46
42
|
// nor the `data-mg-popover-guard` element.
|
|
47
43
|
const path = event.composedPath();
|
|
48
|
-
const isInside = path.includes(this.element) ||
|
|
44
|
+
const isInside = path.includes(this.element) ||
|
|
45
|
+
path.some((node) => node instanceof HTMLElement && node.dataset.mgPopoverGuard === this.identifier);
|
|
49
46
|
if (!this.disabled && !isInside) {
|
|
50
47
|
this.display = false;
|
|
51
48
|
}
|
|
@@ -84,7 +81,7 @@ export class MgPopover {
|
|
|
84
81
|
* @param newValue - if true enable popper listners
|
|
85
82
|
*/
|
|
86
83
|
this.setPopperListeners = (newValue) => {
|
|
87
|
-
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: newValue }] })));
|
|
84
|
+
this.popper.setOptions((options) => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: newValue }] })));
|
|
88
85
|
};
|
|
89
86
|
/**
|
|
90
87
|
* Manage all clickOustside listeners
|
|
@@ -121,13 +118,9 @@ export class MgPopover {
|
|
|
121
118
|
this.mgPopoverContent.setAttribute('slot', 'content');
|
|
122
119
|
this.mgPopoverContent.setAttribute('id', this.identifier);
|
|
123
120
|
this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
|
|
124
|
-
const arrow = document.createElement('div');
|
|
125
|
-
arrow.setAttribute('slot', 'arrow');
|
|
126
|
-
arrow.dataset.popperArrow = '';
|
|
127
|
-
this.mgPopoverContent.appendChild(arrow);
|
|
128
121
|
// insert elements in DOM
|
|
129
|
-
['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
|
|
130
|
-
Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
|
|
122
|
+
['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach((slotType) => {
|
|
123
|
+
Array.from(this.element.querySelectorAll(slotType)).forEach((slot) => {
|
|
131
124
|
this.mgPopoverContent.appendChild(slot);
|
|
132
125
|
});
|
|
133
126
|
});
|
|
@@ -145,12 +138,6 @@ export class MgPopover {
|
|
|
145
138
|
// use renderPopoverContent to update popover-content id
|
|
146
139
|
this.renderPopoverContent();
|
|
147
140
|
}
|
|
148
|
-
validateArrowHide(newValue) {
|
|
149
|
-
if (newValue)
|
|
150
|
-
this.mgPopoverContent.dataset.arrowHide = '';
|
|
151
|
-
else
|
|
152
|
-
delete this.mgPopoverContent.dataset.arrowHide;
|
|
153
|
-
}
|
|
154
141
|
validateCloseButton(newValue) {
|
|
155
142
|
this.mgPopoverContent.closeButton = newValue;
|
|
156
143
|
}
|
|
@@ -182,7 +169,6 @@ export class MgPopover {
|
|
|
182
169
|
this.renderPopoverContent();
|
|
183
170
|
this.validateCloseButton(this.closeButton);
|
|
184
171
|
this.validateIdentifier(this.identifier);
|
|
185
|
-
this.validateArrowHide(this.arrowHide);
|
|
186
172
|
}
|
|
187
173
|
/**
|
|
188
174
|
* Check if component props are well configured on init
|
|
@@ -195,6 +181,9 @@ export class MgPopover {
|
|
|
195
181
|
// Add aria attributes
|
|
196
182
|
this.interactiveElement.setAttribute('aria-controls', this.identifier);
|
|
197
183
|
this.interactiveElement.setAttribute('aria-expanded', `${this.display}`);
|
|
184
|
+
// Mark the trigger so the button stays visually active while the popover is open,
|
|
185
|
+
// without styling every generic aria-expanded (e.g. mg-panel disclosure toggle)
|
|
186
|
+
this.interactiveElement.setAttribute('data-mg-popover-trigger', '');
|
|
198
187
|
const fallbackPlacements = [];
|
|
199
188
|
if (this.element.dataset.fallbackPlacement !== undefined) {
|
|
200
189
|
fallbackPlacements.push(this.element.dataset.fallbackPlacement);
|
|
@@ -207,7 +196,8 @@ export class MgPopover {
|
|
|
207
196
|
{
|
|
208
197
|
name: 'offset',
|
|
209
198
|
options: {
|
|
210
|
-
|
|
199
|
+
// 2px gap with the trigger element, applied on the main axis only (no cross-axis shift so `-start`/`-end` stay aligned)
|
|
200
|
+
offset: [0, 2],
|
|
211
201
|
},
|
|
212
202
|
},
|
|
213
203
|
{
|
|
@@ -219,7 +209,7 @@ export class MgPopover {
|
|
|
219
209
|
],
|
|
220
210
|
});
|
|
221
211
|
// add resize observer
|
|
222
|
-
[this.interactiveElement, this.element.querySelector('mg-popover-content')].forEach(element => {
|
|
212
|
+
[this.interactiveElement, this.element.querySelector('mg-popover-content')].forEach((element) => {
|
|
223
213
|
new ResizeObserver(() => {
|
|
224
214
|
this.popper.update();
|
|
225
215
|
}).observe(element);
|
|
@@ -236,7 +226,7 @@ export class MgPopover {
|
|
|
236
226
|
}
|
|
237
227
|
});
|
|
238
228
|
// Add events to hide popover
|
|
239
|
-
this.element.addEventListener('keydown', e => {
|
|
229
|
+
this.element.addEventListener('keydown', (e) => {
|
|
240
230
|
if (!this.disabled && e.code === 'Escape') {
|
|
241
231
|
this.display = false;
|
|
242
232
|
this.componentClose.emit();
|
|
@@ -250,7 +240,7 @@ export class MgPopover {
|
|
|
250
240
|
* @returns HTML Element
|
|
251
241
|
*/
|
|
252
242
|
render() {
|
|
253
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: '431539cd450da49af5587372a12cbe33956ec5b1' }, h("slot", { key: '30e66567cc00667665b70306b3c9ba2fa541fa1e' }), h("slot", { key: '7fcfcd55904128ef4f7a66e16a31a957e5b7af75', name: "content" })));
|
|
254
244
|
}
|
|
255
245
|
static get is() { return "mg-popover"; }
|
|
256
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -311,27 +301,27 @@ export class MgPopover {
|
|
|
311
301
|
"setter": false,
|
|
312
302
|
"reflect": false,
|
|
313
303
|
"attribute": "placement",
|
|
314
|
-
"defaultValue": "'bottom'"
|
|
304
|
+
"defaultValue": "'bottom-start'"
|
|
315
305
|
},
|
|
316
306
|
"arrowHide": {
|
|
317
|
-
"type": "
|
|
307
|
+
"type": "unknown",
|
|
318
308
|
"mutable": false,
|
|
319
309
|
"complexType": {
|
|
320
|
-
"original": "
|
|
321
|
-
"resolved": "
|
|
310
|
+
"original": "never",
|
|
311
|
+
"resolved": "never",
|
|
322
312
|
"references": {}
|
|
323
313
|
},
|
|
324
314
|
"required": false,
|
|
325
315
|
"optional": false,
|
|
326
316
|
"docs": {
|
|
327
|
-
"tags": [
|
|
317
|
+
"tags": [{
|
|
318
|
+
"name": "deprecated",
|
|
319
|
+
"text": "this prop is deprecated and will be removed in future releases. The popover arrow has been removed."
|
|
320
|
+
}],
|
|
328
321
|
"text": "Hide popover arrow"
|
|
329
322
|
},
|
|
330
323
|
"getter": false,
|
|
331
|
-
"setter": false
|
|
332
|
-
"reflect": false,
|
|
333
|
-
"attribute": "arrow-hide",
|
|
334
|
-
"defaultValue": "false"
|
|
324
|
+
"setter": false
|
|
335
325
|
},
|
|
336
326
|
"closeButton": {
|
|
337
327
|
"type": "boolean",
|
|
@@ -404,7 +394,7 @@ export class MgPopover {
|
|
|
404
394
|
"composed": true,
|
|
405
395
|
"docs": {
|
|
406
396
|
"tags": [],
|
|
407
|
-
"text": "
|
|
397
|
+
"text": "Emitted event when display value change"
|
|
408
398
|
},
|
|
409
399
|
"complexType": {
|
|
410
400
|
"original": "HTMLMgPopoverElement['display']",
|
|
@@ -438,9 +428,6 @@ export class MgPopover {
|
|
|
438
428
|
return [{
|
|
439
429
|
"propName": "identifier",
|
|
440
430
|
"methodName": "validateIdentifier"
|
|
441
|
-
}, {
|
|
442
|
-
"propName": "arrowHide",
|
|
443
|
-
"methodName": "validateArrowHide"
|
|
444
431
|
}, {
|
|
445
432
|
"propName": "closeButton",
|
|
446
433
|
"methodName": "validateCloseButton"
|
|
@@ -65,7 +65,7 @@ export class MgProgress {
|
|
|
65
65
|
* @returns HTML Element
|
|
66
66
|
*/
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: '3682d5f1980678e39594dab8223805deb4b425d4', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '001d511a866ec0526c4ffd01a8a90448b6f40819', class: "mg-c-progress" }, h("div", { key: '504fa583f5b8186236871f3f2cd886acb40614ef', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: '044c9297d5a12c9d8c6d3b76d17dd2ba6a1a9719', class: "mg-c-progress__fill", style: {
|
|
69
69
|
width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,
|
|
70
70
|
} })))));
|
|
71
71
|
}
|
|
@@ -17,7 +17,9 @@ export class MgSkipLinks {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
validateLinks(links) {
|
|
20
|
-
if (links === undefined ||
|
|
20
|
+
if (links === undefined ||
|
|
21
|
+
links.length === 0 ||
|
|
22
|
+
links.some((link) => !isValidString(link.href) || !link.href.startsWith('#') || !isValidString(link.label))) {
|
|
21
23
|
throw new Error(`<mg-skip-links> prop "links": Cannot be empty and each link must contains an href starting with a "#" and a non empty label attributes.`);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -36,7 +38,7 @@ export class MgSkipLinks {
|
|
|
36
38
|
* @returns HTML Element
|
|
37
39
|
*/
|
|
38
40
|
render() {
|
|
39
|
-
return (h("nav", { key: '
|
|
41
|
+
return (h("nav", { key: '9208da538e001be23c8cc78e8a34498cd072cdc6', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'fcd69f398fad6964d5c017bb652ad7b8de34dee6', class: "mg-c-skip-links__list", role: "list" }, this.links.map((link) => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
40
42
|
}
|
|
41
43
|
static get is() { return "mg-skip-links"; }
|
|
42
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +89,7 @@ export class MgSkipLinks {
|
|
|
87
89
|
"composed": true,
|
|
88
90
|
"docs": {
|
|
89
91
|
"tags": [],
|
|
90
|
-
"text": "
|
|
92
|
+
"text": "Emitted event when link is clicked"
|
|
91
93
|
},
|
|
92
94
|
"complexType": {
|
|
93
95
|
"original": "string",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassList, toString, createID, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
2
|
-
import { textAlignments, dataTypes, sizes } from "./mg-table.conf";
|
|
2
|
+
import { textAlignments, dataTypes, sizes, } from "./mg-table.conf";
|
|
3
3
|
import { initLocales } from "../../../locales";
|
|
4
4
|
/**
|
|
5
5
|
* Check if value is a valid align object
|
|
@@ -22,7 +22,7 @@ typeof newValue === 'object' &&
|
|
|
22
22
|
(value.sortable !== undefined && typeof value.sortable === 'boolean') ||
|
|
23
23
|
(value.datatype !== undefined && dataTypes.includes(value.datatype))) &&
|
|
24
24
|
// ensure no extra properties are present
|
|
25
|
-
Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)));
|
|
25
|
+
Object.keys(value).every((key) => ['align', 'sortable', 'datatype'].includes(key)));
|
|
26
26
|
/**
|
|
27
27
|
* Compare values
|
|
28
28
|
* @param firstValue - First value
|
|
@@ -150,12 +150,16 @@ export class MgTable {
|
|
|
150
150
|
// Add event listener
|
|
151
151
|
button.addEventListener('click', () => {
|
|
152
152
|
// Reset aria pressed
|
|
153
|
-
table
|
|
153
|
+
table
|
|
154
|
+
.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`)
|
|
155
|
+
.forEach((ariaPressed) => {
|
|
154
156
|
ariaPressed.removeAttribute('aria-pressed');
|
|
155
157
|
ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');
|
|
156
158
|
});
|
|
157
159
|
// Reset aria sort
|
|
158
|
-
table
|
|
160
|
+
table
|
|
161
|
+
.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`)
|
|
162
|
+
.forEach((ariaSort) => {
|
|
159
163
|
ariaSort.removeAttribute('aria-sort');
|
|
160
164
|
});
|
|
161
165
|
// Set aria pressed
|
|
@@ -190,7 +194,7 @@ export class MgTable {
|
|
|
190
194
|
// If sort order is none, return to original order
|
|
191
195
|
if (sortOrder === 'none') {
|
|
192
196
|
// Append rows to table
|
|
193
|
-
rowsDefault.forEach(row => table.querySelector('tbody').append(row));
|
|
197
|
+
rowsDefault.forEach((row) => table.querySelector('tbody').append(row));
|
|
194
198
|
return;
|
|
195
199
|
}
|
|
196
200
|
// Set a copy of rows
|
|
@@ -208,7 +212,7 @@ export class MgTable {
|
|
|
208
212
|
return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);
|
|
209
213
|
});
|
|
210
214
|
// Append rows to table
|
|
211
|
-
rows.forEach(row => table.querySelector('tbody').append(row));
|
|
215
|
+
rows.forEach((row) => table.querySelector('tbody').append(row));
|
|
212
216
|
});
|
|
213
217
|
}
|
|
214
218
|
});
|