@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-74224.1 → 0.0.0-bugfix-dev-KB-75070.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 (157) hide show
  1. package/dist/cjs/{ConfigStorage-ecc0ed20.js → ConfigStorage-f079f5fd.js} +2 -2
  2. package/dist/cjs/{ContinuousInsertUtils-29b65619.js → ContinuousInsertUtils-64e47516.js} +29 -20
  3. package/dist/cjs/{DataFetcher-cadeef8e.js → DataFetcher-e059eb72.js} +7 -5
  4. package/dist/cjs/{SnkFormConfigManager-f1c92f79.js → SnkFormConfigManager-63369164.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-d68841bc.js → auth-fetcher-4f853233.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-f89461c1.js → dataunit-fetcher-228016f4.js} +3 -3
  7. package/dist/cjs/{form-config-fetcher-ed497282.js → form-config-fetcher-39397ac5.js} +1 -1
  8. package/dist/cjs/index-f9e81701.js +8 -28
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-ca89181c.js → pesquisa-fetcher-a9bfeb22.js} +7 -2
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
  13. package/dist/cjs/snk-application.cjs.entry.js +111 -59
  14. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  15. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +365 -3
  16. package/dist/cjs/snk-crud.cjs.entry.js +13 -7
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  18. package/dist/cjs/{snk-data-unit-668dc5e8.js → snk-data-unit-3d9b6ed4.js} +26 -14
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  21. package/dist/cjs/{snk-filter-bar.cjs.entry.js → snk-filter-bar_4.cjs.entry.js} +691 -3
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-grid.cjs.entry.js +16 -8
  24. package/dist/cjs/{snk-guides-viewer-4236cb9d.js → snk-guides-viewer-eee43c8b.js} +8 -5
  25. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  27. package/dist/cjs/snk-simple-crud.cjs.entry.js +45 -10
  28. package/dist/cjs/snk-taskbar.cjs.entry.js +37 -35
  29. package/dist/collection/collection-manifest.json +11 -31
  30. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +28 -0
  31. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +16 -0
  32. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +52 -0
  33. package/dist/collection/components/snk-application/snk-application.js +44 -54
  34. package/dist/collection/components/snk-crud/snk-crud.js +26 -2
  35. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +3 -0
  36. package/dist/collection/components/snk-data-unit/snk-data-unit.js +25 -13
  37. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +18 -0
  38. package/dist/collection/components/snk-grid/snk-grid.js +28 -2
  39. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +57 -4
  40. package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -36
  41. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -6
  42. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  43. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -1
  44. package/dist/collection/lib/utils/CrudUtils.js +25 -16
  45. package/dist/collection/sw.js +46 -0
  46. package/dist/components/ContinuousInsertUtils.js +25 -16
  47. package/dist/components/DataFetcher.js +7 -5
  48. package/dist/components/dataunit-fetcher.js +2 -2
  49. package/dist/components/pesquisa-fetcher.js +6 -1
  50. package/dist/components/snk-application2.js +107 -54
  51. package/dist/components/snk-crud.js +9 -2
  52. package/dist/components/snk-data-unit2.js +25 -13
  53. package/dist/components/snk-detail-view2.js +3 -0
  54. package/dist/components/snk-filter-bar2.js +4 -0
  55. package/dist/components/snk-grid2.js +11 -2
  56. package/dist/components/snk-simple-crud2.js +40 -4
  57. package/dist/components/snk-taskbar2.js +38 -36
  58. package/dist/esm/{ConfigStorage-7b36d041.js → ConfigStorage-6514d66e.js} +2 -2
  59. package/dist/esm/{ContinuousInsertUtils-30caa626.js → ContinuousInsertUtils-b62906f9.js} +29 -20
  60. package/dist/esm/{DataFetcher-a9c598f2.js → DataFetcher-5034df59.js} +7 -5
  61. package/dist/esm/{SnkFormConfigManager-139f09fa.js → SnkFormConfigManager-b409c745.js} +3 -3
  62. package/dist/esm/{auth-fetcher-749d880f.js → auth-fetcher-ca5d3a49.js} +1 -1
  63. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  64. package/dist/esm/{dataunit-fetcher-c24c76c6.js → dataunit-fetcher-56cb648b.js} +3 -3
  65. package/dist/esm/{form-config-fetcher-adbe5d34.js → form-config-fetcher-a7d3e277.js} +1 -1
  66. package/dist/esm/index-a7d3d3f1.js +8 -28
  67. package/dist/esm/loader.js +1 -1
  68. package/dist/esm/{pesquisa-fetcher-8edaa8cd.js → pesquisa-fetcher-6bc2e41a.js} +7 -2
  69. package/dist/esm/sankhyablocks.js +1 -1
  70. package/dist/esm/snk-actions-button_4.entry.js +6 -6
  71. package/dist/esm/snk-application.entry.js +111 -59
  72. package/dist/esm/snk-attach.entry.js +6 -6
  73. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +366 -6
  74. package/dist/esm/snk-configurator.entry.js +1 -1
  75. package/dist/esm/snk-crud.entry.js +14 -8
  76. package/dist/esm/snk-data-exporter.entry.js +6 -6
  77. package/dist/esm/{snk-data-unit-0fdfb6c2.js → snk-data-unit-9fa7d2b9.js} +26 -14
  78. package/dist/esm/snk-data-unit.entry.js +3 -3
  79. package/dist/esm/snk-detail-view.entry.js +8 -8
  80. package/dist/esm/snk-field-config.entry.js +1 -1
  81. package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_4.entry.js} +690 -5
  82. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  83. package/dist/esm/snk-grid.entry.js +16 -8
  84. package/dist/esm/{snk-guides-viewer-8934c537.js → snk-guides-viewer-e8ca764a.js} +9 -6
  85. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  86. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  87. package/dist/esm/snk-simple-crud.entry.js +47 -12
  88. package/dist/esm/snk-tab-config.entry.js +1 -1
  89. package/dist/esm/snk-taskbar.entry.js +38 -36
  90. package/dist/sankhyablocks/{p-f3434fc4.js → p-00278e07.js} +1 -1
  91. package/dist/sankhyablocks/{p-b9c67e45.entry.js → p-0d2a2e9e.entry.js} +1 -1
  92. package/dist/sankhyablocks/{p-afbb070d.js → p-0e206e62.js} +1 -1
  93. package/dist/sankhyablocks/{p-06421fdb.js → p-126c58ea.js} +1 -1
  94. package/dist/sankhyablocks/p-200a5481.entry.js +11 -0
  95. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  96. package/dist/sankhyablocks/p-30ebcbe0.entry.js +1 -0
  97. package/dist/sankhyablocks/{p-1bf06cd3.js → p-341465ce.js} +2 -2
  98. package/dist/sankhyablocks/p-342eeb3b.js +1 -0
  99. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  100. package/dist/sankhyablocks/p-42130213.entry.js +1 -0
  101. package/dist/sankhyablocks/{p-be5d8fcb.entry.js → p-43353d86.entry.js} +1 -1
  102. package/dist/sankhyablocks/{p-7ac7932c.js → p-47d24ac8.js} +2 -2
  103. package/dist/sankhyablocks/p-520c7c38.entry.js +1 -0
  104. package/dist/sankhyablocks/{p-430e4d3c.entry.js → p-7075b789.entry.js} +1 -1
  105. package/dist/sankhyablocks/p-83e71703.entry.js +1 -0
  106. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  107. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  108. package/dist/sankhyablocks/{p-4d9549cf.js → p-9ffd9fc7.js} +1 -1
  109. package/dist/sankhyablocks/{p-dcead955.entry.js → p-a2c790ac.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-a3fadd0b.entry.js +1 -0
  111. package/dist/sankhyablocks/{p-212213d9.entry.js → p-aa003d4e.entry.js} +1 -1
  112. package/dist/sankhyablocks/p-aaf94476.js +1 -0
  113. package/dist/sankhyablocks/p-ac26df7a.entry.js +1 -0
  114. package/dist/sankhyablocks/{p-fd8e631c.entry.js → p-af7f7b3e.entry.js} +1 -1
  115. package/dist/sankhyablocks/p-c51ad0e7.entry.js +1 -0
  116. package/dist/sankhyablocks/{p-16869f77.js → p-e3a285a2.js} +1 -1
  117. package/dist/sankhyablocks/p-e4391e16.js +1 -0
  118. package/dist/sankhyablocks/{p-fb34e0cf.entry.js → p-fca0e5cc.entry.js} +1 -1
  119. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  120. package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +11 -0
  121. package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +12 -0
  122. package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +13 -0
  123. package/dist/types/components/snk-application/snk-application.d.ts +9 -13
  124. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  125. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  126. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  127. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +2 -0
  128. package/dist/types/components.d.ts +30 -0
  129. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  130. package/dist/types/lib/utils/CrudUtils.d.ts +1 -0
  131. package/package.json +3 -2
  132. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  133. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  134. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  135. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  136. package/dist/cjs/snk-form.cjs.entry.js +0 -144
  137. package/dist/esm/snk-config-options.entry.js +0 -235
  138. package/dist/esm/snk-filter-item.entry.js +0 -308
  139. package/dist/esm/snk-filter-list.entry.js +0 -148
  140. package/dist/esm/snk-filter-modal.entry.js +0 -245
  141. package/dist/esm/snk-form.entry.js +0 -140
  142. package/dist/sankhyablocks/p-01086ff7.entry.js +0 -1
  143. package/dist/sankhyablocks/p-2923c1b5.js +0 -1
  144. package/dist/sankhyablocks/p-2aae03a1.entry.js +0 -1
  145. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  146. package/dist/sankhyablocks/p-5dd8cf4f.js +0 -1
  147. package/dist/sankhyablocks/p-60b29483.entry.js +0 -1
  148. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  149. package/dist/sankhyablocks/p-92eadb1c.entry.js +0 -1
  150. package/dist/sankhyablocks/p-a42e7a1e.entry.js +0 -11
  151. package/dist/sankhyablocks/p-a724e798.entry.js +0 -1
  152. package/dist/sankhyablocks/p-a75d242d.entry.js +0 -1
  153. package/dist/sankhyablocks/p-b9679243.entry.js +0 -1
  154. package/dist/sankhyablocks/p-ca5ec380.js +0 -1
  155. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  156. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  157. package/dist/sankhyablocks/p-feba9d4b.entry.js +0 -1
@@ -5,17 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
- require('./DataFetcher-cadeef8e.js');
9
- require('./pesquisa-fetcher-ca89181c.js');
8
+ require('./DataFetcher-e059eb72.js');
9
+ require('./pesquisa-fetcher-a9bfeb22.js');
10
10
  const index$1 = require('./index-1dfc7a6e.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-f89461c1.js');
14
+ require('./dataunit-fetcher-228016f4.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
- require('./form-config-fetcher-ed497282.js');
16
+ require('./form-config-fetcher-39397ac5.js');
17
17
  const constants = require('./constants-35ddd366.js');
18
- const authFetcher = require('./auth-fetcher-d68841bc.js');
18
+ const authFetcher = require('./auth-fetcher-4f853233.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./PrintUtils-bcaeb82f.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
@@ -63,6 +63,7 @@ const SnkCrud = class {
63
63
  this.enableGridInsert = false;
64
64
  this.domainMessagesBuilder = undefined;
65
65
  this.ignoreReadOnlyFormFields = undefined;
66
+ this.enableLockManger = false;
66
67
  this.setCustomFormTitle = undefined;
67
68
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
68
69
  }
@@ -303,11 +304,16 @@ const SnkCrud = class {
303
304
  if (!isDocumentBody)
304
305
  element.focus();
305
306
  }
307
+ async function handleAddRecord() {
308
+ if (!dataUnit.hasNewRecord()) {
309
+ dataUnit.addRecord();
310
+ }
311
+ }
306
312
  keyboardManager
307
313
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
308
314
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
309
315
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
310
- .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
316
+ .bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
311
317
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
312
318
  .bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
313
319
  .bind("ctrl + .", () => {
@@ -404,7 +410,7 @@ const SnkCrud = class {
404
410
  return;
405
411
  }
406
412
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert);
407
- return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.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 }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.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, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.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 })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
413
+ return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.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, enableLockManger: this.enableLockManger }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.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, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.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 })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
408
414
  }
409
415
  get _element() { return index.getElement(this); }
410
416
  static get watchers() { return {
@@ -7,15 +7,15 @@ const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-1dfc7a6e.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
- const DataFetcher = require('./DataFetcher-cadeef8e.js');
11
- const snkDataUnit = require('./snk-data-unit-668dc5e8.js');
12
- require('./pesquisa-fetcher-ca89181c.js');
10
+ const DataFetcher = require('./DataFetcher-e059eb72.js');
11
+ const snkDataUnit = require('./snk-data-unit-3d9b6ed4.js');
12
+ require('./pesquisa-fetcher-a9bfeb22.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- require('./dataunit-fetcher-f89461c1.js');
16
+ require('./dataunit-fetcher-228016f4.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
- require('./form-config-fetcher-ed497282.js');
18
+ require('./form-config-fetcher-39397ac5.js');
19
19
  require('./PrintUtils-bcaeb82f.js');
20
20
  require('./SnkMessageBuilder-bae64d0d.js');
21
21
  require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
@@ -4,7 +4,7 @@ const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
5
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
6
  const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
7
- const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
7
+ const dataunitFetcher = require('./dataunit-fetcher-228016f4.js');
8
8
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
9
9
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
10
10
 
@@ -25,7 +25,7 @@ const SnkDataUnit = class {
25
25
  this._rowMetadataCache = new Map();
26
26
  this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
27
27
  this._dataUnitObserver = async (action) => {
28
- const duState = this.buildDataState(action.type);
28
+ const duState = await this.buildDataState(action.type);
29
29
  this.dataState = duState;
30
30
  this.messagesBuilder.currentOperation = this.getMessageOperation();
31
31
  switch (action.type) {
@@ -137,14 +137,22 @@ const SnkDataUnit = class {
137
137
  async getRowMetadata(record) {
138
138
  return this.doGetRowMetadata(record);
139
139
  }
140
- doGetRowMetadata(record) {
140
+ async doGetRowMetadata(record) {
141
141
  const selectedRecord = this.dataUnit.getSelectedRecord();
142
142
  if (!record && !selectedRecord) {
143
143
  return;
144
144
  }
145
145
  const currentRecord = record || selectedRecord;
146
146
  const recordId = typeof currentRecord === 'string' ? currentRecord : currentRecord.__record__id__;
147
- const rowMetadata = this._metadataByRow.get(recordId);
147
+ let rowMetadata = this._metadataByRow.get(recordId);
148
+ /*
149
+ Nao fazemos cache de metadataByRow pra registros novos, pois a chave do mesmo
150
+ muda ao ser salvo, por isso essa tratativa é necessária para que o dataState fique com metadados
151
+ corretos nao confiando apenas no _metadataByRow
152
+ */
153
+ if (this.dataUnit.isNewRecord(recordId) && !rowMetadata) {
154
+ rowMetadata = await this.handleLoadRowMetadata(selectedRecord);
155
+ }
148
156
  if (!rowMetadata) {
149
157
  return;
150
158
  }
@@ -338,7 +346,7 @@ const SnkDataUnit = class {
338
346
  case core.Action.RECORDS_COPIED:
339
347
  return this.interceptRecordsCopied(action);
340
348
  case core.Action.DATA_CHANGED:
341
- await this.handleLoadRowMetadata(action);
349
+ await this.handleLoadRowMetadata(action.payload);
342
350
  return await this.interceptDataChange(action);
343
351
  case core.Action.CHANGING_DATA:
344
352
  return await this.interceptDataChange(action);
@@ -358,8 +366,9 @@ const SnkDataUnit = class {
358
366
  return action;
359
367
  }
360
368
  }
361
- async handleLoadRowMetadata(action) {
362
- const record = action.type === core.Action.DATA_CHANGED ? action.payload : action.payload.changes[0].record;
369
+ async handleLoadRowMetadata(record) {
370
+ if (!record)
371
+ return;
363
372
  const keysPayload = Object.keys(record);
364
373
  const rmpField = keysPayload.find((field) => this._fieldsWithRmp.includes(field));
365
374
  if (rmpField) {
@@ -438,7 +447,7 @@ const SnkDataUnit = class {
438
447
  isAllowed(flag) {
439
448
  return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
440
449
  }
441
- buildDataState(actionType) {
450
+ async buildDataState(actionType) {
442
451
  var _a;
443
452
  const selectionInfo = this.dataUnit.getSelectionInfo();
444
453
  const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
@@ -446,7 +455,7 @@ const SnkDataUnit = class {
446
455
  let rowMetadata = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata;
447
456
  const allowedOverwrite = [core.Action.SELECTION_CHANGED, core.Action.EDITION_CANCELED, core.Action.NEXT_SELECTED, core.Action.PREVIOUS_SELECTED];
448
457
  if (selectedRecord && (!rowMetadata || allowedOverwrite.includes(actionType))) {
449
- rowMetadata = this.doGetRowMetadata(selectedRecord);
458
+ rowMetadata = await this.doGetRowMetadata(selectedRecord);
450
459
  }
451
460
  else if (rowMetadata) {
452
461
  rowMetadata.getProp = this.buildGetPropRowMetadata(rowMetadata);
@@ -468,17 +477,20 @@ const SnkDataUnit = class {
468
477
  });
469
478
  }
470
479
  async handleDataSaved(action) {
471
- const newRowMetadata = await this.handleLoadRowMetadata(action);
480
+ var _a, _b, _c;
481
+ const newRowMetadata = await this.handleLoadRowMetadata((_c = (_b = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.changes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.record);
472
482
  if (newRowMetadata) {
473
483
  newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
474
484
  }
475
485
  const recordId = action.payload.records[0].__record__id__;
476
486
  this._metadataByRow.set(recordId, newRowMetadata);
477
- this.dataState = this.buildDataState();
478
- if (this.ignoreSaveMessage) {
487
+ this.dataState = await this.buildDataState();
488
+ let saveOperation = action.payload.changes[0]._operation.toLowerCase();
489
+ if (saveOperation == 'copy')
490
+ saveOperation = SnkMessageBuilder.OperationMap.CLONE;
491
+ if (this.ignoreSaveMessage && ![SnkMessageBuilder.OperationMap.CLONE, SnkMessageBuilder.OperationMap.INSERT].includes(saveOperation)) {
479
492
  return;
480
493
  }
481
- const saveOperation = action.payload.changes[0]._operation.toLowerCase();
482
494
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
483
495
  if (msg != undefined) {
484
496
  this.showSuccessMessage(msg);
@@ -571,7 +583,7 @@ const SnkDataUnit = class {
571
583
  const { records } = this.getMetadataByRow(this.dataUnit);
572
584
  this.dataUnit.records = records;
573
585
  }
574
- this.dataState = this.buildDataState();
586
+ this.dataState = await this.buildDataState();
575
587
  let resolver;
576
588
  while (resolver = this._onDataUnitResolve.pop()) {
577
589
  resolver(this.dataUnit);
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-668dc5e8.js');
5
+ const snkDataUnit = require('./snk-data-unit-3d9b6ed4.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
9
9
  require('./SnkMessageBuilder-bae64d0d.js');
10
- require('./dataunit-fetcher-f89461c1.js');
11
- require('./DataFetcher-cadeef8e.js');
10
+ require('./dataunit-fetcher-228016f4.js');
11
+ require('./DataFetcher-e059eb72.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -4,22 +4,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-63369164.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
- require('./DataFetcher-cadeef8e.js');
10
- require('./pesquisa-fetcher-ca89181c.js');
9
+ require('./DataFetcher-e059eb72.js');
10
+ require('./pesquisa-fetcher-a9bfeb22.js');
11
11
  const index$1 = require('./index-1dfc7a6e.js');
12
12
  require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- require('./dataunit-fetcher-f89461c1.js');
15
+ require('./dataunit-fetcher-228016f4.js');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./form-config-fetcher-ed497282.js');
17
+ require('./form-config-fetcher-39397ac5.js');
18
18
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
19
19
  const constants = require('./constants-35ddd366.js');
20
- const snkGuidesViewer = require('./snk-guides-viewer-4236cb9d.js');
20
+ const snkGuidesViewer = require('./snk-guides-viewer-eee43c8b.js');
21
21
  const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
22
- require('./ConfigStorage-ecc0ed20.js');
22
+ require('./ConfigStorage-f079f5fd.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
25
25
  require('@sankhyalabs/core/dist/utils/SortingUtils');