@kontur.candy/generator 5.14.0-rsvfunctions.7 → 5.14.0-rsvfunctions.9
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 +311 -181
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -59120,6 +59120,69 @@ KCLangRuntimeUtils.kcLangUtilsName = "kcLangUtils";
|
|
|
59120
59120
|
|
|
59121
59121
|
/***/ }),
|
|
59122
59122
|
|
|
59123
|
+
/***/ "./Common/ModelPath/AbsoluteModelFieldPath.ts":
|
|
59124
|
+
/*!****************************************************!*\
|
|
59125
|
+
!*** ./Common/ModelPath/AbsoluteModelFieldPath.ts ***!
|
|
59126
|
+
\****************************************************/
|
|
59127
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
59128
|
+
|
|
59129
|
+
"use strict";
|
|
59130
|
+
__webpack_require__.r(__webpack_exports__);
|
|
59131
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
59132
|
+
/* harmony export */ "AbsoluteModelFieldPath": () => (/* binding */ AbsoluteModelFieldPath)
|
|
59133
|
+
/* harmony export */ });
|
|
59134
|
+
/* 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");
|
|
59135
|
+
/* harmony import */ var _hashUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hashUtils */ "./Common/hashUtils.ts");
|
|
59136
|
+
/* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
|
|
59137
|
+
/* harmony import */ var _IterableUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../IterableUtils */ "./Common/IterableUtils.ts");
|
|
59138
|
+
/* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
59139
|
+
/* harmony import */ var _ModelPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
59140
|
+
|
|
59141
|
+
|
|
59142
|
+
|
|
59143
|
+
|
|
59144
|
+
|
|
59145
|
+
|
|
59146
|
+
class AbsoluteModelFieldPath {
|
|
59147
|
+
constructor(path, fieldName) {
|
|
59148
|
+
this.path = void 0;
|
|
59149
|
+
this.field = void 0;
|
|
59150
|
+
this.path = path;
|
|
59151
|
+
this.field = fieldName;
|
|
59152
|
+
}
|
|
59153
|
+
getHash() {
|
|
59154
|
+
return this.path.getHash() + (0,_hashUtils__WEBPACK_IMPORTED_MODULE_1__.getSimpleHashByString)(this.field);
|
|
59155
|
+
}
|
|
59156
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59157
|
+
return this.path.isEquals(modelPath.path, eachCurrentCollision) && this.field === modelPath.field;
|
|
59158
|
+
}
|
|
59159
|
+
static createFromString(pathWithFieldName) {
|
|
59160
|
+
return this.createFrom(pathWithFieldName, path => (0,_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsolute)(path));
|
|
59161
|
+
}
|
|
59162
|
+
static createFromMask(pathWithFieldName, multiplicitySymbol) {
|
|
59163
|
+
return this.createFrom(pathWithFieldName, path => (0,_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsoluteFromMask)(path, multiplicitySymbol));
|
|
59164
|
+
}
|
|
59165
|
+
static createFrom(pathWithFieldName, modelPathFactory) {
|
|
59166
|
+
var _match$, _ref;
|
|
59167
|
+
const match = AbsoluteModelFieldPath.fieldExtractRegex.exec(pathWithFieldName);
|
|
59168
|
+
const path = match != undefined ? (_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : pathWithFieldName;
|
|
59169
|
+
const field = match != undefined ? (_ref = match[2]) !== null && _ref !== void 0 ? _ref : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : "value";
|
|
59170
|
+
return new AbsoluteModelFieldPath(modelPathFactory(path), field);
|
|
59171
|
+
}
|
|
59172
|
+
toString() {
|
|
59173
|
+
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59174
|
+
}
|
|
59175
|
+
toLegacyPath() {
|
|
59176
|
+
const isLastTokenAnInstance = _ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.isInstanceToken(_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.last(this.path.getPathParts()));
|
|
59177
|
+
const slashIfRequired = isLastTokenAnInstance ? "/" : "";
|
|
59178
|
+
return `${this.path.toLegacyPath()}${slashIfRequired}.${this.field}`;
|
|
59179
|
+
}
|
|
59180
|
+
}
|
|
59181
|
+
AbsoluteModelFieldPath.extraFieldNames = ["\\$errorCount", "\\$warningCount"];
|
|
59182
|
+
AbsoluteModelFieldPath.fieldExtractRegex = new RegExp(`^(.*)\\.(${AbsoluteModelFieldPath.extraFieldNames.concat((0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__.getKnownViewModelFieldNames)()).join("|")})$`);
|
|
59183
|
+
|
|
59184
|
+
/***/ }),
|
|
59185
|
+
|
|
59123
59186
|
/***/ "./Common/ModelPath/BuildIterationSequence.ts":
|
|
59124
59187
|
/*!****************************************************!*\
|
|
59125
59188
|
!*** ./Common/ModelPath/BuildIterationSequence.ts ***!
|
|
@@ -59312,16 +59375,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
59312
59375
|
/* harmony export */ "createAbsoluteResolvedFromTokens": () => (/* binding */ createAbsoluteResolvedFromTokens),
|
|
59313
59376
|
/* harmony export */ "createRelativeFromTokens": () => (/* binding */ createRelativeFromTokens),
|
|
59314
59377
|
/* harmony export */ "joinModelPaths": () => (/* binding */ joinModelPaths),
|
|
59315
|
-
/* harmony export */ "AbsoluteModelFieldPath": () => (/* binding */ AbsoluteModelFieldPath),
|
|
59316
59378
|
/* harmony export */ "ModelPathImpl": () => (/* binding */ ModelPathImpl)
|
|
59317
59379
|
/* harmony export */ });
|
|
59318
59380
|
/* harmony import */ var _IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../IterableUtils */ "./Common/IterableUtils.ts");
|
|
59319
59381
|
/* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
|
|
59320
|
-
/* harmony import */ var
|
|
59321
|
-
/* harmony import */ var
|
|
59322
|
-
/* harmony import */ var
|
|
59323
|
-
/* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
|
|
59324
|
-
|
|
59382
|
+
/* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
59383
|
+
/* harmony import */ var _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ModelPathBuilder */ "./Common/ModelPath/ModelPathBuilder.ts");
|
|
59384
|
+
/* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
|
|
59325
59385
|
|
|
59326
59386
|
|
|
59327
59387
|
|
|
@@ -59442,47 +59502,6 @@ function joinModelPaths(...parts) {
|
|
|
59442
59502
|
}
|
|
59443
59503
|
return new ModelPathImpl(resultParts, absolute);
|
|
59444
59504
|
}
|
|
59445
|
-
class AbsoluteModelFieldPath {
|
|
59446
|
-
constructor(path, fieldName) {
|
|
59447
|
-
this.path = void 0;
|
|
59448
|
-
this.field = void 0;
|
|
59449
|
-
this.path = path;
|
|
59450
|
-
this.field = fieldName;
|
|
59451
|
-
}
|
|
59452
|
-
getHash() {
|
|
59453
|
-
return this.path.getHash() + (0,_hashUtils__WEBPACK_IMPORTED_MODULE_2__.getSimpleHashByString)(this.field);
|
|
59454
|
-
}
|
|
59455
|
-
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreSame) {
|
|
59456
|
-
return this.path.isEquals(modelPath.path, eachCurrentCollision) && this.field === modelPath.field;
|
|
59457
|
-
}
|
|
59458
|
-
static createFromString(pathWithFieldName) {
|
|
59459
|
-
if (pathWithFieldName.endsWith(".$errorCount")) {
|
|
59460
|
-
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName.replace(".$errorCount", "")), "$errorCount");
|
|
59461
|
-
}
|
|
59462
|
-
if (pathWithFieldName.endsWith(".$warningCount")) {
|
|
59463
|
-
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName.replace(".$warningCount", "")), "$warningCount");
|
|
59464
|
-
}
|
|
59465
|
-
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName), "value");
|
|
59466
|
-
}
|
|
59467
|
-
static createFromMask(pathWithFieldName, multiplicitySymbol) {
|
|
59468
|
-
if (pathWithFieldName.endsWith(".$errorCount")) {
|
|
59469
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".$errorCount", ""), multiplicitySymbol), "$errorCount");
|
|
59470
|
-
}
|
|
59471
|
-
if (pathWithFieldName.endsWith(".$warningCount")) {
|
|
59472
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".$warningCount", ""), multiplicitySymbol), "$warningCount");
|
|
59473
|
-
}
|
|
59474
|
-
if (pathWithFieldName.endsWith(".errorsCount")) {
|
|
59475
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".errorsCount", ""), multiplicitySymbol), "errorsCount");
|
|
59476
|
-
}
|
|
59477
|
-
if (pathWithFieldName.endsWith(".warningsCount")) {
|
|
59478
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".warningsCount", ""), multiplicitySymbol), "warningsCount");
|
|
59479
|
-
}
|
|
59480
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName, multiplicitySymbol), "value");
|
|
59481
|
-
}
|
|
59482
|
-
toString() {
|
|
59483
|
-
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59484
|
-
}
|
|
59485
|
-
}
|
|
59486
59505
|
function isAllTokensResolved(tokens) {
|
|
59487
59506
|
// Я что-то немогу сообразить как тут всё строго написать...
|
|
59488
59507
|
// @ts-expect-error
|
|
@@ -59577,8 +59596,8 @@ class ModelPathImpl {
|
|
|
59577
59596
|
var _this$legacyPath;
|
|
59578
59597
|
return (_this$legacyPath = this.legacyPath) !== null && _this$legacyPath !== void 0 ? _this$legacyPath : this.legacyPath = this.tokens.map(x => this.pathPartToString(x)).join("/");
|
|
59579
59598
|
}
|
|
59580
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59581
|
-
if (eachCurrentCollision ===
|
|
59599
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59600
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59582
59601
|
return this.toLegacyPath() === modelPath.toLegacyPath();
|
|
59583
59602
|
} else {
|
|
59584
59603
|
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.zip(this.getPathParts(), modelPath.getPathParts())).every(([t1, t2]) => t1 === t2);
|
|
@@ -59588,14 +59607,14 @@ class ModelPathImpl {
|
|
|
59588
59607
|
/**
|
|
59589
59608
|
* Всегда целое положительное беззнаковое 32-битное число
|
|
59590
59609
|
*/
|
|
59591
|
-
getHash(eachCurrentCollision =
|
|
59610
|
+
getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59592
59611
|
let hash = 5381;
|
|
59593
59612
|
for (const token of (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(this.tokens)) {
|
|
59594
59613
|
let currentStr;
|
|
59595
59614
|
if (PathTokens.isSimpleToken(token)) {
|
|
59596
59615
|
currentStr = token;
|
|
59597
59616
|
} else {
|
|
59598
|
-
if (eachCurrentCollision ===
|
|
59617
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent) {
|
|
59599
59618
|
currentStr = token === PathTokens.each ? "*" : "!";
|
|
59600
59619
|
} else {
|
|
59601
59620
|
currentStr = "*";
|
|
@@ -59649,8 +59668,8 @@ class ModelPathImpl {
|
|
|
59649
59668
|
}
|
|
59650
59669
|
return true;
|
|
59651
59670
|
}
|
|
59652
|
-
getIterationRank(eachCurrentCollision =
|
|
59653
|
-
return (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.count)(Iterator.from(this.tokens).filter(x => eachCurrentCollision ==
|
|
59671
|
+
getIterationRank(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent) {
|
|
59672
|
+
return (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.count)(Iterator.from(this.tokens).filter(x => eachCurrentCollision == _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent ? x === PathTokens.each : PathTokens.isMultiToken(x)));
|
|
59654
59673
|
}
|
|
59655
59674
|
isEmpty() {
|
|
59656
59675
|
return this.tokens.length === 0;
|
|
@@ -59662,17 +59681,17 @@ class ModelPathImpl {
|
|
|
59662
59681
|
if (!modelPath.isAbsolute()) {
|
|
59663
59682
|
throw new Error(`Cannot match non absolute path '${modelPath.toString()}'`);
|
|
59664
59683
|
}
|
|
59665
|
-
return
|
|
59684
|
+
return _PathMatcher__WEBPACK_IMPORTED_MODULE_4__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
|
|
59666
59685
|
}
|
|
59667
59686
|
*splitByMultiplicity() {
|
|
59668
|
-
let lastSimpleParts = new
|
|
59687
|
+
let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
|
|
59669
59688
|
for (const token of this.tokens) {
|
|
59670
59689
|
if (PathTokens.isSimpleToken(token)) {
|
|
59671
59690
|
lastSimpleParts.append(token);
|
|
59672
59691
|
} else {
|
|
59673
59692
|
if (!lastSimpleParts.empty) {
|
|
59674
59693
|
yield lastSimpleParts.toResolvedPath();
|
|
59675
|
-
lastSimpleParts = new
|
|
59694
|
+
lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(false);
|
|
59676
59695
|
}
|
|
59677
59696
|
yield token;
|
|
59678
59697
|
}
|
|
@@ -59732,7 +59751,7 @@ class ModelPathImpl {
|
|
|
59732
59751
|
return new ModelPathImpl(this.tokens, true);
|
|
59733
59752
|
}
|
|
59734
59753
|
*getAllParentPaths() {
|
|
59735
|
-
const result = new
|
|
59754
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
|
|
59736
59755
|
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59737
59756
|
result.append(token);
|
|
59738
59757
|
yield result.toPath();
|
|
@@ -59746,7 +59765,7 @@ class ModelPathImpl {
|
|
|
59746
59765
|
return this;
|
|
59747
59766
|
}
|
|
59748
59767
|
getParentPath() {
|
|
59749
|
-
const result = new
|
|
59768
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.absolute);
|
|
59750
59769
|
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59751
59770
|
result.append(token);
|
|
59752
59771
|
}
|
|
@@ -59759,7 +59778,7 @@ class ModelPathImpl {
|
|
|
59759
59778
|
return this;
|
|
59760
59779
|
}
|
|
59761
59780
|
let instanceCounter = 0;
|
|
59762
|
-
const result = new
|
|
59781
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(true);
|
|
59763
59782
|
for (const token of this.getPathParts()) {
|
|
59764
59783
|
if (PathTokens.isMultiToken(token) && instanceCounter < instances.length) {
|
|
59765
59784
|
var _instances$instanceCo;
|
|
@@ -60024,8 +60043,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60024
60043
|
/* harmony export */ "Set2": () => (/* binding */ Set2)
|
|
60025
60044
|
/* harmony export */ });
|
|
60026
60045
|
class Set2 {
|
|
60027
|
-
constructor() {
|
|
60046
|
+
constructor(source) {
|
|
60028
60047
|
this.hashMap = new Map();
|
|
60048
|
+
if (source != undefined) {
|
|
60049
|
+
for (const sourceElement of source) {
|
|
60050
|
+
this.add(sourceElement);
|
|
60051
|
+
}
|
|
60052
|
+
}
|
|
60029
60053
|
}
|
|
60030
60054
|
add(path) {
|
|
60031
60055
|
const hash = this.getItemHash(path);
|
|
@@ -60429,6 +60453,33 @@ function isMatchAbbreviation(abbreviation, value) {
|
|
|
60429
60453
|
|
|
60430
60454
|
/***/ }),
|
|
60431
60455
|
|
|
60456
|
+
/***/ "./Engine/src/Engine/Core/CoreTypes.ts":
|
|
60457
|
+
/*!*********************************************!*\
|
|
60458
|
+
!*** ./Engine/src/Engine/Core/CoreTypes.ts ***!
|
|
60459
|
+
\*********************************************/
|
|
60460
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60461
|
+
|
|
60462
|
+
"use strict";
|
|
60463
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60464
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
60465
|
+
/* harmony export */ "nonRegularFieldName": () => (/* binding */ nonRegularFieldName),
|
|
60466
|
+
/* harmony export */ "getKnownViewModelFieldNames": () => (/* binding */ getKnownViewModelFieldNames)
|
|
60467
|
+
/* harmony export */ });
|
|
60468
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60469
|
+
|
|
60470
|
+
// Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
|
|
60471
|
+
|
|
60472
|
+
function nonRegularFieldName(fieldName) {
|
|
60473
|
+
// @ts-ignore
|
|
60474
|
+
return fieldName;
|
|
60475
|
+
}
|
|
60476
|
+
function getKnownViewModelFieldNames() {
|
|
60477
|
+
const names = ["children", "error", "warning", "description", "id", "disabled", "visible", "disabledSending", "value", "autoValue", "autoFlag", "resourcesHash", "errorsCount", "warningsCount", "code", "picklist", "normalized", "emptyUnitsVisible", "pencilOpened", "ignoreAutoFlag", "disableValueAutoInit", "index", "regionCode", "district", "city", "settlement", "street", "house", "building", "room", "bossValue", "agentValue", "senderInn", "nameorg", "sum", "count", "normalizationSource", "referencedId"];
|
|
60478
|
+
return names;
|
|
60479
|
+
}
|
|
60480
|
+
|
|
60481
|
+
/***/ }),
|
|
60482
|
+
|
|
60432
60483
|
/***/ "./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts":
|
|
60433
60484
|
/*!*******************************************************************!*\
|
|
60434
60485
|
!*** ./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts ***!
|
|
@@ -79669,7 +79720,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79669
79720
|
|
|
79670
79721
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
79671
79722
|
try {
|
|
79672
|
-
var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _generationOptions$re, _sugarRoot$schemaVali3, _sugarRoot$schemaVali4, _sugarRoot$schemaVali5, _additionalContent$
|
|
79723
|
+
var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _generationOptions$re, _sugarRoot$schemaVali3, _sugarRoot$schemaVali4, _sugarRoot$schemaVali5, _additionalContent$fo5, _additionalContent$fo6;
|
|
79673
79724
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
79674
79725
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
79675
79726
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
|
|
@@ -79678,7 +79729,9 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79678
79729
|
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
79679
79730
|
const formulasFromSugar = extractFormulasFromSugarKCLang(sugarRoot);
|
|
79680
79731
|
const formulas = ((_kxXmlMathContainer$f = kxXmlMathContainer === null || kxXmlMathContainer === void 0 ? void 0 : (_kxXmlMathContainer$f2 = kxXmlMathContainer.formulas) === null || _kxXmlMathContainer$f2 === void 0 ? void 0 : _kxXmlMathContainer$f2.items) !== null && _kxXmlMathContainer$f !== void 0 ? _kxXmlMathContainer$f : []).concat((_kcLangMathContainer$ = kcLangMathContainer === null || kcLangMathContainer === void 0 ? void 0 : (_kcLangMathContainer$2 = kcLangMathContainer.formulas) === null || _kcLangMathContainer$2 === void 0 ? void 0 : _kcLangMathContainer$2.items) !== null && _kcLangMathContainer$ !== void 0 ? _kcLangMathContainer$ : []).concat([...formulasFromSugar]);
|
|
79681
|
-
const
|
|
79732
|
+
const useServerCalculations = (_additionalContent$fo = (_additionalContent$fo2 = additionalContent.formJsonSettings) === null || _additionalContent$fo2 === void 0 ? void 0 : _additionalContent$fo2.useServerSideCalculations) !== null && _additionalContent$fo !== void 0 ? _additionalContent$fo : false;
|
|
79733
|
+
const useCalculator2 = !useServerCalculations && (((_additionalContent$fo3 = additionalContent.formJsonSettings) === null || _additionalContent$fo3 === void 0 ? void 0 : _additionalContent$fo3.autoCalculationCalculatorImpl) === "calculator2" || ((_additionalContent$fo4 = additionalContent.formJsonSettings) === null || _additionalContent$fo4 === void 0 ? void 0 : _additionalContent$fo4.useServerSideFLangNormalization));
|
|
79734
|
+
const useOldCalculator = !useCalculator2 && !useServerCalculations;
|
|
79682
79735
|
const kcXmlConditions = (_Iterator$from$map$fl = Iterator.from(getImportedKcXmlValidations(sugarRoot, additionalContent)).map(x => {
|
|
79683
79736
|
var _container$conditions, _container$conditions2;
|
|
79684
79737
|
const container = formulaReader.readFormulas(x);
|
|
@@ -79707,7 +79760,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79707
79760
|
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter);
|
|
79708
79761
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
79709
79762
|
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
79710
|
-
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, typeRegistry, (_sugarRoot$schemaVali3 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali3 !== void 0 ? _sugarRoot$schemaVali3 : false);
|
|
79763
|
+
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, (_sugarRoot$schemaVali3 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali3 !== void 0 ? _sugarRoot$schemaVali3 : false);
|
|
79711
79764
|
const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, (_sugarRoot$schemaVali4 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali4 !== void 0 ? _sugarRoot$schemaVali4 : false);
|
|
79712
79765
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
79713
79766
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
@@ -79720,18 +79773,18 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79720
79773
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
79721
79774
|
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
79722
79775
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
79723
|
-
const formulasForCalculator =
|
|
79776
|
+
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
79724
79777
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
79725
79778
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
79726
|
-
if ((_additionalContent$
|
|
79727
|
-
var _additionalContent$
|
|
79779
|
+
if ((_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.useServerSideFLangNormalization) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false) {
|
|
79780
|
+
var _additionalContent$fo7, _additionalContent$fo8;
|
|
79728
79781
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
79729
79782
|
const customNormalizers = [{
|
|
79730
79783
|
normalizerId: "formulas",
|
|
79731
|
-
content: (_additionalContent$
|
|
79784
|
+
content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
79732
79785
|
}, {
|
|
79733
79786
|
normalizerId: "formulasWithInitializers",
|
|
79734
|
-
content: (_additionalContent$
|
|
79787
|
+
content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
79735
79788
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
79736
79789
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
79737
79790
|
switch (additionalNormalizer.extension) {
|
|
@@ -79769,7 +79822,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79769
79822
|
const kcXmlAutoCalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_Calculator2_AutoCalculationsCalculator2Generator__WEBPACK_IMPORTED_MODULE_28__.AutoCalculationsCalculator2Generator(formSchemaRng, dataDeclarationHelper);
|
|
79770
79823
|
builder.addResource("kcXmlAutoCalculationConfigurator.js", kcXmlAutoCalcGenerator.generate(formulasForCalculator2));
|
|
79771
79824
|
const kcXmlValidationGenerator = new _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_23__.KCXmlValidationGenerator(formSchemaRng);
|
|
79772
|
-
|
|
79825
|
+
const kcXmlConditionsForCalculator2 = !useServerCalculations ? kcXmlConditions : [];
|
|
79826
|
+
builder.addResource("kcXmlValidationConfigurator.js", kcXmlValidationGenerator.generate(kcXmlConditionsForCalculator2));
|
|
79773
79827
|
// const importedAutoCalculations = getImportedAutoCalculations(sugarRoot);
|
|
79774
79828
|
builder.addResource("autocalculationConfigurators.js", `export default []`);
|
|
79775
79829
|
builder.addResource("FakeStyles.less", `// empty styles to enforce style files`);
|
|
@@ -80238,8 +80292,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80238
80292
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
80239
80293
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
80240
80294
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80241
|
-
/* harmony import */ var
|
|
80242
|
-
/* harmony import */ var
|
|
80295
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80296
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80297
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80298
|
+
|
|
80243
80299
|
|
|
80244
80300
|
|
|
80245
80301
|
|
|
@@ -80283,11 +80339,11 @@ class CustomKCLangToFlangRuleGenerator {
|
|
|
80283
80339
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
80284
80340
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
80285
80341
|
const result = [];
|
|
80286
|
-
const getFormulaExpression = field => new
|
|
80342
|
+
const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(defaultValue));
|
|
80287
80343
|
if (isTargetAutoField) {
|
|
80288
|
-
result.push(new
|
|
80344
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
|
|
80289
80345
|
} else {
|
|
80290
|
-
result.push(new
|
|
80346
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
80291
80347
|
}
|
|
80292
80348
|
result.push(...precalculationRules);
|
|
80293
80349
|
return result;
|
|
@@ -80321,8 +80377,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80321
80377
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80322
80378
|
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
80323
80379
|
/* harmony import */ var _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/SchemaRng/StringTypeMessageGenerator */ "./Generator/src/common/SchemaRng/StringTypeMessageGenerator.ts");
|
|
80324
|
-
/* harmony import */ var
|
|
80325
|
-
/* harmony import */ var
|
|
80380
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80381
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80382
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80383
|
+
|
|
80326
80384
|
|
|
80327
80385
|
|
|
80328
80386
|
|
|
@@ -80336,7 +80394,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80336
80394
|
|
|
80337
80395
|
|
|
80338
80396
|
|
|
80339
|
-
const makeArrayLiteral = text => new
|
|
80397
|
+
const makeArrayLiteral = text => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(`["${text}"]`);
|
|
80340
80398
|
const makeMessage = (constraints, sugarTypeDescription, schemaTypeDescription) => {
|
|
80341
80399
|
var _ref, _ref2;
|
|
80342
80400
|
return makeArrayLiteral((_ref = (_ref2 = sugarTypeDescription !== null && sugarTypeDescription !== void 0 ? sugarTypeDescription : schemaTypeDescription) !== null && _ref2 !== void 0 ? _ref2 : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.generate(constraints !== null && constraints !== void 0 ? constraints : {})) !== null && _ref !== void 0 ? _ref : "Поле должно быть заполнено");
|
|
@@ -80371,7 +80429,7 @@ class FLangValidationBuildContext {
|
|
|
80371
80429
|
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
80372
80430
|
var _typeNode$base, _typeNode$description;
|
|
80373
80431
|
const validations = [];
|
|
80374
|
-
const valueReference = new
|
|
80432
|
+
const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
|
|
80375
80433
|
const baseName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
|
|
80376
80434
|
const baseDescription = (_typeNode$description = typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _typeNode$description !== void 0 ? _typeNode$description : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description;
|
|
80377
80435
|
if (baseName != undefined) {
|
|
@@ -80391,12 +80449,12 @@ class FLangValidationBuildContext {
|
|
|
80391
80449
|
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
80392
80450
|
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
80393
80451
|
const allChildrenPaths = parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement ? this.schemaRng.getAllChildren(parentNode).map(x => this.schemaRng.getPath(x, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each)).filter(x => !(0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_4__.getMatchedAndDifferentModelPaths)(targetPath, x).differentPath.isContainIteration()) : undefined;
|
|
80394
|
-
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new
|
|
80452
|
+
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.combineByAndFlangExpr, undefined);
|
|
80395
80453
|
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
80396
80454
|
const errorExpression = this.createFlangExpression((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.reverseArray)(errorValidations), targetPath, valueReference, "error", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, optional, parentNode, restChecks);
|
|
80397
80455
|
const result = [];
|
|
80398
80456
|
result.push({
|
|
80399
|
-
statement: new
|
|
80457
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "error"), errorExpression),
|
|
80400
80458
|
checkType: "error"
|
|
80401
80459
|
});
|
|
80402
80460
|
const warningValidations = validations.filter(x => x.checkType === "warning");
|
|
@@ -80405,7 +80463,7 @@ class FLangValidationBuildContext {
|
|
|
80405
80463
|
}
|
|
80406
80464
|
const warningExpression = this.createFlangExpression(warningValidations, targetPath, valueReference, "warning", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, true, parentNode, restChecks);
|
|
80407
80465
|
result.push({
|
|
80408
|
-
statement: new
|
|
80466
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "warning"), warningExpression),
|
|
80409
80467
|
checkType: "warning"
|
|
80410
80468
|
});
|
|
80411
80469
|
return result;
|
|
@@ -80414,30 +80472,30 @@ class FLangValidationBuildContext {
|
|
|
80414
80472
|
let expression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.IterUtils.reduce(validations, (result, {
|
|
80415
80473
|
condition,
|
|
80416
80474
|
message
|
|
80417
|
-
}) => new
|
|
80475
|
+
}) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(condition, message, result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
|
|
80418
80476
|
if (!optional) {
|
|
80419
80477
|
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement) {
|
|
80420
|
-
const requiredExpression = new
|
|
80421
|
-
const targetCheck = new
|
|
80478
|
+
const requiredExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("[" + JSON.stringify(requiredDescription !== null && requiredDescription !== void 0 ? requiredDescription : "Поле должно быть заполнено") + "]"), expression);
|
|
80479
|
+
const targetCheck = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("")));
|
|
80422
80480
|
if (restChecks != undefined) {
|
|
80423
|
-
const finalChildrenCondition = new
|
|
80424
|
-
expression = new
|
|
80481
|
+
const finalChildrenCondition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(targetCheck, restChecks);
|
|
80482
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(finalChildrenCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression(), requiredExpression);
|
|
80425
80483
|
} else {
|
|
80426
80484
|
expression = requiredExpression;
|
|
80427
80485
|
}
|
|
80428
80486
|
} else {
|
|
80429
|
-
expression = new
|
|
80487
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("[" + JSON.stringify(requiredDescription !== null && requiredDescription !== void 0 ? requiredDescription : "Поле должно быть заполнено") + "]"), expression);
|
|
80430
80488
|
}
|
|
80431
80489
|
} else {
|
|
80432
|
-
expression = new
|
|
80490
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression(), expression);
|
|
80433
80491
|
}
|
|
80434
80492
|
const visibilityFlangCondition = this.visibilityConditions.map(x => {
|
|
80435
|
-
const target = new
|
|
80493
|
+
const target = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__.AbsoluteModelFieldPath(targetPath, checkType);
|
|
80436
80494
|
const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(x.path.getPathPartsAsArray().filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken));
|
|
80437
80495
|
const flangExpr = this.getFlangExpressionFromKCLangCondition(prefix, target, x.condition, x.invertRequired);
|
|
80438
80496
|
return flangExpr;
|
|
80439
|
-
}).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined).reduce((acc, current) => acc != undefined ? new
|
|
80440
|
-
return visibilityFlangCondition != undefined ? new
|
|
80497
|
+
}).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(acc, current) : current, undefined);
|
|
80498
|
+
return visibilityFlangCondition != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(visibilityFlangCondition, expression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()) : expression;
|
|
80441
80499
|
}
|
|
80442
80500
|
getFlangExpressionFromKCLangCondition(prefix, target, condition, invertRequired) {
|
|
80443
80501
|
const fullKcLangExpr = `
|
|
@@ -80453,13 +80511,13 @@ class FLangValidationBuildContext {
|
|
|
80453
80511
|
const formulaExpr = this.formulaExprConverter.compileExpressionToFlangExpression(formulaNode.expression, prefix, target, value => {
|
|
80454
80512
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotSupportedError("In contextual KcLang conditions should not be summation.");
|
|
80455
80513
|
});
|
|
80456
|
-
const flangExpr = formulaExpr instanceof
|
|
80514
|
+
const flangExpr = formulaExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression ? formulaExpr.condition : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
|
|
80457
80515
|
const getTypeCorrectedExpression = () => {
|
|
80458
|
-
const argExpr = (0,
|
|
80459
|
-
return new
|
|
80516
|
+
const argExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToStringIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.tryExtractValueReferenceAsStringFromDecimal)(flangExpr));
|
|
80517
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(argExpr, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(argExpr, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("")));
|
|
80460
80518
|
};
|
|
80461
|
-
const correctedFLangExpr = flangExpr.getType() ===
|
|
80462
|
-
return invertRequired ? new
|
|
80519
|
+
const correctedFLangExpr = flangExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.bool ? flangExpr : getTypeCorrectedExpression();
|
|
80520
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(correctedFLangExpr) : correctedFLangExpr;
|
|
80463
80521
|
} catch (e) {
|
|
80464
80522
|
try {
|
|
80465
80523
|
var _match$, _match$2, _match$3;
|
|
@@ -80470,26 +80528,26 @@ class FLangValidationBuildContext {
|
|
|
80470
80528
|
const value = match === null || match === void 0 ? void 0 : (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
|
|
80471
80529
|
if (path != undefined && sign != undefined && value != undefined) {
|
|
80472
80530
|
const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
|
|
80473
|
-
const valueRef = new
|
|
80474
|
-
const len = new
|
|
80475
|
-
const argument = new
|
|
80531
|
+
const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(fullPath, "children");
|
|
80532
|
+
const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueRef);
|
|
80533
|
+
const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(value);
|
|
80476
80534
|
const getOperation = () => {
|
|
80477
80535
|
switch (sign) {
|
|
80478
80536
|
case ">":
|
|
80479
|
-
return new
|
|
80537
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GtExpression(len, argument);
|
|
80480
80538
|
case "<":
|
|
80481
|
-
return new
|
|
80539
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LtExpression(len, argument);
|
|
80482
80540
|
case "==":
|
|
80483
80541
|
case "===":
|
|
80484
|
-
return new
|
|
80542
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(len, argument);
|
|
80485
80543
|
case "!=":
|
|
80486
80544
|
case "!==":
|
|
80487
|
-
return new
|
|
80545
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(len, argument);
|
|
80488
80546
|
default:
|
|
80489
80547
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotImplementedError();
|
|
80490
80548
|
}
|
|
80491
80549
|
};
|
|
80492
|
-
return invertRequired ? new
|
|
80550
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(getOperation()) : getOperation();
|
|
80493
80551
|
}
|
|
80494
80552
|
} catch {
|
|
80495
80553
|
// eslint-disable-next-line no-console
|
|
@@ -80506,9 +80564,9 @@ class FLangValidationBuildContext {
|
|
|
80506
80564
|
const typeNodeEnumerations = (_typeNode$children$fi = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children = typeNode.children) === null || _typeNode$children === void 0 ? void 0 : (_typeNode$children$fi2 = _typeNode$children.filter(x => x instanceof _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.EnumerationTypeCheckNode)) === null || _typeNode$children$fi2 === void 0 ? void 0 : _typeNode$children$fi2.map(x => x.value)) !== null && _typeNode$children$fi !== void 0 ? _typeNode$children$fi : [];
|
|
80507
80565
|
const enumerationItems = (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(typeNodeEnumerations) ? typeNodeEnumerations : (_schemaTypeNode$enume = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.enumeration) !== null && _schemaTypeNode$enume !== void 0 ? _schemaTypeNode$enume : [];
|
|
80508
80566
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(enumerationItems)) {
|
|
80509
|
-
const enumerationRuleBody = new
|
|
80567
|
+
const enumerationRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OneOfExpression(valueReference, enumerationItems.map(item => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(item)));
|
|
80510
80568
|
yield {
|
|
80511
|
-
condition: new
|
|
80569
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(enumerationRuleBody),
|
|
80512
80570
|
message: makeMessage({
|
|
80513
80571
|
enumerationAllowedValues: enumerationItems
|
|
80514
80572
|
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
@@ -80519,9 +80577,9 @@ class FLangValidationBuildContext {
|
|
|
80519
80577
|
const gId = (_digest$gId = digest === null || digest === void 0 ? void 0 : digest.gId) !== null && _digest$gId !== void 0 ? _digest$gId : nodeGId;
|
|
80520
80578
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrEmpty)(gId) && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayHasLength)(enumerationItems, 0)) {
|
|
80521
80579
|
var _ref3, _digest$description, _ref4, _digest$checkType;
|
|
80522
|
-
const ruleBody = new
|
|
80580
|
+
const ruleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.HasPicklistValueExpression(valueReference, `${gId}[code]`));
|
|
80523
80581
|
yield {
|
|
80524
|
-
condition: new
|
|
80582
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(ruleBody),
|
|
80525
80583
|
message: makeArrayLiteral((_ref3 = (_digest$description = digest === null || digest === void 0 ? void 0 : digest.description) !== null && _digest$description !== void 0 ? _digest$description : typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _ref3 !== void 0 ? _ref3 : "Поле заполнено не по справочнику"),
|
|
80526
80584
|
checkType: (_ref4 = (_digest$checkType = digest === null || digest === void 0 ? void 0 : digest.checkType) !== null && _digest$checkType !== void 0 ? _digest$checkType : typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _ref4 !== void 0 ? _ref4 : "error"
|
|
80527
80585
|
};
|
|
@@ -80529,7 +80587,7 @@ class FLangValidationBuildContext {
|
|
|
80529
80587
|
const typeNodeLength = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children2 = typeNode.children) === null || _typeNode$children2 === void 0 ? void 0 : _typeNode$children2.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.LengthTypeCheckNode));
|
|
80530
80588
|
const lengthValue = (_typeNodeLength$value = typeNodeLength === null || typeNodeLength === void 0 ? void 0 : typeNodeLength.value) !== null && _typeNodeLength$value !== void 0 ? _typeNodeLength$value : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.length;
|
|
80531
80589
|
if (lengthValue != undefined) {
|
|
80532
|
-
const lengthExprRuleBody = new
|
|
80590
|
+
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(lengthValue)));
|
|
80533
80591
|
yield {
|
|
80534
80592
|
condition: lengthExprRuleBody,
|
|
80535
80593
|
message: makeMessage({
|
|
@@ -80543,7 +80601,7 @@ class FLangValidationBuildContext {
|
|
|
80543
80601
|
const typeNodeMaxLength = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children4 = typeNode.children) === null || _typeNode$children4 === void 0 ? void 0 : _typeNode$children4.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.MaxlengthTypeCheckNode));
|
|
80544
80602
|
const maxLengthValue = (_typeNodeMaxLength$va = typeNodeMaxLength === null || typeNodeMaxLength === void 0 ? void 0 : typeNodeMaxLength.value) !== null && _typeNodeMaxLength$va !== void 0 ? _typeNodeMaxLength$va : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxLength;
|
|
80545
80603
|
if (minLengthValue != undefined && maxLengthValue != undefined) {
|
|
80546
|
-
const lengthExprRuleBody = new
|
|
80604
|
+
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(minLengthValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(maxLengthValue))));
|
|
80547
80605
|
yield {
|
|
80548
80606
|
condition: lengthExprRuleBody,
|
|
80549
80607
|
message: makeMessage({
|
|
@@ -80553,7 +80611,7 @@ class FLangValidationBuildContext {
|
|
|
80553
80611
|
checkType: checkType
|
|
80554
80612
|
};
|
|
80555
80613
|
} else if (minLengthValue != undefined) {
|
|
80556
|
-
const lengthExprRuleBody = new
|
|
80614
|
+
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(minLengthValue)));
|
|
80557
80615
|
yield {
|
|
80558
80616
|
condition: lengthExprRuleBody,
|
|
80559
80617
|
message: makeMessage({
|
|
@@ -80562,7 +80620,7 @@ class FLangValidationBuildContext {
|
|
|
80562
80620
|
checkType: checkType
|
|
80563
80621
|
};
|
|
80564
80622
|
} else if (maxLengthValue != undefined) {
|
|
80565
|
-
const lengthExprRuleBody = new
|
|
80623
|
+
const lengthExprRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(maxLengthValue)));
|
|
80566
80624
|
yield {
|
|
80567
80625
|
condition: lengthExprRuleBody,
|
|
80568
80626
|
message: makeMessage({
|
|
@@ -80574,7 +80632,7 @@ class FLangValidationBuildContext {
|
|
|
80574
80632
|
const typeNodeMinInclusive = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children5 = typeNode.children) === null || _typeNode$children5 === void 0 ? void 0 : _typeNode$children5.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.MininclusiveTypeCheckNode));
|
|
80575
80633
|
const minInclusiveValue = (_typeNodeMinInclusive = typeNodeMinInclusive === null || typeNodeMinInclusive === void 0 ? void 0 : typeNodeMinInclusive.value) !== null && _typeNodeMinInclusive !== void 0 ? _typeNodeMinInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minInclusive;
|
|
80576
80634
|
if (minInclusiveValue != undefined) {
|
|
80577
|
-
const minInclusiveRuleBody = new
|
|
80635
|
+
const minInclusiveRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToDecimalIfNeed)(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(minInclusiveValue)));
|
|
80578
80636
|
yield {
|
|
80579
80637
|
condition: minInclusiveRuleBody,
|
|
80580
80638
|
message: makeMessage({
|
|
@@ -80586,7 +80644,7 @@ class FLangValidationBuildContext {
|
|
|
80586
80644
|
const typeNodeMaxInclusive = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children6 = typeNode.children) === null || _typeNode$children6 === void 0 ? void 0 : _typeNode$children6.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.MaxinclusiveTypeCheckNode));
|
|
80587
80645
|
const maxInclusiveValue = (_typeNodeMaxInclusive = typeNodeMaxInclusive === null || typeNodeMaxInclusive === void 0 ? void 0 : typeNodeMaxInclusive.value) !== null && _typeNodeMaxInclusive !== void 0 ? _typeNodeMaxInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxInclusive;
|
|
80588
80646
|
if (maxInclusiveValue != undefined) {
|
|
80589
|
-
const maxInclusiveRuleBody = new
|
|
80647
|
+
const maxInclusiveRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToDecimalIfNeed)(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(maxInclusiveValue)));
|
|
80590
80648
|
yield {
|
|
80591
80649
|
condition: maxInclusiveRuleBody,
|
|
80592
80650
|
message: makeMessage({
|
|
@@ -80598,7 +80656,7 @@ class FLangValidationBuildContext {
|
|
|
80598
80656
|
const typeNodeTotalDigits = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children7 = typeNode.children) === null || _typeNode$children7 === void 0 ? void 0 : _typeNode$children7.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.TotaldigitsTypeCheckNode));
|
|
80599
80657
|
const totalDigitsValue = (_typeNodeTotalDigits$ = typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.value) !== null && _typeNodeTotalDigits$ !== void 0 ? _typeNodeTotalDigits$ : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.totalDigits;
|
|
80600
80658
|
if (totalDigitsValue != undefined) {
|
|
80601
|
-
const totalDigitsRuleBody = new
|
|
80659
|
+
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NumLenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(totalDigitsValue)));
|
|
80602
80660
|
yield {
|
|
80603
80661
|
condition: totalDigitsRuleBody,
|
|
80604
80662
|
message: makeMessage({
|
|
@@ -80609,9 +80667,9 @@ class FLangValidationBuildContext {
|
|
|
80609
80667
|
}
|
|
80610
80668
|
const typeNodePatterns = (_typeNode$children$fi3 = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children8 = typeNode.children) === null || _typeNode$children8 === void 0 ? void 0 : _typeNode$children8.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.PatternTypeCheckNode)).map(x => x.value).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined)) !== null && _typeNode$children$fi3 !== void 0 ? _typeNode$children$fi3 : [];
|
|
80611
80669
|
const stringPatterns = ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(typeNodePatterns) ? typeNodePatterns : (_schemaTypeNode$patte = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.patterns) !== null && _schemaTypeNode$patte !== void 0 ? _schemaTypeNode$patte : []).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined);
|
|
80612
|
-
const patterns = stringPatterns.map(pattern => new
|
|
80670
|
+
const patterns = stringPatterns.map(pattern => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(pattern))).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(acc, current) : current, undefined);
|
|
80613
80671
|
if (patterns != undefined) {
|
|
80614
|
-
const totalDigitsRuleBody = new
|
|
80672
|
+
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(patterns);
|
|
80615
80673
|
yield {
|
|
80616
80674
|
condition: totalDigitsRuleBody,
|
|
80617
80675
|
message: makeMessage({
|
|
@@ -80623,7 +80681,7 @@ class FLangValidationBuildContext {
|
|
|
80623
80681
|
const typeNodeInteger = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children9 = typeNode.children) === null || _typeNode$children9 === void 0 ? void 0 : _typeNode$children9.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.IntegerdigitsTypeCheckNode));
|
|
80624
80682
|
const integerDigits = (_typeNodeInteger$valu = typeNodeInteger === null || typeNodeInteger === void 0 ? void 0 : typeNodeInteger.value) !== null && _typeNodeInteger$valu !== void 0 ? _typeNodeInteger$valu : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.integerDigits;
|
|
80625
80683
|
if (integerDigits != undefined) {
|
|
80626
|
-
const integerDigitsRuleBody = new
|
|
80684
|
+
const integerDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NumLenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.FractionalLenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToDecimalIfNeed)(valueReference))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(integerDigits)));
|
|
80627
80685
|
yield {
|
|
80628
80686
|
condition: integerDigitsRuleBody,
|
|
80629
80687
|
message: makeMessage({
|
|
@@ -80635,7 +80693,7 @@ class FLangValidationBuildContext {
|
|
|
80635
80693
|
const typeNodeFractional = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children10 = typeNode.children) === null || _typeNode$children10 === void 0 ? void 0 : _typeNode$children10.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.FractiondigitsTypeCheckNode));
|
|
80636
80694
|
const fractionalDigits = (_typeNodeFractional$v = typeNodeFractional === null || typeNodeFractional === void 0 ? void 0 : typeNodeFractional.value) !== null && _typeNodeFractional$v !== void 0 ? _typeNodeFractional$v : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.fractionDigits;
|
|
80637
80695
|
if (fractionalDigits != undefined) {
|
|
80638
|
-
const fractionalDigitsRuleBody = new
|
|
80696
|
+
const fractionalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.FractionalLenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToDecimalIfNeed)(valueReference)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(fractionalDigits)));
|
|
80639
80697
|
yield {
|
|
80640
80698
|
condition: fractionalDigitsRuleBody,
|
|
80641
80699
|
message: makeMessage({
|
|
@@ -80654,35 +80712,35 @@ class FLangValidationBuildContext {
|
|
|
80654
80712
|
case "integer":
|
|
80655
80713
|
{
|
|
80656
80714
|
return {
|
|
80657
|
-
condition: new
|
|
80715
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("^-?\\d+$"))),
|
|
80658
80716
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80659
80717
|
};
|
|
80660
80718
|
}
|
|
80661
80719
|
case "decimal":
|
|
80662
80720
|
{
|
|
80663
80721
|
return {
|
|
80664
|
-
condition: new
|
|
80722
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("^-?\\d+(([.]\\d+$)|($))"))),
|
|
80665
80723
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80666
80724
|
};
|
|
80667
80725
|
}
|
|
80668
80726
|
case "date":
|
|
80669
80727
|
{
|
|
80670
80728
|
return {
|
|
80671
|
-
condition: new
|
|
80729
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("^(0[1-9]|[12][0-9]|3[01])\\.(0[1-9]|1[012])\\.(19|20)[0-9]{2}$"))),
|
|
80672
80730
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80673
80731
|
};
|
|
80674
80732
|
}
|
|
80675
80733
|
case "gYear":
|
|
80676
80734
|
{
|
|
80677
80735
|
return {
|
|
80678
|
-
condition: new
|
|
80736
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("^\\d{4}$"))),
|
|
80679
80737
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80680
80738
|
};
|
|
80681
80739
|
}
|
|
80682
80740
|
case "gMonth":
|
|
80683
80741
|
{
|
|
80684
80742
|
return {
|
|
80685
|
-
condition: new
|
|
80743
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("^(--(0[1-9]|1[0-2]))$"))),
|
|
80686
80744
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80687
80745
|
};
|
|
80688
80746
|
}
|
|
@@ -80812,6 +80870,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80812
80870
|
/* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
|
|
80813
80871
|
/* harmony export */ "TrimExpression": () => (/* binding */ TrimExpression),
|
|
80814
80872
|
/* harmony export */ "PrepareNumberExpression": () => (/* binding */ PrepareNumberExpression),
|
|
80873
|
+
/* harmony export */ "IncrementalFlagExpression": () => (/* binding */ IncrementalFlagExpression),
|
|
80874
|
+
/* harmony export */ "GetOldExpression": () => (/* binding */ GetOldExpression),
|
|
80815
80875
|
/* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
|
|
80816
80876
|
/* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
|
|
80817
80877
|
/* harmony export */ });
|
|
@@ -81996,6 +82056,33 @@ class PrepareNumberExpression extends FLangExpression {
|
|
|
81996
82056
|
return `prepareNumber(${this.expression.convertToString()})`;
|
|
81997
82057
|
}
|
|
81998
82058
|
}
|
|
82059
|
+
class IncrementalFlagExpression extends FLangExpression {
|
|
82060
|
+
getChildNodes() {
|
|
82061
|
+
return [];
|
|
82062
|
+
}
|
|
82063
|
+
getType() {
|
|
82064
|
+
return BuildInTypeExpression.bool;
|
|
82065
|
+
}
|
|
82066
|
+
convertToString() {
|
|
82067
|
+
return `incremental`;
|
|
82068
|
+
}
|
|
82069
|
+
}
|
|
82070
|
+
class GetOldExpression extends FLangExpression {
|
|
82071
|
+
constructor(expression) {
|
|
82072
|
+
super();
|
|
82073
|
+
this.expression = void 0;
|
|
82074
|
+
this.expression = expression;
|
|
82075
|
+
}
|
|
82076
|
+
getChildNodes() {
|
|
82077
|
+
return [];
|
|
82078
|
+
}
|
|
82079
|
+
getType() {
|
|
82080
|
+
return BuildInTypeExpression.bool;
|
|
82081
|
+
}
|
|
82082
|
+
convertToString() {
|
|
82083
|
+
return `old(${this.expression.convertToString()})`;
|
|
82084
|
+
}
|
|
82085
|
+
}
|
|
81999
82086
|
class FLangStatement extends FLangNode {}
|
|
82000
82087
|
class SetStatement extends FLangStatement {
|
|
82001
82088
|
constructor(left, right) {
|
|
@@ -82625,7 +82712,28 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82625
82712
|
const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
|
|
82626
82713
|
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
|
|
82627
82714
|
} else {
|
|
82628
|
-
|
|
82715
|
+
const predictIterMultiplisity = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, firstPartLength));
|
|
82716
|
+
if (predictIterMultiplisity.getIterationRank() > 1) {
|
|
82717
|
+
/**
|
|
82718
|
+
* В зависимости от того - на каком уровне пишем groupCount
|
|
82719
|
+
* in GroupCountConstThrewMultiple
|
|
82720
|
+
* {
|
|
82721
|
+
* check all === groupCount("1", Б/С/Код);
|
|
82722
|
+
* GroupCountConstThrewMultiple/Б/__EACH__/С/__EACH__/Код
|
|
82723
|
+
* in Б
|
|
82724
|
+
* {
|
|
82725
|
+
* in С
|
|
82726
|
+
* {
|
|
82727
|
+
* check inС === groupCount(Код, Код);
|
|
82728
|
+
* GroupCountConstThrewMultiple/Б/__CURRENT__/С/__CURRENT__/Код
|
|
82729
|
+
* }
|
|
82730
|
+
* }
|
|
82731
|
+
* }
|
|
82732
|
+
* */
|
|
82733
|
+
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(predictIterMultiplisity.toCurrentIteration().getPathPartsAsArray().slice(0, firstPartLength - 1));
|
|
82734
|
+
} else {
|
|
82735
|
+
finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, firstPartLength - 1));
|
|
82736
|
+
}
|
|
82629
82737
|
}
|
|
82630
82738
|
if (!finalIterPath) {
|
|
82631
82739
|
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|
|
@@ -82676,9 +82784,9 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82676
82784
|
const currentSumExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
|
|
82677
82785
|
const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
|
|
82678
82786
|
const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
|
|
82679
|
-
const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression()));
|
|
82787
|
+
const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())));
|
|
82680
82788
|
addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(""))));
|
|
82681
|
-
const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0));
|
|
82789
|
+
const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)));
|
|
82682
82790
|
addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("G29"))));
|
|
82683
82791
|
resultValueExpression = currentSumExpression;
|
|
82684
82792
|
countValueExpression = currenCountExpression;
|
|
@@ -82769,8 +82877,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82769
82877
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
82770
82878
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82771
82879
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82772
|
-
/* harmony import */ var
|
|
82773
|
-
/* harmony import */ var
|
|
82880
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
82881
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
82882
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
82883
|
+
|
|
82774
82884
|
|
|
82775
82885
|
|
|
82776
82886
|
|
|
@@ -82791,7 +82901,7 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82791
82901
|
}
|
|
82792
82902
|
generateRules() {
|
|
82793
82903
|
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(this.buildFormulaFLangRules(), this.optionalSectionRuleBuilder.buildRules());
|
|
82794
|
-
return (0,
|
|
82904
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRuleBuilder);
|
|
82795
82905
|
}
|
|
82796
82906
|
*buildFormulaFLangRules() {
|
|
82797
82907
|
for (const formula of (_this$formulas = this.formulas) !== null && _this$formulas !== void 0 ? _this$formulas : []) {
|
|
@@ -82807,11 +82917,11 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82807
82917
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
82808
82918
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82809
82919
|
const result = [];
|
|
82810
|
-
const getFormulaExpression = field => new
|
|
82920
|
+
const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue));
|
|
82811
82921
|
if (isTargetAutoField) {
|
|
82812
|
-
result.push(new
|
|
82922
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string)));
|
|
82813
82923
|
} else {
|
|
82814
|
-
result.push(new
|
|
82924
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
82815
82925
|
}
|
|
82816
82926
|
result.push(...precalculationRules);
|
|
82817
82927
|
return result;
|
|
@@ -82935,6 +83045,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82935
83045
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82936
83046
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82937
83047
|
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83048
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
83049
|
+
|
|
82938
83050
|
|
|
82939
83051
|
|
|
82940
83052
|
|
|
@@ -82964,12 +83076,14 @@ class FormulaRulesBuilder {
|
|
|
82964
83076
|
const precalculationRules = [];
|
|
82965
83077
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82966
83078
|
const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
|
|
82967
|
-
const getFormulaExpression = targetField => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new
|
|
83079
|
+
const getFormulaExpression = targetField => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue));
|
|
82968
83080
|
const result = [];
|
|
82969
83081
|
if (isTargetAutoField) {
|
|
82970
|
-
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string)));
|
|
83082
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag")))));
|
|
82971
83083
|
if (isDisabled) {
|
|
82972
83084
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
83085
|
+
} else {
|
|
83086
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)))));
|
|
82973
83087
|
}
|
|
82974
83088
|
} else {
|
|
82975
83089
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
@@ -83190,15 +83304,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83190
83304
|
|
|
83191
83305
|
|
|
83192
83306
|
class SugarRulesBuilder {
|
|
83193
|
-
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, typeRegistry, useSchemaValidations) {
|
|
83307
|
+
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations) {
|
|
83194
83308
|
this.sugarRoot = void 0;
|
|
83195
83309
|
this.controlCustomizationContext = void 0;
|
|
83196
83310
|
this.fetchFunctions = void 0;
|
|
83197
83311
|
this.formSchemaRng = void 0;
|
|
83312
|
+
this.dataDeclarationHelper = void 0;
|
|
83198
83313
|
this.useSchemaValidations = void 0;
|
|
83199
83314
|
this.typeRegistry = void 0;
|
|
83200
83315
|
this.useSchemaValidations = useSchemaValidations;
|
|
83201
83316
|
this.typeRegistry = typeRegistry;
|
|
83317
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
83202
83318
|
this.formSchemaRng = formSchemaRng;
|
|
83203
83319
|
this.fetchFunctions = fetchFunctions;
|
|
83204
83320
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -83206,7 +83322,7 @@ class SugarRulesBuilder {
|
|
|
83206
83322
|
}
|
|
83207
83323
|
buildRules() {
|
|
83208
83324
|
const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_0__.FormConverter(this.sugarRoot);
|
|
83209
|
-
const builder = new _markupGenerator_FLangNormalizationRulesBuilder__WEBPACK_IMPORTED_MODULE_1__.FLangNormalizationRulesBuilder(this.controlCustomizationContext, this.fetchFunctions, new _FetchFunctionToFlangConverter__WEBPACK_IMPORTED_MODULE_2__.FetchFunctionToFlangConverter(), this.formSchemaRng, new _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_3__.NodeTypeInfoHelper(this.formSchemaRng, this.typeRegistry, this.useSchemaValidations));
|
|
83325
|
+
const builder = new _markupGenerator_FLangNormalizationRulesBuilder__WEBPACK_IMPORTED_MODULE_1__.FLangNormalizationRulesBuilder(this.controlCustomizationContext, this.fetchFunctions, new _FetchFunctionToFlangConverter__WEBPACK_IMPORTED_MODULE_2__.FetchFunctionToFlangConverter(), this.dataDeclarationHelper, this.formSchemaRng, new _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_3__.NodeTypeInfoHelper(this.formSchemaRng, this.typeRegistry, this.useSchemaValidations));
|
|
83210
83326
|
return converter.buildNormalizeRules(builder, this.formSchemaRng);
|
|
83211
83327
|
}
|
|
83212
83328
|
}
|
|
@@ -83231,9 +83347,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83231
83347
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
83232
83348
|
/* harmony import */ var _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Common/ModelPath/Map/AbsoluteModelPathMap */ "./Common/ModelPath/Map/AbsoluteModelPathMap.ts");
|
|
83233
83349
|
/* harmony import */ var _Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Common/ModelPath/EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
83234
|
-
/* harmony import */ var
|
|
83235
|
-
/* harmony import */ var
|
|
83350
|
+
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
83351
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83236
83352
|
/* harmony import */ var _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../NodeTypeInfoHelper */ "./Generator/src/generators/ServerSideFLangNormalization/NodeTypeInfoHelper.ts");
|
|
83353
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
83354
|
+
|
|
83237
83355
|
|
|
83238
83356
|
|
|
83239
83357
|
|
|
@@ -83271,7 +83389,7 @@ class ValidationRulesBuilder {
|
|
|
83271
83389
|
const precalculationRules = [];
|
|
83272
83390
|
return {
|
|
83273
83391
|
target: fullTarget,
|
|
83274
|
-
checkExpression: this.formulaExprConverter.compileExpressionToFlangExpression(condition.expression, prefix, new
|
|
83392
|
+
checkExpression: this.formulaExprConverter.compileExpressionToFlangExpression(condition.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_10__.AbsoluteModelFieldPath(fullTarget, condition.errorLevel === "Error" ? "error" : "warning"), x => precalculationRules.push(x)),
|
|
83275
83393
|
message: condition.description,
|
|
83276
83394
|
errorLevel: condition.errorLevel,
|
|
83277
83395
|
precalculationRules: precalculationRules
|
|
@@ -83334,51 +83452,59 @@ class ValidationRulesBuilder {
|
|
|
83334
83452
|
const tokens = modelPath.getPathPartsAsArray();
|
|
83335
83453
|
for (let i = 0; i < tokens.length; i++) {
|
|
83336
83454
|
const currentModelPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(tokens.slice(0, i));
|
|
83337
|
-
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath)) {
|
|
83455
|
+
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath) || i == 1) {
|
|
83338
83456
|
yield currentModelPath;
|
|
83339
83457
|
}
|
|
83340
83458
|
}
|
|
83341
83459
|
}
|
|
83342
|
-
|
|
83343
|
-
const
|
|
83344
|
-
const
|
|
83345
|
-
|
|
83346
|
-
|
|
83347
|
-
|
|
83348
|
-
|
|
83349
|
-
|
|
83350
|
-
|
|
83351
|
-
|
|
83352
|
-
|
|
83353
|
-
|
|
83354
|
-
errorCountByTarget.getOrSet(multipleTarget, () => []).push(resultCountExpression);
|
|
83355
|
-
resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(multipleTarget.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
|
|
83356
|
-
}
|
|
83357
|
-
errorCountByTarget.getOrSet(iterationPath, () => []).push(resultCountExpression);
|
|
83358
|
-
resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterationPath.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
|
|
83359
|
-
}
|
|
83360
|
-
totalErrorCountExpressions.set((_IterUtils$last = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.last(iterationSequence)) !== null && _IterUtils$last !== void 0 ? _IterUtils$last : path, resultCountExpression);
|
|
83361
|
-
}
|
|
83362
|
-
for (const entry of errorCountByTarget.entries()) {
|
|
83363
|
-
const iterable = entry[0];
|
|
83364
|
-
const items = [..._Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.distinctBy(entry[1], x => x.convertToString())];
|
|
83365
|
-
const firstEmptyExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression();
|
|
83366
|
-
const allItemsSumExpression = items.reduce((x, y) => x == firstEmptyExpression ? y : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(x, y), firstEmptyExpression);
|
|
83367
|
-
const nextErrorCountPrecalculation = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83368
|
-
if (_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.last(iterable.getPathParts()) === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || !this.dataDeclarationHelper.isNodeHasChildrenEntry(iterable)) {
|
|
83369
|
-
yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(allItemsSumExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
|
|
83370
|
-
} else {
|
|
83371
|
-
yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), allItemsSumExpression)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
|
|
83372
|
-
}
|
|
83373
|
-
}
|
|
83374
|
-
const allRules = Iterator.from(totalErrorCountExpressions.values()).reduce((result, expression) => result === zeroExpression ? expression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(result, expression), zeroExpression);
|
|
83375
|
-
yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsolute)((0,_markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_7__.getRootPath)(this.sugarRoot)), countFieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(allRules, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
|
|
83460
|
+
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83461
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83462
|
+
const aggregationReduce = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.MinusBinaryExpression(getAllItemsSumExpression(false), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), getAllItemsSumExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
|
|
83463
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(aggregationReduce, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
|
|
83464
|
+
}
|
|
83465
|
+
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83466
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83467
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(getAllItemsSumExpression(false), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
|
|
83468
|
+
}
|
|
83469
|
+
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
83470
|
+
const valueGetExpression = readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName);
|
|
83471
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`[]`)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(1));
|
|
83376
83472
|
}
|
|
83377
|
-
|
|
83378
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.
|
|
83473
|
+
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
83474
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
|
|
83475
|
+
}
|
|
83476
|
+
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
83477
|
+
const reduceResult = Iterator.from((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.reverseArray)([...this.splitModelPathIfErrorCountRequired(path)])).flatMap(iterationPath => this.dataDeclarationHelper.isNodeHasChildrenEntry(iterationPath) ? [iterationPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), iterationPath] : [iterationPath]).reduce((result, iterationPath) => {
|
|
83478
|
+
const nextResultCountExpression = oldValues => this.getReadErrorCountValueExpression(iterationPath, countFieldName, oldValues);
|
|
83479
|
+
const info = {
|
|
83480
|
+
target: iterationPath,
|
|
83481
|
+
getExpressionFunc: result.resultCountExpression
|
|
83482
|
+
};
|
|
83483
|
+
return {
|
|
83484
|
+
resultCountExpression: nextResultCountExpression,
|
|
83485
|
+
items: result.items.concat(info)
|
|
83486
|
+
};
|
|
83487
|
+
}, {
|
|
83488
|
+
resultCountExpression: oldValues => this.getErrorWarningCountExpression(path.toCurrentIteration(), fieldName, oldValues),
|
|
83489
|
+
items: []
|
|
83490
|
+
});
|
|
83491
|
+
return reduceResult.items;
|
|
83492
|
+
}
|
|
83493
|
+
buildErrorWarningCountRules(allPathsWithValidations, fieldName) {
|
|
83494
|
+
const countFieldName = `${fieldName}sCount`;
|
|
83495
|
+
const errorCountByTarget = Iterator.from(allPathsWithValidations).flatMap(path => this.buildChainOfErrorCountRules(path, countFieldName, fieldName)).reduce((result, current) => {
|
|
83496
|
+
result.getOrSet(current.target, () => []).push(current.getExpressionFunc);
|
|
83497
|
+
return result;
|
|
83498
|
+
}, new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__.EachCurrentCollision.AreDifferent));
|
|
83499
|
+
const rules = Iterator.from(errorCountByTarget.entries()).map(([iterable, getExpressionFunctions]) => {
|
|
83500
|
+
const getAllItemsSumExpression = readOldValues => Iterator.from(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.distinctBy(getExpressionFunctions.map(x => x(readOldValues)), x => x.convertToString())).reduce((result, currentExpr) => result instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression ? currentExpr : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(result, currentExpr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
|
|
83501
|
+
const isTargetRequiredReduce = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.last(iterable.getPathParts()) !== _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each && this.dataDeclarationHelper.isNodeHasChildrenEntry(iterable);
|
|
83502
|
+
return isTargetRequiredReduce ? this.buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) : this.buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression);
|
|
83503
|
+
});
|
|
83504
|
+
return rules;
|
|
83379
83505
|
}
|
|
83380
83506
|
adjustPathMultiplicity(path) {
|
|
83381
|
-
return (0,
|
|
83507
|
+
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
83382
83508
|
}
|
|
83383
83509
|
}
|
|
83384
83510
|
|
|
@@ -107137,12 +107263,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107137
107263
|
|
|
107138
107264
|
|
|
107139
107265
|
class FLangNormalizationRulesBuilder {
|
|
107140
|
-
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, schemaRng, nodeTypeInfoHelper) {
|
|
107266
|
+
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, dataDeclarationHelper, schemaRng, nodeTypeInfoHelper) {
|
|
107141
107267
|
this.controlCustomizationContext = void 0;
|
|
107142
107268
|
this.fetchFunctions = void 0;
|
|
107143
107269
|
this.schemaRng = void 0;
|
|
107144
107270
|
this.nodeTypeInfoHelper = void 0;
|
|
107145
107271
|
this.fetchFuncToFlangConverter = void 0;
|
|
107272
|
+
this.dataDeclarationHelper = void 0;
|
|
107273
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
107146
107274
|
this.nodeTypeInfoHelper = nodeTypeInfoHelper;
|
|
107147
107275
|
this.schemaRng = schemaRng;
|
|
107148
107276
|
this.fetchFuncToFlangConverter = fetchFuncToFlangConverter;
|
|
@@ -107184,7 +107312,8 @@ class FLangNormalizationRulesBuilder {
|
|
|
107184
107312
|
if (!disabled && !dataBinding.settings) {
|
|
107185
107313
|
valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), valueExpression, sourceValueReference);
|
|
107186
107314
|
}
|
|
107187
|
-
|
|
107315
|
+
const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
|
|
107316
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
107188
107317
|
}
|
|
107189
107318
|
*specialFieldsInitializer(node, options) {
|
|
107190
107319
|
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
|
|
@@ -110012,7 +110141,8 @@ function getSettings(sugarRoot, gfv, additionalSettings, formJsonSettings) {
|
|
|
110012
110141
|
isReadOnly: (_sugarRoot$isReadOnly = sugarRoot.isReadOnly) !== null && _sugarRoot$isReadOnly !== void 0 ? _sugarRoot$isReadOnly : false,
|
|
110013
110142
|
gfv: gfv,
|
|
110014
110143
|
...additionalSettings,
|
|
110015
|
-
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization
|
|
110144
|
+
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization,
|
|
110145
|
+
useServerSideCalculations: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideCalculations
|
|
110016
110146
|
};
|
|
110017
110147
|
return `module.exports = ${JSON.stringify(settings, undefined, 2)}`;
|
|
110018
110148
|
}
|