@sankhyalabs/sankhyablocks 3.3.0 → 3.4.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.
Files changed (77) hide show
  1. package/dist/cjs/{SnkMessageBuilder-424f02f7.js → SnkMessageBuilder-e6dee2c2.js} +21 -1
  2. package/dist/cjs/{index-0e663819.js → index-f400b1d6.js} +34 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  5. package/dist/cjs/snk-application.cjs.entry.js +11 -11
  6. package/dist/cjs/snk-configurator_3.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  8. package/dist/cjs/snk-data-exporter_8.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +3 -2
  11. package/dist/cjs/snk-filter-param-config.cjs.entry.js +255 -0
  12. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  13. package/dist/cjs/{taskbar-elements-d7eb170e.js → taskbar-elements-5e87cf44.js} +1 -1
  14. package/dist/collection/collection-manifest.json +1 -0
  15. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +3 -2
  16. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.js +1 -0
  17. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/ISystemFilterConfig.js +1 -0
  18. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IUserFilterConfig.js +1 -0
  19. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.css +12 -0
  20. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +258 -0
  21. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +55 -0
  22. package/dist/collection/lib/@types/index.js +34 -0
  23. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +10 -10
  24. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  25. package/dist/collection/lib/message/resources/snk-filter-param-config.msg.js +18 -0
  26. package/dist/components/SnkMessageBuilder.js +21 -1
  27. package/dist/components/index.d.ts +1 -0
  28. package/dist/components/index.js +1 -0
  29. package/dist/{esm/index-1564817d.js → components/index2.js} +35 -1
  30. package/dist/components/snk-application2.js +10 -10
  31. package/dist/components/snk-crud.js +2 -1
  32. package/dist/components/snk-data-exporter2.js +2 -33
  33. package/dist/components/snk-exporter-email-sender2.js +3 -2
  34. package/dist/components/snk-filter-param-config.d.ts +11 -0
  35. package/dist/components/snk-filter-param-config.js +276 -0
  36. package/dist/components/snk-form2.js +2 -1
  37. package/dist/components/snk-grid2.js +2 -1
  38. package/dist/components/snk-taskbar2.js +2 -1
  39. package/dist/esm/{SnkMessageBuilder-64821b88.js → SnkMessageBuilder-f0d50bd6.js} +21 -1
  40. package/dist/esm/index-bd13bdcf.js +67 -0
  41. package/dist/esm/loader.js +1 -1
  42. package/dist/esm/sankhyablocks.js +1 -1
  43. package/dist/esm/snk-application.entry.js +11 -11
  44. package/dist/esm/snk-configurator_3.entry.js +1 -1
  45. package/dist/esm/snk-crud.entry.js +2 -2
  46. package/dist/esm/snk-data-exporter_8.entry.js +2 -2
  47. package/dist/esm/snk-data-unit.entry.js +1 -1
  48. package/dist/esm/snk-exporter-email-sender.entry.js +3 -2
  49. package/dist/esm/snk-filter-param-config.entry.js +251 -0
  50. package/dist/esm/snk-form.entry.js +1 -1
  51. package/dist/esm/{taskbar-elements-dc968d8f.js → taskbar-elements-8400dbe7.js} +1 -1
  52. package/dist/sankhyablocks/p-22e44b9d.entry.js +1 -0
  53. package/dist/sankhyablocks/{p-d3fb34cb.js → p-32d02fa4.js} +1 -1
  54. package/dist/sankhyablocks/p-69562bcf.js +1 -0
  55. package/dist/sankhyablocks/{p-71b8562d.entry.js → p-69738f28.entry.js} +1 -1
  56. package/dist/sankhyablocks/{p-31b3217d.entry.js → p-7f195b37.entry.js} +1 -1
  57. package/dist/sankhyablocks/{p-d9c43eca.js → p-93c271e2.js} +1 -1
  58. package/dist/sankhyablocks/{p-6878464e.entry.js → p-a2ea13ed.entry.js} +1 -1
  59. package/dist/sankhyablocks/{p-554db79e.entry.js → p-b326cf51.entry.js} +1 -1
  60. package/dist/sankhyablocks/p-c81ced8a.entry.js +1 -0
  61. package/dist/sankhyablocks/{p-a22a3a7a.entry.js → p-e906ba66.entry.js} +4 -4
  62. package/dist/sankhyablocks/{p-afea1284.entry.js → p-f559c71a.entry.js} +1 -1
  63. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  64. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +13 -0
  65. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/ISystemFilterConfig.d.ts +4 -0
  66. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IUserFilterConfig.d.ts +5 -0
  67. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +41 -0
  68. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +15 -0
  69. package/dist/types/components.d.ts +16 -0
  70. package/dist/types/lib/@types/index.d.ts +30 -0
  71. package/dist/types/lib/message/resources/snk-filter-param-config.msg.d.ts +1 -0
  72. package/package.json +1 -1
  73. package/react/components.d.ts +1 -0
  74. package/react/components.js +1 -0
  75. package/react/components.js.map +1 -1
  76. package/dist/sankhyablocks/p-5534e08c.js +0 -1
  77. package/dist/sankhyablocks/p-eb08de68.entry.js +0 -1
@@ -0,0 +1,258 @@
1
+ import { h } from "@stencil/core";
2
+ import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from "@sankhyalabs/core";
3
+ import { ModalAction } from "@sankhyalabs/ezui/dist/collection/components/ez-modal-container";
4
+ import { FilterConfigType, FilterEntities, FilterUserConfigTypes } from "../../../../lib/@types";
5
+ import { PersonalizedFilterUtils } from "./utils/PersonalizedFilterUtils";
6
+ export class SnkFilterParamConfig {
7
+ constructor() {
8
+ this._opened = false;
9
+ this._configType = FilterConfigType.SYSTEM_CONFIG;
10
+ this._expressionItem = undefined;
11
+ this._informedInstance = false;
12
+ this._canSave = false;
13
+ }
14
+ open(expressionItem) {
15
+ this._opened = true;
16
+ this._expressionItem = expressionItem;
17
+ this.loadValues();
18
+ return new Promise(accept => {
19
+ this._promiseResolver = accept;
20
+ });
21
+ }
22
+ close() {
23
+ this._opened = false;
24
+ return new Promise(accept => {
25
+ this._promiseResolver = accept;
26
+ });
27
+ }
28
+ /**
29
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
30
+ * através de um pequeno modulo na estrutura da aplicação:
31
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
32
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-param-config.msg.ts"
33
+ */
34
+ getMessage(key, params) {
35
+ return this._application.messagesBuilder.getMessage(key, params);
36
+ }
37
+ getConfigValue(configName, inputName, inputAlias = "") {
38
+ var _a, _b, _c;
39
+ return ((_b = (_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a[configName]) === null || _b === void 0 ? void 0 : _b[inputName])
40
+ || ((_c = this._expressionItem) === null || _c === void 0 ? void 0 : _c[inputAlias || inputName]);
41
+ }
42
+ loadValues() {
43
+ var _a;
44
+ const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
45
+ const fieldName = this.getConfigValue("systemConfig", "fieldName");
46
+ const description = this.getConfigValue("userConfig", "description");
47
+ const type = this.getConfigValue("userConfig", "type");
48
+ if (((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.userConfig) != undefined) {
49
+ this._configType = FilterConfigType.USER_CONFIG;
50
+ }
51
+ else {
52
+ this._configType = FilterConfigType.SYSTEM_CONFIG;
53
+ }
54
+ if (!StringUtils.isEmpty(entityName) && !StringUtils.isEmpty(fieldName)) {
55
+ this._instanceElement.value = { value: entityName, label: "" };
56
+ this._fieldElement.value = { value: fieldName, label: "" };
57
+ }
58
+ if (!StringUtils.isEmpty(description) && !StringUtils.isEmpty(type)) {
59
+ this._descriptionElement.value = description;
60
+ this._typeElement.value = type;
61
+ }
62
+ this.buildFilterExpression();
63
+ }
64
+ changeDefinitionUsed(option) {
65
+ this._configType = option !== null && option !== void 0 ? option : FilterConfigType.SYSTEM_CONFIG;
66
+ if (this._configType === FilterConfigType.SYSTEM_CONFIG) {
67
+ const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
68
+ const fieldName = this.getConfigValue("systemConfig", "fieldName");
69
+ this._instanceElement.value = this._instanceElement.value || { value: entityName, label: "" };
70
+ this._fieldElement.value = this._fieldElement.value || { value: fieldName, label: "" };
71
+ }
72
+ else if (this._configType === FilterConfigType.USER_CONFIG) {
73
+ const description = this.getConfigValue("userConfig", "description");
74
+ const type = this.getConfigValue("userConfig", "type");
75
+ this._descriptionElement.value = this._descriptionElement.value || description;
76
+ this._typeElement.value = this._typeElement.value || type;
77
+ }
78
+ this.buildFilterExpression();
79
+ }
80
+ getTypeValue() {
81
+ var _a;
82
+ const value = (_a = this._typeElement) === null || _a === void 0 ? void 0 : _a.value;
83
+ return ((value === null || value === void 0 ? void 0 : value.value) || value);
84
+ }
85
+ getExpressionValues() {
86
+ var _a, _b, _c, _d, _e;
87
+ let systemConfig;
88
+ let userConfig;
89
+ if (this._configType === FilterConfigType.SYSTEM_CONFIG) {
90
+ const entity = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
91
+ const fieldName = (_d = (_c = this._fieldElement) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.value;
92
+ systemConfig = { entity, fieldName };
93
+ }
94
+ else if (this._configType === FilterConfigType.USER_CONFIG) {
95
+ const description = (_e = this._descriptionElement) === null || _e === void 0 ? void 0 : _e.value;
96
+ const type = this.getTypeValue();
97
+ userConfig = { description, type };
98
+ }
99
+ return Object.assign(Object.assign(Object.assign({}, this._expressionItem), { systemConfig }), { userConfig });
100
+ }
101
+ isEnabled(value) {
102
+ return this._configType === value;
103
+ }
104
+ isInformedInstance() {
105
+ var _a, _b;
106
+ return !StringUtils.isEmpty((_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value);
107
+ }
108
+ save() {
109
+ var _a;
110
+ this._expressionItem = Object.assign(Object.assign({}, this.getExpressionValues()), { expression: (_a = this._expressionElement) === null || _a === void 0 ? void 0 : _a.value });
111
+ this._promiseResolver(this._expressionItem);
112
+ this._opened = false;
113
+ }
114
+ buildFilterExpression() {
115
+ var _a;
116
+ this._informedInstance = this.isInformedInstance();
117
+ const expression = PersonalizedFilterUtils.buildFilterExpression(this.getExpressionValues());
118
+ this._expressionElement.value = expression || ((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.expression);
119
+ this._canSave = this.getCanSave();
120
+ }
121
+ handleChangeInstance() {
122
+ this._informedInstance = this.isInformedInstance();
123
+ if (this._fieldElement != undefined && !StringUtils.isEmpty(this._fieldElement.value)) {
124
+ this._fieldElement.value = null;
125
+ }
126
+ this.buildFilterExpression();
127
+ }
128
+ getInstanceCriteria() {
129
+ var _a, _b;
130
+ const value = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
131
+ return {
132
+ expression: "this.NOMETAB = (SELECT NOMETAB FROM TDDINS WHERE NOMEINSTANCIA = ?)",
133
+ params: [
134
+ {
135
+ name: "NOMEINSTANCIA",
136
+ dataType: DataType.TEXT,
137
+ value
138
+ }
139
+ ]
140
+ };
141
+ }
142
+ onSearch({ mode, argument }, entity) {
143
+ if (this._application == undefined) {
144
+ return;
145
+ }
146
+ const isField = entity === FilterEntities.FIELD;
147
+ const criteria = isField ? this.getInstanceCriteria() : undefined;
148
+ const messageKey = `snkFilterParamConfig.label${isField ? "Field" : "Instance"}`;
149
+ const entityDescription = this.getMessage(messageKey);
150
+ const searchOptions = {
151
+ descriptionFieldName: isField ? "DESCRCAMPO" : "DESCRINSTANCIA",
152
+ codeFieldName: isField ? "NOMECAMPO" : "NOMEINSTANCIA",
153
+ showInactives: false
154
+ };
155
+ const options = {
156
+ entity,
157
+ entityDescription,
158
+ criteria,
159
+ searchOptions
160
+ };
161
+ return this._application.executePreparedSearch(mode, argument, options);
162
+ }
163
+ getElementID(sufix) {
164
+ return {
165
+ [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
166
+ };
167
+ }
168
+ getCanSave() {
169
+ var _a;
170
+ if (this._configType === FilterConfigType.USER_CONFIG) {
171
+ const description = (_a = this._descriptionElement) === null || _a === void 0 ? void 0 : _a.value;
172
+ const type = this.getTypeValue();
173
+ return !StringUtils.isEmpty(description) && !StringUtils.isEmpty(type);
174
+ }
175
+ return true;
176
+ }
177
+ componentWillLoad() {
178
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
179
+ }
180
+ render() {
181
+ ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkFilterParamConfig');
182
+ return (h("ez-popup", Object.assign({ useHeader: false, size: "small", heightMode: "auto", opened: this._opened }, this.getElementID("popup")), h("ez-modal-container", Object.assign({ onEzModalAction: (evt) => {
183
+ if (evt.detail === ModalAction.CLOSE)
184
+ this.close();
185
+ }, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), h("div", { class: "ez-flex" }, h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value: FilterConfigType.SYSTEM_CONFIG })), h("ez-search", Object.assign({ ref: (ref) => this._instanceElement = ref, label: this.getMessage("snkFilterParamConfig.labelInstance"), enabled: this.isEnabled(FilterConfigType.SYSTEM_CONFIG), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.handleChangeInstance(), optionLoader: (searchArgument) => this.onSearch(searchArgument, FilterEntities.INSTANCE) }, this.getElementID("configFindEntity"))), h("ez-search", Object.assign({ ref: (ref) => this._fieldElement = ref, label: this.getMessage("snkFilterParamConfig.labelField"), enabled: this.isEnabled(FilterConfigType.SYSTEM_CONFIG) && this._informedInstance, suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.buildFilterExpression(), optionLoader: (searchArgument) => this.onSearch(searchArgument, FilterEntities.FIELD) }, this.getElementID("configFindField")))), h("div", { class: "ez-flex ez-padding--medium" }, h("hr", { class: "ez-divider-vertical" })), h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("userConfigOption")), h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelUserConfig"), value: FilterConfigType.USER_CONFIG })), h("ez-text-input", Object.assign({ ref: (ref) => this._descriptionElement = ref, label: this.getMessage("snkFilterParamConfig.labelDescription"), enabled: this.isEnabled(FilterConfigType.USER_CONFIG), onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamLabel"))), h("ez-combo-box", Object.assign({ ref: (ref) => this._typeElement = ref, label: this.getMessage("snkFilterParamConfig.labelType"), enabled: this.isEnabled(FilterConfigType.USER_CONFIG), suppressEmptyOption: true, onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamType")), Object.keys(FilterUserConfigTypes).map((configType) => {
186
+ return (h("option", { value: FilterUserConfigTypes[configType] }, this.getMessage(`snkFilterParamConfig.labelTypeValues.${configType.toLowerCase()}`)));
187
+ })))), h("ez-text-area", Object.assign({ ref: (ref) => this._expressionElement = ref, class: "snk-filter-param-config__expression", label: this.getMessage("snkFilterParamConfig.labelExpression"), enabled: false }, this.getElementID("presentationExpression"))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-padding-right--medium", label: this.getMessage("snkFilterParamConfig.labelCancel"), onClick: () => this.close() }, this.getElementID("cancelEditParam"))), h("ez-button", Object.assign({ class: "ez-button--primary", label: this.getMessage("snkFilterParamConfig.labelSave"), onClick: () => this.save(), enabled: this._canSave }, this.getElementID("saveEditParam")))))));
188
+ }
189
+ static get is() { return "snk-filter-param-config"; }
190
+ static get encapsulation() { return "scoped"; }
191
+ static get originalStyleUrls() {
192
+ return {
193
+ "$": ["snk-filter-param-config.css"]
194
+ };
195
+ }
196
+ static get styleUrls() {
197
+ return {
198
+ "$": ["snk-filter-param-config.css"]
199
+ };
200
+ }
201
+ static get states() {
202
+ return {
203
+ "_opened": {},
204
+ "_configType": {},
205
+ "_expressionItem": {},
206
+ "_informedInstance": {},
207
+ "_canSave": {}
208
+ };
209
+ }
210
+ static get methods() {
211
+ return {
212
+ "open": {
213
+ "complexType": {
214
+ "signature": "(expressionItem: IExpressionItem) => Promise<IExpressionItem>",
215
+ "parameters": [{
216
+ "tags": [],
217
+ "text": ""
218
+ }],
219
+ "references": {
220
+ "Promise": {
221
+ "location": "global"
222
+ },
223
+ "IExpressionItem": {
224
+ "location": "import",
225
+ "path": "./interfaces/IExpressionItem"
226
+ }
227
+ },
228
+ "return": "Promise<IExpressionItem>"
229
+ },
230
+ "docs": {
231
+ "text": "",
232
+ "tags": []
233
+ }
234
+ },
235
+ "close": {
236
+ "complexType": {
237
+ "signature": "() => Promise<IExpressionItem>",
238
+ "parameters": [],
239
+ "references": {
240
+ "Promise": {
241
+ "location": "global"
242
+ },
243
+ "IExpressionItem": {
244
+ "location": "import",
245
+ "path": "./interfaces/IExpressionItem"
246
+ }
247
+ },
248
+ "return": "Promise<IExpressionItem>"
249
+ },
250
+ "docs": {
251
+ "text": "",
252
+ "tags": []
253
+ }
254
+ }
255
+ };
256
+ }
257
+ static get elementRef() { return "_element"; }
258
+ }
@@ -0,0 +1,55 @@
1
+ import { FilterOperand } from "../../../../../lib/@types";
2
+ export class PersonalizedFilterUtils {
3
+ /**
4
+ * Cria uma expressão de filtro a partir de um IExpressionItem.
5
+ * @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
6
+ * @returns Retorna a expressão de filtro.
7
+ */
8
+ static buildFilterExpression(expressionItem) {
9
+ if (expressionItem == undefined) {
10
+ return;
11
+ }
12
+ const value = this.buildVariableParameterValue(expressionItem);
13
+ let expression = expressionItem.expression || "";
14
+ switch (expressionItem.operand) {
15
+ case FilterOperand.IN:
16
+ expression += ` ${expressionItem.operand} (${value})`;
17
+ break;
18
+ case FilterOperand.NULL:
19
+ case FilterOperand.NOT_NULL:
20
+ expression += ` IS ${value}`;
21
+ break;
22
+ case FilterOperand.LIKE:
23
+ expression += ` LIKE '%${value}%'`;
24
+ break;
25
+ case FilterOperand.START_WITH:
26
+ expression += ` LIKE '${value}%'`;
27
+ break;
28
+ case FilterOperand.FINISHED_WITH:
29
+ expression += ` LIKE '%${value}'`;
30
+ break;
31
+ default:
32
+ expression += ` ${expressionItem.operand} ${value}`;
33
+ }
34
+ return expression;
35
+ }
36
+ /**
37
+ * Obtém o valor do parâmetro a partir de um IExpressionItem.
38
+ * @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
39
+ * @returns Retorna o valor do parâmetro.
40
+ */
41
+ static buildVariableParameterValue(expressionItem) {
42
+ if (expressionItem == undefined) {
43
+ return;
44
+ }
45
+ if (expressionItem.systemConfig != undefined) {
46
+ const systemConfig = expressionItem.systemConfig;
47
+ return `?:{entidade=${systemConfig.entity || ""};campo=${systemConfig.fieldName || ""}}`;
48
+ }
49
+ if (expressionItem.userConfig != undefined) {
50
+ const userConfig = expressionItem.userConfig;
51
+ return `?:{desc=${userConfig.description || ""};tipo=${userConfig.type || ""}}`;
52
+ }
53
+ return `?:{entidade=${expressionItem.entityName || ""};campo=${expressionItem.fieldName || ""}}`;
54
+ }
55
+ }
@@ -29,3 +29,37 @@ export var DataExporterType;
29
29
  DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
30
30
  DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
31
31
  })(DataExporterType || (DataExporterType = {}));
32
+ export var FilterConfigType;
33
+ (function (FilterConfigType) {
34
+ FilterConfigType["SYSTEM_CONFIG"] = "S";
35
+ FilterConfigType["USER_CONFIG"] = "E";
36
+ })(FilterConfigType || (FilterConfigType = {}));
37
+ export var FilterUserConfigTypes;
38
+ (function (FilterUserConfigTypes) {
39
+ FilterUserConfigTypes["DATE"] = "D";
40
+ FilterUserConfigTypes["TEXT"] = "S";
41
+ FilterUserConfigTypes["INTEGER"] = "I";
42
+ FilterUserConfigTypes["DECIMAL"] = "F";
43
+ })(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
44
+ export var FilterOperand;
45
+ (function (FilterOperand) {
46
+ FilterOperand["AND"] = "AND";
47
+ FilterOperand["OR"] = "OR";
48
+ FilterOperand["IN"] = "IN";
49
+ FilterOperand["DIFFERENT"] = "<>";
50
+ FilterOperand["LIKE"] = "LIKE";
51
+ FilterOperand["START_WITH"] = "LIKE_START";
52
+ FilterOperand["FINISHED_WITH"] = "LIKE_END";
53
+ FilterOperand["NULL"] = "NULL";
54
+ FilterOperand["NOT_NULL"] = "NOT NULL";
55
+ FilterOperand["EQUAL"] = "=";
56
+ FilterOperand["LARGER"] = ">";
57
+ FilterOperand["LARGER_EQUAL"] = ">=";
58
+ FilterOperand["SMALLER"] = "<";
59
+ FilterOperand["SMALLER_EQUAL"] = "<=";
60
+ })(FilterOperand || (FilterOperand = {}));
61
+ export var FilterEntities;
62
+ (function (FilterEntities) {
63
+ FilterEntities["FIELD"] = "Campo";
64
+ FilterEntities["INSTANCE"] = "Instancia";
65
+ })(FilterEntities || (FilterEntities = {}));
@@ -55,19 +55,19 @@ export class PesquisaFetcher {
55
55
  })
56
56
  };
57
57
  }
58
+ const options = searchOptions != undefined
59
+ ? {
60
+ "pkFieldName": searchOptions.codeFieldName,
61
+ "label": searchOptions.descriptionFieldName,
62
+ "fieldName": searchOptions.codeFieldName,
63
+ "useDescriptionOptions": false,
64
+ "enableRowsCounter": true
65
+ }
66
+ : undefined;
58
67
  const reqBody = {
59
68
  "serviceName": serviceName,
60
69
  "requestBody": {
61
- "criteria": {
62
- "entityName": entityName,
63
- "compacted": false,
64
- "ignoreEntityCriteria": false,
65
- "limit": this._defaultPageSize,
66
- "query": { "$": argument },
67
- "orderByDesc": false,
68
- "externalCriteria": externalCriteria,
69
- "localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity
70
- },
70
+ "criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity }, { options }),
71
71
  "clientEventList": {
72
72
  "clientEvent": []
73
73
  }
@@ -8,6 +8,7 @@ import { snkFormMessages, snkFormConfigMessages, snkConfigOptionsMessages, snkFi
8
8
  import { snkConfiguratorMessages } from "./resources/snk-configurator.msg.js";
9
9
  import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg.js";
10
10
  import { snkDataExporterMessages } from "./resources/snk-data-exporter.msg.js";
11
+ import { snkFilterParamConfigMessages } from "./resources/snk-filter-param-config.msg.js";
11
12
  export class SnkMessageBuilder {
12
13
  constructor() {
13
14
  this._defaults = {
@@ -25,7 +26,8 @@ export class SnkMessageBuilder {
25
26
  snkGridConfig: snkGridConfigMessages,
26
27
  snkExporter: snkExporterMessages,
27
28
  snkDataExporter: snkDataExporterMessages,
28
- fileViewer: fileViewerMessages
29
+ fileViewer: fileViewerMessages,
30
+ snkFilterParamConfig: snkFilterParamConfigMessages
29
31
  };
30
32
  this._currentOperation = OperationMap.CLEAN;
31
33
  this.loadAppMessages().then((msgs) => {
@@ -0,0 +1,18 @@
1
+ export const snkFilterParamConfigMessages = {
2
+ modalTitle: "Configuração de parâmetro variável",
3
+ labelSystemConfig: "Usar definições do sistema",
4
+ labelUserConfig: "Usar definições personalizadas",
5
+ labelInstance: "Categoria",
6
+ labelField: "Campo",
7
+ labelDescription: "Descrição (obrigatório) *",
8
+ labelType: "Tipo (obrigatório) *",
9
+ labelTypeValues: {
10
+ date: "Data",
11
+ text: "Texto",
12
+ integer: "Número Inteiro",
13
+ decimal: "Número com Decimal",
14
+ },
15
+ labelExpression: "Expressão",
16
+ labelCancel: "Cancelar",
17
+ labelSave: "Salvar"
18
+ };
@@ -247,6 +247,25 @@ const snkDataExporterMessages = {
247
247
  }
248
248
  };
249
249
 
250
+ const snkFilterParamConfigMessages = {
251
+ modalTitle: "Configuração de parâmetro variável",
252
+ labelSystemConfig: "Usar definições do sistema",
253
+ labelUserConfig: "Usar definições personalizadas",
254
+ labelInstance: "Categoria",
255
+ labelField: "Campo",
256
+ labelDescription: "Descrição (obrigatório) *",
257
+ labelType: "Tipo (obrigatório) *",
258
+ labelTypeValues: {
259
+ date: "Data",
260
+ text: "Texto",
261
+ integer: "Número Inteiro",
262
+ decimal: "Número com Decimal",
263
+ },
264
+ labelExpression: "Expressão",
265
+ labelCancel: "Cancelar",
266
+ labelSave: "Salvar"
267
+ };
268
+
250
269
  class SnkMessageBuilder {
251
270
  constructor() {
252
271
  this._defaults = {
@@ -264,7 +283,8 @@ class SnkMessageBuilder {
264
283
  snkGridConfig: snkGridConfigMessages,
265
284
  snkExporter: snkExporterMessages,
266
285
  snkDataExporter: snkDataExporterMessages,
267
- fileViewer: fileViewerMessages
286
+ fileViewer: fileViewerMessages,
287
+ snkFilterParamConfig: snkFilterParamConfigMessages
268
288
  };
269
289
  this._currentOperation = OperationMap.CLEAN;
270
290
  this.loadAppMessages().then((msgs) => {
@@ -15,6 +15,7 @@ export { SnkFilterList as SnkFilterList } from '../types/components/snk-filter-b
15
15
  export { SnkFilterModal as SnkFilterModal } from '../types/components/snk-filter-bar/filter-modal/snk-filter-modal';
16
16
  export { SnkFilterMultiSelect as SnkFilterMultiSelect } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select';
17
17
  export { SnkFilterPeriod as SnkFilterNumber } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-number';
18
+ export { SnkFilterParamConfig as SnkFilterParamConfig } from '../types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config';
18
19
  export { SnkFilterPeriod as SnkFilterPeriod } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-period';
19
20
  export { SnkFilterPersonalized as SnkFilterPersonalized } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized';
20
21
  export { SnkFilterSearch as SnkFilterSearch } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-search';
@@ -15,6 +15,7 @@ export { SnkFilterList, defineCustomElement as defineCustomElementSnkFilterList
15
15
  export { SnkFilterModal, defineCustomElement as defineCustomElementSnkFilterModal } from './snk-filter-modal.js';
16
16
  export { SnkFilterMultiSelect, defineCustomElement as defineCustomElementSnkFilterMultiSelect } from './snk-filter-multi-select.js';
17
17
  export { SnkFilterNumber, defineCustomElement as defineCustomElementSnkFilterNumber } from './snk-filter-number.js';
18
+ export { SnkFilterParamConfig, defineCustomElement as defineCustomElementSnkFilterParamConfig } from './snk-filter-param-config.js';
18
19
  export { SnkFilterPeriod, defineCustomElement as defineCustomElementSnkFilterPeriod } from './snk-filter-period.js';
19
20
  export { SnkFilterPersonalized, defineCustomElement as defineCustomElementSnkFilterPersonalized } from './snk-filter-personalized.js';
20
21
  export { SnkFilterSearch, defineCustomElement as defineCustomElementSnkFilterSearch } from './snk-filter-search.js';
@@ -29,5 +29,39 @@ var DataExporterType;
29
29
  DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
30
30
  DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
31
31
  })(DataExporterType || (DataExporterType = {}));
32
+ var FilterConfigType;
33
+ (function (FilterConfigType) {
34
+ FilterConfigType["SYSTEM_CONFIG"] = "S";
35
+ FilterConfigType["USER_CONFIG"] = "E";
36
+ })(FilterConfigType || (FilterConfigType = {}));
37
+ var FilterUserConfigTypes;
38
+ (function (FilterUserConfigTypes) {
39
+ FilterUserConfigTypes["DATE"] = "D";
40
+ FilterUserConfigTypes["TEXT"] = "S";
41
+ FilterUserConfigTypes["INTEGER"] = "I";
42
+ FilterUserConfigTypes["DECIMAL"] = "F";
43
+ })(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
44
+ var FilterOperand;
45
+ (function (FilterOperand) {
46
+ FilterOperand["AND"] = "AND";
47
+ FilterOperand["OR"] = "OR";
48
+ FilterOperand["IN"] = "IN";
49
+ FilterOperand["DIFFERENT"] = "<>";
50
+ FilterOperand["LIKE"] = "LIKE";
51
+ FilterOperand["START_WITH"] = "LIKE_START";
52
+ FilterOperand["FINISHED_WITH"] = "LIKE_END";
53
+ FilterOperand["NULL"] = "NULL";
54
+ FilterOperand["NOT_NULL"] = "NOT NULL";
55
+ FilterOperand["EQUAL"] = "=";
56
+ FilterOperand["LARGER"] = ">";
57
+ FilterOperand["LARGER_EQUAL"] = ">=";
58
+ FilterOperand["SMALLER"] = "<";
59
+ FilterOperand["SMALLER_EQUAL"] = "<=";
60
+ })(FilterOperand || (FilterOperand = {}));
61
+ var FilterEntities;
62
+ (function (FilterEntities) {
63
+ FilterEntities["FIELD"] = "Campo";
64
+ FilterEntities["INSTANCE"] = "Instancia";
65
+ })(FilterEntities || (FilterEntities = {}));
32
66
 
33
- export { DataExporterOption as D, PresentationMode as P, DataExporterFormat as a, DataExporterType as b };
67
+ export { DataExporterOption as D, FilterOperand as F, PresentationMode as P, FilterConfigType as a, FilterEntities as b, FilterUserConfigTypes as c, DataExporterFormat as d, DataExporterType as e };
@@ -120,19 +120,19 @@ class PesquisaFetcher {
120
120
  })
121
121
  };
122
122
  }
123
+ const options = searchOptions != undefined
124
+ ? {
125
+ "pkFieldName": searchOptions.codeFieldName,
126
+ "label": searchOptions.descriptionFieldName,
127
+ "fieldName": searchOptions.codeFieldName,
128
+ "useDescriptionOptions": false,
129
+ "enableRowsCounter": true
130
+ }
131
+ : undefined;
123
132
  const reqBody = {
124
133
  "serviceName": serviceName,
125
134
  "requestBody": {
126
- "criteria": {
127
- "entityName": entityName,
128
- "compacted": false,
129
- "ignoreEntityCriteria": false,
130
- "limit": this._defaultPageSize,
131
- "query": { "$": argument },
132
- "orderByDesc": false,
133
- "externalCriteria": externalCriteria,
134
- "localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity
135
- },
135
+ "criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity }, { options }),
136
136
  "clientEventList": {
137
137
  "clientEvent": []
138
138
  }
@@ -2,9 +2,10 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { V as VIEW_MODE } from './constants.js';
4
4
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
5
- import { P as PresentationMode, d as defineCustomElement$g } from './snk-data-exporter2.js';
5
+ import { P as PresentationMode } from './index2.js';
6
6
  import { d as defineCustomElement$i } from './snk-config-options2.js';
7
7
  import { d as defineCustomElement$h } from './snk-configurator2.js';
8
+ import { d as defineCustomElement$g } from './snk-data-exporter2.js';
8
9
  import { d as defineCustomElement$f } from './snk-exporter-email-sender2.js';
9
10
  import { d as defineCustomElement$e } from './snk-field-config2.js';
10
11
  import { d as defineCustomElement$d } from './snk-filter-bar2.js';
@@ -1,42 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
+ import { D as DataExporterOption, d as DataExporterFormat, e as DataExporterType } from './index2.js';
4
5
  import { K as KEY_PORT_EXPORT, W as WEB_CONNECTION, R as REPORT_LAUNCHER_RESOURCE_ID } from './constants.js';
5
6
  import { D as DataFetcher } from './DataFetcher.js';
6
7
  import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
7
8
 
8
- var PresentationMode;
9
- (function (PresentationMode) {
10
- PresentationMode["PRIMARY"] = "primary";
11
- PresentationMode["SECONDARY"] = "secondary";
12
- })(PresentationMode || (PresentationMode = {}));
13
- var DataExporterOption;
14
- (function (DataExporterOption) {
15
- DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
16
- DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
17
- DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
18
- DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
19
- DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
20
- DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
21
- DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
22
- DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
23
- })(DataExporterOption || (DataExporterOption = {}));
24
- var DataExporterFormat;
25
- (function (DataExporterFormat) {
26
- DataExporterFormat["PDF"] = "exportPDFToEmail";
27
- DataExporterFormat["XLS"] = "exportXLSToEmail";
28
- DataExporterFormat["XLSX"] = "exportXLSToEmail";
29
- })(DataExporterFormat || (DataExporterFormat = {}));
30
- var DataExporterType;
31
- (function (DataExporterType) {
32
- DataExporterType["EXPORT_TO_PDF"] = "PDF";
33
- DataExporterType["EXPORT_TO_XLS"] = "XLS";
34
- DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
35
- DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
36
- DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
37
- DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
38
- })(DataExporterType || (DataExporterType = {}));
39
-
40
9
  class ItemBuilder {
41
10
  constructor(getMessage, selectedNumber) {
42
11
  this._selectedNumber = 0;
@@ -563,4 +532,4 @@ function defineCustomElement() {
563
532
  } });
564
533
  }
565
534
 
566
- export { PresentationMode as P, SnkDataExporter as S, defineCustomElement as d };
535
+ export { SnkDataExporter as S, defineCustomElement as d };
@@ -1,5 +1,6 @@
1
1
  import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
3
4
 
4
5
  const EmailInfoStep = ({ getMessage, changeInfo, data }) => {
5
6
  const { format, email } = data || {};
@@ -117,8 +118,8 @@ const SnkExporterEmailSender = /*@__PURE__*/ proxyCustomElement(class extends HT
117
118
  }
118
119
  render() {
119
120
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'snkExporterEmailSender');
120
- return (h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, h("ez-modal-container", { onEzModalAction: evt => {
121
- if (evt.detail === "CLOSE")
121
+ return (h("ez-popup", { useHeader: false, size: "x-small", heightMode: "auto", opened: this._opened }, h("ez-modal-container", { onEzModalAction: (evt) => {
122
+ if (evt.detail === ModalAction.CLOSE)
122
123
  this.close();
123
124
  }, modalTitle: this.getMessage("snkExporter.emailSenderTitle"), modalSubTitle: this.getStepMessage("subTitle") }, h("ez-view-stack", { ref: ref => this._viewStack = ref }, h("stack-item", null, h(OptionsStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateConfigInfo(field, value) })), h("stack-item", null, h(EmailInfoStep, { getMessage: this.getMessage, data: this._config, changeInfo: (field, value) => this.updateEmailInfo(field, value) }))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-button--tertiary ez-padding-right--medium", label: this.getStepMessage("firstButton"), onClick: () => this.executeButtonAction(true), enabled: this.checkButtonEnabled(true) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("firstButton")}` })), h("ez-button", Object.assign({ class: this.getSecondButtonClass(), label: this.getStepMessage("secondButton"), onClick: () => this.executeButtonAction(false), enabled: this.checkButtonEnabled(false) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("secondButton")}` }))))));
124
125
  }
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterParamConfig extends Components.SnkFilterParamConfig, HTMLElement {}
4
+ export const SnkFilterParamConfig: {
5
+ prototype: SnkFilterParamConfig;
6
+ new (): SnkFilterParamConfig;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;