@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76362.0 → 0.0.0-bugfix-dev-KB-75609.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/cjs/DataBinder-aff1dcc7.js +445 -0
  2. package/dist/cjs/FocusResolver-885f2173.js +35 -0
  3. package/dist/cjs/ez-card-item_3.cjs.entry.js +12 -19
  4. package/dist/cjs/ez-combo-box.cjs.entry.js +46 -10
  5. package/dist/cjs/ez-date-input.cjs.entry.js +8 -2
  6. package/dist/cjs/ez-date-time-input.cjs.entry.js +8 -2
  7. package/dist/cjs/ez-dialog.cjs.entry.js +9 -1
  8. package/dist/cjs/ez-form.cjs.entry.js +3 -324
  9. package/dist/cjs/ez-grid.cjs.entry.js +254 -62
  10. package/dist/cjs/ez-list.cjs.entry.js +151 -100
  11. package/dist/cjs/ez-number-input.cjs.entry.js +7 -0
  12. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-popup.cjs.entry.js +2 -9
  14. package/dist/cjs/ez-search.cjs.entry.js +28 -12
  15. package/dist/cjs/ez-text-area.cjs.entry.js +66 -4
  16. package/dist/cjs/ez-text-input.cjs.entry.js +8 -3
  17. package/dist/cjs/ez-time-input.cjs.entry.js +6 -0
  18. package/dist/cjs/ezui.cjs.js +1 -1
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +1 -1
  21. package/dist/collection/components/ez-card-item/ez-card-item.css +14 -5
  22. package/dist/collection/components/ez-combo-box/ez-combo-box.js +75 -14
  23. package/dist/collection/components/ez-date-input/ez-date-input.js +35 -4
  24. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
  25. package/dist/collection/components/ez-dialog/ez-dialog.js +9 -1
  26. package/dist/collection/components/ez-filter-input/ez-filter-input.css +0 -11
  27. package/dist/collection/components/ez-filter-input/ez-filter-input.js +22 -52
  28. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +52 -14
  29. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -0
  30. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +166 -45
  31. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +7 -0
  32. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +1 -0
  33. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
  34. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
  35. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +1 -0
  36. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
  37. package/dist/collection/components/ez-grid/ez-grid.js +83 -1
  38. package/dist/collection/components/ez-list/ez-list.css +5 -5
  39. package/dist/collection/components/ez-list/ez-list.js +152 -170
  40. package/dist/collection/components/ez-number-input/ez-number-input.js +25 -0
  41. package/dist/collection/components/ez-popover/ez-popover.css +3 -10
  42. package/dist/collection/components/ez-popup/ez-popup.css +2 -6
  43. package/dist/collection/components/ez-popup/ez-popup.js +3 -10
  44. package/dist/collection/components/ez-search/ez-search.css +1 -1
  45. package/dist/collection/components/ez-search/ez-search.js +55 -14
  46. package/dist/collection/components/ez-text-area/ez-text-area.css +49 -0
  47. package/dist/collection/components/ez-text-area/ez-text-area.js +102 -2
  48. package/dist/collection/components/ez-text-input/ez-text-input.css +27 -53
  49. package/dist/collection/components/ez-text-input/ez-text-input.js +25 -2
  50. package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
  51. package/dist/collection/utils/FocusResolver.js +31 -0
  52. package/dist/collection/utils/form/DataBinder.js +18 -3
  53. package/dist/custom-elements/index.js +663 -237
  54. package/dist/esm/DataBinder-bd240826.js +441 -0
  55. package/dist/esm/FocusResolver-1ccbf850.js +33 -0
  56. package/dist/esm/ez-card-item_3.entry.js +12 -19
  57. package/dist/esm/ez-combo-box.entry.js +47 -11
  58. package/dist/esm/ez-date-input.entry.js +8 -2
  59. package/dist/esm/ez-date-time-input.entry.js +8 -2
  60. package/dist/esm/ez-dialog.entry.js +9 -1
  61. package/dist/esm/ez-form.entry.js +2 -323
  62. package/dist/esm/ez-grid.entry.js +253 -61
  63. package/dist/esm/ez-list.entry.js +152 -101
  64. package/dist/esm/ez-number-input.entry.js +7 -0
  65. package/dist/esm/ez-popover.entry.js +1 -1
  66. package/dist/esm/ez-popup.entry.js +2 -9
  67. package/dist/esm/ez-search.entry.js +28 -12
  68. package/dist/esm/ez-text-area.entry.js +66 -4
  69. package/dist/esm/ez-text-input.entry.js +8 -3
  70. package/dist/esm/ez-time-input.entry.js +6 -0
  71. package/dist/esm/ezui.js +1 -1
  72. package/dist/esm/loader.js +1 -1
  73. package/dist/ezui/ezui.esm.js +1 -1
  74. package/dist/ezui/p-03a2c7d1.entry.js +1 -0
  75. package/dist/ezui/p-0a75bb05.entry.js +1 -0
  76. package/dist/ezui/p-0db68715.entry.js +1 -0
  77. package/dist/ezui/p-19098a3f.entry.js +1 -0
  78. package/dist/ezui/p-1f830a2f.entry.js +1 -0
  79. package/dist/ezui/p-3dd919b7.entry.js +1 -0
  80. package/dist/ezui/p-7bfae0fc.entry.js +1 -0
  81. package/dist/ezui/p-81f06699.js +1 -0
  82. package/dist/ezui/p-97af4b13.entry.js +1 -0
  83. package/dist/ezui/p-9ceefe4d.entry.js +1 -0
  84. package/dist/ezui/p-a80b1287.entry.js +1 -0
  85. package/dist/ezui/{p-c3c3d640.entry.js → p-b0a5c2cd.entry.js} +2 -2
  86. package/dist/ezui/p-b54e17d2.entry.js +1 -0
  87. package/dist/ezui/p-bfad39eb.entry.js +1 -0
  88. package/dist/ezui/p-d0ca26fe.entry.js +1 -0
  89. package/dist/ezui/p-dc628ed3.js +1 -0
  90. package/dist/ezui/p-ffd246f5.entry.js +1 -0
  91. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -1
  92. package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
  93. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
  94. package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -0
  95. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +4 -11
  96. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -0
  97. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -0
  98. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +18 -6
  99. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +2 -0
  100. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
  101. package/dist/types/components/ez-grid/ez-grid.d.ts +10 -0
  102. package/dist/types/components/ez-list/ez-list.d.ts +3 -26
  103. package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
  104. package/dist/types/components/ez-popup/ez-popup.d.ts +2 -2
  105. package/dist/types/components/ez-search/ez-search.d.ts +6 -1
  106. package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
  107. package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
  108. package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
  109. package/dist/types/components.d.ts +101 -44
  110. package/dist/types/utils/FocusResolver.d.ts +5 -0
  111. package/dist/types/utils/form/DataBinder.d.ts +3 -0
  112. package/package.json +1 -1
  113. package/dist/cjs/RecordValidationProcessor-10846595.js +0 -108
  114. package/dist/esm/RecordValidationProcessor-9c6cc267.js +0 -105
  115. package/dist/ezui/p-188f1c4c.entry.js +0 -1
  116. package/dist/ezui/p-25ac5376.entry.js +0 -1
  117. package/dist/ezui/p-49456b34.entry.js +0 -1
  118. package/dist/ezui/p-5a90d7d1.entry.js +0 -1
  119. package/dist/ezui/p-62732269.entry.js +0 -1
  120. package/dist/ezui/p-86b6aa01.entry.js +0 -1
  121. package/dist/ezui/p-b3b94f72.entry.js +0 -1
  122. package/dist/ezui/p-b95632e8.entry.js +0 -1
  123. package/dist/ezui/p-bcd47eda.entry.js +0 -1
  124. package/dist/ezui/p-d2c06f38.entry.js +0 -1
  125. package/dist/ezui/p-dc4ada32.entry.js +0 -1
  126. package/dist/ezui/p-e85c48d7.entry.js +0 -1
  127. package/dist/ezui/p-f299c608.entry.js +0 -1
  128. package/dist/ezui/p-f42855b9.js +0 -1
  129. package/dist/ezui/p-f80ac647.entry.js +0 -1
@@ -5,20 +5,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-a7b0c73d.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
 
8
- const ezListCss = ".sc-ez-list-h{--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:none;--ez-list__item--border-bottom-color:none;--ez-list__item--font-family:var(--font-pattern, \"Roboto\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__item--white-space:var(--ez-list__item--white-space, nowrap);--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-color:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Roboto\");--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, \"Roboto\");--ez-list__group-overlay--font-size:var(--text--medium, 14px);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable-list--padding-bottom:var(--space--small, 6px);--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>');--ez-list__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-list__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-list__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-list__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-list__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-list__scrollbar--width:var(--space--medium, 12px);max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}p.sc-ez-list{margin:0}.draggable.sc-ez-list{width:100%;display:grid;grid-template-columns:minmax(0px, auto) minmax(0px, auto);place-items:center;border-top:1px solid #fff;justify-content:space-between;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size)}.dragging.sc-ez-list{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.sc-ez-list{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container.sc-ez-list{margin:0px !important}.hover-feedback.sc-ez-list:hover{background-color:var(--background--medium);border-radius:var(--border--radius-regular)}.item-content.sc-ez-list{display:flex;align-items:center;overflow:hidden;justify-content:flex-start;width:100%}.draggable-list.sc-ez-list{padding:0;margin:0;width:100%;max-height:100%;scrollbar-width:thin;color:var(--text-color);scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.draggable-list.sc-ez-list li.sc-ez-list{display:flex;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);border-bottom:var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color)}.draggable-list.sc-ez-list li.sc-ez-list>div.sc-ez-list{padding:var(--space--2xs, 8px) var(--space--3xs, 4px);margin:var(--ez-list__item--margin)}.over.sc-ez-list{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space.sc-ez-list{height:var(--ez-list__last-droppable-space--height)}.draggable-selected.sc-ez-list{background-color:var(--background--strong) !important}.draggable-selected.sc-ez-list div.sc-ez-list:hover{background-color:var(--background--strong) !important}.draggable-list.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.draggable-list.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.draggable-icon.sc-ez-list{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon.sc-ez-list::after{content:'';display:flex;width:18px;height:18px;background-color:var(--ez-list__icon--color);-webkit-mask-image:var(--ez-list__draggable-icon--image);mask-image:var(--ez-list__draggable-icon--image)}*.sc-ez-list{box-sizing:border-box}.checkbox.sc-ez-list{width:fit-content}.text--ellipsis.sc-ez-list{overflow:hidden;text-overflow:ellipsis;white-space:var(--ez-list__item--white-space)}.group-container.sc-ez-list{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%;scrollbar-width:thin;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-name.sc-ez-list{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--title--primary);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.sc-ez-list{display:flex;flex-direction:column}.group-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.group-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.section-container.sc-ez-list{display:flex;position:relative;height:100%}.items-container.sc-ez-list{width:100%;max-height:100%;outline:none;scrollbar-width:thin;overflow:auto;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-items-container.sc-ez-list{width:100%;max-height:100%;height:100%;outline:none}.items-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.items-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.group-overlay.sc-ez-list{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;font-family:var(--ez-list__group-overlay--font-family);font-size:var(--ez-list__group-overlay--font-size)}.presetedHeight.sc-ez-list{min-height:100px}.overlay-text.sc-ez-list{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item.sc-ez-list{background:var(--ez-list__selected-item--background-color);border-radius:var(--ez-list__selected-item--border-radius)}.slot-item.sc-ez-list{align-items:flex-end}.overGroup.sc-ez-list{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
8
+ 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}";
9
9
 
10
10
  const EzList = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.ezChange = index.createEvent(this, "ezChange", 7);
14
14
  this.ezSelectItem = index.createEvent(this, "ezSelectItem", 7);
15
- this.ezClickItem = index.createEvent(this, "ezClickItem", 7);
16
15
  this.ezCheckChange = index.createEvent(this, "ezCheckChange", 7);
17
16
  this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
18
17
  this._listItemsHistory = [];
19
18
  this._listItems = [];
20
19
  this._listGroupItems = [];
21
- this._selectedItem = undefined;
22
20
  this.dataSource = [];
23
21
  this.listMode = 'regular';
24
22
  this.useGroups = false;
@@ -27,19 +25,6 @@ const EzList = class {
27
25
  this.itemSlotBuilder = undefined;
28
26
  this.itemLeftSlotBuilder = undefined;
29
27
  this.hoverFeedback = false;
30
- this.disableShortcuts = false;
31
- }
32
- /**
33
- * Seleciona o próximo item.
34
- */
35
- async selectNextItem() {
36
- this.nextOption();
37
- }
38
- /**
39
- * Seleciona o item anterior.
40
- */
41
- async selectPreviousItem() {
42
- this.previousOption();
43
28
  }
44
29
  /**
45
30
  * Limpa o histórico da lista.
@@ -63,8 +48,23 @@ const EzList = class {
63
48
  */
64
49
  async setSelection(selectedItem, scrollToOption) {
65
50
  if (selectedItem && this.ezSelectable) {
66
- this._selectedItem = Object.assign({}, selectedItem);
67
51
  this.ezSelectItem.emit(selectedItem);
52
+ if (this.useGroups) {
53
+ let newList = [...this._listGroupItems];
54
+ newList.forEach(groupItem => {
55
+ groupItem.items.forEach(item => {
56
+ item.selected = item.id === selectedItem.id;
57
+ });
58
+ });
59
+ this._listGroupItems = newList;
60
+ }
61
+ else {
62
+ let newList = [...this._listItems];
63
+ newList.forEach(item => {
64
+ item.selected = item.id === selectedItem.id;
65
+ });
66
+ this._listItems = newList;
67
+ }
68
68
  if (scrollToOption) {
69
69
  let liElem = this.useGroups
70
70
  ? this._groupContainer.querySelector('li#item_' + selectedItem.id)
@@ -82,7 +82,21 @@ const EzList = class {
82
82
  * Obtém o item selecionado.
83
83
  */
84
84
  async getSelection() {
85
- return this._selectedItem;
85
+ let selectedItem;
86
+ if (this.useGroups) {
87
+ this._listGroupItems.every(group => {
88
+ let item = group.items.find(item => item.selected == true);
89
+ if (item) {
90
+ selectedItem = item;
91
+ return false;
92
+ }
93
+ return true;
94
+ });
95
+ }
96
+ else {
97
+ selectedItem = this._listItems.find(item => item.selected == true);
98
+ }
99
+ return selectedItem;
86
100
  }
87
101
  /**
88
102
  * Obtém a lista de items ou grupos.
@@ -97,7 +111,22 @@ const EzList = class {
97
111
  * Limpa a seleção atual
98
112
  */
99
113
  async removeSelection() {
100
- this._selectedItem = undefined;
114
+ if (this.useGroups) {
115
+ let newList = [...this._listGroupItems];
116
+ newList.forEach(groupItem => {
117
+ groupItem.items.forEach(item => {
118
+ item.selected = false;
119
+ });
120
+ });
121
+ this._listGroupItems = newList;
122
+ }
123
+ else {
124
+ let newList = [...this._listItems];
125
+ newList.forEach(item => {
126
+ item.selected = false;
127
+ });
128
+ this._listItems = newList;
129
+ }
101
130
  }
102
131
  applyUUID(item) {
103
132
  if (!item.id) {
@@ -157,10 +186,6 @@ const EzList = class {
157
186
  }
158
187
  componentDidLoad() {
159
188
  core.ElementIDUtils.addIDInfo(this._element);
160
- this.bindKeyboardManager();
161
- }
162
- disconnectCallback() {
163
- this.unbindKeyboardManager();
164
189
  }
165
190
  onDrop(ev, dragEndItem) {
166
191
  this.removeOverClass();
@@ -353,58 +378,92 @@ const EzList = class {
353
378
  if (this.useGroups) {
354
379
  this.setSelection(this._listGroupItems[0].items[0]);
355
380
  }
356
- else {
381
+ {
357
382
  this.setSelection(this._listItems[0]);
358
383
  }
359
384
  }
360
- getFlatedItems() {
385
+ nextOption(selectedItem) {
386
+ let nextItem = undefined;
361
387
  if (this.useGroups) {
362
- const itemsGroups = this._listGroupItems.map(({ items }) => items).flat();
363
- return itemsGroups;
364
- }
365
- return this._listItems;
366
- }
367
- getSelectedIndex(items) {
368
- const itemIndex = items.findIndex(item => { var _a; return item.id === ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.id); });
369
- return itemIndex;
370
- }
371
- nextOption() {
372
- if (!this._selectedItem) {
373
- this.selectFirstItem();
374
- return;
388
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
389
+ let item = undefined;
390
+ let itemIndex = group.items.findIndex(item => item.id == selectedItem.id);
391
+ if (itemIndex != undefined && itemIndex != -1) {
392
+ if (itemIndex === group.items.length - 1) {
393
+ if (groupIndex + 1 <= listGroupItems.length - 1) {
394
+ item = { label: listGroupItems[groupIndex + 1].items[0].label };
395
+ }
396
+ }
397
+ else {
398
+ item = { label: group.items[itemIndex + 1].label };
399
+ }
400
+ }
401
+ if (item != undefined) {
402
+ nextItem = item;
403
+ return false;
404
+ }
405
+ return true;
406
+ });
375
407
  }
376
- const items = this.getFlatedItems();
377
- const itemIndex = this.getSelectedIndex(items);
378
- if (itemIndex < (items.length - 1)) {
379
- const nextItem = items[itemIndex + 1];
380
- this.setSelection(nextItem, true);
408
+ else {
409
+ let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
410
+ if (itemIndex >= 0 && itemIndex < this._listItems.length) {
411
+ nextItem = this._listItems[itemIndex + 1];
412
+ }
381
413
  }
414
+ this.setSelection(nextItem, true);
382
415
  }
383
- previousOption() {
384
- const items = this.getFlatedItems();
385
- const itemIndex = this.getSelectedIndex(items);
386
- if (itemIndex > 0) {
387
- const previousItem = items[itemIndex - 1];
388
- this.setSelection(previousItem, true);
416
+ previousOption(selectedItem) {
417
+ let previousItem = undefined;
418
+ if (this.useGroups) {
419
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
420
+ let item = undefined;
421
+ let itemIndex = group.items.findIndex(item => item.id === selectedItem.id);
422
+ if (itemIndex != undefined && itemIndex != -1) {
423
+ if (itemIndex === 0) {
424
+ if (groupIndex - 1 >= 0) {
425
+ item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
426
+ }
427
+ }
428
+ else {
429
+ item = { label: group.items[itemIndex - 1].label };
430
+ }
431
+ }
432
+ if (item != undefined) {
433
+ previousItem = item;
434
+ return false;
435
+ }
436
+ return true;
437
+ });
389
438
  }
390
- }
391
- bindKeyboardManager() {
392
- this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
393
- if (this.disableShortcuts) {
394
- return;
439
+ else {
440
+ let itemIndex = this._listItems.findIndex(item => item.id === selectedItem.id);
441
+ if (itemIndex > 0 && itemIndex < this._listItems.length) {
442
+ previousItem = this._listItems[itemIndex - 1];
443
+ }
395
444
  }
396
- this._keyboardManager
397
- .bind("ArrowDown", () => this.nextOption())
398
- .bind("ArrowUp", () => this.previousOption())
399
- .bind("shift+Tab", () => this.previousOption())
400
- .bind("Tab", () => this.nextOption());
445
+ this.setSelection(previousItem, true);
401
446
  }
402
- unbindKeyboardManager() {
403
- this._keyboardManager
404
- .unbind("ArrowDown")
405
- .unbind("ArrowUp")
406
- .unbind("shift+Tab")
407
- .unbind("Tab");
447
+ keyDownHandler(event) {
448
+ if (!event.ctrlKey) {
449
+ event.preventDefault();
450
+ }
451
+ this.getSelection().then(selectedItem => {
452
+ if (selectedItem) {
453
+ switch (event.key) {
454
+ case 'ArrowDown':
455
+ this.nextOption(selectedItem);
456
+ break;
457
+ case 'ArrowUp':
458
+ this.previousOption(selectedItem);
459
+ break;
460
+ }
461
+ }
462
+ else {
463
+ this.selectFirstItem();
464
+ }
465
+ });
466
+ event.stopPropagation();
408
467
  }
409
468
  getDivGroupId(groupName) {
410
469
  if (groupName) {
@@ -469,46 +528,38 @@ const EzList = class {
469
528
  doubleClickItem(item) {
470
529
  this.ezDoubleClick.emit(item);
471
530
  }
472
- onClickItem(item) {
473
- this.setSelection(item);
474
- this.ezClickItem.emit(item);
475
- }
476
531
  render() {
477
- return (index.h(index.Host, { ref: el => (this._element = el) }, this.useGroups ? (index.h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0 }, this._listGroupItems.map(group => {
478
- return (index.h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, index.h("label", { draggable: false, class: "group-name", title: group.group }, group.group), index.h("section", { class: "section-container", onDragOver: ev => ev.preventDefault() }, index.h("div", { class: "group-items-container" }, index.h("div", { class: "draggable-list" }, group.items.map((item, index$1) => {
479
- var _a;
480
- return (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
481
- 'selectable-container': this.ezSelectable,
482
- 'hover-feedback': this.hoverFeedback,
483
- }, key: 'item_' + item.id }, {
484
- [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`),
485
- }), index.h("div", { class: 'draggable' + (((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.id) === item.id ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
486
- this.doubleClickItem(item);
487
- }, onClick: () => {
488
- this.onClickItem(item);
489
- }, onDragLeave: () => {
490
- group.sort ? undefined : this.removeOverClass();
491
- }, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index$1), onDragOver: event => {
492
- group.sort ? undefined : this.onDragOverItem(event);
493
- }, onDrop: event => this.onDrop(event, { groupName: group.group, item: item, index: index$1 }), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, this.listMode === 'regular' ? (index.h(index.Fragment, null, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item, group), index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (index.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'))));
494
- })), index.h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
495
- this.onDragOverLastIndex(event);
496
- }, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event, group) })), group.sort ? (index.h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" }, "Mover para ", group.group)) : undefined)));
497
- }))) : (index.h("div", { class: "items-container", ref: el => (this._itemContainer = el), tabIndex: 0 }, index.h("ul", { class: "draggable-list" }, this._listItems.map((item, index$1) => {
498
- var _a, _b;
499
- return (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
532
+ return (index.h(index.Host, { ref: el => (this._element = el) }, this.useGroups ? (index.h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
533
+ this.keyDownHandler(event);
534
+ } }, this._listGroupItems.map(group => {
535
+ return (index.h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, index.h("label", { draggable: false, class: "group-name", title: group.group }, group.group), index.h("section", { class: "section-container", onDragOver: ev => ev.preventDefault() }, index.h("div", { class: "group-items-container" }, index.h("div", { class: "draggable-list" }, group.items.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
500
536
  'selectable-container': this.ezSelectable,
501
- 'selected-item': ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.id) === item.id,
502
- 'hover-feedback': this.hoverFeedback && ((_b = this._selectedItem) === null || _b === void 0 ? void 0 : _b.id) !== item.id,
503
- }, key: 'item_' + item.id }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`) }), index.h("div", { class: 'draggable' + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index$1 }), onDblClick: () => {
537
+ 'hover-feedback': this.hoverFeedback,
538
+ }, key: 'item_' + item.id }, {
539
+ [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`),
540
+ }), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
504
541
  this.doubleClickItem(item);
505
542
  }, onClick: () => {
506
- this.onClickItem(item);
507
- }, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index$1 }), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.listMode === 'regular' ? (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, index.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))));
508
- }), this.ezDraggable &&
509
- index.h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
543
+ this.setSelection(item);
544
+ }, onDragLeave: () => {
545
+ group.sort ? undefined : this.removeOverClass();
546
+ }, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index$1), onDragOver: event => {
547
+ group.sort ? undefined : this.onDragOverItem(event);
548
+ }, onDrop: event => this.onDrop(event, { groupName: group.group, item: item, index: index$1 }), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, this.listMode === 'regular' ? (index.h(index.Fragment, null, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item, group), index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (index.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')))))), index.h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
510
549
  this.onDragOverLastIndex(event);
511
- }, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) }))))));
550
+ }, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event, group) })), group.sort ? (index.h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" }, "Mover para ", group.group)) : undefined)));
551
+ }))) : (index.h("div", { class: "items-container", ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
552
+ this.keyDownHandler(event);
553
+ } }, index.h("div", { class: "draggable-list" }, this._listItems.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
554
+ 'selectable-container': this.ezSelectable,
555
+ 'hover-feedback': this.hoverFeedback,
556
+ }, key: 'item_' + item.id }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`) }), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index$1 }), onDblClick: () => {
557
+ this.doubleClickItem(item);
558
+ }, onClick: () => {
559
+ this.setSelection(item);
560
+ }, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index$1 }), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.listMode === 'regular' ? (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, index.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))))), index.h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
561
+ this.onDragOverLastIndex(event);
562
+ }, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) }))))));
512
563
  }
513
564
  };
514
565
  EzList.style = ezListCss;
@@ -27,6 +27,7 @@ const EzNumberInput = class {
27
27
  this.precision = undefined;
28
28
  this.prettyPrecision = undefined;
29
29
  this.mode = "regular";
30
+ this.autoFocus = false;
30
31
  }
31
32
  /**
32
33
  * Aplica o foco no campo.
@@ -167,11 +168,17 @@ const EzNumberInput = class {
167
168
  const textValue = this.getTextValue(this.value) || '';
168
169
  if ((this._value || '') !== textValue) {
169
170
  this._value = textValue;
171
+ this._textInput.value = this._value;
170
172
  }
171
173
  }
172
174
  componentDidLoad() {
173
175
  CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
174
176
  this.setInputValue();
177
+ if (this.autoFocus) {
178
+ requestAnimationFrame(() => {
179
+ this.setFocus({ selectText: true });
180
+ });
181
+ }
175
182
  }
176
183
  render() {
177
184
  core.ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-a7b0c73d.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
 
8
- const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--most-visible, 3);--ez-popover__height:fit-content;--ez-popover__max-height:fit-content;--ez-popover__margin:0;position:relative;display:flex;user-select:none}.popover__box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:var(--ez-popover__height);max-height:var(--ez-popover__max-height);background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow);margin:var(--ez-popover__margin)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";
8
+ const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--most-visible, 3);position:relative;display:flex;user-select:none}.popover__box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";
9
9
 
10
10
  const EzPopover = class {
11
11
  constructor(hostRef) {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-a7b0c73d.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
 
8
- const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__container--width:100%;--ez-popup__container--height:100%;--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"Roboto\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:var(--ez-popup__container--width);max-height:90%;height:var(--ez-popup__container--height);display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;height:calc(100% - 44px)}.popup__header{width:100%;display:flex}.popup__header--padding{padding-bottom:var(--ez-popup__header--padding-bottom)}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
8
+ const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"Roboto\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;height:calc(100% - 44px)}.popup__header{width:100%;display:flex}.popup__header--padding{padding-bottom:var(--ez-popup__header--padding-bottom)}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
9
9
 
10
10
  const EzPopup = class {
11
11
  constructor(hostRef) {
@@ -72,14 +72,7 @@ const EzPopup = class {
72
72
  });
73
73
  }
74
74
  getGridSize() {
75
- if (!this.size) {
76
- return this._sizeClasses["medium"];
77
- }
78
- if (!this._sizeClasses[this.size]) {
79
- this._element.style.setProperty("--ez-popup__container--width", this.size);
80
- return "";
81
- }
82
- return this._sizeClasses[this.size];
75
+ return this._sizeClasses[this.size] || this._sizeClasses["medium"];
83
76
  }
84
77
  handlePopupHeight() {
85
78
  return this.heightMode === 'auto' ? 'popup__container--auto' : '';
@@ -51,6 +51,7 @@ const EzSearch = class {
51
51
  this.suppressSearch = false;
52
52
  this.ensureClearButtonVisible = false;
53
53
  this.suppressPreLoad = false;
54
+ this.autoFocus = false;
54
55
  }
55
56
  observeErrorMessage() {
56
57
  var _a;
@@ -109,9 +110,9 @@ const EzSearch = class {
109
110
  /**
110
111
  * Aplica o foco no campo.
111
112
  */
112
- async setFocus() {
113
+ async setFocus(options) {
113
114
  if (this._textInput) {
114
- this._textInput.setFocus();
115
+ this._textInput.setFocus(options);
115
116
  }
116
117
  }
117
118
  /**
@@ -384,15 +385,16 @@ const EzSearch = class {
384
385
  replaceHighlight(value) {
385
386
  const startHighlight = new RegExp(this._startHighlightTag, 'g');
386
387
  const endHighlight = new RegExp(this._endHighlightTag, 'g');
387
- return (value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
388
+ return String(value !== null && value !== void 0 ? value : "").replace(startHighlight, '').replace(endHighlight, '');
388
389
  }
389
- selectOption(newOption) {
390
+ selectOption(newOption, focusOnInput = true) {
390
391
  var _a, _b;
391
392
  const currentValue = this.getSelectedOption(this.value);
392
393
  const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: this.replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
393
- if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) === null || _b === void 0 ? void 0 : _b.toString()))
394
- || (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
395
- const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
394
+ const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: this.replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
395
+ if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) === null || _b === void 0 ? void 0 : _b.toString()))
396
+ || (currentValue == undefined && newOptionsFormatted != undefined && "value" in newOptionsFormatted)) {
397
+ const adjustedOpt = !(newOptionsFormatted === null || newOptionsFormatted === void 0 ? void 0 : newOptionsFormatted.value) ? undefined : newOptionsFormatted;
396
398
  this.value = adjustedOpt;
397
399
  this._currentValue = adjustedOpt;
398
400
  }
@@ -402,6 +404,11 @@ const EzSearch = class {
402
404
  }
403
405
  this._visibleOptions = [];
404
406
  this.clearSource();
407
+ if (focusOnInput) {
408
+ setTimeout(() => {
409
+ this.setFocus();
410
+ }, 0);
411
+ }
405
412
  }
406
413
  loadOptions(mode, argument = "") {
407
414
  this._criteria = argument;
@@ -438,7 +445,7 @@ const EzSearch = class {
438
445
  this.value = null;
439
446
  this._currentValue = null;
440
447
  }
441
- controlListWithOnlyOne() {
448
+ controlListWithOnlyOne(focusOnInput = true) {
442
449
  var _a, _b;
443
450
  const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
444
451
  if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
@@ -449,7 +456,7 @@ const EzSearch = class {
449
456
  value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
450
457
  label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
451
458
  };
452
- this.selectOption(option);
459
+ this.selectOption(option, focusOnInput);
453
460
  }
454
461
  }
455
462
  controlEmptySearch() {
@@ -575,6 +582,11 @@ const EzSearch = class {
575
582
  }
576
583
  });
577
584
  });
585
+ if (this.autoFocus) {
586
+ requestAnimationFrame(() => {
587
+ this.setFocus({ selectText: true });
588
+ });
589
+ }
578
590
  }
579
591
  //---------------------------------------------
580
592
  // Event handlers
@@ -644,12 +656,16 @@ const EzSearch = class {
644
656
  }
645
657
  switch (event.key) {
646
658
  case "ArrowDown":
647
- this.nextOption();
648
659
  event.stopPropagation();
660
+ if (this.canShowListOptions())
661
+ event.preventDefault();
662
+ this.nextOption();
649
663
  break;
650
664
  case "ArrowUp":
651
- this.previousOption();
652
665
  event.stopPropagation();
666
+ if (this.canShowListOptions())
667
+ event.preventDefault();
668
+ this.previousOption();
653
669
  break;
654
670
  case "Enter":
655
671
  this.handleEventPropagation(event);
@@ -660,7 +676,7 @@ const EzSearch = class {
660
676
  break;
661
677
  case "Tab":
662
678
  this._tabPressed = true;
663
- this.controlListWithOnlyOne();
679
+ this.controlListWithOnlyOne(false);
664
680
  break;
665
681
  }
666
682
  //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.