@sankhyalabs/sankhyablocks 2.7.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 +15 -1
- 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/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 +16 -1
- 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 +15 -1
- 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-f8fdd16c.entry.js → p-43eff4d3.entry.js} +5 -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
|
@@ -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
|
}
|
|
@@ -3,8 +3,8 @@ import { ApplicationContext, ElementIDUtils, DataType } from '@sankhyalabs/core'
|
|
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
4
|
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
6
|
-
import { D as DataExporterOption, d as defineCustomElement$a } from './snk-data-exporter2.js';
|
|
7
6
|
import { s as store, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
7
|
+
import { d as defineCustomElement$a } from './snk-data-exporter2.js';
|
|
8
8
|
import { d as defineCustomElement$9 } from './snk-exporter-email-sender2.js';
|
|
9
9
|
import { d as defineCustomElement$8 } from './snk-filter-bar2.js';
|
|
10
10
|
import { d as defineCustomElement$7 } from './snk-filter-detail2.js';
|
|
@@ -59,38 +59,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
59
59
|
async setConfig(config) {
|
|
60
60
|
this.setGridConfig(config);
|
|
61
61
|
}
|
|
62
|
-
ezClickDataExporterHandler(event) {
|
|
63
|
-
var _a;
|
|
64
|
-
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
65
|
-
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
66
|
-
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
67
|
-
// apenas mais uma
|
|
68
|
-
const selectedRows = this._dataState.selectedRecords.length;
|
|
69
|
-
const config = {
|
|
70
|
-
format: "pdf",
|
|
71
|
-
type: selectedRows > 0 ? "selection" : "all",
|
|
72
|
-
selectedRows,
|
|
73
|
-
email: {
|
|
74
|
-
attachments: [
|
|
75
|
-
{ name: "Movimentação Financeira.pdf", size: 1024 * 231 }
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
this._snkEmailSender.open(config)
|
|
80
|
-
.then((result) => {
|
|
81
|
-
this._application.message("resultado", JSON.stringify(result));
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
87
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
88
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
89
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
90
|
-
*/
|
|
91
|
-
getMessage(key, params) {
|
|
92
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
93
|
-
}
|
|
94
62
|
openGridConfig() {
|
|
95
63
|
this._grid.getColumnsState()
|
|
96
64
|
.then((gridColumns) => {
|
|
@@ -225,7 +193,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
225
193
|
if (!this._dataUnit) {
|
|
226
194
|
return undefined;
|
|
227
195
|
}
|
|
228
|
-
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("
|
|
196
|
+
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() }))));
|
|
229
197
|
}
|
|
230
198
|
get _element() { return this; }
|
|
231
199
|
static get style() { return snkGridCss; }
|
|
@@ -243,7 +211,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
243
211
|
"showConfig": [64],
|
|
244
212
|
"hideConfig": [64],
|
|
245
213
|
"setConfig": [64]
|
|
246
|
-
}
|
|
214
|
+
}]);
|
|
247
215
|
function defineCustomElement() {
|
|
248
216
|
if (typeof customElements === "undefined") {
|
|
249
217
|
return;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getRenderingRef, forceUpdate, h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig.js';
|
|
4
|
-
import { d as defineCustomElement$
|
|
4
|
+
import { d as defineCustomElement$2 } from './snk-data-exporter2.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
|
|
5
6
|
|
|
6
7
|
const appendToMap = (map, propName, value) => {
|
|
7
8
|
const items = map.get(propName);
|
|
@@ -497,7 +498,7 @@ function defineCustomElement() {
|
|
|
497
498
|
if (typeof customElements === "undefined") {
|
|
498
499
|
return;
|
|
499
500
|
}
|
|
500
|
-
const components = ["snk-taskbar", "snk-data-exporter"];
|
|
501
|
+
const components = ["snk-taskbar", "snk-data-exporter", "snk-exporter-email-sender"];
|
|
501
502
|
components.forEach(tagName => { switch (tagName) {
|
|
502
503
|
case "snk-taskbar":
|
|
503
504
|
if (!customElements.get(tagName)) {
|
|
@@ -505,6 +506,11 @@ function defineCustomElement() {
|
|
|
505
506
|
}
|
|
506
507
|
break;
|
|
507
508
|
case "snk-data-exporter":
|
|
509
|
+
if (!customElements.get(tagName)) {
|
|
510
|
+
defineCustomElement$2();
|
|
511
|
+
}
|
|
512
|
+
break;
|
|
513
|
+
case "snk-exporter-email-sender":
|
|
508
514
|
if (!customElements.get(tagName)) {
|
|
509
515
|
defineCustomElement$1();
|
|
510
516
|
}
|
|
@@ -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
|
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}
|
|
13
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}
|
|
16
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
17
17
|
});
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
|
2
2
|
import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage-b59461d8.js';
|
|
4
4
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
5
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-4a060599.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
7
7
|
|
|
8
8
|
class SnkErrorHandler {
|
|
@@ -1217,6 +1217,20 @@ const SnkApplication = class {
|
|
|
1217
1217
|
accept(window['isDebugMode']);
|
|
1218
1218
|
});
|
|
1219
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Obtém o nome das telas da aplicação
|
|
1222
|
+
*/
|
|
1223
|
+
async getAppLabel() {
|
|
1224
|
+
if ((window === null || window === void 0 ? void 0 : window["workspace"]) == undefined) {
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
if (window["workspace"].getAppLabel == undefined) {
|
|
1228
|
+
window["workspace"].getAppLabel = (resourceID) => {
|
|
1229
|
+
return (resourceID || "").split(".").pop();
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
return window["workspace"].getAppLabel(this._resourceID);
|
|
1233
|
+
}
|
|
1220
1234
|
clearContent(container) {
|
|
1221
1235
|
if (container) {
|
|
1222
1236
|
Array.from(container.children).forEach(child => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a77b6f35.js';
|
|
2
2
|
import { ApplicationContext, ElementIDUtils, DataType } from '@sankhyalabs/core';
|
|
3
3
|
import { c as VIEW_MODE, A as ACTION_CONFIG } from './constants-babe1a08.js';
|
|
4
|
-
import { A as AuthorizationConfig
|
|
4
|
+
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
5
5
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
6
6
|
import { T as TaskbarProcessor } from './taskbar-processor-c2a99aba.js';
|
|
7
7
|
import { C as ConfigStorage } from './ConfigStorage-b59461d8.js';
|
|
@@ -197,38 +197,6 @@ const SnkGrid = class {
|
|
|
197
197
|
async setConfig(config) {
|
|
198
198
|
this.setGridConfig(config);
|
|
199
199
|
}
|
|
200
|
-
ezClickDataExporterHandler(event) {
|
|
201
|
-
var _a;
|
|
202
|
-
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
203
|
-
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
204
|
-
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
205
|
-
// apenas mais uma
|
|
206
|
-
const selectedRows = this._dataState.selectedRecords.length;
|
|
207
|
-
const config = {
|
|
208
|
-
format: "pdf",
|
|
209
|
-
type: selectedRows > 0 ? "selection" : "all",
|
|
210
|
-
selectedRows,
|
|
211
|
-
email: {
|
|
212
|
-
attachments: [
|
|
213
|
-
{ name: "Movimentação Financeira.pdf", size: 1024 * 231 }
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
this._snkEmailSender.open(config)
|
|
218
|
-
.then((result) => {
|
|
219
|
-
this._application.message("resultado", JSON.stringify(result));
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
225
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
226
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
227
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
228
|
-
*/
|
|
229
|
-
getMessage(key, params) {
|
|
230
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
231
|
-
}
|
|
232
200
|
openGridConfig() {
|
|
233
201
|
this._grid.getColumnsState()
|
|
234
202
|
.then((gridColumns) => {
|
|
@@ -363,7 +331,7 @@ const SnkGrid = class {
|
|
|
363
331
|
if (!this._dataUnit) {
|
|
364
332
|
return undefined;
|
|
365
333
|
}
|
|
366
|
-
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("
|
|
334
|
+
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() }))));
|
|
367
335
|
}
|
|
368
336
|
get _element() { return getElement(this); }
|
|
369
337
|
};
|