@sankhyalabs/ezui 5.21.4 → 5.22.0-dev.10

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 (201) hide show
  1. package/dist/cjs/ICustomRender-6fafffce.js +13 -0
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
  3. package/dist/cjs/ez-chart.cjs.entry.js +435 -0
  4. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
  5. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
  6. package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +99 -0
  7. package/dist/cjs/ez-form-view.cjs.entry.js +37 -5
  8. package/dist/cjs/ez-form.cjs.entry.js +81 -2
  9. package/dist/cjs/ez-grid.cjs.entry.js +312 -40
  10. package/dist/cjs/ez-list.cjs.entry.js +10 -2
  11. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -1
  12. package/dist/cjs/ez-modal.cjs.entry.js +7 -1
  13. package/dist/cjs/ez-number-input.cjs.entry.js +37 -31
  14. package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
  15. package/dist/cjs/ez-search.cjs.entry.js +40 -33
  16. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
  17. package/dist/cjs/ez-split-item.cjs.entry.js +1 -0
  18. package/dist/cjs/ez-tabselector.cjs.entry.js +8 -2
  19. package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +0 -215
  20. package/dist/cjs/ezui.cjs.js +1 -1
  21. package/dist/cjs/index-a7b0c73d.js +16 -4
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/collection/collection-manifest.json +3 -0
  24. package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
  25. package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
  26. package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
  27. package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
  28. package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
  29. package/dist/collection/components/ez-chart/components/index.js +5 -0
  30. package/dist/collection/components/ez-chart/ez-chart.css +5 -0
  31. package/dist/collection/components/ez-chart/ez-chart.js +286 -0
  32. package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
  33. package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
  34. package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
  35. package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
  36. package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
  37. package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
  38. package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
  39. package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
  40. package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
  41. package/dist/collection/components/ez-form/ez-form.js +130 -4
  42. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +278 -0
  43. package/dist/collection/components/ez-form-view/ez-form-view.js +110 -1
  44. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  45. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
  46. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -22
  47. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +6 -1
  48. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +36 -2
  49. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +59 -0
  50. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
  51. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
  52. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
  53. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +10 -3
  54. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
  55. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
  56. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
  57. package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
  58. package/dist/collection/components/ez-grid/ez-grid.js +235 -12
  59. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  60. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  61. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  62. package/dist/collection/components/ez-list/ez-list.js +28 -2
  63. package/dist/collection/components/ez-modal/ez-modal.js +25 -1
  64. package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
  65. package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
  66. package/dist/collection/components/ez-search/ez-search.js +39 -33
  67. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
  68. package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
  69. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
  70. package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
  71. package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
  72. package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
  73. package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
  74. package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
  75. package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
  76. package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -2
  77. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
  78. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
  79. package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
  80. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
  81. package/dist/collection/utils/form/DataBinder.js +31 -1
  82. package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
  83. package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
  84. package/dist/collection/utils/index.js +2 -0
  85. package/dist/custom-elements/index.d.ts +18 -0
  86. package/dist/custom-elements/index.js +1173 -127
  87. package/dist/esm/ICustomRender-875b5a40.js +13 -0
  88. package/dist/esm/ez-actions-button.entry.js +1 -0
  89. package/dist/esm/ez-chart.entry.js +431 -0
  90. package/dist/esm/ez-collapsible-box.entry.js +1 -0
  91. package/dist/esm/ez-combo-box.entry.js +1 -0
  92. package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +101 -3
  93. package/dist/esm/ez-form-view.entry.js +37 -5
  94. package/dist/esm/ez-form.entry.js +82 -3
  95. package/dist/esm/ez-grid.entry.js +312 -40
  96. package/dist/esm/ez-list.entry.js +10 -2
  97. package/dist/esm/ez-modal-container.entry.js +2 -1
  98. package/dist/esm/ez-modal.entry.js +7 -1
  99. package/dist/esm/ez-number-input.entry.js +38 -32
  100. package/dist/esm/ez-scroller_2.entry.js +217 -0
  101. package/dist/esm/ez-search.entry.js +40 -33
  102. package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
  103. package/dist/esm/ez-split-item.entry.js +1 -0
  104. package/dist/esm/ez-tabselector.entry.js +8 -2
  105. package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
  106. package/dist/esm/ezui.js +1 -1
  107. package/dist/esm/index-baa5e267.js +16 -4
  108. package/dist/esm/loader.js +1 -1
  109. package/dist/ezui/ezui.esm.js +1 -1
  110. package/dist/ezui/p-2097d0cf.entry.js +1 -0
  111. package/dist/ezui/{p-9fbb0f01.entry.js → p-32e553e5.entry.js} +2 -2
  112. package/dist/ezui/p-34b6916c.entry.js +1 -0
  113. package/dist/ezui/p-3b4eeeb6.entry.js +1 -0
  114. package/dist/ezui/p-42533ea4.entry.js +1 -0
  115. package/dist/ezui/p-4607fb89.js +1 -0
  116. package/dist/ezui/p-4d5235f1.entry.js +1 -0
  117. package/dist/ezui/p-5b205c80.entry.js +1 -0
  118. package/dist/ezui/p-7922142b.entry.js +1 -0
  119. package/dist/ezui/p-84e439b9.entry.js +1 -0
  120. package/dist/ezui/p-8888d9ed.entry.js +1 -0
  121. package/dist/ezui/p-922ac38b.entry.js +1 -0
  122. package/dist/ezui/p-a31b9c90.entry.js +1 -0
  123. package/dist/ezui/p-aba3da00.entry.js +1 -0
  124. package/dist/ezui/p-bcb53f27.entry.js +1 -0
  125. package/dist/ezui/p-c0d9c4f8.entry.js +1 -0
  126. package/dist/ezui/p-cdc472cc.entry.js +1 -0
  127. package/dist/ezui/p-ecc2c1ec.entry.js +1 -0
  128. package/dist/ezui/p-fcf0acce.entry.js +1 -0
  129. package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
  130. package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
  131. package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
  132. package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
  133. package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
  134. package/dist/types/components/ez-chart/components/index.d.ts +5 -0
  135. package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
  136. package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
  137. package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
  138. package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
  139. package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
  140. package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
  141. package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
  142. package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
  143. package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
  144. package/dist/types/components/ez-form/ez-form.d.ts +20 -1
  145. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +48 -0
  146. package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
  147. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
  148. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +37 -0
  149. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -4
  150. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
  151. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
  152. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
  153. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
  154. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
  155. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
  156. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +6 -0
  157. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
  158. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
  159. package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
  160. package/dist/types/components/ez-grid/ez-grid.d.ts +34 -1
  161. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  162. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  163. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  164. package/dist/types/components/ez-list/ez-list.d.ts +5 -0
  165. package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
  166. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
  167. package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
  168. package/dist/types/components/ez-search/ez-search.d.ts +4 -2
  169. package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
  170. package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
  171. package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
  172. package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
  173. package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
  174. package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
  175. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -1
  176. package/dist/types/components.d.ts +351 -5
  177. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -0
  178. package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
  179. package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
  180. package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
  181. package/dist/types/utils/form/DataBinder.d.ts +5 -0
  182. package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
  183. package/dist/types/utils/index.d.ts +2 -0
  184. package/package.json +2 -1
  185. package/react/components.d.ts +3 -0
  186. package/react/components.js +3 -0
  187. package/react/components.js.map +1 -1
  188. package/dist/ezui/p-0447d17c.entry.js +0 -1
  189. package/dist/ezui/p-20ec22c0.entry.js +0 -1
  190. package/dist/ezui/p-2a1a0e04.entry.js +0 -1
  191. package/dist/ezui/p-2dcb50d4.entry.js +0 -1
  192. package/dist/ezui/p-30775e7f.entry.js +0 -1
  193. package/dist/ezui/p-41ac6cd9.entry.js +0 -1
  194. package/dist/ezui/p-637f69f2.entry.js +0 -1
  195. package/dist/ezui/p-786559c5.entry.js +0 -1
  196. package/dist/ezui/p-91f626d3.entry.js +0 -1
  197. package/dist/ezui/p-99ead599.entry.js +0 -1
  198. package/dist/ezui/p-b567fa8c.entry.js +0 -1
  199. package/dist/ezui/p-bae3d0aa.entry.js +0 -1
  200. package/dist/ezui/p-db77a984.entry.js +0 -1
  201. package/dist/ezui/p-f3c526cc.entry.js +0 -1
@@ -4,6 +4,7 @@ import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
  import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
+ import { C as CustomEditorSource, a as CustomRenderSource } from './ICustomRender-875b5a40.js';
7
8
  import { D as DISTINCT_FILTER_NAME_PREFIX, E as EZ_GRID_LOADING_SOURCE } from './constants-4e0d35b7.js';
8
9
  import { b as buildFieldMetadata, R as RecordValidationProcessor } from './RecordValidationProcessor-b00b8b77.js';
9
10
 
@@ -118857,7 +118858,9 @@ class DataSource {
118857
118858
  }
118858
118859
  }
118859
118860
  handleFocusFirstRow() {
118860
- this._controller.setFocusFirstRow();
118861
+ if (this._options.autoFocus) {
118862
+ this._controller.setFocusFirstRow();
118863
+ }
118861
118864
  }
118862
118865
  isSilentChange(action) {
118863
118866
  //TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
@@ -118933,6 +118936,9 @@ class DataSource {
118933
118936
  this._controller.selectRows(selectionInfo.recordIds, true);
118934
118937
  }
118935
118938
  }
118939
+ setAutoFocus(autoFocus) {
118940
+ this._options.autoFocus = autoFocus;
118941
+ }
118936
118942
  getRows(params) {
118937
118943
  if (this.needReload(params)) {
118938
118944
  this._lastLoadingParams = params;
@@ -119318,8 +119324,9 @@ const buildDateTime = ({ readOnly }) => {
119318
119324
  };
119319
119325
 
119320
119326
  const buildDecimal = ({ readOnly, props }) => {
119321
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
119322
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
119327
+ var _a, _b;
119328
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
119329
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
119323
119330
  return buildNumeric(readOnly, precision, prettyPrecision);
119324
119331
  };
119325
119332
  const buildInteger = ({ readOnly }) => {
@@ -119413,11 +119420,12 @@ uiBuilders.set(UserInterface.LONGTEXT, buildTextAreaInput);
119413
119420
  uiBuilders.set(UserInterface.SEARCH, buildSearch);
119414
119421
  class EzCellEditor {
119415
119422
  init(params) {
119423
+ this._rowData = params.data;
119416
119424
  const fieldName = params.column.getColId();
119417
119425
  const dataUnit = params.context.dataUnit;
119418
- const fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119419
- const builder = uiBuilders.get(fieldMetadata.userInterface) || buildTextInput;
119420
- this._gui = builder(fieldMetadata);
119426
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119427
+ const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
119428
+ this._gui = builder(this._fieldMetadata);
119421
119429
  if (this._gui.valueSetter != undefined) {
119422
119430
  this._gui.valueSetter(params.value);
119423
119431
  }
@@ -119441,10 +119449,151 @@ class EzCellEditor {
119441
119449
  isPopup() {
119442
119450
  return this._gui.isPopUp;
119443
119451
  }
119452
+ getFieldMetadata() {
119453
+ return this._fieldMetadata;
119454
+ }
119455
+ getRecord() {
119456
+ return this._rowData;
119457
+ }
119458
+ }
119459
+
119460
+ class EzGridCustomCellEditor extends EzCellEditor {
119461
+ init(params) {
119462
+ var _a, _b;
119463
+ this._value = params.value;
119464
+ this._fieldName = params.column.getColId();
119465
+ this._customEditorInstance = params.customEditorsInfo.customEditor;
119466
+ super.init(params);
119467
+ this._defaultGui = this.getDefaultGui();
119468
+ const fieldMetadata = super.getFieldMetadata();
119469
+ this._params = {
119470
+ value: params.value,
119471
+ charPress: params.charPress,
119472
+ currentEditor: this._defaultGui,
119473
+ name: this._fieldName,
119474
+ source: CustomEditorSource.GRID,
119475
+ detailContext: params.customEditorsInfo.detailContext,
119476
+ setValue: (value) => this.setValue(value),
119477
+ getValue: () => this.getValue(),
119478
+ record: super.getRecord(),
119479
+ editorMetadata: {
119480
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119481
+ label: fieldMetadata.label,
119482
+ userInterface: fieldMetadata.userInterface,
119483
+ props: fieldMetadata.props,
119484
+ optionLoader: fieldMetadata.optionLoader,
119485
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119486
+ },
119487
+ };
119488
+ }
119489
+ getDefaultGui() {
119490
+ const gui = super.getGui();
119491
+ gui.value = this._value;
119492
+ gui.onkeyup = (event) => {
119493
+ const value = event.target.value;
119494
+ this.setValue(value);
119495
+ };
119496
+ return gui;
119497
+ }
119498
+ getGui() {
119499
+ const editorElement = this._customEditorInstance.getEditorElement(this._params);
119500
+ if (!editorElement) {
119501
+ return this._defaultGui;
119502
+ }
119503
+ if (typeof editorElement === 'string') {
119504
+ const element = HTMLBuilder.parseElement(editorElement);
119505
+ return element;
119506
+ }
119507
+ return editorElement;
119508
+ }
119509
+ setValue(value) {
119510
+ this._value = value;
119511
+ }
119512
+ getValue() {
119513
+ return this._value;
119514
+ }
119515
+ }
119516
+
119517
+ class EzCellRender {
119518
+ init(params) {
119519
+ const span = document.createElement('span');
119520
+ this._currentParams = params;
119521
+ span.textContent = params.value;
119522
+ const fieldName = params.column.getColId();
119523
+ const dataUnit = params.context.dataUnit;
119524
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
119525
+ this._gui = span;
119526
+ }
119527
+ refresh() {
119528
+ try {
119529
+ this._currentParams.refreshCell();
119530
+ return true;
119531
+ }
119532
+ catch (_a) {
119533
+ return false;
119534
+ }
119535
+ }
119536
+ getGui() {
119537
+ return this._gui;
119538
+ }
119539
+ afterGuiAttached() {
119540
+ this.focusIn();
119541
+ }
119542
+ focusIn() {
119543
+ this._gui.focus();
119544
+ this._gui.setFocus({ selectText: true });
119545
+ }
119546
+ getValue() {
119547
+ return this._currentParams.getValue();
119548
+ }
119549
+ isPopup() {
119550
+ return this._gui.isPopUp;
119551
+ }
119552
+ getFieldMetadata() {
119553
+ return this._fieldMetadata;
119554
+ }
119555
+ }
119556
+
119557
+ class EzGridCustomCellRender extends EzCellRender {
119558
+ init(params) {
119559
+ var _a, _b;
119560
+ this._fieldName = params.column.getColId();
119561
+ this._customRenderInstance = params.customRendersInfo.customRender;
119562
+ super.init(params);
119563
+ const fieldMetadata = super.getFieldMetadata();
119564
+ this._params = {
119565
+ value: params.value,
119566
+ charPress: '',
119567
+ currentRender: super.getGui(),
119568
+ name: this._fieldName,
119569
+ source: CustomRenderSource.GRID,
119570
+ getValue: () => params.getValue(),
119571
+ detailContext: params.customRendersInfo.detailContext,
119572
+ renderMetadata: {
119573
+ hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
119574
+ label: fieldMetadata.label,
119575
+ userInterface: fieldMetadata.userInterface,
119576
+ props: fieldMetadata.props,
119577
+ optionLoader: fieldMetadata.optionLoader,
119578
+ options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
119579
+ }
119580
+ };
119581
+ }
119582
+ getGui() {
119583
+ const editorElement = this._customRenderInstance.getRenderElement(this._params);
119584
+ if (!editorElement) {
119585
+ return super.getGui();
119586
+ }
119587
+ if (typeof editorElement === 'string') {
119588
+ const element = HTMLBuilder.parseElement(editorElement);
119589
+ return element;
119590
+ }
119591
+ return editorElement;
119592
+ }
119444
119593
  }
119445
119594
 
119446
119595
  class GridEditionManager {
119447
- constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
119596
+ constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
119448
119597
  this._dataUnit = dataUnit;
119449
119598
  this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
119450
119599
  getRequiredFields: () => this.getRequiredFields(),
@@ -119453,6 +119602,8 @@ class GridEditionManager {
119453
119602
  }, recordsValidator);
119454
119603
  this._useEnterLikeTab = useEnterLikeTab;
119455
119604
  this._editionIsDisabled = editionIsDisabled;
119605
+ this._customEditors = customEditors;
119606
+ this._customRenders = customRenders;
119456
119607
  }
119457
119608
  configureGrid(options) {
119458
119609
  this._gridOptions = options;
@@ -119470,7 +119621,7 @@ class GridEditionManager {
119470
119621
  this.saveSuccess();
119471
119622
  return;
119472
119623
  }
119473
- if (!this._isGridEdition) {
119624
+ if (!this._isGridEdition || this._dataUnit.hasNewRecord()) {
119474
119625
  return;
119475
119626
  }
119476
119627
  const currentRercord = this._dataUnit.getSelectedRecord();
@@ -119519,6 +119670,30 @@ class GridEditionManager {
119519
119670
  col.suppressKeyboardEvent = (params) => {
119520
119671
  return params.event.key === KeyCode.ENTER;
119521
119672
  };
119673
+ col.cellEditorSelector = (params) => {
119674
+ var _a;
119675
+ if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119676
+ const customEditor = this._customEditors.get(params.colDef.field);
119677
+ return {
119678
+ component: EzGridCustomCellEditor,
119679
+ params: {
119680
+ customEditorsInfo: customEditor,
119681
+ }
119682
+ };
119683
+ }
119684
+ };
119685
+ col.cellRendererSelector = (params) => {
119686
+ var _a;
119687
+ if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
119688
+ const customRender = this._customRenders.get(params.colDef.field);
119689
+ return {
119690
+ component: EzGridCustomCellRender,
119691
+ params: {
119692
+ customRendersInfo: customRender,
119693
+ }
119694
+ };
119695
+ }
119696
+ };
119522
119697
  return col;
119523
119698
  }
119524
119699
  getRequiredFields() {
@@ -119664,6 +119839,12 @@ class GridEditionManager {
119664
119839
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
119665
119840
  }
119666
119841
  }
119842
+ setCellEditors(customEditors) {
119843
+ this._customEditors = customEditors;
119844
+ }
119845
+ setCellRenders(customRenders) {
119846
+ this._customRenders = customRenders;
119847
+ }
119667
119848
  }
119668
119849
  class TargetEdition {
119669
119850
  constructor(rowIndex, column, backwards) {
@@ -119700,14 +119881,13 @@ class AgGridController {
119700
119881
  this.STATUS_COL_ID = 'statusColumn';
119701
119882
  this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
119702
119883
  this.BLOCK_LOAD_DEBOUNCE = 100;
119703
- this.DEFAULT_FONT_SIZE = 14;
119704
- this.DEFAULT_ICON_SIZE = 12;
119705
- this.DEFAULT_MAX_SIZE = 200;
119884
+ this.DOC_WIDTH = 1150;
119706
119885
  this._menuItems = [];
119707
119886
  this._idAttribName = '__record__id__';
119708
119887
  this._gridConfig = [];
119709
119888
  this._filteredColumns = new Map();
119710
119889
  this._filterColumnleftPosition = 0;
119890
+ this._customFormatters = new Map();
119711
119891
  this._enterprise = enterprise;
119712
119892
  }
119713
119893
  getGridConfig() {
@@ -119793,7 +119973,7 @@ class AgGridController {
119793
119973
  this._doubleClickCallBack = options.onDoubleClick;
119794
119974
  this._multipleSelection = options.allowMultipleSelection;
119795
119975
  this._dataUnit = options.dataUnit;
119796
- this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
119976
+ this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
119797
119977
  this._statusResolver = options.statusResolver;
119798
119978
  if (this._dataUnit) {
119799
119979
  this._dataUnit.sortingProvider = this;
@@ -119851,6 +120031,7 @@ class AgGridController {
119851
120031
  this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
119852
120032
  }
119853
120033
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
120034
+ this._customFormatters = options.customFormatters;
119854
120035
  }
119855
120036
  }
119856
120037
  processFormatterCellCallback(params) {
@@ -120149,6 +120330,10 @@ class AgGridController {
120149
120330
  this.focusOnGridContainer();
120150
120331
  }
120151
120332
  }
120333
+ setAutoFocus(autoFocus) {
120334
+ var _a;
120335
+ (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
120336
+ }
120152
120337
  setFocusFirstRow() {
120153
120338
  const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
120154
120339
  if (firstRow) {
@@ -120234,9 +120419,11 @@ class AgGridController {
120234
120419
  //Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
120235
120420
  //Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
120236
120421
  const columnsOffset = colDef.length - columns.length;
120422
+ this._gridConfig = state;
120237
120423
  let sort = [];
120238
- state.forEach((cfgColumn, index) => {
120239
- const colWidth = this.getColumnWidth(cfgColumn);
120424
+ state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
120425
+ var _a;
120426
+ const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
120240
120427
  this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
120241
120428
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
120242
120429
  visibleColumns.push(cfgColumn.name);
@@ -120251,7 +120438,11 @@ class AgGridController {
120251
120438
  state: sort,
120252
120439
  defaultState: { sort: null },
120253
120440
  });
120254
- this._gridConfig = state;
120441
+ }
120442
+ getAdaptiveWidth(width) {
120443
+ const widthGrid = this._container.clientWidth;
120444
+ const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
120445
+ return Math.round(adaptiveWidth);
120255
120446
  }
120256
120447
  getColumnsState() {
120257
120448
  if (this._grid === undefined) {
@@ -120260,13 +120451,15 @@ class AgGridController {
120260
120451
  const colState = this._gridOptions.columnApi.getColumnState();
120261
120452
  return colState
120262
120453
  .map(s => {
120263
- const def = this._gridOptions.columnApi.getColumn(s.colId).getColDef();
120454
+ const column = this._gridOptions.columnApi.getColumn(s.colId);
120455
+ const def = column.getColDef();
120456
+ const width = this.getAdaptiveWidth(column.getActualWidth());
120264
120457
  const label = def.headerName;
120265
120458
  const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
120266
120459
  const colState = { label, name };
120267
120460
  this.conditionalSet(colState, 'sort', s.sort);
120268
120461
  this.conditionalSet(colState, 'sortIndex', s.sortIndex);
120269
- this.conditionalSet(colState, 'width', s.width);
120462
+ this.conditionalSet(colState, 'width', width);
120270
120463
  this.conditionalSet(colState, 'pinned', s.pinned !== null);
120271
120464
  this.conditionalSet(colState, 'hidden', s.hide);
120272
120465
  const props = new Map();
@@ -120332,12 +120525,19 @@ class AgGridController {
120332
120525
  showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
120333
120526
  },
120334
120527
  valueFormatter: params => {
120335
- if (params.value === undefined) {
120528
+ if (params.value === undefined || params.value === null) {
120336
120529
  return "";
120337
120530
  }
120338
120531
  if (params.value instanceof Promise) {
120339
120532
  return "Carregando...";
120340
120533
  }
120534
+ const customFormatter = this._customFormatters.get(source.name);
120535
+ if (customFormatter) {
120536
+ const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
120537
+ if (formattedValue) {
120538
+ return formattedValue;
120539
+ }
120540
+ }
120341
120541
  if (this._dataUnit) {
120342
120542
  return this._dataUnit.getFormattedValue(source.name, params.value);
120343
120543
  }
@@ -120346,6 +120546,13 @@ class AgGridController {
120346
120546
  cellStyle: this.getStyleByColumn(source),
120347
120547
  });
120348
120548
  }
120549
+ setCustomFormatters(customFormatters) {
120550
+ this._customFormatters = customFormatters;
120551
+ }
120552
+ refreshSelectedRows() {
120553
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
120554
+ this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
120555
+ }
120349
120556
  getInitCellStyle() {
120350
120557
  return {
120351
120558
  'line-height': this.getRowHeight() - 1 + 'px',
@@ -120506,20 +120713,23 @@ class AgGridController {
120506
120713
  host[attribute] = value;
120507
120714
  }
120508
120715
  }
120509
- getColumnWidth(cfgColumn) {
120510
- var _a, _b;
120511
- if (cfgColumn == undefined) {
120716
+ setCellEditors(customEditors) {
120717
+ var _a;
120718
+ if (!this._editionManager) {
120719
+ this._customEditors = customEditors;
120512
120720
  return;
120513
120721
  }
120514
- if (cfgColumn.customWidth != undefined) {
120515
- return cfgColumn.customWidth;
120516
- }
120517
- const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
120518
- if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
120519
- return this.DEFAULT_MAX_SIZE;
120722
+ this._editionManager.setCellEditors(customEditors);
120723
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120724
+ }
120725
+ setCellRenders(customRenders) {
120726
+ var _a;
120727
+ if (!this._editionManager) {
120728
+ this._customRenders = customRenders;
120729
+ return;
120520
120730
  }
120521
- const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
120522
- return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
120731
+ this._editionManager.setCellRenders(customRenders);
120732
+ (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
120523
120733
  }
120524
120734
  }
120525
120735
 
@@ -120746,6 +120956,8 @@ const EzGrid = class {
120746
120956
  this.componentReady = createEvent(this, "componentReady", 7);
120747
120957
  this._gridController = new AgGridController(false);
120748
120958
  this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
120959
+ this._customEditor = new Map();
120960
+ this._customRenders = new Map();
120749
120961
  this._paginationInfo = undefined;
120750
120962
  this._paginationChangedByKeyboard = true;
120751
120963
  this._showSelectionCounter = false;
@@ -120753,6 +120965,7 @@ const EzGrid = class {
120753
120965
  this._currentPageSelected = undefined;
120754
120966
  this._selectionCount = undefined;
120755
120967
  this._hasLeftButtons = false;
120968
+ this._customFormatters = new Map();
120756
120969
  this.multipleSelection = undefined;
120757
120970
  this.config = undefined;
120758
120971
  this.selectionToastConfig = undefined;
@@ -120763,6 +120976,7 @@ const EzGrid = class {
120763
120976
  this.useEnterLikeTab = false;
120764
120977
  this.recordsValidator = undefined;
120765
120978
  this.canEdit = true;
120979
+ this.autoFocus = true;
120766
120980
  }
120767
120981
  /**
120768
120982
  * Aplica a definição de colunas.
@@ -120824,6 +121038,63 @@ const EzGrid = class {
120824
121038
  async filterColumns(search) {
120825
121039
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
120826
121040
  }
121041
+ /**
121042
+ * Registra um editor customizado para campos da grade e formulário.
121043
+ */
121044
+ async addCustomEditor(fieldName, customEditor, detailContext) {
121045
+ const newCustomEditor = new Map(this._customEditor);
121046
+ newCustomEditor.set(fieldName, {
121047
+ customEditor,
121048
+ detailContext,
121049
+ });
121050
+ this._customEditor = newCustomEditor;
121051
+ this._gridController.setCellEditors(newCustomEditor);
121052
+ }
121053
+ /**
121054
+ * Registra um render customizado para colunas da grid.
121055
+ */
121056
+ async addGridCustomRender(fieldName, customRender, detailContext) {
121057
+ const newCustomRenders = new Map(this._customRenders);
121058
+ newCustomRenders.set(fieldName, { customRender, detailContext });
121059
+ this._customRenders = newCustomRenders;
121060
+ this._gridController.setCellRenders(newCustomRenders);
121061
+ }
121062
+ /**
121063
+ * Registra um formatador de valores para uma coluna da grid.
121064
+ */
121065
+ async addCustomValueFormatter(columnName, customFormatter) {
121066
+ if (!columnName || !customFormatter) {
121067
+ return;
121068
+ }
121069
+ const newCustomFormatters = new Map(this._customFormatters);
121070
+ newCustomFormatters.set(columnName, customFormatter);
121071
+ this._customFormatters = newCustomFormatters;
121072
+ this._gridController.setCustomFormatters(newCustomFormatters);
121073
+ }
121074
+ /**
121075
+ * Remove o formatador de valores de uma coluna da grid.
121076
+ */
121077
+ async removeCustomValueFormatter(columnName) {
121078
+ if (!columnName) {
121079
+ return;
121080
+ }
121081
+ const newCustomFormatters = new Map(this._customFormatters);
121082
+ newCustomFormatters.delete(columnName);
121083
+ this._customFormatters = newCustomFormatters;
121084
+ this._gridController.setCustomFormatters(newCustomFormatters);
121085
+ }
121086
+ /**
121087
+ * Atualiza linhas da grade.
121088
+ */
121089
+ async refreshSelectedRows() {
121090
+ this._gridController.refreshSelectedRows();
121091
+ }
121092
+ /**
121093
+ * Retorna o formatador customizado da coluna caso exista.
121094
+ */
121095
+ async getCustomValueFormatter(columnName) {
121096
+ return this._customFormatters.get(columnName);
121097
+ }
120827
121098
  /**
120828
121099
  * Atribui o foco para a grade.
120829
121100
  */
@@ -120983,7 +121254,9 @@ const EzGrid = class {
120983
121254
  const dataInfo = { dataUnit: this.dataUnit };
120984
121255
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
120985
121256
  const dtInfo = { id: 'ezGrid' };
120986
- ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121257
+ if (this._refPaginationControl) {
121258
+ ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
121259
+ }
120987
121260
  }
120988
121261
  previousPage() {
120989
121262
  if (this.dataUnit) {
@@ -121003,14 +121276,10 @@ const EzGrid = class {
121003
121276
  (_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
121004
121277
  }
121005
121278
  getPaginationControl() {
121006
- if (this._paginationInfo) {
121007
- const { currentPage, hasMore } = this._paginationInfo;
121008
- return [
121009
- h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
121010
- h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
121011
- ];
121012
- }
121013
- return null;
121279
+ if (!this._paginationInfo)
121280
+ return null;
121281
+ const { currentPage, hasMore } = this._paginationInfo;
121282
+ return (h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
121014
121283
  }
121015
121284
  componentDidLoad() {
121016
121285
  this._gridController.initDatagrid(this._container, {
@@ -121032,6 +121301,8 @@ const EzGrid = class {
121032
121301
  useEnterLikeTab: this.useEnterLikeTab,
121033
121302
  recordsValidator: this.recordsValidator,
121034
121303
  editionIsDisabled: () => !this.canEdit,
121304
+ customFormatters: this._customFormatters,
121305
+ autoFocus: this.autoFocus,
121035
121306
  onRefresh: () => {
121036
121307
  if (this.dataUnit) {
121037
121308
  this.setSelection(this.dataUnit.getSelectionInfo());
@@ -121052,7 +121323,7 @@ const EzGrid = class {
121052
121323
  }
121053
121324
  handlePaginationChange(selectFirstRecord, paginationInfo) {
121054
121325
  var _a;
121055
- if (selectFirstRecord !== false) {
121326
+ if (selectFirstRecord !== false && this.autoFocus) {
121056
121327
  if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
121057
121328
  this._gridController.setFocusLastRow();
121058
121329
  }
@@ -121123,6 +121394,7 @@ const EzGrid = class {
121123
121394
  return;
121124
121395
  }
121125
121396
  componentDidUpdate() {
121397
+ this._gridController.setAutoFocus(this.autoFocus);
121126
121398
  if (this.dataUnit) {
121127
121399
  this.setSelection(this.dataUnit.getSelectionInfo());
121128
121400
  }
@@ -121136,7 +121408,7 @@ const EzGrid = class {
121136
121408
  }
121137
121409
  render() {
121138
121410
  var _a;
121139
- return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121411
+ return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
121140
121412
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
121141
121413
  ` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
121142
121414
  }
@@ -9,6 +9,7 @@ const EzList = class {
9
9
  this.ezChange = createEvent(this, "ezChange", 7);
10
10
  this.ezSelectItem = createEvent(this, "ezSelectItem", 7);
11
11
  this.ezCheckChange = createEvent(this, "ezCheckChange", 7);
12
+ this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
12
13
  this._listItemsHistory = [];
13
14
  this._listItems = [];
14
15
  this._listGroupItems = [];
@@ -521,6 +522,9 @@ const EzList = class {
521
522
  }
522
523
  return h("div", { class: className, innerHTML: customContent });
523
524
  }
525
+ doubleClickItem(item) {
526
+ this.ezDoubleClick.emit(item);
527
+ }
524
528
  render() {
525
529
  return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? (h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
526
530
  this.keyDownHandler(event);
@@ -530,7 +534,9 @@ const EzList = class {
530
534
  'hover-feedback': this.hoverFeedback,
531
535
  }, key: 'item_' + item.id }, {
532
536
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`),
533
- }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onClick: () => {
537
+ }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
538
+ this.doubleClickItem(item);
539
+ }, onClick: () => {
534
540
  this.setSelection(item);
535
541
  }, onDragLeave: () => {
536
542
  group.sort ? undefined : this.removeOverClass();
@@ -544,7 +550,9 @@ const EzList = class {
544
550
  } }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
545
551
  'selectable-container': this.ezSelectable,
546
552
  'hover-feedback': this.hoverFeedback,
547
- }, 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 }), onClick: () => {
553
+ }, 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: () => {
554
+ this.doubleClickItem(item);
555
+ }, onClick: () => {
548
556
  this.setSelection(item);
549
557
  }, 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 => {
550
558
  this.onDragOverLastIndex(event);
@@ -31,6 +31,7 @@ const EzModalContainer = class {
31
31
  this.okButtonLabel = undefined;
32
32
  this.cancelButtonStatus = undefined;
33
33
  this.okButtonStatus = undefined;
34
+ this.showCloseButton = true;
34
35
  }
35
36
  async handleEzModalAction(event) {
36
37
  var _a;
@@ -67,7 +68,7 @@ const EzModalContainer = class {
67
68
  this._closeButton.focus();
68
69
  }
69
70
  render() {
70
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
71
+ return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
71
72
  }
72
73
  get _element() { return getElement(this); }
73
74
  };
@@ -15,6 +15,7 @@ const EzModal = class {
15
15
  this.opened = true;
16
16
  this.closeEsc = false;
17
17
  this.closeOutsideClick = false;
18
+ this.closeOutsideLeave = false;
18
19
  this.scrim = "medium";
19
20
  }
20
21
  observeOpened() {
@@ -46,6 +47,11 @@ const EzModal = class {
46
47
  this.closeModal();
47
48
  }
48
49
  }
50
+ onMouseLeaveHandler() {
51
+ if (this.closeOutsideLeave) {
52
+ this.closeModal();
53
+ }
54
+ }
49
55
  render() {
50
56
  const positionSufix = this.align === "left" ? "left" : "right";
51
57
  const regularVerticalPaddingClass = this.heightMode === "regular" ? 'modal__vertical-padding' : '';
@@ -53,7 +59,7 @@ const EzModal = class {
53
59
  const scrimType = `modal__screen-${this.scrim}`;
54
60
  return (h(Host, null, this.opened
55
61
  ?
56
- h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
62
+ h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { onMouseLeave: () => this.onMouseLeaveHandler(), class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
57
63
  :
58
64
  undefined));
59
65
  }