@sankhyalabs/ezui 1.1.92 → 1.1.93

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.
Files changed (35) hide show
  1. package/dist/cjs/ez-button_11.cjs.entry.js +190 -107
  2. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-form.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  8. package/dist/cjs/{index-a92e6d04.js → index-5c8eb919.js} +2 -2
  9. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +16 -0
  10. package/dist/collection/components/ez-list/ez-list.css +23 -2
  11. package/dist/collection/components/ez-list/ez-list.js +136 -66
  12. package/dist/collection/utils/index.js +2 -0
  13. package/dist/custom-elements/index.js +135 -52
  14. package/dist/esm/ez-button_11.entry.js +190 -107
  15. package/dist/esm/ez-calendar.entry.js +1 -1
  16. package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
  17. package/dist/esm/ez-combo-box.entry.js +1 -1
  18. package/dist/esm/ez-form.entry.js +1 -1
  19. package/dist/esm/ez-popover.entry.js +1 -1
  20. package/dist/esm/ez-time-input.entry.js +1 -1
  21. package/dist/esm/{index-4fb1605f.js → index-4688c617.js} +1 -1
  22. package/dist/ezui/ezui.esm.js +1 -1
  23. package/dist/ezui/{p-d22db59d.entry.js → p-278ce681.entry.js} +1 -1
  24. package/dist/ezui/{p-038fd0cb.entry.js → p-33d1247f.entry.js} +1 -1
  25. package/dist/ezui/{p-552a0b2e.entry.js → p-4b5c4408.entry.js} +1 -1
  26. package/dist/ezui/{p-0094463f.entry.js → p-5793a2e1.entry.js} +1 -1
  27. package/dist/ezui/{p-60469339.entry.js → p-68f6b75e.entry.js} +1 -1
  28. package/dist/ezui/{p-7e0281cd.entry.js → p-7e1d9c29.entry.js} +1 -1
  29. package/dist/ezui/{p-f0137439.js → p-7ff8b7f7.js} +1 -1
  30. package/dist/ezui/{p-d4386e30.entry.js → p-ca42d682.entry.js} +2 -2
  31. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
  32. package/dist/types/components/ez-list/ez-list.d.ts +11 -6
  33. package/dist/types/components.d.ts +2 -2
  34. package/dist/types/utils/index.d.ts +2 -0
  35. package/package.json +1 -1
@@ -143,7 +143,7 @@ export class EzList {
143
143
  this.createList();
144
144
  }
145
145
  onDrop(ev, dragEndItem) {
146
- this.removeOverClass(ev);
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(ev) {
224
- if (ev.target.__proto__ == HTMLDivElement.prototype && ev.target.classList.contains("draggable")) {
225
- ev.target.classList.add('over');
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
- groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.add('overGroup');
275
+ groupOverlay.classList.add("presetedHeight");
276
+ groupOverlay.setAttribute("style", "display:grid");
277
+ groupOverlay.scrollIntoView(false);
237
278
  }
238
279
  }
239
280
  }
240
- removeOverClass(ev) {
241
- ev.target.classList.remove('over');
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
- if (group.items.length > 0) {
247
- let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
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(event, item, group, index) {
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, group) {
441
+ onDragOverItem(event) {
391
442
  if (this._dragStartItem) {
392
443
  event.preventDefault();
393
- if (group) {
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, onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDrop: () => this.onDropGroup(group) },
410
- h("label", { class: "group-name", onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDrop: () => this.onDropGroup(group) }, group.group),
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: (event) => { group.sort ? undefined : this.removeOverClass(event); }, onDragEnd: () => this.onDragEnd(), onDragStart: (event) => this.onDragStart(event, item, group, index), onDragOver: (event) => this.onDragOverItem(event, group), onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable },
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
- h("div", { class: "group-overlay" },
424
- h("div", { id: "overlay-text" },
425
- h("b", null, "Mover"),
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" }, this._listItems.map((item, index) => {
432
- return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) },
433
- h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: (event) => this.onDragStart(event, { item: item, index: index }), onClick: () => { this.setSelection(item); }, onDragLeave: event => this.removeOverClass(event), onDragOver: (event) => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDrop(event, { item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable },
434
- h("div", { class: "item-content" },
435
- this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined,
436
- h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)),
437
- this.itemSlotBuilder ?
438
- h("div", null, this.itemSlotBuilder(item))
439
- : undefined));
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": "Fun\u00E7\u00E3o respons\u00E1vel por renderizar um conte\u00FAdo dentro do item da lista."
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
  }; }
@@ -0,0 +1,2 @@
1
+ export { default as ApplicationUtils } from './ApplicationUtils';
2
+ export { default as CSSVarsUtils } from './CSSVarsUtils';
@@ -119472,6 +119472,19 @@ class AgGridController {
119472
119472
  this._menuItems = [];
119473
119473
  this._enterprise = enterprise;
119474
119474
  }
119475
+ getSort() {
119476
+ const sortedColumns = [];
119477
+ this._gridOptions.api.getSortModel().forEach(({ colId, sort }) => {
119478
+ if (sort) {
119479
+ const field = this._dataUnit.getField(colId);
119480
+ const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
119481
+ const sortField = field ? { field: field.name, dataType: field.dataType, mode } : { field: colId, dataType: DataType.TEXT, mode };
119482
+ sortedColumns.push(sortField);
119483
+ }
119484
+ });
119485
+ return sortedColumns;
119486
+ }
119487
+ ;
119475
119488
  initDatagrid(container, options) {
119476
119489
  if (this._grid === undefined) {
119477
119490
  this._columnStateChangeCallback = options.onColumnStateChange;
@@ -119482,6 +119495,7 @@ class AgGridController {
119482
119495
  this._pageSize = options.pageSize;
119483
119496
  this._serverURL = options.serverURL;
119484
119497
  this._dataUnit = options.dataUnit;
119498
+ this._dataUnit.sortingProvider = this;
119485
119499
  this._gridOptions = {
119486
119500
  localeText: gridTerms,
119487
119501
  rowModelType: "serverSide",
@@ -119992,7 +120006,7 @@ let EzLabelChip$1 = class extends HTMLElement$1 {
119992
120006
  static get style() { return ezLabelChipCss; }
119993
120007
  };
119994
120008
 
119995
- const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon__padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item__margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Sora\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item__border-radius:var(--border--radius-small, 6px);--ez-list__selected-item__background:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Sora\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group__overlay--font-family:var(--font-pattern, \"Sora\");--ez-list__group__overlay--font-size:var(--text--medium, 14px);--ez-list__group-container__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__group-container__scrollbar--width:var(--space--medium, 12px);--ez-list__group-container__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__draggable__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__draggable__scrollbar--width:var(--space--medium, 12px);--ez-list__draggable__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}.draggable{display:flex;align-items:center;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:center;align-items:center}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%;padding-bottom:var(--space--small)}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item__margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable__icon--image);mask-image:var(--ez-list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom)}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:#f0f2f5}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container__scrollbar--background-color);border-radius:var(--ez-list__group-container__scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__group-container__scrollbar--width);max-width:var(--ez-list__group-container__scrollbar--width);min-width:var(--ez-list__group-container__scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:#f0f2f5}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.group-overlay{font-family:var(--ez-list__group__overlay--font-family);font-size:var(--ez-list__group__overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item__background);border-radius:var(--ez-list__selected-item__border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
120009
+ const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon__padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item__margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Sora\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item__border-radius:var(--border--radius-small, 6px);--ez-list__selected-item__background:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Sora\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group__overlay--font-family:var(--font-pattern, \"Sora\");--ez-list__group__overlay--font-size:var(--text--medium, 14px);--ez-list__group-container__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__group-container__scrollbar--width:var(--space--medium, 12px);--ez-list__group-container__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__draggable__list--padding-bottom:var(--space--small, 6px);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__draggable__scrollbar--width:var(--space--medium, 12px);--ez-list__draggable__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}p{margin:0}.draggable{display:flex;align-items:center;border-top:1px dashed #fff;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:center;align-items:center}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item__margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space{height:var(--ez-list__last-droppable-space--height)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable__icon--image);mask-image:var(--ez-list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom);-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:#f0f2f5}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container__scrollbar--background-color);border-radius:var(--ez-list__group-container__scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__group-container__scrollbar--width);max-width:var(--ez-list__group-container__scrollbar--width);min-width:var(--ez-list__group-container__scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:#f0f2f5}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.group-overlay{font-family:var(--ez-list__group__overlay--font-family);font-size:var(--ez-list__group__overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.presetedHeight{min-height:100px}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item__background);border-radius:var(--ez-list__selected-item__border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
119996
120010
 
119997
120011
  let EzList$1 = class extends HTMLElement$1 {
119998
120012
  constructor() {
@@ -120140,7 +120154,7 @@ let EzList$1 = class extends HTMLElement$1 {
120140
120154
  this.createList();
120141
120155
  }
120142
120156
  onDrop(ev, dragEndItem) {
120143
- this.removeOverClass(ev);
120157
+ this.removeOverClass();
120144
120158
  this.setSelection(undefined);
120145
120159
  if (this._dragStartItem) {
120146
120160
  if (this.useGroups) {
@@ -120176,6 +120190,39 @@ let EzList$1 = class extends HTMLElement$1 {
120176
120190
  }
120177
120191
  ev.stopPropagation();
120178
120192
  }
120193
+ onDropLastIndex(ev, groupDropped) {
120194
+ this.removeOverClass();
120195
+ this.setSelection(undefined);
120196
+ if (this._dragStartItem) {
120197
+ if (this.useGroups) {
120198
+ let newList = [...this._listGroupItems];
120199
+ let groupEnd = this._listGroupItems.find(group => groupDropped.group == group.group);
120200
+ //Remove item arrastado
120201
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
120202
+ //Adiciona item arrastado
120203
+ newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
120204
+ if (groupEnd.sort) {
120205
+ newList.find(group => group.group == groupDropped.group).items.sort(function (a, b) {
120206
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
120207
+ });
120208
+ if (groupEnd.sort === "DSC") {
120209
+ newList.find(group => group.group == groupDropped.group).items.reverse();
120210
+ }
120211
+ }
120212
+ this._listGroupItems = newList;
120213
+ this.ezChange.emit(this._listGroupItems);
120214
+ }
120215
+ else {
120216
+ let newList = [...this._listItems];
120217
+ newList.splice(this._dragStartItem.index, 1);
120218
+ newList.push(this._dragStartItem.item);
120219
+ this._listItems = newList;
120220
+ this._listItemsHistory = newList;
120221
+ this.ezChange.emit(this._listItems);
120222
+ }
120223
+ }
120224
+ ev.stopPropagation();
120225
+ }
120179
120226
  onDropGroup(groupSelected) {
120180
120227
  var _a;
120181
120228
  let newList = [...this._listGroupItems];
@@ -120209,6 +120256,9 @@ let EzList$1 = class extends HTMLElement$1 {
120209
120256
  }
120210
120257
  onDragEnd() {
120211
120258
  this._dragStartItem = undefined;
120259
+ if (this.useGroups) {
120260
+ this.hideOverlays();
120261
+ }
120212
120262
  if (this._draggingElement) {
120213
120263
  try {
120214
120264
  this._element.shadowRoot.removeChild(this._draggingElement);
@@ -120217,65 +120267,74 @@ let EzList$1 = class extends HTMLElement$1 {
120217
120267
  this._draggingElement = undefined;
120218
120268
  }
120219
120269
  }
120220
- addOverClass(ev) {
120221
- if (ev.target.__proto__ == HTMLDivElement.prototype && ev.target.classList.contains("draggable")) {
120222
- ev.target.classList.add('over');
120270
+ addOverClass(element) {
120271
+ if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains("draggable")) {
120272
+ element.classList.add('over');
120273
+ }
120274
+ else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains("draggable-list")) {
120275
+ this.addOverClass(element.parentElement);
120223
120276
  }
120224
120277
  }
120225
120278
  addOverGroupClass(ev, group) {
120226
120279
  if (ev.target) {
120227
120280
  let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
120281
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
120228
120282
  if (group.items.length > 0) {
120229
- let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
120230
120283
  groupOverlay.setAttribute("style", "display:grid");
120231
120284
  }
120232
120285
  else {
120233
- groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.add('overGroup');
120286
+ groupOverlay.classList.add("presetedHeight");
120287
+ groupOverlay.setAttribute("style", "display:grid");
120288
+ groupOverlay.scrollIntoView(false);
120234
120289
  }
120235
120290
  }
120236
120291
  }
120237
- removeOverClass(ev) {
120238
- ev.target.classList.remove('over');
120292
+ removeOverClass() {
120293
+ var _a, _b;
120294
+ let overCollection;
120295
+ let overLastDroppableCollection;
120296
+ if (this.useGroups) {
120297
+ overCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('over');
120298
+ overLastDroppableCollection = this._groupContainer.getElementsByClassName('last-droppable-space');
120299
+ }
120300
+ else {
120301
+ overCollection = (_b = this._itemContainer) === null || _b === void 0 ? void 0 : _b.getElementsByClassName('over');
120302
+ overLastDroppableCollection = this._itemContainer.getElementsByClassName('last-droppable-space');
120303
+ }
120304
+ if (overCollection) {
120305
+ Array.from(overCollection).forEach(function (element) {
120306
+ element.classList.remove('over');
120307
+ });
120308
+ }
120309
+ if (overLastDroppableCollection) {
120310
+ Array.from(overLastDroppableCollection).forEach(function (element) {
120311
+ element.classList.remove('over');
120312
+ });
120313
+ }
120239
120314
  }
120240
120315
  removeOverGroupClass(ev, group) {
120241
120316
  if (ev.target) {
120242
120317
  let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
120243
- if (group.items.length > 0) {
120244
- let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
120318
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
120319
+ if (groupOverlay) {
120320
+ groupOverlay.classList.remove("presetedHeight");
120245
120321
  groupOverlay.setAttribute("style", "display:none");
120246
120322
  }
120247
- else {
120248
- groupContainer === null || groupContainer === void 0 ? void 0 : groupContainer.classList.remove('overGroup');
120249
- }
120250
120323
  }
120251
120324
  }
120252
- onDragStart(event, item, group, index) {
120325
+ onDragStart(item, group, index) {
120326
+ if (this._changeDeboucingTimeout) {
120327
+ window.clearTimeout(this._changeDeboucingTimeout);
120328
+ }
120253
120329
  if (this.useGroups) {
120254
120330
  this._dragStartItem = { groupName: group.group, item: item, index: index };
120331
+ this._changeDeboucingTimeout = window.setTimeout(() => {
120332
+ this.showOverlays(group);
120333
+ }, 10);
120255
120334
  }
120256
120335
  else {
120257
120336
  this._dragStartItem = { item: item.item, index: item.index };
120258
120337
  }
120259
- let sourceElement = event.srcElement.cloneNode(true);
120260
- this._draggingElement = event.srcElement.cloneNode(true);
120261
- this._draggingElement.style.position = "absolute";
120262
- this._draggingElement.style.top = (event.clientY + 5) + 'px';
120263
- this._draggingElement.style.left = (event.clientX + 5) + 'px';
120264
- this._draggingElement.style.height = event.srcElement.clientHeight + 'px';
120265
- this._draggingElement.style.width = event.srcElement.clientWidth + 'px';
120266
- this._draggingElement.style.background = "#FFFFFF";
120267
- this._draggingElement.style.border = "1px solid #008561";
120268
- this._draggingElement.style["box-sizing"] = "border-box";
120269
- this._draggingElement.style["box-shadow"] = "0px 0px 16px rgba(0, 38, 111, 0.122)";
120270
- this._draggingElement.style["border-radius"] = "6px";
120271
- this._element.shadowRoot.appendChild(this._draggingElement);
120272
- event.dataTransfer.setDragImage(sourceElement, -10000, -10000);
120273
- }
120274
- onDrag(event) {
120275
- if (this._draggingElement) {
120276
- this._draggingElement.style.top = (event.clientY + 5) + 'px';
120277
- this._draggingElement.style.left = (event.clientX + 5) + 'px';
120278
- }
120279
120338
  }
120280
120339
  selectFirstItem() {
120281
120340
  if (this.useGroups) {
@@ -120378,43 +120437,67 @@ let EzList$1 = class extends HTMLElement$1 {
120378
120437
  }
120379
120438
  return undefined;
120380
120439
  }
120440
+ getGroupOverlayId(groupName) {
120441
+ if (groupName) {
120442
+ return "group-overlay-" + groupName.replace(/[^a-z0-9_]/gi, "_");
120443
+ }
120444
+ return undefined;
120445
+ }
120381
120446
  onDragOverGroup(event, group) {
120382
- if (this._dragStartItem && this._dragStartItem.groupName !== group.group) {
120447
+ if (this._dragStartItem && this._dragStartItem.groupName !== group.group && group.sort) {
120383
120448
  event.preventDefault();
120384
120449
  this.addOverGroupClass(event, group);
120385
120450
  }
120386
120451
  }
120387
- onDragOverItem(event, group) {
120452
+ onDragOverItem(event) {
120388
120453
  if (this._dragStartItem) {
120389
120454
  event.preventDefault();
120390
- if (group) {
120391
- group.sort ?
120392
- () => {
120393
- this.addOverGroupClass(event, group);
120394
- }
120395
- : this.addOverClass(event);
120396
- }
120397
- else {
120398
- this.addOverClass(event);
120399
- }
120455
+ this.addOverClass(event.target);
120400
120456
  event.stopPropagation();
120401
120457
  }
120402
120458
  }
120459
+ onDragOverLastIndex(ev) {
120460
+ ev.preventDefault();
120461
+ if (this._dragStartItem) {
120462
+ ev.target.classList.add('over');
120463
+ ev.stopPropagation();
120464
+ }
120465
+ }
120466
+ showOverlays(groupDragStart) {
120467
+ let groupOverlayCollection = this._groupContainer.getElementsByClassName("group-overlay");
120468
+ Array.from(groupOverlayCollection).forEach(groupOverlay => {
120469
+ let groupOverlayID = this.getGroupOverlayId(groupDragStart.group);
120470
+ if (groupOverlayID && groupOverlay.getAttribute("id") && groupOverlayID != groupOverlay.getAttribute("id")) {
120471
+ groupOverlay.classList.add("presetedHeight");
120472
+ groupOverlay.setAttribute("style", "display:grid");
120473
+ }
120474
+ });
120475
+ }
120476
+ hideOverlays() {
120477
+ var _a;
120478
+ let groupOverlayCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("group-overlay");
120479
+ Array.from(groupOverlayCollection).forEach(groupOverlay => {
120480
+ groupOverlay.classList.remove("presetedHeight");
120481
+ groupOverlay.setAttribute("style", "display:none");
120482
+ });
120483
+ }
120403
120484
  render() {
120404
120485
  return (h(Host, { ref: (el) => this._element = el }, this.useGroups ?
120405
120486
  h("div", { class: "group-container", ref: (el) => this._groupContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, this._listGroupItems.map(group => {
120406
- return h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDrop: () => this.onDropGroup(group) }, h("label", { class: "group-name", onDragLeave: (event) => { this.removeOverGroupClass(event, group); }, onDragOver: (event) => { this.onDragOverGroup(event, group); }, onDragEnd: (event) => { this.onDragEnd(); this.removeOverGroupClass(event, group); }, onDrop: () => this.onDropGroup(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) => {
120407
- return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onClick: () => { this.setSelection(item); }, onDragLeave: (event) => { group.sort ? undefined : this.removeOverClass(event); }, onDragEnd: () => this.onDragEnd(), onDragStart: (event) => this.onDragStart(event, item, group, index), onDragOver: (event) => this.onDragOverItem(event, group), onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
120487
+ 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" }, 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) => {
120488
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, 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 }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
120408
120489
  h("div", { class: "slot-item" }, this.itemSlotBuilder(item, group))
120409
120490
  : undefined));
120410
- }))), h("div", { class: "group-overlay" }, h("div", { id: "overlay-text" }, h("b", null, "Mover"), " para ", group.group))));
120491
+ })), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event, group) })), group.sort ?
120492
+ h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" }, "Mover para ", group.group)
120493
+ : undefined));
120411
120494
  }))
120412
120495
  :
120413
120496
  h("div", { class: "items-container", ref: (el) => this._itemContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => {
120414
- return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: (event) => this.onDragStart(event, { item: item, index: index }), onClick: () => { this.setSelection(item); }, onDragLeave: event => this.removeOverClass(event), onDragOver: (event) => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDrop(event, { item: item, index: index }), onDrag: (event) => this.onDrag(event), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
120497
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, 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 }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
120415
120498
  h("div", null, this.itemSlotBuilder(item))
120416
120499
  : undefined));
120417
- })))));
120500
+ }), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event) })))));
120418
120501
  }
120419
120502
  static get style() { return ezListCss; }
120420
120503
  };