@mgdis/mg-components 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-94497267.js → index-c3450336.js} +0 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +380 -625
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -7
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -7
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +13 -0
- package/dist/collection/components/atoms/mg-button/mg-button.js +12 -29
- package/dist/collection/components/atoms/mg-card/mg-card.css +6 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +2 -3
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +5 -12
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +4 -8
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +1 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +58 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +60 -15
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -19
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +17 -33
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +17 -25
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -47
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -29
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -33
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +23 -33
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +23 -41
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -45
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +4 -7
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +8 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +4 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +13 -24
- package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -22
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +0 -6
- package/dist/collection/components/molecules/mg-message/mg-message.css +13 -19
- package/dist/collection/components/molecules/mg-message/mg-message.js +8 -27
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +12 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +10 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +13 -9
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +7 -23
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +24 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +28 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +77 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +10 -23
- package/dist/collection/locales/en/messages.json +3 -0
- package/dist/collection/locales/fr/messages.json +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +8 -0
- package/dist/components/mg-badge2.js +4 -7
- package/dist/components/mg-button2.js +13 -30
- package/dist/components/mg-card.js +1 -37
- package/dist/components/mg-card2.js +39 -0
- package/dist/components/mg-character-left2.js +2 -3
- package/dist/components/mg-details.js +4 -8
- package/dist/components/mg-divider.js +0 -6
- package/dist/components/mg-form.js +8 -22
- package/dist/components/mg-icon2.js +5 -12
- package/dist/components/mg-illustrated-message.js +1 -7
- package/dist/components/mg-input-checkbox.js +17 -33
- package/dist/components/mg-input-date.js +17 -25
- package/dist/components/mg-input-numeric.js +24 -47
- package/dist/components/mg-input-password.js +17 -29
- package/dist/components/mg-input-radio.js +18 -33
- package/dist/components/mg-input-select2.js +24 -34
- package/dist/components/mg-input-text2.js +23 -41
- package/dist/components/mg-input-textarea.js +23 -45
- package/dist/components/mg-input-title2.js +4 -8
- package/dist/components/mg-input-toggle.js +16 -33
- package/dist/components/mg-menu-item.js +14 -25
- package/dist/components/mg-menu.js +4 -7
- package/dist/components/mg-message.js +17 -30
- package/dist/components/mg-modal.js +18 -30
- package/dist/components/mg-pagination.js +4 -13
- package/dist/components/mg-panel.js +20 -25
- package/dist/components/mg-popover.js +16 -26
- package/dist/components/mg-skip-links.d.ts +11 -0
- package/dist/components/mg-skip-links.js +66 -0
- package/dist/components/mg-tabs.js +10 -23
- package/dist/components/mg-tag.js +34 -12
- package/dist/components/mg-tooltip2.js +6 -19
- package/dist/esm/{index-aad0184c.js → index-78edde1d.js} +0 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +380 -626
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/mg-components/locales/en/messages.json +3 -0
- package/dist/mg-components/locales/fr/messages.json +3 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-3899d5d2.js → p-125c54ca.js} +0 -0
- package/dist/mg-components/p-4961c96c.entry.js +1 -0
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +5 -1
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +27 -6
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +1 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +7 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +34 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +37 -6
- package/dist/types/locales/index.d.ts +6 -0
- package/dist/types/stencil-public-runtime.d.ts +5 -0
- package/dist/types/utils/unit.test.utils.d.ts +42 -0
- package/package.json +36 -31
- package/readme.md +3 -1
- package/dist/mg-components/p-059a9a59.entry.js +0 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { initLocales } from '../../../locales';
|
|
3
|
+
export class MgSkipLinks {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.links = undefined;
|
|
6
|
+
}
|
|
7
|
+
validateLinks(links) {
|
|
8
|
+
if (links === undefined ||
|
|
9
|
+
links.length === 0 ||
|
|
10
|
+
links.some(link => link.href === undefined || !link.href.startsWith('#') || link.label === undefined || link.label.trim() === '')) {
|
|
11
|
+
throw new Error(`<mg-skip-links> prop "links": Cannot be empty and each link must contains an href starting with a "#" and a non empty label attributes.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/*************
|
|
15
|
+
* Lifecycle *
|
|
16
|
+
*************/
|
|
17
|
+
/**
|
|
18
|
+
* Check if props are well configured on init
|
|
19
|
+
*
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this.validateLinks(this.links);
|
|
24
|
+
this.messages = initLocales(this.element).messages;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Render
|
|
28
|
+
*
|
|
29
|
+
* @returns {HTMLElement} HTML Element
|
|
30
|
+
*/
|
|
31
|
+
render() {
|
|
32
|
+
return (h("nav", { class: "mg-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { class: "mg-skip-links__list" }, this.links.map(link => (h("li", null, h("a", { class: "mg-skip-links__link", href: link.href }, link.label)))))));
|
|
33
|
+
}
|
|
34
|
+
static get is() { return "mg-skip-links"; }
|
|
35
|
+
static get encapsulation() { return "shadow"; }
|
|
36
|
+
static get originalStyleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["mg-skip-links.scss"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get styleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["mg-skip-links.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get properties() {
|
|
47
|
+
return {
|
|
48
|
+
"links": {
|
|
49
|
+
"type": "unknown",
|
|
50
|
+
"mutable": true,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "SkipLink[]",
|
|
53
|
+
"resolved": "SkipLink[]",
|
|
54
|
+
"references": {
|
|
55
|
+
"SkipLink": {
|
|
56
|
+
"location": "import",
|
|
57
|
+
"path": "./mg-skip-links.conf"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "Skip links"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get elementRef() { return "element"; }
|
|
71
|
+
static get watchers() {
|
|
72
|
+
return [{
|
|
73
|
+
"propName": "links",
|
|
74
|
+
"methodName": "validateLinks"
|
|
75
|
+
}];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -13,31 +13,11 @@ export class MgTabs {
|
|
|
13
13
|
/************
|
|
14
14
|
* Internal *
|
|
15
15
|
************/
|
|
16
|
+
// classes
|
|
16
17
|
this.tabPanel = 'panel';
|
|
17
|
-
this.startIndex = 1;
|
|
18
18
|
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* If not set, it will be created.
|
|
22
|
-
*/
|
|
23
|
-
this.identifier = createID('mg-tabs');
|
|
24
|
-
/**
|
|
25
|
-
* Define tabs size
|
|
26
|
-
*/
|
|
27
|
-
this.size = 'regular';
|
|
28
|
-
/**
|
|
29
|
-
* Active tab number
|
|
30
|
-
* default: first is 1
|
|
31
|
-
*/
|
|
32
|
-
this.activeTab = 1;
|
|
33
|
-
/**
|
|
34
|
-
* Component tabs
|
|
35
|
-
*/
|
|
36
|
-
this.tabs = [];
|
|
37
|
-
/**
|
|
38
|
-
* Component classes
|
|
39
|
-
*/
|
|
40
|
-
this.classList = new ClassList(['mg-tabs']);
|
|
19
|
+
// variables
|
|
20
|
+
this.startIndex = 1;
|
|
41
21
|
/**
|
|
42
22
|
* Method to set active tab
|
|
43
23
|
*
|
|
@@ -128,6 +108,13 @@ export class MgTabs {
|
|
|
128
108
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
129
109
|
}
|
|
130
110
|
};
|
|
111
|
+
this.identifier = createID('mg-tabs');
|
|
112
|
+
this.label = undefined;
|
|
113
|
+
this.size = 'regular';
|
|
114
|
+
this.items = undefined;
|
|
115
|
+
this.activeTab = 1;
|
|
116
|
+
this.tabs = [];
|
|
117
|
+
this.classList = new ClassList(['mg-tabs']);
|
|
131
118
|
}
|
|
132
119
|
validateLabel(newValue) {
|
|
133
120
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -25,6 +25,7 @@ export { MgModal as MgModal } from '../types/components/molecules/mg-modal/mg-mo
|
|
|
25
25
|
export { MgPagination as MgPagination } from '../types/components/molecules/mg-pagination/mg-pagination';
|
|
26
26
|
export { MgPanel as MgPanel } from '../types/components/molecules/mg-panel/mg-panel';
|
|
27
27
|
export { MgPopover as MgPopover } from '../types/components/molecules/mg-popover/mg-popover';
|
|
28
|
+
export { MgSkipLinks as MgSkipLinks } from '../types/components/molecules/mg-skip-links/mg-skip-links';
|
|
28
29
|
export { MgTabs as MgTabs } from '../types/components/molecules/mg-tabs/mg-tabs';
|
|
29
30
|
export { MgTag as MgTag } from '../types/components/atoms/mg-tag/mg-tag';
|
|
30
31
|
export { MgTooltip as MgTooltip } from '../types/components/atoms/mg-tooltip/mg-tooltip';
|
package/dist/components/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { MgModal, defineCustomElement as defineCustomElementMgModal } from './mg
|
|
|
25
25
|
export { MgPagination, defineCustomElement as defineCustomElementMgPagination } from './mg-pagination.js';
|
|
26
26
|
export { MgPanel, defineCustomElement as defineCustomElementMgPanel } from './mg-panel.js';
|
|
27
27
|
export { MgPopover, defineCustomElement as defineCustomElementMgPopover } from './mg-popover.js';
|
|
28
|
+
export { MgSkipLinks, defineCustomElement as defineCustomElementMgSkipLinks } from './mg-skip-links.js';
|
|
28
29
|
export { MgTabs, defineCustomElement as defineCustomElementMgTabs } from './mg-tabs.js';
|
|
29
30
|
export { MgTag, defineCustomElement as defineCustomElementMgTag } from './mg-tag.js';
|
|
30
31
|
export { MgTooltip, defineCustomElement as defineCustomElementMgTooltip } from './mg-tooltip.js';
|
|
@@ -39,6 +39,9 @@ const pagination$1 = {
|
|
|
39
39
|
const panel$1 = {
|
|
40
40
|
editLabel: "Edit section title."
|
|
41
41
|
};
|
|
42
|
+
const skipLinks$1 = {
|
|
43
|
+
navLabel: "Quick access"
|
|
44
|
+
};
|
|
42
45
|
const general$1 = {
|
|
43
46
|
confirm: "Confirm",
|
|
44
47
|
cancel: "Cancel",
|
|
@@ -55,6 +58,7 @@ const en = {
|
|
|
55
58
|
modal: modal$1,
|
|
56
59
|
pagination: pagination$1,
|
|
57
60
|
panel: panel$1,
|
|
61
|
+
skipLinks: skipLinks$1,
|
|
58
62
|
general: general$1
|
|
59
63
|
};
|
|
60
64
|
|
|
@@ -99,6 +103,9 @@ const pagination = {
|
|
|
99
103
|
const panel = {
|
|
100
104
|
editLabel: "Modifier le titre de la section."
|
|
101
105
|
};
|
|
106
|
+
const skipLinks = {
|
|
107
|
+
navLabel: "Accès rapide"
|
|
108
|
+
};
|
|
102
109
|
const general = {
|
|
103
110
|
confirm: "Valider",
|
|
104
111
|
cancel: "Annuler",
|
|
@@ -115,6 +122,7 @@ const fr = {
|
|
|
115
122
|
modal: modal,
|
|
116
123
|
pagination: pagination,
|
|
117
124
|
panel: panel,
|
|
125
|
+
skipLinks: skipLinks,
|
|
118
126
|
general: general
|
|
119
127
|
};
|
|
120
128
|
|
|
@@ -18,13 +18,10 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
18
18
|
************/
|
|
19
19
|
// Classes
|
|
20
20
|
this.classOutline = `mg-badge--outline`;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
/**
|
|
26
|
-
* Component classes
|
|
27
|
-
*/
|
|
21
|
+
this.value = undefined;
|
|
22
|
+
this.label = undefined;
|
|
23
|
+
this.variant = variants[0];
|
|
24
|
+
this.outline = undefined;
|
|
28
25
|
this.classList = new ClassList(['mg-badge']);
|
|
29
26
|
}
|
|
30
27
|
validateValue(newValue) {
|
|
@@ -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', 'success'];
|
|
8
|
+
const variants = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'];
|
|
9
9
|
|
|
10
|
-
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled),:host(:focus) .mg-button--flat:not(.mg-button--disabled),:host(:active) .mg-button--flat:not(.mg-button--disabled){background:hsla(var(--color-dark), 0.1)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-button.mg-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-primary-font-color));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%)))}:host(:hover) .mg-button--primary:not(.mg-button--disabled),:host(:focus) .mg-button--primary:not(.mg-button--disabled),:host(:active) .mg-button--primary:not(.mg-button--disabled){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{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-secondary-font-color));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%)))}:host(:hover) .mg-button--secondary:not(.mg-button--disabled),:host(:focus) .mg-button--secondary:not(.mg-button--disabled),:host(:active) .mg-button--secondary:not(.mg-button--disabled){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{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));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%)))}:host(:hover) .mg-button--danger:not(.mg-button--disabled),:host(:focus) .mg-button--danger:not(.mg-button--disabled),:host(:active) .mg-button--danger:not(.mg-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-danger));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%)))}:host(:hover) .mg-button--danger-alt:not(.mg-button--disabled),:host(:focus) .mg-button--danger-alt:not(.mg-button--disabled),:host(:active) .mg-button--danger-alt:not(.mg-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));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%)))}:host(:hover) .mg-button--info:not(.mg-button--disabled),:host(:focus) .mg-button--info:not(.mg-button--disabled),:host(:active) .mg-button--info:not(.mg-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-dark));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%)))}:host(:hover) .mg-button--success:not(.mg-button--disabled),:host(:focus) .mg-button--success:not(.mg-button--disabled),:host(:active) .mg-button--success:not(.mg-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button{position:relative;display:inline-flex;align-items:center;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);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;text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);touch-action:manipulation}.mg-button.mg-button--disabled{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon{padding:0;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--flat{background:none;border:none}.mg-button.mg-button--full-width{display:flex;justify-content:center}.mg-button.mg-button--loading>mg-icon:first-of-type{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading .mg-button__content{opacity:0}.mg-button mg-icon:only-child,.mg-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button slot,.mg-button ::slotted(*:not(mg-icon)){text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);display:flex;align-items:center;column-gap:0.6rem}";
|
|
10
|
+
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled),:host(:focus) .mg-button--flat:not(.mg-button--disabled),:host(:active) .mg-button--flat:not(.mg-button--disabled){background:hsla(var(--color-dark), 0.1)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-button.mg-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-primary-font-color));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%)))}:host(:hover) .mg-button--primary:not(.mg-button--disabled),:host(:focus) .mg-button--primary:not(.mg-button--disabled),:host(:active) .mg-button--primary:not(.mg-button--disabled){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{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-secondary-font-color));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%)))}:host(:hover) .mg-button--secondary:not(.mg-button--disabled),:host(:focus) .mg-button--secondary:not(.mg-button--disabled),:host(:active) .mg-button--secondary:not(.mg-button--disabled){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{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));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%)))}:host(:hover) .mg-button--danger:not(.mg-button--disabled),:host(:focus) .mg-button--danger:not(.mg-button--disabled),:host(:active) .mg-button--danger:not(.mg-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-danger));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%)))}:host(:hover) .mg-button--danger-alt:not(.mg-button--disabled),:host(:focus) .mg-button--danger-alt:not(.mg-button--disabled),:host(:active) .mg-button--danger-alt:not(.mg-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));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%)))}:host(:hover) .mg-button--info:not(.mg-button--disabled),:host(:focus) .mg-button--info:not(.mg-button--disabled),:host(:active) .mg-button--info:not(.mg-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-dark));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%)))}:host(:hover) .mg-button--success:not(.mg-button--disabled),:host(:focus) .mg-button--success:not(.mg-button--disabled),:host(:active) .mg-button--success:not(.mg-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button{position:relative;display:inline-flex;align-items:center;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);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;text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);touch-action:manipulation}.mg-button.mg-button--disabled{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon{padding:0;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--flat{background:none;border:none}.mg-button.mg-button--link{padding:unset;min-height:unset;background:unset;border:unset;text-decoration:underline}.mg-button.mg-button--link slot{font-weight:600}.mg-button.mg-button--link:hover{text-decoration:none}.mg-button.mg-button--full-width{display:flex;justify-content:center}.mg-button.mg-button--loading>mg-icon:first-of-type{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading .mg-button__content{opacity:0}.mg-button mg-icon:only-child,.mg-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button slot,.mg-button ::slotted(*:not(mg-icon)){text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);display:flex;align-items:center;column-gap:0.6rem}";
|
|
11
11
|
|
|
12
12
|
const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
@@ -21,34 +21,6 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
21
21
|
this.classDisabled = 'mg-button--disabled';
|
|
22
22
|
this.classLoading = 'mg-button--loading';
|
|
23
23
|
this.classFullWidth = 'mg-button--full-width';
|
|
24
|
-
/**
|
|
25
|
-
* Define button variant
|
|
26
|
-
*/
|
|
27
|
-
this.variant = variants[0]; // Primary
|
|
28
|
-
/**
|
|
29
|
-
* Set button to full-width
|
|
30
|
-
*/
|
|
31
|
-
this.fullWidth = false;
|
|
32
|
-
/**
|
|
33
|
-
* Define if button is round.
|
|
34
|
-
* Used for icon button.
|
|
35
|
-
*/
|
|
36
|
-
this.isIcon = false;
|
|
37
|
-
/**
|
|
38
|
-
* Option to set input disable on click, in order to prevent multi-click.
|
|
39
|
-
* Parent component have to remove the attribute 'disabled' when the process ends.
|
|
40
|
-
*/
|
|
41
|
-
this.disableOnClick = false;
|
|
42
|
-
/**
|
|
43
|
-
* Define if button is loading, default to false.
|
|
44
|
-
* Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
|
|
45
|
-
* It's required to reset to false when action/promise in parent is done to stop the loading state
|
|
46
|
-
*/
|
|
47
|
-
this.loading = false;
|
|
48
|
-
/**
|
|
49
|
-
* Component classes
|
|
50
|
-
*/
|
|
51
|
-
this.classList = new ClassList(['mg-button']);
|
|
52
24
|
/**
|
|
53
25
|
* Trigger actions onClick event
|
|
54
26
|
*
|
|
@@ -91,6 +63,17 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
91
63
|
this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
92
64
|
}
|
|
93
65
|
};
|
|
66
|
+
this.variant = variants[0];
|
|
67
|
+
this.identifier = undefined;
|
|
68
|
+
this.label = undefined;
|
|
69
|
+
this.type = undefined;
|
|
70
|
+
this.fullWidth = false;
|
|
71
|
+
this.form = undefined;
|
|
72
|
+
this.disabled = undefined;
|
|
73
|
+
this.isIcon = false;
|
|
74
|
+
this.disableOnClick = false;
|
|
75
|
+
this.loading = false;
|
|
76
|
+
this.classList = new ClassList(['mg-button']);
|
|
94
77
|
}
|
|
95
78
|
validateVariant(newValue, oldValue) {
|
|
96
79
|
if (!variants.includes(newValue)) {
|
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const mgCardCss = ".mg-card{padding:var(--mg-card-padding);border-radius:var(--mg-card-border-radius);background:var(--mg-card-background);border:var(--mg-card-border);box-shadow:var(--mg-card-box-shadow)}";
|
|
4
|
-
|
|
5
|
-
const MgCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
}
|
|
11
|
-
/*************
|
|
12
|
-
* Lifecycle *
|
|
13
|
-
*************/
|
|
14
|
-
/**
|
|
15
|
-
* Render
|
|
16
|
-
*
|
|
17
|
-
* @returns {HTMLElement} HTML Element
|
|
18
|
-
*/
|
|
19
|
-
render() {
|
|
20
|
-
return (h("div", { class: "mg-card" }, h("slot", null)));
|
|
21
|
-
}
|
|
22
|
-
static get style() { return mgCardCss; }
|
|
23
|
-
}, [1, "mg-card"]);
|
|
24
|
-
function defineCustomElement$1() {
|
|
25
|
-
if (typeof customElements === "undefined") {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const components = ["mg-card"];
|
|
29
|
-
components.forEach(tagName => { switch (tagName) {
|
|
30
|
-
case "mg-card":
|
|
31
|
-
if (!customElements.get(tagName)) {
|
|
32
|
-
customElements.define(tagName, MgCard$1);
|
|
33
|
-
}
|
|
34
|
-
break;
|
|
35
|
-
} });
|
|
36
|
-
}
|
|
37
|
-
defineCustomElement$1();
|
|
1
|
+
import { M as MgCard$1, d as defineCustomElement$1 } from './mg-card2.js';
|
|
38
2
|
|
|
39
3
|
const MgCard = MgCard$1;
|
|
40
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const mgCardCss = ".mg-card{position:relative;width:100%;padding:var(--mg-card-padding);overflow:var(--mg-card-overflow);box-sizing:border-box;z-index:inherit;background:var(--mg-card-background);border:var(--mg-card-border);border-radius:var(--mg-card-border-radius);box-shadow:var(--mg-card-box-shadow)}";
|
|
4
|
+
|
|
5
|
+
const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
}
|
|
11
|
+
/*************
|
|
12
|
+
* Lifecycle *
|
|
13
|
+
*************/
|
|
14
|
+
/**
|
|
15
|
+
* Render
|
|
16
|
+
*
|
|
17
|
+
* @returns {HTMLElement} HTML Element
|
|
18
|
+
*/
|
|
19
|
+
render() {
|
|
20
|
+
return (h("div", { class: "mg-card" }, h("slot", null)));
|
|
21
|
+
}
|
|
22
|
+
static get style() { return mgCardCss; }
|
|
23
|
+
}, [1, "mg-card"]);
|
|
24
|
+
function defineCustomElement() {
|
|
25
|
+
if (typeof customElements === "undefined") {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const components = ["mg-card"];
|
|
29
|
+
components.forEach(tagName => { switch (tagName) {
|
|
30
|
+
case "mg-card":
|
|
31
|
+
if (!customElements.get(tagName)) {
|
|
32
|
+
customElements.define(tagName, MgCard);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
} });
|
|
36
|
+
}
|
|
37
|
+
defineCustomElement();
|
|
38
|
+
|
|
39
|
+
export { MgCard as M, defineCustomElement as d };
|
|
@@ -7,10 +7,9 @@ const MgCharacterLeft = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
|
-
|
|
11
|
-
* Sets the characters to count
|
|
12
|
-
*/
|
|
10
|
+
this.identifier = undefined;
|
|
13
11
|
this.characters = '';
|
|
12
|
+
this.maxlength = undefined;
|
|
14
13
|
}
|
|
15
14
|
validateMaxlength(newValue) {
|
|
16
15
|
if (typeof newValue !== 'number') {
|
|
@@ -9,14 +9,6 @@ const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
12
|
-
/**
|
|
13
|
-
* Hide summary element
|
|
14
|
-
*/
|
|
15
|
-
this.hideSummary = false;
|
|
16
|
-
/**
|
|
17
|
-
* Define if details are diplayed
|
|
18
|
-
*/
|
|
19
|
-
this.expanded = false;
|
|
20
12
|
/**
|
|
21
13
|
* Handle details toggle
|
|
22
14
|
*
|
|
@@ -25,6 +17,10 @@ const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
25
17
|
this.handleToggle = () => {
|
|
26
18
|
this.expanded = this.details.open;
|
|
27
19
|
};
|
|
20
|
+
this.toggleClosed = undefined;
|
|
21
|
+
this.toggleOpened = undefined;
|
|
22
|
+
this.hideSummary = false;
|
|
23
|
+
this.expanded = false;
|
|
28
24
|
}
|
|
29
25
|
validateTitles(newValue) {
|
|
30
26
|
if (newValue === undefined || newValue.trim() === '') {
|
|
@@ -7,12 +7,6 @@ const MgDivider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.__attachShadow();
|
|
10
|
-
/**************
|
|
11
|
-
* Decorators *
|
|
12
|
-
**************/
|
|
13
|
-
/**
|
|
14
|
-
* Define component size
|
|
15
|
-
*/
|
|
16
10
|
this.size = 'regular';
|
|
17
11
|
}
|
|
18
12
|
/**
|
|
@@ -13,28 +13,6 @@ const MgForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
13
13
|
this.formSubmit = createEvent(this, "form-submit", 7);
|
|
14
14
|
// Classes
|
|
15
15
|
this.classAllRequired = 'mg-form--all-required';
|
|
16
|
-
/**
|
|
17
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
18
|
-
* If not set, it will be created.
|
|
19
|
-
*/
|
|
20
|
-
this.identifier = createID('mg-form');
|
|
21
|
-
/**
|
|
22
|
-
* Input name
|
|
23
|
-
* If not set the value equals the identifier
|
|
24
|
-
*/
|
|
25
|
-
this.name = this.identifier;
|
|
26
|
-
/**
|
|
27
|
-
* Define if form is readonly
|
|
28
|
-
*/
|
|
29
|
-
this.readonly = false;
|
|
30
|
-
/**
|
|
31
|
-
* Define if form is disabled
|
|
32
|
-
*/
|
|
33
|
-
this.disabled = false;
|
|
34
|
-
/**
|
|
35
|
-
* Component classes
|
|
36
|
-
*/
|
|
37
|
-
this.classList = new ClassList(['mg-form']);
|
|
38
16
|
/**
|
|
39
17
|
* Define required message based on mg-inputs required elements
|
|
40
18
|
* Also
|
|
@@ -104,6 +82,14 @@ const MgForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
104
82
|
input.addEventListener('input-valid', this.checkValidity);
|
|
105
83
|
});
|
|
106
84
|
};
|
|
85
|
+
this.identifier = createID('mg-form');
|
|
86
|
+
this.name = this.identifier;
|
|
87
|
+
this.readonly = false;
|
|
88
|
+
this.disabled = false;
|
|
89
|
+
this.valid = undefined;
|
|
90
|
+
this.invalid = undefined;
|
|
91
|
+
this.classList = new ClassList(['mg-form']);
|
|
92
|
+
this.requiredMessage = undefined;
|
|
107
93
|
}
|
|
108
94
|
handleAttributeChange() {
|
|
109
95
|
this.setMgInputs();
|
|
@@ -189,24 +189,17 @@ const MgIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
189
189
|
super();
|
|
190
190
|
this.__registerHost();
|
|
191
191
|
this.__attachShadow();
|
|
192
|
-
/**
|
|
193
|
-
* Define icon size
|
|
194
|
-
*/
|
|
195
|
-
this.size = 'regular';
|
|
196
|
-
/**
|
|
197
|
-
* Make the icon spin
|
|
198
|
-
*/
|
|
199
|
-
this.spin = false;
|
|
200
|
-
/**
|
|
201
|
-
* Component classes
|
|
202
|
-
*/
|
|
203
|
-
this.classList = new ClassList(['mg-icon']);
|
|
204
192
|
/**
|
|
205
193
|
* getIcon
|
|
206
194
|
*
|
|
207
195
|
* @returns {HTMLElement} icon html
|
|
208
196
|
*/
|
|
209
197
|
this.getIcon = () => icons[this.icon]();
|
|
198
|
+
this.icon = undefined;
|
|
199
|
+
this.size = 'regular';
|
|
200
|
+
this.variant = undefined;
|
|
201
|
+
this.spin = false;
|
|
202
|
+
this.classList = new ClassList(['mg-icon']);
|
|
210
203
|
}
|
|
211
204
|
validateIcon(newValue, oldValue) {
|
|
212
205
|
if (!Object.keys(icons).includes(newValue)) {
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { i as isTagName } from './components.utils.js';
|
|
3
3
|
|
|
4
|
-
const mgIllustratedMessageCss = ".mg-illustrated-message{display:flex;flex-direction:column;justify-content:center;gap:3em 7rem;margin:auto;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;max-width:47.5rem;box-sizing:border-box;text-align:center}.mg-illustrated-message.mg-illustrated-message--horizontal{flex-direction:row;flex-wrap:wrap;align-items:center;max-width:unset}.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__slots,.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__illustration{max-width:47.5rem}.mg-illustrated-message__illustration{max-height:
|
|
4
|
+
const mgIllustratedMessageCss = ".mg-illustrated-message{display:flex;flex-direction:column;justify-content:center;gap:3em 7rem;margin:auto;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;max-width:47.5rem;box-sizing:border-box;text-align:center}.mg-illustrated-message.mg-illustrated-message--horizontal{flex-direction:row;flex-wrap:wrap;align-items:center;max-width:unset}.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__slots,.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__illustration{max-width:47.5rem}.mg-illustrated-message__illustration{max-height:18.4rem}.mg-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;height:auto;max-width:100%;max-height:18.4rem}.mg-illustrated-message__illustration.mg-illustrated-message__illustration--small{max-height:6rem}.mg-illustrated-message__illustration.mg-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:6rem}.mg-illustrated-message__title ::slotted([slot=title]){margin:0;font-size:2rem !important;font-family:var(--font-family) !important;font-weight:400}.mg-illustrated-message__details ::slotted([slot=details]){margin:2rem 0 0}";
|
|
5
5
|
|
|
6
6
|
const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
|
-
/**
|
|
12
|
-
* Define illustration size
|
|
13
|
-
*/
|
|
14
11
|
this.size = 'regular';
|
|
15
|
-
/**
|
|
16
|
-
* Define component orientation
|
|
17
|
-
*/
|
|
18
12
|
this.direction = 'vertical';
|
|
19
13
|
}
|
|
20
14
|
/*************
|
|
@@ -29,39 +29,6 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
29
29
|
this.inputs = [];
|
|
30
30
|
// hasDisplayedError (triggered by blur event)
|
|
31
31
|
this.hasDisplayedError = false;
|
|
32
|
-
/**
|
|
33
|
-
* Input name
|
|
34
|
-
* If not set the value equals the identifier
|
|
35
|
-
*/
|
|
36
|
-
this.name = this.identifier;
|
|
37
|
-
/**
|
|
38
|
-
* Define if label is visible
|
|
39
|
-
*/
|
|
40
|
-
this.labelHide = false;
|
|
41
|
-
/**
|
|
42
|
-
* Define if inputs are display verticaly
|
|
43
|
-
*/
|
|
44
|
-
this.inputVerticalList = false;
|
|
45
|
-
/**
|
|
46
|
-
* Define if input is required
|
|
47
|
-
*/
|
|
48
|
-
this.required = false;
|
|
49
|
-
/**
|
|
50
|
-
* Define if input is readonly
|
|
51
|
-
*/
|
|
52
|
-
this.readonly = false;
|
|
53
|
-
/**
|
|
54
|
-
* Define if input is disabled
|
|
55
|
-
*/
|
|
56
|
-
this.disabled = false;
|
|
57
|
-
/**
|
|
58
|
-
* Component classes
|
|
59
|
-
*/
|
|
60
|
-
this.classList = new ClassList(['mg-input--checkbox']);
|
|
61
|
-
/**
|
|
62
|
-
* Formated value for display
|
|
63
|
-
*/
|
|
64
|
-
this.checkboxItems = [];
|
|
65
32
|
/**
|
|
66
33
|
* Handle input event
|
|
67
34
|
*
|
|
@@ -111,6 +78,23 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
111
78
|
this.errorMessage = this.messages.errors.required;
|
|
112
79
|
}
|
|
113
80
|
};
|
|
81
|
+
this.value = undefined;
|
|
82
|
+
this.identifier = undefined;
|
|
83
|
+
this.name = this.identifier;
|
|
84
|
+
this.label = undefined;
|
|
85
|
+
this.labelOnTop = undefined;
|
|
86
|
+
this.labelHide = false;
|
|
87
|
+
this.inputVerticalList = false;
|
|
88
|
+
this.required = false;
|
|
89
|
+
this.readonly = false;
|
|
90
|
+
this.disabled = false;
|
|
91
|
+
this.tooltip = undefined;
|
|
92
|
+
this.helpText = undefined;
|
|
93
|
+
this.valid = undefined;
|
|
94
|
+
this.invalid = undefined;
|
|
95
|
+
this.classList = new ClassList(['mg-input--checkbox']);
|
|
96
|
+
this.errorMessage = undefined;
|
|
97
|
+
this.checkboxItems = [];
|
|
114
98
|
}
|
|
115
99
|
validateValue(newValue) {
|
|
116
100
|
if (newValue && newValue.every(item => isCheckboxItem(item))) {
|