@sankhyalabs/sankhyablocks 1.3.31-beta.6 → 1.3.31
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-532bcc28.js → index-1133bc2a.js} +9 -419
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +98 -213
- package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -2
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -4
- package/dist/collection/components/snk-application/snk-application.js +48 -165
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +21 -52
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +3 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -0
- package/dist/components/snk-application2.js +97 -213
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/esm/{index-0b078db7.js → index-ffda6382.js} +10 -419
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +98 -213
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-a8305c35.entry.js → p-2a7b4cb3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a670853c.entry.js → p-49fdec1f.entry.js} +1 -1
- package/dist/sankhyablocks/p-9bc9abe0.entry.js +69 -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 +13 -90
- package/dist/types/components.d.ts +2 -334
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +0 -2
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- package/package.json +5 -5
- package/react/components.d.ts +0 -4
- package/react/components.js +0 -4
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +0 -189
- package/dist/cjs/snk-form.cjs.entry.js +0 -95
- package/dist/cjs/snk-grid.cjs.entry.js +0 -64
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -140
- package/dist/cjs/taskbar-elements-9d47b416.js +0 -70
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +0 -6
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -449
- package/dist/collection/components/snk-form/snk-form.css +0 -3
- package/dist/collection/components/snk-form/snk-form.js +0 -194
- package/dist/collection/components/snk-grid/snk-grid.css +0 -5
- package/dist/collection/components/snk-grid/snk-grid.js +0 -128
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +0 -65
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -252
- package/dist/components/snk-data-unit.d.ts +0 -11
- package/dist/components/snk-data-unit.js +0 -213
- package/dist/components/snk-form.d.ts +0 -11
- package/dist/components/snk-form.js +0 -121
- package/dist/components/snk-grid.d.ts +0 -11
- package/dist/components/snk-grid.js +0 -88
- package/dist/components/snk-taskbar.d.ts +0 -11
- package/dist/components/snk-taskbar.js +0 -6
- package/dist/components/snk-taskbar2.js +0 -221
- package/dist/esm/snk-data-unit.entry.js +0 -185
- package/dist/esm/snk-form.entry.js +0 -91
- package/dist/esm/snk-grid.entry.js +0 -60
- package/dist/esm/snk-taskbar.entry.js +0 -136
- package/dist/esm/taskbar-elements-3ba30bf4.js +0 -68
- package/dist/sankhyablocks/p-3cb106f7.entry.js +0 -69
- package/dist/sankhyablocks/p-3fce3190.entry.js +0 -1
- package/dist/sankhyablocks/p-560fdf54.entry.js +0 -1
- package/dist/sankhyablocks/p-574764bf.js +0 -1
- package/dist/sankhyablocks/p-8f7b9a85.entry.js +0 -1
- package/dist/sankhyablocks/p-9c225717.entry.js +0 -1
- package/dist/sankhyablocks/p-a45dba1a.js +0 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +0 -25
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -45
|
@@ -16,6 +16,7 @@ export class PesquisaFetcher {
|
|
|
16
16
|
}`);
|
|
17
17
|
}
|
|
18
18
|
loadSearchOptions(entityName, argument, criteria, options) {
|
|
19
|
+
argument = (argument === null || argument === void 0 ? void 0 : argument.trim()) ? `%${argument}` : argument === null || argument === void 0 ? void 0 : argument.trim();
|
|
19
20
|
return new Promise((resolve, reject) => {
|
|
20
21
|
DataFetcher.get()
|
|
21
22
|
.callGraphQL({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException,
|
|
2
|
+
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { DependencyType } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
5
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
5
6
|
|
|
6
7
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1232,7 +1233,7 @@ function isNode(maybeNode) {
|
|
|
1232
1233
|
}
|
|
1233
1234
|
/** Name */
|
|
1234
1235
|
|
|
1235
|
-
|
|
1236
|
+
let OperationTypeNode;
|
|
1236
1237
|
exports.OperationTypeNode = OperationTypeNode;
|
|
1237
1238
|
|
|
1238
1239
|
(function (OperationTypeNode) {
|
|
@@ -1252,7 +1253,13 @@ exports.DirectiveLocation = void 0;
|
|
|
1252
1253
|
/**
|
|
1253
1254
|
* The set of allowed directive location values.
|
|
1254
1255
|
*/
|
|
1255
|
-
|
|
1256
|
+
let DirectiveLocation;
|
|
1257
|
+
/**
|
|
1258
|
+
* The enum type representing the directive location values.
|
|
1259
|
+
*
|
|
1260
|
+
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1261
|
+
*/
|
|
1262
|
+
|
|
1256
1263
|
exports.DirectiveLocation = DirectiveLocation;
|
|
1257
1264
|
|
|
1258
1265
|
(function (DirectiveLocation) {
|
|
@@ -1276,11 +1283,6 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1276
1283
|
DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';
|
|
1277
1284
|
DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';
|
|
1278
1285
|
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {}));
|
|
1279
|
-
/**
|
|
1280
|
-
* The enum type representing the directive location values.
|
|
1281
|
-
*
|
|
1282
|
-
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1283
|
-
*/
|
|
1284
1286
|
});
|
|
1285
1287
|
|
|
1286
1288
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
@@ -1293,7 +1295,13 @@ exports.Kind = void 0;
|
|
|
1293
1295
|
/**
|
|
1294
1296
|
* The set of allowed kind values for AST nodes.
|
|
1295
1297
|
*/
|
|
1296
|
-
|
|
1298
|
+
let Kind;
|
|
1299
|
+
/**
|
|
1300
|
+
* The enum type representing the possible kind values of AST nodes.
|
|
1301
|
+
*
|
|
1302
|
+
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1303
|
+
*/
|
|
1304
|
+
|
|
1297
1305
|
exports.Kind = Kind;
|
|
1298
1306
|
|
|
1299
1307
|
(function (Kind) {
|
|
@@ -1341,11 +1349,6 @@ exports.Kind = Kind;
|
|
|
1341
1349
|
Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';
|
|
1342
1350
|
Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';
|
|
1343
1351
|
})(Kind || (exports.Kind = Kind = {}));
|
|
1344
|
-
/**
|
|
1345
|
-
* The enum type representing the possible kind values of AST nodes.
|
|
1346
|
-
*
|
|
1347
|
-
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1348
|
-
*/
|
|
1349
1352
|
});
|
|
1350
1353
|
|
|
1351
1354
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
@@ -1633,7 +1636,13 @@ exports.TokenKind = void 0;
|
|
|
1633
1636
|
* An exported enum describing the different kinds of tokens that the
|
|
1634
1637
|
* lexer emits.
|
|
1635
1638
|
*/
|
|
1636
|
-
|
|
1639
|
+
let TokenKind;
|
|
1640
|
+
/**
|
|
1641
|
+
* The enum type representing the token kinds values.
|
|
1642
|
+
*
|
|
1643
|
+
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1644
|
+
*/
|
|
1645
|
+
|
|
1637
1646
|
exports.TokenKind = TokenKind;
|
|
1638
1647
|
|
|
1639
1648
|
(function (TokenKind) {
|
|
@@ -1660,11 +1669,6 @@ exports.TokenKind = TokenKind;
|
|
|
1660
1669
|
TokenKind['BLOCK_STRING'] = 'BlockString';
|
|
1661
1670
|
TokenKind['COMMENT'] = 'Comment';
|
|
1662
1671
|
})(TokenKind || (exports.TokenKind = TokenKind = {}));
|
|
1663
|
-
/**
|
|
1664
|
-
* The enum type representing the token kinds values.
|
|
1665
|
-
*
|
|
1666
|
-
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1667
|
-
*/
|
|
1668
1672
|
});
|
|
1669
1673
|
|
|
1670
1674
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
@@ -3001,13 +3005,12 @@ function parseType(source, options) {
|
|
|
3001
3005
|
*/
|
|
3002
3006
|
|
|
3003
3007
|
class Parser {
|
|
3004
|
-
constructor(source$1, options
|
|
3008
|
+
constructor(source$1, options) {
|
|
3005
3009
|
const sourceObj = (0, source.isSource)(source$1)
|
|
3006
3010
|
? source$1
|
|
3007
3011
|
: new source.Source(source$1);
|
|
3008
3012
|
this._lexer = new lexer.Lexer(sourceObj);
|
|
3009
3013
|
this._options = options;
|
|
3010
|
-
this._tokenCounter = 0;
|
|
3011
3014
|
}
|
|
3012
3015
|
/**
|
|
3013
3016
|
* Converts a name lex token into a name parse node.
|
|
@@ -3342,12 +3345,18 @@ class Parser {
|
|
|
3342
3345
|
*/
|
|
3343
3346
|
|
|
3344
3347
|
parseFragmentDefinition() {
|
|
3348
|
+
var _this$_options;
|
|
3349
|
+
|
|
3345
3350
|
const start = this._lexer.token;
|
|
3346
3351
|
this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes
|
|
3347
3352
|
// the grammar of FragmentDefinition:
|
|
3348
3353
|
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
3349
3354
|
|
|
3350
|
-
if (
|
|
3355
|
+
if (
|
|
3356
|
+
((_this$_options = this._options) === null || _this$_options === void 0
|
|
3357
|
+
? void 0
|
|
3358
|
+
: _this$_options.allowLegacyFragmentVariables) === true
|
|
3359
|
+
) {
|
|
3351
3360
|
return this.node(start, {
|
|
3352
3361
|
kind: kinds.Kind.FRAGMENT_DEFINITION,
|
|
3353
3362
|
name: this.parseFragmentName(),
|
|
@@ -3408,14 +3417,16 @@ class Parser {
|
|
|
3408
3417
|
return this.parseObject(isConst);
|
|
3409
3418
|
|
|
3410
3419
|
case tokenKind.TokenKind.INT:
|
|
3411
|
-
this.
|
|
3420
|
+
this._lexer.advance();
|
|
3421
|
+
|
|
3412
3422
|
return this.node(token, {
|
|
3413
3423
|
kind: kinds.Kind.INT,
|
|
3414
3424
|
value: token.value,
|
|
3415
3425
|
});
|
|
3416
3426
|
|
|
3417
3427
|
case tokenKind.TokenKind.FLOAT:
|
|
3418
|
-
this.
|
|
3428
|
+
this._lexer.advance();
|
|
3429
|
+
|
|
3419
3430
|
return this.node(token, {
|
|
3420
3431
|
kind: kinds.Kind.FLOAT,
|
|
3421
3432
|
value: token.value,
|
|
@@ -3426,7 +3437,7 @@ class Parser {
|
|
|
3426
3437
|
return this.parseStringLiteral();
|
|
3427
3438
|
|
|
3428
3439
|
case tokenKind.TokenKind.NAME:
|
|
3429
|
-
this.
|
|
3440
|
+
this._lexer.advance();
|
|
3430
3441
|
|
|
3431
3442
|
switch (token.value) {
|
|
3432
3443
|
case 'true':
|
|
@@ -3482,7 +3493,9 @@ class Parser {
|
|
|
3482
3493
|
|
|
3483
3494
|
parseStringLiteral() {
|
|
3484
3495
|
const token = this._lexer.token;
|
|
3485
|
-
|
|
3496
|
+
|
|
3497
|
+
this._lexer.advance();
|
|
3498
|
+
|
|
3486
3499
|
return this.node(token, {
|
|
3487
3500
|
kind: kinds.Kind.STRING,
|
|
3488
3501
|
value: token.value,
|
|
@@ -4273,7 +4286,13 @@ class Parser {
|
|
|
4273
4286
|
*/
|
|
4274
4287
|
|
|
4275
4288
|
node(startToken, node) {
|
|
4276
|
-
|
|
4289
|
+
var _this$_options2;
|
|
4290
|
+
|
|
4291
|
+
if (
|
|
4292
|
+
((_this$_options2 = this._options) === null || _this$_options2 === void 0
|
|
4293
|
+
? void 0
|
|
4294
|
+
: _this$_options2.noLocation) !== true
|
|
4295
|
+
) {
|
|
4277
4296
|
node.loc = new ast.Location(
|
|
4278
4297
|
startToken,
|
|
4279
4298
|
this._lexer.lastToken,
|
|
@@ -4299,7 +4318,8 @@ class Parser {
|
|
|
4299
4318
|
const token = this._lexer.token;
|
|
4300
4319
|
|
|
4301
4320
|
if (token.kind === kind) {
|
|
4302
|
-
this.
|
|
4321
|
+
this._lexer.advance();
|
|
4322
|
+
|
|
4303
4323
|
return token;
|
|
4304
4324
|
}
|
|
4305
4325
|
|
|
@@ -4318,7 +4338,8 @@ class Parser {
|
|
|
4318
4338
|
const token = this._lexer.token;
|
|
4319
4339
|
|
|
4320
4340
|
if (token.kind === kind) {
|
|
4321
|
-
this.
|
|
4341
|
+
this._lexer.advance();
|
|
4342
|
+
|
|
4322
4343
|
return true;
|
|
4323
4344
|
}
|
|
4324
4345
|
|
|
@@ -4333,7 +4354,7 @@ class Parser {
|
|
|
4333
4354
|
const token = this._lexer.token;
|
|
4334
4355
|
|
|
4335
4356
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4336
|
-
this.
|
|
4357
|
+
this._lexer.advance();
|
|
4337
4358
|
} else {
|
|
4338
4359
|
throw (0, syntaxError_1.syntaxError)(
|
|
4339
4360
|
this._lexer.source,
|
|
@@ -4351,7 +4372,8 @@ class Parser {
|
|
|
4351
4372
|
const token = this._lexer.token;
|
|
4352
4373
|
|
|
4353
4374
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4354
|
-
this.
|
|
4375
|
+
this._lexer.advance();
|
|
4376
|
+
|
|
4355
4377
|
return true;
|
|
4356
4378
|
}
|
|
4357
4379
|
|
|
@@ -4438,24 +4460,6 @@ class Parser {
|
|
|
4438
4460
|
|
|
4439
4461
|
return nodes;
|
|
4440
4462
|
}
|
|
4441
|
-
|
|
4442
|
-
advanceLexer() {
|
|
4443
|
-
const { maxTokens } = this._options;
|
|
4444
|
-
|
|
4445
|
-
const token = this._lexer.advance();
|
|
4446
|
-
|
|
4447
|
-
if (maxTokens !== undefined && token.kind !== tokenKind.TokenKind.EOF) {
|
|
4448
|
-
++this._tokenCounter;
|
|
4449
|
-
|
|
4450
|
-
if (this._tokenCounter > maxTokens) {
|
|
4451
|
-
throw (0, syntaxError_1.syntaxError)(
|
|
4452
|
-
this._lexer.source,
|
|
4453
|
-
token.start,
|
|
4454
|
-
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
|
|
4455
|
-
);
|
|
4456
|
-
}
|
|
4457
|
-
}
|
|
4458
|
-
}
|
|
4459
4463
|
}
|
|
4460
4464
|
/**
|
|
4461
4465
|
* A helper function to describe a token as a string for debugging.
|
|
@@ -6688,7 +6692,6 @@ class WaitingRequest {
|
|
|
6688
6692
|
class DataUnitFetcher {
|
|
6689
6693
|
constructor() {
|
|
6690
6694
|
this.templateByQuery = new Map();
|
|
6691
|
-
this._loadDataTimeout = {};
|
|
6692
6695
|
this.buldTemplates();
|
|
6693
6696
|
}
|
|
6694
6697
|
buldTemplates() {
|
|
@@ -6717,9 +6720,9 @@ class DataUnitFetcher {
|
|
|
6717
6720
|
}
|
|
6718
6721
|
}
|
|
6719
6722
|
}`);
|
|
6720
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $
|
|
6723
|
+
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filter: [InputFilter!] $sort: [InputSort!]) {
|
|
6721
6724
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6722
|
-
data(limit: $limit offset: $offset filters: $
|
|
6725
|
+
data(limit: $limit offset: $offset filters: $filter sort: $sort){
|
|
6723
6726
|
limit
|
|
6724
6727
|
offset
|
|
6725
6728
|
total
|
|
@@ -6748,7 +6751,7 @@ class DataUnitFetcher {
|
|
|
6748
6751
|
getDataUnit(entityName, resourceID) {
|
|
6749
6752
|
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6750
6753
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6751
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6754
|
+
dataUnit.dataLoader = (dataUnit, page, sort, filters) => this.loadData(dataUnit, page, sort, filters);
|
|
6752
6755
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6753
6756
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6754
6757
|
return dataUnit;
|
|
@@ -6785,39 +6788,25 @@ class DataUnitFetcher {
|
|
|
6785
6788
|
});
|
|
6786
6789
|
});
|
|
6787
6790
|
}
|
|
6788
|
-
loadData(dataUnit,
|
|
6789
|
-
const duName = dataUnit.name;
|
|
6790
|
-
if (this._loadDataTimeout[duName]) {
|
|
6791
|
-
clearTimeout(this._loadDataTimeout[duName]);
|
|
6792
|
-
delete this._loadDataTimeout[duName];
|
|
6793
|
-
}
|
|
6794
|
-
return new Promise((resolve, reject) => {
|
|
6795
|
-
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6796
|
-
delete this._loadDataTimeout[duName];
|
|
6797
|
-
this.doLoadData(dataUnit, request)
|
|
6798
|
-
.then(result => resolve(result))
|
|
6799
|
-
.catch(reason => reject(reason));
|
|
6800
|
-
}, 200);
|
|
6801
|
-
});
|
|
6802
|
-
}
|
|
6803
|
-
doLoadData(dataUnit, request) {
|
|
6791
|
+
loadData(dataUnit, page, sort, filter) {
|
|
6804
6792
|
return new Promise((resolve, reject) => {
|
|
6805
|
-
var _a;
|
|
6806
|
-
const {
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6793
|
+
var _a, _b, _c;
|
|
6794
|
+
const variables = { dataunit: dataUnit.name, sort, filter };
|
|
6795
|
+
if (page) {
|
|
6796
|
+
variables.limit = page.limit;
|
|
6797
|
+
variables.offset = page.offset;
|
|
6798
|
+
}
|
|
6799
|
+
if (!StringUtils.isEmpty((_a = page === null || page === void 0 ? void 0 : page.quickFilter) === null || _a === void 0 ? void 0 : _a.term)) {
|
|
6811
6800
|
if (variables.filter === undefined) {
|
|
6812
6801
|
variables.filter = [];
|
|
6813
6802
|
}
|
|
6814
6803
|
const quickFilterCriteria = {
|
|
6815
6804
|
name: "__QUICK_FILTER__",
|
|
6816
6805
|
expression: "__QUICK_FILTER__",
|
|
6817
|
-
params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
|
|
6806
|
+
params: [{ name: "term", dataType: DataType.TEXT, value: page.quickFilter.term }]
|
|
6818
6807
|
};
|
|
6819
|
-
if (((
|
|
6820
|
-
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: quickFilter.fields });
|
|
6808
|
+
if (((_c = (_b = page.quickFilter) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
6809
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: page.quickFilter.fields });
|
|
6821
6810
|
}
|
|
6822
6811
|
variables.filter.push(quickFilterCriteria);
|
|
6823
6812
|
}
|
|
@@ -6827,32 +6816,16 @@ class DataUnitFetcher {
|
|
|
6827
6816
|
query: this.templateByQuery.get("fetchData"),
|
|
6828
6817
|
})
|
|
6829
6818
|
.then((resp) => {
|
|
6830
|
-
const
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
const firstRecord = offset + 1;
|
|
6834
|
-
const lastRecord = offset + Math.min(records.length, limit);
|
|
6835
|
-
const currentPage = offset / limit;
|
|
6836
|
-
paginationInfo = {
|
|
6837
|
-
firstRecord,
|
|
6838
|
-
lastRecord,
|
|
6839
|
-
total,
|
|
6840
|
-
currentPage,
|
|
6841
|
-
hasMore
|
|
6842
|
-
};
|
|
6843
|
-
}
|
|
6844
|
-
const processedRecords = [];
|
|
6845
|
-
records.forEach((responseRecord) => {
|
|
6819
|
+
const pageResult = resp.data;
|
|
6820
|
+
const records = [];
|
|
6821
|
+
pageResult.records.forEach((responseRecord) => {
|
|
6846
6822
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6847
6823
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6848
6824
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6849
6825
|
});
|
|
6850
|
-
|
|
6851
|
-
});
|
|
6852
|
-
resolve({
|
|
6853
|
-
paginationInfo,
|
|
6854
|
-
records: processedRecords
|
|
6826
|
+
records.push(duRecord);
|
|
6855
6827
|
});
|
|
6828
|
+
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6856
6829
|
})
|
|
6857
6830
|
.catch((error) => {
|
|
6858
6831
|
reject(error);
|
|
@@ -7078,16 +7051,15 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7078
7051
|
super(...arguments);
|
|
7079
7052
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7080
7053
|
}
|
|
7081
|
-
getConfig(
|
|
7054
|
+
getConfig(resourceID) {
|
|
7082
7055
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7083
7056
|
return new Promise((resolve, reject) => {
|
|
7084
7057
|
this.loadResource(completePath)
|
|
7085
7058
|
.then(loadedResource => {
|
|
7086
|
-
let config = undefined;
|
|
7087
7059
|
if (loadedResource) {
|
|
7088
|
-
config = JSON.parse(loadedResource);
|
|
7060
|
+
let config = JSON.parse(loadedResource);
|
|
7061
|
+
resolve(config);
|
|
7089
7062
|
}
|
|
7090
|
-
resolve(config);
|
|
7091
7063
|
}).catch((error) => {
|
|
7092
7064
|
reject(error);
|
|
7093
7065
|
});
|
|
@@ -7122,6 +7094,7 @@ class PesquisaFetcher {
|
|
|
7122
7094
|
}`);
|
|
7123
7095
|
}
|
|
7124
7096
|
loadSearchOptions(entityName, argument, criteria, options) {
|
|
7097
|
+
argument = (argument === null || argument === void 0 ? void 0 : argument.trim()) ? `%${argument}` : argument === null || argument === void 0 ? void 0 : argument.trim();
|
|
7125
7098
|
return new Promise((resolve, reject) => {
|
|
7126
7099
|
DataFetcher.get()
|
|
7127
7100
|
.callGraphQL({
|
|
@@ -7281,7 +7254,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7281
7254
|
this.__registerHost();
|
|
7282
7255
|
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7283
7256
|
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7284
|
-
this._duCache = new Map();
|
|
7285
7257
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7286
7258
|
}
|
|
7287
7259
|
get parameters() {
|
|
@@ -7312,9 +7284,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7312
7284
|
}
|
|
7313
7285
|
});
|
|
7314
7286
|
}
|
|
7315
|
-
/**
|
|
7316
|
-
* Caso o usuário logado seja o SUP.
|
|
7317
|
-
*/
|
|
7318
7287
|
async isUserSup() {
|
|
7319
7288
|
return new Promise((resolve, reject) => {
|
|
7320
7289
|
this.auth.then((authorization) => {
|
|
@@ -7324,9 +7293,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7324
7293
|
});
|
|
7325
7294
|
});
|
|
7326
7295
|
}
|
|
7327
|
-
/**
|
|
7328
|
-
* Se o usuário logado tem permissão pra determinada ação.
|
|
7329
|
-
*/
|
|
7330
7296
|
async hasAccess(access) {
|
|
7331
7297
|
return new Promise((resolve, reject) => {
|
|
7332
7298
|
this.auth.then((authorization) => {
|
|
@@ -7336,9 +7302,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7336
7302
|
});
|
|
7337
7303
|
});
|
|
7338
7304
|
}
|
|
7339
|
-
/**
|
|
7340
|
-
* Retorna todos os acessos do usuário logado.
|
|
7341
|
-
*/
|
|
7342
7305
|
async getAllAccess() {
|
|
7343
7306
|
return new Promise((resolve, reject) => {
|
|
7344
7307
|
this.auth.then((authorization) => {
|
|
@@ -7353,55 +7316,33 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7353
7316
|
});
|
|
7354
7317
|
});
|
|
7355
7318
|
}
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7319
|
+
async getAuthList(_auth) {
|
|
7320
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7321
|
+
}
|
|
7359
7322
|
async getStringParam(name) {
|
|
7360
7323
|
return this.parameters.asString(name, this.resourceID);
|
|
7361
7324
|
}
|
|
7362
|
-
/**
|
|
7363
|
-
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7364
|
-
*/
|
|
7365
7325
|
async getIntParam(name) {
|
|
7366
7326
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7367
7327
|
}
|
|
7368
|
-
/**
|
|
7369
|
-
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7370
|
-
*/
|
|
7371
7328
|
async getFloatParam(name) {
|
|
7372
7329
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7373
7330
|
}
|
|
7374
|
-
/**
|
|
7375
|
-
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7376
|
-
*/
|
|
7377
7331
|
async getBooleanParam(name) {
|
|
7378
7332
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7379
7333
|
}
|
|
7380
|
-
/**
|
|
7381
|
-
* Retorna o valor de um parâmetro do tipo data.
|
|
7382
|
-
*/
|
|
7383
7334
|
async getDateParam(name) {
|
|
7384
7335
|
return this.parameters.asDate(name, this.resourceID);
|
|
7385
7336
|
}
|
|
7386
|
-
/**
|
|
7387
|
-
* Mostra o conteúdo passado em um Popup
|
|
7388
|
-
*/
|
|
7389
7337
|
async showPopUp(content) {
|
|
7338
|
+
this.clearPopUpContent();
|
|
7390
7339
|
this._popUp.appendChild(content);
|
|
7391
|
-
this._popUp
|
|
7340
|
+
this._popUp.opened = true;
|
|
7392
7341
|
}
|
|
7393
|
-
/**
|
|
7394
|
-
* Fecha o popup, liberando o conteúdo.
|
|
7395
|
-
*/
|
|
7396
7342
|
async closePopUp() {
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
});
|
|
7400
|
-
this._popUp["opened"] = false;
|
|
7343
|
+
this.clearPopUpContent();
|
|
7344
|
+
this._popUp.opened = false;
|
|
7401
7345
|
}
|
|
7402
|
-
/**
|
|
7403
|
-
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7404
|
-
*/
|
|
7405
7346
|
async temOpcional(opcional) {
|
|
7406
7347
|
const opts = opcional.split(",");
|
|
7407
7348
|
return new Promise((resolve, reject) => {
|
|
@@ -7425,10 +7366,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7425
7366
|
});
|
|
7426
7367
|
});
|
|
7427
7368
|
}
|
|
7428
|
-
/**
|
|
7429
|
-
* Retorna a configuração de um recurso por service broker
|
|
7430
|
-
* Veja também o método "loadConfig"
|
|
7431
|
-
*/
|
|
7432
7369
|
async getConfig(key) {
|
|
7433
7370
|
let payload = {
|
|
7434
7371
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7446,9 +7383,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7446
7383
|
.catch(error => reject(error));
|
|
7447
7384
|
});
|
|
7448
7385
|
}
|
|
7449
|
-
/**
|
|
7450
|
-
* Salva a configuração de determinado recurso.
|
|
7451
|
-
*/
|
|
7452
7386
|
async saveConfig(key, data) {
|
|
7453
7387
|
let payload = {
|
|
7454
7388
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7467,97 +7401,42 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7467
7401
|
.catch(error => reject(error));
|
|
7468
7402
|
});
|
|
7469
7403
|
}
|
|
7470
|
-
/**
|
|
7471
|
-
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7472
|
-
*/
|
|
7473
7404
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7474
7405
|
return Promise.resolve(window[attribName]);
|
|
7475
7406
|
}
|
|
7476
|
-
/**
|
|
7477
|
-
* Abre determinada tela, repassando pkObject
|
|
7478
|
-
*/
|
|
7479
7407
|
async openApp(resourceId, pkObject) {
|
|
7480
7408
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7481
7409
|
}
|
|
7482
|
-
/**
|
|
7483
|
-
* Cria o DataUnit a partir do nome da entidade.
|
|
7484
|
-
*/
|
|
7485
7410
|
async createDataunit(entityName) {
|
|
7486
7411
|
return new Promise(resolve => {
|
|
7487
7412
|
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7488
7413
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7489
7414
|
});
|
|
7490
7415
|
}
|
|
7491
|
-
/**
|
|
7492
|
-
* Cria e armazena o DataUnit em um cache
|
|
7493
|
-
*/
|
|
7494
|
-
async getDataUnit(entityName, dataUnitName) {
|
|
7495
|
-
return new Promise((resolve, reject) => {
|
|
7496
|
-
const dataUnit = this._duCache.get(dataUnitName);
|
|
7497
|
-
if (dataUnit) {
|
|
7498
|
-
resolve(dataUnit);
|
|
7499
|
-
}
|
|
7500
|
-
else {
|
|
7501
|
-
this.createDataunit(entityName).then(dataUnit => {
|
|
7502
|
-
if (dataUnitName) {
|
|
7503
|
-
this._duCache.set(dataUnitName, dataUnit);
|
|
7504
|
-
}
|
|
7505
|
-
resolve(dataUnit);
|
|
7506
|
-
}).catch(reason => reject(reason));
|
|
7507
|
-
}
|
|
7508
|
-
});
|
|
7509
|
-
}
|
|
7510
|
-
/**
|
|
7511
|
-
* Retorna o resourceID da tela em questão.
|
|
7512
|
-
*/
|
|
7513
7416
|
async getResourceID() {
|
|
7514
7417
|
return Promise.resolve(this.resourceID);
|
|
7515
7418
|
}
|
|
7516
|
-
/**
|
|
7517
|
-
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7518
|
-
*/
|
|
7519
7419
|
async alert(title, message, icon, options) {
|
|
7520
7420
|
return ApplicationUtils.alert(title, message, icon, options);
|
|
7521
7421
|
}
|
|
7522
|
-
/**
|
|
7523
|
-
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7524
|
-
*/
|
|
7525
7422
|
async error(title, message, icon, options) {
|
|
7526
7423
|
return ApplicationUtils.error(title, message, icon, options);
|
|
7527
7424
|
}
|
|
7528
|
-
/**
|
|
7529
|
-
* Exibe um diálogo de confirmação
|
|
7530
|
-
*/
|
|
7531
7425
|
async confirm(title, message, icon, critical, options) {
|
|
7532
7426
|
return ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
7533
7427
|
}
|
|
7534
|
-
/**
|
|
7535
|
-
* Mostra uma informação efêmera (de segundo plano).
|
|
7536
|
-
*/
|
|
7537
7428
|
async info(message, options) {
|
|
7538
7429
|
return ApplicationUtils.info(message, options);
|
|
7539
7430
|
}
|
|
7540
|
-
/**
|
|
7541
|
-
* Busca a configuração de formulário.
|
|
7542
|
-
*/
|
|
7543
7431
|
async loadFormConfig(name) {
|
|
7544
7432
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7545
7433
|
}
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
*/
|
|
7549
|
-
async loadGridConfig(name) {
|
|
7550
|
-
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7434
|
+
async loadGridConfig() {
|
|
7435
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7551
7436
|
}
|
|
7552
|
-
/**
|
|
7553
|
-
* Salva a configuração de grade.
|
|
7554
|
-
*/
|
|
7555
7437
|
async saveGridConfig(config) {
|
|
7556
7438
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7557
7439
|
}
|
|
7558
|
-
async getAuthList(_auth) {
|
|
7559
|
-
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7560
|
-
}
|
|
7561
7440
|
get urlParams() {
|
|
7562
7441
|
if (!this._urlParams) {
|
|
7563
7442
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7635,7 +7514,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7635
7514
|
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
7636
7515
|
pesquisaContent.selectItem = (option) => {
|
|
7637
7516
|
accept(option);
|
|
7638
|
-
this.
|
|
7517
|
+
this.clearPopUpTitle();
|
|
7639
7518
|
this.closePopUp();
|
|
7640
7519
|
};
|
|
7641
7520
|
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
@@ -7652,11 +7531,18 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7652
7531
|
accept(window['isDebugMode']);
|
|
7653
7532
|
});
|
|
7654
7533
|
}
|
|
7655
|
-
|
|
7656
|
-
this._popUp
|
|
7534
|
+
clearPopUpContent() {
|
|
7535
|
+
if (this._popUp) {
|
|
7536
|
+
Array.from(this._popUp.children).forEach(c => {
|
|
7537
|
+
this._popUp.removeChild(c);
|
|
7538
|
+
});
|
|
7539
|
+
}
|
|
7540
|
+
}
|
|
7541
|
+
clearPopUpTitle() {
|
|
7542
|
+
this._popUp.ezTitle = "";
|
|
7657
7543
|
}
|
|
7658
7544
|
setPopUpTitle(title) {
|
|
7659
|
-
this._popUp
|
|
7545
|
+
this._popUp.ezTitle = title;
|
|
7660
7546
|
}
|
|
7661
7547
|
componentWillLoad() {
|
|
7662
7548
|
this._errorHandler = new SnkErrorHandler(this);
|
|
@@ -7666,7 +7552,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7666
7552
|
});
|
|
7667
7553
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7668
7554
|
ErrorTracking.init();
|
|
7669
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7670
7555
|
}
|
|
7671
7556
|
connectedCallback() {
|
|
7672
7557
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -7701,7 +7586,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7701
7586
|
"getAttributeFromHTMLWrapper": [64],
|
|
7702
7587
|
"openApp": [64],
|
|
7703
7588
|
"createDataunit": [64],
|
|
7704
|
-
"getDataUnit": [64],
|
|
7705
7589
|
"getResourceID": [64],
|
|
7706
7590
|
"alert": [64],
|
|
7707
7591
|
"error": [64],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
|
-
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color:var(--text--primary, #626e82);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-
|
|
4
|
+
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color:var(--text--primary, #626e82);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input-close.sc-snk-pesquisa{cursor:pointer}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:#f0f2f5;border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:#f0f2f5;width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}";
|
|
5
5
|
|
|
6
6
|
const SnkPesquisa = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|