@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 { Host, h } from '@stencil/core';
|
|
2
2
|
import { createID, isTagName } from '../../../utils/components.utils';
|
|
3
3
|
import { createPopper } from '@popperjs/core';
|
|
4
4
|
import { initLocales } from '../../../locales';
|
|
@@ -151,140 +151,142 @@ export class MgPopover {
|
|
|
151
151
|
* @returns {HTMLElement} HTML Element
|
|
152
152
|
*/
|
|
153
153
|
render() {
|
|
154
|
-
return (h(Host, null,
|
|
155
|
-
h("slot", null),
|
|
156
|
-
h("div", { id: this.identifier, class: "mg-popover" },
|
|
157
|
-
!this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton },
|
|
158
|
-
h("mg-icon", { icon: "cross" }))),
|
|
159
|
-
h("div", { class: "mg-popover__title" },
|
|
160
|
-
h("slot", { name: "title" })),
|
|
161
|
-
h("slot", { name: "content" }),
|
|
162
|
-
h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
154
|
+
return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
163
155
|
}
|
|
164
156
|
static get is() { return "mg-popover"; }
|
|
165
157
|
static get encapsulation() { return "scoped"; }
|
|
166
|
-
static get originalStyleUrls() {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
158
|
+
static get originalStyleUrls() {
|
|
159
|
+
return {
|
|
160
|
+
"$": ["mg-popover.scss"]
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
static get styleUrls() {
|
|
164
|
+
return {
|
|
165
|
+
"$": ["mg-popover.css"]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static get properties() {
|
|
169
|
+
return {
|
|
170
|
+
"identifier": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "string",
|
|
175
|
+
"resolved": "string",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": "Sets an `id` attribute.\nNeeded by the input for accessibility `aria-decribedby`."
|
|
183
|
+
},
|
|
184
|
+
"attribute": "identifier",
|
|
185
|
+
"reflect": false,
|
|
186
|
+
"defaultValue": "createID('mg-popover')"
|
|
186
187
|
},
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"Placement": {
|
|
199
|
-
"location": "import",
|
|
200
|
-
"path": "./mg-popover.conf"
|
|
188
|
+
"placement": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "Placement",
|
|
193
|
+
"resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
194
|
+
"references": {
|
|
195
|
+
"Placement": {
|
|
196
|
+
"location": "import",
|
|
197
|
+
"path": "./mg-popover.conf"
|
|
198
|
+
}
|
|
201
199
|
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
"defaultValue": "'bottom'"
|
|
213
|
-
},
|
|
214
|
-
"closeButton": {
|
|
215
|
-
"type": "boolean",
|
|
216
|
-
"mutable": false,
|
|
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 popover has a cross button"
|
|
227
|
-
},
|
|
228
|
-
"attribute": "close-button",
|
|
229
|
-
"reflect": false,
|
|
230
|
-
"defaultValue": "false"
|
|
231
|
-
},
|
|
232
|
-
"display": {
|
|
233
|
-
"type": "boolean",
|
|
234
|
-
"mutable": true,
|
|
235
|
-
"complexType": {
|
|
236
|
-
"original": "boolean",
|
|
237
|
-
"resolved": "boolean",
|
|
238
|
-
"references": {}
|
|
239
|
-
},
|
|
240
|
-
"required": false,
|
|
241
|
-
"optional": false,
|
|
242
|
-
"docs": {
|
|
243
|
-
"tags": [],
|
|
244
|
-
"text": "Display popover"
|
|
245
|
-
},
|
|
246
|
-
"attribute": "display",
|
|
247
|
-
"reflect": false,
|
|
248
|
-
"defaultValue": "false"
|
|
249
|
-
},
|
|
250
|
-
"disabled": {
|
|
251
|
-
"type": "boolean",
|
|
252
|
-
"mutable": true,
|
|
253
|
-
"complexType": {
|
|
254
|
-
"original": "boolean",
|
|
255
|
-
"resolved": "boolean",
|
|
256
|
-
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": false,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Popover placement"
|
|
206
|
+
},
|
|
207
|
+
"attribute": "placement",
|
|
208
|
+
"reflect": false,
|
|
209
|
+
"defaultValue": "'bottom'"
|
|
257
210
|
},
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"
|
|
262
|
-
|
|
211
|
+
"closeButton": {
|
|
212
|
+
"type": "boolean",
|
|
213
|
+
"mutable": false,
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "boolean",
|
|
216
|
+
"resolved": "boolean",
|
|
217
|
+
"references": {}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": false,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "Define if popover has a cross button"
|
|
224
|
+
},
|
|
225
|
+
"attribute": "close-button",
|
|
226
|
+
"reflect": false,
|
|
227
|
+
"defaultValue": "false"
|
|
263
228
|
},
|
|
264
|
-
"
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
229
|
+
"display": {
|
|
230
|
+
"type": "boolean",
|
|
231
|
+
"mutable": true,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "boolean",
|
|
234
|
+
"resolved": "boolean",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Display popover"
|
|
242
|
+
},
|
|
243
|
+
"attribute": "display",
|
|
244
|
+
"reflect": false,
|
|
245
|
+
"defaultValue": "false"
|
|
278
246
|
},
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"
|
|
247
|
+
"disabled": {
|
|
248
|
+
"type": "boolean",
|
|
249
|
+
"mutable": true,
|
|
250
|
+
"complexType": {
|
|
251
|
+
"original": "boolean",
|
|
252
|
+
"resolved": "boolean",
|
|
253
|
+
"references": {}
|
|
254
|
+
},
|
|
255
|
+
"required": false,
|
|
256
|
+
"optional": false,
|
|
257
|
+
"docs": {
|
|
258
|
+
"tags": [],
|
|
259
|
+
"text": "Disable popover"
|
|
260
|
+
},
|
|
261
|
+
"attribute": "disabled",
|
|
262
|
+
"reflect": false,
|
|
263
|
+
"defaultValue": "false"
|
|
283
264
|
}
|
|
284
|
-
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
static get events() {
|
|
268
|
+
return [{
|
|
269
|
+
"method": "displayChange",
|
|
270
|
+
"name": "display-change",
|
|
271
|
+
"bubbles": true,
|
|
272
|
+
"cancelable": true,
|
|
273
|
+
"composed": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Emited event when display value change"
|
|
277
|
+
},
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "boolean",
|
|
280
|
+
"resolved": "boolean",
|
|
281
|
+
"references": {}
|
|
282
|
+
}
|
|
283
|
+
}];
|
|
284
|
+
}
|
|
285
285
|
static get elementRef() { return "element"; }
|
|
286
|
-
static get watchers() {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
static get watchers() {
|
|
287
|
+
return [{
|
|
288
|
+
"propName": "display",
|
|
289
|
+
"methodName": "handleDisplay"
|
|
290
|
+
}];
|
|
291
|
+
}
|
|
290
292
|
}
|
|
@@ -19,11 +19,7 @@ export default {
|
|
|
19
19
|
* @returns {HTMLElement} HTMLElement
|
|
20
20
|
*/
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
const Template = (args) => (h("mg-tabs", Object.assign({}, filterArgs(args, { size: sizes[0], activeTab: 1 })),
|
|
23
|
-
h("div", { slot: "tab_content-1" }, "Content 1"),
|
|
24
|
-
h("div", { slot: "tab_content-2" }, "Content 2"),
|
|
25
|
-
h("div", { slot: "tab_content-3" }, "Content 3"),
|
|
26
|
-
h("div", { slot: "tab_content-4" }, "Content 4")));
|
|
22
|
+
const Template = (args) => (h("mg-tabs", Object.assign({}, filterArgs(args, { size: sizes[0], activeTab: 1 })), h("div", { slot: "tab_content-1" }, "Content 1"), h("div", { slot: "tab_content-2" }, "Content 2"), h("div", { slot: "tab_content-3" }, "Content 3"), h("div", { slot: "tab_content-4" }, "Content 4")));
|
|
27
23
|
export const MgTabs = Template.bind({});
|
|
28
24
|
MgTabs.args = {
|
|
29
25
|
items: ['Tab 1', 'Tab 2', 'Tab 3', 'Tab 4'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { createID, ClassList, allItemsAreString } from '../../../utils/components.utils';
|
|
3
3
|
import { sizes, Status } from './mg-tabs.conf';
|
|
4
4
|
/**
|
|
@@ -129,6 +129,11 @@ export class MgTabs {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
+
validateLabel(newValue) {
|
|
133
|
+
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
134
|
+
throw new Error('<mg-tabs> prop "label" is required.');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
132
137
|
validateSize(newValue) {
|
|
133
138
|
if (!sizes.includes(newValue)) {
|
|
134
139
|
throw new Error(`<mg-tabs> prop "size" must be one of : ${sizes.join(', ')}`);
|
|
@@ -166,6 +171,7 @@ export class MgTabs {
|
|
|
166
171
|
*/
|
|
167
172
|
componentWillLoad() {
|
|
168
173
|
// Check tabs format
|
|
174
|
+
this.validateLabel(this.label);
|
|
169
175
|
this.validateItems(this.items);
|
|
170
176
|
this.validateActiveTab(this.activeTab);
|
|
171
177
|
this.validateSize(this.size);
|
|
@@ -177,149 +183,158 @@ export class MgTabs {
|
|
|
177
183
|
* @returns {HTMLElement} HTML Element
|
|
178
184
|
*/
|
|
179
185
|
render() {
|
|
180
|
-
return (h("div", { class: this.classList.join() },
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) },
|
|
187
|
-
tab.icon !== undefined && h("mg-icon", { icon: tab.icon }),
|
|
188
|
-
tab.label,
|
|
189
|
-
tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))),
|
|
190
|
-
this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" },
|
|
191
|
-
h("slot", { name: this.getElementId('tab_content', index) }))))));
|
|
186
|
+
return (h("div", { class: this.classList.join() }, h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index) => (h("button", { role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
187
|
+
[`${this.buttonTabBaseClass}`]: true,
|
|
188
|
+
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasGivenStatus(tab, Status.ACTIVE),
|
|
189
|
+
[`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasGivenStatus(tab, Status.DISABLED),
|
|
190
|
+
[`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasGivenStatus(tab, Status.HIDDEN),
|
|
191
|
+
}, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))), this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))));
|
|
192
192
|
}
|
|
193
193
|
static get is() { return "mg-tabs"; }
|
|
194
194
|
static get encapsulation() { return "shadow"; }
|
|
195
|
-
static get originalStyleUrls() {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
"original": "string",
|
|
225
|
-
"resolved": "string",
|
|
226
|
-
"references": {}
|
|
227
|
-
},
|
|
228
|
-
"required": true,
|
|
229
|
-
"optional": false,
|
|
230
|
-
"docs": {
|
|
231
|
-
"tags": [],
|
|
232
|
-
"text": "Tabs label. Include short tabs description.\nRequired for accessibility"
|
|
195
|
+
static get originalStyleUrls() {
|
|
196
|
+
return {
|
|
197
|
+
"$": ["mg-tabs.scss"]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
static get styleUrls() {
|
|
201
|
+
return {
|
|
202
|
+
"$": ["mg-tabs.css"]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
static get properties() {
|
|
206
|
+
return {
|
|
207
|
+
"identifier": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "string",
|
|
212
|
+
"resolved": "string",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
|
|
220
|
+
},
|
|
221
|
+
"attribute": "identifier",
|
|
222
|
+
"reflect": false,
|
|
223
|
+
"defaultValue": "createID('mg-tabs')"
|
|
233
224
|
},
|
|
234
|
-
"
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"
|
|
243
|
-
"
|
|
225
|
+
"label": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "string",
|
|
230
|
+
"resolved": "string",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": true,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Tabs label. Include short tabs description.\nRequired for accessibility"
|
|
238
|
+
},
|
|
239
|
+
"attribute": "label",
|
|
240
|
+
"reflect": false
|
|
244
241
|
},
|
|
245
|
-
"
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
|
|
242
|
+
"size": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"mutable": false,
|
|
245
|
+
"complexType": {
|
|
246
|
+
"original": "string",
|
|
247
|
+
"resolved": "string",
|
|
248
|
+
"references": {}
|
|
249
|
+
},
|
|
250
|
+
"required": false,
|
|
251
|
+
"optional": false,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": "Define tabs size"
|
|
255
|
+
},
|
|
256
|
+
"attribute": "size",
|
|
257
|
+
"reflect": false,
|
|
258
|
+
"defaultValue": "'regular'"
|
|
250
259
|
},
|
|
251
|
-
"
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"TabItem": {
|
|
263
|
-
"location": "import",
|
|
264
|
-
"path": "./mg-tabs.conf"
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "unknown",
|
|
262
|
+
"mutable": false,
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "string[] | TabItem[]",
|
|
265
|
+
"resolved": "TabItem[] | string[]",
|
|
266
|
+
"references": {
|
|
267
|
+
"TabItem": {
|
|
268
|
+
"location": "import",
|
|
269
|
+
"path": "./mg-tabs.conf"
|
|
270
|
+
}
|
|
265
271
|
}
|
|
272
|
+
},
|
|
273
|
+
"required": true,
|
|
274
|
+
"optional": false,
|
|
275
|
+
"docs": {
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": "Tabs items\nRequired"
|
|
266
278
|
}
|
|
267
279
|
},
|
|
268
|
-
"
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
"
|
|
272
|
-
|
|
280
|
+
"activeTab": {
|
|
281
|
+
"type": "number",
|
|
282
|
+
"mutable": true,
|
|
283
|
+
"complexType": {
|
|
284
|
+
"original": "number",
|
|
285
|
+
"resolved": "number",
|
|
286
|
+
"references": {}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": false,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "Active tab number\ndefault: first is 1"
|
|
293
|
+
},
|
|
294
|
+
"attribute": "active-tab",
|
|
295
|
+
"reflect": true,
|
|
296
|
+
"defaultValue": "1"
|
|
273
297
|
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
"name": "active-tab-change",
|
|
301
|
-
"bubbles": true,
|
|
302
|
-
"cancelable": true,
|
|
303
|
-
"composed": true,
|
|
304
|
-
"docs": {
|
|
305
|
-
"tags": [],
|
|
306
|
-
"text": "Emited event when active tab change"
|
|
307
|
-
},
|
|
308
|
-
"complexType": {
|
|
309
|
-
"original": "number",
|
|
310
|
-
"resolved": "number",
|
|
311
|
-
"references": {}
|
|
312
|
-
}
|
|
313
|
-
}]; }
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
static get states() {
|
|
301
|
+
return {
|
|
302
|
+
"tabs": {},
|
|
303
|
+
"classList": {}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
static get events() {
|
|
307
|
+
return [{
|
|
308
|
+
"method": "activeTabChange",
|
|
309
|
+
"name": "active-tab-change",
|
|
310
|
+
"bubbles": true,
|
|
311
|
+
"cancelable": true,
|
|
312
|
+
"composed": true,
|
|
313
|
+
"docs": {
|
|
314
|
+
"tags": [],
|
|
315
|
+
"text": "Emited event when active tab change"
|
|
316
|
+
},
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "number",
|
|
319
|
+
"resolved": "number",
|
|
320
|
+
"references": {}
|
|
321
|
+
}
|
|
322
|
+
}];
|
|
323
|
+
}
|
|
314
324
|
static get elementRef() { return "element"; }
|
|
315
|
-
static get watchers() {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
static get watchers() {
|
|
326
|
+
return [{
|
|
327
|
+
"propName": "label",
|
|
328
|
+
"methodName": "validateLabel"
|
|
329
|
+
}, {
|
|
330
|
+
"propName": "size",
|
|
331
|
+
"methodName": "validateSize"
|
|
332
|
+
}, {
|
|
333
|
+
"propName": "items",
|
|
334
|
+
"methodName": "validateItems"
|
|
335
|
+
}, {
|
|
336
|
+
"propName": "activeTab",
|
|
337
|
+
"methodName": "validateActiveTab"
|
|
338
|
+
}];
|
|
339
|
+
}
|
|
325
340
|
}
|
|
Binary file
|