@sankhyalabs/ezui 1.1.91 → 1.1.94
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-button_11.cjs.entry.js +190 -107
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +3 -3
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/{index-a92e6d04.js → index-5c8eb919.js} +2 -2
- package/dist/collection/components/ez-dialog/ez-dialog.css +14 -2
- package/dist/collection/components/ez-dialog/ez-dialog.js +3 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +16 -0
- package/dist/collection/components/ez-list/ez-list.css +23 -2
- package/dist/collection/components/ez-list/ez-list.js +136 -66
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.js +138 -55
- package/dist/esm/ez-button_11.entry.js +190 -107
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +3 -3
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/{index-4fb1605f.js → index-4688c617.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-d22db59d.entry.js → p-278ce681.entry.js} +1 -1
- package/dist/ezui/{p-038fd0cb.entry.js → p-33d1247f.entry.js} +1 -1
- package/dist/ezui/{p-552a0b2e.entry.js → p-4b5c4408.entry.js} +1 -1
- package/dist/ezui/{p-0094463f.entry.js → p-5793a2e1.entry.js} +1 -1
- package/dist/ezui/{p-60469339.entry.js → p-68f6b75e.entry.js} +1 -1
- package/dist/ezui/{p-7e0281cd.entry.js → p-7e1d9c29.entry.js} +1 -1
- package/dist/ezui/{p-f0137439.js → p-7ff8b7f7.js} +1 -1
- package/dist/ezui/{p-d4386e30.entry.js → p-ca42d682.entry.js} +2 -2
- package/dist/ezui/p-e06e47f1.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
- package/dist/types/components/ez-list/ez-list.d.ts +11 -6
- package/dist/types/components.d.ts +2 -2
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/ezui/p-020f1285.entry.js +0 -1
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
/*@doc Define a cor do texto da mensagem.*/
|
|
38
38
|
--dialog__body--color: var(--text--primary, #626e82);
|
|
39
39
|
|
|
40
|
+
/* Ícones */
|
|
41
|
+
/*@doc Define a cor dos ícones dos indicadores de modo.*/
|
|
42
|
+
--dialog__icon--color: var(--text--inverted, #fff);
|
|
40
43
|
/*@doc Define a cor de fundo dos indicadores do modo crítico.*/
|
|
41
44
|
--dialog__critical--background-color: var(--color--alert-error-800, #BD0025);
|
|
42
45
|
/*@doc Define a cor de fundo da lista de opções.*/
|
|
@@ -130,8 +133,17 @@ h2 {
|
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
.changeable__icon {
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
background: var(--dialog__warning--background-color);
|
|
137
|
+
color: var(--dialog__icon--color);
|
|
138
|
+
display: grid;
|
|
139
|
+
place-items: center;
|
|
140
|
+
width: 26px;
|
|
141
|
+
height: 26px;
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.changeable__icon.critical{
|
|
146
|
+
background: var(--dialog__critical--background-color);
|
|
135
147
|
}
|
|
136
148
|
|
|
137
149
|
.title {
|
|
@@ -69,14 +69,12 @@ export class EzDialog {
|
|
|
69
69
|
h("div", { class: "title__container" },
|
|
70
70
|
h("div", { class: "title__box" },
|
|
71
71
|
this._currentMessage.icon ?
|
|
72
|
-
h("
|
|
73
|
-
h("use", { xlinkHref: this._currentMessage.icon }))
|
|
72
|
+
h("ez-icon", { class: this._currentMessage.critical ? "changeable__icon critical" : "changeable__icon", size: "small", iconName: this._currentMessage.icon })
|
|
74
73
|
:
|
|
75
74
|
h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }),
|
|
76
|
-
h("div", { class: "title title--label" },
|
|
77
|
-
h("h2", null, this._currentMessage.title))),
|
|
75
|
+
h("div", { class: "title title--label", innerHTML: this._currentMessage.title })),
|
|
78
76
|
h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })),
|
|
79
|
-
h("div", { class: "message"
|
|
77
|
+
h("div", { class: "message", innerHTML: this._currentMessage.message }),
|
|
80
78
|
this._currentMessage.confirm ?
|
|
81
79
|
h("div", { class: "button-yes-no__container" },
|
|
82
80
|
h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }),
|
|
@@ -3,11 +3,26 @@ import { Grid } from "ag-grid-community";
|
|
|
3
3
|
import gridTerms from "./i18n/pt-BR.js";
|
|
4
4
|
import HeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
|
|
5
5
|
import DataSource from "./DataSource";
|
|
6
|
+
import { DataType } from "@sankhyalabs/core";
|
|
7
|
+
import { SortMode } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
|
|
6
8
|
export default class AgGridController {
|
|
7
9
|
constructor(enterprise) {
|
|
8
10
|
this._menuItems = [];
|
|
9
11
|
this._enterprise = enterprise;
|
|
10
12
|
}
|
|
13
|
+
getSort() {
|
|
14
|
+
const sortedColumns = [];
|
|
15
|
+
this._gridOptions.api.getSortModel().forEach(({ colId, sort }) => {
|
|
16
|
+
if (sort) {
|
|
17
|
+
const field = this._dataUnit.getField(colId);
|
|
18
|
+
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
19
|
+
const sortField = field ? { field: field.name, dataType: field.dataType, mode } : { field: colId, dataType: DataType.TEXT, mode };
|
|
20
|
+
sortedColumns.push(sortField);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return sortedColumns;
|
|
24
|
+
}
|
|
25
|
+
;
|
|
11
26
|
initDatagrid(container, options) {
|
|
12
27
|
if (this._grid === undefined) {
|
|
13
28
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -18,6 +33,7 @@ export default class AgGridController {
|
|
|
18
33
|
this._pageSize = options.pageSize;
|
|
19
34
|
this._serverURL = options.serverURL;
|
|
20
35
|
this._dataUnit = options.dataUnit;
|
|
36
|
+
this._dataUnit.sortingProvider = this;
|
|
21
37
|
this._gridOptions = {
|
|
22
38
|
localeText: gridTerms,
|
|
23
39
|
rowModelType: "serverSide",
|
|
@@ -59,6 +59,12 @@
|
|
|
59
59
|
/* @doc Define a cor da borda pontilhada sobre os elementos da lista. */
|
|
60
60
|
--ez-list__over--border--color: var(--color--primary, #008561);
|
|
61
61
|
|
|
62
|
+
/*@doc Define o espaçamento do container de itens arrastáveis .*/
|
|
63
|
+
--ez-list__draggable__list--padding-bottom: var(--space--small, 6px);
|
|
64
|
+
|
|
65
|
+
/*@doc Define a altura do container para arrasto para última posição .*/
|
|
66
|
+
--ez-list__last-droppable-space--height: var(--space--small, 6px);
|
|
67
|
+
|
|
62
68
|
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
63
69
|
--ez-list__draggable__scrollbar--border-radius: var(--border--radius-large, 24px);
|
|
64
70
|
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
@@ -75,9 +81,14 @@
|
|
|
75
81
|
z-index: var(--ez-list__host--z-index);
|
|
76
82
|
}
|
|
77
83
|
|
|
84
|
+
p {
|
|
85
|
+
margin: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
.draggable {
|
|
79
89
|
display: flex;
|
|
80
90
|
align-items: center;
|
|
91
|
+
border-top: 1px dashed #fff;
|
|
81
92
|
justify-content: space-between;
|
|
82
93
|
background-color: #fff;
|
|
83
94
|
font-family: var(--ez-list__item--font-family);
|
|
@@ -117,8 +128,6 @@
|
|
|
117
128
|
margin: 0;
|
|
118
129
|
width: 100%;
|
|
119
130
|
max-height: 100%;
|
|
120
|
-
/* height: 100%; */
|
|
121
|
-
padding-bottom: var(--space--small);
|
|
122
131
|
}
|
|
123
132
|
|
|
124
133
|
.draggable-list li {
|
|
@@ -135,6 +144,10 @@
|
|
|
135
144
|
border-top: 1px dashed var(--ez-list__over--border--color);
|
|
136
145
|
}
|
|
137
146
|
|
|
147
|
+
.last-droppable-space {
|
|
148
|
+
height: var(--ez-list__last-droppable-space--height);
|
|
149
|
+
}
|
|
150
|
+
|
|
138
151
|
.draggable-selected {
|
|
139
152
|
background-color: var(--background--strong) !important;
|
|
140
153
|
}
|
|
@@ -207,6 +220,10 @@
|
|
|
207
220
|
font-size: var(--ez-list__group--font-size);
|
|
208
221
|
font-weight: var(--ez-list__group--font-weight);
|
|
209
222
|
padding-bottom: var(--ez-list__group--padding-bottom);
|
|
223
|
+
-webkit-user-select: none;
|
|
224
|
+
-moz-user-select: -moz-none;
|
|
225
|
+
-ms-user-select: none;
|
|
226
|
+
user-select: none;
|
|
210
227
|
}
|
|
211
228
|
|
|
212
229
|
.group {
|
|
@@ -286,6 +303,10 @@
|
|
|
286
303
|
cursor: pointer;
|
|
287
304
|
}
|
|
288
305
|
|
|
306
|
+
.presetedHeight {
|
|
307
|
+
min-height: 100px;
|
|
308
|
+
}
|
|
309
|
+
|
|
289
310
|
.overlay-text {
|
|
290
311
|
position: absolute;
|
|
291
312
|
top: 50%;
|
|
@@ -143,7 +143,7 @@ export class EzList {
|
|
|
143
143
|
this.createList();
|
|
144
144
|
}
|
|
145
145
|
onDrop(ev, dragEndItem) {
|
|
146
|
-
this.removeOverClass(
|
|
146
|
+
this.removeOverClass();
|
|
147
147
|
this.setSelection(undefined);
|
|
148
148
|
if (this._dragStartItem) {
|
|
149
149
|
if (this.useGroups) {
|
|
@@ -179,6 +179,39 @@ export class EzList {
|
|
|
179
179
|
}
|
|
180
180
|
ev.stopPropagation();
|
|
181
181
|
}
|
|
182
|
+
onDropLastIndex(ev, groupDropped) {
|
|
183
|
+
this.removeOverClass();
|
|
184
|
+
this.setSelection(undefined);
|
|
185
|
+
if (this._dragStartItem) {
|
|
186
|
+
if (this.useGroups) {
|
|
187
|
+
let newList = [...this._listGroupItems];
|
|
188
|
+
let groupEnd = this._listGroupItems.find(group => groupDropped.group == group.group);
|
|
189
|
+
//Remove item arrastado
|
|
190
|
+
newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
|
|
191
|
+
//Adiciona item arrastado
|
|
192
|
+
newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
|
|
193
|
+
if (groupEnd.sort) {
|
|
194
|
+
newList.find(group => group.group == groupDropped.group).items.sort(function (a, b) {
|
|
195
|
+
return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
|
|
196
|
+
});
|
|
197
|
+
if (groupEnd.sort === "DSC") {
|
|
198
|
+
newList.find(group => group.group == groupDropped.group).items.reverse();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
this._listGroupItems = newList;
|
|
202
|
+
this.ezChange.emit(this._listGroupItems);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
let newList = [...this._listItems];
|
|
206
|
+
newList.splice(this._dragStartItem.index, 1);
|
|
207
|
+
newList.push(this._dragStartItem.item);
|
|
208
|
+
this._listItems = newList;
|
|
209
|
+
this._listItemsHistory = newList;
|
|
210
|
+
this.ezChange.emit(this._listItems);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
ev.stopPropagation();
|
|
214
|
+
}
|
|
182
215
|
onDropGroup(groupSelected) {
|
|
183
216
|
var _a;
|
|
184
217
|
let newList = [...this._listGroupItems];
|
|
@@ -212,6 +245,9 @@ export class EzList {
|
|
|
212
245
|
}
|
|
213
246
|
onDragEnd() {
|
|
214
247
|
this._dragStartItem = undefined;
|
|
248
|
+
if (this.useGroups) {
|
|
249
|
+
this.hideOverlays();
|
|
250
|
+
}
|
|
215
251
|
if (this._draggingElement) {
|
|
216
252
|
try {
|
|
217
253
|
this._element.shadowRoot.removeChild(this._draggingElement);
|
|
@@ -220,65 +256,74 @@ export class EzList {
|
|
|
220
256
|
this._draggingElement = undefined;
|
|
221
257
|
}
|
|
222
258
|
}
|
|
223
|
-
addOverClass(
|
|
224
|
-
if (
|
|
225
|
-
|
|
259
|
+
addOverClass(element) {
|
|
260
|
+
if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains("draggable")) {
|
|
261
|
+
element.classList.add('over');
|
|
262
|
+
}
|
|
263
|
+
else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains("draggable-list")) {
|
|
264
|
+
this.addOverClass(element.parentElement);
|
|
226
265
|
}
|
|
227
266
|
}
|
|
228
267
|
addOverGroupClass(ev, group) {
|
|
229
268
|
if (ev.target) {
|
|
230
269
|
let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
|
|
270
|
+
let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
|
|
231
271
|
if (group.items.length > 0) {
|
|
232
|
-
let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
|
|
233
272
|
groupOverlay.setAttribute("style", "display:grid");
|
|
234
273
|
}
|
|
235
274
|
else {
|
|
236
|
-
|
|
275
|
+
groupOverlay.classList.add("presetedHeight");
|
|
276
|
+
groupOverlay.setAttribute("style", "display:grid");
|
|
277
|
+
groupOverlay.scrollIntoView(false);
|
|
237
278
|
}
|
|
238
279
|
}
|
|
239
280
|
}
|
|
240
|
-
removeOverClass(
|
|
241
|
-
|
|
281
|
+
removeOverClass() {
|
|
282
|
+
var _a, _b;
|
|
283
|
+
let overCollection;
|
|
284
|
+
let overLastDroppableCollection;
|
|
285
|
+
if (this.useGroups) {
|
|
286
|
+
overCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('over');
|
|
287
|
+
overLastDroppableCollection = this._groupContainer.getElementsByClassName('last-droppable-space');
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
overCollection = (_b = this._itemContainer) === null || _b === void 0 ? void 0 : _b.getElementsByClassName('over');
|
|
291
|
+
overLastDroppableCollection = this._itemContainer.getElementsByClassName('last-droppable-space');
|
|
292
|
+
}
|
|
293
|
+
if (overCollection) {
|
|
294
|
+
Array.from(overCollection).forEach(function (element) {
|
|
295
|
+
element.classList.remove('over');
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
if (overLastDroppableCollection) {
|
|
299
|
+
Array.from(overLastDroppableCollection).forEach(function (element) {
|
|
300
|
+
element.classList.remove('over');
|
|
301
|
+
});
|
|
302
|
+
}
|
|
242
303
|
}
|
|
243
304
|
removeOverGroupClass(ev, group) {
|
|
244
305
|
if (ev.target) {
|
|
245
306
|
let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
|
|
246
|
-
|
|
247
|
-
|
|
307
|
+
let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
|
|
308
|
+
if (groupOverlay) {
|
|
309
|
+
groupOverlay.classList.remove("presetedHeight");
|
|
248
310
|
groupOverlay.setAttribute("style", "display:none");
|
|
249
311
|
}
|
|
250
|
-
else {
|
|
251
|
-
groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.remove('overGroup');
|
|
252
|
-
}
|
|
253
312
|
}
|
|
254
313
|
}
|
|
255
|
-
onDragStart(
|
|
314
|
+
onDragStart(item, group, index) {
|
|
315
|
+
if (this._changeDeboucingTimeout) {
|
|
316
|
+
window.clearTimeout(this._changeDeboucingTimeout);
|
|
317
|
+
}
|
|
256
318
|
if (this.useGroups) {
|
|
257
319
|
this._dragStartItem = { groupName: group.group, item: item, index: index };
|
|
320
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
321
|
+
this.showOverlays(group);
|
|
322
|
+
}, 10);
|
|
258
323
|
}
|
|
259
324
|
else {
|
|
260
325
|
this._dragStartItem = { item: item.item, index: item.index };
|
|
261
326
|
}
|
|
262
|
-
let sourceElement = event.srcElement.cloneNode(true);
|
|
263
|
-
this._draggingElement = event.srcElement.cloneNode(true);
|
|
264
|
-
this._draggingElement.style.position = "absolute";
|
|
265
|
-
this._draggingElement.style.top = (event.clientY + 5) + 'px';
|
|
266
|
-
this._draggingElement.style.left = (event.clientX + 5) + 'px';
|
|
267
|
-
this._draggingElement.style.height = event.srcElement.clientHeight + 'px';
|
|
268
|
-
this._draggingElement.style.width = event.srcElement.clientWidth + 'px';
|
|
269
|
-
this._draggingElement.style.background = "#FFFFFF";
|
|
270
|
-
this._draggingElement.style.border = "1px solid #008561";
|
|
271
|
-
this._draggingElement.style["box-sizing"] = "border-box";
|
|
272
|
-
this._draggingElement.style["box-shadow"] = "0px 0px 16px rgba(0, 38, 111, 0.122)";
|
|
273
|
-
this._draggingElement.style["border-radius"] = "6px";
|
|
274
|
-
this._element.shadowRoot.appendChild(this._draggingElement);
|
|
275
|
-
event.dataTransfer.setDragImage(sourceElement, -10000, -10000);
|
|
276
|
-
}
|
|
277
|
-
onDrag(event) {
|
|
278
|
-
if (this._draggingElement) {
|
|
279
|
-
this._draggingElement.style.top = (event.clientY + 5) + 'px';
|
|
280
|
-
this._draggingElement.style.left = (event.clientX + 5) + 'px';
|
|
281
|
-
}
|
|
282
327
|
}
|
|
283
328
|
selectFirstItem() {
|
|
284
329
|
if (this.useGroups) {
|
|
@@ -381,63 +426,88 @@ export class EzList {
|
|
|
381
426
|
}
|
|
382
427
|
return undefined;
|
|
383
428
|
}
|
|
429
|
+
getGroupOverlayId(groupName) {
|
|
430
|
+
if (groupName) {
|
|
431
|
+
return "group-overlay-" + groupName.replace(/[^a-z0-9_]/gi, "_");
|
|
432
|
+
}
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
|
384
435
|
onDragOverGroup(event, group) {
|
|
385
|
-
if (this._dragStartItem && this._dragStartItem.groupName !== group.group) {
|
|
436
|
+
if (this._dragStartItem && this._dragStartItem.groupName !== group.group && group.sort) {
|
|
386
437
|
event.preventDefault();
|
|
387
438
|
this.addOverGroupClass(event, group);
|
|
388
439
|
}
|
|
389
440
|
}
|
|
390
|
-
onDragOverItem(event
|
|
441
|
+
onDragOverItem(event) {
|
|
391
442
|
if (this._dragStartItem) {
|
|
392
443
|
event.preventDefault();
|
|
393
|
-
|
|
394
|
-
group.sort ?
|
|
395
|
-
() => {
|
|
396
|
-
this.addOverGroupClass(event, group);
|
|
397
|
-
}
|
|
398
|
-
: this.addOverClass(event);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
this.addOverClass(event);
|
|
402
|
-
}
|
|
444
|
+
this.addOverClass(event.target);
|
|
403
445
|
event.stopPropagation();
|
|
404
446
|
}
|
|
405
447
|
}
|
|
448
|
+
onDragOverLastIndex(ev) {
|
|
449
|
+
ev.preventDefault();
|
|
450
|
+
if (this._dragStartItem) {
|
|
451
|
+
ev.target.classList.add('over');
|
|
452
|
+
ev.stopPropagation();
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
showOverlays(groupDragStart) {
|
|
456
|
+
let groupOverlayCollection = this._groupContainer.getElementsByClassName("group-overlay");
|
|
457
|
+
Array.from(groupOverlayCollection).forEach(groupOverlay => {
|
|
458
|
+
let groupOverlayID = this.getGroupOverlayId(groupDragStart.group);
|
|
459
|
+
if (groupOverlayID && groupOverlay.getAttribute("id") && groupOverlayID != groupOverlay.getAttribute("id")) {
|
|
460
|
+
groupOverlay.classList.add("presetedHeight");
|
|
461
|
+
groupOverlay.setAttribute("style", "display:grid");
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
hideOverlays() {
|
|
466
|
+
var _a;
|
|
467
|
+
let groupOverlayCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("group-overlay");
|
|
468
|
+
Array.from(groupOverlayCollection).forEach(groupOverlay => {
|
|
469
|
+
groupOverlay.classList.remove("presetedHeight");
|
|
470
|
+
groupOverlay.setAttribute("style", "display:none");
|
|
471
|
+
});
|
|
472
|
+
}
|
|
406
473
|
render() {
|
|
407
474
|
return (h(Host, { ref: (el) => this._element = el }, this.useGroups ?
|
|
408
475
|
h("div", { class: "group-container", ref: (el) => this._groupContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, this._listGroupItems.map(group => {
|
|
409
|
-
return h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length,
|
|
410
|
-
h("label", { class: "group-name"
|
|
476
|
+
return h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) },
|
|
477
|
+
h("label", { draggable: false, class: "group-name" }, group.group),
|
|
411
478
|
h("section", { class: "section-container", onDragOver: (ev) => ev.preventDefault() },
|
|
412
479
|
h("div", { class: "group-items-container" },
|
|
413
480
|
h("div", { class: "draggable-list" }, group.items.map((item, index) => {
|
|
414
481
|
return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) },
|
|
415
|
-
h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onClick: () => { this.setSelection(item); }, onDragLeave: (
|
|
482
|
+
h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onClick: () => { this.setSelection(item); }, onDragLeave: () => { group.sort ? undefined : this.removeOverClass(); }, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index), onDragOver: (event) => { group.sort ? undefined : this.onDragOverItem(event); }, onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index }), draggable: this.ezDraggable },
|
|
416
483
|
h("div", { class: "item-content" },
|
|
417
484
|
this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined,
|
|
418
485
|
h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)),
|
|
419
486
|
this.itemSlotBuilder ?
|
|
420
487
|
h("div", { class: "slot-item" }, this.itemSlotBuilder(item, group))
|
|
421
488
|
: undefined));
|
|
422
|
-
}))
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
" para ",
|
|
427
|
-
group.group)
|
|
489
|
+
})),
|
|
490
|
+
h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event, group) })),
|
|
491
|
+
group.sort ?
|
|
492
|
+
h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" },
|
|
493
|
+
"Mover para ",
|
|
494
|
+
group.group)
|
|
495
|
+
: undefined));
|
|
428
496
|
}))
|
|
429
497
|
:
|
|
430
498
|
h("div", { class: "items-container", ref: (el) => this._itemContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } },
|
|
431
|
-
h("div", { class: "draggable-list" },
|
|
432
|
-
|
|
433
|
-
h("
|
|
434
|
-
h("div", { class: "item-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
499
|
+
h("div", { class: "draggable-list" },
|
|
500
|
+
this._listItems.map((item, index) => {
|
|
501
|
+
return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) },
|
|
502
|
+
h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: () => this.onDragStart({ item: item, index: index }), onClick: () => { this.setSelection(item); }, onDragLeave: () => this.removeOverClass(), onDragOver: (event) => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDrop(event, { item: item, index: index }), draggable: this.ezDraggable },
|
|
503
|
+
h("div", { class: "item-content" },
|
|
504
|
+
this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined,
|
|
505
|
+
h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)),
|
|
506
|
+
this.itemSlotBuilder ?
|
|
507
|
+
h("div", null, this.itemSlotBuilder(item))
|
|
508
|
+
: undefined));
|
|
509
|
+
}),
|
|
510
|
+
h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event) })))));
|
|
441
511
|
}
|
|
442
512
|
static get is() { return "ez-list"; }
|
|
443
513
|
static get encapsulation() { return "shadow"; }
|
|
@@ -534,7 +604,7 @@ export class EzList {
|
|
|
534
604
|
"optional": false,
|
|
535
605
|
"docs": {
|
|
536
606
|
"tags": [],
|
|
537
|
-
"text": "
|
|
607
|
+
"text": "Define se \u00E9 poss\u00EDvel selecionar mais de um registro.\n\n/**\nFun\u00E7\u00E3o respons\u00E1vel por renderizar um conte\u00FAdo dentro do item da lista."
|
|
538
608
|
}
|
|
539
609
|
}
|
|
540
610
|
}; }
|