@sankhyalabs/sankhyablocks 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AuthorizationConfig-79ffae4b.js +7 -0
- package/dist/cjs/{SnkMessageBuilder-09b25b0a.js → SnkMessageBuilder-248b5105.js} +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +15 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +6 -38
- package/dist/cjs/{snk-data-exporter_9.cjs.entry.js → snk-data-exporter_8.cjs.entry.js} +83 -155
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +129 -0
- package/dist/collection/components/snk-application/snk-application.js +30 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js +3 -2
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +29 -6
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +49 -31
- package/dist/collection/components/snk-grid/snk-grid.js +1 -43
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.js +7 -0
- package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +7 -0
- package/dist/components/SnkMessageBuilder.js +7 -0
- package/dist/components/snk-application2.js +16 -1
- package/dist/components/snk-data-exporter2.js +58 -17
- package/dist/components/snk-exporter-email-sender2.js +18 -13
- package/dist/components/snk-form2.js +10 -4
- package/dist/components/snk-grid2.js +3 -35
- package/dist/components/snk-taskbar2.js +8 -2
- package/dist/esm/AuthorizationConfig-dcbd207a.js +7 -0
- package/dist/esm/{SnkMessageBuilder-47db5d75.js → SnkMessageBuilder-4a060599.js} +7 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +15 -1
- package/dist/esm/snk-configurator_3.entry.js +2 -34
- package/dist/esm/{snk-data-exporter_9.entry.js → snk-data-exporter_8.entry.js} +64 -135
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-exporter-email-sender.entry.js +125 -0
- package/dist/sankhyablocks/{p-d96bf6a7.entry.js → p-3480f2fa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f8fdd16c.entry.js → p-43eff4d3.entry.js} +5 -5
- package/dist/sankhyablocks/p-48d7ba04.entry.js +1 -0
- package/dist/sankhyablocks/p-97347faf.entry.js +1 -0
- package/dist/sankhyablocks/p-dc36cfbf.js +1 -0
- package/dist/sankhyablocks/p-f5246cd6.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d7a0daf.js → p-f624979d.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/data/export-config.d.ts +1 -1
- package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +2 -2
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +5 -5
- package/dist/types/components.d.ts +5 -8
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/permission-export-pdf.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/data-exporter-option-417da37a.js +0 -19
- package/dist/esm/data-exporter-option-006307dd.js +0 -19
- package/dist/sankhyablocks/p-04581d0c.entry.js +0 -1
- package/dist/sankhyablocks/p-50c8bcb7.entry.js +0 -1
- package/dist/sankhyablocks/p-719e570a.js +0 -1
|
@@ -242,6 +242,13 @@ const snkDataExporterMessages = {
|
|
|
242
242
|
spreadsheet: "Planilha",
|
|
243
243
|
cube: "Cubo",
|
|
244
244
|
sendByEmail: "Enviar por email",
|
|
245
|
+
},
|
|
246
|
+
message: {
|
|
247
|
+
emailSuccess: "E-mail enviado com sucesso",
|
|
248
|
+
exportError: "Erro ao realizar a exportação",
|
|
249
|
+
},
|
|
250
|
+
title: {
|
|
251
|
+
error: "Erro",
|
|
245
252
|
}
|
|
246
253
|
};
|
|
247
254
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}
|
|
17
|
+
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud.cjs",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}
|
|
18
|
+
return index.bootstrapLazy([["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select.cjs",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized.cjs",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options.cjs",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config.cjs",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config.cjs",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender.cjs",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud.cjs",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"enableDataExporter":[4,"enable-data-exporter"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
19
19
|
});
|
|
@@ -6,7 +6,7 @@ const index = require('./index-2cd6f753.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
9
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
9
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-248b5105.js');
|
|
10
10
|
require('./_commonjsHelpers-537d719a.js');
|
|
11
11
|
|
|
12
12
|
class SnkErrorHandler {
|
|
@@ -1221,6 +1221,20 @@ const SnkApplication = class {
|
|
|
1221
1221
|
accept(window['isDebugMode']);
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Obtém o nome das telas da aplicação
|
|
1226
|
+
*/
|
|
1227
|
+
async getAppLabel() {
|
|
1228
|
+
if ((window === null || window === void 0 ? void 0 : window["workspace"]) == undefined) {
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
if (window["workspace"].getAppLabel == undefined) {
|
|
1232
|
+
window["workspace"].getAppLabel = (resourceID) => {
|
|
1233
|
+
return (resourceID || "").split(".").pop();
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
return window["workspace"].getAppLabel(this._resourceID);
|
|
1237
|
+
}
|
|
1224
1238
|
clearContent(container) {
|
|
1225
1239
|
if (container) {
|
|
1226
1240
|
Array.from(container.children).forEach(child => {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const constants = require('./constants-a47a5190.js');
|
|
8
|
-
const
|
|
8
|
+
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
9
9
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
10
10
|
const taskbarProcessor = require('./taskbar-processor-6f3d2a75.js');
|
|
11
11
|
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
@@ -52,23 +52,23 @@ const SnkConfigurator = class {
|
|
|
52
52
|
this.openConfig.emit(this.viewMode);
|
|
53
53
|
}
|
|
54
54
|
isAllowed(configName) {
|
|
55
|
-
if (
|
|
55
|
+
if (AuthorizationConfig.AuthorizationConfig[configName]) {
|
|
56
56
|
return this._permissions ? this._permissions.isSup || this._permissions[configName] : false;
|
|
57
57
|
}
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
60
|
enableModeConfig() {
|
|
61
|
-
if (!this.isAllowed(
|
|
61
|
+
if (!this.isAllowed(AuthorizationConfig.AuthorizationConfig.CONFIG_GRID) || !this.isAllowed(AuthorizationConfig.AuthorizationConfig.CONFIG)) {
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
66
|
getViewModeValue() {
|
|
67
67
|
if (this._permissions != undefined) {
|
|
68
|
-
if (!this.isAllowed(
|
|
68
|
+
if (!this.isAllowed(AuthorizationConfig.AuthorizationConfig.CONFIG_GRID)) {
|
|
69
69
|
this.viewMode = FORM_MODE.name;
|
|
70
70
|
}
|
|
71
|
-
else if (!this.isAllowed(
|
|
71
|
+
else if (!this.isAllowed(AuthorizationConfig.AuthorizationConfig.CONFIG)) {
|
|
72
72
|
this.viewMode = GRID_MODE.name;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -201,38 +201,6 @@ const SnkGrid = class {
|
|
|
201
201
|
async setConfig(config) {
|
|
202
202
|
this.setGridConfig(config);
|
|
203
203
|
}
|
|
204
|
-
ezClickDataExporterHandler(event) {
|
|
205
|
-
var _a;
|
|
206
|
-
if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.id) === dataExporterOption.DataExporterOption.EXPORT_BY_EMAIL) {
|
|
207
|
-
// TODO: Quando o exportador de grades for implementado, essa ação
|
|
208
|
-
// vai fazer mostrar as opções disponíveis. Enviar por email será
|
|
209
|
-
// apenas mais uma
|
|
210
|
-
const selectedRows = this._dataState.selectedRecords.length;
|
|
211
|
-
const config = {
|
|
212
|
-
format: "pdf",
|
|
213
|
-
type: selectedRows > 0 ? "selection" : "all",
|
|
214
|
-
selectedRows,
|
|
215
|
-
email: {
|
|
216
|
-
attachments: [
|
|
217
|
-
{ name: "Movimentação Financeira.pdf", size: 1024 * 231 }
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
this._snkEmailSender.open(config)
|
|
222
|
-
.then((result) => {
|
|
223
|
-
this._application.message("resultado", JSON.stringify(result));
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
229
|
-
* através de um pequeno modulo na estrutura da aplicação:
|
|
230
|
-
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
231
|
-
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-grid.msg.ts"
|
|
232
|
-
*/
|
|
233
|
-
getMessage(key, params) {
|
|
234
|
-
return this._application.messagesBuilder.getMessage(key, params);
|
|
235
|
-
}
|
|
236
204
|
openGridConfig() {
|
|
237
205
|
this._grid.getColumnsState()
|
|
238
206
|
.then((gridColumns) => {
|
|
@@ -367,7 +335,7 @@ const SnkGrid = class {
|
|
|
367
335
|
if (!this._dataUnit) {
|
|
368
336
|
return undefined;
|
|
369
337
|
}
|
|
370
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, index.h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("
|
|
338
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, index.h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, index.h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
371
339
|
}
|
|
372
340
|
get _element() { return index.getElement(this); }
|
|
373
341
|
};
|
|
@@ -4,17 +4,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const
|
|
7
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const ConfigStorage = require('./ConfigStorage-91953f29.js');
|
|
9
9
|
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
|
10
10
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
|
11
11
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
12
|
-
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
13
12
|
const constants = require('./constants-a47a5190.js');
|
|
13
|
+
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
|
14
14
|
const taskbarElements = require('./taskbar-elements-bbb89cdb.js');
|
|
15
15
|
require('./_commonjsHelpers-537d719a.js');
|
|
16
16
|
require('./index-696b5c3b.js');
|
|
17
17
|
|
|
18
|
+
var DataExporterOption;
|
|
19
|
+
(function (DataExporterOption) {
|
|
20
|
+
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
|
21
|
+
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
|
22
|
+
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
|
23
|
+
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
|
24
|
+
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
|
25
|
+
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
|
26
|
+
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
|
27
|
+
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
|
28
|
+
})(DataExporterOption || (DataExporterOption = {}));
|
|
29
|
+
|
|
18
30
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
19
31
|
var t = {};
|
|
20
32
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -63,10 +75,10 @@ class ItemBuilder {
|
|
|
63
75
|
*/
|
|
64
76
|
setExportOption(option, items) {
|
|
65
77
|
const groupName = this.getExportGroupName();
|
|
66
|
-
if (option ===
|
|
78
|
+
if (option === DataExporterOption.EXPORT_TO_PDF) {
|
|
67
79
|
items.push(this.getExportToPDF(groupName));
|
|
68
80
|
}
|
|
69
|
-
if (option ===
|
|
81
|
+
if (option === DataExporterOption.EXPORT_TO_XLS) {
|
|
70
82
|
items.push(this.getExportToXLS(groupName));
|
|
71
83
|
}
|
|
72
84
|
this.setExportCurrentPage(option, items);
|
|
@@ -79,23 +91,23 @@ class ItemBuilder {
|
|
|
79
91
|
*/
|
|
80
92
|
setExportCurrentPage(option, items) {
|
|
81
93
|
var _a;
|
|
82
|
-
const pageOptions = [
|
|
83
|
-
if (option ===
|
|
94
|
+
const pageOptions = [DataExporterOption.EXPORT_PAGE_TO_PDF, DataExporterOption.EXPORT_PAGE_TO_XLS];
|
|
95
|
+
if (option === DataExporterOption.EXPORT_CURRENT_PAGE) {
|
|
84
96
|
items.push(this.getCurrentPage());
|
|
85
97
|
}
|
|
86
98
|
if (pageOptions.includes(option)) {
|
|
87
|
-
let item = items.find((item) => item.id ===
|
|
99
|
+
let item = items.find((item) => item.id === DataExporterOption.EXPORT_CURRENT_PAGE);
|
|
88
100
|
if (item == undefined) {
|
|
89
101
|
items.push(this.getCurrentPage());
|
|
90
|
-
item = items.find((item) => item.id ===
|
|
102
|
+
item = items.find((item) => item.id === DataExporterOption.EXPORT_CURRENT_PAGE);
|
|
91
103
|
}
|
|
92
104
|
if (!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
93
105
|
item.children = [];
|
|
94
106
|
}
|
|
95
|
-
if (option ===
|
|
107
|
+
if (option === DataExporterOption.EXPORT_PAGE_TO_PDF) {
|
|
96
108
|
item.children.push(this.getExportPageToPDF());
|
|
97
109
|
}
|
|
98
|
-
if (option ===
|
|
110
|
+
if (option === DataExporterOption.EXPORT_PAGE_TO_XLS) {
|
|
99
111
|
item.children.push(this.getExportPageToXLS());
|
|
100
112
|
}
|
|
101
113
|
}
|
|
@@ -106,7 +118,7 @@ class ItemBuilder {
|
|
|
106
118
|
* @param items - Array que será alimentado com as opções permitidas.
|
|
107
119
|
*/
|
|
108
120
|
setExportByEmail(option, items) {
|
|
109
|
-
if (option ===
|
|
121
|
+
if (option === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
110
122
|
items.push(this.getExportByEmail());
|
|
111
123
|
}
|
|
112
124
|
}
|
|
@@ -117,7 +129,7 @@ class ItemBuilder {
|
|
|
117
129
|
*/
|
|
118
130
|
getExportToPDF(groupName) {
|
|
119
131
|
return {
|
|
120
|
-
id:
|
|
132
|
+
id: DataExporterOption.EXPORT_TO_PDF,
|
|
121
133
|
label: "PDF (.pdf)",
|
|
122
134
|
group: groupName
|
|
123
135
|
};
|
|
@@ -129,7 +141,7 @@ class ItemBuilder {
|
|
|
129
141
|
*/
|
|
130
142
|
getExportToXLS(groupName) {
|
|
131
143
|
return {
|
|
132
|
-
id:
|
|
144
|
+
id: DataExporterOption.EXPORT_TO_XLS,
|
|
133
145
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,
|
|
134
146
|
group: groupName
|
|
135
147
|
};
|
|
@@ -140,7 +152,7 @@ class ItemBuilder {
|
|
|
140
152
|
*/
|
|
141
153
|
getCurrentPage() {
|
|
142
154
|
return {
|
|
143
|
-
id:
|
|
155
|
+
id: DataExporterOption.EXPORT_CURRENT_PAGE,
|
|
144
156
|
label: this._getMessage("snkDataExporter.label.currentPage"),
|
|
145
157
|
group: this._getMessage("snkDataExporter.group.custom")
|
|
146
158
|
};
|
|
@@ -151,7 +163,7 @@ class ItemBuilder {
|
|
|
151
163
|
*/
|
|
152
164
|
getExportPageToPDF() {
|
|
153
165
|
return {
|
|
154
|
-
id:
|
|
166
|
+
id: DataExporterOption.EXPORT_PAGE_TO_PDF,
|
|
155
167
|
label: "PDF (.pdf)"
|
|
156
168
|
};
|
|
157
169
|
}
|
|
@@ -161,7 +173,7 @@ class ItemBuilder {
|
|
|
161
173
|
*/
|
|
162
174
|
getExportPageToXLS() {
|
|
163
175
|
return {
|
|
164
|
-
id:
|
|
176
|
+
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
|
165
177
|
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`
|
|
166
178
|
};
|
|
167
179
|
}
|
|
@@ -171,7 +183,7 @@ class ItemBuilder {
|
|
|
171
183
|
*/
|
|
172
184
|
getExportByEmail() {
|
|
173
185
|
return {
|
|
174
|
-
id:
|
|
186
|
+
id: DataExporterOption.EXPORT_BY_EMAIL,
|
|
175
187
|
label: `${this._getMessage("snkDataExporter.label.sendByEmail")}...`
|
|
176
188
|
};
|
|
177
189
|
}
|
|
@@ -195,21 +207,46 @@ const snkDataExporterCss = ".sc-snk-data-exporter-h{--snk-data-exporter--z-index
|
|
|
195
207
|
const SnkDataExporter = class {
|
|
196
208
|
constructor(hostRef) {
|
|
197
209
|
index.registerInstance(this, hostRef);
|
|
198
|
-
this.ezClickDataExporter = index.createEvent(this, "ezClickDataExporter", 7);
|
|
199
210
|
this._items = [];
|
|
200
211
|
this._selectedNumber = 0;
|
|
201
212
|
this._showDropdown = false;
|
|
202
213
|
this._releasedToExport = [
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
DataExporterOption.EXPORT_TO_PDF,
|
|
215
|
+
DataExporterOption.EXPORT_BY_EMAIL,
|
|
216
|
+
DataExporterOption.EXPORT_PDF_TO_EMAIL,
|
|
217
|
+
DataExporterOption.EXPORT_XLS_TO_EMAIL
|
|
207
218
|
];
|
|
208
219
|
/**
|
|
209
220
|
* Provedor das informações para exportação dos dados.
|
|
210
221
|
*/
|
|
211
222
|
this.provider = null;
|
|
212
223
|
}
|
|
224
|
+
async exportByEmail() {
|
|
225
|
+
const selectedRows = this._selectedNumber;
|
|
226
|
+
const config = {
|
|
227
|
+
type: selectedRows > 0 ? "selection" : "all",
|
|
228
|
+
selectedRows,
|
|
229
|
+
email: {
|
|
230
|
+
attachments: [
|
|
231
|
+
{ name: this._appLabel }
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
this._snkEmailSender.open(config)
|
|
236
|
+
.then(({ format, email: { to, subject, message } }) => {
|
|
237
|
+
const methodName = this.getFormatExporter(format);
|
|
238
|
+
this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
|
|
239
|
+
this._snkEmailSender.close();
|
|
240
|
+
utils.ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
getFormatExporter(format) {
|
|
245
|
+
if (format === "xlsx") {
|
|
246
|
+
return DataExporterOption.EXPORT_XLS_TO_EMAIL;
|
|
247
|
+
}
|
|
248
|
+
return DataExporterOption.EXPORT_PDF_TO_EMAIL;
|
|
249
|
+
}
|
|
213
250
|
/**
|
|
214
251
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
215
252
|
* através de um pequeno modulo na estrutura da aplicação:
|
|
@@ -246,24 +283,32 @@ const SnkDataExporter = class {
|
|
|
246
283
|
controlDropdown() {
|
|
247
284
|
this._showDropdown = !this._showDropdown;
|
|
248
285
|
}
|
|
286
|
+
resolveExporter(resolveProps, callbackResolver) {
|
|
287
|
+
if (this.provider == undefined) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const filters = this.provider.getFilters();
|
|
291
|
+
const columns = this.provider.getColumnsMetadata();
|
|
292
|
+
const sort = this.provider.getOrders();
|
|
293
|
+
const resourceURI = this.provider.getResourceURI();
|
|
294
|
+
fetchDataExporter(Object.assign({ filters,
|
|
295
|
+
columns,
|
|
296
|
+
sort,
|
|
297
|
+
resourceURI }, resolveProps))
|
|
298
|
+
.then((result) => callbackResolver(result))
|
|
299
|
+
.catch(() => utils.ApplicationUtils.error(this.getMessage("snkDataExporter.title.error"), this.getMessage("snkDataExporter.message.exportError")));
|
|
300
|
+
}
|
|
249
301
|
async processExporter(evt) {
|
|
250
302
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
251
303
|
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
252
304
|
return;
|
|
253
305
|
}
|
|
254
|
-
if (item.id
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const columns = this.provider.getColumnsMetadata();
|
|
260
|
-
const sort = this.provider.getOrders();
|
|
261
|
-
const resourceURI = this.provider.getResourceURI();
|
|
262
|
-
fetchDataExporter({ filters, columns, sort, resourceURI, methodName: item.id })
|
|
263
|
-
.then((response) => fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" })))
|
|
264
|
-
.catch(err => console.log(err));
|
|
306
|
+
if (item.id === DataExporterOption.EXPORT_BY_EMAIL) {
|
|
307
|
+
this.exportByEmail();
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.resolveExporter({ methodName: item.id, fileName: this._appLabel, titleGrid: this._appLabel }, (response) => (fileViewer(Object.assign(Object.assign({}, response), { fileType: "PDF" }))));
|
|
265
311
|
}
|
|
266
|
-
this.ezClickDataExporter.emit(item);
|
|
267
312
|
this._showDropdown = false;
|
|
268
313
|
}
|
|
269
314
|
getItems() {
|
|
@@ -282,6 +327,7 @@ const SnkDataExporter = class {
|
|
|
282
327
|
}
|
|
283
328
|
componentWillLoad() {
|
|
284
329
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
330
|
+
this._application.getAppLabel().then(result => this._appLabel = result);
|
|
285
331
|
this.loadDropdown();
|
|
286
332
|
this.setEvents();
|
|
287
333
|
}
|
|
@@ -304,129 +350,12 @@ const SnkDataExporter = class {
|
|
|
304
350
|
render() {
|
|
305
351
|
return (index.h(index.Host, null, index.h("div", { class: "snk-data-exporter" }, index.h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", onClick: () => this.controlDropdown() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("button")}` })), this._showDropdown &&
|
|
306
352
|
index.h("ez-dropdown", Object.assign({ ref: (ref) => this._ezDropdown = ref, items: this._items, onEzClick: (evt) => this.processExporter(evt) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("dropdown")}` }))), this._showDropdown &&
|
|
307
|
-
index.h("div", Object.assign({ class: "ez-scrim ez-scrim-light" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("ezScrim")}` }))));
|
|
353
|
+
index.h("div", Object.assign({ class: "ez-scrim ez-scrim-light" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("ezScrim")}` })), index.h("snk-exporter-email-sender", { ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) })));
|
|
308
354
|
}
|
|
309
355
|
get _element() { return index.getElement(this); }
|
|
310
356
|
};
|
|
311
357
|
SnkDataExporter.style = snkDataExporterCss;
|
|
312
358
|
|
|
313
|
-
const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
|
|
314
|
-
return index.h("div", null,
|
|
315
|
-
index.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) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("sendTo")}` })),
|
|
316
|
-
index.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) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("subject")}` })),
|
|
317
|
-
index.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) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("message")}` })),
|
|
318
|
-
((data === null || data === void 0 ? void 0 : data.attachments) || [])
|
|
319
|
-
.map((file, index$1) => index.h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: file.name, fileSize: file.size, canRemove: false }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("fileItem_") + (index$1 + 1)}` }))));
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
323
|
-
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
|
324
|
-
const formatOptions = [
|
|
325
|
-
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
|
326
|
-
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLSX"), value: "xlsx" }
|
|
327
|
-
];
|
|
328
|
-
const typeOptions = [
|
|
329
|
-
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
|
330
|
-
{ label: getMessage("snkExporter.emailSenderOptStep_currentPage"), value: "page" },
|
|
331
|
-
];
|
|
332
|
-
if (selectionCount > 0) {
|
|
333
|
-
const label = getMessage(selectionCount > 1 ? "snkExporter.emailSenderOptStep_someRecords" : "snkExporter.emailSenderOptStep_oneRecord", { SELECTION_COUNT: selectionCount });
|
|
334
|
-
typeOptions.push({
|
|
335
|
-
label,
|
|
336
|
-
value: "selection"
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
return index.h("div", null,
|
|
340
|
-
index.h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.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 })),
|
|
341
|
-
index.h("ez-radio-button", Object.assign({ class: "ez-margin-bottom--large" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.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 })));
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
const SnkExporterEmailSender = class {
|
|
345
|
-
constructor(hostRef) {
|
|
346
|
-
index.registerInstance(this, hostRef);
|
|
347
|
-
this._stepInfo = [
|
|
348
|
-
{
|
|
349
|
-
subTitle: "snkExporter.emailSenderOptStep_subtitle",
|
|
350
|
-
firstButton: "snkExporter.emailSenderCancelButton",
|
|
351
|
-
secondButton: "snkExporter.emailSenderNextButton",
|
|
352
|
-
firstButtonAction: () => this.close(),
|
|
353
|
-
secondButtonAction: () => this.changeStep(1)
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
subTitle: "snkExporter.emailSenderInfoStep_subtitle",
|
|
357
|
-
firstButton: "snkExporter.emailSenderBackButton",
|
|
358
|
-
secondButton: "snkExporter.emailSenderSendButton",
|
|
359
|
-
firstButtonAction: () => this.changeStep(0),
|
|
360
|
-
secondButtonAction: () => this.send(),
|
|
361
|
-
secondButtonEnabledTester: () => this.isFilled(),
|
|
362
|
-
secondButtonClass: "ez-button--primary"
|
|
363
|
-
}
|
|
364
|
-
];
|
|
365
|
-
this._opened = false;
|
|
366
|
-
this._currentStep = 0;
|
|
367
|
-
}
|
|
368
|
-
open(config) {
|
|
369
|
-
this._config = config;
|
|
370
|
-
this._opened = true;
|
|
371
|
-
this.changeStep(0);
|
|
372
|
-
return new Promise(accept => {
|
|
373
|
-
this._promiseResolver = accept;
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
getStepMessage(key) {
|
|
377
|
-
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
378
|
-
return this.getMessage(stepInfo[key]);
|
|
379
|
-
}
|
|
380
|
-
executeButtonAction(first) {
|
|
381
|
-
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
382
|
-
stepInfo[first ? "firstButtonAction" : "secondButtonAction"]();
|
|
383
|
-
}
|
|
384
|
-
checkButtonEnabled(first) {
|
|
385
|
-
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
386
|
-
const testFunction = stepInfo[first ? "firstButtonEnabledTester" : "secondButtonEnabledTester"];
|
|
387
|
-
if (testFunction) {
|
|
388
|
-
return testFunction();
|
|
389
|
-
}
|
|
390
|
-
return true;
|
|
391
|
-
}
|
|
392
|
-
changeStep(index) {
|
|
393
|
-
this._currentStep = index;
|
|
394
|
-
if (this._viewStack) {
|
|
395
|
-
this._viewStack.show(this._currentStep);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
send() {
|
|
399
|
-
const { format, type, email } = this._config;
|
|
400
|
-
this._promiseResolver({ format, type, email, report: undefined });
|
|
401
|
-
}
|
|
402
|
-
close() {
|
|
403
|
-
this._opened = false;
|
|
404
|
-
}
|
|
405
|
-
isFilled() {
|
|
406
|
-
var _a, _b;
|
|
407
|
-
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;
|
|
408
|
-
}
|
|
409
|
-
updateEmailInfo(field, value) {
|
|
410
|
-
this._config = Object.assign(Object.assign({}, this._config), { email: Object.assign(Object.assign({}, this._config.email), { [field]: value }) });
|
|
411
|
-
}
|
|
412
|
-
updateConfigInfo(field, value) {
|
|
413
|
-
this._config = Object.assign(Object.assign({}, this._config), { [field]: value });
|
|
414
|
-
}
|
|
415
|
-
getSecondButtonClass() {
|
|
416
|
-
const stepInfo = this._stepInfo[this._currentStep] || {};
|
|
417
|
-
return stepInfo["secondButtonClass"] || "ez-button--secondary";
|
|
418
|
-
}
|
|
419
|
-
render() {
|
|
420
|
-
var _a;
|
|
421
|
-
core.ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkExporterEmailSender');
|
|
422
|
-
return (index.h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, index.h("ez-modal-container", { onEzModalAction: evt => {
|
|
423
|
-
if (evt.detail === "CLOSE")
|
|
424
|
-
this.close();
|
|
425
|
-
}, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, index.h("ez-view-stack", { ref: ref => this._viewStack = ref }, index.h("stack-item", null, index.h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), index.h("stack-item", null, index.h(EmailInfoStep, { getMessage: this.getMessage, data: (_a = this._config) === null || _a === void 0 ? void 0 : _a.email, changeInfo: (field, value) => this.updateEmailInfo(field, value) }))), index.h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, index.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) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("firstButton")}` })), index.h("ez-button", Object.assign({ class: this.getSecondButtonClass(), label: this.getStepMessage("secondButton"), onClick: () => this.executeButtonAction(false), enabled: this.checkButtonEnabled(false) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("secondButton")}` }))))));
|
|
426
|
-
}
|
|
427
|
-
get _element() { return index.getElement(this); }
|
|
428
|
-
};
|
|
429
|
-
|
|
430
359
|
const buildFilter = (item) => {
|
|
431
360
|
switch (item.type) {
|
|
432
361
|
case filterItemType_enum.FilterItemType.DEFAULT_FILTER:
|
|
@@ -1835,8 +1764,8 @@ const SnkTaskbar = class {
|
|
|
1835
1764
|
if (buttonName === taskbarElements.AuthorizationElements.CONFIGURATOR) {
|
|
1836
1765
|
return this._permissions
|
|
1837
1766
|
? this._permissions.isSup
|
|
1838
|
-
|| this._permissions[
|
|
1839
|
-
|| this._permissions[
|
|
1767
|
+
|| this._permissions[AuthorizationConfig.AuthorizationConfig.CONFIG_GRID]
|
|
1768
|
+
|| this._permissions[AuthorizationConfig.AuthorizationConfig.CONFIG]
|
|
1840
1769
|
: false;
|
|
1841
1770
|
}
|
|
1842
1771
|
if (taskbarElements.AuthorizationElements[buttonName]) {
|
|
@@ -1982,7 +1911,6 @@ const SnkTaskbar = class {
|
|
|
1982
1911
|
SnkTaskbar.style = snkTaskbarCss;
|
|
1983
1912
|
|
|
1984
1913
|
exports.snk_data_exporter = SnkDataExporter;
|
|
1985
|
-
exports.snk_exporter_email_sender = SnkExporterEmailSender;
|
|
1986
1914
|
exports.snk_filter_bar = SnkFilterBar;
|
|
1987
1915
|
exports.snk_filter_item = SnkFilterItem;
|
|
1988
1916
|
exports.snk_filter_list = SnkFilterList;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2cd6f753.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-248b5105.js');
|
|
9
9
|
|
|
10
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
11
11
|
|