@sankhyalabs/sankhyablocks 8.14.17 → 8.14.19

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 (45) hide show
  1. package/dist/cjs/{pesquisa-fetcher-ef050a47.js → pesquisa-fetcher-704fedc1.js} +1 -8
  2. package/dist/cjs/snk-actions-button.cjs.entry.js +1 -1
  3. package/dist/cjs/snk-application.cjs.entry.js +22 -1
  4. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  5. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  6. package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -2
  7. package/dist/cjs/{snk-guides-viewer-bcb5c630.js → snk-guides-viewer-6004a55b.js} +1 -1
  8. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -1
  10. package/dist/cjs/snk-simple-crud.cjs.entry.js +1 -1
  11. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +3 -1
  12. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +17 -2
  13. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  14. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -8
  15. package/dist/components/dataunit-fetcher.js +1 -8
  16. package/dist/components/snk-application2.js +21 -0
  17. package/dist/components/snk-filter-bar2.js +17 -2
  18. package/dist/components/snk-personalized-filter-editor.js +3 -1
  19. package/dist/esm/{pesquisa-fetcher-dd3ca0a5.js → pesquisa-fetcher-9ae1496d.js} +1 -8
  20. package/dist/esm/snk-actions-button.entry.js +1 -1
  21. package/dist/esm/snk-application.entry.js +22 -1
  22. package/dist/esm/snk-crud.entry.js +1 -1
  23. package/dist/esm/snk-detail-view.entry.js +2 -2
  24. package/dist/esm/snk-filter-bar.entry.js +17 -2
  25. package/dist/esm/{snk-guides-viewer-29f6817c.js → snk-guides-viewer-85a42e64.js} +1 -1
  26. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  27. package/dist/esm/snk-personalized-filter-editor.entry.js +3 -1
  28. package/dist/esm/snk-simple-crud.entry.js +1 -1
  29. package/dist/sankhyablocks/{p-3e810565.entry.js → p-2bf377b1.entry.js} +1 -1
  30. package/dist/sankhyablocks/{p-f348f76d.entry.js → p-4bf52c0c.entry.js} +1 -1
  31. package/dist/sankhyablocks/{p-a423d684.js → p-716f724b.js} +1 -1
  32. package/dist/sankhyablocks/p-81dd64dd.entry.js +1 -0
  33. package/dist/sankhyablocks/p-94fcabc2.entry.js +1 -0
  34. package/dist/sankhyablocks/{p-d9bb09b3.js → p-aee5f67c.js} +1 -1
  35. package/dist/sankhyablocks/p-b11aa1e0.entry.js +1 -0
  36. package/dist/sankhyablocks/{p-b7258074.entry.js → p-be9137a4.entry.js} +1 -1
  37. package/dist/sankhyablocks/{p-8f09ffba.entry.js → p-c324d45e.entry.js} +1 -1
  38. package/dist/sankhyablocks/{p-ff2041bb.entry.js → p-fb7462fb.entry.js} +3 -3
  39. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  40. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -0
  41. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/dist/sankhyablocks/p-c758265f.entry.js +0 -1
  44. package/dist/sankhyablocks/p-f2056f66.entry.js +0 -1
  45. package/dist/sankhyablocks/p-fcefcadd.entry.js +0 -1
@@ -82,14 +82,7 @@ class PesquisaFetcher {
82
82
  };
83
83
  }
84
84
  const options = searchOptions != undefined
85
- ? {
86
- "pkFieldName": searchOptions.codeFieldName,
87
- "label": searchOptions.descriptionFieldName,
88
- "fieldName": searchOptions.codeFieldName,
89
- "useDescriptionOptions": false,
90
- "enableRowsCounter": true
91
- }
92
- : undefined;
85
+ ? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
93
86
  const reqBody = {
94
87
  "serviceName": serviceName,
95
88
  "requestBody": {
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const DataFetcher = require('./DataFetcher-ba94ed5b.js');
8
8
  const ParamType = require('./ParamType-90b440a0.js');
9
- require('./pesquisa-fetcher-ef050a47.js');
9
+ require('./pesquisa-fetcher-704fedc1.js');
10
10
  require('./index-0e663819.js');
11
11
  require('./ISave-d68ce3cd.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -9,7 +9,7 @@ const ConfigStorage = require('./ConfigStorage-8009ecb2.js');
9
9
  const DataFetcher = require('./DataFetcher-ba94ed5b.js');
10
10
  const authFetcher = require('./auth-fetcher-c8467c07.js');
11
11
  const dataunitFetcher = require('./dataunit-fetcher-06df1c3b.js');
12
- const pesquisaFetcher = require('./pesquisa-fetcher-ef050a47.js');
12
+ const pesquisaFetcher = require('./pesquisa-fetcher-704fedc1.js');
13
13
  const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
14
14
  require('./form-config-fetcher-df043d3d.js');
15
15
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -31,7 +31,22 @@ const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_
31
31
 
32
32
  class ParametersFetcher {
33
33
  constructor() {
34
+ this._embeddedParams = new Map();
34
35
  this.templateByQuery = new Map();
36
+ try {
37
+ if (window["MGE_PARAMS"] != undefined) {
38
+ const source = atob(window['MGE_PARAMS']);
39
+ const params = source.split('__;__');
40
+ params.forEach(param => {
41
+ const [key, value] = param.split("__=__");
42
+ this._embeddedParams.set(key, value);
43
+ });
44
+ }
45
+ }
46
+ catch (error) {
47
+ console.error("Problemas ao obter parâmetros embarcados");
48
+ console.error(error);
49
+ }
35
50
  this.buldTemplates();
36
51
  }
37
52
  buldTemplates() {
@@ -43,6 +58,9 @@ class ParametersFetcher {
43
58
  }`);
44
59
  }
45
60
  async getParam(name) {
61
+ if (this._embeddedParams.has(name)) {
62
+ return Promise.resolve(this._embeddedParams.get(name));
63
+ }
46
64
  const completPath = `param://application?params=${name}`;
47
65
  return DataFetcher.DataFetcher.get().callGraphQL({
48
66
  values: { name: completPath },
@@ -80,6 +98,9 @@ class ParametersFetcher {
80
98
  if (Array.isArray(obj) && obj.length > 0) {
81
99
  obj = obj[0];
82
100
  }
101
+ if (typeof obj === "string") {
102
+ return obj;
103
+ }
83
104
  if (core.StringUtils.isEmpty(obj.resource))
84
105
  return "";
85
106
  try {
@@ -6,7 +6,7 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
8
8
  require('./DataFetcher-ba94ed5b.js');
9
- require('./pesquisa-fetcher-ef050a47.js');
9
+ require('./pesquisa-fetcher-704fedc1.js');
10
10
  const index$1 = require('./index-0e663819.js');
11
11
  require('./ISave-d68ce3cd.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
7
7
  const SnkFormConfigManager = require('./SnkFormConfigManager-7d850fbc.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
- require('./pesquisa-fetcher-ef050a47.js');
10
+ require('./pesquisa-fetcher-704fedc1.js');
11
11
  const index$1 = require('./index-0e663819.js');
12
12
  require('./ISave-d68ce3cd.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -18,7 +18,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
18
18
  require('./form-config-fetcher-df043d3d.js');
19
19
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
20
20
  const constants = require('./constants-35ddd366.js');
21
- const snkGuidesViewer = require('./snk-guides-viewer-bcb5c630.js');
21
+ const snkGuidesViewer = require('./snk-guides-viewer-6004a55b.js');
22
22
  const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
23
23
  require('./ConfigStorage-8009ecb2.js');
24
24
  require('./PrintUtils-bcaeb82f.js');
@@ -259,6 +259,7 @@ const SnkFilterBar = class {
259
259
  this._updateSequence = [];
260
260
  this._loadingPending = false;
261
261
  this._configUpdated = false;
262
+ this._firstLoad = true;
262
263
  this._pendingVariables = false;
263
264
  this._customfiltersToBeUpdated = [];
264
265
  this._calculateSortIndex = (item) => {
@@ -411,13 +412,27 @@ const SnkFilterBar = class {
411
412
  return;
412
413
  }
413
414
  this._loadingPending = false;
414
- this.dataUnit.loadData(undefined, undefined, true);
415
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
415
416
  }
416
417
  if (this._configUpdated) {
417
418
  this._configUpdated = false;
418
419
  ConfigStorage.ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
419
420
  }
420
421
  }
422
+ async doLoadData(forceReload = false) {
423
+ try {
424
+ if (this._firstLoad && !forceReload) {
425
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
426
+ if (!autoLoad) {
427
+ return;
428
+ }
429
+ }
430
+ this.dataUnit.loadData(undefined, undefined, true);
431
+ }
432
+ finally {
433
+ this._firstLoad = false;
434
+ }
435
+ }
421
436
  /**
422
437
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
423
438
  * através de um pequeno modulo na estrutura da aplicação:
@@ -452,7 +467,7 @@ const SnkFilterBar = class {
452
467
  registryFilterProvider() {
453
468
  this.dataUnit.addFilterProvider(this);
454
469
  if (this.filterConfig) {
455
- this.dataUnit.loadData(undefined, undefined, true);
470
+ this.doLoadData();
456
471
  }
457
472
  }
458
473
  itemFocused(selectedItem) {
@@ -8,7 +8,7 @@ const fieldSearch = require('./field-search-ca27041a.js');
8
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./DataFetcher-ba94ed5b.js');
11
- require('./pesquisa-fetcher-ef050a47.js');
11
+ require('./pesquisa-fetcher-704fedc1.js');
12
12
  const index$1 = require('./index-0e663819.js');
13
13
  require('./ISave-d68ce3cd.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-bcb5c630.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-6004a55b.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-7d850fbc.js');
@@ -18,7 +18,7 @@ require('./taskbar-elements-39949c7a.js');
18
18
  require('./index-0e663819.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./constants-35ddd366.js');
21
- require('./pesquisa-fetcher-ef050a47.js');
21
+ require('./pesquisa-fetcher-704fedc1.js');
22
22
  require('./ISave-d68ce3cd.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
24
24
  require('./dataunit-fetcher-06df1c3b.js');
@@ -67,8 +67,10 @@ const SnkFilterPersonalized = class {
67
67
  return this.presentationMode === presentationMode.EPresentationMode.MODAL;
68
68
  }
69
69
  doSearch(mode, argument, param) {
70
+ const context = Object.assign({}, param.searchContext);
71
+ context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
70
72
  return new Promise((resolve, reject) => {
71
- this._application.executePreparedSearch(mode, argument, param.searchContext)
73
+ this._application.executePreparedSearch(mode, argument, context)
72
74
  .then(result => {
73
75
  resolve(result);
74
76
  }).catch(reason => {
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
7
7
  const constants = require('./constants-35ddd366.js');
8
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
- require('./pesquisa-fetcher-ef050a47.js');
10
+ require('./pesquisa-fetcher-704fedc1.js');
11
11
  const index$1 = require('./index-0e663819.js');
12
12
  require('./ISave-d68ce3cd.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
@@ -55,8 +55,10 @@ export class SnkFilterPersonalized {
55
55
  return this.presentationMode === EPresentationMode.MODAL;
56
56
  }
57
57
  doSearch(mode, argument, param) {
58
+ const context = Object.assign({}, param.searchContext);
59
+ context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
58
60
  return new Promise((resolve, reject) => {
59
- this._application.executePreparedSearch(mode, argument, param.searchContext)
61
+ this._application.executePreparedSearch(mode, argument, context)
60
62
  .then(result => {
61
63
  resolve(result);
62
64
  }).catch(reason => {
@@ -11,6 +11,7 @@ export class SnkFilterBar {
11
11
  this._updateSequence = [];
12
12
  this._loadingPending = false;
13
13
  this._configUpdated = false;
14
+ this._firstLoad = true;
14
15
  this._pendingVariables = false;
15
16
  this._customfiltersToBeUpdated = [];
16
17
  this._calculateSortIndex = (item) => {
@@ -164,13 +165,27 @@ export class SnkFilterBar {
164
165
  return;
165
166
  }
166
167
  this._loadingPending = false;
167
- this.dataUnit.loadData(undefined, undefined, true);
168
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
168
169
  }
169
170
  if (this._configUpdated) {
170
171
  this._configUpdated = false;
171
172
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
172
173
  }
173
174
  }
175
+ async doLoadData(forceReload = false) {
176
+ try {
177
+ if (this._firstLoad && !forceReload) {
178
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
179
+ if (!autoLoad) {
180
+ return;
181
+ }
182
+ }
183
+ this.dataUnit.loadData(undefined, undefined, true);
184
+ }
185
+ finally {
186
+ this._firstLoad = false;
187
+ }
188
+ }
174
189
  /**
175
190
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
176
191
  * através de um pequeno modulo na estrutura da aplicação:
@@ -205,7 +220,7 @@ export class SnkFilterBar {
205
220
  registryFilterProvider() {
206
221
  this.dataUnit.addFilterProvider(this);
207
222
  if (this.filterConfig) {
208
- this.dataUnit.loadData(undefined, undefined, true);
223
+ this.doLoadData();
209
224
  }
210
225
  }
211
226
  itemFocused(selectedItem) {
@@ -3,7 +3,22 @@ import { DateUtils, StringUtils, ObjectUtils } from "@sankhyalabs/core";
3
3
  import { DataFetcher } from "../DataFetcher";
4
4
  export default class ParametersFetcher {
5
5
  constructor() {
6
+ this._embeddedParams = new Map();
6
7
  this.templateByQuery = new Map();
8
+ try {
9
+ if (window["MGE_PARAMS"] != undefined) {
10
+ const source = atob(window['MGE_PARAMS']);
11
+ const params = source.split('__;__');
12
+ params.forEach(param => {
13
+ const [key, value] = param.split("__=__");
14
+ this._embeddedParams.set(key, value);
15
+ });
16
+ }
17
+ }
18
+ catch (error) {
19
+ console.error("Problemas ao obter parâmetros embarcados");
20
+ console.error(error);
21
+ }
7
22
  this.buldTemplates();
8
23
  }
9
24
  buldTemplates() {
@@ -15,6 +30,9 @@ export default class ParametersFetcher {
15
30
  }`);
16
31
  }
17
32
  async getParam(name) {
33
+ if (this._embeddedParams.has(name)) {
34
+ return Promise.resolve(this._embeddedParams.get(name));
35
+ }
18
36
  const completPath = `param://application?params=${name}`;
19
37
  return DataFetcher.get().callGraphQL({
20
38
  values: { name: completPath },
@@ -52,6 +70,9 @@ export default class ParametersFetcher {
52
70
  if (Array.isArray(obj) && obj.length > 0) {
53
71
  obj = obj[0];
54
72
  }
73
+ if (typeof obj === "string") {
74
+ return obj;
75
+ }
55
76
  if (StringUtils.isEmpty(obj.resource))
56
77
  return "";
57
78
  try {
@@ -80,14 +80,7 @@ export class PesquisaFetcher {
80
80
  };
81
81
  }
82
82
  const options = searchOptions != undefined
83
- ? {
84
- "pkFieldName": searchOptions.codeFieldName,
85
- "label": searchOptions.descriptionFieldName,
86
- "fieldName": searchOptions.codeFieldName,
87
- "useDescriptionOptions": false,
88
- "enableRowsCounter": true
89
- }
90
- : undefined;
83
+ ? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
91
84
  const reqBody = {
92
85
  "serviceName": serviceName,
93
86
  "requestBody": {
@@ -84,14 +84,7 @@ class PesquisaFetcher {
84
84
  };
85
85
  }
86
86
  const options = searchOptions != undefined
87
- ? {
88
- "pkFieldName": searchOptions.codeFieldName,
89
- "label": searchOptions.descriptionFieldName,
90
- "fieldName": searchOptions.codeFieldName,
91
- "useDescriptionOptions": false,
92
- "enableRowsCounter": true
93
- }
94
- : undefined;
87
+ ? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
95
88
  const reqBody = {
96
89
  "serviceName": serviceName,
97
90
  "requestBody": {
@@ -72,7 +72,22 @@ class TotalsFetcher {
72
72
 
73
73
  class ParametersFetcher {
74
74
  constructor() {
75
+ this._embeddedParams = new Map();
75
76
  this.templateByQuery = new Map();
77
+ try {
78
+ if (window["MGE_PARAMS"] != undefined) {
79
+ const source = atob(window['MGE_PARAMS']);
80
+ const params = source.split('__;__');
81
+ params.forEach(param => {
82
+ const [key, value] = param.split("__=__");
83
+ this._embeddedParams.set(key, value);
84
+ });
85
+ }
86
+ }
87
+ catch (error) {
88
+ console.error("Problemas ao obter parâmetros embarcados");
89
+ console.error(error);
90
+ }
76
91
  this.buldTemplates();
77
92
  }
78
93
  buldTemplates() {
@@ -84,6 +99,9 @@ class ParametersFetcher {
84
99
  }`);
85
100
  }
86
101
  async getParam(name) {
102
+ if (this._embeddedParams.has(name)) {
103
+ return Promise.resolve(this._embeddedParams.get(name));
104
+ }
87
105
  const completPath = `param://application?params=${name}`;
88
106
  return DataFetcher.get().callGraphQL({
89
107
  values: { name: completPath },
@@ -121,6 +139,9 @@ class ParametersFetcher {
121
139
  if (Array.isArray(obj) && obj.length > 0) {
122
140
  obj = obj[0];
123
141
  }
142
+ if (typeof obj === "string") {
143
+ return obj;
144
+ }
124
145
  if (StringUtils.isEmpty(obj.resource))
125
146
  return "";
126
147
  try {
@@ -261,6 +261,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
261
261
  this._updateSequence = [];
262
262
  this._loadingPending = false;
263
263
  this._configUpdated = false;
264
+ this._firstLoad = true;
264
265
  this._pendingVariables = false;
265
266
  this._customfiltersToBeUpdated = [];
266
267
  this._calculateSortIndex = (item) => {
@@ -413,13 +414,27 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
413
414
  return;
414
415
  }
415
416
  this._loadingPending = false;
416
- this.dataUnit.loadData(undefined, undefined, true);
417
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
417
418
  }
418
419
  if (this._configUpdated) {
419
420
  this._configUpdated = false;
420
421
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
421
422
  }
422
423
  }
424
+ async doLoadData(forceReload = false) {
425
+ try {
426
+ if (this._firstLoad && !forceReload) {
427
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
428
+ if (!autoLoad) {
429
+ return;
430
+ }
431
+ }
432
+ this.dataUnit.loadData(undefined, undefined, true);
433
+ }
434
+ finally {
435
+ this._firstLoad = false;
436
+ }
437
+ }
423
438
  /**
424
439
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
425
440
  * através de um pequeno modulo na estrutura da aplicação:
@@ -454,7 +469,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
454
469
  registryFilterProvider() {
455
470
  this.dataUnit.addFilterProvider(this);
456
471
  if (this.filterConfig) {
457
- this.dataUnit.loadData(undefined, undefined, true);
472
+ this.doLoadData();
458
473
  }
459
474
  }
460
475
  itemFocused(selectedItem) {
@@ -64,8 +64,10 @@ const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTM
64
64
  return this.presentationMode === EPresentationMode.MODAL;
65
65
  }
66
66
  doSearch(mode, argument, param) {
67
+ const context = Object.assign({}, param.searchContext);
68
+ context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
67
69
  return new Promise((resolve, reject) => {
68
- this._application.executePreparedSearch(mode, argument, param.searchContext)
70
+ this._application.executePreparedSearch(mode, argument, context)
69
71
  .then(result => {
70
72
  resolve(result);
71
73
  }).catch(reason => {
@@ -80,14 +80,7 @@ class PesquisaFetcher {
80
80
  };
81
81
  }
82
82
  const options = searchOptions != undefined
83
- ? {
84
- "pkFieldName": searchOptions.codeFieldName,
85
- "label": searchOptions.descriptionFieldName,
86
- "fieldName": searchOptions.codeFieldName,
87
- "useDescriptionOptions": false,
88
- "enableRowsCounter": true
89
- }
90
- : undefined;
83
+ ? Object.assign(Object.assign({}, searchOptions), { "pkFieldName": searchOptions.codeFieldName, "label": searchOptions.descriptionFieldName, "fieldName": searchOptions.codeFieldName, "useDescriptionOptions": false, "enableRowsCounter": true }) : undefined;
91
84
  const reqBody = {
92
85
  "serviceName": serviceName,
93
86
  "requestBody": {
@@ -2,7 +2,7 @@ import { r as registerInstance, h, H as Host, g as getElement } from './index-a7
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher-aa159c5a.js';
4
4
  import { P as ParamType } from './ParamType-d5152b06.js';
5
- import './pesquisa-fetcher-dd3ca0a5.js';
5
+ import './pesquisa-fetcher-9ae1496d.js';
6
6
  import './index-1564817d.js';
7
7
  import './ISave-4412b20c.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -5,7 +5,7 @@ import { C as ConfigStorage } from './ConfigStorage-1244b8b0.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-aa159c5a.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-c05dc474.js';
7
7
  import { D as DataUnitFetcher } from './dataunit-fetcher-00c108d5.js';
8
- import { P as PesquisaFetcher } from './pesquisa-fetcher-dd3ca0a5.js';
8
+ import { P as PesquisaFetcher } from './pesquisa-fetcher-9ae1496d.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-ca843d1b.js';
10
10
  import './form-config-fetcher-36219cd3.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
@@ -27,7 +27,22 @@ const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_
27
27
 
28
28
  class ParametersFetcher {
29
29
  constructor() {
30
+ this._embeddedParams = new Map();
30
31
  this.templateByQuery = new Map();
32
+ try {
33
+ if (window["MGE_PARAMS"] != undefined) {
34
+ const source = atob(window['MGE_PARAMS']);
35
+ const params = source.split('__;__');
36
+ params.forEach(param => {
37
+ const [key, value] = param.split("__=__");
38
+ this._embeddedParams.set(key, value);
39
+ });
40
+ }
41
+ }
42
+ catch (error) {
43
+ console.error("Problemas ao obter parâmetros embarcados");
44
+ console.error(error);
45
+ }
31
46
  this.buldTemplates();
32
47
  }
33
48
  buldTemplates() {
@@ -39,6 +54,9 @@ class ParametersFetcher {
39
54
  }`);
40
55
  }
41
56
  async getParam(name) {
57
+ if (this._embeddedParams.has(name)) {
58
+ return Promise.resolve(this._embeddedParams.get(name));
59
+ }
42
60
  const completPath = `param://application?params=${name}`;
43
61
  return DataFetcher.get().callGraphQL({
44
62
  values: { name: completPath },
@@ -76,6 +94,9 @@ class ParametersFetcher {
76
94
  if (Array.isArray(obj) && obj.length > 0) {
77
95
  obj = obj[0];
78
96
  }
97
+ if (typeof obj === "string") {
98
+ return obj;
99
+ }
79
100
  if (StringUtils.isEmpty(obj.resource))
80
101
  return "";
81
102
  try {
@@ -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-0a6b8b95.js';
4
4
  import './DataFetcher-aa159c5a.js';
5
- import './pesquisa-fetcher-dd3ca0a5.js';
5
+ import './pesquisa-fetcher-9ae1496d.js';
6
6
  import { P as PresentationMode } from './index-1564817d.js';
7
7
  import './ISave-4412b20c.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -3,7 +3,7 @@ import { Action } from '@sankhyalabs/core';
3
3
  import { S as SnkFormConfigManager } from './SnkFormConfigManager-9be0e7d4.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import './DataFetcher-aa159c5a.js';
6
- import './pesquisa-fetcher-dd3ca0a5.js';
6
+ import './pesquisa-fetcher-9ae1496d.js';
7
7
  import { P as PresentationMode } from './index-1564817d.js';
8
8
  import './ISave-4412b20c.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
@@ -14,7 +14,7 @@ import './filter-item-type.enum-d45e026f.js';
14
14
  import './form-config-fetcher-36219cd3.js';
15
15
  import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
16
16
  import { d as VIEW_MODE } from './constants-8457af36.js';
17
- import { S as SnkGuidesViewer } from './snk-guides-viewer-29f6817c.js';
17
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-85a42e64.js';
18
18
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-ca843d1b.js';
19
19
  import './ConfigStorage-1244b8b0.js';
20
20
  import './PrintUtils-3e4ff0f5.js';
@@ -255,6 +255,7 @@ const SnkFilterBar = class {
255
255
  this._updateSequence = [];
256
256
  this._loadingPending = false;
257
257
  this._configUpdated = false;
258
+ this._firstLoad = true;
258
259
  this._pendingVariables = false;
259
260
  this._customfiltersToBeUpdated = [];
260
261
  this._calculateSortIndex = (item) => {
@@ -407,13 +408,27 @@ const SnkFilterBar = class {
407
408
  return;
408
409
  }
409
410
  this._loadingPending = false;
410
- this.dataUnit.loadData(undefined, undefined, true);
411
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
411
412
  }
412
413
  if (this._configUpdated) {
413
414
  this._configUpdated = false;
414
415
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
415
416
  }
416
417
  }
418
+ async doLoadData(forceReload = false) {
419
+ try {
420
+ if (this._firstLoad && !forceReload) {
421
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
422
+ if (!autoLoad) {
423
+ return;
424
+ }
425
+ }
426
+ this.dataUnit.loadData(undefined, undefined, true);
427
+ }
428
+ finally {
429
+ this._firstLoad = false;
430
+ }
431
+ }
417
432
  /**
418
433
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
419
434
  * através de um pequeno modulo na estrutura da aplicação:
@@ -448,7 +463,7 @@ const SnkFilterBar = class {
448
463
  registryFilterProvider() {
449
464
  this.dataUnit.addFilterProvider(this);
450
465
  if (this.filterConfig) {
451
- this.dataUnit.loadData(undefined, undefined, true);
466
+ this.doLoadData();
452
467
  }
453
468
  }
454
469
  itemFocused(selectedItem) {
@@ -6,7 +6,7 @@ import { T as TaskbarProcessor, b as buildFieldSearch } from './field-search-c69
6
6
  import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
7
7
  import { d as VIEW_MODE } from './constants-8457af36.js';
8
8
  import './DataFetcher-aa159c5a.js';
9
- import './pesquisa-fetcher-dd3ca0a5.js';
9
+ import './pesquisa-fetcher-9ae1496d.js';
10
10
  import { P as PresentationMode } from './index-1564817d.js';
11
11
  import './ISave-4412b20c.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-29f6817c.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-85a42e64.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-9be0e7d4.js';
@@ -14,7 +14,7 @@ import './taskbar-elements-0a6b8b95.js';
14
14
  import './index-1564817d.js';
15
15
  import './index-bdf75557.js';
16
16
  import './constants-8457af36.js';
17
- import './pesquisa-fetcher-dd3ca0a5.js';
17
+ import './pesquisa-fetcher-9ae1496d.js';
18
18
  import './ISave-4412b20c.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
20
20
  import './dataunit-fetcher-00c108d5.js';
@@ -63,8 +63,10 @@ const SnkFilterPersonalized = class {
63
63
  return this.presentationMode === EPresentationMode.MODAL;
64
64
  }
65
65
  doSearch(mode, argument, param) {
66
+ const context = Object.assign({}, param.searchContext);
67
+ context.searchOptions = Object.assign(Object.assign({}, context.searchOptions), { showInactives: "true" });
66
68
  return new Promise((resolve, reject) => {
67
- this._application.executePreparedSearch(mode, argument, param.searchContext)
69
+ this._application.executePreparedSearch(mode, argument, context)
68
70
  .then(result => {
69
71
  resolve(result);
70
72
  }).catch(reason => {
@@ -3,7 +3,7 @@ import { ObjectUtils, ApplicationContext, DataType, UserInterface, JSUtils, Floa
3
3
  import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
4
4
  import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
5
5
  import './DataFetcher-aa159c5a.js';
6
- import './pesquisa-fetcher-dd3ca0a5.js';
6
+ import './pesquisa-fetcher-9ae1496d.js';
7
7
  import { P as PresentationMode } from './index-1564817d.js';
8
8
  import './ISave-4412b20c.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';