@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
package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { isTagName } from '../../../utils/components.utils';
|
|
3
3
|
export class MgIllustratedMessage {
|
|
4
4
|
constructor() {
|
|
@@ -31,44 +31,44 @@ export class MgIllustratedMessage {
|
|
|
31
31
|
* @returns {HTMLElement} HTML Element
|
|
32
32
|
*/
|
|
33
33
|
render() {
|
|
34
|
-
return (h("div", { class: "mg-illustrated-message" },
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} },
|
|
39
|
-
h("slot", { name: "illustration" })),
|
|
40
|
-
h("div", { class: "mg-illustrated-message__title" },
|
|
41
|
-
h("slot", { name: "title" })),
|
|
42
|
-
h("div", { class: "mg-illustrated-message__details" },
|
|
43
|
-
h("slot", { name: "details" }))));
|
|
34
|
+
return (h("div", { class: "mg-illustrated-message" }, h("div", { class: {
|
|
35
|
+
'mg-illustrated-message__illustration': true,
|
|
36
|
+
'mg-illustrated-message__illustration--small': this.size === 'small',
|
|
37
|
+
} }, h("slot", { name: "illustration" })), h("div", { class: "mg-illustrated-message__title" }, h("slot", { name: "title" })), h("div", { class: "mg-illustrated-message__details" }, h("slot", { name: "details" }))));
|
|
44
38
|
}
|
|
45
39
|
static get is() { return "mg-illustrated-message"; }
|
|
46
40
|
static get encapsulation() { return "shadow"; }
|
|
47
|
-
static get originalStyleUrls() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["mg-illustrated-message.scss"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["mg-illustrated-message.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get properties() {
|
|
52
|
+
return {
|
|
53
|
+
"size": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "'regular' | 'small'",
|
|
58
|
+
"resolved": "\"regular\" | \"small\"",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "Define illustration size"
|
|
66
|
+
},
|
|
67
|
+
"attribute": "size",
|
|
68
|
+
"reflect": false,
|
|
69
|
+
"defaultValue": "'regular'"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
73
|
static get elementRef() { return "element"; }
|
|
74
74
|
}
|
|
@@ -22,9 +22,7 @@ export default {
|
|
|
22
22
|
* @returns {HTMLElement} HTMLElement
|
|
23
23
|
*/
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
const Template = (args) => (h("mg-message", Object.assign({}, filterArgs(args, { variant: variants[0] })),
|
|
26
|
-
args.slotContent && h("span", { innerHTML: args.slotContent }),
|
|
27
|
-
args.slotActions && h("span", { slot: "actions", innerHTML: args.slotActions })));
|
|
25
|
+
const Template = (args) => (h("mg-message", Object.assign({}, filterArgs(args, { variant: variants[0] })), args.slotContent && h("span", { innerHTML: args.slotContent }), args.slotActions && h("span", { slot: "actions", innerHTML: args.slotActions })));
|
|
28
26
|
export const MgMessage = Template.bind({});
|
|
29
27
|
MgMessage.args = {
|
|
30
28
|
slotContent: `<p>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.</p>`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { createID, ClassList } from '../../../utils/components.utils';
|
|
3
3
|
import { variants } from './mg-message.conf';
|
|
4
4
|
import { initLocales } from '../../../locales';
|
|
@@ -136,165 +136,166 @@ export class MgMessage {
|
|
|
136
136
|
* @returns {HTMLElement} HTML Element
|
|
137
137
|
*/
|
|
138
138
|
render() {
|
|
139
|
-
return (h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' },
|
|
140
|
-
h("span", { class: "mg-message__icon" },
|
|
141
|
-
h("mg-icon", { icon: this.getIcon() })),
|
|
142
|
-
h("div", { class: "mg-message__content" },
|
|
143
|
-
h("span", { class: "mg-message__content-slot" },
|
|
144
|
-
h("slot", null)),
|
|
145
|
-
this.hasActions && h("span", { class: "mg-message__content-separator" }),
|
|
146
|
-
this.hasActions && (h("span", { class: "mg-message__content-actions-slot" },
|
|
147
|
-
h("slot", { name: "actions" })))),
|
|
148
|
-
this.closeButton && (h("span", { class: "mg-message__close-button" },
|
|
149
|
-
h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose },
|
|
150
|
-
h("mg-icon", { icon: "cross" }))))));
|
|
139
|
+
return (h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, h("span", { class: "mg-message__icon" }, h("mg-icon", { icon: this.getIcon() })), h("div", { class: "mg-message__content" }, h("span", { class: "mg-message__content-slot" }, h("slot", null)), this.hasActions && h("span", { class: "mg-message__content-separator" }), this.hasActions && (h("span", { class: "mg-message__content-actions-slot" }, h("slot", { name: "actions" })))), this.closeButton && (h("span", { class: "mg-message__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
|
|
151
140
|
}
|
|
152
141
|
static get is() { return "mg-message"; }
|
|
153
142
|
static get encapsulation() { return "shadow"; }
|
|
154
|
-
static get originalStyleUrls() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
"original": "number",
|
|
184
|
-
"resolved": "number",
|
|
185
|
-
"references": {}
|
|
186
|
-
},
|
|
187
|
-
"required": false,
|
|
188
|
-
"optional": false,
|
|
189
|
-
"docs": {
|
|
190
|
-
"tags": [],
|
|
191
|
-
"text": "Add a delay to hide/close message when it passed\nValue is defined in seconds and must greater than 2 seconds (PDA9-314 RG-06)"
|
|
192
|
-
},
|
|
193
|
-
"attribute": "delay",
|
|
194
|
-
"reflect": false
|
|
195
|
-
},
|
|
196
|
-
"variant": {
|
|
197
|
-
"type": "string",
|
|
198
|
-
"mutable": false,
|
|
199
|
-
"complexType": {
|
|
200
|
-
"original": "string",
|
|
201
|
-
"resolved": "string",
|
|
202
|
-
"references": {}
|
|
203
|
-
},
|
|
204
|
-
"required": false,
|
|
205
|
-
"optional": false,
|
|
206
|
-
"docs": {
|
|
207
|
-
"tags": [],
|
|
208
|
-
"text": "Message variant"
|
|
209
|
-
},
|
|
210
|
-
"attribute": "variant",
|
|
211
|
-
"reflect": false,
|
|
212
|
-
"defaultValue": "variants[0]"
|
|
213
|
-
},
|
|
214
|
-
"closeButton": {
|
|
215
|
-
"type": "boolean",
|
|
216
|
-
"mutable": true,
|
|
217
|
-
"complexType": {
|
|
218
|
-
"original": "boolean",
|
|
219
|
-
"resolved": "boolean",
|
|
220
|
-
"references": {}
|
|
221
|
-
},
|
|
222
|
-
"required": false,
|
|
223
|
-
"optional": false,
|
|
224
|
-
"docs": {
|
|
225
|
-
"tags": [],
|
|
226
|
-
"text": "Define if message has a cross button\nRG 01: https://jira.mgdis.fr/browse/PDA9-140"
|
|
227
|
-
},
|
|
228
|
-
"attribute": "close-button",
|
|
229
|
-
"reflect": false,
|
|
230
|
-
"defaultValue": "false"
|
|
231
|
-
},
|
|
232
|
-
"hide": {
|
|
233
|
-
"type": "boolean",
|
|
234
|
-
"mutable": true,
|
|
235
|
-
"complexType": {
|
|
236
|
-
"original": "boolean",
|
|
237
|
-
"resolved": "boolean",
|
|
238
|
-
"references": {}
|
|
143
|
+
static get originalStyleUrls() {
|
|
144
|
+
return {
|
|
145
|
+
"$": ["mg-message.scss"]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
static get styleUrls() {
|
|
149
|
+
return {
|
|
150
|
+
"$": ["mg-message.css"]
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
static get properties() {
|
|
154
|
+
return {
|
|
155
|
+
"identifier": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"mutable": false,
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "string",
|
|
160
|
+
"resolved": "string",
|
|
161
|
+
"references": {}
|
|
162
|
+
},
|
|
163
|
+
"required": false,
|
|
164
|
+
"optional": false,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
|
|
168
|
+
},
|
|
169
|
+
"attribute": "identifier",
|
|
170
|
+
"reflect": false,
|
|
171
|
+
"defaultValue": "createID('mg-message')"
|
|
239
172
|
},
|
|
240
|
-
"
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
"
|
|
244
|
-
|
|
173
|
+
"delay": {
|
|
174
|
+
"type": "number",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "number",
|
|
178
|
+
"resolved": "number",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Add a delay to hide/close message when it passed\nValue is defined in seconds and must greater than 2 seconds (PDA9-314 RG-06)"
|
|
186
|
+
},
|
|
187
|
+
"attribute": "delay",
|
|
188
|
+
"reflect": false
|
|
245
189
|
},
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"
|
|
263
|
-
"text": "Emited event when message is diplayed"
|
|
190
|
+
"variant": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "string",
|
|
195
|
+
"resolved": "string",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Message variant"
|
|
203
|
+
},
|
|
204
|
+
"attribute": "variant",
|
|
205
|
+
"reflect": false,
|
|
206
|
+
"defaultValue": "variants[0]"
|
|
264
207
|
},
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
"
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
208
|
+
"closeButton": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"mutable": true,
|
|
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 message has a cross button\nRG 01: https://jira.mgdis.fr/browse/PDA9-140"
|
|
221
|
+
},
|
|
222
|
+
"attribute": "close-button",
|
|
223
|
+
"reflect": false,
|
|
224
|
+
"defaultValue": "false"
|
|
279
225
|
},
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
226
|
+
"hide": {
|
|
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 if message is hidden"
|
|
239
|
+
},
|
|
240
|
+
"attribute": "hide",
|
|
241
|
+
"reflect": false,
|
|
242
|
+
"defaultValue": "false"
|
|
284
243
|
}
|
|
285
|
-
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
static get states() {
|
|
247
|
+
return {
|
|
248
|
+
"classList": {},
|
|
249
|
+
"hasActions": {}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
static get events() {
|
|
253
|
+
return [{
|
|
254
|
+
"method": "componentShow",
|
|
255
|
+
"name": "component-show",
|
|
256
|
+
"bubbles": true,
|
|
257
|
+
"cancelable": true,
|
|
258
|
+
"composed": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": "Emited event when message is diplayed"
|
|
262
|
+
},
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "string",
|
|
265
|
+
"resolved": "string",
|
|
266
|
+
"references": {}
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
"method": "componentHide",
|
|
270
|
+
"name": "component-hide",
|
|
271
|
+
"bubbles": true,
|
|
272
|
+
"cancelable": true,
|
|
273
|
+
"composed": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Emited event when message is hidden"
|
|
277
|
+
},
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "string",
|
|
280
|
+
"resolved": "string",
|
|
281
|
+
"references": {}
|
|
282
|
+
}
|
|
283
|
+
}];
|
|
284
|
+
}
|
|
286
285
|
static get elementRef() { return "element"; }
|
|
287
|
-
static get watchers() {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
286
|
+
static get watchers() {
|
|
287
|
+
return [{
|
|
288
|
+
"propName": "delay",
|
|
289
|
+
"methodName": "validateDelay"
|
|
290
|
+
}, {
|
|
291
|
+
"propName": "variant",
|
|
292
|
+
"methodName": "validateVariant"
|
|
293
|
+
}, {
|
|
294
|
+
"propName": "closeButton",
|
|
295
|
+
"methodName": "validateCloseButton"
|
|
296
|
+
}, {
|
|
297
|
+
"propName": "hide",
|
|
298
|
+
"methodName": "validateHide"
|
|
299
|
+
}];
|
|
300
|
+
}
|
|
300
301
|
}
|
|
@@ -13,21 +13,17 @@ export default {
|
|
|
13
13
|
* @returns {HTMLElement} HTMLElement
|
|
14
14
|
*/
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
-
const Template = (args) => (h("div", null,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} }, "Open modal"),
|
|
28
|
-
h("mg-modal", Object.assign({}, filterArgs(args)),
|
|
29
|
-
args.slotContent && h("div", { slot: "content", innerHTML: args.slotContent }),
|
|
30
|
-
args.slotActions && h("div", { slot: "actions", innerHTML: args.slotActions }))));
|
|
16
|
+
const Template = (args) => (h("div", null, h("mg-button", { controls: "identifier", haspopup: "dialog", onClick: () => {
|
|
17
|
+
const mgModal = document.querySelector('mg-modal');
|
|
18
|
+
const isHide = mgModal.hide === true;
|
|
19
|
+
if (isHide) {
|
|
20
|
+
mgModal.removeAttribute('hide'); // storybook first render is an attribute then we use property
|
|
21
|
+
mgModal.hide = false;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
mgModal.hide = true;
|
|
25
|
+
}
|
|
26
|
+
} }, "Open modal"), h("mg-modal", Object.assign({}, filterArgs(args)), args.slotContent && h("div", { slot: "content", innerHTML: args.slotContent }), args.slotActions && h("div", { slot: "actions", innerHTML: args.slotActions }))));
|
|
31
27
|
export const MgModal = Template.bind({});
|
|
32
28
|
MgModal.args = {
|
|
33
29
|
slotContent: `<p>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.</p>`,
|