@sankhyalabs/ezui 1.1.125 → 1.1.128
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/ez-collapsible-box.cjs.entry.js +22 -9
- package/dist/cjs/ez-form.cjs.entry.js +18 -15
- package/dist/cjs/ez-grid.cjs.entry.js +115 -25
- package/dist/cjs/ez-list.cjs.entry.js +6 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-area.cjs.entry.js +13 -3
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/grid-config.cjs.entry.js +164 -32
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/select-box.cjs.entry.js +1 -1
- package/dist/collection/components/ez-check/ez-check.js +1 -1
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +92 -83
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +52 -21
- package/dist/collection/components/ez-form/ez-form.css +5 -0
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/structure/FormItem.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheet.js +2 -2
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +4 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +38 -18
- package/dist/collection/components/ez-grid/ez-grid.js +124 -14
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +188 -39
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +1 -1
- package/dist/collection/components/ez-list/ez-list.js +23 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +1 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +1 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +15 -4
- package/dist/custom-elements/index.js +344 -90
- package/dist/esm/ez-collapsible-box.entry.js +23 -10
- package/dist/esm/ez-form.entry.js +18 -15
- package/dist/esm/ez-grid.entry.js +115 -25
- package/dist/esm/ez-list.entry.js +6 -0
- package/dist/esm/ez-tabselector.entry.js +2 -2
- package/dist/esm/ez-text-area.entry.js +13 -3
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/grid-config.entry.js +164 -32
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select-box.entry.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-4262a462.entry.js → p-2d165ca8.entry.js} +1 -1
- package/dist/ezui/p-47fe4273.entry.js +1 -0
- package/dist/ezui/p-5a9ab4f7.entry.js +1 -0
- package/dist/ezui/p-5b7405e8.entry.js +1 -0
- package/dist/ezui/p-66adbed5.entry.js +1 -0
- package/dist/ezui/p-6d39b7ea.entry.js +1 -0
- package/dist/ezui/p-7d5b2ebf.entry.js +1 -0
- package/dist/ezui/p-ef17f443.entry.js +1 -0
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +13 -5
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +35 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -3
- package/dist/types/components/ez-grid/ez-grid.d.ts +14 -3
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +10 -4
- package/dist/types/components/ez-list/ez-list.d.ts +5 -0
- package/dist/types/components.d.ts +36 -10
- package/package.json +2 -2
- package/dist/ezui/p-1c28d99b.entry.js +0 -1
- package/dist/ezui/p-35edc488.entry.js +0 -1
- package/dist/ezui/p-46d1340b.entry.js +0 -1
- package/dist/ezui/p-6745931a.entry.js +0 -1
- package/dist/ezui/p-7ee0ff27.entry.js +0 -1
- package/dist/ezui/p-91e51dc9.entry.js +0 -1
- package/dist/ezui/p-c621cab9.entry.js +0 -1
|
@@ -1,32 +1,52 @@
|
|
|
1
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
1
2
|
import { Component, Event, h, Host, Prop } from '@stencil/core';
|
|
2
3
|
import { getSpritePath } from '../../../../utils/AssetsUtils';
|
|
3
|
-
import { StringUtils } from '@sankhyalabs/core';
|
|
4
4
|
export class GridConfig {
|
|
5
5
|
constructor() {
|
|
6
|
-
this._columnListHistory = [];
|
|
7
6
|
this._orderListItems = [];
|
|
7
|
+
this._orderPriorityList = [];
|
|
8
8
|
this._columListItems = [];
|
|
9
|
-
this.selectedTab = "Colunas";
|
|
10
9
|
this._selectedIndex = -1;
|
|
10
|
+
this.selectedTab = "Colunas";
|
|
11
11
|
}
|
|
12
12
|
/* Creation Methods */
|
|
13
13
|
createOrderList() {
|
|
14
|
-
var _a;
|
|
15
14
|
let newList = [];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
this.columns.forEach(column => {
|
|
16
|
+
var _a;
|
|
17
|
+
let configItem = (_a = this.config) === null || _a === void 0 ? void 0 : _a.columns.find(item => item.name === column.name);
|
|
18
|
+
let item = { name: column.name, label: column.label };
|
|
19
|
+
if (configItem) {
|
|
20
|
+
item['orderIndex'] = configItem.orderIndex;
|
|
21
|
+
item['ascending'] = configItem.ascending;
|
|
22
|
+
}
|
|
23
|
+
if (!column.hidden) {
|
|
19
24
|
newList.push(item);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
newList.sort((a, b) => {
|
|
28
|
+
//OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
|
|
29
|
+
if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
|
|
30
|
+
if (a.ascending != undefined)
|
|
31
|
+
return -1;
|
|
32
|
+
if (b.ascending != undefined)
|
|
33
|
+
return 1;
|
|
34
|
+
return 0;
|
|
35
|
+
//Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
|
|
36
|
+
}
|
|
37
|
+
else if (a.ascending != undefined && b.ascending != undefined) {
|
|
38
|
+
return (a.orderIndex - b.orderIndex);
|
|
39
|
+
//Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
|
|
40
|
+
}
|
|
41
|
+
else if (a.ascending != undefined || b.ascending != undefined) {
|
|
42
|
+
if (a.ascending != undefined)
|
|
43
|
+
return -1;
|
|
44
|
+
if (b.ascending != undefined)
|
|
45
|
+
return 1;
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
return (a.orderIndex - b.orderIndex);
|
|
49
|
+
});
|
|
30
50
|
this._orderListItems = newList;
|
|
31
51
|
}
|
|
32
52
|
createColumnList() {
|
|
@@ -48,29 +68,44 @@ export class GridConfig {
|
|
|
48
68
|
visibleGroup.items.push(item);
|
|
49
69
|
}
|
|
50
70
|
});
|
|
51
|
-
|
|
52
|
-
this._columListItems = [visibleGroup, hiddenGroup];
|
|
53
|
-
}
|
|
71
|
+
this._columListItems = [visibleGroup, hiddenGroup];
|
|
54
72
|
}
|
|
55
73
|
buildColumnListSlot(item, group) {
|
|
56
74
|
return (h("div", null,
|
|
57
75
|
h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
|
|
58
76
|
}
|
|
59
77
|
buildOrderListSlot(item) {
|
|
60
|
-
let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
|
|
61
78
|
let selectedOption = "na";
|
|
62
|
-
if (
|
|
63
|
-
selectedOption =
|
|
79
|
+
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
80
|
+
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
64
81
|
}
|
|
65
82
|
return (h("div", null,
|
|
66
|
-
h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
|
|
83
|
+
h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
67
84
|
}
|
|
68
|
-
updateOrder(sortOrder,
|
|
85
|
+
updateOrder(sortOrder, updatedItemLabel) {
|
|
86
|
+
var _a;
|
|
69
87
|
let newList = [...this.columns];
|
|
70
|
-
let newItem = newList.find(item => item.label ===
|
|
88
|
+
let newItem = newList.find(item => item.label === updatedItemLabel);
|
|
71
89
|
if (newItem) {
|
|
72
90
|
newItem.sort = sortOrder.value === "na" ? undefined : sortOrder.value;
|
|
73
91
|
}
|
|
92
|
+
let orderArray;
|
|
93
|
+
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
94
|
+
this._orderPriorityList.find(item => item.label === newItem.label).sort = sortOrder;
|
|
95
|
+
this._orderPriorityList.filter(item => item.sort).map((item, index) => {
|
|
96
|
+
if (item.label === newItem.label) {
|
|
97
|
+
newItem.sortIndex = index;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
orderArray = newList.filter(item => item.sort && item.hidden !== true).map((item, index) => {
|
|
103
|
+
return { label: item.label, orderIndex: index };
|
|
104
|
+
});
|
|
105
|
+
orderArray.forEach(element => {
|
|
106
|
+
newList.find(item => item.label === element.label).sortIndex = element.orderIndex;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
74
109
|
this.columns = newList;
|
|
75
110
|
}
|
|
76
111
|
/* Actions Methods */
|
|
@@ -115,9 +150,100 @@ export class GridConfig {
|
|
|
115
150
|
newColumnList.push(newColumnItem);
|
|
116
151
|
});
|
|
117
152
|
});
|
|
118
|
-
this._columnListHistory = [];
|
|
119
153
|
this.columns = newColumnList;
|
|
120
|
-
this.
|
|
154
|
+
this.save();
|
|
155
|
+
}
|
|
156
|
+
save() {
|
|
157
|
+
var _a;
|
|
158
|
+
let _newConfig;
|
|
159
|
+
if (this.config) {
|
|
160
|
+
_newConfig = this.config;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
_newConfig = this.createConfigFromState(this.columns);
|
|
164
|
+
}
|
|
165
|
+
let _newColumnConfigList = [];
|
|
166
|
+
let orderArray;
|
|
167
|
+
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
168
|
+
orderArray = this.columns.filter(item => item.sort && item.hidden !== true).map((item) => {
|
|
169
|
+
return { label: item.label, orderIndex: 0 };
|
|
170
|
+
});
|
|
171
|
+
let indexCount = 0;
|
|
172
|
+
let newOrderArray = [];
|
|
173
|
+
this._orderPriorityList.forEach((orderPriorityItem) => {
|
|
174
|
+
let item = orderArray.find(column => column.label === orderPriorityItem.label);
|
|
175
|
+
if (item) {
|
|
176
|
+
item.orderIndex = indexCount;
|
|
177
|
+
newOrderArray.push(item);
|
|
178
|
+
indexCount++;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
if (newOrderArray.length > 0) {
|
|
182
|
+
orderArray = newOrderArray;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
186
|
+
const column = this.columns[i];
|
|
187
|
+
let _newColumnConfig = _newConfig.columns.find(_newColumnConfig => column.name === _newColumnConfig.name);
|
|
188
|
+
if (column.hidden === true && _newColumnConfig) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (_newColumnConfig) {
|
|
192
|
+
_newColumnConfig.width = column.width;
|
|
193
|
+
}
|
|
194
|
+
else if (column.hidden === false) {
|
|
195
|
+
_newColumnConfig = { name: column.name, width: column.width, orderIndex: 0 };
|
|
196
|
+
}
|
|
197
|
+
if (_newColumnConfig) {
|
|
198
|
+
if (column.sort) {
|
|
199
|
+
_newColumnConfig.ascending = column.sort.toUpperCase() === "ASC" ? true : false;
|
|
200
|
+
if (orderArray) {
|
|
201
|
+
adjustPriorityOrder(column, _newColumnConfig);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
_newColumnConfig.orderIndex = column.sortIndex;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
delete _newColumnConfig.ascending;
|
|
209
|
+
_newColumnConfig.orderIndex = 0;
|
|
210
|
+
}
|
|
211
|
+
_newColumnConfigList.push(_newColumnConfig);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
_newConfig.columns = _newColumnConfigList;
|
|
215
|
+
this.configFinish.emit(_newConfig);
|
|
216
|
+
this._orderList.clearHistory();
|
|
217
|
+
function adjustPriorityOrder(column, _newColumnConfig) {
|
|
218
|
+
if (orderArray) {
|
|
219
|
+
let orderItem = orderArray.find(item => item.label === column.label);
|
|
220
|
+
if (orderItem) {
|
|
221
|
+
_newColumnConfig.orderIndex = orderItem.orderIndex;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
createConfigFromState(state) {
|
|
227
|
+
let newConfig = { columns: [] };
|
|
228
|
+
state.forEach(columnState => {
|
|
229
|
+
if (!columnState.hidden) {
|
|
230
|
+
let newConfigColumn = { name: columnState.name };
|
|
231
|
+
if (columnState.width) {
|
|
232
|
+
newConfigColumn['width'] = columnState.width;
|
|
233
|
+
}
|
|
234
|
+
if (columnState.sort) {
|
|
235
|
+
newConfigColumn['ascending'] = (columnState.sort.toUpperCase() === 'ASC');
|
|
236
|
+
newConfigColumn['orderIndex'] = columnState.sortIndex;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
newConfigColumn['orderIndex'] = 0;
|
|
240
|
+
}
|
|
241
|
+
if (newConfigColumn) {
|
|
242
|
+
newConfig.columns.push(newConfigColumn);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
return newConfig;
|
|
121
247
|
}
|
|
122
248
|
async locateColumn(evt, searchingText) {
|
|
123
249
|
var _a;
|
|
@@ -207,15 +333,14 @@ export class GridConfig {
|
|
|
207
333
|
return false;
|
|
208
334
|
}
|
|
209
335
|
closeConfig() {
|
|
210
|
-
this._columnListHistory = [];
|
|
211
336
|
this.configCancel.emit();
|
|
337
|
+
this._orderList.clearHistory();
|
|
212
338
|
}
|
|
213
339
|
/* Handlers */
|
|
214
340
|
handleTabChange(ev) {
|
|
215
341
|
var _a;
|
|
216
342
|
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
217
343
|
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
218
|
-
this._columnListHistory = this._columnList.dataSource;
|
|
219
344
|
this.createOrderList();
|
|
220
345
|
}
|
|
221
346
|
this.selectedTab = ev.target.selectedTab;
|
|
@@ -230,11 +355,18 @@ export class GridConfig {
|
|
|
230
355
|
}
|
|
231
356
|
}
|
|
232
357
|
}
|
|
358
|
+
handleOrderListChange(ev) {
|
|
359
|
+
if (ev.detail) {
|
|
360
|
+
let orderPriorityList = ev.detail;
|
|
361
|
+
if (orderPriorityList) {
|
|
362
|
+
this._orderPriorityList = orderPriorityList;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
233
366
|
componentWillRender() {
|
|
234
367
|
var _a;
|
|
235
368
|
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
236
369
|
this.createColumnList();
|
|
237
|
-
this.createOrderList();
|
|
238
370
|
}
|
|
239
371
|
}
|
|
240
372
|
componentDidRender() {
|
|
@@ -260,10 +392,10 @@ export class GridConfig {
|
|
|
260
392
|
h("div", { class: "grid-config__main" },
|
|
261
393
|
h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }),
|
|
262
394
|
h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"),
|
|
263
|
-
h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
|
|
395
|
+
h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, onEzChange: ev => this.handleOrderListChange(ev), ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
|
|
264
396
|
h("div", { class: "grid-config__footer" },
|
|
265
397
|
h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }),
|
|
266
|
-
h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
|
|
398
|
+
h("ez-button", { label: "Concluir", class: "ez-button--primary", onClick: () => this.finish() }))));
|
|
267
399
|
}
|
|
268
400
|
static get is() { return "grid-config"; }
|
|
269
401
|
static get encapsulation() { return "scoped"; }
|
|
@@ -315,6 +447,26 @@ export class GridConfig {
|
|
|
315
447
|
"tags": [],
|
|
316
448
|
"text": ""
|
|
317
449
|
}
|
|
450
|
+
},
|
|
451
|
+
"config": {
|
|
452
|
+
"type": "unknown",
|
|
453
|
+
"mutable": true,
|
|
454
|
+
"complexType": {
|
|
455
|
+
"original": "EzGridConfig",
|
|
456
|
+
"resolved": "EzGridConfig",
|
|
457
|
+
"references": {
|
|
458
|
+
"EzGridConfig": {
|
|
459
|
+
"location": "import",
|
|
460
|
+
"path": "../../controller/EzGridController"
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
"required": false,
|
|
465
|
+
"optional": false,
|
|
466
|
+
"docs": {
|
|
467
|
+
"tags": [],
|
|
468
|
+
"text": ""
|
|
469
|
+
}
|
|
318
470
|
}
|
|
319
471
|
}; }
|
|
320
472
|
static get events() { return [{
|
|
@@ -328,13 +480,10 @@ export class GridConfig {
|
|
|
328
480
|
"text": ""
|
|
329
481
|
},
|
|
330
482
|
"complexType": {
|
|
331
|
-
"original": "
|
|
332
|
-
"resolved": "
|
|
483
|
+
"original": "EzGridConfig",
|
|
484
|
+
"resolved": "EzGridConfig",
|
|
333
485
|
"references": {
|
|
334
|
-
"
|
|
335
|
-
"location": "global"
|
|
336
|
-
},
|
|
337
|
-
"EzGridColumn": {
|
|
486
|
+
"EzGridConfig": {
|
|
338
487
|
"location": "import",
|
|
339
488
|
"path": "../../controller/EzGridController"
|
|
340
489
|
}
|
|
@@ -4,7 +4,7 @@ export class SelectBox {
|
|
|
4
4
|
this.selectedOption = { value: "na", label: "N/A" };
|
|
5
5
|
}
|
|
6
6
|
render() {
|
|
7
|
-
return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", suppressSearch: true, value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true },
|
|
7
|
+
return (h("ez-combo-box", { class: "grid-config-combo ez-input--inverted", label: "", suppressSearch: true, value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true },
|
|
8
8
|
h("option", { value: "na" }, "N/A"),
|
|
9
9
|
h("option", { value: "asc" }, "A-Z"),
|
|
10
10
|
h("option", { value: "desc" }, "Z-A")));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, Event, h, Host, Method, Prop, State } from '@stencil/core';
|
|
2
2
|
;
|
|
3
3
|
;
|
|
4
4
|
export class EzList {
|
|
@@ -46,6 +46,12 @@ export class EzList {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
+
* Responsável por limpar a lista de histórico do componente.
|
|
50
|
+
*/
|
|
51
|
+
async clearHistory() {
|
|
52
|
+
this._listItemsHistory = [];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
49
55
|
* Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
|
|
50
56
|
*/
|
|
51
57
|
async setSelection(selectedItem, scrollToOption) {
|
|
@@ -636,6 +642,22 @@ export class EzList {
|
|
|
636
642
|
}
|
|
637
643
|
}]; }
|
|
638
644
|
static get methods() { return {
|
|
645
|
+
"clearHistory": {
|
|
646
|
+
"complexType": {
|
|
647
|
+
"signature": "() => Promise<void>",
|
|
648
|
+
"parameters": [],
|
|
649
|
+
"references": {
|
|
650
|
+
"Promise": {
|
|
651
|
+
"location": "global"
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
"return": "Promise<void>"
|
|
655
|
+
},
|
|
656
|
+
"docs": {
|
|
657
|
+
"text": "Respons\u00E1vel por limpar a lista de hist\u00F3rico do componente.",
|
|
658
|
+
"tags": []
|
|
659
|
+
}
|
|
660
|
+
},
|
|
639
661
|
"setSelection": {
|
|
640
662
|
"complexType": {
|
|
641
663
|
"signature": "(selectedItem: ListItem, scrollToOption?: boolean) => Promise<void>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
-webkit-mask-image: linear-gradient(90deg, transparent 20px, #000 48px);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.scroll.
|
|
36
|
+
.scroll.middle {
|
|
37
37
|
-webkit-mask-image: linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px));
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -129,7 +129,7 @@ export class EzTabselector {
|
|
|
129
129
|
else {
|
|
130
130
|
this._forwardButton.classList.add("hidden");
|
|
131
131
|
}
|
|
132
|
-
const classNames = ["", "startHidden", "endHidden", "
|
|
132
|
+
const classNames = ["", "startHidden", "endHidden", "middle"];
|
|
133
133
|
const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
134
134
|
classNames.forEach((name) => {
|
|
135
135
|
if (name !== currentClass && container.classList.contains(name)) {
|
|
@@ -5,6 +5,10 @@ export class EzTextArea {
|
|
|
5
5
|
* Deixa o campo disponível ou não para digitação.
|
|
6
6
|
*/
|
|
7
7
|
this.enabled = true;
|
|
8
|
+
/**
|
|
9
|
+
* Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
|
|
10
|
+
*/
|
|
11
|
+
this.rows = 4;
|
|
8
12
|
/**
|
|
9
13
|
* Permite exibir a mensagem de erro.
|
|
10
14
|
*/
|
|
@@ -36,11 +40,17 @@ export class EzTextArea {
|
|
|
36
40
|
if (this._initialRows == undefined) {
|
|
37
41
|
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
38
42
|
}
|
|
39
|
-
|
|
43
|
+
const rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
|
|
44
|
+
if (rows !== this.rows) {
|
|
45
|
+
this.rows = rows;
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
adjustRowsValue() {
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
50
|
+
if (rows !== this.rows) {
|
|
51
|
+
this.rows = rows;
|
|
52
|
+
this._initialRows = rows;
|
|
53
|
+
}
|
|
44
54
|
}
|
|
45
55
|
adjustFloatingLabel() {
|
|
46
56
|
if (this.label && this._labelElem) {
|
|
@@ -225,7 +235,8 @@ export class EzTextArea {
|
|
|
225
235
|
"text": "Ajusta o n\u00FAmero de linhas e consequentemente o height do textarea. Valor default: 4"
|
|
226
236
|
},
|
|
227
237
|
"attribute": "rows",
|
|
228
|
-
"reflect": true
|
|
238
|
+
"reflect": true,
|
|
239
|
+
"defaultValue": "4"
|
|
229
240
|
},
|
|
230
241
|
"canShowError": {
|
|
231
242
|
"type": "boolean",
|