@mgdis/mg-components 4.1.0 → 4.2.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-88560a66.js → index-64cee0c8.js} +248 -81
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_24.cjs.entry.js → mg-badge_23.cjs.entry.js} +206 -2180
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-modal.cjs.entry.js +8 -1
- package/dist/cjs/mg-popover.cjs.entry.js +171 -0
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +116 -99
- package/dist/collection/components/atoms/mg-button/mg-button.js +221 -220
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +72 -69
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +102 -92
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +83 -67
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +64 -55
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +3 -6
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +120 -106
- package/dist/collection/components/molecules/inputs/MgInput.js +8 -17
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +323 -318
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +356 -361
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +462 -456
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +347 -340
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +348 -343
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +406 -401
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +12 -15
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +2 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +476 -473
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +461 -456
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +2 -8
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +299 -298
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -3
- package/dist/collection/components/molecules/mg-details/mg-details.js +95 -93
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +13 -27
- package/dist/collection/components/molecules/mg-form/mg-form.js +175 -166
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -6
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +37 -37
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +1 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +154 -153
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +11 -15
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +147 -134
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +192 -189
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +150 -135
- package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/collection/locales/en/messages.json +50 -0
- package/dist/collection/locales/fr/messages.json +50 -0
- package/dist/collection/stories/grids.stories.js +1 -44
- package/dist/collection/stories/helpers.stories.js +1 -19
- package/dist/collection/stories/icons.stories.js +1 -4
- package/dist/collection/stories/typography.stories.js +1 -12
- package/dist/collection/variables.css +3 -2
- package/dist/collection/variables.scss +3 -2
- package/dist/components/MgInput.js +6 -3
- package/dist/components/mg-badge2.js +7 -0
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-input-checkbox.js +1 -6
- package/dist/components/mg-input-date.js +10 -27
- package/dist/components/mg-input-numeric.js +1 -6
- package/dist/components/mg-input-password.js +1 -6
- package/dist/components/mg-input-radio.js +1 -6
- package/dist/components/mg-input-select2.js +1 -6
- package/dist/components/mg-input-text2.js +3 -8
- package/dist/components/mg-input-textarea.js +2 -7
- package/dist/components/mg-input-title2.js +9 -0
- package/dist/components/mg-input-toggle.js +2 -7
- package/dist/components/mg-modal.js +7 -0
- package/dist/components/mg-pagination.js +3 -3
- package/dist/components/mg-panel.js +8 -4
- package/dist/components/mg-tabs.js +8 -1
- package/dist/components/mg-tooltip2.js +7 -0
- package/dist/esm/{index-bca81100.js → index-120f47fd.js} +248 -81
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +207 -2180
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-modal.entry.js +8 -1
- package/dist/esm/mg-popover.entry.js +167 -0
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/mg-components/locales/en/messages.json +50 -0
- package/dist/mg-components/locales/fr/messages.json +50 -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-21991be8.entry.js +1 -0
- package/dist/mg-components/p-36a64f8c.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/{p-b14a3443.js → p-7bc32a2f.js} +0 -0
- package/dist/mg-components/p-b380a0df.entry.js +1 -0
- package/dist/mg-components/variables.css +3 -2
- package/dist/mg-components/variables.scss +3 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +29 -29
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/p-a2883dc7.entry.js +0 -1
- package/dist/mg-components/p-cffe0519.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export class MgDetails {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
@@ -40,102 +40,104 @@ export class MgDetails {
|
|
|
40
40
|
* @returns {HTMLElement} HTML Element
|
|
41
41
|
*/
|
|
42
42
|
render() {
|
|
43
|
-
return (h("details", { class: "mg-details", onToggle: this.handleToggle, open: this.expanded, ref: el => (this.details = el) },
|
|
44
|
-
h("summary", null,
|
|
45
|
-
h("slot", { name: "summary" }),
|
|
46
|
-
h("span", { class: "mg-details__toggle" },
|
|
47
|
-
h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }),
|
|
48
|
-
" ",
|
|
49
|
-
this.expanded ? this.toggleOpened : this.toggleClosed)),
|
|
50
|
-
h("div", { class: "mg-details__details" },
|
|
51
|
-
h("slot", { name: "details" }))));
|
|
43
|
+
return (h("details", { class: "mg-details", onToggle: this.handleToggle, open: this.expanded, ref: el => (this.details = el) }, h("summary", null, h("slot", { name: "summary" }), h("span", { class: "mg-details__toggle" }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), " ", this.expanded ? this.toggleOpened : this.toggleClosed)), h("div", { class: "mg-details__details" }, h("slot", { name: "details" }))));
|
|
52
44
|
}
|
|
53
45
|
static get is() { return "mg-details"; }
|
|
54
46
|
static get encapsulation() { return "shadow"; }
|
|
55
|
-
static get originalStyleUrls() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"original": "string",
|
|
84
|
-
"resolved": "string",
|
|
85
|
-
"references": {}
|
|
86
|
-
},
|
|
87
|
-
"required": false,
|
|
88
|
-
"optional": false,
|
|
89
|
-
"docs": {
|
|
90
|
-
"tags": [],
|
|
91
|
-
"text": "Displayed title when details are opened"
|
|
92
|
-
},
|
|
93
|
-
"attribute": "toggle-opened",
|
|
94
|
-
"reflect": false
|
|
95
|
-
},
|
|
96
|
-
"expanded": {
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"mutable": true,
|
|
99
|
-
"complexType": {
|
|
100
|
-
"original": "boolean",
|
|
101
|
-
"resolved": "boolean",
|
|
102
|
-
"references": {}
|
|
103
|
-
},
|
|
104
|
-
"required": false,
|
|
105
|
-
"optional": false,
|
|
106
|
-
"docs": {
|
|
107
|
-
"tags": [],
|
|
108
|
-
"text": "Define if details are diplayed"
|
|
47
|
+
static get originalStyleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["mg-details.scss"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get styleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["mg-details.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
"toggleClosed": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "string",
|
|
64
|
+
"resolved": "string",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Displayed title when details are closed"
|
|
72
|
+
},
|
|
73
|
+
"attribute": "toggle-closed",
|
|
74
|
+
"reflect": false
|
|
109
75
|
},
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
76
|
+
"toggleOpened": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "string",
|
|
81
|
+
"resolved": "string",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": "Displayed title when details are opened"
|
|
89
|
+
},
|
|
90
|
+
"attribute": "toggle-opened",
|
|
91
|
+
"reflect": false
|
|
124
92
|
},
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
93
|
+
"expanded": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"mutable": true,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "boolean",
|
|
98
|
+
"resolved": "boolean",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "Define if details are diplayed"
|
|
106
|
+
},
|
|
107
|
+
"attribute": "expanded",
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"defaultValue": "false"
|
|
129
110
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get events() {
|
|
114
|
+
return [{
|
|
115
|
+
"method": "expandedChange",
|
|
116
|
+
"name": "expanded-change",
|
|
117
|
+
"bubbles": true,
|
|
118
|
+
"cancelable": true,
|
|
119
|
+
"composed": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Emmited event when expanded change"
|
|
123
|
+
},
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "boolean",
|
|
126
|
+
"resolved": "boolean",
|
|
127
|
+
"references": {}
|
|
128
|
+
}
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
static get watchers() {
|
|
132
|
+
return [{
|
|
133
|
+
"propName": "toggleClosed",
|
|
134
|
+
"methodName": "validateTitles"
|
|
135
|
+
}, {
|
|
136
|
+
"propName": "toggleOpened",
|
|
137
|
+
"methodName": "validateTitles"
|
|
138
|
+
}, {
|
|
139
|
+
"propName": "expanded",
|
|
140
|
+
"methodName": "handleExpanded"
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
141
143
|
}
|
|
@@ -29,33 +29,19 @@ const Template = (args) => {
|
|
|
29
29
|
form.addEventListener('form-submit', () => {
|
|
30
30
|
window.alert('Your form has been submitted');
|
|
31
31
|
});
|
|
32
|
-
} }),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
h("
|
|
39
|
-
|
|
40
|
-
h("mg-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{ title: 'non', value: false },
|
|
46
|
-
{ title: 'oui', value: true },
|
|
47
|
-
] },
|
|
48
|
-
h("span", { slot: "item-1" }, "non"),
|
|
49
|
-
h("span", { slot: "item-2" }, "oui")),
|
|
50
|
-
h("div", { slot: "actions", class: "mg-group-elements mg-group-elements--align-right" },
|
|
51
|
-
h("mg-button", { id: "can-submit", disabled: true, ref: e => {
|
|
52
|
-
submit = e;
|
|
53
|
-
} }, "Submit"),
|
|
54
|
-
h("mg-button", { variant: "secondary", type: "button",
|
|
55
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
56
|
-
onClick: () => {
|
|
57
|
-
form.displayError();
|
|
58
|
-
} }, "Display errors"))));
|
|
32
|
+
} }), h("mg-input-checkbox", { identifier: "mg-input-checkbox", label: "mg-input-checkbox label", value: [
|
|
33
|
+
{ title: 'oui', value: false },
|
|
34
|
+
{ title: 'non', value: false },
|
|
35
|
+
] }), h("mg-input-date", Object.assign({}, filterArgs({ required: true }), { identifier: "mg-input-date", label: "mg-input-date label" })), h("mg-input-numeric", { identifier: "mg-input-numeric", label: "mg-input-numeric label" }), h("mg-input-password", { identifier: "mg-input-password", label: "mg-input-password label" }), h("mg-input-radio", { identifier: "mg-input-radio", label: "mg-input-radio label", items: ['blu', 'bli', 'bla', 'blo'] }), h("mg-input-select", { identifier: "mg-input-select", label: "mg-input-select label", items: ['blu', 'bli', 'bla', 'blo'] }), h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }), h("mg-input-textarea", { identifier: "mg-input-textarea", label: "mg-input-textarea label" }), h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
|
|
36
|
+
{ title: 'non', value: false },
|
|
37
|
+
{ title: 'oui', value: true },
|
|
38
|
+
] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")), h("div", { slot: "actions", class: "mg-group-elements mg-group-elements--align-right" }, h("mg-button", { id: "can-submit", disabled: true, ref: e => {
|
|
39
|
+
submit = e;
|
|
40
|
+
} }, "Submit"), h("mg-button", { variant: "secondary", type: "button",
|
|
41
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
42
|
+
onClick: () => {
|
|
43
|
+
form.displayError();
|
|
44
|
+
} }, "Display errors"))));
|
|
59
45
|
};
|
|
60
46
|
export const MgForm = Template.bind({});
|
|
61
47
|
MgForm.args = Object.assign({}, args);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { createID, ClassList } from '../../../utils/components.utils';
|
|
3
3
|
import { initLocales } from '../../../locales';
|
|
4
4
|
export class MgForm {
|
|
@@ -135,181 +135,190 @@ export class MgForm {
|
|
|
135
135
|
* @returns {HTMLElement} HTML Element
|
|
136
136
|
*/
|
|
137
137
|
render() {
|
|
138
|
-
return (h("form", { class: this.classList.join(), id: this.identifier, name: this.name, ref: el => (this.form = el), onSubmit: this.handleFormSubmit },
|
|
139
|
-
this.requiredMessage && h("p", { innerHTML: this.requiredMessage }),
|
|
140
|
-
h("slot", null),
|
|
141
|
-
!this.readonly && !this.disabled && h("slot", { name: "actions" })));
|
|
138
|
+
return (h("form", { class: this.classList.join(), id: this.identifier, name: this.name, ref: el => (this.form = el), onSubmit: this.handleFormSubmit }, this.requiredMessage && h("p", { innerHTML: this.requiredMessage }), h("slot", null), !this.readonly && !this.disabled && h("slot", { name: "actions" })));
|
|
142
139
|
}
|
|
143
140
|
static get is() { return "mg-form"; }
|
|
144
141
|
static get encapsulation() { return "shadow"; }
|
|
145
|
-
static get originalStyleUrls() {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"original": "string",
|
|
175
|
-
"resolved": "string",
|
|
176
|
-
"references": {}
|
|
177
|
-
},
|
|
178
|
-
"required": false,
|
|
179
|
-
"optional": false,
|
|
180
|
-
"docs": {
|
|
181
|
-
"tags": [],
|
|
182
|
-
"text": "Input name\nIf not set the value equals the identifier"
|
|
183
|
-
},
|
|
184
|
-
"attribute": "name",
|
|
185
|
-
"reflect": false,
|
|
186
|
-
"defaultValue": "this.identifier"
|
|
187
|
-
},
|
|
188
|
-
"readonly": {
|
|
189
|
-
"type": "boolean",
|
|
190
|
-
"mutable": false,
|
|
191
|
-
"complexType": {
|
|
192
|
-
"original": "boolean",
|
|
193
|
-
"resolved": "boolean",
|
|
194
|
-
"references": {}
|
|
195
|
-
},
|
|
196
|
-
"required": false,
|
|
197
|
-
"optional": false,
|
|
198
|
-
"docs": {
|
|
199
|
-
"tags": [],
|
|
200
|
-
"text": "Define if form is readonly"
|
|
201
|
-
},
|
|
202
|
-
"attribute": "readonly",
|
|
203
|
-
"reflect": false,
|
|
204
|
-
"defaultValue": "false"
|
|
205
|
-
},
|
|
206
|
-
"disabled": {
|
|
207
|
-
"type": "boolean",
|
|
208
|
-
"mutable": false,
|
|
209
|
-
"complexType": {
|
|
210
|
-
"original": "boolean",
|
|
211
|
-
"resolved": "boolean",
|
|
212
|
-
"references": {}
|
|
213
|
-
},
|
|
214
|
-
"required": false,
|
|
215
|
-
"optional": false,
|
|
216
|
-
"docs": {
|
|
217
|
-
"tags": [],
|
|
218
|
-
"text": "Define if form is disabled"
|
|
219
|
-
},
|
|
220
|
-
"attribute": "disabled",
|
|
221
|
-
"reflect": false,
|
|
222
|
-
"defaultValue": "false"
|
|
223
|
-
},
|
|
224
|
-
"valid": {
|
|
225
|
-
"type": "boolean",
|
|
226
|
-
"mutable": true,
|
|
227
|
-
"complexType": {
|
|
228
|
-
"original": "boolean",
|
|
229
|
-
"resolved": "boolean",
|
|
230
|
-
"references": {}
|
|
231
|
-
},
|
|
232
|
-
"required": false,
|
|
233
|
-
"optional": false,
|
|
234
|
-
"docs": {
|
|
235
|
-
"tags": [],
|
|
236
|
-
"text": "Define form valid state"
|
|
142
|
+
static get originalStyleUrls() {
|
|
143
|
+
return {
|
|
144
|
+
"$": ["mg-form.scss"]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
static get styleUrls() {
|
|
148
|
+
return {
|
|
149
|
+
"$": ["mg-form.css"]
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
static get properties() {
|
|
153
|
+
return {
|
|
154
|
+
"identifier": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"mutable": false,
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "string",
|
|
159
|
+
"resolved": "string",
|
|
160
|
+
"references": {}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": false,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
|
|
167
|
+
},
|
|
168
|
+
"attribute": "identifier",
|
|
169
|
+
"reflect": false,
|
|
170
|
+
"defaultValue": "createID('mg-form')"
|
|
237
171
|
},
|
|
238
|
-
"
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
"
|
|
247
|
-
"
|
|
172
|
+
"name": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "string",
|
|
177
|
+
"resolved": "string",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": "Input name\nIf not set the value equals the identifier"
|
|
185
|
+
},
|
|
186
|
+
"attribute": "name",
|
|
187
|
+
"reflect": false,
|
|
188
|
+
"defaultValue": "this.identifier"
|
|
248
189
|
},
|
|
249
|
-
"
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"
|
|
253
|
-
|
|
190
|
+
"readonly": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "boolean",
|
|
195
|
+
"resolved": "boolean",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Define if form is readonly"
|
|
203
|
+
},
|
|
204
|
+
"attribute": "readonly",
|
|
205
|
+
"reflect": false,
|
|
206
|
+
"defaultValue": "false"
|
|
254
207
|
},
|
|
255
|
-
"
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
"
|
|
270
|
-
"
|
|
208
|
+
"disabled": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"mutable": false,
|
|
211
|
+
"complexType": {
|
|
212
|
+
"original": "boolean",
|
|
213
|
+
"resolved": "boolean",
|
|
214
|
+
"references": {}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "Define if form is disabled"
|
|
221
|
+
},
|
|
222
|
+
"attribute": "disabled",
|
|
223
|
+
"reflect": false,
|
|
224
|
+
"defaultValue": "false"
|
|
271
225
|
},
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
226
|
+
"valid": {
|
|
227
|
+
"type": "boolean",
|
|
228
|
+
"mutable": true,
|
|
229
|
+
"complexType": {
|
|
230
|
+
"original": "boolean",
|
|
231
|
+
"resolved": "boolean",
|
|
232
|
+
"references": {}
|
|
233
|
+
},
|
|
234
|
+
"required": false,
|
|
235
|
+
"optional": false,
|
|
236
|
+
"docs": {
|
|
237
|
+
"tags": [],
|
|
238
|
+
"text": "Define form valid state"
|
|
239
|
+
},
|
|
240
|
+
"attribute": "valid",
|
|
241
|
+
"reflect": false
|
|
286
242
|
},
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"
|
|
290
|
-
"
|
|
243
|
+
"invalid": {
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"mutable": true,
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "boolean",
|
|
248
|
+
"resolved": "boolean",
|
|
249
|
+
"references": {}
|
|
250
|
+
},
|
|
251
|
+
"required": false,
|
|
252
|
+
"optional": false,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": "Define form invalid state"
|
|
256
|
+
},
|
|
257
|
+
"attribute": "invalid",
|
|
258
|
+
"reflect": false
|
|
291
259
|
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
static get states() {
|
|
263
|
+
return {
|
|
264
|
+
"classList": {}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
static get events() {
|
|
268
|
+
return [{
|
|
269
|
+
"method": "formValid",
|
|
270
|
+
"name": "form-valid",
|
|
271
|
+
"bubbles": true,
|
|
272
|
+
"cancelable": true,
|
|
273
|
+
"composed": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Emitted event on form validity check\nTells if form is valid or not"
|
|
302
277
|
},
|
|
303
|
-
"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "boolean",
|
|
280
|
+
"resolved": "boolean",
|
|
281
|
+
"references": {}
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
"method": "formSubmit",
|
|
285
|
+
"name": "form-submit",
|
|
286
|
+
"bubbles": true,
|
|
287
|
+
"cancelable": true,
|
|
288
|
+
"composed": true,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": "Emitted event on form submit"
|
|
292
|
+
},
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "boolean",
|
|
295
|
+
"resolved": "boolean",
|
|
296
|
+
"references": {}
|
|
297
|
+
}
|
|
298
|
+
}];
|
|
299
|
+
}
|
|
300
|
+
static get methods() {
|
|
301
|
+
return {
|
|
302
|
+
"displayError": {
|
|
303
|
+
"complexType": {
|
|
304
|
+
"signature": "() => Promise<void>",
|
|
305
|
+
"parameters": [],
|
|
306
|
+
"references": {
|
|
307
|
+
"Promise": {
|
|
308
|
+
"location": "global"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"return": "Promise<void>"
|
|
312
|
+
},
|
|
313
|
+
"docs": {
|
|
314
|
+
"text": "Public method to display errors",
|
|
315
|
+
"tags": [{
|
|
316
|
+
"name": "returns",
|
|
317
|
+
"text": undefined
|
|
318
|
+
}]
|
|
319
|
+
}
|
|
311
320
|
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
321
|
+
};
|
|
322
|
+
}
|
|
314
323
|
static get elementRef() { return "element"; }
|
|
315
324
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
|
+
import { filterArgs } from '../../../../../.storybook/utils';
|
|
2
3
|
export default {
|
|
3
4
|
component: 'mg-illustrated-message',
|
|
4
5
|
title: 'Molecules/mg-illustrated-message',
|
|
@@ -9,12 +10,7 @@ export default {
|
|
|
9
10
|
*/
|
|
10
11
|
const Template = args => {
|
|
11
12
|
// return element
|
|
12
|
-
return (h("mg-illustrated-message", Object.assign({}, args),
|
|
13
|
-
h("svg", { slot: "illustration", width: "190", height: "350", viewBox: "0 0 190 350", xmlns: "http://www.w3.org/2000/svg" },
|
|
14
|
-
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z", fill: "black" })),
|
|
15
|
-
h("h2", { slot: "title" }, "Lorem Ipsum"),
|
|
16
|
-
h("h3", { slot: "details" }, "The standard Lorem Ipsum passage, used since the 1500s"),
|
|
17
|
-
h("div", { slot: "details" }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")));
|
|
13
|
+
return (h("mg-illustrated-message", Object.assign({}, filterArgs(args, { size: 'regular' })), h("svg", { slot: "illustration", width: "190", height: "350", viewBox: "0 0 190 350", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z", fill: "black" })), h("h2", { slot: "title" }, "Lorem Ipsum"), h("h3", { slot: "details" }, "The standard Lorem Ipsum passage, used since the 1500s"), h("div", { slot: "details" }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")));
|
|
18
14
|
};
|
|
19
15
|
export const MgIllustratedMessage = Template.bind({});
|
|
20
16
|
MgIllustratedMessage.args = {
|