@mgdis/mg-components 6.25.0 → 6.27.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/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_36.cjs.entry.js +217 -95
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-illustration.cjs.entry.js +1 -1
- package/dist/cjs/mg-input-combobox.cjs.entry.js +25 -7
- package/dist/cjs/mg-input-file.cjs.entry.js +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1595 -637
- package/dist/cjs/mg-loader.cjs.entry.js +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/assets/illustrations/index.js +1 -1
- package/dist/collection/assets/jodit/jodit.css +5834 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +103 -55
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +39 -4
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +2 -4
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +24 -6
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +3 -2
- 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/mg-input-rich-text-editor.js +3 -3
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +10 -2
- 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 +3 -3
- 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 +4 -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/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-illustration.js +1 -1
- 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 +282 -282
- 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-toggle.js +1 -1
- package/dist/components/mg-input2.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-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-tabs2.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/custom-elements.json +19 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_36.entry.js +217 -95
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-illustration.entry.js +1 -1
- package/dist/esm/mg-input-combobox.entry.js +25 -7
- package/dist/esm/mg-input-file.entry.js +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +1595 -637
- package/dist/esm/mg-loader.entry.js +1 -1
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-3ad7441c.entry.js → p-32a55ddb.entry.js} +1 -1
- package/dist/mg-components/p-6f492676.entry.js +1667 -0
- package/dist/mg-components/p-813d69c7.entry.js +1 -0
- package/dist/mg-components/p-85ebacd6.entry.js +1 -0
- package/dist/mg-components/p-a2445605.entry.js +1 -0
- package/dist/mg-components/{p-96fc508e.entry.js → p-c2beff2c.entry.js} +1 -1
- package/dist/mg-components/p-f308e2e4.entry.js +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +33 -6
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +2 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +11 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -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.d.ts +13 -2
- package/ide/intellij/web-types.json +12 -2
- package/ide/vscode/html-custom-data.json +26 -1
- package/package.json +20 -20
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +0 -212
- package/dist/mg-components/p-4693077a.entry.js +0 -1
- package/dist/mg-components/p-5dff879a.entry.js +0 -1
- package/dist/mg-components/p-b20f3698.entry.js +0 -1
- package/dist/mg-components/p-ec4bd337.entry.js +0 -1667
- package/dist/mg-components/p-f8e58181.entry.js +0 -1
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: 'b914eadabb438b17c1cddc6b6e0167facf264a37', class: this.classCollection.join() }, h("div", { key: 'c2c55e775db2a622948ebd0d2efef8336520a52a', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '1b549999f75245d17d7c4ba5696af25921c1725a', name: "illustration" })), h("div", { key: '6f19510b6775bbd366dbb4127ad1ca7b1be8a261', class: "mg-c-illustrated-message__slots" }, h("slot", { key: 'db37d12c2812c8fca129f4d0f24cb011198ba474', name: "title" }), h("slot", { key: '2a1aaf4fe8ea18a971c741c03e05d146584567a7', 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: '55e8bc6908f1cd83f9ffc0e30dd28ede501e30d8', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '4306e748a509ac3c546d565bf2bed74529ce3c24', icon: "loader", spin: true }), h("span", { key: '6636df5f58654f6de7f0b79e8e4dd32e4fe2bfc7', 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: 'ac4ce18faacbbc2e1f1ecaa03f4ddb4693c9f821', class: this.classCollection.join() }, h("mg-card", { key: '25ce44964f85c27386138f9e2f2e6f9c066810b4', shadow: this.variantStyle !== 'background' }, h("span", { key: '1ec4146aefe5f7a41eb92947b3dfd2d975517de2', class: "mg-c-message__icon" }, h("mg-icon", { key: '24e7c80b674e260e47d6134a996a8da774e5eb68', icon: this.getIcon() })), h("div", { key: '5344654d4373a0f4636d062b16a861a12eda19f0', class: "mg-c-message__content" }, h("span", { key: '63bd0aecd75f348be533a92cf63697eaa35db77b', class: "mg-c-message__content-slot" }, h("slot", { key: '4321f84c6b1679b163b0115b78e4801eeece2e25' })), 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: '42c8d32832a41bb6dce997078aabaa8a40c16f5c', name: "actions" })),
|
|
106
106
|
]))));
|
|
107
107
|
}
|
|
108
108
|
static get is() { return "mg-message"; }
|
|
@@ -189,7 +189,7 @@ export class MgMessage {
|
|
|
189
189
|
},
|
|
190
190
|
"getter": false,
|
|
191
191
|
"setter": false,
|
|
192
|
-
"reflect":
|
|
192
|
+
"reflect": true,
|
|
193
193
|
"attribute": "full-width",
|
|
194
194
|
"defaultValue": "false"
|
|
195
195
|
}
|
|
@@ -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: '30175543565cfaad83c561b8316ee7af057d6439', 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: 'b1ddb9603f4956c171fd4e0f5193236b7fc5a739', shadow: true }, h("div", { key: '9d6e8f1d4e19088a31f6785176cee3c099dce111', class: "mg-c-modal__dialog" }, h("header", { key: 'f2e85f730ff4a4dd94df7640d1bb6e3b89c94fbf', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: 'ab1c36f6bbbeed4ba54342a1cae4b08bc3befbb7', class: "mg-c-modal__close-button" }, h("mg-button", { key: '7d3658b31d901dd6b95610e7cbb1d28a47f178f3', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '662f7ee9badfe12dff1c2df58572c8829bf32bff', icon: "cross" })))), h("h1", { key: '8e2ec325dacc29c31806c9525dc4e56ce7f1232b', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '5bc09995ddda790ec1015737176d24484b4b178c', class: "mg-c-modal__content" }, h("slot", { key: 'c3ff57659beb9e0d523ed0a20ad9768c549f6332' })), this.hasActions && (h("footer", { key: '30336eb46581adbc144a9f8275489e5f9a1b9bcd', class: "mg-c-modal__footer" }, h("slot", { key: 'fc2cc4e0b3c300801d1cf928a8d1ef825c8775bc', name: "actions" })))))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "mg-modal"; }
|
|
116
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -245,7 +245,7 @@ export class MgPanel {
|
|
|
245
245
|
*/
|
|
246
246
|
render() {
|
|
247
247
|
const headerId = `${this.identifier}-header`;
|
|
248
|
-
return (h("section", { key: '
|
|
248
|
+
return (h("section", { key: 'b578e1389d1bbd5e035121c350d5c39b9bdf8a5e', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '44f71cd6cb5973719608d04d1581d440a53f5d7d', shadow: this.shadow }, h("header", { key: 'fb3b381c2c574bca89391e9007afc0552cce9a14', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: 'ee1ee946f594900680e2182a41de5d86dd515212', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '7f878c18e3e5d60a7619312b16336858313f1eae' })))));
|
|
249
249
|
}
|
|
250
250
|
static get is() { return "mg-panel"; }
|
|
251
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: 'e019ee038ec460eb854f0c3e1735dbf5d107b76c' }, h("mg-card", { key: 'ddcfa4488e4e1d88f9f04cbe1adbce5571810dc2', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'ecd864254f96e0e4d855f4fd17ea6cefd9606a75', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: 'ef52183b075b47d9fc81b7ec0074c790c51741aa', icon: "cross" }))), h("div", { key: 'df62e551869ec69e902788d20aa50b169bdfc0ee', class: "mg-c-popover-content__title" }, h("slot", { key: '5a4eada9d48368a34094ba22f83d23c0abd92223', name: "title" })), h("slot", { key: 'bfa7298291aed96a01a45cf2921a5646a022287f', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "mg-popover-content"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -181,6 +181,9 @@ export class MgPopover {
|
|
|
181
181
|
// Add aria attributes
|
|
182
182
|
this.interactiveElement.setAttribute('aria-controls', this.identifier);
|
|
183
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', '');
|
|
184
187
|
const fallbackPlacements = [];
|
|
185
188
|
if (this.element.dataset.fallbackPlacement !== undefined) {
|
|
186
189
|
fallbackPlacements.push(this.element.dataset.fallbackPlacement);
|
|
@@ -237,7 +240,7 @@ export class MgPopover {
|
|
|
237
240
|
* @returns HTML Element
|
|
238
241
|
*/
|
|
239
242
|
render() {
|
|
240
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: 'c8f404452600fb8c3c4219c3873d407c9546fa9c' }, h("slot", { key: '0031a6cef5ecab29b82c38a6cdfeef61277e7f57' }), h("slot", { key: 'ececc678b5d54aaad029adcf7d9681471cf78701', name: "content" })));
|
|
241
244
|
}
|
|
242
245
|
static get is() { return "mg-popover"; }
|
|
243
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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: 'c0df3a5d374a8e5761efcd1e340775e5a33b17b4', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '9481f0fdb3bb5b9c0a27cd47113207537dcf0eec', class: "mg-c-progress" }, h("div", { key: '67bf52635d482d56a8b0a85f31da78c243054e22', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: '9a55b0bf8132bcec41350941d2bbd470194d7981', class: "mg-c-progress__fill", style: {
|
|
69
69
|
width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,
|
|
70
70
|
} })))));
|
|
71
71
|
}
|
|
@@ -38,7 +38,7 @@ export class MgSkipLinks {
|
|
|
38
38
|
* @returns HTML Element
|
|
39
39
|
*/
|
|
40
40
|
render() {
|
|
41
|
-
return (h("nav", { key: '
|
|
41
|
+
return (h("nav", { key: '972bbcd87ccb46025324b4dc8e3ded00407e2b77', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'a4673c4b29484e654f4adb5d7c669d4ad372760f', 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)))))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "mg-skip-links"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -226,7 +226,7 @@ export class MgTabs {
|
|
|
226
226
|
* @returns HTML Element
|
|
227
227
|
*/
|
|
228
228
|
render() {
|
|
229
|
-
return (h("div", { key: '
|
|
229
|
+
return (h("div", { key: '6f741baa1d25495fd980586c2cad6203cbb69906', class: this.classCollection.join() }, h("header", { key: '1dd40593a076db2d6c883b2f066e8c96938175bf', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
230
230
|
[`${this.buttonTabBaseClass}`]: true,
|
|
231
231
|
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
232
232
|
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as t,proxyCustomElement as o,HTMLElement as n,createEvent as r,h as i,Host as e}from"@stencil/core/internal/client";import{C as a,t as c,i as b,n as d}from"./index2.js";import{n as s}from"./index3.js";import{K as g}from"./events.utils.js";import{d as u}from"./mg-icon2.js";const m=["medium","large"],l=["primary","secondary","danger","danger-alt","info","flat","success","link"],h=o(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.disabledChange=r(this,"disabled-change",7),this.onClickElementFn=null,this.classDisabled="mg-c-button--disabled",this.classLoading="mg-c-button--loading",this.classFullWidth="mg-c-button--full-width",this.variant="primary",this.size="medium",this.fullWidth=!1,this.isIcon=!1,this.disableOnClick=!1,this.loading=!1,this.classCollection=new a(["mg-c-button"]),this.handleClick=t=>{this.disabled?t.stopPropagation():this.disableOnClick&&(this.loading=!0,this.disabled=!0)},this.handleKeydown=t=>{this.disabled||" "!==t.key?!this.disabled&&[g.ENTER,g.NUMPADENTER,g.SPACE].includes(t.key)&&(t.preventDefault(),this.element.dispatchEvent(new MouseEvent("click",{bubbles:!0}))):t.preventDefault()},this.handleKeyup=t=>{this.disabled||" "!==t.key||(t.preventDefault(),this.element.dispatchEvent(new MouseEvent("click",{bubbles:!0})))},this.setIconSize=()=>{var t,o;"medium"===this.size?null===(t=this.element.querySelector("mg-icon[size]"))||void 0===t||t.removeAttribute("size"):this.isIcon&&(null===(o=this.element.querySelector("mg-icon"))||void 0===o||o.setAttribute("size",this.size))}}validateVariant(t,o){if(!l.includes(t)){if(""===t)return void(this.variant=l[0]);throw new Error(`<mg-button> prop "variant" must be one of: ${l.join(", ")}. Passed value: ${c(t)}.`)}void 0!==o&&this.classCollection.delete(`mg-c-button--${o}`),this.classCollection.add(`mg-c-button--${t}`)}validateSize(t,o){if(!m.includes(t))throw new Error(`<mg-button> prop "size" must be one of: ${m.join(", ")}. Passed value: ${c(t)}.`);void 0!==o&&this.classCollection.delete(`mg-c-button--${o}`),this.classCollection.add(`mg-c-button--${t}`),this.setIconSize()}validateFullWidth(t){if(t&&this.isIcon)throw new Error('<mg-button> prop "fullWidth" cannot be used with prop "isIcon".');t?this.classCollection.add(this.classFullWidth):this.classCollection.delete(this.classFullWidth)}disabledHandler(t){!t&&this.disableOnClick&&(this.loading=!1),this.element.onclick=t?void 0:this.onClickElementFn,t?this.classCollection.add(this.classDisabled):this.classCollection.delete(this.classDisabled),this.disabledChange.emit(t)}watchIsIcon(t){if(t){if(this.classCollection.add("mg-c-button--icon"),!b(this.label))throw new Error('<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.')}else this.classCollection.delete("mg-c-button--icon");this.setIconSize()}loadingHandler(t){t?this.classCollection.add(this.classLoading):this.classCollection.delete(this.classLoading)}componentWillLoad(){s(this),this.validateVariant(this.variant),this.validateFullWidth(this.fullWidth),this.validateSize(this.size),this.watchIsIcon(this.isIcon),this.onClickElementFn=this.element.onclick,this.disabledHandler(this.disabled)}componentDidLoad(){d((()=>{var t;const o=this.element.closest("form")||(null===(t=this.element.closest("mg-form"))||void 0===t?void 0:t.shadowRoot.querySelector("form"));o&&["submit",void 0].includes(this.type)&&this.element.addEventListener("click",(()=>{o.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0}))}))}))}render(){var t;return i(e,{key:"9efa9dbbcdb2965cb8fd301c86988d0b0d97b474",role:"button",tabIndex:this.element.getAttribute("tabindex")||0,type:this.type,form:this.form,"full-width":this.fullWidth,"aria-label":this.label,"aria-disabled":null===(t=this.disabled)||void 0===t?void 0:t.toString(),onClick:this.handleClick,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},i("div",{key:"36918b5b208a9e0a9650107f4418cac35ade1ed2",class:this.classCollection.join()},this.loading&&i("mg-icon",{key:"8ad3e911d273f69441f2a405f8040cc685a0a486",icon:"loader",spin:!0}),i("div",{key:"a6b199c669ef6b15bfc345c98192290ce11e65cb",class:"mg-c-button__content"},i("slot",{key:"b13d317001dbf66c945cdf9e97c06338ce073c12"}))))}get element(){return this}static get watchers(){return{variant:[{validateVariant:0}],size:[{validateSize:0}],fullWidth:[{validateFullWidth:0}],disabled:[{disabledHandler:0}],isIcon:[{watchIsIcon:0}],loading:[{loadingHandler:0}]}}static get style(){return":host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button--flat:not(.mg-c-button--disabled){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--primary:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--secondary:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--danger:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--info:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--success:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--warning:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled),:host([aria-expanded=true]) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--danger-alt:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--disabled,.mg-c-button[aria-disabled=true],.mg-c-button:disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--large{padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border)) calc(var(--mg-b-size-24) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon){line-height:var(--mg-b-size-24)}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) slot,.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) ::slotted(*){font-size:var(--mg-b-size-16)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--icon.mg-c-button--large{width:unset;height:unset;padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--icon.mg-c-button--large ::slotted(*){min-width:var(--mg-b-size-24);min-height:var(--mg-b-size-24);align-items:center;justify-content:center}.mg-c-button.mg-c-button--full-width{display:flex;width:100%;justify-content:center}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible),:host([data-focus-visible]){outline:0}:host(:focus-visible) .mg-c-button,:host([data-focus-visible]) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:var(--mg-b-size-2)}"}},[257,"mg-button",{variant:[1025],label:[1],type:[1],size:[1],fullWidth:[4,"full-width"],form:[1],disabled:[1028],isIcon:[4,"is-icon"],disableOnClick:[4,"disable-on-click"],loading:[32],classCollection:[32]},void 0,{variant:[{validateVariant:0}],size:[{validateSize:0}],fullWidth:[{validateFullWidth:0}],disabled:[{disabledHandler:0}],isIcon:[{watchIsIcon:0}],loading:[{loadingHandler:0}]}]);function v(){"undefined"!=typeof customElements&&["mg-button","mg-icon"].forEach((o=>{switch(o){case"mg-button":customElements.get(t(o))||customElements.define(t(o),h);break;case"mg-icon":customElements.get(t(o))||u()}}))}v();export{h as M,v as d}
|
|
1
|
+
import{transformTag as t,proxyCustomElement as o,HTMLElement as n,createEvent as r,h as i,Host as e}from"@stencil/core/internal/client";import{C as a,t as c,i as b,n as d}from"./index2.js";import{n as g}from"./index3.js";import{K as s}from"./events.utils.js";import{d as u}from"./mg-icon2.js";const m=["medium","large"],l=["primary","secondary","danger","danger-alt","info","flat","success","link"],h=o(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.disabledChange=r(this,"disabled-change",7),this.onClickElementFn=null,this.classDisabled="mg-c-button--disabled",this.classLoading="mg-c-button--loading",this.classFullWidth="mg-c-button--full-width",this.variant="primary",this.size="medium",this.fullWidth=!1,this.isIcon=!1,this.disableOnClick=!1,this.loading=!1,this.classCollection=new a(["mg-c-button"]),this.handleClick=t=>{this.disabled?t.stopPropagation():this.disableOnClick&&(this.loading=!0,this.disabled=!0)},this.handleKeydown=t=>{this.disabled||" "!==t.key?!this.disabled&&[s.ENTER,s.NUMPADENTER,s.SPACE].includes(t.key)&&(t.preventDefault(),this.element.dispatchEvent(new MouseEvent("click",{bubbles:!0}))):t.preventDefault()},this.handleKeyup=t=>{this.disabled||" "!==t.key||(t.preventDefault(),this.element.dispatchEvent(new MouseEvent("click",{bubbles:!0})))},this.setIconSize=()=>{var t,o;"medium"===this.size?null===(t=this.element.querySelector("mg-icon[size]"))||void 0===t||t.removeAttribute("size"):this.isIcon&&(null===(o=this.element.querySelector("mg-icon"))||void 0===o||o.setAttribute("size",this.size))}}validateVariant(t,o){if(!l.includes(t)){if(""===t)return void(this.variant=l[0]);throw new Error(`<mg-button> prop "variant" must be one of: ${l.join(", ")}. Passed value: ${c(t)}.`)}void 0!==o&&this.classCollection.delete(`mg-c-button--${o}`),this.classCollection.add(`mg-c-button--${t}`)}validateSize(t,o){if(!m.includes(t))throw new Error(`<mg-button> prop "size" must be one of: ${m.join(", ")}. Passed value: ${c(t)}.`);void 0!==o&&this.classCollection.delete(`mg-c-button--${o}`),this.classCollection.add(`mg-c-button--${t}`),this.setIconSize()}validateFullWidth(t){if(t&&this.isIcon)throw new Error('<mg-button> prop "fullWidth" cannot be used with prop "isIcon".');t?this.classCollection.add(this.classFullWidth):this.classCollection.delete(this.classFullWidth)}disabledHandler(t){!t&&this.disableOnClick&&(this.loading=!1),this.element.onclick=t?void 0:this.onClickElementFn,t?this.classCollection.add(this.classDisabled):this.classCollection.delete(this.classDisabled),this.disabledChange.emit(t)}watchIsIcon(t){if(t){if(this.classCollection.add("mg-c-button--icon"),!b(this.label))throw new Error('<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.')}else this.classCollection.delete("mg-c-button--icon");this.setIconSize()}loadingHandler(t){t?this.classCollection.add(this.classLoading):this.classCollection.delete(this.classLoading)}componentWillLoad(){g(this),this.validateVariant(this.variant),this.validateFullWidth(this.fullWidth),this.validateSize(this.size),this.watchIsIcon(this.isIcon),this.onClickElementFn=this.element.onclick,this.disabledHandler(this.disabled)}componentDidLoad(){d((()=>{var t;const o=this.element.closest("form")||(null===(t=this.element.closest("mg-form"))||void 0===t?void 0:t.shadowRoot.querySelector("form"));o&&["submit",void 0].includes(this.type)&&this.element.addEventListener("click",(()=>{o.dispatchEvent(new SubmitEvent("submit",{bubbles:!0,cancelable:!0}))}))}))}render(){var t;return i(e,{key:"9efa9dbbcdb2965cb8fd301c86988d0b0d97b474",role:"button",tabIndex:this.element.getAttribute("tabindex")||0,type:this.type,form:this.form,"full-width":this.fullWidth,"aria-label":this.label,"aria-disabled":null===(t=this.disabled)||void 0===t?void 0:t.toString(),onClick:this.handleClick,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},i("div",{key:"36918b5b208a9e0a9650107f4418cac35ade1ed2",class:this.classCollection.join()},this.loading&&i("mg-icon",{key:"8ad3e911d273f69441f2a405f8040cc685a0a486",icon:"loader",spin:!0}),i("div",{key:"a6b199c669ef6b15bfc345c98192290ce11e65cb",class:"mg-c-button__content"},i("slot",{key:"b13d317001dbf66c945cdf9e97c06338ce073c12"}))))}get element(){return this}static get watchers(){return{variant:[{validateVariant:0}],size:[{validateSize:0}],fullWidth:[{validateFullWidth:0}],disabled:[{disabledHandler:0}],isIcon:[{watchIsIcon:0}],loading:[{loadingHandler:0}]}}static get style(){return":host{display:inline-block;max-width:100%;vertical-align:middle}:host(:hover) .mg-c-button--flat:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button--flat:not(.mg-c-button--disabled),.mg-c-button--flat:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:color-mix(in srgb, var(--mg-b-color-dark), transparent 90%)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-c-button.mg-c-button--primary{border-color:var(--mg-c-button-color-border-primary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-primary), var(--mg-c-button-color-gradient-primary));color:var(--mg-c-button-color-text-primary)}:host(:hover) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--primary:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--primary:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-primary)}.mg-c-button.mg-c-button--secondary{border-color:var(--mg-c-button-color-border-secondary);background:linear-gradient(to bottom, var(--mg-c-button-color-background-secondary), var(--mg-c-button-color-gradient-secondary));color:var(--mg-c-button-color-text-secondary)}:host(:hover) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--secondary:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--secondary:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-secondary)}.mg-c-button.mg-c-button--danger{border-color:var(--mg-c-button-color-border-danger);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger), var(--mg-c-button-color-gradient-danger));color:var(--mg-c-button-color-text-danger)}:host(:hover) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--danger:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--danger:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-danger)}.mg-c-button.mg-c-button--info{border-color:var(--mg-c-button-color-border-info);background:linear-gradient(to bottom, var(--mg-c-button-color-background-info), var(--mg-c-button-color-gradient-info));color:var(--mg-c-button-color-text-info)}:host(:hover) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--info:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--info:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-info)}.mg-c-button.mg-c-button--success{border-color:var(--mg-c-button-color-border-success);background:linear-gradient(to bottom, var(--mg-c-button-color-background-success), var(--mg-c-button-color-gradient-success));color:var(--mg-c-button-color-text-success)}:host(:hover) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--success:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--success:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-success)}.mg-c-button.mg-c-button--warning{border-color:var(--mg-c-button-color-border-warning);background:linear-gradient(to bottom, var(--mg-c-button-color-background-warning), var(--mg-c-button-color-gradient-warning));color:var(--mg-c-button-color-text-warning)}:host(:hover) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--warning:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--warning:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-warning)}.mg-c-button.mg-c-button--danger-alt{border-color:var(--mg-c-button-color-border-danger-alt);background:linear-gradient(to bottom, var(--mg-c-button-color-background-danger-alt), var(--mg-c-button-color-gradient-danger-alt));color:var(--mg-c-button-color-text-danger-alt)}:host(:hover) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled),:host([data-mg-popover-trigger][aria-expanded=true]) .mg-c-button.mg-c-button--danger-alt:not(.mg-c-button--disabled),.mg-c-button.mg-c-button--danger-alt:hover:not(.mg-c-button--disabled,:disabled,[aria-disabled=true]){background:var(--mg-c-button-color-background-danger-alt)}.mg-c-button{position:relative;display:inline-flex;min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-width:var(--mg-c-button-border-top-width, var(--mg-b-size-border)) var(--mg-c-button-border-right-width, var(--mg-b-size-border)) var(--mg-c-button-border-bottom-width, var(--mg-b-size-border)) var(--mg-c-button-border-left-width, var(--mg-b-size-border));border-style:solid;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-border-radius));background-image:none;color:inherit;column-gap:var(--mg-b-size-8);cursor:pointer;touch-action:manipulation;font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none}.mg-c-button slot,.mg-c-button ::slotted(*:not(mg-icon)){font-family:inherit;font-size:var(--mg-b-font-size);font-weight:var(--mg-c-button-font-weight, normal);text-align:left;text-decoration:none;display:flex;align-items:center;column-gap:var(--mg-b-size-8)}.mg-c-button mg-icon:only-child,.mg-c-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;margin:auto 0;line-height:1}.mg-c-button.mg-c-button--disabled,.mg-c-button[aria-disabled=true],.mg-c-button:disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled);pointer-events:none}.mg-c-button.mg-c-button--flat{border:none;background:none}.mg-c-button.mg-c-button--link{min-height:unset;padding:unset;border:unset;border-radius:unset;background:unset;text-decoration:underline}.mg-c-button.mg-c-button--link slot{font-weight:600}.mg-c-button.mg-c-button--link:hover{text-decoration:none}.mg-c-button.mg-c-button--large{padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border)) calc(var(--mg-b-size-24) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon){line-height:var(--mg-b-size-24)}.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) slot,.mg-c-button.mg-c-button--large:not(.mg-c-button--icon) ::slotted(*){font-size:var(--mg-b-size-16)}.mg-c-button.mg-c-button--icon{width:var(--mg-b-size-min-height);height:var(--mg-b-size-min-height);justify-content:center;padding:0;border-radius:var(--mg-c-button-border-radius-top-left, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-top-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-right, var(--mg-c-button-icon-border-radius)) var(--mg-c-button-border-radius-bottom-left, var(--mg-c-button-icon-border-radius));font-size:var(--mg-b-font-size);line-height:var(--mg-b-font-size)}.mg-c-button.mg-c-button--icon.mg-c-button--large{width:unset;height:unset;padding:calc(var(--mg-b-size-12) - var(--mg-b-size-border))}.mg-c-button.mg-c-button--icon.mg-c-button--large ::slotted(*){min-width:var(--mg-b-size-24);min-height:var(--mg-b-size-24);align-items:center;justify-content:center}.mg-c-button.mg-c-button--full-width{display:flex;width:100%;justify-content:center}.mg-c-button.mg-c-button--loading>mg-icon:first-of-type{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mg-c-button.mg-c-button--loading .mg-c-button__content{opacity:0}:host(:focus-visible),:host([data-focus-visible]){outline:0}:host(:focus-visible) .mg-c-button,:host([data-focus-visible]) .mg-c-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:var(--mg-b-size-2)}.mg-c-button:focus-visible{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:var(--mg-b-size-2)}"}},[257,"mg-button",{variant:[1025],label:[1],type:[1],size:[1],fullWidth:[4,"full-width"],form:[1],disabled:[1028],isIcon:[4,"is-icon"],disableOnClick:[4,"disable-on-click"],loading:[32],classCollection:[32]},void 0,{variant:[{validateVariant:0}],size:[{validateSize:0}],fullWidth:[{validateFullWidth:0}],disabled:[{disabledHandler:0}],isIcon:[{watchIsIcon:0}],loading:[{loadingHandler:0}]}]);function v(){"undefined"!=typeof customElements&&["mg-button","mg-icon"].forEach((o=>{switch(o){case"mg-button":customElements.get(t(o))||customElements.define(t(o),h);break;case"mg-icon":customElements.get(t(o))||u()}}))}v();export{h as M,v as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as a,proxyCustomElement as r,HTMLElement as d,h as c}from"@stencil/core/internal/client";import{C as e,t as
|
|
1
|
+
import{transformTag as a,proxyCustomElement as r,HTMLElement as d,h as c}from"@stencil/core/internal/client";import{C as e,t as i}from"./index2.js";const t=["xsmall","small","medium"],s=r(class extends d{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.shadow=!1,this.radiusSize="medium",this.classCollection=new e(["mg-c-card"])}watchShadow(a){a?this.classCollection.add("mg-c-card--shadow"):this.classCollection.delete("mg-c-card--shadow")}watchRadiusSize(a,r){if(!t.includes(a)){if(""===String(a))return void(this.radiusSize="medium");throw new Error(`<mg-card> prop "radiusSize" must be one of: ${t.join(", ")}. Passed value: ${i(a)}.`)}void 0!==r&&this.classCollection.delete(`mg-c-card--radius-${r}`),this.classCollection.add(`mg-c-card--radius-${a}`)}componentWillLoad(){this.watchShadow(this.shadow),this.watchRadiusSize(this.radiusSize)}render(){return c("div",{key:"8fb6d9aa655b838e219a077670ce6296640d0854",class:this.classCollection.join()},c("slot",{key:"9413035054408e44b8c8bb3f2033ff970931c347"}))}static get watchers(){return{shadow:[{watchShadow:0}],radiusSize:[{watchRadiusSize:0}]}}static get style(){return".mg-c-card{position:relative;z-index:inherit;overflow:var(--mg-c-card-overflow, var(--mg-c-card-overflow-default));width:100%;min-width:var(--mg-c-card-min-width);max-width:var(--mg-c-card-max-width);max-height:var(--mg-c-card-max-height);box-sizing:border-box;padding:var(--mg-c-card-spacing, var(--mg-c-card-spacing-default));border:var(--mg-c-card-border, var(--mg-c-card-border-default));border-radius:var(--mg-c-card-border-radius, var(--mg-c-card-border-radius-default));background:var(--mg-c-card-color-background, var(--mg-c-card-color-background-default))}.mg-c-card ::slotted(*:not(mg-panel,mg-message,mg-modal)){--mg-c-card-border:var(--mg-c-card-border-default);--mg-c-card-spacing:var(--mg-c-card-spacing-default);--mg-c-card-border-radius:var(--mg-c-card-border-radius-default);--mg-c-card-color-background:var(--mg-c-card-color-background-default);--mg-c-card-box-shadow:var(--mg-c-card-box-shadow-default);--mg-c-card-max-width:unset;--mg-c-card-min-width:unset;--mg-c-card-max-height:unset;--mg-c-card-overflow:var(--mg-c-card-overflow-default)}.mg-c-card.mg-c-card--shadow{--mg-c-card-border:var(--mg-b-color-neutral-20);box-shadow:var(--mg-c-card-box-shadow, var(--mg-c-card-box-shadow-default))}.mg-c-card.mg-c-card--radius-xsmall{--mg-c-card-border-radius:var(--mg-b-size-radius-medium)}.mg-c-card.mg-c-card--radius-small{--mg-c-card-border-radius:var(--mg-b-size-radius-large)}::slotted(:first-child){margin-block-start:0 !important}::slotted(:last-child){margin-block-end:0 !important}"}},[257,"mg-card",{shadow:[4],radiusSize:[1025,"radius-size"],classCollection:[32]},void 0,{shadow:[{watchShadow:0}],radiusSize:[{watchRadiusSize:0}]}]);function o(){"undefined"!=typeof customElements&&["mg-card"].forEach((r=>{"mg-card"===r&&(customElements.get(a(r))||customElements.define(a(r),s))}))}o();export{s as M,o as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as e,proxyCustomElement as t,HTMLElement as i,createEvent as a,h as s}from"@stencil/core/internal/client";import{i as n}from"./index2.js";import{n as
|
|
1
|
+
import{transformTag as e,proxyCustomElement as t,HTMLElement as i,createEvent as a,h as s}from"@stencil/core/internal/client";import{i as n}from"./index2.js";import{n as m}from"./index3.js";import{d as o}from"./mg-icon2.js";const d=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expandedChange=a(this,"expanded-change",7),this.hideSummary=!1,this.expanded=!1,this.handleToggle=()=>{this.expanded=this.details.open}}validateTitles(e){if(!n(e))throw Error(`<mg-details> prop "toggleClosed" and "toggleOpened" is required and must be a valid string. Passed value: "toggleClosed='${this.toggleClosed}'" and "toggleOpened='${this.toggleOpened}'".`)}handleExpanded(e){this.expandedChange.emit(e)}componentWillLoad(){m(this),this.validateTitles(this.toggleClosed),this.validateTitles(this.toggleOpened);const e=this.element.querySelector('[slot="summary"]');this.isEmptySummary=null===e||!n(e.textContent),this.element.addEventListener("click",(e=>{null!==e.target.closest('[slot="summary"] mg-button, mg-button[slot="summary"]')&&e.preventDefault()}))}render(){return s("details",{key:"12eac25682e22d65ace61f6697656459d1494903",class:{"mg-c-details":!0,"mg-c-details--hide-summary":this.hideSummary,"mg-c-details--empty-summary":this.isEmptySummary},onToggle:this.handleToggle,open:this.expanded,ref:e=>this.details=e},s("summary",{key:"d6d621db04bca17297f770a633fcb17711f99ecf"},s("slot",{key:"245aad29a2f2cd93e3a5426ce1e010ab6f5b5e07",name:"summary"}),s("span",{key:"ebfe3c80a00b9b7a38a670f536a3984420ec3945",class:"mg-c-details__toggle"},s("mg-icon",{key:"73c4eb27b3d6aa9168bf6af9fa118afc51b8ee1a",icon:"chevron-up",class:{"mg-c-details__toggle-icon":!0,"mg-c-details__toggle-icon--reverse":!this.expanded}}),s("span",{key:"96730ec386137f7f3aa463b76c20547a5922f294",class:{"mg-u-visually-hidden":this.hideSummary}},this.expanded?this.toggleOpened:this.toggleClosed))),s("div",{key:"8ac6eee499e613a543fd2a2ea9d954719d48005d",class:"mg-c-details__details"},s("slot",{key:"37af4674491d7857163dcc48424e652cfcefbed6",name:"details"})))}get element(){return this}static get watchers(){return{toggleClosed:[{validateTitles:0}],toggleOpened:[{validateTitles:0}],expanded:[{handleExpanded:0}]}}static get style(){return".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip-path:inset(50%) !important;white-space:nowrap !important}.mg-u-visually-hidden *{overflow:hidden !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-details summary{display:inline-flex;align-items:baseline;cursor:pointer;gap:var(--mg-b-size-16)}.mg-c-details summary::-webkit-details-marker{display:none}.mg-c-details.mg-c-details--hide-summary summary{gap:var(--mg-b-size-4)}.mg-c-details.mg-c-details--empty-summary summary{gap:unset}.mg-c-details__toggle{display:flex;min-height:calc(var(--mg-b-font-size)*var(--mg-b-line-height));flex-shrink:0;align-items:center;align-self:flex-start;gap:var(--mg-b-size-4)}.mg-c-details__toggle-icon.mg-c-details__toggle-icon--reverse{transform:rotate(180deg)}.mg-c-details__details{margin-top:var(--mg-c-details-spacing)}@media (width < 43.75rem){.mg-c-details:not(.mg-c-details--empty-summary) .mg-c-details__toggle>span{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip-path:inset(50%) !important;white-space:nowrap !important}.mg-c-details:not(.mg-c-details--empty-summary) .mg-c-details__toggle>span *{overflow:hidden !important}}"}},[257,"mg-details",{toggleClosed:[1,"toggle-closed"],toggleOpened:[1,"toggle-opened"],hideSummary:[4,"hide-summary"],expanded:[1028]},void 0,{toggleClosed:[{validateTitles:0}],toggleOpened:[{validateTitles:0}],expanded:[{handleExpanded:0}]}]);function l(){"undefined"!=typeof customElements&&["mg-details","mg-icon"].forEach((t=>{switch(t){case"mg-details":customElements.get(e(t))||customElements.define(e(t),d);break;case"mg-icon":customElements.get(e(t))||o()}}))}l();const r=d,g=l;export{r as MgDetails,g as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as
|
|
1
|
+
import{transformTag as t,proxyCustomElement as i,HTMLElement as e,createEvent as s,h as a}from"@stencil/core/internal/client";import{c as r,C as o,a as n,t as h}from"./index2.js";import{n as l}from"./index3.js";import{i as m}from"./index4.js";import{i as d}from"./mg-input.conf.js";const c=["form","search","none","presentation"],f=["default","hide"],g=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.formValid=s(this,"form-valid",7),this.formSubmit=s(this,"form-submit",7),this.formReset=s(this,"form-reset",7),this.classAllRequired="mg-c-form--all-required",this.classLabelOnTop="mg-c-form--label-on-top",this.identifier=r("mg-form"),this.name=this.identifier,this.readonly=!1,this.labelOnTop=!1,this.disabled=!1,this.classCollection=new o(["mg-c-form"]),this.hasActions=!1,this.setRequiredMessage=()=>{if(this.requiredMessageText=null,this.classCollection.delete(this.classAllRequired),"hide"===this.requiredMessage)return;if("default"===this.requiredMessage)return void(this.requiredMessageText=this.messages.form.required);const t=t=>!(t.disabled||t.readonly),i=t=>"MG-INPUT-TOGGLE"===t.nodeName;if(!this.disabled&&!this.readonly&&this.mgInputs.some((e=>t(e)&&!i(e)))){const e=this.mgInputs.filter(t),s=e.filter((t=>!i(t)&&t.required));[s.length,e.length].every((t=>1===t))||s.length>1&&s.length===e.filter((t=>!i(t))).length?(this.requiredMessageText=this.getRequiredMessageBasedOnCount(s,"allRequiredSingle","allRequired"),this.classCollection.add(this.classAllRequired)):s.length>0&&(this.requiredMessageText=this.getRequiredMessageBasedOnCount(s,"requiredSingle","required"))}},this.getRequiredMessageBasedOnCount=(t,i,e)=>this.messages.form[1===t.length?i:e],this.checkValidity=()=>{this.setRequiredMessage(),this.valid=!this.mgInputs.some((t=>t.invalid)),this.invalid=!this.valid,this.formValid.emit(this.valid)},this.handleFormSubmit=t=>{t.preventDefault(),this.formSubmit.emit()},this.setMgInputs=()=>{this.mgInputs=Array.from(this.element.querySelectorAll("*")).filter((t=>t.nodeName.startsWith("MG-INPUT"))),this.mgInputs.forEach((t=>{this.labelOnTop&&(t.labelOnTop=!0),"MG-INPUT-FILE"===t.nodeName&&(this.readonly?t.setAttribute("hidden",""):t.removeAttribute("hidden")),this.readonly&&!d(t)?t.readonly=!0:this.disabled?t.disabled=!0:t.addEventListener("input-valid",this.checkValidity)}))}}watchIdentifier(t){n(t)||console.error(`<mg-form> prop "identifier" value is invalid. Passed value: ${h(t)}.`)}validateRequiredMessage(t){if(t&&!f.includes(t))throw Error(`<mg-form> prop "requiredMessage" must be one of: ${f.join(", ")}. Passed value: ${h(t)}.`)}validateAriaRole(t){if(t&&!c.includes(t))throw Error(`<mg-form> prop "ariaRole" must be one of: ${c.join(", ")}. Passed value: ${h(t)}.`)}handlelabelOnTop(t){t?this.classCollection.add(this.classLabelOnTop):this.classCollection.delete(this.classLabelOnTop)}handleAttributeChange(){this.setMgInputs(),this.setRequiredMessage()}async displayError(){this.readonly||([...Array.from(this.element.querySelectorAll("*")).filter((t=>t.nodeName.startsWith("MG-FIELDSET"))),...this.mgInputs].forEach((t=>{var i;null===(i=t.displayError)||void 0===i||i.call(t)})),this.checkValidity())}async reset(){this.readonly||(await Promise.all(this.mgInputs.map((async t=>{void 0!==t.reset&&await t.reset()}))),this.checkValidity(),this.formReset.emit(!0))}componentWillLoad(){this.messages=m(this.element).messages,l(this),this.watchIdentifier(this.identifier),this.validateAriaRole(this.ariaRole),this.validateRequiredMessage(this.requiredMessage),this.handlelabelOnTop(this.labelOnTop),this.hasActions=null!==this.element.querySelector('[slot="actions"]'),this.mgButtons=Array.from(this.element.querySelectorAll("mg-button")),this.mgButtons.forEach((t=>{t.setAttribute("form",this.identifier),"reset"===t.type&&t.addEventListener("click",(()=>{this.reset()}))})),this.setMgInputs(),Promise.all(this.mgInputs.map((async t=>{try{await t.componentOnReady()}catch(t){}}))).then((()=>{this.checkValidity()}))}componentDidLoad(){const t={childList:!0,subtree:!0};new MutationObserver((i=>{i.some((i=>Object.keys(t).includes(i.type)))&&(this.setMgInputs(),this.checkValidity(),this.hasActions=null!==this.element.querySelector('[slot="actions"]'))})).observe(this.element,t)}render(){return a("form",{key:"c851e6f19af32f28cad695daa1f42ddff10796a0",class:this.classCollection.join(),id:this.identifier,name:this.name,onSubmit:this.handleFormSubmit,role:this.ariaRole},this.requiredMessageText&&a("p",{key:"7f92b35872c938e87959acac8841937ad503d98f",innerHTML:this.requiredMessageText}),a("slot",{key:"e75e90f1fe3076d93df82a7a426b17d82035e0cf"}),!this.readonly&&!this.disabled&&this.hasActions&&a("div",{key:"a472cf024a61d6be1665d149749ce7d560a00473",class:"mg-c-form__actions"},a("slot",{key:"f9098c711cb2d2714057c4f14d6df295b75de774",name:"actions"})))}get element(){return this}static get watchers(){return{identifier:[{watchIdentifier:0}],requiredMessage:[{validateRequiredMessage:0},{handleAttributeChange:0}],ariaRole:[{validateAriaRole:0}],labelOnTop:[{handlelabelOnTop:0}],readonly:[{handleAttributeChange:0}],disabled:[{handleAttributeChange:0}]}}static get style(){return".mg-u-form-legacy{--mg-c-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk{color:var(--mg-b-color-danger)}.mg-c-form{--mg-c-input-title-width:var(--mg-c-form-inputs-title-width, calc(28 * var(--mg-b-size-8)));--mg-c-input-margin-bottom:var(--mg-b-size-16);--mg-c-input-title-horizontal-space:var(--mg-b-size-32);--mg-c-form-inputs-field-offset:calc(var(--mg-c-input-title-width) + var(--mg-c-input-title-horizontal-space))}.mg-c-form.mg-c-form--all-required{--mg-c-input-title-display:none}.mg-c-form.mg-c-form--label-on-top{--mg-c-form-inputs-field-offset:0}.mg-c-form>p{font-size:var(--mg-b-font-size-small);margin-block-start:0}.mg-c-form ::slotted(*:last-child){--mg-c-input-margin-bottom:0}.mg-c-form__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--mg-b-size-8)}::slotted(.mg-l-form-field-align){margin-block-end:var(--mg-c-input-margin-bottom);margin-inline-start:var(--mg-c-form-inputs-field-offset)}@media screen and (max-width: 767px){.mg-c-form{--mg-c-form-inputs-field-offset:0}}"}},[257,"mg-form",{identifier:[1],name:[1],readonly:[4],requiredMessage:[1,"required-message"],ariaRole:[1,"aria-role"],labelOnTop:[4,"label-on-top"],disabled:[4],valid:[1028],invalid:[1028],classCollection:[32],requiredMessageText:[32],hasActions:[32],displayError:[64],reset:[64]},void 0,{identifier:[{watchIdentifier:0}],requiredMessage:[{validateRequiredMessage:0},{handleAttributeChange:0}],ariaRole:[{validateAriaRole:0}],labelOnTop:[{handlelabelOnTop:0}],readonly:[{handleAttributeChange:0}],disabled:[{handleAttributeChange:0}]}]);function u(){"undefined"!=typeof customElements&&["mg-form"].forEach((i=>{"mg-form"===i&&(customElements.get(t(i))||customElements.define(t(i),g))}))}u();const p=g,b=u;export{p as MgForm,b as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformTag as e,proxyCustomElement as s,HTMLElement as t,h as i}from"@stencil/core/internal/client";import{C as l,t as a,b as m}from"./index2.js";const r=["small","medium","large"],g=["vertical","horizontal"],o=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="medium",this.direction="vertical",this.classCollection=new l(["mg-c-illustrated-message"])}watchSize(e,s){if(!r.includes(e))throw Error(`<mg-illustrated-message> prop "size" must be one of: ${r.join(", ")}. Passed value: ${a(e)}.`);void 0!==s&&this.classCollection.delete("mg-c-illustrated-message--size-"+s),this.classCollection.add("mg-c-illustrated-message--size-"+e)}watchDirection(e,s){if(void 0!==e&&!g.includes(e))throw Error(`<mg-illustrated-message> prop "direction" must be one of: ${g.join(", ")}. Passed value: ${a(e)}.`);"horizontal"===e?this.classCollection.add("mg-c-illustrated-message--direction-horizontal"):"horizontal"===s&&this.classCollection.delete("mg-c-illustrated-message--direction-horizontal")}validateSlots(){const e=["h1","h2","h3","h4","h5","h6"],s=this.element.querySelector('[slot="title"]'),t=this.element.querySelectorAll('[slot="illustration"]');if(0===this.element.querySelectorAll('[slot="details"]').length&&null===s)throw Error('<mg-illustrated-message> Slot "title" or "details" must be present.');if(null!==s&&!m(s,e))throw Error(`<mg-illustrated-message> Slotted title must be a heading: ${e.join(", ")}.`);if(1!==t.length)throw Error("<mg-illustrated-message> Slotted illustration must be present and unique.");t[0].setAttribute("aria-hidden","true")}componentWillLoad(){this.watchDirection(this.direction),this.watchSize(this.size),this.validateSlots()}render(){return i("div",{key:"
|
|
1
|
+
import{transformTag as e,proxyCustomElement as s,HTMLElement as t,h as i}from"@stencil/core/internal/client";import{C as l,t as a,b as m}from"./index2.js";const r=["small","medium","large"],g=["vertical","horizontal"],c=["left","center","right"],o=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="medium",this.direction="vertical",this.align="center",this.classCollection=new l(["mg-c-illustrated-message"])}watchSize(e,s){if(!r.includes(e))throw Error(`<mg-illustrated-message> prop "size" must be one of: ${r.join(", ")}. Passed value: ${a(e)}.`);void 0!==s&&this.classCollection.delete("mg-c-illustrated-message--size-"+s),this.classCollection.add("mg-c-illustrated-message--size-"+e)}watchDirection(e,s){if(void 0!==e&&!g.includes(e))throw Error(`<mg-illustrated-message> prop "direction" must be one of: ${g.join(", ")}. Passed value: ${a(e)}.`);"horizontal"===e?this.classCollection.add("mg-c-illustrated-message--direction-horizontal"):"horizontal"===s&&this.classCollection.delete("mg-c-illustrated-message--direction-horizontal")}watchAlign(e,s){if(!c.includes(e))throw Error(`<mg-illustrated-message> prop "align" must be one of: ${c.join(", ")}. Passed value: ${a(e)}.`);void 0!==s&&this.classCollection.delete("mg-c-illustrated-message--align-"+s),this.classCollection.add("mg-c-illustrated-message--align-"+e)}validateSlots(){const e=["h1","h2","h3","h4","h5","h6"],s=this.element.querySelector('[slot="title"]'),t=this.element.querySelectorAll('[slot="illustration"]');if(0===this.element.querySelectorAll('[slot="details"]').length&&null===s)throw Error('<mg-illustrated-message> Slot "title" or "details" must be present.');if(null!==s&&!m(s,e))throw Error(`<mg-illustrated-message> Slotted title must be a heading: ${e.join(", ")}.`);if(1!==t.length)throw Error("<mg-illustrated-message> Slotted illustration must be present and unique.");t[0].setAttribute("aria-hidden","true")}componentWillLoad(){this.watchDirection(this.direction),this.watchSize(this.size),this.watchAlign(this.align),this.validateSlots()}render(){return i("div",{key:"b914eadabb438b17c1cddc6b6e0167facf264a37",class:this.classCollection.join()},i("div",{key:"c2c55e775db2a622948ebd0d2efef8336520a52a",class:"mg-c-illustrated-message__illustration"},i("slot",{key:"1b549999f75245d17d7c4ba5696af25921c1725a",name:"illustration"})),i("div",{key:"6f19510b6775bbd366dbb4127ad1ca7b1be8a261",class:"mg-c-illustrated-message__slots"},i("slot",{key:"db37d12c2812c8fca129f4d0f24cb011198ba474",name:"title"}),i("slot",{key:"2a1aaf4fe8ea18a971c741c03e05d146584567a7",name:"details"})))}get element(){return this}static get watchers(){return{size:[{watchSize:0}],direction:[{watchDirection:0}],align:[{watchAlign:0}]}}static get style(){return".mg-c-illustrated-message{display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;padding:var(--mg-c-illustrated-message-spacing-vertical) var(--mg-b-size-16);gap:var(--mg-b-size-16) var(--mg-b-size-64);max-inline-size:calc(60*var(--mg-b-size-8));text-align:center}.mg-c-illustrated-message__illustration{max-block-size:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__illustration ::slotted([slot=illustration]){block-size:auto;inline-size:100%;margin-inline:auto;max-block-size:calc(15*var(--mg-b-size-8));max-inline-size:calc(15*var(--mg-b-size-8))}.mg-c-illustrated-message__slots{display:flex;flex-direction:column;gap:var(--mg-b-size-8)}.mg-c-illustrated-message__slots ::slotted([slot=title]){margin:0;font-family:var(--mg-b-font-family-heading) !important;font-size:var(--mg-b-font-size-h2) !important}.mg-c-illustrated-message__slots ::slotted([slot=details]){margin:0}.mg-c-illustrated-message.mg-c-illustrated-message--size-small{--mg-c-illustrated-message-spacing-vertical:var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__slots{gap:var(--mg-b-size-2)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration{max-block-size:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-block-size:var(--mg-b-size-64);max-inline-size:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration{max-block-size:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration ::slotted([slot=illustration]){max-block-size:calc(23*var(--mg-b-size-8));max-inline-size:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{inline-size:fit-content;max-inline-size:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-inline-size:calc(60*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__illustration ::slotted(img[slot=illustration]){block-size:calc(15*var(--mg-b-size-8));inline-size:auto}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-small .mg-c-illustrated-message__illustration ::slotted(img[slot=illustration]){block-size:var(--mg-b-size-64)}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-large .mg-c-illustrated-message__illustration ::slotted(img[slot=illustration]){block-size:calc(23*var(--mg-b-size-8))}.mg-c-illustrated-message.mg-c-illustrated-message--align-left{margin-inline:0 auto}.mg-c-illustrated-message.mg-c-illustrated-message--align-center{margin-inline:auto}.mg-c-illustrated-message.mg-c-illustrated-message--align-right{margin-inline:auto 0}@container (width > 52.8rem){.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal{flex-direction:row;align-items:center;column-gap:var(--mg-b-size-48);text-align:left}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__slots{max-inline-size:unset}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal .mg-c-illustrated-message__illustration{flex:1 0 auto;max-inline-size:fit-content}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-small{column-gap:var(--mg-b-size-24)}.mg-c-illustrated-message.mg-c-illustrated-message--direction-horizontal.mg-c-illustrated-message--size-large{column-gap:var(--mg-b-size-64)}}:host{display:block;container-type:inline-size;inline-size:100%}"}},[257,"mg-illustrated-message",{size:[1],direction:[1],align:[1],classCollection:[32]},void 0,{size:[{watchSize:0}],direction:[{watchDirection:0}],align:[{watchAlign:0}]}]);function n(){"undefined"!=typeof customElements&&["mg-illustrated-message"].forEach((s=>{"mg-illustrated-message"===s&&(customElements.get(e(s))||customElements.define(e(s),o))}))}n();const d=o,u=n;export{d as MgIllustratedMessage,u as defineCustomElement}
|