@sankhyalabs/sankhyablocks 2.6.0 → 2.8.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/AuthorizationConfig-79ffae4b.js +7 -0
- package/dist/cjs/{SnkMessageBuilder-09b25b0a.js → SnkMessageBuilder-248b5105.js} +7 -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 +24 -2
- package/dist/cjs/snk-configurator_3.cjs.entry.js +6 -38
- package/dist/cjs/{snk-data-exporter_9.cjs.entry.js → snk-data-exporter_8.cjs.entry.js} +83 -155
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +129 -0
- package/dist/collection/components/snk-application/snk-application.js +30 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js +3 -2
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +29 -6
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +49 -31
- package/dist/collection/components/snk-grid/snk-grid.js +1 -43
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +9 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js +7 -0
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +7 -0
- package/dist/components/SnkMessageBuilder.js +7 -0
- package/dist/components/snk-application2.js +25 -2
- package/dist/components/snk-data-exporter2.js +58 -17
- package/dist/components/snk-exporter-email-sender2.js +18 -13
- package/dist/components/snk-form2.js +10 -4
- package/dist/components/snk-grid2.js +3 -35
- package/dist/components/snk-taskbar2.js +8 -2
- package/dist/esm/AuthorizationConfig-dcbd207a.js +7 -0
- package/dist/esm/{SnkMessageBuilder-47db5d75.js → SnkMessageBuilder-4a060599.js} +7 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +24 -2
- package/dist/esm/snk-configurator_3.entry.js +2 -34
- package/dist/esm/{snk-data-exporter_9.entry.js → snk-data-exporter_8.entry.js} +64 -135
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-exporter-email-sender.entry.js +125 -0
- package/dist/sankhyablocks/{p-d96bf6a7.entry.js → p-3480f2fa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-02d430a7.entry.js → p-43eff4d3.entry.js} +12 -5
- package/dist/sankhyablocks/p-48d7ba04.entry.js +1 -0
- package/dist/sankhyablocks/p-97347faf.entry.js +1 -0
- package/dist/sankhyablocks/p-dc36cfbf.js +1 -0
- package/dist/sankhyablocks/p-f5246cd6.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d7a0daf.js → p-f624979d.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +2 -2
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +5 -5
- package/dist/types/components.d.ts +5 -8
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/data-exporter-option-417da37a.js +0 -19
- package/dist/esm/data-exporter-option-006307dd.js +0 -19
- package/dist/sankhyablocks/p-04581d0c.entry.js +0 -1
- package/dist/sankhyablocks/p-50c8bcb7.entry.js +0 -1
- package/dist/sankhyablocks/p-719e570a.js +0 -1
|
@@ -26,13 +26,20 @@ export class SnkExporterEmailSender {
|
|
|
26
26
|
this._currentStep = 0;
|
|
27
27
|
}
|
|
28
28
|
open(config) {
|
|
29
|
-
|
|
29
|
+
var _a;
|
|
30
|
+
this._config = Object.assign(Object.assign({}, config), { format: (_a = config === null || config === void 0 ? void 0 : config.format) !== null && _a !== void 0 ? _a : "pdf" });
|
|
30
31
|
this._opened = true;
|
|
31
32
|
this.changeStep(0);
|
|
32
33
|
return new Promise(accept => {
|
|
33
34
|
this._promiseResolver = accept;
|
|
34
35
|
});
|
|
35
36
|
}
|
|
37
|
+
close() {
|
|
38
|
+
this._opened = false;
|
|
39
|
+
return new Promise(accept => {
|
|
40
|
+
this._promiseResolver = accept;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
36
43
|
getStepMessage(key) {
|
|
37
44
|
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
38
45
|
return this.getMessage(stepInfo[key]);
|
|
@@ -59,9 +66,6 @@ export class SnkExporterEmailSender {
|
|
|
59
66
|
const { format, type, email } = this._config;
|
|
60
67
|
this._promiseResolver({ format, type, email, report: undefined });
|
|
61
68
|
}
|
|
62
|
-
close() {
|
|
63
|
-
this._opened = false;
|
|
64
|
-
}
|
|
65
69
|
isFilled() {
|
|
66
70
|
var _a, _b;
|
|
67
71
|
return ((_a = this._config.email) === null || _a === void 0 ? void 0 : _a.to) && ((_b = this._config.email) === null || _b === void 0 ? void 0 : _b.subject) ? true : false;
|
|
@@ -77,12 +81,11 @@ export class SnkExporterEmailSender {
|
|
|
77
81
|
return stepInfo["secondButtonClass"] || "ez-button--secondary";
|
|
78
82
|
}
|
|
79
83
|
render() {
|
|
80
|
-
var _a;
|
|
81
84
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkExporterEmailSender');
|
|
82
85
|
return (h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, h("ez-modal-container", { onEzModalAction: evt => {
|
|
83
86
|
if (evt.detail === "CLOSE")
|
|
84
87
|
this.close();
|
|
85
|
-
}, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, h("ez-view-stack", { ref: ref => this._viewStack = ref }, h("stack-item", null, h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), h("stack-item", null, h(EmailInfoStep, { getMessage: this.getMessage, data:
|
|
88
|
+
}, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, h("ez-view-stack", { ref: ref => this._viewStack = ref }, h("stack-item", null, h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), h("stack-item", null, h(EmailInfoStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateEmailInfo(field, value) }))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-button--tertiary ez-padding-right--medium", label: this.getStepMessage("firstButton"), onClick: () => this.executeButtonAction(true), enabled: this.checkButtonEnabled(true) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("firstButton")}` })), h("ez-button", Object.assign({ class: this.getSecondButtonClass(), label: this.getStepMessage("secondButton"), onClick: () => this.executeButtonAction(false), enabled: this.checkButtonEnabled(false) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("secondButton")}` }))))));
|
|
86
89
|
}
|
|
87
90
|
static get is() { return "snk-exporter-email-sender"; }
|
|
88
91
|
static get properties() {
|
|
@@ -139,6 +142,26 @@ export class SnkExporterEmailSender {
|
|
|
139
142
|
"text": "",
|
|
140
143
|
"tags": []
|
|
141
144
|
}
|
|
145
|
+
},
|
|
146
|
+
"close": {
|
|
147
|
+
"complexType": {
|
|
148
|
+
"signature": "() => Promise<IExportResult>",
|
|
149
|
+
"parameters": [],
|
|
150
|
+
"references": {
|
|
151
|
+
"Promise": {
|
|
152
|
+
"location": "global"
|
|
153
|
+
},
|
|
154
|
+
"IExportResult": {
|
|
155
|
+
"location": "import",
|
|
156
|
+
"path": "../data/export-result"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"return": "Promise<IExportResult>"
|
|
160
|
+
},
|
|
161
|
+
"docs": {
|
|
162
|
+
"text": "",
|
|
163
|
+
"tags": []
|
|
164
|
+
}
|
|
142
165
|
}
|
|
143
166
|
};
|
|
144
167
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
4
|
import { DataExporterOption } from './enum/data-exporter-option';
|
|
4
5
|
import fetchDataExporter from "../../lib/http/data-fetcher/fetchers/fetchDataExporter";
|
|
5
6
|
import fileViewer from "../../lib/utils/fileViewer";
|
|
@@ -20,6 +21,32 @@ export class SnkDataExporter {
|
|
|
20
21
|
*/
|
|
21
22
|
this.provider = null;
|
|
22
23
|
}
|
|
24
|
+
async exportByEmail() {
|
|
25
|
+
const selectedRows = this._selectedNumber;
|
|
26
|
+
const config = {
|
|
27
|
+
type: selectedRows > 0 ? "selection" : "all",
|
|
28
|
+
selectedRows,
|
|
29
|
+
email: {
|
|
30
|
+
attachments: [
|
|
31
|
+
{ name: this._appLabel }
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
this._snkEmailSender.open(config)
|
|
36
|
+
.then(({ format, email: { to, subject, message } }) => {
|
|
37
|
+
const methodName = this.getFormatExporter(format);
|
|
38
|
+
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
39
|
+
this._snkEmailSender.close();
|
|
40
|
+
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getFormatExporter(format) {
|
|
45
|
+
if (format === "xlsx") {
|
|
46
|
+
return DataExporterOption.EXPORT_XLS_TO_EMAIL;
|
|
47
|
+
}
|
|
48
|
+
return DataExporterOption.EXPORT_PDF_TO_EMAIL;
|
|
49
|
+
}
|
|
23
50
|
/**
|
|
24
51
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
25
52
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -56,24 +83,32 @@ export class SnkDataExporter {
|
|
|
56
83
|
controlDropdown() {
|
|
57
84
|
this._showDropdown = !this._showDropdown;
|
|
58
85
|
}
|
|
86
|
+
resolveExporter(resolveProps, callbackResolver) {
|
|
87
|
+
if (this.provider == undefined) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const filters = this.provider.getFilters();
|
|
91
|
+
const columns = this.provider.getColumnsMetadata();
|
|
92
|
+
const sort = this.provider.getOrders();
|
|
93
|
+
const resourceURI = this.provider.getResourceURI();
|
|
94
|
+
fetchDataExporter(Object.assign({ filters,
|
|
95
|
+
columns,
|
|
96
|
+
sort,
|
|
97
|
+
resourceURI }, resolveProps))
|
|
98
|
+
.then((result) => callbackResolver(result))
|
|
99
|
+
.catch(() => ApplicationUtils.error(this.getMessage("snkDataExporter.title.error"), this.getMessage("snkDataExporter.message.exportError")));
|
|
100
|
+
}
|
|
59
101
|
async processExporter(evt) {
|
|
60
102
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
61
103
|
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
62
104
|
return;
|
|
63
105
|
}
|
|
64
|
-
if (item.id
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const columns = this.provider.getColumnsMetadata();
|
|
70
|
-
const sort = this.provider.getOrders();
|
|
71
|
-
const resourceURI = this.provider.getResourceURI();
|
|
72
|
-
fetchDataExporter({ filters, columns, sort, resourceURI, methodName: item.id })
|
|
73
|
-
.then((response) => fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" })))
|
|
74
|
-
.catch(err => console.log(err));
|
|
106
|
+
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
107
|
+
this.exportByEmail();
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.resolveExporter({ methodName: item.id, fileName: this._appLabel, titleGrid: this._appLabel }, (response) => (fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" }))));
|
|
75
111
|
}
|
|
76
|
-
this.ezClickDataExporter.emit(item);
|
|
77
112
|
this._showDropdown = false;
|
|
78
113
|
}
|
|
79
114
|
getItems() {
|
|
@@ -92,6 +127,7 @@ export class SnkDataExporter {
|
|
|
92
127
|
}
|
|
93
128
|
componentWillLoad() {
|
|
94
129
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
130
|
+
this._application.getAppLabel().then(result => this._appLabel = result);
|
|
95
131
|
this.loadDropdown();
|
|
96
132
|
this.setEvents();
|
|
97
133
|
}
|
|
@@ -114,7 +150,7 @@ export class SnkDataExporter {
|
|
|
114
150
|
render() {
|
|
115
151
|
return (h(Host, null, h("div", { class: "snk-data-exporter" }, 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 &&
|
|
116
152
|
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 &&
|
|
117
|
-
h("div", Object.assign({ class: "ez-scrim ez-scrim-light" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("ezScrim")}` }))));
|
|
153
|
+
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) })));
|
|
118
154
|
}
|
|
119
155
|
static get is() { return "snk-data-exporter"; }
|
|
120
156
|
static get encapsulation() { return "scoped"; }
|
|
@@ -159,23 +195,5 @@ export class SnkDataExporter {
|
|
|
159
195
|
"_releasedToExport": {}
|
|
160
196
|
};
|
|
161
197
|
}
|
|
162
|
-
static get events() {
|
|
163
|
-
return [{
|
|
164
|
-
"method": "ezClickDataExporter",
|
|
165
|
-
"name": "ezClickDataExporter",
|
|
166
|
-
"bubbles": true,
|
|
167
|
-
"cancelable": true,
|
|
168
|
-
"composed": true,
|
|
169
|
-
"docs": {
|
|
170
|
-
"tags": [],
|
|
171
|
-
"text": "Evento emitido quando uma op\u00E7\u00E3o de exporta\u00E7\u00E3o for clicada."
|
|
172
|
-
},
|
|
173
|
-
"complexType": {
|
|
174
|
-
"original": "any",
|
|
175
|
-
"resolved": "any",
|
|
176
|
-
"references": {}
|
|
177
|
-
}
|
|
178
|
-
}];
|
|
179
|
-
}
|
|
180
198
|
static get elementRef() { return "_element"; }
|
|
181
199
|
}
|
|
@@ -3,7 +3,6 @@ import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core'
|
|
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
4
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
5
5
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
6
|
-
import { DataExporterOption } from '../snk-data-exporter/enum/data-exporter-option';
|
|
7
6
|
import store from "../../lib/store";
|
|
8
7
|
export class SnkGrid {
|
|
9
8
|
constructor() {
|
|
@@ -44,38 +43,6 @@ export class SnkGrid {
|
|
|
44
43
|
async setConfig(config) {
|
|
45
44
|
this.setGridConfig(config);
|
|
46
45
|
}
|
|
47
|
-
ezClickDataExporterHandler(event) {
|
|
48
|
-
var _a;
|
|
49
|
-
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
50
|
-
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
51
|
-
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
52
|
-
// apenas mais uma
|
|
53
|
-
const selectedRows = this._dataState.selectedRecords.length;
|
|
54
|
-
const config = {
|
|
55
|
-
format: "pdf",
|
|
56
|
-
type: selectedRows > 0 ? "selection" : "all",
|
|
57
|
-
selectedRows,
|
|
58
|
-
email: {
|
|
59
|
-
attachments: [
|
|
60
|
-
{ name: "Movimentação Financeira.pdf", size: 1024 * 231 }
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
this._snkEmailSender.open(config)
|
|
65
|
-
.then((result) => {
|
|
66
|
-
this._application.message("resultado", JSON.stringify(result));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
72
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
73
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
74
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
75
|
-
*/
|
|
76
|
-
getMessage(key, params) {
|
|
77
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
78
|
-
}
|
|
79
46
|
openGridConfig() {
|
|
80
47
|
this._grid.getColumnsState()
|
|
81
48
|
.then((gridColumns) => {
|
|
@@ -210,7 +177,7 @@ export class SnkGrid {
|
|
|
210
177
|
if (!this._dataUnit) {
|
|
211
178
|
return undefined;
|
|
212
179
|
}
|
|
213
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), 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" })), 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 }, 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 })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("
|
|
180
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), 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" })), 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 }, 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 })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
214
181
|
}
|
|
215
182
|
static get is() { return "snk-grid"; }
|
|
216
183
|
static get encapsulation() { return "scoped"; }
|
|
@@ -444,13 +411,4 @@ export class SnkGrid {
|
|
|
444
411
|
};
|
|
445
412
|
}
|
|
446
413
|
static get elementRef() { return "_element"; }
|
|
447
|
-
static get listeners() {
|
|
448
|
-
return [{
|
|
449
|
-
"name": "ezClickDataExporter",
|
|
450
|
-
"method": "ezClickDataExporterHandler",
|
|
451
|
-
"target": undefined,
|
|
452
|
-
"capture": false,
|
|
453
|
-
"passive": false
|
|
454
|
-
}];
|
|
455
|
-
}
|
|
456
414
|
}
|
|
@@ -32,6 +32,13 @@ export default class DataUnitFetcher {
|
|
|
32
32
|
expression
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
children{
|
|
36
|
+
name
|
|
37
|
+
links{
|
|
38
|
+
source
|
|
39
|
+
target
|
|
40
|
+
}
|
|
41
|
+
}
|
|
35
42
|
}
|
|
36
43
|
}`);
|
|
37
44
|
this.templateByQuery.set("fetchData", gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
@@ -94,7 +101,8 @@ export default class DataUnitFetcher {
|
|
|
94
101
|
const metadata = {
|
|
95
102
|
name: resp.name,
|
|
96
103
|
label: resp.name,
|
|
97
|
-
|
|
104
|
+
children: [...resp.children],
|
|
105
|
+
fields: []
|
|
98
106
|
};
|
|
99
107
|
(_a = resp.fields) === null || _a === void 0 ? void 0 : _a.forEach((source) => {
|
|
100
108
|
let properties = undefined;
|
package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataFetcher } from '../../DataFetcher';
|
|
2
|
+
export default function permissionExportPdf() {
|
|
3
|
+
return new Promise((resolve, reject) => (DataFetcher.get()
|
|
4
|
+
.callServiceBroker("mge@UsuarioSP.usuarioLogadoPodeExportarPDF", "")
|
|
5
|
+
.then(result => { var _a; return resolve(((_a = result === null || result === void 0 ? void 0 : result.responseBody) === null || _a === void 0 ? void 0 : _a.$) === "S" ? true : false); })
|
|
6
|
+
.catch(error => reject(error))));
|
|
7
|
+
}
|
|
@@ -12,5 +12,12 @@ export const snkDataExporterMessages = {
|
|
|
12
12
|
spreadsheet: "Planilha",
|
|
13
13
|
cube: "Cubo",
|
|
14
14
|
sendByEmail: "Enviar por email",
|
|
15
|
+
},
|
|
16
|
+
message: {
|
|
17
|
+
emailSuccess: "E-mail enviado com sucesso",
|
|
18
|
+
exportError: "Erro ao realizar a exportação",
|
|
19
|
+
},
|
|
20
|
+
title: {
|
|
21
|
+
error: "Erro",
|
|
15
22
|
}
|
|
16
23
|
};
|
|
@@ -220,6 +220,13 @@ const snkDataExporterMessages = {
|
|
|
220
220
|
spreadsheet: "Planilha",
|
|
221
221
|
cube: "Cubo",
|
|
222
222
|
sendByEmail: "Enviar por email",
|
|
223
|
+
},
|
|
224
|
+
message: {
|
|
225
|
+
emailSuccess: "E-mail enviado com sucesso",
|
|
226
|
+
exportError: "Erro ao realizar a exportação",
|
|
227
|
+
},
|
|
228
|
+
title: {
|
|
229
|
+
error: "Erro",
|
|
223
230
|
}
|
|
224
231
|
};
|
|
225
232
|
|
|
@@ -239,6 +239,13 @@ class DataUnitFetcher {
|
|
|
239
239
|
expression
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
+
children{
|
|
243
|
+
name
|
|
244
|
+
links{
|
|
245
|
+
source
|
|
246
|
+
target
|
|
247
|
+
}
|
|
248
|
+
}
|
|
242
249
|
}
|
|
243
250
|
}`);
|
|
244
251
|
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
@@ -301,7 +308,8 @@ class DataUnitFetcher {
|
|
|
301
308
|
const metadata = {
|
|
302
309
|
name: resp.name,
|
|
303
310
|
label: resp.name,
|
|
304
|
-
|
|
311
|
+
children: [...resp.children],
|
|
312
|
+
fields: []
|
|
305
313
|
};
|
|
306
314
|
(_a = resp.fields) === null || _a === void 0 ? void 0 : _a.forEach((source) => {
|
|
307
315
|
let properties = undefined;
|
|
@@ -1211,6 +1219,20 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1211
1219
|
accept(window['isDebugMode']);
|
|
1212
1220
|
});
|
|
1213
1221
|
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Obtém o nome das telas da aplicação
|
|
1224
|
+
*/
|
|
1225
|
+
async getAppLabel() {
|
|
1226
|
+
if ((window === null || window === void 0 ? void 0 : window["workspace"]) == undefined) {
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
if (window["workspace"].getAppLabel == undefined) {
|
|
1230
|
+
window["workspace"].getAppLabel = (resourceID) => {
|
|
1231
|
+
return (resourceID || "").split(".").pop();
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
return window["workspace"].getAppLabel(this._resourceID);
|
|
1235
|
+
}
|
|
1214
1236
|
clearContent(container) {
|
|
1215
1237
|
if (container) {
|
|
1216
1238
|
Array.from(container.children).forEach(child => {
|
|
@@ -1311,7 +1333,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1311
1333
|
"getDefaultValue": [64],
|
|
1312
1334
|
"executeSearch": [64],
|
|
1313
1335
|
"executePreparedSearch": [64],
|
|
1314
|
-
"isDebugMode": [64]
|
|
1336
|
+
"isDebugMode": [64],
|
|
1337
|
+
"getAppLabel": [64]
|
|
1315
1338
|
}]);
|
|
1316
1339
|
class RequestListenerLoadingBar {
|
|
1317
1340
|
constructor() {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement,
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
4
|
import { D as DataFetcher } from './DataFetcher.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
|
|
4
6
|
|
|
5
7
|
var DataExporterOption;
|
|
6
8
|
(function (DataExporterOption) {
|
|
@@ -195,7 +197,6 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
195
197
|
constructor() {
|
|
196
198
|
super();
|
|
197
199
|
this.__registerHost();
|
|
198
|
-
this.ezClickDataExporter = createEvent(this, "ezClickDataExporter", 7);
|
|
199
200
|
this._items = [];
|
|
200
201
|
this._selectedNumber = 0;
|
|
201
202
|
this._showDropdown = false;
|
|
@@ -210,6 +211,32 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
210
211
|
*/
|
|
211
212
|
this.provider = null;
|
|
212
213
|
}
|
|
214
|
+
async exportByEmail() {
|
|
215
|
+
const selectedRows = this._selectedNumber;
|
|
216
|
+
const config = {
|
|
217
|
+
type: selectedRows > 0 ? "selection" : "all",
|
|
218
|
+
selectedRows,
|
|
219
|
+
email: {
|
|
220
|
+
attachments: [
|
|
221
|
+
{ name: this._appLabel }
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
this._snkEmailSender.open(config)
|
|
226
|
+
.then(({ format, email: { to, subject, message } }) => {
|
|
227
|
+
const methodName = this.getFormatExporter(format);
|
|
228
|
+
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
229
|
+
this._snkEmailSender.close();
|
|
230
|
+
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
getFormatExporter(format) {
|
|
235
|
+
if (format === "xlsx") {
|
|
236
|
+
return DataExporterOption.EXPORT_XLS_TO_EMAIL;
|
|
237
|
+
}
|
|
238
|
+
return DataExporterOption.EXPORT_PDF_TO_EMAIL;
|
|
239
|
+
}
|
|
213
240
|
/**
|
|
214
241
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
215
242
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -246,24 +273,32 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
246
273
|
controlDropdown() {
|
|
247
274
|
this._showDropdown = !this._showDropdown;
|
|
248
275
|
}
|
|
276
|
+
resolveExporter(resolveProps, callbackResolver) {
|
|
277
|
+
if (this.provider == undefined) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const filters = this.provider.getFilters();
|
|
281
|
+
const columns = this.provider.getColumnsMetadata();
|
|
282
|
+
const sort = this.provider.getOrders();
|
|
283
|
+
const resourceURI = this.provider.getResourceURI();
|
|
284
|
+
fetchDataExporter(Object.assign({ filters,
|
|
285
|
+
columns,
|
|
286
|
+
sort,
|
|
287
|
+
resourceURI }, resolveProps))
|
|
288
|
+
.then((result) => callbackResolver(result))
|
|
289
|
+
.catch(() => ApplicationUtils.error(this.getMessage("snkDataExporter.title.error"), this.getMessage("snkDataExporter.message.exportError")));
|
|
290
|
+
}
|
|
249
291
|
async processExporter(evt) {
|
|
250
292
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
251
293
|
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
252
294
|
return;
|
|
253
295
|
}
|
|
254
|
-
if (item.id
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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));
|
|
296
|
+
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
297
|
+
this.exportByEmail();
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this.resolveExporter({ methodName: item.id, fileName: this._appLabel, titleGrid: this._appLabel }, (response) => (fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" }))));
|
|
265
301
|
}
|
|
266
|
-
this.ezClickDataExporter.emit(item);
|
|
267
302
|
this._showDropdown = false;
|
|
268
303
|
}
|
|
269
304
|
getItems() {
|
|
@@ -282,6 +317,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
282
317
|
}
|
|
283
318
|
componentWillLoad() {
|
|
284
319
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
320
|
+
this._application.getAppLabel().then(result => this._appLabel = result);
|
|
285
321
|
this.loadDropdown();
|
|
286
322
|
this.setEvents();
|
|
287
323
|
}
|
|
@@ -304,7 +340,7 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
304
340
|
render() {
|
|
305
341
|
return (h(Host, null, h("div", { class: "snk-data-exporter" }, 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 &&
|
|
306
342
|
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 &&
|
|
307
|
-
h("div", Object.assign({ class: "ez-scrim ez-scrim-light" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("ezScrim")}` }))));
|
|
343
|
+
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) })));
|
|
308
344
|
}
|
|
309
345
|
get _element() { return this; }
|
|
310
346
|
static get style() { return snkDataExporterCss; }
|
|
@@ -317,14 +353,19 @@ function defineCustomElement() {
|
|
|
317
353
|
if (typeof customElements === "undefined") {
|
|
318
354
|
return;
|
|
319
355
|
}
|
|
320
|
-
const components = ["snk-data-exporter"];
|
|
356
|
+
const components = ["snk-data-exporter", "snk-exporter-email-sender"];
|
|
321
357
|
components.forEach(tagName => { switch (tagName) {
|
|
322
358
|
case "snk-data-exporter":
|
|
323
359
|
if (!customElements.get(tagName)) {
|
|
324
360
|
customElements.define(tagName, SnkDataExporter);
|
|
325
361
|
}
|
|
326
362
|
break;
|
|
363
|
+
case "snk-exporter-email-sender":
|
|
364
|
+
if (!customElements.get(tagName)) {
|
|
365
|
+
defineCustomElement$1();
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
327
368
|
} });
|
|
328
369
|
}
|
|
329
370
|
|
|
330
|
-
export {
|
|
371
|
+
export { SnkDataExporter as S, defineCustomElement as d };
|
|
@@ -2,12 +2,13 @@ import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/clien
|
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
5
|
+
const { format, email } = data || {};
|
|
5
6
|
return h("div", null,
|
|
6
|
-
h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, required: true, value:
|
|
7
|
-
h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, required: true, value:
|
|
8
|
-
h("ez-text-area", Object.assign({ label: getMessage("snkExporter.emailSenderInfoStep_message"), value:
|
|
9
|
-
((
|
|
10
|
-
.map((file, index) => h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: file.name
|
|
7
|
+
h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, required: true, value: email === null || email === void 0 ? void 0 : email.to, onEzChange: evt => changeInfo("to", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("sendTo")}` })),
|
|
8
|
+
h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, required: true, value: email === null || email === void 0 ? void 0 : email.subject, onEzChange: evt => changeInfo("subject", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("subject")}` })),
|
|
9
|
+
h("ez-text-area", Object.assign({ label: getMessage("snkExporter.emailSenderInfoStep_message"), value: email === null || email === void 0 ? void 0 : email.message, onEzChange: evt => changeInfo("message", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("message")}` })),
|
|
10
|
+
((email === null || email === void 0 ? void 0 : email.attachments) || [])
|
|
11
|
+
.map((file, index) => h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: `${file.name}.${format}`, fileSize: file.size, canRemove: false }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("fileItem_") + (index + 1)}` }))));
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
@@ -28,7 +29,7 @@ const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
return h("div", null,
|
|
31
|
-
h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("formato")}` }, { label: getMessage("snkExporter.emailSenderOptStep_lblFormat"), direction: "horizontal", value:
|
|
32
|
+
h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("formato")}` }, { label: getMessage("snkExporter.emailSenderOptStep_lblFormat"), direction: "horizontal", value: data === null || data === void 0 ? void 0 : data.format, onEzChange: evt => changeInfo("format", evt.detail), options: formatOptions })),
|
|
32
33
|
h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("type")}` }, { label: getMessage("snkExporter.emailSenderOptStep_export"), value: (data === null || data === void 0 ? void 0 : data.type) || "all", onEzChange: evt => changeInfo("type", evt.detail), options: typeOptions })));
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -58,13 +59,20 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
58
59
|
this._currentStep = 0;
|
|
59
60
|
}
|
|
60
61
|
open(config) {
|
|
61
|
-
|
|
62
|
+
var _a;
|
|
63
|
+
this._config = Object.assign(Object.assign({}, config), { format: (_a = config === null || config === void 0 ? void 0 : config.format) !== null && _a !== void 0 ? _a : "pdf" });
|
|
62
64
|
this._opened = true;
|
|
63
65
|
this.changeStep(0);
|
|
64
66
|
return new Promise(accept => {
|
|
65
67
|
this._promiseResolver = accept;
|
|
66
68
|
});
|
|
67
69
|
}
|
|
70
|
+
close() {
|
|
71
|
+
this._opened = false;
|
|
72
|
+
return new Promise(accept => {
|
|
73
|
+
this._promiseResolver = accept;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
68
76
|
getStepMessage(key) {
|
|
69
77
|
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
70
78
|
return this.getMessage(stepInfo[key]);
|
|
@@ -91,9 +99,6 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
91
99
|
const { format, type, email } = this._config;
|
|
92
100
|
this._promiseResolver({ format, type, email, report: undefined });
|
|
93
101
|
}
|
|
94
|
-
close() {
|
|
95
|
-
this._opened = false;
|
|
96
|
-
}
|
|
97
102
|
isFilled() {
|
|
98
103
|
var _a, _b;
|
|
99
104
|
return ((_a = this._config.email) === null || _a === void 0 ? void 0 : _a.to) && ((_b = this._config.email) === null || _b === void 0 ? void 0 : _b.subject) ? true : false;
|
|
@@ -109,12 +114,11 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
109
114
|
return stepInfo["secondButtonClass"] || "ez-button--secondary";
|
|
110
115
|
}
|
|
111
116
|
render() {
|
|
112
|
-
var _a;
|
|
113
117
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkExporterEmailSender');
|
|
114
118
|
return (h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, h("ez-modal-container", { onEzModalAction: evt => {
|
|
115
119
|
if (evt.detail === "CLOSE")
|
|
116
120
|
this.close();
|
|
117
|
-
}, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, h("ez-view-stack", { ref: ref => this._viewStack = ref }, h("stack-item", null, h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), h("stack-item", null, h(EmailInfoStep, { getMessage: this.getMessage, data:
|
|
121
|
+
}, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, h("ez-view-stack", { ref: ref => this._viewStack = ref }, h("stack-item", null, h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), h("stack-item", null, h(EmailInfoStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateEmailInfo(field, value) }))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-button--tertiary ez-padding-right--medium", label: this.getStepMessage("firstButton"), onClick: () => this.executeButtonAction(true), enabled: this.checkButtonEnabled(true) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("firstButton")}` })), h("ez-button", Object.assign({ class: this.getSecondButtonClass(), label: this.getStepMessage("secondButton"), onClick: () => this.executeButtonAction(false), enabled: this.checkButtonEnabled(false) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("secondButton")}` }))))));
|
|
118
122
|
}
|
|
119
123
|
get _element() { return this; }
|
|
120
124
|
}, [0, "snk-exporter-email-sender", {
|
|
@@ -122,7 +126,8 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
122
126
|
"_config": [32],
|
|
123
127
|
"_opened": [32],
|
|
124
128
|
"_currentStep": [32],
|
|
125
|
-
"open": [64]
|
|
129
|
+
"open": [64],
|
|
130
|
+
"close": [64]
|
|
126
131
|
}]);
|
|
127
132
|
function defineCustomElement() {
|
|
128
133
|
if (typeof customElements === "undefined") {
|
|
@@ -2,8 +2,9 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { DateUtils, ObjectUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
5
|
-
import { d as defineCustomElement$
|
|
6
|
-
import { d as defineCustomElement$
|
|
5
|
+
import { d as defineCustomElement$7 } from './snk-config-options2.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './snk-data-exporter2.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './snk-exporter-email-sender2.js';
|
|
7
8
|
import { d as defineCustomElement$4 } from './snk-field-config2.js';
|
|
8
9
|
import { d as defineCustomElement$3 } from './snk-form-config2.js';
|
|
9
10
|
import { d as defineCustomElement$2 } from './snk-tab-config2.js';
|
|
@@ -221,7 +222,7 @@ function defineCustomElement() {
|
|
|
221
222
|
if (typeof customElements === "undefined") {
|
|
222
223
|
return;
|
|
223
224
|
}
|
|
224
|
-
const components = ["snk-form", "snk-config-options", "snk-data-exporter", "snk-field-config", "snk-form-config", "snk-tab-config", "snk-taskbar"];
|
|
225
|
+
const components = ["snk-form", "snk-config-options", "snk-data-exporter", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-tab-config", "snk-taskbar"];
|
|
225
226
|
components.forEach(tagName => { switch (tagName) {
|
|
226
227
|
case "snk-form":
|
|
227
228
|
if (!customElements.get(tagName)) {
|
|
@@ -230,10 +231,15 @@ function defineCustomElement() {
|
|
|
230
231
|
break;
|
|
231
232
|
case "snk-config-options":
|
|
232
233
|
if (!customElements.get(tagName)) {
|
|
233
|
-
defineCustomElement$
|
|
234
|
+
defineCustomElement$7();
|
|
234
235
|
}
|
|
235
236
|
break;
|
|
236
237
|
case "snk-data-exporter":
|
|
238
|
+
if (!customElements.get(tagName)) {
|
|
239
|
+
defineCustomElement$6();
|
|
240
|
+
}
|
|
241
|
+
break;
|
|
242
|
+
case "snk-exporter-email-sender":
|
|
237
243
|
if (!customElements.get(tagName)) {
|
|
238
244
|
defineCustomElement$5();
|
|
239
245
|
}
|