@sankhyalabs/sankhyablocks 1.3.20 → 1.3.23
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/{index-dcacd71c.js → index-1133bc2a.js} +55 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +112 -14
- package/dist/cjs/snk-pesquisa.cjs.entry.js +296 -3
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +167 -5
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +92 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +311 -6
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/auth-fetcher.js +29 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +8 -7
- package/dist/components/snk-application2.js +117 -15
- package/dist/components/snk-pesquisa2.js +300 -6
- package/dist/esm/{index-b13a53d8.js → index-ffda6382.js} +55 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +113 -15
- package/dist/esm/snk-pesquisa.entry.js +296 -3
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-28a5ef28.entry.js → p-2a7b4cb3.entry.js} +1 -1
- package/dist/sankhyablocks/p-a200791b.entry.js +68 -0
- package/dist/sankhyablocks/p-d62412bb.entry.js +1 -0
- package/dist/sankhyablocks/p-edcb9d8e.js +2 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +87 -0
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +44 -2
- package/dist/types/components.d.ts +9 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/auth-fetcher.d.ts +17 -0
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +3 -2
- package/package.json +2 -2
- package/dist/sankhyablocks/p-0b1577eb.entry.js +0 -1
- package/dist/sankhyablocks/p-4e116571.js +0 -2
- package/dist/sankhyablocks/p-c1aaec69.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 === '
|
|
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
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
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",[[
|
|
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-
|
|
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",[[
|
|
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-
|
|
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');
|
|
@@ -6627,7 +6627,7 @@ class DataFetcher {
|
|
|
6627
6627
|
});
|
|
6628
6628
|
}
|
|
6629
6629
|
catch (err) {
|
|
6630
|
-
if (
|
|
6630
|
+
if (!this.isHttpError(err)) {
|
|
6631
6631
|
res = err.response;
|
|
6632
6632
|
const req = err.request;
|
|
6633
6633
|
Object.entries(res).forEach(([key, val]) => {
|
|
@@ -6644,12 +6644,17 @@ class DataFetcher {
|
|
|
6644
6644
|
});
|
|
6645
6645
|
}
|
|
6646
6646
|
else {
|
|
6647
|
+
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6647
6648
|
throw new core.ErrorException("Falha de comunicação", err.message);
|
|
6648
6649
|
}
|
|
6649
6650
|
}
|
|
6650
6651
|
DataFetcher.requestListener.forEach(listener => listener.onRequestEnd({ url }));
|
|
6651
6652
|
return { data: dataResponse, errors: errorsResponse };
|
|
6652
6653
|
}
|
|
6654
|
+
isHttpError(err) {
|
|
6655
|
+
var _a;
|
|
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
|
+
}
|
|
6653
6658
|
//TODO: Mover este metodo para o @sankhyalabs/core classe string utils.
|
|
6654
6659
|
hashCode(txt) {
|
|
6655
6660
|
var hash = 0, i, chr;
|
|
@@ -7088,11 +7093,12 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7088
7093
|
|
|
7089
7094
|
class PesquisaFetcher {
|
|
7090
7095
|
constructor() {
|
|
7091
|
-
this.
|
|
7096
|
+
this._defaultPageSize = 100;
|
|
7097
|
+
this._templateByQuery = new Map();
|
|
7092
7098
|
this.buldTemplates();
|
|
7093
7099
|
}
|
|
7094
7100
|
buldTemplates() {
|
|
7095
|
-
this.
|
|
7101
|
+
this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
7096
7102
|
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
7097
7103
|
value
|
|
7098
7104
|
label
|
|
@@ -7104,7 +7110,7 @@ class PesquisaFetcher {
|
|
|
7104
7110
|
DataFetcher.get()
|
|
7105
7111
|
.callGraphQL({
|
|
7106
7112
|
values: { argument, entityName, criteria, options },
|
|
7107
|
-
query: this.
|
|
7113
|
+
query: this._templateByQuery.get("search"),
|
|
7108
7114
|
})
|
|
7109
7115
|
.then((result) => {
|
|
7110
7116
|
resolve(result);
|
|
@@ -7114,7 +7120,7 @@ class PesquisaFetcher {
|
|
|
7114
7120
|
});
|
|
7115
7121
|
});
|
|
7116
7122
|
}
|
|
7117
|
-
loadAdvancedSearch(entityName, argument, criteria) {
|
|
7123
|
+
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
|
7118
7124
|
const serviceName = "PesquisaSP.getSuggestion";
|
|
7119
7125
|
const externalCriteria = {
|
|
7120
7126
|
query: {
|
|
@@ -7133,11 +7139,11 @@ class PesquisaFetcher {
|
|
|
7133
7139
|
"entityName": entityName,
|
|
7134
7140
|
"compacted": false,
|
|
7135
7141
|
"ignoreEntityCriteria": false,
|
|
7136
|
-
"limit":
|
|
7142
|
+
"limit": this._defaultPageSize,
|
|
7137
7143
|
"query": { "$": argument },
|
|
7138
7144
|
"orderByDesc": false,
|
|
7139
|
-
"
|
|
7140
|
-
"
|
|
7145
|
+
"externalCriteria": externalCriteria,
|
|
7146
|
+
"localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity
|
|
7141
7147
|
},
|
|
7142
7148
|
"clientEventList": {
|
|
7143
7149
|
"clientEvent": []
|
|
@@ -7166,6 +7172,36 @@ function convertParamType(dataType) {
|
|
|
7166
7172
|
}
|
|
7167
7173
|
}
|
|
7168
7174
|
|
|
7175
|
+
class AuthFetcher extends ResourceFetcher {
|
|
7176
|
+
getData(resourceID) {
|
|
7177
|
+
const completePath = `cfg://auth/${resourceID}`;
|
|
7178
|
+
return new Promise((resolve, reject) => {
|
|
7179
|
+
this.loadResource(completePath)
|
|
7180
|
+
.then((loadedResource) => {
|
|
7181
|
+
let auth = core.ObjectUtils.stringToObject(loadedResource);
|
|
7182
|
+
if (auth && typeof (auth) === 'object') {
|
|
7183
|
+
resolve(auth);
|
|
7184
|
+
}
|
|
7185
|
+
}).catch((error) => {
|
|
7186
|
+
reject(error);
|
|
7187
|
+
});
|
|
7188
|
+
});
|
|
7189
|
+
}
|
|
7190
|
+
}
|
|
7191
|
+
var AutorizationType;
|
|
7192
|
+
(function (AutorizationType) {
|
|
7193
|
+
AutorizationType["INSERT"] = "I";
|
|
7194
|
+
AutorizationType["UPDATE"] = "A";
|
|
7195
|
+
AutorizationType["REMOVE"] = "E";
|
|
7196
|
+
AutorizationType["SHOW"] = "C";
|
|
7197
|
+
AutorizationType["CONFIG"] = "F";
|
|
7198
|
+
AutorizationType["CONFIG_NUMBER"] = "N";
|
|
7199
|
+
AutorizationType["CLONE"] = "D";
|
|
7200
|
+
AutorizationType["CONFIG_GRID"] = "G";
|
|
7201
|
+
})(AutorizationType || (AutorizationType = {}));
|
|
7202
|
+
|
|
7203
|
+
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')];}}
|
|
7204
|
+
|
|
7169
7205
|
class SnkErrorHandler {
|
|
7170
7206
|
constructor(app) {
|
|
7171
7207
|
this._app = app;
|
|
@@ -7235,6 +7271,54 @@ const SnkApplication = class {
|
|
|
7235
7271
|
}
|
|
7236
7272
|
return this._resourceID;
|
|
7237
7273
|
}
|
|
7274
|
+
get auth() {
|
|
7275
|
+
return new Promise((resolve, reject) => {
|
|
7276
|
+
if (this._auth) {
|
|
7277
|
+
resolve(this._auth);
|
|
7278
|
+
}
|
|
7279
|
+
else {
|
|
7280
|
+
this.authFetcher.getData(this._resourceID).then((authList) => {
|
|
7281
|
+
this._auth = authList;
|
|
7282
|
+
resolve(authList);
|
|
7283
|
+
}).catch(error => reject(error));
|
|
7284
|
+
}
|
|
7285
|
+
});
|
|
7286
|
+
}
|
|
7287
|
+
async isUserSup() {
|
|
7288
|
+
return new Promise((resolve, reject) => {
|
|
7289
|
+
this.auth.then((authorization) => {
|
|
7290
|
+
this.getAuthList(authorization).then((auths) => {
|
|
7291
|
+
resolve(auths.isSup);
|
|
7292
|
+
}).catch(error => reject(error));
|
|
7293
|
+
});
|
|
7294
|
+
});
|
|
7295
|
+
}
|
|
7296
|
+
async hasAccess(access) {
|
|
7297
|
+
return new Promise((resolve, reject) => {
|
|
7298
|
+
this.auth.then((authorization) => {
|
|
7299
|
+
this.getAuthList(authorization).then((auths) => {
|
|
7300
|
+
resolve(auths.isSup || auths.actions[access]);
|
|
7301
|
+
}).catch(error => reject(error));
|
|
7302
|
+
});
|
|
7303
|
+
});
|
|
7304
|
+
}
|
|
7305
|
+
async getAllAccess() {
|
|
7306
|
+
return new Promise((resolve, reject) => {
|
|
7307
|
+
this.auth.then((authorization) => {
|
|
7308
|
+
this.getAuthList(authorization).then((auths) => {
|
|
7309
|
+
const allAccess = {};
|
|
7310
|
+
allAccess['isSup'] = auths.isSup;
|
|
7311
|
+
Object.entries(AutorizationType).forEach((data) => {
|
|
7312
|
+
allAccess[data[0]] = auths.actions[data[1]] || false;
|
|
7313
|
+
});
|
|
7314
|
+
resolve(allAccess);
|
|
7315
|
+
}).catch(error => reject(error));
|
|
7316
|
+
});
|
|
7317
|
+
});
|
|
7318
|
+
}
|
|
7319
|
+
async getAuthList(_auth) {
|
|
7320
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7321
|
+
}
|
|
7238
7322
|
async getStringParam(name) {
|
|
7239
7323
|
return this.parameters.asString(name, this.resourceID);
|
|
7240
7324
|
}
|
|
@@ -7384,12 +7468,18 @@ const SnkApplication = class {
|
|
|
7384
7468
|
}
|
|
7385
7469
|
return this._pesquisaFetcher;
|
|
7386
7470
|
}
|
|
7387
|
-
|
|
7388
|
-
|
|
7471
|
+
get authFetcher() {
|
|
7472
|
+
if (!this._authFetcher) {
|
|
7473
|
+
this._authFetcher = new AuthFetcher();
|
|
7474
|
+
}
|
|
7475
|
+
return this._authFetcher;
|
|
7476
|
+
}
|
|
7477
|
+
async executeSearch(searchArgument, fieldName, dataUnit) {
|
|
7478
|
+
const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
|
|
7389
7479
|
if (!descriptor) ;
|
|
7390
7480
|
else {
|
|
7391
7481
|
const { mode, argument } = searchArgument;
|
|
7392
|
-
const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY } = descriptor.properties;
|
|
7482
|
+
const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
|
|
7393
7483
|
const dependencies = descriptor.dependencies;
|
|
7394
7484
|
let criteria;
|
|
7395
7485
|
const searchOptions = {
|
|
@@ -7422,11 +7512,13 @@ const SnkApplication = class {
|
|
|
7422
7512
|
return new Promise(accept => {
|
|
7423
7513
|
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
7424
7514
|
pesquisaContent.argument = argument;
|
|
7425
|
-
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria);
|
|
7426
|
-
pesquisaContent.
|
|
7515
|
+
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
7516
|
+
pesquisaContent.selectItem = (option) => {
|
|
7427
7517
|
accept(option);
|
|
7518
|
+
this.cleanPopUpTitle();
|
|
7428
7519
|
this.closePopUp();
|
|
7429
7520
|
};
|
|
7521
|
+
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
7430
7522
|
this.showPopUp(pesquisaContent);
|
|
7431
7523
|
});
|
|
7432
7524
|
}
|
|
@@ -7435,6 +7527,12 @@ const SnkApplication = class {
|
|
|
7435
7527
|
}
|
|
7436
7528
|
}
|
|
7437
7529
|
}
|
|
7530
|
+
cleanPopUpTitle() {
|
|
7531
|
+
this._popUp['ezTitle'] = "";
|
|
7532
|
+
}
|
|
7533
|
+
setPopUpTitle(title) {
|
|
7534
|
+
this._popUp['ezTitle'] = title;
|
|
7535
|
+
}
|
|
7438
7536
|
componentWillLoad() {
|
|
7439
7537
|
this._errorHandler = new SnkErrorHandler(this);
|
|
7440
7538
|
core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/ez.uploading`);
|