@sankhyalabs/ezui 0.0.0-bugfix-dev-kb-74998.4 → 0.0.0-bugfix-dev-KB-75210.0

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 (91) hide show
  1. package/dist/cjs/{ez-card-item_3.cjs.entry.js → ez-card-item_2.cjs.entry.js} +0 -123
  2. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
  4. package/dist/cjs/ez-filter-input.cjs.entry.js +130 -0
  5. package/dist/cjs/ez-form-view.cjs.entry.js +8 -2
  6. package/dist/cjs/ez-grid.cjs.entry.js +777 -109
  7. package/dist/cjs/ez-list.cjs.entry.js +253 -205
  8. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-popup.cjs.entry.js +4 -1
  10. package/dist/cjs/ez-split-item.cjs.entry.js +3 -2
  11. package/dist/cjs/ez-split-panel.cjs.entry.js +54 -2
  12. package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
  13. package/dist/cjs/ezui.cjs.js +1 -1
  14. package/dist/cjs/filter-column.cjs.entry.js +2 -2
  15. package/dist/cjs/index-a7b0c73d.js +10 -2
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -0
  18. package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
  19. package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
  20. package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
  21. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  22. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +6 -2
  23. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -1
  24. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +4 -0
  25. package/dist/collection/components/ez-grid/ez-grid.css +24 -6
  26. package/dist/collection/components/ez-grid/ez-grid.js +25 -5
  27. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  28. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
  29. package/dist/collection/components/ez-list/ez-list.js +296 -206
  30. package/dist/collection/components/ez-list/ezListHelper.js +85 -0
  31. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -2
  32. package/dist/collection/components/ez-popup/ez-popup.css +1 -0
  33. package/dist/collection/components/ez-popup/ez-popup.js +5 -2
  34. package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
  35. package/dist/collection/components/ez-split-panel/ez-split-panel.js +71 -1
  36. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +13 -2
  37. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +20 -1
  38. package/dist/custom-elements/index.d.ts +6 -0
  39. package/dist/custom-elements/index.js +1481 -338
  40. package/dist/esm/{ez-card-item_3.entry.js → ez-card-item_2.entry.js} +1 -123
  41. package/dist/esm/ez-chart.entry.js +1 -1
  42. package/dist/esm/ez-double-list.entry.js +283 -0
  43. package/dist/esm/ez-filter-input.entry.js +126 -0
  44. package/dist/esm/ez-form-view.entry.js +8 -2
  45. package/dist/esm/ez-grid.entry.js +778 -110
  46. package/dist/esm/ez-list.entry.js +253 -205
  47. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  48. package/dist/esm/ez-popup.entry.js +4 -1
  49. package/dist/esm/ez-split-item.entry.js +3 -2
  50. package/dist/esm/ez-split-panel.entry.js +54 -2
  51. package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/filter-column.entry.js +2 -2
  54. package/dist/esm/index-baa5e267.js +10 -2
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/ezui/ezui.esm.js +1 -1
  57. package/dist/ezui/p-16e612fc.entry.js +1 -0
  58. package/dist/ezui/p-17eabf46.entry.js +1 -0
  59. package/dist/ezui/p-2475fd6e.entry.js +1 -0
  60. package/dist/ezui/{p-baf80b13.entry.js → p-35d467a8.entry.js} +1 -1
  61. package/dist/ezui/p-5b205c80.entry.js +1 -0
  62. package/dist/ezui/p-65f471bc.entry.js +1 -0
  63. package/dist/ezui/p-66924de6.entry.js +1 -0
  64. package/dist/ezui/p-7e677b7b.entry.js +1 -0
  65. package/dist/ezui/p-80dfc50b.js +1 -0
  66. package/dist/ezui/{p-b36542d8.entry.js → p-a6fe527a.entry.js} +1 -1
  67. package/dist/ezui/p-b46e9f59.entry.js +309 -0
  68. package/dist/ezui/p-e3e3fd7a.entry.js +1 -0
  69. package/dist/ezui/{p-2b46b37b.entry.js → p-fa6732f2.entry.js} +1 -1
  70. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
  71. package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
  72. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
  73. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  74. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -1
  75. package/dist/types/components/ez-list/ez-list.d.ts +23 -2
  76. package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
  77. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  78. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +7 -0
  79. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +4 -0
  80. package/dist/types/components.d.ts +133 -13
  81. package/package.json +1 -1
  82. package/react/components.d.ts +1 -0
  83. package/react/components.js +1 -0
  84. package/react/components.js.map +1 -1
  85. package/dist/ezui/p-4575d511.entry.js +0 -1
  86. package/dist/ezui/p-90bcd2ba.entry.js +0 -1
  87. package/dist/ezui/p-bfad39eb.entry.js +0 -1
  88. package/dist/ezui/p-c806f32f.entry.js +0 -1
  89. package/dist/ezui/p-ca1ce49f.entry.js +0 -309
  90. package/dist/ezui/p-cd2e78f0.entry.js +0 -1
  91. package/dist/ezui/p-e78e0843.entry.js +0 -1
@@ -1,5 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-baa5e267.js';
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
+ import { p as processListOnDrop } from './ezListHelper-00fb9b8d.js';
3
4
 
4
5
  const ezListCss = ".sc-ez-list-h {\n \n --ez-list__host--z-index: var(--visible, 1);\n\n \n --ez-list__host--border-radius: var(--border--radius-medium, 12px);\n\n \n --ez-list__host--padding: var(--space--medium, 12px);\n\n \n --ez-list__icon--padding: var(--space--small, 6px);\n\n \n --ez-list__icon--color: #AFB6C0;\n\n \n --ez-list__item--margin: 0 var(--space--small, 6px);\n\n \n --ez-list__item--color: var(--title--primary, #2b3a54);\n\n \n --ez-list__item--border-bottom;\n\n \n --ez-list__item--border-bottom-color;\n\n \n --ez-list__item--font-family: var(--font-pattern, \"Roboto\");\n\n \n --ez-list__item--font-size: var(--text--medium, 14px);\n \n \n --ez-list__item--white-space: var(--ez-list__item--white-space, nowrap);\n\n \n --ez-list__selectable--padding-right: var(--space--small, 6px);\n \n \n --ez-list__selectable--padding-left: var(--space--small, 6px);\n\n \n --ez-list__selected-item--border-radius: var(--border--radius-small, 6px);\n \n \n --ez-list__selected-item--background-color: var(--color--primary-300, #E2F4EF);\n\n \n --ez-list__group--font-family: var(--font-pattern, \"Roboto\");\n \n \n --ez-list__group--font-size: var(--text--medium, 14px);\n \n \n --ez-list__group--font-weight: var(--text-weight--large, 600);\n \n \n --ez-list__group--padding-bottom: var(--space-small, 6px);\n\n \n --ez-list__group-overlay--font-family: var(--font-pattern, \"Roboto\");\n\n \n --ez-list__group-overlay--font-size: var(--text--medium, 14px);\n \n \n --ez-list__over--border--color: var(--color--primary, #008561);\n\n \n --ez-list__last-droppable-space--height: var(--space--small, 6px);\n \n \n --ez-list__draggable-list--padding-bottom: var(--space--small, 6px);\n\n \n --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>');\n\n \n \n --ez-list__scrollbar--color-default: var(--scrollbar--default, #626e82);\n \n --ez-list__scrollbar--color-background: var(--scrollbar--background, #E5EAF0);\n \n --ez-list__scrollbar--color-hover: var(--scrollbar--hover, #2B3A54);\n \n --ez-list__scrollbar--color-clicked: var(--scrollbar--clicked, #a2abb9);\n \n --ez-list__scrollbar--border-radius: var(--border--radius-small, 6px);\n \n --ez-list__scrollbar--width: var(--space--medium, 12px);\n\n max-height: 100%;\n width: 100%;\n background-color: #fff;\n display: flex;\n\n \n z-index: var(--ez-list__host--z-index);\n}\n\np.sc-ez-list {\n margin: 0;\n}\n\n.draggable.sc-ez-list {\n \n width: 100%;\n display: grid;\n grid-template-columns: minmax(0px, auto) minmax(0px, auto);\n place-items: center;\n border-top: 1px dashed #fff;\n justify-content: space-between;\n\n \n font-family: var(--ez-list__item--font-family);\n font-size: var(--ez-list__item--font-size);\n}\n\n.dragging.sc-ez-list {\n background: #FFFFFF;\n \n\n border: 1px solid #008561;\n box-sizing: border-box;\n box-shadow: 0px 0px 16px rgba(0, 38, 111, 0.122);\n border-radius: 6px;\n}\n\n.selectable.sc-ez-list {\n cursor: pointer;\n\n \n padding-right: var(--ez-list__selectable--padding-right);\n padding-left: var(--ez-list__selectable--padding-left);\n}\n\n.selectable-container.sc-ez-list {\n margin: 0px !important;\n}\n\n.hover-feedback.sc-ez-list:hover {\n background-color: var(--background--medium);\n border-radius: var(--border--radius-regular);\n}\n\n.item-content.sc-ez-list {\n display: flex;\n align-items: center;\n overflow: hidden;\n justify-content: flex-start;\n width: 100%;\n}\n\n.draggable-list.sc-ez-list {\n padding: 0;\n margin: 0;\n width: 100%;\n max-height: 100%;\n scrollbar-width: thin;\n \n \n color: var(--text-color);\n scrollbar-color: var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background);\n}\n\n.draggable-list.sc-ez-list li.sc-ez-list {\n display: flex;\n \n \n font-family: var(--ez-list__item--font-family);\n font-size: var(--ez-list__item--font-size);\n color: var(--ez-list__item--color);\n border-bottom: var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color);\n}\n\n.draggable-list.sc-ez-list li.sc-ez-list > div.sc-ez-list {\n \n padding: var(--space--3xs, 4px) var(--space--3xs, 4px);\n margin: var(--ez-list__item--margin);\n}\n\n.over.sc-ez-list {\n \n border-top: 1px dashed var(--ez-list__over--border--color);\n}\n\n.last-droppable-space.sc-ez-list {\n \n height: var(--ez-list__last-droppable-space--height);\n}\n\n.draggable-selected.sc-ez-list {\n \n background-color: var(--background--strong) !important;\n}\n\n.draggable-selected.sc-ez-list div.sc-ez-list:hover {\n \n background-color: var(--background--strong) !important;\n}\n\n.draggable-list.sc-ez-list::-webkit-scrollbar {\n \n background-color: var(--ez-list__scrollbar--color-background);\n width: var(--ez-list__scrollbar--width);\n max-width: var(--ez-list__scrollbar--width);\n min-width: var(--ez-list__scrollbar--width);\n}\n\n.draggable-list.sc-ez-list::-webkit-scrollbar-track {\n \n background-color: var(--ez-list__scrollbar--color-background);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.draggable-list.sc-ez-list::-webkit-scrollbar-thumb {\n \n background-color: var(--ez-list__scrollbar--color-default);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover, .draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover {\n \n background-color: var(--ez-list__scrollbar--color-hover);\n}\n\n.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:active, .draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active {\n \n background-color: var(--ez-list__scrollbar--color-clicked);\n}\n\n.draggable-icon.sc-ez-list {\n align-items: flex-start;\n display: flex;\n outline: none;\n border: none;\n background-color: unset;\n}\n\n.draggable-icon.sc-ez-list::after {\n content: '';\n display: flex;\n width: 18px;\n height: 18px;\n\n \n background-color: var(--ez-list__icon--color);\n -webkit-mask-image: var(--ez-list__draggable-icon--image);\n mask-image: var(--ez-list__draggable-icon--image);\n}\n\n*.sc-ez-list {\n box-sizing: border-box;\n}\n\n.checkbox.sc-ez-list {\n width: fit-content;\n}\n\n.text--ellipsis.sc-ez-list {\n overflow: hidden;\n text-overflow: ellipsis;\n \n \n white-space: var(--ez-list__item--white-space);\n}\n\n.group-container.sc-ez-list {\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow-y: auto;\n outline: none;\n width: 100%;\n scrollbar-width: thin;\n\n \n scrollbar-color: var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background);\n}\n\n.group-name.sc-ez-list {\n -webkit-user-select: none;\n -moz-user-select: -moz-none;\n -ms-user-select: none;\n user-select: none;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n \n color: var(--title--primary);\n font-family: var(--ez-list__group--font-family);\n font-size: var(--ez-list__group--font-size);\n font-weight: var(--ez-list__group--font-weight);\n padding-bottom: var(--ez-list__group--padding-bottom);\n}\n\n.group.sc-ez-list {\n display: flex;\n flex-direction: column;\n}\n\n.group-container.sc-ez-list::-webkit-scrollbar {\n \n background-color: var(--ez-list__scrollbar--color-background);\n width: var(--ez-list__scrollbar--width);\n max-width: var(--ez-list__scrollbar--width);\n min-width: var(--ez-list__scrollbar--width);\n}\n\n.group-container.sc-ez-list::-webkit-scrollbar-track {\n \n background-color: var(--ez-list__scrollbar--color-background);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.group-container.sc-ez-list::-webkit-scrollbar-thumb {\n \n background-color: var(--ez-list__scrollbar--color-default);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover, .group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover {\n \n background-color: var(--ez-list__scrollbar--color-hover);\n}\n\n.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active, .group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active {\n \n background-color: var(--ez-list__scrollbar--color-clicked);\n}\n\n.section-container.sc-ez-list {\n display: flex;\n position: relative;\n height: 100%;\n}\n\n.items-container.sc-ez-list {\n width: 100%;\n max-height: 100%;\n outline: none;\n scrollbar-width: thin;\n\n \n scrollbar-color: var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background);\n}\n\n.group-items-container.sc-ez-list {\n width: 100%;\n max-height: 100%;\n height: 100%;\n outline: none;\n}\n\n.items-container.sc-ez-list::-webkit-scrollbar {\n \n background-color: var(--ez-list__scrollbar--color-background);\n width: var(--ez-list__scrollbar--width);\n max-width: var(--ez-list__scrollbar--width);\n min-width: var(--ez-list__scrollbar--width);\n}\n\n.items-container.sc-ez-list::-webkit-scrollbar-track {\n \n background-color: var(--ez-list__scrollbar--color-background);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.items-container.sc-ez-list::-webkit-scrollbar-thumb {\n \n background-color: var(--ez-list__scrollbar--color-default);\n border-radius: var(--ez-list__scrollbar--border-radius);\n}\n\n.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover, .items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover {\n \n background-color: var(--ez-list__scrollbar--color-hover);\n}\n\n.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active, .items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active {\n \n background-color: var(--ez-list__scrollbar--color-clicked);\n}\n\n.group-overlay.sc-ez-list {\n background: rgba(226, 244, 239, 0.8);\n border: 1px solid #008561;\n border-radius: 8px;\n position: absolute;\n display: none;\n place-items: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 2;\n margin: 0;\n cursor: pointer;\n\n \n font-family: var(--ez-list__group-overlay--font-family);\n font-size: var(--ez-list__group-overlay--font-size);\n}\n\n.presetedHeight.sc-ez-list {\n min-height: 100px;\n}\n\n.overlay-text.sc-ez-list {\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 50px;\n color: white;\n transform: translate(-50%, -50%);\n -ms-transform: translate(-50%, -50%);\n}\n\n.selected-item.sc-ez-list {\n \n background: var(--ez-list__selected-item--background-color);\n border-radius: var(--ez-list__selected-item--border-radius);\n}\n\n.slot-item.sc-ez-list {\n align-items: flex-end;\n}\n\n.overGroup.sc-ez-list {\n background: rgba(226, 244, 239, 0.8);\n border: 1px solid #008561;\n box-sizing: border-box;\n border-radius: 8px;\n padding-top: 6px;\n}";
5
6
 
@@ -8,6 +9,7 @@ const EzList = class {
8
9
  registerInstance(this, hostRef);
9
10
  this.ezChange = createEvent(this, "ezChange", 7);
10
11
  this.ezSelectItem = createEvent(this, "ezSelectItem", 7);
12
+ this.ezSelectMultipleItems = createEvent(this, "ezSelectMultipleItems", 7);
11
13
  this.ezCheckChange = createEvent(this, "ezCheckChange", 7);
12
14
  this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
13
15
  this._listItemsHistory = [];
@@ -21,6 +23,7 @@ const EzList = class {
21
23
  this.itemSlotBuilder = undefined;
22
24
  this.itemLeftSlotBuilder = undefined;
23
25
  this.hoverFeedback = false;
26
+ this.enableMultipleSelection = false;
24
27
  }
25
28
  /**
26
29
  * Limpa o histórico da lista.
@@ -42,56 +45,99 @@ const EzList = class {
42
45
  /**
43
46
  * Aplica seleção nas linhas da lista.
44
47
  */
45
- async setSelection(selectedItem, scrollToOption) {
46
- if (selectedItem && this.ezSelectable) {
47
- this.ezSelectItem.emit(selectedItem);
48
- if (this.useGroups) {
49
- let newList = [...this._listGroupItems];
50
- newList.forEach(groupItem => {
51
- groupItem.items.forEach(item => {
52
- item.selected = item.id === selectedItem.id;
53
- });
54
- });
55
- this._listGroupItems = newList;
56
- }
57
- else {
58
- let newList = [...this._listItems];
59
- newList.forEach(item => {
60
- item.selected = item.id === selectedItem.id;
61
- });
62
- this._listItems = newList;
63
- }
64
- if (scrollToOption) {
65
- let liElem = this.useGroups
66
- ? this._groupContainer.querySelector('li#item_' + selectedItem.id)
67
- : this._itemContainer.querySelector('li#item_' + selectedItem.id);
68
- if (liElem) {
69
- liElem.scrollIntoView();
70
- }
71
- }
72
- }
73
- else {
48
+ async setSelection(selectedItem, scrollToOption, shitkey, ctrlKey) {
49
+ if (!selectedItem || !this.ezSelectable) {
74
50
  await this.removeSelection();
51
+ return;
52
+ }
53
+ if (this.useGroups) {
54
+ this.setSelectionWithGroups(selectedItem, scrollToOption);
55
+ return;
56
+ }
57
+ if (this.enableMultipleSelection && ctrlKey) {
58
+ this.setSelectionMultiple(selectedItem);
59
+ return;
60
+ }
61
+ if (this.enableMultipleSelection && shitkey) {
62
+ this.setSelectionRange(selectedItem);
63
+ return;
64
+ }
65
+ this.setSelectionSingleItem(selectedItem, scrollToOption);
66
+ this.emitSelectedItems(selectedItem);
67
+ }
68
+ emitSelectedItems(singleItem, listItem) {
69
+ this.ezSelectItem.emit(singleItem);
70
+ this.ezSelectMultipleItems.emit(listItem !== null && listItem !== void 0 ? listItem : [singleItem]);
71
+ }
72
+ setSelectionRange(selectedItem) {
73
+ const lastSelectedIndex = this._listItems.findIndex(item => item.selected);
74
+ const seletedItemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
75
+ if (lastSelectedIndex < 0 || lastSelectedIndex === seletedItemIndex) {
76
+ this.setSelectionSingleItem(selectedItem);
77
+ return;
75
78
  }
79
+ const minorIndex = Math.min(lastSelectedIndex, seletedItemIndex);
80
+ const majorIndex = Math.max(lastSelectedIndex, seletedItemIndex);
81
+ let newList = [...this._listItems];
82
+ newList.forEach((item, index) => {
83
+ item.selected = (index >= minorIndex && index <= majorIndex);
84
+ });
85
+ this._listItems = [...newList];
86
+ const selectedList = this._listItems.filter(item => item.selected);
87
+ this.emitSelectedItems(selectedItem, selectedList);
88
+ }
89
+ setSelectionMultiple(selectedItem) {
90
+ let newList = [...this._listItems];
91
+ newList.forEach(item => {
92
+ item.selected = (item.id === selectedItem.id) ? !item.selected : item.selected;
93
+ });
94
+ this._listItems = [...newList];
95
+ const selectedList = this._listItems.filter(item => item.selected);
96
+ this.emitSelectedItems(selectedItem, selectedList);
97
+ }
98
+ setSelectionSingleItem(selectedItem, scrollToOption) {
99
+ this.emitSelectedItems(selectedItem);
100
+ let newList = [...this._listItems];
101
+ newList.forEach(item => {
102
+ item.selected = item.id === selectedItem.id;
103
+ });
104
+ this._listItems = newList;
105
+ if (!scrollToOption)
106
+ return;
107
+ let liElem = this._itemContainer.querySelector('li#item_' + selectedItem.id);
108
+ if (liElem)
109
+ liElem.scrollIntoView();
110
+ }
111
+ setSelectionWithGroups(selectedItem, scrollToOption) {
112
+ this.emitSelectedItems(selectedItem);
113
+ let newList = [...this._listGroupItems];
114
+ newList.forEach(groupItem => {
115
+ groupItem.items.forEach(item => {
116
+ item.selected = item.id === selectedItem.id;
117
+ });
118
+ });
119
+ this._listGroupItems = newList;
120
+ if (!scrollToOption)
121
+ return;
122
+ let liElem = this._groupContainer.querySelector('li#item_' + selectedItem.id);
123
+ if (liElem)
124
+ liElem.scrollIntoView();
76
125
  }
77
126
  /**
78
127
  * Obtém o item selecionado.
79
128
  */
80
129
  async getSelection() {
130
+ if (!this.useGroups)
131
+ return this._listItems.find(item => item.selected == true);
81
132
  let selectedItem;
82
- if (this.useGroups) {
83
- this._listGroupItems.every(group => {
84
- let item = group.items.find(item => item.selected == true);
85
- if (item) {
86
- selectedItem = item;
87
- return false;
88
- }
89
- return true;
90
- });
91
- }
92
- else {
93
- selectedItem = this._listItems.find(item => item.selected == true);
94
- }
133
+ this._listGroupItems.every(group => {
134
+ let item = group.items.find(item => item.selected == true);
135
+ if (item) {
136
+ selectedItem = item;
137
+ return false;
138
+ }
139
+ return true;
140
+ });
95
141
  return selectedItem;
96
142
  }
97
143
  /**
@@ -115,14 +161,11 @@ const EzList = class {
115
161
  });
116
162
  });
117
163
  this._listGroupItems = newList;
164
+ return;
118
165
  }
119
- else {
120
- let newList = [...this._listItems];
121
- newList.forEach(item => {
122
- item.selected = false;
123
- });
124
- this._listItems = newList;
125
- }
166
+ let newList = [...this._listItems];
167
+ newList.forEach(item => item.selected = false);
168
+ this._listItems = newList;
126
169
  }
127
170
  applyUUID(item) {
128
171
  if (!item.id) {
@@ -184,78 +227,88 @@ const EzList = class {
184
227
  ElementIDUtils.addIDInfo(this._element);
185
228
  }
186
229
  onDrop(ev, dragEndItem) {
230
+ ev.stopPropagation();
187
231
  this.removeOverClass();
232
+ if (!this._dragStartItem)
233
+ return;
234
+ if (this.useGroups) {
235
+ this.onDropWithGroups(dragEndItem);
236
+ return;
237
+ }
238
+ this._listItems = [...processListOnDrop(this.buildDragHandlerConfig(dragEndItem.index, false))];
239
+ this._listItemsHistory = [...this._listItems];
240
+ this.ezChange.emit(this._listItems);
241
+ }
242
+ buildDragHandlerConfig(targetIndex, moveToFinal) {
243
+ return {
244
+ listItems: this._listItems,
245
+ dragItem: this._dragStartItem,
246
+ enableMultipleSelection: this.enableMultipleSelection,
247
+ targetIndex,
248
+ moveToFinal,
249
+ clearSelection: () => this.setSelection(undefined)
250
+ };
251
+ }
252
+ ;
253
+ onDropWithGroups(dragEndItem) {
188
254
  this.setSelection(undefined);
189
- if (this._dragStartItem) {
190
- if (this.useGroups) {
191
- let newList = [...this._listGroupItems];
192
- let groupEnd = this._listGroupItems.find(group => dragEndItem.groupName == group.group);
193
- //Remove item arrastado
194
- newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
195
- //Adiciona item arrastado
196
- if (groupEnd.sort) {
197
- newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
198
- newList
199
- .find(group => group.group == dragEndItem.groupName)
200
- .items.sort(function (a, b) {
201
- return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
202
- });
203
- if (groupEnd.sort === 'DSC') {
204
- newList.find(group => group.group == dragEndItem.groupName).items.reverse();
205
- }
206
- }
207
- else {
208
- let indexForAdd = dragEndItem.index > this._dragStartItem.index ? dragEndItem.index - 1 : dragEndItem.index;
209
- newList.find(group => group.group == dragEndItem.groupName).items.splice(indexForAdd, 0, this._dragStartItem.item);
210
- }
211
- this._listGroupItems = newList;
212
- this.ezChange.emit(this._listGroupItems);
213
- }
214
- else {
215
- let newList = [...this._listItems];
216
- newList.splice(this._dragStartItem.index, 1);
217
- newList.splice(dragEndItem.index, 0, this._dragStartItem.item);
218
- this._listItems = newList;
219
- this._listItemsHistory = newList;
220
- this.ezChange.emit(this._listItems);
255
+ let newList = [...this._listGroupItems];
256
+ let groupEnd = this._listGroupItems.find(group => dragEndItem.groupName == group.group);
257
+ //Remove item arrastado
258
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
259
+ //Adiciona item arrastado
260
+ if (groupEnd.sort) {
261
+ newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
262
+ newList
263
+ .find(group => group.group == dragEndItem.groupName)
264
+ .items.sort(function (a, b) {
265
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
266
+ });
267
+ if (groupEnd.sort === 'DSC') {
268
+ newList.find(group => group.group == dragEndItem.groupName).items.reverse();
221
269
  }
222
270
  }
223
- ev.stopPropagation();
271
+ else {
272
+ let indexForAdd = dragEndItem.index > this._dragStartItem.index ? dragEndItem.index - 1 : dragEndItem.index;
273
+ newList.find(group => group.group == dragEndItem.groupName).items.splice(indexForAdd, 0, this._dragStartItem.item);
274
+ }
275
+ this._listGroupItems = newList;
276
+ this.ezChange.emit(this._listGroupItems);
224
277
  }
225
278
  onDropLastIndex(ev, groupDropped) {
279
+ ev.stopPropagation();
226
280
  this.removeOverClass();
281
+ if (!this._dragStartItem)
282
+ return;
283
+ if (this.useGroups) {
284
+ this.onDropLastItemWithGroups(groupDropped);
285
+ return;
286
+ }
287
+ const lastIndex = this._listItems.length - 1;
288
+ this._listItems = [...processListOnDrop(this.buildDragHandlerConfig(lastIndex, true))];
289
+ this._listItemsHistory = [...this._listItems];
290
+ this.ezChange.emit(this._listItems);
291
+ }
292
+ onDropLastItemWithGroups(groupDropped) {
227
293
  this.setSelection(undefined);
228
- if (this._dragStartItem) {
229
- if (this.useGroups) {
230
- let newList = [...this._listGroupItems];
231
- let groupEnd = this._listGroupItems.find(group => groupDropped.group == group.group);
232
- //Remove item arrastado
233
- newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
234
- //Adiciona item arrastado
235
- newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
236
- if (groupEnd.sort) {
237
- newList
238
- .find(group => group.group == groupDropped.group)
239
- .items.sort(function (a, b) {
240
- return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
241
- });
242
- if (groupEnd.sort === 'DSC') {
243
- newList.find(group => group.group == groupDropped.group).items.reverse();
244
- }
245
- }
246
- this._listGroupItems = newList;
247
- this.ezChange.emit(this._listGroupItems);
248
- }
249
- else {
250
- let newList = [...this._listItems];
251
- newList.splice(this._dragStartItem.index, 1);
252
- newList.push(this._dragStartItem.item);
253
- this._listItems = newList;
254
- this._listItemsHistory = newList;
255
- this.ezChange.emit(this._listItems);
294
+ let newList = [...this._listGroupItems];
295
+ let groupEnd = this._listGroupItems.find(group => groupDropped.group == group.group);
296
+ //Remove item arrastado
297
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
298
+ //Adiciona item arrastado
299
+ newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
300
+ if (groupEnd.sort) {
301
+ newList
302
+ .find(group => group.group == groupDropped.group)
303
+ .items.sort(function (a, b) {
304
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
305
+ });
306
+ if (groupEnd.sort === 'DSC') {
307
+ newList.find(group => group.group == groupDropped.group).items.reverse();
256
308
  }
257
309
  }
258
- ev.stopPropagation();
310
+ this._listGroupItems = newList;
311
+ this.ezChange.emit(this._listGroupItems);
259
312
  }
260
313
  onDropGroup(groupSelected) {
261
314
  var _a;
@@ -293,19 +346,13 @@ const EzList = class {
293
346
  if (this.useGroups) {
294
347
  this.hideOverlays();
295
348
  }
296
- if (this._draggingElement) {
297
- try {
298
- this._element.removeChild(this._draggingElement);
299
- }
300
- catch (err) { }
301
- this._draggingElement = undefined;
302
- }
303
349
  }
304
350
  addOverClass(element) {
305
351
  if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains('draggable')) {
306
352
  element.classList.add('over');
353
+ return;
307
354
  }
308
- else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains('draggable-list')) {
355
+ if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains('draggable-list')) {
309
356
  this.addOverClass(element.parentElement);
310
357
  }
311
358
  }
@@ -361,84 +408,94 @@ const EzList = class {
361
408
  window.clearTimeout(this._changeDeboucingTimeout);
362
409
  }
363
410
  if (this.useGroups) {
364
- this._dragStartItem = { groupName: group.group, item: item, index: index };
365
- this._changeDeboucingTimeout = window.setTimeout(() => {
366
- this.showOverlays(group);
367
- }, 10);
368
- }
369
- else {
370
- this._dragStartItem = { item: item.item, index: item.index };
411
+ this.onDragStartWithGroups(group, item, index);
412
+ return;
371
413
  }
414
+ this._dragStartItem = { item: item.item, index: item.index };
415
+ }
416
+ onDragStartWithGroups(group, item, index) {
417
+ this._dragStartItem = { groupName: group.group, item: item, index: index };
418
+ this._changeDeboucingTimeout = window.setTimeout(() => {
419
+ this.showOverlays(group);
420
+ }, 10);
372
421
  }
373
422
  selectFirstItem() {
374
423
  if (this.useGroups) {
375
424
  this.setSelection(this._listGroupItems[0].items[0]);
376
425
  }
377
- {
426
+ else {
378
427
  this.setSelection(this._listItems[0]);
379
428
  }
380
429
  }
381
430
  nextOption(selectedItem) {
382
- let nextItem = undefined;
383
431
  if (this.useGroups) {
384
- this._listGroupItems.every((group, groupIndex, listGroupItems) => {
385
- let item = undefined;
386
- let itemIndex = group.items.findIndex(item => item.id == selectedItem.id);
387
- if (itemIndex != undefined && itemIndex != -1) {
388
- if (itemIndex === group.items.length - 1) {
389
- if (groupIndex + 1 <= listGroupItems.length - 1) {
390
- item = { label: listGroupItems[groupIndex + 1].items[0].label };
391
- }
392
- }
393
- else {
394
- item = { label: group.items[itemIndex + 1].label };
432
+ this.setSelection(this.nextOptionWithGroups(selectedItem), true);
433
+ return;
434
+ }
435
+ let nextItem = undefined;
436
+ let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
437
+ if (itemIndex >= 0 && itemIndex < this._listItems.length) {
438
+ nextItem = this._listItems[itemIndex + 1];
439
+ }
440
+ this.setSelection(nextItem, true);
441
+ }
442
+ nextOptionWithGroups(selectedItem) {
443
+ let nextItem = undefined;
444
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
445
+ let item = undefined;
446
+ let itemIndex = group.items.findIndex(item => item.id == selectedItem.id);
447
+ if (itemIndex != undefined && itemIndex != -1) {
448
+ if (itemIndex === group.items.length - 1) {
449
+ if (groupIndex + 1 <= listGroupItems.length - 1) {
450
+ item = { label: listGroupItems[groupIndex + 1].items[0].label };
395
451
  }
396
452
  }
397
- if (item != undefined) {
398
- nextItem = item;
399
- return false;
453
+ else {
454
+ item = { label: group.items[itemIndex + 1].label };
400
455
  }
401
- return true;
402
- });
403
- }
404
- else {
405
- let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
406
- if (itemIndex >= 0 && itemIndex < this._listItems.length) {
407
- nextItem = this._listItems[itemIndex + 1];
408
456
  }
409
- }
410
- this.setSelection(nextItem, true);
457
+ if (item != undefined) {
458
+ nextItem = item;
459
+ return false;
460
+ }
461
+ return true;
462
+ });
463
+ return nextItem;
411
464
  }
412
465
  previousOption(selectedItem) {
413
- let previousItem = undefined;
414
466
  if (this.useGroups) {
415
- this._listGroupItems.every((group, groupIndex, listGroupItems) => {
416
- let item = undefined;
417
- let itemIndex = group.items.findIndex(item => item.id === selectedItem.id);
418
- if (itemIndex != undefined && itemIndex != -1) {
419
- if (itemIndex === 0) {
420
- if (groupIndex - 1 >= 0) {
421
- item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
422
- }
423
- }
424
- else {
425
- item = { label: group.items[itemIndex - 1].label };
467
+ this.setSelection(this.previousOptionWithGroups(selectedItem), true);
468
+ return;
469
+ }
470
+ let previousItem = undefined;
471
+ let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
472
+ if (itemIndex > 0 && itemIndex < this._listItems.length) {
473
+ previousItem = this._listItems[itemIndex - 1];
474
+ }
475
+ this.setSelection(previousItem, true);
476
+ }
477
+ previousOptionWithGroups(selectedItem) {
478
+ let previousItem = undefined;
479
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
480
+ let item = undefined;
481
+ let itemIndex = group.items.findIndex(item => item.id === selectedItem.id);
482
+ if (itemIndex != undefined && itemIndex != -1) {
483
+ if (itemIndex === 0) {
484
+ if (groupIndex - 1 >= 0) {
485
+ item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
426
486
  }
427
487
  }
428
- if (item != undefined) {
429
- previousItem = item;
430
- return false;
488
+ else {
489
+ item = { label: group.items[itemIndex - 1].label };
431
490
  }
432
- return true;
433
- });
434
- }
435
- else {
436
- let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
437
- if (itemIndex > 0 && itemIndex < this._listItems.length) {
438
- previousItem = this._listItems[itemIndex - 1];
439
491
  }
440
- }
441
- this.setSelection(previousItem, true);
492
+ if (item != undefined) {
493
+ previousItem = item;
494
+ return false;
495
+ }
496
+ return true;
497
+ });
498
+ return previousItem;
442
499
  }
443
500
  keyDownHandler(event) {
444
501
  if (!event.ctrlKey) {
@@ -480,11 +537,11 @@ const EzList = class {
480
537
  }
481
538
  }
482
539
  onDragOverItem(event) {
483
- if (this._dragStartItem) {
484
- event.preventDefault();
485
- this.addOverClass(event.target);
486
- event.stopPropagation();
487
- }
540
+ if (!this._dragStartItem)
541
+ return;
542
+ event.preventDefault();
543
+ this.addOverClass(event.target);
544
+ event.stopPropagation();
488
545
  }
489
546
  onDragOverLastIndex(ev) {
490
547
  ev.preventDefault();
@@ -524,38 +581,29 @@ const EzList = class {
524
581
  doubleClickItem(item) {
525
582
  this.ezDoubleClick.emit(item);
526
583
  }
527
- render() {
528
- return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? (h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
529
- this.keyDownHandler(event);
530
- } }, this._listGroupItems.map(group => {
531
- 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_' + item.id, class: {
584
+ buildItem(item, evt) {
585
+ return { id: item.id, label: item.label, check: evt.detail };
586
+ }
587
+ renderListWithGroups() {
588
+ return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
589
+ 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_' + item.id, class: {
532
590
  'selectable-container': this.ezSelectable,
533
591
  'hover-feedback': this.hoverFeedback,
534
592
  }, key: 'item_' + item.id }, {
535
593
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`),
536
- }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
537
- this.doubleClickItem(item);
538
- }, onClick: () => {
539
- this.setSelection(item);
540
- }, onDragLeave: () => {
541
- group.sort ? undefined : this.removeOverClass();
542
- }, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index), onDragOver: event => {
543
- group.sort ? undefined : this.onDragOverItem(event);
544
- }, 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(Fragment, null, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item, group), 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('right', item, group, 'slot-item')))))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
545
- this.onDragOverLastIndex(event);
546
- }, 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)));
547
- }))) : (h("div", { class: "items-container", ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
594
+ }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => this.doubleClickItem(item), 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, this.listMode === 'regular' ? (h(Fragment, null, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item, group), 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(this.buildItem(item, evt)) }))), !!this.itemSlotBuilder && this.getContainerItemBuilder('right', item, group, 'slot-item')))))), 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 ? (h("div", { id: this.getGroupOverlayId(group.group), class: 'group-overlay' }, "Mover para ", group.group)) : undefined)));
595
+ }));
596
+ }
597
+ renderList() {
598
+ return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
548
599
  this.keyDownHandler(event);
549
- } }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
600
+ } }, h("div", { class: 'draggable-list' }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
550
601
  'selectable-container': this.ezSelectable,
551
602
  'hover-feedback': this.hoverFeedback,
552
- }, key: 'item_' + item.id }, { [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 }), onDblClick: () => {
553
- this.doubleClickItem(item);
554
- }, onClick: () => {
555
- this.setSelection(item);
556
- }, 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, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), 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('right', item))))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
557
- this.onDragOverLastIndex(event);
558
- }, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) }))))));
603
+ }, key: 'item_' + item.id }, { [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 ' : ''), onDblClick: () => this.doubleClickItem(item), onClick: (event) => this.setSelection(item, false, event.shiftKey, (event.altKey || event.metaKey)), onDragStart: () => this.onDragStart({ item: item, index: index }), onDragOver: event => this.onDragOverItem(event), onDragLeave: () => this.removeOverClass(), 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, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), 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('right', item))))), h("div", { class: 'last-droppable-space', onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverLastIndex(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) })));
604
+ }
605
+ render() {
606
+ return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? this.renderListWithGroups() : this.renderList()));
559
607
  }
560
608
  };
561
609
  EzList.style = ezListCss;
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-baa5e267.js';
2
2
  import { ArrayUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezMultiSelectionListCss = ".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;display:block;width:304px;height:322px;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{height:235px;max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
4
+ const ezMultiSelectionListCss = ".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
5
5
 
6
6
  var ViewScenarios;
7
7
  (function (ViewScenarios) {