@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
|
@@ -2,9 +2,10 @@
|
|
|
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
|
+
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
8
9
|
|
|
9
10
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
10
11
|
|
|
@@ -1235,7 +1236,7 @@ function isNode(maybeNode) {
|
|
|
1235
1236
|
}
|
|
1236
1237
|
/** Name */
|
|
1237
1238
|
|
|
1238
|
-
|
|
1239
|
+
let OperationTypeNode;
|
|
1239
1240
|
exports.OperationTypeNode = OperationTypeNode;
|
|
1240
1241
|
|
|
1241
1242
|
(function (OperationTypeNode) {
|
|
@@ -1255,7 +1256,13 @@ exports.DirectiveLocation = void 0;
|
|
|
1255
1256
|
/**
|
|
1256
1257
|
* The set of allowed directive location values.
|
|
1257
1258
|
*/
|
|
1258
|
-
|
|
1259
|
+
let DirectiveLocation;
|
|
1260
|
+
/**
|
|
1261
|
+
* The enum type representing the directive location values.
|
|
1262
|
+
*
|
|
1263
|
+
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1264
|
+
*/
|
|
1265
|
+
|
|
1259
1266
|
exports.DirectiveLocation = DirectiveLocation;
|
|
1260
1267
|
|
|
1261
1268
|
(function (DirectiveLocation) {
|
|
@@ -1279,11 +1286,6 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1279
1286
|
DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';
|
|
1280
1287
|
DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';
|
|
1281
1288
|
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {}));
|
|
1282
|
-
/**
|
|
1283
|
-
* The enum type representing the directive location values.
|
|
1284
|
-
*
|
|
1285
|
-
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1286
|
-
*/
|
|
1287
1289
|
});
|
|
1288
1290
|
|
|
1289
1291
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
@@ -1296,7 +1298,13 @@ exports.Kind = void 0;
|
|
|
1296
1298
|
/**
|
|
1297
1299
|
* The set of allowed kind values for AST nodes.
|
|
1298
1300
|
*/
|
|
1299
|
-
|
|
1301
|
+
let Kind;
|
|
1302
|
+
/**
|
|
1303
|
+
* The enum type representing the possible kind values of AST nodes.
|
|
1304
|
+
*
|
|
1305
|
+
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1306
|
+
*/
|
|
1307
|
+
|
|
1300
1308
|
exports.Kind = Kind;
|
|
1301
1309
|
|
|
1302
1310
|
(function (Kind) {
|
|
@@ -1344,11 +1352,6 @@ exports.Kind = Kind;
|
|
|
1344
1352
|
Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';
|
|
1345
1353
|
Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';
|
|
1346
1354
|
})(Kind || (exports.Kind = Kind = {}));
|
|
1347
|
-
/**
|
|
1348
|
-
* The enum type representing the possible kind values of AST nodes.
|
|
1349
|
-
*
|
|
1350
|
-
* @deprecated Please use `Kind`. Will be remove in v17.
|
|
1351
|
-
*/
|
|
1352
1355
|
});
|
|
1353
1356
|
|
|
1354
1357
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
@@ -1636,7 +1639,13 @@ exports.TokenKind = void 0;
|
|
|
1636
1639
|
* An exported enum describing the different kinds of tokens that the
|
|
1637
1640
|
* lexer emits.
|
|
1638
1641
|
*/
|
|
1639
|
-
|
|
1642
|
+
let TokenKind;
|
|
1643
|
+
/**
|
|
1644
|
+
* The enum type representing the token kinds values.
|
|
1645
|
+
*
|
|
1646
|
+
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1647
|
+
*/
|
|
1648
|
+
|
|
1640
1649
|
exports.TokenKind = TokenKind;
|
|
1641
1650
|
|
|
1642
1651
|
(function (TokenKind) {
|
|
@@ -1663,11 +1672,6 @@ exports.TokenKind = TokenKind;
|
|
|
1663
1672
|
TokenKind['BLOCK_STRING'] = 'BlockString';
|
|
1664
1673
|
TokenKind['COMMENT'] = 'Comment';
|
|
1665
1674
|
})(TokenKind || (exports.TokenKind = TokenKind = {}));
|
|
1666
|
-
/**
|
|
1667
|
-
* The enum type representing the token kinds values.
|
|
1668
|
-
*
|
|
1669
|
-
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1670
|
-
*/
|
|
1671
1675
|
});
|
|
1672
1676
|
|
|
1673
1677
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
@@ -3004,13 +3008,12 @@ function parseType(source, options) {
|
|
|
3004
3008
|
*/
|
|
3005
3009
|
|
|
3006
3010
|
class Parser {
|
|
3007
|
-
constructor(source$1, options
|
|
3011
|
+
constructor(source$1, options) {
|
|
3008
3012
|
const sourceObj = (0, source.isSource)(source$1)
|
|
3009
3013
|
? source$1
|
|
3010
3014
|
: new source.Source(source$1);
|
|
3011
3015
|
this._lexer = new lexer.Lexer(sourceObj);
|
|
3012
3016
|
this._options = options;
|
|
3013
|
-
this._tokenCounter = 0;
|
|
3014
3017
|
}
|
|
3015
3018
|
/**
|
|
3016
3019
|
* Converts a name lex token into a name parse node.
|
|
@@ -3345,12 +3348,18 @@ class Parser {
|
|
|
3345
3348
|
*/
|
|
3346
3349
|
|
|
3347
3350
|
parseFragmentDefinition() {
|
|
3351
|
+
var _this$_options;
|
|
3352
|
+
|
|
3348
3353
|
const start = this._lexer.token;
|
|
3349
3354
|
this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes
|
|
3350
3355
|
// the grammar of FragmentDefinition:
|
|
3351
3356
|
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
3352
3357
|
|
|
3353
|
-
if (
|
|
3358
|
+
if (
|
|
3359
|
+
((_this$_options = this._options) === null || _this$_options === void 0
|
|
3360
|
+
? void 0
|
|
3361
|
+
: _this$_options.allowLegacyFragmentVariables) === true
|
|
3362
|
+
) {
|
|
3354
3363
|
return this.node(start, {
|
|
3355
3364
|
kind: kinds.Kind.FRAGMENT_DEFINITION,
|
|
3356
3365
|
name: this.parseFragmentName(),
|
|
@@ -3411,14 +3420,16 @@ class Parser {
|
|
|
3411
3420
|
return this.parseObject(isConst);
|
|
3412
3421
|
|
|
3413
3422
|
case tokenKind.TokenKind.INT:
|
|
3414
|
-
this.
|
|
3423
|
+
this._lexer.advance();
|
|
3424
|
+
|
|
3415
3425
|
return this.node(token, {
|
|
3416
3426
|
kind: kinds.Kind.INT,
|
|
3417
3427
|
value: token.value,
|
|
3418
3428
|
});
|
|
3419
3429
|
|
|
3420
3430
|
case tokenKind.TokenKind.FLOAT:
|
|
3421
|
-
this.
|
|
3431
|
+
this._lexer.advance();
|
|
3432
|
+
|
|
3422
3433
|
return this.node(token, {
|
|
3423
3434
|
kind: kinds.Kind.FLOAT,
|
|
3424
3435
|
value: token.value,
|
|
@@ -3429,7 +3440,7 @@ class Parser {
|
|
|
3429
3440
|
return this.parseStringLiteral();
|
|
3430
3441
|
|
|
3431
3442
|
case tokenKind.TokenKind.NAME:
|
|
3432
|
-
this.
|
|
3443
|
+
this._lexer.advance();
|
|
3433
3444
|
|
|
3434
3445
|
switch (token.value) {
|
|
3435
3446
|
case 'true':
|
|
@@ -3485,7 +3496,9 @@ class Parser {
|
|
|
3485
3496
|
|
|
3486
3497
|
parseStringLiteral() {
|
|
3487
3498
|
const token = this._lexer.token;
|
|
3488
|
-
|
|
3499
|
+
|
|
3500
|
+
this._lexer.advance();
|
|
3501
|
+
|
|
3489
3502
|
return this.node(token, {
|
|
3490
3503
|
kind: kinds.Kind.STRING,
|
|
3491
3504
|
value: token.value,
|
|
@@ -4276,7 +4289,13 @@ class Parser {
|
|
|
4276
4289
|
*/
|
|
4277
4290
|
|
|
4278
4291
|
node(startToken, node) {
|
|
4279
|
-
|
|
4292
|
+
var _this$_options2;
|
|
4293
|
+
|
|
4294
|
+
if (
|
|
4295
|
+
((_this$_options2 = this._options) === null || _this$_options2 === void 0
|
|
4296
|
+
? void 0
|
|
4297
|
+
: _this$_options2.noLocation) !== true
|
|
4298
|
+
) {
|
|
4280
4299
|
node.loc = new ast.Location(
|
|
4281
4300
|
startToken,
|
|
4282
4301
|
this._lexer.lastToken,
|
|
@@ -4302,7 +4321,8 @@ class Parser {
|
|
|
4302
4321
|
const token = this._lexer.token;
|
|
4303
4322
|
|
|
4304
4323
|
if (token.kind === kind) {
|
|
4305
|
-
this.
|
|
4324
|
+
this._lexer.advance();
|
|
4325
|
+
|
|
4306
4326
|
return token;
|
|
4307
4327
|
}
|
|
4308
4328
|
|
|
@@ -4321,7 +4341,8 @@ class Parser {
|
|
|
4321
4341
|
const token = this._lexer.token;
|
|
4322
4342
|
|
|
4323
4343
|
if (token.kind === kind) {
|
|
4324
|
-
this.
|
|
4344
|
+
this._lexer.advance();
|
|
4345
|
+
|
|
4325
4346
|
return true;
|
|
4326
4347
|
}
|
|
4327
4348
|
|
|
@@ -4336,7 +4357,7 @@ class Parser {
|
|
|
4336
4357
|
const token = this._lexer.token;
|
|
4337
4358
|
|
|
4338
4359
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4339
|
-
this.
|
|
4360
|
+
this._lexer.advance();
|
|
4340
4361
|
} else {
|
|
4341
4362
|
throw (0, syntaxError_1.syntaxError)(
|
|
4342
4363
|
this._lexer.source,
|
|
@@ -4354,7 +4375,8 @@ class Parser {
|
|
|
4354
4375
|
const token = this._lexer.token;
|
|
4355
4376
|
|
|
4356
4377
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4357
|
-
this.
|
|
4378
|
+
this._lexer.advance();
|
|
4379
|
+
|
|
4358
4380
|
return true;
|
|
4359
4381
|
}
|
|
4360
4382
|
|
|
@@ -4441,24 +4463,6 @@ class Parser {
|
|
|
4441
4463
|
|
|
4442
4464
|
return nodes;
|
|
4443
4465
|
}
|
|
4444
|
-
|
|
4445
|
-
advanceLexer() {
|
|
4446
|
-
const { maxTokens } = this._options;
|
|
4447
|
-
|
|
4448
|
-
const token = this._lexer.advance();
|
|
4449
|
-
|
|
4450
|
-
if (maxTokens !== undefined && token.kind !== tokenKind.TokenKind.EOF) {
|
|
4451
|
-
++this._tokenCounter;
|
|
4452
|
-
|
|
4453
|
-
if (this._tokenCounter > maxTokens) {
|
|
4454
|
-
throw (0, syntaxError_1.syntaxError)(
|
|
4455
|
-
this._lexer.source,
|
|
4456
|
-
token.start,
|
|
4457
|
-
`Document contains more that ${maxTokens} tokens. Parsing aborted.`,
|
|
4458
|
-
);
|
|
4459
|
-
}
|
|
4460
|
-
}
|
|
4461
|
-
}
|
|
4462
4466
|
}
|
|
4463
4467
|
/**
|
|
4464
4468
|
* A helper function to describe a token as a string for debugging.
|
|
@@ -6691,7 +6695,6 @@ class WaitingRequest {
|
|
|
6691
6695
|
class DataUnitFetcher {
|
|
6692
6696
|
constructor() {
|
|
6693
6697
|
this.templateByQuery = new Map();
|
|
6694
|
-
this._loadDataTimeout = {};
|
|
6695
6698
|
this.buldTemplates();
|
|
6696
6699
|
}
|
|
6697
6700
|
buldTemplates() {
|
|
@@ -6720,9 +6723,9 @@ class DataUnitFetcher {
|
|
|
6720
6723
|
}
|
|
6721
6724
|
}
|
|
6722
6725
|
}`);
|
|
6723
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $
|
|
6726
|
+
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filter: [InputFilter!] $sort: [InputSort!]) {
|
|
6724
6727
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6725
|
-
data(limit: $limit offset: $offset filters: $
|
|
6728
|
+
data(limit: $limit offset: $offset filters: $filter sort: $sort){
|
|
6726
6729
|
limit
|
|
6727
6730
|
offset
|
|
6728
6731
|
total
|
|
@@ -6751,7 +6754,7 @@ class DataUnitFetcher {
|
|
|
6751
6754
|
getDataUnit(entityName, resourceID) {
|
|
6752
6755
|
const dataUnit = new core.DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6753
6756
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6754
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6757
|
+
dataUnit.dataLoader = (dataUnit, page, sort, filters) => this.loadData(dataUnit, page, sort, filters);
|
|
6755
6758
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6756
6759
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6757
6760
|
return dataUnit;
|
|
@@ -6788,39 +6791,25 @@ class DataUnitFetcher {
|
|
|
6788
6791
|
});
|
|
6789
6792
|
});
|
|
6790
6793
|
}
|
|
6791
|
-
loadData(dataUnit,
|
|
6792
|
-
const duName = dataUnit.name;
|
|
6793
|
-
if (this._loadDataTimeout[duName]) {
|
|
6794
|
-
clearTimeout(this._loadDataTimeout[duName]);
|
|
6795
|
-
delete this._loadDataTimeout[duName];
|
|
6796
|
-
}
|
|
6797
|
-
return new Promise((resolve, reject) => {
|
|
6798
|
-
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6799
|
-
delete this._loadDataTimeout[duName];
|
|
6800
|
-
this.doLoadData(dataUnit, request)
|
|
6801
|
-
.then(result => resolve(result))
|
|
6802
|
-
.catch(reason => reject(reason));
|
|
6803
|
-
}, 200);
|
|
6804
|
-
});
|
|
6805
|
-
}
|
|
6806
|
-
doLoadData(dataUnit, request) {
|
|
6794
|
+
loadData(dataUnit, page, sort, filter) {
|
|
6807
6795
|
return new Promise((resolve, reject) => {
|
|
6808
|
-
var _a;
|
|
6809
|
-
const {
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6796
|
+
var _a, _b, _c;
|
|
6797
|
+
const variables = { dataunit: dataUnit.name, sort, filter };
|
|
6798
|
+
if (page) {
|
|
6799
|
+
variables.limit = page.limit;
|
|
6800
|
+
variables.offset = page.offset;
|
|
6801
|
+
}
|
|
6802
|
+
if (!core.StringUtils.isEmpty((_a = page === null || page === void 0 ? void 0 : page.quickFilter) === null || _a === void 0 ? void 0 : _a.term)) {
|
|
6814
6803
|
if (variables.filter === undefined) {
|
|
6815
6804
|
variables.filter = [];
|
|
6816
6805
|
}
|
|
6817
6806
|
const quickFilterCriteria = {
|
|
6818
6807
|
name: "__QUICK_FILTER__",
|
|
6819
6808
|
expression: "__QUICK_FILTER__",
|
|
6820
|
-
params: [{ name: "term", dataType: core.DataType.TEXT, value: quickFilter.term }]
|
|
6809
|
+
params: [{ name: "term", dataType: core.DataType.TEXT, value: page.quickFilter.term }]
|
|
6821
6810
|
};
|
|
6822
|
-
if (((
|
|
6823
|
-
quickFilterCriteria.params.push({ name: "fields", dataType: core.DataType.OBJECT, value: quickFilter.fields });
|
|
6811
|
+
if (((_c = (_b = page.quickFilter) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
6812
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: core.DataType.OBJECT, value: page.quickFilter.fields });
|
|
6824
6813
|
}
|
|
6825
6814
|
variables.filter.push(quickFilterCriteria);
|
|
6826
6815
|
}
|
|
@@ -6830,32 +6819,16 @@ class DataUnitFetcher {
|
|
|
6830
6819
|
query: this.templateByQuery.get("fetchData"),
|
|
6831
6820
|
})
|
|
6832
6821
|
.then((resp) => {
|
|
6833
|
-
const
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
const firstRecord = offset + 1;
|
|
6837
|
-
const lastRecord = offset + Math.min(records.length, limit);
|
|
6838
|
-
const currentPage = offset / limit;
|
|
6839
|
-
paginationInfo = {
|
|
6840
|
-
firstRecord,
|
|
6841
|
-
lastRecord,
|
|
6842
|
-
total,
|
|
6843
|
-
currentPage,
|
|
6844
|
-
hasMore
|
|
6845
|
-
};
|
|
6846
|
-
}
|
|
6847
|
-
const processedRecords = [];
|
|
6848
|
-
records.forEach((responseRecord) => {
|
|
6822
|
+
const pageResult = resp.data;
|
|
6823
|
+
const records = [];
|
|
6824
|
+
pageResult.records.forEach((responseRecord) => {
|
|
6849
6825
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6850
6826
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6851
6827
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6852
6828
|
});
|
|
6853
|
-
|
|
6854
|
-
});
|
|
6855
|
-
resolve({
|
|
6856
|
-
paginationInfo,
|
|
6857
|
-
records: processedRecords
|
|
6829
|
+
records.push(duRecord);
|
|
6858
6830
|
});
|
|
6831
|
+
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6859
6832
|
})
|
|
6860
6833
|
.catch((error) => {
|
|
6861
6834
|
reject(error);
|
|
@@ -7081,16 +7054,15 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7081
7054
|
super(...arguments);
|
|
7082
7055
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7083
7056
|
}
|
|
7084
|
-
getConfig(
|
|
7057
|
+
getConfig(resourceID) {
|
|
7085
7058
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7086
7059
|
return new Promise((resolve, reject) => {
|
|
7087
7060
|
this.loadResource(completePath)
|
|
7088
7061
|
.then(loadedResource => {
|
|
7089
|
-
let config = undefined;
|
|
7090
7062
|
if (loadedResource) {
|
|
7091
|
-
config = JSON.parse(loadedResource);
|
|
7063
|
+
let config = JSON.parse(loadedResource);
|
|
7064
|
+
resolve(config);
|
|
7092
7065
|
}
|
|
7093
|
-
resolve(config);
|
|
7094
7066
|
}).catch((error) => {
|
|
7095
7067
|
reject(error);
|
|
7096
7068
|
});
|
|
@@ -7125,6 +7097,7 @@ class PesquisaFetcher {
|
|
|
7125
7097
|
}`);
|
|
7126
7098
|
}
|
|
7127
7099
|
loadSearchOptions(entityName, argument, criteria, options) {
|
|
7100
|
+
argument = (argument === null || argument === void 0 ? void 0 : argument.trim()) ? `%${argument}` : argument === null || argument === void 0 ? void 0 : argument.trim();
|
|
7128
7101
|
return new Promise((resolve, reject) => {
|
|
7129
7102
|
DataFetcher.get()
|
|
7130
7103
|
.callGraphQL({
|
|
@@ -7283,7 +7256,6 @@ const SnkApplication = class {
|
|
|
7283
7256
|
index.registerInstance(this, hostRef);
|
|
7284
7257
|
this.applicationLoaded = index.createEvent(this, "applicationLoaded", 7);
|
|
7285
7258
|
this.applicationLoading = index.createEvent(this, "applicationLoading", 7);
|
|
7286
|
-
this._duCache = new Map();
|
|
7287
7259
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7288
7260
|
}
|
|
7289
7261
|
get parameters() {
|
|
@@ -7314,9 +7286,6 @@ const SnkApplication = class {
|
|
|
7314
7286
|
}
|
|
7315
7287
|
});
|
|
7316
7288
|
}
|
|
7317
|
-
/**
|
|
7318
|
-
* Caso o usuário logado seja o SUP.
|
|
7319
|
-
*/
|
|
7320
7289
|
async isUserSup() {
|
|
7321
7290
|
return new Promise((resolve, reject) => {
|
|
7322
7291
|
this.auth.then((authorization) => {
|
|
@@ -7326,9 +7295,6 @@ const SnkApplication = class {
|
|
|
7326
7295
|
});
|
|
7327
7296
|
});
|
|
7328
7297
|
}
|
|
7329
|
-
/**
|
|
7330
|
-
* Se o usuário logado tem permissão pra determinada ação.
|
|
7331
|
-
*/
|
|
7332
7298
|
async hasAccess(access) {
|
|
7333
7299
|
return new Promise((resolve, reject) => {
|
|
7334
7300
|
this.auth.then((authorization) => {
|
|
@@ -7338,9 +7304,6 @@ const SnkApplication = class {
|
|
|
7338
7304
|
});
|
|
7339
7305
|
});
|
|
7340
7306
|
}
|
|
7341
|
-
/**
|
|
7342
|
-
* Retorna todos os acessos do usuário logado.
|
|
7343
|
-
*/
|
|
7344
7307
|
async getAllAccess() {
|
|
7345
7308
|
return new Promise((resolve, reject) => {
|
|
7346
7309
|
this.auth.then((authorization) => {
|
|
@@ -7355,55 +7318,33 @@ const SnkApplication = class {
|
|
|
7355
7318
|
});
|
|
7356
7319
|
});
|
|
7357
7320
|
}
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7321
|
+
async getAuthList(_auth) {
|
|
7322
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7323
|
+
}
|
|
7361
7324
|
async getStringParam(name) {
|
|
7362
7325
|
return this.parameters.asString(name, this.resourceID);
|
|
7363
7326
|
}
|
|
7364
|
-
/**
|
|
7365
|
-
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7366
|
-
*/
|
|
7367
7327
|
async getIntParam(name) {
|
|
7368
7328
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7369
7329
|
}
|
|
7370
|
-
/**
|
|
7371
|
-
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7372
|
-
*/
|
|
7373
7330
|
async getFloatParam(name) {
|
|
7374
7331
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7375
7332
|
}
|
|
7376
|
-
/**
|
|
7377
|
-
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7378
|
-
*/
|
|
7379
7333
|
async getBooleanParam(name) {
|
|
7380
7334
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7381
7335
|
}
|
|
7382
|
-
/**
|
|
7383
|
-
* Retorna o valor de um parâmetro do tipo data.
|
|
7384
|
-
*/
|
|
7385
7336
|
async getDateParam(name) {
|
|
7386
7337
|
return this.parameters.asDate(name, this.resourceID);
|
|
7387
7338
|
}
|
|
7388
|
-
/**
|
|
7389
|
-
* Mostra o conteúdo passado em um Popup
|
|
7390
|
-
*/
|
|
7391
7339
|
async showPopUp(content) {
|
|
7340
|
+
this.clearPopUpContent();
|
|
7392
7341
|
this._popUp.appendChild(content);
|
|
7393
|
-
this._popUp
|
|
7342
|
+
this._popUp.opened = true;
|
|
7394
7343
|
}
|
|
7395
|
-
/**
|
|
7396
|
-
* Fecha o popup, liberando o conteúdo.
|
|
7397
|
-
*/
|
|
7398
7344
|
async closePopUp() {
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
});
|
|
7402
|
-
this._popUp["opened"] = false;
|
|
7345
|
+
this.clearPopUpContent();
|
|
7346
|
+
this._popUp.opened = false;
|
|
7403
7347
|
}
|
|
7404
|
-
/**
|
|
7405
|
-
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7406
|
-
*/
|
|
7407
7348
|
async temOpcional(opcional) {
|
|
7408
7349
|
const opts = opcional.split(",");
|
|
7409
7350
|
return new Promise((resolve, reject) => {
|
|
@@ -7427,10 +7368,6 @@ const SnkApplication = class {
|
|
|
7427
7368
|
});
|
|
7428
7369
|
});
|
|
7429
7370
|
}
|
|
7430
|
-
/**
|
|
7431
|
-
* Retorna a configuração de um recurso por service broker
|
|
7432
|
-
* Veja também o método "loadConfig"
|
|
7433
|
-
*/
|
|
7434
7371
|
async getConfig(key) {
|
|
7435
7372
|
let payload = {
|
|
7436
7373
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7448,9 +7385,6 @@ const SnkApplication = class {
|
|
|
7448
7385
|
.catch(error => reject(error));
|
|
7449
7386
|
});
|
|
7450
7387
|
}
|
|
7451
|
-
/**
|
|
7452
|
-
* Salva a configuração de determinado recurso.
|
|
7453
|
-
*/
|
|
7454
7388
|
async saveConfig(key, data) {
|
|
7455
7389
|
let payload = {
|
|
7456
7390
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7469,97 +7403,42 @@ const SnkApplication = class {
|
|
|
7469
7403
|
.catch(error => reject(error));
|
|
7470
7404
|
});
|
|
7471
7405
|
}
|
|
7472
|
-
/**
|
|
7473
|
-
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7474
|
-
*/
|
|
7475
7406
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7476
7407
|
return Promise.resolve(window[attribName]);
|
|
7477
7408
|
}
|
|
7478
|
-
/**
|
|
7479
|
-
* Abre determinada tela, repassando pkObject
|
|
7480
|
-
*/
|
|
7481
7409
|
async openApp(resourceId, pkObject) {
|
|
7482
7410
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7483
7411
|
}
|
|
7484
|
-
/**
|
|
7485
|
-
* Cria o DataUnit a partir do nome da entidade.
|
|
7486
|
-
*/
|
|
7487
7412
|
async createDataunit(entityName) {
|
|
7488
7413
|
return new Promise(resolve => {
|
|
7489
7414
|
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7490
7415
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7491
7416
|
});
|
|
7492
7417
|
}
|
|
7493
|
-
/**
|
|
7494
|
-
* Cria e armazena o DataUnit em um cache
|
|
7495
|
-
*/
|
|
7496
|
-
async getDataUnit(entityName, dataUnitName) {
|
|
7497
|
-
return new Promise((resolve, reject) => {
|
|
7498
|
-
const dataUnit = this._duCache.get(dataUnitName);
|
|
7499
|
-
if (dataUnit) {
|
|
7500
|
-
resolve(dataUnit);
|
|
7501
|
-
}
|
|
7502
|
-
else {
|
|
7503
|
-
this.createDataunit(entityName).then(dataUnit => {
|
|
7504
|
-
if (dataUnitName) {
|
|
7505
|
-
this._duCache.set(dataUnitName, dataUnit);
|
|
7506
|
-
}
|
|
7507
|
-
resolve(dataUnit);
|
|
7508
|
-
}).catch(reason => reject(reason));
|
|
7509
|
-
}
|
|
7510
|
-
});
|
|
7511
|
-
}
|
|
7512
|
-
/**
|
|
7513
|
-
* Retorna o resourceID da tela em questão.
|
|
7514
|
-
*/
|
|
7515
7418
|
async getResourceID() {
|
|
7516
7419
|
return Promise.resolve(this.resourceID);
|
|
7517
7420
|
}
|
|
7518
|
-
/**
|
|
7519
|
-
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7520
|
-
*/
|
|
7521
7421
|
async alert(title, message, icon, options) {
|
|
7522
7422
|
return utils.ApplicationUtils.alert(title, message, icon, options);
|
|
7523
7423
|
}
|
|
7524
|
-
/**
|
|
7525
|
-
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7526
|
-
*/
|
|
7527
7424
|
async error(title, message, icon, options) {
|
|
7528
7425
|
return utils.ApplicationUtils.error(title, message, icon, options);
|
|
7529
7426
|
}
|
|
7530
|
-
/**
|
|
7531
|
-
* Exibe um diálogo de confirmação
|
|
7532
|
-
*/
|
|
7533
7427
|
async confirm(title, message, icon, critical, options) {
|
|
7534
7428
|
return utils.ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
7535
7429
|
}
|
|
7536
|
-
/**
|
|
7537
|
-
* Mostra uma informação efêmera (de segundo plano).
|
|
7538
|
-
*/
|
|
7539
7430
|
async info(message, options) {
|
|
7540
7431
|
return utils.ApplicationUtils.info(message, options);
|
|
7541
7432
|
}
|
|
7542
|
-
/**
|
|
7543
|
-
* Busca a configuração de formulário.
|
|
7544
|
-
*/
|
|
7545
7433
|
async loadFormConfig(name) {
|
|
7546
7434
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7547
7435
|
}
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
*/
|
|
7551
|
-
async loadGridConfig(name) {
|
|
7552
|
-
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7436
|
+
async loadGridConfig() {
|
|
7437
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7553
7438
|
}
|
|
7554
|
-
/**
|
|
7555
|
-
* Salva a configuração de grade.
|
|
7556
|
-
*/
|
|
7557
7439
|
async saveGridConfig(config) {
|
|
7558
7440
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7559
7441
|
}
|
|
7560
|
-
async getAuthList(_auth) {
|
|
7561
|
-
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7562
|
-
}
|
|
7563
7442
|
get urlParams() {
|
|
7564
7443
|
if (!this._urlParams) {
|
|
7565
7444
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7612,7 +7491,7 @@ const SnkApplication = class {
|
|
|
7612
7491
|
};
|
|
7613
7492
|
dependencies === null || dependencies === void 0 ? void 0 : dependencies.filter(dep => { var _a; return (_a = dep.masterFields) === null || _a === void 0 ? void 0 : _a.every(f => { var _a; return (_a = dataUnit.getField(f)) === null || _a === void 0 ? void 0 : _a.visible; }); }).forEach(dependency => {
|
|
7614
7493
|
var _a;
|
|
7615
|
-
if (dependency.type ===
|
|
7494
|
+
if (dependency.type === UnitMetadata.DependencyType.SEARCHING) {
|
|
7616
7495
|
if (((_a = dependency.masterFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
7617
7496
|
criteria = {
|
|
7618
7497
|
expression: dependency.expression,
|
|
@@ -7637,7 +7516,7 @@ const SnkApplication = class {
|
|
|
7637
7516
|
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
7638
7517
|
pesquisaContent.selectItem = (option) => {
|
|
7639
7518
|
accept(option);
|
|
7640
|
-
this.
|
|
7519
|
+
this.clearPopUpTitle();
|
|
7641
7520
|
this.closePopUp();
|
|
7642
7521
|
};
|
|
7643
7522
|
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
@@ -7654,11 +7533,18 @@ const SnkApplication = class {
|
|
|
7654
7533
|
accept(window['isDebugMode']);
|
|
7655
7534
|
});
|
|
7656
7535
|
}
|
|
7657
|
-
|
|
7658
|
-
this._popUp
|
|
7536
|
+
clearPopUpContent() {
|
|
7537
|
+
if (this._popUp) {
|
|
7538
|
+
Array.from(this._popUp.children).forEach(c => {
|
|
7539
|
+
this._popUp.removeChild(c);
|
|
7540
|
+
});
|
|
7541
|
+
}
|
|
7542
|
+
}
|
|
7543
|
+
clearPopUpTitle() {
|
|
7544
|
+
this._popUp.ezTitle = "";
|
|
7659
7545
|
}
|
|
7660
7546
|
setPopUpTitle(title) {
|
|
7661
|
-
this._popUp
|
|
7547
|
+
this._popUp.ezTitle = title;
|
|
7662
7548
|
}
|
|
7663
7549
|
componentWillLoad() {
|
|
7664
7550
|
this._errorHandler = new SnkErrorHandler(this);
|
|
@@ -7668,7 +7554,6 @@ const SnkApplication = class {
|
|
|
7668
7554
|
});
|
|
7669
7555
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7670
7556
|
core.ErrorTracking.init();
|
|
7671
|
-
core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7672
7557
|
}
|
|
7673
7558
|
connectedCallback() {
|
|
7674
7559
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -2,10 +2,10 @@
|
|
|
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
|
|
|
8
|
-
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-
|
|
8
|
+
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)}";
|
|
9
9
|
|
|
10
10
|
const SnkPesquisa = class {
|
|
11
11
|
constructor(hostRef) {
|