@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-56414.2 → 0.0.0-bugfix-dev-KB-55396.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 (67) hide show
  1. package/dist/cjs/{IExporterProvider-91e8acd9.js → IExporterProvider-766e1681.js} +1 -1
  2. package/dist/cjs/{pesquisa-fetcher-d15951b1.js → pesquisa-fetcher-42ea15c0.js} +7 -12
  3. package/dist/cjs/snk-actions-button_4.cjs.entry.js +2 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +2 -1
  5. package/dist/cjs/snk-attach.cjs.entry.js +22 -12
  6. package/dist/cjs/snk-crud.cjs.entry.js +2 -1
  7. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
  8. package/dist/cjs/{snk-data-unit-7798c5c4.js → snk-data-unit-abd2113f.js} +0 -1
  9. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -2
  11. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -5
  12. package/dist/cjs/snk-grid.cjs.entry.js +3 -2
  13. package/dist/cjs/{snk-guides-viewer-eee0b978.js → snk-guides-viewer-7c07f342.js} +1 -1
  14. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -2
  15. package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -2
  16. package/dist/collection/components/snk-attach/snk-attach.js +20 -11
  17. package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -1
  18. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +0 -5
  19. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +3 -12
  20. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +1 -1
  21. package/dist/components/dataunit-fetcher.js +4 -13
  22. package/dist/components/snk-attach2.js +20 -11
  23. package/dist/components/snk-data-unit2.js +0 -1
  24. package/dist/components/snk-filter-bar2.js +0 -5
  25. package/dist/esm/{IExporterProvider-c3bd60f3.js → IExporterProvider-c2384d12.js} +1 -1
  26. package/dist/esm/{pesquisa-fetcher-9e18940f.js → pesquisa-fetcher-8d7a86e7.js} +4 -13
  27. package/dist/esm/snk-actions-button_4.entry.js +2 -1
  28. package/dist/esm/snk-application.entry.js +2 -1
  29. package/dist/esm/snk-attach.entry.js +22 -12
  30. package/dist/esm/snk-crud.entry.js +2 -1
  31. package/dist/esm/snk-data-exporter.entry.js +3 -2
  32. package/dist/esm/{snk-data-unit-592a8ed3.js → snk-data-unit-29eba11a.js} +0 -1
  33. package/dist/esm/snk-data-unit.entry.js +1 -1
  34. package/dist/esm/snk-detail-view.entry.js +3 -2
  35. package/dist/esm/snk-filter-bar.entry.js +0 -5
  36. package/dist/esm/snk-grid.entry.js +3 -2
  37. package/dist/esm/{snk-guides-viewer-4fd4e25a.js → snk-guides-viewer-ab10b1ea.js} +1 -1
  38. package/dist/esm/snk-guides-viewer.entry.js +3 -2
  39. package/dist/esm/snk-simple-crud.entry.js +3 -2
  40. package/dist/sankhyablocks/p-07825198.js +1 -0
  41. package/dist/sankhyablocks/p-41b2ba65.entry.js +1 -0
  42. package/dist/sankhyablocks/p-5d3fb87a.entry.js +1 -0
  43. package/dist/sankhyablocks/p-61984566.entry.js +1 -0
  44. package/dist/sankhyablocks/p-6b69a15b.entry.js +1 -0
  45. package/dist/sankhyablocks/{p-e0649a17.js → p-7087c679.js} +1 -1
  46. package/dist/sankhyablocks/p-950a0dfc.entry.js +1 -0
  47. package/dist/sankhyablocks/{p-9b94aaa9.js → p-9800ce29.js} +1 -1
  48. package/dist/sankhyablocks/p-9952f9be.entry.js +1 -0
  49. package/dist/sankhyablocks/p-bbc3c9f6.entry.js +1 -0
  50. package/dist/sankhyablocks/p-debcb301.js +65 -0
  51. package/dist/sankhyablocks/{p-52ec26b8.entry.js → p-e73eb043.entry.js} +1 -1
  52. package/dist/sankhyablocks/p-f440e50a.entry.js +1 -0
  53. package/dist/sankhyablocks/{p-388d00f5.entry.js → p-f50c876c.entry.js} +1 -1
  54. package/dist/sankhyablocks/{p-ac2fc78d.entry.js → p-fa84e72f.entry.js} +1 -1
  55. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  56. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  57. package/package.json +1 -1
  58. package/dist/sankhyablocks/p-07d324ba.entry.js +0 -1
  59. package/dist/sankhyablocks/p-1e5dffbf.js +0 -1
  60. package/dist/sankhyablocks/p-2345687c.entry.js +0 -1
  61. package/dist/sankhyablocks/p-3de247d1.entry.js +0 -1
  62. package/dist/sankhyablocks/p-595e7068.entry.js +0 -1
  63. package/dist/sankhyablocks/p-775253f7.entry.js +0 -1
  64. package/dist/sankhyablocks/p-7d6897ec.entry.js +0 -1
  65. package/dist/sankhyablocks/p-81abd586.entry.js +0 -1
  66. package/dist/sankhyablocks/p-8fadeb65.entry.js +0 -1
  67. package/dist/sankhyablocks/p-f678bffa.js +0 -65
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
4
- const pesquisaFetcher = require('./pesquisa-fetcher-d15951b1.js');
4
+ const pesquisaFetcher = require('./pesquisa-fetcher-42ea15c0.js');
5
5
  const core = require('@sankhyalabs/core');
6
6
  require('./index-0922807b.js');
7
7
  require('./ISave-e91b70a7.js');
@@ -5,8 +5,13 @@ const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
5
5
  const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
6
6
  const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
8
+ const SortingUtils = require('@sankhyalabs/core/dist/utils/SortingUtils');
8
9
  const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
10
 
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ const SortingUtils__default = /*#__PURE__*/_interopDefaultLegacy(SortingUtils);
14
+
10
15
  class ArrayRepository {
11
16
  constructor(equalsFunction) {
12
17
  this._list = [];
@@ -110,17 +115,7 @@ class PreloadManager {
110
115
  }
111
116
  }
112
117
  static getSortingFunction(dataUnit, sorting) {
113
- if (sorting == undefined || sorting.length == 0) {
114
- return undefined;
115
- }
116
- return (recordA, recordB) => {
117
- for (const sort of sorting) {
118
- const result = core.FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === core.SortMode.ASC);
119
- if (result != 0) {
120
- return result;
121
- }
122
- }
123
- };
118
+ return SortingUtils__default['default'].getSortingFunction(dataUnit, sorting);
124
119
  }
125
120
  static async getDistinct(dataUnit, fieldName) {
126
121
  if (!PreloadManager.isCacheEnabled(dataUnit)) {
@@ -395,7 +390,7 @@ class DatasetStrategy {
395
390
  const descriptor = dataUnit.getField(sort.field);
396
391
  const local = descriptor != undefined
397
392
  && descriptor.properties != undefined
398
- && descriptor.properties.calculated === "true";
393
+ && (descriptor.properties.calculated === "true" || descriptor.userInterface === core.UserInterface.LONGTEXT);
399
394
  if (local) {
400
395
  localSorting.push(sort);
401
396
  }
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
8
8
  const ParamType = require('./ParamType-90b440a0.js');
9
- require('./pesquisa-fetcher-d15951b1.js');
9
+ require('./pesquisa-fetcher-42ea15c0.js');
10
10
  require('./index-0922807b.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -19,6 +19,7 @@ const ConfigStorage = require('./ConfigStorage-7df9d3bb.js');
19
19
  const constants = require('./constants-35ddd366.js');
20
20
  require('./PrintUtils-bcaeb82f.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
22
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
22
23
 
23
24
  const SERVICE_ACTION_EXECUTE_JAVA = 'ActionButtonsSP.executeJava';
24
25
  class JavaExecutor {
@@ -8,13 +8,14 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const ConfigStorage = require('./ConfigStorage-7df9d3bb.js');
9
9
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
10
10
  const authFetcher = require('./auth-fetcher-e6112be7.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-d15951b1.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-42ea15c0.js');
12
12
  const SnkMessageBuilder = require('./SnkMessageBuilder-66aa2557.js');
13
13
  require('./filter-item-type.enum-a7ffdaa6.js');
14
14
  require('./PrintUtils-bcaeb82f.js');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
16
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
17
17
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
18
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
18
19
  require('./ResourceIDUtils-5ff86aa7.js');
19
20
 
20
21
  class AppletCaller {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
8
- const pesquisaFetcher = require('./pesquisa-fetcher-d15951b1.js');
8
+ const pesquisaFetcher = require('./pesquisa-fetcher-42ea15c0.js');
9
9
  require('./index-0922807b.js');
10
10
  const ISave = require('./ISave-e91b70a7.js');
11
11
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -16,6 +16,7 @@ require('./PrintUtils-bcaeb82f.js');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
18
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
19
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
19
20
  require('./ResourceIDUtils-5ff86aa7.js');
20
21
  require('./index-102ba62d.js');
21
22
 
@@ -728,15 +729,13 @@ const SnkAttach = class {
728
729
  }
729
730
  }
730
731
  loadAnexoSistema() {
731
- var _a;
732
732
  this._currentDataUnit = this._currentDataUnit || new pesquisaFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
733
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
734
733
  if (!this._currentDataUnit.metadata) {
735
734
  this._currentDataUnit
736
735
  .loadMetadata()
737
736
  .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
738
737
  }
739
- this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
738
+ this.initDataUnitLoaders();
740
739
  this._currentDataUnit.addFilterProvider({
741
740
  getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
742
741
  });
@@ -746,9 +745,9 @@ const SnkAttach = class {
746
745
  this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
747
746
  }
748
747
  loadAttach() {
749
- var _a, _b, _c;
750
- this._currentFetcher = new AttachFetcher();
748
+ var _a, _b;
751
749
  this._currentDataUnit = new core.DataUnit(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
750
+ this.initDataUnitLoaders();
752
751
  this._currentDataUnit.addInterceptor({
753
752
  interceptAction: (action) => {
754
753
  var _a;
@@ -759,19 +758,30 @@ const SnkAttach = class {
759
758
  return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
760
759
  }
761
760
  });
762
- this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
763
- (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
764
- this.returnToGridMode();
765
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
766
- });
767
761
  if (!this._currentDataUnit.metadata) {
768
- (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
762
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
769
763
  var _a, _b;
770
764
  this.crudConfig = Object.assign({}, attachCrudConfig);
771
765
  (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
772
766
  });
773
767
  }
774
768
  }
769
+ initDataUnitLoaders() {
770
+ var _a, _b, _c;
771
+ if (this.fetcherType === "AnexoSistema") {
772
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
773
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
774
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
775
+ }
776
+ if (this.fetcherType === "Attach") {
777
+ this._currentFetcher = new AttachFetcher();
778
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
779
+ (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
780
+ this.returnToGridMode();
781
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
782
+ });
783
+ }
784
+ }
775
785
  disableEditFieldsNotInForm() {
776
786
  var _a;
777
787
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-d9392685.js');
8
8
  require('./form-config-fetcher-3c4daeb5.js');
9
- require('./pesquisa-fetcher-d15951b1.js');
9
+ require('./pesquisa-fetcher-42ea15c0.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
11
  require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -17,6 +17,7 @@ const authFetcher = require('./auth-fetcher-e6112be7.js');
17
17
  require('./index-102ba62d.js');
18
18
  require('./PrintUtils-bcaeb82f.js');
19
19
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
20
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
20
21
  require('./ResourceIDUtils-5ff86aa7.js');
21
22
 
22
23
  const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-0922807b.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
11
- const snkDataUnit = require('./snk-data-unit-7798c5c4.js');
12
- require('./pesquisa-fetcher-d15951b1.js');
11
+ const snkDataUnit = require('./snk-data-unit-abd2113f.js');
12
+ require('./pesquisa-fetcher-42ea15c0.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -18,6 +18,7 @@ require('./PrintUtils-bcaeb82f.js');
18
18
  require('./SnkMessageBuilder-66aa2557.js');
19
19
  require('./RecordIDUtils-3735135c.js');
20
20
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
21
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
21
22
  require('./ResourceIDUtils-5ff86aa7.js');
22
23
 
23
24
  class ItemBuilder {
@@ -101,7 +101,6 @@ const SnkDataUnit = class {
101
101
  }
102
102
  }
103
103
  observeDataUnit() {
104
- this.loadDataUnit();
105
104
  this.handlerLinkFields();
106
105
  this.dataUnitReady.emit(this.dataUnit);
107
106
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-7798c5c4.js');
5
+ const snkDataUnit = require('./snk-data-unit-abd2113f.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
7
7
  const SnkFormConfigManager = require('./SnkFormConfigManager-4259edbe.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
9
  require('./form-config-fetcher-3c4daeb5.js');
10
- require('./pesquisa-fetcher-d15951b1.js');
10
+ require('./pesquisa-fetcher-42ea15c0.js');
11
11
  const index$1 = require('./index-0922807b.js');
12
12
  require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -15,11 +15,12 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
16
16
  const taskbarElements = require('./taskbar-elements-d9392685.js');
17
17
  const constants = require('./constants-35ddd366.js');
18
- const snkGuidesViewer = require('./snk-guides-viewer-eee0b978.js');
18
+ const snkGuidesViewer = require('./snk-guides-viewer-7c07f342.js');
19
19
  const SnkMessageBuilder = require('./SnkMessageBuilder-66aa2557.js');
20
20
  require('./ConfigStorage-7df9d3bb.js');
21
21
  require('./PrintUtils-bcaeb82f.js');
22
22
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
23
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
23
24
  require('./ResourceIDUtils-5ff86aa7.js');
24
25
  require('./index-102ba62d.js');
25
26
  require('./field-search-f56aa7d6.js');
@@ -296,11 +296,6 @@ const SnkFilterBar = class {
296
296
  this.handleFilterConfigsChanged(oldValue, newValue);
297
297
  }
298
298
  handleFilterConfigsChanged(oldValue, newValue) {
299
- const isEmptyPersonalizedFilter = newValue && newValue.length === 1 ? (newValue[0].id === 'PERSONALIZED_FILTER_GROUP' && newValue[0].groupedItems.length === 0) : false;
300
- if (oldValue === undefined && isEmptyPersonalizedFilter) {
301
- this.configUpdated.emit(newValue);
302
- return;
303
- }
304
299
  if (oldValue != undefined && newValue == undefined) {
305
300
  this._loadingPending = true;
306
301
  this._configUpdated = true;
@@ -9,10 +9,10 @@ const ConfigStorage = require('./ConfigStorage-7df9d3bb.js');
9
9
  const index$1 = require('./index-0922807b.js');
10
10
  const fieldSearch = require('./field-search-f56aa7d6.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const IExporterProvider = require('./IExporterProvider-91e8acd9.js');
12
+ const IExporterProvider = require('./IExporterProvider-766e1681.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./form-config-fetcher-3c4daeb5.js');
15
- require('./pesquisa-fetcher-d15951b1.js');
15
+ require('./pesquisa-fetcher-42ea15c0.js');
16
16
  require('./ISave-e91b70a7.js');
17
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -21,6 +21,7 @@ const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
22
22
  require('./PrintUtils-bcaeb82f.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
24
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
24
25
  require('./ResourceIDUtils-5ff86aa7.js');
25
26
 
26
27
  class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
@@ -8,7 +8,7 @@ const fieldSearch = require('./field-search-f56aa7d6.js');
8
8
  const taskbarElements = require('./taskbar-elements-d9392685.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./form-config-fetcher-3c4daeb5.js');
11
- require('./pesquisa-fetcher-d15951b1.js');
11
+ require('./pesquisa-fetcher-42ea15c0.js');
12
12
  const index$1 = require('./index-0922807b.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-eee0b978.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-7c07f342.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-4259edbe.js');
@@ -17,9 +17,10 @@ require('./taskbar-elements-d9392685.js');
17
17
  require('./index-0922807b.js');
18
18
  require('./index-102ba62d.js');
19
19
  require('./constants-35ddd366.js');
20
- require('./pesquisa-fetcher-d15951b1.js');
20
+ require('./pesquisa-fetcher-42ea15c0.js');
21
21
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
22
22
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
23
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
23
24
  require('./ResourceIDUtils-5ff86aa7.js');
24
25
  require('./ISave-e91b70a7.js');
25
26
  require('@sankhyalabs/core/dist/dataunit/DataUnit');
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-d9392685.js');
10
10
  const formConfigFetcher = require('./form-config-fetcher-3c4daeb5.js');
11
- const pesquisaFetcher = require('./pesquisa-fetcher-d15951b1.js');
12
- const IExporterProvider = require('./IExporterProvider-91e8acd9.js');
11
+ const pesquisaFetcher = require('./pesquisa-fetcher-42ea15c0.js');
12
+ const IExporterProvider = require('./IExporterProvider-766e1681.js');
13
13
  const index = require('./index-0922807b.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -22,6 +22,7 @@ const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
22
22
  const index$2 = require('./index-102ba62d.js');
23
23
  require('./PrintUtils-bcaeb82f.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
25
+ require('@sankhyalabs/core/dist/utils/SortingUtils');
25
26
  require('./ResourceIDUtils-5ff86aa7.js');
26
27
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
27
28
 
@@ -117,15 +117,13 @@ export class SnkAttach {
117
117
  }
118
118
  }
119
119
  loadAnexoSistema() {
120
- var _a;
121
120
  this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
122
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
123
121
  if (!this._currentDataUnit.metadata) {
124
122
  this._currentDataUnit
125
123
  .loadMetadata()
126
124
  .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
127
125
  }
128
- this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
126
+ this.initDataUnitLoaders();
129
127
  this._currentDataUnit.addFilterProvider({
130
128
  getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
131
129
  });
@@ -135,9 +133,9 @@ export class SnkAttach {
135
133
  this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
136
134
  }
137
135
  loadAttach() {
138
- var _a, _b, _c;
139
- this._currentFetcher = new AttachFetcher();
136
+ var _a, _b;
140
137
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
138
+ this.initDataUnitLoaders();
141
139
  this._currentDataUnit.addInterceptor({
142
140
  interceptAction: (action) => {
143
141
  var _a;
@@ -148,19 +146,30 @@ export class SnkAttach {
148
146
  return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
149
147
  }
150
148
  });
151
- this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
152
- (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
153
- this.returnToGridMode();
154
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
155
- });
156
149
  if (!this._currentDataUnit.metadata) {
157
- (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
150
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
158
151
  var _a, _b;
159
152
  this.crudConfig = Object.assign({}, attachCrudConfig);
160
153
  (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
161
154
  });
162
155
  }
163
156
  }
157
+ initDataUnitLoaders() {
158
+ var _a, _b, _c;
159
+ if (this.fetcherType === "AnexoSistema") {
160
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
161
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
162
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
163
+ }
164
+ if (this.fetcherType === "Attach") {
165
+ this._currentFetcher = new AttachFetcher();
166
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
167
+ (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
168
+ this.returnToGridMode();
169
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
170
+ });
171
+ }
172
+ }
164
173
  disableEditFieldsNotInForm() {
165
174
  var _a;
166
175
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
@@ -92,7 +92,6 @@ export class SnkDataUnit {
92
92
  }
93
93
  }
94
94
  observeDataUnit() {
95
- this.loadDataUnit();
96
95
  this.handlerLinkFields();
97
96
  this.dataUnitReady.emit(this.dataUnit);
98
97
  }
@@ -47,11 +47,6 @@ export class SnkFilterBar {
47
47
  this.handleFilterConfigsChanged(oldValue, newValue);
48
48
  }
49
49
  handleFilterConfigsChanged(oldValue, newValue) {
50
- const isEmptyPersonalizedFilter = newValue && newValue.length === 1 ? (newValue[0].id === 'PERSONALIZED_FILTER_GROUP' && newValue[0].groupedItems.length === 0) : false;
51
- if (oldValue === undefined && isEmptyPersonalizedFilter) {
52
- this.configUpdated.emit(newValue);
53
- return;
54
- }
55
50
  if (oldValue != undefined && newValue == undefined) {
56
51
  this._loadingPending = true;
57
52
  this._configUpdated = true;
@@ -1,6 +1,7 @@
1
- import { DataUnit, FieldComparator, SortMode } from "@sankhyalabs/core";
1
+ import { DataUnit } from "@sankhyalabs/core";
2
2
  import { ArrayRepository } from "./ArrayRepository";
3
3
  import { ColumnFilterManager } from "@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";
4
+ import SortingUtils from "@sankhyalabs/core/dist/utils/SortingUtils";
4
5
  export default class PreloadManager {
5
6
  static setLoadingStatus(dataUnit, loadingInProgress) {
6
7
  this._loadingStatus.set(dataUnit.name, loadingInProgress);
@@ -20,17 +21,7 @@ export default class PreloadManager {
20
21
  }
21
22
  }
22
23
  static getSortingFunction(dataUnit, sorting) {
23
- if (sorting == undefined || sorting.length == 0) {
24
- return undefined;
25
- }
26
- return (recordA, recordB) => {
27
- for (const sort of sorting) {
28
- const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
29
- if (result != 0) {
30
- return result;
31
- }
32
- }
33
- };
24
+ return SortingUtils.getSortingFunction(dataUnit, sorting);
34
25
  }
35
26
  static async getDistinct(dataUnit, fieldName) {
36
27
  if (!PreloadManager.isCacheEnabled(dataUnit)) {
@@ -17,7 +17,7 @@ export class DatasetStrategy {
17
17
  const descriptor = dataUnit.getField(sort.field);
18
18
  const local = descriptor != undefined
19
19
  && descriptor.properties != undefined
20
- && descriptor.properties.calculated === "true";
20
+ && (descriptor.properties.calculated === "true" || descriptor.userInterface === UserInterface.LONGTEXT);
21
21
  if (local) {
22
22
  localSorting.push(sort);
23
23
  }
@@ -1,8 +1,9 @@
1
- import { DataType, ApplicationContext, ObjectUtils, FieldComparator, SortMode, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
1
+ import { DataType, ApplicationContext, ObjectUtils, DataUnit, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
2
2
  import { d as dist, D as DataFetcher } from './form-config-fetcher.js';
3
3
  import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
4
4
  import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
5
5
  import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
6
+ import SortingUtils from '@sankhyalabs/core/dist/utils/SortingUtils';
6
7
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
7
8
 
8
9
  class PesquisaFetcher {
@@ -268,17 +269,7 @@ class PreloadManager {
268
269
  }
269
270
  }
270
271
  static getSortingFunction(dataUnit, sorting) {
271
- if (sorting == undefined || sorting.length == 0) {
272
- return undefined;
273
- }
274
- return (recordA, recordB) => {
275
- for (const sort of sorting) {
276
- const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
277
- if (result != 0) {
278
- return result;
279
- }
280
- }
281
- };
272
+ return SortingUtils.getSortingFunction(dataUnit, sorting);
282
273
  }
283
274
  static async getDistinct(dataUnit, fieldName) {
284
275
  if (!PreloadManager.isCacheEnabled(dataUnit)) {
@@ -553,7 +544,7 @@ class DatasetStrategy {
553
544
  const descriptor = dataUnit.getField(sort.field);
554
545
  const local = descriptor != undefined
555
546
  && descriptor.properties != undefined
556
- && descriptor.properties.calculated === "true";
547
+ && (descriptor.properties.calculated === "true" || descriptor.userInterface === UserInterface.LONGTEXT);
557
548
  if (local) {
558
549
  localSorting.push(sort);
559
550
  }
@@ -732,15 +732,13 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
732
732
  }
733
733
  }
734
734
  loadAnexoSistema() {
735
- var _a;
736
735
  this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
737
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
738
736
  if (!this._currentDataUnit.metadata) {
739
737
  this._currentDataUnit
740
738
  .loadMetadata()
741
739
  .then(() => this.crudConfig = Object.assign({}, anexoSistemaCrudConfig));
742
740
  }
743
- this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
741
+ this.initDataUnitLoaders();
744
742
  this._currentDataUnit.addFilterProvider({
745
743
  getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
746
744
  });
@@ -750,9 +748,9 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
750
748
  this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
751
749
  }
752
750
  loadAttach() {
753
- var _a, _b, _c;
754
- this._currentFetcher = new AttachFetcher();
751
+ var _a, _b;
755
752
  this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
753
+ this.initDataUnitLoaders();
756
754
  this._currentDataUnit.addInterceptor({
757
755
  interceptAction: (action) => {
758
756
  var _a;
@@ -763,19 +761,30 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
763
761
  return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
764
762
  }
765
763
  });
766
- this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
767
- (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
768
- this.returnToGridMode();
769
- await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
770
- });
771
764
  if (!this._currentDataUnit.metadata) {
772
- (_c = (_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadMetadata()) === null || _c === void 0 ? void 0 : _c.then(() => {
765
+ (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata()) === null || _b === void 0 ? void 0 : _b.then(() => {
773
766
  var _a, _b;
774
767
  this.crudConfig = Object.assign({}, attachCrudConfig);
775
768
  (_b = (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData(undefined, undefined, true, this.registerKey)) === null || _b === void 0 ? void 0 : _b.then(this.disableEditFieldsNotInForm.bind(this));
776
769
  });
777
770
  }
778
771
  }
772
+ initDataUnitLoaders() {
773
+ var _a, _b, _c;
774
+ if (this.fetcherType === "AnexoSistema") {
775
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
776
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
777
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
778
+ }
779
+ if (this.fetcherType === "Attach") {
780
+ this._currentFetcher = new AttachFetcher();
781
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
782
+ (_c = this._currentDataUnitBuilder) === null || _c === void 0 ? void 0 : _c.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
783
+ this.returnToGridMode();
784
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
785
+ });
786
+ }
787
+ }
779
788
  disableEditFieldsNotInForm() {
780
789
  var _a;
781
790
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
@@ -137,7 +137,6 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
137
137
  }
138
138
  }
139
139
  observeDataUnit() {
140
- this.loadDataUnit();
141
140
  this.handlerLinkFields();
142
141
  this.dataUnitReady.emit(this.dataUnit);
143
142
  }
@@ -299,11 +299,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
299
299
  this.handleFilterConfigsChanged(oldValue, newValue);
300
300
  }
301
301
  handleFilterConfigsChanged(oldValue, newValue) {
302
- const isEmptyPersonalizedFilter = newValue && newValue.length === 1 ? (newValue[0].id === 'PERSONALIZED_FILTER_GROUP' && newValue[0].groupedItems.length === 0) : false;
303
- if (oldValue === undefined && isEmptyPersonalizedFilter) {
304
- this.configUpdated.emit(newValue);
305
- return;
306
- }
307
302
  if (oldValue != undefined && newValue == undefined) {
308
303
  this._loadingPending = true;
309
304
  this._configUpdated = true;
@@ -1,5 +1,5 @@
1
1
  import { D as DataFetcher } from './form-config-fetcher-e3094014.js';
2
- import { a as PreloadManager } from './pesquisa-fetcher-9e18940f.js';
2
+ import { a as PreloadManager } from './pesquisa-fetcher-8d7a86e7.js';
3
3
  import { SortMode, ApplicationContext, UserInterface, DateUtils, DataType } from '@sankhyalabs/core';
4
4
  import './index-0ece87a6.js';
5
5
  import './ISave-d8c8bc59.js';