@sankhyalabs/sankhyablocks 1.3.31-beta.4 → 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-ebe8245e.js → index-1133bc2a.js} +9 -453
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +95 -118
- 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 +20 -61
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +21 -36
- 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 +94 -118
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/esm/{index-7565ae23.js → index-ffda6382.js} +10 -453
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +95 -118
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-bb31ea2a.entry.js → p-2a7b4cb3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6d82d7fd.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 +5 -6
- package/dist/types/components.d.ts +1 -119
- 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 -174
- 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 -159
- package/dist/cjs/taskbar-elements-589a3744.js +0 -68
- 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 -429
- 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/component/snk-popup-button.js +0 -7
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +0 -63
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +0 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +0 -268
- package/dist/components/snk-data-unit.d.ts +0 -11
- package/dist/components/snk-data-unit.js +0 -198
- 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 -239
- package/dist/esm/snk-data-unit.entry.js +0 -170
- 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 -155
- package/dist/esm/taskbar-elements-b6822601.js +0 -66
- package/dist/sankhyablocks/p-306224bf.entry.js +0 -1
- package/dist/sankhyablocks/p-4ee1e12b.js +0 -1
- package/dist/sankhyablocks/p-88278b85.entry.js +0 -1
- package/dist/sankhyablocks/p-90b832f7.js +0 -2
- package/dist/sankhyablocks/p-a4b2fa10.entry.js +0 -69
- package/dist/sankhyablocks/p-bb8d8fe7.entry.js +0 -1
- package/dist/sankhyablocks/p-e7ade160.entry.js +0 -1
- package/dist/types/components/snk-taskbar/component/snk-popup-button.d.ts +0 -12
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +0 -24
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -28
|
@@ -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.
|
|
@@ -6716,9 +6720,9 @@ class DataUnitFetcher {
|
|
|
6716
6720
|
}
|
|
6717
6721
|
}
|
|
6718
6722
|
}`);
|
|
6719
|
-
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!]) {
|
|
6720
6724
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6721
|
-
data(limit: $limit offset: $offset filters: $
|
|
6725
|
+
data(limit: $limit offset: $offset filters: $filter sort: $sort){
|
|
6722
6726
|
limit
|
|
6723
6727
|
offset
|
|
6724
6728
|
total
|
|
@@ -6747,7 +6751,7 @@ class DataUnitFetcher {
|
|
|
6747
6751
|
getDataUnit(entityName, resourceID) {
|
|
6748
6752
|
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6749
6753
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6750
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6754
|
+
dataUnit.dataLoader = (dataUnit, page, sort, filters) => this.loadData(dataUnit, page, sort, filters);
|
|
6751
6755
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6752
6756
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6753
6757
|
return dataUnit;
|
|
@@ -6784,24 +6788,25 @@ class DataUnitFetcher {
|
|
|
6784
6788
|
});
|
|
6785
6789
|
});
|
|
6786
6790
|
}
|
|
6787
|
-
loadData(dataUnit,
|
|
6791
|
+
loadData(dataUnit, page, sort, filter) {
|
|
6788
6792
|
return new Promise((resolve, reject) => {
|
|
6789
|
-
var _a;
|
|
6790
|
-
const {
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
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)) {
|
|
6795
6800
|
if (variables.filter === undefined) {
|
|
6796
6801
|
variables.filter = [];
|
|
6797
6802
|
}
|
|
6798
6803
|
const quickFilterCriteria = {
|
|
6799
6804
|
name: "__QUICK_FILTER__",
|
|
6800
6805
|
expression: "__QUICK_FILTER__",
|
|
6801
|
-
params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
|
|
6806
|
+
params: [{ name: "term", dataType: DataType.TEXT, value: page.quickFilter.term }]
|
|
6802
6807
|
};
|
|
6803
|
-
if (((
|
|
6804
|
-
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 });
|
|
6805
6810
|
}
|
|
6806
6811
|
variables.filter.push(quickFilterCriteria);
|
|
6807
6812
|
}
|
|
@@ -6811,32 +6816,16 @@ class DataUnitFetcher {
|
|
|
6811
6816
|
query: this.templateByQuery.get("fetchData"),
|
|
6812
6817
|
})
|
|
6813
6818
|
.then((resp) => {
|
|
6814
|
-
const
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
const firstRecord = offset + 1;
|
|
6818
|
-
const lastRecord = offset + Math.min(records.length, limit);
|
|
6819
|
-
const currentPage = offset / limit;
|
|
6820
|
-
paginationInfo = {
|
|
6821
|
-
firstRecord,
|
|
6822
|
-
lastRecord,
|
|
6823
|
-
total,
|
|
6824
|
-
currentPage,
|
|
6825
|
-
hasMore
|
|
6826
|
-
};
|
|
6827
|
-
}
|
|
6828
|
-
const processedRecords = [];
|
|
6829
|
-
records.forEach((responseRecord) => {
|
|
6819
|
+
const pageResult = resp.data;
|
|
6820
|
+
const records = [];
|
|
6821
|
+
pageResult.records.forEach((responseRecord) => {
|
|
6830
6822
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6831
6823
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6832
6824
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6833
6825
|
});
|
|
6834
|
-
|
|
6835
|
-
});
|
|
6836
|
-
resolve({
|
|
6837
|
-
paginationInfo,
|
|
6838
|
-
records: processedRecords
|
|
6826
|
+
records.push(duRecord);
|
|
6839
6827
|
});
|
|
6828
|
+
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6840
6829
|
})
|
|
6841
6830
|
.catch((error) => {
|
|
6842
6831
|
reject(error);
|
|
@@ -7062,16 +7051,15 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7062
7051
|
super(...arguments);
|
|
7063
7052
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7064
7053
|
}
|
|
7065
|
-
getConfig(
|
|
7054
|
+
getConfig(resourceID) {
|
|
7066
7055
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7067
7056
|
return new Promise((resolve, reject) => {
|
|
7068
7057
|
this.loadResource(completePath)
|
|
7069
7058
|
.then(loadedResource => {
|
|
7070
|
-
let config = undefined;
|
|
7071
7059
|
if (loadedResource) {
|
|
7072
|
-
config = JSON.parse(loadedResource);
|
|
7060
|
+
let config = JSON.parse(loadedResource);
|
|
7061
|
+
resolve(config);
|
|
7073
7062
|
}
|
|
7074
|
-
resolve(config);
|
|
7075
7063
|
}).catch((error) => {
|
|
7076
7064
|
reject(error);
|
|
7077
7065
|
});
|
|
@@ -7106,6 +7094,7 @@ class PesquisaFetcher {
|
|
|
7106
7094
|
}`);
|
|
7107
7095
|
}
|
|
7108
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();
|
|
7109
7098
|
return new Promise((resolve, reject) => {
|
|
7110
7099
|
DataFetcher.get()
|
|
7111
7100
|
.callGraphQL({
|
|
@@ -7265,7 +7254,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7265
7254
|
this.__registerHost();
|
|
7266
7255
|
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7267
7256
|
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7268
|
-
this._duCache = new Map();
|
|
7269
7257
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7270
7258
|
}
|
|
7271
7259
|
get parameters() {
|
|
@@ -7347,14 +7335,13 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7347
7335
|
return this.parameters.asDate(name, this.resourceID);
|
|
7348
7336
|
}
|
|
7349
7337
|
async showPopUp(content) {
|
|
7338
|
+
this.clearPopUpContent();
|
|
7350
7339
|
this._popUp.appendChild(content);
|
|
7351
|
-
this._popUp
|
|
7340
|
+
this._popUp.opened = true;
|
|
7352
7341
|
}
|
|
7353
7342
|
async closePopUp() {
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
});
|
|
7357
|
-
this._popUp["opened"] = false;
|
|
7343
|
+
this.clearPopUpContent();
|
|
7344
|
+
this._popUp.opened = false;
|
|
7358
7345
|
}
|
|
7359
7346
|
async temOpcional(opcional) {
|
|
7360
7347
|
const opts = opcional.split(",");
|
|
@@ -7426,22 +7413,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7426
7413
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7427
7414
|
});
|
|
7428
7415
|
}
|
|
7429
|
-
async getOrCreateDataUnit(entityName, dataUnitName) {
|
|
7430
|
-
return new Promise((resolve, reject) => {
|
|
7431
|
-
const dataUnit = this._duCache.get(dataUnitName);
|
|
7432
|
-
if (dataUnit) {
|
|
7433
|
-
resolve(dataUnit);
|
|
7434
|
-
}
|
|
7435
|
-
else {
|
|
7436
|
-
this.createDataunit(entityName).then(dataUnit => {
|
|
7437
|
-
if (dataUnitName) {
|
|
7438
|
-
this._duCache.set(dataUnitName, dataUnit);
|
|
7439
|
-
}
|
|
7440
|
-
resolve(dataUnit);
|
|
7441
|
-
}).catch(reason => reject(reason));
|
|
7442
|
-
}
|
|
7443
|
-
});
|
|
7444
|
-
}
|
|
7445
7416
|
async getResourceID() {
|
|
7446
7417
|
return Promise.resolve(this.resourceID);
|
|
7447
7418
|
}
|
|
@@ -7460,8 +7431,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7460
7431
|
async loadFormConfig(name) {
|
|
7461
7432
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7462
7433
|
}
|
|
7463
|
-
async loadGridConfig(
|
|
7464
|
-
return this.gridConfigFetcher.getConfig(
|
|
7434
|
+
async loadGridConfig() {
|
|
7435
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7465
7436
|
}
|
|
7466
7437
|
async saveGridConfig(config) {
|
|
7467
7438
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
@@ -7543,7 +7514,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7543
7514
|
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
7544
7515
|
pesquisaContent.selectItem = (option) => {
|
|
7545
7516
|
accept(option);
|
|
7546
|
-
this.
|
|
7517
|
+
this.clearPopUpTitle();
|
|
7547
7518
|
this.closePopUp();
|
|
7548
7519
|
};
|
|
7549
7520
|
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
@@ -7560,11 +7531,18 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7560
7531
|
accept(window['isDebugMode']);
|
|
7561
7532
|
});
|
|
7562
7533
|
}
|
|
7563
|
-
|
|
7564
|
-
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 = "";
|
|
7565
7543
|
}
|
|
7566
7544
|
setPopUpTitle(title) {
|
|
7567
|
-
this._popUp
|
|
7545
|
+
this._popUp.ezTitle = title;
|
|
7568
7546
|
}
|
|
7569
7547
|
componentWillLoad() {
|
|
7570
7548
|
this._errorHandler = new SnkErrorHandler(this);
|
|
@@ -7574,7 +7552,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7574
7552
|
});
|
|
7575
7553
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7576
7554
|
ErrorTracking.init();
|
|
7577
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7578
7555
|
}
|
|
7579
7556
|
connectedCallback() {
|
|
7580
7557
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -7609,7 +7586,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7609
7586
|
"getAttributeFromHTMLWrapper": [64],
|
|
7610
7587
|
"openApp": [64],
|
|
7611
7588
|
"createDataunit": [64],
|
|
7612
|
-
"getOrCreateDataUnit": [64],
|
|
7613
7589
|
"getResourceID": [64],
|
|
7614
7590
|
"alert": [64],
|
|
7615
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() {
|