@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-81596.0 → 0.0.0-bugfix-dev-KB-81596.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 (170) hide show
  1. package/dist/cjs/{DataBinder-e92314c2.js → DataBinder-c2060474.js} +3 -2
  2. package/dist/cjs/FormLayout-c2451c7f.js +7 -0
  3. package/dist/cjs/{constants-2714478b.js → constants-569271bc.js} +4 -0
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
  5. package/dist/cjs/ez-card-item_2.cjs.entry.js +3 -1217
  6. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -1
  7. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +3 -2
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -7
  9. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-form-view.cjs.entry.js +18 -10
  12. package/dist/cjs/ez-form.cjs.entry.js +29 -3
  13. package/dist/cjs/ez-grid.cjs.entry.js +165 -28
  14. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  15. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-search-plus.cjs.entry.js +369 -0
  19. package/dist/cjs/ez-search-result-list.cjs.entry.js +98 -0
  20. package/dist/cjs/ez-search.cjs.entry.js +3 -2
  21. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  22. package/dist/cjs/ez-text-input.cjs.entry.js +20 -87
  23. package/dist/cjs/ez-tooltip.cjs.entry.js +104 -29
  24. package/dist/cjs/ezui.cjs.js +1 -1
  25. package/dist/cjs/floating-ui.dom.esm-017acce4.js +1404 -0
  26. package/dist/cjs/index-a7b0c73d.js +8 -0
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/{ICustomRender-6fafffce.js → types-6a5df0c7.js} +8 -0
  29. package/dist/collection/collection-manifest.json +12 -0
  30. package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -8
  31. package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
  32. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +1 -1
  33. package/dist/collection/components/ez-form/ez-form.js +31 -4
  34. package/dist/collection/components/ez-form-view/ez-form-view.css +8 -0
  35. package/dist/collection/components/ez-form-view/ez-form-view.js +21 -2
  36. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +3 -1
  37. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js +6 -0
  38. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +96 -16
  39. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +21 -4
  40. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +31 -7
  41. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +2 -0
  42. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js +15 -0
  43. package/dist/collection/components/ez-list/ez-list.js +2 -2
  44. package/dist/collection/components/ez-modal/ez-modal.js +1 -1
  45. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  46. package/dist/collection/components/ez-popup/ez-popup.js +1 -1
  47. package/dist/collection/components/ez-search-plus/ez-search-plus.css +373 -0
  48. package/dist/collection/components/ez-search-plus/ez-search-plus.js +952 -0
  49. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css +227 -0
  50. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js +279 -0
  51. package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
  52. package/dist/collection/components/ez-text-input/ez-text-input.js +39 -60
  53. package/dist/collection/components/ez-tooltip/ez-tooltip.css +52 -12
  54. package/dist/collection/components/ez-tooltip/ez-tooltip.js +217 -46
  55. package/dist/collection/utils/constants.js +2 -0
  56. package/dist/collection/utils/form/DataBinder.js +3 -2
  57. package/dist/collection/utils/form/interfaces/FormLayout.js +5 -0
  58. package/dist/collection/utils/form/interfaces/index.js +1 -1
  59. package/dist/collection/utils/index.js +2 -0
  60. package/dist/collection/utils/search/types.js +7 -0
  61. package/dist/custom-elements/index.d.ts +12 -0
  62. package/dist/custom-elements/index.js +992 -170
  63. package/dist/esm/{DataBinder-9c877244.js → DataBinder-89946126.js} +3 -2
  64. package/dist/esm/FormLayout-54092963.js +7 -0
  65. package/dist/esm/constants-b036528f.js +7 -0
  66. package/dist/esm/ez-actions-button.entry.js +2 -1
  67. package/dist/esm/ez-card-item_2.entry.js +1 -1215
  68. package/dist/esm/ez-collapsible-box.entry.js +2 -1
  69. package/dist/esm/ez-combo-box-list_3.entry.js +2 -1
  70. package/dist/esm/ez-combo-box.entry.js +2 -7
  71. package/dist/esm/ez-date-input.entry.js +1 -1
  72. package/dist/esm/ez-date-time-input.entry.js +1 -1
  73. package/dist/esm/ez-form-view.entry.js +19 -11
  74. package/dist/esm/ez-form.entry.js +30 -4
  75. package/dist/esm/ez-grid.entry.js +164 -27
  76. package/dist/esm/ez-list.entry.js +2 -2
  77. package/dist/esm/ez-modal-container.entry.js +1 -1
  78. package/dist/esm/ez-modal.entry.js +1 -1
  79. package/dist/esm/ez-popup.entry.js +1 -1
  80. package/dist/esm/ez-search-plus.entry.js +365 -0
  81. package/dist/esm/ez-search-result-list.entry.js +94 -0
  82. package/dist/esm/ez-search.entry.js +3 -2
  83. package/dist/esm/ez-split-item.entry.js +2 -1
  84. package/dist/esm/ez-text-input.entry.js +20 -87
  85. package/dist/esm/ez-tooltip.entry.js +105 -30
  86. package/dist/esm/ezui.js +1 -1
  87. package/dist/esm/floating-ui.dom.esm-5d3da819.js +1398 -0
  88. package/dist/esm/index-baa5e267.js +8 -0
  89. package/dist/esm/loader.js +1 -1
  90. package/dist/esm/{ICustomRender-875b5a40.js → types-6f6b2650.js} +9 -1
  91. package/dist/ezui/ezui.esm.js +1 -1
  92. package/dist/ezui/p-0bffeffc.entry.js +1 -0
  93. package/dist/ezui/p-173f68ea.js +1 -0
  94. package/dist/ezui/p-1a060042.entry.js +1 -0
  95. package/dist/ezui/{p-cb5cd243.entry.js → p-1ec8bdd2.entry.js} +46 -46
  96. package/dist/ezui/p-248d4f54.entry.js +1 -0
  97. package/dist/ezui/p-3176a6ef.entry.js +1 -0
  98. package/dist/ezui/p-4e0628a7.entry.js +1 -0
  99. package/dist/ezui/p-5895e687.js +1 -0
  100. package/dist/ezui/p-5a14f506.entry.js +1 -0
  101. package/dist/ezui/p-5ec0ae79.entry.js +1 -0
  102. package/dist/ezui/p-5eea9886.js +1 -0
  103. package/dist/ezui/p-81145609.entry.js +1 -0
  104. package/dist/ezui/p-84b1c99e.entry.js +1 -0
  105. package/dist/ezui/p-8ac8093c.entry.js +1 -0
  106. package/dist/ezui/p-9142b27a.entry.js +1 -0
  107. package/dist/ezui/p-9567b31a.entry.js +1 -0
  108. package/dist/ezui/p-9f22e1dc.entry.js +1 -0
  109. package/dist/ezui/{p-acddfb2e.js → p-a64cfcfc.js} +1 -1
  110. package/dist/ezui/p-bf9dec89.entry.js +1 -0
  111. package/dist/ezui/p-c5df78be.entry.js +1 -0
  112. package/dist/ezui/p-cd07f8be.entry.js +1 -0
  113. package/dist/ezui/p-e07e4671.js +1 -0
  114. package/dist/ezui/p-e3544d23.entry.js +1 -0
  115. package/dist/ezui/p-ecaac11f.entry.js +1 -0
  116. package/dist/ezui/p-f4861c6a.entry.js +1 -0
  117. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -2
  118. package/dist/types/components/ez-form/ez-form.d.ts +5 -1
  119. package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
  120. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.d.ts +2 -0
  121. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  122. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -2
  123. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
  124. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -0
  125. package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.d.ts +3 -0
  126. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +184 -0
  127. package/dist/types/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.d.ts +26 -0
  128. package/dist/types/components/ez-text-input/ez-text-input.d.ts +6 -9
  129. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +37 -5
  130. package/dist/types/components.d.ts +338 -12
  131. package/dist/types/utils/constants.d.ts +2 -0
  132. package/dist/types/utils/form/interfaces/FormLayout.d.ts +4 -0
  133. package/dist/types/utils/form/interfaces/index.d.ts +1 -0
  134. package/dist/types/utils/index.d.ts +2 -0
  135. package/dist/types/utils/search/types.d.ts +12 -0
  136. package/package.json +3 -3
  137. package/react/components.d.ts +62 -60
  138. package/react/components.js +2 -0
  139. package/react/components.js.map +1 -1
  140. package/react/react-component-lib/createComponent.d.ts +1 -1
  141. package/react/react-component-lib/createComponent.js.map +1 -1
  142. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  143. package/react/react-component-lib/interfaces.js +1 -0
  144. package/react/react-component-lib/utils/attachProps.d.ts +1 -1
  145. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  146. package/react/react-component-lib/utils/dev.js.map +1 -1
  147. package/react/react-component-lib/utils/index.d.ts +2 -2
  148. package/react/react-component-lib/utils/index.js.map +1 -1
  149. package/dist/collection/utils/ResponsiveInputUtils.js +0 -26
  150. package/dist/esm/constants-4e0d35b7.js +0 -5
  151. package/dist/ezui/p-05e1f4e7.js +0 -1
  152. package/dist/ezui/p-17eabf46.entry.js +0 -1
  153. package/dist/ezui/p-1ad6c61b.entry.js +0 -1
  154. package/dist/ezui/p-20cb13fa.entry.js +0 -1
  155. package/dist/ezui/p-23b6128c.entry.js +0 -1
  156. package/dist/ezui/p-3195a7a7.entry.js +0 -1
  157. package/dist/ezui/p-4607fb89.js +0 -1
  158. package/dist/ezui/p-556468d9.entry.js +0 -1
  159. package/dist/ezui/p-6cdd3e0a.entry.js +0 -1
  160. package/dist/ezui/p-788467fe.entry.js +0 -1
  161. package/dist/ezui/p-af1a478e.entry.js +0 -1
  162. package/dist/ezui/p-bbdc3996.entry.js +0 -1
  163. package/dist/ezui/p-c297aa52.entry.js +0 -1
  164. package/dist/ezui/p-cb1535f7.entry.js +0 -1
  165. package/dist/ezui/p-cf87aacb.entry.js +0 -1
  166. package/dist/ezui/p-dcf3c8e5.entry.js +0 -1
  167. package/dist/ezui/p-e347df9c.entry.js +0 -1
  168. package/dist/ezui/p-f5931caa.entry.js +0 -1
  169. package/dist/ezui/p-fd0a19d6.entry.js +0 -1
  170. package/dist/types/utils/ResponsiveInputUtils.d.ts +0 -6
@@ -8,9 +8,10 @@ const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
8
8
  const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
9
9
  require('./DialogType-2114c337.js');
10
10
  require('./CheckMode-ecb90b87.js');
11
- const ICustomRender = require('./ICustomRender-6fafffce.js');
12
- const constants = require('./constants-2714478b.js');
13
- const DataBinder = require('./DataBinder-e92314c2.js');
11
+ const types = require('./types-6a5df0c7.js');
12
+ require('./FormLayout-c2451c7f.js');
13
+ const constants = require('./constants-569271bc.js');
14
+ const DataBinder = require('./DataBinder-c2060474.js');
14
15
  const FocusResolver = require('./FocusResolver-885f2173.js');
15
16
 
16
17
  /**
@@ -50250,14 +50251,20 @@ class DataSource {
50250
50251
  return indexA - indexB;
50251
50252
  });
50252
50253
  this._dataUnit.metadata.fields.forEach(f => {
50253
- var _a;
50254
+ var _a, _b;
50254
50255
  if (f.visible !== false && f.name !== this.RECORD_ARCHIVE) {
50255
50256
  const props = new Map();
50256
50257
  const properties = this._dataUnit.getField(f.name).properties;
50257
50258
  for (const value in properties) {
50258
50259
  props.set(value, properties[value]);
50259
50260
  }
50260
- columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
50261
+ const col = { label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props };
50262
+ columnDefs.push(col);
50263
+ if (f.userInterface === core.UserInterface.SEARCHPLUS && ((_b = f.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD)) {
50264
+ const descriptionCol = this.buildDescriptionColumn(f);
50265
+ columnDefs.push(descriptionCol);
50266
+ f.properties[constants.PRESENTATION_COL_ID_PROP_NAME] = descriptionCol.name;
50267
+ }
50261
50268
  }
50262
50269
  });
50263
50270
  }
@@ -50267,6 +50274,17 @@ class DataSource {
50267
50274
  console.warn(error);
50268
50275
  }
50269
50276
  }
50277
+ buildDescriptionColumn(field) {
50278
+ var _a, _b, _c, _d;
50279
+ const props = new Map();
50280
+ props.set(constants.PRESENTATION_FROM_COL_PROP_NAME, field.name);
50281
+ return {
50282
+ label: `${(_a = field.properties) === null || _a === void 0 ? void 0 : _a.DESCRIPTIONFIELDLABEL} (${(_b = field.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONENTITY})`,
50283
+ name: `${(_c = field.properties) === null || _c === void 0 ? void 0 : _c.ENTITYNAME}.${(_d = field.properties) === null || _d === void 0 ? void 0 : _d.DESCRIPTIONFIELD}`,
50284
+ userInterface: core.UserInterface.SHORTTEXT,
50285
+ props
50286
+ };
50287
+ }
50270
50288
  }
50271
50289
 
50272
50290
  class EzGridCustomHeader {
@@ -50677,6 +50695,21 @@ const buildSwitch = (fieldMetadata) => {
50677
50695
  return combo;
50678
50696
  };
50679
50697
 
50698
+ const buildSearchPlus = ({ name, required, readOnly, dataUnit }) => {
50699
+ const ezSearch = core.HTMLBuilder.parseElement(`<ez-search-plus
50700
+ class="ez-grid grid_editor"
50701
+ mode="slim"
50702
+ suppress-empty-option=${required}
50703
+ enabled=${!readOnly}
50704
+ hide-description-input=${true}
50705
+ />`);
50706
+ const loader = core.ApplicationContext.getContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__");
50707
+ ezSearch.optionLoader = (argument) => loader(argument, name, dataUnit);
50708
+ ezSearch.autoFocus = true;
50709
+ ezSearch.valueGetter = () => ezSearch.getValueAsync();
50710
+ return ezSearch;
50711
+ };
50712
+
50680
50713
  const buildSearch = ({ name, required, readOnly, eGridCell, dataUnit }) => {
50681
50714
  var _a;
50682
50715
  const ezSearch = core.HTMLBuilder.parseElement(`<ez-search
@@ -50709,6 +50742,7 @@ uiBuilders.set(core.UserInterface.CHECKBOX, buildSwitch);
50709
50742
  uiBuilders.set(core.UserInterface.OPTIONSELECTOR, buildComboBox);
50710
50743
  uiBuilders.set(core.UserInterface.LONGTEXT, buildTextAreaInput);
50711
50744
  uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
50745
+ uiBuilders.set(core.UserInterface.SEARCHPLUS, buildSearchPlus);
50712
50746
  class EzCellEditor {
50713
50747
  init(params) {
50714
50748
  this._rowData = params.data;
@@ -50772,7 +50806,7 @@ class EzGridCustomCellEditor extends EzCellEditor {
50772
50806
  charPress: params.charPress,
50773
50807
  currentEditor: this._defaultGui,
50774
50808
  name: this._fieldName,
50775
- source: ICustomRender.CustomEditorSource.GRID,
50809
+ source: types.CustomEditorSource.GRID,
50776
50810
  detailContext: params.customEditorsInfo.detailContext,
50777
50811
  setValue: (value) => this.setValue(value),
50778
50812
  getValue: () => this.getValue(),
@@ -50879,7 +50913,7 @@ class EzGridCustomCellRender extends EzCellRender {
50879
50913
  charPress: '',
50880
50914
  currentRender: super.getGui(),
50881
50915
  name: this._fieldName,
50882
- source: ICustomRender.CustomRenderSource.GRID,
50916
+ source: types.CustomRenderSource.GRID,
50883
50917
  getValue: () => params.getValue(),
50884
50918
  detailContext: params.customRendersInfo.detailContext,
50885
50919
  renderMetadata: {
@@ -50907,6 +50941,7 @@ class EzGridCustomCellRender extends EzCellRender {
50907
50941
 
50908
50942
  class GridEditionManager {
50909
50943
  constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert, lockerId) {
50944
+ this._inProgressChanges = [];
50910
50945
  this._dataUnit = dataUnit;
50911
50946
  this._recordValidationProcessor = new DataBinder.RecordValidationProcessor(this._dataUnit, {
50912
50947
  getRequiredFields: () => this.getRequiredFields(),
@@ -51006,6 +51041,12 @@ class GridEditionManager {
51006
51041
  return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
51007
51042
  }
51008
51043
  async proceedAutoSave() {
51044
+ var _a;
51045
+ //Aguarda outras promises entrarem na fila
51046
+ await new Promise(resolve => setTimeout(resolve, 100));
51047
+ if (this._inProgressChanges.length) {
51048
+ await Promise.all((_a = this._inProgressChanges) === null || _a === void 0 ? void 0 : _a.map(({ promise }) => promise));
51049
+ }
51009
51050
  if (!this._dataUnit.isDirty()) {
51010
51051
  this.saveSuccess();
51011
51052
  return true;
@@ -51076,7 +51117,9 @@ class GridEditionManager {
51076
51117
  }
51077
51118
  configureColumn(col) {
51078
51119
  col.cellEditor = 'ezCellEditor';
51079
- col.editable = params => this.canEdit(params);
51120
+ if (col.editable != false) {
51121
+ col.editable = params => this.canEdit(params);
51122
+ }
51080
51123
  col.suppressKeyboardEvent = (params) => {
51081
51124
  if (params.event.key === KeyCode.ESCAPE && params.editing) {
51082
51125
  return this._dataUnit.isDirty();
@@ -51260,6 +51303,14 @@ class GridEditionManager {
51260
51303
  return;
51261
51304
  }
51262
51305
  if (value instanceof Promise) {
51306
+ const progressChange = {
51307
+ promise: undefined,
51308
+ resolve: () => { }
51309
+ };
51310
+ progressChange.promise = new Promise((resolve) => {
51311
+ progressChange.resolve = resolve;
51312
+ });
51313
+ this._inProgressChanges.push(progressChange);
51263
51314
  this.handlePromiseValue(event, value);
51264
51315
  return;
51265
51316
  }
@@ -51273,16 +51324,22 @@ class GridEditionManager {
51273
51324
  const resolved = await value;
51274
51325
  return this.updateCellValue(event, resolved);
51275
51326
  }
51276
- updateCellValue(event, newValue) {
51277
- var _a;
51327
+ async updateCellValue(event, newValue) {
51328
+ var _a, _b, _c, _d;
51278
51329
  const fieldName = event.colDef.field;
51279
- event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: newValue }));
51280
- (_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
51330
+ const newData = { [fieldName]: newValue };
51331
+ const descriptionColName = (_b = (_a = this._dataUnit.getField(fieldName)) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b[constants.PRESENTATION_COL_ID_PROP_NAME];
51332
+ if (!core.StringUtils.isEmpty(descriptionColName)) {
51333
+ newData[descriptionColName] = newValue === null || newValue === void 0 ? void 0 : newValue.label;
51334
+ }
51335
+ event.node.setData(Object.assign(Object.assign({}, event.data), { newData }));
51336
+ (_c = this._currentEditLock) === null || _c === void 0 ? void 0 : _c.call(this);
51281
51337
  if (event.oldValue !== newValue) {
51282
51338
  this._isGridEdition = true;
51283
- this._dataUnit.setFieldValue(fieldName, newValue, [event.data.__record__id__], { suppressCreateNewRecord: true });
51339
+ await this._dataUnit.setFieldValue(fieldName, newValue, [event.data.__record__id__], { suppressCreateNewRecord: true });
51284
51340
  this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
51285
51341
  }
51342
+ (_d = this._inProgressChanges) === null || _d === void 0 ? void 0 : _d.forEach(({ resolve }) => resolve(newValue));
51286
51343
  }
51287
51344
  setCellEditors(customEditors) {
51288
51345
  var _a;
@@ -64771,7 +64828,6 @@ class AgGridController {
64771
64828
  this.DEFAULT_FONT_SIZE_HTML5 = 32;
64772
64829
  this.DEFAULT_ICON_SIZE = 12;
64773
64830
  this.DEFAULT_MAX_SIZE = 200;
64774
- this.DOC_WIDTH = 800;
64775
64831
  this._menuItems = [];
64776
64832
  this._idAttribName = '__record__id__';
64777
64833
  this._gridConfig = [];
@@ -64780,6 +64836,7 @@ class AgGridController {
64780
64836
  this._customFormatters = new Map();
64781
64837
  this._gridShowDom = false;
64782
64838
  this.peddingExecutionsOnGridShow = [];
64839
+ this._lastColsConfig = undefined;
64783
64840
  ModuleRegistry.registerModules([
64784
64841
  EnterpriseCoreModule,
64785
64842
  RangeSelectionModule,
@@ -65374,7 +65431,9 @@ class AgGridController {
65374
65431
  }
65375
65432
  }
65376
65433
  isColumnEditable(rowIndex, column) {
65377
- if (column.getColDef().headerName === '' || rowIndex === -1)
65434
+ if (column.getColDef().headerName === ''
65435
+ || column.getColDef().headerName === this.CHECK_BOX_COL_ID
65436
+ || rowIndex === -1)
65378
65437
  return false;
65379
65438
  const rowId = this._dataUnit.records[rowIndex][this._idAttribName];
65380
65439
  const rowNode = this._gridOptions.api.getRowNode(rowId);
@@ -65392,7 +65451,7 @@ class AgGridController {
65392
65451
  this._gridOptions.api.setFocusedCell(rowIndex, firstCell);
65393
65452
  }
65394
65453
  setColumnsDef(cols) {
65395
- const checkBoxColumn = Object.assign({ colId: this.CHECK_BOX_COL_ID, headerName: '', checkboxSelection: true, width: 29, suppressMovable: true, suppressAutoSize: true, suppressMenu: true, lockPosition: true, pinned: true }, (this._multipleSelection && { headerComponent: 'ezGridHeaderComponent', headerClass: 'ag-column-select-header' }));
65454
+ const checkBoxColumn = Object.assign({ colId: this.CHECK_BOX_COL_ID, headerName: this.CHECK_BOX_COL_ID, checkboxSelection: true, width: 29, suppressMovable: true, suppressAutoSize: true, suppressMenu: true, lockPosition: true, pinned: true }, (this._multipleSelection && { headerComponent: 'ezGridHeaderComponent', headerClass: 'ag-column-select-header' }));
65396
65455
  const newColDefs = this._options.suppressCheckBoxCol ? [] : [checkBoxColumn];
65397
65456
  if (this._statusResolver != undefined) {
65398
65457
  newColDefs.push({
@@ -65420,8 +65479,39 @@ class AgGridController {
65420
65479
  });
65421
65480
  this._colDefs = newColDefs;
65422
65481
  if (this._gridOptions && this._gridOptions.api) {
65482
+ this.setColsDefsWithStateIfNeeded(this._colDefs);
65483
+ }
65484
+ }
65485
+ setColsDefsWithStateIfNeeded(colDefs) {
65486
+ if (!this._lastColsConfig) {
65423
65487
  this._gridOptions.api.setColumnDefs(this._colDefs);
65424
65488
  }
65489
+ /*
65490
+ Caso a definição de colunas esteja sendo atualizada,
65491
+ e existe uma config aplicada, temos que considerar essa
65492
+ config ao adicionar nova definição de colunas.
65493
+ PS: Poderia apenas chamar o setColumnsState, porém,
65494
+ isso impactaria em performance, e o usuário ia perceber
65495
+ a mudança das colunas visualmente na grade, o que traria
65496
+ uma experiencia ruim.
65497
+ */
65498
+ const colDefsWithConfigs = this.getColsDefWithConfigApplied(colDefs, this._lastColsConfig);
65499
+ this._gridOptions.api.setColumnDefs(colDefsWithConfigs);
65500
+ }
65501
+ getColsDefWithConfigApplied(colDefs, colsConfig) {
65502
+ //Cria map de colunas existentes na config e seu índice
65503
+ const orderMap = colsConfig.reduce((map, col, index) => {
65504
+ map[col.name] = index;
65505
+ return map;
65506
+ }, {});
65507
+ //Remove colunas que não existem na config
65508
+ const filteredColsDefs = colDefs.filter((col) => !orderMap.hasOwnProperty(col.colId));
65509
+ //Ordena colunas baseada na config aplicada
65510
+ const sortedColumnDefs = filteredColsDefs.sort((a, b) => {
65511
+ var _a, _b;
65512
+ return ((_a = orderMap[a.field]) !== null && _a !== void 0 ? _a : Number.MAX_VALUE) - ((_b = orderMap[b.field]) !== null && _b !== void 0 ? _b : Number.MAX_VALUE);
65513
+ });
65514
+ return sortedColumnDefs;
65425
65515
  }
65426
65516
  hideSelectionColumn() {
65427
65517
  var _a, _b;
@@ -65455,6 +65545,7 @@ class AgGridController {
65455
65545
  if (this._grid === undefined) {
65456
65546
  throw new Error('Erro interno: Grid ainda não inicializado.');
65457
65547
  }
65548
+ this._lastColsConfig = state;
65458
65549
  const colDef = this._gridOptions.columnApi.getColumns();
65459
65550
  let columns = this.getColumnsDef();
65460
65551
  let visibleColumns = [];
@@ -65463,14 +65554,39 @@ class AgGridController {
65463
65554
  const columnsOffset = colDef.length - columns.length;
65464
65555
  this._gridConfig = state;
65465
65556
  let sort = [];
65466
- state.forEach((cfgColumn, index) => {
65557
+ let currentIndex = 0;
65558
+ state.forEach((cfgColumn) => {
65559
+ var _a, _b;
65467
65560
  const colWidth = this.getColumnWidth(cfgColumn);
65468
- this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
65561
+ this._gridOptions.columnApi.moveColumn(cfgColumn.name, currentIndex + columnsOffset);
65469
65562
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
65470
65563
  visibleColumns.push(cfgColumn.name);
65471
65564
  if (cfgColumn.ascending !== undefined) {
65472
65565
  sort.push({ colId: cfgColumn.name, sort: cfgColumn.ascending !== true ? 'desc' : 'asc', sortIndex: cfgColumn.orderIndex });
65473
65566
  }
65567
+ currentIndex++;
65568
+ const fieldMD = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
65569
+ /*
65570
+ Migração para o SEARCHPLUS, caso de uso:
65571
+ - Agora existe uma coluna para o campo de descrição do relaciona
65572
+ - Essa col, não existe na config da grade que já foi salva pelo DS
65573
+ - Nesse caso, precisamos inserir a coluna de descrição automaticamente para que
65574
+ os usuários não percam a apresentação do campo de descrição.
65575
+ PS: Caso esteja herdando do HTML5, devemos manter a config como está la
65576
+ */
65577
+ if (this.needToAddDescriptionColumn(cfgColumn, fieldMD, state)) {
65578
+ const descriptionColID = (_b = fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.properties) === null || _b === void 0 ? void 0 : _b[constants.PRESENTATION_COL_ID_PROP_NAME];
65579
+ if (!descriptionColID)
65580
+ return;
65581
+ const descriptionCol = this._gridOptions.columnApi.getColumn(descriptionColID);
65582
+ const descriptionColDef = descriptionCol === null || descriptionCol === void 0 ? void 0 : descriptionCol.getColDef();
65583
+ const descriptionHeaderName = descriptionColDef === null || descriptionColDef === void 0 ? void 0 : descriptionColDef.headerName;
65584
+ const descriptionColSize = this.getColumnWidthByLabel(descriptionHeaderName);
65585
+ this._gridOptions.columnApi.moveColumn(descriptionColID, currentIndex + columnsOffset);
65586
+ this._gridOptions.columnApi.setColumnWidth(descriptionColID, descriptionColSize);
65587
+ visibleColumns.push(descriptionColID);
65588
+ currentIndex++;
65589
+ }
65474
65590
  });
65475
65591
  let invisibleColumns = columns.filter(column => !visibleColumns.includes(column.name)).map(column => column.name);
65476
65592
  this._gridOptions.columnApi.setColumnsVisible(visibleColumns, true);
@@ -65480,10 +65596,15 @@ class AgGridController {
65480
65596
  defaultState: { sort: null },
65481
65597
  });
65482
65598
  }
65483
- getAdaptiveWidth(width) {
65484
- const widthGrid = this._container.clientWidth;
65485
- const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
65486
- return Math.round(adaptiveWidth);
65599
+ needToAddDescriptionColumn(cfgColumn, fieldMD, stateConfig) {
65600
+ var _a, _b;
65601
+ if (!fieldMD) {
65602
+ return false;
65603
+ }
65604
+ const configVersion = ((_a = cfgColumn.configVersion) !== null && _a !== void 0 ? _a : 0);
65605
+ const isSearchPlus = (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.userInterface) == core.UserInterface.SEARCHPLUS;
65606
+ const descriptionColID = (_b = fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.properties) === null || _b === void 0 ? void 0 : _b[constants.PRESENTATION_COL_ID_PROP_NAME];
65607
+ return isSearchPlus && configVersion < 1 && stateConfig.find(col => col.name === descriptionColID) != undefined;
65487
65608
  }
65488
65609
  getColumnsState() {
65489
65610
  if (this._grid === undefined) {
@@ -65494,7 +65615,7 @@ class AgGridController {
65494
65615
  .map(s => {
65495
65616
  const column = this._gridOptions.columnApi.getColumn(s.colId);
65496
65617
  const def = column.getColDef();
65497
- const width = this.getAdaptiveWidth(column.getActualWidth());
65618
+ const width = column.getActualWidth();
65498
65619
  const label = def.headerName;
65499
65620
  const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
65500
65621
  const colState = { label, name };
@@ -65544,7 +65665,7 @@ class AgGridController {
65544
65665
  return filterOptions.map(item => item.check).includes(true);
65545
65666
  }
65546
65667
  buildColDef(source) {
65547
- var _a, _b, _c;
65668
+ var _a, _b, _c, _d;
65548
65669
  let tooltip = undefined;
65549
65670
  const propSortable = core.StringUtils.getBooleanValue((_a = source.props) === null || _a === void 0 ? void 0 : _a.get('gridSortable'), true);
65550
65671
  if ((_b = source.props) === null || _b === void 0 ? void 0 : _b.get('gridHeaderTooltip')) {
@@ -65566,6 +65687,11 @@ class AgGridController {
65566
65687
  showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
65567
65688
  },
65568
65689
  valueFormatter: params => {
65690
+ var _a, _b, _c, _d;
65691
+ const presentationFrom = (_a = source === null || source === void 0 ? void 0 : source.props) === null || _a === void 0 ? void 0 : _a.get(constants.PRESENTATION_FROM_COL_PROP_NAME);
65692
+ if (presentationFrom) {
65693
+ return (_d = (_c = (_b = params === null || params === void 0 ? void 0 : params.data) === null || _b === void 0 ? void 0 : _b[presentationFrom]) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : "";
65694
+ }
65569
65695
  if (params.value === undefined || params.value === null) {
65570
65696
  return "";
65571
65697
  }
@@ -65585,6 +65711,7 @@ class AgGridController {
65585
65711
  return this.getFormatterByColumn(params, source);
65586
65712
  },
65587
65713
  cellStyle: this.getStyleByColumn(source),
65714
+ editable: !((_d = source.props) === null || _d === void 0 ? void 0 : _d.has(constants.PRESENTATION_FROM_COL_PROP_NAME))
65588
65715
  });
65589
65716
  }
65590
65717
  setCustomFormatters(customFormatters) {
@@ -65600,8 +65727,11 @@ class AgGridController {
65600
65727
  };
65601
65728
  }
65602
65729
  getStyleByColumn(source) {
65730
+ var _a;
65603
65731
  let cellStyle = this.getInitCellStyle();
65604
- switch (source === null || source === void 0 ? void 0 : source.userInterface) {
65732
+ const primitiveUIType = (_a = source === null || source === void 0 ? void 0 : source.props) === null || _a === void 0 ? void 0 : _a.get("PRIMITIVETUIYPE");
65733
+ const uitype = source === null || source === void 0 ? void 0 : source.userInterface;
65734
+ switch (primitiveUIType !== null && primitiveUIType !== void 0 ? primitiveUIType : uitype) {
65605
65735
  case core.UserInterface.DECIMALNUMBER:
65606
65736
  case core.UserInterface.INTEGERNUMBER:
65607
65737
  cellStyle['text-align'] = 'right';
@@ -65617,7 +65747,7 @@ class AgGridController {
65617
65747
  return cellStyle;
65618
65748
  }
65619
65749
  getFormatterByColumn(params, source) {
65620
- var _a;
65750
+ var _a, _b, _c, _d;
65621
65751
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === 'OPTIONSELECTOR' && source.options) {
65622
65752
  const prop = source === null || source === void 0 ? void 0 : source.options;
65623
65753
  let options;
@@ -65654,6 +65784,9 @@ class AgGridController {
65654
65784
  return params === null || params === void 0 ? void 0 : params.value;
65655
65785
  }
65656
65786
  }
65787
+ if ((source === null || source === void 0 ? void 0 : source.userInterface) === core.UserInterface.SEARCHPLUS) {
65788
+ return (_d = (_c = (_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : params === null || params === void 0 ? void 0 : params.value) !== null && _d !== void 0 ? _d : "";
65789
+ }
65657
65790
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === core.UserInterface.DECIMALNUMBER) {
65658
65791
  if (params.value != undefined) {
65659
65792
  const precision = Number(source.props.get('precision')) || 2;
@@ -65827,7 +65960,7 @@ class AgGridController {
65827
65960
  this._gridOptions.api.stopEditing();
65828
65961
  }
65829
65962
  getColumnWidth(cfgColumn) {
65830
- var _a, _b;
65963
+ var _a, _b, _c, _d, _e, _f;
65831
65964
  if (cfgColumn == undefined) {
65832
65965
  return;
65833
65966
  }
@@ -65839,10 +65972,14 @@ class AgGridController {
65839
65972
  return parseInt(cfgColumn.width) + this.DEFAULT_FONT_SIZE_HTML5;
65840
65973
  }
65841
65974
  const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
65975
+ const label = (_b = field === null || field === void 0 ? void 0 : field.label) !== null && _b !== void 0 ? _b : (_f = (_e = (_d = (_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.columnApi) === null || _d === void 0 ? void 0 : _d.getColumn(cfgColumn.name)) === null || _e === void 0 ? void 0 : _e.getColDef()) === null || _f === void 0 ? void 0 : _f.headerName;
65842
65976
  if ((field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH) {
65843
65977
  return this.DEFAULT_MAX_SIZE;
65844
65978
  }
65845
- 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;
65979
+ return this.getColumnWidthByLabel(label);
65980
+ }
65981
+ getColumnWidthByLabel(label) {
65982
+ const labelSize = ((label === null || label === void 0 ? void 0 : label.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
65846
65983
  return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
65847
65984
  }
65848
65985
  }
@@ -589,7 +589,7 @@ const EzList = class {
589
589
  return { id: item.id, label: item.label, check: evt.detail };
590
590
  }
591
591
  renderListWithGroups() {
592
- return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
592
+ return index.h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
593
593
  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: {
594
594
  'selectable-container': this.ezSelectable,
595
595
  'hover-feedback': this.hoverFeedback,
@@ -599,7 +599,7 @@ const EzList = class {
599
599
  }));
600
600
  }
601
601
  renderList() {
602
- return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
602
+ return index.h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => {
603
603
  this.keyDownHandler(event);
604
604
  } }, index.h("div", { class: 'draggable-list' }, this._listItems.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
605
605
  'selectable-container': this.ezSelectable,
@@ -72,7 +72,7 @@ const EzModalContainer = class {
72
72
  this._closeButton.focus();
73
73
  }
74
74
  render() {
75
- return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.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) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
75
+ return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("div", { tabIndex: -1, class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.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) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
76
76
  }
77
77
  get _element() { return index.getElement(this); }
78
78
  };
@@ -36,7 +36,7 @@ const EzModal = class {
36
36
  }
37
37
  componentDidLoad() {
38
38
  this.observeOpened();
39
- new core.KeyboardManager({ propagate: false, element: this._element })
39
+ new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
40
40
  .bind("Enter", this.ezModalAction.emit.bind("OK"))
41
41
  .bind("Escape", () => this.closeModal())
42
42
  .bind("Esc", () => this.closeModal());
@@ -35,7 +35,7 @@ const EzPopup = class {
35
35
  if (this.opened && this._popupRef) {
36
36
  this._popupRef.focus();
37
37
  }
38
- new core.KeyboardManager({ propagate: false, element: this._element })
38
+ new core.KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
39
39
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
40
40
  .bind("Escape", () => this.closePopup())
41
41
  .bind("Esc", () => this.closePopup());