@sankhyalabs/sankhyablocks 2.4.8 → 2.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SnkMessageBuilder-61f00e7f.js → SnkMessageBuilder-370e23ae.js} +24 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +44 -6
- package/dist/cjs/snk-crud.cjs.entry.js +6 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/{snk-filter-bar_7.cjs.entry.js → snk-exporter-email-sender_8.cjs.entry.js} +133 -15
- package/dist/cjs/snk-filter-detail.cjs.entry.js +8 -1
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-b995b84d.js → taskbar-elements-3807c809.js} +3 -0
- package/dist/cjs/{taskbar-processor-6bd0d35c.js → taskbar-processor-6f3d2a75.js} +9 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +23 -1
- package/dist/collection/components/snk-data-exporter/data/attachment.js +1 -0
- package/dist/collection/components/snk-data-exporter/data/email.js +1 -0
- package/dist/collection/components/snk-data-exporter/data/export-config.js +1 -0
- package/dist/collection/components/snk-data-exporter/data/export-result.js +1 -0
- package/dist/collection/components/snk-data-exporter/data/report.js +1 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js +6 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +21 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +146 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +8 -1
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +8 -6
- package/dist/collection/components/snk-grid/snk-grid.js +71 -6
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +25 -8
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +9 -7
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +21 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/components/SnkMessageBuilder.js +24 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-crud.js +16 -5
- package/dist/components/snk-exporter-email-sender.d.ts +11 -0
- package/dist/components/snk-exporter-email-sender.js +6 -0
- package/dist/components/snk-exporter-email-sender2.js +141 -0
- package/dist/components/snk-filter-detail2.js +8 -1
- package/dist/components/snk-filter-list2.js +8 -6
- package/dist/components/snk-grid-config2.js +6 -8
- package/dist/components/snk-grid2.js +53 -9
- package/dist/components/snk-taskbar2.js +5 -1
- package/dist/components/taskbar-processor.js +9 -7
- package/dist/esm/{SnkMessageBuilder-f5ef87df.js → SnkMessageBuilder-7d583c9a.js} +24 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +44 -6
- package/dist/esm/snk-crud.entry.js +6 -2
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/{snk-filter-bar_7.entry.js → snk-exporter-email-sender_8.entry.js} +135 -18
- package/dist/esm/snk-filter-detail.entry.js +8 -1
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/{taskbar-elements-a0a8c3ac.js → taskbar-elements-b2bbe275.js} +3 -0
- package/dist/esm/{taskbar-processor-aa6772c9.js → taskbar-processor-c2a99aba.js} +9 -7
- package/dist/sankhyablocks/{p-a72a0a5d.entry.js → p-1b7f87cf.entry.js} +1 -1
- package/dist/sankhyablocks/p-2445b586.entry.js +1 -0
- package/dist/sankhyablocks/{p-cd486089.entry.js → p-2664ae24.entry.js} +1 -1
- package/dist/sankhyablocks/p-5a3e0eb6.js +1 -0
- package/dist/sankhyablocks/{p-eb94df0b.entry.js → p-70e52fee.entry.js} +1 -1
- package/dist/sankhyablocks/p-c118ef2a.entry.js +1 -0
- package/dist/sankhyablocks/p-dbaad88c.js +1 -0
- package/dist/sankhyablocks/p-df53643b.entry.js +1 -0
- package/dist/sankhyablocks/p-e7f772ed.js +1 -0
- package/dist/sankhyablocks/{p-71997e4c.entry.js → p-fb96840c.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/data/attachment.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/data/email.d.ts +7 -0
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +9 -0
- package/dist/types/components/snk-data-exporter/data/export-result.d.ts +8 -0
- package/dist/types/components/snk-data-exporter/data/report.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +9 -0
- package/dist/types/components/snk-data-exporter/exporter-email-sender/options-step.d.ts +9 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +1 -0
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +6 -3
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +43 -0
- package/dist/types/lib/message/resources/snk-exporter.msg.d.ts +2 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-03f0a380.entry.js +0 -1
- package/dist/sankhyablocks/p-03f9c407.js +0 -1
- package/dist/sankhyablocks/p-4cbc4ae3.js +0 -1
- package/dist/sankhyablocks/p-877bd6cf.js +0 -1
- package/dist/sankhyablocks/p-e6e0efe7.entry.js +0 -1
- package/dist/sankhyablocks/p-f1de5d1f.entry.js +0 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -70
|
@@ -16,6 +16,10 @@ export class SnkCrud {
|
|
|
16
16
|
* Determina se pode haver mais de uma linha selecionada na grade.
|
|
17
17
|
*/
|
|
18
18
|
this.multipleSelection = true;
|
|
19
|
+
/**
|
|
20
|
+
* Determina se haverá exportação de dados
|
|
21
|
+
*/
|
|
22
|
+
this.enableDataExporter = false;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
@@ -94,7 +98,7 @@ export class SnkCrud {
|
|
|
94
98
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
95
99
|
}
|
|
96
100
|
render() {
|
|
97
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, "data-element-id": "crud_form", configName: this.configName, actionsList: this.actionsList, onExit: () => this.setViewMode(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" }))), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
101
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, enableDataExporter: this.enableDataExporter }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { ref: (ref) => this._snkForm = ref, "data-element-id": "crud_form", configName: this.configName, actionsList: this.actionsList, onExit: () => this.setViewMode(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" }))), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._viewMode, onConfigSelected: (evt) => this.executeAction(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
|
98
102
|
}
|
|
99
103
|
static get is() { return "snk-crud"; }
|
|
100
104
|
static get encapsulation() { return "scoped"; }
|
|
@@ -227,6 +231,24 @@ export class SnkCrud {
|
|
|
227
231
|
"attribute": "multiple-selection",
|
|
228
232
|
"reflect": false,
|
|
229
233
|
"defaultValue": "true"
|
|
234
|
+
},
|
|
235
|
+
"enableDataExporter": {
|
|
236
|
+
"type": "boolean",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "boolean",
|
|
240
|
+
"resolved": "boolean",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Determina se haver\u00E1 exporta\u00E7\u00E3o de dados"
|
|
248
|
+
},
|
|
249
|
+
"attribute": "enable-data-exporter",
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"defaultValue": "false"
|
|
230
252
|
}
|
|
231
253
|
};
|
|
232
254
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
+
export const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
4
|
+
return h("div", null, h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, required: true, value: data === null || data === void 0 ? void 0 : data.to, onEzChange: evt => changeInfo("to", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("sendTo")}` })), h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, required: true, value: data === null || data === void 0 ? void 0 : data.subject, onEzChange: evt => changeInfo("subject", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("subject")}` })), h("ez-text-area", Object.assign({ label: getMessage("snkExporter.emailSenderInfoStep_message"), value: data === null || data === void 0 ? void 0 : data.message, onEzChange: evt => changeInfo("message", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("message")}` })), ((data === null || data === void 0 ? void 0 : data.attachments) || [])
|
|
5
|
+
.map((file, index) => h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: file.name, fileSize: file.size, canRemove: false }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("fileItem_") + (index + 1)}` }))));
|
|
6
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
export const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
4
|
+
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
|
5
|
+
const formatOptions = [
|
|
6
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
|
7
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLSX"), value: "xlsx" }
|
|
8
|
+
];
|
|
9
|
+
const typeOptions = [
|
|
10
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
|
11
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_currentPage"), value: "page" },
|
|
12
|
+
];
|
|
13
|
+
if (selectionCount > 0) {
|
|
14
|
+
const label = getMessage(selectionCount > 1 ? "snkExporter.emailSenderOptStep_someRecords" : "snkExporter.emailSenderOptStep_oneRecord", { SELECTION_COUNT: selectionCount });
|
|
15
|
+
typeOptions.push({
|
|
16
|
+
label,
|
|
17
|
+
value: "selection"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return h("div", null, 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) || "pdf", onEzChange: evt => changeInfo("format", evt.detail), options: formatOptions })), 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 })));
|
|
21
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { EmailInfoStep } from './email-info-step';
|
|
4
|
+
import { OptionsStep } from './options-step';
|
|
5
|
+
export class SnkExporterEmailSender {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._stepInfo = [
|
|
8
|
+
{
|
|
9
|
+
subTitle: "snkExporter.emailSenderOptStep_subtitle",
|
|
10
|
+
firstButton: "snkExporter.emailSenderCancelButton",
|
|
11
|
+
secondButton: "snkExporter.emailSenderNextButton",
|
|
12
|
+
firstButtonAction: () => this.close(),
|
|
13
|
+
secondButtonAction: () => this.changeStep(1)
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
subTitle: "snkExporter.emailSenderInfoStep_subtitle",
|
|
17
|
+
firstButton: "snkExporter.emailSenderBackButton",
|
|
18
|
+
secondButton: "snkExporter.emailSenderSendButton",
|
|
19
|
+
firstButtonAction: () => this.changeStep(0),
|
|
20
|
+
secondButtonAction: () => this.send(),
|
|
21
|
+
secondButtonEnabledTester: () => this.isFilled(),
|
|
22
|
+
secondButtonClass: "ez-button--primary"
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
this._opened = false;
|
|
26
|
+
this._currentStep = 0;
|
|
27
|
+
}
|
|
28
|
+
open(config) {
|
|
29
|
+
this._config = config;
|
|
30
|
+
this._opened = true;
|
|
31
|
+
this.changeStep(0);
|
|
32
|
+
return new Promise(accept => {
|
|
33
|
+
this._promiseResolver = accept;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getStepMessage(key) {
|
|
37
|
+
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
38
|
+
return this.getMessage(stepInfo[key]);
|
|
39
|
+
}
|
|
40
|
+
executeButtonAction(first) {
|
|
41
|
+
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
42
|
+
stepInfo[first ? "firstButtonAction" : "secondButtonAction"]();
|
|
43
|
+
}
|
|
44
|
+
checkButtonEnabled(first) {
|
|
45
|
+
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
46
|
+
const testFunction = stepInfo[first ? "firstButtonEnabledTester" : "secondButtonEnabledTester"];
|
|
47
|
+
if (testFunction) {
|
|
48
|
+
return testFunction();
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
changeStep(index) {
|
|
53
|
+
this._currentStep = index;
|
|
54
|
+
if (this._viewStack) {
|
|
55
|
+
this._viewStack.show(this._currentStep);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
send() {
|
|
59
|
+
const { format, type, email } = this._config;
|
|
60
|
+
this._promiseResolver({ format, type, email, report: undefined });
|
|
61
|
+
}
|
|
62
|
+
close() {
|
|
63
|
+
this._opened = false;
|
|
64
|
+
}
|
|
65
|
+
isFilled() {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
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;
|
|
68
|
+
}
|
|
69
|
+
updateEmailInfo(field, value) {
|
|
70
|
+
this._config = Object.assign(Object.assign({}, this._config), { email: Object.assign(Object.assign({}, this._config.email), { [field]: value }) });
|
|
71
|
+
}
|
|
72
|
+
updateConfigInfo(field, value) {
|
|
73
|
+
this._config = Object.assign(Object.assign({}, this._config), { [field]: value });
|
|
74
|
+
}
|
|
75
|
+
getSecondButtonClass() {
|
|
76
|
+
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
77
|
+
return stepInfo["secondButtonClass"] || "ez-button--secondary";
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
var _a;
|
|
81
|
+
ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkExporterEmailSender');
|
|
82
|
+
return (h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, h("ez-modal-container", { onEzModalAction: evt => {
|
|
83
|
+
if (evt.detail === "CLOSE")
|
|
84
|
+
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: (_a = this._config) === null || _a === void 0 ? void 0 : _a.email, 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
|
+
}
|
|
87
|
+
static get is() { return "snk-exporter-email-sender"; }
|
|
88
|
+
static get properties() {
|
|
89
|
+
return {
|
|
90
|
+
"getMessage": {
|
|
91
|
+
"type": "unknown",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "(key: string, params?: any) => string",
|
|
95
|
+
"resolved": "(key: string, params?: any) => string",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": ""
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
static get states() {
|
|
108
|
+
return {
|
|
109
|
+
"_config": {},
|
|
110
|
+
"_opened": {},
|
|
111
|
+
"_currentStep": {}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get methods() {
|
|
115
|
+
return {
|
|
116
|
+
"open": {
|
|
117
|
+
"complexType": {
|
|
118
|
+
"signature": "(config: ExportConfig) => Promise<ExportResult>",
|
|
119
|
+
"parameters": [{
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": ""
|
|
122
|
+
}],
|
|
123
|
+
"references": {
|
|
124
|
+
"Promise": {
|
|
125
|
+
"location": "global"
|
|
126
|
+
},
|
|
127
|
+
"ExportResult": {
|
|
128
|
+
"location": "import",
|
|
129
|
+
"path": "../data/export-result"
|
|
130
|
+
},
|
|
131
|
+
"ExportConfig": {
|
|
132
|
+
"location": "import",
|
|
133
|
+
"path": "../data/export-config"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"return": "Promise<ExportResult>"
|
|
137
|
+
},
|
|
138
|
+
"docs": {
|
|
139
|
+
"text": "",
|
|
140
|
+
"tags": []
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
static get elementRef() { return "_element"; }
|
|
146
|
+
}
|
|
@@ -49,7 +49,14 @@ export class SnkFilterDetail {
|
|
|
49
49
|
]);
|
|
50
50
|
}
|
|
51
51
|
buildIcon(title, iconName, action) {
|
|
52
|
-
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button" }, h("ez-icon", { title: title, iconName: iconName })));
|
|
52
|
+
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
|
|
53
|
+
}
|
|
54
|
+
buildIdButton(buttonElement, title) {
|
|
55
|
+
if (!buttonElement)
|
|
56
|
+
return;
|
|
57
|
+
const dataElement = { id: title };
|
|
58
|
+
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
59
|
+
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "button", dataElement);
|
|
53
60
|
}
|
|
54
61
|
getNormalizedValue(params, value) {
|
|
55
62
|
return params.reduce((arrayValues, currentParam, index) => {
|
|
@@ -57,15 +57,17 @@ export class SnkFilterList {
|
|
|
57
57
|
this._popover.remove();
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
60
|
+
}
|
|
61
|
+
buildIdElement(buttonElement, name) {
|
|
62
|
+
if (!buttonElement)
|
|
63
|
+
return;
|
|
64
|
+
const dataElement = { id: name };
|
|
65
|
+
buttonElement.removeAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME);
|
|
66
|
+
ElementIDUtils.addIDInfoIfNotExists(buttonElement, "filterItemList", dataElement);
|
|
65
67
|
}
|
|
66
68
|
buildItemElement(item) {
|
|
67
69
|
const itemId = ++this._selectableItemsCount;
|
|
68
|
-
return (h("button", { id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
70
|
+
return (h("button", { ref: elem => elem && this.buildIdElement(elem, item.label), id: `filter-item${itemId}`, onFocusin: () => this._preselection = itemId, class: `ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item`, onClick: () => this.itemSelected(item.name), name: item.label, key: itemId }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
|
|
69
71
|
}
|
|
70
72
|
itemSelected(itemName) {
|
|
71
73
|
if (itemName === SHOW_MORE_ITEM_NAME) {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
1
|
import { h } from '@stencil/core';
|
|
2
|
+
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
5
|
+
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
|
5
6
|
export class SnkGrid {
|
|
6
7
|
constructor() {
|
|
7
8
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
8
9
|
"snkGridTopTaskbar": ["FORM_MODE", "CONFIGURATOR", "INSERT"]
|
|
9
10
|
});
|
|
10
11
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
11
|
-
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
12
|
-
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
12
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH", "EXPORT"],
|
|
13
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH", "EXPORT"]
|
|
13
14
|
});
|
|
14
15
|
this._popUpGridConfig = false;
|
|
16
|
+
/**
|
|
17
|
+
* Determina se haverá exportação de dados
|
|
18
|
+
*/
|
|
19
|
+
this.enableDataExporter = false;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
22
|
* Exibe a janela de configurações da grade.
|
|
@@ -37,6 +42,37 @@ export class SnkGrid {
|
|
|
37
42
|
async setConfig(config) {
|
|
38
43
|
this.setGridConfig(config);
|
|
39
44
|
}
|
|
45
|
+
actionClickHandler(event) {
|
|
46
|
+
if (event.detail === TaskbarElement.EXPORT) {
|
|
47
|
+
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
48
|
+
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
49
|
+
// apenas mais uma
|
|
50
|
+
const selectedRows = this._dataState.selectedRecords.length;
|
|
51
|
+
const config = {
|
|
52
|
+
format: "pdf",
|
|
53
|
+
type: selectedRows > 0 ? "selection" : "all",
|
|
54
|
+
selectedRows,
|
|
55
|
+
email: {
|
|
56
|
+
attachments: [
|
|
57
|
+
{ name: "Movimentação Financeira.pdf", size: 1024 * 231 }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
this._snkEmailSender.open(config)
|
|
62
|
+
.then((result) => {
|
|
63
|
+
this._application.message("resultado", JSON.stringify(result));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
69
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
70
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
71
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
72
|
+
*/
|
|
73
|
+
getMessage(key, params) {
|
|
74
|
+
return this._application.messagesBuilder.getMessage(key, params);
|
|
75
|
+
}
|
|
40
76
|
openGridConfig() {
|
|
41
77
|
this._grid.getColumnsState()
|
|
42
78
|
.then((gridColumns) => {
|
|
@@ -72,6 +108,7 @@ export class SnkGrid {
|
|
|
72
108
|
});
|
|
73
109
|
}
|
|
74
110
|
componentWillLoad() {
|
|
111
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
75
112
|
let parent = this._element.parentElement;
|
|
76
113
|
while (parent) {
|
|
77
114
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
@@ -96,9 +133,10 @@ export class SnkGrid {
|
|
|
96
133
|
this.loadConfig();
|
|
97
134
|
}
|
|
98
135
|
componentWillRender() {
|
|
136
|
+
const invisibleButtons = this.enableDataExporter ? [] : ["EXPORT"];
|
|
99
137
|
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
100
|
-
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
101
|
-
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
138
|
+
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
139
|
+
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
102
140
|
}
|
|
103
141
|
addElementID() {
|
|
104
142
|
const dataInfo = { dataUnit: this._dataUnit };
|
|
@@ -108,7 +146,7 @@ export class SnkGrid {
|
|
|
108
146
|
if (!this._dataUnit) {
|
|
109
147
|
return undefined;
|
|
110
148
|
}
|
|
111
|
-
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-padding-bottom--medium 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, "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), selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
149
|
+
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-padding-bottom--medium 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, "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("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }), 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() }))));
|
|
112
150
|
}
|
|
113
151
|
static get is() { return "snk-grid"; }
|
|
114
152
|
static get encapsulation() { return "scoped"; }
|
|
@@ -220,6 +258,24 @@ export class SnkGrid {
|
|
|
220
258
|
},
|
|
221
259
|
"attribute": "multiple-selection",
|
|
222
260
|
"reflect": false
|
|
261
|
+
},
|
|
262
|
+
"enableDataExporter": {
|
|
263
|
+
"type": "boolean",
|
|
264
|
+
"mutable": false,
|
|
265
|
+
"complexType": {
|
|
266
|
+
"original": "boolean",
|
|
267
|
+
"resolved": "boolean",
|
|
268
|
+
"references": {}
|
|
269
|
+
},
|
|
270
|
+
"required": false,
|
|
271
|
+
"optional": false,
|
|
272
|
+
"docs": {
|
|
273
|
+
"tags": [],
|
|
274
|
+
"text": "Determina se haver\u00E1 exporta\u00E7\u00E3o de dados"
|
|
275
|
+
},
|
|
276
|
+
"attribute": "enable-data-exporter",
|
|
277
|
+
"reflect": false,
|
|
278
|
+
"defaultValue": "false"
|
|
223
279
|
}
|
|
224
280
|
};
|
|
225
281
|
}
|
|
@@ -324,4 +380,13 @@ export class SnkGrid {
|
|
|
324
380
|
};
|
|
325
381
|
}
|
|
326
382
|
static get elementRef() { return "_element"; }
|
|
383
|
+
static get listeners() {
|
|
384
|
+
return [{
|
|
385
|
+
"name": "actionClick",
|
|
386
|
+
"method": "actionClickHandler",
|
|
387
|
+
"target": undefined,
|
|
388
|
+
"capture": false,
|
|
389
|
+
"passive": false
|
|
390
|
+
}];
|
|
391
|
+
}
|
|
327
392
|
}
|
package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
3
|
import { h, Host } from '@stencil/core';
|
|
4
4
|
import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
|
|
@@ -13,7 +13,7 @@ export class EzGridConfig {
|
|
|
13
13
|
this._componenteInternalKey = Date.now();
|
|
14
14
|
/**
|
|
15
15
|
* Aba selecionada das configurações da grade.
|
|
16
|
-
|
|
16
|
+
*/
|
|
17
17
|
this.selectedIndex = 0;
|
|
18
18
|
}
|
|
19
19
|
/* Creation Methods */
|
|
@@ -22,10 +22,10 @@ export class EzGridConfig {
|
|
|
22
22
|
*/
|
|
23
23
|
async saveConfig(config) {
|
|
24
24
|
var _a;
|
|
25
|
-
if (config == undefined || ((_a = this.
|
|
25
|
+
if (config == undefined || ((_a = this.application) === null || _a === void 0 ? void 0 : _a.configName) == undefined) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
ConfigStorage.saveGridConfig(config, this.
|
|
28
|
+
ConfigStorage.saveGridConfig(config, this.application.configName)
|
|
29
29
|
.then((response) => {
|
|
30
30
|
if ((response === null || response === void 0 ? void 0 : response.resource) != undefined) {
|
|
31
31
|
this.configChange.emit(config);
|
|
@@ -40,7 +40,7 @@ export class EzGridConfig {
|
|
|
40
40
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
41
41
|
*/
|
|
42
42
|
getMessage(key, params) {
|
|
43
|
-
return this.
|
|
43
|
+
return this.application.messagesBuilder.getMessage(key, params);
|
|
44
44
|
}
|
|
45
45
|
createOrderList() {
|
|
46
46
|
let newList = [];
|
|
@@ -459,9 +459,6 @@ export class EzGridConfig {
|
|
|
459
459
|
this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
componentWillLoad() {
|
|
463
|
-
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
464
|
-
}
|
|
465
462
|
componentDidLoad() {
|
|
466
463
|
ElementIDUtils.addIDInfo(this._element);
|
|
467
464
|
}
|
|
@@ -501,6 +498,26 @@ export class EzGridConfig {
|
|
|
501
498
|
"reflect": false,
|
|
502
499
|
"defaultValue": "0"
|
|
503
500
|
},
|
|
501
|
+
"application": {
|
|
502
|
+
"type": "unknown",
|
|
503
|
+
"mutable": false,
|
|
504
|
+
"complexType": {
|
|
505
|
+
"original": "SnkApplication",
|
|
506
|
+
"resolved": "SnkApplication",
|
|
507
|
+
"references": {
|
|
508
|
+
"SnkApplication": {
|
|
509
|
+
"location": "import",
|
|
510
|
+
"path": "../../../snk-application/snk-application"
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
"required": false,
|
|
515
|
+
"optional": false,
|
|
516
|
+
"docs": {
|
|
517
|
+
"tags": [],
|
|
518
|
+
"text": "Refer\u00EAncia para o SnkApplication"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
504
521
|
"columns": {
|
|
505
522
|
"type": "unknown",
|
|
506
523
|
"mutable": true,
|
|
@@ -15,6 +15,7 @@ export var TaskbarElement;
|
|
|
15
15
|
TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
|
|
16
16
|
TaskbarElement["DIVIDER"] = "DIVIDER";
|
|
17
17
|
TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
|
|
18
|
+
TaskbarElement["EXPORT"] = "EXPORT";
|
|
18
19
|
})(TaskbarElement || (TaskbarElement = {}));
|
|
19
20
|
export var AuthorizationElements;
|
|
20
21
|
(function (AuthorizationElements) {
|
|
@@ -69,6 +70,8 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
|
|
|
69
70
|
return iconButton("list", element, className, dataElementId, title, action, isEnabled);
|
|
70
71
|
case TaskbarElement.CONFIGURATOR:
|
|
71
72
|
return iconButton("settings-inverted", element, className, dataElementId, title, action, isEnabled);
|
|
73
|
+
case TaskbarElement.EXPORT:
|
|
74
|
+
return iconButton("file-download", element, className, dataElementId, title, action, isEnabled);
|
|
72
75
|
case TaskbarElement.MORE_OPTIONS:
|
|
73
76
|
return actionButton(element, className, dataElementId, title, action, isEnabled, actions);
|
|
74
77
|
case TaskbarElement.DIVIDER:
|
|
@@ -2,7 +2,7 @@ export default class TaskbarProcessor {
|
|
|
2
2
|
constructor(defaultButtons) {
|
|
3
3
|
this._defaultButtons = defaultButtons;
|
|
4
4
|
}
|
|
5
|
-
process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
|
|
5
|
+
process(taskbarId, taskbarManager, dataState, disabledButtons = [], invisibleButtons = []) {
|
|
6
6
|
var _a;
|
|
7
7
|
this.customButtons = new Map();
|
|
8
8
|
this.buttons = "";
|
|
@@ -17,13 +17,15 @@ export default class TaskbarProcessor {
|
|
|
17
17
|
this.customButtons.set(customBtn.name, customBtn);
|
|
18
18
|
buttonName = customBtn.name;
|
|
19
19
|
}
|
|
20
|
-
if (!
|
|
21
|
-
this.
|
|
20
|
+
if (!invisibleButtons.includes(buttonName)) {
|
|
21
|
+
if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
22
|
+
this.disabledButtons.push(buttonName);
|
|
23
|
+
}
|
|
24
|
+
if (this.buttons.length > 0) {
|
|
25
|
+
this.buttons += ",";
|
|
26
|
+
}
|
|
27
|
+
this.buttons += buttonName;
|
|
22
28
|
}
|
|
23
|
-
if (this.buttons.length > 0) {
|
|
24
|
-
this.buttons += ",";
|
|
25
|
-
}
|
|
26
|
-
this.buttons += buttonName;
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
|
@@ -17,7 +17,8 @@ export class SnkTaskbar {
|
|
|
17
17
|
[TaskbarElement.SAVE]: "snkTaskbar.titleSave",
|
|
18
18
|
[TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
|
|
19
19
|
[TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
|
|
20
|
-
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator"
|
|
20
|
+
[TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator",
|
|
21
|
+
[TaskbarElement.EXPORT]: "snkTaskbar.titleExportar"
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
observeButtons() {
|
|
@@ -2,6 +2,7 @@ import snkDataUnitMessages from "./resources/snk-data-unit.msg.js";
|
|
|
2
2
|
import snkFilterBarMessages from "./resources/snk-filter-bar.msg.js";
|
|
3
3
|
import snkTaskbarMessages from "./resources/snk-taskbar.msg.js";
|
|
4
4
|
import crudUtilsMessages from "./resources/crud-utils.msg.js";
|
|
5
|
+
import snkExporterMessages from "./resources/snk-exporter.msg.js";
|
|
5
6
|
import { snkFormMessages, snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg.js";
|
|
6
7
|
import { snkConfiguratorMessages } from "./resources/snk-configurator.msg.js";
|
|
7
8
|
import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg.js";
|
|
@@ -19,7 +20,8 @@ export class SnkMessageBuilder {
|
|
|
19
20
|
snkTabConfig: snkTabConfigMessages,
|
|
20
21
|
crudUtils: crudUtilsMessages,
|
|
21
22
|
snkGrid: snkGridMessages,
|
|
22
|
-
snkGridConfig: snkGridConfigMessages
|
|
23
|
+
snkGridConfig: snkGridConfigMessages,
|
|
24
|
+
snkExporter: snkExporterMessages
|
|
23
25
|
};
|
|
24
26
|
this._currentOperation = OperationMap.CLEAN;
|
|
25
27
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const snkExporterMessages = {
|
|
2
|
+
emailSenderTitle: "Enviar por email",
|
|
3
|
+
emailSenderBackButton: "Voltar",
|
|
4
|
+
emailSenderNextButton: "Avançar",
|
|
5
|
+
emailSenderCancelButton: "Cancelar",
|
|
6
|
+
emailSenderSendButton: "Enviar",
|
|
7
|
+
emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
|
|
8
|
+
emailSenderOptStep_lblFormat: "Formato:",
|
|
9
|
+
emailSenderOptStep_formatPDF: "PDF (.pdf)",
|
|
10
|
+
emailSenderOptStep_formatXLSX: "Planilha (.xlsx)",
|
|
11
|
+
emailSenderOptStep_export: "Exportar:",
|
|
12
|
+
emailSenderOptStep_allData: "Toda a grade",
|
|
13
|
+
emailSenderOptStep_currentPage: "Somente a página atual",
|
|
14
|
+
emailSenderOptStep_someRecords: "{{SELECTION_COUNT}} linhas selecionadas",
|
|
15
|
+
emailSenderOptStep_oneRecord: "Somente a linha selecionada",
|
|
16
|
+
emailSenderInfoStep_subtitle: "Informações de email",
|
|
17
|
+
emailSenderInfoStep_sendTo: "Enviar para",
|
|
18
|
+
emailSenderInfoStep_subject: "Assunto",
|
|
19
|
+
emailSenderInfoStep_message: "Mensagem"
|
|
20
|
+
};
|
|
21
|
+
export default snkExporterMessages;
|