@sankhyalabs/sankhyablocks 8.16.0-dev.2 → 8.16.0-dev.21

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 (156) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  3. package/dist/cjs/{IExporterProvider-9479f618.js → IExporterProvider-9ac15aaf.js} +4 -4
  4. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
  5. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-cceebbae.js} +2 -2
  6. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-0c7106a0.js → dataunit-fetcher-4b12f70c.js} +8 -4
  8. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
  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 +7 -7
  14. package/dist/cjs/snk-attach.cjs.entry.js +36 -25
  15. package/dist/cjs/snk-crud.cjs.entry.js +11 -6
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
  17. package/dist/cjs/{snk-data-unit-16791a2f.js → snk-data-unit-c095fb1a.js} +23 -11
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -12
  20. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -11
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-form-config.cjs.entry.js +16 -5
  24. package/dist/cjs/snk-form.cjs.entry.js +7 -6
  25. package/dist/cjs/snk-grid.cjs.entry.js +9 -9
  26. package/dist/cjs/{snk-guides-viewer-d82746e8.js → snk-guides-viewer-866447ab.js} +17 -9
  27. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  28. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -12
  30. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  31. package/dist/collection/components/snk-attach/snk-attach.js +24 -15
  32. package/dist/collection/components/snk-crud/snk-crud.js +57 -1
  33. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
  34. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +27 -4
  35. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  36. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  37. package/dist/collection/components/snk-data-unit/snk-data-unit.js +38 -9
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +16 -8
  39. package/dist/collection/components/snk-form/snk-form.js +2 -2
  40. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
  41. package/dist/collection/components/snk-form-config/snk-form-config.js +14 -3
  42. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  43. package/dist/collection/components/snk-grid/snk-grid.js +2 -2
  44. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +24 -5
  45. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  46. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  47. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +7 -3
  48. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  49. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  50. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  51. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  52. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  53. package/dist/components/ConfigStorage.js +1 -0
  54. package/dist/components/DataFetcher.js +22 -16
  55. package/dist/components/SnkFormConfigManager.js +72 -18
  56. package/dist/components/SnkMessageBuilder.js +2 -2
  57. package/dist/components/dataunit-fetcher.js +7 -3
  58. package/dist/components/form-config-fetcher.js +4 -1
  59. package/dist/components/snk-attach2.js +31 -20
  60. package/dist/components/snk-crud.js +8 -1
  61. package/dist/components/snk-data-exporter2.js +2 -2
  62. package/dist/components/snk-data-unit2.js +22 -9
  63. package/dist/components/snk-detail-view2.js +16 -8
  64. package/dist/components/snk-exporter-email-sender2.js +1 -1
  65. package/dist/components/snk-filter-bar2.js +16 -8
  66. package/dist/components/snk-form-config2.js +14 -3
  67. package/dist/components/snk-form.js +2 -2
  68. package/dist/components/snk-grid2.js +3 -3
  69. package/dist/components/snk-simple-crud2.js +8 -5
  70. package/dist/components/snk-taskbar2.js +24 -2
  71. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
  72. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  73. package/dist/esm/{IExporterProvider-5a858363.js → IExporterProvider-09df2e3e.js} +4 -4
  74. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-139f09fa.js} +74 -20
  75. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-ae87b754.js} +2 -2
  76. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  77. package/dist/esm/{dataunit-fetcher-f7e0ffc0.js → dataunit-fetcher-3aac1a53.js} +8 -4
  78. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  79. package/dist/esm/loader.js +1 -1
  80. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
  81. package/dist/esm/sankhyablocks.js +1 -1
  82. package/dist/esm/snk-actions-button_4.entry.js +5 -5
  83. package/dist/esm/snk-application.entry.js +7 -7
  84. package/dist/esm/snk-attach.entry.js +36 -25
  85. package/dist/esm/snk-crud.entry.js +11 -6
  86. package/dist/esm/snk-data-exporter.entry.js +8 -8
  87. package/dist/esm/{snk-data-unit-a327d22c.js → snk-data-unit-75fc8910.js} +23 -11
  88. package/dist/esm/snk-data-unit.entry.js +4 -4
  89. package/dist/esm/snk-detail-view.entry.js +11 -12
  90. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  91. package/dist/esm/snk-filter-bar.entry.js +19 -11
  92. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  93. package/dist/esm/snk-form-config.entry.js +16 -5
  94. package/dist/esm/snk-form.entry.js +7 -6
  95. package/dist/esm/snk-grid.entry.js +9 -9
  96. package/dist/esm/{snk-guides-viewer-874da66f.js → snk-guides-viewer-cb8a0b48.js} +17 -9
  97. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  98. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  99. package/dist/esm/snk-simple-crud.entry.js +14 -12
  100. package/dist/esm/snk-taskbar.entry.js +23 -1
  101. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  102. package/dist/sankhyablocks/p-16969508.entry.js +1 -0
  103. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  104. package/dist/sankhyablocks/p-17aba142.entry.js +1 -0
  105. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  106. package/dist/sankhyablocks/{p-e6210aec.js → p-1ab19772.js} +1 -1
  107. package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
  108. package/dist/sankhyablocks/p-1f47a0b2.entry.js +1 -0
  109. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-3757394b.entry.js +1 -0
  111. package/dist/sankhyablocks/p-41556e8a.entry.js +1 -0
  112. package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
  113. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  114. package/dist/sankhyablocks/{p-60e46675.entry.js → p-640140b3.entry.js} +2 -2
  115. package/dist/sankhyablocks/p-73185e58.entry.js +1 -0
  116. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  117. package/dist/sankhyablocks/p-a31e761f.js +1 -0
  118. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  119. package/dist/sankhyablocks/p-b2caaaf9.entry.js +1 -0
  120. package/dist/sankhyablocks/p-bc4b94d2.entry.js +1 -0
  121. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  122. package/dist/sankhyablocks/{p-b7c4feeb.entry.js → p-d137ae48.entry.js} +1 -1
  123. package/dist/sankhyablocks/p-df8f4c4f.js +1 -0
  124. package/dist/sankhyablocks/{p-7d9baaf4.entry.js → p-e2a1273a.entry.js} +1 -1
  125. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  126. package/dist/sankhyablocks/{p-6d4f4614.js → p-f8698ad3.js} +1 -1
  127. package/dist/sankhyablocks/{p-b8cde0d8.entry.js → p-fb0313db.entry.js} +1 -1
  128. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
  129. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  130. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  131. package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
  132. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -0
  133. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
  134. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  135. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
  136. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  137. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  138. package/dist/types/components.d.ts +49 -0
  139. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  140. package/package.json +2 -2
  141. package/dist/sankhyablocks/p-0046959e.entry.js +0 -1
  142. package/dist/sankhyablocks/p-0e11ee18.entry.js +0 -1
  143. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  144. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  145. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  146. package/dist/sankhyablocks/p-6ded2076.entry.js +0 -1
  147. package/dist/sankhyablocks/p-7a337364.js +0 -1
  148. package/dist/sankhyablocks/p-829d4045.js +0 -1
  149. package/dist/sankhyablocks/p-8c6b44ea.entry.js +0 -1
  150. package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
  151. package/dist/sankhyablocks/p-a4b1f1eb.js +0 -1
  152. package/dist/sankhyablocks/p-c7cbad38.js +0 -1
  153. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  154. package/dist/sankhyablocks/p-e0b9f59a.entry.js +0 -1
  155. package/dist/sankhyablocks/p-e9bbc3d5.entry.js +0 -1
  156. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
@@ -7,9 +7,9 @@ const Sortable = require('./Sortable-fb1c4cbb.js');
7
7
  const core = require('@sankhyalabs/core');
8
8
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
9
  const constants = require('./constants-35ddd366.js');
10
- const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
10
+ const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
11
11
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
12
- require('./DataFetcher-313debd8.js');
12
+ require('./DataFetcher-cadeef8e.js');
13
13
  require('./PrintUtils-bcaeb82f.js');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
 
@@ -80,7 +80,7 @@ const SnkFormConfig = class {
80
80
  }
81
81
  }
82
82
  getConfig() {
83
- let config = this.configManager.getConfig(false, this.dataUnit);
83
+ let config = this.configManager.getConfig(this.dataUnit);
84
84
  if (config.fields && config.fields.length === 0) {
85
85
  config = undefined;
86
86
  }
@@ -206,6 +206,11 @@ const SnkFormConfig = class {
206
206
  this.configManager.saveConfig(this.buildConfigToSave())
207
207
  .then(savedConfig => {
208
208
  utils.ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
209
+ const userOption = this._formConfigOptions
210
+ .find((config) => {
211
+ return config.origin === formConfigFetcher.UserConfigType.USER;
212
+ });
213
+ this.setFormConfig(userOption);
209
214
  this.configChange.emit(savedConfig);
210
215
  });
211
216
  }
@@ -539,9 +544,12 @@ const SnkFormConfig = class {
539
544
  switch (this._optionFormConfigSelected.origin) {
540
545
  case formConfigFetcher.UserConfigType.DEFAULT:
541
546
  config = await this.configManager.fetchDefaultConfig();
547
+ if (!config) {
548
+ config = this.configManager.getEmptyConfig();
549
+ }
542
550
  break;
543
- case formConfigFetcher.UserConfigType.DEFAULT:
544
- config = await this.configManager.fetchDefaultConfig();
551
+ default:
552
+ config = this.getConfig();
545
553
  break;
546
554
  }
547
555
  if (config != undefined) {
@@ -744,6 +752,9 @@ const SnkFormConfig = class {
744
752
  if (layoutFormConfig == undefined) {
745
753
  layoutFormConfig = [];
746
754
  }
755
+ if (this._formConfig.defaultConfiguration) {
756
+ return layoutFormConfig;
757
+ }
747
758
  return this._formConfig.tabs.map((tab) => {
748
759
  return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
749
760
  || { tab: tab.label, groups: [], visible: tab.visible };
@@ -4,14 +4,15 @@ 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-1b13bacd.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
8
8
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
- require('./ConfigStorage-942ce74b.js');
10
- require('./form-config-fetcher-2dd00e5b.js');
11
- require('./DataFetcher-313debd8.js');
9
+ require('./ConfigStorage-ecc0ed20.js');
10
+ require('./form-config-fetcher-ed497282.js');
11
+ require('./DataFetcher-cadeef8e.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
15
+ require('./constants-35ddd366.js');
15
16
 
16
17
  const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
17
18
 
@@ -104,7 +105,7 @@ const SnkForm = class {
104
105
  if (this.resourceID == undefined) {
105
106
  this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
106
107
  }
107
- this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID);
108
+ this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
108
109
  this.addFormLegacyConfig();
109
110
  await this._configManager.loadConfig();
110
111
  }
@@ -133,7 +134,7 @@ const SnkForm = class {
133
134
  if (!this._dataUnit || !this._dataState) {
134
135
  return undefined;
135
136
  }
136
- return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
137
+ return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
137
138
  index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
138
139
  }
139
140
  get _element() { return index.getElement(this); }
@@ -5,20 +5,20 @@ 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
- const ConfigStorage = require('./ConfigStorage-942ce74b.js');
8
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
9
9
  const index$1 = require('./index-1dfc7a6e.js');
10
10
  const fieldSearch = require('./field-search-f56aa7d6.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const IExporterProvider = require('./IExporterProvider-9479f618.js');
12
+ const IExporterProvider = require('./IExporterProvider-9ac15aaf.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
- require('./DataFetcher-313debd8.js');
15
- require('./pesquisa-fetcher-680e198f.js');
14
+ require('./DataFetcher-cadeef8e.js');
15
+ require('./pesquisa-fetcher-ca89181c.js');
16
16
  require('./ISave-e91b70a7.js');
17
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
19
- require('./dataunit-fetcher-0c7106a0.js');
19
+ require('./dataunit-fetcher-4b12f70c.js');
20
20
  require('./filter-item-type.enum-a7ffdaa6.js');
21
- require('./form-config-fetcher-2dd00e5b.js');
21
+ require('./form-config-fetcher-ed497282.js');
22
22
  const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
24
24
  require('./PrintUtils-bcaeb82f.js');
@@ -80,7 +80,7 @@ class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
80
80
  }
81
81
  }
82
82
 
83
- const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
83
+ const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--lg)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
84
84
 
85
85
  const SnkGrid = class {
86
86
  constructor(hostRef) {
@@ -383,7 +383,7 @@ const SnkGrid = class {
383
383
  const disabledButtons = [];
384
384
  if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
385
385
  if (this._dataState.selectionInfo.length > 1) {
386
- disabledButtons.push(taskbarElements.TaskbarElement.CLONE, "ATTACH");
386
+ disabledButtons.push(taskbarElements.TaskbarElement.CLONE, "ATTACH", taskbarElements.TaskbarElement.UPDATE);
387
387
  }
388
388
  if (this._dataState.selectionInfo.isAllRecords()) {
389
389
  disabledButtons.push("REMOVE");
@@ -489,7 +489,7 @@ const SnkGrid = class {
489
489
  if (!this._dataUnit) {
490
490
  return undefined;
491
491
  }
492
- return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
492
+ return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
493
493
  index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.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.resourceID }))));
494
494
  }
495
495
  get _element() { return index.getElement(this); }
@@ -2,20 +2,20 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-f56aa7d6.js');
8
8
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
- require('./DataFetcher-313debd8.js');
11
- require('./pesquisa-fetcher-680e198f.js');
10
+ require('./DataFetcher-cadeef8e.js');
11
+ require('./pesquisa-fetcher-ca89181c.js');
12
12
  const index$1 = require('./index-1dfc7a6e.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-0c7106a0.js');
16
+ require('./dataunit-fetcher-4b12f70c.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
- require('./form-config-fetcher-2dd00e5b.js');
18
+ require('./form-config-fetcher-ed497282.js');
19
19
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
20
20
 
21
21
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
@@ -43,6 +43,7 @@ const SnkGuidesViewer = class {
43
43
  this.resourceID = undefined;
44
44
  this.detailTaskbarCustomContainerId = undefined;
45
45
  this.formLegacyConfigName = undefined;
46
+ this.getCustomTitle = undefined;
46
47
  this._hasToCreateFieldSearch = true;
47
48
  this._breadcrumbItems = [];
48
49
  this._guides = undefined;
@@ -129,7 +130,7 @@ const SnkGuidesViewer = class {
129
130
  }
130
131
  onContentCardChanged(evt) {
131
132
  SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
132
- .then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, this.dataUnit));
133
+ .then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
133
134
  }
134
135
  /**
135
136
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -376,11 +377,14 @@ const SnkGuidesViewer = class {
376
377
  this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
377
378
  }
378
379
  }
380
+ setMasterFormConfig(config) {
381
+ this.masterFormConfig = config;
382
+ }
379
383
  componentWillLoad() {
380
384
  if (this.resourceID == undefined) {
381
385
  throw new Error("Erro interno: resourceID não informado");
382
386
  }
383
- this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
387
+ this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
384
388
  this.addFormLegacyConfigName();
385
389
  this._configManager.loadConfig();
386
390
  }
@@ -408,7 +412,7 @@ const SnkGuidesViewer = class {
408
412
  return this._fieldSearch;
409
413
  }
410
414
  fieldsOptionLoader(argument) {
411
- return Promise.resolve(this._configManager.getFieldsList(this.dataUnit, argument)
415
+ return Promise.resolve(this._configManager.getFieldsList(argument)
412
416
  .map(field => ({ value: field.name, label: field.label })));
413
417
  }
414
418
  onSelectField(option, actionButton) {
@@ -480,6 +484,10 @@ const SnkGuidesViewer = class {
480
484
  }
481
485
  return "";
482
486
  }
487
+ getTitle() {
488
+ var _a, _b;
489
+ return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
490
+ }
483
491
  componentDidLoad() {
484
492
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
485
493
  }
@@ -493,7 +501,7 @@ const SnkGuidesViewer = class {
493
501
  }
494
502
  this.loadTaskbarProcessor();
495
503
  const showGuides = this._guides && (this._guides.length > 1);
496
- return (index.h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, index.h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.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 &&
504
+ return (index.h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, index.h("div", { class: "ez-row snk-guides-viewer__header" }, index.h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, index.h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, index.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 &&
497
505
  index.h("div", { class: "ez-margin-top--extra-small" }, index.h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != index$1.PresentationMode.SECONDARY && this.buildTaskBar()), index.h("div", { class: "snk-guides-viewer__container" }, showGuides ?
498
506
  index.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) })
499
507
  :
@@ -2,26 +2,26 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-d82746e8.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-866447ab.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-1b13bacd.js');
9
- require('./ConfigStorage-942ce74b.js');
10
- require('./form-config-fetcher-2dd00e5b.js');
11
- require('./DataFetcher-313debd8.js');
8
+ require('./SnkFormConfigManager-f1c92f79.js');
9
+ require('./ConfigStorage-ecc0ed20.js');
10
+ require('./form-config-fetcher-ed497282.js');
11
+ require('./DataFetcher-cadeef8e.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
15
+ require('./constants-35ddd366.js');
15
16
  require('@sankhyalabs/ezui/dist/collection/utils/form');
16
17
  require('./field-search-f56aa7d6.js');
17
18
  require('./taskbar-elements-9ad1f9c0.js');
18
19
  require('./index-1dfc7a6e.js');
19
20
  require('./index-102ba62d.js');
20
- require('./constants-35ddd366.js');
21
- require('./pesquisa-fetcher-680e198f.js');
21
+ require('./pesquisa-fetcher-ca89181c.js');
22
22
  require('./ISave-e91b70a7.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
24
- require('./dataunit-fetcher-0c7106a0.js');
24
+ require('./dataunit-fetcher-4b12f70c.js');
25
25
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
26
26
  require('@sankhyalabs/core/dist/utils/SortingUtils');
27
27
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
8
- const ConfigStorage = require('./ConfigStorage-942ce74b.js');
8
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
12
  require('./filter-item-type.enum-a7ffdaa6.js');
13
- require('./form-config-fetcher-2dd00e5b.js');
14
- require('./DataFetcher-313debd8.js');
13
+ require('./form-config-fetcher-ed497282.js');
14
+ require('./DataFetcher-cadeef8e.js');
15
15
  require('./PrintUtils-bcaeb82f.js');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
17
 
@@ -7,19 +7,19 @@ 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-9479f618.js');
10
+ require('./DataFetcher-cadeef8e.js');
11
+ require('./pesquisa-fetcher-ca89181c.js');
12
+ const IExporterProvider = require('./IExporterProvider-9ac15aaf.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-0c7106a0.js');
17
+ const dataunitFetcher = require('./dataunit-fetcher-4b12f70c.js');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
19
- const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
19
+ const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
20
20
  const fieldSearch = require('./field-search-f56aa7d6.js');
21
- const ConfigStorage = require('./ConfigStorage-942ce74b.js');
22
- const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
21
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
22
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
23
23
  const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
24
24
  const index$2 = require('./index-102ba62d.js');
25
25
  require('./PrintUtils-bcaeb82f.js');
@@ -137,6 +137,7 @@ const SnkSimpleCrud = class {
137
137
  this.formLegacyConfigName = undefined;
138
138
  this.ignoreReadOnlyFormFields = false;
139
139
  this.autoFocus = true;
140
+ this.domainMessagesBuilder = undefined;
140
141
  this.autoLoad = undefined;
141
142
  }
142
143
  /**
@@ -358,7 +359,7 @@ const SnkSimpleCrud = class {
358
359
  return;
359
360
  }
360
361
  if (this._formConfigManager == undefined) {
361
- this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
362
+ this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
362
363
  this._formConfigManager.setConfig(this.formConfig);
363
364
  }
364
365
  if (this.formConfigIsLoaded() && !forceLoad) {
@@ -752,8 +753,8 @@ const SnkSimpleCrud = class {
752
753
  return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
753
754
  }
754
755
  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);
756
+ var _a;
757
+ const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
757
758
  if (!this.configName && !configFromManager) {
758
759
  return this.formConfig;
759
760
  }
@@ -773,9 +774,10 @@ const SnkSimpleCrud = class {
773
774
  if (this.dataUnit == undefined) {
774
775
  return;
775
776
  }
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)
777
+ const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "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" })));
778
+ 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), 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
779
  ? 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() }))));
780
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, 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
781
  }
780
782
  get _element() { return index$1.getElement(this); }
781
783
  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;
@@ -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
  });