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