@sankhyalabs/ezui 6.2.0-dev.2 → 6.2.0-dev.4
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/{app-globals-cdb08d04.js → app-globals-0a67e214.js} +3 -1
- package/dist/cjs/ez-classic-input.cjs.entry.js +318 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +86 -0
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +48 -7
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/index-a7b0c73d.js +8 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css +140 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.js +547 -0
- package/dist/collection/components/ez-classic-input/interfaces/optionsSetFocus.js +1 -0
- package/dist/collection/components/ez-classic-input/utils/maskFormatter.js +194 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css +179 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.js +479 -0
- package/dist/collection/components/ez-classic-text-area/interfaces/optionsSetFocus.js +1 -0
- package/dist/collection/components/ez-icon/ez-icon.css +23 -18
- package/dist/collection/components/ez-tree/ez-tree.css +4 -1
- package/dist/collection/components/ez-tree/ez-tree.js +21 -2
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +7 -1
- package/dist/collection/components/ez-tree/types/Tree.js +37 -3
- package/dist/collection/global/app-init.js +3 -1
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +454 -15
- package/dist/esm/{app-globals-8c57b015.js → app-globals-8a94d86c.js} +3 -1
- package/dist/esm/ez-classic-input.entry.js +314 -0
- package/dist/esm/ez-classic-text-area.entry.js +82 -0
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +48 -7
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/index-baa5e267.js +8 -0
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2d080bdc.entry.js +1 -0
- package/dist/ezui/p-48effc69.entry.js +1 -0
- package/dist/ezui/p-b2b1a1a7.entry.js +1 -0
- package/dist/ezui/p-e78e87f5.entry.js +1 -0
- package/dist/types/components/ez-classic-input/ez-classic-input.d.ts +78 -0
- package/dist/types/components/ez-classic-input/interfaces/optionsSetFocus.d.ts +4 -0
- package/dist/types/components/ez-classic-input/utils/maskFormatter.d.ts +30 -0
- package/dist/types/components/ez-classic-text-area/ez-classic-text-area.d.ts +61 -0
- package/dist/types/components/ez-classic-text-area/interfaces/optionsSetFocus.d.ts +4 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +4 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +2 -1
- package/dist/types/components.d.ts +372 -0
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-7eb6115c.entry.js +0 -1
- package/dist/ezui/p-e78b5a16.entry.js +0 -1
- /package/dist/ezui/{p-76ad2e26.js → p-07819d50.js} +0 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import { ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
|
+
export class EzClassicTextArea {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.name = StringUtils.generateUUID();
|
|
6
|
+
this.label = '';
|
|
7
|
+
this.placeholder = '';
|
|
8
|
+
this.value = '';
|
|
9
|
+
this.helpText = undefined;
|
|
10
|
+
this.state = "default";
|
|
11
|
+
this.enabled = true;
|
|
12
|
+
this.readonly = false;
|
|
13
|
+
this.maxlength = undefined;
|
|
14
|
+
this.resize = 'vertical';
|
|
15
|
+
this.leftIconName = undefined;
|
|
16
|
+
this.rightIconName = undefined;
|
|
17
|
+
this.rightIconTooltip = undefined;
|
|
18
|
+
this.leftIconTooltip = undefined;
|
|
19
|
+
this.leftIconClickable = false;
|
|
20
|
+
this.rightIconClickable = false;
|
|
21
|
+
this.rows = 5;
|
|
22
|
+
}
|
|
23
|
+
/** Aplica o foco no campo. */
|
|
24
|
+
async setFocus(option) {
|
|
25
|
+
if (option === null || option === void 0 ? void 0 : option.selectText) {
|
|
26
|
+
this._textAreaElem.select();
|
|
27
|
+
}
|
|
28
|
+
if (!(option === null || option === void 0 ? void 0 : option.preventScroll)) {
|
|
29
|
+
this._textAreaElem.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
30
|
+
}
|
|
31
|
+
this._textAreaElem.focus({ preventScroll: true });
|
|
32
|
+
}
|
|
33
|
+
/** Remove o foco do campo. */
|
|
34
|
+
async setBlur() {
|
|
35
|
+
this._textAreaElem.blur();
|
|
36
|
+
}
|
|
37
|
+
onBlur() {
|
|
38
|
+
this.ezBlur.emit(this.value);
|
|
39
|
+
}
|
|
40
|
+
handleInput(event) {
|
|
41
|
+
const target = event.target;
|
|
42
|
+
this.ezChange.emit(target.value);
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
handleIconClick(event, icon) {
|
|
46
|
+
if (!this.enabled) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if ((icon === "left" && !this.leftIconClickable) || (icon === "right" && !this.rightIconClickable)) {
|
|
50
|
+
this.setFocus({ preventScroll: true });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
this.iconClick.emit({ icon });
|
|
55
|
+
}
|
|
56
|
+
addInfoId() {
|
|
57
|
+
if (this._element) {
|
|
58
|
+
ElementIDUtils.addIDInfo(this._element);
|
|
59
|
+
}
|
|
60
|
+
if (this._textAreaElem) {
|
|
61
|
+
const dataInfo = { id: 'embedded' };
|
|
62
|
+
ElementIDUtils.addIDInfo(this._textAreaElem, 'classic-text-area', dataInfo);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
componentDidLoad() {
|
|
66
|
+
this.addInfoId();
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return (h(Host, null, this.label && (h("label", { title: this.label, htmlFor: this.name }, this.label)), h("div", { class: "text-area-container", "data-state": this.state, "data-disabled": (!this.enabled).toString(), "data-resize": this.resize, onClick: () => this.setFocus({ preventScroll: true }) }, this.leftIconName && (h("ez-icon", { iconName: this.leftIconName, title: this.leftIconTooltip, onClick: (event) => this.handleIconClick(event, "left"), class: { 'icon-clickable': this.leftIconClickable } })), h("textarea", { ref: (el) => (this._textAreaElem = el), id: this.name, name: this.name, placeholder: this.placeholder, value: this.value, disabled: !this.enabled, readOnly: this.readonly, maxLength: this.maxlength, rows: this.rows, onInput: this.handleInput.bind(this), onBlur: this.onBlur.bind(this) }), this.rightIconName && (h("ez-icon", { iconName: this.rightIconName, title: this.rightIconTooltip, onClick: (event) => this.handleIconClick(event, "right"), class: { 'icon-clickable': this.rightIconClickable } }))), this.helpText && (h("span", { title: this.helpText }, this.helpText))));
|
|
70
|
+
}
|
|
71
|
+
static get is() { return "ez-classic-text-area"; }
|
|
72
|
+
static get encapsulation() { return "shadow"; }
|
|
73
|
+
static get originalStyleUrls() {
|
|
74
|
+
return {
|
|
75
|
+
"$": ["ez-classic-text-area.css"]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static get styleUrls() {
|
|
79
|
+
return {
|
|
80
|
+
"$": ["ez-classic-text-area.css"]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
static get properties() {
|
|
84
|
+
return {
|
|
85
|
+
"name": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "string",
|
|
90
|
+
"resolved": "string",
|
|
91
|
+
"references": {}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": true,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [],
|
|
97
|
+
"text": "Nome da textarea"
|
|
98
|
+
},
|
|
99
|
+
"attribute": "name",
|
|
100
|
+
"reflect": false,
|
|
101
|
+
"defaultValue": "StringUtils.generateUUID()"
|
|
102
|
+
},
|
|
103
|
+
"label": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "string",
|
|
108
|
+
"resolved": "string",
|
|
109
|
+
"references": {}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": true,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": "Texto do r\u00F3tulo exibido acima da \u00E1rea de texto"
|
|
116
|
+
},
|
|
117
|
+
"attribute": "label",
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"defaultValue": "''"
|
|
120
|
+
},
|
|
121
|
+
"placeholder": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "string",
|
|
126
|
+
"resolved": "string",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": true,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Texto de placeholder exibido quando a \u00E1rea de texto est\u00E1 vazia"
|
|
134
|
+
},
|
|
135
|
+
"attribute": "placeholder",
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"defaultValue": "''"
|
|
138
|
+
},
|
|
139
|
+
"value": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"mutable": false,
|
|
142
|
+
"complexType": {
|
|
143
|
+
"original": "string",
|
|
144
|
+
"resolved": "string",
|
|
145
|
+
"references": {}
|
|
146
|
+
},
|
|
147
|
+
"required": false,
|
|
148
|
+
"optional": true,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Valor atual da \u00E1rea de texto"
|
|
152
|
+
},
|
|
153
|
+
"attribute": "value",
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"defaultValue": "''"
|
|
156
|
+
},
|
|
157
|
+
"helpText": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": true,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Texto de ajuda exibido abaixo da textarea"
|
|
170
|
+
},
|
|
171
|
+
"attribute": "help-text",
|
|
172
|
+
"reflect": false
|
|
173
|
+
},
|
|
174
|
+
"state": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"mutable": false,
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "\"default\" | \"error\" | \"success\" | \"warning\"",
|
|
179
|
+
"resolved": "\"default\" | \"error\" | \"success\" | \"warning\"",
|
|
180
|
+
"references": {}
|
|
181
|
+
},
|
|
182
|
+
"required": false,
|
|
183
|
+
"optional": true,
|
|
184
|
+
"docs": {
|
|
185
|
+
"tags": [],
|
|
186
|
+
"text": "Estado visual da textarea: default, error, success ou warning"
|
|
187
|
+
},
|
|
188
|
+
"attribute": "state",
|
|
189
|
+
"reflect": false,
|
|
190
|
+
"defaultValue": "\"default\""
|
|
191
|
+
},
|
|
192
|
+
"enabled": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": true,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": "Define se a textarea est\u00E1 habilitada"
|
|
205
|
+
},
|
|
206
|
+
"attribute": "enabled",
|
|
207
|
+
"reflect": false,
|
|
208
|
+
"defaultValue": "true"
|
|
209
|
+
},
|
|
210
|
+
"readonly": {
|
|
211
|
+
"type": "boolean",
|
|
212
|
+
"mutable": false,
|
|
213
|
+
"complexType": {
|
|
214
|
+
"original": "boolean",
|
|
215
|
+
"resolved": "boolean",
|
|
216
|
+
"references": {}
|
|
217
|
+
},
|
|
218
|
+
"required": false,
|
|
219
|
+
"optional": true,
|
|
220
|
+
"docs": {
|
|
221
|
+
"tags": [],
|
|
222
|
+
"text": "Se a \u00E1rea de texto \u00E9 somente leitura"
|
|
223
|
+
},
|
|
224
|
+
"attribute": "readonly",
|
|
225
|
+
"reflect": false,
|
|
226
|
+
"defaultValue": "false"
|
|
227
|
+
},
|
|
228
|
+
"maxlength": {
|
|
229
|
+
"type": "number",
|
|
230
|
+
"mutable": false,
|
|
231
|
+
"complexType": {
|
|
232
|
+
"original": "number",
|
|
233
|
+
"resolved": "number",
|
|
234
|
+
"references": {}
|
|
235
|
+
},
|
|
236
|
+
"required": false,
|
|
237
|
+
"optional": true,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [],
|
|
240
|
+
"text": "N\u00FAmero m\u00E1ximo de caracteres permitidos"
|
|
241
|
+
},
|
|
242
|
+
"attribute": "maxlength",
|
|
243
|
+
"reflect": false
|
|
244
|
+
},
|
|
245
|
+
"resize": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "'none' | 'both' | 'horizontal' | 'vertical'",
|
|
250
|
+
"resolved": "\"both\" | \"horizontal\" | \"none\" | \"vertical\"",
|
|
251
|
+
"references": {}
|
|
252
|
+
},
|
|
253
|
+
"required": false,
|
|
254
|
+
"optional": true,
|
|
255
|
+
"docs": {
|
|
256
|
+
"tags": [],
|
|
257
|
+
"text": "Comportamento de redimensionamento da \u00E1rea de texto"
|
|
258
|
+
},
|
|
259
|
+
"attribute": "resize",
|
|
260
|
+
"reflect": false,
|
|
261
|
+
"defaultValue": "'vertical'"
|
|
262
|
+
},
|
|
263
|
+
"leftIconName": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": "Nome do \u00EDcone \u00E0 esquerda"
|
|
276
|
+
},
|
|
277
|
+
"attribute": "left-icon-name",
|
|
278
|
+
"reflect": false
|
|
279
|
+
},
|
|
280
|
+
"rightIconName": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"mutable": false,
|
|
283
|
+
"complexType": {
|
|
284
|
+
"original": "string",
|
|
285
|
+
"resolved": "string",
|
|
286
|
+
"references": {}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": true,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "Nome do \u00EDcone \u00E0 direita"
|
|
293
|
+
},
|
|
294
|
+
"attribute": "right-icon-name",
|
|
295
|
+
"reflect": false
|
|
296
|
+
},
|
|
297
|
+
"rightIconTooltip": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"mutable": false,
|
|
300
|
+
"complexType": {
|
|
301
|
+
"original": "string",
|
|
302
|
+
"resolved": "string",
|
|
303
|
+
"references": {}
|
|
304
|
+
},
|
|
305
|
+
"required": false,
|
|
306
|
+
"optional": true,
|
|
307
|
+
"docs": {
|
|
308
|
+
"tags": [],
|
|
309
|
+
"text": "T\u00EDtulo do \u00EDcone \u00E0 direita (tooltip)"
|
|
310
|
+
},
|
|
311
|
+
"attribute": "right-icon-tooltip",
|
|
312
|
+
"reflect": false
|
|
313
|
+
},
|
|
314
|
+
"leftIconTooltip": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "string",
|
|
319
|
+
"resolved": "string",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": true,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "T\u00EDtulo do \u00EDcone \u00E0 esquerda (tooltip)"
|
|
327
|
+
},
|
|
328
|
+
"attribute": "left-icon-tooltip",
|
|
329
|
+
"reflect": false
|
|
330
|
+
},
|
|
331
|
+
"leftIconClickable": {
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"mutable": false,
|
|
334
|
+
"complexType": {
|
|
335
|
+
"original": "boolean",
|
|
336
|
+
"resolved": "boolean",
|
|
337
|
+
"references": {}
|
|
338
|
+
},
|
|
339
|
+
"required": false,
|
|
340
|
+
"optional": true,
|
|
341
|
+
"docs": {
|
|
342
|
+
"tags": [],
|
|
343
|
+
"text": "Define se o \u00EDcone da esquerda \u00E9 clic\u00E1vel"
|
|
344
|
+
},
|
|
345
|
+
"attribute": "left-icon-clickable",
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"defaultValue": "false"
|
|
348
|
+
},
|
|
349
|
+
"rightIconClickable": {
|
|
350
|
+
"type": "boolean",
|
|
351
|
+
"mutable": false,
|
|
352
|
+
"complexType": {
|
|
353
|
+
"original": "boolean",
|
|
354
|
+
"resolved": "boolean",
|
|
355
|
+
"references": {}
|
|
356
|
+
},
|
|
357
|
+
"required": false,
|
|
358
|
+
"optional": true,
|
|
359
|
+
"docs": {
|
|
360
|
+
"tags": [],
|
|
361
|
+
"text": "Define se o \u00EDcone da direita \u00E9 clic\u00E1vel"
|
|
362
|
+
},
|
|
363
|
+
"attribute": "right-icon-clickable",
|
|
364
|
+
"reflect": false,
|
|
365
|
+
"defaultValue": "false"
|
|
366
|
+
},
|
|
367
|
+
"rows": {
|
|
368
|
+
"type": "number",
|
|
369
|
+
"mutable": false,
|
|
370
|
+
"complexType": {
|
|
371
|
+
"original": "number",
|
|
372
|
+
"resolved": "number",
|
|
373
|
+
"references": {}
|
|
374
|
+
},
|
|
375
|
+
"required": false,
|
|
376
|
+
"optional": true,
|
|
377
|
+
"docs": {
|
|
378
|
+
"tags": [],
|
|
379
|
+
"text": "Define o n\u00FAmero de linhas da \u00E1rea de texto"
|
|
380
|
+
},
|
|
381
|
+
"attribute": "rows",
|
|
382
|
+
"reflect": false,
|
|
383
|
+
"defaultValue": "5"
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
static get events() {
|
|
388
|
+
return [{
|
|
389
|
+
"method": "ezChange",
|
|
390
|
+
"name": "ezChange",
|
|
391
|
+
"bubbles": true,
|
|
392
|
+
"cancelable": true,
|
|
393
|
+
"composed": true,
|
|
394
|
+
"docs": {
|
|
395
|
+
"tags": [],
|
|
396
|
+
"text": "Evento emitido quando o valor da \u00E1rea de texto muda"
|
|
397
|
+
},
|
|
398
|
+
"complexType": {
|
|
399
|
+
"original": "string",
|
|
400
|
+
"resolved": "string",
|
|
401
|
+
"references": {}
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
"method": "ezBlur",
|
|
405
|
+
"name": "ezBlur",
|
|
406
|
+
"bubbles": true,
|
|
407
|
+
"cancelable": true,
|
|
408
|
+
"composed": true,
|
|
409
|
+
"docs": {
|
|
410
|
+
"tags": [],
|
|
411
|
+
"text": "Evento emitido quando a \u00E1rea de texto perde foco"
|
|
412
|
+
},
|
|
413
|
+
"complexType": {
|
|
414
|
+
"original": "string",
|
|
415
|
+
"resolved": "string",
|
|
416
|
+
"references": {}
|
|
417
|
+
}
|
|
418
|
+
}, {
|
|
419
|
+
"method": "iconClick",
|
|
420
|
+
"name": "iconClick",
|
|
421
|
+
"bubbles": true,
|
|
422
|
+
"cancelable": true,
|
|
423
|
+
"composed": true,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "Evento disparado quando um \u00EDcone \u00E9 clicado.\nPayload: { icon: \"left\" | \"right\" }"
|
|
427
|
+
},
|
|
428
|
+
"complexType": {
|
|
429
|
+
"original": "{ icon: \"left\" | \"right\" }",
|
|
430
|
+
"resolved": "{ icon: \"left\" | \"right\"; }",
|
|
431
|
+
"references": {}
|
|
432
|
+
}
|
|
433
|
+
}];
|
|
434
|
+
}
|
|
435
|
+
static get methods() {
|
|
436
|
+
return {
|
|
437
|
+
"setFocus": {
|
|
438
|
+
"complexType": {
|
|
439
|
+
"signature": "(option?: OptionsSetFocus) => Promise<void>",
|
|
440
|
+
"parameters": [{
|
|
441
|
+
"tags": [],
|
|
442
|
+
"text": ""
|
|
443
|
+
}],
|
|
444
|
+
"references": {
|
|
445
|
+
"Promise": {
|
|
446
|
+
"location": "global"
|
|
447
|
+
},
|
|
448
|
+
"OptionsSetFocus": {
|
|
449
|
+
"location": "import",
|
|
450
|
+
"path": "./interfaces/optionsSetFocus"
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
"return": "Promise<void>"
|
|
454
|
+
},
|
|
455
|
+
"docs": {
|
|
456
|
+
"text": "Aplica o foco no campo.",
|
|
457
|
+
"tags": []
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
"setBlur": {
|
|
461
|
+
"complexType": {
|
|
462
|
+
"signature": "() => Promise<void>",
|
|
463
|
+
"parameters": [],
|
|
464
|
+
"references": {
|
|
465
|
+
"Promise": {
|
|
466
|
+
"location": "global"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"return": "Promise<void>"
|
|
470
|
+
},
|
|
471
|
+
"docs": {
|
|
472
|
+
"text": "Remove o foco do campo.",
|
|
473
|
+
"tags": []
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
static get elementRef() { return "_element"; }
|
|
479
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
position: relative;
|
|
5
5
|
/* @doc Define a cor do ícone. */
|
|
6
|
-
--ez-icon--color: var(--icon--color, #ffffff);
|
|
6
|
+
--ez-icon--color: var(--icon--color, var(--color--gray-70, #ffffff));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
svg {
|
|
@@ -14,28 +14,28 @@ svg {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.x-small {
|
|
17
|
-
width: 12px;
|
|
18
|
-
height: 12px;
|
|
17
|
+
width: var(--space--12, 12px);
|
|
18
|
+
height: var(--space--12, 12px);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.small {
|
|
22
|
-
width: 16px;
|
|
23
|
-
height: 16px;
|
|
22
|
+
width: var(--space--16, 16px);
|
|
23
|
+
height: var(--space--16, 16px);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.medium {
|
|
27
|
-
width: 20px;
|
|
28
|
-
height: 20px;
|
|
27
|
+
width: var(--space--20, 20px);
|
|
28
|
+
height: var(--space--20, 20px);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.large {
|
|
32
|
-
width: 24px;
|
|
33
|
-
height: 24px;
|
|
32
|
+
width: var(--space--24, 24px);
|
|
33
|
+
height: var(--space--24, 24px);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.x-large {
|
|
37
|
-
width: 30px;
|
|
38
|
-
height: 30px;
|
|
37
|
+
width: var(--space--30, 30px);
|
|
38
|
+
height: var(--space--30, 30px);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
[class^="ez-icon-"], [class*=" ez-icon-"] {
|
|
@@ -48,8 +48,8 @@ svg {
|
|
|
48
48
|
*/
|
|
49
49
|
[class^="ez-icon-"], [class*=" ez-icon-"] {
|
|
50
50
|
font-family: 'ez-icons' !important;
|
|
51
|
-
font-size:16px;
|
|
52
|
-
font-style:normal;
|
|
51
|
+
font-size: var(--font-size--medium, 16px);
|
|
52
|
+
font-style: normal;
|
|
53
53
|
-webkit-font-smoothing: antialiased;
|
|
54
54
|
-moz-osx-font-smoothing: grayscale;
|
|
55
55
|
}
|
|
@@ -1399,21 +1399,26 @@ svg {
|
|
|
1399
1399
|
*/
|
|
1400
1400
|
|
|
1401
1401
|
.x-small--font {
|
|
1402
|
-
font-size: 12px;
|
|
1402
|
+
font-size: var(--font-size--small, 12px);
|
|
1403
|
+
line-height: var(--line-height--16, 16px);
|
|
1403
1404
|
}
|
|
1404
1405
|
|
|
1405
1406
|
.small--font {
|
|
1406
|
-
font-size: 16px;
|
|
1407
|
+
font-size: var(--font-size--medium, 16px);
|
|
1408
|
+
line-height: var(--line-height--20, 20px);
|
|
1407
1409
|
}
|
|
1408
1410
|
|
|
1409
1411
|
.medium--font {
|
|
1410
|
-
font-size: 20px;
|
|
1412
|
+
font-size: var(--font-size--xlarge, 20px);
|
|
1413
|
+
line-height: var(--line-height--24, 24px);
|
|
1411
1414
|
}
|
|
1412
1415
|
|
|
1413
1416
|
.large--font {
|
|
1414
|
-
font-size: 24px;
|
|
1417
|
+
font-size: var(--font-size--xxxlarge, 24px);
|
|
1418
|
+
line-height: var(--line-height--28, 28px);
|
|
1415
1419
|
}
|
|
1416
1420
|
|
|
1417
1421
|
.x-large--font {
|
|
1418
|
-
font-size: 30px;
|
|
1422
|
+
font-size: var(--font-size--6xlarge, 30px);
|
|
1423
|
+
line-height: var(--line-height--34, 34px);
|
|
1419
1424
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/*@doc Define a margem do componente.*/
|
|
8
8
|
--ez-tree--margin: var(--space--extra-small, 3px);
|
|
9
9
|
/*@doc Define a margem da direita do componente.*/
|
|
10
|
-
--ez-tree--margin-right:
|
|
10
|
+
--ez-tree--margin-right: 0px;
|
|
11
11
|
|
|
12
12
|
/* Fontes e cor de ícones*/
|
|
13
13
|
/*@doc Define a família da fonte.*/
|
|
@@ -74,6 +74,7 @@ ul {
|
|
|
74
74
|
/*private*/
|
|
75
75
|
list-style-type: none;
|
|
76
76
|
margin: 0;
|
|
77
|
+
cursor: default;
|
|
77
78
|
|
|
78
79
|
/*public*/
|
|
79
80
|
padding-inline-start: var(--ez-tree--padding-inline-start);
|
|
@@ -122,12 +123,14 @@ ul.first-level {
|
|
|
122
123
|
.item-label-container {
|
|
123
124
|
display: flex;
|
|
124
125
|
align-items: center;
|
|
126
|
+
overflow: hidden;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
.tree-item {
|
|
128
130
|
/*private*/
|
|
129
131
|
display: flex;
|
|
130
132
|
align-items: center;
|
|
133
|
+
cursor: pointer;
|
|
131
134
|
|
|
132
135
|
/*public*/
|
|
133
136
|
margin-top: var(--ez-tree--margin);
|
|
@@ -7,7 +7,7 @@ import initI18n from '../../utils/i18n';
|
|
|
7
7
|
export class EzTree {
|
|
8
8
|
constructor() {
|
|
9
9
|
this._onItemClick = (item) => {
|
|
10
|
-
this.
|
|
10
|
+
this._onIconClick(item);
|
|
11
11
|
};
|
|
12
12
|
this._onIconClick = (item) => {
|
|
13
13
|
this.openClose(item);
|
|
@@ -20,6 +20,7 @@ export class EzTree {
|
|
|
20
20
|
this.selectedId = undefined;
|
|
21
21
|
this.iconResolver = defaultIconResolver;
|
|
22
22
|
this.tooltipResolver = undefined;
|
|
23
|
+
this.enableHierarchicalFilter = true;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Efetua a seleção de um item.
|
|
@@ -79,7 +80,7 @@ export class EzTree {
|
|
|
79
80
|
* Efetua a seleção de um item.
|
|
80
81
|
*/
|
|
81
82
|
async applyFilter(pattern) {
|
|
82
|
-
this._tree.setFilterPattern(pattern);
|
|
83
|
+
await this._tree.setFilterPattern(pattern, this.enableHierarchicalFilter);
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* Atualiza um item
|
|
@@ -396,6 +397,24 @@ export class EzTree {
|
|
|
396
397
|
"tags": [],
|
|
397
398
|
"text": "Define uma fun\u00E7\u00E3o que vai resolver o `tooltip` ou `title` daquele item."
|
|
398
399
|
}
|
|
400
|
+
},
|
|
401
|
+
"enableHierarchicalFilter": {
|
|
402
|
+
"type": "boolean",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "boolean",
|
|
406
|
+
"resolved": "boolean",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": false,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": "Define se a \u00E1rvore deve permitir a filtragem hier\u00E1rquica."
|
|
414
|
+
},
|
|
415
|
+
"attribute": "enable-hierarchical-filter",
|
|
416
|
+
"reflect": false,
|
|
417
|
+
"defaultValue": "true"
|
|
399
418
|
}
|
|
400
419
|
};
|
|
401
420
|
}
|
|
@@ -14,12 +14,18 @@ export const TreeItem = (props) => {
|
|
|
14
14
|
if (available) {
|
|
15
15
|
itemsList.push(treeItem);
|
|
16
16
|
}
|
|
17
|
+
function handleIconClick(event) {
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
if (available) {
|
|
20
|
+
iconClick(treeItem);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
17
23
|
return (h("ul", { class: level === 1 ? "first-level" : undefined }, h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem), onDblClick: () => available && itemDoubleClick(treeItem) }, {
|
|
18
24
|
disabled,
|
|
19
25
|
selected: treeItem.id === selectedId,
|
|
20
26
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezTreeItem_${treeItem.id}`)
|
|
21
27
|
}), h("div", { class: "item-label-container" }, h("div", { class: "item-icon-box" }, expandable &&
|
|
22
|
-
h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: () =>
|
|
28
|
+
h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: (event) => handleIconClick(event) })), h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)), getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)), expanded
|
|
23
29
|
&& node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList, itemDoubleClick: itemDoubleClick }))));
|
|
24
30
|
};
|
|
25
31
|
function getBadgeElement(itemId, badge, isSelectedItem) {
|