@mgdis/mg-components 6.20.0 → 6.22.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-TUElr4Wv.js → index-BxB20_Vw.js} +54 -0
- package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1761 -80
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +761 -371
- package/dist/cjs/mg-alert.cjs.entry.js +17 -9
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
- package/dist/cjs/mg-input-combobox.cjs.entry.js +49 -19
- package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40096 -15821
- package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
- package/dist/cjs/mg-loader.cjs.entry.js +8 -6
- package/dist/cjs/mg-progress.cjs.entry.js +19 -9
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +163 -53
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +3 -36
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +21 -43
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +65 -38
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +92 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +37 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +13 -33
- package/dist/collection/locales/en/messages.json +14 -0
- package/dist/collection/locales/fr/messages.json +14 -0
- package/dist/components/events.utils.js +1 -23
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -408
- package/dist/components/index3.js +1 -476
- package/dist/components/mg-action-more.js +1 -254
- package/dist/components/mg-alert.js +1 -224
- package/dist/components/mg-badge.js +1 -6
- package/dist/components/mg-badge2.js +1 -113
- package/dist/components/mg-breadcrumb.d.ts +11 -0
- package/dist/components/mg-breadcrumb.js +1 -0
- package/dist/components/mg-button.js +1 -6
- package/dist/components/mg-button2.js +1 -275
- package/dist/components/mg-card.js +1 -6
- package/dist/components/mg-card2.js +1 -92
- package/dist/components/mg-character-left.js +1 -6
- package/dist/components/mg-character-left2.js +1 -75
- package/dist/components/mg-details.js +1 -104
- package/dist/components/mg-divider.js +1 -6
- package/dist/components/mg-divider2.js +1 -49
- package/dist/components/mg-fieldset.js +1 -209
- package/dist/components/mg-form.js +1 -302
- package/dist/components/mg-icon.js +1 -6
- package/dist/components/mg-icon2.js +1 -188
- package/dist/components/mg-illustrated-message.js +1 -129
- package/dist/components/mg-input-checkbox-paginated.js +1 -6
- package/dist/components/mg-input-checkbox-paginated2.js +1 -135
- package/dist/components/mg-input-checkbox.js +1 -762
- package/dist/components/mg-input-combobox.js +1 -940
- package/dist/components/mg-input-date.js +1 -463
- package/dist/components/mg-input-file.d.ts +11 -0
- package/dist/components/mg-input-file.js +1 -0
- package/dist/components/mg-input-numeric.js +1 -592
- package/dist/components/mg-input-password.js +1 -360
- package/dist/components/mg-input-radio.js +1 -392
- package/dist/components/mg-input-rich-text-editor.js +1663 -16797
- package/dist/components/mg-input-select.js +1 -6
- package/dist/components/mg-input-select2.js +1 -481
- package/dist/components/mg-input-text.js +1 -6
- package/dist/components/mg-input-text2.js +1 -514
- package/dist/components/mg-input-textarea.js +1 -412
- package/dist/components/mg-input-title.js +1 -6
- package/dist/components/mg-input-title2.js +1 -81
- package/dist/components/mg-input-toggle.js +1 -371
- package/dist/components/mg-input.conf.js +1 -0
- package/dist/components/mg-input.js +1 -6
- package/dist/components/mg-input2.js +1 -459
- package/dist/components/mg-item-more.js +1 -6
- package/dist/components/mg-item-more2.js +1 -505
- package/dist/components/mg-loader.js +1 -6
- package/dist/components/mg-loader2.js +1 -74
- package/dist/components/mg-menu-item.js +1 -6
- package/dist/components/mg-menu-item2.js +1 -485
- package/dist/components/mg-menu.js +1 -6
- package/dist/components/mg-message.js +1 -6
- package/dist/components/mg-message2.js +1 -146
- package/dist/components/mg-modal.js +1 -184
- package/dist/components/mg-pagination.js +1 -234
- package/dist/components/mg-panel.js +1 -350
- package/dist/components/mg-popover-content.js +1 -6
- package/dist/components/mg-popover-content2.js +1 -96
- package/dist/components/mg-popover.js +1 -6
- package/dist/components/mg-popover2.js +1 -312
- package/dist/components/mg-progress.js +1 -123
- package/dist/components/mg-skip-links.js +1 -78
- package/dist/components/mg-table.js +1 -319
- package/dist/components/mg-tabs.js +1 -6
- package/dist/components/mg-tabs2.js +1 -315
- package/dist/components/mg-tag.js +1 -133
- package/dist/components/mg-tooltip-content.js +1 -6
- package/dist/components/mg-tooltip-content2.js +1 -42
- package/dist/components/mg-tooltip.js +1 -6
- package/dist/components/mg-tooltip2.js +1 -421
- package/dist/components/popper.js +1 -1790
- package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1761 -80
- package/dist/esm/{index-CNX6lq0x.js → index-DSEloqPn.js} +54 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +761 -371
- package/dist/esm/mg-alert.entry.js +17 -9
- package/dist/esm/mg-breadcrumb.entry.js +61 -0
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +24 -7
- package/dist/esm/mg-input-combobox.entry.js +49 -19
- package/dist/esm/mg-input-file.entry.js +382 -0
- package/dist/esm/mg-input-rich-text-editor.entry.js +40083 -15808
- package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
- package/dist/esm/mg-loader.entry.js +8 -6
- package/dist/esm/mg-progress.entry.js +19 -9
- package/dist/mg-components/locales/en/messages.json +14 -0
- package/dist/mg-components/locales/fr/messages.json +14 -0
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-0482eb9f.entry.js +1 -0
- package/dist/mg-components/{p-7132bca1.entry.js → p-2ee92f38.entry.js} +1 -1
- package/dist/mg-components/{p-916dfb6d.entry.js → p-3b653226.entry.js} +1 -1
- package/dist/mg-components/p-5745fbea.entry.js +1 -0
- package/dist/mg-components/p-C9rmNQIL.js +1 -0
- package/dist/mg-components/p-DFwaH2hS.js +2 -0
- package/dist/mg-components/p-DSEloqPn.js +1 -0
- package/dist/mg-components/p-adec7fcc.entry.js +1 -0
- package/dist/mg-components/p-c63f97f0.entry.js +1658 -0
- package/dist/mg-components/p-c8c8cfc1.entry.js +1 -0
- package/dist/mg-components/p-cc793586.entry.js +1 -0
- package/dist/mg-components/p-d5e69c95.entry.js +1 -0
- package/dist/types/assets/icons/index.d.ts +2 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +50 -16
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
- package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
- package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
- package/dist/types/components.d.ts +302 -46
- package/dist/types/stencil-public-runtime.d.ts +76 -12
- package/ide/intellij/web-types.json +483 -51
- package/ide/vscode/css-custom-data.json +10 -2
- package/ide/vscode/html-custom-data.json +445 -104
- package/package.json +24 -23
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
- package/dist/mg-components/p-016bd291.entry.js +0 -1
- package/dist/mg-components/p-186a6139.entry.js +0 -1
- package/dist/mg-components/p-BluNKQ3L.js +0 -2
- package/dist/mg-components/p-CNX6lq0x.js +0 -1
- package/dist/mg-components/p-DDnrE1hD.js +0 -1
- package/dist/mg-components/p-cd061b38.entry.js +0 -1
- package/dist/mg-components/p-d2c72f09.entry.js +0 -1
- package/dist/mg-components/p-d5a276eb.entry.js +0 -1
- package/ide/vscode/custom.css-data.json +0 -425
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { directions
|
|
2
|
+
import { directions } from "./mg-menu.conf";
|
|
3
3
|
import { toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
4
4
|
/**
|
|
5
5
|
* @slot - Menu content
|
|
@@ -14,10 +14,6 @@ export class MgMenu {
|
|
|
14
14
|
* Component display direction.
|
|
15
15
|
*/
|
|
16
16
|
this.direction = 'horizontal';
|
|
17
|
-
/**
|
|
18
|
-
* Define mg-menu size
|
|
19
|
-
*/
|
|
20
|
-
this.size = 'medium';
|
|
21
17
|
/*************
|
|
22
18
|
* Methods *
|
|
23
19
|
*************/
|
|
@@ -53,7 +49,6 @@ export class MgMenu {
|
|
|
53
49
|
* render mg-item-more
|
|
54
50
|
*/
|
|
55
51
|
this.renderMgItemMore = () => {
|
|
56
|
-
var _a;
|
|
57
52
|
if (this.direction === directions.VERTICAL || (this.direction === directions.HORIZONTAL && this.isChildMenu()) || this.element.children.length <= 1) {
|
|
58
53
|
return;
|
|
59
54
|
}
|
|
@@ -67,8 +62,6 @@ export class MgMenu {
|
|
|
67
62
|
for (const propertie in this.itemmore) {
|
|
68
63
|
itemMoreElement[propertie] = this.itemmore[propertie];
|
|
69
64
|
}
|
|
70
|
-
if (((_a = this.itemmore) === null || _a === void 0 ? void 0 : _a.size) === undefined)
|
|
71
|
-
itemMoreElement.size = this.size;
|
|
72
65
|
};
|
|
73
66
|
}
|
|
74
67
|
validateLabel(newValue) {
|
|
@@ -92,11 +85,6 @@ export class MgMenu {
|
|
|
92
85
|
this.renderMgItemMore();
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
|
-
validateSize(newValue) {
|
|
96
|
-
if (!sizes.includes(newValue)) {
|
|
97
|
-
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
88
|
/**
|
|
101
89
|
* Define mg-menu-item listener when they are loaded
|
|
102
90
|
* @param event - mg-item-loaded "item-loaded" custom event
|
|
@@ -131,7 +119,6 @@ export class MgMenu {
|
|
|
131
119
|
this.validateDirection(this.direction);
|
|
132
120
|
this.validateLabel(this.label);
|
|
133
121
|
this.validateItemMore(this.itemmore);
|
|
134
|
-
this.validateSize(this.size);
|
|
135
122
|
}
|
|
136
123
|
/**
|
|
137
124
|
* Check if component slots configuration
|
|
@@ -166,7 +153,7 @@ export class MgMenu {
|
|
|
166
153
|
* @returns HTML Element
|
|
167
154
|
*/
|
|
168
155
|
render() {
|
|
169
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '17b5111014e866939f58170452ca74ee40c8454c', role: "list", "aria-label": this.label }, h("slot", { key: '7c2a9aafccbc7526c74acaf7a505d7a33befc5ad' })));
|
|
170
157
|
}
|
|
171
158
|
static get is() { return "mg-menu"; }
|
|
172
159
|
static get encapsulation() { return "shadow"; }
|
|
@@ -227,54 +214,48 @@ export class MgMenu {
|
|
|
227
214
|
"attribute": "direction",
|
|
228
215
|
"defaultValue": "'horizontal'"
|
|
229
216
|
},
|
|
230
|
-
"
|
|
217
|
+
"size": {
|
|
231
218
|
"type": "unknown",
|
|
232
219
|
"mutable": false,
|
|
233
220
|
"complexType": {
|
|
234
|
-
"original": "
|
|
235
|
-
"resolved": "
|
|
236
|
-
"references": {
|
|
237
|
-
"ItemMoreType": {
|
|
238
|
-
"location": "import",
|
|
239
|
-
"path": "./mg-menu.conf",
|
|
240
|
-
"id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::ItemMoreType"
|
|
241
|
-
}
|
|
242
|
-
}
|
|
221
|
+
"original": "never",
|
|
222
|
+
"resolved": "never",
|
|
223
|
+
"references": {}
|
|
243
224
|
},
|
|
244
225
|
"required": false,
|
|
245
|
-
"optional":
|
|
226
|
+
"optional": false,
|
|
246
227
|
"docs": {
|
|
247
|
-
"tags": [
|
|
248
|
-
|
|
228
|
+
"tags": [{
|
|
229
|
+
"name": "deprecated",
|
|
230
|
+
"text": "this prop is deprecated and will be removed in future releases"
|
|
231
|
+
}],
|
|
232
|
+
"text": "Size of the menu items"
|
|
249
233
|
},
|
|
250
234
|
"getter": false,
|
|
251
235
|
"setter": false
|
|
252
236
|
},
|
|
253
|
-
"
|
|
254
|
-
"type": "
|
|
237
|
+
"itemmore": {
|
|
238
|
+
"type": "unknown",
|
|
255
239
|
"mutable": false,
|
|
256
240
|
"complexType": {
|
|
257
|
-
"original": "
|
|
258
|
-
"resolved": "
|
|
241
|
+
"original": "ItemMoreType",
|
|
242
|
+
"resolved": "{ icon?: IconType; slotlabel?: SlotLabelType; }",
|
|
259
243
|
"references": {
|
|
260
|
-
"
|
|
244
|
+
"ItemMoreType": {
|
|
261
245
|
"location": "import",
|
|
262
246
|
"path": "./mg-menu.conf",
|
|
263
|
-
"id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::
|
|
247
|
+
"id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::ItemMoreType"
|
|
264
248
|
}
|
|
265
249
|
}
|
|
266
250
|
},
|
|
267
251
|
"required": false,
|
|
268
|
-
"optional":
|
|
252
|
+
"optional": true,
|
|
269
253
|
"docs": {
|
|
270
254
|
"tags": [],
|
|
271
|
-
"text": "
|
|
255
|
+
"text": "Customize \"mg-item-more\" element\nUsed with direction: 'horizontal' to manage overflow"
|
|
272
256
|
},
|
|
273
257
|
"getter": false,
|
|
274
|
-
"setter": false
|
|
275
|
-
"reflect": false,
|
|
276
|
-
"attribute": "size",
|
|
277
|
-
"defaultValue": "'medium'"
|
|
258
|
+
"setter": false
|
|
278
259
|
}
|
|
279
260
|
};
|
|
280
261
|
}
|
|
@@ -289,9 +270,6 @@ export class MgMenu {
|
|
|
289
270
|
}, {
|
|
290
271
|
"propName": "itemmore",
|
|
291
272
|
"methodName": "validateItemMore"
|
|
292
|
-
}, {
|
|
293
|
-
"propName": "size",
|
|
294
|
-
"methodName": "validateSize"
|
|
295
273
|
}];
|
|
296
274
|
}
|
|
297
275
|
static get listeners() {
|
|
@@ -16,7 +16,7 @@ export class MgMenuItem {
|
|
|
16
16
|
* Internal *
|
|
17
17
|
************/
|
|
18
18
|
this.name = 'mg-menu-item';
|
|
19
|
-
this.
|
|
19
|
+
this.classNavigationButton = 'mg-c-menu-item__navigation-button';
|
|
20
20
|
/************
|
|
21
21
|
* Props *
|
|
22
22
|
************/
|
|
@@ -28,6 +28,10 @@ export class MgMenuItem {
|
|
|
28
28
|
* Define menu-item status.
|
|
29
29
|
*/
|
|
30
30
|
this.status = 'visible';
|
|
31
|
+
/**
|
|
32
|
+
* Define menu-item isIcon style.
|
|
33
|
+
*/
|
|
34
|
+
this.isIcon = false;
|
|
31
35
|
/**
|
|
32
36
|
* Define menu-item content expanded.
|
|
33
37
|
*/
|
|
@@ -35,14 +39,10 @@ export class MgMenuItem {
|
|
|
35
39
|
/**********
|
|
36
40
|
* States *
|
|
37
41
|
*********/
|
|
38
|
-
/**
|
|
39
|
-
* Define menu-item size.
|
|
40
|
-
*/
|
|
41
|
-
this.size = 'medium';
|
|
42
42
|
/**
|
|
43
43
|
* Component button classes
|
|
44
44
|
*/
|
|
45
|
-
this.
|
|
45
|
+
this.classNavigationButtonClassList = new ClassList([this.classNavigationButton]);
|
|
46
46
|
/**
|
|
47
47
|
* Does component have children.
|
|
48
48
|
*/
|
|
@@ -146,12 +146,6 @@ export class MgMenuItem {
|
|
|
146
146
|
* @param guard - prevent action with guard
|
|
147
147
|
*/
|
|
148
148
|
this.updateItem = (guard) => {
|
|
149
|
-
const menu = this.getParentMenu();
|
|
150
|
-
// define element size
|
|
151
|
-
if ((menu === null || menu === void 0 ? void 0 : menu.size) !== undefined && !this.isItemMore)
|
|
152
|
-
this.size = menu.size;
|
|
153
|
-
else if (this.isItemMore)
|
|
154
|
-
this.size = this.element.dataset.size;
|
|
155
149
|
// when vertical main menu item contain an active item we force expanded
|
|
156
150
|
this.updateExpanded(this.expanded);
|
|
157
151
|
this.updateStatus(guard);
|
|
@@ -177,9 +171,6 @@ export class MgMenuItem {
|
|
|
177
171
|
const closePopover = (element) => {
|
|
178
172
|
if (element === null)
|
|
179
173
|
return;
|
|
180
|
-
else if (element !== this.element && element.expanded && element.shadowRoot.querySelector('mg-popover') !== null) {
|
|
181
|
-
element.expanded = false;
|
|
182
|
-
}
|
|
183
174
|
else {
|
|
184
175
|
closePopover(element.parentElement.closest('mg-menu-item'));
|
|
185
176
|
}
|
|
@@ -215,8 +206,23 @@ export class MgMenuItem {
|
|
|
215
206
|
}
|
|
216
207
|
watchStatus(newValue, oldValue) {
|
|
217
208
|
if (oldValue !== undefined)
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
209
|
+
this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${oldValue}`);
|
|
210
|
+
this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${newValue}`);
|
|
211
|
+
}
|
|
212
|
+
watchIsIcon(newValue) {
|
|
213
|
+
const classIcon = `${this.classNavigationButton}--is-icon`;
|
|
214
|
+
if (newValue) {
|
|
215
|
+
// in vertical menu isIcon is not available
|
|
216
|
+
if (this.direction === 'vertical') {
|
|
217
|
+
this.isIcon = false;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
this.classNavigationButtonClassList.add(classIcon);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
this.classNavigationButtonClassList.delete(classIcon);
|
|
225
|
+
}
|
|
220
226
|
}
|
|
221
227
|
watchExpanded(newValue) {
|
|
222
228
|
if (typeof newValue !== 'boolean') {
|
|
@@ -231,15 +237,10 @@ export class MgMenuItem {
|
|
|
231
237
|
});
|
|
232
238
|
}
|
|
233
239
|
}
|
|
234
|
-
watchSize(newValue, oldValue) {
|
|
235
|
-
if (oldValue !== undefined)
|
|
236
|
-
this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);
|
|
237
|
-
this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);
|
|
238
|
-
}
|
|
239
240
|
validateDirection(newValue, oldValue) {
|
|
240
241
|
if (oldValue !== undefined)
|
|
241
|
-
this.
|
|
242
|
-
this.
|
|
242
|
+
this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${oldValue}`);
|
|
243
|
+
this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${newValue}`);
|
|
243
244
|
// manage all sub levels child menu-items level with data-level attribut
|
|
244
245
|
Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {
|
|
245
246
|
if (this.isDirection(directions.VERTICAL, newValue)) {
|
|
@@ -262,6 +263,7 @@ export class MgMenuItem {
|
|
|
262
263
|
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
263
264
|
watchDataStyleDirection(newValue) {
|
|
264
265
|
this.direction = newValue;
|
|
266
|
+
this.watchIsIcon(this.isIcon);
|
|
265
267
|
}
|
|
266
268
|
/**
|
|
267
269
|
* has focus value in dataset
|
|
@@ -301,7 +303,7 @@ export class MgMenuItem {
|
|
|
301
303
|
this.watchExpanded(this.expanded);
|
|
302
304
|
this.watchTarget(this.target);
|
|
303
305
|
this.watchIdentifier(this.identifier);
|
|
304
|
-
this.
|
|
306
|
+
this.watchIsIcon(this.isIcon);
|
|
305
307
|
}
|
|
306
308
|
/**
|
|
307
309
|
* Check if component slots configuration
|
|
@@ -315,7 +317,6 @@ export class MgMenuItem {
|
|
|
315
317
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
316
318
|
return setTimeout(() => {
|
|
317
319
|
this.watchDataStyleDirection(this.element.dataset.styleDirection);
|
|
318
|
-
this.watchDataHasFocus(this.element.dataset.hasFocus);
|
|
319
320
|
this.updateItem([Status.ACTIVE]);
|
|
320
321
|
// emit loaded event when component is fully loaded
|
|
321
322
|
this.itemLoaded.emit();
|
|
@@ -339,19 +340,26 @@ export class MgMenuItem {
|
|
|
339
340
|
this.itemUpdated.emit();
|
|
340
341
|
});
|
|
341
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Render information slot or notification badge
|
|
345
|
+
* @returns HTML Element
|
|
346
|
+
*/
|
|
347
|
+
renderInformationSlotOrNotification() {
|
|
348
|
+
return !this.displayNotificationBadge ? (h("slot", { name: "information" })) : (h("span", { class: `${this.classNavigationButton}-text-content-notification` }, h("mg-badge", { label: this.messages.badgeLabel, value: "!", variant: "text-color", slot: "information" })));
|
|
349
|
+
}
|
|
342
350
|
/**
|
|
343
351
|
* Render ineractive element
|
|
344
352
|
* @returns HTML Element
|
|
345
353
|
*/
|
|
346
354
|
renderInteractiveElement() {
|
|
347
355
|
const TagName = this.href !== undefined ? 'a' : 'button';
|
|
348
|
-
return (h(TagName, { href: this.href, class: this.
|
|
349
|
-
h("mg-icon", { key: "icon-new-tab", class: `${this.
|
|
356
|
+
return (h(TagName, { href: this.href, class: this.classNavigationButtonClassList.join(), tabindex: [Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined, disabled: this.status === Status.DISABLED, hidden: this.status === Status.HIDDEN, target: this.href !== undefined && this.target !== undefined ? this.target : undefined, "aria-expanded": this.hasChildren && this.expanded.toString(), "aria-current": this.status === Status.ACTIVE && 'page', onClick: this.handleElementCLick }, h("slot", { name: "image" }), h("div", { class: { [`${this.classNavigationButton}-center`]: true, 'mg-u-visually-hidden': this.isIcon } }, h("div", { class: `${this.classNavigationButton}-text-content` }, h("slot", { name: "label" }), !this.isIcon && this.renderInformationSlotOrNotification(), this.target === '_blank' && [
|
|
357
|
+
h("mg-icon", { key: "icon-new-tab", class: `${this.classNavigationButton}-new-tab`, icon: "arrow-up-right-square" }),
|
|
350
358
|
h("span", { key: "a11y-new-tab", class: "mg-u-visually-hidden" }, this.messages.openNewTab),
|
|
351
|
-
]), this.
|
|
352
|
-
[`${this.
|
|
353
|
-
[`${this.
|
|
354
|
-
} }, h("mg-icon", { icon: "chevron-down" })))));
|
|
359
|
+
]), !this.isIcon && h("slot", { name: "metadata" })), this.isIcon && this.renderInformationSlotOrNotification(), this.hasChildren && this.href === undefined && !this.isIcon && (h("span", { class: {
|
|
360
|
+
[`${this.classNavigationButton}-chevron`]: true,
|
|
361
|
+
[`${this.classNavigationButton}-chevron--rotate`]: this.expanded === true,
|
|
362
|
+
} }, h("mg-icon", { icon: "chevron-down", size: "small" })))));
|
|
355
363
|
}
|
|
356
364
|
/**
|
|
357
365
|
* Render
|
|
@@ -362,7 +370,7 @@ export class MgMenuItem {
|
|
|
362
370
|
['mg-c-menu-item__collapse-container']: true,
|
|
363
371
|
['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu() || this.isItemMore) && this.isDirection(directions.HORIZONTAL),
|
|
364
372
|
});
|
|
365
|
-
return (h(Host, { key: '
|
|
373
|
+
return (h(Host, { key: '374bf5cb625380973d15163b1088e7e743da5dd4', role: this.isItemMore ? 'presentation' : 'listitem' }, this.hasPopover() ? (h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay, identifier: this.popoverIdentifier, "data-fallback-placement": "bottom-end" // use for the last element of the menu if it is placed on the right side
|
|
366
374
|
}, this.renderInteractiveElement(), h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
|
|
367
375
|
this.renderInteractiveElement(),
|
|
368
376
|
h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
|
|
@@ -472,6 +480,26 @@ export class MgMenuItem {
|
|
|
472
480
|
"attribute": "status",
|
|
473
481
|
"defaultValue": "'visible'"
|
|
474
482
|
},
|
|
483
|
+
"isIcon": {
|
|
484
|
+
"type": "boolean",
|
|
485
|
+
"mutable": true,
|
|
486
|
+
"complexType": {
|
|
487
|
+
"original": "boolean",
|
|
488
|
+
"resolved": "boolean",
|
|
489
|
+
"references": {}
|
|
490
|
+
},
|
|
491
|
+
"required": false,
|
|
492
|
+
"optional": true,
|
|
493
|
+
"docs": {
|
|
494
|
+
"tags": [],
|
|
495
|
+
"text": "Define menu-item isIcon style."
|
|
496
|
+
},
|
|
497
|
+
"getter": false,
|
|
498
|
+
"setter": false,
|
|
499
|
+
"reflect": false,
|
|
500
|
+
"attribute": "is-icon",
|
|
501
|
+
"defaultValue": "false"
|
|
502
|
+
},
|
|
475
503
|
"expanded": {
|
|
476
504
|
"type": "boolean",
|
|
477
505
|
"mutable": true,
|
|
@@ -496,8 +524,7 @@ export class MgMenuItem {
|
|
|
496
524
|
}
|
|
497
525
|
static get states() {
|
|
498
526
|
return {
|
|
499
|
-
"
|
|
500
|
-
"navigationButtonClassList": {},
|
|
527
|
+
"classNavigationButtonClassList": {},
|
|
501
528
|
"direction": {},
|
|
502
529
|
"isItemMore": {},
|
|
503
530
|
"hasChildren": {},
|
|
@@ -548,12 +575,12 @@ export class MgMenuItem {
|
|
|
548
575
|
}, {
|
|
549
576
|
"propName": "status",
|
|
550
577
|
"methodName": "watchStatus"
|
|
578
|
+
}, {
|
|
579
|
+
"propName": "isIcon",
|
|
580
|
+
"methodName": "watchIsIcon"
|
|
551
581
|
}, {
|
|
552
582
|
"propName": "expanded",
|
|
553
583
|
"methodName": "watchExpanded"
|
|
554
|
-
}, {
|
|
555
|
-
"propName": "size",
|
|
556
|
-
"methodName": "watchSize"
|
|
557
584
|
}, {
|
|
558
585
|
"propName": "direction",
|
|
559
586
|
"methodName": "validateDirection"
|
|
@@ -141,7 +141,7 @@ export class MgActionMore {
|
|
|
141
141
|
[`${this.classBase}__chevron--rotate`]: this.expanded === true,
|
|
142
142
|
} }, h("mg-icon", { icon: "chevron-down" })));
|
|
143
143
|
}
|
|
144
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: 'bef7d0e0c5a991f321ca930d65fa458873fc7564', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '4e47d1513749cc1ac15ef8febd2fb914e362bbee', class: this.classBase }, h("mg-popover", { key: 'ab6dfc93422f03b49a78d2896196aa6901841aef', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '921f17c4ede5f1783dc336429539b0b082902fdd', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: '19bf9e015cbd82d8dffc62269de735607ab4f2bb' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '56a43a5adebd31264742c0ef8905ccb0bd8fb581', slot: "content" }, h("mg-menu", { key: '70520957ac07a3190ef753ee435996af96dbc5b5', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
145
145
|
var _a, _b;
|
|
146
146
|
return isMgActionMoreDivider(item) ? (h("mg-divider", { class: "mg-c-action-more__divider", key: "divider", "full-width": true })) : (h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, target: item.target, href: item.href,
|
|
147
147
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -195,7 +195,7 @@ export class MgActionMore {
|
|
|
195
195
|
"mutable": true,
|
|
196
196
|
"complexType": {
|
|
197
197
|
"original": "MgActionMoreIconType",
|
|
198
|
-
"resolved": "{ icon: \"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"; }",
|
|
198
|
+
"resolved": "{ icon: \"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"pause\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"; }",
|
|
199
199
|
"references": {
|
|
200
200
|
"MgActionMoreIconType": {
|
|
201
201
|
"location": "import",
|
|
@@ -142,7 +142,7 @@ export class MgAlert {
|
|
|
142
142
|
* @returns HTML Element
|
|
143
143
|
*/
|
|
144
144
|
render() {
|
|
145
|
-
return (h("mg-message", { key: '
|
|
145
|
+
return (h("mg-message", { key: '6085a45d00c4762bae88d98e89f44c20d5f9b6c4', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '55491d1b41609883958680c14a2ddb8dd84a3bd4' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
|
|
146
146
|
}
|
|
147
147
|
static get is() { return "mg-alert"; }
|
|
148
148
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { initLocales } from "../../../locales";
|
|
3
|
+
import { isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
4
|
+
/**
|
|
5
|
+
* Type guard for BreadcrumbItemType[]
|
|
6
|
+
* @param items - value to check
|
|
7
|
+
* @returns true if items is a non-empty array of valid BreadcrumbItemType (label required, href required except for last item)
|
|
8
|
+
*/
|
|
9
|
+
const isBreadcrumbItems = (items) => Array.isArray(items) &&
|
|
10
|
+
items.length > 0 &&
|
|
11
|
+
items.every((item, index) => typeof item === 'object' && item !== null && isValidString(item.label) && (index === items.length - 1 || isValidString(item.href)));
|
|
12
|
+
export class MgBreadcrumb {
|
|
13
|
+
validateItems(newValue) {
|
|
14
|
+
if (newValue === undefined || !isBreadcrumbItems(newValue)) {
|
|
15
|
+
throw new Error(`<mg-breadcrumb> prop "items" is required and all values must be the same type, BreadcrumbItemType. Passed value: ${toString(newValue)}.`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/***********
|
|
19
|
+
* Methods *
|
|
20
|
+
**********/
|
|
21
|
+
/**
|
|
22
|
+
* Render a single breadcrumb item (link or current page)
|
|
23
|
+
* @param item - The breadcrumb item
|
|
24
|
+
* @param isLast - Whether this item is the last in the list
|
|
25
|
+
* @returns The rendered link or span element
|
|
26
|
+
*/
|
|
27
|
+
renderItem(item, isLast) {
|
|
28
|
+
if (isValidString(item.href)) {
|
|
29
|
+
return (h("a", { href: item.href, "aria-label": item.icon !== undefined ? item.label : undefined, "aria-current": isLast ? 'page' : undefined }, item.icon !== undefined ? h("mg-icon", { icon: item.icon }) : item.label));
|
|
30
|
+
}
|
|
31
|
+
return h("span", null, item.label);
|
|
32
|
+
}
|
|
33
|
+
/*************
|
|
34
|
+
* Lifecycle *
|
|
35
|
+
*************/
|
|
36
|
+
componentWillLoad() {
|
|
37
|
+
this.validateItems(this.items);
|
|
38
|
+
this.messages = initLocales(this.element).messages.breadcrumb;
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return (h("nav", { key: '5181512072a7de6e161adcbb9988ae3407f61301', "aria-label": this.messages.label, class: "mg-c-breadcrumb" }, h("ol", { key: '2a4cec366a72027091ebcbccd78d552884005b93', class: "mg-c-breadcrumb__list" }, this.items.map((item, index) => {
|
|
42
|
+
var _a;
|
|
43
|
+
return (h("li", { key: `${index}-${(_a = item.href) !== null && _a !== void 0 ? _a : item.label}`, class: "mg-c-breadcrumb__list-item" }, this.renderItem(item, index === this.items.length - 1)));
|
|
44
|
+
}))));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "mg-breadcrumb"; }
|
|
47
|
+
static get encapsulation() { return "shadow"; }
|
|
48
|
+
static get originalStyleUrls() {
|
|
49
|
+
return {
|
|
50
|
+
"$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-breadcrumb.css"]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get styleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-breadcrumb.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get properties() {
|
|
59
|
+
return {
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "unknown",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "BreadcrumbItemType[]",
|
|
65
|
+
"resolved": "BreadcrumbItemType[]",
|
|
66
|
+
"references": {
|
|
67
|
+
"BreadcrumbItemType": {
|
|
68
|
+
"location": "import",
|
|
69
|
+
"path": "./mg-breadcrumb.conf",
|
|
70
|
+
"id": "src/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.ts::BreadcrumbItemType"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"required": true,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Breadcrumb items (hierarchical order: root \u2192 current page)."
|
|
79
|
+
},
|
|
80
|
+
"getter": false,
|
|
81
|
+
"setter": false
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static get elementRef() { return "element"; }
|
|
86
|
+
static get watchers() {
|
|
87
|
+
return [{
|
|
88
|
+
"propName": "items",
|
|
89
|
+
"methodName": "validateItems"
|
|
90
|
+
}];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -53,7 +53,7 @@ export class MgDetails {
|
|
|
53
53
|
* @returns HTML Element
|
|
54
54
|
*/
|
|
55
55
|
render() {
|
|
56
|
-
return (h("details", { key: '
|
|
56
|
+
return (h("details", { key: '4da17afd7a964a14b5b101bcfadc241be569d55a', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '515d6c4e117b547fe80a310fb90e114900f645e8' }, h("slot", { key: '0c9c0dcc47dd418e34e541d878bfc03ca137c68d', name: "summary" }), h("span", { key: 'c94f52994843b10c1161c0d85f38f8cb917ea806', class: "mg-c-details__toggle" }, h("mg-icon", { key: '9421452572af3deb03146a8dfd189369b249ba2d', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'dbfb0b34da00e37f55ec07236611c2babdd6b7c5', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '1b18b65a98e39a8663fa5d7e51eef5fbe2b92f76', class: "mg-c-details__details" }, h("slot", { key: '81c213594b1b67747db439624090784eaa5e6fcd', name: "details" }))));
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "mg-details"; }
|
|
59
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { ClassList, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
-
import { classReadonly } from "../inputs/mg-input/mg-input.conf";
|
|
3
|
+
import { classReadonly, isMgInputFile } from "../inputs/mg-input/mg-input.conf";
|
|
4
4
|
export class MgFieldset {
|
|
5
5
|
constructor() {
|
|
6
6
|
/**
|
|
@@ -44,7 +44,16 @@ export class MgFieldset {
|
|
|
44
44
|
// Set inputs readonly or disabled based on form configuration
|
|
45
45
|
// Othewise listen to events
|
|
46
46
|
this.mgInputs.forEach(input => {
|
|
47
|
-
|
|
47
|
+
// manage special display case for mg-input-file
|
|
48
|
+
if (input.nodeName === 'MG-INPUT-FILE') {
|
|
49
|
+
if (this.readonly) {
|
|
50
|
+
input.setAttribute('hidden', '');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
input.removeAttribute('hidden');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (this.readonly && !isMgInputFile(input)) {
|
|
48
57
|
input.readonly = true;
|
|
49
58
|
}
|
|
50
59
|
else if (this.disabled) {
|
|
@@ -124,7 +133,7 @@ export class MgFieldset {
|
|
|
124
133
|
* @returns HTML Element
|
|
125
134
|
*/
|
|
126
135
|
render() {
|
|
127
|
-
return (h("mg-input", { key: '
|
|
136
|
+
return (h("mg-input", { key: 'b0b16a170de87de91fa02a38371eb3dd6fe995d7', label: this.legend, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: !this.legendHide, labelHeading: this.legendHeading, labelBorderDisplay: this.legendHeading && this.legendBorderDisplay, labelHide: this.legendHide, inputsOnBottom: this.legendHeading !== undefined, tooltip: this.tooltip, tooltipPosition: 'label', helpText: this.helpText, errorMessage: !this.valid && isValidString(this.errorMessage) ? this.errorMessage : undefined }, h("span", { key: 'c449a5235da7b190d8d311469d15cebcfaf3badc', class: "mg-c-input__input-group" }, h("slot", { key: '6d8c60e2555bfd65c8c146233dc840a2d73597d5' }))));
|
|
128
137
|
}
|
|
129
138
|
static get is() { return "mg-fieldset"; }
|
|
130
139
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { createID, ClassList, toString, isValideID } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { initLocales } from "../../../locales";
|
|
4
|
+
import { isMgInputFile } from "../inputs/mg-input/mg-input.conf";
|
|
4
5
|
import { requiredMessageStatus, roles } from "./mg-form.conf";
|
|
5
6
|
/**
|
|
6
7
|
* @slot - Form content
|
|
@@ -111,7 +112,16 @@ export class MgForm {
|
|
|
111
112
|
if (this.labelOnTop) {
|
|
112
113
|
input.labelOnTop = true;
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
// manage special display case for mg-input-file
|
|
116
|
+
if (input.nodeName === 'MG-INPUT-FILE') {
|
|
117
|
+
if (this.readonly) {
|
|
118
|
+
input.setAttribute('hidden', '');
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
input.removeAttribute('hidden');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (this.readonly && !isMgInputFile(input)) {
|
|
115
125
|
input.readonly = true;
|
|
116
126
|
}
|
|
117
127
|
else if (this.disabled) {
|
|
@@ -232,7 +242,7 @@ export class MgForm {
|
|
|
232
242
|
* @returns HTML Element
|
|
233
243
|
*/
|
|
234
244
|
render() {
|
|
235
|
-
return (h("form", { key: '
|
|
245
|
+
return (h("form", { key: 'b1a6b50f2bbb9b71cecd23d419771cf1b40e13b4', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '9c878f3730a06e1b683240057511b588edf5e887', innerHTML: this.requiredMessageText }), h("slot", { key: '3cf5ca0f07e2f3573615cf6566e230f4d5678b31' }), !this.readonly && !this.disabled && h("slot", { key: '6cbfd58e9600f7a9d9b55ec23bdd64877c03f0d7', name: "actions" })));
|
|
236
246
|
}
|
|
237
247
|
static get is() { return "mg-form"; }
|
|
238
248
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js
CHANGED
|
@@ -81,7 +81,7 @@ export class MgIllustratedMessage {
|
|
|
81
81
|
* @returns HTML Element
|
|
82
82
|
*/
|
|
83
83
|
render() {
|
|
84
|
-
return (h("div", { key: '
|
|
84
|
+
return (h("div", { key: 'ed3b924f5c5a75706aef03ef8798cb699679012d', class: this.classCollection.join() }, h("div", { key: '59b7f7b3fe4ad808377094f93e8b6e86ba2f49ec', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: 'd28aa873cd7025647f56f3a4ed62d9e35dde25d3', name: "illustration" })), h("div", { key: '3b150411a26531827c988a2d34e2990a2302f982', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '8ffea6e50bf5dc4b870d414cb710fc88e0984f61', name: "title" }), h("slot", { key: 'ec85b4a50d28ddf14dbd6b0feff59e2030348b68', name: "details" }))));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "mg-illustrated-message"; }
|
|
87
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -29,7 +29,7 @@ export class MgLoader {
|
|
|
29
29
|
* @returns HTML Element
|
|
30
30
|
*/
|
|
31
31
|
render() {
|
|
32
|
-
return (h("div", { key: '
|
|
32
|
+
return (h("div", { key: 'da82988810c1e2916a2464299844cad674cd1f12', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '45588ae8dd55ca582a4872d4c1e731bb00681c28', icon: "loader", spin: true }), h("span", { key: '3bc07f4bbf8995de61c019942c33c8076793096a', class: { 'mg-u-visually-hidden': this.messageHide } }, this.message || this.messages.loader.inProgress)));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "mg-loader"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|