@sankhyalabs/sankhyablocks 8.16.0-dev.3 → 8.16.0-dev.30

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 (204) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-807730a8.js} +39 -6
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-f89461c1.js} +46 -18
  9. package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
  10. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  15. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  16. package/dist/cjs/snk-attach.cjs.entry.js +37 -28
  17. package/dist/cjs/snk-crud.cjs.entry.js +14 -6
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -9
  19. package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-668dc5e8.js} +42 -22
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
  22. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  23. package/dist/cjs/snk-filter-bar.cjs.entry.js +37 -25
  24. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
  27. package/dist/cjs/snk-form.cjs.entry.js +7 -6
  28. package/dist/cjs/snk-grid.cjs.entry.js +61 -21
  29. package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-68777d37.js} +24 -12
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +64 -26
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  35. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  36. package/dist/collection/components/snk-attach/snk-attach.js +24 -15
  37. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  38. package/dist/collection/components/snk-crud/snk-crud.js +78 -1
  39. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
  40. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +51 -6
  41. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  42. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  43. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  44. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  45. package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  47. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
  49. package/dist/collection/components/snk-form/snk-form.js +2 -2
  50. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
  51. package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
  52. package/dist/collection/components/snk-form-config/snk-form-config.js +14 -3
  53. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  54. package/dist/collection/components/snk-grid/snk-grid.js +68 -8
  55. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  56. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
  57. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +89 -15
  58. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  59. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  60. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  61. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  62. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  63. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  64. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  65. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  66. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  67. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  68. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  69. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  70. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  71. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  72. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  73. package/dist/components/ConfigStorage.js +1 -0
  74. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
  75. package/dist/components/DataFetcher.js +22 -16
  76. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  77. package/dist/components/SnkFormConfigManager.js +72 -18
  78. package/dist/components/SnkMessageBuilder.js +7 -3
  79. package/dist/components/dataunit-fetcher.js +45 -15
  80. package/dist/components/form-config-fetcher.js +4 -1
  81. package/dist/components/snk-actions-button2.js +12 -9
  82. package/dist/components/snk-attach2.js +33 -24
  83. package/dist/components/snk-crud.js +12 -1
  84. package/dist/components/snk-data-exporter2.js +2 -2
  85. package/dist/components/snk-data-unit2.js +44 -60
  86. package/dist/components/snk-detail-view2.js +24 -11
  87. package/dist/components/snk-exporter-email-sender2.js +1 -1
  88. package/dist/components/snk-filter-bar2.js +35 -22
  89. package/dist/components/snk-filter-checkbox-list.js +1 -1
  90. package/dist/components/snk-form-config2.js +15 -4
  91. package/dist/components/snk-form.js +2 -2
  92. package/dist/components/snk-grid2.js +53 -11
  93. package/dist/components/snk-simple-bar2.js +1 -1
  94. package/dist/components/snk-simple-crud2.js +57 -15
  95. package/dist/components/snk-taskbar2.js +24 -2
  96. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
  97. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-1a82a768.js} +40 -8
  98. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  99. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  100. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-139f09fa.js} +74 -20
  101. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  102. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  103. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-c24c76c6.js} +46 -16
  104. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  105. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  106. package/dist/esm/loader.js +1 -1
  107. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
  108. package/dist/esm/sankhyablocks.js +1 -1
  109. package/dist/esm/snk-actions-button_4.entry.js +17 -14
  110. package/dist/esm/snk-application.entry.js +7 -7
  111. package/dist/esm/snk-attach.entry.js +37 -28
  112. package/dist/esm/snk-crud.entry.js +14 -6
  113. package/dist/esm/snk-data-exporter.entry.js +9 -9
  114. package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-0fdfb6c2.js} +42 -22
  115. package/dist/esm/snk-data-unit.entry.js +5 -5
  116. package/dist/esm/snk-detail-view.entry.js +12 -13
  117. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  118. package/dist/esm/snk-filter-bar.entry.js +37 -25
  119. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  120. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  121. package/dist/esm/snk-form-config.entry.js +17 -6
  122. package/dist/esm/snk-form.entry.js +7 -6
  123. package/dist/esm/snk-grid.entry.js +56 -16
  124. package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-b5dd30e6.js} +24 -12
  125. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  126. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  127. package/dist/esm/snk-simple-bar.entry.js +1 -1
  128. package/dist/esm/snk-simple-crud.entry.js +60 -22
  129. package/dist/esm/snk-taskbar.entry.js +23 -1
  130. package/dist/sankhyablocks/p-0035ad6e.entry.js +1 -0
  131. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  132. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  133. package/dist/sankhyablocks/p-17425c72.js +1 -0
  134. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  135. package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
  136. package/dist/sankhyablocks/p-1e4c25e3.entry.js +1 -0
  137. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
  138. package/dist/sankhyablocks/p-23736d75.js +1 -0
  139. package/dist/sankhyablocks/p-3ae9d08a.js +1 -0
  140. package/dist/sankhyablocks/p-3e3cc017.js +1 -0
  141. package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
  142. package/dist/sankhyablocks/p-50779ad3.entry.js +1 -0
  143. package/dist/sankhyablocks/p-5dd8cf4f.js +1 -0
  144. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  145. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  146. package/dist/sankhyablocks/p-694e1c4a.entry.js +1 -0
  147. package/dist/sankhyablocks/p-7ac7932c.js +60 -0
  148. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  149. package/dist/sankhyablocks/p-7eef0898.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-a42e7a1e.entry.js} +2 -2
  151. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  152. package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
  153. package/dist/sankhyablocks/p-b9c67e45.entry.js +1 -0
  154. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  155. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  156. package/dist/sankhyablocks/p-d80a84fd.entry.js +1 -0
  157. package/dist/sankhyablocks/p-d836f72b.entry.js +1 -0
  158. package/dist/sankhyablocks/p-e16e87fc.entry.js +1 -0
  159. package/dist/sankhyablocks/p-eb9f0407.entry.js +1 -0
  160. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  161. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
  162. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  163. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  164. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  165. package/dist/types/components/snk-crud/snk-crud.d.ts +13 -0
  166. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -0
  167. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
  168. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  169. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
  170. package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
  171. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +14 -0
  172. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  173. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  174. package/dist/types/components.d.ts +89 -0
  175. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  176. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  177. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  178. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  179. package/package.json +2 -2
  180. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  181. package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
  182. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  183. package/dist/sankhyablocks/p-3a212712.js +0 -1
  184. package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
  185. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  186. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  187. package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
  188. package/dist/sankhyablocks/p-7a337364.js +0 -1
  189. package/dist/sankhyablocks/p-829d4045.js +0 -1
  190. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  191. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  192. package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
  193. package/dist/sankhyablocks/p-9863d682.js +0 -1
  194. package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
  195. package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
  196. package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
  197. package/dist/sankhyablocks/p-c2495304.js +0 -1
  198. package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
  199. package/dist/sankhyablocks/p-cefba299.js +0 -1
  200. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  201. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  202. package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
  203. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  204. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -7,20 +7,20 @@ const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
10
- require('./DataFetcher-313debd8.js');
11
- require('./pesquisa-fetcher-680e198f.js');
12
- const IExporterProvider = require('./IExporterProvider-597949f9.js');
10
+ require('./DataFetcher-cadeef8e.js');
11
+ require('./pesquisa-fetcher-ca89181c.js');
12
+ const ContinuousInsertUtils = require('./ContinuousInsertUtils-807730a8.js');
13
13
  const index = require('./index-1dfc7a6e.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
- const dataunitFetcher = require('./dataunit-fetcher-688d3f05.js');
17
+ const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
19
- const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
20
- const fieldSearch = require('./field-search-f56aa7d6.js');
21
- const ConfigStorage = require('./ConfigStorage-942ce74b.js');
22
- const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
23
- const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
19
+ const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
20
+ const fieldSearch = require('./field-search-68e34bf4.js');
21
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
22
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
23
+ const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
24
24
  const index$2 = require('./index-102ba62d.js');
25
25
  require('./PrintUtils-bcaeb82f.js');
26
26
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
@@ -31,7 +31,7 @@ require('./ResourceIDUtils-5ff86aa7.js');
31
31
  const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
32
32
  const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
33
33
 
34
- class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
34
+ class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
35
35
  getSelectedNumber() {
36
36
  return this.dataUnit.getSelectionInfo().length;
37
37
  }
@@ -41,7 +41,7 @@ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
41
41
  return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
42
42
  }
43
43
  getSelectedIDs() {
44
- return RecordIDUtils.getSelectedIDs(this.dataUnit);
44
+ return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
45
45
  }
46
46
  getRecordID() {
47
47
  var _a, _b, _c;
@@ -86,7 +86,7 @@ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
86
86
  }
87
87
  }
88
88
 
89
- const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
89
+ const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
90
90
 
91
91
  const SnkSimpleCrud = class {
92
92
  constructor(hostRef) {
@@ -97,17 +97,17 @@ const SnkSimpleCrud = class {
97
97
  this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
98
98
  this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
99
99
  this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
100
- this._multiSelectionListDataSource = new IExporterProvider.SnkMultiSelectionListDataSource();
100
+ this._multiSelectionListDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
101
101
  this._keyDownHandler = (event) => this.keyDownListener(event);
102
102
  this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
103
103
  this._customEditors = new Map();
104
104
  this._customRenders = new Map();
105
105
  this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
106
- "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [taskbarElements.TaskbarElement.GRID_MODE]),
106
+ "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [taskbarElements.TaskbarElement.GRID_MODE], true),
107
107
  "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
108
- "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
108
+ "snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE], true),
109
109
  "snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
110
- "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
110
+ "snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
111
111
  });
112
112
  this._showPopUpGridConfig = false;
113
113
  this._showFormConfig = false;
@@ -123,10 +123,12 @@ const SnkSimpleCrud = class {
123
123
  this.formConfig = undefined;
124
124
  this._formFields = [];
125
125
  this._fieldsProps = new Map();
126
+ this._enableContinuousInsert = true;
126
127
  this.multipleSelection = undefined;
127
128
  this.useCancelConfirm = true;
128
129
  this.pageSize = 150;
129
130
  this.resourceID = undefined;
131
+ this.enableGridInsert = false;
130
132
  this.taskbarManager = undefined;
131
133
  this.messagesBuilder = undefined;
132
134
  this.useEnterLikeTab = false;
@@ -137,6 +139,7 @@ const SnkSimpleCrud = class {
137
139
  this.formLegacyConfigName = undefined;
138
140
  this.ignoreReadOnlyFormFields = false;
139
141
  this.autoFocus = true;
142
+ this.domainMessagesBuilder = undefined;
140
143
  this.autoLoad = undefined;
141
144
  }
142
145
  /**
@@ -195,8 +198,19 @@ const SnkSimpleCrud = class {
195
198
  newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
196
199
  this._fieldsProps = newCustomFieldProps;
197
200
  }
198
- getButtons(selected, extraButtons) {
199
- return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
201
+ getFinishEditionButtonsCallback() {
202
+ const btns = ["CANCEL", "SAVE"];
203
+ if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
204
+ btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
205
+ }
206
+ return btns;
207
+ }
208
+ getButtons(selected, extraButtons, removeRefresh) {
209
+ let btnList = selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS;
210
+ if (removeRefresh) {
211
+ btnList = btnList.filter(item => item !== taskbarElements.TaskbarElement.REFRESH);
212
+ }
213
+ return this.addConfigButton(this.resolveInMemoryBtns(btnList)
200
214
  .concat(extraButtons));
201
215
  }
202
216
  addConfigButton(buttons) {
@@ -358,7 +372,7 @@ const SnkSimpleCrud = class {
358
372
  return;
359
373
  }
360
374
  if (this._formConfigManager == undefined) {
361
- this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
375
+ this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
362
376
  this._formConfigManager.setConfig(this.formConfig);
363
377
  }
364
378
  if (this.formConfigIsLoaded() && !forceLoad) {
@@ -398,7 +412,11 @@ const SnkSimpleCrud = class {
398
412
  this.processMetadata();
399
413
  this.onModeChange();
400
414
  this.configDatasource();
401
- this._rmPrecisionCustomValueFormatter = new IExporterProvider.RmPrecisionCustomValueFormatter();
415
+ this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
416
+ this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
417
+ if (this.enableGridInsert) {
418
+ this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
419
+ }
402
420
  }
403
421
  componentDidLoad() {
404
422
  utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
@@ -633,6 +651,9 @@ const SnkSimpleCrud = class {
633
651
  const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
634
652
  return Promise.resolve(options);
635
653
  }
654
+ isGridInsertActive() {
655
+ return this.enableGridInsert && this.dataUnit.hasNewRecord();
656
+ }
636
657
  getActionsList() {
637
658
  var _a, _b;
638
659
  const hardList = [{
@@ -644,11 +665,22 @@ const SnkSimpleCrud = class {
644
665
  ? this.getColumnSearch(actionButton, item)
645
666
  : this.getFieldSearch(actionButton, item)
646
667
  }];
668
+ if (this.enableGridInsert) {
669
+ hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, this.handleEnableContinuousInsert));
670
+ }
671
+ if (this.isGridInsertActive())
672
+ return hardList;
647
673
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
648
674
  const taskbarID = this.getTopTaskBarId();
649
675
  return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
650
676
  }
651
- return hardList.concat(this.actionsList);
677
+ if (this.actionsList)
678
+ return hardList.concat(this.actionsList);
679
+ return hardList;
680
+ }
681
+ handleEnableContinuousInsert() {
682
+ this._enableContinuousInsert = !this._enableContinuousInsert;
683
+ this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
652
684
  }
653
685
  getTopTaskBarId() {
654
686
  var _a;
@@ -722,7 +754,7 @@ const SnkSimpleCrud = class {
722
754
  }
723
755
  setGridConfig(config) {
724
756
  this.gridConfig = config;
725
- IExporterProvider.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
757
+ ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
726
758
  }
727
759
  setFormConfig(config, forceUpdate) {
728
760
  if (this.formConfig && !forceUpdate)
@@ -752,8 +784,8 @@ const SnkSimpleCrud = class {
752
784
  return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
753
785
  }
754
786
  getFormConfig() {
755
- var _a, _b;
756
- const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
787
+ var _a;
788
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
757
789
  if (!this.configName && !configFromManager) {
758
790
  return this.formConfig;
759
791
  }
@@ -767,15 +799,21 @@ const SnkSimpleCrud = class {
767
799
  }
768
800
  this._formConfigManager.setConfig(this.formConfig);
769
801
  }
802
+ handleDataUnitOnInsertionMode() {
803
+ if (this.enableGridInsert)
804
+ return;
805
+ this.goToView(constants.VIEW_MODE.FORM);
806
+ }
770
807
  /* istanbul ignore next */
771
808
  render() {
772
809
  var _a;
773
810
  if (this.dataUnit == undefined) {
774
811
  return;
775
812
  }
776
- return (index$1.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(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.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: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
813
+ const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", 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: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
814
+ return (index$1.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 === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
777
815
  ? undefined
778
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.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() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.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 })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
816
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.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() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.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 })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
779
817
  }
780
818
  get _element() { return index$1.getElement(this); }
781
819
  static get watchers() { return {
@@ -15,6 +15,8 @@ const SnkTaskbar = class {
15
15
  constructor(hostRef) {
16
16
  index.registerInstance(this, hostRef);
17
17
  this.actionClick = index.createEvent(this, "actionClick", 7);
18
+ this.taskbarSaveLocker = index.createEvent(this, "taskbarSaveLocker", 7);
19
+ this.taskbarSaveUnlocker = index.createEvent(this, "taskbarSaveUnlocker", 7);
18
20
  this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
19
21
  this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
20
22
  this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
@@ -38,6 +40,7 @@ const SnkTaskbar = class {
38
40
  this.onSaveEvent = (action) => {
39
41
  switch (action.type) {
40
42
  case core.Action.FIELD_INVALIDATED:
43
+ case core.Action.INVALIDATE_CLEAN:
41
44
  case core.Action.DATA_SAVED:
42
45
  case core.Action.SAVING_ERROR:
43
46
  this._isWaitingForSave = false;
@@ -76,6 +79,16 @@ const SnkTaskbar = class {
76
79
  this.getCustomElements(true);
77
80
  }
78
81
  }
82
+ handleTaskbarSaveLocker() {
83
+ if (this._isWaitingForSave !== true) {
84
+ this._isWaitingForSave = true;
85
+ }
86
+ }
87
+ handleTaskbarSaveUnlocker() {
88
+ if (this._isWaitingForSave === true) {
89
+ this._isWaitingForSave = false;
90
+ }
91
+ }
79
92
  hasToSearchCustomElements(event) {
80
93
  return this.customSlotId === event.detail && !this._slotContainer;
81
94
  }
@@ -94,6 +107,14 @@ const SnkTaskbar = class {
94
107
  this._hasToUpdateOverFlow = true;
95
108
  }
96
109
  }
110
+ observeIsWaitingForSave(newValue, oldValue) {
111
+ if (newValue == true && oldValue == false) {
112
+ this.taskbarSaveLocker.emit();
113
+ }
114
+ if (newValue == false && oldValue == true) {
115
+ this.taskbarSaveUnlocker.emit();
116
+ }
117
+ }
97
118
  // Internal methods
98
119
  elementsFromString(strButtons) {
99
120
  const elements = [];
@@ -422,7 +443,8 @@ const SnkTaskbar = class {
422
443
  static get watchers() { return {
423
444
  "buttons": ["observeButtons"],
424
445
  "disabledButtons": ["observeDisabledButtons"],
425
- "_lastWidth": ["observeLastWidth"]
446
+ "_lastWidth": ["observeLastWidth"],
447
+ "_isWaitingForSave": ["observeIsWaitingForSave"]
426
448
  }; }
427
449
  };
428
450
  SnkTaskbar.style = snkTaskbarCss;
@@ -3,9 +3,9 @@ import { RefreshType } from "./enum/RefreshType";
3
3
  import { ParamType } from "./enum/ParamType";
4
4
  import { DataFetcher } from "../../../lib";
5
5
  import { ActionsType } from "./enum/ActionsType";
6
+ import { getSelectedRecordsIDsInfo } from "../../../lib/utils/GetSelectedRecordsIDsInfo";
6
7
  const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
7
8
  const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
8
- const NUFIN_COLUMN = 'NUFIN';
9
9
  const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
10
10
  export default class Actions {
11
11
  constructor(actionsExecuteInterface, dataUnit, appResourceId) {
@@ -17,6 +17,10 @@ export default class Actions {
17
17
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
18
18
  this._appResourceId = appResourceId;
19
19
  }
20
+ getPrimaryKeys() {
21
+ const ids = getSelectedRecordsIDsInfo(this._dataUnit);
22
+ return ids.map(({ name }) => name);
23
+ }
20
24
  apply(action, hasParamsToSave) {
21
25
  this._application.closePopUp();
22
26
  this._actionsExecuteInterface.execute(action, this._dataUnit)
@@ -285,6 +289,7 @@ export default class Actions {
285
289
  executeAction(execSource);
286
290
  }
287
291
  addRows(execSource) {
292
+ const primaryKeys = this.getPrimaryKeys();
288
293
  const rows = {
289
294
  row: []
290
295
  };
@@ -298,15 +303,13 @@ export default class Actions {
298
303
  delete sourceRow[MASTER_ROW_PROPERTY];
299
304
  delete sourceRow[ENTITY_NAME_PROPERTY];
300
305
  }
301
- for (const fieldName in sourceRow) {
302
- if (fieldName !== NUFIN_COLUMN)
303
- continue;
304
- if (!row.field) {
305
- row.field = [];
306
- }
306
+ if (!row.field) {
307
+ row.field = [];
308
+ }
309
+ for (const primaryKey of primaryKeys) {
307
310
  row.field.push({
308
- fieldName: fieldName,
309
- $: sourceRow[fieldName]
311
+ fieldName: primaryKey,
312
+ $: sourceRow[primaryKey]
310
313
  });
311
314
  }
312
315
  rows.row.push(row);
@@ -46,11 +46,20 @@ export class SnkAttach {
46
46
  this.loadAttachmentDataUnit();
47
47
  }
48
48
  if (oldRegisterKey !== newRegisterKey) {
49
+ if (this._currentFetcher instanceof AnexoSistemaFetcher) {
50
+ this._currentFetcher.registerKey = newRegisterKey;
51
+ }
49
52
  await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
50
53
  }
51
54
  }
55
+ getAnexoSistemaFetcherInstance() {
56
+ var _a;
57
+ const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
58
+ anexoSistemaFetcher.registerKey = this.registerKey;
59
+ return anexoSistemaFetcher;
60
+ }
52
61
  async initAttach() {
53
- var _a, _b, _c, _d, _e, _f;
62
+ var _a, _b, _c, _d, _e;
54
63
  if (!this.fetcherType && !this.registerKey)
55
64
  return;
56
65
  if (!this.fetcherType) {
@@ -58,18 +67,18 @@ export class SnkAttach {
58
67
  }
59
68
  this.returnToGridMode();
60
69
  if (this.fetcherType === "AnexoSistema") {
61
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
62
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
63
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
70
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
71
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
72
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
64
73
  return;
65
74
  }
66
75
  if (this.fetcherType === "Attach") {
67
- const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
76
+ const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
68
77
  if (hasMoreOneItem)
69
78
  return;
70
79
  }
71
- await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata());
72
- await ((_f = this._currentDataUnit) === null || _f === void 0 ? void 0 : _f.loadData(undefined, undefined, true, this.registerKey));
80
+ await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
81
+ await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
73
82
  }
74
83
  /**
75
84
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -128,11 +137,11 @@ export class SnkAttach {
128
137
  }
129
138
  }
130
139
  async loadAnexoSistema() {
131
- var _a, _b, _c;
140
+ var _a, _b;
132
141
  this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
133
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
142
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
134
143
  if (!this._currentDataUnit.metadata) {
135
- await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata());
144
+ await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
136
145
  this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
137
146
  }
138
147
  this.initDataUnitLoaders();
@@ -142,7 +151,7 @@ export class SnkAttach {
142
151
  this._currentDataUnit.addInterceptor({
143
152
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
144
153
  });
145
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
154
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
146
155
  this.disableEditFieldsNotInForm();
147
156
  }
148
157
  async loadAttach() {
@@ -168,16 +177,16 @@ export class SnkAttach {
168
177
  }
169
178
  }
170
179
  initDataUnitLoaders() {
171
- var _a, _b, _c;
180
+ var _a, _b;
172
181
  if (this.fetcherType === "AnexoSistema") {
173
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
182
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
174
183
  this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
175
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
184
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
176
185
  }
177
186
  if (this.fetcherType === "Attach") {
178
187
  this._currentFetcher = new AttachFetcher();
179
188
  this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
180
- (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
189
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
181
190
  this.returnToGridMode();
182
191
  await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
183
192
  });
@@ -3,7 +3,7 @@ import { SaveErrorsEnum } from '../../../../../lib/http/data-fetcher/fetchers/At
3
3
  import { AutorizationType } from '../../../../../lib/http/data-fetcher/fetchers/auth-fetcher';
4
4
  import { attachFetcherMetadataBuilder } from '../../builder/attach-crud-config.builder';
5
5
  import { VIEW_MODE } from '../../../../../lib/utils/constants';
6
- import { applyFilter, applySorting, buildPaginationInfo } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
6
+ import { buildLoadDataResponse } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
7
7
  const SERVICE_LOAD = "Attach.load";
8
8
  export class AttachFetcherDataUnitFactory {
9
9
  constructor(getMessage) {
@@ -49,9 +49,7 @@ export class AttachFetcherDataUnitFactory {
49
49
  });
50
50
  this._records = records;
51
51
  }
52
- let records = applyFilter(this._records, dataUnit, request.filters);
53
- records = applySorting(records, dataUnit, request.sort);
54
- return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
52
+ return buildLoadDataResponse(this._records, dataUnit, request);
55
53
  }
56
54
  saveLoader(changes, fetcher) {
57
55
  return new Promise((resolve) => {
@@ -39,6 +39,9 @@ export class SnkCrud {
39
39
  this.disablePersonalizedFilter = undefined;
40
40
  this.autoLoad = undefined;
41
41
  this.autoFocus = true;
42
+ this.enableGridInsert = false;
43
+ this.domainMessagesBuilder = undefined;
44
+ this.setCustomFormTitle = undefined;
42
45
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
43
46
  }
44
47
  /**
@@ -147,6 +150,7 @@ export class SnkCrud {
147
150
  else if (viewMode === VIEW_MODE.FORM) {
148
151
  this._guidesViewer.setFocus();
149
152
  }
153
+ this.viewModeChanged.emit(viewMode);
150
154
  }
151
155
  openConfig(viewMode) {
152
156
  this._snkConfigurator.close();
@@ -162,6 +166,8 @@ export class SnkCrud {
162
166
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
163
167
  }
164
168
  insertionModeHandler() {
169
+ if (this.enableGridInsert)
170
+ return;
165
171
  this.gridToForm();
166
172
  }
167
173
  cancelHandler() {
@@ -210,6 +216,7 @@ export class SnkCrud {
210
216
  this._snkDataUnit = parent;
211
217
  this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
212
218
  this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
219
+ this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
213
220
  this._dataUnit = this._snkDataUnit.dataUnit;
214
221
  this._dataState = this._snkDataUnit.dataState;
215
222
  if (!this._dataUnit) {
@@ -376,7 +383,7 @@ export class SnkCrud {
376
383
  return;
377
384
  }
378
385
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
379
- 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 }, 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" }))));
386
+ 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, 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" }))));
380
387
  }
381
388
  static get is() { return "snk-crud"; }
382
389
  static get encapsulation() { return "scoped"; }
@@ -732,6 +739,56 @@ export class SnkCrud {
732
739
  "attribute": "auto-focus",
733
740
  "reflect": false,
734
741
  "defaultValue": "true"
742
+ },
743
+ "enableGridInsert": {
744
+ "type": "boolean",
745
+ "mutable": false,
746
+ "complexType": {
747
+ "original": "boolean",
748
+ "resolved": "boolean",
749
+ "references": {}
750
+ },
751
+ "required": false,
752
+ "optional": true,
753
+ "docs": {
754
+ "tags": [],
755
+ "text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
756
+ },
757
+ "attribute": "enable-grid-insert",
758
+ "reflect": false,
759
+ "defaultValue": "false"
760
+ },
761
+ "domainMessagesBuilder": {
762
+ "type": "string",
763
+ "mutable": false,
764
+ "complexType": {
765
+ "original": "string",
766
+ "resolved": "string",
767
+ "references": {}
768
+ },
769
+ "required": false,
770
+ "optional": false,
771
+ "docs": {
772
+ "tags": [],
773
+ "text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
774
+ },
775
+ "attribute": "domain-messages-builder",
776
+ "reflect": false
777
+ },
778
+ "setCustomFormTitle": {
779
+ "type": "unknown",
780
+ "mutable": false,
781
+ "complexType": {
782
+ "original": "() => string",
783
+ "resolved": "() => string",
784
+ "references": {}
785
+ },
786
+ "required": false,
787
+ "optional": false,
788
+ "docs": {
789
+ "tags": [],
790
+ "text": "Define uma fun\u00E7\u00E3o para configurar um t\u00EDtulo cusotmizado no modo formul\u00E1rio."
791
+ }
735
792
  }
736
793
  };
737
794
  }
@@ -814,6 +871,26 @@ export class SnkCrud {
814
871
  }
815
872
  }
816
873
  }
874
+ }, {
875
+ "method": "viewModeChanged",
876
+ "name": "viewModeChanged",
877
+ "bubbles": true,
878
+ "cancelable": true,
879
+ "composed": true,
880
+ "docs": {
881
+ "tags": [],
882
+ "text": ""
883
+ },
884
+ "complexType": {
885
+ "original": "VIEW_MODE",
886
+ "resolved": "VIEW_MODE.ATTACHMENT | VIEW_MODE.FORM | VIEW_MODE.GRID",
887
+ "references": {
888
+ "VIEW_MODE": {
889
+ "location": "import",
890
+ "path": "../../lib/utils/constants"
891
+ }
892
+ }
893
+ }
817
894
  }];
818
895
  }
819
896
  static get methods() {
@@ -158,14 +158,13 @@ export class SnkDetailView {
158
158
  return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
159
159
  }
160
160
  loadMetadata() {
161
- var _a;
162
161
  if (!this.dataUnit) {
163
162
  return;
164
163
  }
165
164
  if (!this.formConfigManager.isLoaded) {
166
165
  return;
167
166
  }
168
- const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
167
+ const formConfig = this.formConfigManager.getConfig(this.dataUnit);
169
168
  //this._cardsState = formConfig?.cardsState;
170
169
  this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
171
170
  }
@@ -199,7 +198,7 @@ export class SnkDetailView {
199
198
  this.emitSwitchEvent(VIEW_MODE.GRID);
200
199
  evt.stopPropagation();
201
200
  }
202
- if (evt.detail === TaskbarElement.FORM_MODE) {
201
+ if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE) {
203
202
  this.emitSwitchEvent(VIEW_MODE.FORM);
204
203
  evt.stopPropagation();
205
204
  }
@@ -223,7 +222,7 @@ export class SnkDetailView {
223
222
  }
224
223
  componentWillLoad() {
225
224
  this._configName = `dynaform.${this.entityName}`;
226
- this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
225
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata(), this.dataUnit);
227
226
  this.formConfigManager.loadConfig();
228
227
  if (this.messagesBuilder == undefined) {
229
228
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);