@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-71601.1 → 0.0.0-bugfix-dev-KB-55889.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/cjs/{ConfigStorage-e49214c6.js → ConfigStorage-ecc0ed20.js} +2 -2
  2. package/dist/cjs/{DataFetcher-77729a93.js → DataFetcher-cadeef8e.js} +21 -20
  3. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  4. package/dist/cjs/{IExporterProvider-5d129ffd.js → IExporterProvider-9ac15aaf.js} +4 -4
  5. package/dist/cjs/{SnkFormConfigManager-beebf47a.js → SnkFormConfigManager-f1c92f79.js} +72 -16
  6. package/dist/cjs/{auth-fetcher-29bb791c.js → auth-fetcher-d68841bc.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-0c2f5903.js → dataunit-fetcher-4b12f70c.js} +16 -37
  8. package/dist/cjs/{form-config-fetcher-feb08214.js → form-config-fetcher-ed497282.js} +5 -2
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-a1d0353f.js → pesquisa-fetcher-ca89181c.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  13. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  14. package/dist/cjs/snk-attach.cjs.entry.js +8 -6
  15. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
  17. package/dist/cjs/{snk-data-unit-610fb4bc.js → snk-data-unit-ed17da6b.js} +12 -11
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
  20. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  22. package/dist/cjs/snk-form-config.cjs.entry.js +15 -4
  23. package/dist/cjs/snk-form.cjs.entry.js +7 -6
  24. package/dist/cjs/snk-grid.cjs.entry.js +8 -8
  25. package/dist/cjs/{snk-guides-viewer-d6d543af.js → snk-guides-viewer-866447ab.js} +10 -7
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
  29. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  30. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  31. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +4 -2
  32. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
  33. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +5 -2
  34. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  35. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  36. package/dist/collection/components/snk-data-unit/snk-data-unit.js +11 -10
  37. package/dist/collection/components/snk-form/snk-form.js +2 -2
  38. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
  39. package/dist/collection/components/snk-form-config/snk-form-config.js +13 -2
  40. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
  41. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  42. package/dist/collection/lib/dataUnit/InMemoryLoader.js +4 -2
  43. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +9 -34
  44. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +21 -20
  45. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  46. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  47. package/dist/components/DataFetcher.js +21 -20
  48. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  49. package/dist/components/SnkFormConfigManager.js +70 -14
  50. package/dist/components/dataunit-fetcher.js +13 -36
  51. package/dist/components/form-config-fetcher.js +4 -1
  52. package/dist/components/snk-actions-button2.js +12 -9
  53. package/dist/components/snk-attach2.js +4 -2
  54. package/dist/components/snk-data-unit2.js +14 -50
  55. package/dist/components/snk-detail-view2.js +7 -4
  56. package/dist/components/snk-form-config2.js +13 -2
  57. package/dist/components/snk-form.js +2 -2
  58. package/dist/components/snk-grid2.js +2 -2
  59. package/dist/components/snk-simple-crud2.js +4 -3
  60. package/dist/components/snk-taskbar2.js +24 -2
  61. package/dist/esm/{ConfigStorage-e476378d.js → ConfigStorage-7b36d041.js} +2 -2
  62. package/dist/esm/{DataFetcher-773a3e4b.js → DataFetcher-a9c598f2.js} +21 -20
  63. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  64. package/dist/esm/{IExporterProvider-24f1d5be.js → IExporterProvider-09df2e3e.js} +4 -4
  65. package/dist/esm/{SnkFormConfigManager-298cd647.js → SnkFormConfigManager-139f09fa.js} +72 -16
  66. package/dist/esm/{auth-fetcher-a411f73c.js → auth-fetcher-749d880f.js} +1 -1
  67. package/dist/esm/{dataunit-fetcher-3308edba.js → dataunit-fetcher-3aac1a53.js} +14 -37
  68. package/dist/esm/{form-config-fetcher-e0382e5a.js → form-config-fetcher-adbe5d34.js} +5 -2
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/{pesquisa-fetcher-a87445a0.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
  71. package/dist/esm/sankhyablocks.js +1 -1
  72. package/dist/esm/snk-actions-button_4.entry.js +17 -14
  73. package/dist/esm/snk-application.entry.js +6 -6
  74. package/dist/esm/snk-attach.entry.js +8 -6
  75. package/dist/esm/snk-crud.entry.js +5 -5
  76. package/dist/esm/snk-data-exporter.entry.js +6 -6
  77. package/dist/esm/{snk-data-unit-f4727294.js → snk-data-unit-6888df8f.js} +12 -11
  78. package/dist/esm/snk-data-unit.entry.js +4 -4
  79. package/dist/esm/snk-detail-view.entry.js +9 -9
  80. package/dist/esm/snk-filter-bar.entry.js +3 -3
  81. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  82. package/dist/esm/snk-form-config.entry.js +15 -4
  83. package/dist/esm/snk-form.entry.js +7 -6
  84. package/dist/esm/snk-grid.entry.js +8 -8
  85. package/dist/esm/{snk-guides-viewer-57cfa507.js → snk-guides-viewer-cb8a0b48.js} +10 -7
  86. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  87. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  88. package/dist/esm/snk-simple-crud.entry.js +10 -10
  89. package/dist/esm/snk-taskbar.entry.js +23 -1
  90. package/dist/sankhyablocks/{p-181975f1.js → p-06421fdb.js} +2 -2
  91. package/dist/sankhyablocks/{p-1f2f07c2.entry.js → p-0e9a872d.entry.js} +1 -1
  92. package/dist/sankhyablocks/{p-a0e0c10f.entry.js → p-16969508.entry.js} +1 -1
  93. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  94. package/dist/sankhyablocks/{p-1d13de28.js → p-1ab19772.js} +1 -1
  95. package/dist/sankhyablocks/{p-25f1fc39.js → p-1bf06cd3.js} +2 -2
  96. package/dist/sankhyablocks/{p-50d7d40b.entry.js → p-1f47a0b2.entry.js} +1 -1
  97. package/dist/sankhyablocks/{p-9dfda04a.entry.js → p-212213d9.entry.js} +1 -1
  98. package/dist/sankhyablocks/p-3757394b.entry.js +1 -0
  99. package/dist/sankhyablocks/p-3d542b58.entry.js +1 -0
  100. package/dist/sankhyablocks/{p-212c54c1.entry.js → p-439a50fb.entry.js} +1 -1
  101. package/dist/sankhyablocks/{p-3287a6cc.js → p-4d9549cf.js} +1 -1
  102. package/dist/sankhyablocks/p-53c1d25d.entry.js +1 -0
  103. package/dist/sankhyablocks/p-559bfb9b.entry.js +1 -0
  104. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  105. package/dist/sankhyablocks/{p-29016f61.entry.js → p-640140b3.entry.js} +2 -2
  106. package/dist/sankhyablocks/p-73185e58.entry.js +1 -0
  107. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  108. package/dist/sankhyablocks/p-9cbef862.js +1 -0
  109. package/dist/sankhyablocks/{p-c319fccd.js → p-a31e761f.js} +1 -1
  110. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  111. package/dist/sankhyablocks/{p-5b26cc7c.entry.js → p-b2caaaf9.entry.js} +1 -1
  112. package/dist/sankhyablocks/p-bc4b94d2.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-0cd3c0a9.js → p-ca5ec380.js} +1 -1
  114. package/dist/sankhyablocks/{p-594bc21d.js → p-f3434fc4.js} +1 -1
  115. package/dist/sankhyablocks/p-f8698ad3.js +60 -0
  116. package/dist/sankhyablocks/{p-bd008859.entry.js → p-fb34e0cf.entry.js} +1 -1
  117. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  118. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  119. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +1 -0
  120. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  121. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
  122. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  123. package/dist/types/components.d.ts +8 -0
  124. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +2 -12
  125. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  126. package/package.json +1 -1
  127. package/dist/sankhyablocks/p-038f6a70.entry.js +0 -1
  128. package/dist/sankhyablocks/p-0611c5d4.js +0 -1
  129. package/dist/sankhyablocks/p-0e7db332.entry.js +0 -1
  130. package/dist/sankhyablocks/p-2e9c764c.entry.js +0 -1
  131. package/dist/sankhyablocks/p-4c92bf50.entry.js +0 -1
  132. package/dist/sankhyablocks/p-5f016aed.js +0 -1
  133. package/dist/sankhyablocks/p-8ad41dcb.entry.js +0 -1
  134. package/dist/sankhyablocks/p-939e15d3.entry.js +0 -1
  135. package/dist/sankhyablocks/p-9863d682.js +0 -1
  136. package/dist/sankhyablocks/p-a875c5f2.js +0 -60
  137. package/dist/sankhyablocks/p-cfb72d5e.entry.js +0 -1
  138. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  139. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
4
- import './pesquisa-fetcher-a87445a0.js';
3
+ import { D as DataFetcher } from './DataFetcher-a9c598f2.js';
4
+ import './pesquisa-fetcher-8edaa8cd.js';
5
5
  import './index-3aa4977a.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
- import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-3308edba.js';
7
+ import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-3aac1a53.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-e0382e5a.js';
9
+ import './form-config-fetcher-adbe5d34.js';
10
10
  import { d as VIEW_MODE } from './constants-8457af36.js';
11
- import { A as AutorizationType } from './auth-fetcher-a411f73c.js';
11
+ import { A as AutorizationType } from './auth-fetcher-749d880f.js';
12
12
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -460,7 +460,9 @@ class AttachFetcherDataUnitFactory {
460
460
  });
461
461
  this._records = records;
462
462
  }
463
- return buildLoadDataResponse(this._records, dataUnit, request);
463
+ let records = applyFilter(this._records, dataUnit, request.filters);
464
+ records = applySorting(records, dataUnit, request.sort);
465
+ return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
464
466
  }
465
467
  saveLoader(changes, fetcher) {
466
468
  return new Promise((resolve) => {
@@ -1,17 +1,17 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
4
- import './DataFetcher-773a3e4b.js';
5
- import './pesquisa-fetcher-a87445a0.js';
4
+ import './DataFetcher-a9c598f2.js';
5
+ import './pesquisa-fetcher-8edaa8cd.js';
6
6
  import { P as PresentationMode } from './index-3aa4977a.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-3308edba.js';
10
+ import './dataunit-fetcher-3aac1a53.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-e0382e5a.js';
12
+ import './form-config-fetcher-adbe5d34.js';
13
13
  import { d as VIEW_MODE } from './constants-8457af36.js';
14
- import { A as AutorizationType } from './auth-fetcher-a411f73c.js';
14
+ import { A as AutorizationType } from './auth-fetcher-749d880f.js';
15
15
  import './index-bdf75557.js';
16
16
  import './PrintUtils-3e4ff0f5.js';
17
17
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -3,19 +3,19 @@ import { ApplicationContext, ObjectUtils, UserInterface, DataType, ElementIDUtil
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-3aa4977a.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
6
- import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-f4727294.js';
8
- import './pesquisa-fetcher-a87445a0.js';
6
+ import { D as DataFetcher } from './DataFetcher-a9c598f2.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-6888df8f.js';
8
+ import './pesquisa-fetcher-8edaa8cd.js';
9
9
  import './ISave-d8c8bc59.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import './dataunit-fetcher-3308edba.js';
12
+ import './dataunit-fetcher-3aac1a53.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import './form-config-fetcher-e0382e5a.js';
14
+ import './form-config-fetcher-adbe5d34.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
16
  import './SnkMessageBuilder-ae87b754.js';
17
- import './RecordIDUtils-87d02110.js';
18
17
  import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
18
+ import './GetSelectedRecordsIDsInfo-9fa41508.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  import '@sankhyalabs/core/dist/utils/SortingUtils';
21
21
  import './ResourceIDUtils-a114189a.js';
@@ -2,9 +2,9 @@ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host
2
2
  import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-ae87b754.js';
5
- import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-3308edba.js';
6
- import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-3aac1a53.js';
7
6
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
8
8
 
9
9
  const SnkDataUnit = class {
10
10
  constructor(hostRef) {
@@ -115,7 +115,7 @@ const SnkDataUnit = class {
115
115
  * @returns Retorna a lista de IDs dos registros selecionados.
116
116
  */
117
117
  async getSelectedRecordsIDsInfo() {
118
- return Promise.resolve(getSelectedIDs(this.dataUnit));
118
+ return getSelectedRecordsIDsInfo(this.dataUnit);
119
119
  }
120
120
  /**
121
121
  * Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
@@ -484,14 +484,7 @@ const SnkDataUnit = class {
484
484
  }
485
485
  handleRecordsRemoved(action) {
486
486
  var _a, _b;
487
- const cachedRecords = action.payload.cachedRecords;
488
- let removeFinishMsg;
489
- if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
490
- removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
491
- }
492
- else {
493
- removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
494
- }
487
+ let removeFinishMsg = this.buildRemoveFinishMessage(action);
495
488
  if (removeFinishMsg != undefined) {
496
489
  this.showSuccessMessage(removeFinishMsg);
497
490
  }
@@ -502,6 +495,14 @@ const SnkDataUnit = class {
502
495
  this.dataUnit.gotoPage(page);
503
496
  }
504
497
  }
498
+ buildRemoveFinishMessage(action) {
499
+ const records = action.payload.records;
500
+ if (!records || !records.length)
501
+ return undefined;
502
+ if ((records === null || records === void 0 ? void 0 : records.length) > 1)
503
+ return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
504
+ return this.getMessage('snkDataUnit.removeInfo', records);
505
+ }
505
506
  /**
506
507
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
507
508
  * através de um pequeno modulo na estrutura da aplicação:
@@ -1,15 +1,15 @@
1
- export { S as snk_data_unit } from './snk-data-unit-f4727294.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-6888df8f.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import './SnkMessageBuilder-ae87b754.js';
6
- import './dataunit-fetcher-3308edba.js';
7
- import './DataFetcher-773a3e4b.js';
6
+ import './dataunit-fetcher-3aac1a53.js';
7
+ import './DataFetcher-a9c598f2.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
12
12
  import '@sankhyalabs/core/dist/utils/SortingUtils';
13
13
  import './ResourceIDUtils-a114189a.js';
14
- import './RecordIDUtils-87d02110.js';
15
14
  import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
15
+ import './GetSelectedRecordsIDsInfo-9fa41508.js';
@@ -1,21 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-139f09fa.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import './DataFetcher-773a3e4b.js';
6
- import './pesquisa-fetcher-a87445a0.js';
5
+ import './DataFetcher-a9c598f2.js';
6
+ import './pesquisa-fetcher-8edaa8cd.js';
7
7
  import { P as PresentationMode } from './index-3aa4977a.js';
8
8
  import './ISave-d8c8bc59.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-3308edba.js';
11
+ import './dataunit-fetcher-3aac1a53.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-e0382e5a.js';
13
+ import './form-config-fetcher-adbe5d34.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
15
15
  import { d as VIEW_MODE } from './constants-8457af36.js';
16
- import { S as SnkGuidesViewer } from './snk-guides-viewer-57cfa507.js';
16
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-cb8a0b48.js';
17
17
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-ae87b754.js';
18
- import './ConfigStorage-e476378d.js';
18
+ import './ConfigStorage-7b36d041.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
@@ -263,7 +263,7 @@ const SnkDetailView = class {
263
263
  this.emitSwitchEvent(VIEW_MODE.GRID);
264
264
  evt.stopPropagation();
265
265
  }
266
- if (evt.detail === TaskbarElement.FORM_MODE) {
266
+ if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE) {
267
267
  this.emitSwitchEvent(VIEW_MODE.FORM);
268
268
  evt.stopPropagation();
269
269
  }
@@ -287,7 +287,7 @@ const SnkDetailView = class {
287
287
  }
288
288
  componentWillLoad() {
289
289
  this._configName = `dynaform.${this.entityName}`;
290
- this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
290
+ this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata(), this.dataUnit);
291
291
  this.formConfigManager.loadConfig();
292
292
  if (this.messagesBuilder == undefined) {
293
293
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-e476378d.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-7b36d041.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
8
8
  import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
9
9
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
10
10
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
11
- import './form-config-fetcher-e0382e5a.js';
12
- import './DataFetcher-773a3e4b.js';
11
+ import './form-config-fetcher-adbe5d34.js';
12
+ import './DataFetcher-a9c598f2.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
15
 
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
- import { C as ConfigStorage } from './ConfigStorage-e476378d.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-7b36d041.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-e0382e5a.js';
8
- import './DataFetcher-773a3e4b.js';
7
+ import './form-config-fetcher-adbe5d34.js';
8
+ import './DataFetcher-a9c598f2.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -3,9 +3,9 @@ import { S as Sortable } from './Sortable-83960219.js';
3
3
  import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { C as CONFIG_EVENTS, a as CONFIG_SORTABLE_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-8457af36.js';
6
- import { U as UserConfigType } from './form-config-fetcher-e0382e5a.js';
6
+ import { U as UserConfigType } from './form-config-fetcher-adbe5d34.js';
7
7
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
8
- import './DataFetcher-773a3e4b.js';
8
+ import './DataFetcher-a9c598f2.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -202,6 +202,11 @@ const SnkFormConfig = class {
202
202
  this.configManager.saveConfig(this.buildConfigToSave())
203
203
  .then(savedConfig => {
204
204
  ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
205
+ const userOption = this._formConfigOptions
206
+ .find((config) => {
207
+ return config.origin === UserConfigType.USER;
208
+ });
209
+ this.setFormConfig(userOption);
205
210
  this.configChange.emit(savedConfig);
206
211
  });
207
212
  }
@@ -535,9 +540,12 @@ const SnkFormConfig = class {
535
540
  switch (this._optionFormConfigSelected.origin) {
536
541
  case UserConfigType.DEFAULT:
537
542
  config = await this.configManager.fetchDefaultConfig();
543
+ if (!config) {
544
+ config = this.configManager.getEmptyConfig();
545
+ }
538
546
  break;
539
- case UserConfigType.DEFAULT:
540
- config = await this.configManager.fetchDefaultConfig();
547
+ default:
548
+ config = this.getConfig();
541
549
  break;
542
550
  }
543
551
  if (config != undefined) {
@@ -740,6 +748,9 @@ const SnkFormConfig = class {
740
748
  if (layoutFormConfig == undefined) {
741
749
  layoutFormConfig = [];
742
750
  }
751
+ if (this._formConfig.defaultConfiguration) {
752
+ return layoutFormConfig;
753
+ }
743
754
  return this._formConfig.tabs.map((tab) => {
744
755
  return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
745
756
  || { tab: tab.label, groups: [], visible: tab.visible };
@@ -1,13 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-139f09fa.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
- import './ConfigStorage-e476378d.js';
6
- import './form-config-fetcher-e0382e5a.js';
7
- import './DataFetcher-773a3e4b.js';
5
+ import './ConfigStorage-7b36d041.js';
6
+ import './form-config-fetcher-adbe5d34.js';
7
+ import './DataFetcher-a9c598f2.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
+ import './constants-8457af36.js';
11
12
 
12
13
  const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
13
14
 
@@ -100,7 +101,7 @@ const SnkForm = class {
100
101
  if (this.resourceID == undefined) {
101
102
  this.resourceID = await ResourceIDUtils.getResourceID();
102
103
  }
103
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
104
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
104
105
  this.addFormLegacyConfig();
105
106
  await this._configManager.loadConfig();
106
107
  }
@@ -129,7 +130,7 @@ const SnkForm = class {
129
130
  if (!this._dataUnit || !this._dataState) {
130
131
  return undefined;
131
132
  }
132
- return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
133
+ return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
133
134
  h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
134
135
  }
135
136
  get _element() { return getElement(this); }
@@ -1,21 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
4
- import { C as ConfigStorage } from './ConfigStorage-e476378d.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-7b36d041.js';
5
5
  import { P as PresentationMode } from './index-3aa4977a.js';
6
6
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-24f1d5be.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter } from './IExporterProvider-09df2e3e.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
- import './DataFetcher-773a3e4b.js';
11
- import './pesquisa-fetcher-a87445a0.js';
10
+ import './DataFetcher-a9c598f2.js';
11
+ import './pesquisa-fetcher-8edaa8cd.js';
12
12
  import './ISave-d8c8bc59.js';
13
13
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
- import './dataunit-fetcher-3308edba.js';
15
+ import './dataunit-fetcher-3aac1a53.js';
16
16
  import './filter-item-type.enum-d45e026f.js';
17
- import './form-config-fetcher-e0382e5a.js';
18
- import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
17
+ import './form-config-fetcher-adbe5d34.js';
18
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
20
20
  import './PrintUtils-3e4ff0f5.js';
21
21
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -44,7 +44,7 @@ class ServerSideExporterProvider extends CommonsExporter {
44
44
  return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
45
45
  }
46
46
  getSelectedIDs() {
47
- return getSelectedIDs(this.dataUnit);
47
+ return getSelectedRecordsIDsInfo(this.dataUnit);
48
48
  }
49
49
  getOffset() {
50
50
  return this.getExporterOffset(this.getPaginationInfo());
@@ -1,19 +1,19 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
2
  import { Action, ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-139f09fa.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
6
6
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
7
7
  import { d as VIEW_MODE } from './constants-8457af36.js';
8
- import './DataFetcher-773a3e4b.js';
9
- import './pesquisa-fetcher-a87445a0.js';
8
+ import './DataFetcher-a9c598f2.js';
9
+ import './pesquisa-fetcher-8edaa8cd.js';
10
10
  import { P as PresentationMode } from './index-3aa4977a.js';
11
11
  import './ISave-d8c8bc59.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
- import './dataunit-fetcher-3308edba.js';
14
+ import './dataunit-fetcher-3aac1a53.js';
15
15
  import './filter-item-type.enum-d45e026f.js';
16
- import './form-config-fetcher-e0382e5a.js';
16
+ import './form-config-fetcher-adbe5d34.js';
17
17
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
18
18
 
19
19
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
@@ -375,11 +375,14 @@ const SnkGuidesViewer = class {
375
375
  this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
376
376
  }
377
377
  }
378
+ setMasterFormConfig(config) {
379
+ this.masterFormConfig = config;
380
+ }
378
381
  componentWillLoad() {
379
382
  if (this.resourceID == undefined) {
380
383
  throw new Error("Erro interno: resourceID não informado");
381
384
  }
382
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
385
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
383
386
  this.addFormLegacyConfigName();
384
387
  this._configManager.loadConfig();
385
388
  }
@@ -407,7 +410,7 @@ const SnkGuidesViewer = class {
407
410
  return this._fieldSearch;
408
411
  }
409
412
  fieldsOptionLoader(argument) {
410
- return Promise.resolve(this._configManager.getFieldsList(this.dataUnit, argument)
413
+ return Promise.resolve(this._configManager.getFieldsList(argument)
411
414
  .map(field => ({ value: field.name, label: field.label })));
412
415
  }
413
416
  onSelectField(option, actionButton) {
@@ -1,23 +1,23 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-57cfa507.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-cb8a0b48.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
- import './SnkFormConfigManager-298cd647.js';
5
- import './ConfigStorage-e476378d.js';
6
- import './form-config-fetcher-e0382e5a.js';
7
- import './DataFetcher-773a3e4b.js';
4
+ import './SnkFormConfigManager-139f09fa.js';
5
+ import './ConfigStorage-7b36d041.js';
6
+ import './form-config-fetcher-adbe5d34.js';
7
+ import './DataFetcher-a9c598f2.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
+ import './constants-8457af36.js';
11
12
  import '@sankhyalabs/ezui/dist/collection/utils/form';
12
13
  import './field-search-efbe307f.js';
13
14
  import './taskbar-elements-d59867f1.js';
14
15
  import './index-3aa4977a.js';
15
16
  import './index-bdf75557.js';
16
- import './constants-8457af36.js';
17
- import './pesquisa-fetcher-a87445a0.js';
17
+ import './pesquisa-fetcher-8edaa8cd.js';
18
18
  import './ISave-d8c8bc59.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
20
- import './dataunit-fetcher-3308edba.js';
20
+ import './dataunit-fetcher-3aac1a53.js';
21
21
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
22
22
  import '@sankhyalabs/core/dist/utils/SortingUtils';
23
23
  import './ResourceIDUtils-a114189a.js';
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
4
- import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-e476378d.js';
4
+ import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-7b36d041.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { a as FilterGroupCondition } from './index-ae591a44.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-e0382e5a.js';
10
- import './DataFetcher-773a3e4b.js';
9
+ import './form-config-fetcher-adbe5d34.js';
10
+ import './DataFetcher-a9c598f2.js';
11
11
  import './PrintUtils-3e4ff0f5.js';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
13
 
@@ -3,20 +3,20 @@ import { UserInterface, StringUtils, ApplicationContext, ObjectUtils, DataType,
3
3
  import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
6
- import './DataFetcher-773a3e4b.js';
7
- import './pesquisa-fetcher-a87445a0.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-24f1d5be.js';
6
+ import './DataFetcher-a9c598f2.js';
7
+ import './pesquisa-fetcher-8edaa8cd.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, a as CrudUtils } from './IExporterProvider-09df2e3e.js';
9
9
  import { D as DataExporterOption, P as PresentationMode } from './index-3aa4977a.js';
10
10
  import './ISave-d8c8bc59.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
- import { I as InMemoryLoader } from './dataunit-fetcher-3308edba.js';
13
+ import { I as InMemoryLoader } from './dataunit-fetcher-3aac1a53.js';
14
14
  import './filter-item-type.enum-d45e026f.js';
15
- import { F as FormConfigFetcher } from './form-config-fetcher-e0382e5a.js';
15
+ import { F as FormConfigFetcher } from './form-config-fetcher-adbe5d34.js';
16
16
  import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-efbe307f.js';
17
- import { C as ConfigStorage } from './ConfigStorage-e476378d.js';
18
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
19
- import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
17
+ import { C as ConfigStorage } from './ConfigStorage-7b36d041.js';
18
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-139f09fa.js';
19
+ import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
20
20
  import { s as store } from './index-bdf75557.js';
21
21
  import './PrintUtils-3e4ff0f5.js';
22
22
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
@@ -37,7 +37,7 @@ class ClientSideExporterProvider extends CommonsExporter {
37
37
  return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
38
38
  }
39
39
  getSelectedIDs() {
40
- return getSelectedIDs(this.dataUnit);
40
+ return getSelectedRecordsIDsInfo(this.dataUnit);
41
41
  }
42
42
  getRecordID() {
43
43
  var _a, _b, _c;
@@ -355,7 +355,7 @@ const SnkSimpleCrud = class {
355
355
  return;
356
356
  }
357
357
  if (this._formConfigManager == undefined) {
358
- this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID());
358
+ this._formConfigManager = new SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
359
359
  this._formConfigManager.setConfig(this.formConfig);
360
360
  }
361
361
  if (this.formConfigIsLoaded() && !forceLoad) {
@@ -11,6 +11,8 @@ const SnkTaskbar = class {
11
11
  constructor(hostRef) {
12
12
  registerInstance(this, hostRef);
13
13
  this.actionClick = createEvent(this, "actionClick", 7);
14
+ this.taskbarSaveLocker = createEvent(this, "taskbarSaveLocker", 7);
15
+ this.taskbarSaveUnlocker = createEvent(this, "taskbarSaveUnlocker", 7);
14
16
  this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
15
17
  this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
16
18
  this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
@@ -34,6 +36,7 @@ const SnkTaskbar = class {
34
36
  this.onSaveEvent = (action) => {
35
37
  switch (action.type) {
36
38
  case Action.FIELD_INVALIDATED:
39
+ case Action.INVALIDATE_CLEAN:
37
40
  case Action.DATA_SAVED:
38
41
  case Action.SAVING_ERROR:
39
42
  this._isWaitingForSave = false;
@@ -72,6 +75,16 @@ const SnkTaskbar = class {
72
75
  this.getCustomElements(true);
73
76
  }
74
77
  }
78
+ handleTaskbarSaveLocker() {
79
+ if (this._isWaitingForSave !== true) {
80
+ this._isWaitingForSave = true;
81
+ }
82
+ }
83
+ handleTaskbarSaveUnlocker() {
84
+ if (this._isWaitingForSave === true) {
85
+ this._isWaitingForSave = false;
86
+ }
87
+ }
75
88
  hasToSearchCustomElements(event) {
76
89
  return this.customSlotId === event.detail && !this._slotContainer;
77
90
  }
@@ -90,6 +103,14 @@ const SnkTaskbar = class {
90
103
  this._hasToUpdateOverFlow = true;
91
104
  }
92
105
  }
106
+ observeIsWaitingForSave(newValue, oldValue) {
107
+ if (newValue == true && oldValue == false) {
108
+ this.taskbarSaveLocker.emit();
109
+ }
110
+ if (newValue == false && oldValue == true) {
111
+ this.taskbarSaveUnlocker.emit();
112
+ }
113
+ }
93
114
  // Internal methods
94
115
  elementsFromString(strButtons) {
95
116
  const elements = [];
@@ -418,7 +439,8 @@ const SnkTaskbar = class {
418
439
  static get watchers() { return {
419
440
  "buttons": ["observeButtons"],
420
441
  "disabledButtons": ["observeDisabledButtons"],
421
- "_lastWidth": ["observeLastWidth"]
442
+ "_lastWidth": ["observeLastWidth"],
443
+ "_isWaitingForSave": ["observeIsWaitingForSave"]
422
444
  }; }
423
445
  };
424
446
  SnkTaskbar.style = snkTaskbarCss;
@@ -1,4 +1,4 @@
1
- import{d as e,D as t}from"./p-594bc21d.js";import{ObjectUtils as r}from"@sankhyalabs/core";class s{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
1
+ import{d as e,D as t}from"./p-f3434fc4.js";import{ObjectUtils as r}from"@sankhyalabs/core";class s{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  resource
4
4
  }
@@ -23,4 +23,4 @@ import{d as e,D as t}from"./p-594bc21d.js";import{ObjectUtils as r}from"@sankhya
23
23
  name
24
24
  resource
25
25
  }
26
- }`)}loadFormConfig(e,t){return new Promise(((r,s)=>{Promise.all([this.loadResource(this.getPath(t,e)),this.loadResource(this.getPath(`FormCardState:${t}`,e,"form-card")),this.loadResource(this.getPath(t,e,"summary")),this.loadResource(this.getPath(t,e,"defaultValues"))]).then((([e,t,s,n])=>{let i;if(null!=e){i=Object.assign(Object.assign({},JSON.parse(e)),{emptyConfig:!1});const{tabs:t,fields:r}=i;if(t){const e=new Map(t.map((e=>[e.label,e])));null==r||r.forEach((t=>{var r;return t.tab=(null===(r=e.get(this.getTabName(t.tab)))||void 0===r?void 0:r.label)||e.get(this.getTabName(t.tab))}))}i.fields=null==r?void 0:r.map((e=>{if("readonly"in e){const t=!0===e.readonly;delete e.readonly,e.readOnly=t}return e}))}null!=t&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.cardsState=new Map(JSON.parse(t))),null!=s&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.summary=new Map(Object.entries(JSON.parse(s)))),null!=n&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.defaultVars=new Map(Object.entries(JSON.parse(n)))),r(i)})).catch((e=>{s(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveCardState(e,t,r){const s=this.getPath(`FormCardState:${r}`,t,"form-card");return new Promise(((t,r)=>{this.saveResource(Array.from(e.entries()),s).then((e=>{t(new Map(JSON.parse(e.resource)))})).catch((e=>{r(e)}))}))}saveConfig(e,t,r){delete e.cardsState,delete e.defaultVars,delete e.summary;const s=this.getPath(r,t);return new Promise(((t,r)=>{this.saveResource(e,s).then((e=>{t(JSON.parse(e.resource))})).catch((e=>{r(e)}))}))}fetchUserAvailableConfigs(e,r){const s=this.getPath(r,e);return new Promise(((e,r)=>{t.get().callGraphQL({values:{name:s},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((t=>{e(t)})).catch((e=>{r(e)}))}))}fetchLegacyConfig(e,s){const n=this.getPath(s,e);return new Promise(((e,s)=>{t.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchLegacyConfig")}).then((t=>{e(r.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{s(e)}))}))}fetchDefaultConfig(e,s){const n=this.getPath(s,e);return new Promise(((e,s)=>{t.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchDefaultConfig")}).then((t=>{e(r.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{s(e)}))}))}getPath(e,t,r="form"){return t?`cfg://${r}/${e}/${t}`:`cfg://${r}/${e}`}async fetchLegacyConfigurableForm(e){const s={requestBody:{config:{chave:e,tipo:"T"}}},n=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s));if(!r.isEmpty(n))return this.buildLegacyConfigurableForm(n)}buildLegacyConfigurableForm(e){var t,r,s;const n=null!==(s=null===(r=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===r?void 0:r.field)&&void 0!==s?s:[];return{emptyConfig:!1,fields:Array.isArray(n)?n:[n]}}}var i;!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(i||(i={}));export{n as F,s as R,i as U}
26
+ }`)}loadFormConfig(e,t){return new Promise(((r,s)=>{Promise.all([this.loadResource(this.getPath(t,e)),this.loadResource(this.getPath(`FormCardState:${t}`,e,"form-card")),this.loadResource(this.getPath(t,e,"summary")),this.loadResource(this.getPath(t,e,"defaultValues"))]).then((([e,t,s,n])=>{let i;if(null!=e){i=Object.assign(Object.assign({},JSON.parse(e)),{emptyConfig:!1});const{tabs:t,fields:r}=i;if(t){const e=new Map(t.map((e=>[e.label,e])));null==r||r.forEach((t=>{var r;return t.tab=(null===(r=e.get(this.getTabName(t.tab)))||void 0===r?void 0:r.label)||e.get(this.getTabName(t.tab))}))}i.fields=null==r?void 0:r.map((e=>{if("readonly"in e){const t=!0===e.readonly;delete e.readonly,e.readOnly=t}return e}))}null!=t&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.cardsState=new Map(JSON.parse(t))),null!=s&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.summary=new Map(Object.entries(JSON.parse(s)))),null!=n&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.defaultVars=new Map(Object.entries(JSON.parse(n)))),r(i)})).catch((e=>{s(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveCardState(e,t,r){const s=this.getPath(`FormCardState:${r}`,t,"form-card");return new Promise(((t,r)=>{this.saveResource(Array.from(e.entries()),s).then((e=>{t(new Map(JSON.parse(e.resource)))})).catch((e=>{r(e)}))}))}saveConfig(e,t,r){delete e.cardsState,delete e.defaultVars,delete e.summary;const s=this.getPath(r,t);return new Promise(((t,r)=>{this.saveResource(e,s).then((e=>{t(JSON.parse(e.resource))})).catch((e=>{r(e)}))}))}fetchUserAvailableConfigs(e,r){const s=this.getPath(r,e);return new Promise(((e,r)=>{t.get().callGraphQL({values:{name:s},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((t=>{e(t)})).catch((e=>{r(e)}))}))}fetchLegacyConfig(e,s){const n=this.getPath(s,e);return new Promise(((e,s)=>{t.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchLegacyConfig")}).then((t=>{e(r.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{s(e)}))}))}fetchDefaultConfig(e,s){const n=this.getPath(s,e);return new Promise(((e,s)=>{t.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchDefaultConfig")}).then((t=>{(null==t?void 0:t.resource)||e(null),e(r.stringToObject(null==t?void 0:t.resource))})).catch((e=>{s(e)}))}))}getPath(e,t,r="form"){return t?`cfg://${r}/${e}/${t}`:`cfg://${r}/${e}`}async fetchLegacyConfigurableForm(e){const s={requestBody:{config:{chave:e,tipo:"T"}}},n=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s));if(!r.isEmpty(n))return this.buildLegacyConfigurableForm(n)}buildLegacyConfigurableForm(e){var t,r,s;const n=null!==(s=null===(r=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===r?void 0:r.field)&&void 0!==s?s:[];return{emptyConfig:!1,fields:Array.isArray(n)?n:[n]}}}var i;!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(i||(i={}));export{n as F,s as R,i as U}