@mgdis/mg-components 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-dd2c7f7b.js → index-64cee0c8.js} +248 -128
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_24.cjs.entry.js → mg-badge_23.cjs.entry.js} +206 -2180
- package/dist/cjs/mg-components.cjs.js +3 -26
- package/dist/cjs/mg-modal.cjs.entry.js +8 -1
- package/dist/cjs/mg-popover.cjs.entry.js +171 -0
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +116 -99
- package/dist/collection/components/atoms/mg-button/mg-button.js +221 -220
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +72 -69
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +102 -92
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +83 -67
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +64 -55
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +3 -6
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +120 -106
- package/dist/collection/components/molecules/inputs/MgInput.js +8 -17
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +323 -318
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +356 -361
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +462 -456
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +347 -340
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +348 -343
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +406 -401
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +12 -15
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +2 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +476 -473
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +461 -456
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +2 -8
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +299 -298
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -3
- package/dist/collection/components/molecules/mg-details/mg-details.js +95 -93
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +13 -27
- package/dist/collection/components/molecules/mg-form/mg-form.js +175 -166
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -6
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +37 -37
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +1 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +154 -153
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +11 -15
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +147 -134
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +192 -189
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +150 -135
- package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/collection/locales/en/messages.json +50 -0
- package/dist/collection/locales/fr/messages.json +50 -0
- package/dist/collection/stories/grids.stories.js +1 -44
- package/dist/collection/stories/helpers.stories.js +1 -19
- package/dist/collection/stories/icons.stories.js +1 -4
- package/dist/collection/stories/typography.stories.js +1 -12
- package/dist/collection/variables.css +3 -2
- package/dist/collection/variables.scss +3 -2
- package/dist/components/MgInput.js +6 -3
- package/dist/components/mg-badge2.js +7 -0
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-input-checkbox.js +1 -6
- package/dist/components/mg-input-date.js +10 -27
- package/dist/components/mg-input-numeric.js +1 -6
- package/dist/components/mg-input-password.js +1 -6
- package/dist/components/mg-input-radio.js +1 -6
- package/dist/components/mg-input-select2.js +1 -6
- package/dist/components/mg-input-text2.js +3 -8
- package/dist/components/mg-input-textarea.js +2 -7
- package/dist/components/mg-input-title2.js +9 -0
- package/dist/components/mg-input-toggle.js +2 -7
- package/dist/components/mg-modal.js +7 -0
- package/dist/components/mg-pagination.js +3 -3
- package/dist/components/mg-panel.js +8 -4
- package/dist/components/mg-tabs.js +8 -1
- package/dist/components/mg-tooltip2.js +7 -0
- package/dist/esm/{index-f58b769f.js → index-120f47fd.js} +249 -128
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +207 -2180
- package/dist/esm/mg-components.js +3 -26
- package/dist/esm/mg-modal.entry.js +8 -1
- package/dist/esm/mg-popover.entry.js +167 -0
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/mg-components/locales/en/messages.json +50 -0
- package/dist/mg-components/locales/fr/messages.json +50 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-21991be8.entry.js +1 -0
- package/dist/mg-components/p-36a64f8c.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/p-7bc32a2f.js +2 -0
- package/dist/mg-components/p-b380a0df.entry.js +1 -0
- package/dist/mg-components/variables.css +3 -2
- package/dist/mg-components/variables.scss +3 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +29 -29
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/p-2a3d8f60.entry.js +0 -1
- package/dist/mg-components/p-b6df1cac.js +0 -2
- package/dist/mg-components/p-c8779533.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { icons, sizes, variants } from './mg-icon.conf';
|
|
3
3
|
import { ClassList } from '../../../utils/components.utils';
|
|
4
4
|
export class MgIcon {
|
|
@@ -84,98 +84,108 @@ export class MgIcon {
|
|
|
84
84
|
}
|
|
85
85
|
static get is() { return "mg-icon"; }
|
|
86
86
|
static get encapsulation() { return "shadow"; }
|
|
87
|
-
static get originalStyleUrls() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"original": "string",
|
|
116
|
-
"resolved": "string",
|
|
117
|
-
"references": {}
|
|
118
|
-
},
|
|
119
|
-
"required": false,
|
|
120
|
-
"optional": false,
|
|
121
|
-
"docs": {
|
|
122
|
-
"tags": [],
|
|
123
|
-
"text": "Define icon size"
|
|
124
|
-
},
|
|
125
|
-
"attribute": "size",
|
|
126
|
-
"reflect": false,
|
|
127
|
-
"defaultValue": "'regular'"
|
|
128
|
-
},
|
|
129
|
-
"variant": {
|
|
130
|
-
"type": "string",
|
|
131
|
-
"mutable": false,
|
|
132
|
-
"complexType": {
|
|
133
|
-
"original": "string",
|
|
134
|
-
"resolved": "string",
|
|
135
|
-
"references": {}
|
|
136
|
-
},
|
|
137
|
-
"required": false,
|
|
138
|
-
"optional": false,
|
|
139
|
-
"docs": {
|
|
140
|
-
"tags": [],
|
|
141
|
-
"text": "Define icon variant\nAdd a background to the icon based on variant color"
|
|
87
|
+
static get originalStyleUrls() {
|
|
88
|
+
return {
|
|
89
|
+
"$": ["mg-icon.scss"]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static get styleUrls() {
|
|
93
|
+
return {
|
|
94
|
+
"$": ["mg-icon.css"]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static get properties() {
|
|
98
|
+
return {
|
|
99
|
+
"icon": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Icon to display"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "icon",
|
|
114
|
+
"reflect": false
|
|
142
115
|
},
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"
|
|
152
|
-
"
|
|
116
|
+
"size": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "string",
|
|
121
|
+
"resolved": "string",
|
|
122
|
+
"references": {}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": false,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "Define icon size"
|
|
129
|
+
},
|
|
130
|
+
"attribute": "size",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "'regular'"
|
|
153
133
|
},
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
|
|
134
|
+
"variant": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "string",
|
|
139
|
+
"resolved": "string",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": false,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": "Define icon variant\nAdd a background to the icon based on variant color"
|
|
147
|
+
},
|
|
148
|
+
"attribute": "variant",
|
|
149
|
+
"reflect": false
|
|
159
150
|
},
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
151
|
+
"spin": {
|
|
152
|
+
"type": "boolean",
|
|
153
|
+
"mutable": false,
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "boolean",
|
|
156
|
+
"resolved": "boolean",
|
|
157
|
+
"references": {}
|
|
158
|
+
},
|
|
159
|
+
"required": false,
|
|
160
|
+
"optional": false,
|
|
161
|
+
"docs": {
|
|
162
|
+
"tags": [],
|
|
163
|
+
"text": "Make the icon spin"
|
|
164
|
+
},
|
|
165
|
+
"attribute": "spin",
|
|
166
|
+
"reflect": false,
|
|
167
|
+
"defaultValue": "false"
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
static get states() {
|
|
172
|
+
return {
|
|
173
|
+
"classList": {}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
static get watchers() {
|
|
177
|
+
return [{
|
|
178
|
+
"propName": "icon",
|
|
179
|
+
"methodName": "validateIcon"
|
|
180
|
+
}, {
|
|
181
|
+
"propName": "size",
|
|
182
|
+
"methodName": "validateSize"
|
|
183
|
+
}, {
|
|
184
|
+
"propName": "variant",
|
|
185
|
+
"methodName": "validateVariant"
|
|
186
|
+
}, {
|
|
187
|
+
"propName": "spin",
|
|
188
|
+
"methodName": "handleSpin"
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
181
191
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export class MgInputTitle {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
@@ -13,6 +13,11 @@ export class MgInputTitle {
|
|
|
13
13
|
this.tagName = this.isLegend ? 'legend' : 'label';
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
validateIdentifier(newValue) {
|
|
17
|
+
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
18
|
+
throw new Error('<mg-input-title> prop "identifier" is required.');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
16
21
|
/*************
|
|
17
22
|
* Lifecycle *
|
|
18
23
|
*************/
|
|
@@ -22,6 +27,7 @@ export class MgInputTitle {
|
|
|
22
27
|
* @returns {void}
|
|
23
28
|
*/
|
|
24
29
|
componentWillLoad() {
|
|
30
|
+
this.validateIdentifier(this.identifier);
|
|
25
31
|
this.getTagName();
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
@@ -32,75 +38,85 @@ export class MgInputTitle {
|
|
|
32
38
|
render() {
|
|
33
39
|
const TagName = this.tagName;
|
|
34
40
|
// \u00A0 represent a
|
|
35
|
-
return (h(TagName, { class: "mg-input-title", htmlFor: this.isLegend ? undefined : this.identifier },
|
|
36
|
-
h("slot", null),
|
|
37
|
-
this.required && (h("span", { class: "mg-input-title__required" },
|
|
38
|
-
"\u00A0",
|
|
39
|
-
h("span", { class: "is-asterisk" }, "*")))));
|
|
41
|
+
return (h(TagName, { class: "mg-input-title", htmlFor: this.isLegend ? undefined : this.identifier }, h("slot", null), this.required && (h("span", { class: "mg-input-title__required" }, "\u00A0", h("span", { class: "is-asterisk" }, "*")))));
|
|
40
42
|
}
|
|
41
43
|
static get is() { return "mg-input-title"; }
|
|
42
44
|
static get encapsulation() { return "scoped"; }
|
|
43
|
-
static get originalStyleUrls() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"original": "boolean",
|
|
72
|
-
"resolved": "boolean",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": "If input is required an asterisk is added at the end of the label"
|
|
80
|
-
},
|
|
81
|
-
"attribute": "required",
|
|
82
|
-
"reflect": false
|
|
83
|
-
},
|
|
84
|
-
"isLegend": {
|
|
85
|
-
"type": "boolean",
|
|
86
|
-
"mutable": false,
|
|
87
|
-
"complexType": {
|
|
88
|
-
"original": "boolean",
|
|
89
|
-
"resolved": "boolean",
|
|
90
|
-
"references": {}
|
|
45
|
+
static get originalStyleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["mg-input-title.scss"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get styleUrls() {
|
|
51
|
+
return {
|
|
52
|
+
"$": ["mg-input-title.css"]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get properties() {
|
|
56
|
+
return {
|
|
57
|
+
"identifier": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "string",
|
|
62
|
+
"resolved": "string",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": true,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": "Label input id"
|
|
70
|
+
},
|
|
71
|
+
"attribute": "identifier",
|
|
72
|
+
"reflect": false
|
|
91
73
|
},
|
|
92
|
-
"required":
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
74
|
+
"required": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "boolean",
|
|
79
|
+
"resolved": "boolean",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": "If input is required an asterisk is added at the end of the label"
|
|
87
|
+
},
|
|
88
|
+
"attribute": "required",
|
|
89
|
+
"reflect": false
|
|
97
90
|
},
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
"isLegend": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "boolean",
|
|
96
|
+
"resolved": "boolean",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": "Switch from label to fieldset sementic"
|
|
104
|
+
},
|
|
105
|
+
"attribute": "is-legend",
|
|
106
|
+
"reflect": false,
|
|
107
|
+
"defaultValue": "false"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
static get states() {
|
|
112
|
+
return {
|
|
113
|
+
"tagName": {}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
static get watchers() {
|
|
117
|
+
return [{
|
|
118
|
+
"propName": "identifier",
|
|
119
|
+
"methodName": "validateIdentifier"
|
|
120
|
+
}];
|
|
121
|
+
}
|
|
106
122
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { variants } from './mg-tag.conf';
|
|
3
3
|
import { ClassList } from '../../../utils/components.utils';
|
|
4
4
|
export class MgTag {
|
|
@@ -55,62 +55,71 @@ export class MgTag {
|
|
|
55
55
|
* @returns {HTMLElement} HTML Element
|
|
56
56
|
*/
|
|
57
57
|
render() {
|
|
58
|
-
return (h("span", { class: this.classList.join() },
|
|
59
|
-
h("slot", null)));
|
|
58
|
+
return (h("span", { class: this.classList.join() }, h("slot", null)));
|
|
60
59
|
}
|
|
61
60
|
static get is() { return "mg-tag"; }
|
|
62
61
|
static get encapsulation() { return "shadow"; }
|
|
63
|
-
static get originalStyleUrls() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"original": "boolean",
|
|
93
|
-
"resolved": "boolean",
|
|
94
|
-
"references": {}
|
|
95
|
-
},
|
|
96
|
-
"required": false,
|
|
97
|
-
"optional": false,
|
|
98
|
-
"docs": {
|
|
99
|
-
"tags": [],
|
|
100
|
-
"text": "Define if button is using outline style"
|
|
62
|
+
static get originalStyleUrls() {
|
|
63
|
+
return {
|
|
64
|
+
"$": ["mg-tag.scss"]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static get styleUrls() {
|
|
68
|
+
return {
|
|
69
|
+
"$": ["mg-tag.css"]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
static get properties() {
|
|
73
|
+
return {
|
|
74
|
+
"variant": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": "Define button variant"
|
|
87
|
+
},
|
|
88
|
+
"attribute": "variant",
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"defaultValue": "variants[0]"
|
|
101
91
|
},
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
92
|
+
"outline": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "boolean",
|
|
97
|
+
"resolved": "boolean",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "Define if button is using outline style"
|
|
105
|
+
},
|
|
106
|
+
"attribute": "outline",
|
|
107
|
+
"reflect": false
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
static get states() {
|
|
112
|
+
return {
|
|
113
|
+
"classList": {}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
static get watchers() {
|
|
117
|
+
return [{
|
|
118
|
+
"propName": "variant",
|
|
119
|
+
"methodName": "validateVariant"
|
|
120
|
+
}, {
|
|
121
|
+
"propName": "outline",
|
|
122
|
+
"methodName": "validateOutline"
|
|
123
|
+
}];
|
|
124
|
+
}
|
|
116
125
|
}
|
|
@@ -24,8 +24,7 @@ export default {
|
|
|
24
24
|
* @returns {HTMLElement} HTMLElement
|
|
25
25
|
*/
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
const Template = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })),
|
|
28
|
-
h("mg-icon", { icon: "info-circle" })));
|
|
27
|
+
const Template = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })), h("mg-icon", { icon: "info-circle" })));
|
|
29
28
|
export const MgTooltip = Template.bind({});
|
|
30
29
|
MgTooltip.args = {
|
|
31
30
|
identifier: 'identifier',
|
|
@@ -41,8 +40,7 @@ MgTooltip.args = {
|
|
|
41
40
|
* @returns {HTMLElement} HTMLElement
|
|
42
41
|
*/
|
|
43
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
-
const TemplateButton = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })),
|
|
45
|
-
h("mg-button", null, "Action")));
|
|
43
|
+
const TemplateButton = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })), h("mg-button", null, "Action")));
|
|
46
44
|
export const MgTooltipOnButton = TemplateButton.bind({});
|
|
47
45
|
MgTooltipOnButton.args = Object.assign({}, MgTooltip.args);
|
|
48
46
|
/**
|
|
@@ -52,7 +50,6 @@ MgTooltipOnButton.args = Object.assign({}, MgTooltip.args);
|
|
|
52
50
|
* @returns {HTMLElement} HTMLElement
|
|
53
51
|
*/
|
|
54
52
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
-
const TemplateSpan = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })),
|
|
56
|
-
h("span", null, "any text")));
|
|
53
|
+
const TemplateSpan = (args) => (h("mg-tooltip", Object.assign({}, filterArgs(args, { placement: 'bottom' })), h("span", null, "any text")));
|
|
57
54
|
export const MgTooltipOnSpan = TemplateSpan.bind({});
|
|
58
55
|
MgTooltipOnSpan.args = Object.assign({}, MgTooltip.args);
|