@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-78242.2 → 0.0.0-bugfix-dev-KB-80932.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/cjs/{ConfigStorage-f079f5fd.js → ConfigStorage-d024aec8.js} +2 -2
  2. package/dist/cjs/{ContinuousInsertUtils-64e47516.js → ContinuousInsertUtils-54d44192.js} +5 -5
  3. package/dist/cjs/{DataFetcher-e059eb72.js → DataFetcher-65879b2c.js} +188 -56
  4. package/dist/cjs/{SnkFormConfigManager-63369164.js → SnkFormConfigManager-ae3185b2.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-4f853233.js → auth-fetcher-8480751c.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-8ea97d88.js} +2 -2
  7. package/dist/cjs/{form-config-fetcher-39397ac5.js → form-config-fetcher-90126e4c.js} +38 -1
  8. package/dist/cjs/index-f9e81701.js +8 -4
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-a9bfeb22.js → pesquisa-fetcher-f3454c23.js} +179 -1
  11. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +133 -0
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/{snk-actions-button_4.cjs.entry.js → snk-actions-button_5.cjs.entry.js} +99 -9
  14. package/dist/cjs/snk-application.cjs.entry.js +144 -21
  15. package/dist/cjs/snk-attach.cjs.entry.js +13 -9
  16. package/dist/cjs/snk-config-options_3.cjs.entry.js +4 -4
  17. package/dist/cjs/snk-crud.cjs.entry.js +8 -7
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +29 -18
  19. package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-72ef8777.js} +1 -1
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  22. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +27 -11
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-grid.cjs.entry.js +9 -8
  25. package/dist/cjs/{snk-guides-viewer-2139481c.js → snk-guides-viewer-ea5d0907.js} +5 -5
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-pesquisa.cjs.entry.js +105 -31
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +27 -29
  30. package/dist/collection/collection-manifest.json +3 -0
  31. package/dist/collection/components/snk-actions-button/actions/index.js +4 -4
  32. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +4 -3
  33. package/dist/collection/components/snk-application/snk-application.css +34 -0
  34. package/dist/collection/components/snk-application/snk-application.js +197 -14
  35. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js +8 -4
  36. package/dist/collection/components/snk-crud/snk-crud.js +39 -20
  37. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +11 -5
  38. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +11 -4
  39. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -1
  40. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -3
  41. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
  42. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +3 -1
  43. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +40 -8
  44. package/dist/collection/components/snk-grid/snk-grid.js +39 -20
  45. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css +10 -0
  46. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +190 -0
  47. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css +25 -0
  48. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js +179 -0
  49. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +89 -0
  50. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +24 -5
  51. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +168 -32
  52. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +56 -41
  53. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +22 -0
  54. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +181 -0
  55. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +1 -1
  56. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +41 -4
  57. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +92 -3
  58. package/dist/components/ContinuousInsertUtils.js +2 -3
  59. package/dist/components/DataFetcher.js +188 -56
  60. package/dist/components/ISave.js +346 -1
  61. package/dist/components/dataunit-fetcher.js +1 -1
  62. package/dist/components/form-config-fetcher.js +37 -0
  63. package/dist/components/index.d.ts +3 -0
  64. package/dist/components/index.js +3 -0
  65. package/dist/components/pesquisa-grid.d.ts +11 -0
  66. package/dist/components/pesquisa-grid.js +6 -0
  67. package/dist/components/pesquisa-grid2.js +86 -0
  68. package/dist/components/pesquisa-tree.d.ts +11 -0
  69. package/dist/components/pesquisa-tree.js +6 -0
  70. package/dist/components/pesquisa-tree2.js +82 -0
  71. package/dist/components/snk-actions-button2.js +4 -5
  72. package/dist/components/snk-application2.js +159 -20
  73. package/dist/components/snk-attach2.js +20 -35
  74. package/dist/components/snk-crud.js +66 -59
  75. package/dist/components/snk-data-exporter2.js +25 -15
  76. package/dist/components/snk-detail-view2.js +84 -94
  77. package/dist/components/snk-filter-bar2.js +23 -8
  78. package/dist/components/snk-filter-modal.js +3 -1
  79. package/dist/components/snk-grid2.js +5 -4
  80. package/dist/components/snk-pesquisa2.js +118 -33
  81. package/dist/components/snk-simple-crud2.js +35 -56
  82. package/dist/components/snk-simple-form-config.d.ts +11 -0
  83. package/dist/components/snk-simple-form-config.js +6 -0
  84. package/dist/components/snk-simple-form-config2.js +120 -0
  85. package/dist/components/teste-pesquisa.js +13 -1
  86. package/dist/esm/{ConfigStorage-6514d66e.js → ConfigStorage-373bb440.js} +2 -2
  87. package/dist/esm/{ContinuousInsertUtils-b62906f9.js → ContinuousInsertUtils-25e7bd9a.js} +5 -5
  88. package/dist/esm/{DataFetcher-5034df59.js → DataFetcher-5221b992.js} +188 -56
  89. package/dist/esm/{SnkFormConfigManager-b409c745.js → SnkFormConfigManager-b65e6db0.js} +2 -2
  90. package/dist/esm/{auth-fetcher-ca5d3a49.js → auth-fetcher-e32fe8a4.js} +1 -1
  91. package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-8dd93d8b.js} +2 -2
  92. package/dist/esm/{form-config-fetcher-a7d3e277.js → form-config-fetcher-126e2471.js} +38 -1
  93. package/dist/esm/index-a7d3d3f1.js +8 -4
  94. package/dist/esm/loader.js +1 -1
  95. package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-0af41f09.js} +180 -3
  96. package/dist/esm/pesquisa-grid_2.entry.js +128 -0
  97. package/dist/esm/sankhyablocks.js +1 -1
  98. package/dist/esm/{snk-actions-button_4.entry.js → snk-actions-button_5.entry.js} +99 -10
  99. package/dist/esm/snk-application.entry.js +146 -23
  100. package/dist/esm/snk-attach.entry.js +13 -9
  101. package/dist/esm/snk-config-options_3.entry.js +4 -4
  102. package/dist/esm/snk-crud.entry.js +8 -7
  103. package/dist/esm/snk-data-exporter.entry.js +29 -18
  104. package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-11a49fc3.js} +1 -1
  105. package/dist/esm/snk-data-unit.entry.js +3 -3
  106. package/dist/esm/snk-detail-view.entry.js +7 -7
  107. package/dist/esm/snk-filter-bar_4.entry.js +28 -12
  108. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  109. package/dist/esm/snk-grid.entry.js +9 -8
  110. package/dist/esm/{snk-guides-viewer-b7ed39eb.js → snk-guides-viewer-830f5fb9.js} +5 -5
  111. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  112. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  113. package/dist/esm/snk-pesquisa.entry.js +105 -31
  114. package/dist/esm/snk-simple-crud.entry.js +27 -29
  115. package/dist/sankhyablocks/{p-0e206e62.js → p-05b6ff91.js} +1 -1
  116. package/dist/sankhyablocks/p-09067bee.entry.js +1 -0
  117. package/dist/sankhyablocks/p-0cda2226.entry.js +11 -0
  118. package/dist/sankhyablocks/p-1435701f.js +26 -0
  119. package/dist/sankhyablocks/{p-e97be1c8.js → p-171b7623.js} +1 -1
  120. package/dist/sankhyablocks/{p-9ffd9fc7.js → p-19dc71e9.js} +1 -1
  121. package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-1a91d1f3.entry.js} +1 -1
  122. package/dist/sankhyablocks/{p-aa003d4e.entry.js → p-1cf39cfd.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-bb8ef149.entry.js → p-254c59d2.entry.js} +1 -1
  124. package/dist/sankhyablocks/p-422eb699.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-a2c790ac.entry.js → p-469384a2.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-54f5354a.entry.js +1 -0
  127. package/dist/sankhyablocks/{p-342eeb3b.js → p-60e4db34.js} +1 -1
  128. package/dist/sankhyablocks/p-618a29ed.entry.js +1 -0
  129. package/dist/sankhyablocks/p-798386c7.js +6 -0
  130. package/dist/sankhyablocks/{p-fca0e5cc.entry.js → p-82ee6dc3.entry.js} +1 -1
  131. package/dist/sankhyablocks/{p-e4391e16.js → p-8a1ee5b5.js} +1 -1
  132. package/dist/sankhyablocks/p-8bd86610.entry.js +1 -0
  133. package/dist/sankhyablocks/p-b50a0753.entry.js +1 -0
  134. package/dist/sankhyablocks/p-d62228fb.js +1 -0
  135. package/dist/sankhyablocks/p-d92d4f91.entry.js +1 -0
  136. package/dist/sankhyablocks/{p-47d24ac8.js → p-ddefbbc7.js} +1 -1
  137. package/dist/sankhyablocks/p-e5430b29.entry.js +1 -0
  138. package/dist/sankhyablocks/p-f0b9303b.js +1 -0
  139. package/dist/sankhyablocks/p-f258690a.entry.js +1 -0
  140. package/dist/sankhyablocks/{p-ec43fcc8.entry.js → p-f975370f.entry.js} +1 -1
  141. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  142. package/dist/types/components/snk-application/snk-application.d.ts +22 -4
  143. package/dist/types/components/snk-crud/snk-crud.d.ts +8 -4
  144. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
  145. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  146. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +1 -1
  147. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +6 -1
  148. package/dist/types/components/snk-grid/snk-grid.d.ts +8 -4
  149. package/dist/types/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.d.ts +38 -0
  150. package/dist/types/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.d.ts +29 -0
  151. package/dist/types/components/snk-pesquisa/pesquisaHelper.d.ts +19 -0
  152. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +35 -1
  153. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -4
  154. package/dist/types/components/snk-simple-form-config/snk-simple-form-config.d.ts +34 -0
  155. package/dist/types/components.d.ts +244 -23
  156. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +8 -2
  157. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +10 -1
  158. package/package.json +1 -1
  159. package/react/components.d.ts +3 -0
  160. package/react/components.js +3 -0
  161. package/react/components.js.map +1 -1
  162. package/dist/esm/pesquisa-fetcher-6bc2e41a.js +0 -169
  163. package/dist/sankhyablocks/p-00278e07.js +0 -1
  164. package/dist/sankhyablocks/p-0387d9d7.entry.js +0 -1
  165. package/dist/sankhyablocks/p-126c58ea.js +0 -26
  166. package/dist/sankhyablocks/p-1d3ce0d9.entry.js +0 -1
  167. package/dist/sankhyablocks/p-341465ce.js +0 -6
  168. package/dist/sankhyablocks/p-3728d2aa.entry.js +0 -11
  169. package/dist/sankhyablocks/p-4138da61.entry.js +0 -1
  170. package/dist/sankhyablocks/p-5d9788b3.entry.js +0 -1
  171. package/dist/sankhyablocks/p-7075b789.entry.js +0 -1
  172. package/dist/sankhyablocks/p-aaf94476.js +0 -1
  173. package/dist/sankhyablocks/p-af7f7b3e.entry.js +0 -1
  174. package/dist/sankhyablocks/p-d1791da2.entry.js +0 -1
  175. package/dist/sankhyablocks/p-eb7c9cf4.entry.js +0 -1
@@ -4,21 +4,21 @@ 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 DataFetcher = require('./DataFetcher-e059eb72.js');
7
+ const DataFetcher = require('./DataFetcher-65879b2c.js');
8
8
  const ParamType = require('./ParamType-90b440a0.js');
9
- require('./pesquisa-fetcher-a9bfeb22.js');
9
+ require('./pesquisa-fetcher-f3454c23.js');
10
10
  require('./index-1dfc7a6e.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-228016f4.js');
14
+ require('./dataunit-fetcher-8ea97d88.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
- require('./form-config-fetcher-39397ac5.js');
16
+ const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
17
17
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
18
18
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
19
19
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
20
20
  const CheckMode = require('@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode');
21
- const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
21
+ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
22
22
  const constants = require('./constants-35ddd366.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
@@ -255,9 +255,9 @@ class Actions {
255
255
  return resultParams;
256
256
  });
257
257
  }
258
- actionExecute(execSource, callback) {
258
+ async actionExecute(execSource, callback) {
259
259
  execSource.virtualPage = this.buildVirtualPage();
260
- this.prepareAndExecute(execSource, callback);
260
+ await this.prepareAndExecute(execSource, callback);
261
261
  this.recordsReloader(execSource.refreshType);
262
262
  }
263
263
  resolvePromptParams(action, execSource, hasParamsToSave) {
@@ -452,9 +452,9 @@ class Actions {
452
452
  async buildResourceId(actionId) {
453
453
  return this._appResourceId + '.actionconfig.' + actionId;
454
454
  }
455
- prepareAndExecute(execSource, executeAction) {
455
+ async prepareAndExecute(execSource, executeAction) {
456
456
  this.addRows(execSource);
457
- executeAction(execSource);
457
+ await executeAction(execSource);
458
458
  }
459
459
  addRows(execSource) {
460
460
  const primaryKeys = this.getPrimaryKeys();
@@ -1237,6 +1237,95 @@ const SelectBox = class {
1237
1237
  };
1238
1238
  SelectBox.style = snkSelectBoxCss;
1239
1239
 
1240
+ const snkSimpleFormConfigCss = ":host{display:block}.config-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between}.config-lists{margin-bottom:12px}.config-actions{display:flex;flex-direction:row;justify-content:flex-end;width:100%;gap:12px}";
1241
+
1242
+ const SnkSimpleFormConfig = class {
1243
+ constructor(hostRef) {
1244
+ index.registerInstance(this, hostRef);
1245
+ this.snkConfigSaved = index.createEvent(this, "snkConfigSaved", 7);
1246
+ this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
1247
+ this.fieldsToSave = [];
1248
+ this.dataUnit = undefined;
1249
+ this.configName = undefined;
1250
+ this.avaliableFields = [];
1251
+ this.selectedFields = [];
1252
+ }
1253
+ /**
1254
+ * Responsável por abrir o configurador.
1255
+ */
1256
+ async show() {
1257
+ var _a;
1258
+ await ((_a = this.ezDoubleListRef) === null || _a === void 0 ? void 0 : _a.resetSelectedLists());
1259
+ await this.initializeFormConfig();
1260
+ this.ezPopupRef.opened = true;
1261
+ }
1262
+ ;
1263
+ async initializeFormConfig() {
1264
+ if (!this.configName)
1265
+ return;
1266
+ const allFields = this.getAllVisibleFieldsFromDataUnit();
1267
+ const displayedFieldNameList = await this.getConfig();
1268
+ //Quando não retorna dados, é por quê não existe configuração do usuário salva.
1269
+ if (displayedFieldNameList.length === 0) {
1270
+ this.avaliableFields = [];
1271
+ this.selectedFields = [...allFields];
1272
+ this.fieldsToSave = [...this.selectedFields];
1273
+ return;
1274
+ }
1275
+ const selectedFieldsAux = this.sortDisplayedFields(displayedFieldNameList, allFields);
1276
+ const avaliableFieldsAux = allFields.filter(field => !displayedFieldNameList.includes(field.id));
1277
+ this.avaliableFields = [...avaliableFieldsAux];
1278
+ this.selectedFields = [...selectedFieldsAux];
1279
+ this.fieldsToSave = [...this.selectedFields];
1280
+ }
1281
+ async getConfig() {
1282
+ const fieldList = await this._formConfigFetcher.fetchSimpleFormConfig(this.configName);
1283
+ return [...this.removeDuplicates(fieldList)];
1284
+ }
1285
+ removeDuplicates(strings) {
1286
+ return strings.filter((item, index) => strings.indexOf(item) === index);
1287
+ }
1288
+ sortDisplayedFields(displayedFieldNameList, allFields) {
1289
+ const selectedFieldsAux = [];
1290
+ //É preciso garantir a ordem na qual os campos vieram na resposta do fetchSimpleFormConfig.
1291
+ displayedFieldNameList.forEach(fieldName => {
1292
+ const field = allFields.find(field => field.id === fieldName);
1293
+ if (!field)
1294
+ return;
1295
+ selectedFieldsAux.push(field);
1296
+ });
1297
+ return selectedFieldsAux;
1298
+ }
1299
+ getAllVisibleFieldsFromDataUnit() {
1300
+ var _a, _b, _c;
1301
+ const visibleFields = ((_c = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) !== null && _c !== void 0 ? _c : []).filter(field => field.visible);
1302
+ return visibleFields.map(field => {
1303
+ return { id: field.name, label: field.label };
1304
+ });
1305
+ }
1306
+ close() {
1307
+ this.ezPopupRef.opened = false;
1308
+ }
1309
+ async handleResetConfigs() {
1310
+ await this._formConfigFetcher.restoreFormConfig(this.configName);
1311
+ await this.initializeFormConfig();
1312
+ await this.handleSave();
1313
+ }
1314
+ handleCancel() {
1315
+ this.close();
1316
+ }
1317
+ async handleSave() {
1318
+ const saveList = this.fieldsToSave.map(field => field.id);
1319
+ await this._formConfigFetcher.saveSimpleFormConfig(this.configName, saveList);
1320
+ this.close();
1321
+ this.snkConfigSaved.emit();
1322
+ }
1323
+ render() {
1324
+ return (index.h("ez-popup", { ref: (ref) => this.ezPopupRef = ref, heightMode: 'auto', size: 'auto', ezTitle: 'Configurar formul\u00E1rio' }, index.h("div", { class: 'config-container' }, index.h("div", { class: 'config-lists' }, index.h("ez-double-list", { ref: (ref) => this.ezDoubleListRef = ref, leftList: this.avaliableFields, leftTitle: 'Campos disponíveis', rightList: this.selectedFields, rightTitle: 'Campos selecionados', onEzRightListChanged: ({ detail }) => this.fieldsToSave = [...detail], entityLabel: 'campo', entityLabelPlural: 'campos' })), index.h("div", { class: 'config-actions' }, index.h("ez-button", { label: 'Restaurar', onClick: this.handleResetConfigs.bind(this), size: 'small' }), index.h("ez-button", { label: 'Cancelar', onClick: this.handleCancel.bind(this), size: 'small' }), index.h("ez-button", { label: 'Salvar', class: 'ez-button--primary', onClick: this.handleSave.bind(this), size: 'small' })))));
1325
+ }
1326
+ };
1327
+ SnkSimpleFormConfig.style = snkSimpleFormConfigCss;
1328
+
1240
1329
  const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
1241
1330
 
1242
1331
  const TaskbarActionsButton = class {
@@ -1371,4 +1460,5 @@ TaskbarActionsButton.style = taskbarActionsButtonCss;
1371
1460
  exports.snk_actions_button = SnkActionsButton;
1372
1461
  exports.snk_grid_config = SnkGridConfig;
1373
1462
  exports.snk_select_box = SelectBox;
1463
+ exports.snk_simple_form_config = SnkSimpleFormConfig;
1374
1464
  exports.taskbar_actions_button = TaskbarActionsButton;
@@ -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 utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
9
- const DataFetcher = require('./DataFetcher-e059eb72.js');
10
- const authFetcher = require('./auth-fetcher-4f853233.js');
11
- const dataunitFetcher = require('./dataunit-fetcher-228016f4.js');
12
- const pesquisaFetcher = require('./pesquisa-fetcher-a9bfeb22.js');
8
+ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
9
+ const DataFetcher = require('./DataFetcher-65879b2c.js');
10
+ const authFetcher = require('./auth-fetcher-8480751c.js');
11
+ const dataunitFetcher = require('./dataunit-fetcher-8ea97d88.js');
12
+ const pesquisaFetcher = require('./pesquisa-fetcher-f3454c23.js');
13
13
  const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
14
- require('./form-config-fetcher-39397ac5.js');
14
+ require('./form-config-fetcher-90126e4c.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
17
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -309,11 +309,12 @@ class DebouncedRequestListener {
309
309
  }
310
310
  ;
311
311
  onRequestEnd(param) {
312
+ var _a, _b, _c;
312
313
  const timeoutId = this.requests.get(param.requestId);
313
314
  clearTimeout(timeoutId);
314
- if (this.requestsLoadingBar.includes(param.requestId)) {
315
- this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
316
- !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
315
+ if ((_a = this.requestsLoadingBar) === null || _a === void 0 ? void 0 : _a.includes(param.requestId)) {
316
+ this.requestsLoadingBar = (_b = this.requestsLoadingBar) === null || _b === void 0 ? void 0 : _b.filter(id => id !== param.requestId);
317
+ !this.requestsLoadingBar.length && ((_c = this.ezLoadingBar) === null || _c === void 0 ? void 0 : _c.hide());
317
318
  }
318
319
  }
319
320
  ;
@@ -384,7 +385,7 @@ class RequestListenerFactory {
384
385
  }
385
386
  }
386
387
 
387
- const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
388
+ const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
388
389
 
389
390
  const SnkApplication = class {
390
391
  constructor(hostRef) {
@@ -398,9 +399,13 @@ const SnkApplication = class {
398
399
  this._duCache = new Map();
399
400
  this._duPromises = new Map();
400
401
  this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
402
+ this._maxTimeLockAppLoading = 10000;
403
+ this._isBrowserTypeElectron = false;
401
404
  this._pendingActions = new Map;
402
405
  this._loadPkParameter = null;
403
406
  this._isLoadedByPk = false;
407
+ this._applicationReady = false;
408
+ this.enableLockManagerLoadingApp = undefined;
404
409
  this.messagesBuilder = undefined;
405
410
  this.configName = undefined;
406
411
  this.gridLegacyConfigName = undefined;
@@ -886,15 +891,21 @@ const SnkApplication = class {
886
891
  return Promise.resolve(this._isLoadedByPk);
887
892
  }
888
893
  /**
889
- * Remove registro do cache do PreLoader do dataunit.
890
- * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
891
- */
894
+ * Remove registro do cache do PreLoader do dataunit.
895
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
896
+ */
892
897
  async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
893
898
  const records = recordsIDs.map(id => {
894
899
  return { "__record__id__": id };
895
900
  });
896
901
  dataunitFetcher.PreloadManager.removeRecords(dataUnit, records);
897
902
  }
903
+ getCountSkeleton(className, skeletonHeight, spacingSkeleton) {
904
+ let containerHeight = window.innerHeight - 350;
905
+ spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
906
+ let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
907
+ return skeletonCount || 1;
908
+ }
898
909
  async getAuthList(auth) {
899
910
  return await (new MGEAuthorization()).parseFromJSON(auth);
900
911
  }
@@ -936,12 +947,12 @@ const SnkApplication = class {
936
947
  * Obtém as opções em componentes de pesquisa
937
948
  * Ex.: snk-config-options
938
949
  */
939
- async executeSearch(searchArgument, fieldName, dataUnit) {
950
+ async executeSearch(searchArgument, fieldName, dataUnit, ctxOptions) {
940
951
  const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
941
952
  if (!descriptor) ;
942
953
  else {
943
954
  const { mode, argument } = searchArgument;
944
- const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
955
+ const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY, ISHIERARCHYENTITY } = descriptor.properties;
945
956
  const dependencies = descriptor.dependencies;
946
957
  let criteria;
947
958
  const searchOptions = {
@@ -971,7 +982,16 @@ const SnkApplication = class {
971
982
  }
972
983
  }
973
984
  });
974
- return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
985
+ const allowsNonAnalytic = ctxOptions === null || ctxOptions === void 0 ? void 0 : ctxOptions.allowsNonAnalytic;
986
+ const options = {
987
+ entity: ENTITYNAME,
988
+ entityDescription: DESCRIPTIONENTITY,
989
+ isHierarchyEntity: ISHIERARCHYENTITY,
990
+ criteria,
991
+ searchOptions,
992
+ allowsNonAnalytic
993
+ };
994
+ return this.executePreparedSearch(mode, argument, options);
975
995
  }
976
996
  }
977
997
  filterInvalidFields(resp, item, mdByName) {
@@ -1021,13 +1041,19 @@ const SnkApplication = class {
1021
1041
  */
1022
1042
  async executePreparedSearch(mode, argument, options) {
1023
1043
  const mdByName = {};
1024
- const { entity, entityDescription, criteria, searchOptions } = options;
1044
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
1025
1045
  if (mode === "ADVANCED") {
1026
1046
  return new Promise((accept, reject) => {
1027
1047
  const pesquisaContent = document.createElement("snk-pesquisa");
1028
1048
  pesquisaContent[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
1049
+ pesquisaContent.entityName = entity;
1029
1050
  pesquisaContent.argument = argument;
1030
1051
  pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
1052
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
1053
+ if (isHierarchyEntity) {
1054
+ pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
1055
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
1056
+ }
1031
1057
  pesquisaContent.selectItem = (option) => {
1032
1058
  accept(option);
1033
1059
  this.clearPopUpTitle();
@@ -1335,8 +1361,8 @@ const SnkApplication = class {
1335
1361
  this._errorHandler = new SnkErrorHandler(this);
1336
1362
  this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
1337
1363
  core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${DataFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
1338
- core.ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
1339
- return this.executeSearch(searchArgument, fieldName, dataUnit);
1364
+ core.ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit, ctxOptions) => {
1365
+ return this.executeSearch(searchArgument, fieldName, dataUnit, ctxOptions);
1340
1366
  });
1341
1367
  core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
1342
1368
  this.registerPkChangeListener();
@@ -1350,12 +1376,15 @@ const SnkApplication = class {
1350
1376
  this._waitingAppReady.forEach(resolve => resolve());
1351
1377
  }
1352
1378
  connectedCallback() {
1379
+ this._isBrowserTypeElectron = core.UserAgentUtils.isElectron();
1353
1380
  core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
1354
1381
  DataFetcher.DataFetcher.addRequestListener(this._requestListener);
1355
1382
  }
1356
1383
  disconnectedCallback() {
1357
- DataFetcher.DataFetcher.removeRequestListener(this._requestListener);
1384
+ DataFetcher.DataFetcher === null || DataFetcher.DataFetcher === void 0 ? void 0 : DataFetcher.DataFetcher.removeRequestListener(this._requestListener);
1358
1385
  this.removeShortcuts();
1386
+ if (this._lockManagerTimer)
1387
+ clearTimeout(this._lockManagerTimer);
1359
1388
  }
1360
1389
  async componentDidLoad() {
1361
1390
  this.applicationLoading.emit(true);
@@ -1367,6 +1396,63 @@ const SnkApplication = class {
1367
1396
  core.ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
1368
1397
  await this.handleShowNewVersionPopup();
1369
1398
  this.initKeyboardManager();
1399
+ if (this.enableLockManagerLoadingApp) {
1400
+ core.LockManager.addLockManagerCtxId(this._element);
1401
+ this.resolveApplicationReady();
1402
+ }
1403
+ else {
1404
+ this._applicationReady = true;
1405
+ }
1406
+ }
1407
+ async markToReload() {
1408
+ if (!this.enableLockManagerLoadingApp)
1409
+ return;
1410
+ this._applicationReady = false;
1411
+ await core.LockManager.resetLocks(this._element, core.LockManagerOperation.APP_LOADING);
1412
+ this.resolveApplicationReady();
1413
+ }
1414
+ async addLoadingLock(forceReady = false) {
1415
+ if (!this.enableLockManagerLoadingApp)
1416
+ return;
1417
+ if (forceReady) {
1418
+ this._applicationReady = false;
1419
+ await core.LockManager.resetLocks(this._element, core.LockManagerOperation.APP_LOADING);
1420
+ }
1421
+ this.resolveApplicationReady();
1422
+ return await core.LockManager.lock(this._element, core.LockManagerOperation.APP_LOADING);
1423
+ }
1424
+ async resolveApplicationReady() {
1425
+ if (this._applicationReady) {
1426
+ return;
1427
+ }
1428
+ try {
1429
+ await this.checkTimeoutLimitLockManager();
1430
+ await core.LockManager.whenHasLock(this._element, core.LockManagerOperation.APP_LOADING);
1431
+ await core.LockManager.whenResolve(this._element, core.LockManagerOperation.APP_LOADING, 1200);
1432
+ await core.LockManager.resetLocks(this._element, core.LockManagerOperation.APP_LOADING);
1433
+ this._applicationReady = true;
1434
+ }
1435
+ catch (error) {
1436
+ console.warn(error);
1437
+ this._applicationReady = true;
1438
+ }
1439
+ }
1440
+ stopTimeoutLockManager() {
1441
+ if (this._lockManagerTimer) {
1442
+ clearTimeout(this._lockManagerTimer);
1443
+ }
1444
+ }
1445
+ async checkTimeoutLimitLockManager() {
1446
+ this.stopTimeoutLockManager();
1447
+ if (this._applicationReady)
1448
+ return;
1449
+ this._lockManagerTimer = setTimeout(async () => {
1450
+ if (!this._applicationReady) {
1451
+ await core.LockManager.resetLocks(this._element, core.LockManagerOperation.APP_LOADING);
1452
+ this.stopTimeoutLockManager();
1453
+ this._applicationReady = true;
1454
+ }
1455
+ }, this._maxTimeLockAppLoading);
1370
1456
  }
1371
1457
  initKeyboardManager() {
1372
1458
  this._keyboardManager
@@ -1380,8 +1466,40 @@ const SnkApplication = class {
1380
1466
  .unbind("ctrl + d")
1381
1467
  .unbind("F1");
1382
1468
  }
1469
+ // TODO: Etapa 2 - implementar template de loading
1470
+ renderLoadingSkeleton(template) {
1471
+ if (this.enableLockManagerLoadingApp) {
1472
+ if (!this._isBrowserTypeElectron) {
1473
+ switch (template) {
1474
+ case TEMPLATES_LOADING_SKELETON.APPLICATION:
1475
+ case TEMPLATES_LOADING_SKELETON.GRID:
1476
+ return this.getSkeletonTemplateApplication();
1477
+ default:
1478
+ return this.getSkeletonTemplateApplication();
1479
+ }
1480
+ }
1481
+ else {
1482
+ return this.getSpinnerLoadingDefault();
1483
+ }
1484
+ }
1485
+ }
1486
+ getLoadingVisibilityStyle() {
1487
+ return {
1488
+ visibility: this._applicationReady ? "hidden" : "initial",
1489
+ display: this._applicationReady ? "none" : "unset"
1490
+ };
1491
+ }
1492
+ getSkeletonTemplateApplication() {
1493
+ return (index.h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, index.h("div", { class: "ez-margin--medium ez-margin-top--extra-small" }, index.h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "150px", animation: "progress" })), index.h("div", { class: "ez-flex ez-flex--align-items-stretch skeleton-content" }, index.h("div", { class: "skeleton-content-left ez-margin--medium" }, index.h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "calc(100% - 15px)", animation: "progress", marginBottom: "20px" })), index.h("div", { class: "ez-flex-item--auto skeleton-content-right ez-margin--medium" }, index.h("ez-skeleton", { count: this.getCountSkeleton("skeleton-content-right", 50, 20), variant: "rect", width: "100%", height: "49px", animation: "progress", marginBottom: "20px" }))), index.h("div", { class: "skeleton-content-footer ez-margin--medium ez-margin-top--extra-small" }, index.h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100px", animation: "progress" }))));
1494
+ }
1495
+ getSpinnerLoadingDefault() {
1496
+ return (index.h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, index.h("div", { class: "ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner" }, index.h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), index.h("span", { class: "ez-title ez-title--secondary ez-title--extra-large" }, "Carregando..."))));
1497
+ }
1383
1498
  render() {
1384
- return (index.h("div", null, index.h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), index.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), index.h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1499
+ return (index.h(index.Host, { style: {
1500
+ visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
1501
+ overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
1502
+ } }, index.h("div", null, index.h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), index.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), index.h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true }), this.renderLoadingSkeleton())));
1385
1503
  }
1386
1504
  get _element() { return index.getElement(this); }
1387
1505
  static get watchers() { return {
@@ -1394,6 +1512,11 @@ class PendingPromise {
1394
1512
  this.reject = reject;
1395
1513
  }
1396
1514
  }
1515
+ var TEMPLATES_LOADING_SKELETON;
1516
+ (function (TEMPLATES_LOADING_SKELETON) {
1517
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
1518
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
1519
+ })(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
1397
1520
  SnkApplication.style = snkApplicationCss;
1398
1521
 
1399
1522
  exports.snk_application = SnkApplication;
@@ -4,15 +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 DataFetcher = require('./DataFetcher-e059eb72.js');
8
- require('./pesquisa-fetcher-a9bfeb22.js');
7
+ const DataFetcher = require('./DataFetcher-65879b2c.js');
8
+ require('./pesquisa-fetcher-f3454c23.js');
9
9
  require('./index-1dfc7a6e.js');
10
10
  const ISave = require('./ISave-e91b70a7.js');
11
- const dataunitFetcher = require('./dataunit-fetcher-228016f4.js');
11
+ const dataunitFetcher = require('./dataunit-fetcher-8ea97d88.js');
12
12
  require('./filter-item-type.enum-a7ffdaa6.js');
13
- require('./form-config-fetcher-39397ac5.js');
13
+ require('./form-config-fetcher-90126e4c.js');
14
14
  const constants = require('./constants-35ddd366.js');
15
- const authFetcher = require('./auth-fetcher-4f853233.js');
15
+ const authFetcher = require('./auth-fetcher-8480751c.js');
16
16
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
17
17
  require('./PrintUtils-bcaeb82f.js');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -555,14 +555,18 @@ const buildTaskBarManager = () => {
555
555
  ];
556
556
  return {
557
557
  getButtons: (_, dataState, currentButtons) => {
558
- if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty))
558
+ const refreshBtnIndex = currentButtons.indexOf(taskbarElements.TaskbarElement.REFRESH);
559
+ if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty)) {
559
560
  return currentButtons.reverse();
560
- else
561
- currentButtons.splice(currentButtons.indexOf(taskbarElements.TaskbarElement.REFRESH), 1);
561
+ }
562
+ else if (refreshBtnIndex !== -1) {
563
+ currentButtons.splice(refreshBtnIndex, 1);
564
+ }
562
565
  const { selectedRecord } = dataState || {};
563
566
  const taskbarTobeAdded = !!(selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.LINK) ? TaskbarAttachButtons.LINK : TaskbarAttachButtons.DOWNLOAD;
564
567
  currentButtons.splice(currentButtons.indexOf(taskbarElements.TaskbarElement.DIVIDER) + 1, 0, taskbarElements.TaskbarElement.REMOVE, taskbarTobeAdded, taskbarElements.TaskbarElement.DIVIDER);
565
- const updatedButtons = Array.from(new Set(currentButtons.filter(button => button !== taskbarElements.TaskbarElement.CLONE)));
568
+ const buttonsToRemove = [taskbarElements.TaskbarElement.CLONE, taskbarElements.TaskbarElement.DATA_EXPORTER];
569
+ const updatedButtons = Array.from(new Set(currentButtons.filter((button) => !buttonsToRemove.includes(button))));
566
570
  updatedButtons.splice(updatedButtons.indexOf(taskbarTobeAdded) + 1, 0, taskbarElements.TaskbarElement.DIVIDER);
567
571
  return updatedButtons;
568
572
  },
@@ -7,14 +7,14 @@ const core = require('@sankhyalabs/core');
7
7
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
8
8
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
9
  const constants = require('./constants-35ddd366.js');
10
- const SnkFormConfigManager = require('./SnkFormConfigManager-63369164.js');
10
+ const SnkFormConfigManager = require('./SnkFormConfigManager-ae3185b2.js');
11
11
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
12
12
  const Sortable = require('./Sortable-fb1c4cbb.js');
13
- const formConfigFetcher = require('./form-config-fetcher-39397ac5.js');
13
+ const formConfigFetcher = require('./form-config-fetcher-90126e4c.js');
14
14
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
15
- require('./ConfigStorage-f079f5fd.js');
15
+ require('./ConfigStorage-d024aec8.js');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./DataFetcher-e059eb72.js');
17
+ require('./DataFetcher-65879b2c.js');
18
18
  require('./PrintUtils-bcaeb82f.js');
19
19
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
20
20
 
@@ -5,17 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
- require('./DataFetcher-e059eb72.js');
9
- require('./pesquisa-fetcher-a9bfeb22.js');
8
+ require('./DataFetcher-65879b2c.js');
9
+ require('./pesquisa-fetcher-f3454c23.js');
10
10
  const index$1 = require('./index-1dfc7a6e.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-228016f4.js');
14
+ require('./dataunit-fetcher-8ea97d88.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
- require('./form-config-fetcher-39397ac5.js');
16
+ require('./form-config-fetcher-90126e4c.js');
17
17
  const constants = require('./constants-35ddd366.js');
18
- const authFetcher = require('./auth-fetcher-4f853233.js');
18
+ const authFetcher = require('./auth-fetcher-8480751c.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./PrintUtils-bcaeb82f.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
@@ -42,6 +42,8 @@ const SnkCrud = class {
42
42
  this._currentViewMode = constants.VIEW_MODE.GRID;
43
43
  this._canEdit = undefined;
44
44
  this._resourceID = undefined;
45
+ this.enableLockManagerLoadingComp = false;
46
+ this.enableLockManagerTaskbarClick = false;
45
47
  this.configName = undefined;
46
48
  this.filterBarTitle = undefined;
47
49
  this.selectionToastConfig = undefined;
@@ -63,7 +65,6 @@ const SnkCrud = class {
63
65
  this.enableGridInsert = false;
64
66
  this.domainMessagesBuilder = undefined;
65
67
  this.ignoreReadOnlyFormFields = undefined;
66
- this.enableLockManger = false;
67
68
  this.setCustomFormTitle = undefined;
68
69
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
69
70
  }
@@ -410,7 +411,7 @@ const SnkCrud = class {
410
411
  return;
411
412
  }
412
413
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert);
413
- return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManger: this.enableLockManger }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
414
+ return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', 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, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
414
415
  }
415
416
  get _element() { return index.getElement(this); }
416
417
  static get watchers() { return {