@sankhyalabs/sankhyablocks 8.16.0-dev.2 → 8.16.0-dev.20

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 (151) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-e49214c6.js} +3 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{IExporterProvider-9479f618.js → IExporterProvider-10b7fed5.js} +4 -4
  4. package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-beebf47a.js} +7 -9
  5. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-cceebbae.js} +2 -2
  6. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-0c7106a0.js → dataunit-fetcher-d4873076.js} +8 -4
  8. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
  13. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  14. package/dist/cjs/snk-attach.cjs.entry.js +36 -25
  15. package/dist/cjs/snk-crud.cjs.entry.js +11 -6
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
  17. package/dist/cjs/{snk-data-unit-16791a2f.js → snk-data-unit-11e31d8d.js} +23 -11
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -11
  20. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -11
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  25. package/dist/cjs/snk-grid.cjs.entry.js +9 -9
  26. package/dist/cjs/{snk-guides-viewer-d82746e8.js → snk-guides-viewer-aafc3073.js} +12 -7
  27. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  28. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -11
  30. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  31. package/dist/collection/components/snk-attach/snk-attach.js +24 -15
  32. package/dist/collection/components/snk-crud/snk-crud.js +57 -1
  33. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -3
  34. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +22 -2
  35. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  36. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  37. package/dist/collection/components/snk-data-unit/snk-data-unit.js +38 -9
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +16 -8
  39. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +5 -7
  40. package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
  41. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  42. package/dist/collection/components/snk-grid/snk-grid.js +2 -2
  43. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -4
  44. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  45. package/dist/collection/lib/configs/ConfigStorage.js +1 -0
  46. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +7 -3
  47. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  48. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  49. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  50. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  51. package/dist/components/ConfigStorage.js +1 -0
  52. package/dist/components/DataFetcher.js +8 -3
  53. package/dist/components/SnkFormConfigManager.js +5 -7
  54. package/dist/components/SnkMessageBuilder.js +2 -2
  55. package/dist/components/dataunit-fetcher.js +7 -3
  56. package/dist/components/snk-attach2.js +31 -20
  57. package/dist/components/snk-crud.js +8 -1
  58. package/dist/components/snk-data-exporter2.js +2 -2
  59. package/dist/components/snk-data-unit2.js +22 -9
  60. package/dist/components/snk-detail-view2.js +10 -5
  61. package/dist/components/snk-exporter-email-sender2.js +1 -1
  62. package/dist/components/snk-filter-bar2.js +16 -8
  63. package/dist/components/snk-form-config2.js +1 -1
  64. package/dist/components/snk-grid2.js +3 -3
  65. package/dist/components/snk-simple-crud2.js +7 -4
  66. package/dist/components/snk-taskbar2.js +24 -2
  67. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-e476378d.js} +3 -2
  68. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  69. package/dist/esm/{IExporterProvider-5a858363.js → IExporterProvider-d597f27d.js} +4 -4
  70. package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-298cd647.js} +7 -9
  71. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-ae87b754.js} +2 -2
  72. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  73. package/dist/esm/{dataunit-fetcher-f7e0ffc0.js → dataunit-fetcher-3d2ec959.js} +8 -4
  74. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
  77. package/dist/esm/sankhyablocks.js +1 -1
  78. package/dist/esm/snk-actions-button_4.entry.js +5 -5
  79. package/dist/esm/snk-application.entry.js +7 -7
  80. package/dist/esm/snk-attach.entry.js +36 -25
  81. package/dist/esm/snk-crud.entry.js +11 -6
  82. package/dist/esm/snk-data-exporter.entry.js +8 -8
  83. package/dist/esm/{snk-data-unit-a327d22c.js → snk-data-unit-29de836f.js} +23 -11
  84. package/dist/esm/snk-data-unit.entry.js +4 -4
  85. package/dist/esm/snk-detail-view.entry.js +10 -11
  86. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  87. package/dist/esm/snk-filter-bar.entry.js +19 -11
  88. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  89. package/dist/esm/snk-form-config.entry.js +3 -3
  90. package/dist/esm/snk-form.entry.js +4 -4
  91. package/dist/esm/snk-grid.entry.js +9 -9
  92. package/dist/esm/{snk-guides-viewer-874da66f.js → snk-guides-viewer-62124f3d.js} +12 -7
  93. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  94. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  95. package/dist/esm/snk-simple-crud.entry.js +13 -11
  96. package/dist/esm/snk-taskbar.entry.js +23 -1
  97. package/dist/sankhyablocks/p-08c28ddd.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-6d4f4614.js → p-091ce761.js} +1 -1
  99. package/dist/sankhyablocks/{p-b8cde0d8.entry.js → p-094eebf6.entry.js} +1 -1
  100. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  101. package/dist/sankhyablocks/p-12f45f86.entry.js +1 -0
  102. package/dist/sankhyablocks/{p-60e46675.entry.js → p-162b9a59.entry.js} +2 -2
  103. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  104. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  105. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  106. package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
  107. package/dist/sankhyablocks/{p-8fc470e5.entry.js → p-2e9c764c.entry.js} +1 -1
  108. package/dist/sankhyablocks/{p-aff76a53.js → p-3287a6cc.js} +2 -2
  109. package/dist/sankhyablocks/{p-b7c4feeb.entry.js → p-421bec84.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
  111. package/dist/sankhyablocks/p-53949130.entry.js +1 -0
  112. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  113. package/dist/sankhyablocks/p-5b26cc7c.entry.js +1 -0
  114. package/dist/sankhyablocks/p-5b9160c6.entry.js +1 -0
  115. package/dist/sankhyablocks/{p-7d9baaf4.entry.js → p-5e384af4.entry.js} +1 -1
  116. package/dist/sankhyablocks/p-5f016aed.js +1 -0
  117. package/dist/sankhyablocks/p-70001ac1.js +1 -0
  118. package/dist/sankhyablocks/{p-e6210aec.js → p-76a65660.js} +1 -1
  119. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  120. package/dist/sankhyablocks/p-8f4e743f.js +1 -0
  121. package/dist/sankhyablocks/p-939e15d3.entry.js +1 -0
  122. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-9dfda04a.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-bd008859.entry.js} +1 -1
  124. package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
  125. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  126. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  127. package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
  128. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
  129. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
  130. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  131. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
  132. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  133. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  134. package/dist/types/components.d.ts +49 -0
  135. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  136. package/package.json +2 -2
  137. package/dist/sankhyablocks/p-0046959e.entry.js +0 -1
  138. package/dist/sankhyablocks/p-0e11ee18.entry.js +0 -1
  139. package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
  140. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  141. package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
  142. package/dist/sankhyablocks/p-6ded2076.entry.js +0 -1
  143. package/dist/sankhyablocks/p-7a337364.js +0 -1
  144. package/dist/sankhyablocks/p-829d4045.js +0 -1
  145. package/dist/sankhyablocks/p-8c6b44ea.entry.js +0 -1
  146. package/dist/sankhyablocks/p-a4b1f1eb.js +0 -1
  147. package/dist/sankhyablocks/p-c7cbad38.js +0 -1
  148. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  149. package/dist/sankhyablocks/p-e0b9f59a.entry.js +0 -1
  150. package/dist/sankhyablocks/p-e9bbc3d5.entry.js +0 -1
  151. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
@@ -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-c1baf61d.js';
4
- import './pesquisa-fetcher-03c8f919.js';
3
+ import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
4
+ import './pesquisa-fetcher-a87445a0.js';
5
5
  import './index-3aa4977a.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
- import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-f7e0ffc0.js';
7
+ import { P as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-3d2ec959.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-30fb808f.js';
9
+ import './form-config-fetcher-e0382e5a.js';
10
10
  import { d as VIEW_MODE } from './constants-8457af36.js';
11
- import { A as AutorizationType } from './auth-fetcher-039abba3.js';
11
+ import { A as AutorizationType } from './auth-fetcher-a411f73c.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';
@@ -113,21 +113,23 @@ const SERVICE = {
113
113
  download: "AnexoSistemaSP.baixar",
114
114
  };
115
115
  class AnexoSistemaFetcher {
116
- constructor(entityName, registerKey, dataUnitName) {
116
+ constructor(entityName, dataUnitName) {
117
117
  var _a;
118
118
  this.entityName = entityName;
119
- this.registerKey = registerKey;
120
119
  this.dataUnitName = dataUnitName;
121
120
  this.validateFields = (fields) => {
122
121
  if (!!fields.LINK && !!fields.NOMEARQUIVO)
123
122
  throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
124
123
  if (!fields.LINK && !fields.NOMEARQUIVO)
125
124
  throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
126
- if (!this.registerKey)
125
+ if (!this._registerKey)
127
126
  throw new Error('Register key can not be null');
128
127
  };
129
128
  this.resourceID = (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID));
130
129
  }
130
+ set registerKey(registerKey) {
131
+ this._registerKey = registerKey;
132
+ }
131
133
  async save(change) {
132
134
  var _a, _b;
133
135
  let { updatingFields: fields } = change;
@@ -146,7 +148,7 @@ class AnexoSistemaFetcher {
146
148
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
147
149
  link: fields.LINK,
148
150
  nameEntity: this.entityName,
149
- pkEntity: this.registerKey,
151
+ pkEntity: this._registerKey,
150
152
  typeAcess: fields.TIPOACESSO,
151
153
  typeApres: fields.TIPOAPRES,
152
154
  }
@@ -186,7 +188,7 @@ class AnexoSistemaFetcher {
186
188
  nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
187
189
  link: fields.LINK,
188
190
  nameEntity: this.entityName,
189
- pkEntity: this.registerKey,
191
+ pkEntity: this._registerKey,
190
192
  typeAcess: fields.TIPOACESSO,
191
193
  typeApres: fields.TIPOAPRES,
192
194
  }
@@ -656,11 +658,20 @@ const SnkAttach = class {
656
658
  this.loadAttachmentDataUnit();
657
659
  }
658
660
  if (oldRegisterKey !== newRegisterKey) {
661
+ if (this._currentFetcher instanceof AnexoSistemaFetcher) {
662
+ this._currentFetcher.registerKey = newRegisterKey;
663
+ }
659
664
  await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
660
665
  }
661
666
  }
667
+ getAnexoSistemaFetcherInstance() {
668
+ var _a;
669
+ const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
670
+ anexoSistemaFetcher.registerKey = this.registerKey;
671
+ return anexoSistemaFetcher;
672
+ }
662
673
  async initAttach() {
663
- var _a, _b, _c, _d, _e, _f;
674
+ var _a, _b, _c, _d, _e;
664
675
  if (!this.fetcherType && !this.registerKey)
665
676
  return;
666
677
  if (!this.fetcherType) {
@@ -668,18 +679,18 @@ const SnkAttach = class {
668
679
  }
669
680
  this.returnToGridMode();
670
681
  if (this.fetcherType === "AnexoSistema") {
671
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
672
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
673
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
682
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
683
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
684
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
674
685
  return;
675
686
  }
676
687
  if (this.fetcherType === "Attach") {
677
- const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
688
+ const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
678
689
  if (hasMoreOneItem)
679
690
  return;
680
691
  }
681
- await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata());
682
- await ((_f = this._currentDataUnit) === null || _f === void 0 ? void 0 : _f.loadData(undefined, undefined, true, this.registerKey));
692
+ await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
693
+ await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
683
694
  }
684
695
  /**
685
696
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -738,11 +749,11 @@ const SnkAttach = class {
738
749
  }
739
750
  }
740
751
  async loadAnexoSistema() {
741
- var _a, _b, _c;
752
+ var _a, _b;
742
753
  this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
743
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
754
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
744
755
  if (!this._currentDataUnit.metadata) {
745
- await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata());
756
+ await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
746
757
  this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
747
758
  }
748
759
  this.initDataUnitLoaders();
@@ -752,7 +763,7 @@ const SnkAttach = class {
752
763
  this._currentDataUnit.addInterceptor({
753
764
  interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
754
765
  });
755
- await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
766
+ await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
756
767
  this.disableEditFieldsNotInForm();
757
768
  }
758
769
  async loadAttach() {
@@ -778,16 +789,16 @@ const SnkAttach = class {
778
789
  }
779
790
  }
780
791
  initDataUnitLoaders() {
781
- var _a, _b, _c;
792
+ var _a, _b;
782
793
  if (this.fetcherType === "AnexoSistema") {
783
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
794
+ this._currentFetcher = this.getAnexoSistemaFetcherInstance();
784
795
  this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
785
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
796
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
786
797
  }
787
798
  if (this.fetcherType === "Attach") {
788
799
  this._currentFetcher = new AttachFetcher();
789
800
  this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
790
- (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
801
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
791
802
  this.returnToGridMode();
792
803
  await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
793
804
  });
@@ -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-c1baf61d.js';
5
- import './pesquisa-fetcher-03c8f919.js';
4
+ import './DataFetcher-773a3e4b.js';
5
+ import './pesquisa-fetcher-a87445a0.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-f7e0ffc0.js';
10
+ import './dataunit-fetcher-3d2ec959.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-30fb808f.js';
12
+ import './form-config-fetcher-e0382e5a.js';
13
13
  import { d as VIEW_MODE } from './constants-8457af36.js';
14
- import { A as AutorizationType } from './auth-fetcher-039abba3.js';
14
+ import { A as AutorizationType } from './auth-fetcher-a411f73c.js';
15
15
  import './index-bdf75557.js';
16
16
  import './PrintUtils-3e4ff0f5.js';
17
17
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -27,6 +27,7 @@ const SnkCrud = class {
27
27
  this.configuratorSave = createEvent(this, "configuratorSave", 7);
28
28
  this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
29
29
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
30
+ this.viewModeChanged = createEvent(this, "viewModeChanged", 7);
30
31
  this._keyDownHandler = async (event) => this.keyDownListener(event);
31
32
  this._viewHistory = [];
32
33
  this._customEditors = new Map();
@@ -55,6 +56,8 @@ const SnkCrud = class {
55
56
  this.disablePersonalizedFilter = undefined;
56
57
  this.autoLoad = undefined;
57
58
  this.autoFocus = true;
59
+ this.domainMessagesBuilder = undefined;
60
+ this.setCustomFormTitle = undefined;
58
61
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
59
62
  }
60
63
  /**
@@ -163,6 +166,7 @@ const SnkCrud = class {
163
166
  else if (viewMode === VIEW_MODE.FORM) {
164
167
  this._guidesViewer.setFocus();
165
168
  }
169
+ this.viewModeChanged.emit(viewMode);
166
170
  }
167
171
  openConfig(viewMode) {
168
172
  this._snkConfigurator.close();
@@ -226,6 +230,7 @@ const SnkCrud = class {
226
230
  this._snkDataUnit = parent;
227
231
  this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
228
232
  this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
233
+ this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
229
234
  this._dataUnit = this._snkDataUnit.dataUnit;
230
235
  this._dataState = this._snkDataUnit.dataState;
231
236
  if (!this._dataUnit) {
@@ -391,7 +396,7 @@ const SnkCrud = class {
391
396
  return;
392
397
  }
393
398
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
394
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, 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 }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
399
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, 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 }, 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, getCustomTitle: this.setCustomFormTitle }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
395
400
  }
396
401
  get _element() { return getElement(this); }
397
402
  static get watchers() { return {
@@ -3,17 +3,17 @@ 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-c1baf61d.js';
7
- import { S as SnkDataUnit } from './snk-data-unit-a327d22c.js';
8
- import './pesquisa-fetcher-03c8f919.js';
6
+ import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
7
+ import { S as SnkDataUnit } from './snk-data-unit-29de836f.js';
8
+ import './pesquisa-fetcher-a87445a0.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-f7e0ffc0.js';
12
+ import './dataunit-fetcher-3d2ec959.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import './form-config-fetcher-30fb808f.js';
14
+ import './form-config-fetcher-e0382e5a.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
- import './SnkMessageBuilder-89925609.js';
16
+ import './SnkMessageBuilder-ae87b754.js';
17
17
  import './RecordIDUtils-87d02110.js';
18
18
  import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -131,7 +131,7 @@ class ItemBuilder {
131
131
  getExportToXLS(groupName) {
132
132
  return {
133
133
  id: DataExporterOption.EXPORT_TO_XLS,
134
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
134
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
135
135
  group: groupName
136
136
  };
137
137
  }
@@ -174,7 +174,7 @@ class ItemBuilder {
174
174
  getExportPageToXLS() {
175
175
  return {
176
176
  id: DataExporterOption.EXPORT_PAGE_TO_XLS,
177
- label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
177
+ label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
178
178
  };
179
179
  }
180
180
  /**
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
5
- import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-f7e0ffc0.js';
4
+ import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-ae87b754.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-3d2ec959.js';
6
6
  import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
7
7
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
8
8
 
@@ -59,6 +59,7 @@ const SnkDataUnit = class {
59
59
  this.ignoreSaveMessage = undefined;
60
60
  this.configName = undefined;
61
61
  this.resourceID = undefined;
62
+ this.domainMessagesBuilder = undefined;
62
63
  }
63
64
  observePageSize() {
64
65
  if (this.dataUnit) {
@@ -475,7 +476,8 @@ const SnkDataUnit = class {
475
476
  if (this.ignoreSaveMessage) {
476
477
  return;
477
478
  }
478
- const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
479
+ const saveOperation = action.payload.changes[0]._operation.toLowerCase();
480
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
479
481
  if (msg != undefined) {
480
482
  this.showSuccessMessage(msg);
481
483
  }
@@ -506,10 +508,13 @@ const SnkDataUnit = class {
506
508
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
507
509
  * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
508
510
  */
509
- getMessage(key, params = undefined) {
511
+ getMessage(key, params = undefined, customOperation) {
510
512
  if (!params) {
511
513
  params = this.getMessageParams();
512
514
  }
515
+ if (customOperation) {
516
+ this.messagesBuilder.currentOperation = customOperation;
517
+ }
513
518
  return this.messagesBuilder.getMessage(key, params);
514
519
  }
515
520
  getMessageParams() {
@@ -540,7 +545,7 @@ const SnkDataUnit = class {
540
545
  return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
541
546
  }
542
547
  }
543
- async loadDataUnit() {
548
+ async loadDataUnit(forceMetadataLoad = true) {
544
549
  var _a;
545
550
  if (this.dataUnit == null && this._application && this.entityName) {
546
551
  this.dataUnit = await this.getDataUnitParentOrChild();
@@ -550,9 +555,11 @@ const SnkDataUnit = class {
550
555
  this.dataUnit.unsubscribe(this._dataUnitObserver);
551
556
  this.dataUnit.addInterceptor(this);
552
557
  this.dataUnit.subscribe(this._dataUnitObserver);
553
- await this.dataUnit.loadMetadata();
558
+ if (forceMetadataLoad || !this.dataUnit.metadata)
559
+ await this.dataUnit.loadMetadata();
554
560
  if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
555
- this.getMetadataByRow(this.dataUnit);
561
+ const { records } = this.getMetadataByRow(this.dataUnit);
562
+ this.dataUnit.records = records;
556
563
  }
557
564
  this.dataState = this.buildDataState();
558
565
  let resolver;
@@ -616,6 +623,13 @@ const SnkDataUnit = class {
616
623
  parent = parent.parentElement;
617
624
  }
618
625
  }
626
+ instanceMessagesBuilder() {
627
+ var _a;
628
+ if (this.messagesBuilder) {
629
+ return;
630
+ }
631
+ this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
632
+ }
619
633
  //---------------------------------------------
620
634
  // Lifecycle web component
621
635
  //---------------------------------------------
@@ -623,9 +637,7 @@ const SnkDataUnit = class {
623
637
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
624
638
  this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
625
639
  this._parentSnkDataUnit = this.getParentSnkDataUnit();
626
- if (this.messagesBuilder == undefined) {
627
- this.messagesBuilder = new SnkMessageBuilder(this.entityName);
628
- }
640
+ this.instanceMessagesBuilder();
629
641
  }
630
642
  disconnectedCallback() {
631
643
  if (this.dataUnit) {
@@ -633,7 +645,7 @@ const SnkDataUnit = class {
633
645
  }
634
646
  }
635
647
  async componentDidLoad() {
636
- await this.loadDataUnit();
648
+ await this.loadDataUnit(false);
637
649
  this.handlerLinkFields();
638
650
  }
639
651
  render() {
@@ -1,10 +1,10 @@
1
- export { S as snk_data_unit } from './snk-data-unit-a327d22c.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-29de836f.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
- import './SnkMessageBuilder-89925609.js';
6
- import './dataunit-fetcher-f7e0ffc0.js';
7
- import './DataFetcher-c1baf61d.js';
5
+ import './SnkMessageBuilder-ae87b754.js';
6
+ import './dataunit-fetcher-3d2ec959.js';
7
+ import './DataFetcher-773a3e4b.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -1,21 +1,21 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-d4554df9.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import './DataFetcher-c1baf61d.js';
6
- import './pesquisa-fetcher-03c8f919.js';
5
+ import './DataFetcher-773a3e4b.js';
6
+ import './pesquisa-fetcher-a87445a0.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-f7e0ffc0.js';
11
+ import './dataunit-fetcher-3d2ec959.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-30fb808f.js';
13
+ import './form-config-fetcher-e0382e5a.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-874da66f.js';
17
- import { S as SnkMessageBuilder } from './SnkMessageBuilder-89925609.js';
18
- import './ConfigStorage-86187da3.js';
16
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-62124f3d.js';
17
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder-ae87b754.js';
18
+ import './ConfigStorage-e476378d.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';
@@ -223,14 +223,13 @@ const SnkDetailView = class {
223
223
  return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
224
224
  }
225
225
  loadMetadata() {
226
- var _a;
227
226
  if (!this.dataUnit) {
228
227
  return;
229
228
  }
230
229
  if (!this.formConfigManager.isLoaded) {
231
230
  return;
232
231
  }
233
- const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
232
+ const formConfig = this.formConfigManager.getConfig(this.dataUnit);
234
233
  //this._cardsState = formConfig?.cardsState;
235
234
  this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
236
235
  }
@@ -264,7 +263,7 @@ const SnkDetailView = class {
264
263
  this.emitSwitchEvent(VIEW_MODE.GRID);
265
264
  evt.stopPropagation();
266
265
  }
267
- if (evt.detail === TaskbarElement.FORM_MODE) {
266
+ if (evt.detail === TaskbarElement.FORM_MODE || evt.detail === TaskbarElement.UPDATE) {
268
267
  this.emitSwitchEvent(VIEW_MODE.FORM);
269
268
  evt.stopPropagation();
270
269
  }
@@ -16,7 +16,7 @@ const OptionsStep = ({ getMessage, changeInfo, data }) => {
16
16
  const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
17
17
  const formatOptions = [
18
18
  { label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
19
- { label: getMessage("snkExporter.emailSenderOptStep_formatXLSX"), value: "xlsx" }
19
+ { label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
20
20
  ];
21
21
  const typeOptions = [
22
22
  { label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
@@ -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-86187da3.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-e476378d.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-30fb808f.js';
12
- import './DataFetcher-c1baf61d.js';
11
+ import './form-config-fetcher-e0382e5a.js';
12
+ import './DataFetcher-773a3e4b.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
15
 
@@ -261,13 +261,13 @@ const SnkFilterBar = class {
261
261
  this._pendingVariables = false;
262
262
  this._customfiltersToBeUpdated = [];
263
263
  this._calculateSortIndex = (item) => {
264
- let index = item.hardFixed ? 1000000 : 0;
265
- //campos Hard Fixed não variam a ordem
266
- if (!item.hardFixed) {
267
- index += item.fixed ? 100000 : 0;
268
- index += item.value == undefined ? 0 : 10000;
269
- index += this._updateSequence.lastIndexOf(item.id) + 1;
270
- }
264
+ if (!item.visible)
265
+ return 0;
266
+ if (item.hardFixed)
267
+ return 1000000; //campos Hard Fixed não variam a ordem
268
+ let index = item.fixed ? 100000 : 0;
269
+ index += this.hasValidValue(item) ? 10000 : 0;
270
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
271
271
  return index;
272
272
  };
273
273
  this._filtersComparator = (a, b) => {
@@ -288,6 +288,13 @@ const SnkFilterBar = class {
288
288
  this.showPersonalizedFilter = false;
289
289
  this.personalizedFilterId = undefined;
290
290
  }
291
+ hasValidValue(item) {
292
+ if (item.value === undefined || item.value === null)
293
+ return false;
294
+ if (!Array.isArray(item.value))
295
+ return true;
296
+ return item.value.some(filterItem => filterItem.check === true);
297
+ }
291
298
  observeFilterConfig(newValue, oldValue) {
292
299
  if (ObjectUtils.equals(newValue, oldValue))
293
300
  return;
@@ -513,7 +520,7 @@ const SnkFilterBar = class {
513
520
  getFilterItems() {
514
521
  const pinnedItems = [];
515
522
  const unpinnedItems = [];
516
- this.filterConfig
523
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
517
524
  .filter(this.filterActiveFilter)
518
525
  .forEach((item, index) => {
519
526
  item = ObjectUtils.copy(item);
@@ -583,6 +590,7 @@ const SnkFilterBar = class {
583
590
  .then((filters) => {
584
591
  accept();
585
592
  this.filterConfig = filters.map(item => this.normalizeItem(item));
593
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
586
594
  })
587
595
  .catch(reason => {
588
596
  throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
@@ -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-86187da3.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-e476378d.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-30fb808f.js';
8
- import './DataFetcher-c1baf61d.js';
7
+ import './form-config-fetcher-e0382e5a.js';
8
+ import './DataFetcher-773a3e4b.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-30fb808f.js';
6
+ import { U as UserConfigType } from './form-config-fetcher-e0382e5a.js';
7
7
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
8
- import './DataFetcher-c1baf61d.js';
8
+ import './DataFetcher-773a3e4b.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -76,7 +76,7 @@ const SnkFormConfig = class {
76
76
  }
77
77
  }
78
78
  getConfig() {
79
- let config = this.configManager.getConfig(false, this.dataUnit);
79
+ let config = this.configManager.getConfig(this.dataUnit);
80
80
  if (config.fields && config.fields.length === 0) {
81
81
  config = undefined;
82
82
  }
@@ -1,10 +1,10 @@
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-d4554df9.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-298cd647.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
- import './ConfigStorage-86187da3.js';
6
- import './form-config-fetcher-30fb808f.js';
7
- import './DataFetcher-c1baf61d.js';
5
+ import './ConfigStorage-e476378d.js';
6
+ import './form-config-fetcher-e0382e5a.js';
7
+ import './DataFetcher-773a3e4b.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';