@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-68936.0 → 0.0.0-bugfix-dev-KB-65214.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-e49214c6.js} +2 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{IExporterProvider-d2a04ee7.js → IExporterProvider-10b7fed5.js} +5 -5
  4. package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-beebf47a.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-28ceaaed.js → SnkMessageBuilder-cceebbae.js} +3 -7
  6. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-75f89355.js → dataunit-fetcher-d4873076.js} +3 -10
  8. package/dist/cjs/{field-search-68e34bf4.js → field-search-f56aa7d6.js} +1 -5
  9. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
  14. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  15. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  16. package/dist/cjs/snk-crud.cjs.entry.js +11 -9
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
  18. package/dist/cjs/{snk-data-unit-bf418767.js → snk-data-unit-f0221097.js} +21 -10
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
  21. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  25. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  26. package/dist/cjs/snk-grid.cjs.entry.js +13 -38
  27. package/dist/cjs/{snk-guides-viewer-14c27834.js → snk-guides-viewer-aafc3073.js} +14 -13
  28. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  29. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  30. package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -29
  31. package/dist/collection/components/snk-crud/snk-crud.js +48 -13
  32. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +15 -17
  33. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  34. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  35. package/dist/collection/components/snk-data-unit/snk-data-unit.js +36 -8
  36. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  37. package/dist/collection/components/snk-grid/snk-grid.js +6 -58
  38. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +24 -41
  39. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +1 -5
  40. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +1 -1
  41. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  42. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +2 -9
  43. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  44. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  45. package/dist/collection/lib/message/resources/snk-grid.msg.js +1 -5
  46. package/dist/components/DataFetcher.js +8 -3
  47. package/dist/components/IExporterProvider.js +2 -6
  48. package/dist/components/SnkMessageBuilder.js +3 -7
  49. package/dist/components/dataunit-fetcher.js +2 -9
  50. package/dist/components/snk-crud.js +8 -5
  51. package/dist/components/snk-data-exporter2.js +2 -2
  52. package/dist/components/snk-data-unit2.js +20 -8
  53. package/dist/components/snk-detail-view2.js +9 -8
  54. package/dist/components/snk-exporter-email-sender2.js +1 -1
  55. package/dist/components/snk-grid2.js +8 -34
  56. package/dist/components/snk-simple-crud2.js +5 -22
  57. package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-e476378d.js} +2 -2
  58. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  59. package/dist/esm/{IExporterProvider-b2e244b3.js → IExporterProvider-d597f27d.js} +5 -5
  60. package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-298cd647.js} +2 -2
  61. package/dist/esm/{SnkMessageBuilder-0485b99a.js → SnkMessageBuilder-ae87b754.js} +3 -7
  62. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  63. package/dist/esm/{dataunit-fetcher-6463ac8d.js → dataunit-fetcher-3d2ec959.js} +3 -10
  64. package/dist/esm/{field-search-f8b1d91e.js → field-search-efbe307f.js} +1 -5
  65. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
  68. package/dist/esm/sankhyablocks.js +1 -1
  69. package/dist/esm/snk-actions-button_4.entry.js +5 -5
  70. package/dist/esm/snk-application.entry.js +7 -7
  71. package/dist/esm/snk-attach.entry.js +5 -5
  72. package/dist/esm/snk-crud.entry.js +11 -9
  73. package/dist/esm/snk-data-exporter.entry.js +8 -8
  74. package/dist/esm/{snk-data-unit-20860cfc.js → snk-data-unit-1ef94aef.js} +21 -10
  75. package/dist/esm/snk-data-unit.entry.js +4 -4
  76. package/dist/esm/snk-detail-view.entry.js +9 -9
  77. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  78. package/dist/esm/snk-filter-bar.entry.js +3 -3
  79. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  80. package/dist/esm/snk-form-config.entry.js +2 -2
  81. package/dist/esm/snk-form.entry.js +4 -4
  82. package/dist/esm/snk-grid.entry.js +13 -38
  83. package/dist/esm/{snk-guides-viewer-b82ec79a.js → snk-guides-viewer-62124f3d.js} +14 -13
  84. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  85. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  86. package/dist/esm/snk-simple-crud.entry.js +12 -29
  87. package/dist/sankhyablocks/{p-b4d016a3.js → p-091ce761.js} +1 -1
  88. package/dist/sankhyablocks/p-0c68f40f.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  90. package/dist/sankhyablocks/{p-74fafa0d.entry.js → p-162b9a59.entry.js} +2 -2
  91. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  92. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  93. package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
  94. package/dist/sankhyablocks/{p-62ba211a.entry.js → p-2e9c764c.entry.js} +1 -1
  95. package/dist/sankhyablocks/{p-52920496.js → p-3287a6cc.js} +1 -1
  96. package/dist/sankhyablocks/{p-d0bec13f.entry.js → p-421bec84.entry.js} +1 -1
  97. package/dist/sankhyablocks/{p-249adf8b.entry.js → p-42f7b05d.entry.js} +1 -1
  98. package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
  99. package/dist/sankhyablocks/p-52a6a293.entry.js +1 -0
  100. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  101. package/dist/sankhyablocks/{p-2a408684.js → p-5f016aed.js} +1 -1
  102. package/dist/sankhyablocks/{p-d6e26ea8.entry.js → p-62f34e6f.entry.js} +1 -1
  103. package/dist/sankhyablocks/p-684a2590.entry.js +1 -0
  104. package/dist/sankhyablocks/p-70001ac1.js +1 -0
  105. package/dist/sankhyablocks/{p-4111c6ce.entry.js → p-74c665d5.entry.js} +1 -1
  106. package/dist/sankhyablocks/{p-0e85d9ba.js → p-76a65660.js} +1 -1
  107. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  108. package/dist/sankhyablocks/{p-2f978e29.entry.js → p-8c1ff936.entry.js} +1 -1
  109. package/dist/sankhyablocks/{p-450c60e4.entry.js → p-939e15d3.entry.js} +1 -1
  110. package/dist/sankhyablocks/{p-47db7e88.entry.js → p-9dfda04a.entry.js} +1 -1
  111. package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-bd008859.entry.js} +1 -1
  112. package/dist/sankhyablocks/p-c2495304.js +1 -0
  113. package/dist/sankhyablocks/p-c273d6ee.js +1 -0
  114. package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
  115. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  116. package/dist/types/components/snk-crud/snk-crud.d.ts +7 -2
  117. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +3 -3
  118. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
  119. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -9
  120. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -7
  121. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +0 -1
  122. package/dist/types/components.d.ts +33 -24
  123. package/package.json +2 -2
  124. package/dist/sankhyablocks/p-14c2056a.js +0 -1
  125. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  126. package/dist/sankhyablocks/p-23736d75.js +0 -1
  127. package/dist/sankhyablocks/p-4238fcd4.entry.js +0 -1
  128. package/dist/sankhyablocks/p-6614c578.js +0 -1
  129. package/dist/sankhyablocks/p-6fede3d4.entry.js +0 -1
  130. package/dist/sankhyablocks/p-701442ef.entry.js +0 -1
  131. package/dist/sankhyablocks/p-950037cb.js +0 -1
  132. package/dist/sankhyablocks/p-95e44a9c.entry.js +0 -1
  133. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  134. package/dist/sankhyablocks/p-ebc4011a.entry.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ApplicationContext, DataType, ElementIDUtils, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
2
- import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
2
+ import { CSSVarsUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
3
  import { h } from '@stencil/core';
4
4
  import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
5
5
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
@@ -13,7 +13,7 @@ import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
13
13
  import { REGULAR_DEFAULT_BTNS, REGULAR_SELECTED_BTNS } from './regular-buttons';
14
14
  import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
15
15
  import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
16
- import store from '../../lib/store';
16
+ import store from "../../lib/store";
17
17
  export class SnkSimpleCrud {
18
18
  constructor() {
19
19
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
@@ -26,7 +26,7 @@ export class SnkSimpleCrud {
26
26
  "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
27
27
  "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [TaskbarElement.GRID_MODE]),
28
28
  "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
29
- "snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
29
+ "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
30
30
  });
31
31
  this._showPopUpGridConfig = false;
32
32
  this._showFormConfig = false;
@@ -46,7 +46,6 @@ export class SnkSimpleCrud {
46
46
  this.useCancelConfirm = true;
47
47
  this.pageSize = 150;
48
48
  this.resourceID = undefined;
49
- this.enableGridInsert = false;
50
49
  this.taskbarManager = undefined;
51
50
  this.messagesBuilder = undefined;
52
51
  this.useEnterLikeTab = false;
@@ -57,6 +56,7 @@ export class SnkSimpleCrud {
57
56
  this.formLegacyConfigName = undefined;
58
57
  this.ignoreReadOnlyFormFields = false;
59
58
  this.autoFocus = true;
59
+ this.domainMessagesBuilder = undefined;
60
60
  this.autoLoad = undefined;
61
61
  }
62
62
  /**
@@ -115,13 +115,6 @@ export class SnkSimpleCrud {
115
115
  newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
116
116
  this._fieldsProps = newCustomFieldProps;
117
117
  }
118
- getFinishEditionButtonsCallback() {
119
- const btns = ["CANCEL", "SAVE"];
120
- if (this.enableGridInsert && this._currentViewMode !== VIEW_MODE.ATTACHMENT) {
121
- btns.push(this._currentViewMode === VIEW_MODE.GRID ? TaskbarElement.FORM_MODE : TaskbarElement.GRID_MODE);
122
- }
123
- return btns;
124
- }
125
118
  getButtons(selected, extraButtons) {
126
119
  return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
127
120
  .concat(extraButtons));
@@ -204,6 +197,7 @@ export class SnkSimpleCrud {
204
197
  await this.setFieldProp(field, 'precision', rmPrecision);
205
198
  await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
206
199
  }
200
+ ;
207
201
  this._rmPrecisionCustomValueFormatter.setDataState(this.dataState);
208
202
  }
209
203
  async handleUpdateGridLegacyConfig(newValue, oldValue) {
@@ -560,9 +554,6 @@ export class SnkSimpleCrud {
560
554
  const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
561
555
  return Promise.resolve(options);
562
556
  }
563
- isGridInsertActive() {
564
- return this.enableGridInsert && this.dataUnit.hasNewRecord();
565
- }
566
557
  getActionsList() {
567
558
  var _a, _b;
568
559
  const hardList = [{
@@ -574,8 +565,6 @@ export class SnkSimpleCrud {
574
565
  ? this.getColumnSearch(actionButton, item)
575
566
  : this.getFieldSearch(actionButton, item)
576
567
  }];
577
- if (this.isGridInsertActive())
578
- return hardList;
579
568
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
580
569
  const taskbarID = this.getTopTaskBarId();
581
570
  return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
@@ -699,20 +688,15 @@ export class SnkSimpleCrud {
699
688
  }
700
689
  this._formConfigManager.setConfig(this.formConfig);
701
690
  }
702
- handleDataUnitOnInsertionMode() {
703
- if (this.enableGridInsert)
704
- return;
705
- this.goToView(VIEW_MODE.FORM);
706
- }
707
691
  /* istanbul ignore next */
708
692
  render() {
709
693
  var _a;
710
694
  if (this.dataUnit == undefined) {
711
695
  return;
712
696
  }
713
- return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
697
+ return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
714
698
  ? undefined
715
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
699
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
716
700
  }
717
701
  static get is() { return "snk-simple-crud"; }
718
702
  static get encapsulation() { return "scoped"; }
@@ -918,24 +902,6 @@ export class SnkSimpleCrud {
918
902
  "attribute": "resource-i-d",
919
903
  "reflect": false
920
904
  },
921
- "enableGridInsert": {
922
- "type": "boolean",
923
- "mutable": false,
924
- "complexType": {
925
- "original": "boolean",
926
- "resolved": "boolean",
927
- "references": {}
928
- },
929
- "required": false,
930
- "optional": true,
931
- "docs": {
932
- "tags": [],
933
- "text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
934
- },
935
- "attribute": "enable-grid-insert",
936
- "reflect": false,
937
- "defaultValue": "false"
938
- },
939
905
  "taskbarManager": {
940
906
  "type": "unknown",
941
907
  "mutable": false,
@@ -1121,6 +1087,23 @@ export class SnkSimpleCrud {
1121
1087
  "reflect": false,
1122
1088
  "defaultValue": "true"
1123
1089
  },
1090
+ "domainMessagesBuilder": {
1091
+ "type": "string",
1092
+ "mutable": false,
1093
+ "complexType": {
1094
+ "original": "string",
1095
+ "resolved": "string",
1096
+ "references": {}
1097
+ },
1098
+ "required": false,
1099
+ "optional": false,
1100
+ "docs": {
1101
+ "tags": [],
1102
+ "text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
1103
+ },
1104
+ "attribute": "domain-messages-builder",
1105
+ "reflect": false
1106
+ },
1124
1107
  "autoLoad": {
1125
1108
  "type": "boolean",
1126
1109
  "mutable": false,
@@ -29,16 +29,12 @@ export default class TaskbarProcessor {
29
29
  });
30
30
  }
31
31
  getButtonsArray(taskbarId, taskbarManager, dataState) {
32
- const defaults = this.getButtonsFromKey(taskbarId);
32
+ const defaults = this._defaultButtons[taskbarId];
33
33
  if (taskbarManager) {
34
34
  return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
35
35
  }
36
36
  return defaults;
37
37
  }
38
- getButtonsFromKey(taskbarId) {
39
- const btnsValue = this._defaultButtons[taskbarId];
40
- return typeof btnsValue === 'function' ? btnsValue() : btnsValue;
41
- }
42
38
  isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
43
39
  const originalValue = disabled.includes(buttonName) ? false : true;
44
40
  if (taskbarManager && taskbarManager.isEnabled) {
@@ -8,7 +8,7 @@ export default class RmPrecisionCustomValueFormatter {
8
8
  this.refreshSelectedRows();
9
9
  }
10
10
  setDataState(dataState) {
11
- if (this._dataState && ObjectUtils.equals(dataState === null || dataState === void 0 ? void 0 : dataState.metadataByRow, this._dataState.metadataByRow)) {
11
+ if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
12
12
  return;
13
13
  }
14
14
  this._dataState = dataState;
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
7
7
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
8
8
  };
9
- import { ApplicationContext, ErrorException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
9
+ import { ApplicationContext, ErrorException, ServiceCanceledException, ObjectUtils, StringUtils, WarningException } from '@sankhyalabs/core';
10
10
  import { batchRequests } from 'graphql-request';
11
11
  import UrlUtils from "../../../lib/utils/urlutils";
12
12
  import { PrintUtils } from '../../utils/PrintUtils';
@@ -372,9 +372,14 @@ export class DataFetcher {
372
372
  resolve(false);
373
373
  })
374
374
  ]).then((data) => {
375
- var _a;
375
+ var _a, _b;
376
376
  if (!hasClientEvent || data === false) {
377
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
377
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
378
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
379
+ }
380
+ else {
381
+ (((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
382
+ }
378
383
  }
379
384
  });
380
385
  });
@@ -44,19 +44,12 @@ export class DatasetStrategy {
44
44
  const records = this.processRecords(dataUnit, fields, responseRecords);
45
45
  const loadingInProgress = pagerId != undefined;
46
46
  const count = loadingInfo.count + records.length;
47
- const isInsertingNewRecord = dataUnit.hasNewRecord();
48
47
  const needReload = !loadingInProgress && localSorting.length > 0;
49
- /**
50
- * Caso precise recarregar dados, porém está no meio de uma inserção, os dados não devem recarregados instantaneamente,
51
- * Mas sim, sinalizar que o dataUnit está aguardando para der recarregado.
52
- */
53
- if (needReload && isInsertingNewRecord) {
54
- dataUnit.setWaitingToReload(true);
55
- }
56
48
  return Promise.resolve({
57
49
  records,
58
50
  loadingInfo: Object.assign(Object.assign({}, loadingInfo), { pagerId,
59
- loadingInProgress, total: loadingInProgress ? undefined : count, count, needReload: needReload && !isInsertingNewRecord })
51
+ loadingInProgress, total: loadingInProgress ? undefined : count, count,
52
+ needReload })
60
53
  });
61
54
  }
62
55
  catch (error) {
@@ -6,7 +6,7 @@ const snkDataUnitMessages = {
6
6
  },
7
7
  cancelInfo: {
8
8
  clone: "Duplicação descartada!",
9
- insert: "A inclusão descartada!",
9
+ insert: "A inclusão foi descartada!",
10
10
  update: "A edição foi descartada!"
11
11
  },
12
12
  confirm: {
@@ -7,7 +7,7 @@ const snkExporterMessages = {
7
7
  emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
8
8
  emailSenderOptStep_lblFormat: "Formato:",
9
9
  emailSenderOptStep_formatPDF: "PDF (.pdf)",
10
- emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
10
+ emailSenderOptStep_formatXLS: "Planilha (.xls)",
11
11
  emailSenderOptStep_export: "Exportar:",
12
12
  emailSenderOptStep_allData: "Toda a grade",
13
13
  emailSenderOptStep_currentPage: "Somente a página atual",
@@ -1,9 +1,5 @@
1
1
  export const snkGridMessages = {
2
- findColumn: "Busca de colunas",
3
- cancelConfirmation: {
4
- title: "Aviso",
5
- message: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?</b>",
6
- }
2
+ findColumn: "Busca de colunas"
7
3
  };
8
4
  export const snkGridConfigMessages = {
9
5
  gridConfiguration: "Configuração da Grade",
@@ -1,4 +1,4 @@
1
- import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
1
+ import { DataType, ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, ServiceCanceledException } from '@sankhyalabs/core';
2
2
  import { P as PrintUtils } from './PrintUtils.js';
3
3
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
 
@@ -6883,9 +6883,14 @@ class DataFetcher {
6883
6883
  resolve(false);
6884
6884
  })
6885
6885
  ]).then((data) => {
6886
- var _a;
6886
+ var _a, _b;
6887
6887
  if (!hasClientEvent || data === false) {
6888
- (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6888
+ if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
6889
+ (((_a = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new ServiceCanceledException("Service canceled", val.message));
6890
+ }
6891
+ else {
6892
+ (((_b = watingRequestsById.get(val.request.variables[val.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new ErrorException("Falha detectada", val.message));
6893
+ }
6889
6894
  }
6890
6895
  });
6891
6896
  });
@@ -124,16 +124,12 @@ class TaskbarProcessor {
124
124
  });
125
125
  }
126
126
  getButtonsArray(taskbarId, taskbarManager, dataState) {
127
- const defaults = this.getButtonsFromKey(taskbarId);
127
+ const defaults = this._defaultButtons[taskbarId];
128
128
  if (taskbarManager) {
129
129
  return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
130
130
  }
131
131
  return defaults;
132
132
  }
133
- getButtonsFromKey(taskbarId) {
134
- const btnsValue = this._defaultButtons[taskbarId];
135
- return typeof btnsValue === 'function' ? btnsValue() : btnsValue;
136
- }
137
133
  isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
138
134
  const originalValue = disabled.includes(buttonName) ? false : true;
139
135
  if (taskbarManager && taskbarManager.isEnabled) {
@@ -221,7 +217,7 @@ class RmPrecisionCustomValueFormatter {
221
217
  this.refreshSelectedRows();
222
218
  }
223
219
  setDataState(dataState) {
224
- if (this._dataState && ObjectUtils.equals(dataState === null || dataState === void 0 ? void 0 : dataState.metadataByRow, this._dataState.metadataByRow)) {
220
+ if (ObjectUtils.objectToString(dataState) === ObjectUtils.objectToString(this._dataState)) {
225
221
  return;
226
222
  }
227
223
  this._dataState = dataState;
@@ -8,7 +8,7 @@ const snkDataUnitMessages = {
8
8
  },
9
9
  cancelInfo: {
10
10
  clone: "Duplicação descartada!",
11
- insert: "A inclusão descartada!",
11
+ insert: "A inclusão foi descartada!",
12
12
  update: "A edição foi descartada!"
13
13
  },
14
14
  confirm: {
@@ -122,7 +122,7 @@ const snkExporterMessages = {
122
122
  emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
123
123
  emailSenderOptStep_lblFormat: "Formato:",
124
124
  emailSenderOptStep_formatPDF: "PDF (.pdf)",
125
- emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
125
+ emailSenderOptStep_formatXLS: "Planilha (.xls)",
126
126
  emailSenderOptStep_export: "Exportar:",
127
127
  emailSenderOptStep_allData: "Toda a grade",
128
128
  emailSenderOptStep_currentPage: "Somente a página atual",
@@ -245,11 +245,7 @@ const snkConfiguratorMessages = {
245
245
  };
246
246
 
247
247
  const snkGridMessages = {
248
- findColumn: "Busca de colunas",
249
- cancelConfirmation: {
250
- title: "Aviso",
251
- message: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?</b>",
252
- }
248
+ findColumn: "Busca de colunas"
253
249
  };
254
250
  const snkGridConfigMessages = {
255
251
  gridConfiguration: "Configuração da Grade",
@@ -424,19 +424,12 @@ class DatasetStrategy {
424
424
  const records = this.processRecords(dataUnit, fields, responseRecords);
425
425
  const loadingInProgress = pagerId != undefined;
426
426
  const count = loadingInfo.count + records.length;
427
- const isInsertingNewRecord = dataUnit.hasNewRecord();
428
427
  const needReload = !loadingInProgress && localSorting.length > 0;
429
- /**
430
- * Caso precise recarregar dados, porém está no meio de uma inserção, os dados não devem recarregados instantaneamente,
431
- * Mas sim, sinalizar que o dataUnit está aguardando para der recarregado.
432
- */
433
- if (needReload && isInsertingNewRecord) {
434
- dataUnit.setWaitingToReload(true);
435
- }
436
428
  return Promise.resolve({
437
429
  records,
438
430
  loadingInfo: Object.assign(Object.assign({}, loadingInfo), { pagerId,
439
- loadingInProgress, total: loadingInProgress ? undefined : count, count, needReload: needReload && !isInsertingNewRecord })
431
+ loadingInProgress, total: loadingInProgress ? undefined : count, count,
432
+ needReload })
440
433
  });
441
434
  }
442
435
  catch (error) {
@@ -51,6 +51,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
51
51
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
52
52
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
53
53
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
54
+ this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
54
55
  this._keyDownHandler = async (event) => this.keyDownListener(event);
55
56
  this._viewHistory = [];
56
57
  this._customEditors = new Map();
@@ -79,7 +80,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
80
  this.disablePersonalizedFilter = undefined;
80
81
  this.autoLoad = undefined;
81
82
  this.autoFocus = true;
82
- this.enableGridInsert = false;
83
+ this.domainMessagesBuilder = undefined;
84
+ this.setCustomFormTitle = undefined;
83
85
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
84
86
  }
85
87
  /**
@@ -188,6 +190,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
188
190
  else if (viewMode === VIEW_MODE.FORM) {
189
191
  this._guidesViewer.setFocus();
190
192
  }
193
+ this.viewModeChanged.emit(viewMode);
191
194
  }
192
195
  openConfig(viewMode) {
193
196
  this._snkConfigurator.close();
@@ -203,8 +206,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
203
206
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
204
207
  }
205
208
  insertionModeHandler() {
206
- if (this.enableGridInsert)
207
- return;
208
209
  this.gridToForm();
209
210
  }
210
211
  cancelHandler() {
@@ -253,6 +254,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
253
254
  this._snkDataUnit = parent;
254
255
  this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
255
256
  this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
257
+ this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
256
258
  this._dataUnit = this._snkDataUnit.dataUnit;
257
259
  this._dataState = this._snkDataUnit.dataState;
258
260
  if (!this._dataUnit) {
@@ -418,7 +420,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
418
420
  return;
419
421
  }
420
422
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
421
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
423
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, getCustomTitle: this.setCustomFormTitle }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
422
424
  }
423
425
  get _element() { return this; }
424
426
  static get watchers() { return {
@@ -444,7 +446,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
444
446
  "disablePersonalizedFilter": [4, "disable-personalized-filter"],
445
447
  "autoLoad": [4, "auto-load"],
446
448
  "autoFocus": [4, "auto-focus"],
447
- "enableGridInsert": [4, "enable-grid-insert"],
449
+ "domainMessagesBuilder": [1, "domain-messages-builder"],
450
+ "setCustomFormTitle": [16],
448
451
  "_dataUnit": [32],
449
452
  "_dataState": [32],
450
453
  "attachmentRegisterKey": [32],
@@ -124,7 +124,7 @@ class ItemBuilder {
124
124
  getExportToXLS(groupName) {
125
125
  return {
126
126
  id: DataExporterOption.EXPORT_TO_XLS,
127
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
127
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
128
128
  group: groupName
129
129
  };
130
130
  }
@@ -167,7 +167,7 @@ class ItemBuilder {
167
167
  getExportPageToXLS() {
168
168
  return {
169
169
  id: DataExporterOption.EXPORT_PAGE_TO_XLS,
170
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
170
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
171
171
  };
172
172
  }
173
173
  /**
@@ -97,6 +97,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
97
97
  this.ignoreSaveMessage = undefined;
98
98
  this.configName = undefined;
99
99
  this.resourceID = undefined;
100
+ this.domainMessagesBuilder = undefined;
100
101
  }
101
102
  observePageSize() {
102
103
  if (this.dataUnit) {
@@ -513,7 +514,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
513
514
  if (this.ignoreSaveMessage) {
514
515
  return;
515
516
  }
516
- const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
517
+ const saveOperation = action.payload.changes[0]._operation.toLowerCase();
518
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
517
519
  if (msg != undefined) {
518
520
  this.showSuccessMessage(msg);
519
521
  }
@@ -544,10 +546,13 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
544
546
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
545
547
  * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
546
548
  */
547
- getMessage(key, params = undefined) {
549
+ getMessage(key, params = undefined, customOperation) {
548
550
  if (!params) {
549
551
  params = this.getMessageParams();
550
552
  }
553
+ if (customOperation) {
554
+ this.messagesBuilder.currentOperation = customOperation;
555
+ }
551
556
  return this.messagesBuilder.getMessage(key, params);
552
557
  }
553
558
  getMessageParams() {
@@ -578,7 +583,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
578
583
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
579
584
  }
580
585
  }
581
- async loadDataUnit() {
586
+ async loadDataUnit(forceMetadataLoad = true) {
582
587
  var _a;
583
588
  if (this.dataUnit == null && this._application && this.entityName) {
584
589
  this.dataUnit = await this.getDataUnitParentOrChild();
@@ -588,7 +593,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
588
593
  this.dataUnit.unsubscribe(this._dataUnitObserver);
589
594
  this.dataUnit.addInterceptor(this);
590
595
  this.dataUnit.subscribe(this._dataUnitObserver);
591
- await this.dataUnit.loadMetadata();
596
+ if (forceMetadataLoad || !this.dataUnit.metadata)
597
+ await this.dataUnit.loadMetadata();
592
598
  if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
593
599
  this.getMetadataByRow(this.dataUnit);
594
600
  }
@@ -654,6 +660,13 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
654
660
  parent = parent.parentElement;
655
661
  }
656
662
  }
663
+ instanceMessagesBuilder() {
664
+ var _a;
665
+ if (this.messagesBuilder) {
666
+ return;
667
+ }
668
+ this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
669
+ }
657
670
  //---------------------------------------------
658
671
  // Lifecycle web component
659
672
  //---------------------------------------------
@@ -661,9 +674,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
661
674
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
662
675
  this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
663
676
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
664
- if (this.messagesBuilder == undefined) {
665
- this.messagesBuilder = new SnkMessageBuilder(this.entityName);
666
- }
677
+ this.instanceMessagesBuilder();
667
678
  }
668
679
  disconnectedCallback() {
669
680
  if (this.dataUnit) {
@@ -671,7 +682,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
671
682
  }
672
683
  }
673
684
  async componentDidLoad() {
674
- await this.loadDataUnit();
685
+ await this.loadDataUnit(false);
675
686
  this.handlerLinkFields();
676
687
  }
677
688
  render() {
@@ -699,6 +710,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
699
710
  "ignoreSaveMessage": [4, "ignore-save-message"],
700
711
  "configName": [1, "config-name"],
701
712
  "resourceID": [1, "resource-i-d"],
713
+ "domainMessagesBuilder": [1, "domain-messages-builder"],
702
714
  "fieldsToLink": [32],
703
715
  "getDataUnit": [64],
704
716
  "getSelectedRecordsIDsInfo": [64],
@@ -70,7 +70,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
70
70
  this.resourceID = undefined;
71
71
  this.detailTaskbarCustomContainerId = undefined;
72
72
  this.formLegacyConfigName = undefined;
73
- this.enableGridInsert = false;
73
+ this.getCustomTitle = undefined;
74
74
  this._hasToCreateFieldSearch = true;
75
75
  this._breadcrumbItems = [];
76
76
  this._guides = undefined;
@@ -139,7 +139,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
139
139
  this._container.focus();
140
140
  }
141
141
  exitViewer() {
142
- if (!this.enableGridInsert && this.dataUnit.isDirty()) {
142
+ if (this.dataUnit.isDirty()) {
143
143
  this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
144
144
  }
145
145
  else {
@@ -248,13 +248,10 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
248
248
  const invisibleButtons = this.getInvisibleButtons();
249
249
  this._taskbarProcessor = new TaskbarProcessor({
250
250
  "snkGuideViewer.regular": btnsRegularMode,
251
- "snkGuideViewer.finish_edition": ["CANCEL", "SAVE", this.handleAddGridMode()],
251
+ "snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
252
252
  });
253
253
  this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
254
254
  }
255
- handleAddGridMode() {
256
- return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
257
- }
258
255
  getInvisibleButtons() {
259
256
  const invisibleButtons = [];
260
257
  if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
@@ -511,6 +508,10 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
511
508
  }
512
509
  return "";
513
510
  }
511
+ getTitle() {
512
+ var _a, _b;
513
+ return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
514
+ }
514
515
  componentDidLoad() {
515
516
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
516
517
  }
@@ -524,7 +525,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
524
525
  }
525
526
  this.loadTaskbarProcessor();
526
527
  const showGuides = this._guides && (this._guides.length > 1);
527
- return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getMessage("snkCrud.title")), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
528
+ return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
528
529
  h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
529
530
  h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
530
531
  :
@@ -562,7 +563,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
562
563
  "resourceID": [1, "resource-i-d"],
563
564
  "detailTaskbarCustomContainerId": [1, "detail-taskbar-custom-container-id"],
564
565
  "formLegacyConfigName": [1, "form-legacy-config-name"],
565
- "enableGridInsert": [4, "enable-grid-insert"],
566
+ "getCustomTitle": [16],
566
567
  "_hasToCreateFieldSearch": [32],
567
568
  "_breadcrumbItems": [32],
568
569
  "_guides": [32],
@@ -16,7 +16,7 @@ const OptionsStep = ({ getMessage, changeInfo, data }) => {
16
16
  const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
17
17
  const formatOptions = [
18
18
  { label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
19
- { label: getMessage("snkExporter.emailSenderOptStep_formatXLSX"), value: "xlsx" }
19
+ { label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
20
20
  ];
21
21
  const typeOptions = [
22
22
  { label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },