@sankhyalabs/sankhyablocks 8.16.0-dev.76 → 8.16.0-dev.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ContinuousInsertUtils-fff67c94.js → ContinuousInsertUtils-aa63f0a9.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-36d039c4.js → pesquisa-fetcher-5c583c93.js} +12 -5
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +19 -5
- package/dist/cjs/{snk-guides-viewer-00f17b65.js → snk-guides-viewer-c1c56eca.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
- package/dist/collection/components/snk-grid/snk-grid.js +17 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -5
- package/dist/components/ISave.js +12 -5
- package/dist/components/snk-grid2.js +17 -3
- package/dist/esm/{ContinuousInsertUtils-2bb81687.js → ContinuousInsertUtils-af683684.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-aab1fe14.js → pesquisa-fetcher-4284f2a3.js} +12 -5
- package/dist/esm/pesquisa-grid_2.entry.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +19 -5
- package/dist/esm/{snk-guides-viewer-e41d53d3.js → snk-guides-viewer-2b96b7f7.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +2 -2
- package/dist/sankhyablocks/{p-dbf2c7ea.entry.js → p-0c50ba37.entry.js} +2 -2
- package/dist/sankhyablocks/{p-dbd60c7d.js → p-15f5f702.js} +1 -1
- package/dist/sankhyablocks/{p-63e38a9e.entry.js → p-31c3c9d0.entry.js} +1 -1
- package/dist/sankhyablocks/p-41c3bee5.js +6 -0
- package/dist/sankhyablocks/{p-34692731.entry.js → p-43d58b74.entry.js} +1 -1
- package/dist/sankhyablocks/{p-adf31dc8.entry.js → p-538b3174.entry.js} +1 -1
- package/dist/sankhyablocks/p-6f546ad9.entry.js +1 -0
- package/dist/sankhyablocks/{p-3decf7ea.entry.js → p-78e91134.entry.js} +1 -1
- package/dist/sankhyablocks/{p-332b6975.entry.js → p-7d0627f4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-85116083.entry.js → p-80dd8976.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0af50c95.entry.js → p-c4d87e71.entry.js} +1 -1
- package/dist/sankhyablocks/{p-57cbcd43.js → p-c6aefba8.js} +1 -1
- package/dist/sankhyablocks/{p-1190411d.entry.js → p-c9eb2bf5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a86cef70.entry.js → p-d5687306.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +9 -2
- package/package.json +1 -1
- package/dist/sankhyablocks/p-c9f22653.js +0 -6
- package/dist/sankhyablocks/p-ee97cb65.entry.js +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
4
|
-
require('./pesquisa-fetcher-
|
4
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
5
5
|
const core = require('@sankhyalabs/core');
|
6
6
|
require('./index-1dfc7a6e.js');
|
7
7
|
require('./ISave-e91b70a7.js');
|
@@ -276,13 +276,13 @@ class PesquisaFetcher {
|
|
276
276
|
return parseLegacyTree(response);
|
277
277
|
}
|
278
278
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
279
|
-
var _a, _b
|
279
|
+
var _a, _b;
|
280
280
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
281
281
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
282
282
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
283
283
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
284
284
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
285
|
-
const params = (
|
285
|
+
const params = this.buildParams(listenerResult);
|
286
286
|
const instancia = {
|
287
287
|
'nome': entityName,
|
288
288
|
'nomeInstanciaLocal': rootEntity,
|
@@ -300,6 +300,14 @@ class PesquisaFetcher {
|
|
300
300
|
'instancia': instancia,
|
301
301
|
};
|
302
302
|
}
|
303
|
+
buildParams(listenerResult) {
|
304
|
+
var _a, _b;
|
305
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
306
|
+
params = params.map(param => {
|
307
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
308
|
+
});
|
309
|
+
return params;
|
310
|
+
}
|
303
311
|
}
|
304
312
|
function buildLoadGridConfigPayload(entityName) {
|
305
313
|
return {
|
@@ -337,9 +345,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
337
345
|
};
|
338
346
|
}
|
339
347
|
function convertParamType(dataType) {
|
340
|
-
//Alerta: Cuidado
|
341
|
-
//
|
342
|
-
//data (com ou sem hora) e string são realmente relevantes
|
348
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
349
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
343
350
|
switch (dataType) {
|
344
351
|
case core.DataType.NUMBER:
|
345
352
|
return "I";
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const dataunitFetcher = require('./dataunit-fetcher-c32fdff7.js');
|
7
7
|
require('./DataFetcher-65879b2c.js');
|
8
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
8
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
9
9
|
require('@sankhyalabs/core');
|
10
10
|
require('./index-1dfc7a6e.js');
|
11
11
|
require('./ISave-e91b70a7.js');
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
8
8
|
const ParamType = require('./ParamType-90b440a0.js');
|
9
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
10
10
|
require('./index-1dfc7a6e.js');
|
11
11
|
require('./ISave-e91b70a7.js');
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -9,7 +9,7 @@ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
9
9
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
10
10
|
const authFetcher = require('./auth-fetcher-8480751c.js');
|
11
11
|
const dataunitFetcher = require('./dataunit-fetcher-c32fdff7.js');
|
12
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
12
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
13
13
|
const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
|
14
14
|
const constants = require('./constants-241934b3.js');
|
15
15
|
require('./form-config-fetcher-90126e4c.js');
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
8
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
9
9
|
require('./index-1dfc7a6e.js');
|
10
10
|
const ISave = require('./ISave-e91b70a7.js');
|
11
11
|
const dataunitFetcher = require('./dataunit-fetcher-c32fdff7.js');
|
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
8
8
|
require('./DataFetcher-65879b2c.js');
|
9
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
10
10
|
const index$1 = require('./index-1dfc7a6e.js');
|
11
11
|
require('./ISave-e91b70a7.js');
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -9,7 +9,7 @@ const index = require('./index-1dfc7a6e.js');
|
|
9
9
|
const constants = require('./constants-241934b3.js');
|
10
10
|
const DataFetcher = require('./DataFetcher-65879b2c.js');
|
11
11
|
const snkDataUnit = require('./snk-data-unit-2c7c1964.js');
|
12
|
-
require('./pesquisa-fetcher-
|
12
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
13
13
|
require('./ISave-e91b70a7.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const SnkFormConfigManager = require('./SnkFormConfigManager-c11d8468.js');
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
9
9
|
require('./DataFetcher-65879b2c.js');
|
10
|
-
require('./pesquisa-fetcher-
|
10
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
11
11
|
const index$1 = require('./index-1dfc7a6e.js');
|
12
12
|
require('./ISave-e91b70a7.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -17,7 +17,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
17
17
|
require('./form-config-fetcher-90126e4c.js');
|
18
18
|
const constants = require('./constants-241934b3.js');
|
19
19
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
20
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
20
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c1c56eca.js');
|
21
21
|
const SnkMessageBuilder = require('./SnkMessageBuilder-bae64d0d.js');
|
22
22
|
require('./ConfigStorage-d024aec8.js');
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -9,10 +9,10 @@ const ConfigStorage = require('./ConfigStorage-d024aec8.js');
|
|
9
9
|
const index$1 = require('./index-1dfc7a6e.js');
|
10
10
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-aa63f0a9.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
14
14
|
require('./DataFetcher-65879b2c.js');
|
15
|
-
require('./pesquisa-fetcher-
|
15
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
16
16
|
require('./ISave-e91b70a7.js');
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -285,10 +285,24 @@ const SnkGrid = class {
|
|
285
285
|
this._gridConfig = config;
|
286
286
|
ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
287
287
|
}
|
288
|
+
fixColumNameCharset(columnName) {
|
289
|
+
try {
|
290
|
+
return decodeURIComponent(escape(columnName));
|
291
|
+
}
|
292
|
+
catch (e) {
|
293
|
+
return columnName;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
normalizeGridConfig(config) {
|
297
|
+
if (!config)
|
298
|
+
return config;
|
299
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
300
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
301
|
+
}
|
288
302
|
loadConfig() {
|
289
303
|
ConfigStorage.ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
290
304
|
.then((config) => {
|
291
|
-
this.setGridConfig(config);
|
305
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
292
306
|
})
|
293
307
|
.catch((error) => {
|
294
308
|
console.warn(error);
|
@@ -300,12 +314,12 @@ const SnkGrid = class {
|
|
300
314
|
}
|
301
315
|
}
|
302
316
|
gridConfigChangeHandler(evt) {
|
303
|
-
const config = evt.detail;
|
317
|
+
const config = this.normalizeGridConfig(evt.detail);
|
304
318
|
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
305
319
|
evt.stopPropagation();
|
306
320
|
}
|
307
321
|
modalConfigChangeHandler(evt) {
|
308
|
-
const config = evt.detail;
|
322
|
+
const config = this.normalizeGridConfig(evt.detail);
|
309
323
|
this._grid.setColumnsState(config.columns)
|
310
324
|
.then(() => {
|
311
325
|
this.setGridConfig(config);
|
@@ -8,7 +8,7 @@ const fieldSearch = require('./field-search-68e34bf4.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
9
9
|
const constants = require('./constants-241934b3.js');
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
11
|
-
require('./pesquisa-fetcher-
|
11
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
12
12
|
const index$1 = require('./index-1dfc7a6e.js');
|
13
13
|
require('./ISave-e91b70a7.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-c1c56eca.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-c11d8468.js');
|
@@ -18,7 +18,7 @@ require('./field-search-68e34bf4.js');
|
|
18
18
|
require('./taskbar-elements-9ad1f9c0.js');
|
19
19
|
require('./index-1dfc7a6e.js');
|
20
20
|
require('./index-102ba62d.js');
|
21
|
-
require('./pesquisa-fetcher-
|
21
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
22
22
|
require('./ISave-e91b70a7.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
24
|
require('./dataunit-fetcher-c32fdff7.js');
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
7
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-5c583c93.js');
|
8
8
|
require('./DataFetcher-65879b2c.js');
|
9
9
|
require('./index-1dfc7a6e.js');
|
10
10
|
require('./ISave-e91b70a7.js');
|
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const constants = require('./constants-241934b3.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
10
10
|
require('./DataFetcher-65879b2c.js');
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
11
|
+
require('./pesquisa-fetcher-5c583c93.js');
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-aa63f0a9.js');
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
14
14
|
require('./ISave-e91b70a7.js');
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
@@ -211,10 +211,24 @@ export class SnkGrid {
|
|
211
211
|
this._gridConfig = config;
|
212
212
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
213
213
|
}
|
214
|
+
fixColumNameCharset(columnName) {
|
215
|
+
try {
|
216
|
+
return decodeURIComponent(escape(columnName));
|
217
|
+
}
|
218
|
+
catch (e) {
|
219
|
+
return columnName;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
normalizeGridConfig(config) {
|
223
|
+
if (!config)
|
224
|
+
return config;
|
225
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
226
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
227
|
+
}
|
214
228
|
loadConfig() {
|
215
229
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
216
230
|
.then((config) => {
|
217
|
-
this.setGridConfig(config);
|
231
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
218
232
|
})
|
219
233
|
.catch((error) => {
|
220
234
|
console.warn(error);
|
@@ -226,12 +240,12 @@ export class SnkGrid {
|
|
226
240
|
}
|
227
241
|
}
|
228
242
|
gridConfigChangeHandler(evt) {
|
229
|
-
const config = evt.detail;
|
243
|
+
const config = this.normalizeGridConfig(evt.detail);
|
230
244
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
231
245
|
evt.stopPropagation();
|
232
246
|
}
|
233
247
|
modalConfigChangeHandler(evt) {
|
234
|
-
const config = evt.detail;
|
248
|
+
const config = this.normalizeGridConfig(evt.detail);
|
235
249
|
this._grid.setColumnsState(config.columns)
|
236
250
|
.then(() => {
|
237
251
|
this.setGridConfig(config);
|
@@ -176,13 +176,13 @@ export class PesquisaFetcher {
|
|
176
176
|
return parseLegacyTree(response);
|
177
177
|
}
|
178
178
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
179
|
-
var _a, _b
|
179
|
+
var _a, _b;
|
180
180
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
181
181
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
182
182
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
183
183
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
184
184
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
185
|
-
const params = (
|
185
|
+
const params = this.buildParams(listenerResult);
|
186
186
|
const instancia = {
|
187
187
|
'nome': entityName,
|
188
188
|
'nomeInstanciaLocal': rootEntity,
|
@@ -200,6 +200,14 @@ export class PesquisaFetcher {
|
|
200
200
|
'instancia': instancia,
|
201
201
|
};
|
202
202
|
}
|
203
|
+
buildParams(listenerResult) {
|
204
|
+
var _a, _b;
|
205
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
206
|
+
params = params.map(param => {
|
207
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
208
|
+
});
|
209
|
+
return params;
|
210
|
+
}
|
203
211
|
}
|
204
212
|
function buildLoadGridConfigPayload(entityName) {
|
205
213
|
return {
|
@@ -237,9 +245,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
237
245
|
};
|
238
246
|
}
|
239
247
|
function convertParamType(dataType) {
|
240
|
-
//Alerta: Cuidado
|
241
|
-
//
|
242
|
-
//data (com ou sem hora) e string são realmente relevantes
|
248
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
249
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
243
250
|
switch (dataType) {
|
244
251
|
case DataType.NUMBER:
|
245
252
|
return "I";
|
package/dist/components/ISave.js
CHANGED
@@ -274,13 +274,13 @@ class PesquisaFetcher {
|
|
274
274
|
return parseLegacyTree(response);
|
275
275
|
}
|
276
276
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
277
|
-
var _a, _b
|
277
|
+
var _a, _b;
|
278
278
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
279
279
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
280
280
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
281
281
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
282
282
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
283
|
-
const params = (
|
283
|
+
const params = this.buildParams(listenerResult);
|
284
284
|
const instancia = {
|
285
285
|
'nome': entityName,
|
286
286
|
'nomeInstanciaLocal': rootEntity,
|
@@ -298,6 +298,14 @@ class PesquisaFetcher {
|
|
298
298
|
'instancia': instancia,
|
299
299
|
};
|
300
300
|
}
|
301
|
+
buildParams(listenerResult) {
|
302
|
+
var _a, _b;
|
303
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
304
|
+
params = params.map(param => {
|
305
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
306
|
+
});
|
307
|
+
return params;
|
308
|
+
}
|
301
309
|
}
|
302
310
|
function buildLoadGridConfigPayload(entityName) {
|
303
311
|
return {
|
@@ -335,9 +343,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
335
343
|
};
|
336
344
|
}
|
337
345
|
function convertParamType(dataType) {
|
338
|
-
//Alerta: Cuidado
|
339
|
-
//
|
340
|
-
//data (com ou sem hora) e string são realmente relevantes
|
346
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
347
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
341
348
|
switch (dataType) {
|
342
349
|
case DataType.NUMBER:
|
343
350
|
return "I";
|
@@ -291,10 +291,24 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
291
291
|
this._gridConfig = config;
|
292
292
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
293
293
|
}
|
294
|
+
fixColumNameCharset(columnName) {
|
295
|
+
try {
|
296
|
+
return decodeURIComponent(escape(columnName));
|
297
|
+
}
|
298
|
+
catch (e) {
|
299
|
+
return columnName;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
normalizeGridConfig(config) {
|
303
|
+
if (!config)
|
304
|
+
return config;
|
305
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
306
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
307
|
+
}
|
294
308
|
loadConfig() {
|
295
309
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
296
310
|
.then((config) => {
|
297
|
-
this.setGridConfig(config);
|
311
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
298
312
|
})
|
299
313
|
.catch((error) => {
|
300
314
|
console.warn(error);
|
@@ -306,12 +320,12 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
306
320
|
}
|
307
321
|
}
|
308
322
|
gridConfigChangeHandler(evt) {
|
309
|
-
const config = evt.detail;
|
323
|
+
const config = this.normalizeGridConfig(evt.detail);
|
310
324
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
311
325
|
evt.stopPropagation();
|
312
326
|
}
|
313
327
|
modalConfigChangeHandler(evt) {
|
314
|
-
const config = evt.detail;
|
328
|
+
const config = this.normalizeGridConfig(evt.detail);
|
315
329
|
this._grid.setColumnsState(config.columns)
|
316
330
|
.then(() => {
|
317
331
|
this.setGridConfig(config);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { D as DataFetcher } from './DataFetcher-5221b992.js';
|
2
|
-
import './pesquisa-fetcher-
|
2
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
3
3
|
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
4
4
|
import './index-3aa4977a.js';
|
5
5
|
import './ISave-d8c8bc59.js';
|
@@ -274,13 +274,13 @@ class PesquisaFetcher {
|
|
274
274
|
return parseLegacyTree(response);
|
275
275
|
}
|
276
276
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
277
|
-
var _a, _b
|
277
|
+
var _a, _b;
|
278
278
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
279
279
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
280
280
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
281
281
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
282
282
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
283
|
-
const params = (
|
283
|
+
const params = this.buildParams(listenerResult);
|
284
284
|
const instancia = {
|
285
285
|
'nome': entityName,
|
286
286
|
'nomeInstanciaLocal': rootEntity,
|
@@ -298,6 +298,14 @@ class PesquisaFetcher {
|
|
298
298
|
'instancia': instancia,
|
299
299
|
};
|
300
300
|
}
|
301
|
+
buildParams(listenerResult) {
|
302
|
+
var _a, _b;
|
303
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
304
|
+
params = params.map(param => {
|
305
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
306
|
+
});
|
307
|
+
return params;
|
308
|
+
}
|
301
309
|
}
|
302
310
|
function buildLoadGridConfigPayload(entityName) {
|
303
311
|
return {
|
@@ -335,9 +343,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
335
343
|
};
|
336
344
|
}
|
337
345
|
function convertParamType(dataType) {
|
338
|
-
//Alerta: Cuidado
|
339
|
-
//
|
340
|
-
//data (com ou sem hora) e string são realmente relevantes
|
346
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
347
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
341
348
|
switch (dataType) {
|
342
349
|
case DataType.NUMBER:
|
343
350
|
return "I";
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { I as InMemoryLoader } from './dataunit-fetcher-26c2bed4.js';
|
3
3
|
import './DataFetcher-5221b992.js';
|
4
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
4
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-4284f2a3.js';
|
5
5
|
import '@sankhyalabs/core';
|
6
6
|
import './index-3aa4977a.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent
|
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher-5221b992.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
6
6
|
import './index-3aa4977a.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -5,7 +5,7 @@ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
|
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-5221b992.js';
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-e32fe8a4.js';
|
7
7
|
import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-26c2bed4.js';
|
8
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
8
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-4284f2a3.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
10
10
|
import { T as TEMPLATES_SKELETON } from './constants-75abb876.js';
|
11
11
|
import './form-config-fetcher-126e2471.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher-5221b992.js';
|
4
|
-
import './pesquisa-fetcher-
|
4
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
5
5
|
import './index-3aa4977a.js';
|
6
6
|
import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
|
7
7
|
import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-26c2bed4.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
4
4
|
import './DataFetcher-5221b992.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
6
6
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -5,7 +5,7 @@ import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat
|
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-75abb876.js';
|
6
6
|
import { D as DataFetcher } from './DataFetcher-5221b992.js';
|
7
7
|
import { S as SnkDataUnit } from './snk-data-unit-a36df23f.js';
|
8
|
-
import './pesquisa-fetcher-
|
8
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
9
9
|
import './ISave-d8c8bc59.js';
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -3,7 +3,7 @@ import { Action } from '@sankhyalabs/core';
|
|
3
3
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager-5022f87f.js';
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import './DataFetcher-5221b992.js';
|
6
|
-
import './pesquisa-fetcher-
|
6
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
7
7
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
8
8
|
import './ISave-d8c8bc59.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -13,7 +13,7 @@ import './filter-item-type.enum-d45e026f.js';
|
|
13
13
|
import './form-config-fetcher-126e2471.js';
|
14
14
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
15
15
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-2b96b7f7.js';
|
17
17
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
18
18
|
import './ConfigStorage-373bb440.js';
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -5,10 +5,10 @@ import { C as ConfigStorage } from './ConfigStorage-373bb440.js';
|
|
5
5
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
6
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-af683684.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
10
|
import './DataFetcher-5221b992.js';
|
11
|
-
import './pesquisa-fetcher-
|
11
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
12
12
|
import './ISave-d8c8bc59.js';
|
13
13
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
14
14
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -281,10 +281,24 @@ const SnkGrid = class {
|
|
281
281
|
this._gridConfig = config;
|
282
282
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
283
283
|
}
|
284
|
+
fixColumNameCharset(columnName) {
|
285
|
+
try {
|
286
|
+
return decodeURIComponent(escape(columnName));
|
287
|
+
}
|
288
|
+
catch (e) {
|
289
|
+
return columnName;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
normalizeGridConfig(config) {
|
293
|
+
if (!config)
|
294
|
+
return config;
|
295
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
296
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
297
|
+
}
|
284
298
|
loadConfig() {
|
285
299
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
286
300
|
.then((config) => {
|
287
|
-
this.setGridConfig(config);
|
301
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
288
302
|
})
|
289
303
|
.catch((error) => {
|
290
304
|
console.warn(error);
|
@@ -296,12 +310,12 @@ const SnkGrid = class {
|
|
296
310
|
}
|
297
311
|
}
|
298
312
|
gridConfigChangeHandler(evt) {
|
299
|
-
const config = evt.detail;
|
313
|
+
const config = this.normalizeGridConfig(evt.detail);
|
300
314
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
301
315
|
evt.stopPropagation();
|
302
316
|
}
|
303
317
|
modalConfigChangeHandler(evt) {
|
304
|
-
const config = evt.detail;
|
318
|
+
const config = this.normalizeGridConfig(evt.detail);
|
305
319
|
this._grid.setColumnsState(config.columns)
|
306
320
|
.then(() => {
|
307
321
|
this.setGridConfig(config);
|
@@ -6,7 +6,7 @@ import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } fr
|
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
7
7
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
8
8
|
import './DataFetcher-5221b992.js';
|
9
|
-
import './pesquisa-fetcher-
|
9
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
10
10
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
11
11
|
import './ISave-d8c8bc59.js';
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-2b96b7f7.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
4
|
import './SnkFormConfigManager-5022f87f.js';
|
@@ -14,7 +14,7 @@ import './field-search-f8b1d91e.js';
|
|
14
14
|
import './taskbar-elements-d59867f1.js';
|
15
15
|
import './index-3aa4977a.js';
|
16
16
|
import './index-bdf75557.js';
|
17
|
-
import './pesquisa-fetcher-
|
17
|
+
import './pesquisa-fetcher-4284f2a3.js';
|
18
18
|
import './ISave-d8c8bc59.js';
|
19
19
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
20
20
|
import './dataunit-fetcher-26c2bed4.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ObjectUtils, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './pesquisa-fetcher-
|
3
|
+
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './pesquisa-fetcher-4284f2a3.js';
|
4
4
|
import './DataFetcher-5221b992.js';
|
5
5
|
import './index-3aa4977a.js';
|
6
6
|
import './ISave-d8c8bc59.js';
|