@sankhyalabs/sankhyablocks 3.2.1 → 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.
Files changed (82) hide show
  1. package/dist/cjs/{SnkMessageBuilder-c596bd9c.js → SnkMessageBuilder-e103fb59.js} +13 -2
  2. package/dist/cjs/snk-application.cjs.entry.js +2 -2
  3. package/dist/cjs/snk-configurator_3.cjs.entry.js +13 -19
  4. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  5. package/dist/cjs/snk-data-exporter_8.cjs.entry.js +44 -32
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +4 -4
  8. package/dist/cjs/snk-form.cjs.entry.js +3 -1
  9. package/dist/cjs/snk-tab-config.cjs.entry.js +4 -0
  10. package/dist/cjs/{taskbar-elements-8d38f43a.js → taskbar-elements-d7eb170e.js} +2 -2
  11. package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
  12. package/dist/collection/components/snk-data-exporter/exporter-email-sender/email-info-step.js +1 -1
  13. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +2 -2
  14. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +14 -12
  15. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  16. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +2 -1
  17. package/dist/collection/components/snk-form/snk-form.js +3 -1
  18. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +36 -4
  19. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +2 -1
  20. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +4 -0
  21. package/dist/collection/components/snk-grid/snk-grid.js +9 -16
  22. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +8 -4
  23. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  24. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -1
  25. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  26. package/dist/collection/lib/message/resources/file-viewer.msg.js +10 -0
  27. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +1 -1
  28. package/dist/collection/lib/utils/fileViewer/index.js +20 -13
  29. package/dist/components/SnkMessageBuilder.js +13 -2
  30. package/dist/components/snk-application2.js +1 -1
  31. package/dist/components/snk-configurator2.js +1 -1
  32. package/dist/components/snk-data-exporter2.js +32 -25
  33. package/dist/components/snk-exporter-email-sender2.js +4 -4
  34. package/dist/components/snk-field-config2.js +3 -2
  35. package/dist/components/snk-filter-bar2.js +2 -1
  36. package/dist/components/snk-filter-modal2.js +1 -1
  37. package/dist/components/snk-form2.js +3 -1
  38. package/dist/components/snk-grid-config2.js +8 -4
  39. package/dist/components/snk-grid2.js +9 -16
  40. package/dist/components/snk-tab-config2.js +4 -0
  41. package/dist/components/snk-taskbar2.js +2 -2
  42. package/dist/esm/{SnkMessageBuilder-66ddc2f0.js → SnkMessageBuilder-11038c4f.js} +13 -2
  43. package/dist/esm/{index-1564817d.js → index-87e6efed.js} +1 -1
  44. package/dist/esm/snk-application.entry.js +2 -2
  45. package/dist/esm/snk-configurator_3.entry.js +14 -20
  46. package/dist/esm/snk-crud.entry.js +2 -2
  47. package/dist/esm/snk-data-exporter_8.entry.js +45 -33
  48. package/dist/esm/snk-data-unit.entry.js +1 -1
  49. package/dist/esm/snk-exporter-email-sender.entry.js +4 -4
  50. package/dist/esm/snk-form.entry.js +4 -2
  51. package/dist/esm/snk-tab-config.entry.js +4 -0
  52. package/dist/esm/{taskbar-elements-24655695.js → taskbar-elements-025f6c0c.js} +3 -3
  53. package/dist/sankhyablocks/{p-5534e08c.js → p-1f388b12.js} +1 -1
  54. package/dist/sankhyablocks/{p-01fdcc77.entry.js → p-25244256.entry.js} +1 -1
  55. package/dist/sankhyablocks/p-277968b3.entry.js +1 -0
  56. package/dist/sankhyablocks/{p-2cd74aa1.entry.js → p-3dcc1202.entry.js} +1 -1
  57. package/dist/sankhyablocks/p-41f61cc3.entry.js +1 -0
  58. package/dist/sankhyablocks/{p-6b992e43.js → p-4ba7e5e9.js} +1 -1
  59. package/dist/sankhyablocks/{p-31e36df4.entry.js → p-809ecd6b.entry.js} +2 -2
  60. package/dist/sankhyablocks/p-87ef5482.js +1 -0
  61. package/dist/sankhyablocks/p-8d8e859b.entry.js +1 -0
  62. package/dist/sankhyablocks/p-c8244b9e.entry.js +1 -0
  63. package/dist/sankhyablocks/p-eb08de68.entry.js +1 -0
  64. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  65. package/dist/types/components/snk-data-exporter/data/export-config.d.ts +1 -0
  66. package/dist/types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.d.ts +40 -0
  67. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +2 -2
  68. package/dist/types/components/snk-grid/snk-grid.d.ts +84 -0
  69. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -0
  70. package/dist/types/lib/message/resources/file-viewer.msg.d.ts +2 -0
  71. package/dist/types/lib/utils/fileViewer/index.d.ts +1 -1
  72. package/package.json +4 -4
  73. package/react/components.d.ts +29 -29
  74. package/react/react-component-lib/createComponent.d.ts +1 -1
  75. package/react/react-component-lib/interfaces.js +1 -0
  76. package/react/react-component-lib/utils/index.d.ts +2 -2
  77. package/dist/sankhyablocks/p-0b86c7f0.entry.js +0 -1
  78. package/dist/sankhyablocks/p-123732eb.entry.js +0 -1
  79. package/dist/sankhyablocks/p-3187b31c.js +0 -1
  80. package/dist/sankhyablocks/p-4133f9e5.entry.js +0 -1
  81. package/dist/sankhyablocks/p-5360f8fa.entry.js +0 -1
  82. package/dist/sankhyablocks/p-9fab987d.entry.js +0 -1
@@ -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", null, this.fieldConfig.label, this.isRequired() && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
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;
@@ -86,18 +86,19 @@ export class SnkGrid {
86
86
  .then(() => {
87
87
  this.setGridConfig(config);
88
88
  this.closeGridConfig();
89
+ this.dataExporterProviderStore();
89
90
  });
90
91
  }
91
92
  buildColumnsMetadata(columnsMetadata, gridColumns) {
92
93
  gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
93
- var _a, _b, _c, _d, _e;
94
+ var _a, _b;
94
95
  /**
95
96
  * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
96
97
  */
97
98
  if (column.hidden && column.name !== "RECDESP") {
98
99
  return;
99
100
  }
100
- const fieldData = (_d = (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.filter((field) => field.name === column.name)) === null || _d === void 0 ? void 0 : _d[0];
101
+ const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
101
102
  const columnData = {
102
103
  label: column.label,
103
104
  id: column.name,
@@ -106,10 +107,12 @@ export class SnkGrid {
106
107
  userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
107
108
  };
108
109
  columnsMetadata.push(columnData);
109
- if (((_e = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _e === void 0 ? void 0 : _e.DESCRIPTIONFIELD) != undefined) {
110
+ if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
111
+ const mergedFrom = fieldData.properties.mergedFrom;
112
+ const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
110
113
  const descriptionColumn = {
111
114
  label: fieldData.properties.DESCRIPTIONENTITY,
112
- id: fieldData.properties.ENTITYNAME + "." + fieldData.properties.DESCRIPTIONFIELD,
115
+ id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
113
116
  width: 200,
114
117
  type: DataType.TEXT,
115
118
  userInterface: UserInterface.LONGTEXT
@@ -133,17 +136,6 @@ export class SnkGrid {
133
136
  }
134
137
  return offset;
135
138
  }
136
- getExporterLimit(paginationInfo) {
137
- if (paginationInfo == undefined) {
138
- return;
139
- }
140
- const { firstRecord, lastRecord } = paginationInfo;
141
- const limit = firstRecord > 0 && lastRecord > 0 && (lastRecord - firstRecord + 1);
142
- if (!limit) {
143
- return;
144
- }
145
- return limit;
146
- }
147
139
  async dataExporterProviderStore() {
148
140
  var _a, _b;
149
141
  const paginationInfo = this.getPaginationInfo();
@@ -182,7 +174,8 @@ export class SnkGrid {
182
174
  return this.getExporterOffset(paginationInfo);
183
175
  },
184
176
  getLimit: () => {
185
- return this.getExporterLimit(paginationInfo);
177
+ var _a;
178
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
186
179
  },
187
180
  getRecordID: () => {
188
181
  var _a, _b, _c;
@@ -1,5 +1,6 @@
1
1
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
3
+ import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
3
4
  import { h, Host } from '@stencil/core';
4
5
  import { ConfigStorage } from '../../../../lib/configs/ConfigStorage';
5
6
  import { ORDER_VALUES } from '../../../../lib/utils/constants';
@@ -104,7 +105,7 @@ export class EzGridConfig {
104
105
  }
105
106
  buildColumnListSlot(item, group) {
106
107
  const dataElementId = `configItem_${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(item.label))}`;
107
- return (h("div", null, h("ez-check", { mode: 'switch', id: '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); } })));
108
+ return (h("div", null, h("ez-check", { mode: CheckMode.SWITCH, id: 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); } })));
108
109
  }
109
110
  buildOrderListSlot(item) {
110
111
  const dataElementId = `${this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${StringUtils.toCamelCase(item.label)}`;
@@ -370,10 +371,13 @@ export class EzGridConfig {
370
371
  }
371
372
  }
372
373
  compareWords(column, searchingText) {
373
- if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
374
- return true;
374
+ var _a, _b;
375
+ const columnLabel = (_a = StringUtils.replaceAccentuatedChars(column === null || column === void 0 ? void 0 : column.label)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
376
+ const argument = (_b = StringUtils.replaceAccentuatedChars(searchingText)) === null || _b === void 0 ? void 0 : _b.toUpperCase();
377
+ if (StringUtils.isEmpty(columnLabel) || StringUtils.isEmpty(argument)) {
378
+ return false;
375
379
  }
376
- return false;
380
+ return columnLabel.includes(argument);
377
381
  }
378
382
  getColumnNames() {
379
383
  const listNames = [];
@@ -96,10 +96,10 @@ function textButton(name, className, dataElementId, text, title, action, isEnabl
96
96
  return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
97
97
  }
98
98
  function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
99
- return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
99
+ return h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
100
100
  }
101
101
  function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
102
- return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
102
+ return h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
103
103
  }
104
104
  function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
105
105
  return actions && actions.length > 0
@@ -16,7 +16,7 @@ export class PesquisaFetcher {
16
16
  }`);
17
17
  }
18
18
  loadSearchOptions(entityName, argument, criteria, options) {
19
- const cleanText = (argument === null || argument === void 0 ? void 0 : argument.trim()) || undefined;
19
+ const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
20
20
  argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
21
21
  return new Promise((resolve, reject) => {
22
22
  DataFetcher.get()
@@ -3,6 +3,7 @@ import snkFilterBarMessages from "./resources/snk-filter-bar.msg.js";
3
3
  import snkTaskbarMessages from "./resources/snk-taskbar.msg.js";
4
4
  import crudUtilsMessages from "./resources/crud-utils.msg.js";
5
5
  import snkExporterMessages from "./resources/snk-exporter.msg.js";
6
+ import fileViewerMessages from "./resources/file-viewer.msg.js";
6
7
  import { snkFormMessages, snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg.js";
7
8
  import { snkConfiguratorMessages } from "./resources/snk-configurator.msg.js";
8
9
  import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg.js";
@@ -23,7 +24,8 @@ export class SnkMessageBuilder {
23
24
  snkGrid: snkGridMessages,
24
25
  snkGridConfig: snkGridConfigMessages,
25
26
  snkExporter: snkExporterMessages,
26
- snkDataExporter: snkDataExporterMessages
27
+ snkDataExporter: snkDataExporterMessages,
28
+ fileViewer: fileViewerMessages
27
29
  };
28
30
  this._currentOperation = OperationMap.CLEAN;
29
31
  this.loadAppMessages().then((msgs) => {
@@ -0,0 +1,10 @@
1
+ const fileViewerMessages = {
2
+ error: {
3
+ title: "Erro na Exportação",
4
+ message: "O usuário não possui permissão para exportar o arquivo."
5
+ },
6
+ message: {
7
+ exportSuccess: "Exportado com sucesso!",
8
+ }
9
+ };
10
+ export default fileViewerMessages;
@@ -17,7 +17,7 @@ export const snkDataExporterMessages = {
17
17
  message: {
18
18
  emailSuccess: "E-mail enviado com sucesso",
19
19
  exportError: "Erro ao realizar a exportação",
20
- exportSuccess: "Exportado com sucesso!",
20
+ exportPermission: "O usuário não possui permissão para exportar o arquivo.",
21
21
  },
22
22
  title: {
23
23
  error: "Erro",
@@ -1,18 +1,12 @@
1
1
  import { ApplicationContext } from '@sankhyalabs/core';
2
+ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
2
3
  import { KEY_PORT_EXPORT, WEB_CONNECTION } from '../constants.js';
3
- export default function fileViewer({ fileSessionKey, canPrint, canExport, useAppPrint, isDownload }) {
4
- if (useAppPrint && !isDownload) {
5
- webConnection(fileSessionKey, canPrint, canExport);
6
- }
7
- else {
8
- window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
9
- }
4
+ import { DataExporterType } from '../../../lib/@types';
5
+ function getMessage(application, key, params) {
6
+ var _a;
7
+ return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
10
8
  }
11
- function webConnection(fileSessionKey, canPrint, canExport) {
12
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
13
- if (application == undefined) {
14
- return;
15
- }
9
+ function webConnection(fileSessionKey, canPrint, canExport, application) {
16
10
  const keyPort = KEY_PORT_EXPORT;
17
11
  const methodName = WEB_CONNECTION.methods.PDF_VIEWER;
18
12
  const params = {
@@ -21,5 +15,18 @@ function webConnection(fileSessionKey, canPrint, canExport) {
21
15
  permiteExportar: canExport ? "S" : "N",
22
16
  contentType: "S"
23
17
  };
24
- application.webConnection(keyPort, methodName, params);
18
+ application === null || application === void 0 ? void 0 : application.webConnection(keyPort, methodName, params);
19
+ }
20
+ export default function fileViewer({ fileSessionKey, canPrint, canExport, useAppPrint, isDownload, fileType }) {
21
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
22
+ if (isDownload && !canExport && fileType === DataExporterType.EXPORT_PAGE_TO_XLS) {
23
+ const title = getMessage(application, "fileViewer.error.title");
24
+ const message = getMessage(application, "fileViewer.error.message");
25
+ return ApplicationUtils.error(title, message);
26
+ }
27
+ if (useAppPrint && !isDownload) {
28
+ return webConnection(fileSessionKey, canPrint, canExport, application);
29
+ }
30
+ window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
31
+ ApplicationUtils.info(getMessage(application, "fileViewer.message.exportSuccess"), { iconName: "check" });
25
32
  }
@@ -97,6 +97,16 @@ const snkExporterMessages = {
97
97
  emailSenderInfoStep_message: "Mensagem"
98
98
  };
99
99
 
100
+ const fileViewerMessages = {
101
+ error: {
102
+ title: "Erro na Exportação",
103
+ message: "O usuário não possui permissão para exportar o arquivo."
104
+ },
105
+ message: {
106
+ exportSuccess: "Exportado com sucesso!",
107
+ }
108
+ };
109
+
100
110
  const snkFormMessages = {
101
111
  title: {
102
112
  clone: "Duplicar registro",
@@ -223,7 +233,7 @@ const snkDataExporterMessages = {
223
233
  message: {
224
234
  emailSuccess: "E-mail enviado com sucesso",
225
235
  exportError: "Erro ao realizar a exportação",
226
- exportSuccess: "Exportado com sucesso!",
236
+ exportPermission: "O usuário não possui permissão para exportar o arquivo.",
227
237
  },
228
238
  title: {
229
239
  error: "Erro",
@@ -253,7 +263,8 @@ class SnkMessageBuilder {
253
263
  snkGrid: snkGridMessages,
254
264
  snkGridConfig: snkGridConfigMessages,
255
265
  snkExporter: snkExporterMessages,
256
- snkDataExporter: snkDataExporterMessages
266
+ snkDataExporter: snkDataExporterMessages,
267
+ fileViewer: fileViewerMessages
257
268
  };
258
269
  this._currentOperation = OperationMap.CLEAN;
259
270
  this.loadAppMessages().then((msgs) => {
@@ -81,7 +81,7 @@ class PesquisaFetcher {
81
81
  }`);
82
82
  }
83
83
  loadSearchOptions(entityName, argument, criteria, options) {
84
- const cleanText = (argument === null || argument === void 0 ? void 0 : argument.trim()) || undefined;
84
+ const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
85
85
  argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
86
86
  return new Promise((resolve, reject) => {
87
87
  DataFetcher.get()
@@ -85,7 +85,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
85
85
  }
86
86
  }
87
87
  render() {
88
- 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", { mode: "slim", label: this.viewMode === GRID_MODE.name
88
+ 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
89
89
  ? this.getMessage("snkConfigurator.labelConfigGrid")
90
90
  : 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" })))));
91
91
  }
@@ -208,19 +208,11 @@ function getFormatResponse$1(result) {
208
208
  return ObjectUtils.stringToObject(response);
209
209
  }
210
210
 
211
- function fileViewer({ fileSessionKey, canPrint, canExport, useAppPrint, isDownload }) {
212
- if (useAppPrint && !isDownload) {
213
- webConnection(fileSessionKey, canPrint, canExport);
214
- }
215
- else {
216
- window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
217
- }
211
+ function getMessage(application, key, params) {
212
+ var _a;
213
+ return (_a = application === null || application === void 0 ? void 0 : application.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
218
214
  }
219
- function webConnection(fileSessionKey, canPrint, canExport) {
220
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
221
- if (application == undefined) {
222
- return;
223
- }
215
+ function webConnection(fileSessionKey, canPrint, canExport, application) {
224
216
  const keyPort = KEY_PORT_EXPORT;
225
217
  const methodName = WEB_CONNECTION.methods.PDF_VIEWER;
226
218
  const params = {
@@ -229,7 +221,20 @@ function webConnection(fileSessionKey, canPrint, canExport) {
229
221
  permiteExportar: canExport ? "S" : "N",
230
222
  contentType: "S"
231
223
  };
232
- application.webConnection(keyPort, methodName, params);
224
+ application === null || application === void 0 ? void 0 : application.webConnection(keyPort, methodName, params);
225
+ }
226
+ function fileViewer({ fileSessionKey, canPrint, canExport, useAppPrint, isDownload, fileType }) {
227
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
228
+ if (isDownload && !canExport && fileType === DataExporterType.EXPORT_PAGE_TO_XLS) {
229
+ const title = getMessage(application, "fileViewer.error.title");
230
+ const message = getMessage(application, "fileViewer.error.message");
231
+ return ApplicationUtils.error(title, message);
232
+ }
233
+ if (useAppPrint && !isDownload) {
234
+ return webConnection(fileSessionKey, canPrint, canExport, application);
235
+ }
236
+ window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${fileSessionKey}${isDownload ? "&download=S" : ""}`);
237
+ ApplicationUtils.info(getMessage(application, "fileViewer.message.exportSuccess"), { iconName: "check" });
233
238
  }
234
239
 
235
240
  function getPersonalizedReports(requestBody) {
@@ -280,17 +285,17 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
280
285
  attachments: [
281
286
  { name: this._appLabel }
282
287
  ]
288
+ },
289
+ resolver: ({ type, format, email: { to, subject, message } }) => {
290
+ var _a;
291
+ const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
292
+ this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
293
+ this._snkEmailSender.close();
294
+ ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
295
+ });
283
296
  }
284
297
  };
285
- this._snkEmailSender.open(config)
286
- .then(({ format, email: { to, subject, message } }) => {
287
- var _a;
288
- const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
289
- this.resolveExporter({ methodName, to, subject, message, fileName: this._appLabel, titleGrid: this._appLabel }, () => {
290
- this._snkEmailSender.close();
291
- ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
292
- });
293
- });
298
+ this._snkEmailSender.open(config);
294
299
  }
295
300
  /**
296
301
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -347,11 +352,14 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
347
352
  columns,
348
353
  sort,
349
354
  resourceURI, selectedIDs: selectedIDs.slice(0, LIMIT_PER_EXPORT) }, resolveProps);
350
- if (currentPageOptions.includes(option)) {
355
+ if (currentPageOptions.includes(option) || resolveProps.type == "page") {
351
356
  const offset = this.provider.getOffset();
352
357
  const limit = this.provider.getLimit();
353
358
  params = Object.assign(Object.assign({}, params), { offset,
354
- limit });
359
+ limit, selectedIDs: [] });
360
+ }
361
+ else if (resolveProps.type == "all") {
362
+ params = Object.assign(Object.assign({}, params), { offset: 0, limit: LIMIT_PER_EXPORT, selectedIDs: [] });
355
363
  }
356
364
  fetchDataExporter(params)
357
365
  .then((result) => callbackResolver(result))
@@ -378,7 +386,6 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
378
386
  this.resolveExporter(params, (response) => {
379
387
  fileViewer(Object.assign(Object.assign({}, response), { fileType,
380
388
  isDownload }));
381
- ApplicationUtils.info(this.getMessage("snkDataExporter.message.exportSuccess"), { iconName: "check" });
382
389
  });
383
390
  }
384
391
  async processExporter(evt) {
@@ -4,8 +4,8 @@ import { ElementIDUtils } from '@sankhyalabs/core';
4
4
  const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
5
5
  const { format, email } = data || {};
6
6
  return h("div", null,
7
- h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`, required: true, value: email === null || email === void 0 ? void 0 : email.to, onEzChange: evt => changeInfo("to", evt.detail.trim()) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("sendTo")}` })),
8
- h("ez-text-input", Object.assign({ label: `${getMessage("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`, required: true, value: email === null || email === void 0 ? void 0 : email.subject, onEzChange: evt => changeInfo("subject", evt.detail.trim()) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("subject")}` })),
7
+ 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")}` })),
8
+ 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")}` })),
9
9
  h("ez-text-area", Object.assign({ label: getMessage("snkExporter.emailSenderInfoStep_message"), value: email === null || email === void 0 ? void 0 : email.message, onEzChange: evt => changeInfo("message", evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("message")}` })),
10
10
  ((email === null || email === void 0 ? void 0 : email.attachments) || [])
11
11
  .map((file, index) => h("ez-file-item", Object.assign({ class: "ez-padding-bottom--large", fileName: `${file.name}.${format}`, fileSize: file.size, canRemove: false }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("fileItem_") + (index + 1)}` }))));
@@ -98,8 +98,8 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
98
98
  }
99
99
  }
100
100
  send() {
101
- const { format, type, email } = this._config;
102
- this._promiseResolver({ format, type, email, report: undefined });
101
+ const { format, type, email, resolver } = this._config;
102
+ resolver({ format, type, email, report: undefined });
103
103
  }
104
104
  isFilled() {
105
105
  var _a, _b;
@@ -2,13 +2,14 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
2
2
  import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as ACTION_CONFIG } from './constants.js';
4
4
 
5
- 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__required--padding-left: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__required-label.sc-snk-field-config{color:var(--snk-field-config__required--color);padding-left:var(--snk-field-config__required--padding-left)}.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}";
5
+ 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}}";
6
6
 
7
7
  const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  constructor() {
9
9
  super();
10
10
  this.__registerHost();
11
11
  this.ezClickIcon = createEvent(this, "ezClickIcon", 7);
12
+ this._lang = "pt"; // Controla qual idioma será usado para definir a regras de hifenização.
12
13
  this.isConfigActive = false;
13
14
  this.fieldConfig = undefined;
14
15
  this.modeInsertion = true;
@@ -47,7 +48,7 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
47
48
  if (this.fieldConfig == undefined) {
48
49
  return;
49
50
  }
50
- 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", null, this.fieldConfig.label, this.isRequired() && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
51
+ 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 ?
51
52
  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") })) :
52
53
  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" })))));
53
54
  }
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { DataType, ObjectUtils, ElementIDUtils, StringUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
+ import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
3
4
  import { F as FilterItemType } from './filter-item-type.enum.js';
4
5
  import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
5
6
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
@@ -480,7 +481,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
480
481
  if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
481
482
  return undefined;
482
483
  }
483
- return (h(Host, null, h("ez-scroller", { direction: "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" }))));
484
+ 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" }))));
484
485
  }
485
486
  get _element() { return this; }
486
487
  static get watchers() { return {
@@ -40,7 +40,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
40
40
  }
41
41
  buildItems(list) {
42
42
  return list.map(item => {
43
- 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)));
43
+ 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)));
44
44
  });
45
45
  }
46
46
  itemKeyBoardSelect(event, item) {
@@ -109,7 +109,9 @@ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
109
109
  .then((defaultValue) => {
110
110
  fieldValue = defaultValue;
111
111
  });
112
- return fieldValue;
112
+ return {
113
+ value: fieldValue
114
+ };
113
115
  default:
114
116
  return value;
115
117
  }
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
+ import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
4
5
  import { C as ConfigStorage } from './ConfigStorage.js';
5
6
  import { O as ORDER_VALUES } from './constants.js';
6
7
  import { d as defineCustomElement$1 } from './snk-select-box2.js';
@@ -112,7 +113,7 @@ const EzGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
112
113
  }
113
114
  buildColumnListSlot(item, group) {
114
115
  const dataElementId = `configItem_${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(item.label))}`;
115
- return (h("div", null, h("ez-check", { mode: 'switch', id: '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); } })));
116
+ return (h("div", null, h("ez-check", { mode: CheckMode.SWITCH, id: 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); } })));
116
117
  }
117
118
  buildOrderListSlot(item) {
118
119
  const dataElementId = `${this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${StringUtils.toCamelCase(item.label)}`;
@@ -378,10 +379,13 @@ const EzGridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
378
379
  }
379
380
  }
380
381
  compareWords(column, searchingText) {
381
- if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
382
- return true;
382
+ var _a, _b;
383
+ const columnLabel = (_a = StringUtils.replaceAccentuatedChars(column === null || column === void 0 ? void 0 : column.label)) === null || _a === void 0 ? void 0 : _a.toUpperCase();
384
+ const argument = (_b = StringUtils.replaceAccentuatedChars(searchingText)) === null || _b === void 0 ? void 0 : _b.toUpperCase();
385
+ if (StringUtils.isEmpty(columnLabel) || StringUtils.isEmpty(argument)) {
386
+ return false;
383
387
  }
384
- return false;
388
+ return columnLabel.includes(argument);
385
389
  }
386
390
  getColumnNames() {
387
391
  const listNames = [];
@@ -101,18 +101,19 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
101
101
  .then(() => {
102
102
  this.setGridConfig(config);
103
103
  this.closeGridConfig();
104
+ this.dataExporterProviderStore();
104
105
  });
105
106
  }
106
107
  buildColumnsMetadata(columnsMetadata, gridColumns) {
107
108
  gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
108
- var _a, _b, _c, _d, _e;
109
+ var _a, _b;
109
110
  /**
110
111
  * TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
111
112
  */
112
113
  if (column.hidden && column.name !== "RECDESP") {
113
114
  return;
114
115
  }
115
- const fieldData = (_d = (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.filter((field) => field.name === column.name)) === null || _d === void 0 ? void 0 : _d[0];
116
+ const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
116
117
  const columnData = {
117
118
  label: column.label,
118
119
  id: column.name,
@@ -121,10 +122,12 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
121
122
  userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
122
123
  };
123
124
  columnsMetadata.push(columnData);
124
- if (((_e = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _e === void 0 ? void 0 : _e.DESCRIPTIONFIELD) != undefined) {
125
+ if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
126
+ const mergedFrom = fieldData.properties.mergedFrom;
127
+ const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
125
128
  const descriptionColumn = {
126
129
  label: fieldData.properties.DESCRIPTIONENTITY,
127
- id: fieldData.properties.ENTITYNAME + "." + fieldData.properties.DESCRIPTIONFIELD,
130
+ id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
128
131
  width: 200,
129
132
  type: DataType.TEXT,
130
133
  userInterface: UserInterface.LONGTEXT
@@ -148,17 +151,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
148
151
  }
149
152
  return offset;
150
153
  }
151
- getExporterLimit(paginationInfo) {
152
- if (paginationInfo == undefined) {
153
- return;
154
- }
155
- const { firstRecord, lastRecord } = paginationInfo;
156
- const limit = firstRecord > 0 && lastRecord > 0 && (lastRecord - firstRecord + 1);
157
- if (!limit) {
158
- return;
159
- }
160
- return limit;
161
- }
162
154
  async dataExporterProviderStore() {
163
155
  var _a, _b;
164
156
  const paginationInfo = this.getPaginationInfo();
@@ -197,7 +189,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
197
189
  return this.getExporterOffset(paginationInfo);
198
190
  },
199
191
  getLimit: () => {
200
- return this.getExporterLimit(paginationInfo);
192
+ var _a;
193
+ return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.pageSize;
201
194
  },
202
195
  getRecordID: () => {
203
196
  var _a, _b, _c;