@sankhyalabs/sankhyablocks 10.1.0-dev.1 → 10.1.0-dev.3

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 (128) 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 +14 -7
  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-view.cjs.entry.js +2 -6
  23. package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
  24. package/dist/cjs/snk-grid.cjs.entry.js +8 -7
  25. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-8b841753.js} +6 -6
  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 +17 -5
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  30. package/dist/cjs/snk-taskbar.cjs.entry.js +8 -4
  31. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
  32. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
  33. package/dist/collection/components/snk-application/snk-application.js +87 -44
  34. package/dist/collection/components/snk-crud/snk-crud.js +106 -2
  35. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +2 -6
  36. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  37. package/dist/collection/components/snk-grid/snk-grid.js +20 -1
  38. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +9 -2
  39. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
  40. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +47 -0
  41. package/dist/collection/components/snk-taskbar/snk-taskbar.js +29 -4
  42. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
  43. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
  44. package/dist/components/DataFetcher.js +1 -1
  45. package/dist/components/ISave.js +3 -3
  46. package/dist/components/snk-application2.js +76 -63
  47. package/dist/components/snk-crud.js +88 -1
  48. package/dist/components/snk-detail-view2.js +1 -1
  49. package/dist/components/snk-form-view2.js +2 -6
  50. package/dist/components/snk-grid2.js +3 -1
  51. package/dist/components/snk-layout-form-config2.js +9 -2
  52. package/dist/components/snk-pesquisa2.js +15 -2
  53. package/dist/components/snk-taskbar2.js +9 -4
  54. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-13d80e36.js} +2 -2
  55. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-f4ccd9f3.js} +1 -1
  56. package/dist/esm/{ISave-345481c1.js → ISave-288fa9df.js} +4 -4
  57. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-3ee2937b.js} +2 -2
  58. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-5d3a93f2.js} +4 -4
  59. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-59ab0c67.js} +1 -1
  60. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-c4f9f222.js} +1 -1
  61. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-6a00fe9e.js} +1 -1
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  64. package/dist/esm/sankhyablocks.js +1 -1
  65. package/dist/esm/snk-actions-button_9.entry.js +14 -7
  66. package/dist/esm/snk-application.entry.js +81 -69
  67. package/dist/esm/snk-attach.entry.js +5 -5
  68. package/dist/esm/snk-crud.entry.js +90 -6
  69. package/dist/esm/snk-data-exporter.entry.js +5 -5
  70. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-0edeb967.js} +2 -2
  71. package/dist/esm/snk-data-unit.entry.js +3 -3
  72. package/dist/esm/snk-detail-view.entry.js +7 -7
  73. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  74. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  75. package/dist/esm/snk-form-view.entry.js +2 -6
  76. package/dist/esm/snk-form_2.entry.js +4 -4
  77. package/dist/esm/snk-grid.entry.js +8 -7
  78. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-9cd4d20f.js} +6 -6
  79. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  80. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  81. package/dist/esm/snk-pesquisa.entry.js +17 -5
  82. package/dist/esm/snk-simple-crud.entry.js +7 -7
  83. package/dist/esm/snk-taskbar.entry.js +8 -4
  84. package/dist/sankhyablocks/{p-9fe91526.js → p-0e279e7a.js} +1 -1
  85. package/dist/sankhyablocks/{p-9b6d4950.entry.js → p-1858c023.entry.js} +1 -1
  86. package/dist/sankhyablocks/{p-1d585081.js → p-1c2971e4.js} +1 -1
  87. package/dist/sankhyablocks/{p-27005fac.entry.js → p-26e0f63c.entry.js} +1 -1
  88. package/dist/sankhyablocks/{p-bb0de89c.entry.js → p-34df7eca.entry.js} +1 -1
  89. package/dist/sankhyablocks/p-34f447ba.entry.js +1 -0
  90. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-38e56b68.entry.js} +1 -1
  91. package/dist/sankhyablocks/{p-1649f51e.entry.js → p-3abeeefa.entry.js} +1 -1
  92. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-3d021bef.entry.js} +1 -1
  93. package/dist/sankhyablocks/{p-e64958ba.entry.js → p-44939a0e.entry.js} +1 -1
  94. package/dist/sankhyablocks/{p-88ed2793.js → p-5304753a.js} +2 -2
  95. package/dist/sankhyablocks/{p-e8c49c12.js → p-53599b26.js} +2 -2
  96. package/dist/sankhyablocks/p-557368df.entry.js +1 -0
  97. package/dist/sankhyablocks/p-583151c5.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-6180de07.entry.js} +1 -1
  99. package/dist/sankhyablocks/{p-1788d191.js → p-78ff8734.js} +1 -1
  100. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-80014119.entry.js} +1 -1
  101. package/dist/sankhyablocks/{p-af9d79e0.entry.js → p-8a88690f.entry.js} +1 -1
  102. package/dist/sankhyablocks/{p-7fc46290.js → p-9317942f.js} +1 -1
  103. package/dist/sankhyablocks/p-a2ed1ebd.entry.js +1 -0
  104. package/dist/sankhyablocks/{p-0cf9aa38.js → p-a644a956.js} +1 -1
  105. package/dist/sankhyablocks/p-ae108ffd.entry.js +11 -0
  106. package/dist/sankhyablocks/{p-9f2cdaab.entry.js → p-b4322b87.entry.js} +1 -1
  107. package/dist/sankhyablocks/p-b7e891cc.entry.js +1 -0
  108. package/dist/sankhyablocks/{p-6d241415.js → p-bb2f5f38.js} +1 -1
  109. package/dist/sankhyablocks/{p-626b7a17.js → p-d9c54991.js} +1 -1
  110. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-e9021f79.entry.js} +1 -1
  111. package/dist/sankhyablocks/{p-59b8f277.js → p-f15478a1.js} +1 -1
  112. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  113. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
  114. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  115. package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
  116. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  117. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +2 -2
  118. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +9 -0
  119. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -1
  120. package/dist/types/components.d.ts +39 -0
  121. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  122. package/package.json +1 -1
  123. package/dist/sankhyablocks/p-2c86cfab.entry.js +0 -1
  124. package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
  125. package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
  126. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  127. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  128. package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
2
2
  import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, SilentException, WarningException, ErrorException, ElementIDUtils, SearchUtils, ArrayUtils, KeyboardManager, OnboardingUtils, DependencyType, DataType, ApplicationContext, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { C as ConfigStorage } from './ConfigStorage-568dc227.js';
5
- import { d as dist, D as DataFetcher, U as UrlUtils, S as SnkMessageBuilder } from './DataFetcher-743feb3b.js';
6
- import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-c353127d.js';
7
- import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-7f2c61ca.js';
8
- import { P as PesquisaFetcher } from './ISave-345481c1.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-13d80e36.js';
5
+ import { d as dist, D as DataFetcher, U as UrlUtils, S as SnkMessageBuilder } from './DataFetcher-f4ccd9f3.js';
6
+ import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-59ab0c67.js';
7
+ import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-c4f9f222.js';
8
+ import { P as PesquisaFetcher } from './ISave-288fa9df.js';
9
9
  import { T as TEMPLATES_SKELETON } from './constants-7b422de0.js';
10
10
  import './index-b40568ff.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import { F as FormConfigFetcher } from './form-config-fetcher-898d2dd1.js';
12
+ import { F as FormConfigFetcher } from './form-config-fetcher-6a00fe9e.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
15
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -389,32 +389,40 @@ class RequestListenerFactory {
389
389
  }
390
390
  }
391
391
 
392
+ const executeAdvancedModeSearch = async (argument, options, app, pesquisaFetcher) => {
393
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, executeOnOpen } = options;
394
+ return new Promise((accept, reject) => {
395
+ const pesquisaContent = document.createElement("snk-pesquisa");
396
+ pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
397
+ pesquisaContent.entityName = entity;
398
+ pesquisaContent.argument = argument;
399
+ pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
400
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
401
+ if (isHierarchyEntity) {
402
+ pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
403
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
404
+ }
405
+ pesquisaContent.selectItem = (option) => {
406
+ accept(option);
407
+ app.clearPopUpTitle();
408
+ app.closePopUp();
409
+ };
410
+ app.setPopUpTitle(entityDescription);
411
+ app.showPopUp(pesquisaContent, undefined, undefined, reject);
412
+ if (executeOnOpen) {
413
+ pesquisaContent.executeSearch(argument);
414
+ }
415
+ });
416
+ };
417
+
392
418
  const QTD_DETAIL_FIELDS_PREDICTIVE_SEARCH = 6;
393
419
  const INVALID_CONTENT_PATTERNS = ['<img', '<svg'];
394
420
  const executePreparedSearchPlus = async (mode, argument, options, app, pesquisaFetcher) => {
395
421
  var _a;
396
422
  const mdByName = {};
397
- const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
423
+ const { entity, criteria, searchOptions } = options;
398
424
  if (mode === "ADVANCED") {
399
- return new Promise((accept, reject) => {
400
- const pesquisaContent = document.createElement("snk-pesquisa");
401
- pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
402
- pesquisaContent.entityName = entity;
403
- pesquisaContent.argument = argument;
404
- pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
405
- pesquisaContent.isHierarchyEntity = isHierarchyEntity;
406
- if (isHierarchyEntity) {
407
- pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
408
- pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
409
- }
410
- pesquisaContent.selectItem = (option) => {
411
- accept(option);
412
- app.clearPopUpTitle();
413
- app.closePopUp();
414
- };
415
- app.setPopUpTitle(entityDescription);
416
- app.showPopUp(pesquisaContent, undefined, undefined, reject);
417
- });
425
+ return executeAdvancedModeSearch(argument, options, app, pesquisaFetcher);
418
426
  }
419
427
  else if (mode === "LOAD_DESCRIPTION") {
420
428
  let result = await pesquisaFetcher.loadByCode(entity, argument, criteria, searchOptions);
@@ -451,14 +459,13 @@ const buildOptionItem = (argument, item, fields, descriptionField, pkField) => {
451
459
  const matchFields = item['__matchFields'];
452
460
  const descriptionValue = (_a = item[descriptionField]) !== null && _a !== void 0 ? _a : "";
453
461
  const pkValue = item[pkField];
454
- let searchOption = {
462
+ return {
455
463
  value: pkValue,
456
464
  label: descriptionValue,
457
465
  presentationValue: StringUtils.highlightValue(argument, matchFields, pkValue, fields, true),
458
466
  presentationLabel: descriptionField ? StringUtils.highlightValue(argument, matchFields, descriptionValue, fields, true) : "",
459
467
  details: SearchUtils.buildDetails(argument, fields, item)
460
468
  };
461
- return searchOption;
462
469
  };
463
470
  const filterInvalidFields = (resp, item, mdByName) => {
464
471
  let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
@@ -893,7 +900,7 @@ const SnkApplication = class {
893
900
  if (this._featureFlagsCache.get(featureName) && now < this._featureFlagsCache.get(featureName).expires) {
894
901
  return Promise.resolve(this._featureFlagsCache.get(featureName).isActive);
895
902
  }
896
- //Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
903
+ //Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
897
904
  const result = await DataFetcher.get().callServiceBroker("SystemUtilsSP.featureIsActive", JSON.stringify(payload));
898
905
  const isActive = result.isActive;
899
906
  this._featureFlagsCache.set(featureName, {
@@ -1384,52 +1391,57 @@ const SnkApplication = class {
1384
1391
  */
1385
1392
  async executePreparedSearch(mode, argument, options) {
1386
1393
  const mdByName = {};
1387
- const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, useSearchPlus } = options;
1394
+ const { entity, criteria, searchOptions, useSearchPlus } = options;
1388
1395
  if (useSearchPlus) {
1389
1396
  return executePreparedSearchPlus(mode, argument, options, this, this.pesquisaFetcher);
1390
1397
  }
1391
1398
  if (mode === "ADVANCED") {
1392
- return new Promise((accept, reject) => {
1393
- const pesquisaContent = document.createElement("snk-pesquisa");
1394
- pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
1395
- pesquisaContent.entityName = entity;
1396
- pesquisaContent.argument = argument;
1397
- pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
1398
- pesquisaContent.isHierarchyEntity = isHierarchyEntity;
1399
- if (isHierarchyEntity) {
1400
- pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
1401
- pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
1402
- }
1403
- pesquisaContent.selectItem = (option) => {
1404
- accept(option);
1405
- this.clearPopUpTitle();
1406
- this.closePopUp();
1407
- };
1408
- this.setPopUpTitle(entityDescription);
1409
- this.showPopUp(pesquisaContent, undefined, undefined, reject);
1410
- });
1399
+ return executeAdvancedModeSearch(argument, options, this, this.pesquisaFetcher);
1411
1400
  }
1412
- else {
1413
- return new Promise((resolve, reject) => {
1414
- this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1415
- .then(result => {
1416
- result = ObjectUtils.stringToObject(result.json.$);
1417
- let descriptionField = result.descriptionField;
1418
- let pkField = result.pkField;
1419
- const list = [];
1420
- result.data.forEach((item) => {
1421
- let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
1422
- let qtyFields = 6;
1423
- let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
1424
- list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
1425
- });
1426
- resolve(list);
1427
- })
1428
- .catch(error => {
1429
- reject(error);
1430
- });
1401
+ return new Promise((resolve, reject) => {
1402
+ this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1403
+ .then(result => {
1404
+ result = ObjectUtils.stringToObject(result.json.$);
1405
+ resolve(this.buildSearchResultList(result, mdByName, argument));
1406
+ })
1407
+ .catch(error => {
1408
+ reject(error);
1431
1409
  });
1432
- }
1410
+ });
1411
+ }
1412
+ /**
1413
+ * Obtém as opções em componentes de pesquisa além dos metadados como showMore e entityPk.
1414
+ * @param {string} argument - O argumento da pesquisa.
1415
+ * @param {any} options - Opções preparadas para a pesquisa.
1416
+ * @returns {Promise<Array<IOption> | IOption>} Uma lista de opções ou uma única opção.
1417
+ * @async
1418
+ */
1419
+ async executePreparedSearchWithFullResponse(argument, options) {
1420
+ const mdByName = {};
1421
+ const { entity, criteria, searchOptions } = options;
1422
+ return new Promise((resolve, reject) => {
1423
+ this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
1424
+ .then(result => {
1425
+ result = ObjectUtils.stringToObject(result.json.$);
1426
+ result.data = this.buildSearchResultList(result, mdByName, argument);
1427
+ resolve(result);
1428
+ })
1429
+ .catch(error => {
1430
+ reject(error);
1431
+ });
1432
+ });
1433
+ }
1434
+ buildSearchResultList(result, mdByName, argument) {
1435
+ let descriptionField = result.descriptionField;
1436
+ let pkField = result.pkField;
1437
+ const list = [];
1438
+ result.data.forEach((item) => {
1439
+ let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
1440
+ let qtyFields = 6;
1441
+ let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
1442
+ list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
1443
+ });
1444
+ return list;
1433
1445
  }
1434
1446
  /**
1435
1447
  * Obtém `true` caso a tela esteja em modo de debug.
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-479e1293.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnitLoaderUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher, S as SnkMessageBuilder } from './DataFetcher-743feb3b.js';
4
- import { S as SaveErrorsEnum } from './ISave-345481c1.js';
3
+ import { D as DataFetcher, S as SnkMessageBuilder } from './DataFetcher-f4ccd9f3.js';
4
+ import { S as SaveErrorsEnum } from './ISave-288fa9df.js';
5
5
  import './index-b40568ff.js';
6
- import { P as PreloadManager, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-7f2c61ca.js';
6
+ import { P as PreloadManager, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-c4f9f222.js';
7
7
  import './filter-item-type.enum-d45e026f.js';
8
- import './form-config-fetcher-898d2dd1.js';
8
+ import './form-config-fetcher-6a00fe9e.js';
9
9
  import { V as VIEW_MODE } from './constants-7b422de0.js';
10
- import { A as AutorizationType } from './auth-fetcher-c353127d.js';
10
+ import { A as AutorizationType } from './auth-fetcher-59ab0c67.js';
11
11
  import { T as TaskbarElement } from './taskbar-elements-faaf5d8f.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
2
2
  import { Action, StringUtils, ElementIDUtils, ApplicationContext, KeyboardManager } from '@sankhyalabs/core';
3
- import './DataFetcher-743feb3b.js';
4
- import './ISave-345481c1.js';
3
+ import './DataFetcher-f4ccd9f3.js';
4
+ import './ISave-288fa9df.js';
5
5
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
6
6
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import './dataunit-fetcher-7f2c61ca.js';
8
+ import './dataunit-fetcher-c4f9f222.js';
9
9
  import './filter-item-type.enum-d45e026f.js';
10
- import './form-config-fetcher-898d2dd1.js';
10
+ import './form-config-fetcher-6a00fe9e.js';
11
11
  import { V as VIEW_MODE } from './constants-7b422de0.js';
12
- import { A as AutorizationType } from './auth-fetcher-c353127d.js';
12
+ import { A as AutorizationType } from './auth-fetcher-59ab0c67.js';
13
13
  import { S as ServicesNumberingConfig } from './ServicesNumberingConfig-2f7b050e.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-faaf5d8f.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
@@ -32,6 +32,38 @@ const SnkCrud = class {
32
32
  this._viewHistory = [];
33
33
  this._customEditors = new Map();
34
34
  this._customRenders = new Map();
35
+ this.loadEntitySuggestions = async (argument) => {
36
+ var _a;
37
+ const value = (_a = argument === null || argument === void 0 ? void 0 : argument.argument) !== null && _a !== void 0 ? _a : '';
38
+ const mode = (argument === null || argument === void 0 ? void 0 : argument.mode) || "PREDICTIVE";
39
+ if (!value || value.trim().length === 0) {
40
+ return [];
41
+ }
42
+ try {
43
+ this._showMoreOnSearch = false;
44
+ const entityName = this._snkDataUnit.entityName;
45
+ if (mode === "PREDICTIVE") {
46
+ return await this.handlePredictiveSearch(value, entityName);
47
+ }
48
+ return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
49
+ }
50
+ catch (error) {
51
+ console.error('Erro ao carregar sugestões de entidades:', error);
52
+ return [];
53
+ }
54
+ };
55
+ this.searchEntitySelect = async (item) => {
56
+ if (!this._entityPKField || !item) {
57
+ return;
58
+ }
59
+ try {
60
+ const pk = [{ name: this._entityPKField, value: item.value }];
61
+ await this.refreshDataUnitByPk(pk);
62
+ }
63
+ catch (error) {
64
+ console.error('Erro ao selecionar entidade:', error);
65
+ }
66
+ };
35
67
  this.dataUnitInterceptor = {
36
68
  interceptAction: (action) => {
37
69
  if (action.type === Action.DATA_SAVED) {
@@ -48,6 +80,8 @@ const SnkCrud = class {
48
80
  this._resourceID = undefined;
49
81
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
50
82
  this.numberingConfig = undefined;
83
+ this._showMoreOnSearch = false;
84
+ this._entityPKField = undefined;
51
85
  this.enableLockManagerLoadingComp = false;
52
86
  this.enableLockManagerTaskbarClick = false;
53
87
  this.configName = undefined;
@@ -76,6 +110,7 @@ const SnkCrud = class {
76
110
  this.layoutFormConfig = true;
77
111
  this.multipleEditionEnabled = true;
78
112
  this.paginationCounterMode = 'auto';
113
+ this.showEntitySearch = true;
79
114
  this.disableNumberingConfig = false;
80
115
  }
81
116
  /**
@@ -371,6 +406,49 @@ const SnkCrud = class {
371
406
  var _a;
372
407
  (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
373
408
  }
409
+ async handlePredictiveSearch(argument, entityName) {
410
+ var _a, _b;
411
+ const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
412
+ this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
413
+ this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
414
+ return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
415
+ }
416
+ async refreshDataUnitByPk(pks) {
417
+ try {
418
+ const pkField = pks[0].name;
419
+ const pkValue = pks[0].value;
420
+ // Criar filtro para a busca específica
421
+ const quickFilter = {
422
+ term: '',
423
+ filter: {
424
+ name: '',
425
+ params: [],
426
+ expression: `(${pkField} = ${pkValue})`
427
+ }
428
+ };
429
+ // Carregar dados com o filtro aplicado diretamente
430
+ await this._dataUnit.loadData(quickFilter);
431
+ // Navegar para o formulário se houver apenas um registro
432
+ if (this._dataUnit.records.length === 1) {
433
+ this._dataUnit.selectFirst();
434
+ this.gridToForm(true);
435
+ }
436
+ }
437
+ catch (error) {
438
+ console.error('Erro ao atualizar dataset:', error);
439
+ }
440
+ }
441
+ buildSearchOptions(entityName, limit) {
442
+ return {
443
+ entity: entityName,
444
+ entityDescription: entityName,
445
+ executeOnOpen: true,
446
+ searchOptions: {
447
+ localEntityName: entityName,
448
+ limit,
449
+ }
450
+ };
451
+ }
374
452
  async toggleView() {
375
453
  const currentView = await this._viewStack.getSelectedIndex();
376
454
  this.setViewMode(VIEW_MODE.GRID === currentView ? VIEW_MODE.FORM : VIEW_MODE.GRID);
@@ -477,12 +555,18 @@ const SnkCrud = class {
477
555
  }
478
556
  this.configuratorCancel.emit();
479
557
  }
558
+ renderDynamicSearch(slotName) {
559
+ var _a;
560
+ if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
561
+ return;
562
+ return (h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
563
+ }
480
564
  render() {
481
565
  if (this._resourceID == undefined) {
482
566
  return;
483
567
  }
484
568
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
485
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, 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 })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
569
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, 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 })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
486
570
  }
487
571
  get _element() { return getElement(this); }
488
572
  static get watchers() { return {
@@ -4,14 +4,14 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
4
4
  import { I as IExportType } from './IFetchDataExporterParams-d73bed3d.js';
5
5
  import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-b40568ff.js';
6
6
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-7b422de0.js';
7
- import { D as DataFetcher } from './DataFetcher-743feb3b.js';
8
- import { S as SnkDataUnit } from './snk-data-unit-60b338c5.js';
9
- import './ISave-345481c1.js';
7
+ import { D as DataFetcher } from './DataFetcher-f4ccd9f3.js';
8
+ import { S as SnkDataUnit } from './snk-data-unit-0edeb967.js';
9
+ import './ISave-288fa9df.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import './dataunit-fetcher-7f2c61ca.js';
12
+ import './dataunit-fetcher-c4f9f222.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import './form-config-fetcher-898d2dd1.js';
14
+ import './form-config-fetcher-6a00fe9e.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
16
  import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
17
17
  import './GetSelectedRecordsIDsInfo-9fa41508.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-479e1293.js';
2
2
  import { ApplicationContext, Action, ObjectUtils, DataUnitAction, StringUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { O as OperationMap, S as SnkMessageBuilder } from './DataFetcher-743feb3b.js';
5
- import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-7f2c61ca.js';
4
+ import { O as OperationMap, S as SnkMessageBuilder } from './DataFetcher-f4ccd9f3.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-c4f9f222.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,11 +1,11 @@
1
- export { S as snk_data_unit } from './snk-data-unit-60b338c5.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-0edeb967.js';
2
2
  import './index-479e1293.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
- import './DataFetcher-743feb3b.js';
5
+ import './DataFetcher-f4ccd9f3.js';
6
6
  import './PrintUtils-3e4ff0f5.js';
7
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import './dataunit-fetcher-7f2c61ca.js';
8
+ import './dataunit-fetcher-c4f9f222.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
11
11
  import '@sankhyalabs/core/dist/utils/SortingUtils';
@@ -1,20 +1,20 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-479e1293.js';
2
2
  import { Action, StringUtils, KeyboardManager } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-d61df0c8.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-3ee2937b.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import { S as SnkMessageBuilder } from './DataFetcher-743feb3b.js';
6
- import './ISave-345481c1.js';
5
+ import { S as SnkMessageBuilder } from './DataFetcher-f4ccd9f3.js';
6
+ import './ISave-288fa9df.js';
7
7
  import { P as PresentationMode } from './index-b40568ff.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-7f2c61ca.js';
10
+ import './dataunit-fetcher-c4f9f222.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-898d2dd1.js';
12
+ import './form-config-fetcher-6a00fe9e.js';
13
13
  import { V as VIEW_MODE } from './constants-7b422de0.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-faaf5d8f.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-339e10b3.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-9cd4d20f.js';
16
16
  import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
17
- import './ConfigStorage-568dc227.js';
17
+ import './ConfigStorage-13d80e36.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  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-479e1293.js';
2
2
  import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation, DateUtils, MaskFormatter, KeyboardManager, FloatingManager, ArrayUtils } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-568dc227.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-13d80e36.js';
5
5
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-2db38ff2.js';
6
6
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
7
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
@@ -12,8 +12,8 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
12
12
  import { A as ActionDefaultFilter } from './default-filters-50105e43.js';
13
13
  import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
14
14
  import { g as getInvalidFilters } from './filter-validate-faf51fa9.js';
15
- import './form-config-fetcher-898d2dd1.js';
16
- import './DataFetcher-743feb3b.js';
15
+ import './form-config-fetcher-6a00fe9e.js';
16
+ import './DataFetcher-f4ccd9f3.js';
17
17
  import './PrintUtils-3e4ff0f5.js';
18
18
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
19
19
 
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
- import { C as ConfigStorage } from './ConfigStorage-568dc227.js';
3
+ import { C as ConfigStorage } from './ConfigStorage-13d80e36.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
5
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
6
6
  import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
7
- import './form-config-fetcher-898d2dd1.js';
8
- import './DataFetcher-743feb3b.js';
7
+ import './form-config-fetcher-6a00fe9e.js';
8
+ import './DataFetcher-f4ccd9f3.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -13,7 +13,7 @@ const SnkFormView = class {
13
13
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
14
14
  this._customEditors = new Map();
15
15
  this._fieldProps = new Map();
16
- this._singleColumn = true;
16
+ this._singleColumn = false;
17
17
  this.levelPath = undefined;
18
18
  this.fieldSearch = undefined;
19
19
  this.label = undefined;
@@ -151,11 +151,7 @@ const SnkFormView = class {
151
151
  }
152
152
  }
153
153
  setSingleColumn(layoutFormConfig) {
154
- if (!(layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config)) {
155
- this._singleColumn = true;
156
- return;
157
- }
158
- this._singleColumn = (layoutFormConfig.config === FormLayout.CASCADE);
154
+ this._singleColumn = (layoutFormConfig === null || layoutFormConfig === void 0 ? void 0 : layoutFormConfig.config) === FormLayout.CASCADE;
159
155
  }
160
156
  registerNotifyListeners(layoutFormConfig) {
161
157
  if (!layoutFormConfig)
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-479e1293.js';
2
2
  import { ElementIDUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-d61df0c8.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-3ee2937b.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
5
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
6
6
  import { b as buildGuides, a as buildGuidesMap, g as getFieldsToSave, u as updateTabInFieldsFromGroupList, c as buildNewGuideName } from './FormConfigHelper-4e42f0b6.js';
7
7
  import { a as TAB_NAMES, G as GROUP_NAMES } from './constants-7b422de0.js';
8
8
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
9
- import { U as UserConfigType } from './form-config-fetcher-898d2dd1.js';
10
- import './ConfigStorage-568dc227.js';
11
- import './DataFetcher-743feb3b.js';
9
+ import { U as UserConfigType } from './form-config-fetcher-6a00fe9e.js';
10
+ import './ConfigStorage-13d80e36.js';
11
+ import './DataFetcher-f4ccd9f3.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
14
  import './filter-item-type.enum-d45e026f.js';
@@ -2,17 +2,17 @@ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElem
2
2
  import { KeyboardManager, Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
3
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
  import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
5
- import './DataFetcher-743feb3b.js';
6
- import './ISave-345481c1.js';
7
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-ca8d7a09.js';
5
+ import './DataFetcher-f4ccd9f3.js';
6
+ import './ISave-288fa9df.js';
7
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-5d3a93f2.js';
8
8
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-7f2c61ca.js';
11
+ import './dataunit-fetcher-c4f9f222.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-898d2dd1.js';
13
+ import './form-config-fetcher-6a00fe9e.js';
14
14
  import './constants-7b422de0.js';
15
- import { C as ConfigStorage } from './ConfigStorage-568dc227.js';
15
+ import { C as ConfigStorage } from './ConfigStorage-13d80e36.js';
16
16
  import { s as store } from './index-446f9341.js';
17
17
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
18
18
  import { v as validateFilters } from './filter-validate-faf51fa9.js';
@@ -145,6 +145,7 @@ const SnkGrid = class {
145
145
  this.canEdit = true;
146
146
  this.taskbarCustomContainerId = undefined;
147
147
  this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
148
+ this.gridHeaderDynamicSearchSlotId = 'GRID_HEADER_DYNAMIC_SEARCH';
148
149
  this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
149
150
  this.disablePersonalizedFilter = undefined;
150
151
  this.gridLegacyConfigName = undefined;
@@ -663,7 +664,7 @@ const SnkGrid = class {
663
664
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
664
665
  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, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor }), 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 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() }, 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) => {
665
666
  this.gridConfigChangeHandler(evt);
666
- }, 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 }, 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() }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => 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 }))));
667
+ }, 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 }, 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() }, h("slot", { name: this.gridHeaderCustomSlotId }), h("slot", { name: this.gridHeaderDynamicSearchSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => 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 }))));
667
668
  }
668
669
  get _element() { return getElement(this); }
669
670
  static get watchers() { return {