@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
@@ -3,15 +3,15 @@ import { ApplicationContext, ObjectUtils, UserInterface, DataType, ElementIDUtil
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-3aa4977a.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-7302ee87.js';
6
- import { D as DataFetcher } from './DataFetcher-5034df59.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-9fa7d2b9.js';
8
- import './pesquisa-fetcher-6bc2e41a.js';
6
+ import { D as DataFetcher } from './DataFetcher-5221b992.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-11a49fc3.js';
8
+ import './pesquisa-fetcher-0af41f09.js';
9
9
  import './ISave-d8c8bc59.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import './dataunit-fetcher-56cb648b.js';
12
+ import './dataunit-fetcher-8dd93d8b.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import './form-config-fetcher-a7d3e277.js';
14
+ import './form-config-fetcher-126e2471.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
16
  import './SnkMessageBuilder-6fff4a4c.js';
17
17
  import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
@@ -250,7 +250,7 @@ function getFormatResponse(result) {
250
250
  return ObjectUtils.stringToObject(response);
251
251
  }
252
252
 
253
- const DOC_MAX_WIDTH = 800;
253
+ const DOC_MAX_WIDTH = 760;
254
254
  function getVisibleColumns(columns) {
255
255
  const visibleColumns = [];
256
256
  let totalWidth = 0;
@@ -290,12 +290,19 @@ class ServerSideExporterStrategy {
290
290
  const visibleColumns = getVisibleColumns(columns);
291
291
  return visibleColumns;
292
292
  }
293
+ async getColumns(resolveProps) {
294
+ var _a;
295
+ if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
296
+ return await this.getParsedColumns();
297
+ }
298
+ return await this._provider.getColumnsMetadata();
299
+ }
293
300
  async getParams(resolveProps) {
294
- var _a, _b, _c, _d, _e, _f, _g;
301
+ var _a, _b, _c, _d, _e, _f;
295
302
  const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
296
- const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
297
- const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
298
- const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
303
+ const columns = await this.getColumns(resolveProps);
304
+ const sort = (_d = (_c = this._provider).getOrders) === null || _d === void 0 ? void 0 : _d.call(_c);
305
+ const resourceURI = (_f = (_e = this._provider).getResourceURI) === null || _f === void 0 ? void 0 : _f.call(_e);
299
306
  const selectedIDs = this._provider.getSelectedIDs();
300
307
  const option = resolveProps.exportOption;
301
308
  const currentPageOptions = [
@@ -349,11 +356,17 @@ class ClientSideExporterStrategy {
349
356
  const visibleColumns = getVisibleColumns(columns);
350
357
  return visibleColumns;
351
358
  }
352
- async executeExport(resolveProps) {
359
+ async getColumns(resolveProps) {
353
360
  var _a;
361
+ if ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) {
362
+ return await this.getParsedColumns();
363
+ }
364
+ return await this._provider.getColumnsMetadata();
365
+ }
366
+ async executeExport(resolveProps) {
354
367
  const { methodName, gridTitle } = resolveProps;
355
368
  const records = await this._provider.getRecords();
356
- const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
369
+ const columns = await this.getColumns(resolveProps);
357
370
  const [serviceName, processor] = this.getExecutor(methodName);
358
371
  const payload = {
359
372
  serviceName,
@@ -390,10 +403,10 @@ class ClientSideExporterStrategy {
390
403
  "GridXLSBuilderSP.buildXLSFromJson",
391
404
  responseBody => ({
392
405
  fileSessionKey: responseBody.chaveXLS.valor,
393
- canPrint: false,
394
- canExport: false,
406
+ canPrint: true,
407
+ canExport: true,
408
+ canSendEmail: true,
395
409
  useAppPrint: false,
396
- canSendEmail: false
397
410
  })
398
411
  ];
399
412
  }
@@ -553,7 +566,6 @@ const SnkDataExporter = class {
553
566
  var _a, _b, _c;
554
567
  const optionKey = this.getOptionKey(option);
555
568
  const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
556
- const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
557
569
  const params = {
558
570
  methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
559
571
  fileName: this._appLabel,
@@ -564,8 +576,7 @@ const SnkDataExporter = class {
564
576
  };
565
577
  await this.resolveExporter(params, (response) => {
566
578
  if (response.canExport || fileType === DataExporterType.EXPORT_TO_PDF) {
567
- fileViewer(Object.assign(Object.assign({}, response), { fileType,
568
- isDownload }));
579
+ fileViewer(Object.assign(Object.assign({}, response), { fileType }));
569
580
  }
570
581
  else {
571
582
  ApplicationUtils.error(this.getMessage("snkDataExporter.title.permission"), this.getMessage("snkDataExporter.message.exportPermission"));
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host
2
2
  import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
5
- import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-56cb648b.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-8dd93d8b.js';
6
6
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
7
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
8
8
 
@@ -1,10 +1,10 @@
1
- export { S as snk_data_unit } from './snk-data-unit-9fa7d2b9.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-11a49fc3.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import './SnkMessageBuilder-6fff4a4c.js';
6
- import './dataunit-fetcher-56cb648b.js';
7
- import './DataFetcher-5034df59.js';
6
+ import './dataunit-fetcher-8dd93d8b.js';
7
+ import './DataFetcher-5221b992.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -1,21 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-b409c745.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-b65e6db0.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import './DataFetcher-5034df59.js';
6
- import './pesquisa-fetcher-6bc2e41a.js';
5
+ import './DataFetcher-5221b992.js';
6
+ import './pesquisa-fetcher-0af41f09.js';
7
7
  import { P as PresentationMode } from './index-3aa4977a.js';
8
8
  import './ISave-d8c8bc59.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-56cb648b.js';
11
+ import './dataunit-fetcher-8dd93d8b.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-a7d3e277.js';
13
+ import './form-config-fetcher-126e2471.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
15
15
  import { V as VIEW_MODE } from './constants-7302ee87.js';
16
- import { S as SnkGuidesViewer } from './snk-guides-viewer-b7ed39eb.js';
16
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-830f5fb9.js';
17
17
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
18
- import './ConfigStorage-6514d66e.js';
18
+ import './ConfigStorage-373bb440.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
- import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, FloatingManager, DateUtils, MaskFormatter, ArrayUtils } from '@sankhyalabs/core';
2
+ import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation, FloatingManager, DateUtils, MaskFormatter, ArrayUtils } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
@@ -10,8 +10,8 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
10
10
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
11
11
  import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
12
12
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
13
- import './form-config-fetcher-a7d3e277.js';
14
- import './DataFetcher-5034df59.js';
13
+ import './form-config-fetcher-126e2471.js';
14
+ import './DataFetcher-5221b992.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
16
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
17
17
 
@@ -262,6 +262,7 @@ const SnkFilterBar = class {
262
262
  this._firstLoad = true;
263
263
  this._pendingVariables = false;
264
264
  this._customfiltersToBeUpdated = [];
265
+ this._resolveLoading = undefined;
265
266
  this._calculateSortIndex = (item) => {
266
267
  if (!item.visible)
267
268
  return 0;
@@ -275,6 +276,7 @@ const SnkFilterBar = class {
275
276
  this._filtersComparator = (a, b) => {
276
277
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
277
278
  };
279
+ this.enableLockManagerLoadingComp = false;
278
280
  this.customFilterBarConfig = undefined;
279
281
  this.dataUnit = undefined;
280
282
  this.title = undefined;
@@ -695,14 +697,26 @@ const SnkFilterBar = class {
695
697
  this.personalizedFilterId = undefined;
696
698
  this.showPersonalizedFilter = false;
697
699
  }
698
- componentWillLoad() {
699
- this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
700
- if (this._application) {
701
- this.loadPermitions();
702
- this.addFilterBarLegacyConfigName();
703
- this.loadConfigFromStorage();
700
+ async componentWillLoad() {
701
+ var _a;
702
+ try {
703
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
704
+ await this.attachDataUnit();
705
+ if (this._application) {
706
+ if (this._application.enableLockManagerLoadingApp && this.enableLockManagerLoadingComp) {
707
+ const appLoadLockerID = LockManager.addLockManagerCtxId(this._element);
708
+ this._resolveLoading = LockManager.lock(appLoadLockerID, LockManagerOperation.APP_LOADING);
709
+ }
710
+ await Promise.all([
711
+ this.loadPermitions(),
712
+ this.addFilterBarLegacyConfigName(),
713
+ this.loadConfigFromStorage(),
714
+ ]);
715
+ }
716
+ }
717
+ finally {
718
+ (_a = this._resolveLoading) === null || _a === void 0 ? void 0 : _a.call(this);
704
719
  }
705
- this.attachDataUnit();
706
720
  }
707
721
  componentDidRender() {
708
722
  this.processPendingFilter();
@@ -1315,7 +1329,9 @@ const SnkFilterModal = class {
1315
1329
  this.filters = ObjectUtils.copy(filterListCopy);
1316
1330
  return;
1317
1331
  }
1318
- this.filters.find(filter => filter.id === filterItem.id).value = undefined;
1332
+ const filter = this.filters.find(filter => filter.id === filterItem.id);
1333
+ filter.value = undefined;
1334
+ this.filters = ObjectUtils.copy(this.filters);
1319
1335
  }
1320
1336
  uncheckFilterValues(valueList) {
1321
1337
  valueList.forEach(value => {
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-a7d3e277.js';
8
- import './DataFetcher-5034df59.js';
7
+ import './form-config-fetcher-126e2471.js';
8
+ import './DataFetcher-5221b992.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -1,20 +1,20 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
4
- import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
5
5
  import { P as PresentationMode } from './index-3aa4977a.js';
6
6
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-b62906f9.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-25e7bd9a.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
- import './DataFetcher-5034df59.js';
11
- import './pesquisa-fetcher-6bc2e41a.js';
10
+ import './DataFetcher-5221b992.js';
11
+ import './pesquisa-fetcher-0af41f09.js';
12
12
  import './ISave-d8c8bc59.js';
13
13
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
- import './dataunit-fetcher-56cb648b.js';
15
+ import './dataunit-fetcher-8dd93d8b.js';
16
16
  import './filter-item-type.enum-d45e026f.js';
17
- import './form-config-fetcher-a7d3e277.js';
17
+ import './form-config-fetcher-126e2471.js';
18
18
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
20
20
  import './PrintUtils-3e4ff0f5.js';
@@ -119,6 +119,8 @@ const SnkGrid = class {
119
119
  this._showSnkFilterBar = true;
120
120
  this._enableContinuousInsert = false;
121
121
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
122
+ this.enableLockManagerLoadingComp = false;
123
+ this.enableLockManagerTaskbarClick = false;
122
124
  this.configName = undefined;
123
125
  this.filterBarTitle = undefined;
124
126
  this.resourceID = undefined;
@@ -142,7 +144,6 @@ const SnkGrid = class {
142
144
  this.autoLoad = undefined;
143
145
  this.autoFocus = true;
144
146
  this.enableGridInsert = false;
145
- this.enableLockManger = false;
146
147
  this.outlineMode = false;
147
148
  }
148
149
  /**
@@ -532,7 +533,7 @@ const SnkGrid = class {
532
533
  return undefined;
533
534
  }
534
535
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
535
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
536
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
536
537
  }
537
538
  get _element() { return getElement(this); }
538
539
  static get watchers() { return {
@@ -1,19 +1,19 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
2
  import { Action, ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-b409c745.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-b65e6db0.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-f8b1d91e.js';
6
6
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
7
7
  import { V as VIEW_MODE } from './constants-7302ee87.js';
8
- import './DataFetcher-5034df59.js';
9
- import './pesquisa-fetcher-6bc2e41a.js';
8
+ import './DataFetcher-5221b992.js';
9
+ import './pesquisa-fetcher-0af41f09.js';
10
10
  import { P as PresentationMode } from './index-3aa4977a.js';
11
11
  import './ISave-d8c8bc59.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
- import './dataunit-fetcher-56cb648b.js';
14
+ import './dataunit-fetcher-8dd93d8b.js';
15
15
  import './filter-item-type.enum-d45e026f.js';
16
- import './form-config-fetcher-a7d3e277.js';
16
+ import './form-config-fetcher-126e2471.js';
17
17
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
18
18
 
19
19
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
@@ -1,10 +1,10 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-b7ed39eb.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-830f5fb9.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
- import './SnkFormConfigManager-b409c745.js';
5
- import './ConfigStorage-6514d66e.js';
6
- import './form-config-fetcher-a7d3e277.js';
7
- import './DataFetcher-5034df59.js';
4
+ import './SnkFormConfigManager-b65e6db0.js';
5
+ import './ConfigStorage-373bb440.js';
6
+ import './form-config-fetcher-126e2471.js';
7
+ import './DataFetcher-5221b992.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
@@ -14,10 +14,10 @@ import './field-search-f8b1d91e.js';
14
14
  import './taskbar-elements-d59867f1.js';
15
15
  import './index-3aa4977a.js';
16
16
  import './index-bdf75557.js';
17
- import './pesquisa-fetcher-6bc2e41a.js';
17
+ import './pesquisa-fetcher-0af41f09.js';
18
18
  import './ISave-d8c8bc59.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
20
- import './dataunit-fetcher-56cb648b.js';
20
+ import './dataunit-fetcher-8dd93d8b.js';
21
21
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
22
22
  import '@sankhyalabs/core/dist/utils/SortingUtils';
23
23
  import './ResourceIDUtils-a114189a.js';
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
4
- import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-6514d66e.js';
4
+ import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-373bb440.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { a as FilterGroupCondition } from './index-ae591a44.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-a7d3e277.js';
10
- import './DataFetcher-5034df59.js';
9
+ import './form-config-fetcher-126e2471.js';
10
+ import './DataFetcher-5221b992.js';
11
11
  import './PrintUtils-3e4ff0f5.js';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
13
 
@@ -1,7 +1,21 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ObjectUtils, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
+ import { P as PesquisaFetcher, b as buildGridMetadata } from './pesquisa-fetcher-0af41f09.js';
4
+ import './DataFetcher-5221b992.js';
5
+ import './index-3aa4977a.js';
6
+ import './ISave-d8c8bc59.js';
7
+ import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
+ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
+ import './dataunit-fetcher-8dd93d8b.js';
10
+ import './filter-item-type.enum-d45e026f.js';
11
+ import './form-config-fetcher-126e2471.js';
12
+ import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
13
+ import './PrintUtils-3e4ff0f5.js';
14
+ import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
15
+ import '@sankhyalabs/core/dist/utils/SortingUtils';
16
+ import './ResourceIDUtils-a114189a.js';
3
17
 
4
- const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
18
+ const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
5
19
 
6
20
  const SnkPesquisa = class {
7
21
  constructor(hostRef) {
@@ -15,11 +29,18 @@ const SnkPesquisa = class {
15
29
  this._changeDeboucingTimeout = null;
16
30
  this._limitCharsToSearch = 3;
17
31
  this._deboucingTime = 450;
32
+ this._gridDataSource = [];
33
+ this.pesquisaFetcher = new PesquisaFetcher();
18
34
  this._itemList = undefined;
19
35
  this._startLoading = false;
36
+ this._presentationMode = "list";
20
37
  this.searchLoader = undefined;
38
+ this.treeLoader = undefined;
21
39
  this.selectItem = undefined;
40
+ this.entityName = undefined;
22
41
  this.argument = undefined;
42
+ this.isHierarchyEntity = false;
43
+ this.allowsNonAnalytic = false;
23
44
  }
24
45
  observeArgument() {
25
46
  if (this._textInput) {
@@ -57,36 +78,42 @@ const SnkPesquisa = class {
57
78
  this._startLoading = true;
58
79
  this.searchLoader(argument)
59
80
  .then((resp) => {
81
+ if (!resp)
82
+ return;
83
+ this.processSearchResponse(resp);
84
+ }).finally(() => {
60
85
  this._startLoading = false;
61
- if (resp) {
62
- resp = ObjectUtils.stringToObject(resp.json.$);
63
- let descriptionField = resp.descriptionField;
64
- let pkField = resp.pkField;
65
- if (pkField) {
66
- let newItemList = [];
67
- resp.data.forEach((item) => {
68
- var _a;
69
- let fieldsMetadata = this.filterFieldsMetadata(resp, item);
70
- let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
71
- let exibitionItem = {
72
- key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
73
- title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : "",
74
- details: this.buildDetails(fields, item)
75
- };
76
- newItemList.push(exibitionItem);
77
- });
78
- this._itemList = newItemList;
79
- }
80
- }
81
- }).catch((error) => {
82
- this._startLoading = false;
83
- this._itemList = [];
84
- console.warn(error);
85
86
  });
86
87
  }
87
88
  }
89
+ processSearchResponse(resp) {
90
+ resp = ObjectUtils.stringToObject(resp.json.$);
91
+ let descriptionField = resp.descriptionField;
92
+ let pkField = resp.pkField;
93
+ if (!pkField)
94
+ return;
95
+ this._gridMetadata = buildGridMetadata(resp);
96
+ this._gridDataSource = [...resp.data];
97
+ this._pkField = pkField;
98
+ this._descriptionField = descriptionField;
99
+ this._itemList = this.buildCardItemList(resp, pkField, descriptionField);
100
+ }
101
+ buildCardItemList(resp, pkField, descriptionField) {
102
+ var _a;
103
+ let newItemList = (_a = resp.data) === null || _a === void 0 ? void 0 : _a.map((item) => {
104
+ var _a;
105
+ let fieldsMetadata = this.filterFieldsMetadata(resp, item);
106
+ let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
107
+ return {
108
+ key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
109
+ title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : '',
110
+ details: this.buildDetails(fields, item),
111
+ };
112
+ });
113
+ return newItemList;
114
+ }
88
115
  filterFieldsMetadata(resp, item) {
89
- let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
116
+ return resp.fieldsMetadata.filter((field) => {
90
117
  let accept = !StringUtils.isEmpty(item[field.fieldName]) &&
91
118
  field.visible !== false &&
92
119
  field.type !== 'B' &&
@@ -103,7 +130,6 @@ const SnkPesquisa = class {
103
130
  }
104
131
  return accept;
105
132
  });
106
- return fieldsMetadata;
107
133
  }
108
134
  removeAtIndex(array, index) {
109
135
  if (index >= 0 && index < array.length) {
@@ -261,6 +287,7 @@ const SnkPesquisa = class {
261
287
  this.selectItem(option);
262
288
  }
263
289
  onChangeValue(event) {
290
+ var _a;
264
291
  this.clearDeboucingTimeout();
265
292
  if (this._startLoading) {
266
293
  this._changeDeboucingTimeout = setTimeout(() => {
@@ -269,6 +296,10 @@ const SnkPesquisa = class {
269
296
  return;
270
297
  }
271
298
  this.argument = (event.detail || "").trim();
299
+ if (this.isHierarchyEntity && this._presentationMode === 'list') {
300
+ (_a = this._pesquisaTree) === null || _a === void 0 ? void 0 : _a.applyFilter();
301
+ return;
302
+ }
272
303
  const argumentNumber = this.getArgumentNumber();
273
304
  if (this.argument && (!isNaN(argumentNumber) || this.argument.length >= this._limitCharsToSearch)) {
274
305
  this._changeDeboucingTimeout = setTimeout(() => {
@@ -299,16 +330,59 @@ const SnkPesquisa = class {
299
330
  : 'Nenhum registro encontrado'
300
331
  : 'Os resultados de sua pesquisa aparecerão aqui...';
301
332
  }
302
- componentDidLoad() {
333
+ async componentWillLoad() {
334
+ const mode = await this.pesquisaFetcher.loadPresentationConfig(this.entityName);
335
+ this._presentationMode = mode === 'list' ? 'list' : 'table';
336
+ }
337
+ async componentDidLoad() {
303
338
  ElementIDUtils.addIDInfo(this._element);
304
339
  }
340
+ async onClickList() {
341
+ this._presentationMode = this._presentationMode === 'list' ? 'table' : 'list';
342
+ await this.pesquisaFetcher.savePresentationConfig(this.entityName, this._presentationMode);
343
+ }
344
+ enableListButton() {
345
+ var _a;
346
+ return ((_a = this._itemList) === null || _a === void 0 ? void 0 : _a.length) > 0;
347
+ }
348
+ //Os limites de exibição são diferentes para lista e grade
349
+ hideLimitMessage() {
350
+ if (!this._itemList)
351
+ return true;
352
+ if (this._presentationMode === "list") {
353
+ if (this.isHierarchyEntity)
354
+ return true;
355
+ return this._itemList.length <= 100;
356
+ }
357
+ return this._itemList.length <= 150;
358
+ }
359
+ hideRecordsMessage() {
360
+ return (this._presentationMode === "list" && this.isHierarchyEntity);
361
+ }
362
+ renderContent() {
363
+ if (!this._itemList)
364
+ return;
365
+ if (this._presentationMode === 'list') {
366
+ return this.isHierarchyEntity ? this.renderTree() : this.renderCards();
367
+ }
368
+ return this.renderPesquisaGrid();
369
+ }
370
+ renderTree() {
371
+ return h("ez-scroller", { direction: EzScrollDirection.VERTICAL }, h("pesquisa-tree", { ref: (element) => this._pesquisaTree = element, argument: this.argument, treeLoader: this.treeLoader, allowsNonAnalytic: this.allowsNonAnalytic, onPesquisaTreeSelectItem: ({ detail }) => this.selectItem(detail) }));
372
+ }
373
+ renderCards() {
374
+ return (h("ez-scroller", { direction: EzScrollDirection.VERTICAL }, h("div", { class: "snk-pesquisa__cards-container" }, this._itemList.map((item) => {
375
+ return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
376
+ }))));
377
+ }
378
+ renderPesquisaGrid() {
379
+ return h("pesquisa-grid", { metadata: this._gridMetadata, dataSource: this._gridDataSource, pkField: this._pkField, descriptionField: this._descriptionField, entityName: this.entityName, onPesquisaGridSelectItem: ({ detail }) => this.selectItem(detail) });
380
+ }
305
381
  render() {
306
382
  var _a;
307
383
  return (h(Host, null, h("div", { class: "snk-pesquisa" }, h("div", { class: "snk-pesquisa__input" }, h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument, "data-element-id": "searchInput" }, h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
308
384
  ? h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
309
- : undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })), h("label", { class: "snk-pesquisa__records" }, this.getMessageView()), h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
310
- return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
311
- })))));
385
+ : undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() }), h("ez-button", { class: "ez-margin-left--medium", mode: "icon", iconName: this._presentationMode === 'list' ? 'table' : 'list', title: this._presentationMode === 'list' ? 'Modo grade' : 'Modo lista', onClick: async () => await this.onClickList(), enabled: this.enableListButton() })), h("div", { class: "snk-pesquisa__records-label" }, h("label", { class: `snk-pesquisa__records ${this.hideRecordsMessage() ? "hidden" : ""}` }, this.getMessageView()), h("label", { class: `snk-pesquisa__records-limit ${this.hideLimitMessage() ? "hidden" : ""}` }, "Essa pesquisa foi limitada, existem mais resultados.")), h("div", { class: "snk-pesquisa__content" }, this.renderContent()))));
312
386
  }
313
387
  get _element() { return getElement(this); }
314
388
  static get watchers() { return {