@sankhyalabs/sankhyablocks 3.2.2 → 3.2.3
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-c596bd9c.js → SnkMessageBuilder-e103fb59.js} +13 -2
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +13 -19
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +44 -32
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +4 -4
- package/dist/cjs/snk-tab-config.cjs.entry.js +4 -0
- package/dist/cjs/{taskbar-elements-8d38f43a.js → taskbar-elements-d7eb170e.js} +2 -2
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +14 -12
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +2 -1
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +36 -4
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +2 -1
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +4 -0
- package/dist/collection/components/snk-grid/snk-grid.js +9 -16
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +8 -4
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
- package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
- package/dist/collection/lib/message/resources/file-viewer.msg.js +10 -0
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +1 -1
- package/dist/collection/lib/utils/fileViewer/index.js +20 -13
- package/dist/components/SnkMessageBuilder.js +13 -2
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-data-exporter2.js +32 -25
- package/dist/components/snk-exporter-email-sender2.js +4 -4
- package/dist/components/snk-field-config2.js +3 -2
- package/dist/components/snk-filter-bar2.js +2 -1
- package/dist/components/snk-filter-modal2.js +1 -1
- package/dist/components/snk-grid-config2.js +8 -4
- package/dist/components/snk-grid2.js +9 -16
- package/dist/components/snk-tab-config2.js +4 -0
- package/dist/components/snk-taskbar2.js +2 -2
- package/dist/esm/{SnkMessageBuilder-66ddc2f0.js → SnkMessageBuilder-11038c4f.js} +13 -2
- package/dist/esm/{index-1564817d.js → index-87e6efed.js} +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +14 -20
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-exporter_8.entry.js +45 -33
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-exporter-email-sender.entry.js +4 -4
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +4 -0
- package/dist/esm/{taskbar-elements-24655695.js → taskbar-elements-025f6c0c.js} +3 -3
- package/dist/sankhyablocks/{p-5534e08c.js → p-1f388b12.js} +1 -1
- package/dist/sankhyablocks/{p-01fdcc77.entry.js → p-25244256.entry.js} +1 -1
- package/dist/sankhyablocks/p-277968b3.entry.js +1 -0
- package/dist/sankhyablocks/{p-2cd74aa1.entry.js → p-3dcc1202.entry.js} +1 -1
- package/dist/sankhyablocks/p-41f61cc3.entry.js +1 -0
- package/dist/sankhyablocks/{p-6b992e43.js → p-4ba7e5e9.js} +1 -1
- package/dist/sankhyablocks/{p-82ab941a.entry.js → p-809ecd6b.entry.js} +2 -2
- package/dist/sankhyablocks/p-87ef5482.js +1 -0
- package/dist/sankhyablocks/p-8d8e859b.entry.js +1 -0
- package/dist/sankhyablocks/{p-6878464e.entry.js → p-c8244b9e.entry.js} +1 -1
- package/dist/sankhyablocks/p-eb08de68.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +1 -0
- package/dist/types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.d.ts +40 -0
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +84 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -0
- package/dist/types/lib/message/resources/file-viewer.msg.d.ts +2 -0
- package/dist/types/lib/utils/fileViewer/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/sankhyablocks/p-0b86c7f0.entry.js +0 -1
- package/dist/sankhyablocks/p-123732eb.entry.js +0 -1
- package/dist/sankhyablocks/p-3187b31c.js +0 -1
- package/dist/sankhyablocks/p-5360f8fa.entry.js +0 -1
- package/dist/sankhyablocks/p-9fab987d.entry.js +0 -1
|
@@ -119,6 +119,16 @@ const snkExporterMessages = {
|
|
|
119
119
|
emailSenderInfoStep_message: "Mensagem"
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
+
const fileViewerMessages = {
|
|
123
|
+
error: {
|
|
124
|
+
title: "Erro na Exportação",
|
|
125
|
+
message: "O usuário não possui permissão para exportar o arquivo."
|
|
126
|
+
},
|
|
127
|
+
message: {
|
|
128
|
+
exportSuccess: "Exportado com sucesso!",
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
122
132
|
const snkFormMessages = {
|
|
123
133
|
title: {
|
|
124
134
|
clone: "Duplicar registro",
|
|
@@ -245,7 +255,7 @@ const snkDataExporterMessages = {
|
|
|
245
255
|
message: {
|
|
246
256
|
emailSuccess: "E-mail enviado com sucesso",
|
|
247
257
|
exportError: "Erro ao realizar a exportação",
|
|
248
|
-
|
|
258
|
+
exportPermission: "O usuário não possui permissão para exportar o arquivo.",
|
|
249
259
|
},
|
|
250
260
|
title: {
|
|
251
261
|
error: "Erro",
|
|
@@ -275,7 +285,8 @@ class SnkMessageBuilder {
|
|
|
275
285
|
snkGrid: snkGridMessages,
|
|
276
286
|
snkGridConfig: snkGridConfigMessages,
|
|
277
287
|
snkExporter: snkExporterMessages,
|
|
278
|
-
snkDataExporter: snkDataExporterMessages
|
|
288
|
+
snkDataExporter: snkDataExporterMessages,
|
|
289
|
+
fileViewer: fileViewerMessages
|
|
279
290
|
};
|
|
280
291
|
this._currentOperation = exports.OperationMap.CLEAN;
|
|
281
292
|
this.loadAppMessages().then((msgs) => {
|
|
@@ -6,7 +6,7 @@ const index = require('./index-21bd01e1.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const ConfigStorage = require('./ConfigStorage-8b5e3261.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
9
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-e103fb59.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
11
11
|
|
|
12
12
|
class SnkErrorHandler {
|
|
@@ -94,19 +94,20 @@ const SnkConfigurator = class {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
render() {
|
|
97
|
-
return (index.h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, index.h("div", { class: "snk-configurator" }, index.h("div", { class: "snk-configurator__header" }, index.h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), index.h("div", { class: "snk-configurator__button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "snk-configurator__main" }, index.h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), index.h("ez-button", {
|
|
97
|
+
return (index.h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, index.h("div", { class: "snk-configurator" }, index.h("div", { class: "snk-configurator__header" }, index.h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), index.h("div", { class: "snk-configurator__button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "snk-configurator__main" }, index.h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), index.h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), index.h("ez-button", { label: this.viewMode === GRID_MODE.name
|
|
98
98
|
? this.getMessage("snkConfigurator.labelConfigGrid")
|
|
99
99
|
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }), index.h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
SnkConfigurator.style = snkConfiguratorCss;
|
|
103
103
|
|
|
104
|
-
const snkFieldConfigCss = ".sc-snk-field-config-h{--snk-field-config--height:42px;--snk-field-config--width:100%;--snk-field-config__icon--width:48px;--snk-field-config-slim--height:32px;--snk-field-config--border-radius:var(--border--radius-medium, 12px);--snk-field-config--font-size:var(--text--medium, 14px);--snk-field-config--font-family:var(--font-pattern, Arial);--snk-field-config--font-weight:var(--text-weight--medium, 400);--snk-field-config--color:var(--title--primary, #000);--snk-field-config--padding-left:var(--space--medium, 6px);--snk-field-config__input--background-color:var(--background--medium, #e0e0e0);--snk-field-config__input--border:var(--border--medium, 2px solid);--snk-field-config__input--border-color:var(--background--xlight, #fff);--snk-field-config__required--color:var(--color--error, #FF0000);--snk-field-
|
|
104
|
+
const snkFieldConfigCss = ".sc-snk-field-config-h{--snk-field-config--height:42px;--snk-field-config--width:100%;--snk-field-config__icon--width:48px;--snk-field-config-slim--height:32px;--snk-field-config--border-radius:var(--border--radius-medium, 12px);--snk-field-config--font-size:var(--text--medium, 14px);--snk-field-config--font-family:var(--font-pattern, Arial);--snk-field-config--font-weight:var(--text-weight--medium, 400);--snk-field-config--color:var(--title--primary, #000);--snk-field-config--padding-left:var(--space--medium, 6px);--snk-field-config__input--background-color:var(--background--medium, #e0e0e0);--snk-field-config__input--border:var(--border--medium, 2px solid);--snk-field-config__input--border-color:var(--background--xlight, #fff);--snk-field-config__required--color:var(--color--error, #FF0000);--snk-field-config__label--gap:var(--space--extra-small, 3px);--snk-field-config__transition--visibility:var(--transition, 0.2s linear);--snk-field-config__transition--opacity:var(--transition, 0.15s linear);--snk-field-config__config-popover--z-index:var(--more-visible, 2);--snk-field-config__config-outer-arrow--background-color:var(--color--secondary-200, #D2D3DA);--snk-field-config__draggable--padding-right:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--snk-field-config--width)}.field-config.sc-snk-field-config{width:100%;box-sizing:border-box;display:flex;align-items:center;padding-left:var(--snk-field-config--padding-left);font-weight:var(--snk-field-config--font-weight);height:var(--snk-field-config--height);border-radius:var(--snk-field-config--border-radius);font-family:var(--snk-field-config--font-family);font-size:var(--snk-field-config--font-size);border:var(--snk-field-config__input--border);border-color:var(--snk-field-config__input--border-color);background-color:var(--snk-field-config__input--background-color);color:var(--snk-field-config--color)}.field-config__config-popover.sc-snk-field-config{width:40px;margin-left:auto;z-index:var(--snk-field-config__config-popover--z-index)}.field-config__label.sc-snk-field-config{display:flex;flex-direction:row-reverse;line-height:calc(var(--snk-field-config--font-size) + 2px);gap:var(--snk-field-config__label--gap)}.field-config__label-text.sc-snk-field-config{overflow:hidden;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;display:-webkit-box;-o-text-overflow:ellipsis;text-overflow:ellipsis;word-break:break-word}.field-config__label-required.sc-snk-field-config{color:var(--snk-field-config__required--color)}.field-config__add.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options.sc-snk-field-config{display:flex;margin-left:auto;visibility:hidden;opacity:0;transition:visibility var(--snk-field-config__transition--visibility), opacity var(--snk-field-config__transition--opacity)}.field-config__options--is-active.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config__remove-icon.sc-snk-field-config{margin-right:-15px}.field-config.sc-snk-field-config:hover .field-config__options.sc-snk-field-config{display:flex;visibility:visible;opacity:1}.field-config.sc-snk-field-config:hover .field-config__add.sc-snk-field-config{visibility:visible;opacity:1}.field-config__draggable.sc-snk-field-config{padding-right:var(--snk-field-config__draggable--padding-right)}.field-config__config-outer-arrow.sc-snk-field-config{clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px;padding-top:3px;border-bottom:1px solid #FFFFFF;background-color:var(--snk-field-config__config-outer-arrow--background-color)}.field-config__config-inner-arrow.sc-snk-field-config{background-color:#FFFFFF;clip-path:polygon(50% 0, 90% 100%, 10% 100%);border-radius:0.25em 0 0 0;width:30px;height:15px}.ez-box__container.sc-snk-field-config ez-collapsible-box.sc-snk-field-config{--snk-collapsible-box__header--padding-left:6px}ez-icon.sc-snk-field-config{--snk-icon--color:var(--snk-field-config--color)}ez-popover.sc-snk-field-config{--snk-popover__box--background-color:transparent;--snk-popover__box--box-shadow:none}.field-config__options.sc-snk-field-config ez-button.sc-snk-field-config{--snk-button--background-color:transparent;--snk-button--focus--border:none;--snk-button--focus--box-shadow:none}@media screen and (min-width: 1200px){.field-config__label.sc-snk-field-config{flex-direction:row}}";
|
|
105
105
|
|
|
106
106
|
const SnkFieldConfig = class {
|
|
107
107
|
constructor(hostRef) {
|
|
108
108
|
index.registerInstance(this, hostRef);
|
|
109
109
|
this.ezClickIcon = index.createEvent(this, "ezClickIcon", 7);
|
|
110
|
+
this._lang = "pt"; // Controla qual idioma será usado para definir a regras de hifenização.
|
|
110
111
|
this.isConfigActive = false;
|
|
111
112
|
this.fieldConfig = undefined;
|
|
112
113
|
this.modeInsertion = true;
|
|
@@ -145,7 +146,7 @@ const SnkFieldConfig = class {
|
|
|
145
146
|
if (this.fieldConfig == undefined) {
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
|
-
return (index.h(index.Host, null, index.h("div", { class: "field-config" }, index.h("div", { class: "field-config__draggable" }, index.h("ez-icon", { iconName: "drag-indicator", size: "small" })), index.h("div",
|
|
149
|
+
return (index.h(index.Host, null, index.h("div", { class: "field-config" }, index.h("div", { class: "field-config__draggable" }, index.h("ez-icon", { iconName: "drag-indicator", size: "small" })), index.h("div", { class: "field-config__label" }, index.h("span", { class: "field-config__label-text", lang: this._lang, title: this.fieldConfig.label }, this.fieldConfig.label), this.isRequired() && index.h("span", { class: "field-config__label-required" }, "*")), this.modeInsertion ?
|
|
149
150
|
index.h("div", { class: "field-config__add" }, index.h("ez-button", { onClick: (evt) => this.handleAction(evt, constants.ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
|
|
150
151
|
index.h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, index.h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, constants.ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), index.h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, constants.ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && index.h("div", { class: "field-config__config-popover" }, index.h("div", { class: "field-config__config-outer-arrow" }, index.h("div", { class: "field-config__config-inner-arrow" })))));
|
|
151
152
|
}
|
|
@@ -239,18 +240,19 @@ const SnkGrid = class {
|
|
|
239
240
|
.then(() => {
|
|
240
241
|
this.setGridConfig(config);
|
|
241
242
|
this.closeGridConfig();
|
|
243
|
+
this.dataExporterProviderStore();
|
|
242
244
|
});
|
|
243
245
|
}
|
|
244
246
|
buildColumnsMetadata(columnsMetadata, gridColumns) {
|
|
245
247
|
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
|
246
|
-
var _a, _b
|
|
248
|
+
var _a, _b;
|
|
247
249
|
/**
|
|
248
250
|
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
|
249
251
|
*/
|
|
250
252
|
if (column.hidden && column.name !== "RECDESP") {
|
|
251
253
|
return;
|
|
252
254
|
}
|
|
253
|
-
const fieldData = (
|
|
255
|
+
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
|
254
256
|
const columnData = {
|
|
255
257
|
label: column.label,
|
|
256
258
|
id: column.name,
|
|
@@ -259,10 +261,12 @@ const SnkGrid = class {
|
|
|
259
261
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
|
260
262
|
};
|
|
261
263
|
columnsMetadata.push(columnData);
|
|
262
|
-
if (((
|
|
264
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
|
265
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
|
266
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
|
263
267
|
const descriptionColumn = {
|
|
264
268
|
label: fieldData.properties.DESCRIPTIONENTITY,
|
|
265
|
-
id:
|
|
269
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
|
266
270
|
width: 200,
|
|
267
271
|
type: core.DataType.TEXT,
|
|
268
272
|
userInterface: UnitMetadata.UserInterface.LONGTEXT
|
|
@@ -286,17 +290,6 @@ const SnkGrid = class {
|
|
|
286
290
|
}
|
|
287
291
|
return offset;
|
|
288
292
|
}
|
|
289
|
-
getExporterLimit(paginationInfo) {
|
|
290
|
-
if (paginationInfo == undefined) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const { firstRecord, lastRecord } = paginationInfo;
|
|
294
|
-
const limit = firstRecord > 0 && lastRecord > 0 && (lastRecord - firstRecord + 1);
|
|
295
|
-
if (!limit) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
return limit;
|
|
299
|
-
}
|
|
300
293
|
async dataExporterProviderStore() {
|
|
301
294
|
var _a, _b;
|
|
302
295
|
const paginationInfo = this.getPaginationInfo();
|
|
@@ -335,7 +328,8 @@ const SnkGrid = class {
|
|
|
335
328
|
return this.getExporterOffset(paginationInfo);
|
|
336
329
|
},
|
|
337
330
|
getLimit: () => {
|
|
338
|
-
|
|
331
|
+
var _a;
|
|
332
|
+
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
|
|
339
333
|
},
|
|
340
334
|
getRecordID: () => {
|
|
341
335
|
var _a, _b, _c;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const constants = require('./constants-8f3504ec.js');
|
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
|
8
|
+
const taskbarElements = require('./taskbar-elements-d7eb170e.js');
|
|
9
9
|
const index$1 = require('./index-0e663819.js');
|
|
10
10
|
require('./index-fc7ca86c.js');
|
|
11
11
|
|
|
@@ -8,11 +8,13 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
|
8
8
|
const index = require('./index-0e663819.js');
|
|
9
9
|
const constants = require('./constants-8f3504ec.js');
|
|
10
10
|
const ConfigStorage = require('./ConfigStorage-8b5e3261.js');
|
|
11
|
+
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
|
11
12
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
12
13
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
13
14
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
15
|
+
const CheckMode = require('@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode');
|
|
14
16
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
15
|
-
const taskbarElements = require('./taskbar-elements-
|
|
17
|
+
const taskbarElements = require('./taskbar-elements-d7eb170e.js');
|
|
16
18
|
require('./_commonjsHelpers-537d719a.js');
|
|
17
19
|
require('./index-fc7ca86c.js');
|
|
18
20
|
|
|
@@ -187,19 +189,11 @@ function getFormatResponse$1(result) {
|
|
|
187
189
|
return core.ObjectUtils.stringToObject(response);
|
|
188
190
|
}
|
|
189
191
|
|
|
190
|
-
function
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
|
|
196
|
-
}
|
|
192
|
+
function getMessage(application, key, params) {
|
|
193
|
+
var _a;
|
|
194
|
+
return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
|
197
195
|
}
|
|
198
|
-
function webConnection(fileSessionKey, canPrint, canExport) {
|
|
199
|
-
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
200
|
-
if (application == undefined) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
196
|
+
function webConnection(fileSessionKey, canPrint, canExport, application) {
|
|
203
197
|
const keyPort = constants.KEY_PORT_EXPORT;
|
|
204
198
|
const methodName = constants.WEB_CONNECTION.methods.PDF_VIEWER;
|
|
205
199
|
const params = {
|
|
@@ -208,7 +202,20 @@ function webConnection(fileSessionKey, canPrint, canExport) {
|
|
|
208
202
|
permiteExportar: canExport ? "S" : "N",
|
|
209
203
|
contentType: "S"
|
|
210
204
|
};
|
|
211
|
-
application.webConnection(keyPort, methodName, params);
|
|
205
|
+
application === null || application === void 0 ? void 0 : application.webConnection(keyPort, methodName, params);
|
|
206
|
+
}
|
|
207
|
+
function fileViewer({ fileSessionKey, canPrint, canExport, useAppPrint, isDownload, fileType }) {
|
|
208
|
+
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
209
|
+
if (isDownload && !canExport && fileType === index.DataExporterType.EXPORT_PAGE_TO_XLS) {
|
|
210
|
+
const title = getMessage(application, "fileViewer.error.title");
|
|
211
|
+
const message = getMessage(application, "fileViewer.error.message");
|
|
212
|
+
return utils.ApplicationUtils.error(title, message);
|
|
213
|
+
}
|
|
214
|
+
if (useAppPrint && !isDownload) {
|
|
215
|
+
return webConnection(fileSessionKey, canPrint, canExport, application);
|
|
216
|
+
}
|
|
217
|
+
window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
|
|
218
|
+
utils.ApplicationUtils.info(getMessage(application, "fileViewer.message.exportSuccess"), { iconName: "check" });
|
|
212
219
|
}
|
|
213
220
|
|
|
214
221
|
function getPersonalizedReports(requestBody) {
|
|
@@ -258,17 +265,17 @@ const SnkDataExporter = class {
|
|
|
258
265
|
attachments: [
|
|
259
266
|
{ name: this._appLabel }
|
|
260
267
|
]
|
|
268
|
+
},
|
|
269
|
+
resolver: ({ type, format, email: { to, subject, message } }) => {
|
|
270
|
+
var _a;
|
|
271
|
+
const methodName = (_a = index.DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : index.DataExporterFormat.PDF;
|
|
272
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
273
|
+
this._snkEmailSender.close();
|
|
274
|
+
utils.ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
275
|
+
});
|
|
261
276
|
}
|
|
262
277
|
};
|
|
263
|
-
this._snkEmailSender.open(config)
|
|
264
|
-
.then(({ format, email: { to, subject, message } }) => {
|
|
265
|
-
var _a;
|
|
266
|
-
const methodName = (_a = index.DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : index.DataExporterFormat.PDF;
|
|
267
|
-
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
268
|
-
this._snkEmailSender.close();
|
|
269
|
-
utils.ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
270
|
-
});
|
|
271
|
-
});
|
|
278
|
+
this._snkEmailSender.open(config);
|
|
272
279
|
}
|
|
273
280
|
/**
|
|
274
281
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -325,11 +332,14 @@ const SnkDataExporter = class {
|
|
|
325
332
|
columns,
|
|
326
333
|
sort,
|
|
327
334
|
resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
|
|
328
|
-
if (currentPageOptions.includes(option)) {
|
|
335
|
+
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
|
329
336
|
const offset = this.provider.getOffset();
|
|
330
337
|
const limit = this.provider.getLimit();
|
|
331
338
|
params = Object.assign(Object.assign({}, params), { offset,
|
|
332
|
-
limit });
|
|
339
|
+
limit, selectedIDs: [] });
|
|
340
|
+
}
|
|
341
|
+
else if (resolveProps.type == "all") {
|
|
342
|
+
params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
|
|
333
343
|
}
|
|
334
344
|
fetchDataExporter(params)
|
|
335
345
|
.then((result) => callbackResolver(result))
|
|
@@ -356,7 +366,6 @@ const SnkDataExporter = class {
|
|
|
356
366
|
this.resolveExporter(params, (response) => {
|
|
357
367
|
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
358
368
|
isDownload }));
|
|
359
|
-
utils.ApplicationUtils.info(this.getMessage("snkDataExporter.message.exportSuccess"), { iconName: "check" });
|
|
360
369
|
});
|
|
361
370
|
}
|
|
362
371
|
async processExporter(evt) {
|
|
@@ -987,7 +996,7 @@ const SnkFilterBar = class {
|
|
|
987
996
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
988
997
|
return undefined;
|
|
989
998
|
}
|
|
990
|
-
return (index$1.h(index$1.Host, null, index$1.h("ez-scroller", { direction:
|
|
999
|
+
return (index$1.h(index$1.Host, null, index$1.h("ez-scroller", { direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), index$1.h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id": "apppliedFilters" }), index$1.h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail), "data-element-id": "addFilters" }, index$1.h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
991
1000
|
}
|
|
992
1001
|
get _element() { return index$1.getElement(this); }
|
|
993
1002
|
static get watchers() { return {
|
|
@@ -1385,7 +1394,7 @@ const SnkFilterModal = class {
|
|
|
1385
1394
|
}
|
|
1386
1395
|
buildItems(list) {
|
|
1387
1396
|
return list.map(item => {
|
|
1388
|
-
return (index$1.h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, index$1.h("ez-check", { id: `checkbox_${item.id}`, tabIndex:
|
|
1397
|
+
return (index$1.h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, index$1.h("ez-check", { id: `checkbox_${item.id}`, tabIndex: -1, class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: utils.CheckMode.SWITCH }), index$1.h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
|
|
1389
1398
|
});
|
|
1390
1399
|
}
|
|
1391
1400
|
itemKeyBoardSelect(event, item) {
|
|
@@ -1521,7 +1530,7 @@ const EzGridConfig = class {
|
|
|
1521
1530
|
}
|
|
1522
1531
|
buildColumnListSlot(item, group) {
|
|
1523
1532
|
const dataElementId = `configItem_${core.StringUtils.replaceAccentuatedChars(core.StringUtils.toCamelCase(item.label))}`;
|
|
1524
|
-
return (index$1.h("div", null, index$1.h("ez-check", { mode:
|
|
1533
|
+
return (index$1.h("div", null, index$1.h("ez-check", { mode: CheckMode.CheckMode.SWITCH, id: CheckMode.CheckMode.SWITCH + ((item === null || item === void 0 ? void 0 : item.label) || '') + ((group === null || group === void 0 ? void 0 : group.group) || ''), value: group.group === this.getMessage("snkGridConfig.group.visible"), "data-element-id": dataElementId, onEzChange: (evt) => { this.switchColumnGroup(evt, item); } })));
|
|
1525
1534
|
}
|
|
1526
1535
|
buildOrderListSlot(item) {
|
|
1527
1536
|
const dataElementId = `${this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${core.StringUtils.toCamelCase(item.label)}`;
|
|
@@ -1787,10 +1796,13 @@ const EzGridConfig = class {
|
|
|
1787
1796
|
}
|
|
1788
1797
|
}
|
|
1789
1798
|
compareWords(column, searchingText) {
|
|
1790
|
-
|
|
1791
|
-
|
|
1799
|
+
var _a, _b;
|
|
1800
|
+
const columnLabel = (_a = core.StringUtils.replaceAccentuatedChars(column === null || column === void 0 ? void 0 : column.label)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
1801
|
+
const argument = (_b = core.StringUtils.replaceAccentuatedChars(searchingText)) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
1802
|
+
if (core.StringUtils.isEmpty(columnLabel) || core.StringUtils.isEmpty(argument)) {
|
|
1803
|
+
return false;
|
|
1792
1804
|
}
|
|
1793
|
-
return
|
|
1805
|
+
return columnLabel.includes(argument);
|
|
1794
1806
|
}
|
|
1795
1807
|
getColumnNames() {
|
|
1796
1808
|
const listNames = [];
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-e103fb59.js');
|
|
9
9
|
|
|
10
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
11
11
|
|
|
@@ -8,8 +8,8 @@ const core = require('@sankhyalabs/core');
|
|
|
8
8
|
const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
9
9
|
const { format, email } = data || {};
|
|
10
10
|
return index.h("div", null,
|
|
11
|
-
index.h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`,
|
|
12
|
-
index.h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`,
|
|
11
|
+
index.h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, value: email === null || email === void 0 ? void 0 : email.to, onEzChange: evt => { var _a; return changeInfo("to", (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.trim()); } }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("sendTo")}` })),
|
|
12
|
+
index.h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, value: email === null || email === void 0 ? void 0 : email.subject, onEzChange: evt => { var _a; return changeInfo("subject", (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.trim()); } }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("subject")}` })),
|
|
13
13
|
index.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) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("message")}` })),
|
|
14
14
|
((email === null || email === void 0 ? void 0 : email.attachments) || [])
|
|
15
15
|
.map((file, index$1) => index.h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: `${file.name}.${format}`, fileSize: file.size, canRemove: false }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("fileItem_") + (index$1 + 1)}` }))));
|
|
@@ -101,8 +101,8 @@ const SnkExporterEmailSender = class {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
send() {
|
|
104
|
-
const { format, type, email } = this._config;
|
|
105
|
-
|
|
104
|
+
const { format, type, email, resolver } = this._config;
|
|
105
|
+
resolver({ format, type, email, report: undefined });
|
|
106
106
|
}
|
|
107
107
|
isFilled() {
|
|
108
108
|
var _a, _b;
|
|
@@ -246,6 +246,10 @@ const SnkTabConfig = class {
|
|
|
246
246
|
}
|
|
247
247
|
handleSaveEditionText(editDetails) {
|
|
248
248
|
const { value, newValue } = editDetails.detail;
|
|
249
|
+
if (value === newValue) {
|
|
250
|
+
this.cancelEditText();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
249
253
|
this._processedTabs.forEach((tab) => {
|
|
250
254
|
if (tab.label === value) {
|
|
251
255
|
tab.label = newValue;
|
|
@@ -99,10 +99,10 @@ function textButton(name, className, dataElementId, text, title, action, isEnabl
|
|
|
99
99
|
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
|
100
100
|
}
|
|
101
101
|
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
|
102
|
-
return index.h("ez-button", {
|
|
102
|
+
return index.h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
|
103
103
|
}
|
|
104
104
|
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
|
105
|
-
return index.h("ez-button", {
|
|
105
|
+
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
|
106
106
|
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
|
107
107
|
}
|
|
108
108
|
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
|
@@ -78,7 +78,7 @@ export class SnkConfigurator {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), h("ez-button", {
|
|
81
|
+
return (h("ez-modal", { opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage("snkConfigurator.titleConfigurations")), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigurator.subTitleModeConfig"), value: this.getViewModeValue(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelGrid"), value: GRID_MODE.name }), h("ez-radio-button-option", { label: this.getMessage("snkConfigurator.labelForm"), value: FORM_MODE.name })), h("ez-button", { label: this.viewMode === GRID_MODE.name
|
|
82
82
|
? this.getMessage("snkConfigurator.labelConfigGrid")
|
|
83
83
|
: this.getMessage("snkConfigurator.labelConfigForm"), class: "snk-configurator__button-config ez-button--primary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" })))));
|
|
84
84
|
}
|
package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js
CHANGED
|
@@ -2,6 +2,6 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
export const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
4
4
|
const { format, email } = data || {};
|
|
5
|
-
return h("div", null, h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`,
|
|
5
|
+
return h("div", null, h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, value: email === null || email === void 0 ? void 0 : email.to, onEzChange: evt => { var _a; return changeInfo("to", (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.trim()); } }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("sendTo")}` })), h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, value: email === null || email === void 0 ? void 0 : email.subject, onEzChange: evt => { var _a; return changeInfo("subject", (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.trim()); } }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("subject")}` })), 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")}` })), ((email === null || email === void 0 ? void 0 : email.attachments) || [])
|
|
6
6
|
.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)}` }))));
|
|
7
7
|
};
|
|
@@ -65,8 +65,8 @@ export class SnkExporterEmailSender {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
send() {
|
|
68
|
-
const { format, type, email } = this._config;
|
|
69
|
-
|
|
68
|
+
const { format, type, email, resolver } = this._config;
|
|
69
|
+
resolver({ format, type, email, report: undefined });
|
|
70
70
|
}
|
|
71
71
|
isFilled() {
|
|
72
72
|
var _a, _b;
|
|
@@ -34,17 +34,17 @@ export class SnkDataExporter {
|
|
|
34
34
|
attachments: [
|
|
35
35
|
{ name: this._appLabel }
|
|
36
36
|
]
|
|
37
|
+
},
|
|
38
|
+
resolver: ({ type, format, email: { to, subject, message } }) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
41
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
42
|
+
this._snkEmailSender.close();
|
|
43
|
+
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
44
|
+
});
|
|
37
45
|
}
|
|
38
46
|
};
|
|
39
|
-
this._snkEmailSender.open(config)
|
|
40
|
-
.then(({ format, email: { to, subject, message } }) => {
|
|
41
|
-
var _a;
|
|
42
|
-
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
|
43
|
-
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
44
|
-
this._snkEmailSender.close();
|
|
45
|
-
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
46
|
-
});
|
|
47
|
-
});
|
|
47
|
+
this._snkEmailSender.open(config);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -101,11 +101,14 @@ export class SnkDataExporter {
|
|
|
101
101
|
columns,
|
|
102
102
|
sort,
|
|
103
103
|
resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
|
|
104
|
-
if (currentPageOptions.includes(option)) {
|
|
104
|
+
if (currentPageOptions.includes(option) || resolveProps.type == "page") {
|
|
105
105
|
const offset = this.provider.getOffset();
|
|
106
106
|
const limit = this.provider.getLimit();
|
|
107
107
|
params = Object.assign(Object.assign({}, params), { offset,
|
|
108
|
-
limit });
|
|
108
|
+
limit, selectedIDs: [] });
|
|
109
|
+
}
|
|
110
|
+
else if (resolveProps.type == "all") {
|
|
111
|
+
params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
|
|
109
112
|
}
|
|
110
113
|
fetchDataExporter(params)
|
|
111
114
|
.then((result) => callbackResolver(result))
|
|
@@ -132,7 +135,6 @@ export class SnkDataExporter {
|
|
|
132
135
|
this.resolveExporter(params, (response) => {
|
|
133
136
|
fileViewer(Object.assign(Object.assign({}, response), { fileType,
|
|
134
137
|
isDownload }));
|
|
135
|
-
ApplicationUtils.info(this.getMessage("snkDataExporter.message.exportSuccess"), { iconName: "check" });
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
async processExporter(evt) {
|
|
@@ -35,7 +35,7 @@ export class SnkFilterModal {
|
|
|
35
35
|
}
|
|
36
36
|
buildItems(list) {
|
|
37
37
|
return list.map(item => {
|
|
38
|
-
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex:
|
|
38
|
+
return (h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { id: `checkbox_${item.id}`, tabIndex: -1, class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: CheckMode.SWITCH }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
itemKeyBoardSelect(event, item) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
2
|
import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
3
4
|
import FilterItemType from './filter-item/filter-item-type.enum';
|
|
4
5
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
5
6
|
import buildFilter from './filter-item/dataunitfilter/data-unit-filter-builder';
|
|
@@ -374,7 +375,7 @@ export class SnkFilterBar {
|
|
|
374
375
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
|
375
376
|
return undefined;
|
|
376
377
|
}
|
|
377
|
-
return (h(Host, null, h("ez-scroller", { direction:
|
|
378
|
+
return (h(Host, null, h("ez-scroller", { direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), h("snk-filter-list", { id: APPLIED_FILTERS, onFocusin: () => this.itemFocused(APPLIED_FILTERS), items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail), "data-element-id": "apppliedFilters" }), h("snk-filter-list", { id: ADD_FILTER, onFocusin: () => this.itemFocused(ADD_FILTER), items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail), "data-element-id": "addFilters" }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
|
|
378
379
|
}
|
|
379
380
|
static get is() { return "snk-filter-bar"; }
|
|
380
381
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
--snk-field-config__input--border-color: var(--background--xlight, #fff);
|
|
28
28
|
/*@doc Define no modo normal a borda com a mesma cor do bg.*/
|
|
29
29
|
--snk-field-config__required--color: var(--color--error, #FF0000);
|
|
30
|
-
/*@doc Define espeçamento
|
|
31
|
-
--snk-field-
|
|
30
|
+
/*@doc Define o espeçamento entre os elementos internos do label.*/
|
|
31
|
+
--snk-field-config__label--gap: var(--space--extra-small, 3px);
|
|
32
32
|
/*@doc Define o efeito de visualização do componente.*/
|
|
33
33
|
--snk-field-config__transition--visibility: var(--transition, 0.2s linear);
|
|
34
34
|
/*@doc Define o efeito de opacidade do componente.*/
|
|
@@ -81,10 +81,35 @@
|
|
|
81
81
|
z-index: var(--snk-field-config__config-popover--z-index);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.field-
|
|
84
|
+
.field-config__label {
|
|
85
|
+
/*private*/
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: row-reverse;
|
|
88
|
+
|
|
89
|
+
/*public*/
|
|
90
|
+
line-height: calc(var(--snk-field-config--font-size) + 2px);
|
|
91
|
+
gap: var(--snk-field-config__label--gap);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.field-config__label-text {
|
|
95
|
+
/*private*/
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
-webkit-hyphens: auto;
|
|
98
|
+
-ms-hyphens: auto;
|
|
99
|
+
hyphens: auto;
|
|
100
|
+
height: auto;
|
|
101
|
+
-webkit-box-orient: vertical;
|
|
102
|
+
-webkit-line-clamp: 2;
|
|
103
|
+
line-clamp: 2;
|
|
104
|
+
display: -webkit-box;
|
|
105
|
+
-o-text-overflow: ellipsis;
|
|
106
|
+
text-overflow: ellipsis;
|
|
107
|
+
word-break: break-word;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.field-config__label-required {
|
|
85
111
|
/*public*/
|
|
86
112
|
color: var(--snk-field-config__required--color);
|
|
87
|
-
padding-left: var(--snk-field-config__required--padding-left);
|
|
88
113
|
}
|
|
89
114
|
|
|
90
115
|
.field-config__add {
|
|
@@ -184,4 +209,11 @@ ez-popover {
|
|
|
184
209
|
--snk-button--background-color: transparent;
|
|
185
210
|
--snk-button--focus--border: none;
|
|
186
211
|
--snk-button--focus--box-shadow: none;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media screen and (min-width: 1200px) {
|
|
215
|
+
.field-config__label {
|
|
216
|
+
/*private*/
|
|
217
|
+
flex-direction: row;
|
|
218
|
+
}
|
|
187
219
|
}
|
package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js
CHANGED
|
@@ -3,6 +3,7 @@ import { h, Host } from "@stencil/core";
|
|
|
3
3
|
import { ACTION_CONFIG } from "../../../../lib/utils/constants";
|
|
4
4
|
export class SnkFieldConfig {
|
|
5
5
|
constructor() {
|
|
6
|
+
this._lang = "pt"; // Controla qual idioma será usado para definir a regras de hifenização.
|
|
6
7
|
this.isConfigActive = false;
|
|
7
8
|
this.fieldConfig = undefined;
|
|
8
9
|
this.modeInsertion = true;
|
|
@@ -41,7 +42,7 @@ export class SnkFieldConfig {
|
|
|
41
42
|
if (this.fieldConfig == undefined) {
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
|
-
return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div",
|
|
45
|
+
return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", { class: "field-config__label" }, h("span", { class: "field-config__label-text", lang: this._lang, title: this.fieldConfig.label }, this.fieldConfig.label), this.isRequired() && h("span", { class: "field-config__label-required" }, "*")), this.modeInsertion ?
|
|
45
46
|
h("div", { class: "field-config__add" }, h("ez-button", { onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
|
|
46
47
|
h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && h("div", { class: "field-config__config-popover" }, h("div", { class: "field-config__config-outer-arrow" }, h("div", { class: "field-config__config-inner-arrow" })))));
|
|
47
48
|
}
|
|
@@ -231,6 +231,10 @@ export class SnkTabConfig {
|
|
|
231
231
|
}
|
|
232
232
|
handleSaveEditionText(editDetails) {
|
|
233
233
|
const { value, newValue } = editDetails.detail;
|
|
234
|
+
if (value === newValue) {
|
|
235
|
+
this.cancelEditText();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
234
238
|
this._processedTabs.forEach((tab) => {
|
|
235
239
|
if (tab.label === value) {
|
|
236
240
|
tab.label = newValue;
|