@sankhyalabs/sankhyablocks 2.5.2 → 2.7.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-370e23ae.js → SnkMessageBuilder-09b25b0a.js} +20 -1
- package/dist/cjs/data-exporter-option-417da37a.js +19 -0
- package/dist/cjs/{index-20e8b68a.js → index-2cd6f753.js} +26 -0
- package/dist/cjs/index-696b5c3b.js +200 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +11 -3
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +71 -13
- package/dist/cjs/snk-crud.cjs.entry.js +3 -2
- package/dist/cjs/{snk-exporter-email-sender_8.cjs.entry.js → snk-data-exporter_9.cjs.entry.js} +305 -8
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- 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-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-3807c809.js → taskbar-elements-bbb89cdb.js} +8 -5
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-data-exporter/enum/data-exporter-option.js +11 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +4 -4
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +19 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +181 -0
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +140 -0
- package/dist/collection/components/snk-grid/snk-grid.js +69 -10
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +7 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +9 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +33 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +16 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/collection/lib/store/index.js +5 -0
- package/dist/collection/lib/utils/fileViewer/index.js +3 -0
- package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js +1 -0
- package/dist/components/ConfigStorage.js +3 -6694
- package/dist/components/DataFetcher.js +6695 -0
- package/dist/components/SnkMessageBuilder.js +20 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +11 -2
- package/dist/components/snk-crud.js +10 -4
- package/dist/components/snk-data-exporter.d.ts +11 -0
- package/dist/components/snk-data-exporter.js +6 -0
- package/dist/components/snk-data-exporter2.js +330 -0
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form2.js +8 -2
- package/dist/components/snk-grid2.js +74 -10
- package/dist/components/snk-taskbar2.js +212 -9
- package/dist/esm/{SnkMessageBuilder-7d583c9a.js → SnkMessageBuilder-47db5d75.js} +20 -1
- package/dist/esm/data-exporter-option-006307dd.js +19 -0
- package/dist/esm/{index-e4121713.js → index-a77b6f35.js} +25 -1
- package/dist/esm/index-d89e384f.js +198 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +11 -3
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +68 -10
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/{snk-exporter-email-sender_8.entry.js → snk-data-exporter_9.entry.js} +304 -8
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-personalized.entry.js +1 -1
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-b2bbe275.js → taskbar-elements-beec3b27.js} +8 -5
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-04581d0c.entry.js +1 -0
- package/dist/sankhyablocks/p-112bb324.js +1 -0
- package/dist/sankhyablocks/{p-c17be74f.entry.js → p-12ebe36a.entry.js} +1 -1
- package/dist/sankhyablocks/p-13116d05.entry.js +1 -0
- package/dist/sankhyablocks/{p-14af45cc.entry.js → p-187b0d06.entry.js} +1 -1
- package/dist/sankhyablocks/{p-570cc474.entry.js → p-1a2533d0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-fd3b562d.entry.js → p-1ccaea51.entry.js} +1 -1
- package/dist/sankhyablocks/p-1d7a0daf.js +1 -0
- package/dist/sankhyablocks/p-50c8bcb7.entry.js +1 -0
- package/dist/sankhyablocks/{p-44ce5b90.entry.js → p-57895452.entry.js} +1 -1
- package/dist/sankhyablocks/{p-48bbbd2c.entry.js → p-68fcc226.entry.js} +1 -1
- package/dist/sankhyablocks/p-719e570a.js +1 -0
- package/dist/sankhyablocks/{p-00b3c5d8.entry.js → p-772f1c44.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c30d0966.entry.js → p-82e20fc0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-eff899b0.entry.js → p-91c23d20.entry.js} +1 -1
- package/dist/sankhyablocks/p-a77dd79a.js +2 -0
- package/dist/sankhyablocks/{p-f50c6ef6.entry.js → p-ab4ff312.entry.js} +1 -1
- package/dist/sankhyablocks/p-c8327a5c.js +1 -0
- package/dist/sankhyablocks/{p-2664ae24.entry.js → p-d3e402d3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9593c937.entry.js → p-d7ae56ce.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70e52fee.entry.js → p-d96bf6a7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b0a0222f.entry.js → p-df5d94c6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-db111acd.entry.js → p-e075dba7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a3871147.entry.js → p-f8fdd16c.entry.js} +11 -4
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/data/attachment.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/data/email.d.ts +3 -3
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +5 -5
- package/dist/types/components/snk-data-exporter/data/export-result.d.ts +5 -5
- package/dist/types/components/snk-data-exporter/data/report.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/enum/data-exporter-option.d.ts +10 -0
- package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +4 -4
- package/dist/types/components/snk-data-exporter/exporter-email-sender/options-step.d.ts +4 -4
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +9 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +40 -0
- package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +61 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -1
- package/dist/types/components.d.ts +33 -3
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +14 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.d.ts +7 -0
- package/dist/types/lib/message/resources/snk-data-exporter.msg.d.ts +1 -0
- package/dist/types/lib/store/index.d.ts +4 -0
- package/dist/types/lib/utils/fileViewer/index.d.ts +2 -0
- package/dist/types/lib/utils/fileViewer/interfaces/IFileViewerParams.d.ts +4 -0
- package/package.json +2 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/AuthorizationConfig-79ffae4b.js +0 -7
- package/dist/esm/AuthorizationConfig-dcbd207a.js +0 -7
- package/dist/sankhyablocks/p-8a872a35.entry.js +0 -1
- package/dist/sankhyablocks/p-9ba3df4c.js +0 -2
- package/dist/sankhyablocks/p-9e67cf79.entry.js +0 -1
- package/dist/sankhyablocks/p-c118ef2a.entry.js +0 -1
- package/dist/sankhyablocks/p-dbaad88c.js +0 -1
- package/dist/sankhyablocks/p-dc36cfbf.js +0 -1
- package/dist/sankhyablocks/p-e7f772ed.js +0 -1
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const constants = require('./constants-a47a5190.js');
|
|
8
|
-
const
|
|
8
|
+
const dataExporterOption = require('./data-exporter-option-417da37a.js');
|
|
9
|
+
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
9
10
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
10
11
|
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
11
|
-
const
|
|
12
|
+
const index$1 = require('./index-696b5c3b.js');
|
|
12
13
|
require('./_commonjsHelpers-537d719a.js');
|
|
13
14
|
|
|
14
15
|
const snkConfiguratorCss = ".sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--medium, 12px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}";
|
|
@@ -51,23 +52,23 @@ const SnkConfigurator = class {
|
|
|
51
52
|
this.openConfig.emit(this.viewMode);
|
|
52
53
|
}
|
|
53
54
|
isAllowed(configName) {
|
|
54
|
-
if (
|
|
55
|
+
if (dataExporterOption.AuthorizationConfig[configName]) {
|
|
55
56
|
return this._permissions ? this._permissions.isSup || this._permissions[configName] : false;
|
|
56
57
|
}
|
|
57
58
|
return true;
|
|
58
59
|
}
|
|
59
60
|
enableModeConfig() {
|
|
60
|
-
if (!this.isAllowed(
|
|
61
|
+
if (!this.isAllowed(dataExporterOption.AuthorizationConfig.CONFIG_GRID) || !this.isAllowed(dataExporterOption.AuthorizationConfig.CONFIG)) {
|
|
61
62
|
return false;
|
|
62
63
|
}
|
|
63
64
|
return true;
|
|
64
65
|
}
|
|
65
66
|
getViewModeValue() {
|
|
66
67
|
if (this._permissions != undefined) {
|
|
67
|
-
if (!this.isAllowed(
|
|
68
|
+
if (!this.isAllowed(dataExporterOption.AuthorizationConfig.CONFIG_GRID)) {
|
|
68
69
|
this.viewMode = FORM_MODE.name;
|
|
69
70
|
}
|
|
70
|
-
else if (!this.isAllowed(
|
|
71
|
+
else if (!this.isAllowed(dataExporterOption.AuthorizationConfig.CONFIG)) {
|
|
71
72
|
this.viewMode = GRID_MODE.name;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -167,8 +168,8 @@ const SnkGrid = class {
|
|
|
167
168
|
"snkGridTopTaskbar": ["FORM_MODE", "CONFIGURATOR", "INSERT"]
|
|
168
169
|
});
|
|
169
170
|
this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
|
170
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH", "
|
|
171
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "
|
|
171
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER"],
|
|
172
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "DATA_EXPORTER"]
|
|
172
173
|
});
|
|
173
174
|
this._popUpGridConfig = false;
|
|
174
175
|
/**
|
|
@@ -200,8 +201,9 @@ const SnkGrid = class {
|
|
|
200
201
|
async setConfig(config) {
|
|
201
202
|
this.setGridConfig(config);
|
|
202
203
|
}
|
|
203
|
-
|
|
204
|
-
|
|
204
|
+
ezClickDataExporterHandler(event) {
|
|
205
|
+
var _a;
|
|
206
|
+
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL) {
|
|
205
207
|
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
206
208
|
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
207
209
|
// apenas mais uma
|
|
@@ -270,6 +272,61 @@ const SnkGrid = class {
|
|
|
270
272
|
this.closeGridConfig();
|
|
271
273
|
});
|
|
272
274
|
}
|
|
275
|
+
buildColumnsMetadata(columnsMetadata, gridColumns) {
|
|
276
|
+
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
|
277
|
+
var _a, _b, _c, _d, _e;
|
|
278
|
+
if (column.hidden) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
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];
|
|
282
|
+
const columnData = {
|
|
283
|
+
label: column.label,
|
|
284
|
+
id: column.name,
|
|
285
|
+
width: column.width,
|
|
286
|
+
dataType: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
|
287
|
+
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
|
288
|
+
};
|
|
289
|
+
columnsMetadata.push(columnData);
|
|
290
|
+
if (((_e = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _e === void 0 ? void 0 : _e.DESCRIPTIONFIELD) != undefined) {
|
|
291
|
+
const descriptionColumn = {
|
|
292
|
+
label: fieldData.properties.DESCRIPTIONENTITY,
|
|
293
|
+
id: fieldData.properties.ENTITYNAME + "." + fieldData.properties.DESCRIPTIONFIELD,
|
|
294
|
+
width: 200,
|
|
295
|
+
dataType: core.DataType.TEXT,
|
|
296
|
+
userInterface: UnitMetadata.UserInterface.LONGTEXT
|
|
297
|
+
};
|
|
298
|
+
columnsMetadata.push(descriptionColumn);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
return columnsMetadata || [];
|
|
302
|
+
}
|
|
303
|
+
async dataExporterProviderStore() {
|
|
304
|
+
var _a;
|
|
305
|
+
const columnsMetadata = [];
|
|
306
|
+
await ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
307
|
+
const dataExporterProvider = {
|
|
308
|
+
getFilters: () => {
|
|
309
|
+
var _a;
|
|
310
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getFilters();
|
|
311
|
+
},
|
|
312
|
+
getColumnsMetadata: () => {
|
|
313
|
+
return columnsMetadata;
|
|
314
|
+
},
|
|
315
|
+
getOrders: () => {
|
|
316
|
+
var _a;
|
|
317
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSort();
|
|
318
|
+
},
|
|
319
|
+
getResourceURI: () => {
|
|
320
|
+
var _a;
|
|
321
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
322
|
+
},
|
|
323
|
+
getSelectedNumber: () => {
|
|
324
|
+
var _a, _b;
|
|
325
|
+
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
index$1.store.set("exporterProviders", Object.assign(Object.assign({}, index$1.store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
329
|
+
}
|
|
273
330
|
componentWillLoad() {
|
|
274
331
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
275
332
|
let parent = this._element.parentElement;
|
|
@@ -296,10 +353,11 @@ const SnkGrid = class {
|
|
|
296
353
|
this.loadConfig();
|
|
297
354
|
}
|
|
298
355
|
componentWillRender() {
|
|
299
|
-
const invisibleButtons = this.enableDataExporter ? [] : ["
|
|
356
|
+
const invisibleButtons = this.enableDataExporter && this._dataUnit && this._dataUnit.records.length > 0 ? [] : ["DATA_EXPORTER"];
|
|
300
357
|
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
301
358
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
302
359
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
360
|
+
this.dataExporterProviderStore();
|
|
303
361
|
}
|
|
304
362
|
addElementID() {
|
|
305
363
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
@@ -309,7 +367,7 @@ const SnkGrid = class {
|
|
|
309
367
|
if (!this._dataUnit) {
|
|
310
368
|
return undefined;
|
|
311
369
|
}
|
|
312
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, index.h("snk-taskbar", { dataUnit: this._dataUnit, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
370
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, index.h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
313
371
|
}
|
|
314
372
|
get _element() { return index.getElement(this); }
|
|
315
373
|
};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const constants = require('./constants-a47a5190.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-bbb89cdb.js');
|
|
9
|
+
require('./index-696b5c3b.js');
|
|
9
10
|
|
|
10
11
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
11
12
|
|
package/dist/cjs/{snk-exporter-email-sender_8.cjs.entry.js → snk-data-exporter_9.cjs.entry.js}
RENAMED
|
@@ -2,17 +2,313 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
+
const dataExporterOption = require('./data-exporter-option-417da37a.js');
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
7
9
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
10
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
9
11
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
10
12
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
11
|
-
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
12
13
|
const constants = require('./constants-a47a5190.js');
|
|
13
|
-
const
|
|
14
|
-
const taskbarElements = require('./taskbar-elements-3807c809.js');
|
|
14
|
+
const taskbarElements = require('./taskbar-elements-bbb89cdb.js');
|
|
15
15
|
require('./_commonjsHelpers-537d719a.js');
|
|
16
|
+
require('./index-696b5c3b.js');
|
|
17
|
+
|
|
18
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
19
|
+
var t = {};
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
23
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
25
|
+
t[p[i]] = s[p[i]];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
function fetchDataExporter(_a) {
|
|
30
|
+
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
|
31
|
+
const serviceName = `DataExporterSPBean.${methodName}`;
|
|
32
|
+
const payload = { serviceName, requestBody };
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
ConfigStorage.DataFetcher.get()
|
|
35
|
+
.callServiceBroker(serviceName, core.ObjectUtils.objectToString(payload))
|
|
36
|
+
.then(result => resolve(getFormatResponse(result)))
|
|
37
|
+
.catch(error => reject(error));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function getFormatResponse(result) {
|
|
41
|
+
var _a;
|
|
42
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
43
|
+
if (response == undefined) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return core.ObjectUtils.stringToObject(response);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function fileViewer({ fileSessionKey }) {
|
|
50
|
+
window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}&download=S`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
class ItemBuilder {
|
|
54
|
+
constructor(getMessage, selectedNumber) {
|
|
55
|
+
this._selectedNumber = 0;
|
|
56
|
+
this._getMessage = getMessage;
|
|
57
|
+
this._selectedNumber = selectedNumber;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Método responsável por inserir os items no array de opções.
|
|
61
|
+
* @param option - Nome da opção que será inserida no array.
|
|
62
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
|
63
|
+
*/
|
|
64
|
+
setExportOption(option, items) {
|
|
65
|
+
const groupName = this.getExportGroupName();
|
|
66
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_TO_PDF) {
|
|
67
|
+
items.push(this.getExportToPDF(groupName));
|
|
68
|
+
}
|
|
69
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_TO_XLS) {
|
|
70
|
+
items.push(this.getExportToXLS(groupName));
|
|
71
|
+
}
|
|
72
|
+
this.setExportCurrentPage(option, items);
|
|
73
|
+
this.setExportByEmail(option, items);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Método responsável por inserir os itens de exportação personalizada.
|
|
77
|
+
* @param option - Nome da opção que será inserida no array.
|
|
78
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
|
79
|
+
*/
|
|
80
|
+
setExportCurrentPage(option, items) {
|
|
81
|
+
var _a;
|
|
82
|
+
const pageOptions = [dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_PDF, dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_XLS];
|
|
83
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_CURRENT_PAGE) {
|
|
84
|
+
items.push(this.getCurrentPage());
|
|
85
|
+
}
|
|
86
|
+
if (pageOptions.includes(option)) {
|
|
87
|
+
let item = items.find((item) => item.id === dataExporterOption.DataExporterOption.EXPORT_CURRENT_PAGE);
|
|
88
|
+
if (item == undefined) {
|
|
89
|
+
items.push(this.getCurrentPage());
|
|
90
|
+
item = items.find((item) => item.id === dataExporterOption.DataExporterOption.EXPORT_CURRENT_PAGE);
|
|
91
|
+
}
|
|
92
|
+
if (!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
93
|
+
item.children = [];
|
|
94
|
+
}
|
|
95
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_PDF) {
|
|
96
|
+
item.children.push(this.getExportPageToPDF());
|
|
97
|
+
}
|
|
98
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
|
99
|
+
item.children.push(this.getExportPageToXLS());
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Método responsável por inserir os itens de exportação por e-mail.
|
|
105
|
+
* @param option - Nome da opção que será inserida no array.
|
|
106
|
+
* @param items - Array que será alimentado com as opções permitidas.
|
|
107
|
+
*/
|
|
108
|
+
setExportByEmail(option, items) {
|
|
109
|
+
if (option === dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL) {
|
|
110
|
+
items.push(this.getExportByEmail());
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Método responsável por capturar o objeto com os dados de exportação em PDF.
|
|
115
|
+
* @param groupName - Nome do grupo da opção que será inserida na lista.
|
|
116
|
+
* @returns Retorna o objeto com os dados de exportação em PDF.
|
|
117
|
+
*/
|
|
118
|
+
getExportToPDF(groupName) {
|
|
119
|
+
return {
|
|
120
|
+
id: dataExporterOption.DataExporterOption.EXPORT_TO_PDF,
|
|
121
|
+
label: "PDF (.pdf)",
|
|
122
|
+
group: groupName
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Método responsável por capturar o objeto com os dados de exportação em XLS.
|
|
127
|
+
* @param groupName - Nome do grupo da opção que será inserida na lista.
|
|
128
|
+
* @returns Retorna o objeto com os dados de exportação em XLS.
|
|
129
|
+
*/
|
|
130
|
+
getExportToXLS(groupName) {
|
|
131
|
+
return {
|
|
132
|
+
id: dataExporterOption.DataExporterOption.EXPORT_TO_XLS,
|
|
133
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
|
|
134
|
+
group: groupName
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Método responsável por capturar o objeto com os dados de exportação personalizada.
|
|
139
|
+
* @returns Retorna o objeto com os dados de exportação personalizada.
|
|
140
|
+
*/
|
|
141
|
+
getCurrentPage() {
|
|
142
|
+
return {
|
|
143
|
+
id: dataExporterOption.DataExporterOption.EXPORT_CURRENT_PAGE,
|
|
144
|
+
label: this._getMessage("snkDataExporter.label.currentPage"),
|
|
145
|
+
group: this._getMessage("snkDataExporter.group.custom")
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
|
|
150
|
+
* @returns Retorna o objeto com os dados de exportação personalizada em PDF.
|
|
151
|
+
*/
|
|
152
|
+
getExportPageToPDF() {
|
|
153
|
+
return {
|
|
154
|
+
id: dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
155
|
+
label: "PDF (.pdf)"
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Método responsável por capturar o objeto com os dados de exportação personalizada em XLS.
|
|
160
|
+
* @returns Retorna o objeto com os dados de exportação personalizada em XLS.
|
|
161
|
+
*/
|
|
162
|
+
getExportPageToXLS() {
|
|
163
|
+
return {
|
|
164
|
+
id: dataExporterOption.DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
165
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Método responsável por capturar o objeto com os dados de exportação por e-mail.
|
|
170
|
+
* @returns Retorna o objeto com os dados de exportação por e-mail.
|
|
171
|
+
*/
|
|
172
|
+
getExportByEmail() {
|
|
173
|
+
return {
|
|
174
|
+
id: dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL,
|
|
175
|
+
label: `${this._getMessage("snkDataExporter.label.sendByEmail")}...`
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Método responsável por capturar o nome do grupo da opção que será inserida na lista.
|
|
180
|
+
* @returns Retorna o nome do grupo da opção que será inserida na lista.
|
|
181
|
+
*/
|
|
182
|
+
getExportGroupName() {
|
|
183
|
+
if (this._selectedNumber === 1) {
|
|
184
|
+
return this._getMessage("snkDataExporter.group.export.selectedLine");
|
|
185
|
+
}
|
|
186
|
+
if (this._selectedNumber > 1) {
|
|
187
|
+
return this._getMessage("snkDataExporter.group.export.multiSelected").replace('{0}', this._selectedNumber.toString());
|
|
188
|
+
}
|
|
189
|
+
return this._getMessage("snkDataExporter.group.export.default");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const snkDataExporterCss = ".sc-snk-data-exporter-h{--snk-data-exporter--z-index:var(--more-visible, 2);display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content;z-index:var(--snk-data-exporter--z-index)}";
|
|
194
|
+
|
|
195
|
+
const SnkDataExporter = class {
|
|
196
|
+
constructor(hostRef) {
|
|
197
|
+
index.registerInstance(this, hostRef);
|
|
198
|
+
this.ezClickDataExporter = index.createEvent(this, "ezClickDataExporter", 7);
|
|
199
|
+
this._items = [];
|
|
200
|
+
this._selectedNumber = 0;
|
|
201
|
+
this._showDropdown = false;
|
|
202
|
+
this._releasedToExport = [
|
|
203
|
+
dataExporterOption.DataExporterOption.EXPORT_TO_PDF,
|
|
204
|
+
dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL,
|
|
205
|
+
dataExporterOption.DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
206
|
+
dataExporterOption.DataExporterOption.EXPORT_XLS_TO_EMAIL
|
|
207
|
+
];
|
|
208
|
+
/**
|
|
209
|
+
* Provedor das informações para exportação dos dados.
|
|
210
|
+
*/
|
|
211
|
+
this.provider = null;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
215
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
216
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
217
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-exporter.msg.ts"
|
|
218
|
+
*/
|
|
219
|
+
getMessage(key, params) {
|
|
220
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
221
|
+
}
|
|
222
|
+
positionDropdown() {
|
|
223
|
+
var _a;
|
|
224
|
+
const bounding = (_a = this._ezButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
225
|
+
if (bounding == undefined || this._ezDropdown == undefined) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
this._ezDropdown.style.top = (bounding.y + bounding.height + 5) + "px";
|
|
229
|
+
this._ezDropdown.style.left = bounding.x + "px";
|
|
230
|
+
}
|
|
231
|
+
closeDropdown(evt) {
|
|
232
|
+
const target = evt === null || evt === void 0 ? void 0 : evt.target;
|
|
233
|
+
if (target == undefined) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (!target.closest(".snk-data-exporter")) {
|
|
237
|
+
this._showDropdown = false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
setEvents() {
|
|
241
|
+
document.removeEventListener("click", this.closeDropdown.bind(this));
|
|
242
|
+
document.addEventListener("click", this.closeDropdown.bind(this));
|
|
243
|
+
document.removeEventListener("scroll", this.positionDropdown.bind(this));
|
|
244
|
+
document.addEventListener("scroll", this.positionDropdown.bind(this));
|
|
245
|
+
}
|
|
246
|
+
controlDropdown() {
|
|
247
|
+
this._showDropdown = !this._showDropdown;
|
|
248
|
+
}
|
|
249
|
+
async processExporter(evt) {
|
|
250
|
+
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
251
|
+
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (item.id !== dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL) {
|
|
255
|
+
if (this.provider == undefined) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const filters = this.provider.getFilters();
|
|
259
|
+
const columns = this.provider.getColumnsMetadata();
|
|
260
|
+
const sort = this.provider.getOrders();
|
|
261
|
+
const resourceURI = this.provider.getResourceURI();
|
|
262
|
+
fetchDataExporter({ filters, columns, sort, resourceURI, methodName: item.id })
|
|
263
|
+
.then((response) => fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" })))
|
|
264
|
+
.catch(err => console.log(err));
|
|
265
|
+
}
|
|
266
|
+
this.ezClickDataExporter.emit(item);
|
|
267
|
+
this._showDropdown = false;
|
|
268
|
+
}
|
|
269
|
+
getItems() {
|
|
270
|
+
const items = [];
|
|
271
|
+
this._releasedToExport
|
|
272
|
+
.forEach((option) => {
|
|
273
|
+
this._itemBuilder.setExportOption(option, items);
|
|
274
|
+
});
|
|
275
|
+
return items;
|
|
276
|
+
}
|
|
277
|
+
loadDropdown() {
|
|
278
|
+
var _a;
|
|
279
|
+
this._selectedNumber = ((_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedNumber()) || 0;
|
|
280
|
+
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
|
281
|
+
this._items = this.getItems();
|
|
282
|
+
}
|
|
283
|
+
componentWillLoad() {
|
|
284
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
285
|
+
this.loadDropdown();
|
|
286
|
+
this.setEvents();
|
|
287
|
+
}
|
|
288
|
+
componentDidLoad() {
|
|
289
|
+
if (this._element == undefined) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
core.ElementIDUtils.addIDInfo(this._element);
|
|
293
|
+
}
|
|
294
|
+
componentWillUpdate() {
|
|
295
|
+
if (this._showDropdown) {
|
|
296
|
+
this.loadDropdown();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
componentDidUpdate() {
|
|
300
|
+
if (this._showDropdown) {
|
|
301
|
+
this.positionDropdown();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
render() {
|
|
305
|
+
return (index.h(index.Host, null, index.h("div", { class: "snk-data-exporter" }, index.h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", onClick: () => this.controlDropdown() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("button")}` })), this._showDropdown &&
|
|
306
|
+
index.h("ez-dropdown", Object.assign({ ref: (ref) => this._ezDropdown = ref, items: this._items, onEzClick: (evt) => this.processExporter(evt) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("dropdown")}` }))), this._showDropdown &&
|
|
307
|
+
index.h("div", Object.assign({ class: "ez-scrim ez-scrim-light" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("ezScrim")}` }))));
|
|
308
|
+
}
|
|
309
|
+
get _element() { return index.getElement(this); }
|
|
310
|
+
};
|
|
311
|
+
SnkDataExporter.style = snkDataExporterCss;
|
|
16
312
|
|
|
17
313
|
const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
18
314
|
return index.h("div", null,
|
|
@@ -1516,7 +1812,7 @@ const SnkTaskbar = class {
|
|
|
1516
1812
|
[taskbarElements.TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
|
|
1517
1813
|
[taskbarElements.TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
|
|
1518
1814
|
[taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
|
1519
|
-
[taskbarElements.TaskbarElement.
|
|
1815
|
+
[taskbarElements.TaskbarElement.DATA_EXPORTER]: "snkTaskbar.titleDataExporter"
|
|
1520
1816
|
};
|
|
1521
1817
|
}
|
|
1522
1818
|
observeButtons() {
|
|
@@ -1539,8 +1835,8 @@ const SnkTaskbar = class {
|
|
|
1539
1835
|
if (buttonName === taskbarElements.AuthorizationElements.CONFIGURATOR) {
|
|
1540
1836
|
return this._permissions
|
|
1541
1837
|
? this._permissions.isSup
|
|
1542
|
-
|| this._permissions[
|
|
1543
|
-
|| this._permissions[
|
|
1838
|
+
|| this._permissions[dataExporterOption.AuthorizationConfig.CONFIG_GRID]
|
|
1839
|
+
|| this._permissions[dataExporterOption.AuthorizationConfig.CONFIG]
|
|
1544
1840
|
: false;
|
|
1545
1841
|
}
|
|
1546
1842
|
if (taskbarElements.AuthorizationElements[buttonName]) {
|
|
@@ -1607,7 +1903,7 @@ const SnkTaskbar = class {
|
|
|
1607
1903
|
className += "ez-padding-left--medium";
|
|
1608
1904
|
}
|
|
1609
1905
|
if (taskbarElements.TaskbarElement[def.toString()]) {
|
|
1610
|
-
return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
|
|
1906
|
+
return taskbarElements.buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
|
|
1611
1907
|
}
|
|
1612
1908
|
else {
|
|
1613
1909
|
return taskbarElements.buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -1685,6 +1981,7 @@ const SnkTaskbar = class {
|
|
|
1685
1981
|
};
|
|
1686
1982
|
SnkTaskbar.style = snkTaskbarCss;
|
|
1687
1983
|
|
|
1984
|
+
exports.snk_data_exporter = SnkDataExporter;
|
|
1688
1985
|
exports.snk_exporter_email_sender = SnkExporterEmailSender;
|
|
1689
1986
|
exports.snk_filter_bar = SnkFilterBar;
|
|
1690
1987
|
exports.snk_filter_item = SnkFilterItem;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
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-09b25b0a.js');
|
|
9
9
|
|
|
10
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
const core = require('@sankhyalabs/core');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
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
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
8
8
|
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|