@mgdis/mg-components 6.22.0 → 6.23.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-C2viYwrR.js → index-BEF-cqV9.js} +325 -1789
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mg-action-more_37.cjs.entry.js → mg-action-more_36.cjs.entry.js} +242 -172
- package/dist/cjs/mg-alert.cjs.entry.js +6 -2
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +4 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +4 -3
- package/dist/cjs/mg-input-file.cjs.entry.js +5 -4
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +7491 -6367
- package/dist/cjs/mg-input.conf-wgTh7iBb.js +84 -0
- package/dist/cjs/mg-loader.cjs.entry.js +2 -2
- package/dist/cjs/mg-progress.cjs.entry.js +2 -2
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +5 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +12 -3
- package/dist/collection/components/atoms/mg-button/mg-button.js +9 -4
- package/dist/collection/components/atoms/mg-card/mg-card.js +16 -7
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +16 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +2 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -3
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +15 -13
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +38 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +49 -26
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +16 -8
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +6 -3
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +7 -4
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +11 -5
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +9 -4
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +61 -19
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +15 -8
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +9 -4
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +5 -3
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +5 -3
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +8 -4
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -7
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +29 -3
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +3 -2
- package/dist/collection/components/molecules/mg-details/mg-details.js +3 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +5 -2
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -4
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +5 -3
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +43 -4
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +4 -3
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +20 -6
- 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 +3 -2
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +3 -2
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -2
- package/dist/collection/components/molecules/mg-table/mg-table.js +4 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +3 -2
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +1 -1
- package/dist/components/index4.js +1 -0
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-breadcrumb.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-fieldset.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +284 -284
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-input2.js +1 -1
- package/dist/components/mg-item-more2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-table.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/custom-elements.json +8828 -0
- package/dist/esm/{index-DFwaH2hS.js → index-DshvCiTL.js} +325 -1789
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-action-more_37.entry.js → mg-action-more_36.entry.js} +244 -173
- package/dist/esm/mg-alert.entry.js +6 -2
- package/dist/esm/mg-breadcrumb.entry.js +2 -2
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +4 -3
- package/dist/esm/mg-input-combobox.entry.js +4 -3
- package/dist/esm/mg-input-file.entry.js +5 -4
- package/dist/esm/mg-input-rich-text-editor.entry.js +7491 -6367
- package/dist/esm/mg-input.conf-DOi9lJXy.js +73 -0
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +2 -2
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-d5e69c95.entry.js → p-13feb37a.entry.js} +1 -1
- package/dist/mg-components/{p-c8c8cfc1.entry.js → p-236bb1d2.entry.js} +1 -1
- package/dist/mg-components/p-79265ad3.entry.js +1 -0
- package/dist/mg-components/{p-adec7fcc.entry.js → p-7c63e469.entry.js} +1 -1
- package/dist/mg-components/p-7fd3e519.entry.js +1 -0
- package/dist/mg-components/p-DOi9lJXy.js +1 -0
- package/dist/mg-components/p-DshvCiTL.js +2 -0
- package/dist/mg-components/p-a0e2c886.entry.js +1 -0
- package/dist/mg-components/p-cdb01923.entry.js +1 -0
- package/dist/mg-components/p-d0b6d8f5.entry.js +1 -0
- package/dist/mg-components/{p-c63f97f0.entry.js → p-d698fa67.entry.js} +283 -283
- package/dist/types/assets/icons/index.d.ts +2 -0
- package/dist/types/components/atoms/internals/mg-input-title/mg-input-title.d.ts +4 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +16 -8
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +15 -5
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +12 -6
- package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +4 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +6 -0
- package/dist/types/components.d.ts +547 -170
- package/dist/types/stencil-public-runtime.d.ts +53 -2
- package/ide/intellij/web-types.json +211 -3476
- package/ide/vscode/css-custom-data.json +1 -1
- package/ide/vscode/html-custom-data.json +58 -314
- package/package.json +30 -25
- package/dist/cjs/mg-input.conf-BNpeATnq.js +0 -35
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +0 -245
- package/dist/components/mg-input-checkbox-paginated.d.ts +0 -11
- package/dist/components/mg-input-checkbox-paginated.js +0 -1
- package/dist/components/mg-input-checkbox-paginated2.js +0 -1
- package/dist/esm/mg-input.conf-C9rmNQIL.js +0 -25
- package/dist/mg-components/p-0482eb9f.entry.js +0 -1
- package/dist/mg-components/p-2ee92f38.entry.js +0 -1
- package/dist/mg-components/p-3b653226.entry.js +0 -1
- package/dist/mg-components/p-5745fbea.entry.js +0 -1
- package/dist/mg-components/p-C9rmNQIL.js +0 -1
- package/dist/mg-components/p-DFwaH2hS.js +0 -2
- package/dist/mg-components/p-cc793586.entry.js +0 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +0 -77
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"components/atoms/mg-tooltip/mg-tooltip.js",
|
|
14
14
|
"components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js",
|
|
15
15
|
"components/molecules/inputs/mg-input/mg-input.js",
|
|
16
|
-
"components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js",
|
|
17
16
|
"components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js",
|
|
18
17
|
"components/molecules/inputs/mg-input-combobox/mg-input-combobox.js",
|
|
19
18
|
"components/molecules/inputs/mg-input-date/mg-input-date.js",
|
|
@@ -46,9 +45,10 @@
|
|
|
46
45
|
"components/molecules/mg-table/mg-table.js",
|
|
47
46
|
"components/molecules/mg-tabs/mg-tabs.js"
|
|
48
47
|
],
|
|
48
|
+
"mixins": [],
|
|
49
49
|
"compiler": {
|
|
50
50
|
"name": "@stencil/core",
|
|
51
|
-
"version": "4.
|
|
51
|
+
"version": "4.43.5",
|
|
52
52
|
"typescriptVersion": "5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"collections": [],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { isValidString, isValideID, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
+
import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
@@ -32,6 +33,7 @@ export class MgInputTitle {
|
|
|
32
33
|
* Init tag name
|
|
33
34
|
*/
|
|
34
35
|
componentWillLoad() {
|
|
36
|
+
normalizeBooleanAttributes(this);
|
|
35
37
|
this.validateIdentifier(this.identifier);
|
|
36
38
|
this.validateIsLegend(this.isLegend);
|
|
37
39
|
}
|
|
@@ -42,7 +44,7 @@ export class MgInputTitle {
|
|
|
42
44
|
render() {
|
|
43
45
|
const TagName = this.readonly ? 'span' : this.tagName;
|
|
44
46
|
// \u00A0 represent a
|
|
45
|
-
return (h(TagName, { key: '
|
|
47
|
+
return (h(TagName, { key: '316341d052fa751e442f749ce66e2712ecd864c2', class: "mg-c-input-title", htmlFor: !this.isLegend && this.identifier, id: this.isLegend ? `${this.identifier}-title` : undefined }, h("slot", { key: '4df4df8d18f46b09081ebc13619034f923132697' }), this.required && !this.readonly && (h("span", { key: '778a3317990278dd95a450dd9aa91c3afafb1b43', class: "mg-c-input-title__required" }, "\u00A0", h("span", { key: '509a4ecc94111d61f3df3ae28286bf23bf8c7d0f', class: "mg-u-is-asterisk" }, "*")))));
|
|
46
48
|
}
|
|
47
49
|
static get is() { return "mg-input-title"; }
|
|
48
50
|
static get encapsulation() { return "scoped"; }
|
|
@@ -142,6 +144,7 @@ export class MgInputTitle {
|
|
|
142
144
|
"tagName": {}
|
|
143
145
|
};
|
|
144
146
|
}
|
|
147
|
+
static get elementRef() { return "element"; }
|
|
145
148
|
static get watchers() {
|
|
146
149
|
return [{
|
|
147
150
|
"propName": "identifier",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { variants } from "./mg-badge.conf";
|
|
3
3
|
import { ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
4
|
+
import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
|
|
4
5
|
export class MgBadge {
|
|
5
6
|
constructor() {
|
|
6
7
|
/************
|
|
@@ -33,6 +34,11 @@ export class MgBadge {
|
|
|
33
34
|
}
|
|
34
35
|
validateVariant(newValue, oldValue) {
|
|
35
36
|
if (!variants.includes(newValue)) {
|
|
37
|
+
if (String(newValue) === '') {
|
|
38
|
+
// Reactive frameworks (e.g. Vue) may pass "" instead of undefined when the prop is reset.
|
|
39
|
+
this.variant = 'info';
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
36
42
|
throw new Error(`<mg-badge> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
37
43
|
}
|
|
38
44
|
else {
|
|
@@ -52,6 +58,7 @@ export class MgBadge {
|
|
|
52
58
|
* Check if props are well configured on init
|
|
53
59
|
*/
|
|
54
60
|
componentWillLoad() {
|
|
61
|
+
normalizeBooleanAttributes(this);
|
|
55
62
|
this.validateValue(this.value);
|
|
56
63
|
this.validateLabel(this.label);
|
|
57
64
|
this.validateVariant(this.variant);
|
|
@@ -62,7 +69,7 @@ export class MgBadge {
|
|
|
62
69
|
* @returns HTML Element
|
|
63
70
|
*/
|
|
64
71
|
render() {
|
|
65
|
-
return (h("span", { key: '
|
|
72
|
+
return (h("span", { key: 'b4c55957d7e59c889147cf3ddeb57f94c7afdaaa', class: this.classCollection.join() }, h("span", { key: '3f9bfae0e36de3c14d71d3a904f426508b1d5872', class: "mg-c-badge__value" }, this.value), h("span", { key: '2e6ee3c010b6f0c8c1df7bfdd3aed755e5afc0d8', class: "mg-u-visually-hidden" }, this.label)));
|
|
66
73
|
}
|
|
67
74
|
static get is() { return "mg-badge"; }
|
|
68
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -118,7 +125,7 @@ export class MgBadge {
|
|
|
118
125
|
},
|
|
119
126
|
"variant": {
|
|
120
127
|
"type": "string",
|
|
121
|
-
"mutable":
|
|
128
|
+
"mutable": true,
|
|
122
129
|
"complexType": {
|
|
123
130
|
"original": "BadgeVariantType",
|
|
124
131
|
"resolved": "\"danger\" | \"info\" | \"primary\" | \"secondary\" | \"success\" | \"text-color\" | \"warning\"",
|
|
@@ -126,7 +133,8 @@ export class MgBadge {
|
|
|
126
133
|
"BadgeVariantType": {
|
|
127
134
|
"location": "import",
|
|
128
135
|
"path": "./mg-badge.conf",
|
|
129
|
-
"id": "src/components/atoms/mg-badge/mg-badge.conf.ts::BadgeVariantType"
|
|
136
|
+
"id": "src/components/atoms/mg-badge/mg-badge.conf.ts::BadgeVariantType",
|
|
137
|
+
"referenceLocation": "BadgeVariantType"
|
|
130
138
|
}
|
|
131
139
|
}
|
|
132
140
|
},
|
|
@@ -169,6 +177,7 @@ export class MgBadge {
|
|
|
169
177
|
"classCollection": {}
|
|
170
178
|
};
|
|
171
179
|
}
|
|
180
|
+
static get elementRef() { return "element"; }
|
|
172
181
|
static get watchers() {
|
|
173
182
|
return [{
|
|
174
183
|
"propName": "value",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { variants, sizes } from "./mg-button.conf";
|
|
3
3
|
import { ClassList, isValidString, nextTick, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
4
|
+
import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
|
|
4
5
|
import { Keys } from "../../../utils/events.utils";
|
|
5
6
|
/**
|
|
6
7
|
* @slot - Button content
|
|
@@ -176,6 +177,7 @@ export class MgButton {
|
|
|
176
177
|
* Check if props are well configured on init
|
|
177
178
|
*/
|
|
178
179
|
componentWillLoad() {
|
|
180
|
+
normalizeBooleanAttributes(this);
|
|
179
181
|
this.validateVariant(this.variant);
|
|
180
182
|
this.validateFullWidth(this.fullWidth);
|
|
181
183
|
this.validateSize(this.size);
|
|
@@ -205,7 +207,7 @@ export class MgButton {
|
|
|
205
207
|
*/
|
|
206
208
|
render() {
|
|
207
209
|
var _a;
|
|
208
|
-
return (h(Host, { key: '
|
|
210
|
+
return (h(Host, { key: 'e79494f9da9f0c4c19841d44a85ee955f2e19016', role: "button", tabIndex: this.element.getAttribute('tabindex') || 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": (_a = this.disabled) === null || _a === void 0 ? void 0 : _a.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { key: '1a4802637eca8125d09cae3363ff11fe9b50ffd4', class: this.classCollection.join() }, this.loading && h("mg-icon", { key: '9f4512a0ed650c3af63e8216baa5b0eaabd4bfd2', icon: "loader", spin: true }), h("div", { key: '9c0647c6741a0610a516bc2ac1cce328d3004d51', class: "mg-c-button__content" }, h("slot", { key: '7875b875d0a8a8ac74faf233b0cd49462a775dc6' })))));
|
|
209
211
|
}
|
|
210
212
|
static get is() { return "mg-button"; }
|
|
211
213
|
static get encapsulation() { return "shadow"; }
|
|
@@ -231,7 +233,8 @@ export class MgButton {
|
|
|
231
233
|
"VariantType": {
|
|
232
234
|
"location": "import",
|
|
233
235
|
"path": "./mg-button.conf",
|
|
234
|
-
"id": "src/components/atoms/mg-button/mg-button.conf.ts::VariantType"
|
|
236
|
+
"id": "src/components/atoms/mg-button/mg-button.conf.ts::VariantType",
|
|
237
|
+
"referenceLocation": "VariantType"
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
240
|
},
|
|
@@ -276,7 +279,8 @@ export class MgButton {
|
|
|
276
279
|
"ButtonType": {
|
|
277
280
|
"location": "import",
|
|
278
281
|
"path": "./mg-button.conf",
|
|
279
|
-
"id": "src/components/atoms/mg-button/mg-button.conf.ts::ButtonType"
|
|
282
|
+
"id": "src/components/atoms/mg-button/mg-button.conf.ts::ButtonType",
|
|
283
|
+
"referenceLocation": "ButtonType"
|
|
280
284
|
}
|
|
281
285
|
}
|
|
282
286
|
},
|
|
@@ -301,7 +305,8 @@ export class MgButton {
|
|
|
301
305
|
"SizeType": {
|
|
302
306
|
"location": "import",
|
|
303
307
|
"path": "./mg-button.conf",
|
|
304
|
-
"id": "src/components/atoms/mg-button/mg-button.conf.ts::SizeType"
|
|
308
|
+
"id": "src/components/atoms/mg-button/mg-button.conf.ts::SizeType",
|
|
309
|
+
"referenceLocation": "SizeType"
|
|
305
310
|
}
|
|
306
311
|
}
|
|
307
312
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import { ClassList } from "@mgdis/core-ui-helpers/dist/utils";
|
|
2
|
+
import { ClassList, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { radiusSizes } from "./mg-card.conf";
|
|
4
4
|
/**
|
|
5
5
|
* @slot - Card content
|
|
@@ -28,10 +28,18 @@ export class MgCard {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
watchRadiusSize(newValue, oldValue) {
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if (!radiusSizes.includes(newValue)) {
|
|
32
|
+
if (String(newValue) === '') {
|
|
33
|
+
// Reactive frameworks (e.g. Vue) may pass "" instead of undefined when the prop is reset.
|
|
34
|
+
this.radiusSize = 'medium';
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
throw new Error(`<mg-card> prop "radiusSize" must be one of: ${radiusSizes.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
33
38
|
}
|
|
34
|
-
|
|
39
|
+
else {
|
|
40
|
+
if (oldValue !== undefined) {
|
|
41
|
+
this.classCollection.delete(`mg-c-card--radius-${oldValue}`);
|
|
42
|
+
}
|
|
35
43
|
this.classCollection.add(`mg-c-card--radius-${newValue}`);
|
|
36
44
|
}
|
|
37
45
|
}
|
|
@@ -50,7 +58,7 @@ export class MgCard {
|
|
|
50
58
|
* @returns HTML Element
|
|
51
59
|
*/
|
|
52
60
|
render() {
|
|
53
|
-
return (h("div", { key: '
|
|
61
|
+
return (h("div", { key: 'd652bf6913d37428bb9729d32fb3541543418a71', class: this.classCollection.join() }, h("slot", { key: '5157ee6cf1330c907babad1f2190973dd4d9f39e' })));
|
|
54
62
|
}
|
|
55
63
|
static get is() { return "mg-card"; }
|
|
56
64
|
static get encapsulation() { return "shadow"; }
|
|
@@ -88,7 +96,7 @@ export class MgCard {
|
|
|
88
96
|
},
|
|
89
97
|
"radiusSize": {
|
|
90
98
|
"type": "string",
|
|
91
|
-
"mutable":
|
|
99
|
+
"mutable": true,
|
|
92
100
|
"complexType": {
|
|
93
101
|
"original": "RadiusSizeType",
|
|
94
102
|
"resolved": "\"medium\" | \"small\" | \"xsmall\"",
|
|
@@ -96,7 +104,8 @@ export class MgCard {
|
|
|
96
104
|
"RadiusSizeType": {
|
|
97
105
|
"location": "import",
|
|
98
106
|
"path": "./mg-card.conf",
|
|
99
|
-
"id": "src/components/atoms/mg-card/mg-card.conf.ts::RadiusSizeType"
|
|
107
|
+
"id": "src/components/atoms/mg-card/mg-card.conf.ts::RadiusSizeType",
|
|
108
|
+
"referenceLocation": "RadiusSizeType"
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
},
|
|
@@ -48,9 +48,12 @@ export class MgIcon {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
validateSize(newValue, oldValue) {
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
// Reactive frameworks reset the prop differently:
|
|
52
|
+
// - removing the attribute sets it to null
|
|
53
|
+
// - Vue reactivity may set it to ""
|
|
54
|
+
if (newValue === null || String(newValue) === '') {
|
|
55
|
+
this.size = 'medium';
|
|
56
|
+
return;
|
|
54
57
|
}
|
|
55
58
|
if (!sizes.includes(newValue)) {
|
|
56
59
|
throw new Error(`<mg-icon> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
@@ -144,12 +147,13 @@ export class MgIcon {
|
|
|
144
147
|
"mutable": false,
|
|
145
148
|
"complexType": {
|
|
146
149
|
"original": "IconType",
|
|
147
|
-
"resolved": "\"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"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\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"",
|
|
150
|
+
"resolved": "\"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"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\" | \"glitters\" | \"glitters-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"",
|
|
148
151
|
"references": {
|
|
149
152
|
"IconType": {
|
|
150
153
|
"location": "import",
|
|
151
154
|
"path": "./mg-icon.conf",
|
|
152
|
-
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconType"
|
|
155
|
+
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconType",
|
|
156
|
+
"referenceLocation": "IconType"
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
},
|
|
@@ -166,7 +170,7 @@ export class MgIcon {
|
|
|
166
170
|
},
|
|
167
171
|
"size": {
|
|
168
172
|
"type": "string",
|
|
169
|
-
"mutable":
|
|
173
|
+
"mutable": true,
|
|
170
174
|
"complexType": {
|
|
171
175
|
"original": "IconSizeType",
|
|
172
176
|
"resolved": "\"large\" | \"medium\" | \"small\" | \"xlarge\" | \"xxlarge\"",
|
|
@@ -174,7 +178,8 @@ export class MgIcon {
|
|
|
174
178
|
"IconSizeType": {
|
|
175
179
|
"location": "import",
|
|
176
180
|
"path": "./mg-icon.conf",
|
|
177
|
-
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconSizeType"
|
|
181
|
+
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconSizeType",
|
|
182
|
+
"referenceLocation": "IconSizeType"
|
|
178
183
|
}
|
|
179
184
|
}
|
|
180
185
|
},
|
|
@@ -200,7 +205,8 @@ export class MgIcon {
|
|
|
200
205
|
"IconVariantType": {
|
|
201
206
|
"location": "import",
|
|
202
207
|
"path": "./mg-icon.conf",
|
|
203
|
-
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantType"
|
|
208
|
+
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantType",
|
|
209
|
+
"referenceLocation": "IconVariantType"
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
},
|
|
@@ -225,7 +231,8 @@ export class MgIcon {
|
|
|
225
231
|
"IconVariantStyleType": {
|
|
226
232
|
"location": "import",
|
|
227
233
|
"path": "./mg-icon.conf",
|
|
228
|
-
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantStyleType"
|
|
234
|
+
"id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantStyleType",
|
|
235
|
+
"referenceLocation": "IconVariantStyleType"
|
|
229
236
|
}
|
|
230
237
|
}
|
|
231
238
|
},
|
|
@@ -110,7 +110,8 @@ export class MgTag {
|
|
|
110
110
|
"TagVariantType": {
|
|
111
111
|
"location": "import",
|
|
112
112
|
"path": "./mg-tag.conf",
|
|
113
|
-
"id": "src/components/atoms/mg-tag/mg-tag.conf.ts::TagVariantType"
|
|
113
|
+
"id": "src/components/atoms/mg-tag/mg-tag.conf.ts::TagVariantType",
|
|
114
|
+
"referenceLocation": "TagVariantType"
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
},
|
|
@@ -57,7 +57,7 @@ export class MgTooltip {
|
|
|
57
57
|
// Remove event listener
|
|
58
58
|
this.windows.forEach((localWindow) => {
|
|
59
59
|
localWindow.removeEventListener('click', this.handleClickOutside, false);
|
|
60
|
-
localWindow.removeEventListener('
|
|
60
|
+
localWindow.removeEventListener('keydown', this.handlePressEscape, false);
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
@@ -326,6 +326,11 @@ export class MgTooltip {
|
|
|
326
326
|
this.setMgButtonMutationObserver(slotElement);
|
|
327
327
|
this.setMgButtonWrapper(slotElement);
|
|
328
328
|
}
|
|
329
|
+
// Propagate the full-width intent from a slotted mg-button to the tooltip host so it
|
|
330
|
+
// takes the parent's width — the host is `display: inline-block` otherwise.
|
|
331
|
+
if (this.element.querySelector('mg-button[full-width]') !== null) {
|
|
332
|
+
this.element.classList.add('mg-c-tooltip--full-width');
|
|
333
|
+
}
|
|
329
334
|
// Add tabindex to slotted element if we can't find any interactive element
|
|
330
335
|
if (!this.disabled && [undefined, null].includes(interactiveElement)) {
|
|
331
336
|
this.hasCustomTabIndex = true;
|
|
@@ -364,7 +369,7 @@ export class MgTooltip {
|
|
|
364
369
|
* @returns HTML Element
|
|
365
370
|
*/
|
|
366
371
|
render() {
|
|
367
|
-
return (h(Host, { key: '
|
|
372
|
+
return (h(Host, { key: 'f8fe2bfb1fe70bf169abf8ddd77323342af2ac54' }, h("slot", { key: '6d478d941b9cf9374395e597a703ba7c8411eb75' }), h("slot", { key: 'bbbb59eda24731ec2fa54a909b0f3f93000083e5', name: "content" })));
|
|
368
373
|
}
|
|
369
374
|
static get is() { return "mg-tooltip"; }
|
|
370
375
|
static get encapsulation() { return "shadow"; }
|
|
@@ -429,7 +434,8 @@ export class MgTooltip {
|
|
|
429
434
|
"Placement": {
|
|
430
435
|
"location": "import",
|
|
431
436
|
"path": "@popperjs/core",
|
|
432
|
-
"id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::Placement"
|
|
437
|
+
"id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::Placement",
|
|
438
|
+
"referenceLocation": "Placement"
|
|
433
439
|
}
|
|
434
440
|
}
|
|
435
441
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { isValidString, isValideID, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
|
+
import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
|
|
3
4
|
import { tooltipPositions, classFieldset, classReadonly, classDisabled, classVerticalList, labelHeadings } from "./mg-input.conf";
|
|
4
5
|
/**
|
|
5
6
|
* @slot - Input content
|
|
@@ -253,15 +254,13 @@ export class MgInput {
|
|
|
253
254
|
labelSlotElement === null || labelSlotElement === void 0 ? void 0 : labelSlotElement.remove();
|
|
254
255
|
// create title element
|
|
255
256
|
labelSlotElement = document.createElement('mg-input-title');
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
labelSlotElement.setAttribute(attr, val);
|
|
264
|
-
});
|
|
257
|
+
labelSlotElement.setAttribute('slot', this.slotLabel);
|
|
258
|
+
labelSlotElement.setAttribute('identifier', this.identifier);
|
|
259
|
+
// Set boolean props via property assignment to honour HTML attribute-presence semantics: an
|
|
260
|
+
// attribute set to "false" would now be normalized to `true` by mg-input-title's helper.
|
|
261
|
+
labelSlotElement.readonly = this.isReadonly;
|
|
262
|
+
labelSlotElement.required = (this.required && !this.isDisabled) || false;
|
|
263
|
+
labelSlotElement.isLegend = this.isFieldset;
|
|
265
264
|
// create label element
|
|
266
265
|
if (labelHeadings.includes(this.labelHeading)) {
|
|
267
266
|
let label = this.element.shadowRoot.querySelector(this.labelHeading);
|
|
@@ -312,6 +311,7 @@ export class MgInput {
|
|
|
312
311
|
* Check if component props are well configured on init
|
|
313
312
|
*/
|
|
314
313
|
componentWillLoad() {
|
|
314
|
+
normalizeBooleanAttributes(this);
|
|
315
315
|
this.watchIdentifier(this.identifier);
|
|
316
316
|
this.watchLabel();
|
|
317
317
|
this.watchClass();
|
|
@@ -339,7 +339,7 @@ export class MgInput {
|
|
|
339
339
|
*/
|
|
340
340
|
render() {
|
|
341
341
|
const isGroup = this.isFieldset && !this.isReadonly;
|
|
342
|
-
return (h(Host, { key: '
|
|
342
|
+
return (h(Host, { key: 'b5952c998fe8562eb2e5dc0e425484f0aa9177f3', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: 'd6399c7f4798af37639218373f775739fc04e593', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: '58a593bb16193a5ca6b0374919b22fa64aab26a4', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: '1a70d0b00d6cf235c7a64d3ebde212eef62e213c', class: "mg-c-input__input-container" }, this.inputContainerElements())));
|
|
343
343
|
}
|
|
344
344
|
static get is() { return "mg-input"; }
|
|
345
345
|
static get encapsulation() { return "shadow"; }
|
|
@@ -443,7 +443,8 @@ export class MgInput {
|
|
|
443
443
|
"labelHeading": {
|
|
444
444
|
"location": "import",
|
|
445
445
|
"path": "./mg-input.conf",
|
|
446
|
-
"id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::labelHeading"
|
|
446
|
+
"id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::labelHeading",
|
|
447
|
+
"referenceLocation": "labelHeading"
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
450
|
},
|
|
@@ -507,7 +508,8 @@ export class MgInput {
|
|
|
507
508
|
"TooltipPosition": {
|
|
508
509
|
"location": "import",
|
|
509
510
|
"path": "./mg-input.conf",
|
|
510
|
-
"id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition"
|
|
511
|
+
"id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition",
|
|
512
|
+
"referenceLocation": "TooltipPosition"
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
515
|
},
|
package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { MgInputCheckboxList } from "./MgInputCheckboxList";
|
|
3
|
+
import { formatID } from "@mgdis/core-ui-helpers/dist/utils";
|
|
4
|
+
/**
|
|
5
|
+
* Get items from checkboxes and limit
|
|
6
|
+
* @param checkboxes - checkboxes to slice
|
|
7
|
+
* @param limit - number of items to return
|
|
8
|
+
* @returns list of items to display in section
|
|
9
|
+
*/
|
|
10
|
+
const getItems = (checkboxes, limit) => [...checkboxes].slice(0, limit);
|
|
11
|
+
/**
|
|
12
|
+
* Component has next checkboxes to display
|
|
13
|
+
* @param checkboxes - checkboxes to check
|
|
14
|
+
* @param limit - number of items to display
|
|
15
|
+
* @returns truthy if have next elements
|
|
16
|
+
*/
|
|
17
|
+
const hasNext = (checkboxes, limit) => checkboxes.length > limit;
|
|
18
|
+
/**
|
|
19
|
+
* Internal component use to manage sections instances
|
|
20
|
+
* @param props - MgInputCheckboxList Interface Props
|
|
21
|
+
* @returns input template
|
|
22
|
+
*/
|
|
23
|
+
export const MgInputCheckboxPaginated = (props) => {
|
|
24
|
+
const items = getItems(props.checkboxes, props.limit);
|
|
25
|
+
const listId = formatID(props.messages.label);
|
|
26
|
+
const tabId = `tab-info-${props.key}`;
|
|
27
|
+
/**
|
|
28
|
+
* Handle load-more <mg-button> click event
|
|
29
|
+
*/
|
|
30
|
+
const handleLoadMoreClick = () => {
|
|
31
|
+
if (hasNext(props.checkboxes, props.limit)) {
|
|
32
|
+
props.handleLoadMore();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return (h("div", { class: "mg-input-checkbox-paginated mg-c-input__tab", slot: `tab_content-${props.key + 1}` },
|
|
36
|
+
// Mass action depends on all checkboxes list, not only displayed items
|
|
37
|
+
typeof props.handleMassAction === 'function' && props.checkboxes.length > 0 && props.checkboxes.some(checkbox => checkbox.disabled !== true) && (h("mg-tooltip", { slot: "header-action", class: "mg-c-input__tabs-action", message: props.messages.tooltip }, h("mg-button", { variant: "link", onClick: props.handleMassAction }, props.messages.action))), h("div", { class: "mg-c-input__tabs-content" }, h("p", { id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': items.length !== 0 }, "aria-live": items.length !== 0 ? 'polite' : undefined }, items.length === 0 ? props.messages.noValue : props.messages.values.replace('{count}', items.length.toString())), items.length > 0 && (h(MgInputCheckboxList, { checkboxes: items, labelledby: tabId, id: listId, disabled: props.disabled, name: props.name, invalid: props.invalid })), hasNext(props.checkboxes, props.limit) && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: handleLoadMoreClick, "aria-controls": listId }, h("mg-icon", { icon: "chevron-down" }), props.messages.showMore)))));
|
|
38
|
+
};
|