@kontur.candy/generator 5.2.0-server-side-calculations.4 → 5.2.0-server-side-calculations.5
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/index.js +66 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -59315,12 +59315,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
59315
59315
|
/* harmony export */ "AbsoluteModelFieldPath": () => (/* binding */ AbsoluteModelFieldPath),
|
|
59316
59316
|
/* harmony export */ "ModelPathImpl": () => (/* binding */ ModelPathImpl)
|
|
59317
59317
|
/* harmony export */ });
|
|
59318
|
-
/* harmony import */ var
|
|
59319
|
-
/* harmony import */ var
|
|
59320
|
-
/* harmony import */ var
|
|
59321
|
-
/* harmony import */ var
|
|
59322
|
-
/* harmony import */ var
|
|
59323
|
-
/* harmony import */ var
|
|
59318
|
+
/* harmony import */ var _Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Engine/src/Engine/Core/CoreTypes */ "./Engine/src/Engine/Core/CoreTypes.ts");
|
|
59319
|
+
/* harmony import */ var _IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../IterableUtils */ "./Common/IterableUtils.ts");
|
|
59320
|
+
/* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
|
|
59321
|
+
/* harmony import */ var _hashUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hashUtils */ "./Common/hashUtils.ts");
|
|
59322
|
+
/* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
59323
|
+
/* harmony import */ var _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ModelPathBuilder */ "./Common/ModelPath/ModelPathBuilder.ts");
|
|
59324
|
+
/* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
|
|
59325
|
+
|
|
59324
59326
|
|
|
59325
59327
|
|
|
59326
59328
|
|
|
@@ -59450,9 +59452,9 @@ class AbsoluteModelFieldPath {
|
|
|
59450
59452
|
this.field = fieldName;
|
|
59451
59453
|
}
|
|
59452
59454
|
getHash() {
|
|
59453
|
-
return this.path.getHash() + (0,
|
|
59455
|
+
return this.path.getHash() + (0,_hashUtils__WEBPACK_IMPORTED_MODULE_3__.getSimpleHashByString)(this.field);
|
|
59454
59456
|
}
|
|
59455
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59457
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59456
59458
|
return this.path.isEquals(modelPath.path, eachCurrentCollision) && this.field === modelPath.field;
|
|
59457
59459
|
}
|
|
59458
59460
|
static createFromString(pathWithFieldName) {
|
|
@@ -59465,6 +59467,7 @@ class AbsoluteModelFieldPath {
|
|
|
59465
59467
|
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName), "value");
|
|
59466
59468
|
}
|
|
59467
59469
|
static createFromMask(pathWithFieldName, multiplicitySymbol) {
|
|
59470
|
+
var _match$, _ref;
|
|
59468
59471
|
if (pathWithFieldName.endsWith(".$errorCount")) {
|
|
59469
59472
|
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".$errorCount", ""), multiplicitySymbol), "$errorCount");
|
|
59470
59473
|
}
|
|
@@ -59477,12 +59480,19 @@ class AbsoluteModelFieldPath {
|
|
|
59477
59480
|
if (pathWithFieldName.endsWith(".warningsCount")) {
|
|
59478
59481
|
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".warningsCount", ""), multiplicitySymbol), "warningsCount");
|
|
59479
59482
|
}
|
|
59480
|
-
|
|
59483
|
+
const match = AbsoluteModelFieldPath.fieldExtractRegex.exec(pathWithFieldName);
|
|
59484
|
+
const path = match != undefined ? (_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : pathWithFieldName;
|
|
59485
|
+
const field = match != undefined ? (_ref = match[2]) !== null && _ref !== void 0 ? _ref : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : "value";
|
|
59486
|
+
return new AbsoluteModelFieldPath(createAbsoluteFromMask(path, multiplicitySymbol), field);
|
|
59481
59487
|
}
|
|
59482
59488
|
toString() {
|
|
59483
59489
|
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59484
59490
|
}
|
|
59491
|
+
toLegacyPath() {
|
|
59492
|
+
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59493
|
+
}
|
|
59485
59494
|
}
|
|
59495
|
+
AbsoluteModelFieldPath.fieldExtractRegex = new RegExp(`^(.*)\\.(${(0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__.getKnownViewModelFieldNames)().join("|")})$`);
|
|
59486
59496
|
function isAllTokensResolved(tokens) {
|
|
59487
59497
|
// Я что-то немогу сообразить как тут всё строго написать...
|
|
59488
59498
|
// @ts-expect-error
|
|
@@ -59557,7 +59567,7 @@ class ModelPathImpl {
|
|
|
59557
59567
|
return this.tokens.slice(0, lastIterationIndex);
|
|
59558
59568
|
}
|
|
59559
59569
|
isEndsWithIteration() {
|
|
59560
|
-
const lastItem =
|
|
59570
|
+
const lastItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(this.tokens);
|
|
59561
59571
|
return lastItem == PathTokens.each;
|
|
59562
59572
|
}
|
|
59563
59573
|
isAbsolute() {
|
|
@@ -59573,25 +59583,25 @@ class ModelPathImpl {
|
|
|
59573
59583
|
var _this$legacyPath;
|
|
59574
59584
|
return (_this$legacyPath = this.legacyPath) !== null && _this$legacyPath !== void 0 ? _this$legacyPath : this.legacyPath = this.tokens.map(x => this.pathPartToString(x)).join("/");
|
|
59575
59585
|
}
|
|
59576
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59577
|
-
if (eachCurrentCollision ===
|
|
59586
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59587
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59578
59588
|
return this.toLegacyPath() === modelPath.toLegacyPath();
|
|
59579
59589
|
} else {
|
|
59580
|
-
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(
|
|
59590
|
+
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.zip(this.getPathParts(), modelPath.getPathParts())).every(([t1, t2]) => t1 === t2);
|
|
59581
59591
|
}
|
|
59582
59592
|
}
|
|
59583
59593
|
|
|
59584
59594
|
/**
|
|
59585
59595
|
* Всегда целое положительное беззнаковое 32-битное число
|
|
59586
59596
|
*/
|
|
59587
|
-
getHash(eachCurrentCollision =
|
|
59597
|
+
getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59588
59598
|
let hash = 5381;
|
|
59589
|
-
for (const token of (0,
|
|
59599
|
+
for (const token of (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.reverseArray)(this.tokens)) {
|
|
59590
59600
|
let currentStr;
|
|
59591
59601
|
if (PathTokens.isSimpleToken(token)) {
|
|
59592
59602
|
currentStr = token;
|
|
59593
59603
|
} else {
|
|
59594
|
-
if (eachCurrentCollision ===
|
|
59604
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent) {
|
|
59595
59605
|
currentStr = token === PathTokens.each ? "*" : "!";
|
|
59596
59606
|
} else {
|
|
59597
59607
|
currentStr = "*";
|
|
@@ -59645,8 +59655,8 @@ class ModelPathImpl {
|
|
|
59645
59655
|
}
|
|
59646
59656
|
return true;
|
|
59647
59657
|
}
|
|
59648
|
-
getIterationRank(eachCurrentCollision =
|
|
59649
|
-
return (0,
|
|
59658
|
+
getIterationRank(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent) {
|
|
59659
|
+
return (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.count)(Iterator.from(this.tokens).filter(x => eachCurrentCollision == _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent ? x === PathTokens.each : PathTokens.isMultiToken(x)));
|
|
59650
59660
|
}
|
|
59651
59661
|
isEmpty() {
|
|
59652
59662
|
return this.tokens.length === 0;
|
|
@@ -59658,17 +59668,17 @@ class ModelPathImpl {
|
|
|
59658
59668
|
if (!modelPath.isAbsolute()) {
|
|
59659
59669
|
throw new Error(`Cannot match non absolute path '${modelPath.toString()}'`);
|
|
59660
59670
|
}
|
|
59661
|
-
return
|
|
59671
|
+
return _PathMatcher__WEBPACK_IMPORTED_MODULE_6__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
|
|
59662
59672
|
}
|
|
59663
59673
|
*splitByMultiplicity() {
|
|
59664
|
-
let lastSimpleParts = new
|
|
59674
|
+
let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.isAbsolute());
|
|
59665
59675
|
for (const token of this.tokens) {
|
|
59666
59676
|
if (PathTokens.isSimpleToken(token)) {
|
|
59667
59677
|
lastSimpleParts.append(token);
|
|
59668
59678
|
} else {
|
|
59669
59679
|
if (!lastSimpleParts.empty) {
|
|
59670
59680
|
yield lastSimpleParts.toResolvedPath();
|
|
59671
|
-
lastSimpleParts = new
|
|
59681
|
+
lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(false);
|
|
59672
59682
|
}
|
|
59673
59683
|
yield token;
|
|
59674
59684
|
}
|
|
@@ -59728,22 +59738,22 @@ class ModelPathImpl {
|
|
|
59728
59738
|
return new ModelPathImpl(this.tokens, true);
|
|
59729
59739
|
}
|
|
59730
59740
|
*getAllParentPaths() {
|
|
59731
|
-
const result = new
|
|
59732
|
-
for (const token of
|
|
59741
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.isAbsolute());
|
|
59742
|
+
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59733
59743
|
result.append(token);
|
|
59734
59744
|
yield result.toPath();
|
|
59735
59745
|
}
|
|
59736
59746
|
}
|
|
59737
59747
|
trimLastStarIfLastToken() {
|
|
59738
|
-
const lastItem =
|
|
59748
|
+
const lastItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(this.tokens);
|
|
59739
59749
|
if (lastItem != undefined && PathTokens.isMultiToken(lastItem)) {
|
|
59740
59750
|
return new ModelPathImpl(this.tokens.slice(0, -1), this.absolute);
|
|
59741
59751
|
}
|
|
59742
59752
|
return this;
|
|
59743
59753
|
}
|
|
59744
59754
|
getParentPath() {
|
|
59745
|
-
const result = new
|
|
59746
|
-
for (const token of
|
|
59755
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.absolute);
|
|
59756
|
+
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59747
59757
|
result.append(token);
|
|
59748
59758
|
}
|
|
59749
59759
|
// Тут получается так, что по другому никак
|
|
@@ -59755,11 +59765,11 @@ class ModelPathImpl {
|
|
|
59755
59765
|
return this;
|
|
59756
59766
|
}
|
|
59757
59767
|
let instanceCounter = 0;
|
|
59758
|
-
const result = new
|
|
59768
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(true);
|
|
59759
59769
|
for (const token of this.getPathParts()) {
|
|
59760
59770
|
if (PathTokens.isMultiToken(token) && instanceCounter < instances.length) {
|
|
59761
59771
|
var _instances$instanceCo;
|
|
59762
|
-
result.append((_instances$instanceCo = instances[instanceCounter]) !== null && _instances$instanceCo !== void 0 ? _instances$instanceCo : (0,
|
|
59772
|
+
result.append((_instances$instanceCo = instances[instanceCounter]) !== null && _instances$instanceCo !== void 0 ? _instances$instanceCo : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)());
|
|
59763
59773
|
instanceCounter++;
|
|
59764
59774
|
} else {
|
|
59765
59775
|
result.append(token);
|
|
@@ -59779,7 +59789,7 @@ class ModelPathImpl {
|
|
|
59779
59789
|
if (pathPart === PathTokens.current) {
|
|
59780
59790
|
return "*";
|
|
59781
59791
|
}
|
|
59782
|
-
throw new Error(`Unknown path part specified: ${(0,
|
|
59792
|
+
throw new Error(`Unknown path part specified: ${(0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.ensureAndGetString)(pathPart)}`);
|
|
59783
59793
|
}
|
|
59784
59794
|
}
|
|
59785
59795
|
|
|
@@ -60425,6 +60435,33 @@ function isMatchAbbreviation(abbreviation, value) {
|
|
|
60425
60435
|
|
|
60426
60436
|
/***/ }),
|
|
60427
60437
|
|
|
60438
|
+
/***/ "./Engine/src/Engine/Core/CoreTypes.ts":
|
|
60439
|
+
/*!*********************************************!*\
|
|
60440
|
+
!*** ./Engine/src/Engine/Core/CoreTypes.ts ***!
|
|
60441
|
+
\*********************************************/
|
|
60442
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60443
|
+
|
|
60444
|
+
"use strict";
|
|
60445
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60446
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
60447
|
+
/* harmony export */ "nonRegularFieldName": () => (/* binding */ nonRegularFieldName),
|
|
60448
|
+
/* harmony export */ "getKnownViewModelFieldNames": () => (/* binding */ getKnownViewModelFieldNames)
|
|
60449
|
+
/* harmony export */ });
|
|
60450
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60451
|
+
|
|
60452
|
+
// Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
|
|
60453
|
+
|
|
60454
|
+
function nonRegularFieldName(fieldName) {
|
|
60455
|
+
// @ts-ignore
|
|
60456
|
+
return fieldName;
|
|
60457
|
+
}
|
|
60458
|
+
function getKnownViewModelFieldNames() {
|
|
60459
|
+
const names = ["value", "autoValue", "autoFlag", "error", "warning", "errorsCount", "warningsCount", "children", "disabled", "visible", "sum", "id", "agentValue", "city", "building", "code", "count", "description"];
|
|
60460
|
+
return names;
|
|
60461
|
+
}
|
|
60462
|
+
|
|
60463
|
+
/***/ }),
|
|
60464
|
+
|
|
60428
60465
|
/***/ "./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts":
|
|
60429
60466
|
/*!*******************************************************************!*\
|
|
60430
60467
|
!*** ./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts ***!
|