@sankhyalabs/sankhyablocks 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SnkMessageBuilder-248b5105.js → SnkMessageBuilder-b1e5ee65.js} +1 -0
- package/dist/cjs/{constants-a47a5190.js → constants-0069b951.js} +14 -0
- package/dist/cjs/index-0e663819.js +33 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +48 -34
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +41 -10
- package/dist/cjs/snk-crud.cjs.entry.js +4 -8
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +182 -138
- package/dist/cjs/snk-data-unit.cjs.entry.js +6 -6
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-89bf9399.js → taskbar-elements-fec33533.js} +1 -1
- package/dist/collection/components/snk-application/snk-application.js +60 -10
- package/dist/collection/components/snk-crud/snk-crud.js +1 -23
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +5 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +54 -18
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +5 -5
- package/dist/collection/components/snk-grid/snk-grid.js +39 -26
- package/dist/collection/lib/@types/index.js +26 -0
- package/dist/collection/lib/applet-caller/applet-caller.js +6 -0
- package/dist/collection/lib/applet-caller/interfaces/IAppletCallerParams.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +0 -7
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +1 -0
- package/dist/collection/lib/utils/constants.js +12 -0
- package/dist/collection/lib/utils/fileViewer/index.js +24 -2
- package/dist/collection/lib/workspace/workspace.js +11 -0
- package/dist/components/SnkMessageBuilder.js +1 -0
- package/dist/components/constants.js +13 -1
- package/dist/components/snk-application2.js +48 -33
- package/dist/components/snk-crud.js +3 -8
- package/dist/components/snk-data-exporter2.js +130 -53
- package/dist/components/snk-data-unit.js +5 -5
- package/dist/components/snk-form2.js +2 -2
- package/dist/components/snk-grid2.js +41 -11
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/components/snk-taskbar2.js +2 -8
- package/dist/esm/{SnkMessageBuilder-4a060599.js → SnkMessageBuilder-608c038f.js} +1 -0
- package/dist/esm/{constants-babe1a08.js → constants-8ad13317.js} +13 -1
- package/dist/esm/index-1564817d.js +33 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +48 -34
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +41 -10
- package/dist/esm/snk-crud.entry.js +4 -8
- package/dist/esm/snk-data-exporter_8.entry.js +111 -67
- package/dist/esm/snk-data-unit.entry.js +6 -6
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-c8966343.js → taskbar-elements-e4006db7.js} +1 -1
- package/dist/sankhyablocks/{p-a65d6ba3.entry.js → p-223d1bd9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4c759619.entry.js → p-392d3c18.entry.js} +1 -1
- package/dist/sankhyablocks/p-5534e08c.js +1 -0
- package/dist/sankhyablocks/p-6671b0e1.entry.js +1 -0
- package/dist/sankhyablocks/{p-9b858e3a.entry.js → p-7ba9d7c7.entry.js} +1 -1
- package/dist/sankhyablocks/p-847d06a3.entry.js +1 -0
- package/dist/sankhyablocks/p-ad2026bb.js +1 -0
- package/dist/sankhyablocks/{p-420d07c4.js → p-b03ff65b.js} +1 -1
- package/dist/sankhyablocks/p-b7a379bf.entry.js +83 -0
- package/dist/sankhyablocks/{p-f624979d.js → p-c422cbd2.js} +1 -1
- package/dist/sankhyablocks/p-c613957d.entry.js +1 -0
- package/dist/sankhyablocks/{p-4a5c1d36.entry.js → p-e24e488b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cd19bd29.entry.js → p-f6f71be7.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +9 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +2 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +2 -1
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +1 -1
- package/dist/types/components.d.ts +7 -16
- package/dist/types/lib/@types/index.d.ts +23 -0
- package/dist/types/lib/applet-caller/applet-caller.d.ts +4 -0
- package/dist/types/lib/applet-caller/interfaces/IAppletCallerParams.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.d.ts +5 -4
- package/dist/types/lib/utils/constants.d.ts +12 -0
- package/dist/types/lib/utils/fileViewer/index.d.ts +2 -2
- package/dist/types/lib/workspace/workspace.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/index-9c584423.js +0 -7
- package/dist/collection/components/snk-data-exporter/enum/data-exporter-option.js +0 -11
- package/dist/esm/index-de5f37a6.js +0 -7
- package/dist/sankhyablocks/p-01c361bb.entry.js +0 -1
- package/dist/sankhyablocks/p-05fadb77.js +0 -1
- package/dist/sankhyablocks/p-3ee68d78.entry.js +0 -1
- package/dist/sankhyablocks/p-6673c77c.js +0 -1
- package/dist/sankhyablocks/p-b84c7c61.entry.js +0 -90
- package/dist/sankhyablocks/p-c32cfc29.entry.js +0 -1
- package/dist/types/components/snk-data-exporter/enum/data-exporter-option.d.ts +0 -10
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-b1e5ee65.js');
|
|
9
9
|
|
|
10
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
11
11
|
|
|
@@ -50,10 +50,6 @@ const SnkDataUnit = class {
|
|
|
50
50
|
}
|
|
51
51
|
if (action.type === core.Action.EDITION_CANCELED) {
|
|
52
52
|
this.cancelEdition.emit();
|
|
53
|
-
const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
|
|
54
|
-
if (cancelFinishMsg != undefined) {
|
|
55
|
-
this.showSuccessMessage(cancelFinishMsg);
|
|
56
|
-
}
|
|
57
53
|
}
|
|
58
54
|
if (action.type === core.Action.RECORDS_REMOVED) {
|
|
59
55
|
const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
@@ -160,12 +156,16 @@ const SnkDataUnit = class {
|
|
|
160
156
|
if (this.dataState.hasDirtyRecords) {
|
|
161
157
|
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
|
162
158
|
if (cancelConfirmation == undefined) {
|
|
159
|
+
this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
|
|
163
160
|
resolve(action);
|
|
164
161
|
}
|
|
165
162
|
else {
|
|
166
163
|
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
|
167
164
|
utils.ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
|
|
168
|
-
.then((result) =>
|
|
165
|
+
.then((result) => {
|
|
166
|
+
this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
|
|
167
|
+
resolve(result ? action : undefined);
|
|
168
|
+
});
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
@@ -6,7 +6,7 @@ const index = require('./index-2cd6f753.js');
|
|
|
6
6
|
const draggable_bundle = require('./draggable.bundle-82a25c06.js');
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
|
-
const constants = require('./constants-
|
|
9
|
+
const constants = require('./constants-0069b951.js');
|
|
10
10
|
const ConfigStorage = require('./ConfigStorage-8b5e3261.js');
|
|
11
11
|
require('./_commonjsHelpers-537d719a.js');
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const ConfigStorage = require('./ConfigStorage-8b5e3261.js');
|
|
8
|
-
const index$1 = require('./index-
|
|
8
|
+
const index$1 = require('./index-0e663819.js');
|
|
9
9
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const draggable_bundle = require('./draggable.bundle-82a25c06.js');
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
|
8
|
-
const constants = require('./constants-
|
|
8
|
+
const constants = require('./constants-0069b951.js');
|
|
9
9
|
require('./_commonjsHelpers-537d719a.js');
|
|
10
10
|
|
|
11
11
|
const snkTabConfigCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--snk-tab-config--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--snk-tab-config__lower-bar--background-color:var(--color--disable-primary, #e5eaf0);--snk-tab-config__lower-bar--border:2px solid var(--color--disable-primary, #e5eaf0);--snk-tab-config__tab--color:var(--text--primary, #626e82);--snk-tab-config__tab--font-family:var(--font-pattern, \"Roboto\");--snk-tab-config__tab--font-size:var(--title--small, 14px);--snk-tab-config__tab--padding:var(--space--small, 6px) var(--space--medium, 12px);--snk-tab-config__tab-is-active--color:var(--color--primary, #008561);--snk-tab-config__tab-hover--color:var(--color--secondary, #383c45);--snk-tab-config__tab-is-focused--border:1px dashed var(--color--primary, #008561);--snk-tab-config__tab-label--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--snk-tab-config__tab-label--margin-bottom:var(--space--extra-small, 3px);--snk-tab-config__new-button-icon--color:var(--color--secondary-700, #1C1D22);--snk-tab-config__forward-button--background-color:var(--text--primary, #626e82);--snk-tab-config__forward-button-hover--background-color:var(--color--primary, #008561);--snk-tab-config__left-icon--padding-right:var(--space--small, 6px);--snk-tab-config__left-icon--color:var(--text--disable, #AFB6C0);--snk-tab-config__tab-label-disabled--color:var(--text--disable, #AFB6C0);--snk-tab-config__slot--margin-left:var(--space--small, 6px);display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background-color:var(--snk-tab-config__lower-bar--background-color);border:var(--snk-tab-config__lower-bar--border)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--snk-tab-config__tab--color);font-family:var(--snk-tab-config__tab--font-family);font-size:var(--snk-tab-config__tab--font-size);padding:var(--snk-tab-config__tab--padding)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:\"\";position:absolute;width:100%;height:100%;clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out;background-color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-focused.sc-snk-tab-config{border:var(--snk-tab-config__tab-is-focused--border)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--snk-tab-config__tab-label--text-shadow);margin-bottom:var(--snk-tab-config__tab-label--margin-bottom)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__new-button-icon--color)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:'';display:flex;width:10px;height:16px;background-color:var(--snk-tab-config__forward-button--background-color)}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--snk-tab-config__left-icon--padding-right);--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--snk-tab-config__left-icon--padding-right)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear, opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--snk-tab-config__tab-label-disabled--color)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--snk-tab-config__slot--margin-left)}";
|
|
@@ -9,15 +9,16 @@ import { agGridLicense } from '../../lib/licenses/sankhyalicense.module';
|
|
|
9
9
|
import { TotalsFetcher } from "../../lib/http/data-fetcher/fetchers/totals-fetcher";
|
|
10
10
|
import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
11
11
|
import { ConfigStorage } from "../../lib/configs/ConfigStorage";
|
|
12
|
+
import { DefaultValuesFetcher } from "../../lib/http/data-fetcher/fetchers/default-values-fetcher";
|
|
12
13
|
import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/dataunit-fetcher";
|
|
13
14
|
import UrlUtils from "../../lib/utils/urlutils";
|
|
14
15
|
import Workspace from "../../lib/workspace/workspace";
|
|
16
|
+
import AppletCaller from "../../lib/applet-caller/applet-caller";
|
|
15
17
|
import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
|
|
16
18
|
import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
|
|
17
19
|
import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
|
|
18
20
|
import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
|
|
19
21
|
import FilterBarConfigFetcher from "../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher";
|
|
20
|
-
import { DefaultValuesFetcher } from "../../lib/http/data-fetcher/fetchers/default-values-fetcher";
|
|
21
22
|
/**
|
|
22
23
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
|
23
24
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
@@ -255,6 +256,17 @@ export class SnkApplication {
|
|
|
255
256
|
async openApp(resourceId, pkObject) {
|
|
256
257
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
257
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Realiza a chamada do WebConnection para realizar a exportação de arquivo.
|
|
261
|
+
* @param keyPort - Chave da porta que será requisitada.
|
|
262
|
+
* @param methodName - Nome do tipo de exportação de arquivo que será realizado.
|
|
263
|
+
* @param params - Parâmetros necessários para realizar a exportação do arquivo.
|
|
264
|
+
*/
|
|
265
|
+
async webConnection(keyPort, methodName, params) {
|
|
266
|
+
this.getStringParam(keyPort).then((port) => {
|
|
267
|
+
AppletCaller.webConnectionCaller(port, methodName, params);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
258
270
|
getDuPromissesStack(dataUnitName) {
|
|
259
271
|
let stack;
|
|
260
272
|
if (dataUnitName) {
|
|
@@ -579,15 +591,7 @@ export class SnkApplication {
|
|
|
579
591
|
* Obtém o nome das telas da aplicação
|
|
580
592
|
*/
|
|
581
593
|
async getAppLabel() {
|
|
582
|
-
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
if (window["workspace"].getAppLabel == undefined) {
|
|
586
|
-
window["workspace"].getAppLabel = (resourceID) => {
|
|
587
|
-
return (resourceID || "").split(".").pop();
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
return window["workspace"].getAppLabel(this._resourceID);
|
|
594
|
+
return Workspace.getAppLabel(this._resourceID);
|
|
591
595
|
}
|
|
592
596
|
clearContent(container) {
|
|
593
597
|
if (container) {
|
|
@@ -1073,6 +1077,52 @@ export class SnkApplication {
|
|
|
1073
1077
|
"tags": []
|
|
1074
1078
|
}
|
|
1075
1079
|
},
|
|
1080
|
+
"webConnection": {
|
|
1081
|
+
"complexType": {
|
|
1082
|
+
"signature": "(keyPort: string, methodName: string, params: IAppletCallerParams) => Promise<void>",
|
|
1083
|
+
"parameters": [{
|
|
1084
|
+
"tags": [{
|
|
1085
|
+
"name": "param",
|
|
1086
|
+
"text": "keyPort - Chave da porta que ser\u00E1 requisitada."
|
|
1087
|
+
}],
|
|
1088
|
+
"text": "- Chave da porta que ser\u00E1 requisitada."
|
|
1089
|
+
}, {
|
|
1090
|
+
"tags": [{
|
|
1091
|
+
"name": "param",
|
|
1092
|
+
"text": "methodName - Nome do tipo de exporta\u00E7\u00E3o de arquivo que ser\u00E1 realizado."
|
|
1093
|
+
}],
|
|
1094
|
+
"text": "- Nome do tipo de exporta\u00E7\u00E3o de arquivo que ser\u00E1 realizado."
|
|
1095
|
+
}, {
|
|
1096
|
+
"tags": [{
|
|
1097
|
+
"name": "param",
|
|
1098
|
+
"text": "params - Par\u00E2metros necess\u00E1rios para realizar a exporta\u00E7\u00E3o do arquivo."
|
|
1099
|
+
}],
|
|
1100
|
+
"text": "- Par\u00E2metros necess\u00E1rios para realizar a exporta\u00E7\u00E3o do arquivo."
|
|
1101
|
+
}],
|
|
1102
|
+
"references": {
|
|
1103
|
+
"Promise": {
|
|
1104
|
+
"location": "global"
|
|
1105
|
+
},
|
|
1106
|
+
"IAppletCallerParams": {
|
|
1107
|
+
"location": "global"
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
"return": "Promise<void>"
|
|
1111
|
+
},
|
|
1112
|
+
"docs": {
|
|
1113
|
+
"text": "Realiza a chamada do WebConnection para realizar a exporta\u00E7\u00E3o de arquivo.",
|
|
1114
|
+
"tags": [{
|
|
1115
|
+
"name": "param",
|
|
1116
|
+
"text": "keyPort - Chave da porta que ser\u00E1 requisitada."
|
|
1117
|
+
}, {
|
|
1118
|
+
"name": "param",
|
|
1119
|
+
"text": "methodName - Nome do tipo de exporta\u00E7\u00E3o de arquivo que ser\u00E1 realizado."
|
|
1120
|
+
}, {
|
|
1121
|
+
"name": "param",
|
|
1122
|
+
"text": "params - Par\u00E2metros necess\u00E1rios para realizar a exporta\u00E7\u00E3o do arquivo."
|
|
1123
|
+
}]
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1076
1126
|
"createDataunit": {
|
|
1077
1127
|
"complexType": {
|
|
1078
1128
|
"signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit) => Promise<DataUnit>",
|
|
@@ -17,10 +17,6 @@ export class SnkCrud {
|
|
|
17
17
|
* Determina se pode haver mais de uma linha selecionada na grade.
|
|
18
18
|
*/
|
|
19
19
|
this.multipleSelection = true;
|
|
20
|
-
/**
|
|
21
|
-
* Determina se haverá exportação de dados
|
|
22
|
-
*/
|
|
23
|
-
this.enableDataExporter = false;
|
|
24
20
|
/**
|
|
25
21
|
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
26
22
|
*/
|
|
@@ -112,7 +108,7 @@ export class SnkCrud {
|
|
|
112
108
|
this.validatePresentationMode();
|
|
113
109
|
}
|
|
114
110
|
render() {
|
|
115
|
-
return (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, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection,
|
|
111
|
+
return (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, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, "data-element-id": "crud_form", configName: this.configName, actionsList: this.actionsList, onExit: () => this.setViewMode(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode }, h("slot", { name: "SnkFormTaskBar" }))), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
116
112
|
}
|
|
117
113
|
static get is() { return "snk-crud"; }
|
|
118
114
|
static get encapsulation() { return "scoped"; }
|
|
@@ -246,24 +242,6 @@ export class SnkCrud {
|
|
|
246
242
|
"reflect": false,
|
|
247
243
|
"defaultValue": "true"
|
|
248
244
|
},
|
|
249
|
-
"enableDataExporter": {
|
|
250
|
-
"type": "boolean",
|
|
251
|
-
"mutable": false,
|
|
252
|
-
"complexType": {
|
|
253
|
-
"original": "boolean",
|
|
254
|
-
"resolved": "boolean",
|
|
255
|
-
"references": {}
|
|
256
|
-
},
|
|
257
|
-
"required": false,
|
|
258
|
-
"optional": false,
|
|
259
|
-
"docs": {
|
|
260
|
-
"tags": [],
|
|
261
|
-
"text": "Determina se haver\u00E1 exporta\u00E7\u00E3o de dados"
|
|
262
|
-
},
|
|
263
|
-
"attribute": "enable-data-exporter",
|
|
264
|
-
"reflect": false,
|
|
265
|
-
"defaultValue": "false"
|
|
266
|
-
},
|
|
267
245
|
"presentationMode": {
|
|
268
246
|
"type": "string",
|
|
269
247
|
"mutable": false,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { ItemBuilder } from './structure/ItemBuilder';
|
|
5
|
+
import { DataExporterFormat, DataExporterOption, DataExporterType } from '../../lib/@types';
|
|
5
6
|
import fetchDataExporter from "../../lib/http/data-fetcher/fetchers/fetchDataExporter";
|
|
6
7
|
import fileViewer from "../../lib/utils/fileViewer";
|
|
7
|
-
import { ItemBuilder } from './structure/ItemBuilder';
|
|
8
8
|
export class SnkDataExporter {
|
|
9
9
|
constructor() {
|
|
10
10
|
this._items = [];
|
|
@@ -12,9 +12,12 @@ export class SnkDataExporter {
|
|
|
12
12
|
this._showDropdown = false;
|
|
13
13
|
this._releasedToExport = [
|
|
14
14
|
DataExporterOption.EXPORT_TO_PDF,
|
|
15
|
+
DataExporterOption.EXPORT_TO_XLS,
|
|
15
16
|
DataExporterOption.EXPORT_BY_EMAIL,
|
|
16
17
|
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
17
|
-
DataExporterOption.EXPORT_XLS_TO_EMAIL
|
|
18
|
+
DataExporterOption.EXPORT_XLS_TO_EMAIL,
|
|
19
|
+
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
20
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
18
21
|
];
|
|
19
22
|
/**
|
|
20
23
|
* Provedor das informações para exportação dos dados.
|
|
@@ -34,19 +37,14 @@ export class SnkDataExporter {
|
|
|
34
37
|
};
|
|
35
38
|
this._snkEmailSender.open(config)
|
|
36
39
|
.then(({ format, email: { to, subject, message } }) => {
|
|
37
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
38
42
|
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
39
43
|
this._snkEmailSender.close();
|
|
40
44
|
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
41
45
|
});
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
|
-
getFormatExporter(format) {
|
|
45
|
-
if (format === "xlsx") {
|
|
46
|
-
return DataExporterOption.EXPORT_XLS_TO_EMAIL;
|
|
47
|
-
}
|
|
48
|
-
return DataExporterOption.EXPORT_PDF_TO_EMAIL;
|
|
49
|
-
}
|
|
50
48
|
/**
|
|
51
49
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
52
50
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -84,20 +82,56 @@ export class SnkDataExporter {
|
|
|
84
82
|
this._showDropdown = !this._showDropdown;
|
|
85
83
|
}
|
|
86
84
|
resolveExporter(resolveProps, callbackResolver) {
|
|
87
|
-
if (this.provider == undefined) {
|
|
85
|
+
if (this.provider == undefined || resolveProps == undefined || callbackResolver == undefined) {
|
|
88
86
|
return;
|
|
89
87
|
}
|
|
90
88
|
const filters = this.provider.getFilters();
|
|
91
89
|
const columns = this.provider.getColumnsMetadata();
|
|
92
90
|
const sort = this.provider.getOrders();
|
|
93
91
|
const resourceURI = this.provider.getResourceURI();
|
|
94
|
-
|
|
92
|
+
const option = resolveProps.exportOption;
|
|
93
|
+
const currentPageOptions = [
|
|
94
|
+
DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
95
|
+
DataExporterOption.EXPORT_PAGE_TO_XLS
|
|
96
|
+
];
|
|
97
|
+
delete resolveProps.exportOption;
|
|
98
|
+
let params = Object.assign({ filters,
|
|
95
99
|
columns,
|
|
96
100
|
sort,
|
|
97
|
-
resourceURI }, resolveProps)
|
|
101
|
+
resourceURI }, resolveProps);
|
|
102
|
+
if (currentPageOptions.includes(option)) {
|
|
103
|
+
const offset = this.provider.getOffset();
|
|
104
|
+
const limit = this.provider.getLimit();
|
|
105
|
+
params = Object.assign(Object.assign({}, params), { offset,
|
|
106
|
+
limit });
|
|
107
|
+
}
|
|
108
|
+
fetchDataExporter(params)
|
|
98
109
|
.then((result) => callbackResolver(result))
|
|
99
110
|
.catch(() => ApplicationUtils.error(this.getMessage("snkDataExporter.title.error"), this.getMessage("snkDataExporter.message.exportError")));
|
|
100
111
|
}
|
|
112
|
+
getOptionKey(option) {
|
|
113
|
+
return Object.keys(DataExporterOption)
|
|
114
|
+
.find((key) => {
|
|
115
|
+
return DataExporterOption[key] === option;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
dispatchExporter(option) {
|
|
119
|
+
var _a;
|
|
120
|
+
const optionKey = this.getOptionKey(option);
|
|
121
|
+
const fileType = (_a = DataExporterType[optionKey]) !== null && _a !== void 0 ? _a : DataExporterType.EXPORT_TO_PDF;
|
|
122
|
+
const isDownload = DataExporterType[optionKey] === DataExporterType.EXPORT_TO_XLS;
|
|
123
|
+
const params = {
|
|
124
|
+
methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
|
|
125
|
+
fileName: this._appLabel,
|
|
126
|
+
titleGrid: this._appLabel,
|
|
127
|
+
exportOption: option
|
|
128
|
+
};
|
|
129
|
+
this.resolveExporter(params, (response) => {
|
|
130
|
+
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
131
|
+
isDownload }));
|
|
132
|
+
ApplicationUtils.info(this.getMessage("snkDataExporter.message.exportSuccess"), { iconName: "check" });
|
|
133
|
+
});
|
|
134
|
+
}
|
|
101
135
|
async processExporter(evt) {
|
|
102
136
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
103
137
|
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
@@ -107,7 +141,7 @@ export class SnkDataExporter {
|
|
|
107
141
|
this.exportByEmail();
|
|
108
142
|
}
|
|
109
143
|
else {
|
|
110
|
-
this.
|
|
144
|
+
this.dispatchExporter(item.id);
|
|
111
145
|
}
|
|
112
146
|
this._showDropdown = false;
|
|
113
147
|
}
|
|
@@ -115,7 +149,8 @@ export class SnkDataExporter {
|
|
|
115
149
|
const items = [];
|
|
116
150
|
this._releasedToExport
|
|
117
151
|
.forEach((option) => {
|
|
118
|
-
|
|
152
|
+
var _a;
|
|
153
|
+
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
|
119
154
|
});
|
|
120
155
|
return items;
|
|
121
156
|
}
|
|
@@ -126,8 +161,9 @@ export class SnkDataExporter {
|
|
|
126
161
|
this._items = this.getItems();
|
|
127
162
|
}
|
|
128
163
|
componentWillLoad() {
|
|
164
|
+
var _a;
|
|
129
165
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
130
|
-
this._application.getAppLabel().then(result => this._appLabel = result);
|
|
166
|
+
(_a = this._application) === null || _a === void 0 ? void 0 : _a.getAppLabel().then(result => this._appLabel = result);
|
|
131
167
|
this.loadDropdown();
|
|
132
168
|
this.setEvents();
|
|
133
169
|
}
|
|
@@ -136,6 +172,7 @@ export class SnkDataExporter {
|
|
|
136
172
|
return;
|
|
137
173
|
}
|
|
138
174
|
ElementIDUtils.addIDInfo(this._element);
|
|
175
|
+
this.positionDropdown();
|
|
139
176
|
}
|
|
140
177
|
componentWillUpdate() {
|
|
141
178
|
if (this._showDropdown) {
|
|
@@ -150,8 +187,7 @@ export class SnkDataExporter {
|
|
|
150
187
|
render() {
|
|
151
188
|
return (h(Host, null, h("div", { class: `snk-data-exporter
|
|
152
189
|
${this._showDropdown ? " snk-data-exporter--overlap" : ""}
|
|
153
|
-
` }, h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", onClick: () => this.controlDropdown() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("button")}` })), this._showDropdown &&
|
|
154
|
-
h("ez-dropdown", Object.assign({ ref: (ref) => this._ezDropdown = ref, items: this._items, onEzClick: (evt) => this.processExporter(evt) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("dropdown")}` }))), this._showDropdown &&
|
|
190
|
+
` }, h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", onClick: () => this.controlDropdown() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("button")}` })), h("ez-dropdown", Object.assign({ class: this._showDropdown ? "" : "snk-data-exporter__dropdown--hide", ref: (ref) => this._ezDropdown = ref, items: this._items, onEzClick: (evt) => this.processExporter(evt) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("dropdown")}` }))), this._showDropdown &&
|
|
155
191
|
h("div", Object.assign({ class: "ez-scrim ez-scrim--light" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("ezScrim")}` })), h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) })));
|
|
156
192
|
}
|
|
157
193
|
static get is() { return "snk-data-exporter"; }
|
|
@@ -38,10 +38,6 @@ export class SnkDataUnit {
|
|
|
38
38
|
}
|
|
39
39
|
if (action.type === Action.EDITION_CANCELED) {
|
|
40
40
|
this.cancelEdition.emit();
|
|
41
|
-
const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
|
|
42
|
-
if (cancelFinishMsg != undefined) {
|
|
43
|
-
this.showSuccessMessage(cancelFinishMsg);
|
|
44
|
-
}
|
|
45
41
|
}
|
|
46
42
|
if (action.type === Action.RECORDS_REMOVED) {
|
|
47
43
|
const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
@@ -148,12 +144,16 @@ export class SnkDataUnit {
|
|
|
148
144
|
if (this.dataState.hasDirtyRecords) {
|
|
149
145
|
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
|
150
146
|
if (cancelConfirmation == undefined) {
|
|
147
|
+
this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
|
|
151
148
|
resolve(action);
|
|
152
149
|
}
|
|
153
150
|
else {
|
|
154
151
|
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
|
155
152
|
ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
|
|
156
|
-
.then((result) =>
|
|
153
|
+
.then((result) => {
|
|
154
|
+
this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo"));
|
|
155
|
+
resolve(result ? action : undefined);
|
|
156
|
+
});
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
@@ -15,10 +15,6 @@ export class SnkGrid {
|
|
|
15
15
|
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "DATA_EXPORTER"]
|
|
16
16
|
});
|
|
17
17
|
this._popUpGridConfig = false;
|
|
18
|
-
/**
|
|
19
|
-
* Determina se haverá exportação de dados
|
|
20
|
-
*/
|
|
21
|
-
this.enableDataExporter = false;
|
|
22
18
|
/**
|
|
23
19
|
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
24
20
|
*/
|
|
@@ -90,7 +86,10 @@ export class SnkGrid {
|
|
|
90
86
|
buildColumnsMetadata(columnsMetadata, gridColumns) {
|
|
91
87
|
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
|
92
88
|
var _a, _b, _c, _d, _e;
|
|
93
|
-
|
|
89
|
+
/**
|
|
90
|
+
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
|
91
|
+
*/
|
|
92
|
+
if (column.hidden && column.name !== "RECDESP") {
|
|
94
93
|
return;
|
|
95
94
|
}
|
|
96
95
|
const fieldData = (_d = (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.filter((field) => field.name === column.name)) === null || _d === void 0 ? void 0 : _d[0];
|
|
@@ -98,7 +97,7 @@ export class SnkGrid {
|
|
|
98
97
|
label: column.label,
|
|
99
98
|
id: column.name,
|
|
100
99
|
width: column.width,
|
|
101
|
-
|
|
100
|
+
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
|
102
101
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
|
103
102
|
};
|
|
104
103
|
columnsMetadata.push(columnData);
|
|
@@ -107,7 +106,7 @@ export class SnkGrid {
|
|
|
107
106
|
label: fieldData.properties.DESCRIPTIONENTITY,
|
|
108
107
|
id: fieldData.properties.ENTITYNAME + "." + fieldData.properties.DESCRIPTIONFIELD,
|
|
109
108
|
width: 200,
|
|
110
|
-
|
|
109
|
+
type: DataType.TEXT,
|
|
111
110
|
userInterface: UserInterface.LONGTEXT
|
|
112
111
|
};
|
|
113
112
|
columnsMetadata.push(descriptionColumn);
|
|
@@ -115,8 +114,34 @@ export class SnkGrid {
|
|
|
115
114
|
});
|
|
116
115
|
return columnsMetadata || [];
|
|
117
116
|
}
|
|
117
|
+
getPaginationInfo() {
|
|
118
|
+
var _a;
|
|
119
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
|
120
|
+
}
|
|
121
|
+
getExporterOffset(paginationInfo) {
|
|
122
|
+
if (paginationInfo == undefined) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const offset = paginationInfo.firstRecord;
|
|
126
|
+
if (offset > 0) {
|
|
127
|
+
return (offset - 1);
|
|
128
|
+
}
|
|
129
|
+
return offset;
|
|
130
|
+
}
|
|
131
|
+
getExporterLimit(paginationInfo) {
|
|
132
|
+
if (paginationInfo == undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const { firstRecord, lastRecord } = paginationInfo;
|
|
136
|
+
const limit = firstRecord > 0 && lastRecord > 0 && (lastRecord - firstRecord + 1);
|
|
137
|
+
if (!limit) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
return limit;
|
|
141
|
+
}
|
|
118
142
|
async dataExporterProviderStore() {
|
|
119
143
|
var _a;
|
|
144
|
+
const paginationInfo = this.getPaginationInfo();
|
|
120
145
|
const columnsMetadata = [];
|
|
121
146
|
await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
122
147
|
const dataExporterProvider = {
|
|
@@ -138,6 +163,12 @@ export class SnkGrid {
|
|
|
138
163
|
getSelectedNumber: () => {
|
|
139
164
|
var _a, _b;
|
|
140
165
|
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
166
|
+
},
|
|
167
|
+
getOffset: () => {
|
|
168
|
+
return this.getExporterOffset(paginationInfo);
|
|
169
|
+
},
|
|
170
|
+
getLimit: () => {
|
|
171
|
+
return this.getExporterLimit(paginationInfo);
|
|
141
172
|
}
|
|
142
173
|
};
|
|
143
174
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
@@ -181,7 +212,7 @@ export class SnkGrid {
|
|
|
181
212
|
this.loadConfig();
|
|
182
213
|
}
|
|
183
214
|
componentWillRender() {
|
|
184
|
-
const invisibleButtons = this.
|
|
215
|
+
const invisibleButtons = this._dataUnit && this._dataUnit.records.length > 0 ? [] : ["DATA_EXPORTER"];
|
|
185
216
|
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
186
217
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
187
218
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
@@ -305,24 +336,6 @@ export class SnkGrid {
|
|
|
305
336
|
"attribute": "multiple-selection",
|
|
306
337
|
"reflect": false
|
|
307
338
|
},
|
|
308
|
-
"enableDataExporter": {
|
|
309
|
-
"type": "boolean",
|
|
310
|
-
"mutable": false,
|
|
311
|
-
"complexType": {
|
|
312
|
-
"original": "boolean",
|
|
313
|
-
"resolved": "boolean",
|
|
314
|
-
"references": {}
|
|
315
|
-
},
|
|
316
|
-
"required": false,
|
|
317
|
-
"optional": false,
|
|
318
|
-
"docs": {
|
|
319
|
-
"tags": [],
|
|
320
|
-
"text": "Determina se haver\u00E1 exporta\u00E7\u00E3o de dados"
|
|
321
|
-
},
|
|
322
|
-
"attribute": "enable-data-exporter",
|
|
323
|
-
"reflect": false,
|
|
324
|
-
"defaultValue": "false"
|
|
325
|
-
},
|
|
326
339
|
"presentationMode": {
|
|
327
340
|
"type": "string",
|
|
328
341
|
"mutable": false,
|
|
@@ -3,3 +3,29 @@ export var PresentationMode;
|
|
|
3
3
|
PresentationMode["PRIMARY"] = "primary";
|
|
4
4
|
PresentationMode["SECONDARY"] = "secondary";
|
|
5
5
|
})(PresentationMode || (PresentationMode = {}));
|
|
6
|
+
export var DataExporterOption;
|
|
7
|
+
(function (DataExporterOption) {
|
|
8
|
+
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
|
9
|
+
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
|
10
|
+
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
|
11
|
+
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
|
12
|
+
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
|
13
|
+
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
|
14
|
+
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
|
15
|
+
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
|
16
|
+
})(DataExporterOption || (DataExporterOption = {}));
|
|
17
|
+
export var DataExporterFormat;
|
|
18
|
+
(function (DataExporterFormat) {
|
|
19
|
+
DataExporterFormat["PDF"] = "exportPDFToEmail";
|
|
20
|
+
DataExporterFormat["XLS"] = "exportXLSToEmail";
|
|
21
|
+
DataExporterFormat["XLSX"] = "exportXLSToEmail";
|
|
22
|
+
})(DataExporterFormat || (DataExporterFormat = {}));
|
|
23
|
+
export var DataExporterType;
|
|
24
|
+
(function (DataExporterType) {
|
|
25
|
+
DataExporterType["EXPORT_TO_PDF"] = "PDF";
|
|
26
|
+
DataExporterType["EXPORT_TO_XLS"] = "XLS";
|
|
27
|
+
DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
|
|
28
|
+
DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
|
|
29
|
+
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
|
30
|
+
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
|
31
|
+
})(DataExporterType || (DataExporterType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|