@mgdis/mg-components 3.2.0 → 3.3.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-badge_21.cjs.entry.js +64 -19
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-modal.cjs.entry.js +2 -2
- package/dist/cjs/mg-popover.cjs.entry.js +0 -4
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +19 -7
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +11 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +3 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +9 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +111 -11
- package/dist/collection/components/molecules/mg-panel/mg-panel.stories.js +9 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +0 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +21 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.stories.js +1 -0
- package/dist/collection/variables.css +1 -1
- package/dist/collection/variables.scss +1 -1
- package/dist/components/mg-button2.js +3 -3
- package/dist/components/mg-icon2.js +11 -0
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-modal.js +2 -2
- package/dist/components/mg-panel.js +46 -13
- package/dist/components/mg-popover.js +0 -4
- package/dist/components/mg-tabs.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-badge_21.entry.js +64 -19
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-modal.entry.js +2 -2
- package/dist/esm/mg-popover.entry.js +0 -4
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mg-badge_21.entry.js +2 -2
- package/dist/esm-es5/mg-components.js +1 -1
- package/dist/esm-es5/mg-modal.entry.js +1 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-136c8d6f.system.entry.js +2 -0
- package/dist/mg-components/p-6f173f62.system.entry.js +1 -0
- package/dist/mg-components/p-8cb61c3f.system.js +1 -1
- package/dist/mg-components/p-b7488a4c.entry.js +1 -0
- package/dist/mg-components/p-c1ffb2e1.entry.js +1 -0
- package/dist/mg-components/variables.css +1 -1
- package/dist/mg-components/variables.scss +1 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +24 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.stories.d.ts +5 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +5 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +5 -0
- package/dist/types/components.d.ts +34 -2
- package/package.json +1 -1
- package/dist/mg-components/p-3633e9e1.system.entry.js +0 -2
- package/dist/mg-components/p-c46fbd54.entry.js +0 -1
- package/dist/mg-components/p-cd2a4acc.system.entry.js +0 -1
- package/dist/mg-components/p-dfe25da3.entry.js +0 -1
|
@@ -174,7 +174,7 @@ export class MgInputToggle {
|
|
|
174
174
|
*/
|
|
175
175
|
render() {
|
|
176
176
|
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, width: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, displayCharacterLeft: undefined, characterLeftTemplate: undefined, maxlength: undefined, helpText: this.helpText, errorMessage: undefined, isFieldset: false },
|
|
177
|
-
h("button", { type: "button", role: "switch", "aria-checked": this.checked, "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked },
|
|
177
|
+
h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked },
|
|
178
178
|
h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" },
|
|
179
179
|
h("slot", { name: "item-1" })),
|
|
180
180
|
h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" },
|
|
@@ -93,8 +93,9 @@ export class MgModal {
|
|
|
93
93
|
return (h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide },
|
|
94
94
|
h("article", { class: "mg-modal__dialog" },
|
|
95
95
|
h("header", { class: "mg-modal__header" },
|
|
96
|
-
this.closeButton && (h("
|
|
97
|
-
h("mg-
|
|
96
|
+
this.closeButton && (h("span", { class: "mg-modal__close-button" },
|
|
97
|
+
h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.modal.closeButton, onClick: this.handleClose },
|
|
98
|
+
h("mg-icon", { icon: "cross" })))),
|
|
98
99
|
h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)),
|
|
99
100
|
this.hasContent && (h("article", { class: "mg-modal__content" },
|
|
100
101
|
h("slot", { name: "content" }))),
|
|
@@ -9,16 +9,23 @@
|
|
|
9
9
|
flex-wrap: wrap;
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
padding: 0 1rem 0 0.3rem;
|
|
12
|
-
align-items:
|
|
12
|
+
align-items: flex-start;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.mg-panel__header-left,
|
|
16
16
|
.mg-panel__header-right {
|
|
17
17
|
display: flex;
|
|
18
|
-
flex-grow: 1;
|
|
19
18
|
margin: 0.3rem 0;
|
|
20
19
|
}
|
|
21
20
|
|
|
21
|
+
.mg-panel__header-left--full {
|
|
22
|
+
flex: 1 1 auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mg-panel__header-right {
|
|
26
|
+
flex: 1 auto;
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
.mg-panel__header-left mg-input-text {
|
|
23
30
|
flex-grow: 1;
|
|
24
31
|
}
|
|
@@ -15,6 +15,10 @@ export class MgPanel {
|
|
|
15
15
|
* Panel is opened
|
|
16
16
|
*/
|
|
17
17
|
this.expanded = false;
|
|
18
|
+
/**
|
|
19
|
+
* Disable possibility to toggle expand
|
|
20
|
+
*/
|
|
21
|
+
this.expandToggleDisabled = false;
|
|
18
22
|
/**
|
|
19
23
|
* Panel title is editabled
|
|
20
24
|
*/
|
|
@@ -47,7 +51,9 @@ export class MgPanel {
|
|
|
47
51
|
* @returns {void}
|
|
48
52
|
*/
|
|
49
53
|
this.handleCollapseButton = () => {
|
|
50
|
-
|
|
54
|
+
if (!this.expandToggleDisabled) {
|
|
55
|
+
this.expanded = !this.expanded;
|
|
56
|
+
}
|
|
51
57
|
};
|
|
52
58
|
/**
|
|
53
59
|
* Edit button click handler
|
|
@@ -81,13 +87,12 @@ export class MgPanel {
|
|
|
81
87
|
* @returns {void}
|
|
82
88
|
*/
|
|
83
89
|
this.handleValidateEditButton = () => {
|
|
84
|
-
if (this.
|
|
85
|
-
this.
|
|
86
|
-
|
|
90
|
+
if (this.editInputElement.valid) {
|
|
91
|
+
if (this.updatedPanelTitle !== undefined)
|
|
92
|
+
this.panelTitle = this.updatedPanelTitle;
|
|
93
|
+
this.toggleIsEditing();
|
|
94
|
+
}
|
|
87
95
|
};
|
|
88
|
-
/*************
|
|
89
|
-
* Lifecycle *
|
|
90
|
-
*************/
|
|
91
96
|
/**
|
|
92
97
|
* Header left conditional render
|
|
93
98
|
*
|
|
@@ -95,20 +100,20 @@ export class MgPanel {
|
|
|
95
100
|
* @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
|
|
96
101
|
*/
|
|
97
102
|
this.headerLeft = () => {
|
|
98
|
-
const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", class: "mg-panel__collapse-button", identifier: `${this.identifier}-collapse-button`, expanded: this.expanded, controls: `${this.identifier}-content
|
|
103
|
+
const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", class: "mg-panel__collapse-button", identifier: `${this.identifier}-collapse-button`, expanded: this.expanded, controls: `${this.identifier}-content`, disabled: this.expandToggleDisabled },
|
|
99
104
|
h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }),
|
|
100
105
|
!this.isEditing && this.panelTitle));
|
|
101
106
|
if (this.titleEditable && !this.isEditing) {
|
|
102
107
|
return [
|
|
103
108
|
collapseButton(),
|
|
104
|
-
h("mg-button", { "is-icon": true, variant: "
|
|
109
|
+
h("mg-button", { "is-icon": true, variant: "flat", label: messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` },
|
|
105
110
|
h("mg-icon", { icon: "pen" })),
|
|
106
111
|
];
|
|
107
112
|
}
|
|
108
113
|
if (this.titleEditable && this.isEditing) {
|
|
109
114
|
return [
|
|
110
115
|
collapseButton(),
|
|
111
|
-
h("mg-input-text", { label: messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) },
|
|
116
|
+
h("mg-input-text", { label: messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) },
|
|
112
117
|
h("mg-button", { slot: "append-input", label: messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` },
|
|
113
118
|
h("mg-icon", { icon: "cross" })),
|
|
114
119
|
h("mg-button", { slot: "append-input", label: messages.general.validate, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` },
|
|
@@ -121,6 +126,28 @@ export class MgPanel {
|
|
|
121
126
|
handelTileChange(newValue) {
|
|
122
127
|
this.titleChange.emit(newValue);
|
|
123
128
|
}
|
|
129
|
+
validatetitlePattern(newValue) {
|
|
130
|
+
if (newValue && !this.titleEditable) {
|
|
131
|
+
throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
|
|
132
|
+
}
|
|
133
|
+
if (newValue && this.titlePatternErrorMessage === undefined) {
|
|
134
|
+
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
handleExpanded(newValue) {
|
|
138
|
+
this.expandedChange.emit(newValue);
|
|
139
|
+
}
|
|
140
|
+
/*************
|
|
141
|
+
* Lifecycle *
|
|
142
|
+
*************/
|
|
143
|
+
/**
|
|
144
|
+
* Check if props are well configured on init
|
|
145
|
+
*
|
|
146
|
+
* @returns {void}
|
|
147
|
+
*/
|
|
148
|
+
componentWillLoad() {
|
|
149
|
+
this.validatetitlePattern(this.titlePattern);
|
|
150
|
+
}
|
|
124
151
|
/**
|
|
125
152
|
* Edit DOM after render
|
|
126
153
|
*
|
|
@@ -140,7 +167,7 @@ export class MgPanel {
|
|
|
140
167
|
render() {
|
|
141
168
|
return (h("section", { class: this.classList.join(), id: this.identifier },
|
|
142
169
|
h("header", { class: "mg-panel__header", id: `${this.identifier}-header` },
|
|
143
|
-
h("div", { class:
|
|
170
|
+
h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()),
|
|
144
171
|
h("div", { class: "mg-panel__header-right" },
|
|
145
172
|
h("slot", { name: "header-right" }))),
|
|
146
173
|
h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded },
|
|
@@ -190,6 +217,40 @@ export class MgPanel {
|
|
|
190
217
|
"attribute": "panel-title",
|
|
191
218
|
"reflect": false
|
|
192
219
|
},
|
|
220
|
+
"titlePattern": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"mutable": true,
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "string",
|
|
225
|
+
"resolved": "string",
|
|
226
|
+
"references": {}
|
|
227
|
+
},
|
|
228
|
+
"required": false,
|
|
229
|
+
"optional": false,
|
|
230
|
+
"docs": {
|
|
231
|
+
"tags": [],
|
|
232
|
+
"text": "Panel title pattern"
|
|
233
|
+
},
|
|
234
|
+
"attribute": "title-pattern",
|
|
235
|
+
"reflect": false
|
|
236
|
+
},
|
|
237
|
+
"titlePatternErrorMessage": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"mutable": true,
|
|
240
|
+
"complexType": {
|
|
241
|
+
"original": "string",
|
|
242
|
+
"resolved": "string",
|
|
243
|
+
"references": {}
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"optional": false,
|
|
247
|
+
"docs": {
|
|
248
|
+
"tags": [],
|
|
249
|
+
"text": "Panel title pattern error message"
|
|
250
|
+
},
|
|
251
|
+
"attribute": "title-pattern-error-message",
|
|
252
|
+
"reflect": false
|
|
253
|
+
},
|
|
193
254
|
"expanded": {
|
|
194
255
|
"type": "boolean",
|
|
195
256
|
"mutable": true,
|
|
@@ -208,6 +269,24 @@ export class MgPanel {
|
|
|
208
269
|
"reflect": false,
|
|
209
270
|
"defaultValue": "false"
|
|
210
271
|
},
|
|
272
|
+
"expandToggleDisabled": {
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"mutable": true,
|
|
275
|
+
"complexType": {
|
|
276
|
+
"original": "boolean",
|
|
277
|
+
"resolved": "boolean",
|
|
278
|
+
"references": {}
|
|
279
|
+
},
|
|
280
|
+
"required": false,
|
|
281
|
+
"optional": false,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": "Disable possibility to toggle expand"
|
|
285
|
+
},
|
|
286
|
+
"attribute": "expand-toggle-disabled",
|
|
287
|
+
"reflect": false,
|
|
288
|
+
"defaultValue": "false"
|
|
289
|
+
},
|
|
211
290
|
"titleEditable": {
|
|
212
291
|
"type": "boolean",
|
|
213
292
|
"mutable": false,
|
|
@@ -247,9 +326,30 @@ export class MgPanel {
|
|
|
247
326
|
"resolved": "string",
|
|
248
327
|
"references": {}
|
|
249
328
|
}
|
|
329
|
+
}, {
|
|
330
|
+
"method": "expandedChange",
|
|
331
|
+
"name": "expanded-change",
|
|
332
|
+
"bubbles": true,
|
|
333
|
+
"cancelable": true,
|
|
334
|
+
"composed": true,
|
|
335
|
+
"docs": {
|
|
336
|
+
"tags": [],
|
|
337
|
+
"text": "Emmited event when expanded change"
|
|
338
|
+
},
|
|
339
|
+
"complexType": {
|
|
340
|
+
"original": "boolean",
|
|
341
|
+
"resolved": "boolean",
|
|
342
|
+
"references": {}
|
|
343
|
+
}
|
|
250
344
|
}]; }
|
|
251
345
|
static get watchers() { return [{
|
|
252
346
|
"propName": "panelTitle",
|
|
253
347
|
"methodName": "handelTileChange"
|
|
348
|
+
}, {
|
|
349
|
+
"propName": "titlePattern",
|
|
350
|
+
"methodName": "validatetitlePattern"
|
|
351
|
+
}, {
|
|
352
|
+
"propName": "expanded",
|
|
353
|
+
"methodName": "handleExpanded"
|
|
254
354
|
}]; }
|
|
255
355
|
}
|
|
@@ -2,6 +2,7 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
export default {
|
|
3
3
|
component: 'mg-panel',
|
|
4
4
|
title: 'Molecules/mg-panel',
|
|
5
|
+
parameters: { actions: { handles: ['title-change'] } },
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* 1. camelCase arguments must be written in the template, for exemple labelOnTop must be placed in the template as label-on-top={args.labelOnTop}
|
|
@@ -13,8 +14,14 @@ const Template = args => {
|
|
|
13
14
|
delete args.panelTitle;
|
|
14
15
|
const titleEditable = args.titleEditable;
|
|
15
16
|
delete args.titleEditable;
|
|
17
|
+
const expandToggleDisabled = args.expandToggleDisabled;
|
|
18
|
+
delete args.expandToggleDisabled;
|
|
19
|
+
const titlePattern = args.titlePattern;
|
|
20
|
+
delete args.titlePattern;
|
|
21
|
+
const titlePatternErrorMessage = args.titlePatternErrorMessage;
|
|
22
|
+
delete args.titlePatternErrorMessage;
|
|
16
23
|
// return element
|
|
17
|
-
return (h("mg-panel", Object.assign({}, args, { "panel-title": panelTitle, "title-editable": titleEditable }),
|
|
24
|
+
return (h("mg-panel", Object.assign({}, args, { "panel-title": panelTitle, "title-editable": titleEditable, "expand-toggle-disabled": expandToggleDisabled, "title-pattern": titlePattern, "title-pattern-error-message": titlePatternErrorMessage }),
|
|
18
25
|
h("div", null, "Content"),
|
|
19
26
|
h("div", { slot: "header-right" },
|
|
20
27
|
h("mg-button", { variant: "secondary" },
|
|
@@ -28,4 +35,5 @@ MgPanel.args = {
|
|
|
28
35
|
panelTitle: 'title',
|
|
29
36
|
expanded: false,
|
|
30
37
|
titleEditable: true,
|
|
38
|
+
expandToggleDisabled: true,
|
|
31
39
|
};
|
|
@@ -32,8 +32,6 @@ export class MgPopover {
|
|
|
32
32
|
* @param {MouseEvent} event mouse event
|
|
33
33
|
* @returns {void}
|
|
34
34
|
*/
|
|
35
|
-
// Unable to trigger document events in unit tests: https://gitlab.mgdis.fr/core/core-ui/mg-components/-/issues/57
|
|
36
|
-
/* istanbul ignore next */
|
|
37
35
|
this.clickOutside = (event) => {
|
|
38
36
|
var _a;
|
|
39
37
|
if (!this.disabled && ((_a = event.target.closest(`#${this.identifier}`)) === null || _a === void 0 ? void 0 : _a.parentElement.nodeName) !== 'MG-POPOVER') {
|
|
@@ -55,8 +53,6 @@ export class MgPopover {
|
|
|
55
53
|
// hide when click outside
|
|
56
54
|
// setTimeout is used to prevent event to trigger after creation
|
|
57
55
|
setTimeout(() => {
|
|
58
|
-
// Unable to trigger document events in unit tests: https://gitlab.mgdis.fr/core/core-ui/mg-components/-/issues/57
|
|
59
|
-
/* istanbul ignore next */
|
|
60
56
|
document.addEventListener('click', this.clickOutside, false);
|
|
61
57
|
}, 0);
|
|
62
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, h, Host, Prop, State, Element, Watch } from '@stencil/core';
|
|
1
|
+
import { Component, Event, h, Host, Prop, State, Element, Watch } from '@stencil/core';
|
|
2
2
|
import { createID, ClassList, allItemsAreString } from '../../../utils/components.utils';
|
|
3
3
|
import { sizes } from './mg-tabs.conf';
|
|
4
4
|
/**
|
|
@@ -97,9 +97,12 @@ export class MgTabs {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
validateActiveTab(newValue) {
|
|
100
|
-
if (
|
|
100
|
+
if (newValue < 1 || newValue > this.tabs.length) {
|
|
101
101
|
throw new Error('<mg-tabs> prop "activeTab" must be between 1 and tabs length.');
|
|
102
102
|
}
|
|
103
|
+
else {
|
|
104
|
+
this.activeTabChange.emit(newValue);
|
|
105
|
+
}
|
|
103
106
|
}
|
|
104
107
|
/*************
|
|
105
108
|
* Lifecycle *
|
|
@@ -246,6 +249,22 @@ export class MgTabs {
|
|
|
246
249
|
"tabs": {},
|
|
247
250
|
"classList": {}
|
|
248
251
|
}; }
|
|
252
|
+
static get events() { return [{
|
|
253
|
+
"method": "activeTabChange",
|
|
254
|
+
"name": "active-tab-change",
|
|
255
|
+
"bubbles": true,
|
|
256
|
+
"cancelable": true,
|
|
257
|
+
"composed": true,
|
|
258
|
+
"docs": {
|
|
259
|
+
"tags": [],
|
|
260
|
+
"text": "Emited event when active tab change"
|
|
261
|
+
},
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "number",
|
|
264
|
+
"resolved": "number",
|
|
265
|
+
"references": {}
|
|
266
|
+
}
|
|
267
|
+
}]; }
|
|
249
268
|
static get elementRef() { return "element"; }
|
|
250
269
|
static get watchers() { return [{
|
|
251
270
|
"propName": "size",
|
|
@@ -9,6 +9,7 @@ export default {
|
|
|
9
9
|
control: { type: 'select' },
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
|
+
parameters: { actions: { handles: ['active-tab-change'] } },
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
15
|
* 1. camelCase arguments must be written in the template, for exemple labelOnTop must be placed in the template as label-on-top={args.labelOnTop}
|
|
@@ -5,9 +5,9 @@ import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* List of all possibles variants
|
|
7
7
|
*/
|
|
8
|
-
const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat'];
|
|
8
|
+
const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success'];
|
|
9
9
|
|
|
10
|
-
const mgButtonCss = ".mg-button.sc-mg-button{position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.6rem;-moz-column-gap:0.6rem;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);-webkit-box-sizing:border-box;box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;font-family:inherit;text-decoration:none;font-weight:normal;text-align:left;-ms-touch-action:manipulation;touch-action:manipulation}.mg-button[disabled].sc-mg-button,.mg-button[aria-disabled].sc-mg-button,.mg-button.disabled.sc-mg-button{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon.sc-mg-button{padding:0;-ms-flex-pack:center;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--font-size)}.mg-button.mg-button--primary.sc-mg-button{border-color:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));border-color:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - 10%));color:hsl(var(--mg-button-primary-font-color));background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))), to(hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--primary.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary.sc-mg-button{border-color:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));border-color:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - 10%));color:hsl(var(--mg-button-secondary-font-color));background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))), to(hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--secondary.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger.sc-mg-button{border-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));border-color:hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - 10%));color:hsl(var(--color-neutral));background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))), to(hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--danger.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt.sc-mg-button{border-color:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));border-color:hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - 10%));color:hsl(var(--color-danger));background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))), to(hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--danger-alt.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info.sc-mg-button{border-color:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));border-color:hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - 10%));color:hsl(var(--color-neutral));background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))), to(hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--info.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--flat.sc-mg-button{background:none;border:none}.mg-button.mg-button--flat.sc-mg-button:hover:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:focus:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:active:not([disabled],[aria-disabled].sc-mg-button,.disabled).sc-mg-button{background:hsla(var(--color-dark), 0.1)}.mg-button.sc-mg-button mg-icon.sc-mg-button:only-child,.mg-button .sc-mg-button-s>mg-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-negative:0;flex-shrink:0;line-height:1;margin:auto 0}.mg-button.mg-button--loading.sc-mg-button>mg-icon.sc-mg-button{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.mg-button.mg-button--loading.sc-mg-button .mg-button__content.sc-mg-button{opacity:0}.mg-button__content.sc-mg-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.6rem;-moz-column-gap:0.6rem;column-gap:0.6rem}mg-button.sc-mg-button{display:inline-block}.mg-button.sc-mg-button,mg-button.sc-mg-button{vertical-align:middle;max-width:100%}";
|
|
10
|
+
const mgButtonCss = ".mg-button.sc-mg-button{position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.6rem;-moz-column-gap:0.6rem;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);-webkit-box-sizing:border-box;box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;font-family:inherit;text-decoration:none;font-weight:normal;text-align:left;-ms-touch-action:manipulation;touch-action:manipulation}.mg-button[disabled].sc-mg-button,.mg-button[aria-disabled=true].sc-mg-button,.mg-button.disabled.sc-mg-button{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon.sc-mg-button{padding:0;-ms-flex-pack:center;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--font-size)}.mg-button.mg-button--primary.sc-mg-button{border-color:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));border-color:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - 10%));color:hsl(var(--mg-button-primary-font-color));background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))), to(hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--primary.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--primary.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary.sc-mg-button{border-color:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));border-color:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - 10%));color:hsl(var(--mg-button-secondary-font-color));background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))), to(hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--secondary.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--secondary.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger.sc-mg-button{border-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));border-color:hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - 10%));color:hsl(var(--color-neutral));background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))), to(hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--danger.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt.sc-mg-button{border-color:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));border-color:hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - 10%));color:hsl(var(--color-danger));background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))), to(hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--danger-alt.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--danger-alt.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info.sc-mg-button{border-color:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));border-color:hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - 10%));color:hsl(var(--color-neutral));background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))), to(hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--info.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--info.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success.sc-mg-button{border-color:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l));border-color:hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - 10%));color:hsl(var(--color-dark));background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l));background:-webkit-gradient(linear, left top, left bottom, from(hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))), to(hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%))));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)))}.mg-button.mg-button--success.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--success.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--success.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button.mg-button--flat.sc-mg-button{background:none;border:none}.mg-button.mg-button--flat.sc-mg-button:hover:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:focus:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button,.mg-button.mg-button--flat.sc-mg-button:active:not([disabled],[aria-disabled=true].sc-mg-button,.disabled).sc-mg-button{background:hsla(var(--color-dark), 0.1)}.mg-button.sc-mg-button mg-icon.sc-mg-button:only-child,.mg-button .sc-mg-button-s>mg-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-negative:0;flex-shrink:0;line-height:1;margin:auto 0}.mg-button.mg-button--loading.sc-mg-button>mg-icon.sc-mg-button{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.mg-button.mg-button--loading.sc-mg-button .mg-button__content.sc-mg-button{opacity:0}.mg-button__content.sc-mg-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.6rem;-moz-column-gap:0.6rem;column-gap:0.6rem}mg-button.sc-mg-button{display:inline-block}.mg-button.sc-mg-button,mg-button.sc-mg-button{vertical-align:middle;max-width:100%}";
|
|
11
11
|
|
|
12
12
|
const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
@@ -122,7 +122,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
122
122
|
* @returns {HTMLElement} html element
|
|
123
123
|
*/
|
|
124
124
|
render() {
|
|
125
|
-
return (h("button", { id: this.identifier, class: this.classList.join(), "aria-label": this.label, "aria-disabled": this.disabled, "aria-expanded": this.expanded, "aria-controls": this.controls, "aria-haspopup": this.haspopup, onClick: this.handleClick }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null))));
|
|
125
|
+
return (h("button", { id: this.identifier, class: this.classList.join(), "aria-label": this.label, "aria-disabled": this.disabled.toString(), "aria-expanded": this.expanded, "aria-controls": this.controls, "aria-haspopup": this.haspopup, onClick: this.handleClick }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null))));
|
|
126
126
|
}
|
|
127
127
|
get element() { return this; }
|
|
128
128
|
static get watchers() { return {
|
|
@@ -19,6 +19,8 @@ const icons = {
|
|
|
19
19
|
'chevron-left': () => (h("path", { fill: "currentColor", d: "M3.79,7.43,10.31.9a.81.81,0,0,1,1.14,0h0l.77.76a.81.81,0,0,1,0,1.14L7,8l5.18,5.2a.81.81,0,0,1,0,1.14l-.77.76a.8.8,0,0,1-1.13,0h0L3.79,8.57a.79.79,0,0,1,0-1.13Z" })),
|
|
20
20
|
'chevron-right': () => (h("path", { fill: "currentColor", d: "M12.21,8.57,5.69,15.1a.81.81,0,0,1-1.14,0h0l-.77-.76a.81.81,0,0,1,0-1.14L9,8,3.78,2.8a.81.81,0,0,1,0-1.14L4.55.9A.8.8,0,0,1,5.68.9h0l6.53,6.53a.79.79,0,0,1,0,1.13Z" })),
|
|
21
21
|
'chevron-up': () => (h("path", { fill: "currentColor", d: "M8.57,3.79l6.53,6.52a.81.81,0,0,1,0,1.14h0l-.76.77a.81.81,0,0,1-1.14,0L8,7,2.8,12.22a.81.81,0,0,1-1.14,0L.9,11.45a.8.8,0,0,1,0-1.13h0L7.43,3.79a.79.79,0,0,1,1.13,0Z" })),
|
|
22
|
+
'clock': () => (h("path", { fill: "currentColor", d: "M8,.67C3.95,.67,.67,3.95,.67,8s3.28,7.33,7.33,7.33,7.33-3.28,7.33-7.33h0C15.33,3.95,12.05,.67,8,.67h0Zm1.69,10.33l-2.61-1.88c-.09-.07-.14-.17-.14-.28V3.84c0-.19,.16-.35,.35-.36h1.42c.2,0,.35,.16,.36,.36V7.93l1.87,1.37c.16,.1,.2,.32,.09,.47v.02h-.01l-.83,1.15c-.12,.15-.34,.18-.5,.06Z" })),
|
|
23
|
+
'conversation': () => (h("path", { fill: "currentColor", d: "M11.22,6.48c0-2.11-2.36-3.81-5.28-3.81S.67,4.37.67,6.48a3.15,3.15,0,0,0,1,2.19A5.17,5.17,0,0,1,.72,10a.2.2,0,0,0,0,.21.23.23,0,0,0,.19.12,4.79,4.79,0,0,0,2.25-.6,6.84,6.84,0,0,0,2.82.6C8.86,10.29,11.22,8.58,11.22,6.48Zm3.1,5.23a3.08,3.08,0,0,0,1-2.19C15.28,7.93,14,6.57,12,6a3.84,3.84,0,0,1,0,.48C12,9,9.3,11.05,6,11.05a7.16,7.16,0,0,1-.8-.05A5.6,5.6,0,0,0,10,13.33a6.7,6.7,0,0,0,2.82-.59,4.66,4.66,0,0,0,2.25.59.21.21,0,0,0,.19-.11.2.2,0,0,0,0-.21,5.15,5.15,0,0,1-.91-1.3Z" })),
|
|
22
24
|
'cross': () => (h("path", { fill: "currentColor", d: "M14.26 12.74 9.52 8l4.7-4.7a.29.29 0 0 0 0-.41l-1.1-1.1a.29.29 0 0 0-.41 0L8 6.48 3.26 1.74a.24.24 0 0 0-.34 0L1.74 2.91a.24.24 0 0 0 0 .34L6.48 8l-4.7 4.7a.29.29 0 0 0 0 .41l1.1 1.1a.29.29 0 0 0 .41 0L8 9.52l4.74 4.74a.24.24 0 0 0 .34 0l1.17-1.17a.24.24 0 0 0 0-.34Z" })),
|
|
23
25
|
'cross-circle': () => (h("path", { fill: "currentColor", d: "M8.06.67H8A7.33 7.33 0 0 0 .68 8v.1a7.42 7.42 0 0 0 7.23 7.23A7.33 7.33 0 1 0 8.06.67Zm3.6 9.57a.28.28 0 0 1 0 .4l-.19.2-.61.61-.2.19a.27.27 0 0 1-.39 0L8 9.41l-2.23 2.24a.27.27 0 0 1-.39 0l-.2-.2-.6-.6-.19-.2a.28.28 0 0 1 0-.4L6.6 8 4.36 5.76a.28.28 0 0 1 0-.4l1-1a.28.28 0 0 1 .4 0L8 6.59l2.24-2.24a.28.28 0 0 1 .4 0l.2.2.6.6.2.2a.28.28 0 0 1 0 .4L9.42 8Z" })),
|
|
24
26
|
'download': () => (h("path", { fill: "currentColor", d: "M6.44,2V6.09a.31.31,0,0,1-.31.31H4a.31.31,0,0,0-.31.29.33.33,0,0,0,.1.23l4,4a.29.29,0,0,0,.41,0h0l4-4a.3.3,0,0,0,0-.42A.29.29,0,0,0,12,6.4H9.91a.31.31,0,0,1-.31-.31h0V2a.29.29,0,0,0-.28-.3H6.74a.29.29,0,0,0-.3.28ZM1.69,13v1a.29.29,0,0,0,.29.29H14a.29.29,0,0,0,.29-.29V13a.29.29,0,0,0-.28-.3H2a.29.29,0,0,0-.33.25Z" })),
|
|
@@ -31,11 +33,18 @@ const icons = {
|
|
|
31
33
|
h("path", { fill: "currentColor", d: "M13.3 14.6V5.3H9.6c-.4 0-.7-.3-.7-.7V.7H3.3c-.3 0-.6.3-.6.6v13.3c0 .4.3.7.7.7h9.3c.3 0 .6-.3.6-.7zm-3-4.6H8.9c-.1 0-.2.1-.2.2v2.6c0 .1-.1.2-.2.2H6.9c-.1 0-.2-.1-.2-.2v-2.6c0-.1-.1-.2-.2-.2H5.1C5 9.9 5 9.8 5 9.7l2.5-2.6c.1-.1.2-.1.3 0l2.5 2.5.1.1c.1.2 0 .3-.1.3z" }),
|
|
32
34
|
],
|
|
33
35
|
'floppy-disk': () => (h("path", { fill: "currentColor", d: "m13.94 4.44-2.38-2.38a1.39 1.39 0 0 0-1-.39H3A1.35 1.35 0 0 0 1.67 3v10A1.35 1.35 0 0 0 3 14.33h10A1.35 1.35 0 0 0 14.33 13V5.4a1.39 1.39 0 0 0-.39-1ZM8 12.52a1.81 1.81 0 1 1 1.81-1.81A1.81 1.81 0 0 1 8 12.52Zm2.71-8.6v2.84a.34.34 0 0 1-.34.34H3.82a.34.34 0 0 1-.34-.34V3.82a.34.34 0 0 1 .34-.34h6.46a.35.35 0 0 1 .24.1l.1.1a.35.35 0 0 1 .1.24Z" })),
|
|
36
|
+
'history': () => [
|
|
37
|
+
h("path", { fill: "currentColor", d: "M8,1.67A6.37,6.37,0,0,0,3.6,3.42l-.91-.91a.6.6,0,0,0-.85,0h0a.58.58,0,0,0-.18.43V6.37A.61.61,0,0,0,2.24,7H5.68a.62.62,0,0,0,.62-.62A.69.69,0,0,0,6.12,6L5.05,4.87a4.29,4.29,0,1,1,.1,6.36.3.3,0,0,0-.41,0l-1,1a.3.3,0,0,0,0,.42h0A6.33,6.33,0,1,0,8,1.67Z" }),
|
|
38
|
+
h("path", { fill: "currentColor", d: "M9.85,9.3l-.36.36a.3.3,0,0,1-.43,0L7.45,8V5.15a.3.3,0,0,1,.3-.3h.5a.3.3,0,0,1,.3.3V7.58l1.3,1.3A.31.31,0,0,1,9.85,9.3Z" }),
|
|
39
|
+
],
|
|
34
40
|
'info-circle': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67ZM9 12a.29.29 0 0 1-.3.3H7.35a.29.29 0 0 1-.3-.3V7.32A.29.29 0 0 1 7.33 7h1.32a.29.29 0 0 1 .35.3Zm0-6.74a.29.29 0 0 1-.3.3H7.35a.29.29 0 0 1-.3-.3V4a.29.29 0 0 1 .28-.3h1.32a.29.29 0 0 1 .3.28V4Z" })),
|
|
41
|
+
'lines-rectangle': () => (h("path", { fill: "currentColor", d: "M12.32.67H3.68c-.56 0-1.01.45-1.01 1.01v12.64c0 .56.45 1.01 1.01 1.01h8.64c.56 0 1.01-.45 1.01-1.01V1.68c0-.56-.45-1.01-1.01-1.01ZM9 11.25H4.67v-2H9v2Zm2.33-4.49H4.67v-2h6.67v2Z" })),
|
|
42
|
+
'list': () => (h("path", { fill: "currentColor", d: "M1.9 2.68c-.67 0-1.22.56-1.21 1.23 0 .67.56 1.22 1.23 1.21.67 0 1.22-.56 1.21-1.23 0-.32-.13-.63-.36-.86-.23-.23-.54-.36-.87-.35Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm13 .41H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Zm0-8.18H5.18c-.23 0-.41.18-.41.41v.81c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41V3.5c0-.23-.18-.41-.41-.41h-.03Zm0 4.09H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Z" })),
|
|
35
43
|
'loader': () => [
|
|
36
44
|
h("path", { fill: "currentColor", class: "loader__full-circle", d: "M8 2.67A5.33 5.33 0 1 1 2.67 8 5.33 5.33 0 0 1 8 2.67m0-2A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Z" }),
|
|
37
45
|
h("path", { fill: "currentColor", d: "M8 2.67v-2A7.33 7.33 0 0 0 .67 8h2A5.33 5.33 0 0 1 8 2.67Z" }),
|
|
38
46
|
],
|
|
47
|
+
'lock': () => (h("path", { fill: "currentColor", d: "M12 5.56h-.67v-1.4C11.37 2.28 9.88.71 8 .67 6.12.71 4.63 2.28 4.67 4.16v1.4H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39V7a1.37 1.37 0 0 0-1.28-1.44H12Zm-4 6.28c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Zm2.07-6.28H5.93v-1.4A2.12 2.12 0 0 1 8 2c1.17.03 2.1 1 2.07 2.17v1.39Z" })),
|
|
39
48
|
'log-in': () => (h("path", { fill: "currentColor", d: "M10.97,7.78h0L6.97,3.78c-.12-.12-.31-.12-.42,0h0c-.07,.06-.12,.15-.13,.24v2.07c0,.17-.13,.3-.3,.32H1.97c-.16,0-.29,.12-.3,.28h0v2.58c0,.16,.12,.29,.28,.3H6.11c.17,0,.3,.14,.3,.31v2.14c0,.16,.12,.29,.28,.3h0c.11,.01,.21-.03,.28-.11l4-4c.11-.12,.11-.3,0-.42Zm3.37,5.26h0v1c0,.16-.13,.28-.28,.28h-4.77c-.16,0-.28-.13-.28-.28v-1c0-.16,.13-.28,.28-.28h3.43V3.3h-3.42c-.16,0-.29-.13-.29-.29V1.97c0-.16,.13-.29,.29-.29h4.76c.16,0,.29,.13,.29,.29v.68h0V13.04Z" })),
|
|
40
49
|
'log-out': () => [
|
|
41
50
|
h("path", { fill: "currentColor", d: "M14.25,7.77h0l-4-4a.31.31,0,0,0-.43,0A.34.34,0,0,0,9.7,4V6.07a.32.32,0,0,1-.3.32H5.23a.3.3,0,0,0-.3.3V9.25a.3.3,0,0,0,.3.3H9.4a.31.31,0,0,1,.3.31V12a.3.3,0,0,0,.3.3.33.33,0,0,0,.23-.09l4-4A.29.29,0,0,0,14.25,7.77Z" }),
|
|
@@ -47,10 +56,12 @@ const icons = {
|
|
|
47
56
|
'pen': () => (h("path", { fill: "currentColor", d: "M1.67,11.69v2.64h2.64l7.78-7.78-2.64-2.64L1.67,11.69ZM14.13,4.51c.27-.28,.27-.72,0-1h0l-1.65-1.64c-.28-.27-.72-.27-1,0h0l-1.28,1.29,2.64,2.64,1.29-1.29Z" })),
|
|
48
57
|
'pen-fancy': () => (h("path", { fill: "currentColor", d: "M3.63,8.65c-.24,.07-.43,.26-.5,.5l-1.46,4.37,.11,.12,2.3-2.3c0-.06,0-.13,0-.19,0-.44,.35-.8,.79-.81,.44,0,.8,.35,.81,.79,0,.44-.35,.8-.79,.81,0,0-.01,0-.02,0h-.19l-2.3,2.3,.12,.11,4.37-1.46c.24-.07,.43-.26,.5-.5l.82-2.08-2.49-2.48-2.07,.82ZM10.8,2.35L6.27,7.28l2.42,2.42,4.94-4.52c2.1-1.86-.99-4.92-2.83-2.83Z" })),
|
|
49
58
|
'plus-circle': () => (h("path", { fill: "currentColor", d: "M8,0.7C4,0.7,0.7,4,0.7,8S4,15.3,8,15.3S15.3,12,15.3,8l0,0C15.3,4,12,0.7,8,0.7 C8,0.7,8,0.7,8,0.7z M12.3,8.8c0,0.2-0.2,0.4-0.4,0.4H9.2v2.7c0,0.2-0.2,0.4-0.4,0.4H7.2c-0.2,0-0.4-0.2-0.3-0.4V9.2H4.1 C3.9,9.2,3.7,9,3.7,8.8V7.2c0-0.2,0.2-0.4,0.4-0.3h2.7V4.1c0-0.2,0.2-0.4,0.3-0.4h1.7c0.2,0,0.4,0.2,0.4,0.4v2.7h2.7 c0.2,0,0.4,0.2,0.4,0.3L12.3,8.8z" })),
|
|
59
|
+
'share': () => (h("path", { fill: "currentColor", d: "M13.43,10.67a2,2,0,0,0-2.42.18L5.64,8.28a2.11,2.11,0,0,0,0-.56L11,5.15a2,2,0,0,0,2.42.18,2,2,0,1,0-3.08-1.57L4.83,6.4l-.11-.09a2,2,0,1,0,.12,3.3l5.51,2.63a2,2,0,1,0,3.08-1.57Z" })),
|
|
50
60
|
'trash': () => [
|
|
51
61
|
h("path", { fill: "currentColor", d: "M11.5,14.8h-7 c-0.6,0-1.1-0.5-1.1-1.1V4.4h9.3v9.2C12.6,14.2,12.1,14.8,11.5,14.8 M6.9,6.8c0-0.3-0.3-0.6-0.6-0.6S5.8,6.5,5.8,6.8v5.2 c0,0.3,0.3,0.6,0.6,0.6s0.6-0.3,0.6-0.6V6.8z M10.3,6.8c0-0.3-0.3-0.6-0.6-0.6S9.2,6.5,9.2,6.8v5.2c0,0.3,0.3,0.6,0.6,0.6 s0.6-0.3,0.6-0.6V6.8z" }),
|
|
52
62
|
h("path", { fill: "currentColor", d: "M13,2h-2.9L9.9,1.6 C9.8,1.4,9.6,1.2,9.4,1.2H6.6c-0.2,0-0.4,0.1-0.5,0.3L5.8,2H2.9C2.7,2,2.5,2.2,2.5,2.4c0,0,0,0,0,0v0.8c0,0.2,0.2,0.4,0.4,0.4H13 c0.2,0,0.4-0.2,0.4-0.4V2.4C13.4,2.2,13.2,2,13,2z" }),
|
|
53
63
|
],
|
|
64
|
+
'unlock': () => (h("path", { fill: "currentColor", d: "M13.33 13.94V7a1.37 1.37 0 0 0-1.28-1.44h-.72v-1.4A3.422 3.422 0 0 0 8 .67 3.4 3.4 0 0 0 4.68 4h1.26C6 2.9 6.9 2.03 8 2c1.17.03 2.1 1 2.07 2.17v1.39H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39ZM8 11.84c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Z" })),
|
|
54
65
|
'user-plus': () => (h("path", { fill: "currentColor", d: "M14,3.33H12.65V2a.36.36,0,0,0-.35-.33h-.65A.36.36,0,0,0,11.3,2V3.33H10a.34.34,0,0,0-.33.34v.66a.34.34,0,0,0,.33.34H11.3V6a.37.37,0,0,0,.35.33h.65A.37.37,0,0,0,12.65,6V4.67H14a.34.34,0,0,0,.32-.34V3.67A.34.34,0,0,0,14,3.33ZM9.28,9.77h-.2a5.19,5.19,0,0,1-3.91,0H5A3,3,0,0,0,1.7,12.46h0v.72A1.27,1.27,0,0,0,3,14.33h8.25a1.26,1.26,0,0,0,1.36-1.14v-.68A3,3,0,0,0,9.37,9.76H9.28ZM7.13,3.7A2.64,2.64,0,1,1,4.5,6.34h0A2.64,2.64,0,0,1,7.13,3.7Z" })),
|
|
55
66
|
'users': () => (h("path", { fill: "currentColor", d: "M12,8.76h-.2a5.24,5.24,0,0,1-3.93,0H7.61a3.05,3.05,0,0,0-3.3,2.75v.69a1.28,1.28,0,0,0,1.38,1.14H14a1.27,1.27,0,0,0,1.37-1.14v-.69A3.07,3.07,0,0,0,12,8.75Zm-6.4-.32A2,2,0,0,0,4.31,8H2.48A1.69,1.69,0,0,0,.65,9.53v.76a.85.85,0,0,0,.91.76H3.45A3.58,3.58,0,0,1,5.61,8.44ZM9.81,2.66A2.65,2.65,0,1,1,7.16,5.31h0A2.65,2.65,0,0,1,9.81,2.66ZM3.31,4.18A1.51,1.51,0,1,1,1.8,5.69,1.51,1.51,0,0,1,3.31,4.18Z" })),
|
|
56
67
|
};
|
|
@@ -183,7 +183,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
183
183
|
* @returns {HTMLElement} HTML Element
|
|
184
184
|
*/
|
|
185
185
|
render() {
|
|
186
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, width: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, displayCharacterLeft: undefined, characterLeftTemplate: undefined, maxlength: undefined, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, h("button", { type: "button", role: "switch", "aria-checked": this.checked, "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-2" })))));
|
|
186
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, readonly: undefined, width: undefined, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: !this.readonly && this.tooltip, displayCharacterLeft: undefined, characterLeftTemplate: undefined, maxlength: undefined, helpText: this.helpText, errorMessage: undefined, isFieldset: false }, h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-input__toggle-item-container" }, h("slot", { name: "item-2" })))));
|
|
187
187
|
}
|
|
188
188
|
get element() { return this; }
|
|
189
189
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@ import { m as messages } from './index2.js';
|
|
|
4
4
|
import { d as defineCustomElement$3 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
6
6
|
|
|
7
|
-
const mgModalCss = ".mg-modal{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-
|
|
7
|
+
const mgModalCss = ".mg-modal{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-light), 70%)}.mg-modal__dialog{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:none;flex:none;-ms-flex-item-align:center;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-width:100%;max-height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:hsl(var(--color-light));-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__content{overflow-y:auto}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal .mg-modal__content ::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
|
|
8
8
|
|
|
9
9
|
const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
@@ -100,7 +100,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
100
100
|
* @returns {HTMLElement} HTML Element
|
|
101
101
|
*/
|
|
102
102
|
render() {
|
|
103
|
-
return (h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, h("article", { class: "mg-modal__dialog" }, h("header", { class: "mg-modal__header" }, this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.modal.closeButton, onClick: this.handleClose
|
|
103
|
+
return (h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, h("article", { class: "mg-modal__dialog" }, h("header", { class: "mg-modal__header" }, this.closeButton && (h("span", { class: "mg-modal__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" })))), h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (h("article", { class: "mg-modal__content" }, h("slot", { name: "content" }))), this.hasActions && (h("footer", { class: "mg-modal__footer" }, h("slot", { name: "actions" }))))));
|
|
104
104
|
}
|
|
105
105
|
get element() { return this; }
|
|
106
106
|
static get watchers() { return {
|