@sankhyalabs/ezui 1.1.124 → 1.1.127
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/{CSSVarsUtils-8fbdf2e0.js → CSSVarsUtils-1034b7b6.js} +2 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +22 -9
- package/dist/cjs/ez-combo-box.cjs.entry.js +7 -3
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +7 -4
- package/dist/cjs/ez-grid.cjs.entry.js +112 -22
- package/dist/cjs/ez-list.cjs.entry.js +6 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +13 -3
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/grid-config.cjs.entry.js +167 -31
- 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 +91 -83
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +49 -18
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +6 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +23 -1
- package/dist/collection/components/ez-form/ez-form.css +5 -0
- package/dist/collection/components/ez-form/structure/FormItem.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheet.js +1 -1
- 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 +117 -7
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +190 -37
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +3 -3
- package/dist/collection/components/ez-list/ez-list.js +23 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +15 -4
- package/dist/collection/components/ez-text-input/ez-text-input.css +4 -0
- package/dist/collection/utils/CSSVarsUtils.js +2 -0
- package/dist/custom-elements/index.js +341 -77
- package/dist/esm/{CSSVarsUtils-667e0016.js → CSSVarsUtils-eb4c5af6.js} +2 -0
- package/dist/esm/ez-collapsible-box.entry.js +23 -10
- package/dist/esm/ez-combo-box.entry.js +7 -3
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +7 -4
- package/dist/esm/ez-grid.entry.js +112 -22
- package/dist/esm/ez-list.entry.js +6 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +13 -3
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/grid-config.entry.js +167 -31
- 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-248d8511.entry.js} +1 -1
- package/dist/ezui/p-35edc488.entry.js +1 -0
- package/dist/ezui/{p-2d894fed.entry.js → p-5821c335.entry.js} +1 -1
- package/dist/ezui/p-5a9ab4f7.entry.js +1 -0
- package/dist/ezui/{p-e62f5c77.entry.js → p-5f725a93.entry.js} +1 -1
- package/dist/ezui/p-7d5657c7.entry.js +1 -0
- package/dist/ezui/p-7d5b2ebf.entry.js +1 -0
- package/dist/ezui/p-7f87f762.entry.js +1 -0
- package/dist/ezui/p-933a7475.js +1 -0
- package/dist/ezui/p-b59ab2d5.entry.js +1 -0
- package/dist/ezui/{p-1db59c89.entry.js → p-c6b2b2e5.entry.js} +1 -1
- package/dist/ezui/{p-0927092b.entry.js → p-cbfb94cb.entry.js} +1 -1
- package/dist/ezui/p-cf8309fc.entry.js +1 -0
- package/dist/ezui/{p-5e989ecf.entry.js → p-ec205792.entry.js} +1 -1
- package/dist/ezui/{p-8543a1b3.entry.js → p-ed1e0331.entry.js} +1 -1
- package/dist/ezui/{p-28ce145e.entry.js → p-f65302bb.entry.js} +1 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +12 -3
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -0
- 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 +44 -10
- package/package.json +3 -3
- package/dist/ezui/p-0965bcae.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-91e51dc9.entry.js +0 -1
- package/dist/ezui/p-9a9b2936.entry.js +0 -1
- package/dist/ezui/p-a44dcc62.entry.js +0 -1
- package/dist/ezui/p-c621cab9.entry.js +0 -1
- package/dist/ezui/p-d54c157f.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,24 +68,43 @@ 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
|
|
78
|
+
let selectedOption = "na";
|
|
79
|
+
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
80
|
+
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
81
|
+
}
|
|
61
82
|
return (h("div", null,
|
|
62
|
-
h("select-box", { selectedOption:
|
|
83
|
+
h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
63
84
|
}
|
|
64
|
-
updateOrder(sortOrder,
|
|
85
|
+
updateOrder(sortOrder, updatedItemLabel) {
|
|
86
|
+
var _a;
|
|
65
87
|
let newList = [...this.columns];
|
|
66
|
-
let newItem = newList.find(item => item.label ===
|
|
88
|
+
let newItem = newList.find(item => item.label === updatedItemLabel);
|
|
67
89
|
if (newItem) {
|
|
68
|
-
newItem.sort = sortOrder.value;
|
|
90
|
+
newItem.sort = sortOrder.value === "na" ? undefined : sortOrder.value;
|
|
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
|
+
});
|
|
69
108
|
}
|
|
70
109
|
this.columns = newList;
|
|
71
110
|
}
|
|
@@ -111,9 +150,100 @@ export class GridConfig {
|
|
|
111
150
|
newColumnList.push(newColumnItem);
|
|
112
151
|
});
|
|
113
152
|
});
|
|
114
|
-
this._columnListHistory = [];
|
|
115
153
|
this.columns = newColumnList;
|
|
116
|
-
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;
|
|
117
247
|
}
|
|
118
248
|
async locateColumn(evt, searchingText) {
|
|
119
249
|
var _a;
|
|
@@ -203,15 +333,14 @@ export class GridConfig {
|
|
|
203
333
|
return false;
|
|
204
334
|
}
|
|
205
335
|
closeConfig() {
|
|
206
|
-
this._columnListHistory = [];
|
|
207
336
|
this.configCancel.emit();
|
|
337
|
+
this._orderList.clearHistory();
|
|
208
338
|
}
|
|
209
339
|
/* Handlers */
|
|
210
340
|
handleTabChange(ev) {
|
|
211
341
|
var _a;
|
|
212
342
|
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
213
343
|
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
214
|
-
this._columnListHistory = this._columnList.dataSource;
|
|
215
344
|
this.createOrderList();
|
|
216
345
|
}
|
|
217
346
|
this.selectedTab = ev.target.selectedTab;
|
|
@@ -226,11 +355,18 @@ export class GridConfig {
|
|
|
226
355
|
}
|
|
227
356
|
}
|
|
228
357
|
}
|
|
358
|
+
handleOrderListChange(ev) {
|
|
359
|
+
if (ev.detail) {
|
|
360
|
+
let orderPriorityList = ev.detail;
|
|
361
|
+
if (orderPriorityList) {
|
|
362
|
+
this._orderPriorityList = orderPriorityList;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
229
366
|
componentWillRender() {
|
|
230
367
|
var _a;
|
|
231
368
|
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
232
369
|
this.createColumnList();
|
|
233
|
-
this.createOrderList();
|
|
234
370
|
}
|
|
235
371
|
}
|
|
236
372
|
componentDidRender() {
|
|
@@ -256,7 +392,7 @@ export class GridConfig {
|
|
|
256
392
|
h("div", { class: "grid-config__main" },
|
|
257
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 }),
|
|
258
394
|
h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"),
|
|
259
|
-
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) })),
|
|
260
396
|
h("div", { class: "grid-config__footer" },
|
|
261
397
|
h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }),
|
|
262
398
|
h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
|
|
@@ -311,6 +447,26 @@ export class GridConfig {
|
|
|
311
447
|
"tags": [],
|
|
312
448
|
"text": ""
|
|
313
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
|
+
}
|
|
314
470
|
}
|
|
315
471
|
}; }
|
|
316
472
|
static get events() { return [{
|
|
@@ -324,13 +480,10 @@ export class GridConfig {
|
|
|
324
480
|
"text": ""
|
|
325
481
|
},
|
|
326
482
|
"complexType": {
|
|
327
|
-
"original": "
|
|
328
|
-
"resolved": "
|
|
483
|
+
"original": "EzGridConfig",
|
|
484
|
+
"resolved": "EzGridConfig",
|
|
329
485
|
"references": {
|
|
330
|
-
"
|
|
331
|
-
"location": "global"
|
|
332
|
-
},
|
|
333
|
-
"EzGridColumn": {
|
|
486
|
+
"EzGridConfig": {
|
|
334
487
|
"location": "import",
|
|
335
488
|
"path": "../../controller/EzGridController"
|
|
336
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: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true },
|
|
7
|
+
return (h("ez-combo-box", { class: "grid-config-combo 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")));
|
|
@@ -23,7 +23,7 @@ export class SelectBox {
|
|
|
23
23
|
"type": "string",
|
|
24
24
|
"mutable": false,
|
|
25
25
|
"complexType": {
|
|
26
|
-
"original": "Option|string",
|
|
26
|
+
"original": "Option | string",
|
|
27
27
|
"resolved": "Option | string",
|
|
28
28
|
"references": {
|
|
29
29
|
"Option": {
|
|
@@ -39,7 +39,7 @@ export class SelectBox {
|
|
|
39
39
|
},
|
|
40
40
|
"attribute": "selected-option",
|
|
41
41
|
"reflect": false,
|
|
42
|
-
"defaultValue": "{value: \"na\", label: \"N/A\"}"
|
|
42
|
+
"defaultValue": "{ value: \"na\", label: \"N/A\" }"
|
|
43
43
|
}
|
|
44
44
|
}; }
|
|
45
45
|
static get events() { return [{
|
|
@@ -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>",
|
|
@@ -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",
|
|
@@ -4,6 +4,8 @@ export default class CSSVarsUtils {
|
|
|
4
4
|
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
|
|
5
5
|
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
|
|
6
6
|
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
|
|
7
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--background-color');
|
|
8
|
+
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--color');
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
static applyIfExists(host, element, varName) {
|