@sankhyalabs/ezui 2.0.3 → 2.0.5
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-combo-box.cjs.entry.js +4 -3
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +26 -17
- package/dist/cjs/ez-grid.cjs.entry.js +1 -11
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +4 -3
- package/dist/collection/components/ez-dialog/ez-dialog.css +2 -2
- package/dist/collection/components/ez-form/ez-form.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +25 -16
- package/dist/collection/components/ez-grid/ez-grid.js +2 -47
- package/dist/custom-elements/index.d.ts +0 -12
- package/dist/custom-elements/index.js +34 -482
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +26 -17
- package/dist/esm/ez-grid.entry.js +1 -11
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-45d8634a.entry.js +1 -0
- package/dist/ezui/{p-e120b25a.entry.js → p-a7733cb4.entry.js} +1 -1
- package/dist/ezui/p-e0aa9cb1.entry.js +1 -0
- package/dist/ezui/p-f6afdc4d.entry.js +1 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +0 -4
- package/dist/types/components.d.ts +0 -39
- package/package.json +1 -1
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-grid-config.cjs.entry.js +0 -436
- package/dist/cjs/ez-select-box.cjs.entry.js +0 -22
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +0 -166
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +0 -551
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.css +0 -9
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +0 -62
- package/dist/esm/ez-grid-config.entry.js +0 -432
- package/dist/esm/ez-select-box.entry.js +0 -18
- package/dist/ezui/p-2c6398b3.entry.js +0 -1
- package/dist/ezui/p-3987f8d8.entry.js +0 -1
- package/dist/ezui/p-6608b9a5.entry.js +0 -1
- package/dist/ezui/p-9b1700f7.entry.js +0 -1
- package/dist/ezui/p-9fc50d9a.entry.js +0 -1
- package/dist/types/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.d.ts +0 -38
- package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +0 -7
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-8646c40d.js');
|
|
6
|
-
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
|
|
8
|
-
const DialogType = require('./DialogType-aa435c52.js');
|
|
9
|
-
|
|
10
|
-
const ezGridConfigCss = ".sc-ez-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--ez-grid-config__title--font-family:var(--font-pattern, \"Roboto\");--ez-grid-config__title--font-size:var(--title--large, 20px);--ez-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Roboto\");--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-grid-config__scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-grid-config__group--font-family:var(--font-pattern, \"Roboto\");--ez-grid-config__group--font-size:var(--text--medium, 14px);--ez-grid-config__group--font-weight:var(--text-weight--large, 600);--ez-grid-config__group--padding-bottom:var(--space-small, 6px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-ez-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-ez-grid-config{padding-right:var(--space--medium)}ez-list.sc-ez-grid-config{height:100%}.height-calc.sc-ez-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-ez-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--ez-grid-config__footer--padding-top)}.hidden.sc-ez-grid-config{display:none}.tabselector-container.sc-ez-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-ez-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-ez-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-ez-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--ez-grid-config__title--font-size);font-family:var(--ez-grid-config__title--font-family);font-weight:var(--ez-grid-config__title--font-weight)}.subtitle.sc-ez-grid-config{color:var(--text--primary);font-size:var(--ez-grid-config__subtitle--font-size);font-family:var(--ez-grid-config__subtitle--font-family)}.grid-config__main.sc-ez-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--ez-grid-config__scrollbar--background-color-primary) var(--ez-grid-config__scrollbar--background-color-secondary);padding-right:var(--ez-grid-config__main--padding-right)}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar-track{background-color:var(--ez-grid-config__scrollbar--background-color-secondary)}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__scrollbar--background-color-primary);border-radius:var(--ez-grid-config__scrollbar--border-radius)}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar{width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width);background-color:var(--ez-grid-config__scrollbar--background-color-secondary)}.group-name.sc-ez-grid-config{font-family:var(--ez-grid-config__group--font-family);font-size:var(--ez-grid-config__group--font-size);font-weight:var(--ez-grid-config__group--font-weight);padding-bottom:var(--ez-grid-config__group--padding-bottom)}";
|
|
11
|
-
|
|
12
|
-
let EzGridConfig = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.configFinish = index.createEvent(this, "configFinish", 7);
|
|
16
|
-
this.configCancel = index.createEvent(this, "configCancel", 7);
|
|
17
|
-
this._orderListItems = [];
|
|
18
|
-
this._orderPriorityList = [];
|
|
19
|
-
this._columListItems = [];
|
|
20
|
-
this._selectedIndex = -1;
|
|
21
|
-
this._dataChanged = false;
|
|
22
|
-
this._componenteInternalKey = Date.now();
|
|
23
|
-
this.selectedTab = "Colunas";
|
|
24
|
-
}
|
|
25
|
-
/* Creation Methods */
|
|
26
|
-
createOrderList() {
|
|
27
|
-
let newList = [];
|
|
28
|
-
this.columns.filter(col => { var _a; return core.StringUtils.getBooleanValue((_a = col === null || col === void 0 ? void 0 : col.props) === null || _a === void 0 ? void 0 : _a.get("sortable"), true); }).forEach(column => {
|
|
29
|
-
var _a;
|
|
30
|
-
let configItem = (_a = this.config) === null || _a === void 0 ? void 0 : _a.columns.find(item => item.name === column.name);
|
|
31
|
-
let item = { name: column.name, label: column.label };
|
|
32
|
-
if (configItem) {
|
|
33
|
-
item['orderIndex'] = configItem.orderIndex;
|
|
34
|
-
item['ascending'] = configItem.ascending;
|
|
35
|
-
}
|
|
36
|
-
if (!column.hidden) {
|
|
37
|
-
newList.push(item);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
newList.sort((a, b) => {
|
|
41
|
-
//OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
|
|
42
|
-
if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
|
|
43
|
-
if (a.ascending != undefined)
|
|
44
|
-
return -1;
|
|
45
|
-
if (b.ascending != undefined)
|
|
46
|
-
return 1;
|
|
47
|
-
return 0;
|
|
48
|
-
//Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
|
|
49
|
-
}
|
|
50
|
-
else if (a.ascending != undefined && b.ascending != undefined) {
|
|
51
|
-
return (a.orderIndex - b.orderIndex);
|
|
52
|
-
//Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
|
|
53
|
-
}
|
|
54
|
-
else if (a.ascending != undefined || b.ascending != undefined) {
|
|
55
|
-
if (a.ascending != undefined)
|
|
56
|
-
return -1;
|
|
57
|
-
if (b.ascending != undefined)
|
|
58
|
-
return 1;
|
|
59
|
-
return 0;
|
|
60
|
-
}
|
|
61
|
-
return (a.orderIndex - b.orderIndex);
|
|
62
|
-
});
|
|
63
|
-
this._orderListItems = newList;
|
|
64
|
-
}
|
|
65
|
-
createColumnList() {
|
|
66
|
-
let visibleGroup = {
|
|
67
|
-
group: 'Visíveis',
|
|
68
|
-
items: [],
|
|
69
|
-
};
|
|
70
|
-
let hiddenGroup = {
|
|
71
|
-
group: 'Ocultas',
|
|
72
|
-
items: [],
|
|
73
|
-
sort: 'ASC'
|
|
74
|
-
};
|
|
75
|
-
this.columns.forEach(column => {
|
|
76
|
-
let item = { label: column.label };
|
|
77
|
-
if (column.hidden) {
|
|
78
|
-
hiddenGroup.items.push(item);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
visibleGroup.items.push(item);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
this._columListItems = [visibleGroup, hiddenGroup];
|
|
85
|
-
}
|
|
86
|
-
buildColumnListSlot(item, group) {
|
|
87
|
-
return (index.h("div", null, index.h("ez-check", { mode: 'switch', id: 'switch' + ((item === null || item === void 0 ? void 0 : item.label) || '') + ((group === null || group === void 0 ? void 0 : group.group) || ''), value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
|
|
88
|
-
}
|
|
89
|
-
buildOrderListSlot(item) {
|
|
90
|
-
let selectedOption = "na";
|
|
91
|
-
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
92
|
-
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
93
|
-
}
|
|
94
|
-
return (index.h("div", null, index.h("ez-select-box", { selectedOption: selectedOption, key: 'ez-select-box-' + this._componenteInternalKey + '-' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
95
|
-
}
|
|
96
|
-
updateOrder(sortOrder, updatedItemLabel) {
|
|
97
|
-
var _a;
|
|
98
|
-
this._dataChanged = true;
|
|
99
|
-
let newList = [...this.columns];
|
|
100
|
-
let newItem = newList.find(item => item.label === updatedItemLabel);
|
|
101
|
-
if (newItem) {
|
|
102
|
-
newItem.sort = sortOrder.value === "na" ? undefined : sortOrder.value;
|
|
103
|
-
}
|
|
104
|
-
let orderArray;
|
|
105
|
-
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
106
|
-
this._orderPriorityList.find(item => item.label === newItem.label).sort = sortOrder;
|
|
107
|
-
this._orderPriorityList.filter(item => item.sort).map((item, index) => {
|
|
108
|
-
if (item.label === newItem.label) {
|
|
109
|
-
newItem.sortIndex = index;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
orderArray = newList.filter(item => item.sort && item.hidden !== true).map((item, index) => {
|
|
115
|
-
return { label: item.label, orderIndex: index };
|
|
116
|
-
});
|
|
117
|
-
orderArray.forEach(element => {
|
|
118
|
-
newList.find(item => item.label === element.label).sortIndex = element.orderIndex;
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
this.columns = newList;
|
|
122
|
-
}
|
|
123
|
-
/* Actions Methods */
|
|
124
|
-
switchColumnGroup(ev, switchedItem) {
|
|
125
|
-
ev.stopPropagation();
|
|
126
|
-
let newList = [...this._columListItems];
|
|
127
|
-
this._dataChanged = true;
|
|
128
|
-
if (ev.detail === true) {
|
|
129
|
-
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
130
|
-
let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
131
|
-
if (index >= 0) {
|
|
132
|
-
hiddenGroup.items.splice(index, 1);
|
|
133
|
-
}
|
|
134
|
-
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
135
|
-
visibleGroup.items.push(switchedItem);
|
|
136
|
-
this._columListItems = newList;
|
|
137
|
-
this.createOrderList();
|
|
138
|
-
}
|
|
139
|
-
else if (ev.detail === false) {
|
|
140
|
-
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
141
|
-
let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
142
|
-
if (index >= 0) {
|
|
143
|
-
visibleGroup.items.splice(index, 1);
|
|
144
|
-
}
|
|
145
|
-
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
146
|
-
hiddenGroup.items.push(switchedItem);
|
|
147
|
-
this._columListItems = newList;
|
|
148
|
-
this.createOrderList();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
finish() {
|
|
152
|
-
let newColumnList = [];
|
|
153
|
-
this._columListItems.forEach(group => {
|
|
154
|
-
group.items.forEach(item => {
|
|
155
|
-
const baseColumn = this.columns.find(column => column.label === item.label);
|
|
156
|
-
let newColumnItem = Object.assign({}, baseColumn);
|
|
157
|
-
if (group.group === "Ocultas") {
|
|
158
|
-
newColumnItem.hidden = true;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
newColumnItem.hidden = false;
|
|
162
|
-
}
|
|
163
|
-
newColumnList.push(newColumnItem);
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
this.columns = newColumnList;
|
|
167
|
-
this._dataChanged = false;
|
|
168
|
-
this.closeConfig();
|
|
169
|
-
this.save();
|
|
170
|
-
}
|
|
171
|
-
save() {
|
|
172
|
-
var _a;
|
|
173
|
-
let _newConfig;
|
|
174
|
-
if (this.config) {
|
|
175
|
-
_newConfig = this.config;
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
_newConfig = this.createConfigFromState(this.columns);
|
|
179
|
-
}
|
|
180
|
-
let _newColumnConfigList = [];
|
|
181
|
-
let orderArray;
|
|
182
|
-
if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
183
|
-
orderArray = this.columns.filter(item => item.sort && item.hidden !== true).map((item) => {
|
|
184
|
-
return { label: item.label, orderIndex: 0 };
|
|
185
|
-
});
|
|
186
|
-
let indexCount = 0;
|
|
187
|
-
let newOrderArray = [];
|
|
188
|
-
this._orderPriorityList.forEach((orderPriorityItem) => {
|
|
189
|
-
let item = orderArray.find(column => column.label === orderPriorityItem.label);
|
|
190
|
-
if (item) {
|
|
191
|
-
item.orderIndex = indexCount;
|
|
192
|
-
newOrderArray.push(item);
|
|
193
|
-
indexCount++;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
if (newOrderArray.length > 0) {
|
|
197
|
-
orderArray = newOrderArray;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
for (let i = 0; i < this.columns.length; i++) {
|
|
201
|
-
const column = this.columns[i];
|
|
202
|
-
let _newColumnConfig = _newConfig.columns.find(_newColumnConfig => column.name === _newColumnConfig.name);
|
|
203
|
-
if (column.hidden === true && _newColumnConfig) {
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
if (_newColumnConfig) {
|
|
207
|
-
_newColumnConfig.width = column.width;
|
|
208
|
-
}
|
|
209
|
-
else if (column.hidden === false) {
|
|
210
|
-
_newColumnConfig = { name: column.name, width: column.width, orderIndex: 0 };
|
|
211
|
-
}
|
|
212
|
-
if (_newColumnConfig) {
|
|
213
|
-
if (column.sort) {
|
|
214
|
-
_newColumnConfig.ascending = column.sort.toUpperCase() === "ASC" ? true : false;
|
|
215
|
-
if (orderArray) {
|
|
216
|
-
adjustPriorityOrder(column, _newColumnConfig);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
_newColumnConfig.orderIndex = column.sortIndex;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
delete _newColumnConfig.ascending;
|
|
224
|
-
_newColumnConfig.orderIndex = 0;
|
|
225
|
-
}
|
|
226
|
-
_newColumnConfigList.push(_newColumnConfig);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
_newConfig.columns = _newColumnConfigList;
|
|
230
|
-
this.configFinish.emit(_newConfig);
|
|
231
|
-
this._orderList.clearHistory();
|
|
232
|
-
function adjustPriorityOrder(column, _newColumnConfig) {
|
|
233
|
-
if (orderArray) {
|
|
234
|
-
let orderItem = orderArray.find(item => item.label === column.label);
|
|
235
|
-
if (orderItem) {
|
|
236
|
-
_newColumnConfig.orderIndex = orderItem.orderIndex;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
createConfigFromState(state) {
|
|
242
|
-
let newConfig = { columns: [] };
|
|
243
|
-
state.forEach(columnState => {
|
|
244
|
-
if (!columnState.hidden) {
|
|
245
|
-
let newConfigColumn = { name: columnState.name };
|
|
246
|
-
if (columnState.width) {
|
|
247
|
-
newConfigColumn['width'] = columnState.width;
|
|
248
|
-
}
|
|
249
|
-
if (columnState.sort) {
|
|
250
|
-
newConfigColumn['ascending'] = (columnState.sort.toUpperCase() === 'ASC');
|
|
251
|
-
newConfigColumn['orderIndex'] = columnState.sortIndex;
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
newConfigColumn['orderIndex'] = 0;
|
|
255
|
-
}
|
|
256
|
-
if (newConfigColumn) {
|
|
257
|
-
newConfig.columns.push(newConfigColumn);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
return newConfig;
|
|
262
|
-
}
|
|
263
|
-
async locateColumn(evt, searchingText) {
|
|
264
|
-
var _a;
|
|
265
|
-
const hitEnter = evt.key === "Enter";
|
|
266
|
-
if (!searchingText) {
|
|
267
|
-
searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
|
|
268
|
-
}
|
|
269
|
-
let newSelected = -1;
|
|
270
|
-
if (this.selectedTab === "Ordenação das linhas") {
|
|
271
|
-
if (searchingText) {
|
|
272
|
-
const matchedIndexes = [];
|
|
273
|
-
let orderListDatasource;
|
|
274
|
-
await this._orderList.getList().then(listGroup => {
|
|
275
|
-
orderListDatasource = listGroup;
|
|
276
|
-
orderListDatasource.forEach((column, index) => {
|
|
277
|
-
if (this.compareWords(column, searchingText)) {
|
|
278
|
-
matchedIndexes.push(index);
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
if (matchedIndexes.length > 0) {
|
|
283
|
-
if (hitEnter) {
|
|
284
|
-
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
285
|
-
if (matchedIndexes[j] > this._selectedIndex) {
|
|
286
|
-
newSelected = matchedIndexes[j];
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
if (newSelected === -1) {
|
|
292
|
-
newSelected = matchedIndexes[0];
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
this._selectedIndex = newSelected;
|
|
296
|
-
let selectedColumn;
|
|
297
|
-
selectedColumn = orderListDatasource[newSelected];
|
|
298
|
-
if (selectedColumn) {
|
|
299
|
-
this._orderList.setSelection({ label: selectedColumn.label }, true);
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
this._orderList.setSelection(undefined);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
this._orderList.setSelection(undefined);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
if (searchingText) {
|
|
311
|
-
const matchedIndexes = [];
|
|
312
|
-
this.columns.forEach((column, index) => {
|
|
313
|
-
if (this.compareWords(column, searchingText)) {
|
|
314
|
-
matchedIndexes.push(index);
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
if (matchedIndexes.length > 0) {
|
|
318
|
-
if (hitEnter) {
|
|
319
|
-
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
320
|
-
if (matchedIndexes[j] > this._selectedIndex) {
|
|
321
|
-
newSelected = matchedIndexes[j];
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if (newSelected === -1) {
|
|
327
|
-
newSelected = matchedIndexes[0];
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
this._selectedIndex = newSelected;
|
|
331
|
-
let selectedColumn = this.columns[newSelected];
|
|
332
|
-
if (selectedColumn) {
|
|
333
|
-
this._columnList.setSelection({ label: selectedColumn.label }, true);
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
this._columnList.setSelection(undefined);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
this._columnList.setSelection(undefined);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
compareWords(column, searchingText) {
|
|
345
|
-
if (core.StringUtils.replaceAccentuatedChars(column.label).indexOf(core.StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
|
|
346
|
-
return true;
|
|
347
|
-
}
|
|
348
|
-
return false;
|
|
349
|
-
}
|
|
350
|
-
closeConfig() {
|
|
351
|
-
this._orderList.scrollToTop();
|
|
352
|
-
this._columnList.scrollToTop();
|
|
353
|
-
this._searchElement.value = "";
|
|
354
|
-
if (this._dataChanged) {
|
|
355
|
-
let options = {
|
|
356
|
-
canClose: false,
|
|
357
|
-
labelCancel: "Descartar",
|
|
358
|
-
labelConfirm: "Salvar",
|
|
359
|
-
btnConfirmDanger: false
|
|
360
|
-
};
|
|
361
|
-
ApplicationUtils.ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null, DialogType.DialogType.WARN, options)
|
|
362
|
-
.then(response => {
|
|
363
|
-
if (!response) {
|
|
364
|
-
this._dataChanged = false;
|
|
365
|
-
this.configCancel.emit();
|
|
366
|
-
this._orderList.clearHistory();
|
|
367
|
-
this._componenteInternalKey = Date.now();
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
this.finish();
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
else {
|
|
375
|
-
this.configCancel.emit();
|
|
376
|
-
this._orderList.clearHistory();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
/* Handlers */
|
|
380
|
-
handleTabChange(ev) {
|
|
381
|
-
var _a;
|
|
382
|
-
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
383
|
-
if (this.selectedTab !== ev.target.selectedTab) {
|
|
384
|
-
if (ev.target.selectedTab === "Colunas") {
|
|
385
|
-
this._orderList.scrollToTop();
|
|
386
|
-
}
|
|
387
|
-
else if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
388
|
-
this._columnList.scrollToTop();
|
|
389
|
-
}
|
|
390
|
-
this._searchElement.value = "";
|
|
391
|
-
}
|
|
392
|
-
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
393
|
-
this.createOrderList();
|
|
394
|
-
}
|
|
395
|
-
this.selectedTab = ev.target.selectedTab;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
handleColumnListChange(ev) {
|
|
399
|
-
var _a;
|
|
400
|
-
if (ev.detail) {
|
|
401
|
-
let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
|
|
402
|
-
if (visibleItems) {
|
|
403
|
-
this._dataChanged = true;
|
|
404
|
-
this._orderListItems = visibleItems;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
handleOrderListChange(ev) {
|
|
409
|
-
if (ev.detail) {
|
|
410
|
-
let orderPriorityList = ev.detail;
|
|
411
|
-
if (orderPriorityList) {
|
|
412
|
-
this._dataChanged = true;
|
|
413
|
-
this._orderPriorityList = orderPriorityList;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
componentWillRender() {
|
|
418
|
-
var _a;
|
|
419
|
-
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
420
|
-
this.createColumnList();
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
componentDidRender() {
|
|
424
|
-
var _a;
|
|
425
|
-
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
426
|
-
this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
render() {
|
|
430
|
-
return (index.h(index.Host, null, index.h("div", { class: "grid-config__header" }, index.h("div", { class: "title-container" }, index.h("div", { class: "" }, index.h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), index.h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), index.h("div", { class: "button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "tabselector-container" }, index.h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o das linhas' })), index.h("div", null, index.h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, index.h("ez-icon", { slot: "leftIcon", size: "medium", iconName: "search" })))), index.h("div", { class: "grid-config__main" }, index.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 }), index.h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"), index.h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "height-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, onEzChange: ev => this.handleOrderListChange(ev), ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), index.h("div", { class: "grid-config__footer" }, index.h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), index.h("ez-button", { label: "Concluir", class: "ez-button--primary", onClick: () => this.finish() }))));
|
|
431
|
-
}
|
|
432
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
433
|
-
};
|
|
434
|
-
EzGridConfig.style = ezGridConfigCss;
|
|
435
|
-
|
|
436
|
-
exports.ez_grid_config = EzGridConfig;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-8646c40d.js');
|
|
6
|
-
|
|
7
|
-
const ezSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
|
8
|
-
|
|
9
|
-
let SelectBox = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
13
|
-
this.selectedOption = { value: "na", label: "N/A" };
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
return (index.h("ez-combo-box", { class: "grid-config-combo ez-input--inverted", label: "", suppressSearch: true, value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, index.h("option", { value: "na" }, "N/A"), index.h("option", { value: "asc" }, "A-Z"), index.h("option", { value: "desc" }, "Z-A")));
|
|
17
|
-
}
|
|
18
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
19
|
-
};
|
|
20
|
-
SelectBox.style = ezSelectBoxCss;
|
|
21
|
-
|
|
22
|
-
exports.ez_select_box = SelectBox;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
/*@doc Define o espaçamento utilizado no rodapé do componente.*/
|
|
3
|
-
--ez-grid-config__footer--padding-top: var(--space--medium, 12px);
|
|
4
|
-
|
|
5
|
-
/*@doc Define o espaçamento utilizado no centro do componente.*/
|
|
6
|
-
--ez-grid-config__main--padding-right: var(--space--medium, 12px);
|
|
7
|
-
|
|
8
|
-
/*@doc Define o espaçamento utilizado no seletor de abas do componente.*/
|
|
9
|
-
--ez-grid-config__tabselector-container--padding: var(--space--medium, 12px);
|
|
10
|
-
|
|
11
|
-
/*@doc Define o espaçamento utilizado à esquerda do botão de fechar do componente.*/
|
|
12
|
-
--ez-grid-config__button-close--padding-left: var(--space--medium, 12px);
|
|
13
|
-
|
|
14
|
-
/*@doc Define a cor do texto utilizado para o titulo do componente.*/
|
|
15
|
-
--snk-grid-config__title--color: var(--title--primary, #2B3A54);
|
|
16
|
-
|
|
17
|
-
/*@doc Define o estilo da fonte utilizada para o titulo do componente.*/
|
|
18
|
-
--ez-grid-config__title--font-family: var(--font-pattern, "Roboto");
|
|
19
|
-
|
|
20
|
-
/*@doc Define o tamanho da fonte utilizada para o titulo do componente.*/
|
|
21
|
-
--ez-grid-config__title--font-size: var(--title--large, 20px);
|
|
22
|
-
|
|
23
|
-
/*@doc Define o peso do texto utilizado para o titulo do componente.*/
|
|
24
|
-
--ez-grid-config__title--font-weight: var(--text-weight--extra-large, 700);
|
|
25
|
-
|
|
26
|
-
/*@doc Define o estilo da fonte utilizada para o subtitulo do componente.*/
|
|
27
|
-
--ez-grid-config__subtitle--font-family: var(--font-pattern, "Roboto");
|
|
28
|
-
|
|
29
|
-
/*@doc Define o tamanho da fonte utilizada para o subtitulo do componente.*/
|
|
30
|
-
--ez-grid-config__subtitle--font-size: var(--text--medium, 14px);
|
|
31
|
-
|
|
32
|
-
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
33
|
-
--ez-grid-config__scrollbar--width: var(--space--medium, 12px);
|
|
34
|
-
|
|
35
|
-
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
36
|
-
--ez-grid-config__scrollbar--background-color-primary: var(--scrollbar--primary, #2B3A54);
|
|
37
|
-
|
|
38
|
-
/*@doc Define a cor de fundo da barra de rolagem do componente.*/
|
|
39
|
-
--ez-grid-config__scrollbar--background-color-secondary: var(--scrollbar--secondary, #E5EAF0);
|
|
40
|
-
|
|
41
|
-
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
42
|
-
--ez-grid-config__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
43
|
-
|
|
44
|
-
/* @doc Define o estilo do texto do grupo da lista. */
|
|
45
|
-
--ez-grid-config__group--font-family: var(--font-pattern, "Roboto");
|
|
46
|
-
|
|
47
|
-
/* @doc Define o tamanho do texto do grupo da lista. */
|
|
48
|
-
--ez-grid-config__group--font-size: var(--text--medium, 14px);
|
|
49
|
-
|
|
50
|
-
/* @doc Define o peso do texto do grupo da lista. */
|
|
51
|
-
--ez-grid-config__group--font-weight: var(--text-weight--large, 600);
|
|
52
|
-
|
|
53
|
-
/* @doc Define o espaçamento inferior do grupo da lista. */
|
|
54
|
-
--ez-grid-config__group--padding-bottom: var(--space-small, 6px);
|
|
55
|
-
|
|
56
|
-
display: grid;
|
|
57
|
-
grid-template-rows: auto 1fr auto;
|
|
58
|
-
max-height: 100%;
|
|
59
|
-
width: 100%;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@media screen and (min-width: 480px) {
|
|
63
|
-
:host {
|
|
64
|
-
width: 359px;
|
|
65
|
-
max-width: 359px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.padding-right--medium {
|
|
70
|
-
padding-right: var(--space--medium);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
ez-list {
|
|
74
|
-
height: 100%;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.height-calc {
|
|
78
|
-
max-height: calc(100% - 24px);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.grid-config__footer {
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: flex-end;
|
|
84
|
-
width: 100%;
|
|
85
|
-
|
|
86
|
-
/*public*/
|
|
87
|
-
padding-top: var(--ez-grid-config__footer--padding-top);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.hidden {
|
|
91
|
-
display: none;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.tabselector-container {
|
|
95
|
-
/*public*/
|
|
96
|
-
padding: var(--ez-grid-config__tabselector-container--padding) 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.button-close {
|
|
100
|
-
/*public*/
|
|
101
|
-
padding-left: var(--ez-grid-config__button-close--padding-left);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.title-container {
|
|
105
|
-
display: flex;
|
|
106
|
-
justify-content: space-between;
|
|
107
|
-
align-items: center;
|
|
108
|
-
width: 100%;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.title {
|
|
112
|
-
display: flex;
|
|
113
|
-
margin: 0;
|
|
114
|
-
line-height: normal;
|
|
115
|
-
letter-spacing: 0em;
|
|
116
|
-
text-align: left;
|
|
117
|
-
|
|
118
|
-
/*public*/
|
|
119
|
-
color: var(--snk-grid-config__title--color);
|
|
120
|
-
font-size: var(--ez-grid-config__title--font-size);
|
|
121
|
-
font-family: var(--ez-grid-config__title--font-family);
|
|
122
|
-
font-weight: var(--ez-grid-config__title--font-weight);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.subtitle {
|
|
126
|
-
/*public*/
|
|
127
|
-
color: var(--text--primary);
|
|
128
|
-
font-size: var(--ez-grid-config__subtitle--font-size);
|
|
129
|
-
font-family: var(--ez-grid-config__subtitle--font-family);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.grid-config__main {
|
|
133
|
-
overflow-y: auto;
|
|
134
|
-
scrollbar-width: thin;
|
|
135
|
-
|
|
136
|
-
/*public*/
|
|
137
|
-
scrollbar-color: var(--ez-grid-config__scrollbar--background-color-primary) var(--ez-grid-config__scrollbar--background-color-secondary);
|
|
138
|
-
padding-right: var(--ez-grid-config__main--padding-right);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.grid-config__main::-webkit-scrollbar-track {
|
|
142
|
-
/*public*/
|
|
143
|
-
background-color: var(--ez-grid-config__scrollbar--background-color-secondary);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.grid-config__main::-webkit-scrollbar-thumb {
|
|
147
|
-
/*public*/
|
|
148
|
-
background-color: var(--ez-grid-config__scrollbar--background-color-primary);
|
|
149
|
-
border-radius: var(--ez-grid-config__scrollbar--border-radius);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.grid-config__main::-webkit-scrollbar {
|
|
153
|
-
/*public*/
|
|
154
|
-
width: var(--ez-grid-config__scrollbar--width);
|
|
155
|
-
max-width: var(--ez-grid-config__scrollbar--width);
|
|
156
|
-
min-width: var(--ez-grid-config__scrollbar--width);
|
|
157
|
-
background-color: var(--ez-grid-config__scrollbar--background-color-secondary);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.group-name {
|
|
161
|
-
/*public*/
|
|
162
|
-
font-family: var(--ez-grid-config__group--font-family);
|
|
163
|
-
font-size: var(--ez-grid-config__group--font-size);
|
|
164
|
-
font-weight: var(--ez-grid-config__group--font-weight);
|
|
165
|
-
padding-bottom: var(--ez-grid-config__group--padding-bottom);
|
|
166
|
-
}
|