@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
@@ -1,20 +1,20 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-5034df59.js';
3
+ import { D as DataFetcher } from './DataFetcher-5221b992.js';
4
4
  import { P as ParamType } from './ParamType-d5152b06.js';
5
- import './pesquisa-fetcher-6bc2e41a.js';
5
+ import './pesquisa-fetcher-0af41f09.js';
6
6
  import './index-3aa4977a.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-56cb648b.js';
10
+ import './dataunit-fetcher-8dd93d8b.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-a7d3e277.js';
12
+ import { F as FormConfigFetcher } from './form-config-fetcher-126e2471.js';
13
13
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
14
14
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
15
15
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
16
16
  import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
17
- import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
17
+ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
18
18
  import { O as ORDER_VALUES } from './constants-7302ee87.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -251,9 +251,9 @@ class Actions {
251
251
  return resultParams;
252
252
  });
253
253
  }
254
- actionExecute(execSource, callback) {
254
+ async actionExecute(execSource, callback) {
255
255
  execSource.virtualPage = this.buildVirtualPage();
256
- this.prepareAndExecute(execSource, callback);
256
+ await this.prepareAndExecute(execSource, callback);
257
257
  this.recordsReloader(execSource.refreshType);
258
258
  }
259
259
  resolvePromptParams(action, execSource, hasParamsToSave) {
@@ -448,9 +448,9 @@ class Actions {
448
448
  async buildResourceId(actionId) {
449
449
  return this._appResourceId + '.actionconfig.' + actionId;
450
450
  }
451
- prepareAndExecute(execSource, executeAction) {
451
+ async prepareAndExecute(execSource, executeAction) {
452
452
  this.addRows(execSource);
453
- executeAction(execSource);
453
+ await executeAction(execSource);
454
454
  }
455
455
  addRows(execSource) {
456
456
  const primaryKeys = this.getPrimaryKeys();
@@ -1233,6 +1233,95 @@ const SelectBox = class {
1233
1233
  };
1234
1234
  SelectBox.style = snkSelectBoxCss;
1235
1235
 
1236
+ 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}";
1237
+
1238
+ const SnkSimpleFormConfig = class {
1239
+ constructor(hostRef) {
1240
+ registerInstance(this, hostRef);
1241
+ this.snkConfigSaved = createEvent(this, "snkConfigSaved", 7);
1242
+ this._formConfigFetcher = new FormConfigFetcher();
1243
+ this.fieldsToSave = [];
1244
+ this.dataUnit = undefined;
1245
+ this.configName = undefined;
1246
+ this.avaliableFields = [];
1247
+ this.selectedFields = [];
1248
+ }
1249
+ /**
1250
+ * Responsável por abrir o configurador.
1251
+ */
1252
+ async show() {
1253
+ var _a;
1254
+ await ((_a = this.ezDoubleListRef) === null || _a === void 0 ? void 0 : _a.resetSelectedLists());
1255
+ await this.initializeFormConfig();
1256
+ this.ezPopupRef.opened = true;
1257
+ }
1258
+ ;
1259
+ async initializeFormConfig() {
1260
+ if (!this.configName)
1261
+ return;
1262
+ const allFields = this.getAllVisibleFieldsFromDataUnit();
1263
+ const displayedFieldNameList = await this.getConfig();
1264
+ //Quando não retorna dados, é por quê não existe configuração do usuário salva.
1265
+ if (displayedFieldNameList.length === 0) {
1266
+ this.avaliableFields = [];
1267
+ this.selectedFields = [...allFields];
1268
+ this.fieldsToSave = [...this.selectedFields];
1269
+ return;
1270
+ }
1271
+ const selectedFieldsAux = this.sortDisplayedFields(displayedFieldNameList, allFields);
1272
+ const avaliableFieldsAux = allFields.filter(field => !displayedFieldNameList.includes(field.id));
1273
+ this.avaliableFields = [...avaliableFieldsAux];
1274
+ this.selectedFields = [...selectedFieldsAux];
1275
+ this.fieldsToSave = [...this.selectedFields];
1276
+ }
1277
+ async getConfig() {
1278
+ const fieldList = await this._formConfigFetcher.fetchSimpleFormConfig(this.configName);
1279
+ return [...this.removeDuplicates(fieldList)];
1280
+ }
1281
+ removeDuplicates(strings) {
1282
+ return strings.filter((item, index) => strings.indexOf(item) === index);
1283
+ }
1284
+ sortDisplayedFields(displayedFieldNameList, allFields) {
1285
+ const selectedFieldsAux = [];
1286
+ //É preciso garantir a ordem na qual os campos vieram na resposta do fetchSimpleFormConfig.
1287
+ displayedFieldNameList.forEach(fieldName => {
1288
+ const field = allFields.find(field => field.id === fieldName);
1289
+ if (!field)
1290
+ return;
1291
+ selectedFieldsAux.push(field);
1292
+ });
1293
+ return selectedFieldsAux;
1294
+ }
1295
+ getAllVisibleFieldsFromDataUnit() {
1296
+ var _a, _b, _c;
1297
+ 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);
1298
+ return visibleFields.map(field => {
1299
+ return { id: field.name, label: field.label };
1300
+ });
1301
+ }
1302
+ close() {
1303
+ this.ezPopupRef.opened = false;
1304
+ }
1305
+ async handleResetConfigs() {
1306
+ await this._formConfigFetcher.restoreFormConfig(this.configName);
1307
+ await this.initializeFormConfig();
1308
+ await this.handleSave();
1309
+ }
1310
+ handleCancel() {
1311
+ this.close();
1312
+ }
1313
+ async handleSave() {
1314
+ const saveList = this.fieldsToSave.map(field => field.id);
1315
+ await this._formConfigFetcher.saveSimpleFormConfig(this.configName, saveList);
1316
+ this.close();
1317
+ this.snkConfigSaved.emit();
1318
+ }
1319
+ render() {
1320
+ return (h("ez-popup", { ref: (ref) => this.ezPopupRef = ref, heightMode: 'auto', size: 'auto', ezTitle: 'Configurar formul\u00E1rio' }, h("div", { class: 'config-container' }, h("div", { class: 'config-lists' }, 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' })), h("div", { class: 'config-actions' }, h("ez-button", { label: 'Restaurar', onClick: this.handleResetConfigs.bind(this), size: 'small' }), h("ez-button", { label: 'Cancelar', onClick: this.handleCancel.bind(this), size: 'small' }), h("ez-button", { label: 'Salvar', class: 'ez-button--primary', onClick: this.handleSave.bind(this), size: 'small' })))));
1321
+ }
1322
+ };
1323
+ SnkSimpleFormConfig.style = snkSimpleFormConfigCss;
1324
+
1236
1325
  const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
1237
1326
 
1238
1327
  const TaskbarActionsButton = class {
@@ -1364,4 +1453,4 @@ const TaskbarActionsButton = class {
1364
1453
  };
1365
1454
  TaskbarActionsButton.style = taskbarActionsButtonCss;
1366
1455
 
1367
- export { SnkActionsButton as snk_actions_button, SnkGridConfig as snk_grid_config, SelectBox as snk_select_box, TaskbarActionsButton as taskbar_actions_button };
1456
+ export { SnkActionsButton as snk_actions_button, SnkGridConfig as snk_grid_config, SelectBox as snk_select_box, SnkSimpleFormConfig as snk_simple_form_config, TaskbarActionsButton as taskbar_actions_button };
@@ -1,13 +1,13 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
- import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
+ import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
5
- import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-5034df59.js';
6
- import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-ca5d3a49.js';
7
- import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-56cb648b.js';
8
- import { P as PesquisaFetcher } from './pesquisa-fetcher-6bc2e41a.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
5
+ import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-5221b992.js';
6
+ import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-e32fe8a4.js';
7
+ import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-8dd93d8b.js';
8
+ import { P as PesquisaFetcher } from './pesquisa-fetcher-0af41f09.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
10
- import './form-config-fetcher-a7d3e277.js';
10
+ import './form-config-fetcher-126e2471.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -305,11 +305,12 @@ class DebouncedRequestListener {
305
305
  }
306
306
  ;
307
307
  onRequestEnd(param) {
308
+ var _a, _b, _c;
308
309
  const timeoutId = this.requests.get(param.requestId);
309
310
  clearTimeout(timeoutId);
310
- if (this.requestsLoadingBar.includes(param.requestId)) {
311
- this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
312
- !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
311
+ if ((_a = this.requestsLoadingBar) === null || _a === void 0 ? void 0 : _a.includes(param.requestId)) {
312
+ this.requestsLoadingBar = (_b = this.requestsLoadingBar) === null || _b === void 0 ? void 0 : _b.filter(id => id !== param.requestId);
313
+ !this.requestsLoadingBar.length && ((_c = this.ezLoadingBar) === null || _c === void 0 ? void 0 : _c.hide());
313
314
  }
314
315
  }
315
316
  ;
@@ -380,7 +381,7 @@ class RequestListenerFactory {
380
381
  }
381
382
  }
382
383
 
383
- const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
384
+ 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)}}";
384
385
 
385
386
  const SnkApplication = class {
386
387
  constructor(hostRef) {
@@ -394,9 +395,13 @@ const SnkApplication = class {
394
395
  this._duCache = new Map();
395
396
  this._duPromises = new Map();
396
397
  this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
398
+ this._maxTimeLockAppLoading = 10000;
399
+ this._isBrowserTypeElectron = false;
397
400
  this._pendingActions = new Map;
398
401
  this._loadPkParameter = null;
399
402
  this._isLoadedByPk = false;
403
+ this._applicationReady = false;
404
+ this.enableLockManagerLoadingApp = undefined;
400
405
  this.messagesBuilder = undefined;
401
406
  this.configName = undefined;
402
407
  this.gridLegacyConfigName = undefined;
@@ -882,15 +887,21 @@ const SnkApplication = class {
882
887
  return Promise.resolve(this._isLoadedByPk);
883
888
  }
884
889
  /**
885
- * Remove registro do cache do PreLoader do dataunit.
886
- * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
887
- */
890
+ * Remove registro do cache do PreLoader do dataunit.
891
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
892
+ */
888
893
  async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
889
894
  const records = recordsIDs.map(id => {
890
895
  return { "__record__id__": id };
891
896
  });
892
897
  PreloadManager.removeRecords(dataUnit, records);
893
898
  }
899
+ getCountSkeleton(className, skeletonHeight, spacingSkeleton) {
900
+ let containerHeight = window.innerHeight - 350;
901
+ spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
902
+ let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
903
+ return skeletonCount || 1;
904
+ }
894
905
  async getAuthList(auth) {
895
906
  return await (new MGEAuthorization()).parseFromJSON(auth);
896
907
  }
@@ -932,12 +943,12 @@ const SnkApplication = class {
932
943
  * Obtém as opções em componentes de pesquisa
933
944
  * Ex.: snk-config-options
934
945
  */
935
- async executeSearch(searchArgument, fieldName, dataUnit) {
946
+ async executeSearch(searchArgument, fieldName, dataUnit, ctxOptions) {
936
947
  const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
937
948
  if (!descriptor) ;
938
949
  else {
939
950
  const { mode, argument } = searchArgument;
940
- const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
951
+ const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY, ISHIERARCHYENTITY } = descriptor.properties;
941
952
  const dependencies = descriptor.dependencies;
942
953
  let criteria;
943
954
  const searchOptions = {
@@ -967,7 +978,16 @@ const SnkApplication = class {
967
978
  }
968
979
  }
969
980
  });
970
- return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
981
+ const allowsNonAnalytic = ctxOptions === null || ctxOptions === void 0 ? void 0 : ctxOptions.allowsNonAnalytic;
982
+ const options = {
983
+ entity: ENTITYNAME,
984
+ entityDescription: DESCRIPTIONENTITY,
985
+ isHierarchyEntity: ISHIERARCHYENTITY,
986
+ criteria,
987
+ searchOptions,
988
+ allowsNonAnalytic
989
+ };
990
+ return this.executePreparedSearch(mode, argument, options);
971
991
  }
972
992
  }
973
993
  filterInvalidFields(resp, item, mdByName) {
@@ -1017,13 +1037,19 @@ const SnkApplication = class {
1017
1037
  */
1018
1038
  async executePreparedSearch(mode, argument, options) {
1019
1039
  const mdByName = {};
1020
- const { entity, entityDescription, criteria, searchOptions } = options;
1040
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
1021
1041
  if (mode === "ADVANCED") {
1022
1042
  return new Promise((accept, reject) => {
1023
1043
  const pesquisaContent = document.createElement("snk-pesquisa");
1024
1044
  pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
1045
+ pesquisaContent.entityName = entity;
1025
1046
  pesquisaContent.argument = argument;
1026
1047
  pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
1048
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
1049
+ if (isHierarchyEntity) {
1050
+ pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
1051
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
1052
+ }
1027
1053
  pesquisaContent.selectItem = (option) => {
1028
1054
  accept(option);
1029
1055
  this.clearPopUpTitle();
@@ -1331,8 +1357,8 @@ const SnkApplication = class {
1331
1357
  this._errorHandler = new SnkErrorHandler(this);
1332
1358
  this.messagesBuilder = new SnkMessageBuilder();
1333
1359
  ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
1334
- ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
1335
- return this.executeSearch(searchArgument, fieldName, dataUnit);
1360
+ ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit, ctxOptions) => {
1361
+ return this.executeSearch(searchArgument, fieldName, dataUnit, ctxOptions);
1336
1362
  });
1337
1363
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
1338
1364
  this.registerPkChangeListener();
@@ -1346,12 +1372,15 @@ const SnkApplication = class {
1346
1372
  this._waitingAppReady.forEach(resolve => resolve());
1347
1373
  }
1348
1374
  connectedCallback() {
1375
+ this._isBrowserTypeElectron = UserAgentUtils.isElectron();
1349
1376
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
1350
1377
  DataFetcher.addRequestListener(this._requestListener);
1351
1378
  }
1352
1379
  disconnectedCallback() {
1353
- DataFetcher.removeRequestListener(this._requestListener);
1380
+ DataFetcher === null || DataFetcher === void 0 ? void 0 : DataFetcher.removeRequestListener(this._requestListener);
1354
1381
  this.removeShortcuts();
1382
+ if (this._lockManagerTimer)
1383
+ clearTimeout(this._lockManagerTimer);
1355
1384
  }
1356
1385
  async componentDidLoad() {
1357
1386
  this.applicationLoading.emit(true);
@@ -1363,6 +1392,63 @@ const SnkApplication = class {
1363
1392
  ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
1364
1393
  await this.handleShowNewVersionPopup();
1365
1394
  this.initKeyboardManager();
1395
+ if (this.enableLockManagerLoadingApp) {
1396
+ LockManager.addLockManagerCtxId(this._element);
1397
+ this.resolveApplicationReady();
1398
+ }
1399
+ else {
1400
+ this._applicationReady = true;
1401
+ }
1402
+ }
1403
+ async markToReload() {
1404
+ if (!this.enableLockManagerLoadingApp)
1405
+ return;
1406
+ this._applicationReady = false;
1407
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1408
+ this.resolveApplicationReady();
1409
+ }
1410
+ async addLoadingLock(forceReady = false) {
1411
+ if (!this.enableLockManagerLoadingApp)
1412
+ return;
1413
+ if (forceReady) {
1414
+ this._applicationReady = false;
1415
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1416
+ }
1417
+ this.resolveApplicationReady();
1418
+ return await LockManager.lock(this._element, LockManagerOperation.APP_LOADING);
1419
+ }
1420
+ async resolveApplicationReady() {
1421
+ if (this._applicationReady) {
1422
+ return;
1423
+ }
1424
+ try {
1425
+ await this.checkTimeoutLimitLockManager();
1426
+ await LockManager.whenHasLock(this._element, LockManagerOperation.APP_LOADING);
1427
+ await LockManager.whenResolve(this._element, LockManagerOperation.APP_LOADING, 1200);
1428
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1429
+ this._applicationReady = true;
1430
+ }
1431
+ catch (error) {
1432
+ console.warn(error);
1433
+ this._applicationReady = true;
1434
+ }
1435
+ }
1436
+ stopTimeoutLockManager() {
1437
+ if (this._lockManagerTimer) {
1438
+ clearTimeout(this._lockManagerTimer);
1439
+ }
1440
+ }
1441
+ async checkTimeoutLimitLockManager() {
1442
+ this.stopTimeoutLockManager();
1443
+ if (this._applicationReady)
1444
+ return;
1445
+ this._lockManagerTimer = setTimeout(async () => {
1446
+ if (!this._applicationReady) {
1447
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1448
+ this.stopTimeoutLockManager();
1449
+ this._applicationReady = true;
1450
+ }
1451
+ }, this._maxTimeLockAppLoading);
1366
1452
  }
1367
1453
  initKeyboardManager() {
1368
1454
  this._keyboardManager
@@ -1376,8 +1462,40 @@ const SnkApplication = class {
1376
1462
  .unbind("ctrl + d")
1377
1463
  .unbind("F1");
1378
1464
  }
1465
+ // TODO: Etapa 2 - implementar template de loading
1466
+ renderLoadingSkeleton(template) {
1467
+ if (this.enableLockManagerLoadingApp) {
1468
+ if (!this._isBrowserTypeElectron) {
1469
+ switch (template) {
1470
+ case TEMPLATES_LOADING_SKELETON.APPLICATION:
1471
+ case TEMPLATES_LOADING_SKELETON.GRID:
1472
+ return this.getSkeletonTemplateApplication();
1473
+ default:
1474
+ return this.getSkeletonTemplateApplication();
1475
+ }
1476
+ }
1477
+ else {
1478
+ return this.getSpinnerLoadingDefault();
1479
+ }
1480
+ }
1481
+ }
1482
+ getLoadingVisibilityStyle() {
1483
+ return {
1484
+ visibility: this._applicationReady ? "hidden" : "initial",
1485
+ display: this._applicationReady ? "none" : "unset"
1486
+ };
1487
+ }
1488
+ getSkeletonTemplateApplication() {
1489
+ return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "150px", animation: "progress" })), h("div", { class: "ez-flex ez-flex--align-items-stretch skeleton-content" }, h("div", { class: "skeleton-content-left ez-margin--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "calc(100% - 15px)", animation: "progress", marginBottom: "20px" })), h("div", { class: "ez-flex-item--auto skeleton-content-right ez-margin--medium" }, h("ez-skeleton", { count: this.getCountSkeleton("skeleton-content-right", 50, 20), variant: "rect", width: "100%", height: "49px", animation: "progress", marginBottom: "20px" }))), h("div", { class: "skeleton-content-footer ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100px", animation: "progress" }))));
1490
+ }
1491
+ getSpinnerLoadingDefault() {
1492
+ return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner" }, h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), h("span", { class: "ez-title ez-title--secondary ez-title--extra-large" }, "Carregando..."))));
1493
+ }
1379
1494
  render() {
1380
- return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
1495
+ return (h(Host, { style: {
1496
+ visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
1497
+ overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
1498
+ } }, h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true }), this.renderLoadingSkeleton())));
1381
1499
  }
1382
1500
  get _element() { return getElement(this); }
1383
1501
  static get watchers() { return {
@@ -1390,6 +1508,11 @@ class PendingPromise {
1390
1508
  this.reject = reject;
1391
1509
  }
1392
1510
  }
1511
+ var TEMPLATES_LOADING_SKELETON;
1512
+ (function (TEMPLATES_LOADING_SKELETON) {
1513
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
1514
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
1515
+ })(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
1393
1516
  SnkApplication.style = snkApplicationCss;
1394
1517
 
1395
1518
  export { SnkApplication as snk_application };
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-5034df59.js';
4
- import './pesquisa-fetcher-6bc2e41a.js';
3
+ import { D as DataFetcher } from './DataFetcher-5221b992.js';
4
+ import './pesquisa-fetcher-0af41f09.js';
5
5
  import './index-3aa4977a.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
- import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-56cb648b.js';
7
+ import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-8dd93d8b.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-a7d3e277.js';
9
+ import './form-config-fetcher-126e2471.js';
10
10
  import { V as VIEW_MODE } from './constants-7302ee87.js';
11
- import { A as AutorizationType } from './auth-fetcher-ca5d3a49.js';
11
+ import { A as AutorizationType } from './auth-fetcher-e32fe8a4.js';
12
12
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -551,14 +551,18 @@ const buildTaskBarManager = () => {
551
551
  ];
552
552
  return {
553
553
  getButtons: (_, dataState, currentButtons) => {
554
- if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty))
554
+ const refreshBtnIndex = currentButtons.indexOf(TaskbarElement.REFRESH);
555
+ if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty)) {
555
556
  return currentButtons.reverse();
556
- else
557
- currentButtons.splice(currentButtons.indexOf(TaskbarElement.REFRESH), 1);
557
+ }
558
+ else if (refreshBtnIndex !== -1) {
559
+ currentButtons.splice(refreshBtnIndex, 1);
560
+ }
558
561
  const { selectedRecord } = dataState || {};
559
562
  const taskbarTobeAdded = !!(selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.LINK) ? TaskbarAttachButtons.LINK : TaskbarAttachButtons.DOWNLOAD;
560
563
  currentButtons.splice(currentButtons.indexOf(TaskbarElement.DIVIDER) + 1, 0, TaskbarElement.REMOVE, taskbarTobeAdded, TaskbarElement.DIVIDER);
561
- const updatedButtons = Array.from(new Set(currentButtons.filter(button => button !== TaskbarElement.CLONE)));
564
+ const buttonsToRemove = [TaskbarElement.CLONE, TaskbarElement.DATA_EXPORTER];
565
+ const updatedButtons = Array.from(new Set(currentButtons.filter((button) => !buttonsToRemove.includes(button))));
562
566
  updatedButtons.splice(updatedButtons.indexOf(taskbarTobeAdded) + 1, 0, TaskbarElement.DIVIDER);
563
567
  return updatedButtons;
564
568
  },
@@ -3,14 +3,14 @@ import { UserInterface, ObjectUtils, StringUtils, ApplicationContext, ElementIDU
3
3
  import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
4
4
  import { CheckMode, ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { c as VARS_BY_TYPE, D as DEFAULT_TYPE, d as TAGS_BY_TYPE, C as CONFIG_EVENTS, a as CONFIG_SORTABLE_EVENTS, b as TAB_NAMES, A as ACTION_CONFIG } from './constants-7302ee87.js';
6
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-b409c745.js';
6
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-b65e6db0.js';
7
7
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
8
8
  import { S as Sortable } from './Sortable-83960219.js';
9
- import { U as UserConfigType } from './form-config-fetcher-a7d3e277.js';
9
+ import { U as UserConfigType } from './form-config-fetcher-126e2471.js';
10
10
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
11
- import './ConfigStorage-6514d66e.js';
11
+ import './ConfigStorage-373bb440.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './DataFetcher-5034df59.js';
13
+ import './DataFetcher-5221b992.js';
14
14
  import './PrintUtils-3e4ff0f5.js';
15
15
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
16
16
 
@@ -1,17 +1,17 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
4
- import './DataFetcher-5034df59.js';
5
- import './pesquisa-fetcher-6bc2e41a.js';
4
+ import './DataFetcher-5221b992.js';
5
+ import './pesquisa-fetcher-0af41f09.js';
6
6
  import { P as PresentationMode } from './index-3aa4977a.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-56cb648b.js';
10
+ import './dataunit-fetcher-8dd93d8b.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-a7d3e277.js';
12
+ import './form-config-fetcher-126e2471.js';
13
13
  import { V as VIEW_MODE } from './constants-7302ee87.js';
14
- import { A as AutorizationType } from './auth-fetcher-ca5d3a49.js';
14
+ import { A as AutorizationType } from './auth-fetcher-e32fe8a4.js';
15
15
  import './index-bdf75557.js';
16
16
  import './PrintUtils-3e4ff0f5.js';
17
17
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -38,6 +38,8 @@ const SnkCrud = class {
38
38
  this._currentViewMode = VIEW_MODE.GRID;
39
39
  this._canEdit = undefined;
40
40
  this._resourceID = undefined;
41
+ this.enableLockManagerLoadingComp = false;
42
+ this.enableLockManagerTaskbarClick = false;
41
43
  this.configName = undefined;
42
44
  this.filterBarTitle = undefined;
43
45
  this.selectionToastConfig = undefined;
@@ -59,7 +61,6 @@ const SnkCrud = class {
59
61
  this.enableGridInsert = false;
60
62
  this.domainMessagesBuilder = undefined;
61
63
  this.ignoreReadOnlyFormFields = undefined;
62
- this.enableLockManger = false;
63
64
  this.setCustomFormTitle = undefined;
64
65
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
65
66
  }
@@ -406,7 +407,7 @@ const SnkCrud = class {
406
407
  return;
407
408
  }
408
409
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
409
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, 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 }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
410
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, 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 }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
410
411
  }
411
412
  get _element() { return getElement(this); }
412
413
  static get watchers() { return {