@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.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-e49214c6.js} +3 -2
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
- package/dist/cjs/{IExporterProvider-9479f618.js → IExporterProvider-10b7fed5.js} +4 -4
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-beebf47a.js} +7 -9
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-cceebbae.js} +2 -2
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-0c7106a0.js → dataunit-fetcher-d4873076.js} +8 -4
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +36 -25
- package/dist/cjs/snk-crud.cjs.entry.js +11 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
- package/dist/cjs/{snk-data-unit-16791a2f.js → snk-data-unit-11e31d8d.js} +23 -11
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -11
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -11
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +9 -9
- package/dist/cjs/{snk-guides-viewer-d82746e8.js → snk-guides-viewer-aafc3073.js} +12 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -11
- package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
- package/dist/collection/components/snk-attach/snk-attach.js +24 -15
- package/dist/collection/components/snk-crud/snk-crud.js +57 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +22 -2
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +38 -9
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +16 -8
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +5 -7
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +2 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +7 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/DataFetcher.js +8 -3
- package/dist/components/SnkFormConfigManager.js +5 -7
- package/dist/components/SnkMessageBuilder.js +2 -2
- package/dist/components/dataunit-fetcher.js +7 -3
- package/dist/components/snk-attach2.js +31 -20
- package/dist/components/snk-crud.js +8 -1
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-data-unit2.js +22 -9
- package/dist/components/snk-detail-view2.js +10 -5
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +16 -8
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +3 -3
- package/dist/components/snk-simple-crud2.js +7 -4
- package/dist/components/snk-taskbar2.js +24 -2
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-e476378d.js} +3 -2
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
- package/dist/esm/{IExporterProvider-5a858363.js → IExporterProvider-d597f27d.js} +4 -4
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-298cd647.js} +7 -9
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-ae87b754.js} +2 -2
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-f7e0ffc0.js → dataunit-fetcher-3d2ec959.js} +8 -4
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +36 -25
- package/dist/esm/snk-crud.entry.js +11 -6
- package/dist/esm/snk-data-exporter.entry.js +8 -8
- package/dist/esm/{snk-data-unit-a327d22c.js → snk-data-unit-29de836f.js} +23 -11
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +10 -11
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +19 -11
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +3 -3
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +9 -9
- package/dist/esm/{snk-guides-viewer-874da66f.js → snk-guides-viewer-62124f3d.js} +12 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +13 -11
- package/dist/esm/snk-taskbar.entry.js +23 -1
- package/dist/sankhyablocks/p-08c28ddd.entry.js +1 -0
- package/dist/sankhyablocks/{p-6d4f4614.js → p-091ce761.js} +1 -1
- package/dist/sankhyablocks/{p-b8cde0d8.entry.js → p-094eebf6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
- package/dist/sankhyablocks/p-12f45f86.entry.js +1 -0
- package/dist/sankhyablocks/{p-60e46675.entry.js → p-162b9a59.entry.js} +2 -2
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
- package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
- package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
- package/dist/sankhyablocks/{p-8fc470e5.entry.js → p-2e9c764c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aff76a53.js → p-3287a6cc.js} +2 -2
- package/dist/sankhyablocks/{p-b7c4feeb.entry.js → p-421bec84.entry.js} +1 -1
- package/dist/sankhyablocks/p-51999ab5.entry.js +1 -0
- package/dist/sankhyablocks/p-53949130.entry.js +1 -0
- package/dist/sankhyablocks/p-594bc21d.js +1 -0
- package/dist/sankhyablocks/p-5b26cc7c.entry.js +1 -0
- package/dist/sankhyablocks/p-5b9160c6.entry.js +1 -0
- package/dist/sankhyablocks/{p-7d9baaf4.entry.js → p-5e384af4.entry.js} +1 -1
- package/dist/sankhyablocks/p-5f016aed.js +1 -0
- package/dist/sankhyablocks/p-70001ac1.js +1 -0
- package/dist/sankhyablocks/{p-e6210aec.js → p-76a65660.js} +1 -1
- package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
- package/dist/sankhyablocks/p-8f4e743f.js +1 -0
- package/dist/sankhyablocks/p-939e15d3.entry.js +1 -0
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-9dfda04a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-bd008859.entry.js} +1 -1
- package/dist/sankhyablocks/p-d65d98ed.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +49 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
- package/package.json +2 -2
- package/dist/sankhyablocks/p-0046959e.entry.js +0 -1
- package/dist/sankhyablocks/p-0e11ee18.entry.js +0 -1
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-6ded2076.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-8c6b44ea.entry.js +0 -1
- package/dist/sankhyablocks/p-a4b1f1eb.js +0 -1
- package/dist/sankhyablocks/p-c7cbad38.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-e0b9f59a.entry.js +0 -1
- package/dist/sankhyablocks/p-e9bbc3d5.entry.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
@@ -4,15 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const DataFetcher = require('./DataFetcher-
|
8
|
-
require('./pesquisa-fetcher-
|
7
|
+
const DataFetcher = require('./DataFetcher-77729a93.js');
|
8
|
+
require('./pesquisa-fetcher-a1d0353f.js');
|
9
9
|
require('./index-1dfc7a6e.js');
|
10
10
|
const ISave = require('./ISave-e91b70a7.js');
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-d4873076.js');
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
13
|
-
require('./form-config-fetcher-
|
13
|
+
require('./form-config-fetcher-feb08214.js');
|
14
14
|
const constants = require('./constants-35ddd366.js');
|
15
|
-
const authFetcher = require('./auth-fetcher-
|
15
|
+
const authFetcher = require('./auth-fetcher-29bb791c.js');
|
16
16
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
17
17
|
require('./PrintUtils-bcaeb82f.js');
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -117,21 +117,23 @@ const SERVICE = {
|
|
117
117
|
download: "AnexoSistemaSP.baixar",
|
118
118
|
};
|
119
119
|
class AnexoSistemaFetcher {
|
120
|
-
constructor(entityName,
|
120
|
+
constructor(entityName, dataUnitName) {
|
121
121
|
var _a;
|
122
122
|
this.entityName = entityName;
|
123
|
-
this.registerKey = registerKey;
|
124
123
|
this.dataUnitName = dataUnitName;
|
125
124
|
this.validateFields = (fields) => {
|
126
125
|
if (!!fields.LINK && !!fields.NOMEARQUIVO)
|
127
126
|
throw new Error(ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
128
127
|
if (!fields.LINK && !fields.NOMEARQUIVO)
|
129
128
|
throw new Error(ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
130
|
-
if (!this.
|
129
|
+
if (!this._registerKey)
|
131
130
|
throw new Error('Register key can not be null');
|
132
131
|
};
|
133
132
|
this.resourceID = (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID));
|
134
133
|
}
|
134
|
+
set registerKey(registerKey) {
|
135
|
+
this._registerKey = registerKey;
|
136
|
+
}
|
135
137
|
async save(change) {
|
136
138
|
var _a, _b;
|
137
139
|
let { updatingFields: fields } = change;
|
@@ -150,7 +152,7 @@ class AnexoSistemaFetcher {
|
|
150
152
|
nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
|
151
153
|
link: fields.LINK,
|
152
154
|
nameEntity: this.entityName,
|
153
|
-
pkEntity: this.
|
155
|
+
pkEntity: this._registerKey,
|
154
156
|
typeAcess: fields.TIPOACESSO,
|
155
157
|
typeApres: fields.TIPOAPRES,
|
156
158
|
}
|
@@ -190,7 +192,7 @@ class AnexoSistemaFetcher {
|
|
190
192
|
nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
|
191
193
|
link: fields.LINK,
|
192
194
|
nameEntity: this.entityName,
|
193
|
-
pkEntity: this.
|
195
|
+
pkEntity: this._registerKey,
|
194
196
|
typeAcess: fields.TIPOACESSO,
|
195
197
|
typeApres: fields.TIPOAPRES,
|
196
198
|
}
|
@@ -660,11 +662,20 @@ const SnkAttach = class {
|
|
660
662
|
this.loadAttachmentDataUnit();
|
661
663
|
}
|
662
664
|
if (oldRegisterKey !== newRegisterKey) {
|
665
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
666
|
+
this._currentFetcher.registerKey = newRegisterKey;
|
667
|
+
}
|
663
668
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
|
664
669
|
}
|
665
670
|
}
|
671
|
+
getAnexoSistemaFetcherInstance() {
|
672
|
+
var _a;
|
673
|
+
const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
674
|
+
anexoSistemaFetcher.registerKey = this.registerKey;
|
675
|
+
return anexoSistemaFetcher;
|
676
|
+
}
|
666
677
|
async initAttach() {
|
667
|
-
var _a, _b, _c, _d, _e
|
678
|
+
var _a, _b, _c, _d, _e;
|
668
679
|
if (!this.fetcherType && !this.registerKey)
|
669
680
|
return;
|
670
681
|
if (!this.fetcherType) {
|
@@ -672,18 +683,18 @@ const SnkAttach = class {
|
|
672
683
|
}
|
673
684
|
this.returnToGridMode();
|
674
685
|
if (this.fetcherType === "AnexoSistema") {
|
675
|
-
this._currentFetcher =
|
676
|
-
(
|
677
|
-
await ((
|
686
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
687
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
688
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
678
689
|
return;
|
679
690
|
}
|
680
691
|
if (this.fetcherType === "Attach") {
|
681
|
-
const hasMoreOneItem = ((
|
692
|
+
const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
|
682
693
|
if (hasMoreOneItem)
|
683
694
|
return;
|
684
695
|
}
|
685
|
-
await ((
|
686
|
-
await ((
|
696
|
+
await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
|
697
|
+
await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
|
687
698
|
}
|
688
699
|
/**
|
689
700
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -742,11 +753,11 @@ const SnkAttach = class {
|
|
742
753
|
}
|
743
754
|
}
|
744
755
|
async loadAnexoSistema() {
|
745
|
-
var _a, _b
|
756
|
+
var _a, _b;
|
746
757
|
this._currentDataUnit = new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
747
|
-
this._currentFetcher =
|
758
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
748
759
|
if (!this._currentDataUnit.metadata) {
|
749
|
-
await ((
|
760
|
+
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
750
761
|
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
751
762
|
}
|
752
763
|
this.initDataUnitLoaders();
|
@@ -756,7 +767,7 @@ const SnkAttach = class {
|
|
756
767
|
this._currentDataUnit.addInterceptor({
|
757
768
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
758
769
|
});
|
759
|
-
await ((
|
770
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
760
771
|
this.disableEditFieldsNotInForm();
|
761
772
|
}
|
762
773
|
async loadAttach() {
|
@@ -782,16 +793,16 @@ const SnkAttach = class {
|
|
782
793
|
}
|
783
794
|
}
|
784
795
|
initDataUnitLoaders() {
|
785
|
-
var _a, _b
|
796
|
+
var _a, _b;
|
786
797
|
if (this.fetcherType === "AnexoSistema") {
|
787
|
-
this._currentFetcher =
|
798
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
788
799
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
789
|
-
(
|
800
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
790
801
|
}
|
791
802
|
if (this.fetcherType === "Attach") {
|
792
803
|
this._currentFetcher = new AttachFetcher();
|
793
804
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
794
|
-
(
|
805
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
795
806
|
this.returnToGridMode();
|
796
807
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
797
808
|
});
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-77729a93.js');
|
9
|
+
require('./pesquisa-fetcher-a1d0353f.js');
|
10
10
|
const index$1 = require('./index-1dfc7a6e.js');
|
11
11
|
require('./ISave-e91b70a7.js');
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./dataunit-fetcher-
|
14
|
+
require('./dataunit-fetcher-d4873076.js');
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
16
|
-
require('./form-config-fetcher-
|
16
|
+
require('./form-config-fetcher-feb08214.js');
|
17
17
|
const constants = require('./constants-35ddd366.js');
|
18
|
-
const authFetcher = require('./auth-fetcher-
|
18
|
+
const authFetcher = require('./auth-fetcher-29bb791c.js');
|
19
19
|
require('./index-102ba62d.js');
|
20
20
|
require('./PrintUtils-bcaeb82f.js');
|
21
21
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -31,6 +31,7 @@ const SnkCrud = class {
|
|
31
31
|
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
32
32
|
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
33
33
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
34
|
+
this.viewModeChanged = index.createEvent(this, "viewModeChanged", 7);
|
34
35
|
this._keyDownHandler = async (event) => this.keyDownListener(event);
|
35
36
|
this._viewHistory = [];
|
36
37
|
this._customEditors = new Map();
|
@@ -59,6 +60,8 @@ const SnkCrud = class {
|
|
59
60
|
this.disablePersonalizedFilter = undefined;
|
60
61
|
this.autoLoad = undefined;
|
61
62
|
this.autoFocus = true;
|
63
|
+
this.domainMessagesBuilder = undefined;
|
64
|
+
this.setCustomFormTitle = undefined;
|
62
65
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
63
66
|
}
|
64
67
|
/**
|
@@ -167,6 +170,7 @@ const SnkCrud = class {
|
|
167
170
|
else if (viewMode === constants.VIEW_MODE.FORM) {
|
168
171
|
this._guidesViewer.setFocus();
|
169
172
|
}
|
173
|
+
this.viewModeChanged.emit(viewMode);
|
170
174
|
}
|
171
175
|
openConfig(viewMode) {
|
172
176
|
this._snkConfigurator.close();
|
@@ -230,6 +234,7 @@ const SnkCrud = class {
|
|
230
234
|
this._snkDataUnit = parent;
|
231
235
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
232
236
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
237
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
233
238
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
234
239
|
this._dataState = this._snkDataUnit.dataState;
|
235
240
|
if (!this._dataUnit) {
|
@@ -395,7 +400,7 @@ const SnkCrud = class {
|
|
395
400
|
return;
|
396
401
|
}
|
397
402
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
|
398
|
-
return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.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 }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, 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 })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
403
|
+
return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.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 }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, getCustomTitle: this.setCustomFormTitle }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, 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 })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
399
404
|
}
|
400
405
|
get _element() { return index.getElement(this); }
|
401
406
|
static get watchers() { return {
|
@@ -7,17 +7,17 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const index = require('./index-1dfc7a6e.js');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const DataFetcher = require('./DataFetcher-
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
12
|
-
require('./pesquisa-fetcher-
|
10
|
+
const DataFetcher = require('./DataFetcher-77729a93.js');
|
11
|
+
const snkDataUnit = require('./snk-data-unit-11e31d8d.js');
|
12
|
+
require('./pesquisa-fetcher-a1d0353f.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');
|
16
|
-
require('./dataunit-fetcher-
|
16
|
+
require('./dataunit-fetcher-d4873076.js');
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
|
-
require('./form-config-fetcher-
|
18
|
+
require('./form-config-fetcher-feb08214.js');
|
19
19
|
require('./PrintUtils-bcaeb82f.js');
|
20
|
-
require('./SnkMessageBuilder-
|
20
|
+
require('./SnkMessageBuilder-cceebbae.js');
|
21
21
|
require('./RecordIDUtils-3735135c.js');
|
22
22
|
require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -135,7 +135,7 @@ class ItemBuilder {
|
|
135
135
|
getExportToXLS(groupName) {
|
136
136
|
return {
|
137
137
|
id: index.DataExporterOption.EXPORT_TO_XLS,
|
138
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
138
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
139
139
|
group: groupName
|
140
140
|
};
|
141
141
|
}
|
@@ -178,7 +178,7 @@ class ItemBuilder {
|
|
178
178
|
getExportPageToXLS() {
|
179
179
|
return {
|
180
180
|
id: index.DataExporterOption.EXPORT_PAGE_TO_XLS,
|
181
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
181
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
182
182
|
};
|
183
183
|
}
|
184
184
|
/**
|
@@ -3,8 +3,8 @@
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
6
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
7
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
6
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-cceebbae.js');
|
7
|
+
const dataunitFetcher = require('./dataunit-fetcher-d4873076.js');
|
8
8
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
|
@@ -61,6 +61,7 @@ const SnkDataUnit = class {
|
|
61
61
|
this.ignoreSaveMessage = undefined;
|
62
62
|
this.configName = undefined;
|
63
63
|
this.resourceID = undefined;
|
64
|
+
this.domainMessagesBuilder = undefined;
|
64
65
|
}
|
65
66
|
observePageSize() {
|
66
67
|
if (this.dataUnit) {
|
@@ -477,7 +478,8 @@ const SnkDataUnit = class {
|
|
477
478
|
if (this.ignoreSaveMessage) {
|
478
479
|
return;
|
479
480
|
}
|
480
|
-
const
|
481
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
482
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
481
483
|
if (msg != undefined) {
|
482
484
|
this.showSuccessMessage(msg);
|
483
485
|
}
|
@@ -508,10 +510,13 @@ const SnkDataUnit = class {
|
|
508
510
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
509
511
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
510
512
|
*/
|
511
|
-
getMessage(key, params = undefined) {
|
513
|
+
getMessage(key, params = undefined, customOperation) {
|
512
514
|
if (!params) {
|
513
515
|
params = this.getMessageParams();
|
514
516
|
}
|
517
|
+
if (customOperation) {
|
518
|
+
this.messagesBuilder.currentOperation = customOperation;
|
519
|
+
}
|
515
520
|
return this.messagesBuilder.getMessage(key, params);
|
516
521
|
}
|
517
522
|
getMessageParams() {
|
@@ -542,7 +547,7 @@ const SnkDataUnit = class {
|
|
542
547
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
543
548
|
}
|
544
549
|
}
|
545
|
-
async loadDataUnit() {
|
550
|
+
async loadDataUnit(forceMetadataLoad = true) {
|
546
551
|
var _a;
|
547
552
|
if (this.dataUnit == null && this._application && this.entityName) {
|
548
553
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
@@ -552,9 +557,11 @@ const SnkDataUnit = class {
|
|
552
557
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
553
558
|
this.dataUnit.addInterceptor(this);
|
554
559
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
555
|
-
|
560
|
+
if (forceMetadataLoad || !this.dataUnit.metadata)
|
561
|
+
await this.dataUnit.loadMetadata();
|
556
562
|
if ((_a = this.dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) {
|
557
|
-
this.getMetadataByRow(this.dataUnit);
|
563
|
+
const { records } = this.getMetadataByRow(this.dataUnit);
|
564
|
+
this.dataUnit.records = records;
|
558
565
|
}
|
559
566
|
this.dataState = this.buildDataState();
|
560
567
|
let resolver;
|
@@ -618,6 +625,13 @@ const SnkDataUnit = class {
|
|
618
625
|
parent = parent.parentElement;
|
619
626
|
}
|
620
627
|
}
|
628
|
+
instanceMessagesBuilder() {
|
629
|
+
var _a;
|
630
|
+
if (this.messagesBuilder) {
|
631
|
+
return;
|
632
|
+
}
|
633
|
+
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
634
|
+
}
|
621
635
|
//---------------------------------------------
|
622
636
|
// Lifecycle web component
|
623
637
|
//---------------------------------------------
|
@@ -625,9 +639,7 @@ const SnkDataUnit = class {
|
|
625
639
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
626
640
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
627
641
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
628
|
-
|
629
|
-
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
630
|
-
}
|
642
|
+
this.instanceMessagesBuilder();
|
631
643
|
}
|
632
644
|
disconnectedCallback() {
|
633
645
|
if (this.dataUnit) {
|
@@ -635,7 +647,7 @@ const SnkDataUnit = class {
|
|
635
647
|
}
|
636
648
|
}
|
637
649
|
async componentDidLoad() {
|
638
|
-
await this.loadDataUnit();
|
650
|
+
await this.loadDataUnit(false);
|
639
651
|
this.handlerLinkFields();
|
640
652
|
}
|
641
653
|
render() {
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-11e31d8d.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
require('./SnkMessageBuilder-
|
10
|
-
require('./dataunit-fetcher-
|
11
|
-
require('./DataFetcher-
|
9
|
+
require('./SnkMessageBuilder-cceebbae.js');
|
10
|
+
require('./dataunit-fetcher-d4873076.js');
|
11
|
+
require('./DataFetcher-77729a93.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -4,22 +4,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-beebf47a.js');
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./DataFetcher-77729a93.js');
|
10
|
+
require('./pesquisa-fetcher-a1d0353f.js');
|
11
11
|
const index$1 = require('./index-1dfc7a6e.js');
|
12
12
|
require('./ISave-e91b70a7.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./dataunit-fetcher-
|
15
|
+
require('./dataunit-fetcher-d4873076.js');
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
|
-
require('./form-config-fetcher-
|
17
|
+
require('./form-config-fetcher-feb08214.js');
|
18
18
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
19
19
|
const constants = require('./constants-35ddd366.js');
|
20
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
21
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
22
|
-
require('./ConfigStorage-
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-aafc3073.js');
|
21
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-cceebbae.js');
|
22
|
+
require('./ConfigStorage-e49214c6.js');
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
25
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
@@ -227,14 +227,13 @@ const SnkDetailView = class {
|
|
227
227
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
228
228
|
}
|
229
229
|
loadMetadata() {
|
230
|
-
var _a;
|
231
230
|
if (!this.dataUnit) {
|
232
231
|
return;
|
233
232
|
}
|
234
233
|
if (!this.formConfigManager.isLoaded) {
|
235
234
|
return;
|
236
235
|
}
|
237
|
-
const formConfig = this.formConfigManager.getConfig(
|
236
|
+
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
238
237
|
//this._cardsState = formConfig?.cardsState;
|
239
238
|
this._formMetadata = form.buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
240
239
|
}
|
@@ -268,7 +267,7 @@ const SnkDetailView = class {
|
|
268
267
|
this.emitSwitchEvent(constants.VIEW_MODE.GRID);
|
269
268
|
evt.stopPropagation();
|
270
269
|
}
|
271
|
-
if (evt.detail === taskbarElements.TaskbarElement.FORM_MODE) {
|
270
|
+
if (evt.detail === taskbarElements.TaskbarElement.FORM_MODE || evt.detail === taskbarElements.TaskbarElement.UPDATE) {
|
272
271
|
this.emitSwitchEvent(constants.VIEW_MODE.FORM);
|
273
272
|
evt.stopPropagation();
|
274
273
|
}
|
@@ -20,7 +20,7 @@ const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
20
20
|
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
21
21
|
const formatOptions = [
|
22
22
|
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
23
|
-
{ label: getMessage("snkExporter.
|
23
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
|
24
24
|
];
|
25
25
|
const typeOptions = [
|
26
26
|
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-e49214c6.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
11
11
|
const index = require('./index-c5771aba.js');
|
12
12
|
const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
|
13
13
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
14
14
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
15
|
-
require('./form-config-fetcher-
|
16
|
-
require('./DataFetcher-
|
15
|
+
require('./form-config-fetcher-feb08214.js');
|
16
|
+
require('./DataFetcher-77729a93.js');
|
17
17
|
require('./PrintUtils-bcaeb82f.js');
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
19
19
|
|
@@ -265,13 +265,13 @@ const SnkFilterBar = class {
|
|
265
265
|
this._pendingVariables = false;
|
266
266
|
this._customfiltersToBeUpdated = [];
|
267
267
|
this._calculateSortIndex = (item) => {
|
268
|
-
|
269
|
-
|
270
|
-
if (
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
268
|
+
if (!item.visible)
|
269
|
+
return 0;
|
270
|
+
if (item.hardFixed)
|
271
|
+
return 1000000; //campos Hard Fixed não variam a ordem
|
272
|
+
let index = item.fixed ? 100000 : 0;
|
273
|
+
index += this.hasValidValue(item) ? 10000 : 0;
|
274
|
+
index += this._updateSequence.lastIndexOf(item.id) + 1;
|
275
275
|
return index;
|
276
276
|
};
|
277
277
|
this._filtersComparator = (a, b) => {
|
@@ -292,6 +292,13 @@ const SnkFilterBar = class {
|
|
292
292
|
this.showPersonalizedFilter = false;
|
293
293
|
this.personalizedFilterId = undefined;
|
294
294
|
}
|
295
|
+
hasValidValue(item) {
|
296
|
+
if (item.value === undefined || item.value === null)
|
297
|
+
return false;
|
298
|
+
if (!Array.isArray(item.value))
|
299
|
+
return true;
|
300
|
+
return item.value.some(filterItem => filterItem.check === true);
|
301
|
+
}
|
295
302
|
observeFilterConfig(newValue, oldValue) {
|
296
303
|
if (core.ObjectUtils.equals(newValue, oldValue))
|
297
304
|
return;
|
@@ -517,7 +524,7 @@ const SnkFilterBar = class {
|
|
517
524
|
getFilterItems() {
|
518
525
|
const pinnedItems = [];
|
519
526
|
const unpinnedItems = [];
|
520
|
-
this.filterConfig
|
527
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
|
521
528
|
.filter(this.filterActiveFilter)
|
522
529
|
.forEach((item, index) => {
|
523
530
|
item = core.ObjectUtils.copy(item);
|
@@ -587,6 +594,7 @@ const SnkFilterBar = class {
|
|
587
594
|
.then((filters) => {
|
588
595
|
accept();
|
589
596
|
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
597
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
590
598
|
})
|
591
599
|
.catch(reason => {
|
592
600
|
throw new core.ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
@@ -6,10 +6,10 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
8
8
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-e49214c6.js');
|
10
10
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
11
|
-
require('./form-config-fetcher-
|
12
|
-
require('./DataFetcher-
|
11
|
+
require('./form-config-fetcher-feb08214.js');
|
12
|
+
require('./DataFetcher-77729a93.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
|
@@ -7,9 +7,9 @@ const Sortable = require('./Sortable-fb1c4cbb.js');
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
10
|
+
const formConfigFetcher = require('./form-config-fetcher-feb08214.js');
|
11
11
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
12
|
-
require('./DataFetcher-
|
12
|
+
require('./DataFetcher-77729a93.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
|
@@ -80,7 +80,7 @@ const SnkFormConfig = class {
|
|
80
80
|
}
|
81
81
|
}
|
82
82
|
getConfig() {
|
83
|
-
let config = this.configManager.getConfig(
|
83
|
+
let config = this.configManager.getConfig(this.dataUnit);
|
84
84
|
if (config.fields && config.fields.length === 0) {
|
85
85
|
config = undefined;
|
86
86
|
}
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-beebf47a.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
9
|
+
require('./ConfigStorage-e49214c6.js');
|
10
|
+
require('./form-config-fetcher-feb08214.js');
|
11
|
+
require('./DataFetcher-77729a93.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|