@sankhyalabs/sankhyablocks 1.3.31-beta.1 → 1.3.31-beta.4
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-1133bc2a.js → index-ebe8245e.js} +453 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +109 -79
- package/dist/cjs/snk-data-unit.cjs.entry.js +174 -0
- package/dist/cjs/snk-form.cjs.entry.js +95 -0
- package/dist/cjs/snk-grid.cjs.entry.js +64 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +159 -0
- package/dist/cjs/taskbar-elements-589a3744.js +68 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/snk-application/snk-application.js +52 -5
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +429 -0
- package/dist/collection/components/snk-form/snk-form.css +3 -0
- package/dist/collection/components/snk-form/snk-form.js +194 -0
- package/dist/collection/components/snk-grid/snk-grid.css +5 -0
- package/dist/collection/components/snk-grid/snk-grid.js +128 -0
- package/dist/collection/components/snk-taskbar/component/snk-popup-button.js +7 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +63 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +268 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +36 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/components/snk-application2.js +109 -78
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +198 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +121 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +88 -0
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +239 -0
- package/dist/esm/{index-ffda6382.js → index-7565ae23.js} +453 -10
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +109 -79
- package/dist/esm/snk-data-unit.entry.js +170 -0
- package/dist/esm/snk-form.entry.js +91 -0
- package/dist/esm/snk-grid.entry.js +60 -0
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +155 -0
- package/dist/esm/taskbar-elements-b6822601.js +66 -0
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-306224bf.entry.js +1 -0
- package/dist/sankhyablocks/p-4ee1e12b.js +1 -0
- package/dist/sankhyablocks/{p-d62412bb.entry.js → p-6d82d7fd.entry.js} +1 -1
- package/dist/sankhyablocks/p-88278b85.entry.js +1 -0
- package/dist/sankhyablocks/p-90b832f7.js +2 -0
- package/dist/sankhyablocks/p-a4b2fa10.entry.js +69 -0
- package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-bb31ea2a.entry.js} +1 -1
- package/dist/sankhyablocks/p-bb8d8fe7.entry.js +1 -0
- package/dist/sankhyablocks/p-e7ade160.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +3 -1
- package/dist/types/components/snk-taskbar/component/snk-popup-button.d.ts +12 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +24 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +28 -0
- package/dist/types/components.d.ts +119 -1
- 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 +4 -0
- package/react/components.js +4 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-7565ae23.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["
|
|
13
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getOrCreateDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_moreOptionsOpened":[32],"_permissions":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-7565ae23.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["
|
|
16
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-form",[[2,"snk-form",{"formTitle":[1,"form-title"],"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32]}]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"messageBuilder":[16],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-application",[[2,"snk-application",{"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getOrCreateDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_moreOptionsOpened":[32],"_permissions":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
2
|
-
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-7565ae23.js';
|
|
2
|
+
import { ErrorException, StringUtils, DataUnit, DataType, ChangeOperation, DateUtils, ObjectUtils, WaitingChangeException, WarningException, DependencyType, 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';
|
|
5
4
|
|
|
6
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
6
|
|
|
@@ -1232,7 +1231,7 @@ function isNode(maybeNode) {
|
|
|
1232
1231
|
}
|
|
1233
1232
|
/** Name */
|
|
1234
1233
|
|
|
1235
|
-
|
|
1234
|
+
var OperationTypeNode;
|
|
1236
1235
|
exports.OperationTypeNode = OperationTypeNode;
|
|
1237
1236
|
|
|
1238
1237
|
(function (OperationTypeNode) {
|
|
@@ -1252,13 +1251,7 @@ exports.DirectiveLocation = void 0;
|
|
|
1252
1251
|
/**
|
|
1253
1252
|
* The set of allowed directive location values.
|
|
1254
1253
|
*/
|
|
1255
|
-
|
|
1256
|
-
/**
|
|
1257
|
-
* The enum type representing the directive location values.
|
|
1258
|
-
*
|
|
1259
|
-
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
|
|
1260
|
-
*/
|
|
1261
|
-
|
|
1254
|
+
var DirectiveLocation;
|
|
1262
1255
|
exports.DirectiveLocation = DirectiveLocation;
|
|
1263
1256
|
|
|
1264
1257
|
(function (DirectiveLocation) {
|
|
@@ -1282,6 +1275,11 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1282
1275
|
DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';
|
|
1283
1276
|
DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';
|
|
1284
1277
|
})(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
|
+
*/
|
|
1285
1283
|
});
|
|
1286
1284
|
|
|
1287
1285
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
@@ -1294,13 +1292,7 @@ exports.Kind = void 0;
|
|
|
1294
1292
|
/**
|
|
1295
1293
|
* The set of allowed kind values for AST nodes.
|
|
1296
1294
|
*/
|
|
1297
|
-
|
|
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
|
-
|
|
1295
|
+
var Kind;
|
|
1304
1296
|
exports.Kind = Kind;
|
|
1305
1297
|
|
|
1306
1298
|
(function (Kind) {
|
|
@@ -1348,6 +1340,11 @@ exports.Kind = Kind;
|
|
|
1348
1340
|
Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';
|
|
1349
1341
|
Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';
|
|
1350
1342
|
})(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
|
+
*/
|
|
1351
1348
|
});
|
|
1352
1349
|
|
|
1353
1350
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
@@ -1635,13 +1632,7 @@ exports.TokenKind = void 0;
|
|
|
1635
1632
|
* An exported enum describing the different kinds of tokens that the
|
|
1636
1633
|
* lexer emits.
|
|
1637
1634
|
*/
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
* The enum type representing the token kinds values.
|
|
1641
|
-
*
|
|
1642
|
-
* @deprecated Please use `TokenKind`. Will be remove in v17.
|
|
1643
|
-
*/
|
|
1644
|
-
|
|
1635
|
+
var TokenKind;
|
|
1645
1636
|
exports.TokenKind = TokenKind;
|
|
1646
1637
|
|
|
1647
1638
|
(function (TokenKind) {
|
|
@@ -1668,6 +1659,11 @@ exports.TokenKind = TokenKind;
|
|
|
1668
1659
|
TokenKind['BLOCK_STRING'] = 'BlockString';
|
|
1669
1660
|
TokenKind['COMMENT'] = 'Comment';
|
|
1670
1661
|
})(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
|
+
*/
|
|
1671
1667
|
});
|
|
1672
1668
|
|
|
1673
1669
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
@@ -3004,12 +3000,13 @@ function parseType(source, options) {
|
|
|
3004
3000
|
*/
|
|
3005
3001
|
|
|
3006
3002
|
class Parser {
|
|
3007
|
-
constructor(source$1, options) {
|
|
3003
|
+
constructor(source$1, options = {}) {
|
|
3008
3004
|
const sourceObj = (0, source.isSource)(source$1)
|
|
3009
3005
|
? source$1
|
|
3010
3006
|
: new source.Source(source$1);
|
|
3011
3007
|
this._lexer = new lexer.Lexer(sourceObj);
|
|
3012
3008
|
this._options = options;
|
|
3009
|
+
this._tokenCounter = 0;
|
|
3013
3010
|
}
|
|
3014
3011
|
/**
|
|
3015
3012
|
* Converts a name lex token into a name parse node.
|
|
@@ -3344,18 +3341,12 @@ class Parser {
|
|
|
3344
3341
|
*/
|
|
3345
3342
|
|
|
3346
3343
|
parseFragmentDefinition() {
|
|
3347
|
-
var _this$_options;
|
|
3348
|
-
|
|
3349
3344
|
const start = this._lexer.token;
|
|
3350
3345
|
this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes
|
|
3351
3346
|
// the grammar of FragmentDefinition:
|
|
3352
3347
|
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
3353
3348
|
|
|
3354
|
-
if (
|
|
3355
|
-
((_this$_options = this._options) === null || _this$_options === void 0
|
|
3356
|
-
? void 0
|
|
3357
|
-
: _this$_options.allowLegacyFragmentVariables) === true
|
|
3358
|
-
) {
|
|
3349
|
+
if (this._options.allowLegacyFragmentVariables === true) {
|
|
3359
3350
|
return this.node(start, {
|
|
3360
3351
|
kind: kinds.Kind.FRAGMENT_DEFINITION,
|
|
3361
3352
|
name: this.parseFragmentName(),
|
|
@@ -3416,16 +3407,14 @@ class Parser {
|
|
|
3416
3407
|
return this.parseObject(isConst);
|
|
3417
3408
|
|
|
3418
3409
|
case tokenKind.TokenKind.INT:
|
|
3419
|
-
this.
|
|
3420
|
-
|
|
3410
|
+
this.advanceLexer();
|
|
3421
3411
|
return this.node(token, {
|
|
3422
3412
|
kind: kinds.Kind.INT,
|
|
3423
3413
|
value: token.value,
|
|
3424
3414
|
});
|
|
3425
3415
|
|
|
3426
3416
|
case tokenKind.TokenKind.FLOAT:
|
|
3427
|
-
this.
|
|
3428
|
-
|
|
3417
|
+
this.advanceLexer();
|
|
3429
3418
|
return this.node(token, {
|
|
3430
3419
|
kind: kinds.Kind.FLOAT,
|
|
3431
3420
|
value: token.value,
|
|
@@ -3436,7 +3425,7 @@ class Parser {
|
|
|
3436
3425
|
return this.parseStringLiteral();
|
|
3437
3426
|
|
|
3438
3427
|
case tokenKind.TokenKind.NAME:
|
|
3439
|
-
this.
|
|
3428
|
+
this.advanceLexer();
|
|
3440
3429
|
|
|
3441
3430
|
switch (token.value) {
|
|
3442
3431
|
case 'true':
|
|
@@ -3492,9 +3481,7 @@ class Parser {
|
|
|
3492
3481
|
|
|
3493
3482
|
parseStringLiteral() {
|
|
3494
3483
|
const token = this._lexer.token;
|
|
3495
|
-
|
|
3496
|
-
this._lexer.advance();
|
|
3497
|
-
|
|
3484
|
+
this.advanceLexer();
|
|
3498
3485
|
return this.node(token, {
|
|
3499
3486
|
kind: kinds.Kind.STRING,
|
|
3500
3487
|
value: token.value,
|
|
@@ -4285,13 +4272,7 @@ class Parser {
|
|
|
4285
4272
|
*/
|
|
4286
4273
|
|
|
4287
4274
|
node(startToken, node) {
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
if (
|
|
4291
|
-
((_this$_options2 = this._options) === null || _this$_options2 === void 0
|
|
4292
|
-
? void 0
|
|
4293
|
-
: _this$_options2.noLocation) !== true
|
|
4294
|
-
) {
|
|
4275
|
+
if (this._options.noLocation !== true) {
|
|
4295
4276
|
node.loc = new ast.Location(
|
|
4296
4277
|
startToken,
|
|
4297
4278
|
this._lexer.lastToken,
|
|
@@ -4317,8 +4298,7 @@ class Parser {
|
|
|
4317
4298
|
const token = this._lexer.token;
|
|
4318
4299
|
|
|
4319
4300
|
if (token.kind === kind) {
|
|
4320
|
-
this.
|
|
4321
|
-
|
|
4301
|
+
this.advanceLexer();
|
|
4322
4302
|
return token;
|
|
4323
4303
|
}
|
|
4324
4304
|
|
|
@@ -4337,8 +4317,7 @@ class Parser {
|
|
|
4337
4317
|
const token = this._lexer.token;
|
|
4338
4318
|
|
|
4339
4319
|
if (token.kind === kind) {
|
|
4340
|
-
this.
|
|
4341
|
-
|
|
4320
|
+
this.advanceLexer();
|
|
4342
4321
|
return true;
|
|
4343
4322
|
}
|
|
4344
4323
|
|
|
@@ -4353,7 +4332,7 @@ class Parser {
|
|
|
4353
4332
|
const token = this._lexer.token;
|
|
4354
4333
|
|
|
4355
4334
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4356
|
-
this.
|
|
4335
|
+
this.advanceLexer();
|
|
4357
4336
|
} else {
|
|
4358
4337
|
throw (0, syntaxError_1.syntaxError)(
|
|
4359
4338
|
this._lexer.source,
|
|
@@ -4371,8 +4350,7 @@ class Parser {
|
|
|
4371
4350
|
const token = this._lexer.token;
|
|
4372
4351
|
|
|
4373
4352
|
if (token.kind === tokenKind.TokenKind.NAME && token.value === value) {
|
|
4374
|
-
this.
|
|
4375
|
-
|
|
4353
|
+
this.advanceLexer();
|
|
4376
4354
|
return true;
|
|
4377
4355
|
}
|
|
4378
4356
|
|
|
@@ -4459,6 +4437,24 @@ class Parser {
|
|
|
4459
4437
|
|
|
4460
4438
|
return nodes;
|
|
4461
4439
|
}
|
|
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
|
+
}
|
|
4462
4458
|
}
|
|
4463
4459
|
/**
|
|
4464
4460
|
* A helper function to describe a token as a string for debugging.
|
|
@@ -6719,9 +6715,9 @@ class DataUnitFetcher {
|
|
|
6719
6715
|
}
|
|
6720
6716
|
}
|
|
6721
6717
|
}`);
|
|
6722
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $
|
|
6718
|
+
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
6723
6719
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6724
|
-
data(limit: $limit offset: $offset filters: $
|
|
6720
|
+
data(limit: $limit offset: $offset filters: $filters sort: $sort){
|
|
6725
6721
|
limit
|
|
6726
6722
|
offset
|
|
6727
6723
|
total
|
|
@@ -6750,7 +6746,7 @@ class DataUnitFetcher {
|
|
|
6750
6746
|
getDataUnit(entityName, resourceID) {
|
|
6751
6747
|
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6752
6748
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6753
|
-
dataUnit.dataLoader = (dataUnit,
|
|
6749
|
+
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
6754
6750
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6755
6751
|
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6756
6752
|
return dataUnit;
|
|
@@ -6787,25 +6783,24 @@ class DataUnitFetcher {
|
|
|
6787
6783
|
});
|
|
6788
6784
|
});
|
|
6789
6785
|
}
|
|
6790
|
-
loadData(dataUnit,
|
|
6786
|
+
loadData(dataUnit, request) {
|
|
6791
6787
|
return new Promise((resolve, reject) => {
|
|
6792
|
-
var _a
|
|
6793
|
-
const
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
if (!StringUtils.isEmpty((_a = page === null || page === void 0 ? void 0 : page.quickFilter) === null || _a === void 0 ? void 0 : _a.term)) {
|
|
6788
|
+
var _a;
|
|
6789
|
+
const { sort, filters, limit, offset, quickFilter } = request;
|
|
6790
|
+
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
6791
|
+
variables.limit = limit;
|
|
6792
|
+
variables.offset = offset;
|
|
6793
|
+
if (!StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
6799
6794
|
if (variables.filter === undefined) {
|
|
6800
6795
|
variables.filter = [];
|
|
6801
6796
|
}
|
|
6802
6797
|
const quickFilterCriteria = {
|
|
6803
6798
|
name: "__QUICK_FILTER__",
|
|
6804
6799
|
expression: "__QUICK_FILTER__",
|
|
6805
|
-
params: [{ name: "term", dataType: DataType.TEXT, value:
|
|
6800
|
+
params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
|
|
6806
6801
|
};
|
|
6807
|
-
if (((
|
|
6808
|
-
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value:
|
|
6802
|
+
if (((_a = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.fields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
6803
|
+
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: quickFilter.fields });
|
|
6809
6804
|
}
|
|
6810
6805
|
variables.filter.push(quickFilterCriteria);
|
|
6811
6806
|
}
|
|
@@ -6815,16 +6810,32 @@ class DataUnitFetcher {
|
|
|
6815
6810
|
query: this.templateByQuery.get("fetchData"),
|
|
6816
6811
|
})
|
|
6817
6812
|
.then((resp) => {
|
|
6818
|
-
const
|
|
6819
|
-
|
|
6820
|
-
|
|
6813
|
+
const { limit, offset, total, hasMore, records } = resp.data;
|
|
6814
|
+
let paginationInfo;
|
|
6815
|
+
if (limit) {
|
|
6816
|
+
const firstRecord = offset + 1;
|
|
6817
|
+
const lastRecord = offset + Math.min(records.length, limit);
|
|
6818
|
+
const currentPage = offset / limit;
|
|
6819
|
+
paginationInfo = {
|
|
6820
|
+
firstRecord,
|
|
6821
|
+
lastRecord,
|
|
6822
|
+
total,
|
|
6823
|
+
currentPage,
|
|
6824
|
+
hasMore
|
|
6825
|
+
};
|
|
6826
|
+
}
|
|
6827
|
+
const processedRecords = [];
|
|
6828
|
+
records.forEach((responseRecord) => {
|
|
6821
6829
|
const duRecord = { __record__id__: responseRecord.id };
|
|
6822
6830
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
6823
6831
|
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
6824
6832
|
});
|
|
6825
|
-
|
|
6833
|
+
processedRecords.push(duRecord);
|
|
6834
|
+
});
|
|
6835
|
+
resolve({
|
|
6836
|
+
paginationInfo,
|
|
6837
|
+
records: processedRecords
|
|
6826
6838
|
});
|
|
6827
|
-
resolve(Object.assign(Object.assign({}, pageResult), { records }));
|
|
6828
6839
|
})
|
|
6829
6840
|
.catch((error) => {
|
|
6830
6841
|
reject(error);
|
|
@@ -7050,15 +7061,16 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7050
7061
|
super(...arguments);
|
|
7051
7062
|
this.GRID_CONFIG_VERSION = "V3:";
|
|
7052
7063
|
}
|
|
7053
|
-
getConfig(resourceID) {
|
|
7064
|
+
getConfig(_gridName, resourceID) {
|
|
7054
7065
|
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7055
7066
|
return new Promise((resolve, reject) => {
|
|
7056
7067
|
this.loadResource(completePath)
|
|
7057
7068
|
.then(loadedResource => {
|
|
7069
|
+
let config = undefined;
|
|
7058
7070
|
if (loadedResource) {
|
|
7059
|
-
|
|
7060
|
-
resolve(config);
|
|
7071
|
+
config = JSON.parse(loadedResource);
|
|
7061
7072
|
}
|
|
7073
|
+
resolve(config);
|
|
7062
7074
|
}).catch((error) => {
|
|
7063
7075
|
reject(error);
|
|
7064
7076
|
});
|
|
@@ -7251,6 +7263,7 @@ const SnkApplication = class {
|
|
|
7251
7263
|
registerInstance(this, hostRef);
|
|
7252
7264
|
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7253
7265
|
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7266
|
+
this._duCache = new Map();
|
|
7254
7267
|
this._requestListener = new RequestListenerLoadingBar();
|
|
7255
7268
|
}
|
|
7256
7269
|
get parameters() {
|
|
@@ -7411,6 +7424,22 @@ const SnkApplication = class {
|
|
|
7411
7424
|
dataUnit.loadMetadata().then(() => resolve(dataUnit));
|
|
7412
7425
|
});
|
|
7413
7426
|
}
|
|
7427
|
+
async getOrCreateDataUnit(entityName, dataUnitName) {
|
|
7428
|
+
return new Promise((resolve, reject) => {
|
|
7429
|
+
const dataUnit = this._duCache.get(dataUnitName);
|
|
7430
|
+
if (dataUnit) {
|
|
7431
|
+
resolve(dataUnit);
|
|
7432
|
+
}
|
|
7433
|
+
else {
|
|
7434
|
+
this.createDataunit(entityName).then(dataUnit => {
|
|
7435
|
+
if (dataUnitName) {
|
|
7436
|
+
this._duCache.set(dataUnitName, dataUnit);
|
|
7437
|
+
}
|
|
7438
|
+
resolve(dataUnit);
|
|
7439
|
+
}).catch(reason => reject(reason));
|
|
7440
|
+
}
|
|
7441
|
+
});
|
|
7442
|
+
}
|
|
7414
7443
|
async getResourceID() {
|
|
7415
7444
|
return Promise.resolve(this.resourceID);
|
|
7416
7445
|
}
|
|
@@ -7429,8 +7458,8 @@ const SnkApplication = class {
|
|
|
7429
7458
|
async loadFormConfig(name) {
|
|
7430
7459
|
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7431
7460
|
}
|
|
7432
|
-
async loadGridConfig() {
|
|
7433
|
-
return this.gridConfigFetcher.getConfig(this.resourceID);
|
|
7461
|
+
async loadGridConfig(name) {
|
|
7462
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7434
7463
|
}
|
|
7435
7464
|
async saveGridConfig(config) {
|
|
7436
7465
|
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
@@ -7543,6 +7572,7 @@ const SnkApplication = class {
|
|
|
7543
7572
|
});
|
|
7544
7573
|
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
7545
7574
|
ErrorTracking.init();
|
|
7575
|
+
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
7546
7576
|
}
|
|
7547
7577
|
connectedCallback() {
|
|
7548
7578
|
DataFetcher.addRequestListener(this._requestListener);
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7565ae23.js';
|
|
2
|
+
import { Action, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
|
|
5
|
+
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
6
|
+
|
|
7
|
+
const SnkDataUnit = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.insertionMode = createEvent(this, "insertionMode", 7);
|
|
11
|
+
this.dataStateChange = createEvent(this, "dataStateChange", 7);
|
|
12
|
+
this.dataUnitReady = createEvent(this, "dataUnitReady", 7);
|
|
13
|
+
this._onDataUnitResolve = [];
|
|
14
|
+
this._dataUnitObserver = (action) => {
|
|
15
|
+
let msg = this.getActionInfo(action.type);
|
|
16
|
+
if (msg) {
|
|
17
|
+
ApplicationUtils.info(msg);
|
|
18
|
+
}
|
|
19
|
+
if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
|
|
20
|
+
this.insertionMode.emit();
|
|
21
|
+
}
|
|
22
|
+
const duState = {
|
|
23
|
+
insertionMode: false,
|
|
24
|
+
hasNext: this.dataUnit.hasNext(),
|
|
25
|
+
hasPrevious: this.dataUnit.hasPrevious(),
|
|
26
|
+
copyMode: false,
|
|
27
|
+
isDirty: this.dataUnit.isDirty(),
|
|
28
|
+
selectedRecords: this.dataUnit.getSelectedRecords()
|
|
29
|
+
};
|
|
30
|
+
this.dataUnit.records.forEach(r => {
|
|
31
|
+
if (r.__record__id__.startsWith('NEW_')) {
|
|
32
|
+
duState.insertionMode = true;
|
|
33
|
+
duState.copyMode || (duState.copyMode = r['__record__source__id__'] != undefined);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.dataState = duState;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async getDataUnit() {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
if (this.dataUnit) {
|
|
42
|
+
resolve(this.dataUnit);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this._onDataUnitResolve.push(resolve);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async interceptAction(action) {
|
|
50
|
+
return new Promise(resolve => {
|
|
51
|
+
switch (action.type) {
|
|
52
|
+
case Action.SAVING_DATA:
|
|
53
|
+
if (this.beforeSave) {
|
|
54
|
+
const continueAction = this.beforeSave(this.dataUnit);
|
|
55
|
+
if (continueAction instanceof Promise) {
|
|
56
|
+
continueAction.then(result => resolve(result ? action : undefined));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
resolve(continueAction ? action : undefined);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
resolve(action);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case Action.DATA_SAVED:
|
|
67
|
+
if (this.afterSave) {
|
|
68
|
+
this.afterSave(this.dataUnit);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
resolve(action);
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case Action.EDITION_CANCELED:
|
|
75
|
+
ApplicationUtils.confirm(this.i18n("components.warning"), this.i18n("components.confirmCancelEdition"))
|
|
76
|
+
.then((result) => resolve(result ? action : undefined));
|
|
77
|
+
break;
|
|
78
|
+
case Action.REMOVING_RECORDS:
|
|
79
|
+
ApplicationUtils.confirm(this.i18n("components.delete"), this.i18n("components.confirmRemoveRecord"), "delete", true, { btnConfirmDanger: true })
|
|
80
|
+
.then((result) => resolve(result ? action : undefined));
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
resolve(action);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
getActionInfo(action) {
|
|
88
|
+
if (this.messageBuilder) {
|
|
89
|
+
return this.messageBuilder(action, this.dataState, this.dataUnit);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if (action === Action.EDITION_CANCELED) {
|
|
93
|
+
return this.i18n("components.editionCanceled");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
observePageSize() {
|
|
98
|
+
if (this.dataUnit) {
|
|
99
|
+
this.dataUnit.pageSize = this.pageSize;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
observeDataUnitName(newValue, oldValue) {
|
|
103
|
+
if (oldValue != newValue) {
|
|
104
|
+
this.dataUnit = undefined;
|
|
105
|
+
this.dataUnitName = newValue;
|
|
106
|
+
this.loadDataUnit();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
observeEntityName(newValue, oldValue) {
|
|
110
|
+
if (oldValue != newValue) {
|
|
111
|
+
this.dataUnit = undefined;
|
|
112
|
+
this.entityName = newValue;
|
|
113
|
+
this.loadDataUnit();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
observeDataState(newValue, oldValue) {
|
|
117
|
+
if (oldValue != newValue) {
|
|
118
|
+
this.dataStateChange.emit(newValue);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
observeDataUnit() {
|
|
122
|
+
this.dataUnitReady.emit(this.dataUnit);
|
|
123
|
+
}
|
|
124
|
+
async loadDataUnit() {
|
|
125
|
+
if (!this.dataUnit) {
|
|
126
|
+
const app = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
127
|
+
if (app && this.entityName) {
|
|
128
|
+
this.dataUnit = await app.getOrCreateDataUnit(this.entityName, this.dataUnitName);
|
|
129
|
+
this.dataUnit.pageSize = this.pageSize;
|
|
130
|
+
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
|
131
|
+
this.dataUnit.addInterceptor(this);
|
|
132
|
+
this.dataUnit.subscribe(this._dataUnitObserver);
|
|
133
|
+
let resolver;
|
|
134
|
+
while (resolver = this._onDataUnitResolve.pop()) {
|
|
135
|
+
resolver(this.dataUnit);
|
|
136
|
+
}
|
|
137
|
+
if (this.autoLoad) {
|
|
138
|
+
this.dataUnit.loadData();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
i18n(key) {
|
|
144
|
+
const pt_br = {
|
|
145
|
+
"components.warning": "Aviso",
|
|
146
|
+
"components.delete": "Excluir",
|
|
147
|
+
"components.confirmRemoveRecord": "Deseja realmente excluir o registro atual?",
|
|
148
|
+
"components.confirmCancelEdition": "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de sair?</b>",
|
|
149
|
+
"components.editionCanceled": "Todas as alterações foram descartadas.",
|
|
150
|
+
};
|
|
151
|
+
return pt_br[key];
|
|
152
|
+
}
|
|
153
|
+
componentDidRender() {
|
|
154
|
+
this.loadDataUnit();
|
|
155
|
+
}
|
|
156
|
+
render() {
|
|
157
|
+
return (h(Host, null));
|
|
158
|
+
}
|
|
159
|
+
get element() { return getElement(this); }
|
|
160
|
+
static get watchers() { return {
|
|
161
|
+
"pageSize": ["observePageSize"],
|
|
162
|
+
"dataUnitName": ["observeDataUnitName"],
|
|
163
|
+
"entityName": ["observeEntityName"],
|
|
164
|
+
"dataState": ["observeDataState"],
|
|
165
|
+
"dataUnit": ["observeDataUnit"]
|
|
166
|
+
}; }
|
|
167
|
+
};
|
|
168
|
+
SnkDataUnit.style = snkDataUnitCss;
|
|
169
|
+
|
|
170
|
+
export { SnkDataUnit as snk_data_unit };
|