@mgdis/mg-components 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-88560a66.js → index-64cee0c8.js} +248 -81
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_24.cjs.entry.js → mg-badge_23.cjs.entry.js} +206 -2180
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-modal.cjs.entry.js +8 -1
- package/dist/cjs/mg-popover.cjs.entry.js +171 -0
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +116 -99
- package/dist/collection/components/atoms/mg-button/mg-button.js +221 -220
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +72 -69
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +102 -92
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +83 -67
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +64 -55
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +3 -6
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +120 -106
- package/dist/collection/components/molecules/inputs/MgInput.js +8 -17
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +323 -318
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +356 -361
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +462 -456
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +347 -340
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +348 -343
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +406 -401
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +12 -15
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +2 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +476 -473
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +461 -456
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +2 -8
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +299 -298
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -3
- package/dist/collection/components/molecules/mg-details/mg-details.js +95 -93
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +13 -27
- package/dist/collection/components/molecules/mg-form/mg-form.js +175 -166
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -6
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +37 -37
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +1 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +154 -153
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +11 -15
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +147 -134
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +192 -189
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +150 -135
- package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/collection/locales/en/messages.json +50 -0
- package/dist/collection/locales/fr/messages.json +50 -0
- package/dist/collection/stories/grids.stories.js +1 -44
- package/dist/collection/stories/helpers.stories.js +1 -19
- package/dist/collection/stories/icons.stories.js +1 -4
- package/dist/collection/stories/typography.stories.js +1 -12
- package/dist/collection/variables.css +3 -2
- package/dist/collection/variables.scss +3 -2
- package/dist/components/MgInput.js +6 -3
- package/dist/components/mg-badge2.js +7 -0
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-input-checkbox.js +1 -6
- package/dist/components/mg-input-date.js +10 -27
- package/dist/components/mg-input-numeric.js +1 -6
- package/dist/components/mg-input-password.js +1 -6
- package/dist/components/mg-input-radio.js +1 -6
- package/dist/components/mg-input-select2.js +1 -6
- package/dist/components/mg-input-text2.js +3 -8
- package/dist/components/mg-input-textarea.js +2 -7
- package/dist/components/mg-input-title2.js +9 -0
- package/dist/components/mg-input-toggle.js +2 -7
- package/dist/components/mg-modal.js +7 -0
- package/dist/components/mg-pagination.js +3 -3
- package/dist/components/mg-panel.js +8 -4
- package/dist/components/mg-tabs.js +8 -1
- package/dist/components/mg-tooltip2.js +7 -0
- package/dist/esm/{index-bca81100.js → index-120f47fd.js} +248 -81
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +207 -2180
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-modal.entry.js +8 -1
- package/dist/esm/mg-popover.entry.js +167 -0
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/mg-components/locales/en/messages.json +50 -0
- package/dist/mg-components/locales/fr/messages.json +50 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-21991be8.entry.js +1 -0
- package/dist/mg-components/p-36a64f8c.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/{p-b14a3443.js → p-7bc32a2f.js} +0 -0
- package/dist/mg-components/p-b380a0df.entry.js +1 -0
- package/dist/mg-components/variables.css +3 -2
- package/dist/mg-components/variables.scss +3 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +29 -29
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/p-a2883dc7.entry.js +0 -1
- package/dist/mg-components/p-cffe0519.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { variants } from './mg-button.conf';
|
|
3
|
-
import { ClassList
|
|
3
|
+
import { ClassList } from '../../../utils/components.utils';
|
|
4
4
|
export class MgButton {
|
|
5
5
|
constructor() {
|
|
6
6
|
/************
|
|
@@ -11,11 +11,6 @@ export class MgButton {
|
|
|
11
11
|
* Define button variant
|
|
12
12
|
*/
|
|
13
13
|
this.variant = variants[0]; // Primary
|
|
14
|
-
/**
|
|
15
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
16
|
-
* If not set, it will be created.
|
|
17
|
-
*/
|
|
18
|
-
this.identifier = createID('mg-button');
|
|
19
14
|
/**
|
|
20
15
|
* Define if button is round.
|
|
21
16
|
* Used for icon button.
|
|
@@ -90,7 +85,7 @@ export class MgButton {
|
|
|
90
85
|
this.validateVariant(this.variant);
|
|
91
86
|
if (this.isIcon) {
|
|
92
87
|
this.classList.add(`mg-button--icon`);
|
|
93
|
-
if (typeof this.label !== 'string' || this.label === '') {
|
|
88
|
+
if (typeof this.label !== 'string' || this.label.trim() === '') {
|
|
94
89
|
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
95
90
|
}
|
|
96
91
|
}
|
|
@@ -104,233 +99,239 @@ export class MgButton {
|
|
|
104
99
|
* @returns {HTMLElement} html element
|
|
105
100
|
*/
|
|
106
101
|
render() {
|
|
107
|
-
return (h("button", { id: this.identifier, class: this.classList.join(), type: this.type, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), "aria-expanded": this.expanded !== undefined && this.expanded.toString(), "aria-controls": this.controls, "aria-haspopup": this.haspopup !== undefined && this.haspopup.toString(), onClick: this.handleClick,
|
|
102
|
+
return (h("button", { id: this.identifier, class: this.classList.join(), type: this.type, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), "aria-expanded": this.expanded !== undefined && this.expanded.toString(), "aria-controls": this.controls, "aria-haspopup": this.haspopup !== undefined && this.haspopup.toString(), onClick: this.handleClick,
|
|
108
103
|
// has stencil does not support form attribute on button, we set the attribute from the ref
|
|
109
104
|
// https://github.com/ionic-team/stencil/issues/2703#issuecomment-1050943715
|
|
110
|
-
ref: btn => this.form && btn.setAttribute('form', this.form) },
|
|
111
|
-
this.loading && h("mg-icon", { icon: "loader", spin: true }),
|
|
112
|
-
h("div", { class: "mg-button__content" },
|
|
113
|
-
h("slot", null))));
|
|
105
|
+
ref: btn => this.form && btn.setAttribute('form', this.form) }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null))));
|
|
114
106
|
}
|
|
115
107
|
static get is() { return "mg-button"; }
|
|
116
108
|
static get encapsulation() { return "scoped"; }
|
|
117
|
-
static get originalStyleUrls() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"original": "string",
|
|
147
|
-
"resolved": "string",
|
|
148
|
-
"references": {}
|
|
149
|
-
},
|
|
150
|
-
"required": false,
|
|
151
|
-
"optional": false,
|
|
152
|
-
"docs": {
|
|
153
|
-
"tags": [],
|
|
154
|
-
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
|
|
109
|
+
static get originalStyleUrls() {
|
|
110
|
+
return {
|
|
111
|
+
"$": ["mg-button.scss"]
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get styleUrls() {
|
|
115
|
+
return {
|
|
116
|
+
"$": ["mg-button.css"]
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
static get properties() {
|
|
120
|
+
return {
|
|
121
|
+
"variant": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "string",
|
|
126
|
+
"resolved": "string",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Define button variant"
|
|
134
|
+
},
|
|
135
|
+
"attribute": "variant",
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"defaultValue": "variants[0]"
|
|
155
138
|
},
|
|
156
|
-
"
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
139
|
+
"identifier": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "string",
|
|
144
|
+
"resolved": "string",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": false,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)"
|
|
152
|
+
},
|
|
153
|
+
"attribute": "identifier",
|
|
154
|
+
"reflect": false
|
|
167
155
|
},
|
|
168
|
-
"
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
"
|
|
172
|
-
|
|
156
|
+
"label": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "string",
|
|
161
|
+
"resolved": "string",
|
|
162
|
+
"references": {}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "aria-label\nIn case button text is not explicit enough"
|
|
169
|
+
},
|
|
170
|
+
"attribute": "label",
|
|
171
|
+
"reflect": false
|
|
173
172
|
},
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"location": "import",
|
|
186
|
-
"path": "./mg-button.conf"
|
|
173
|
+
"type": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "ButtonType",
|
|
178
|
+
"resolved": "\"button\" | \"reset\" | \"submit\"",
|
|
179
|
+
"references": {
|
|
180
|
+
"ButtonType": {
|
|
181
|
+
"location": "import",
|
|
182
|
+
"path": "./mg-button.conf"
|
|
183
|
+
}
|
|
187
184
|
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"reflect": false
|
|
198
|
-
},
|
|
199
|
-
"form": {
|
|
200
|
-
"type": "string",
|
|
201
|
-
"mutable": true,
|
|
202
|
-
"complexType": {
|
|
203
|
-
"original": "string",
|
|
204
|
-
"resolved": "string",
|
|
205
|
-
"references": {}
|
|
206
|
-
},
|
|
207
|
-
"required": false,
|
|
208
|
-
"optional": false,
|
|
209
|
-
"docs": {
|
|
210
|
-
"tags": [],
|
|
211
|
-
"text": "Define form id to attach button with.\nIf this attribute is not set, the <button> is associated with its ancestor <form> element."
|
|
212
|
-
},
|
|
213
|
-
"attribute": "form",
|
|
214
|
-
"reflect": false
|
|
215
|
-
},
|
|
216
|
-
"disabled": {
|
|
217
|
-
"type": "boolean",
|
|
218
|
-
"mutable": true,
|
|
219
|
-
"complexType": {
|
|
220
|
-
"original": "boolean",
|
|
221
|
-
"resolved": "boolean",
|
|
222
|
-
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Define button type\nDefault: 'submit', as HTMLButtonElement type is submit by default"
|
|
191
|
+
},
|
|
192
|
+
"attribute": "type",
|
|
193
|
+
"reflect": false
|
|
223
194
|
},
|
|
224
|
-
"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"
|
|
228
|
-
|
|
195
|
+
"form": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": true,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Define form id to attach button with.\nIf this attribute is not set, the <button> is associated with its ancestor <form> element."
|
|
208
|
+
},
|
|
209
|
+
"attribute": "form",
|
|
210
|
+
"reflect": false
|
|
229
211
|
},
|
|
230
|
-
"
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"
|
|
239
|
-
"
|
|
212
|
+
"disabled": {
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"mutable": true,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "boolean",
|
|
217
|
+
"resolved": "boolean",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": "Disable button"
|
|
225
|
+
},
|
|
226
|
+
"attribute": "disabled",
|
|
227
|
+
"reflect": false
|
|
240
228
|
},
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"
|
|
245
|
-
|
|
229
|
+
"isIcon": {
|
|
230
|
+
"type": "boolean",
|
|
231
|
+
"mutable": false,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "boolean",
|
|
234
|
+
"resolved": "boolean",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Define if button is round.\nUsed for icon button."
|
|
242
|
+
},
|
|
243
|
+
"attribute": "is-icon",
|
|
244
|
+
"reflect": false,
|
|
245
|
+
"defaultValue": "false"
|
|
246
246
|
},
|
|
247
|
-
"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
-
"
|
|
247
|
+
"disableOnClick": {
|
|
248
|
+
"type": "boolean",
|
|
249
|
+
"mutable": false,
|
|
250
|
+
"complexType": {
|
|
251
|
+
"original": "boolean",
|
|
252
|
+
"resolved": "boolean",
|
|
253
|
+
"references": {}
|
|
254
|
+
},
|
|
255
|
+
"required": false,
|
|
256
|
+
"optional": false,
|
|
257
|
+
"docs": {
|
|
258
|
+
"tags": [],
|
|
259
|
+
"text": "Option to set input disable on click, in order to prevent multi-click.\nParent component have to remove the attribute 'disabled' when the process ends."
|
|
260
|
+
},
|
|
261
|
+
"attribute": "disable-on-click",
|
|
262
|
+
"reflect": false,
|
|
263
|
+
"defaultValue": "false"
|
|
258
264
|
},
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"
|
|
263
|
-
|
|
265
|
+
"expanded": {
|
|
266
|
+
"type": "boolean",
|
|
267
|
+
"mutable": false,
|
|
268
|
+
"complexType": {
|
|
269
|
+
"original": "boolean",
|
|
270
|
+
"resolved": "boolean",
|
|
271
|
+
"references": {}
|
|
272
|
+
},
|
|
273
|
+
"required": false,
|
|
274
|
+
"optional": false,
|
|
275
|
+
"docs": {
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": "Prop to set aria-expanded on button element"
|
|
278
|
+
},
|
|
279
|
+
"attribute": "expanded",
|
|
280
|
+
"reflect": false
|
|
264
281
|
},
|
|
265
|
-
"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
282
|
+
"controls": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string",
|
|
287
|
+
"resolved": "string",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Prop to set aria-controls on button element"
|
|
295
|
+
},
|
|
296
|
+
"attribute": "controls",
|
|
297
|
+
"reflect": false
|
|
276
298
|
},
|
|
277
|
-
"
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
"
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
"
|
|
292
|
-
"
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
"haspopup": {
|
|
304
|
-
"type": "any",
|
|
305
|
-
"mutable": false,
|
|
306
|
-
"complexType": {
|
|
307
|
-
"original": "boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'",
|
|
308
|
-
"resolved": "\"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | boolean",
|
|
309
|
-
"references": {}
|
|
310
|
-
},
|
|
311
|
-
"required": false,
|
|
312
|
-
"optional": false,
|
|
313
|
-
"docs": {
|
|
314
|
-
"tags": [],
|
|
315
|
-
"text": "Option to set aria-haspopup\nThe aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity."
|
|
316
|
-
},
|
|
317
|
-
"attribute": "haspopup",
|
|
318
|
-
"reflect": false
|
|
319
|
-
}
|
|
320
|
-
}; }
|
|
321
|
-
static get states() { return {
|
|
322
|
-
"loading": {},
|
|
323
|
-
"classList": {}
|
|
324
|
-
}; }
|
|
299
|
+
"haspopup": {
|
|
300
|
+
"type": "any",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'",
|
|
304
|
+
"resolved": "\"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\" | boolean",
|
|
305
|
+
"references": {}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": "Option to set aria-haspopup\nThe aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity."
|
|
312
|
+
},
|
|
313
|
+
"attribute": "haspopup",
|
|
314
|
+
"reflect": false
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
static get states() {
|
|
319
|
+
return {
|
|
320
|
+
"loading": {},
|
|
321
|
+
"classList": {}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
325
324
|
static get elementRef() { return "element"; }
|
|
326
|
-
static get watchers() {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
325
|
+
static get watchers() {
|
|
326
|
+
return [{
|
|
327
|
+
"propName": "variant",
|
|
328
|
+
"methodName": "validateVariant"
|
|
329
|
+
}, {
|
|
330
|
+
"propName": "disabled",
|
|
331
|
+
"methodName": "disabledHandler"
|
|
332
|
+
}, {
|
|
333
|
+
"propName": "loading",
|
|
334
|
+
"methodName": "loadingHandler"
|
|
335
|
+
}];
|
|
336
|
+
}
|
|
336
337
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { initLocales } from '../../../locales';
|
|
3
3
|
export class MgCharacterLeft {
|
|
4
4
|
constructor() {
|
|
@@ -30,78 +30,81 @@ export class MgCharacterLeft {
|
|
|
30
30
|
* @returns {HTMLElement} HTML Element
|
|
31
31
|
*/
|
|
32
32
|
render() {
|
|
33
|
-
return (h("span", { id: this.identifier, "aria-live": "polite" },
|
|
34
|
-
h("span", { "aria-hidden": "true" },
|
|
35
|
-
this.maxlength - this.characters.length,
|
|
36
|
-
"/",
|
|
37
|
-
this.maxlength),
|
|
38
|
-
h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
|
|
33
|
+
return (h("span", { id: this.identifier, "aria-live": "polite" }, h("span", { "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
|
|
39
34
|
}
|
|
40
35
|
static get is() { return "mg-character-left"; }
|
|
41
36
|
static get encapsulation() { return "scoped"; }
|
|
42
|
-
static get originalStyleUrls() {
|
|
43
|
-
|
|
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
|
-
"original": "string",
|
|
71
|
-
"resolved": "string",
|
|
72
|
-
"references": {}
|
|
73
|
-
},
|
|
74
|
-
"required": false,
|
|
75
|
-
"optional": false,
|
|
76
|
-
"docs": {
|
|
77
|
-
"tags": [],
|
|
78
|
-
"text": "Sets the characters to count"
|
|
79
|
-
},
|
|
80
|
-
"attribute": "characters",
|
|
81
|
-
"reflect": false,
|
|
82
|
-
"defaultValue": "''"
|
|
83
|
-
},
|
|
84
|
-
"maxlength": {
|
|
85
|
-
"type": "number",
|
|
86
|
-
"mutable": false,
|
|
87
|
-
"complexType": {
|
|
88
|
-
"original": "number",
|
|
89
|
-
"resolved": "number",
|
|
90
|
-
"references": {}
|
|
37
|
+
static get originalStyleUrls() {
|
|
38
|
+
return {
|
|
39
|
+
"$": ["mg-character-left.scss"]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static get styleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["mg-character-left.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get properties() {
|
|
48
|
+
return {
|
|
49
|
+
"identifier": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "string",
|
|
54
|
+
"resolved": "string",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": "Sets an `id` attribute.\nNeeded by the input for accessibility `aria-decribedby`."
|
|
62
|
+
},
|
|
63
|
+
"attribute": "identifier",
|
|
64
|
+
"reflect": false
|
|
91
65
|
},
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
66
|
+
"characters": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Sets the characters to count"
|
|
79
|
+
},
|
|
80
|
+
"attribute": "characters",
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"defaultValue": "''"
|
|
97
83
|
},
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
"maxlength": {
|
|
85
|
+
"type": "number",
|
|
86
|
+
"mutable": false,
|
|
87
|
+
"complexType": {
|
|
88
|
+
"original": "number",
|
|
89
|
+
"resolved": "number",
|
|
90
|
+
"references": {}
|
|
91
|
+
},
|
|
92
|
+
"required": true,
|
|
93
|
+
"optional": false,
|
|
94
|
+
"docs": {
|
|
95
|
+
"tags": [],
|
|
96
|
+
"text": "Add maximum length"
|
|
97
|
+
},
|
|
98
|
+
"attribute": "maxlength",
|
|
99
|
+
"reflect": false
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
102
103
|
static get elementRef() { return "element"; }
|
|
103
|
-
static get watchers() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
static get watchers() {
|
|
105
|
+
return [{
|
|
106
|
+
"propName": "maxlength",
|
|
107
|
+
"methodName": "validateMaxlength"
|
|
108
|
+
}];
|
|
109
|
+
}
|
|
107
110
|
}
|
|
@@ -30,8 +30,7 @@ const Template = (args) => {
|
|
|
30
30
|
const color = args.color;
|
|
31
31
|
delete args.color;
|
|
32
32
|
// return element
|
|
33
|
-
return (h("div", { style: { color } },
|
|
34
|
-
h("mg-icon", Object.assign({}, filterArgs(args, { size: sizes[1] })))));
|
|
33
|
+
return (h("div", { style: { color } }, h("mg-icon", Object.assign({}, filterArgs(args, { size: sizes[1] })))));
|
|
35
34
|
};
|
|
36
35
|
export const MgIcon = Template.bind({});
|
|
37
36
|
MgIcon.args = {
|