@sankhyalabs/sankhyablocks 1.3.21 → 1.3.24

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 (35) hide show
  1. package/dist/cjs/{index-dcacd71c.js → index-1133bc2a.js} +55 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  4. package/dist/cjs/snk-application.cjs.entry.js +107 -27
  5. package/dist/cjs/snk-pesquisa.cjs.entry.js +296 -3
  6. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  7. package/dist/collection/components/snk-application/snk-application.js +167 -5
  8. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +92 -1
  9. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +311 -6
  10. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +2 -14
  11. package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js +29 -0
  12. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +8 -7
  13. package/dist/components/snk-application2.js +112 -28
  14. package/dist/components/snk-pesquisa2.js +300 -6
  15. package/dist/esm/{index-b13a53d8.js → index-ffda6382.js} +55 -1
  16. package/dist/esm/loader.js +2 -2
  17. package/dist/esm/sankhyablocks.js +2 -2
  18. package/dist/esm/snk-application.entry.js +108 -28
  19. package/dist/esm/snk-pesquisa.entry.js +296 -3
  20. package/dist/esm/teste-pesquisa.entry.js +1 -1
  21. package/dist/sankhyablocks/{p-28a5ef28.entry.js → p-2a7b4cb3.entry.js} +1 -1
  22. package/dist/sankhyablocks/p-9ba08cf0.entry.js +68 -0
  23. package/dist/sankhyablocks/p-d62412bb.entry.js +1 -0
  24. package/dist/sankhyablocks/p-edcb9d8e.js +2 -0
  25. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  26. package/dist/types/components/snk-application/snk-application.d.ts +87 -0
  27. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +44 -2
  28. package/dist/types/components.d.ts +9 -2
  29. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -1
  30. package/dist/types/lib/http/data-fetcher/fetchers/auth-fetcher.d.ts +17 -0
  31. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +3 -2
  32. package/package.json +2 -2
  33. package/dist/sankhyablocks/p-0b1577eb.entry.js +0 -1
  34. package/dist/sankhyablocks/p-4e116571.js +0 -2
  35. package/dist/sankhyablocks/p-dedc8d7b.entry.js +0 -68
@@ -183,6 +183,19 @@ const h = (nodeName, vnodeData, ...children) => {
183
183
  }
184
184
  };
185
185
  walk(children);
186
+ if (vnodeData) {
187
+ {
188
+ const classData = vnodeData.className || vnodeData.class;
189
+ if (classData) {
190
+ vnodeData.class =
191
+ typeof classData !== 'object'
192
+ ? classData
193
+ : Object.keys(classData)
194
+ .filter((k) => classData[k])
195
+ .join(' ');
196
+ }
197
+ }
198
+ }
186
199
  const vnode = newVNode(nodeName, null);
187
200
  vnode.$attrs$ = vnodeData;
188
201
  if (vNodeChildren.length > 0) {
@@ -217,7 +230,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
217
230
  if (oldValue !== newValue) {
218
231
  let isProp = isMemberInElement(elm, memberName);
219
232
  let ln = memberName.toLowerCase();
220
- if (memberName === 'ref') {
233
+ if (memberName === 'class') {
234
+ const classList = elm.classList;
235
+ const oldClasses = parseClassList(oldValue);
236
+ const newClasses = parseClassList(newValue);
237
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
238
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
239
+ }
240
+ else if (memberName === 'ref') {
221
241
  // minifier will clean this up
222
242
  if (newValue) {
223
243
  newValue(elm);
@@ -299,6 +319,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
299
319
  }
300
320
  }
301
321
  };
322
+ const parseClassListRegex = /\s/;
323
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
302
324
  const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
303
325
  // if the element passed in is a shadow root, which is a document fragment
304
326
  // then we want to be adding attrs/props to the shadow root's "host" element
@@ -746,6 +768,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
746
768
  const setValue = (ref, propName, newVal, cmpMeta) => {
747
769
  // check our new property value against our internal value
748
770
  const hostRef = getHostRef(ref);
771
+ const elm = hostRef.$hostElement$ ;
749
772
  const oldVal = hostRef.$instanceValues$.get(propName);
750
773
  const flags = hostRef.$flags$;
751
774
  const instance = hostRef.$lazyInstance$ ;
@@ -758,6 +781,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
758
781
  // set our new value!
759
782
  hostRef.$instanceValues$.set(propName, newVal);
760
783
  if (instance) {
784
+ // get an array of method names of watch functions to call
785
+ if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
786
+ const watchMethods = cmpMeta.$watchers$[propName];
787
+ if (watchMethods) {
788
+ // this instance is watching for when this property changed
789
+ watchMethods.map((watchMethodName) => {
790
+ try {
791
+ // fire off each of the watch methods that are watching this property
792
+ instance[watchMethodName](newVal, oldVal, propName);
793
+ }
794
+ catch (e) {
795
+ consoleError(e, elm);
796
+ }
797
+ });
798
+ }
799
+ }
761
800
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
762
801
  // looks like this value actually changed, so we've got work to do!
763
802
  // but only if we've already rendered, otherwise just chill out
@@ -770,6 +809,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
770
809
  };
771
810
  const proxyComponent = (Cstr, cmpMeta, flags) => {
772
811
  if (cmpMeta.$members$) {
812
+ if (Cstr.watchers) {
813
+ cmpMeta.$watchers$ = Cstr.watchers;
814
+ }
773
815
  // It's better to have a const than two Object.entries()
774
816
  const members = Object.entries(cmpMeta.$members$);
775
817
  const prototype = Cstr.prototype;
@@ -884,6 +926,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
884
926
  endLoad();
885
927
  }
886
928
  if (!Cstr.isProxied) {
929
+ // we've never proxied this Constructor before
930
+ // let's add the getters/setters to its prototype before
931
+ // the first time we create an instance of the implementation
932
+ {
933
+ cmpMeta.$watchers$ = Cstr.watchers;
934
+ }
887
935
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
888
936
  Cstr.isProxied = true;
889
937
  }
@@ -907,6 +955,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
907
955
  {
908
956
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
909
957
  }
958
+ {
959
+ hostRef.$flags$ |= 128 /* isWatchReady */;
960
+ }
910
961
  endNewInstance();
911
962
  fireConnectedCallback(hostRef.$lazyInstance$);
912
963
  }
@@ -1020,6 +1071,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1020
1071
  {
1021
1072
  cmpMeta.$members$ = compactMeta[2];
1022
1073
  }
1074
+ {
1075
+ cmpMeta.$watchers$ = {};
1076
+ }
1023
1077
  const tagName = cmpMeta.$tagName$;
1024
1078
  const HostElement = class extends HTMLElement {
1025
1079
  // StencilLazyHost
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-dcacd71c.js');
5
+ const index = require('./index-1133bc2a.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
17
+ return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-dcacd71c.js');
3
+ const index = require('./index-1133bc2a.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["snk-pesquisa.cjs",[[1,"snk-pesquisa",{"searchLoader":[16],"onSelectItem":[16],"argument":[1025]}]]],["snk-application.cjs",[[2,"snk-application",{"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
18
+ return index.bootstrapLazy([["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]]], options);
19
19
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-dcacd71c.js');
5
+ const index = require('./index-1133bc2a.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -6563,7 +6563,7 @@ class DataFetcher {
6563
6563
  });
6564
6564
  }
6565
6565
  getReqKey(req) {
6566
- return window.btoa(this.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
6566
+ return window.btoa(core.StringUtils.hashCode(`${req.query}${JSON.stringify(req.values || "")}`)).replace(/=/g, "");
6567
6567
  }
6568
6568
  getQueryTemplate(re) {
6569
6569
  return (re.query || "").replaceAll("$queryAlias$", re.queryID);
@@ -6655,19 +6655,6 @@ class DataFetcher {
6655
6655
  var _a;
6656
6656
  return !err.response && !err.request || (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) >= 300);
6657
6657
  }
6658
- //TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
6659
- hashCode(txt) {
6660
- var hash = 0, i, chr;
6661
- if (txt.length === 0)
6662
- return hash.toString();
6663
- for (i = 0; i < txt.length; i++) {
6664
- chr = txt.charCodeAt(i);
6665
- hash = ((hash << 5) - hash) + chr;
6666
- hash |= 0; // Convert to 32bit integer
6667
- }
6668
- return hash.toString();
6669
- }
6670
- ;
6671
6658
  normalizeErrorResponse(error, requests, requestIndex) {
6672
6659
  const req = Object.assign({}, requests[requestIndex]);
6673
6660
  const { variables } = req;
@@ -7093,11 +7080,12 @@ class GridConfigFetcher extends ResourceFetcher {
7093
7080
 
7094
7081
  class PesquisaFetcher {
7095
7082
  constructor() {
7096
- this.templateByQuery = new Map();
7083
+ this._defaultPageSize = 100;
7084
+ this._templateByQuery = new Map();
7097
7085
  this.buldTemplates();
7098
7086
  }
7099
7087
  buldTemplates() {
7100
- this.templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
7088
+ this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
7101
7089
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
7102
7090
  value
7103
7091
  label
@@ -7109,7 +7097,7 @@ class PesquisaFetcher {
7109
7097
  DataFetcher.get()
7110
7098
  .callGraphQL({
7111
7099
  values: { argument, entityName, criteria, options },
7112
- query: this.templateByQuery.get("search"),
7100
+ query: this._templateByQuery.get("search"),
7113
7101
  })
7114
7102
  .then((result) => {
7115
7103
  resolve(result);
@@ -7119,7 +7107,7 @@ class PesquisaFetcher {
7119
7107
  });
7120
7108
  });
7121
7109
  }
7122
- loadAdvancedSearch(entityName, argument, criteria) {
7110
+ loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
7123
7111
  const serviceName = "PesquisaSP.getSuggestion";
7124
7112
  const externalCriteria = {
7125
7113
  query: {
@@ -7138,11 +7126,11 @@ class PesquisaFetcher {
7138
7126
  "entityName": entityName,
7139
7127
  "compacted": false,
7140
7128
  "ignoreEntityCriteria": false,
7141
- "limit": "5",
7129
+ "limit": this._defaultPageSize,
7142
7130
  "query": { "$": argument },
7143
7131
  "orderByDesc": false,
7144
- "options": { "showInactives": false },
7145
- "externalCriteria": externalCriteria
7132
+ "externalCriteria": externalCriteria,
7133
+ "localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity
7146
7134
  },
7147
7135
  "clientEventList": {
7148
7136
  "clientEvent": []
@@ -7171,6 +7159,36 @@ function convertParamType(dataType) {
7171
7159
  }
7172
7160
  }
7173
7161
 
7162
+ class AuthFetcher extends ResourceFetcher {
7163
+ getData(resourceID) {
7164
+ const completePath = `cfg://auth/${resourceID}`;
7165
+ return new Promise((resolve, reject) => {
7166
+ this.loadResource(completePath)
7167
+ .then((loadedResource) => {
7168
+ let auth = core.ObjectUtils.stringToObject(loadedResource);
7169
+ if (auth && typeof (auth) === 'object') {
7170
+ resolve(auth);
7171
+ }
7172
+ }).catch((error) => {
7173
+ reject(error);
7174
+ });
7175
+ });
7176
+ }
7177
+ }
7178
+ var AutorizationType;
7179
+ (function (AutorizationType) {
7180
+ AutorizationType["INSERT"] = "I";
7181
+ AutorizationType["UPDATE"] = "A";
7182
+ AutorizationType["REMOVE"] = "E";
7183
+ AutorizationType["SHOW"] = "C";
7184
+ AutorizationType["CONFIG"] = "F";
7185
+ AutorizationType["CONFIG_NUMBER"] = "N";
7186
+ AutorizationType["CLONE"] = "D";
7187
+ AutorizationType["CONFIG_GRID"] = "G";
7188
+ })(AutorizationType || (AutorizationType = {}));
7189
+
7190
+ var _0x19bf=['hasOwnProperty','isUserSup','parseFromJSON','authorizationSf','string','parse','item','forEach','putAccess','status','true','isSup','actions'];(function(_0x232776,_0x161588){var _0xf498c3=function(_0x1b72ca){while(--_0x1b72ca){_0x232776['push'](_0x232776['shift']());}};_0xf498c3(++_0x161588);}(_0x19bf,0x1bc));var _0x4ace=function(_0x18a194,_0x20fa62){_0x18a194=_0x18a194-0x0;var _0x4bcfc6=_0x19bf[_0x18a194];return _0x4bcfc6;};class MGEAuthorization{[_0x4ace('0x0')](_0x5da3ee){_0x5da3ee=utxt(_0x5da3ee[_0x4ace('0x1')]);if(typeof _0x5da3ee==_0x4ace('0x2')){_0x5da3ee=JSON[_0x4ace('0x3')](_0x5da3ee);}if(_0x5da3ee==undefined){throw Error('Objeto\x20não\x20pode\x20ser\x20indefinido.');}const _0xa117bd=new MGEAuthorizationData(_0x5da3ee['isSup']==='S');if(Array['isArray'](_0x5da3ee[_0x4ace('0x4')])){_0x5da3ee['item'][_0x4ace('0x5')](_0x1d7ff8=>_0xa117bd[_0x4ace('0x6')](_0x1d7ff8['name'],String(_0x1d7ff8[_0x4ace('0x7')])==_0x4ace('0x8')));}return _0xa117bd;}}class MGEAuthorizationData{constructor(_0x2419ec){this[_0x4ace('0x9')]=_0x2419ec;this[_0x4ace('0xa')]={};}[_0x4ace('0x6')](_0x225382,_0x418c04){this['actions'][_0x225382]=_0x418c04;}['hasAccess'](_0x4f03c9){if(this[_0x4ace('0x9')]){return !![];}let _0x4347e9=!![];if(this['actions'][_0x4ace('0xb')](_0x4f03c9)){_0x4347e9=this['actions'][_0x4f03c9];}return _0x4347e9;}[_0x4ace('0xc')](){return this[_0x4ace('0x9')];}}
7191
+
7174
7192
  class SnkErrorHandler {
7175
7193
  constructor(app) {
7176
7194
  this._app = app;
@@ -7240,6 +7258,54 @@ const SnkApplication = class {
7240
7258
  }
7241
7259
  return this._resourceID;
7242
7260
  }
7261
+ get auth() {
7262
+ return new Promise((resolve, reject) => {
7263
+ if (this._auth) {
7264
+ resolve(this._auth);
7265
+ }
7266
+ else {
7267
+ this.authFetcher.getData(this._resourceID).then((authList) => {
7268
+ this._auth = authList;
7269
+ resolve(authList);
7270
+ }).catch(error => reject(error));
7271
+ }
7272
+ });
7273
+ }
7274
+ async isUserSup() {
7275
+ return new Promise((resolve, reject) => {
7276
+ this.auth.then((authorization) => {
7277
+ this.getAuthList(authorization).then((auths) => {
7278
+ resolve(auths.isSup);
7279
+ }).catch(error => reject(error));
7280
+ });
7281
+ });
7282
+ }
7283
+ async hasAccess(access) {
7284
+ return new Promise((resolve, reject) => {
7285
+ this.auth.then((authorization) => {
7286
+ this.getAuthList(authorization).then((auths) => {
7287
+ resolve(auths.isSup || auths.actions[access]);
7288
+ }).catch(error => reject(error));
7289
+ });
7290
+ });
7291
+ }
7292
+ async getAllAccess() {
7293
+ return new Promise((resolve, reject) => {
7294
+ this.auth.then((authorization) => {
7295
+ this.getAuthList(authorization).then((auths) => {
7296
+ const allAccess = {};
7297
+ allAccess['isSup'] = auths.isSup;
7298
+ Object.entries(AutorizationType).forEach((data) => {
7299
+ allAccess[data[0]] = auths.actions[data[1]] || false;
7300
+ });
7301
+ resolve(allAccess);
7302
+ }).catch(error => reject(error));
7303
+ });
7304
+ });
7305
+ }
7306
+ async getAuthList(_auth) {
7307
+ return await (new MGEAuthorization()).parseFromJSON(_auth);
7308
+ }
7243
7309
  async getStringParam(name) {
7244
7310
  return this.parameters.asString(name, this.resourceID);
7245
7311
  }
@@ -7389,12 +7455,18 @@ const SnkApplication = class {
7389
7455
  }
7390
7456
  return this._pesquisaFetcher;
7391
7457
  }
7392
- executeSearch(searchArgument, fieldName, dataUnit) {
7393
- const descriptor = dataUnit.getField(fieldName);
7458
+ get authFetcher() {
7459
+ if (!this._authFetcher) {
7460
+ this._authFetcher = new AuthFetcher();
7461
+ }
7462
+ return this._authFetcher;
7463
+ }
7464
+ async executeSearch(searchArgument, fieldName, dataUnit) {
7465
+ const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
7394
7466
  if (!descriptor) ;
7395
7467
  else {
7396
7468
  const { mode, argument } = searchArgument;
7397
- const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY } = descriptor.properties;
7469
+ const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
7398
7470
  const dependencies = descriptor.dependencies;
7399
7471
  let criteria;
7400
7472
  const searchOptions = {
@@ -7427,11 +7499,13 @@ const SnkApplication = class {
7427
7499
  return new Promise(accept => {
7428
7500
  const pesquisaContent = document.createElement("snk-pesquisa");
7429
7501
  pesquisaContent.argument = argument;
7430
- pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria);
7431
- pesquisaContent.onSelectItem = (option) => {
7502
+ pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
7503
+ pesquisaContent.selectItem = (option) => {
7432
7504
  accept(option);
7505
+ this.cleanPopUpTitle();
7433
7506
  this.closePopUp();
7434
7507
  };
7508
+ this.setPopUpTitle(DESCRIPTIONENTITY);
7435
7509
  this.showPopUp(pesquisaContent);
7436
7510
  });
7437
7511
  }
@@ -7440,6 +7514,12 @@ const SnkApplication = class {
7440
7514
  }
7441
7515
  }
7442
7516
  }
7517
+ cleanPopUpTitle() {
7518
+ this._popUp['ezTitle'] = "";
7519
+ }
7520
+ setPopUpTitle(title) {
7521
+ this._popUp['ezTitle'] = title;
7522
+ }
7443
7523
  componentWillLoad() {
7444
7524
  this._errorHandler = new SnkErrorHandler(this);
7445
7525
  core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/ez.uploading`);