@sankhyalabs/sankhyablocks 8.16.0-dev.3 → 8.16.0-dev.31
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-ecc0ed20.js} +3 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-807730a8.js} +39 -6
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
- package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-f89461c1.js} +46 -18
- package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +37 -28
- package/dist/cjs/snk-crud.cjs.entry.js +14 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-668dc5e8.js} +42 -22
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +37 -25
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
- package/dist/cjs/snk-form.cjs.entry.js +7 -6
- package/dist/cjs/snk-grid.cjs.entry.js +61 -21
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-68777d37.js} +24 -12
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +64 -26
- package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-attach/snk-attach.js +24 -15
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
- package/dist/collection/components/snk-crud/snk-crud.js +78 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +51 -6
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
- package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
- package/dist/collection/components/snk-form-config/snk-form-config.js +14 -3
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +68 -8
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +89 -15
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
- 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/collection/lib/message/resources/snk-grid.msg.js +5 -1
- package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
- package/dist/components/DataFetcher.js +22 -16
- package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
- package/dist/components/SnkFormConfigManager.js +72 -18
- package/dist/components/SnkMessageBuilder.js +7 -3
- package/dist/components/dataunit-fetcher.js +45 -15
- package/dist/components/form-config-fetcher.js +4 -1
- package/dist/components/snk-actions-button2.js +12 -9
- package/dist/components/snk-attach2.js +33 -24
- package/dist/components/snk-crud.js +12 -1
- package/dist/components/snk-data-exporter2.js +12 -11
- package/dist/components/snk-data-unit2.js +44 -60
- package/dist/components/snk-detail-view2.js +24 -11
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +35 -22
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-form-config2.js +15 -4
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +53 -11
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +57 -15
- package/dist/components/snk-taskbar2.js +24 -2
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-1a82a768.js} +40 -8
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
- package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-139f09fa.js} +74 -20
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-c24c76c6.js} +46 -16
- package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +17 -14
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +37 -28
- package/dist/esm/snk-crud.entry.js +14 -6
- package/dist/esm/snk-data-exporter.entry.js +19 -18
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-0fdfb6c2.js} +42 -22
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +12 -13
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +37 -25
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +17 -6
- package/dist/esm/snk-form.entry.js +7 -6
- package/dist/esm/snk-grid.entry.js +56 -16
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-b5dd30e6.js} +24 -12
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +60 -22
- package/dist/esm/snk-taskbar.entry.js +23 -1
- package/dist/sankhyablocks/p-0035ad6e.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
- package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-23736d75.js +1 -0
- package/dist/sankhyablocks/p-3ae9d08a.js +1 -0
- package/dist/sankhyablocks/p-3e3cc017.js +1 -0
- package/dist/sankhyablocks/p-430e4d3c.entry.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
- package/dist/sankhyablocks/p-50779ad3.entry.js +1 -0
- package/dist/sankhyablocks/p-5dd8cf4f.js +1 -0
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
- package/dist/sankhyablocks/p-694e1c4a.entry.js +1 -0
- package/dist/sankhyablocks/p-7ac7932c.js +60 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/p-7eef0898.entry.js +1 -0
- package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-a42e7a1e.entry.js} +2 -2
- package/dist/sankhyablocks/p-afbb070d.js +1 -0
- package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
- package/dist/sankhyablocks/p-b9c67e45.entry.js +1 -0
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
- package/dist/sankhyablocks/p-d80a84fd.entry.js +1 -0
- package/dist/sankhyablocks/p-d836f72b.entry.js +1 -0
- package/dist/sankhyablocks/p-e16e87fc.entry.js +1 -0
- package/dist/sankhyablocks/p-eb9f0407.entry.js +1 -0
- package/dist/sankhyablocks/p-f3434fc4.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +13 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +14 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +89 -0
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
- package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
- package/dist/sankhyablocks/p-c2495304.js +0 -1
- package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
|
2
2
|
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
|
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
|
4
|
-
import './pesquisa-fetcher-
|
|
3
|
+
import { D as DataFetcher } from './DataFetcher-a9c598f2.js';
|
|
4
|
+
import './pesquisa-fetcher-8edaa8cd.js';
|
|
5
5
|
import './index-3aa4977a.js';
|
|
6
6
|
import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
|
|
7
|
-
import { P as PreloadManager, b as
|
|
7
|
+
import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-c24c76c6.js';
|
|
8
8
|
import './filter-item-type.enum-d45e026f.js';
|
|
9
|
-
import './form-config-fetcher-
|
|
9
|
+
import './form-config-fetcher-adbe5d34.js';
|
|
10
10
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
|
11
|
-
import { A as AutorizationType } from './auth-fetcher-
|
|
11
|
+
import { A as AutorizationType } from './auth-fetcher-749d880f.js';
|
|
12
12
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
13
13
|
import './PrintUtils-3e4ff0f5.js';
|
|
14
14
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
@@ -113,21 +113,23 @@ const SERVICE = {
|
|
|
113
113
|
download: "AnexoSistemaSP.baixar",
|
|
114
114
|
};
|
|
115
115
|
class AnexoSistemaFetcher {
|
|
116
|
-
constructor(entityName,
|
|
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.
|
|
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.
|
|
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.
|
|
191
|
+
pkEntity: this._registerKey,
|
|
190
192
|
typeAcess: fields.TIPOACESSO,
|
|
191
193
|
typeApres: fields.TIPOAPRES,
|
|
192
194
|
}
|
|
@@ -458,9 +460,7 @@ class AttachFetcherDataUnitFactory {
|
|
|
458
460
|
});
|
|
459
461
|
this._records = records;
|
|
460
462
|
}
|
|
461
|
-
|
|
462
|
-
records = applySorting(records, dataUnit, request.sort);
|
|
463
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
|
463
|
+
return buildLoadDataResponse(this._records, dataUnit, request);
|
|
464
464
|
}
|
|
465
465
|
saveLoader(changes, fetcher) {
|
|
466
466
|
return new Promise((resolve) => {
|
|
@@ -656,11 +656,20 @@ const SnkAttach = class {
|
|
|
656
656
|
this.loadAttachmentDataUnit();
|
|
657
657
|
}
|
|
658
658
|
if (oldRegisterKey !== newRegisterKey) {
|
|
659
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
|
660
|
+
this._currentFetcher.registerKey = newRegisterKey;
|
|
661
|
+
}
|
|
659
662
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
|
|
660
663
|
}
|
|
661
664
|
}
|
|
665
|
+
getAnexoSistemaFetcherInstance() {
|
|
666
|
+
var _a;
|
|
667
|
+
const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
|
668
|
+
anexoSistemaFetcher.registerKey = this.registerKey;
|
|
669
|
+
return anexoSistemaFetcher;
|
|
670
|
+
}
|
|
662
671
|
async initAttach() {
|
|
663
|
-
var _a, _b, _c, _d, _e
|
|
672
|
+
var _a, _b, _c, _d, _e;
|
|
664
673
|
if (!this.fetcherType && !this.registerKey)
|
|
665
674
|
return;
|
|
666
675
|
if (!this.fetcherType) {
|
|
@@ -668,18 +677,18 @@ const SnkAttach = class {
|
|
|
668
677
|
}
|
|
669
678
|
this.returnToGridMode();
|
|
670
679
|
if (this.fetcherType === "AnexoSistema") {
|
|
671
|
-
this._currentFetcher =
|
|
672
|
-
(
|
|
673
|
-
await ((
|
|
680
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
|
681
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
|
682
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
|
674
683
|
return;
|
|
675
684
|
}
|
|
676
685
|
if (this.fetcherType === "Attach") {
|
|
677
|
-
const hasMoreOneItem = ((
|
|
686
|
+
const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
|
|
678
687
|
if (hasMoreOneItem)
|
|
679
688
|
return;
|
|
680
689
|
}
|
|
681
|
-
await ((
|
|
682
|
-
await ((
|
|
690
|
+
await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
|
|
691
|
+
await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
|
|
683
692
|
}
|
|
684
693
|
/**
|
|
685
694
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -738,11 +747,11 @@ const SnkAttach = class {
|
|
|
738
747
|
}
|
|
739
748
|
}
|
|
740
749
|
async loadAnexoSistema() {
|
|
741
|
-
var _a, _b
|
|
750
|
+
var _a, _b;
|
|
742
751
|
this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
|
743
|
-
this._currentFetcher =
|
|
752
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
|
744
753
|
if (!this._currentDataUnit.metadata) {
|
|
745
|
-
await ((
|
|
754
|
+
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
|
746
755
|
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
|
747
756
|
}
|
|
748
757
|
this.initDataUnitLoaders();
|
|
@@ -752,7 +761,7 @@ const SnkAttach = class {
|
|
|
752
761
|
this._currentDataUnit.addInterceptor({
|
|
753
762
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
|
754
763
|
});
|
|
755
|
-
await ((
|
|
764
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
|
756
765
|
this.disableEditFieldsNotInForm();
|
|
757
766
|
}
|
|
758
767
|
async loadAttach() {
|
|
@@ -778,16 +787,16 @@ const SnkAttach = class {
|
|
|
778
787
|
}
|
|
779
788
|
}
|
|
780
789
|
initDataUnitLoaders() {
|
|
781
|
-
var _a, _b
|
|
790
|
+
var _a, _b;
|
|
782
791
|
if (this.fetcherType === "AnexoSistema") {
|
|
783
|
-
this._currentFetcher =
|
|
792
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
|
784
793
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
|
785
|
-
(
|
|
794
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
|
786
795
|
}
|
|
787
796
|
if (this.fetcherType === "Attach") {
|
|
788
797
|
this._currentFetcher = new AttachFetcher();
|
|
789
798
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
|
790
|
-
(
|
|
799
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
|
791
800
|
this.returnToGridMode();
|
|
792
801
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
|
793
802
|
});
|
|
@@ -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-
|
|
5
|
-
import './pesquisa-fetcher-
|
|
4
|
+
import './DataFetcher-a9c598f2.js';
|
|
5
|
+
import './pesquisa-fetcher-8edaa8cd.js';
|
|
6
6
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
7
7
|
import './ISave-d8c8bc59.js';
|
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
|
-
import './dataunit-fetcher-
|
|
10
|
+
import './dataunit-fetcher-c24c76c6.js';
|
|
11
11
|
import './filter-item-type.enum-d45e026f.js';
|
|
12
|
-
import './form-config-fetcher-
|
|
12
|
+
import './form-config-fetcher-adbe5d34.js';
|
|
13
13
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
|
14
|
-
import { A as AutorizationType } from './auth-fetcher-
|
|
14
|
+
import { A as AutorizationType } from './auth-fetcher-749d880f.js';
|
|
15
15
|
import './index-bdf75557.js';
|
|
16
16
|
import './PrintUtils-3e4ff0f5.js';
|
|
17
17
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
@@ -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,9 @@ const SnkCrud = class {
|
|
|
55
56
|
this.disablePersonalizedFilter = undefined;
|
|
56
57
|
this.autoLoad = undefined;
|
|
57
58
|
this.autoFocus = true;
|
|
59
|
+
this.enableGridInsert = false;
|
|
60
|
+
this.domainMessagesBuilder = undefined;
|
|
61
|
+
this.setCustomFormTitle = undefined;
|
|
58
62
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
@@ -163,6 +167,7 @@ const SnkCrud = class {
|
|
|
163
167
|
else if (viewMode === VIEW_MODE.FORM) {
|
|
164
168
|
this._guidesViewer.setFocus();
|
|
165
169
|
}
|
|
170
|
+
this.viewModeChanged.emit(viewMode);
|
|
166
171
|
}
|
|
167
172
|
openConfig(viewMode) {
|
|
168
173
|
this._snkConfigurator.close();
|
|
@@ -178,6 +183,8 @@ const SnkCrud = class {
|
|
|
178
183
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
179
184
|
}
|
|
180
185
|
insertionModeHandler() {
|
|
186
|
+
if (this.enableGridInsert)
|
|
187
|
+
return;
|
|
181
188
|
this.gridToForm();
|
|
182
189
|
}
|
|
183
190
|
cancelHandler() {
|
|
@@ -226,6 +233,7 @@ const SnkCrud = class {
|
|
|
226
233
|
this._snkDataUnit = parent;
|
|
227
234
|
this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
|
|
228
235
|
this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
|
|
236
|
+
this._snkDataUnit.domainMessagesBuilder = this.domainMessagesBuilder;
|
|
229
237
|
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
230
238
|
this._dataState = this._snkDataUnit.dataState;
|
|
231
239
|
if (!this._dataUnit) {
|
|
@@ -391,7 +399,7 @@ const SnkCrud = class {
|
|
|
391
399
|
return;
|
|
392
400
|
}
|
|
393
401
|
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" }))));
|
|
402
|
+
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, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle }, 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
403
|
}
|
|
396
404
|
get _element() { return getElement(this); }
|
|
397
405
|
static get watchers() { return {
|
|
@@ -3,19 +3,19 @@ import { ApplicationContext, ObjectUtils, UserInterface, DataType, ElementIDUtil
|
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-3aa4977a.js';
|
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
|
|
6
|
-
import { D as DataFetcher } from './DataFetcher-
|
|
7
|
-
import { S as SnkDataUnit } from './snk-data-unit-
|
|
8
|
-
import './pesquisa-fetcher-
|
|
6
|
+
import { D as DataFetcher } from './DataFetcher-a9c598f2.js';
|
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-0fdfb6c2.js';
|
|
8
|
+
import './pesquisa-fetcher-8edaa8cd.js';
|
|
9
9
|
import './ISave-d8c8bc59.js';
|
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
12
|
-
import './dataunit-fetcher-
|
|
12
|
+
import './dataunit-fetcher-c24c76c6.js';
|
|
13
13
|
import './filter-item-type.enum-d45e026f.js';
|
|
14
|
-
import './form-config-fetcher-
|
|
14
|
+
import './form-config-fetcher-adbe5d34.js';
|
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
|
16
|
-
import './SnkMessageBuilder-
|
|
17
|
-
import './RecordIDUtils-87d02110.js';
|
|
16
|
+
import './SnkMessageBuilder-6fff4a4c.js';
|
|
18
17
|
import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
18
|
+
import './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
19
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
20
20
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
21
21
|
import './ResourceIDUtils-a114189a.js';
|
|
@@ -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")} (.
|
|
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")} (.
|
|
177
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
@@ -291,11 +291,11 @@ class ServerSideExporterStrategy {
|
|
|
291
291
|
return visibleColumns;
|
|
292
292
|
}
|
|
293
293
|
async getParams(resolveProps) {
|
|
294
|
-
var _a, _b, _c, _d, _e, _f;
|
|
294
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
295
295
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
296
|
-
const columns =
|
|
297
|
-
const sort = (
|
|
298
|
-
const resourceURI = (
|
|
296
|
+
const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
297
|
+
const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
|
|
298
|
+
const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
299
299
|
const selectedIDs = this._provider.getSelectedIDs();
|
|
300
300
|
const option = resolveProps.exportOption;
|
|
301
301
|
const currentPageOptions = [
|
|
@@ -350,15 +350,16 @@ class ClientSideExporterStrategy {
|
|
|
350
350
|
return visibleColumns;
|
|
351
351
|
}
|
|
352
352
|
async executeExport(resolveProps) {
|
|
353
|
-
|
|
353
|
+
var _a;
|
|
354
|
+
const { methodName, gridTitle } = resolveProps;
|
|
354
355
|
const records = await this._provider.getRecords();
|
|
355
|
-
const columns =
|
|
356
|
+
const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
|
356
357
|
const [serviceName, processor] = this.getExecutor(methodName);
|
|
357
358
|
const payload = {
|
|
358
359
|
serviceName,
|
|
359
360
|
requestBody: {
|
|
360
361
|
grid: {
|
|
361
|
-
|
|
362
|
+
gridTitle,
|
|
362
363
|
columns: this.buildColumnsObject(columns),
|
|
363
364
|
rows: this.buildRowsObject(columns, records),
|
|
364
365
|
customOptions: { xlsxExtension: false }
|
|
@@ -468,7 +469,7 @@ const SnkDataExporter = class {
|
|
|
468
469
|
resolver: ({ type, format, email: { to, subject, message } }) => {
|
|
469
470
|
var _a;
|
|
470
471
|
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
471
|
-
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel,
|
|
472
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, gridTitle: this._appLabel }, () => {
|
|
472
473
|
this._snkEmailSender.close();
|
|
473
474
|
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
474
475
|
});
|
|
@@ -556,7 +557,7 @@ const SnkDataExporter = class {
|
|
|
556
557
|
const params = {
|
|
557
558
|
methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
|
|
558
559
|
fileName: this._appLabel,
|
|
559
|
-
|
|
560
|
+
gridTitle: this._appLabel,
|
|
560
561
|
exportOption: option,
|
|
561
562
|
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
|
562
563
|
type: this.getExportType(option),
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
5
|
-
import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-
|
|
6
|
-
import { g as getSelectedIDs } from './RecordIDUtils-87d02110.js';
|
|
4
|
+
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
|
5
|
+
import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-c24c76c6.js';
|
|
7
6
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
7
|
+
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
8
8
|
|
|
9
9
|
const SnkDataUnit = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -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) {
|
|
@@ -114,7 +115,7 @@ const SnkDataUnit = class {
|
|
|
114
115
|
* @returns Retorna a lista de IDs dos registros selecionados.
|
|
115
116
|
*/
|
|
116
117
|
async getSelectedRecordsIDsInfo() {
|
|
117
|
-
return
|
|
118
|
+
return getSelectedRecordsIDsInfo(this.dataUnit);
|
|
118
119
|
}
|
|
119
120
|
/**
|
|
120
121
|
* Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
|
|
@@ -475,21 +476,15 @@ const SnkDataUnit = class {
|
|
|
475
476
|
if (this.ignoreSaveMessage) {
|
|
476
477
|
return;
|
|
477
478
|
}
|
|
478
|
-
const
|
|
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
|
}
|
|
482
484
|
}
|
|
483
485
|
handleRecordsRemoved(action) {
|
|
484
486
|
var _a, _b;
|
|
485
|
-
|
|
486
|
-
let removeFinishMsg;
|
|
487
|
-
if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
|
|
488
|
-
removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
492
|
-
}
|
|
487
|
+
let removeFinishMsg = this.buildRemoveFinishMessage(action);
|
|
493
488
|
if (removeFinishMsg != undefined) {
|
|
494
489
|
this.showSuccessMessage(removeFinishMsg);
|
|
495
490
|
}
|
|
@@ -500,16 +495,27 @@ const SnkDataUnit = class {
|
|
|
500
495
|
this.dataUnit.gotoPage(page);
|
|
501
496
|
}
|
|
502
497
|
}
|
|
498
|
+
buildRemoveFinishMessage(action) {
|
|
499
|
+
const records = action.payload.records;
|
|
500
|
+
if (!records || !records.length)
|
|
501
|
+
return undefined;
|
|
502
|
+
if ((records === null || records === void 0 ? void 0 : records.length) > 1)
|
|
503
|
+
return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
|
|
504
|
+
return this.getMessage('snkDataUnit.removeInfo', records);
|
|
505
|
+
}
|
|
503
506
|
/**
|
|
504
507
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
505
508
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
506
509
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
507
510
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
|
508
511
|
*/
|
|
509
|
-
getMessage(key, params = undefined) {
|
|
512
|
+
getMessage(key, params = undefined, customOperation) {
|
|
510
513
|
if (!params) {
|
|
511
514
|
params = this.getMessageParams();
|
|
512
515
|
}
|
|
516
|
+
if (customOperation) {
|
|
517
|
+
this.messagesBuilder.currentOperation = customOperation;
|
|
518
|
+
}
|
|
513
519
|
return this.messagesBuilder.getMessage(key, params);
|
|
514
520
|
}
|
|
515
521
|
getMessageParams() {
|
|
@@ -540,19 +546,28 @@ const SnkDataUnit = class {
|
|
|
540
546
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
|
541
547
|
}
|
|
542
548
|
}
|
|
549
|
+
updateMetadataWithRMP() {
|
|
550
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
|
551
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
|
552
|
+
const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
|
|
553
|
+
this.dataUnit.metadata = dataUnitUpdatedMetadata;
|
|
554
|
+
}
|
|
543
555
|
async loadDataUnit() {
|
|
544
|
-
var _a;
|
|
556
|
+
var _a, _b;
|
|
545
557
|
if (this.dataUnit == null && this._application && this.entityName) {
|
|
546
558
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
|
547
559
|
}
|
|
548
560
|
if (this.dataUnit) {
|
|
549
561
|
this.dataUnit.pageSize = this.pageSize;
|
|
550
562
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
551
|
-
this.dataUnit.addInterceptor(this);
|
|
552
563
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
564
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
|
|
565
|
+
this.updateMetadataWithRMP();
|
|
566
|
+
}
|
|
567
|
+
this.dataUnit.addInterceptor(this);
|
|
568
|
+
if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
569
|
+
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
570
|
+
this.dataUnit.records = records;
|
|
556
571
|
}
|
|
557
572
|
this.dataState = this.buildDataState();
|
|
558
573
|
let resolver;
|
|
@@ -616,6 +631,13 @@ const SnkDataUnit = class {
|
|
|
616
631
|
parent = parent.parentElement;
|
|
617
632
|
}
|
|
618
633
|
}
|
|
634
|
+
instanceMessagesBuilder() {
|
|
635
|
+
var _a;
|
|
636
|
+
if (this.messagesBuilder) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
|
640
|
+
}
|
|
619
641
|
//---------------------------------------------
|
|
620
642
|
// Lifecycle web component
|
|
621
643
|
//---------------------------------------------
|
|
@@ -623,9 +645,7 @@ const SnkDataUnit = class {
|
|
|
623
645
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
624
646
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
|
625
647
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
|
626
|
-
|
|
627
|
-
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
628
|
-
}
|
|
648
|
+
this.instanceMessagesBuilder();
|
|
629
649
|
}
|
|
630
650
|
disconnectedCallback() {
|
|
631
651
|
if (this.dataUnit) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { S as snk_data_unit } from './snk-data-unit-
|
|
1
|
+
export { S as snk_data_unit } from './snk-data-unit-0fdfb6c2.js';
|
|
2
2
|
import './index-a7d3d3f1.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import './SnkMessageBuilder-
|
|
6
|
-
import './dataunit-fetcher-
|
|
7
|
-
import './DataFetcher-
|
|
5
|
+
import './SnkMessageBuilder-6fff4a4c.js';
|
|
6
|
+
import './dataunit-fetcher-c24c76c6.js';
|
|
7
|
+
import './DataFetcher-a9c598f2.js';
|
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
12
12
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
13
13
|
import './ResourceIDUtils-a114189a.js';
|
|
14
|
-
import './RecordIDUtils-87d02110.js';
|
|
15
14
|
import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
15
|
+
import './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
@@ -1,27 +1,27 @@
|
|
|
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-
|
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-139f09fa.js';
|
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
5
|
-
import './DataFetcher-
|
|
6
|
-
import './pesquisa-fetcher-
|
|
5
|
+
import './DataFetcher-a9c598f2.js';
|
|
6
|
+
import './pesquisa-fetcher-8edaa8cd.js';
|
|
7
7
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
8
8
|
import './ISave-d8c8bc59.js';
|
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
11
|
-
import './dataunit-fetcher-
|
|
11
|
+
import './dataunit-fetcher-c24c76c6.js';
|
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
|
13
|
-
import './form-config-fetcher-
|
|
13
|
+
import './form-config-fetcher-adbe5d34.js';
|
|
14
14
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
15
15
|
import { d as VIEW_MODE } from './constants-8457af36.js';
|
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
|
17
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
18
|
-
import './ConfigStorage-
|
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-b5dd30e6.js';
|
|
17
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
|
18
|
+
import './ConfigStorage-7b36d041.js';
|
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
21
21
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
22
22
|
import './ResourceIDUtils-a114189a.js';
|
|
23
23
|
import './index-bdf75557.js';
|
|
24
|
-
import './field-search-
|
|
24
|
+
import './field-search-f8b1d91e.js';
|
|
25
25
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
26
26
|
|
|
27
27
|
class GuideBuilder {
|
|
@@ -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(
|
|
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
|
}
|
|
@@ -288,7 +287,7 @@ const SnkDetailView = class {
|
|
|
288
287
|
}
|
|
289
288
|
componentWillLoad() {
|
|
290
289
|
this._configName = `dynaform.${this.entityName}`;
|
|
291
|
-
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata());
|
|
290
|
+
this.formConfigManager = new SnkFormConfigManager(this._configName, this.resourceID, () => this.loadMetadata(), this.dataUnit);
|
|
292
291
|
this.formConfigManager.loadConfig();
|
|
293
292
|
if (this.messagesBuilder == undefined) {
|
|
294
293
|
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
|
@@ -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.
|
|
19
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
|
|
20
20
|
];
|
|
21
21
|
const typeOptions = [
|
|
22
22
|
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|