@govbr-ds/webcomponents 2.0.0-next.5 → 2.0.0-next.6
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/README.md +16 -30
- package/dist/cjs/br-button.cjs.entry.js +1 -1
- package/dist/cjs/br-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/br-icon.cjs.entry.js +2465 -0
- package/dist/cjs/br-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/br-input.cjs.entry.js +2 -2
- package/dist/cjs/br-input.cjs.entry.js.map +1 -1
- package/dist/cjs/br-item.cjs.entry.js +2 -2
- package/dist/cjs/{index-c5475da7.js → index-d682c89d.js} +9 -5
- package/dist/cjs/{index-c5475da7.js.map → index-d682c89d.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/cjs/webcomponents.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/icon/icon.css +23222 -0
- package/dist/collection/components/icon/icon.js +324 -0
- package/dist/collection/components/icon/icon.js.map +1 -0
- package/dist/collection/components/icon/tests/icon.e2e.js +107 -0
- package/dist/collection/components/icon/tests/icon.e2e.js.map +1 -0
- package/dist/collection/components/icon/tests/icon.spec.js +80 -0
- package/dist/collection/components/icon/tests/icon.spec.js.map +1 -0
- package/dist/collection/components/input/input.js +1 -1
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/tests/input.e2e.js +25 -0
- package/dist/collection/components/input/tests/input.e2e.js.map +1 -0
- package/dist/collection/components/input/tests/input.spec.js +36 -0
- package/dist/collection/components/input/tests/input.spec.js.map +1 -0
- package/dist/collection/components/item/item.js +1 -1
- package/dist/collection/pages/icon/icon.js +19 -0
- package/dist/components/br-icon.d.ts +11 -0
- package/dist/components/br-icon.js +2481 -0
- package/dist/components/br-icon.js.map +1 -0
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-input.js.map +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/esm/br-button.entry.js +1 -1
- package/dist/esm/br-checkbox.entry.js +1 -1
- package/dist/esm/br-icon.entry.js +2461 -0
- package/dist/esm/br-icon.entry.js.map +1 -0
- package/dist/esm/br-input.entry.js +2 -2
- package/dist/esm/br-input.entry.js.map +1 -1
- package/dist/esm/br-item.entry.js +2 -2
- package/dist/esm/{index-57007b22.js → index-55a13a51.js} +9 -5
- package/dist/esm/{index-57007b22.js.map → index-55a13a51.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/webcomponents.js +4 -4
- package/dist/esm/webcomponents.js.map +1 -1
- package/dist/types/components/icon/icon.d.ts +50 -0
- package/dist/types/components.d.ts +128 -0
- package/dist/webcomponents/p-1b6e8650.entry.js +13 -0
- package/dist/webcomponents/p-1b6e8650.entry.js.map +1 -0
- package/dist/webcomponents/{p-1b276845.entry.js → p-61231fb7.entry.js} +2 -2
- package/dist/webcomponents/{p-a0b98f14.entry.js → p-8ed9a673.entry.js} +2 -2
- package/dist/webcomponents/{p-5f162437.entry.js → p-a7e423b4.entry.js} +2 -2
- package/dist/webcomponents/{p-5f162437.entry.js.map → p-a7e423b4.entry.js.map} +1 -1
- package/dist/webcomponents/{p-6d857090.entry.js → p-b0e416bd.entry.js} +2 -2
- package/dist/webcomponents/p-f379e66c.js +3 -0
- package/dist/webcomponents/{p-a3d8d916.js.map → p-f379e66c.js.map} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/hydrate/index.js +18038 -11564
- package/package.json +22 -11
- package/vscode-data.json +37 -0
- package/dist/webcomponents/p-a3d8d916.js +0 -3
- /package/dist/webcomponents/{p-1b276845.entry.js.map → p-61231fb7.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-a0b98f14.entry.js.map → p-8ed9a673.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-6d857090.entry.js.map → p-b0e416bd.entry.js.map} +0 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import "iconify-icon";
|
|
3
|
+
import { inheritAriaAttributes } from "../../utils/inherited-attributes";
|
|
4
|
+
export class Icon {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.inheritedAttributes = {};
|
|
7
|
+
this.IconName = undefined;
|
|
8
|
+
this.height = undefined;
|
|
9
|
+
this.width = undefined;
|
|
10
|
+
this.class = undefined;
|
|
11
|
+
this.inline = false;
|
|
12
|
+
this.rotate = undefined;
|
|
13
|
+
this.flip = undefined;
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.brConnectedCallback.emit(this);
|
|
17
|
+
}
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
this.brComponentWillLoad.emit(this);
|
|
20
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
21
|
+
}
|
|
22
|
+
componentDidLoad() {
|
|
23
|
+
this.brComponentDidLoad.emit(this);
|
|
24
|
+
}
|
|
25
|
+
componentWillRender() {
|
|
26
|
+
this.brComponentWillRender.emit(this);
|
|
27
|
+
}
|
|
28
|
+
componentDidRender() {
|
|
29
|
+
this.brComponentDidRender.emit(this);
|
|
30
|
+
}
|
|
31
|
+
componentShouldUpdate() {
|
|
32
|
+
this.brComponentShouldUpdate.emit(this);
|
|
33
|
+
}
|
|
34
|
+
componentWillUpdate() {
|
|
35
|
+
this.brComponentWillUpdate.emit(this);
|
|
36
|
+
}
|
|
37
|
+
componentDidUpdate() {
|
|
38
|
+
this.brComponentDidUpdate.emit(this);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.brDisconnectedCallback.emit(this);
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, { key: 'b26b2da21c7f395e42c9f73d0f7c3663b1bd6d5c' }, h("iconify-icon", Object.assign({ key: 'eb22872b7e12ef49253ca6f2ed829929d5376fe8', flip: this.flip, width: this.width, class: this.class, icon: this.IconName, inline: this.inline, height: this.height, rotate: this.rotate }, this.inheritedAttributes))));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "br-icon"; }
|
|
47
|
+
static get encapsulation() { return "shadow"; }
|
|
48
|
+
static get formAssociated() { return true; }
|
|
49
|
+
static get originalStyleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["icon.scss"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get styleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["icon.css"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get properties() {
|
|
60
|
+
return {
|
|
61
|
+
"IconName": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "string",
|
|
66
|
+
"resolved": "string",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "Nome do \u00EDcone Iconify a ser exibido"
|
|
74
|
+
},
|
|
75
|
+
"attribute": "icon-name",
|
|
76
|
+
"reflect": true
|
|
77
|
+
},
|
|
78
|
+
"height": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "string",
|
|
83
|
+
"resolved": "string",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Altura do \u00EDcone, pode ser especificada em qualquer unidade CSS v\u00E1lida (px, em, rem, etc.)"
|
|
91
|
+
},
|
|
92
|
+
"attribute": "height",
|
|
93
|
+
"reflect": true
|
|
94
|
+
},
|
|
95
|
+
"width": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Largura do \u00EDcone, pode ser especificada em qualquer unidade CSS v\u00E1lida (px, em, rem, etc.)"
|
|
108
|
+
},
|
|
109
|
+
"attribute": "width",
|
|
110
|
+
"reflect": true
|
|
111
|
+
},
|
|
112
|
+
"class": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": true,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Classes CSS adicionais a serem aplicadas ao \u00EDcone"
|
|
125
|
+
},
|
|
126
|
+
"attribute": "class",
|
|
127
|
+
"reflect": true
|
|
128
|
+
},
|
|
129
|
+
"inline": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "boolean",
|
|
134
|
+
"resolved": "boolean",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": true,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": "Adiciona alinhamento vertical ao \u00EDcone quando embutido no texto"
|
|
142
|
+
},
|
|
143
|
+
"attribute": "inline",
|
|
144
|
+
"reflect": true,
|
|
145
|
+
"defaultValue": "false"
|
|
146
|
+
},
|
|
147
|
+
"rotate": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "string",
|
|
152
|
+
"resolved": "string",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": true,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": "Rotaciona o \u00EDcone em diferentes \u00E2ngulos. Aceita valores como \"90deg\", \"180deg\", \"270deg\"."
|
|
160
|
+
},
|
|
161
|
+
"attribute": "rotate",
|
|
162
|
+
"reflect": true
|
|
163
|
+
},
|
|
164
|
+
"flip": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "string",
|
|
169
|
+
"resolved": "string",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": true,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Espelha o \u00EDcone horizontalmente, verticalmente ou ambos. Aceita valores \"horizontal\", \"vertical\"."
|
|
177
|
+
},
|
|
178
|
+
"attribute": "flip",
|
|
179
|
+
"reflect": true
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
static get events() {
|
|
184
|
+
return [{
|
|
185
|
+
"method": "brConnectedCallback",
|
|
186
|
+
"name": "brConnectedCallback",
|
|
187
|
+
"bubbles": true,
|
|
188
|
+
"cancelable": true,
|
|
189
|
+
"composed": true,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Disparado quando o componente \u00E9 conectado ao DOM. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
193
|
+
},
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "this",
|
|
196
|
+
"resolved": "this",
|
|
197
|
+
"references": {}
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
"method": "brComponentWillLoad",
|
|
201
|
+
"name": "brComponentWillLoad",
|
|
202
|
+
"bubbles": true,
|
|
203
|
+
"cancelable": true,
|
|
204
|
+
"composed": true,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Disparado antes do componente ser carregado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
208
|
+
},
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "this",
|
|
211
|
+
"resolved": "this",
|
|
212
|
+
"references": {}
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
"method": "brComponentDidLoad",
|
|
216
|
+
"name": "brComponentDidLoad",
|
|
217
|
+
"bubbles": true,
|
|
218
|
+
"cancelable": true,
|
|
219
|
+
"composed": true,
|
|
220
|
+
"docs": {
|
|
221
|
+
"tags": [],
|
|
222
|
+
"text": "Disparado ap\u00F3s o componente ser carregado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
223
|
+
},
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "this",
|
|
226
|
+
"resolved": "this",
|
|
227
|
+
"references": {}
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
"method": "brComponentWillRender",
|
|
231
|
+
"name": "brComponentWillRender",
|
|
232
|
+
"bubbles": true,
|
|
233
|
+
"cancelable": true,
|
|
234
|
+
"composed": true,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Disparado antes do componente ser renderizado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
238
|
+
},
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "this",
|
|
241
|
+
"resolved": "this",
|
|
242
|
+
"references": {}
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
"method": "brComponentDidRender",
|
|
246
|
+
"name": "brComponentDidRender",
|
|
247
|
+
"bubbles": true,
|
|
248
|
+
"cancelable": true,
|
|
249
|
+
"composed": true,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": "Disparado ap\u00F3s o componente ser renderizado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
253
|
+
},
|
|
254
|
+
"complexType": {
|
|
255
|
+
"original": "this",
|
|
256
|
+
"resolved": "this",
|
|
257
|
+
"references": {}
|
|
258
|
+
}
|
|
259
|
+
}, {
|
|
260
|
+
"method": "brComponentShouldUpdate",
|
|
261
|
+
"name": "brComponentShouldUpdate",
|
|
262
|
+
"bubbles": true,
|
|
263
|
+
"cancelable": true,
|
|
264
|
+
"composed": true,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Disparado antes do componente ser atualizado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
268
|
+
},
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "this",
|
|
271
|
+
"resolved": "this",
|
|
272
|
+
"references": {}
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
"method": "brComponentWillUpdate",
|
|
276
|
+
"name": "brComponentWillUpdate",
|
|
277
|
+
"bubbles": true,
|
|
278
|
+
"cancelable": true,
|
|
279
|
+
"composed": true,
|
|
280
|
+
"docs": {
|
|
281
|
+
"tags": [],
|
|
282
|
+
"text": "Disparado antes do componente ser atualizado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
283
|
+
},
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "this",
|
|
286
|
+
"resolved": "this",
|
|
287
|
+
"references": {}
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
"method": "brComponentDidUpdate",
|
|
291
|
+
"name": "brComponentDidUpdate",
|
|
292
|
+
"bubbles": true,
|
|
293
|
+
"cancelable": true,
|
|
294
|
+
"composed": true,
|
|
295
|
+
"docs": {
|
|
296
|
+
"tags": [],
|
|
297
|
+
"text": "Disparado ap\u00F3s o componente ser atualizado. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
298
|
+
},
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "this",
|
|
301
|
+
"resolved": "this",
|
|
302
|
+
"references": {}
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
"method": "brDisconnectedCallback",
|
|
306
|
+
"name": "brDisconnectedCallback",
|
|
307
|
+
"bubbles": true,
|
|
308
|
+
"cancelable": true,
|
|
309
|
+
"composed": true,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "Disparado quando o componente \u00E9 desconectado do DOM. Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
|
|
313
|
+
},
|
|
314
|
+
"complexType": {
|
|
315
|
+
"original": "this",
|
|
316
|
+
"resolved": "this",
|
|
317
|
+
"references": {}
|
|
318
|
+
}
|
|
319
|
+
}];
|
|
320
|
+
}
|
|
321
|
+
static get elementRef() { return "el"; }
|
|
322
|
+
static get attachInternalsMemberName() { return "elementInternals"; }
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACvG,OAAO,cAAc,CAAA;AACrB,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAQpF,MAAM,OAAO,IAAI;;QA2BP,wBAAmB,GAAe,EAAE,CAAA;;;;;sBARA,KAAK;;;;IAYjD,iBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, h, Host, Prop } from '@stencil/core'\nimport 'iconify-icon'\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\n\n@Component({\n tag: 'br-icon',\n styleUrl: 'icon.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Icon {\n /** Elemento host */\n @Element() el: HTMLElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /** Nome do ícone Iconify a ser exibido */\n @Prop({ reflect: true }) IconName: string\n\n /** Altura do ícone, pode ser especificada em qualquer unidade CSS válida (px, em, rem, etc.) */\n @Prop({ reflect: true }) height: string\n\n /** Largura do ícone, pode ser especificada em qualquer unidade CSS válida (px, em, rem, etc.) */\n @Prop({ reflect: true }) width: string\n\n /** Classes CSS adicionais a serem aplicadas ao ícone */\n @Prop({ reflect: true }) class?: string\n\n /** Adiciona alinhamento vertical ao ícone quando embutido no texto */\n @Prop({ reflect: true }) inline?: boolean = false\n\n /** Rotaciona o ícone em diferentes ângulos. Aceita valores como \"90deg\", \"180deg\", \"270deg\". */\n @Prop({ reflect: true }) rotate?: string\n\n /** Espelha o ícone horizontalmente, verticalmente ou ambos. Aceita valores \"horizontal\", \"vertical\". */\n @Prop({ reflect: true }) flip?: string\n\n private inheritedAttributes: Attributes = {}\n\n /** Disparado quando o componente é conectado ao DOM. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brConnectedCallback: EventEmitter<this>\n connectedCallback() {\n this.brConnectedCallback.emit(this)\n }\n\n /** Disparado antes do componente ser carregado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillLoad: EventEmitter<this>\n componentWillLoad() {\n this.brComponentWillLoad.emit(this)\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n /** Disparado após o componente ser carregado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brComponentDidLoad.emit(this)\n }\n\n /** Disparado antes do componente ser renderizado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillRender: EventEmitter<this>\n componentWillRender() {\n this.brComponentWillRender.emit(this)\n }\n\n /** Disparado após o componente ser renderizado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidRender: EventEmitter<this>\n componentDidRender() {\n this.brComponentDidRender.emit(this)\n }\n\n /** Disparado antes do componente ser atualizado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brComponentShouldUpdate.emit(this)\n }\n\n /** Disparado antes do componente ser atualizado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brComponentWillUpdate.emit(this)\n }\n\n /** Disparado após o componente ser atualizado. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brComponentDidUpdate.emit(this)\n }\n\n /** Disparado quando o componente é desconectado do DOM. Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brDisconnectedCallback: EventEmitter<this>\n disconnectedCallback() {\n this.brDisconnectedCallback.emit(this)\n }\n\n render() {\n return (\n <Host>\n <iconify-icon\n flip={this.flip}\n width={this.width}\n class={this.class}\n icon={this.IconName}\n inline={this.inline}\n height={this.height}\n rotate={this.rotate}\n {...this.inheritedAttributes}\n ></iconify-icon>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// import AxeBuilder from '@axe-core/playwright'
|
|
2
|
+
// import { expect, test } from '@playwright/test'
|
|
3
|
+
// test.describe('br-icon', () => {
|
|
4
|
+
// test('should render with the "hydrated" class', async ({ page }) => {
|
|
5
|
+
// await page.goto('icon')
|
|
6
|
+
// await page.setContent('<br-icon></br-icon>')
|
|
7
|
+
// const element = await page.locator('br-icon')
|
|
8
|
+
// await expect(element).toHaveClass(/hydrated/)
|
|
9
|
+
// })
|
|
10
|
+
// test('should render with "brand" icon-style', async ({ page }) => {
|
|
11
|
+
// const props = [
|
|
12
|
+
// {
|
|
13
|
+
// name: 'name',
|
|
14
|
+
// value: 'node-js',
|
|
15
|
+
// },
|
|
16
|
+
// {
|
|
17
|
+
// name: 'icon-style',
|
|
18
|
+
// value: 'brand',
|
|
19
|
+
// },
|
|
20
|
+
// ]
|
|
21
|
+
// const expectedDataPrefix = 'fab'
|
|
22
|
+
// await page.goto('icon')
|
|
23
|
+
// await page.setContent(
|
|
24
|
+
// `<br-icon ${props[0].name}="${props[0].value}" ${props[1].name}="${props[1].value}"></br-icon>`
|
|
25
|
+
// )
|
|
26
|
+
// const svgIcon = await page.locator('br-icon svg')
|
|
27
|
+
// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)
|
|
28
|
+
// })
|
|
29
|
+
// test('should render with "regular" icon-style', async ({ page }) => {
|
|
30
|
+
// const props = [
|
|
31
|
+
// {
|
|
32
|
+
// name: 'name',
|
|
33
|
+
// value: 'envelope',
|
|
34
|
+
// },
|
|
35
|
+
// {
|
|
36
|
+
// name: 'icon-style',
|
|
37
|
+
// value: 'regular',
|
|
38
|
+
// },
|
|
39
|
+
// ]
|
|
40
|
+
// const expectedDataPrefix = 'far'
|
|
41
|
+
// await page.goto('icon')
|
|
42
|
+
// await page.setContent(
|
|
43
|
+
// `<br-icon ${props[0].name}="${props[0].value}" ${props[1].name}="${props[1].value}"></br-icon>`
|
|
44
|
+
// )
|
|
45
|
+
// const svgIcon = await page.locator('br-icon svg')
|
|
46
|
+
// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)
|
|
47
|
+
// })
|
|
48
|
+
// test('should render with "solid" icon-style', async ({ page }) => {
|
|
49
|
+
// const props = [
|
|
50
|
+
// {
|
|
51
|
+
// name: 'name',
|
|
52
|
+
// value: 'camera',
|
|
53
|
+
// },
|
|
54
|
+
// {
|
|
55
|
+
// name: 'icon-style',
|
|
56
|
+
// value: 'solid',
|
|
57
|
+
// },
|
|
58
|
+
// ]
|
|
59
|
+
// const expectedDataPrefix = 'fas'
|
|
60
|
+
// await page.goto('icon')
|
|
61
|
+
// await page.setContent(
|
|
62
|
+
// `<br-icon ${props[0].name}="${props[0].value}" ${props[1].name}="${props[1].value}"></br-icon>`
|
|
63
|
+
// )
|
|
64
|
+
// const svgIcon = await page.locator('br-icon svg')
|
|
65
|
+
// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)
|
|
66
|
+
// })
|
|
67
|
+
// test('should render with a specified icon name', async ({ page }) => {
|
|
68
|
+
// const props = [
|
|
69
|
+
// {
|
|
70
|
+
// name: 'name',
|
|
71
|
+
// value: 'node-js',
|
|
72
|
+
// },
|
|
73
|
+
// {
|
|
74
|
+
// name: 'icon-style',
|
|
75
|
+
// value: 'brand',
|
|
76
|
+
// },
|
|
77
|
+
// ]
|
|
78
|
+
// await page.goto('icon')
|
|
79
|
+
// await page.setContent(
|
|
80
|
+
// `<br-icon ${props[0].name}="${props[0].value}" ${props[1].name}="${props[1].value}"></br-icon>`
|
|
81
|
+
// )
|
|
82
|
+
// const svgIcon = await page.locator('br-icon svg')
|
|
83
|
+
// await expect(svgIcon).toHaveAttribute('data-icon', props[0].value)
|
|
84
|
+
// })
|
|
85
|
+
// test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => {
|
|
86
|
+
// const props = [
|
|
87
|
+
// {
|
|
88
|
+
// name: 'name',
|
|
89
|
+
// value: 'camera',
|
|
90
|
+
// },
|
|
91
|
+
// {
|
|
92
|
+
// name: 'icon-style',
|
|
93
|
+
// value: 'solid',
|
|
94
|
+
// },
|
|
95
|
+
// ]
|
|
96
|
+
// await page.goto('icon')
|
|
97
|
+
// await page.setContent(
|
|
98
|
+
// `<br-icon ${props[0].name}="${props[0].value}" ${props[1].name}="${props[1].value}"></br-icon>`
|
|
99
|
+
// )
|
|
100
|
+
// const accessibilityScanResults = await new AxeBuilder({ page })
|
|
101
|
+
// .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
|
|
102
|
+
// .disableRules(['color-contrast', 'html-has-lang', 'document-title'])
|
|
103
|
+
// .analyze()
|
|
104
|
+
// expect(accessibilityScanResults.violations).toEqual([])
|
|
105
|
+
// })
|
|
106
|
+
// })
|
|
107
|
+
//# sourceMappingURL=icon.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.e2e.js","sourceRoot":"","sources":["../../../../src/components/icon/tests/icon.e2e.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,kDAAkD;AAElD,mCAAmC;AACnC,0EAA0E;AAC1E,8BAA8B;AAC9B,mDAAmD;AAEnD,oDAAoD;AACpD,oDAAoD;AACpD,OAAO;AAEP,wEAAwE;AACxE,sBAAsB;AACtB,UAAU;AACV,wBAAwB;AACxB,4BAA4B;AAC5B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,0BAA0B;AAC1B,WAAW;AACX,QAAQ;AACR,uCAAuC;AACvC,8BAA8B;AAC9B,6BAA6B;AAC7B,wGAAwG;AACxG,QAAQ;AAER,wDAAwD;AACxD,+EAA+E;AAC/E,OAAO;AAEP,0EAA0E;AAC1E,sBAAsB;AACtB,UAAU;AACV,wBAAwB;AACxB,6BAA6B;AAC7B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,4BAA4B;AAC5B,WAAW;AACX,QAAQ;AACR,uCAAuC;AACvC,8BAA8B;AAC9B,6BAA6B;AAC7B,wGAAwG;AACxG,QAAQ;AAER,wDAAwD;AACxD,+EAA+E;AAC/E,OAAO;AAEP,wEAAwE;AACxE,sBAAsB;AACtB,UAAU;AACV,wBAAwB;AACxB,2BAA2B;AAC3B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,0BAA0B;AAC1B,WAAW;AACX,QAAQ;AACR,uCAAuC;AACvC,8BAA8B;AAC9B,6BAA6B;AAC7B,wGAAwG;AACxG,QAAQ;AAER,wDAAwD;AACxD,+EAA+E;AAC/E,OAAO;AAEP,2EAA2E;AAC3E,sBAAsB;AACtB,UAAU;AACV,wBAAwB;AACxB,4BAA4B;AAC5B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,0BAA0B;AAC1B,WAAW;AACX,QAAQ;AACR,8BAA8B;AAC9B,6BAA6B;AAC7B,wGAAwG;AACxG,QAAQ;AAER,wDAAwD;AACxD,yEAAyE;AACzE,OAAO;AAEP,uGAAuG;AACvG,sBAAsB;AACtB,UAAU;AACV,wBAAwB;AACxB,2BAA2B;AAC3B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,0BAA0B;AAC1B,WAAW;AACX,QAAQ;AACR,8BAA8B;AAC9B,6BAA6B;AAC7B,wGAAwG;AACxG,QAAQ;AAER,sEAAsE;AACtE,gEAAgE;AAChE,6EAA6E;AAC7E,mBAAmB;AAEnB,8DAA8D;AAC9D,OAAO;AACP,KAAK","sourcesContent":["// import AxeBuilder from '@axe-core/playwright'\n// import { expect, test } from '@playwright/test'\n\n// test.describe('br-icon', () => {\n// test('should render with the \"hydrated\" class', async ({ page }) => {\n// await page.goto('icon')\n// await page.setContent('<br-icon></br-icon>')\n\n// const element = await page.locator('br-icon')\n// await expect(element).toHaveClass(/hydrated/)\n// })\n\n// test('should render with \"brand\" icon-style', async ({ page }) => {\n// const props = [\n// {\n// name: 'name',\n// value: 'node-js',\n// },\n// {\n// name: 'icon-style',\n// value: 'brand',\n// },\n// ]\n// const expectedDataPrefix = 'fab'\n// await page.goto('icon')\n// await page.setContent(\n// `<br-icon ${props[0].name}=\"${props[0].value}\" ${props[1].name}=\"${props[1].value}\"></br-icon>`\n// )\n\n// const svgIcon = await page.locator('br-icon svg')\n// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)\n// })\n\n// test('should render with \"regular\" icon-style', async ({ page }) => {\n// const props = [\n// {\n// name: 'name',\n// value: 'envelope',\n// },\n// {\n// name: 'icon-style',\n// value: 'regular',\n// },\n// ]\n// const expectedDataPrefix = 'far'\n// await page.goto('icon')\n// await page.setContent(\n// `<br-icon ${props[0].name}=\"${props[0].value}\" ${props[1].name}=\"${props[1].value}\"></br-icon>`\n// )\n\n// const svgIcon = await page.locator('br-icon svg')\n// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)\n// })\n\n// test('should render with \"solid\" icon-style', async ({ page }) => {\n// const props = [\n// {\n// name: 'name',\n// value: 'camera',\n// },\n// {\n// name: 'icon-style',\n// value: 'solid',\n// },\n// ]\n// const expectedDataPrefix = 'fas'\n// await page.goto('icon')\n// await page.setContent(\n// `<br-icon ${props[0].name}=\"${props[0].value}\" ${props[1].name}=\"${props[1].value}\"></br-icon>`\n// )\n\n// const svgIcon = await page.locator('br-icon svg')\n// await expect(svgIcon).toHaveAttribute('data-prefix', expectedDataPrefix)\n// })\n\n// test('should render with a specified icon name', async ({ page }) => {\n// const props = [\n// {\n// name: 'name',\n// value: 'node-js',\n// },\n// {\n// name: 'icon-style',\n// value: 'brand',\n// },\n// ]\n// await page.goto('icon')\n// await page.setContent(\n// `<br-icon ${props[0].name}=\"${props[0].value}\" ${props[1].name}=\"${props[1].value}\"></br-icon>`\n// )\n\n// const svgIcon = await page.locator('br-icon svg')\n// await expect(svgIcon).toHaveAttribute('data-icon', props[0].value)\n// })\n\n// test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => {\n// const props = [\n// {\n// name: 'name',\n// value: 'camera',\n// },\n// {\n// name: 'icon-style',\n// value: 'solid',\n// },\n// ]\n// await page.goto('icon')\n// await page.setContent(\n// `<br-icon ${props[0].name}=\"${props[0].value}\" ${props[1].name}=\"${props[1].value}\"></br-icon>`\n// )\n\n// const accessibilityScanResults = await new AxeBuilder({ page })\n// .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])\n// .disableRules(['color-contrast', 'html-has-lang', 'document-title'])\n// .analyze()\n\n// expect(accessibilityScanResults.violations).toEqual([])\n// })\n// })\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// import { newSpecPage } from '@stencil/core/testing'
|
|
2
|
+
// import { Icon } from '../icon'
|
|
3
|
+
// describe('br-icon', () => {
|
|
4
|
+
// it('should render the icon with default style and icon name "camera"', async () => {
|
|
5
|
+
// const prop = {
|
|
6
|
+
// name: 'name',
|
|
7
|
+
// value: 'camera',
|
|
8
|
+
// }
|
|
9
|
+
// const page = await newSpecPage({
|
|
10
|
+
// components: [Icon],
|
|
11
|
+
// html: `<br-icon ${prop.name}="${prop.value}"></br-icon>`,
|
|
12
|
+
// })
|
|
13
|
+
// expect(page.root).toEqualHtml(`
|
|
14
|
+
// <br-icon icon-style="solid" name="camera">
|
|
15
|
+
// <mock:shadow-root>
|
|
16
|
+
// <div class="br-icon">
|
|
17
|
+
// <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="camera" class="svg-inline--fa fa-camera" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
18
|
+
// <path fill="currentColor" d="M149.1 64.8L138.7 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H373.3L362.9 64.8C356.4 45.2 338.1 32 317.4 32H194.6c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"></path>
|
|
19
|
+
// </svg>
|
|
20
|
+
// </div>
|
|
21
|
+
// </mock:shadow-root>
|
|
22
|
+
// </br-icon>
|
|
23
|
+
// `)
|
|
24
|
+
// })
|
|
25
|
+
// it('should render the icon with brand style and icon name "node-js"', async () => {
|
|
26
|
+
// const prop = [
|
|
27
|
+
// {
|
|
28
|
+
// name: 'name',
|
|
29
|
+
// value: 'node-js',
|
|
30
|
+
// },
|
|
31
|
+
// {
|
|
32
|
+
// name: 'icon-style',
|
|
33
|
+
// value: 'brand',
|
|
34
|
+
// },
|
|
35
|
+
// ]
|
|
36
|
+
// const page = await newSpecPage({
|
|
37
|
+
// components: [Icon],
|
|
38
|
+
// html: `<br-icon ${prop[0].name}="${prop[0].value}" ${prop[1].name}="${prop[1].value}"></br-icon>`,
|
|
39
|
+
// })
|
|
40
|
+
// expect(page.root).toEqualHtml(`
|
|
41
|
+
// <br-icon icon-style="brand" name="node-js">
|
|
42
|
+
// <mock:shadow-root>
|
|
43
|
+
// <div class="br-icon">
|
|
44
|
+
// <svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="node-js" class="svg-inline--fa fa-node-js" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
45
|
+
// <path fill="currentColor" d="M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z"></path>
|
|
46
|
+
// </svg>
|
|
47
|
+
// </div>
|
|
48
|
+
// </mock:shadow-root>
|
|
49
|
+
// </br-icon>
|
|
50
|
+
// `)
|
|
51
|
+
// })
|
|
52
|
+
// it('should render the icon with regular style and icon name "envelope"', async () => {
|
|
53
|
+
// const prop = [
|
|
54
|
+
// {
|
|
55
|
+
// name: 'name',
|
|
56
|
+
// value: 'envelope',
|
|
57
|
+
// },
|
|
58
|
+
// {
|
|
59
|
+
// name: 'icon-style',
|
|
60
|
+
// value: 'regular',
|
|
61
|
+
// },
|
|
62
|
+
// ]
|
|
63
|
+
// const page = await newSpecPage({
|
|
64
|
+
// components: [Icon],
|
|
65
|
+
// html: `<br-icon ${prop[0].name}="${prop[0].value}" ${prop[1].name}="${prop[1].value}"></br-icon>`,
|
|
66
|
+
// })
|
|
67
|
+
// expect(page.root).toEqualHtml(`
|
|
68
|
+
// <br-icon icon-style="regular" name="envelope">
|
|
69
|
+
// <mock:shadow-root>
|
|
70
|
+
// <div class="br-icon">
|
|
71
|
+
// <svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="envelope" class="svg-inline--fa fa-envelope" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
72
|
+
// <path fill="currentColor" d="M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"></path>
|
|
73
|
+
// </svg>
|
|
74
|
+
// </div>
|
|
75
|
+
// </mock:shadow-root>
|
|
76
|
+
// </br-icon>
|
|
77
|
+
// `)
|
|
78
|
+
// })
|
|
79
|
+
// })
|
|
80
|
+
//# sourceMappingURL=icon.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.spec.js","sourceRoot":"","sources":["../../../../src/components/icon/tests/icon.spec.tsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,iCAAiC;AAEjC,8BAA8B;AAC9B,yFAAyF;AACzF,qBAAqB;AACrB,sBAAsB;AACtB,yBAAyB;AACzB,QAAQ;AACR,uCAAuC;AACvC,4BAA4B;AAC5B,kEAAkE;AAClE,SAAS;AAET,sCAAsC;AACtC,mDAAmD;AACnD,6BAA6B;AAC7B,kCAAkC;AAClC,mMAAmM;AACnM,2SAA2S;AAC3S,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mBAAmB;AACnB,SAAS;AACT,OAAO;AAEP,wFAAwF;AACxF,qBAAqB;AACrB,UAAU;AACV,wBAAwB;AACxB,4BAA4B;AAC5B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,0BAA0B;AAC1B,WAAW;AACX,QAAQ;AACR,uCAAuC;AACvC,4BAA4B;AAC5B,2GAA2G;AAC3G,SAAS;AAET,sCAAsC;AACtC,oDAAoD;AACpD,6BAA6B;AAC7B,kCAAkC;AAClC,qMAAqM;AACrM,mnCAAmnC;AACnnC,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mBAAmB;AACnB,SAAS;AACT,OAAO;AAEP,2FAA2F;AAC3F,qBAAqB;AACrB,UAAU;AACV,wBAAwB;AACxB,6BAA6B;AAC7B,WAAW;AACX,UAAU;AACV,8BAA8B;AAC9B,4BAA4B;AAC5B,WAAW;AACX,QAAQ;AACR,uCAAuC;AACvC,4BAA4B;AAC5B,2GAA2G;AAC3G,SAAS;AAET,sCAAsC;AACtC,uDAAuD;AACvD,6BAA6B;AAC7B,kCAAkC;AAClC,uMAAuM;AACvM,sXAAsX;AACtX,qBAAqB;AACrB,mBAAmB;AACnB,8BAA8B;AAC9B,mBAAmB;AACnB,SAAS;AACT,OAAO;AACP,KAAK","sourcesContent":["// import { newSpecPage } from '@stencil/core/testing'\n// import { Icon } from '../icon'\n\n// describe('br-icon', () => {\n// it('should render the icon with default style and icon name \"camera\"', async () => {\n// const prop = {\n// name: 'name',\n// value: 'camera',\n// }\n// const page = await newSpecPage({\n// components: [Icon],\n// html: `<br-icon ${prop.name}=\"${prop.value}\"></br-icon>`,\n// })\n\n// expect(page.root).toEqualHtml(`\n// <br-icon icon-style=\"solid\" name=\"camera\">\n// <mock:shadow-root>\n// <div class=\"br-icon\">\n// <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"camera\" class=\"svg-inline--fa fa-camera\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n// <path fill=\"currentColor\" d=\"M149.1 64.8L138.7 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H373.3L362.9 64.8C356.4 45.2 338.1 32 317.4 32H194.6c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"></path>\n// </svg>\n// </div>\n// </mock:shadow-root>\n// </br-icon>\n// `)\n// })\n\n// it('should render the icon with brand style and icon name \"node-js\"', async () => {\n// const prop = [\n// {\n// name: 'name',\n// value: 'node-js',\n// },\n// {\n// name: 'icon-style',\n// value: 'brand',\n// },\n// ]\n// const page = await newSpecPage({\n// components: [Icon],\n// html: `<br-icon ${prop[0].name}=\"${prop[0].value}\" ${prop[1].name}=\"${prop[1].value}\"></br-icon>`,\n// })\n\n// expect(page.root).toEqualHtml(`\n// <br-icon icon-style=\"brand\" name=\"node-js\">\n// <mock:shadow-root>\n// <div class=\"br-icon\">\n// <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fab\" data-icon=\"node-js\" class=\"svg-inline--fa fa-node-js\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\">\n// <path fill=\"currentColor\" d=\"M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z\"></path>\n// </svg>\n// </div>\n// </mock:shadow-root>\n// </br-icon>\n// `)\n// })\n\n// it('should render the icon with regular style and icon name \"envelope\"', async () => {\n// const prop = [\n// {\n// name: 'name',\n// value: 'envelope',\n// },\n// {\n// name: 'icon-style',\n// value: 'regular',\n// },\n// ]\n// const page = await newSpecPage({\n// components: [Icon],\n// html: `<br-icon ${prop[0].name}=\"${prop[0].value}\" ${prop[1].name}=\"${prop[1].value}\"></br-icon>`,\n// })\n\n// expect(page.root).toEqualHtml(`\n// <br-icon icon-style=\"regular\" name=\"envelope\">\n// <mock:shadow-root>\n// <div class=\"br-icon\">\n// <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"envelope\" class=\"svg-inline--fa fa-envelope\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n// <path fill=\"currentColor\" d=\"M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z\"></path>\n// </svg>\n// </div>\n// </mock:shadow-root>\n// </br-icon>\n// `)\n// })\n// })\n"]}
|
|
@@ -83,7 +83,7 @@ export class Input {
|
|
|
83
83
|
this.valueChange.emit(this.value);
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '10d76e3d8526d57da98a8f3f03e58f78737cbf0a' }, h("div", { key: '674cdf3eda8f13021e02676ad04c4eccb40cf96e', class: this.getInputCssClassMap() }, this.label && (h("label", { key: '034e40975010c10833ef3bde1553fa57cdf654e3', class: "text-nowrap", htmlFor: this.el.id }, this.label)), this.icon && (h("div", { key: 'c2ace90ab1e4529f9993ee0848a7d22d362b84a5', class: "input-icon" }, h("slot", { key: '6a2bc341c47e7ace754c2a5f19040ed836645031', name: "icon" }))), h("input", Object.assign({ key: '55b8ddbe7ae043fa99428496cb8db7e9c2df2626', autocomplete: this.autocomplete, autofocus: this.autofocus, disabled: this.disabled, onInput: this.handleInput.bind(this), placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)), this.button && (h("br-button", { key: '34ef61913f82651b6c8aa34f27936b8048a70f08', class: "br-button", circle: true, "aria-label": 'bot\u00E3o de a\u00E7\u00E3o do \u00EDcone' }, h("slot", { key: 'abeca6596f1b146c26f3b6b41b11892c98f4e7c7', name: "action" }))))));
|
|
87
87
|
}
|
|
88
88
|
static get is() { return "br-input"; }
|
|
89
89
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, h } from '@stencil/core'\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n *\n * Consulte a [documentação GovBR-DS](https://www.gov.br/ds/components/input?tab=designer) para mais detalhes.\n *\n * @slot action Define a ação interna\n *\n */\n@Component({\n tag: 'br-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input {\n /** Elemento host */\n @Element() el: HTMLInputElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /** Tipo de campo de entrada */\n @Prop({ reflect: true }) type:\n | 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'url' = 'text'\n\n /** Define o comportamento padrão do browser para autocomplete em formulários */\n @Prop({ reflect: true }) autocomplete: 'on' | 'off'\n\n /** Se definido como true, o campo de entrada receberá foco automaticamente quando o formulário for carregado */\n @Prop({ reflect: true }) autofocus: boolean = false\n\n /** Comportamento: densidade */\n @Prop({ reflect: true }) density: 'small' | 'large' | '' = ''\n\n /** Se definido como true, o campo de entrada é desabilitado e não pode ser interrompido. */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /** Define o label e input como comportamento inline */\n @Prop({ reflect: true }) inline: boolean = false\n\n /** Define se o input vai ser icon. Use o @slot icon para definir o ícone */\n @Prop({ reflect: true }) icon: boolean = false\n\n /** Define se o input vai ter um botão a direita */\n @Prop({ reflect: true }) button: boolean = false\n\n @Prop({ reflect: true }) highlight: boolean = false\n\n @Prop({ reflect: true }) success: boolean = false\n\n @Prop({ reflect: true }) danger: boolean = false\n\n @Prop({ reflect: true }) info: boolean = false\n\n @Prop({ reflect: true }) warning: boolean = false\n\n /** Label para o input */\n @Prop({ reflect: true }) label: string\n\n /** Nome do campo de entrada */\n @Prop({ reflect: true }) name: string\n\n /** Uma dica ou sugestão exibida dentro do campo de entrada quando ele está vazio */\n @Prop({ reflect: true }) placeholder: string\n\n /** Se definido como true, o valor do campo de entrada pode ser exibido, mas não editado pelo usuário. */\n @Prop({ reflect: true }) readonly: boolean = false\n\n /** Se definido como true, o campo de entrada deve ser preenchido antes que o formulário possa ser enviado. */\n @Prop({ reflect: true }) required: boolean = false\n\n /** Valor inicial a ser exibido no campo de entrada. */\n @Prop({ reflect: true, mutable: true }) value: string\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brConnectedCallback: EventEmitter<this>\n connectedCallback() {\n this.brConnectedCallback.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillLoad: EventEmitter<this>\n componentWillLoad() {\n this.brComponentWillLoad.emit(this)\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brComponentDidLoad.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillRender: EventEmitter<this>\n componentWillRender() {\n this.brComponentWillRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidRender: EventEmitter<this>\n componentDidRender() {\n this.brComponentDidRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brComponentShouldUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brComponentWillUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brComponentDidUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brDisconnectedCallback: EventEmitter<this>\n disconnectedCallback() {\n this.brDisconnectedCallback.emit(this)\n }\n\n /** Componente foi inserido em um `<form>` */\n @Event() formAssociatedCallback: EventEmitter<this>\n onFormAssociatedCallback(form) {\n this.formAssociatedCallback.emit(form)\n }\n\n /** Componente foi removido de um `<form>` */\n @Event() formDisassociatedCallback: EventEmitter<this>\n onFormDisassociatedCallback(form) {\n this.formDisassociatedCallback.emit(form)\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.button,\n large: this.density === 'large',\n small: this.density === 'small',\n 'input-inline': this.inline,\n 'input-highlight': this.highlight,\n success: this.success,\n danger: this.danger,\n info: this.info,\n warning: this.warning,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /** Valor atualizado do input */\n @Event() valueChange!: EventEmitter<string>\n\n private handleInput(event: Event) {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n {this.label && (\n <label class=\"text-nowrap\" htmlFor={this.el.id}>\n {this.label}\n </label>\n )}\n {this.icon && (\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n )}\n <input\n autocomplete={this.autocomplete}\n autofocus={this.autofocus}\n disabled={this.disabled}\n onInput={this.handleInput.bind(this)}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n title={this.el.title}\n type={this.type}\n value={this.value}\n {...this.inheritedAttributes}\n />\n {this.button && (\n <br-button class=\"br-button\" circle>\n <slot name=\"action\"></slot>\n </br-button>\n )}\n </div>\n </Host>\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACvG,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGpF;;;;;;GAMG;AAOH,MAAM,OAAO,KAAK;;QAsJR,wBAAmB,GAAe,EAAE,CAAA;oBArIhC,MAAM;;yBAM4B,KAAK;uBAGQ,EAAE;wBAGhB,KAAK;sBAGP,KAAK;oBAGP,KAAK;sBAGH,KAAK;yBAEF,KAAK;uBAEP,KAAK;sBAEN,KAAK;oBAEP,KAAK;uBAEF,KAAK;;;;wBAYJ,KAAK;wBAGL,KAAK;;;IAOlD,iBAAiB;QACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAID,iBAAiB;QACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnC,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC3D,CAAC;IAID,gBAAgB;QACd,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpC,CAAC;IAID,mBAAmB;QACjB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IAID,kBAAkB;QAChB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtC,CAAC;IAID,qBAAqB;QACnB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAID,mBAAmB;QACjB,IAAI,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, h } from '@stencil/core'\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n *\n * Consulte a [documentação GovBR-DS](https://www.gov.br/ds/components/input?tab=designer) para mais detalhes.\n *\n * @slot action Define a ação interna\n *\n */\n@Component({\n tag: 'br-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input {\n /** Elemento host */\n @Element() el: HTMLInputElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /** Tipo de campo de entrada */\n @Prop({ reflect: true }) type:\n | 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'url' = 'text'\n\n /** Define o comportamento padrão do browser para autocomplete em formulários */\n @Prop({ reflect: true }) autocomplete: 'on' | 'off'\n\n /** Se definido como true, o campo de entrada receberá foco automaticamente quando o formulário for carregado */\n @Prop({ reflect: true }) autofocus: boolean = false\n\n /** Comportamento: densidade */\n @Prop({ reflect: true }) density: 'small' | 'large' | '' = ''\n\n /** Se definido como true, o campo de entrada é desabilitado e não pode ser interrompido. */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /** Define o label e input como comportamento inline */\n @Prop({ reflect: true }) inline: boolean = false\n\n /** Define se o input vai ser icon. Use o @slot icon para definir o ícone */\n @Prop({ reflect: true }) icon: boolean = false\n\n /** Define se o input vai ter um botão a direita */\n @Prop({ reflect: true }) button: boolean = false\n\n @Prop({ reflect: true }) highlight: boolean = false\n\n @Prop({ reflect: true }) success: boolean = false\n\n @Prop({ reflect: true }) danger: boolean = false\n\n @Prop({ reflect: true }) info: boolean = false\n\n @Prop({ reflect: true }) warning: boolean = false\n\n /** Label para o input */\n @Prop({ reflect: true }) label: string\n\n /** Nome do campo de entrada */\n @Prop({ reflect: true }) name: string\n\n /** Uma dica ou sugestão exibida dentro do campo de entrada quando ele está vazio */\n @Prop({ reflect: true }) placeholder: string\n\n /** Se definido como true, o valor do campo de entrada pode ser exibido, mas não editado pelo usuário. */\n @Prop({ reflect: true }) readonly: boolean = false\n\n /** Se definido como true, o campo de entrada deve ser preenchido antes que o formulário possa ser enviado. */\n @Prop({ reflect: true }) required: boolean = false\n\n /** Valor inicial a ser exibido no campo de entrada. */\n @Prop({ reflect: true, mutable: true }) value: string\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brConnectedCallback: EventEmitter<this>\n connectedCallback() {\n this.brConnectedCallback.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillLoad: EventEmitter<this>\n componentWillLoad() {\n this.brComponentWillLoad.emit(this)\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brComponentDidLoad.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillRender: EventEmitter<this>\n componentWillRender() {\n this.brComponentWillRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidRender: EventEmitter<this>\n componentDidRender() {\n this.brComponentDidRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brComponentShouldUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brComponentWillUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brComponentDidUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brDisconnectedCallback: EventEmitter<this>\n disconnectedCallback() {\n this.brDisconnectedCallback.emit(this)\n }\n\n /** Componente foi inserido em um `<form>` */\n @Event() formAssociatedCallback: EventEmitter<this>\n onFormAssociatedCallback(form) {\n this.formAssociatedCallback.emit(form)\n }\n\n /** Componente foi removido de um `<form>` */\n @Event() formDisassociatedCallback: EventEmitter<this>\n onFormDisassociatedCallback(form) {\n this.formDisassociatedCallback.emit(form)\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.button,\n large: this.density === 'large',\n small: this.density === 'small',\n 'input-inline': this.inline,\n 'input-highlight': this.highlight,\n success: this.success,\n danger: this.danger,\n info: this.info,\n warning: this.warning,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /** Valor atualizado do input */\n @Event() valueChange!: EventEmitter<string>\n\n private handleInput(event: Event) {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n {this.label && (\n <label class=\"text-nowrap\" htmlFor={this.el.id}>\n {this.label}\n </label>\n )}\n {this.icon && (\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n )}\n <input\n autocomplete={this.autocomplete}\n autofocus={this.autofocus}\n disabled={this.disabled}\n onInput={this.handleInput.bind(this)}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n title={this.el.title}\n type={this.type}\n value={this.value}\n {...this.inheritedAttributes}\n />\n {this.button && (\n <br-button class=\"br-button\" circle aria-label='botão de ação do ícone'>\n <slot name=\"action\"></slot>\n </br-button>\n )}\n </div>\n </Host>\n )\n }\n}\n"]}
|