@kontur.candy/generator 5.14.0-rsvfunctions.6 → 5.14.0-rsvfunctions.8
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 +290 -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;
|
|
@@ -60429,6 +60448,33 @@ function isMatchAbbreviation(abbreviation, value) {
|
|
|
60429
60448
|
|
|
60430
60449
|
/***/ }),
|
|
60431
60450
|
|
|
60451
|
+
/***/ "./Engine/src/Engine/Core/CoreTypes.ts":
|
|
60452
|
+
/*!*********************************************!*\
|
|
60453
|
+
!*** ./Engine/src/Engine/Core/CoreTypes.ts ***!
|
|
60454
|
+
\*********************************************/
|
|
60455
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60456
|
+
|
|
60457
|
+
"use strict";
|
|
60458
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60459
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
60460
|
+
/* harmony export */ "nonRegularFieldName": () => (/* binding */ nonRegularFieldName),
|
|
60461
|
+
/* harmony export */ "getKnownViewModelFieldNames": () => (/* binding */ getKnownViewModelFieldNames)
|
|
60462
|
+
/* harmony export */ });
|
|
60463
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60464
|
+
|
|
60465
|
+
// Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
|
|
60466
|
+
|
|
60467
|
+
function nonRegularFieldName(fieldName) {
|
|
60468
|
+
// @ts-ignore
|
|
60469
|
+
return fieldName;
|
|
60470
|
+
}
|
|
60471
|
+
function getKnownViewModelFieldNames() {
|
|
60472
|
+
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"];
|
|
60473
|
+
return names;
|
|
60474
|
+
}
|
|
60475
|
+
|
|
60476
|
+
/***/ }),
|
|
60477
|
+
|
|
60432
60478
|
/***/ "./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts":
|
|
60433
60479
|
/*!*******************************************************************!*\
|
|
60434
60480
|
!*** ./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts ***!
|
|
@@ -79315,7 +79361,6 @@ class KCXmlGeneratorBase {
|
|
|
79315
79361
|
в зависимостях в CalculationFunction в данном случае все звёздочки превратятся в PathTokens.current.
|
|
79316
79362
|
*/
|
|
79317
79363
|
calculatedGroupSumDependencyForSourcePath(targetKeyPath, sourcePath) {
|
|
79318
|
-
var _targetPathParts$last;
|
|
79319
79364
|
const diffPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_4__.getMatchedAndDifferentModelPaths)(targetKeyPath, sourcePath);
|
|
79320
79365
|
if (targetKeyPath.getIterationRank() > diffPaths.matchedPath.getIterationRank()) {
|
|
79321
79366
|
return {
|
|
@@ -79326,7 +79371,13 @@ class KCXmlGeneratorBase {
|
|
|
79326
79371
|
const targetPathParts = diffPaths.matchedPath.getPathPartsAsArray();
|
|
79327
79372
|
const lastStarIndex = targetPathParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each);
|
|
79328
79373
|
const currentDepsPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(targetPathParts.slice(0, lastStarIndex));
|
|
79329
|
-
|
|
79374
|
+
let eachDepsPath;
|
|
79375
|
+
if (lastStarIndex === -1) {
|
|
79376
|
+
eachDepsPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createRelativeFromTokens)([...diffPaths.matchedPath.getPathParts(), ...diffPaths.differentPath.getPathParts()]);
|
|
79377
|
+
} else {
|
|
79378
|
+
var _targetPathParts$last;
|
|
79379
|
+
eachDepsPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createRelativeFromTokens)([(_targetPathParts$last = targetPathParts[lastStarIndex]) !== null && _targetPathParts$last !== void 0 ? _targetPathParts$last : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)("path in groupSum is incorrect. Cannot create DepsPath for " + targetPathParts.join("/")), ...targetPathParts.slice(lastStarIndex + 1), ...diffPaths.differentPath.getPathParts()]);
|
|
79380
|
+
}
|
|
79330
79381
|
return {
|
|
79331
79382
|
currentDepsPath: currentDepsPath,
|
|
79332
79383
|
eachDepsPath: eachDepsPath
|
|
@@ -79664,7 +79715,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79664
79715
|
|
|
79665
79716
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
79666
79717
|
try {
|
|
79667
|
-
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$
|
|
79718
|
+
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;
|
|
79668
79719
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
79669
79720
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
79670
79721
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
|
|
@@ -79673,7 +79724,9 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79673
79724
|
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
79674
79725
|
const formulasFromSugar = extractFormulasFromSugarKCLang(sugarRoot);
|
|
79675
79726
|
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]);
|
|
79676
|
-
const
|
|
79727
|
+
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;
|
|
79728
|
+
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));
|
|
79729
|
+
const useOldCalculator = !useCalculator2 && !useServerCalculations;
|
|
79677
79730
|
const kcXmlConditions = (_Iterator$from$map$fl = Iterator.from(getImportedKcXmlValidations(sugarRoot, additionalContent)).map(x => {
|
|
79678
79731
|
var _container$conditions, _container$conditions2;
|
|
79679
79732
|
const container = formulaReader.readFormulas(x);
|
|
@@ -79702,7 +79755,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79702
79755
|
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter);
|
|
79703
79756
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
79704
79757
|
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
79705
|
-
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);
|
|
79758
|
+
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);
|
|
79706
79759
|
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);
|
|
79707
79760
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
79708
79761
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
@@ -79715,18 +79768,18 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79715
79768
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
79716
79769
|
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
79717
79770
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
79718
|
-
const formulasForCalculator =
|
|
79771
|
+
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
79719
79772
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
79720
79773
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
79721
|
-
if ((_additionalContent$
|
|
79722
|
-
var _additionalContent$
|
|
79774
|
+
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) {
|
|
79775
|
+
var _additionalContent$fo7, _additionalContent$fo8;
|
|
79723
79776
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
79724
79777
|
const customNormalizers = [{
|
|
79725
79778
|
normalizerId: "formulas",
|
|
79726
|
-
content: (_additionalContent$
|
|
79779
|
+
content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
79727
79780
|
}, {
|
|
79728
79781
|
normalizerId: "formulasWithInitializers",
|
|
79729
|
-
content: (_additionalContent$
|
|
79782
|
+
content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
79730
79783
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
79731
79784
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
79732
79785
|
switch (additionalNormalizer.extension) {
|
|
@@ -79764,7 +79817,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79764
79817
|
const kcXmlAutoCalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_Calculator2_AutoCalculationsCalculator2Generator__WEBPACK_IMPORTED_MODULE_28__.AutoCalculationsCalculator2Generator(formSchemaRng, dataDeclarationHelper);
|
|
79765
79818
|
builder.addResource("kcXmlAutoCalculationConfigurator.js", kcXmlAutoCalcGenerator.generate(formulasForCalculator2));
|
|
79766
79819
|
const kcXmlValidationGenerator = new _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_23__.KCXmlValidationGenerator(formSchemaRng);
|
|
79767
|
-
|
|
79820
|
+
const kcXmlConditionsForCalculator2 = !useServerCalculations ? kcXmlConditions : [];
|
|
79821
|
+
builder.addResource("kcXmlValidationConfigurator.js", kcXmlValidationGenerator.generate(kcXmlConditionsForCalculator2));
|
|
79768
79822
|
// const importedAutoCalculations = getImportedAutoCalculations(sugarRoot);
|
|
79769
79823
|
builder.addResource("autocalculationConfigurators.js", `export default []`);
|
|
79770
79824
|
builder.addResource("FakeStyles.less", `// empty styles to enforce style files`);
|
|
@@ -80233,8 +80287,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80233
80287
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
80234
80288
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
80235
80289
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80236
|
-
/* harmony import */ var
|
|
80237
|
-
/* harmony import */ var
|
|
80290
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80291
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80292
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80293
|
+
|
|
80238
80294
|
|
|
80239
80295
|
|
|
80240
80296
|
|
|
@@ -80278,11 +80334,11 @@ class CustomKCLangToFlangRuleGenerator {
|
|
|
80278
80334
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
80279
80335
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
80280
80336
|
const result = [];
|
|
80281
|
-
const getFormulaExpression = field => new
|
|
80337
|
+
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));
|
|
80282
80338
|
if (isTargetAutoField) {
|
|
80283
|
-
result.push(new
|
|
80339
|
+
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)));
|
|
80284
80340
|
} else {
|
|
80285
|
-
result.push(new
|
|
80341
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
80286
80342
|
}
|
|
80287
80343
|
result.push(...precalculationRules);
|
|
80288
80344
|
return result;
|
|
@@ -80316,8 +80372,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80316
80372
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80317
80373
|
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
80318
80374
|
/* harmony import */ var _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/SchemaRng/StringTypeMessageGenerator */ "./Generator/src/common/SchemaRng/StringTypeMessageGenerator.ts");
|
|
80319
|
-
/* harmony import */ var
|
|
80320
|
-
/* harmony import */ var
|
|
80375
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80376
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80377
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80378
|
+
|
|
80321
80379
|
|
|
80322
80380
|
|
|
80323
80381
|
|
|
@@ -80331,7 +80389,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80331
80389
|
|
|
80332
80390
|
|
|
80333
80391
|
|
|
80334
|
-
const makeArrayLiteral = text => new
|
|
80392
|
+
const makeArrayLiteral = text => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(`["${text}"]`);
|
|
80335
80393
|
const makeMessage = (constraints, sugarTypeDescription, schemaTypeDescription) => {
|
|
80336
80394
|
var _ref, _ref2;
|
|
80337
80395
|
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 : "Поле должно быть заполнено");
|
|
@@ -80366,7 +80424,7 @@ class FLangValidationBuildContext {
|
|
|
80366
80424
|
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
80367
80425
|
var _typeNode$base, _typeNode$description;
|
|
80368
80426
|
const validations = [];
|
|
80369
|
-
const valueReference = new
|
|
80427
|
+
const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
|
|
80370
80428
|
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;
|
|
80371
80429
|
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;
|
|
80372
80430
|
if (baseName != undefined) {
|
|
@@ -80386,12 +80444,12 @@ class FLangValidationBuildContext {
|
|
|
80386
80444
|
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
80387
80445
|
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
80388
80446
|
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;
|
|
80389
|
-
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new
|
|
80447
|
+
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);
|
|
80390
80448
|
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
80391
80449
|
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);
|
|
80392
80450
|
const result = [];
|
|
80393
80451
|
result.push({
|
|
80394
|
-
statement: new
|
|
80452
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "error"), errorExpression),
|
|
80395
80453
|
checkType: "error"
|
|
80396
80454
|
});
|
|
80397
80455
|
const warningValidations = validations.filter(x => x.checkType === "warning");
|
|
@@ -80400,7 +80458,7 @@ class FLangValidationBuildContext {
|
|
|
80400
80458
|
}
|
|
80401
80459
|
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);
|
|
80402
80460
|
result.push({
|
|
80403
|
-
statement: new
|
|
80461
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "warning"), warningExpression),
|
|
80404
80462
|
checkType: "warning"
|
|
80405
80463
|
});
|
|
80406
80464
|
return result;
|
|
@@ -80409,30 +80467,30 @@ class FLangValidationBuildContext {
|
|
|
80409
80467
|
let expression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.IterUtils.reduce(validations, (result, {
|
|
80410
80468
|
condition,
|
|
80411
80469
|
message
|
|
80412
|
-
}) => new
|
|
80470
|
+
}) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(condition, message, result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
|
|
80413
80471
|
if (!optional) {
|
|
80414
80472
|
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement) {
|
|
80415
|
-
const requiredExpression = new
|
|
80416
|
-
const targetCheck = new
|
|
80473
|
+
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);
|
|
80474
|
+
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("")));
|
|
80417
80475
|
if (restChecks != undefined) {
|
|
80418
|
-
const finalChildrenCondition = new
|
|
80419
|
-
expression = new
|
|
80476
|
+
const finalChildrenCondition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(targetCheck, restChecks);
|
|
80477
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(finalChildrenCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression(), requiredExpression);
|
|
80420
80478
|
} else {
|
|
80421
80479
|
expression = requiredExpression;
|
|
80422
80480
|
}
|
|
80423
80481
|
} else {
|
|
80424
|
-
expression = new
|
|
80482
|
+
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);
|
|
80425
80483
|
}
|
|
80426
80484
|
} else {
|
|
80427
|
-
expression = new
|
|
80485
|
+
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);
|
|
80428
80486
|
}
|
|
80429
80487
|
const visibilityFlangCondition = this.visibilityConditions.map(x => {
|
|
80430
|
-
const target = new
|
|
80488
|
+
const target = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__.AbsoluteModelFieldPath(targetPath, checkType);
|
|
80431
80489
|
const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(x.path.getPathPartsAsArray().filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken));
|
|
80432
80490
|
const flangExpr = this.getFlangExpressionFromKCLangCondition(prefix, target, x.condition, x.invertRequired);
|
|
80433
80491
|
return flangExpr;
|
|
80434
|
-
}).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined).reduce((acc, current) => acc != undefined ? new
|
|
80435
|
-
return visibilityFlangCondition != undefined ? new
|
|
80492
|
+
}).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);
|
|
80493
|
+
return visibilityFlangCondition != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(visibilityFlangCondition, expression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()) : expression;
|
|
80436
80494
|
}
|
|
80437
80495
|
getFlangExpressionFromKCLangCondition(prefix, target, condition, invertRequired) {
|
|
80438
80496
|
const fullKcLangExpr = `
|
|
@@ -80448,13 +80506,13 @@ class FLangValidationBuildContext {
|
|
|
80448
80506
|
const formulaExpr = this.formulaExprConverter.compileExpressionToFlangExpression(formulaNode.expression, prefix, target, value => {
|
|
80449
80507
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotSupportedError("In contextual KcLang conditions should not be summation.");
|
|
80450
80508
|
});
|
|
80451
|
-
const flangExpr = formulaExpr instanceof
|
|
80509
|
+
const flangExpr = formulaExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression ? formulaExpr.condition : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
|
|
80452
80510
|
const getTypeCorrectedExpression = () => {
|
|
80453
|
-
const argExpr = (0,
|
|
80454
|
-
return new
|
|
80511
|
+
const argExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToStringIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.tryExtractValueReferenceAsStringFromDecimal)(flangExpr));
|
|
80512
|
+
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("")));
|
|
80455
80513
|
};
|
|
80456
|
-
const correctedFLangExpr = flangExpr.getType() ===
|
|
80457
|
-
return invertRequired ? new
|
|
80514
|
+
const correctedFLangExpr = flangExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.bool ? flangExpr : getTypeCorrectedExpression();
|
|
80515
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(correctedFLangExpr) : correctedFLangExpr;
|
|
80458
80516
|
} catch (e) {
|
|
80459
80517
|
try {
|
|
80460
80518
|
var _match$, _match$2, _match$3;
|
|
@@ -80465,26 +80523,26 @@ class FLangValidationBuildContext {
|
|
|
80465
80523
|
const value = match === null || match === void 0 ? void 0 : (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
|
|
80466
80524
|
if (path != undefined && sign != undefined && value != undefined) {
|
|
80467
80525
|
const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
|
|
80468
|
-
const valueRef = new
|
|
80469
|
-
const len = new
|
|
80470
|
-
const argument = new
|
|
80526
|
+
const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(fullPath, "children");
|
|
80527
|
+
const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueRef);
|
|
80528
|
+
const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(value);
|
|
80471
80529
|
const getOperation = () => {
|
|
80472
80530
|
switch (sign) {
|
|
80473
80531
|
case ">":
|
|
80474
|
-
return new
|
|
80532
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GtExpression(len, argument);
|
|
80475
80533
|
case "<":
|
|
80476
|
-
return new
|
|
80534
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LtExpression(len, argument);
|
|
80477
80535
|
case "==":
|
|
80478
80536
|
case "===":
|
|
80479
|
-
return new
|
|
80537
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(len, argument);
|
|
80480
80538
|
case "!=":
|
|
80481
80539
|
case "!==":
|
|
80482
|
-
return new
|
|
80540
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(len, argument);
|
|
80483
80541
|
default:
|
|
80484
80542
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotImplementedError();
|
|
80485
80543
|
}
|
|
80486
80544
|
};
|
|
80487
|
-
return invertRequired ? new
|
|
80545
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(getOperation()) : getOperation();
|
|
80488
80546
|
}
|
|
80489
80547
|
} catch {
|
|
80490
80548
|
// eslint-disable-next-line no-console
|
|
@@ -80501,9 +80559,9 @@ class FLangValidationBuildContext {
|
|
|
80501
80559
|
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 : [];
|
|
80502
80560
|
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 : [];
|
|
80503
80561
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(enumerationItems)) {
|
|
80504
|
-
const enumerationRuleBody = new
|
|
80562
|
+
const enumerationRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OneOfExpression(valueReference, enumerationItems.map(item => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(item)));
|
|
80505
80563
|
yield {
|
|
80506
|
-
condition: new
|
|
80564
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(enumerationRuleBody),
|
|
80507
80565
|
message: makeMessage({
|
|
80508
80566
|
enumerationAllowedValues: enumerationItems
|
|
80509
80567
|
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
@@ -80514,9 +80572,9 @@ class FLangValidationBuildContext {
|
|
|
80514
80572
|
const gId = (_digest$gId = digest === null || digest === void 0 ? void 0 : digest.gId) !== null && _digest$gId !== void 0 ? _digest$gId : nodeGId;
|
|
80515
80573
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrEmpty)(gId) && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayHasLength)(enumerationItems, 0)) {
|
|
80516
80574
|
var _ref3, _digest$description, _ref4, _digest$checkType;
|
|
80517
|
-
const ruleBody = new
|
|
80575
|
+
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]`));
|
|
80518
80576
|
yield {
|
|
80519
|
-
condition: new
|
|
80577
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(ruleBody),
|
|
80520
80578
|
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 : "Поле заполнено не по справочнику"),
|
|
80521
80579
|
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"
|
|
80522
80580
|
};
|
|
@@ -80524,7 +80582,7 @@ class FLangValidationBuildContext {
|
|
|
80524
80582
|
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));
|
|
80525
80583
|
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;
|
|
80526
80584
|
if (lengthValue != undefined) {
|
|
80527
|
-
const lengthExprRuleBody = new
|
|
80585
|
+
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)));
|
|
80528
80586
|
yield {
|
|
80529
80587
|
condition: lengthExprRuleBody,
|
|
80530
80588
|
message: makeMessage({
|
|
@@ -80538,7 +80596,7 @@ class FLangValidationBuildContext {
|
|
|
80538
80596
|
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));
|
|
80539
80597
|
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;
|
|
80540
80598
|
if (minLengthValue != undefined && maxLengthValue != undefined) {
|
|
80541
|
-
const lengthExprRuleBody = new
|
|
80599
|
+
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))));
|
|
80542
80600
|
yield {
|
|
80543
80601
|
condition: lengthExprRuleBody,
|
|
80544
80602
|
message: makeMessage({
|
|
@@ -80548,7 +80606,7 @@ class FLangValidationBuildContext {
|
|
|
80548
80606
|
checkType: checkType
|
|
80549
80607
|
};
|
|
80550
80608
|
} else if (minLengthValue != undefined) {
|
|
80551
|
-
const lengthExprRuleBody = new
|
|
80609
|
+
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)));
|
|
80552
80610
|
yield {
|
|
80553
80611
|
condition: lengthExprRuleBody,
|
|
80554
80612
|
message: makeMessage({
|
|
@@ -80557,7 +80615,7 @@ class FLangValidationBuildContext {
|
|
|
80557
80615
|
checkType: checkType
|
|
80558
80616
|
};
|
|
80559
80617
|
} else if (maxLengthValue != undefined) {
|
|
80560
|
-
const lengthExprRuleBody = new
|
|
80618
|
+
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)));
|
|
80561
80619
|
yield {
|
|
80562
80620
|
condition: lengthExprRuleBody,
|
|
80563
80621
|
message: makeMessage({
|
|
@@ -80569,7 +80627,7 @@ class FLangValidationBuildContext {
|
|
|
80569
80627
|
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));
|
|
80570
80628
|
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;
|
|
80571
80629
|
if (minInclusiveValue != undefined) {
|
|
80572
|
-
const minInclusiveRuleBody = new
|
|
80630
|
+
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)));
|
|
80573
80631
|
yield {
|
|
80574
80632
|
condition: minInclusiveRuleBody,
|
|
80575
80633
|
message: makeMessage({
|
|
@@ -80581,7 +80639,7 @@ class FLangValidationBuildContext {
|
|
|
80581
80639
|
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));
|
|
80582
80640
|
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;
|
|
80583
80641
|
if (maxInclusiveValue != undefined) {
|
|
80584
|
-
const maxInclusiveRuleBody = new
|
|
80642
|
+
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)));
|
|
80585
80643
|
yield {
|
|
80586
80644
|
condition: maxInclusiveRuleBody,
|
|
80587
80645
|
message: makeMessage({
|
|
@@ -80593,7 +80651,7 @@ class FLangValidationBuildContext {
|
|
|
80593
80651
|
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));
|
|
80594
80652
|
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;
|
|
80595
80653
|
if (totalDigitsValue != undefined) {
|
|
80596
|
-
const totalDigitsRuleBody = new
|
|
80654
|
+
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)));
|
|
80597
80655
|
yield {
|
|
80598
80656
|
condition: totalDigitsRuleBody,
|
|
80599
80657
|
message: makeMessage({
|
|
@@ -80604,9 +80662,9 @@ class FLangValidationBuildContext {
|
|
|
80604
80662
|
}
|
|
80605
80663
|
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 : [];
|
|
80606
80664
|
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);
|
|
80607
|
-
const patterns = stringPatterns.map(pattern => new
|
|
80665
|
+
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);
|
|
80608
80666
|
if (patterns != undefined) {
|
|
80609
|
-
const totalDigitsRuleBody = new
|
|
80667
|
+
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(patterns);
|
|
80610
80668
|
yield {
|
|
80611
80669
|
condition: totalDigitsRuleBody,
|
|
80612
80670
|
message: makeMessage({
|
|
@@ -80618,7 +80676,7 @@ class FLangValidationBuildContext {
|
|
|
80618
80676
|
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));
|
|
80619
80677
|
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;
|
|
80620
80678
|
if (integerDigits != undefined) {
|
|
80621
|
-
const integerDigitsRuleBody = new
|
|
80679
|
+
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)));
|
|
80622
80680
|
yield {
|
|
80623
80681
|
condition: integerDigitsRuleBody,
|
|
80624
80682
|
message: makeMessage({
|
|
@@ -80630,7 +80688,7 @@ class FLangValidationBuildContext {
|
|
|
80630
80688
|
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));
|
|
80631
80689
|
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;
|
|
80632
80690
|
if (fractionalDigits != undefined) {
|
|
80633
|
-
const fractionalDigitsRuleBody = new
|
|
80691
|
+
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)));
|
|
80634
80692
|
yield {
|
|
80635
80693
|
condition: fractionalDigitsRuleBody,
|
|
80636
80694
|
message: makeMessage({
|
|
@@ -80649,35 +80707,35 @@ class FLangValidationBuildContext {
|
|
|
80649
80707
|
case "integer":
|
|
80650
80708
|
{
|
|
80651
80709
|
return {
|
|
80652
|
-
condition: new
|
|
80710
|
+
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+$"))),
|
|
80653
80711
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80654
80712
|
};
|
|
80655
80713
|
}
|
|
80656
80714
|
case "decimal":
|
|
80657
80715
|
{
|
|
80658
80716
|
return {
|
|
80659
|
-
condition: new
|
|
80717
|
+
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+$)|($))"))),
|
|
80660
80718
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80661
80719
|
};
|
|
80662
80720
|
}
|
|
80663
80721
|
case "date":
|
|
80664
80722
|
{
|
|
80665
80723
|
return {
|
|
80666
|
-
condition: new
|
|
80724
|
+
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}$"))),
|
|
80667
80725
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80668
80726
|
};
|
|
80669
80727
|
}
|
|
80670
80728
|
case "gYear":
|
|
80671
80729
|
{
|
|
80672
80730
|
return {
|
|
80673
|
-
condition: new
|
|
80731
|
+
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}$"))),
|
|
80674
80732
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80675
80733
|
};
|
|
80676
80734
|
}
|
|
80677
80735
|
case "gMonth":
|
|
80678
80736
|
{
|
|
80679
80737
|
return {
|
|
80680
|
-
condition: new
|
|
80738
|
+
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]))$"))),
|
|
80681
80739
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80682
80740
|
};
|
|
80683
80741
|
}
|
|
@@ -80807,6 +80865,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80807
80865
|
/* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
|
|
80808
80866
|
/* harmony export */ "TrimExpression": () => (/* binding */ TrimExpression),
|
|
80809
80867
|
/* harmony export */ "PrepareNumberExpression": () => (/* binding */ PrepareNumberExpression),
|
|
80868
|
+
/* harmony export */ "IncrementalFlagExpression": () => (/* binding */ IncrementalFlagExpression),
|
|
80869
|
+
/* harmony export */ "GetOldExpression": () => (/* binding */ GetOldExpression),
|
|
80810
80870
|
/* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
|
|
80811
80871
|
/* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
|
|
80812
80872
|
/* harmony export */ });
|
|
@@ -81991,6 +82051,33 @@ class PrepareNumberExpression extends FLangExpression {
|
|
|
81991
82051
|
return `prepareNumber(${this.expression.convertToString()})`;
|
|
81992
82052
|
}
|
|
81993
82053
|
}
|
|
82054
|
+
class IncrementalFlagExpression extends FLangExpression {
|
|
82055
|
+
getChildNodes() {
|
|
82056
|
+
return [];
|
|
82057
|
+
}
|
|
82058
|
+
getType() {
|
|
82059
|
+
return BuildInTypeExpression.bool;
|
|
82060
|
+
}
|
|
82061
|
+
convertToString() {
|
|
82062
|
+
return `incremental`;
|
|
82063
|
+
}
|
|
82064
|
+
}
|
|
82065
|
+
class GetOldExpression extends FLangExpression {
|
|
82066
|
+
constructor(expression) {
|
|
82067
|
+
super();
|
|
82068
|
+
this.expression = void 0;
|
|
82069
|
+
this.expression = expression;
|
|
82070
|
+
}
|
|
82071
|
+
getChildNodes() {
|
|
82072
|
+
return [];
|
|
82073
|
+
}
|
|
82074
|
+
getType() {
|
|
82075
|
+
return BuildInTypeExpression.bool;
|
|
82076
|
+
}
|
|
82077
|
+
convertToString() {
|
|
82078
|
+
return `old(${this.expression.convertToString()})`;
|
|
82079
|
+
}
|
|
82080
|
+
}
|
|
81994
82081
|
class FLangStatement extends FLangNode {}
|
|
81995
82082
|
class SetStatement extends FLangStatement {
|
|
81996
82083
|
constructor(left, right) {
|
|
@@ -82671,9 +82758,9 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82671
82758
|
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");
|
|
82672
82759
|
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");
|
|
82673
82760
|
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");
|
|
82674
|
-
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()));
|
|
82761
|
+
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())));
|
|
82675
82762
|
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(""))));
|
|
82676
|
-
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));
|
|
82763
|
+
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)));
|
|
82677
82764
|
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"))));
|
|
82678
82765
|
resultValueExpression = currentSumExpression;
|
|
82679
82766
|
countValueExpression = currenCountExpression;
|
|
@@ -82764,8 +82851,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82764
82851
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
82765
82852
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82766
82853
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82767
|
-
/* harmony import */ var
|
|
82768
|
-
/* harmony import */ var
|
|
82854
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
82855
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
82856
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
82857
|
+
|
|
82769
82858
|
|
|
82770
82859
|
|
|
82771
82860
|
|
|
@@ -82786,7 +82875,7 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82786
82875
|
}
|
|
82787
82876
|
generateRules() {
|
|
82788
82877
|
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(this.buildFormulaFLangRules(), this.optionalSectionRuleBuilder.buildRules());
|
|
82789
|
-
return (0,
|
|
82878
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRuleBuilder);
|
|
82790
82879
|
}
|
|
82791
82880
|
*buildFormulaFLangRules() {
|
|
82792
82881
|
for (const formula of (_this$formulas = this.formulas) !== null && _this$formulas !== void 0 ? _this$formulas : []) {
|
|
@@ -82802,11 +82891,11 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82802
82891
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
82803
82892
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82804
82893
|
const result = [];
|
|
82805
|
-
const getFormulaExpression = field => new
|
|
82894
|
+
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));
|
|
82806
82895
|
if (isTargetAutoField) {
|
|
82807
|
-
result.push(new
|
|
82896
|
+
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)));
|
|
82808
82897
|
} else {
|
|
82809
|
-
result.push(new
|
|
82898
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
82810
82899
|
}
|
|
82811
82900
|
result.push(...precalculationRules);
|
|
82812
82901
|
return result;
|
|
@@ -82930,6 +83019,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82930
83019
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82931
83020
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82932
83021
|
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83022
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
83023
|
+
|
|
82933
83024
|
|
|
82934
83025
|
|
|
82935
83026
|
|
|
@@ -82959,12 +83050,14 @@ class FormulaRulesBuilder {
|
|
|
82959
83050
|
const precalculationRules = [];
|
|
82960
83051
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82961
83052
|
const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
|
|
82962
|
-
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
|
|
83053
|
+
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));
|
|
82963
83054
|
const result = [];
|
|
82964
83055
|
if (isTargetAutoField) {
|
|
82965
|
-
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)));
|
|
83056
|
+
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")))));
|
|
82966
83057
|
if (isDisabled) {
|
|
82967
83058
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
83059
|
+
} else {
|
|
83060
|
+
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)))));
|
|
82968
83061
|
}
|
|
82969
83062
|
} else {
|
|
82970
83063
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
@@ -83185,15 +83278,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83185
83278
|
|
|
83186
83279
|
|
|
83187
83280
|
class SugarRulesBuilder {
|
|
83188
|
-
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, typeRegistry, useSchemaValidations) {
|
|
83281
|
+
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations) {
|
|
83189
83282
|
this.sugarRoot = void 0;
|
|
83190
83283
|
this.controlCustomizationContext = void 0;
|
|
83191
83284
|
this.fetchFunctions = void 0;
|
|
83192
83285
|
this.formSchemaRng = void 0;
|
|
83286
|
+
this.dataDeclarationHelper = void 0;
|
|
83193
83287
|
this.useSchemaValidations = void 0;
|
|
83194
83288
|
this.typeRegistry = void 0;
|
|
83195
83289
|
this.useSchemaValidations = useSchemaValidations;
|
|
83196
83290
|
this.typeRegistry = typeRegistry;
|
|
83291
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
83197
83292
|
this.formSchemaRng = formSchemaRng;
|
|
83198
83293
|
this.fetchFunctions = fetchFunctions;
|
|
83199
83294
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -83201,7 +83296,7 @@ class SugarRulesBuilder {
|
|
|
83201
83296
|
}
|
|
83202
83297
|
buildRules() {
|
|
83203
83298
|
const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_0__.FormConverter(this.sugarRoot);
|
|
83204
|
-
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));
|
|
83299
|
+
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));
|
|
83205
83300
|
return converter.buildNormalizeRules(builder, this.formSchemaRng);
|
|
83206
83301
|
}
|
|
83207
83302
|
}
|
|
@@ -83226,9 +83321,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83226
83321
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
83227
83322
|
/* harmony import */ var _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Common/ModelPath/Map/AbsoluteModelPathMap */ "./Common/ModelPath/Map/AbsoluteModelPathMap.ts");
|
|
83228
83323
|
/* harmony import */ var _Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Common/ModelPath/EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
83229
|
-
/* harmony import */ var
|
|
83230
|
-
/* harmony import */ var
|
|
83324
|
+
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
83325
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83231
83326
|
/* harmony import */ var _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../NodeTypeInfoHelper */ "./Generator/src/generators/ServerSideFLangNormalization/NodeTypeInfoHelper.ts");
|
|
83327
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
83328
|
+
|
|
83232
83329
|
|
|
83233
83330
|
|
|
83234
83331
|
|
|
@@ -83266,7 +83363,7 @@ class ValidationRulesBuilder {
|
|
|
83266
83363
|
const precalculationRules = [];
|
|
83267
83364
|
return {
|
|
83268
83365
|
target: fullTarget,
|
|
83269
|
-
checkExpression: this.formulaExprConverter.compileExpressionToFlangExpression(condition.expression, prefix, new
|
|
83366
|
+
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)),
|
|
83270
83367
|
message: condition.description,
|
|
83271
83368
|
errorLevel: condition.errorLevel,
|
|
83272
83369
|
precalculationRules: precalculationRules
|
|
@@ -83329,51 +83426,59 @@ class ValidationRulesBuilder {
|
|
|
83329
83426
|
const tokens = modelPath.getPathPartsAsArray();
|
|
83330
83427
|
for (let i = 0; i < tokens.length; i++) {
|
|
83331
83428
|
const currentModelPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(tokens.slice(0, i));
|
|
83332
|
-
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath)) {
|
|
83429
|
+
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath) || i == 1) {
|
|
83333
83430
|
yield currentModelPath;
|
|
83334
83431
|
}
|
|
83335
83432
|
}
|
|
83336
83433
|
}
|
|
83337
|
-
|
|
83338
|
-
const
|
|
83339
|
-
const
|
|
83340
|
-
|
|
83341
|
-
|
|
83342
|
-
|
|
83343
|
-
|
|
83344
|
-
|
|
83345
|
-
|
|
83346
|
-
|
|
83347
|
-
|
|
83348
|
-
|
|
83349
|
-
|
|
83350
|
-
|
|
83351
|
-
|
|
83352
|
-
|
|
83353
|
-
|
|
83354
|
-
|
|
83355
|
-
|
|
83356
|
-
|
|
83357
|
-
|
|
83358
|
-
|
|
83359
|
-
|
|
83360
|
-
|
|
83361
|
-
|
|
83362
|
-
|
|
83363
|
-
|
|
83364
|
-
|
|
83365
|
-
|
|
83366
|
-
|
|
83367
|
-
|
|
83368
|
-
|
|
83369
|
-
const allRules = Iterator.from(totalErrorCountExpressions.values()).reduce((result, expression) => result === zeroExpression ? expression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(result, expression), zeroExpression);
|
|
83370
|
-
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")));
|
|
83434
|
+
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83435
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83436
|
+
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)));
|
|
83437
|
+
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")));
|
|
83438
|
+
}
|
|
83439
|
+
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83440
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83441
|
+
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")));
|
|
83442
|
+
}
|
|
83443
|
+
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
83444
|
+
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);
|
|
83445
|
+
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));
|
|
83446
|
+
}
|
|
83447
|
+
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
83448
|
+
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));
|
|
83449
|
+
}
|
|
83450
|
+
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
83451
|
+
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) => {
|
|
83452
|
+
const nextResultCountExpression = oldValues => this.getReadErrorCountValueExpression(iterationPath, countFieldName, oldValues);
|
|
83453
|
+
const info = {
|
|
83454
|
+
target: iterationPath,
|
|
83455
|
+
getExpressionFunc: result.resultCountExpression
|
|
83456
|
+
};
|
|
83457
|
+
return {
|
|
83458
|
+
resultCountExpression: nextResultCountExpression,
|
|
83459
|
+
items: result.items.concat(info)
|
|
83460
|
+
};
|
|
83461
|
+
}, {
|
|
83462
|
+
resultCountExpression: oldValues => this.getErrorWarningCountExpression(path.toCurrentIteration(), fieldName, oldValues),
|
|
83463
|
+
items: []
|
|
83464
|
+
});
|
|
83465
|
+
return reduceResult.items;
|
|
83371
83466
|
}
|
|
83372
|
-
|
|
83373
|
-
|
|
83467
|
+
buildErrorWarningCountRules(allPathsWithValidations, fieldName) {
|
|
83468
|
+
const countFieldName = `${fieldName}sCount`;
|
|
83469
|
+
const errorCountByTarget = Iterator.from(allPathsWithValidations).flatMap(path => this.buildChainOfErrorCountRules(path, countFieldName, fieldName)).reduce((result, current) => {
|
|
83470
|
+
result.getOrSet(current.target, () => []).push(current.getExpressionFunc);
|
|
83471
|
+
return result;
|
|
83472
|
+
}, new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__.EachCurrentCollision.AreDifferent));
|
|
83473
|
+
const rules = Iterator.from(errorCountByTarget.entries()).map(([iterable, getExpressionFunctions]) => {
|
|
83474
|
+
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());
|
|
83475
|
+
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);
|
|
83476
|
+
return isTargetRequiredReduce ? this.buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) : this.buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression);
|
|
83477
|
+
});
|
|
83478
|
+
return rules;
|
|
83374
83479
|
}
|
|
83375
83480
|
adjustPathMultiplicity(path) {
|
|
83376
|
-
return (0,
|
|
83481
|
+
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
83377
83482
|
}
|
|
83378
83483
|
}
|
|
83379
83484
|
|
|
@@ -107132,12 +107237,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107132
107237
|
|
|
107133
107238
|
|
|
107134
107239
|
class FLangNormalizationRulesBuilder {
|
|
107135
|
-
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, schemaRng, nodeTypeInfoHelper) {
|
|
107240
|
+
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, dataDeclarationHelper, schemaRng, nodeTypeInfoHelper) {
|
|
107136
107241
|
this.controlCustomizationContext = void 0;
|
|
107137
107242
|
this.fetchFunctions = void 0;
|
|
107138
107243
|
this.schemaRng = void 0;
|
|
107139
107244
|
this.nodeTypeInfoHelper = void 0;
|
|
107140
107245
|
this.fetchFuncToFlangConverter = void 0;
|
|
107246
|
+
this.dataDeclarationHelper = void 0;
|
|
107247
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
107141
107248
|
this.nodeTypeInfoHelper = nodeTypeInfoHelper;
|
|
107142
107249
|
this.schemaRng = schemaRng;
|
|
107143
107250
|
this.fetchFuncToFlangConverter = fetchFuncToFlangConverter;
|
|
@@ -107179,7 +107286,8 @@ class FLangNormalizationRulesBuilder {
|
|
|
107179
107286
|
if (!disabled && !dataBinding.settings) {
|
|
107180
107287
|
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);
|
|
107181
107288
|
}
|
|
107182
|
-
|
|
107289
|
+
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;
|
|
107290
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
107183
107291
|
}
|
|
107184
107292
|
*specialFieldsInitializer(node, options) {
|
|
107185
107293
|
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)());
|
|
@@ -110007,7 +110115,8 @@ function getSettings(sugarRoot, gfv, additionalSettings, formJsonSettings) {
|
|
|
110007
110115
|
isReadOnly: (_sugarRoot$isReadOnly = sugarRoot.isReadOnly) !== null && _sugarRoot$isReadOnly !== void 0 ? _sugarRoot$isReadOnly : false,
|
|
110008
110116
|
gfv: gfv,
|
|
110009
110117
|
...additionalSettings,
|
|
110010
|
-
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization
|
|
110118
|
+
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization,
|
|
110119
|
+
useServerSideCalculations: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideCalculations
|
|
110011
110120
|
};
|
|
110012
110121
|
return `module.exports = ${JSON.stringify(settings, undefined, 2)}`;
|
|
110013
110122
|
}
|