@sankhyalabs/ezui 4.18.2 → 4.19.1
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/constants-3a1d64fb.js +7 -0
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-filter-input_2.cjs.entry.js +137 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +373 -282
- package/dist/cjs/ez-list.cjs.entry.js +85 -72
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +181 -0
- package/dist/cjs/{ez-filter-input_4.cjs.entry.js → ez-scroller_3.cjs.entry.js} +0 -116
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +108 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ez-check/ez-check.css +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +186 -119
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +8 -1
- package/dist/collection/components/ez-grid/ez-grid.css +14 -4
- package/dist/collection/components/ez-grid/ez-grid.js +49 -20
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css +34 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +297 -0
- package/dist/collection/components/ez-list/ez-list.css +0 -1
- package/dist/collection/components/ez-list/ez-list.js +88 -77
- package/dist/collection/components/ez-modal/ez-modal.css +0 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +11 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +36 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +318 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js +1 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js +1 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css +18 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js +41 -0
- package/dist/collection/utils/constants.js +1 -0
- package/dist/custom-elements/index.d.ts +18 -0
- package/dist/custom-elements/index.js +764 -365
- package/dist/esm/constants-6dab64f7.js +4 -0
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +2 -2
- package/dist/esm/ez-filter-input_2.entry.js +132 -0
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +373 -282
- package/dist/esm/ez-list.entry.js +85 -72
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +177 -0
- package/dist/esm/{ez-filter-input_4.entry.js → ez-scroller_3.entry.js} +3 -118
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +104 -0
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-06b3c6cd.entry.js +1 -0
- package/dist/ezui/{p-967758ac.entry.js → p-0dc118f3.entry.js} +1 -1
- package/dist/ezui/p-27a01a26.js +1 -0
- package/dist/ezui/p-353be5eb.entry.js +1 -0
- package/dist/ezui/p-3e25ecbc.entry.js +1 -0
- package/dist/ezui/{p-b945133d.entry.js → p-4186ca4f.entry.js} +1 -1
- package/dist/ezui/{p-b2056805.entry.js → p-5c0ac5ba.entry.js} +1 -1
- package/dist/ezui/{p-5110b212.entry.js → p-71faa111.entry.js} +1 -1
- package/dist/ezui/{p-9334e296.entry.js → p-b7dd1382.entry.js} +2 -2
- package/dist/ezui/p-c72a799e.entry.js +1 -0
- package/dist/ezui/p-e04e9dbd.entry.js +1 -0
- package/dist/ezui/p-f9787309.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +5 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +14 -5
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +9 -7
- package/dist/types/components/ez-grid/ez-grid.d.ts +14 -4
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +45 -0
- package/dist/types/components/ez-list/ez-list.d.ts +5 -5
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +64 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +4 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.d.ts +4 -0
- package/dist/types/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.d.ts +4 -0
- package/dist/types/components.d.ts +117 -1
- package/dist/types/utils/constants.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/constants-5a75e2f3.js +0 -5
- package/dist/esm/constants-ca136201.js +0 -3
- package/dist/ezui/p-3f4ae3a3.js +0 -1
- package/dist/ezui/p-4ebb1d15.entry.js +0 -1
- package/dist/ezui/p-afea6e50.entry.js +0 -1
- package/dist/ezui/p-f71f0aa2.entry.js +0 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { ElementIDUtils, StringUtils } from
|
|
2
|
-
import { Fragment,
|
|
3
|
-
;
|
|
4
|
-
;
|
|
1
|
+
import { ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { Fragment, Host, h } from '@stencil/core';
|
|
5
3
|
export class EzList {
|
|
6
4
|
constructor() {
|
|
7
5
|
this._listItemsHistory = [];
|
|
8
6
|
this._listItems = [];
|
|
9
7
|
this._listGroupItems = [];
|
|
10
8
|
this.dataSource = [];
|
|
11
|
-
this.listMode =
|
|
9
|
+
this.listMode = 'regular';
|
|
12
10
|
this.useGroups = false;
|
|
13
11
|
this.ezDraggable = false;
|
|
14
12
|
this.ezSelectable = false;
|
|
@@ -26,10 +24,10 @@ export class EzList {
|
|
|
26
24
|
*/
|
|
27
25
|
async scrollToTop() {
|
|
28
26
|
if (this.useGroups) {
|
|
29
|
-
this._element.shadowRoot.querySelector(
|
|
27
|
+
this._element.shadowRoot.querySelector('.group-container').scrollTop = 0;
|
|
30
28
|
}
|
|
31
29
|
else {
|
|
32
|
-
this._element.shadowRoot.querySelector(
|
|
30
|
+
this._element.shadowRoot.querySelector('.items-container').scrollTop = 0;
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
@@ -65,9 +63,9 @@ export class EzList {
|
|
|
65
63
|
this._listItems = newList;
|
|
66
64
|
}
|
|
67
65
|
if (scrollToOption) {
|
|
68
|
-
let liElem = this.useGroups
|
|
69
|
-
this._groupContainer.querySelector(
|
|
70
|
-
: this._itemContainer.querySelector(
|
|
66
|
+
let liElem = this.useGroups
|
|
67
|
+
? this._groupContainer.querySelector('li#item_' + this.getItemId(selectedItem.label))
|
|
68
|
+
: this._itemContainer.querySelector('li#item_' + this.getItemId(selectedItem.label));
|
|
71
69
|
if (liElem) {
|
|
72
70
|
liElem.scrollIntoView();
|
|
73
71
|
}
|
|
@@ -84,7 +82,7 @@ export class EzList {
|
|
|
84
82
|
let selectedItem;
|
|
85
83
|
if (this.useGroups) {
|
|
86
84
|
this._listGroupItems.every(group => {
|
|
87
|
-
let item = group.items.find(
|
|
85
|
+
let item = group.items.find(item => item.selected == true);
|
|
88
86
|
if (item) {
|
|
89
87
|
selectedItem = item;
|
|
90
88
|
return false;
|
|
@@ -93,7 +91,7 @@ export class EzList {
|
|
|
93
91
|
});
|
|
94
92
|
}
|
|
95
93
|
else {
|
|
96
|
-
selectedItem = this._listItems.find(
|
|
94
|
+
selectedItem = this._listItems.find(item => item.selected == true);
|
|
97
95
|
}
|
|
98
96
|
return selectedItem;
|
|
99
97
|
}
|
|
@@ -123,7 +121,7 @@ export class EzList {
|
|
|
123
121
|
itemGroup.items.sort(function (a, b) {
|
|
124
122
|
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
|
|
125
123
|
});
|
|
126
|
-
if (itemGroup.sort ===
|
|
124
|
+
if (itemGroup.sort === 'DSC') {
|
|
127
125
|
itemGroup.items.reverse();
|
|
128
126
|
}
|
|
129
127
|
}
|
|
@@ -148,19 +146,19 @@ export class EzList {
|
|
|
148
146
|
}
|
|
149
147
|
buildIdDraggableListAndSelectable() {
|
|
150
148
|
const shadow = this._element.shadowRoot;
|
|
151
|
-
const draggableList = shadow.querySelectorAll(
|
|
149
|
+
const draggableList = shadow.querySelectorAll('.draggable-list');
|
|
152
150
|
draggableList === null || draggableList === void 0 ? void 0 : draggableList.forEach((draggable, index) => {
|
|
153
151
|
var _a, _b;
|
|
154
|
-
let suffix =
|
|
152
|
+
let suffix = 'draggableList';
|
|
155
153
|
const group = (_b = (_a = this._listGroupItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.group;
|
|
156
154
|
if (this.useGroups && group) {
|
|
157
155
|
suffix = suffix.concat('_', group);
|
|
158
156
|
}
|
|
159
157
|
ElementIDUtils.addIDInfoIfNotExists(draggable, suffix);
|
|
160
158
|
});
|
|
161
|
-
const selectable = shadow.querySelectorAll(
|
|
159
|
+
const selectable = shadow.querySelectorAll('.selectable-container');
|
|
162
160
|
selectable === null || selectable === void 0 ? void 0 : selectable.forEach((item) => {
|
|
163
|
-
ElementIDUtils.addIDInfoIfNotExists(item,
|
|
161
|
+
ElementIDUtils.addIDInfoIfNotExists(item, 'selectable');
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
164
|
componentWillLoad() {
|
|
@@ -187,15 +185,17 @@ export class EzList {
|
|
|
187
185
|
//Adiciona item arrastado
|
|
188
186
|
if (groupEnd.sort) {
|
|
189
187
|
newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
|
|
190
|
-
newList
|
|
188
|
+
newList
|
|
189
|
+
.find(group => group.group == dragEndItem.groupName)
|
|
190
|
+
.items.sort(function (a, b) {
|
|
191
191
|
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
|
|
192
192
|
});
|
|
193
|
-
if (groupEnd.sort ===
|
|
193
|
+
if (groupEnd.sort === 'DSC') {
|
|
194
194
|
newList.find(group => group.group == dragEndItem.groupName).items.reverse();
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
else {
|
|
198
|
-
let indexForAdd =
|
|
198
|
+
let indexForAdd = dragEndItem.index > this._dragStartItem.index ? dragEndItem.index - 1 : dragEndItem.index;
|
|
199
199
|
newList.find(group => group.group == dragEndItem.groupName).items.splice(indexForAdd, 0, this._dragStartItem.item);
|
|
200
200
|
}
|
|
201
201
|
this._listGroupItems = newList;
|
|
@@ -224,10 +224,12 @@ export class EzList {
|
|
|
224
224
|
//Adiciona item arrastado
|
|
225
225
|
newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
|
|
226
226
|
if (groupEnd.sort) {
|
|
227
|
-
newList
|
|
227
|
+
newList
|
|
228
|
+
.find(group => group.group == groupDropped.group)
|
|
229
|
+
.items.sort(function (a, b) {
|
|
228
230
|
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
|
|
229
231
|
});
|
|
230
|
-
if (groupEnd.sort ===
|
|
232
|
+
if (groupEnd.sort === 'DSC') {
|
|
231
233
|
newList.find(group => group.group == groupDropped.group).items.reverse();
|
|
232
234
|
}
|
|
233
235
|
}
|
|
@@ -290,23 +292,23 @@ export class EzList {
|
|
|
290
292
|
}
|
|
291
293
|
}
|
|
292
294
|
addOverClass(element) {
|
|
293
|
-
if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains(
|
|
294
|
-
element.classList.add(
|
|
295
|
+
if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains('draggable')) {
|
|
296
|
+
element.classList.add('over');
|
|
295
297
|
}
|
|
296
|
-
else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains(
|
|
298
|
+
else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains('draggable-list')) {
|
|
297
299
|
this.addOverClass(element.parentElement);
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
addOverGroupClass(ev, group) {
|
|
301
303
|
if (ev.target) {
|
|
302
|
-
let groupContainer = this._groupContainer.querySelector(
|
|
303
|
-
let groupOverlay = groupContainer.getElementsByClassName(
|
|
304
|
+
let groupContainer = this._groupContainer.querySelector('div#' + this.getDivGroupId(group.group));
|
|
305
|
+
let groupOverlay = groupContainer.getElementsByClassName('group-overlay')[0];
|
|
304
306
|
if (group.items.length > 0) {
|
|
305
|
-
groupOverlay.setAttribute(
|
|
307
|
+
groupOverlay.setAttribute('style', 'display:grid');
|
|
306
308
|
}
|
|
307
309
|
else {
|
|
308
|
-
groupOverlay.classList.add(
|
|
309
|
-
groupOverlay.setAttribute(
|
|
310
|
+
groupOverlay.classList.add('presetedHeight');
|
|
311
|
+
groupOverlay.setAttribute('style', 'display:grid');
|
|
310
312
|
groupOverlay.scrollIntoView(false);
|
|
311
313
|
}
|
|
312
314
|
}
|
|
@@ -316,31 +318,31 @@ export class EzList {
|
|
|
316
318
|
let overCollection;
|
|
317
319
|
let overLastDroppableCollection;
|
|
318
320
|
if (this.useGroups) {
|
|
319
|
-
overCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(
|
|
320
|
-
overLastDroppableCollection = this._groupContainer.getElementsByClassName(
|
|
321
|
+
overCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('over');
|
|
322
|
+
overLastDroppableCollection = this._groupContainer.getElementsByClassName('last-droppable-space');
|
|
321
323
|
}
|
|
322
324
|
else {
|
|
323
|
-
overCollection = (_b = this._itemContainer) === null || _b === void 0 ? void 0 : _b.getElementsByClassName(
|
|
324
|
-
overLastDroppableCollection = this._itemContainer.getElementsByClassName(
|
|
325
|
+
overCollection = (_b = this._itemContainer) === null || _b === void 0 ? void 0 : _b.getElementsByClassName('over');
|
|
326
|
+
overLastDroppableCollection = this._itemContainer.getElementsByClassName('last-droppable-space');
|
|
325
327
|
}
|
|
326
328
|
if (overCollection) {
|
|
327
329
|
Array.from(overCollection).forEach(function (element) {
|
|
328
|
-
element.classList.remove(
|
|
330
|
+
element.classList.remove('over');
|
|
329
331
|
});
|
|
330
332
|
}
|
|
331
333
|
if (overLastDroppableCollection) {
|
|
332
334
|
Array.from(overLastDroppableCollection).forEach(function (element) {
|
|
333
|
-
element.classList.remove(
|
|
335
|
+
element.classList.remove('over');
|
|
334
336
|
});
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
removeOverGroupClass(ev, group) {
|
|
338
340
|
if (ev.target) {
|
|
339
|
-
let groupContainer = this._groupContainer.querySelector(
|
|
340
|
-
let groupOverlay = groupContainer.getElementsByClassName(
|
|
341
|
+
let groupContainer = this._groupContainer.querySelector('div#' + this.getDivGroupId(group.group));
|
|
342
|
+
let groupOverlay = groupContainer.getElementsByClassName('group-overlay')[0];
|
|
341
343
|
if (groupOverlay) {
|
|
342
|
-
groupOverlay.classList.remove(
|
|
343
|
-
groupOverlay.setAttribute(
|
|
344
|
+
groupOverlay.classList.remove('presetedHeight');
|
|
345
|
+
groupOverlay.setAttribute('style', 'display:none');
|
|
344
346
|
}
|
|
345
347
|
}
|
|
346
348
|
}
|
|
@@ -405,7 +407,7 @@ export class EzList {
|
|
|
405
407
|
let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
|
|
406
408
|
if (itemIndex != undefined && itemIndex != -1) {
|
|
407
409
|
if (itemIndex === 0) {
|
|
408
|
-
if (
|
|
410
|
+
if (groupIndex - 1 >= 0) {
|
|
409
411
|
item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
|
|
410
412
|
}
|
|
411
413
|
}
|
|
@@ -433,10 +435,10 @@ export class EzList {
|
|
|
433
435
|
this.getSelection().then(selectedItem => {
|
|
434
436
|
if (selectedItem) {
|
|
435
437
|
switch (event.key) {
|
|
436
|
-
case
|
|
438
|
+
case 'ArrowDown':
|
|
437
439
|
this.nextOption(selectedItem);
|
|
438
440
|
break;
|
|
439
|
-
case
|
|
441
|
+
case 'ArrowUp':
|
|
440
442
|
this.previousOption(selectedItem);
|
|
441
443
|
break;
|
|
442
444
|
}
|
|
@@ -449,19 +451,19 @@ export class EzList {
|
|
|
449
451
|
}
|
|
450
452
|
getItemId(itemLabel) {
|
|
451
453
|
if (itemLabel) {
|
|
452
|
-
return itemLabel.replace(/[^a-z0-9_]/gi,
|
|
454
|
+
return itemLabel.replace(/[^a-z0-9_]/gi, '_');
|
|
453
455
|
}
|
|
454
456
|
return undefined;
|
|
455
457
|
}
|
|
456
458
|
getDivGroupId(groupName) {
|
|
457
459
|
if (groupName) {
|
|
458
|
-
return
|
|
460
|
+
return 'group-' + groupName.replace(/[^a-z0-9_]/gi, '_');
|
|
459
461
|
}
|
|
460
462
|
return undefined;
|
|
461
463
|
}
|
|
462
464
|
getGroupOverlayId(groupName) {
|
|
463
465
|
if (groupName) {
|
|
464
|
-
return
|
|
466
|
+
return 'group-overlay-' + groupName.replace(/[^a-z0-9_]/gi, '_');
|
|
465
467
|
}
|
|
466
468
|
return undefined;
|
|
467
469
|
}
|
|
@@ -481,26 +483,26 @@ export class EzList {
|
|
|
481
483
|
onDragOverLastIndex(ev) {
|
|
482
484
|
ev.preventDefault();
|
|
483
485
|
if (this._dragStartItem) {
|
|
484
|
-
ev.target.classList.add(
|
|
486
|
+
ev.target.classList.add('over');
|
|
485
487
|
ev.stopPropagation();
|
|
486
488
|
}
|
|
487
489
|
}
|
|
488
490
|
showOverlays(groupDragStart) {
|
|
489
|
-
let groupOverlayCollection = this._groupContainer.getElementsByClassName(
|
|
491
|
+
let groupOverlayCollection = this._groupContainer.getElementsByClassName('group-overlay');
|
|
490
492
|
Array.from(groupOverlayCollection).forEach(groupOverlay => {
|
|
491
493
|
let groupOverlayID = this.getGroupOverlayId(groupDragStart.group);
|
|
492
|
-
if (groupOverlayID && groupOverlay.getAttribute(
|
|
493
|
-
groupOverlay.classList.add(
|
|
494
|
-
groupOverlay.setAttribute(
|
|
494
|
+
if (groupOverlayID && groupOverlay.getAttribute('id') && groupOverlayID != groupOverlay.getAttribute('id')) {
|
|
495
|
+
groupOverlay.classList.add('presetedHeight');
|
|
496
|
+
groupOverlay.setAttribute('style', 'display:grid');
|
|
495
497
|
}
|
|
496
498
|
});
|
|
497
499
|
}
|
|
498
500
|
hideOverlays() {
|
|
499
501
|
var _a;
|
|
500
|
-
let groupOverlayCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(
|
|
502
|
+
let groupOverlayCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('group-overlay');
|
|
501
503
|
Array.from(groupOverlayCollection).forEach(groupOverlay => {
|
|
502
|
-
groupOverlay.classList.remove(
|
|
503
|
-
groupOverlay.setAttribute(
|
|
504
|
+
groupOverlay.classList.remove('presetedHeight');
|
|
505
|
+
groupOverlay.setAttribute('style', 'display:none');
|
|
504
506
|
});
|
|
505
507
|
}
|
|
506
508
|
getContainerItemBuilder(item, group, className) {
|
|
@@ -511,30 +513,39 @@ export class EzList {
|
|
|
511
513
|
if (customContent == undefined) {
|
|
512
514
|
return;
|
|
513
515
|
}
|
|
514
|
-
if (typeof customContent !==
|
|
515
|
-
return
|
|
516
|
+
if (typeof customContent !== 'string') {
|
|
517
|
+
return h("div", { class: className }, customContent);
|
|
516
518
|
}
|
|
517
|
-
return
|
|
519
|
+
return h("div", { class: className, innerHTML: customContent });
|
|
518
520
|
}
|
|
519
521
|
render() {
|
|
520
|
-
return (h(Host, { ref:
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
522
|
+
return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? (h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
523
|
+
this.keyDownHandler(event);
|
|
524
|
+
} }, this._listGroupItems.map(group => {
|
|
525
|
+
return (h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, h("label", { draggable: false, class: "group-name", title: group.group }, group.group), h("section", { class: "section-container", onDragOver: ev => ev.preventDefault() }, h("div", { class: "group-items-container" }, h("div", { class: "draggable-list" }, group.items.map((item, index) => (h("li", Object.assign({ id: 'item_' + this.getItemId(item.label), class: {
|
|
526
|
+
'selectable-container': this.ezSelectable,
|
|
527
|
+
'hover-feedback': this.hoverFeedback,
|
|
528
|
+
}, key: 'item_' + this.getItemId(item.label) }, {
|
|
529
|
+
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`),
|
|
530
|
+
}), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onClick: () => {
|
|
531
|
+
this.setSelection(item);
|
|
532
|
+
}, onDragLeave: () => {
|
|
533
|
+
group.sort ? undefined : this.removeOverClass();
|
|
534
|
+
}, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index), onDragOver: event => {
|
|
535
|
+
group.sort ? undefined : this.onDragOverItem(event);
|
|
536
|
+
}, onDrop: event => this.onDrop(event, { groupName: group.group, item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, this.listMode === 'regular' ? (h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)) : (h("ez-check", { label: item.label, value: item.check, onEzChange: evt => this.ezCheckChange.emit({ id: item.id, label: item.label, check: evt.detail }) }))), this.itemSlotBuilder ? this.getContainerItemBuilder(item, group, 'slot-item') : undefined))))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
|
|
537
|
+
this.onDragOverLastIndex(event);
|
|
538
|
+
}, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event, group) })), group.sort ? (h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" }, "Mover para ", group.group)) : undefined)));
|
|
539
|
+
}))) : (h("div", { class: "items-container", ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
540
|
+
this.keyDownHandler(event);
|
|
541
|
+
} }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + this.getItemId(item.label), class: {
|
|
542
|
+
'selectable-container': this.ezSelectable,
|
|
543
|
+
'hover-feedback': this.hoverFeedback,
|
|
544
|
+
}, key: 'item_' + this.getItemId(item.label) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`) }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index }), onClick: () => {
|
|
545
|
+
this.setSelection(item);
|
|
546
|
+
}, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.listMode === 'regular' ? (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("ez-check", { label: item.label, value: item.check, onEzChange: evt => this.ezCheckChange.emit({ id: item.id, label: item.label, check: evt.detail }) })))), this.itemSlotBuilder ? this.getContainerItemBuilder(item) : undefined)))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
|
|
547
|
+
this.onDragOverLastIndex(event);
|
|
548
|
+
}, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) }))))));
|
|
538
549
|
}
|
|
539
550
|
static get is() { return "ez-list"; }
|
|
540
551
|
static get encapsulation() { return "shadow"; }
|
|
@@ -596,7 +607,7 @@ export class EzList {
|
|
|
596
607
|
},
|
|
597
608
|
"attribute": "list-mode",
|
|
598
609
|
"reflect": false,
|
|
599
|
-
"defaultValue": "
|
|
610
|
+
"defaultValue": "'regular'"
|
|
600
611
|
},
|
|
601
612
|
"useGroups": {
|
|
602
613
|
"type": "boolean",
|
|
@@ -715,7 +726,7 @@ export class EzList {
|
|
|
715
726
|
"text": "Emitido quando acontece a altera\u00E7\u00E3o de estado da lista."
|
|
716
727
|
},
|
|
717
728
|
"complexType": {
|
|
718
|
-
"original": "Array<ListItem|ListGroup>",
|
|
729
|
+
"original": "Array<ListItem | ListGroup>",
|
|
719
730
|
"resolved": "(ListItem | ListGroup)[]",
|
|
720
731
|
"references": {
|
|
721
732
|
"Array": {
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
grid-template-rows: 0 auto 1fr auto;
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
6
|
+
|
|
7
|
+
/* @doc Define o tamanho do header e do footer com os espaçamentos necessários para scroll no content. */
|
|
8
|
+
--ez-modal-container__content--subtract-height: 154px;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
.ez-modal-container__header{
|
|
@@ -13,8 +16,11 @@
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.ez-modal-container__content {
|
|
19
|
+
display: flex;
|
|
16
20
|
overflow-y: auto;
|
|
17
21
|
overflow-x: clip;
|
|
22
|
+
|
|
23
|
+
height: calc(100vh - var(--ez-modal-container__content--subtract-height));
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
.ez-modal-container__title{
|
|
@@ -33,6 +39,11 @@
|
|
|
33
39
|
|
|
34
40
|
.ez-modal-container__focus-ctrl{
|
|
35
41
|
height: 0px;
|
|
42
|
+
width: 0px;
|
|
36
43
|
background-color: transparent;
|
|
37
44
|
border: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ez-modal-container__footer{
|
|
48
|
+
padding-top: var(--space--small, 6px);
|
|
38
49
|
}
|
|
@@ -32,7 +32,7 @@ export class EzModalContainer {
|
|
|
32
32
|
this._closeButton.focus();
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), this.showTitleBar && h("div", { class: "ez-modal-container__header ez-margin-bottom--large ez-align--middle" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle) : undefined), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-flex ez-flex--justify-end" }, this.cancelIsVisible() ? h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) }) : undefined, this.okIsVisible() ? h("ez-button", { ref: ref => this._okButton = ref, label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, class: "ez-button--primary ez-margin-left--medium", onClick: () => this.ezModalAction.emit(ModalAction.OK) }) : undefined), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
35
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), this.showTitleBar && h("div", { class: "ez-modal-container__header ez-margin-bottom--large ez-align--middle" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle) : undefined), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-flex ez-flex--justify-end ez-modal-container__footer" }, this.cancelIsVisible() ? h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) }) : undefined, this.okIsVisible() ? h("ez-button", { ref: ref => this._okButton = ref, label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, class: "ez-button--primary ez-margin-left--medium", onClick: () => this.ezModalAction.emit(ModalAction.OK) }) : undefined), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "ez-modal-container"; }
|
|
38
38
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--ez-check--outter-gap: 0px;
|
|
3
|
+
|
|
4
|
+
display: block;
|
|
5
|
+
width: 304px;
|
|
6
|
+
height: 322px;
|
|
7
|
+
max-height: calc(100vh - 350px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.multi-selection__input {
|
|
11
|
+
margin-bottom: var(--space--2xs, 8px);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.multi-selection__content-options {
|
|
15
|
+
position: relative;
|
|
16
|
+
top: -12px;
|
|
17
|
+
left: -4px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.multi-selection__select-all {
|
|
21
|
+
height: var(--space--xl);
|
|
22
|
+
margin: 0 var(--space--small, 6px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.multi-selection__list {
|
|
26
|
+
height: 235px;
|
|
27
|
+
max-height: calc(100vh - 435px);
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
overflow-x: clip;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.multi-selection__list::-webkit-scrollbar {
|
|
33
|
+
width: var(--space--small);
|
|
34
|
+
min-width: var(--space--small);
|
|
35
|
+
max-width: var(--space--small);
|
|
36
|
+
}
|