@sankhyalabs/ezui 1.1.76 → 1.1.77
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/ApplicationUtils-d1c1db56.js +35 -0
- package/dist/cjs/AssetsUtils-dd585fba.js +24 -0
- package/dist/cjs/DataUnit-fdd7c70e.js +474 -0
- package/dist/cjs/DateUtils-716769e0.js +46 -0
- package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +28 -0
- package/dist/cjs/ez-button_11.cjs.entry.js +111771 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +212 -0
- package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +630 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +250 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +144 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1838 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +61 -190
- package/dist/cjs/ez-popover.cjs.entry.js +3 -3
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-time-input.cjs.entry.js +9 -27
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/form-metadata.cjs.entry.js +129 -0
- package/dist/cjs/index-262d703b.js +7442 -0
- package/dist/cjs/{index-9431aeeb.js → index-4e4bae01.js} +1 -5
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +8 -3
- package/dist/collection/components/ez-application/ez-application.css +3 -0
- package/dist/collection/components/ez-application/ez-application.js +37 -0
- package/dist/collection/components/ez-button/ez-button.css +16 -1
- package/dist/collection/components/ez-button/ez-button.js +27 -2
- package/dist/collection/components/ez-calendar/ez-calendar.css +70 -3
- package/dist/collection/components/ez-calendar/ez-calendar.js +168 -24
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +3 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +67 -51
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +49 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +254 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +4 -4
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +2 -2
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +21 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +203 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +41 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +75 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js +69 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +12 -0
- package/dist/collection/components/ez-grid/ez-grid.css +15 -0
- package/dist/collection/components/ez-grid/ez-grid.js +414 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +105 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +354 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +7 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +66 -0
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-list/ez-list.css +227 -44
- package/dist/collection/components/ez-list/ez-list.js +529 -149
- package/dist/collection/components/ez-modal/ez-modal.css +4 -4
- package/dist/collection/components/ez-modal/ez-modal.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.css +7 -162
- package/dist/collection/components/ez-number-input/ez-number-input.js +90 -281
- package/dist/collection/components/ez-popover/ez-popover.css +10 -6
- package/dist/collection/components/ez-popup/ez-popup.css +25 -27
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +3 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +1 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +1 -0
- package/dist/collection/components/ez-upload/ez-upload.js +3 -3
- package/dist/collection/components/test-du/test-du.css +3 -0
- package/dist/collection/components/test-du/test-du.js +45 -0
- package/dist/collection/servidor.js +94 -94
- package/dist/collection/utils/{Application.js → ApplicationUtils.js} +4 -4
- package/dist/custom-elements/index.d.ts +36 -6
- package/dist/custom-elements/index.js +120975 -3013
- package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
- package/dist/esm/AssetsUtils-3803e935.js +22 -0
- package/dist/esm/DataUnit-1cd45202.js +464 -0
- package/dist/esm/DateUtils-0a1bbd7a.js +44 -0
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +24 -0
- package/dist/esm/ez-button_11.entry.js +111757 -0
- package/dist/esm/ez-calendar.entry.js +208 -0
- package/dist/esm/ez-collapsible-box_6.entry.js +621 -0
- package/dist/esm/ez-combo-box.entry.js +246 -0
- package/dist/esm/ez-date-time-input.entry.js +140 -0
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1834 -0
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +61 -190
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +3 -21
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/form-metadata.entry.js +125 -0
- package/dist/esm/{index-fd3c8023.js → index-1dacecd3.js} +1 -5
- package/dist/esm/index-cfd5e193.js +7433 -0
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1ea8187e.entry.js +369 -0
- package/dist/ezui/p-37a611ea.js +1 -0
- package/dist/ezui/p-45689464.entry.js +1 -0
- package/dist/ezui/{p-a0b6eee2.entry.js → p-516d0e0f.entry.js} +1 -1
- package/dist/ezui/p-57291f97.entry.js +1 -0
- package/dist/ezui/{p-66954a04.entry.js → p-5a86e18a.entry.js} +1 -1
- package/dist/ezui/{p-823ff0a0.entry.js → p-5da66d3e.entry.js} +1 -1
- package/dist/ezui/p-69416bec.entry.js +1 -0
- package/dist/ezui/p-7107d7ef.js +1 -0
- package/dist/ezui/p-7ef97c5f.entry.js +1 -0
- package/dist/ezui/p-88f45a83.entry.js +1 -0
- package/dist/ezui/p-8c51a6aa.entry.js +1 -0
- package/dist/ezui/{p-e0ab3746.js → p-8f4851a6.js} +1 -1
- package/dist/ezui/p-9dfd537e.js +1 -0
- package/dist/ezui/{p-d443f020.entry.js → p-a18a2d7b.entry.js} +1 -1
- package/dist/ezui/p-a223eed8.entry.js +1 -0
- package/dist/ezui/p-b36308e7.js +1 -0
- package/dist/ezui/p-c0af195b.entry.js +1 -0
- package/dist/ezui/p-c6d469fc.entry.js +1 -0
- package/dist/ezui/p-c89629eb.js +1 -0
- package/dist/ezui/p-e7ee2836.entry.js +1 -0
- package/dist/ezui/p-f7b835cf.entry.js +1 -0
- package/dist/types/components/ez-application/ez-application.d.ts +12 -0
- package/dist/types/components/ez-button/ez-button.d.ts +5 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +21 -0
- package/dist/types/components/ez-check/ez-check.d.ts +1 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +42 -0
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +8 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +195 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +34 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +8 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +78 -0
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +30 -0
- package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +9 -0
- package/dist/types/components/ez-list/ez-list.d.ts +70 -17
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +33 -50
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +1 -1
- package/dist/types/components/test-du/test-du.d.ts +6 -0
- package/dist/types/components.d.ts +283 -117
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/{Application.d.ts → ApplicationUtils.d.ts} +1 -1
- package/package.json +10 -8
- package/react/components.d.ts +6 -1
- package/react/components.js +6 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/RequestMetadata-2cd01e8a.js +0 -531
- package/dist/cjs/ez-button_16.cjs.entry.js +0 -4079
- package/dist/cjs/ez-list.cjs.entry.js +0 -174
- package/dist/cjs/ez-modal.cjs.entry.js +0 -65
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +0 -13
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +0 -185
- package/dist/esm/RequestMetadata-c265c9d5.js +0 -527
- package/dist/esm/ez-button_16.entry.js +0 -4060
- package/dist/esm/ez-list.entry.js +0 -170
- package/dist/esm/ez-modal.entry.js +0 -61
- package/dist/ezui/p-11ae4ae7.entry.js +0 -1
- package/dist/ezui/p-47fa3d6c.entry.js +0 -1
- package/dist/ezui/p-8ab6168f.entry.js +0 -1
- package/dist/ezui/p-9c1fb51c.entry.js +0 -1
- package/dist/ezui/p-9d85125b.entry.js +0 -1
- package/dist/ezui/p-9dfccb16.js +0 -1
- package/dist/ezui/p-a7b546b2.entry.js +0 -1
- package/dist/ezui/p-c833c94f.entry.js +0 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +0 -45
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { Component, Event, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
import { getSpritePath } from '../../../../utils/AssetsUtils';
|
|
3
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
4
|
+
export class GridConfig {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._columnListHistory = [];
|
|
7
|
+
this._orderListItems = [];
|
|
8
|
+
this._columListItems = [];
|
|
9
|
+
this.selectedTab = "Colunas";
|
|
10
|
+
this._selectedIndex = -1;
|
|
11
|
+
}
|
|
12
|
+
/* Creation Methods */
|
|
13
|
+
createOrderList() {
|
|
14
|
+
var _a;
|
|
15
|
+
let newList = [];
|
|
16
|
+
if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
17
|
+
this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
|
|
18
|
+
let item = { label: column.label };
|
|
19
|
+
newList.push(item);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.columns.forEach(column => {
|
|
24
|
+
let item = { name: column.name, label: column.label };
|
|
25
|
+
if (!column.hidden) {
|
|
26
|
+
newList.push(item);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
this._orderListItems = newList;
|
|
31
|
+
}
|
|
32
|
+
createColumnList() {
|
|
33
|
+
let visibleGroup = {
|
|
34
|
+
group: 'Visíveis',
|
|
35
|
+
items: [],
|
|
36
|
+
};
|
|
37
|
+
let hiddenGroup = {
|
|
38
|
+
group: 'Ocultas',
|
|
39
|
+
items: [],
|
|
40
|
+
sort: 'ASC'
|
|
41
|
+
};
|
|
42
|
+
this.columns.forEach(column => {
|
|
43
|
+
let item = { label: column.label };
|
|
44
|
+
if (column.hidden) {
|
|
45
|
+
hiddenGroup.items.push(item);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
visibleGroup.items.push(item);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (this._columnListHistory.length <= 0) {
|
|
52
|
+
this._columListItems = [visibleGroup, hiddenGroup];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
buildColumnListSlot(item, group) {
|
|
56
|
+
return (h("div", null,
|
|
57
|
+
h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
|
|
58
|
+
}
|
|
59
|
+
buildOrderListSlot(item) {
|
|
60
|
+
let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
|
|
61
|
+
return (h("div", null,
|
|
62
|
+
h("select-box", { selectedOption: existingItem === null || existingItem === void 0 ? void 0 : existingItem.sort, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
|
|
63
|
+
}
|
|
64
|
+
updateOrder(sortOrder, updatedItem) {
|
|
65
|
+
let newList = [...this.columns];
|
|
66
|
+
let newItem = newList.find(item => item.label === updatedItem.label);
|
|
67
|
+
if (newItem) {
|
|
68
|
+
newItem.sort = sortOrder;
|
|
69
|
+
}
|
|
70
|
+
this.columns = newList;
|
|
71
|
+
}
|
|
72
|
+
/* Actions Methods */
|
|
73
|
+
switchColumnGroup(ev, switchedItem) {
|
|
74
|
+
ev.stopPropagation();
|
|
75
|
+
let newList = [...this._columListItems];
|
|
76
|
+
if (ev.detail === true) {
|
|
77
|
+
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
78
|
+
let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
79
|
+
if (index >= 0) {
|
|
80
|
+
hiddenGroup.items.splice(index, 1);
|
|
81
|
+
}
|
|
82
|
+
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
83
|
+
visibleGroup.items.push(switchedItem);
|
|
84
|
+
this._columListItems = newList;
|
|
85
|
+
this.createOrderList();
|
|
86
|
+
}
|
|
87
|
+
else if (ev.detail === false) {
|
|
88
|
+
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
89
|
+
let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
90
|
+
if (index >= 0) {
|
|
91
|
+
visibleGroup.items.splice(index, 1);
|
|
92
|
+
}
|
|
93
|
+
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
94
|
+
hiddenGroup.items.push(switchedItem);
|
|
95
|
+
this._columListItems = newList;
|
|
96
|
+
this.createOrderList();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
finish() {
|
|
100
|
+
let newColumnList = [];
|
|
101
|
+
this._columListItems.forEach(group => {
|
|
102
|
+
group.items.forEach(item => {
|
|
103
|
+
const baseColumn = this.columns.find(column => column.label === item.label);
|
|
104
|
+
let newColumnItem = Object.assign({}, baseColumn);
|
|
105
|
+
if (group.group === "Ocultas") {
|
|
106
|
+
newColumnItem.hidden = true;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
newColumnItem.hidden = false;
|
|
110
|
+
}
|
|
111
|
+
newColumnList.push(newColumnItem);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
this._columnListHistory = [];
|
|
115
|
+
this.columns = newColumnList;
|
|
116
|
+
this.configFinish.emit(this.columns);
|
|
117
|
+
}
|
|
118
|
+
async locateColumn(evt, searchingText) {
|
|
119
|
+
var _a;
|
|
120
|
+
const hitEnter = evt.key === "Enter";
|
|
121
|
+
if (!searchingText) {
|
|
122
|
+
searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
|
|
123
|
+
}
|
|
124
|
+
let newSelected = -1;
|
|
125
|
+
if (this.selectedTab === "Ordenação") {
|
|
126
|
+
if (searchingText) {
|
|
127
|
+
const matchedIndexes = [];
|
|
128
|
+
let orderListDatasource;
|
|
129
|
+
await this._orderList.getList().then(listGroup => {
|
|
130
|
+
orderListDatasource = listGroup;
|
|
131
|
+
orderListDatasource.forEach((column, index) => {
|
|
132
|
+
if (this.compareWords(column, searchingText)) {
|
|
133
|
+
matchedIndexes.push(index);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
if (matchedIndexes.length > 0) {
|
|
138
|
+
if (hitEnter) {
|
|
139
|
+
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
140
|
+
if (matchedIndexes[j] > this._selectedIndex) {
|
|
141
|
+
newSelected = matchedIndexes[j];
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (newSelected === -1) {
|
|
147
|
+
newSelected = matchedIndexes[0];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
this._selectedIndex = newSelected;
|
|
151
|
+
let selectedColumn;
|
|
152
|
+
selectedColumn = orderListDatasource[newSelected];
|
|
153
|
+
if (selectedColumn) {
|
|
154
|
+
this._orderList.setSelection({ label: selectedColumn.label }, true);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this._orderList.setSelection(undefined);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this._orderList.setSelection(undefined);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
if (searchingText) {
|
|
166
|
+
const matchedIndexes = [];
|
|
167
|
+
this.columns.forEach((column, index) => {
|
|
168
|
+
if (this.compareWords(column, searchingText)) {
|
|
169
|
+
matchedIndexes.push(index);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
if (matchedIndexes.length > 0) {
|
|
173
|
+
if (hitEnter) {
|
|
174
|
+
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
175
|
+
if (matchedIndexes[j] > this._selectedIndex) {
|
|
176
|
+
newSelected = matchedIndexes[j];
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (newSelected === -1) {
|
|
182
|
+
newSelected = matchedIndexes[0];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
this._selectedIndex = newSelected;
|
|
186
|
+
let selectedColumn = this.columns[newSelected];
|
|
187
|
+
if (selectedColumn) {
|
|
188
|
+
this._columnList.setSelection({ label: selectedColumn.label }, true);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
this._columnList.setSelection(undefined);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this._columnList.setSelection(undefined);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
compareWords(column, searchingText) {
|
|
200
|
+
if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
closeConfig() {
|
|
206
|
+
this._columnListHistory = [];
|
|
207
|
+
this.configCancel.emit();
|
|
208
|
+
}
|
|
209
|
+
/* Handlers */
|
|
210
|
+
handleTabChange(ev) {
|
|
211
|
+
var _a;
|
|
212
|
+
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
213
|
+
if (ev.target.selectedTab === "Ordenação") {
|
|
214
|
+
this._columnListHistory = this._columnList.dataSource;
|
|
215
|
+
this.createOrderList();
|
|
216
|
+
}
|
|
217
|
+
this.selectedTab = ev.target.selectedTab;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
handleColumnListChange(ev) {
|
|
221
|
+
var _a;
|
|
222
|
+
if (ev.detail) {
|
|
223
|
+
let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
|
|
224
|
+
if (visibleItems) {
|
|
225
|
+
this._orderListItems = visibleItems;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
componentWillRender() {
|
|
230
|
+
var _a;
|
|
231
|
+
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
232
|
+
this.createColumnList();
|
|
233
|
+
this.createOrderList();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
componentDidRender() {
|
|
237
|
+
var _a;
|
|
238
|
+
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
239
|
+
this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
render() {
|
|
243
|
+
return (h(Host, null,
|
|
244
|
+
h("div", { class: "grid-config__header" },
|
|
245
|
+
h("div", { class: "title-container" },
|
|
246
|
+
h("div", { class: "" },
|
|
247
|
+
h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"),
|
|
248
|
+
h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")),
|
|
249
|
+
h("div", { class: "button-close" },
|
|
250
|
+
h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))),
|
|
251
|
+
h("div", { class: "tabselector-container" },
|
|
252
|
+
h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: '0', onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o' })),
|
|
253
|
+
h("div", null,
|
|
254
|
+
h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) },
|
|
255
|
+
h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))),
|
|
256
|
+
h("div", { class: "grid-config__main" },
|
|
257
|
+
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
|
+
h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação" ? "" : "hidden", dataSource: this._orderListItems, ezSelectable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })),
|
|
259
|
+
h("div", { class: "grid-config__footer" },
|
|
260
|
+
h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }),
|
|
261
|
+
h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
|
|
262
|
+
}
|
|
263
|
+
static get is() { return "grid-config"; }
|
|
264
|
+
static get encapsulation() { return "shadow"; }
|
|
265
|
+
static get originalStyleUrls() { return {
|
|
266
|
+
"$": ["grid-config.css"]
|
|
267
|
+
}; }
|
|
268
|
+
static get styleUrls() { return {
|
|
269
|
+
"$": ["grid-config.css"]
|
|
270
|
+
}; }
|
|
271
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
272
|
+
static get properties() { return {
|
|
273
|
+
"selectedTab": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": true,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "string",
|
|
278
|
+
"resolved": "string",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": false,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [],
|
|
285
|
+
"text": ""
|
|
286
|
+
},
|
|
287
|
+
"attribute": "selected-tab",
|
|
288
|
+
"reflect": false,
|
|
289
|
+
"defaultValue": "\"Colunas\""
|
|
290
|
+
},
|
|
291
|
+
"columns": {
|
|
292
|
+
"type": "unknown",
|
|
293
|
+
"mutable": true,
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "Array<EzGridColumn>",
|
|
296
|
+
"resolved": "EzGridColumn[]",
|
|
297
|
+
"references": {
|
|
298
|
+
"Array": {
|
|
299
|
+
"location": "global"
|
|
300
|
+
},
|
|
301
|
+
"EzGridColumn": {
|
|
302
|
+
"location": "import",
|
|
303
|
+
"path": "../../controller/EzGridController"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": ""
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}; }
|
|
315
|
+
static get events() { return [{
|
|
316
|
+
"method": "configFinish",
|
|
317
|
+
"name": "configFinish",
|
|
318
|
+
"bubbles": true,
|
|
319
|
+
"cancelable": true,
|
|
320
|
+
"composed": true,
|
|
321
|
+
"docs": {
|
|
322
|
+
"tags": [],
|
|
323
|
+
"text": ""
|
|
324
|
+
},
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "Array<EzGridColumn>",
|
|
327
|
+
"resolved": "EzGridColumn[]",
|
|
328
|
+
"references": {
|
|
329
|
+
"Array": {
|
|
330
|
+
"location": "global"
|
|
331
|
+
},
|
|
332
|
+
"EzGridColumn": {
|
|
333
|
+
"location": "import",
|
|
334
|
+
"path": "../../controller/EzGridController"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
"method": "configCancel",
|
|
340
|
+
"name": "configCancel",
|
|
341
|
+
"bubbles": true,
|
|
342
|
+
"cancelable": true,
|
|
343
|
+
"composed": true,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": ""
|
|
347
|
+
},
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "void",
|
|
350
|
+
"resolved": "void",
|
|
351
|
+
"references": {}
|
|
352
|
+
}
|
|
353
|
+
}]; }
|
|
354
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component, Event, h, Prop } from '@stencil/core';
|
|
2
|
+
export class SelectBox {
|
|
3
|
+
changeSelection() {
|
|
4
|
+
this.ezChange.emit(this._selectElem.value);
|
|
5
|
+
}
|
|
6
|
+
componentDidRender() {
|
|
7
|
+
if (this._selectElem) {
|
|
8
|
+
if (this.selectedOption) {
|
|
9
|
+
this._selectElem.value = this.selectedOption;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this._selectElem.value = "na";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return (h("select", { ref: (el) => this._selectElem = el, onChange: () => { this.changeSelection(); } },
|
|
18
|
+
h("option", { value: "na" }, "N/A"),
|
|
19
|
+
h("option", { value: "asc" }, "A-Z"),
|
|
20
|
+
h("option", { value: "desc" }, "Z-A")));
|
|
21
|
+
}
|
|
22
|
+
static get is() { return "select-box"; }
|
|
23
|
+
static get encapsulation() { return "shadow"; }
|
|
24
|
+
static get originalStyleUrls() { return {
|
|
25
|
+
"$": ["select-box.css"]
|
|
26
|
+
}; }
|
|
27
|
+
static get styleUrls() { return {
|
|
28
|
+
"$": ["select-box.css"]
|
|
29
|
+
}; }
|
|
30
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
31
|
+
static get properties() { return {
|
|
32
|
+
"selectedOption": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"mutable": false,
|
|
35
|
+
"complexType": {
|
|
36
|
+
"original": "string",
|
|
37
|
+
"resolved": "string",
|
|
38
|
+
"references": {}
|
|
39
|
+
},
|
|
40
|
+
"required": false,
|
|
41
|
+
"optional": false,
|
|
42
|
+
"docs": {
|
|
43
|
+
"tags": [],
|
|
44
|
+
"text": ""
|
|
45
|
+
},
|
|
46
|
+
"attribute": "selected-option",
|
|
47
|
+
"reflect": false
|
|
48
|
+
}
|
|
49
|
+
}; }
|
|
50
|
+
static get events() { return [{
|
|
51
|
+
"method": "ezChange",
|
|
52
|
+
"name": "ezChange",
|
|
53
|
+
"bubbles": true,
|
|
54
|
+
"cancelable": true,
|
|
55
|
+
"composed": true,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": ""
|
|
59
|
+
},
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "string",
|
|
62
|
+
"resolved": "string",
|
|
63
|
+
"references": {}
|
|
64
|
+
}
|
|
65
|
+
}]; }
|
|
66
|
+
}
|