@sankhyalabs/sankhyablocks 1.3.31-beta.6 → 1.3.32
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 +99 -213
- package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
- 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 +49 -10
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
- 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 +2 -0
- package/dist/components/snk-application2.js +98 -213
- package/dist/components/snk-pesquisa2.js +5 -2
- 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 +99 -213
- package/dist/esm/snk-pesquisa.entry.js +6 -3
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-24238a55.entry.js +1 -0
- package/dist/sankhyablocks/{p-a8305c35.entry.js → p-2a7b4cb3.entry.js} +1 -1
- package/dist/sankhyablocks/p-bd1b31db.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/sankhyablocks/p-a670853c.entry.js +0 -1
- 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,8 @@ class PesquisaFetcher {
|
|
|
7121
7093
|
}`);
|
|
7122
7094
|
}
|
|
7123
7095
|
loadSearchOptions(entityName, argument, criteria, options) {
|
|
7096
|
+
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.trim()) || undefined;
|
|
7097
|
+
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
|
7124
7098
|
return new Promise((resolve, reject) => {
|
|
7125
7099
|
DataFetcher.get()
|
|
7126
7100
|
.callGraphQL({
|
|
@@ -7279,7 +7253,6 @@ const SnkApplication = class {
|
|
|
7279
7253
|
registerInstance(this, hostRef);
|
|
7280
7254
|
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7281
7255
|
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7282
|
-
this._duCache = new Map();
|
|
7283
7256
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7284
7257
|
}
|
|
7285
7258
|
get parameters() {
|
|
@@ -7310,9 +7283,6 @@ const SnkApplication = class {
|
|
|
7310
7283
|
}
|
|
7311
7284
|
});
|
|
7312
7285
|
}
|
|
7313
|
-
/**
|
|
7314
|
-
* Caso o usuário logado seja o SUP.
|
|
7315
|
-
*/
|
|
7316
7286
|
async isUserSup() {
|
|
7317
7287
|
return new Promise((resolve, reject) => {
|
|
7318
7288
|
this.auth.then((authorization) => {
|
|
@@ -7322,9 +7292,6 @@ const SnkApplication = class {
|
|
|
7322
7292
|
});
|
|
7323
7293
|
});
|
|
7324
7294
|
}
|
|
7325
|
-
/**
|
|
7326
|
-
* Se o usuário logado tem permissão pra determinada ação.
|
|
7327
|
-
*/
|
|
7328
7295
|
async hasAccess(access) {
|
|
7329
7296
|
return new Promise((resolve, reject) => {
|
|
7330
7297
|
this.auth.then((authorization) => {
|
|
@@ -7334,9 +7301,6 @@ const SnkApplication = class {
|
|
|
7334
7301
|
});
|
|
7335
7302
|
});
|
|
7336
7303
|
}
|
|
7337
|
-
/**
|
|
7338
|
-
* Retorna todos os acessos do usuário logado.
|
|
7339
|
-
*/
|
|
7340
7304
|
async getAllAccess() {
|
|
7341
7305
|
return new Promise((resolve, reject) => {
|
|
7342
7306
|
this.auth.then((authorization) => {
|
|
@@ -7351,55 +7315,33 @@ const SnkApplication = class {
|
|
|
7351
7315
|
});
|
|
7352
7316
|
});
|
|
7353
7317
|
}
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7318
|
+
async getAuthList(_auth) {
|
|
7319
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7320
|
+
}
|
|
7357
7321
|
async getStringParam(name) {
|
|
7358
7322
|
return this.parameters.asString(name, this.resourceID);
|
|
7359
7323
|
}
|
|
7360
|
-
/**
|
|
7361
|
-
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7362
|
-
*/
|
|
7363
7324
|
async getIntParam(name) {
|
|
7364
7325
|
return this.parameters.asInteger(name, this.resourceID);
|
|
7365
7326
|
}
|
|
7366
|
-
/**
|
|
7367
|
-
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7368
|
-
*/
|
|
7369
7327
|
async getFloatParam(name) {
|
|
7370
7328
|
return this.parameters.asFloat(name, this.resourceID);
|
|
7371
7329
|
}
|
|
7372
|
-
/**
|
|
7373
|
-
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7374
|
-
*/
|
|
7375
7330
|
async getBooleanParam(name) {
|
|
7376
7331
|
return this.parameters.asBoolean(name, this.resourceID);
|
|
7377
7332
|
}
|
|
7378
|
-
/**
|
|
7379
|
-
* Retorna o valor de um parâmetro do tipo data.
|
|
7380
|
-
*/
|
|
7381
7333
|
async getDateParam(name) {
|
|
7382
7334
|
return this.parameters.asDate(name, this.resourceID);
|
|
7383
7335
|
}
|
|
7384
|
-
/**
|
|
7385
|
-
* Mostra o conteúdo passado em um Popup
|
|
7386
|
-
*/
|
|
7387
7336
|
async showPopUp(content) {
|
|
7337
|
+
this.clearPopUpContent();
|
|
7388
7338
|
this._popUp.appendChild(content);
|
|
7389
|
-
this._popUp
|
|
7339
|
+
this._popUp.opened = true;
|
|
7390
7340
|
}
|
|
7391
|
-
/**
|
|
7392
|
-
* Fecha o popup, liberando o conteúdo.
|
|
7393
|
-
*/
|
|
7394
7341
|
async closePopUp() {
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
});
|
|
7398
|
-
this._popUp["opened"] = false;
|
|
7342
|
+
this.clearPopUpContent();
|
|
7343
|
+
this._popUp.opened = false;
|
|
7399
7344
|
}
|
|
7400
|
-
/**
|
|
7401
|
-
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7402
|
-
*/
|
|
7403
7345
|
async temOpcional(opcional) {
|
|
7404
7346
|
const opts = opcional.split(",");
|
|
7405
7347
|
return new Promise((resolve, reject) => {
|
|
@@ -7423,10 +7365,6 @@ const SnkApplication = class {
|
|
|
7423
7365
|
});
|
|
7424
7366
|
});
|
|
7425
7367
|
}
|
|
7426
|
-
/**
|
|
7427
|
-
* Retorna a configuração de um recurso por service broker
|
|
7428
|
-
* Veja também o método "loadConfig"
|
|
7429
|
-
*/
|
|
7430
7368
|
async getConfig(key) {
|
|
7431
7369
|
let payload = {
|
|
7432
7370
|
"serviceName": "SystemUtilsSP.getConf",
|
|
@@ -7444,9 +7382,6 @@ const SnkApplication = class {
|
|
|
7444
7382
|
.catch(error => reject(error));
|
|
7445
7383
|
});
|
|
7446
7384
|
}
|
|
7447
|
-
/**
|
|
7448
|
-
* Salva a configuração de determinado recurso.
|
|
7449
|
-
*/
|
|
7450
7385
|
async saveConfig(key, data) {
|
|
7451
7386
|
let payload = {
|
|
7452
7387
|
"serviceName": "SystemUtilsSP.saveConf",
|
|
@@ -7465,97 +7400,42 @@ const SnkApplication = class {
|
|
|
7465
7400
|
.catch(error => reject(error));
|
|
7466
7401
|
});
|
|
7467
7402
|
}
|
|
7468
|
-
/**
|
|
7469
|
-
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7470
|
-
*/
|
|
7471
7403
|
async getAttributeFromHTMLWrapper(attribName) {
|
|
7472
7404
|
return Promise.resolve(window[attribName]);
|
|
7473
7405
|
}
|
|
7474
|
-
/**
|
|
7475
|
-
* Abre determinada tela, repassando pkObject
|
|
7476
|
-
*/
|
|
7477
7406
|
async openApp(resourceId, pkObject) {
|
|
7478
7407
|
Workspace.openAppActivity(resourceId, pkObject);
|
|
7479
7408
|
}
|
|
7480
|
-
/**
|
|
7481
|
-
* Cria o DataUnit a partir do nome da entidade.
|
|
7482
|
-
*/
|
|
7483
7409
|
async createDataunit(entityName) {
|
|
7484
7410
|
return new Promise(resolve => {
|
|
7485
7411
|
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7486
7412
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7487
7413
|
});
|
|
7488
7414
|
}
|
|
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
7415
|
async getResourceID() {
|
|
7512
7416
|
return Promise.resolve(this.resourceID);
|
|
7513
7417
|
}
|
|
7514
|
-
/**
|
|
7515
|
-
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7516
|
-
*/
|
|
7517
7418
|
async alert(title, message, icon, options) {
|
|
7518
7419
|
return ApplicationUtils.alert(title, message, icon, options);
|
|
7519
7420
|
}
|
|
7520
|
-
/**
|
|
7521
|
-
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7522
|
-
*/
|
|
7523
7421
|
async error(title, message, icon, options) {
|
|
7524
7422
|
return ApplicationUtils.error(title, message, icon, options);
|
|
7525
7423
|
}
|
|
7526
|
-
/**
|
|
7527
|
-
* Exibe um diálogo de confirmação
|
|
7528
|
-
*/
|
|
7529
7424
|
async confirm(title, message, icon, critical, options) {
|
|
7530
7425
|
return ApplicationUtils.confirm(title, message, icon, critical, options);
|
|
7531
7426
|
}
|
|
7532
|
-
/**
|
|
7533
|
-
* Mostra uma informação efêmera (de segundo plano).
|
|
7534
|
-
*/
|
|
7535
7427
|
async info(message, options) {
|
|
7536
7428
|
return ApplicationUtils.info(message, options);
|
|
7537
7429
|
}
|
|
7538
|
-
/**
|
|
7539
|
-
* Busca a configuração de formulário.
|
|
7540
|
-
*/
|
|
7541
7430
|
async loadFormConfig(name) {
|
|
7542
7431
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7543
7432
|
}
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
*/
|
|
7547
|
-
async loadGridConfig(name) {
|
|
7548
|
-
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7433
|
+
async loadGridConfig() {
|
|
7434
|
+
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7549
7435
|
}
|
|
7550
|
-
/**
|
|
7551
|
-
* Salva a configuração de grade.
|
|
7552
|
-
*/
|
|
7553
7436
|
async saveGridConfig(config) {
|
|
7554
7437
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7555
7438
|
}
|
|
7556
|
-
async getAuthList(_auth) {
|
|
7557
|
-
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7558
|
-
}
|
|
7559
7439
|
get urlParams() {
|
|
7560
7440
|
if (!this._urlParams) {
|
|
7561
7441
|
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
@@ -7633,7 +7513,7 @@ const SnkApplication = class {
|
|
|
7633
7513
|
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
|
|
7634
7514
|
pesquisaContent.selectItem = (option) => {
|
|
7635
7515
|
accept(option);
|
|
7636
|
-
this.
|
|
7516
|
+
this.clearPopUpTitle();
|
|
7637
7517
|
this.closePopUp();
|
|
7638
7518
|
};
|
|
7639
7519
|
this.setPopUpTitle(DESCRIPTIONENTITY);
|
|
@@ -7650,11 +7530,18 @@ const SnkApplication = class {
|
|
|
7650
7530
|
accept(window['isDebugMode']);
|
|
7651
7531
|
});
|
|
7652
7532
|
}
|
|
7653
|
-
|
|
7654
|
-
this._popUp
|
|
7533
|
+
clearPopUpContent() {
|
|
7534
|
+
if (this._popUp) {
|
|
7535
|
+
Array.from(this._popUp.children).forEach(c => {
|
|
7536
|
+
this._popUp.removeChild(c);
|
|
7537
|
+
});
|
|
7538
|
+
}
|
|
7539
|
+
}
|
|
7540
|
+
clearPopUpTitle() {
|
|
7541
|
+
this._popUp.ezTitle = "";
|
|
7655
7542
|
}
|
|
7656
7543
|
setPopUpTitle(title) {
|
|
7657
|
-
this._popUp
|
|
7544
|
+
this._popUp.ezTitle = title;
|
|
7658
7545
|
}
|
|
7659
7546
|
componentWillLoad() {
|
|
7660
7547
|
this._errorHandler = new SnkErrorHandler(this);
|
|
@@ -7664,7 +7551,6 @@ const SnkApplication = class {
|
|
|
7664
7551
|
});
|
|
7665
7552
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7666
7553
|
ErrorTracking.init();
|
|
7667
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7668
7554
|
}
|
|
7669
7555
|
connectedCallback() {
|
|
7670
7556
|
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(--
|
|
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(--title--primary, #2B3A54);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);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.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.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)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
|
|
5
5
|
|
|
6
6
|
const SnkPesquisa = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -295,7 +295,10 @@ const SnkPesquisa = class {
|
|
|
295
295
|
: 'Os resultados de sua pesquisa aparecerão aqui...';
|
|
296
296
|
}
|
|
297
297
|
render() {
|
|
298
|
-
|
|
298
|
+
var _a;
|
|
299
|
+
return (h(Host, null, h("div", { class: "snk-pesquisa" }, h("div", { class: "snk-pesquisa__input" }, h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument }, h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
|
300
|
+
? h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
301
|
+
: undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })), h("label", { class: "snk-pesquisa__records" }, this.getMessageView()), h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
|
|
299
302
|
return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
|
|
300
303
|
})))));
|
|
301
304
|
}
|