@sankhyalabs/sankhyablocks 10.1.0-dev.2 → 10.1.0-dev.4

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 (120) hide show
  1. package/dist/cjs/{ConfigStorage-5a73e979.js → ConfigStorage-b29e31be.js} +2 -2
  2. package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-ed9d97ea.js} +1 -1
  3. package/dist/cjs/{ISave-861e9d6d.js → ISave-81eb2fbc.js} +4 -4
  4. package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-6838389c.js} +2 -2
  5. package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-1e804147.js} +4 -4
  6. package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-cc28d847.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-ab1cc071.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-f0897eb5.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -5
  13. package/dist/cjs/snk-application.cjs.entry.js +81 -69
  14. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-crud.cjs.entry.js +90 -6
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  17. package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-68992932.js} +2 -2
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  20. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  22. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  23. package/dist/cjs/snk-grid.cjs.entry.js +12 -9
  24. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-8b841753.js} +6 -6
  25. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  27. package/dist/cjs/snk-pesquisa.cjs.entry.js +17 -5
  28. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  29. package/dist/cjs/snk-taskbar.cjs.entry.js +8 -4
  30. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
  31. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
  32. package/dist/collection/components/snk-application/snk-application.js +87 -44
  33. package/dist/collection/components/snk-crud/snk-crud.js +106 -2
  34. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  35. package/dist/collection/components/snk-grid/snk-grid.js +26 -4
  36. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
  37. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +47 -0
  38. package/dist/collection/components/snk-taskbar/snk-taskbar.js +29 -4
  39. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
  40. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
  41. package/dist/components/DataFetcher.js +1 -1
  42. package/dist/components/ISave.js +3 -3
  43. package/dist/components/snk-application2.js +76 -63
  44. package/dist/components/snk-crud.js +88 -1
  45. package/dist/components/snk-detail-view2.js +1 -1
  46. package/dist/components/snk-grid2.js +8 -3
  47. package/dist/components/snk-pesquisa2.js +15 -2
  48. package/dist/components/snk-taskbar2.js +9 -4
  49. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-13d80e36.js} +2 -2
  50. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-f4ccd9f3.js} +1 -1
  51. package/dist/esm/{ISave-345481c1.js → ISave-288fa9df.js} +4 -4
  52. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-3ee2937b.js} +2 -2
  53. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-5d3a93f2.js} +4 -4
  54. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-59ab0c67.js} +1 -1
  55. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-c4f9f222.js} +1 -1
  56. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-6a00fe9e.js} +1 -1
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  59. package/dist/esm/sankhyablocks.js +1 -1
  60. package/dist/esm/snk-actions-button_9.entry.js +5 -5
  61. package/dist/esm/snk-application.entry.js +81 -69
  62. package/dist/esm/snk-attach.entry.js +5 -5
  63. package/dist/esm/snk-crud.entry.js +90 -6
  64. package/dist/esm/snk-data-exporter.entry.js +5 -5
  65. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-0edeb967.js} +2 -2
  66. package/dist/esm/snk-data-unit.entry.js +3 -3
  67. package/dist/esm/snk-detail-view.entry.js +7 -7
  68. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  69. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  70. package/dist/esm/snk-form_2.entry.js +4 -4
  71. package/dist/esm/snk-grid.entry.js +12 -9
  72. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-9cd4d20f.js} +6 -6
  73. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  74. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  75. package/dist/esm/snk-pesquisa.entry.js +17 -5
  76. package/dist/esm/snk-simple-crud.entry.js +7 -7
  77. package/dist/esm/snk-taskbar.entry.js +8 -4
  78. package/dist/sankhyablocks/{p-9fe91526.js → p-0e279e7a.js} +1 -1
  79. package/dist/sankhyablocks/{p-164c822d.entry.js → p-1858c023.entry.js} +1 -1
  80. package/dist/sankhyablocks/{p-1d585081.js → p-1c2971e4.js} +1 -1
  81. package/dist/sankhyablocks/{p-27005fac.entry.js → p-26e0f63c.entry.js} +1 -1
  82. package/dist/sankhyablocks/{p-bb0de89c.entry.js → p-34df7eca.entry.js} +1 -1
  83. package/dist/sankhyablocks/p-34f447ba.entry.js +1 -0
  84. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-38e56b68.entry.js} +1 -1
  85. package/dist/sankhyablocks/{p-1649f51e.entry.js → p-3abeeefa.entry.js} +1 -1
  86. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-3d021bef.entry.js} +1 -1
  87. package/dist/sankhyablocks/{p-e64958ba.entry.js → p-44939a0e.entry.js} +1 -1
  88. package/dist/sankhyablocks/{p-88ed2793.js → p-5304753a.js} +2 -2
  89. package/dist/sankhyablocks/{p-e8c49c12.js → p-53599b26.js} +2 -2
  90. package/dist/sankhyablocks/p-557368df.entry.js +1 -0
  91. package/dist/sankhyablocks/p-583151c5.entry.js +1 -0
  92. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-6180de07.entry.js} +1 -1
  93. package/dist/sankhyablocks/{p-1788d191.js → p-78ff8734.js} +1 -1
  94. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-80014119.entry.js} +1 -1
  95. package/dist/sankhyablocks/{p-7fc46290.js → p-9317942f.js} +1 -1
  96. package/dist/sankhyablocks/p-a2ed1ebd.entry.js +1 -0
  97. package/dist/sankhyablocks/{p-0cf9aa38.js → p-a644a956.js} +1 -1
  98. package/dist/sankhyablocks/p-ae108ffd.entry.js +11 -0
  99. package/dist/sankhyablocks/{p-9f2cdaab.entry.js → p-b4322b87.entry.js} +1 -1
  100. package/dist/sankhyablocks/{p-6d241415.js → p-bb2f5f38.js} +1 -1
  101. package/dist/sankhyablocks/{p-626b7a17.js → p-d9c54991.js} +1 -1
  102. package/dist/sankhyablocks/p-dc851b6e.entry.js +1 -0
  103. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-e9021f79.entry.js} +1 -1
  104. package/dist/sankhyablocks/{p-59b8f277.js → p-f15478a1.js} +1 -1
  105. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  106. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
  107. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  108. package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
  109. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  110. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +9 -0
  111. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -1
  112. package/dist/types/components.d.ts +39 -0
  113. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  114. package/package.json +1 -1
  115. package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
  116. package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
  117. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  118. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  119. package/dist/sankhyablocks/p-af9d79e0.entry.js +0 -1
  120. package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
@@ -5,15 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const ConfigStorage = require('./ConfigStorage-5a73e979.js');
9
- const DataFetcher = require('./DataFetcher-eeb3b0b7.js');
10
- const authFetcher = require('./auth-fetcher-8d8acd69.js');
11
- const dataunitFetcher = require('./dataunit-fetcher-1cea0695.js');
12
- const ISave = require('./ISave-861e9d6d.js');
8
+ const ConfigStorage = require('./ConfigStorage-b29e31be.js');
9
+ const DataFetcher = require('./DataFetcher-ed9d97ea.js');
10
+ const authFetcher = require('./auth-fetcher-cc28d847.js');
11
+ const dataunitFetcher = require('./dataunit-fetcher-ab1cc071.js');
12
+ const ISave = require('./ISave-81eb2fbc.js');
13
13
  const constants = require('./constants-6d82e405.js');
14
14
  require('./index-e3e39724.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
- const formConfigFetcher = require('./form-config-fetcher-f347f884.js');
16
+ const formConfigFetcher = require('./form-config-fetcher-f0897eb5.js');
17
17
  require('./PrintUtils-bcaeb82f.js');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
19
19
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -393,32 +393,40 @@ class RequestListenerFactory {
393
393
  }
394
394
  }
395
395
 
396
+ const executeAdvancedModeSearch = async (argument, options, app, pesquisaFetcher) => {
397
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, executeOnOpen } = options;
398
+ return new Promise((accept, reject) => {
399
+ const pesquisaContent = document.createElement("snk-pesquisa");
400
+ pesquisaContent[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
401
+ pesquisaContent.entityName = entity;
402
+ pesquisaContent.argument = argument;
403
+ pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
404
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
405
+ if (isHierarchyEntity) {
406
+ pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
407
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
408
+ }
409
+ pesquisaContent.selectItem = (option) => {
410
+ accept(option);
411
+ app.clearPopUpTitle();
412
+ app.closePopUp();
413
+ };
414
+ app.setPopUpTitle(entityDescription);
415
+ app.showPopUp(pesquisaContent, undefined, undefined, reject);
416
+ if (executeOnOpen) {
417
+ pesquisaContent.executeSearch(argument);
418
+ }
419
+ });
420
+ };
421
+
396
422
  const QTD_DETAIL_FIELDS_PREDICTIVE_SEARCH = 6;
397
423
  const INVALID_CONTENT_PATTERNS = ['<img', '<svg'];
398
424
  const executePreparedSearchPlus = async (mode, argument, options, app, pesquisaFetcher) => {
399
425
  var _a;
400
426
  const mdByName = {};
401
- const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
427
+ const { entity, criteria, searchOptions } = options;
402
428
  if (mode === "ADVANCED") {
403
- return new Promise((accept, reject) => {
404
- const pesquisaContent = document.createElement("snk-pesquisa");
405
- pesquisaContent[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
406
- pesquisaContent.entityName = entity;
407
- pesquisaContent.argument = argument;
408
- pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
409
- pesquisaContent.isHierarchyEntity = isHierarchyEntity;
410
- if (isHierarchyEntity) {
411
- pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
412
- pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
413
- }
414
- pesquisaContent.selectItem = (option) => {
415
- accept(option);
416
- app.clearPopUpTitle();
417
- app.closePopUp();
418
- };
419
- app.setPopUpTitle(entityDescription);
420
- app.showPopUp(pesquisaContent, undefined, undefined, reject);
421
- });
429
+ return executeAdvancedModeSearch(argument, options, app, pesquisaFetcher);
422
430
  }
423
431
  else if (mode === "LOAD_DESCRIPTION") {
424
432
  let result = await pesquisaFetcher.loadByCode(entity, argument, criteria, searchOptions);
@@ -455,14 +463,13 @@ const buildOptionItem = (argument, item, fields, descriptionField, pkField) => {
455
463
  const matchFields = item['__matchFields'];
456
464
  const descriptionValue = (_a = item[descriptionField]) !== null && _a !== void 0 ? _a : "";
457
465
  const pkValue = item[pkField];
458
- let searchOption = {
466
+ return {
459
467
  value: pkValue,
460
468
  label: descriptionValue,
461
469
  presentationValue: core.StringUtils.highlightValue(argument, matchFields, pkValue, fields, true),
462
470
  presentationLabel: descriptionField ? core.StringUtils.highlightValue(argument, matchFields, descriptionValue, fields, true) : "",
463
471
  details: core.SearchUtils.buildDetails(argument, fields, item)
464
472
  };
465
- return searchOption;
466
473
  };
467
474
  const filterInvalidFields = (resp, item, mdByName) => {
468
475
  let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
@@ -897,7 +904,7 @@ const SnkApplication = class {
897
904
  if (this._featureFlagsCache.get(featureName) && now < this._featureFlagsCache.get(featureName).expires) {
898
905
  return Promise.resolve(this._featureFlagsCache.get(featureName).isActive);
899
906
  }
900
- //Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
907
+ //Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
901
908
  const result = await DataFetcher.DataFetcher.get().callServiceBroker("SystemUtilsSP.featureIsActive", JSON.stringify(payload));
902
909
  const isActive = result.isActive;
903
910
  this._featureFlagsCache.set(featureName, {
@@ -1388,52 +1395,57 @@ const SnkApplication = class {
1388
1395
  */
1389
1396
  async executePreparedSearch(mode, argument, options) {
1390
1397
  const mdByName = {};
1391
- const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, useSearchPlus } = options;
1398
+ const { entity, criteria, searchOptions, useSearchPlus } = options;
1392
1399
  if (useSearchPlus) {
1393
1400
  return executePreparedSearchPlus(mode, argument, options, this, this.pesquisaFetcher);
1394
1401
  }
1395
1402
  if (mode === "ADVANCED") {
1396
- return new Promise((accept, reject) => {
1397
- const pesquisaContent = document.createElement("snk-pesquisa");
1398
- pesquisaContent[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
1399
- pesquisaContent.entityName = entity;
1400
- pesquisaContent.argument = argument;
1401
- pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
1402
- pesquisaContent.isHierarchyEntity = isHierarchyEntity;
1403
- if (isHierarchyEntity) {
1404
- pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
1405
- pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
1406
- }
1407
- pesquisaContent.selectItem = (option) => {
1408
- accept(option);
1409
- this.clearPopUpTitle();
1410
- this.closePopUp();
1411
- };
1412
- this.setPopUpTitle(entityDescription);
1413
- this.showPopUp(pesquisaContent, undefined, undefined, reject);
1414
- });
1403
+ return executeAdvancedModeSearch(argument, options, this, this.pesquisaFetcher);
1415
1404
  }
1416
- else {
1417
- return new Promise((resolve, reject) => {
1418
- this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1419
- .then(result => {
1420
- result = core.ObjectUtils.stringToObject(result.json.$);
1421
- let descriptionField = result.descriptionField;
1422
- let pkField = result.pkField;
1423
- const list = [];
1424
- result.data.forEach((item) => {
1425
- let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
1426
- let qtyFields = 6;
1427
- let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
1428
- list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
1429
- });
1430
- resolve(list);
1431
- })
1432
- .catch(error => {
1433
- reject(error);
1434
- });
1405
+ return new Promise((resolve, reject) => {
1406
+ this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1407
+ .then(result => {
1408
+ result = core.ObjectUtils.stringToObject(result.json.$);
1409
+ resolve(this.buildSearchResultList(result, mdByName, argument));
1410
+ })
1411
+ .catch(error => {
1412
+ reject(error);
1435
1413
  });
1436
- }
1414
+ });
1415
+ }
1416
+ /**
1417
+ * Obtém as opções em componentes de pesquisa além dos metadados como showMore e entityPk.
1418
+ * @param {string} argument - O argumento da pesquisa.
1419
+ * @param {any} options - Opções preparadas para a pesquisa.
1420
+ * @returns {Promise<Array<IOption> | IOption>} Uma lista de opções ou uma única opção.
1421
+ * @async
1422
+ */
1423
+ async executePreparedSearchWithFullResponse(argument, options) {
1424
+ const mdByName = {};
1425
+ const { entity, criteria, searchOptions } = options;
1426
+ return new Promise((resolve, reject) => {
1427
+ this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1428
+ .then(result => {
1429
+ result = core.ObjectUtils.stringToObject(result.json.$);
1430
+ result.data = this.buildSearchResultList(result, mdByName, argument);
1431
+ resolve(result);
1432
+ })
1433
+ .catch(error => {
1434
+ reject(error);
1435
+ });
1436
+ });
1437
+ }
1438
+ buildSearchResultList(result, mdByName, argument) {
1439
+ let descriptionField = result.descriptionField;
1440
+ let pkField = result.pkField;
1441
+ const list = [];
1442
+ result.data.forEach((item) => {
1443
+ let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
1444
+ let qtyFields = 6;
1445
+ let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
1446
+ list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
1447
+ });
1448
+ return list;
1437
1449
  }
1438
1450
  /**
1439
1451
  * Obtém `true` caso a tela esteja em modo de debug.
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const DataFetcher = require('./DataFetcher-eeb3b0b7.js');
8
- const ISave = require('./ISave-861e9d6d.js');
7
+ const DataFetcher = require('./DataFetcher-ed9d97ea.js');
8
+ const ISave = require('./ISave-81eb2fbc.js');
9
9
  require('./index-e3e39724.js');
10
- const dataunitFetcher = require('./dataunit-fetcher-1cea0695.js');
10
+ const dataunitFetcher = require('./dataunit-fetcher-ab1cc071.js');
11
11
  require('./filter-item-type.enum-a7ffdaa6.js');
12
- require('./form-config-fetcher-f347f884.js');
12
+ require('./form-config-fetcher-f0897eb5.js');
13
13
  const constants = require('./constants-6d82e405.js');
14
- const authFetcher = require('./auth-fetcher-8d8acd69.js');
14
+ const authFetcher = require('./auth-fetcher-cc28d847.js');
15
15
  const taskbarElements = require('./taskbar-elements-fb5d1e08.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
17
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -4,16 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- require('./DataFetcher-eeb3b0b7.js');
8
- require('./ISave-861e9d6d.js');
7
+ require('./DataFetcher-ed9d97ea.js');
8
+ require('./ISave-81eb2fbc.js');
9
9
  const index$1 = require('./index-e3e39724.js');
10
10
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
11
11
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
12
- require('./dataunit-fetcher-1cea0695.js');
12
+ require('./dataunit-fetcher-ab1cc071.js');
13
13
  require('./filter-item-type.enum-a7ffdaa6.js');
14
- require('./form-config-fetcher-f347f884.js');
14
+ require('./form-config-fetcher-f0897eb5.js');
15
15
  const constants = require('./constants-6d82e405.js');
16
- const authFetcher = require('./auth-fetcher-8d8acd69.js');
16
+ const authFetcher = require('./auth-fetcher-cc28d847.js');
17
17
  const ServicesNumberingConfig = require('./ServicesNumberingConfig-69038a0f.js');
18
18
  const taskbarElements = require('./taskbar-elements-fb5d1e08.js');
19
19
  require('./PrintUtils-bcaeb82f.js');
@@ -36,6 +36,38 @@ const SnkCrud = class {
36
36
  this._viewHistory = [];
37
37
  this._customEditors = new Map();
38
38
  this._customRenders = new Map();
39
+ this.loadEntitySuggestions = async (argument) => {
40
+ var _a;
41
+ const value = (_a = argument === null || argument === void 0 ? void 0 : argument.argument) !== null && _a !== void 0 ? _a : '';
42
+ const mode = (argument === null || argument === void 0 ? void 0 : argument.mode) || "PREDICTIVE";
43
+ if (!value || value.trim().length === 0) {
44
+ return [];
45
+ }
46
+ try {
47
+ this._showMoreOnSearch = false;
48
+ const entityName = this._snkDataUnit.entityName;
49
+ if (mode === "PREDICTIVE") {
50
+ return await this.handlePredictiveSearch(value, entityName);
51
+ }
52
+ return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
53
+ }
54
+ catch (error) {
55
+ console.error('Erro ao carregar sugestões de entidades:', error);
56
+ return [];
57
+ }
58
+ };
59
+ this.searchEntitySelect = async (item) => {
60
+ if (!this._entityPKField || !item) {
61
+ return;
62
+ }
63
+ try {
64
+ const pk = [{ name: this._entityPKField, value: item.value }];
65
+ await this.refreshDataUnitByPk(pk);
66
+ }
67
+ catch (error) {
68
+ console.error('Erro ao selecionar entidade:', error);
69
+ }
70
+ };
39
71
  this.dataUnitInterceptor = {
40
72
  interceptAction: (action) => {
41
73
  if (action.type === core.Action.DATA_SAVED) {
@@ -52,6 +84,8 @@ const SnkCrud = class {
52
84
  this._resourceID = undefined;
53
85
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
54
86
  this.numberingConfig = undefined;
87
+ this._showMoreOnSearch = false;
88
+ this._entityPKField = undefined;
55
89
  this.enableLockManagerLoadingComp = false;
56
90
  this.enableLockManagerTaskbarClick = false;
57
91
  this.configName = undefined;
@@ -80,6 +114,7 @@ const SnkCrud = class {
80
114
  this.layoutFormConfig = true;
81
115
  this.multipleEditionEnabled = true;
82
116
  this.paginationCounterMode = 'auto';
117
+ this.showEntitySearch = true;
83
118
  this.disableNumberingConfig = false;
84
119
  }
85
120
  /**
@@ -375,6 +410,49 @@ const SnkCrud = class {
375
410
  var _a;
376
411
  (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
377
412
  }
413
+ async handlePredictiveSearch(argument, entityName) {
414
+ var _a, _b;
415
+ const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
416
+ this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
417
+ this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
418
+ return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
419
+ }
420
+ async refreshDataUnitByPk(pks) {
421
+ try {
422
+ const pkField = pks[0].name;
423
+ const pkValue = pks[0].value;
424
+ // Criar filtro para a busca específica
425
+ const quickFilter = {
426
+ term: '',
427
+ filter: {
428
+ name: '',
429
+ params: [],
430
+ expression: `(${pkField} = ${pkValue})`
431
+ }
432
+ };
433
+ // Carregar dados com o filtro aplicado diretamente
434
+ await this._dataUnit.loadData(quickFilter);
435
+ // Navegar para o formulário se houver apenas um registro
436
+ if (this._dataUnit.records.length === 1) {
437
+ this._dataUnit.selectFirst();
438
+ this.gridToForm(true);
439
+ }
440
+ }
441
+ catch (error) {
442
+ console.error('Erro ao atualizar dataset:', error);
443
+ }
444
+ }
445
+ buildSearchOptions(entityName, limit) {
446
+ return {
447
+ entity: entityName,
448
+ entityDescription: entityName,
449
+ executeOnOpen: true,
450
+ searchOptions: {
451
+ localEntityName: entityName,
452
+ limit,
453
+ }
454
+ };
455
+ }
378
456
  async toggleView() {
379
457
  const currentView = await this._viewStack.getSelectedIndex();
380
458
  this.setViewMode(constants.VIEW_MODE.GRID === currentView ? constants.VIEW_MODE.FORM : constants.VIEW_MODE.GRID);
@@ -481,12 +559,18 @@ const SnkCrud = class {
481
559
  }
482
560
  this.configuratorCancel.emit();
483
561
  }
562
+ renderDynamicSearch(slotName) {
563
+ var _a;
564
+ if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
565
+ return;
566
+ return (index.h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, index.h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
567
+ }
484
568
  render() {
485
569
  if (this._resourceID == undefined) {
486
570
  return;
487
571
  }
488
572
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert);
489
- return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", { tabIndex: "0" }, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, 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, layoutFormConfig: this.layoutFormConfig })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
573
+ return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", { tabIndex: "0" }, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, 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, layoutFormConfig: this.layoutFormConfig })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
490
574
  }
491
575
  get _element() { return index.getElement(this); }
492
576
  static get watchers() { return {
@@ -8,14 +8,14 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const IFetchDataExporterParams = require('./IFetchDataExporterParams-e78ec415.js');
9
9
  const index = require('./index-e3e39724.js');
10
10
  const constants = require('./constants-6d82e405.js');
11
- const DataFetcher = require('./DataFetcher-eeb3b0b7.js');
12
- const snkDataUnit = require('./snk-data-unit-de248308.js');
13
- require('./ISave-861e9d6d.js');
11
+ const DataFetcher = require('./DataFetcher-ed9d97ea.js');
12
+ const snkDataUnit = require('./snk-data-unit-68992932.js');
13
+ require('./ISave-81eb2fbc.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- require('./dataunit-fetcher-1cea0695.js');
16
+ require('./dataunit-fetcher-ab1cc071.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
- require('./form-config-fetcher-f347f884.js');
18
+ require('./form-config-fetcher-f0897eb5.js');
19
19
  require('./PrintUtils-bcaeb82f.js');
20
20
  require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
21
21
  require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
@@ -3,8 +3,8 @@
3
3
  const index = require('./index-1cf293c1.js');
4
4
  const core = require('@sankhyalabs/core');
5
5
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
- const DataFetcher = require('./DataFetcher-eeb3b0b7.js');
7
- const dataunitFetcher = require('./dataunit-fetcher-1cea0695.js');
6
+ const DataFetcher = require('./DataFetcher-ed9d97ea.js');
7
+ const dataunitFetcher = require('./dataunit-fetcher-ab1cc071.js');
8
8
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
9
9
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
10
10
 
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-de248308.js');
5
+ const snkDataUnit = require('./snk-data-unit-68992932.js');
6
6
  require('./index-1cf293c1.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
9
- require('./DataFetcher-eeb3b0b7.js');
9
+ require('./DataFetcher-ed9d97ea.js');
10
10
  require('./PrintUtils-bcaeb82f.js');
11
11
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
12
- require('./dataunit-fetcher-1cea0695.js');
12
+ require('./dataunit-fetcher-ab1cc071.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
15
15
  require('@sankhyalabs/core/dist/utils/SortingUtils');
@@ -4,21 +4,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const SnkFormConfigManager = require('./SnkFormConfigManager-8d4fded8.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-6838389c.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
- const DataFetcher = require('./DataFetcher-eeb3b0b7.js');
10
- require('./ISave-861e9d6d.js');
9
+ const DataFetcher = require('./DataFetcher-ed9d97ea.js');
10
+ require('./ISave-81eb2fbc.js');
11
11
  const index$1 = require('./index-e3e39724.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-1cea0695.js');
14
+ require('./dataunit-fetcher-ab1cc071.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
- require('./form-config-fetcher-f347f884.js');
16
+ require('./form-config-fetcher-f0897eb5.js');
17
17
  const constants = require('./constants-6d82e405.js');
18
18
  const taskbarElements = require('./taskbar-elements-fb5d1e08.js');
19
- const snkGuidesViewer = require('./snk-guides-viewer-4ec3e7e1.js');
19
+ const snkGuidesViewer = require('./snk-guides-viewer-8b841753.js');
20
20
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
21
- require('./ConfigStorage-5a73e979.js');
21
+ require('./ConfigStorage-b29e31be.js');
22
22
  require('./PrintUtils-bcaeb82f.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
24
  require('@sankhyalabs/core/dist/utils/SortingUtils');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index$1 = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
8
- const ConfigStorage = require('./ConfigStorage-5a73e979.js');
8
+ const ConfigStorage = require('./ConfigStorage-b29e31be.js');
9
9
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
10
10
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
11
11
  const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
@@ -16,8 +16,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
16
16
  const defaultFilters = require('./default-filters-a09bf82b.js');
17
17
  const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
18
18
  const filterValidate = require('./filter-validate-cb4ed41a.js');
19
- require('./form-config-fetcher-f347f884.js');
20
- require('./DataFetcher-eeb3b0b7.js');
19
+ require('./form-config-fetcher-f0897eb5.js');
20
+ require('./DataFetcher-ed9d97ea.js');
21
21
  require('./PrintUtils-bcaeb82f.js');
22
22
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
23
23
 
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const ConfigStorage = require('./ConfigStorage-5a73e979.js');
7
+ const ConfigStorage = require('./ConfigStorage-b29e31be.js');
8
8
  const presentationMode = require('./presentationMode-52ec3bdd.js');
9
9
  const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
10
10
  const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
11
- require('./form-config-fetcher-f347f884.js');
12
- require('./DataFetcher-eeb3b0b7.js');
11
+ require('./form-config-fetcher-f0897eb5.js');
12
+ require('./DataFetcher-ed9d97ea.js');
13
13
  require('./PrintUtils-bcaeb82f.js');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
 
@@ -4,15 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const SnkFormConfigManager = require('./SnkFormConfigManager-8d4fded8.js');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-6838389c.js');
8
8
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
9
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
10
10
  const FormConfigHelper = require('./FormConfigHelper-ebb77625.js');
11
11
  const constants = require('./constants-6d82e405.js');
12
12
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
13
- const formConfigFetcher = require('./form-config-fetcher-f347f884.js');
14
- require('./ConfigStorage-5a73e979.js');
15
- require('./DataFetcher-eeb3b0b7.js');
13
+ const formConfigFetcher = require('./form-config-fetcher-f0897eb5.js');
14
+ require('./ConfigStorage-b29e31be.js');
15
+ require('./DataFetcher-ed9d97ea.js');
16
16
  require('./PrintUtils-bcaeb82f.js');
17
17
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -6,17 +6,17 @@ const index = require('./index-1cf293c1.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
8
8
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
- require('./DataFetcher-eeb3b0b7.js');
10
- require('./ISave-861e9d6d.js');
11
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-3b93f6a6.js');
9
+ require('./DataFetcher-ed9d97ea.js');
10
+ require('./ISave-81eb2fbc.js');
11
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-1e804147.js');
12
12
  const index$1 = require('./index-e3e39724.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- require('./dataunit-fetcher-1cea0695.js');
15
+ require('./dataunit-fetcher-ab1cc071.js');
16
16
  require('./filter-item-type.enum-a7ffdaa6.js');
17
- require('./form-config-fetcher-f347f884.js');
17
+ require('./form-config-fetcher-f0897eb5.js');
18
18
  require('./constants-6d82e405.js');
19
- const ConfigStorage = require('./ConfigStorage-5a73e979.js');
19
+ const ConfigStorage = require('./ConfigStorage-b29e31be.js');
20
20
  const index$2 = require('./index-13d05f03.js');
21
21
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
22
22
  const filterValidate = require('./filter-validate-cb4ed41a.js');
@@ -130,6 +130,7 @@ const SnkGrid = class {
130
130
  this._popUpGridConfig = false;
131
131
  this._showSnkFilterBar = true;
132
132
  this._enableContinuousInsert = false;
133
+ this._filterMode = 'regular';
133
134
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
134
135
  this.enableLockManagerLoadingComp = false;
135
136
  this.enableLockManagerTaskbarClick = false;
@@ -149,6 +150,7 @@ const SnkGrid = class {
149
150
  this.canEdit = true;
150
151
  this.taskbarCustomContainerId = undefined;
151
152
  this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
153
+ this.gridHeaderDynamicSearchSlotId = 'GRID_HEADER_DYNAMIC_SEARCH';
152
154
  this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
153
155
  this.disablePersonalizedFilter = undefined;
154
156
  this.gridLegacyConfigName = undefined;
@@ -647,7 +649,8 @@ const SnkGrid = class {
647
649
  return;
648
650
  }
649
651
  if (filterConfig.length === 1 && filterConfig[0].id === 'PERSONALIZED_FILTER_GROUP') {
650
- this._showSnkFilterBar = filterConfig[0].groupedItems.length > 0;
652
+ this._showSnkFilterBar = true;
653
+ this._filterMode = filterConfig[0].groupedItems.length > 0 ? 'regular' : 'button';
651
654
  return;
652
655
  }
653
656
  this._showSnkFilterBar = true;
@@ -665,9 +668,9 @@ const SnkGrid = class {
665
668
  return undefined;
666
669
  }
667
670
  return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
668
- index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "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', actionsSettingsList: this.getActionsSettingsList() }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
671
+ index.h(index.Fragment, null, index.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor, mode: this._filterMode }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "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', actionsSettingsList: this.getActionsSettingsList() }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
669
672
  this.gridConfigChangeHandler(evt);
670
- }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), 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, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, index.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, actionsSettingsList: this.getActionsSettingsList() }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
673
+ }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), 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, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, index.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, additionalSlotId: this.gridHeaderDynamicSearchSlotId, actionsSettingsList: this.getActionsSettingsList() }, index.h("slot", { name: this.gridHeaderCustomSlotId }), index.h("slot", { name: this.gridHeaderDynamicSearchSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
671
674
  }
672
675
  get _element() { return index.getElement(this); }
673
676
  static get watchers() { return {