@kontur.candy/generator 5.14.0 → 5.15.1
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 +283 -179
- 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
|
|
@@ -59573,8 +59592,8 @@ class ModelPathImpl {
|
|
|
59573
59592
|
var _this$legacyPath;
|
|
59574
59593
|
return (_this$legacyPath = this.legacyPath) !== null && _this$legacyPath !== void 0 ? _this$legacyPath : this.legacyPath = this.tokens.map(x => this.pathPartToString(x)).join("/");
|
|
59575
59594
|
}
|
|
59576
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59577
|
-
if (eachCurrentCollision ===
|
|
59595
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59596
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59578
59597
|
return this.toLegacyPath() === modelPath.toLegacyPath();
|
|
59579
59598
|
} else {
|
|
59580
59599
|
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.zip(this.getPathParts(), modelPath.getPathParts())).every(([t1, t2]) => t1 === t2);
|
|
@@ -59584,14 +59603,14 @@ class ModelPathImpl {
|
|
|
59584
59603
|
/**
|
|
59585
59604
|
* Всегда целое положительное беззнаковое 32-битное число
|
|
59586
59605
|
*/
|
|
59587
|
-
getHash(eachCurrentCollision =
|
|
59606
|
+
getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
|
|
59588
59607
|
let hash = 5381;
|
|
59589
59608
|
for (const token of (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(this.tokens)) {
|
|
59590
59609
|
let currentStr;
|
|
59591
59610
|
if (PathTokens.isSimpleToken(token)) {
|
|
59592
59611
|
currentStr = token;
|
|
59593
59612
|
} else {
|
|
59594
|
-
if (eachCurrentCollision ===
|
|
59613
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent) {
|
|
59595
59614
|
currentStr = token === PathTokens.each ? "*" : "!";
|
|
59596
59615
|
} else {
|
|
59597
59616
|
currentStr = "*";
|
|
@@ -59645,8 +59664,8 @@ class ModelPathImpl {
|
|
|
59645
59664
|
}
|
|
59646
59665
|
return true;
|
|
59647
59666
|
}
|
|
59648
|
-
getIterationRank(eachCurrentCollision =
|
|
59649
|
-
return (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.count)(Iterator.from(this.tokens).filter(x => eachCurrentCollision ==
|
|
59667
|
+
getIterationRank(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent) {
|
|
59668
|
+
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)));
|
|
59650
59669
|
}
|
|
59651
59670
|
isEmpty() {
|
|
59652
59671
|
return this.tokens.length === 0;
|
|
@@ -59658,17 +59677,17 @@ class ModelPathImpl {
|
|
|
59658
59677
|
if (!modelPath.isAbsolute()) {
|
|
59659
59678
|
throw new Error(`Cannot match non absolute path '${modelPath.toString()}'`);
|
|
59660
59679
|
}
|
|
59661
|
-
return
|
|
59680
|
+
return _PathMatcher__WEBPACK_IMPORTED_MODULE_4__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
|
|
59662
59681
|
}
|
|
59663
59682
|
*splitByMultiplicity() {
|
|
59664
|
-
let lastSimpleParts = new
|
|
59683
|
+
let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
|
|
59665
59684
|
for (const token of this.tokens) {
|
|
59666
59685
|
if (PathTokens.isSimpleToken(token)) {
|
|
59667
59686
|
lastSimpleParts.append(token);
|
|
59668
59687
|
} else {
|
|
59669
59688
|
if (!lastSimpleParts.empty) {
|
|
59670
59689
|
yield lastSimpleParts.toResolvedPath();
|
|
59671
|
-
lastSimpleParts = new
|
|
59690
|
+
lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(false);
|
|
59672
59691
|
}
|
|
59673
59692
|
yield token;
|
|
59674
59693
|
}
|
|
@@ -59728,7 +59747,7 @@ class ModelPathImpl {
|
|
|
59728
59747
|
return new ModelPathImpl(this.tokens, true);
|
|
59729
59748
|
}
|
|
59730
59749
|
*getAllParentPaths() {
|
|
59731
|
-
const result = new
|
|
59750
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
|
|
59732
59751
|
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59733
59752
|
result.append(token);
|
|
59734
59753
|
yield result.toPath();
|
|
@@ -59742,7 +59761,7 @@ class ModelPathImpl {
|
|
|
59742
59761
|
return this;
|
|
59743
59762
|
}
|
|
59744
59763
|
getParentPath() {
|
|
59745
|
-
const result = new
|
|
59764
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.absolute);
|
|
59746
59765
|
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59747
59766
|
result.append(token);
|
|
59748
59767
|
}
|
|
@@ -59755,7 +59774,7 @@ class ModelPathImpl {
|
|
|
59755
59774
|
return this;
|
|
59756
59775
|
}
|
|
59757
59776
|
let instanceCounter = 0;
|
|
59758
|
-
const result = new
|
|
59777
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(true);
|
|
59759
59778
|
for (const token of this.getPathParts()) {
|
|
59760
59779
|
if (PathTokens.isMultiToken(token) && instanceCounter < instances.length) {
|
|
59761
59780
|
var _instances$instanceCo;
|
|
@@ -60425,6 +60444,33 @@ function isMatchAbbreviation(abbreviation, value) {
|
|
|
60425
60444
|
|
|
60426
60445
|
/***/ }),
|
|
60427
60446
|
|
|
60447
|
+
/***/ "./Engine/src/Engine/Core/CoreTypes.ts":
|
|
60448
|
+
/*!*********************************************!*\
|
|
60449
|
+
!*** ./Engine/src/Engine/Core/CoreTypes.ts ***!
|
|
60450
|
+
\*********************************************/
|
|
60451
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60452
|
+
|
|
60453
|
+
"use strict";
|
|
60454
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60455
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
60456
|
+
/* harmony export */ "nonRegularFieldName": () => (/* binding */ nonRegularFieldName),
|
|
60457
|
+
/* harmony export */ "getKnownViewModelFieldNames": () => (/* binding */ getKnownViewModelFieldNames)
|
|
60458
|
+
/* harmony export */ });
|
|
60459
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60460
|
+
|
|
60461
|
+
// Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
|
|
60462
|
+
|
|
60463
|
+
function nonRegularFieldName(fieldName) {
|
|
60464
|
+
// @ts-ignore
|
|
60465
|
+
return fieldName;
|
|
60466
|
+
}
|
|
60467
|
+
function getKnownViewModelFieldNames() {
|
|
60468
|
+
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"];
|
|
60469
|
+
return names;
|
|
60470
|
+
}
|
|
60471
|
+
|
|
60472
|
+
/***/ }),
|
|
60473
|
+
|
|
60428
60474
|
/***/ "./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts":
|
|
60429
60475
|
/*!*******************************************************************!*\
|
|
60430
60476
|
!*** ./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts ***!
|
|
@@ -79613,7 +79659,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79613
79659
|
|
|
79614
79660
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
79615
79661
|
try {
|
|
79616
|
-
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$
|
|
79662
|
+
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;
|
|
79617
79663
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
79618
79664
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
79619
79665
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
|
|
@@ -79622,7 +79668,9 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79622
79668
|
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
79623
79669
|
const formulasFromSugar = extractFormulasFromSugarKCLang(sugarRoot);
|
|
79624
79670
|
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]);
|
|
79625
|
-
const
|
|
79671
|
+
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;
|
|
79672
|
+
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));
|
|
79673
|
+
const useOldCalculator = !useCalculator2 && !useServerCalculations;
|
|
79626
79674
|
const kcXmlConditions = (_Iterator$from$map$fl = Iterator.from(getImportedKcXmlValidations(sugarRoot, additionalContent)).map(x => {
|
|
79627
79675
|
var _container$conditions, _container$conditions2;
|
|
79628
79676
|
const container = formulaReader.readFormulas(x);
|
|
@@ -79651,7 +79699,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79651
79699
|
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter);
|
|
79652
79700
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
79653
79701
|
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
79654
|
-
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);
|
|
79702
|
+
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);
|
|
79655
79703
|
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);
|
|
79656
79704
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
79657
79705
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
@@ -79664,18 +79712,18 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79664
79712
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
79665
79713
|
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
79666
79714
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
79667
|
-
const formulasForCalculator =
|
|
79715
|
+
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
79668
79716
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
79669
79717
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
79670
|
-
if ((_additionalContent$
|
|
79671
|
-
var _additionalContent$
|
|
79718
|
+
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) {
|
|
79719
|
+
var _additionalContent$fo7, _additionalContent$fo8;
|
|
79672
79720
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
79673
79721
|
const customNormalizers = [{
|
|
79674
79722
|
normalizerId: "formulas",
|
|
79675
|
-
content: (_additionalContent$
|
|
79723
|
+
content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
79676
79724
|
}, {
|
|
79677
79725
|
normalizerId: "formulasWithInitializers",
|
|
79678
|
-
content: (_additionalContent$
|
|
79726
|
+
content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
79679
79727
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
79680
79728
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
79681
79729
|
switch (additionalNormalizer.extension) {
|
|
@@ -79713,7 +79761,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79713
79761
|
const kcXmlAutoCalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_Calculator2_AutoCalculationsCalculator2Generator__WEBPACK_IMPORTED_MODULE_28__.AutoCalculationsCalculator2Generator(formSchemaRng, dataDeclarationHelper);
|
|
79714
79762
|
builder.addResource("kcXmlAutoCalculationConfigurator.js", kcXmlAutoCalcGenerator.generate(formulasForCalculator2));
|
|
79715
79763
|
const kcXmlValidationGenerator = new _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_23__.KCXmlValidationGenerator(formSchemaRng);
|
|
79716
|
-
|
|
79764
|
+
const kcXmlConditionsForCalculator2 = !useServerCalculations ? kcXmlConditions : [];
|
|
79765
|
+
builder.addResource("kcXmlValidationConfigurator.js", kcXmlValidationGenerator.generate(kcXmlConditionsForCalculator2));
|
|
79717
79766
|
// const importedAutoCalculations = getImportedAutoCalculations(sugarRoot);
|
|
79718
79767
|
builder.addResource("autocalculationConfigurators.js", `export default []`);
|
|
79719
79768
|
builder.addResource("FakeStyles.less", `// empty styles to enforce style files`);
|
|
@@ -80182,8 +80231,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80182
80231
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
80183
80232
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
80184
80233
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80185
|
-
/* harmony import */ var
|
|
80186
|
-
/* harmony import */ var
|
|
80234
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80235
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80236
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80237
|
+
|
|
80187
80238
|
|
|
80188
80239
|
|
|
80189
80240
|
|
|
@@ -80227,11 +80278,11 @@ class CustomKCLangToFlangRuleGenerator {
|
|
|
80227
80278
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
80228
80279
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
80229
80280
|
const result = [];
|
|
80230
|
-
const getFormulaExpression = field => new
|
|
80281
|
+
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));
|
|
80231
80282
|
if (isTargetAutoField) {
|
|
80232
|
-
result.push(new
|
|
80283
|
+
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)));
|
|
80233
80284
|
} else {
|
|
80234
|
-
result.push(new
|
|
80285
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
80235
80286
|
}
|
|
80236
80287
|
result.push(...precalculationRules);
|
|
80237
80288
|
return result;
|
|
@@ -80265,8 +80316,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80265
80316
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
80266
80317
|
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
80267
80318
|
/* harmony import */ var _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/SchemaRng/StringTypeMessageGenerator */ "./Generator/src/common/SchemaRng/StringTypeMessageGenerator.ts");
|
|
80268
|
-
/* harmony import */ var
|
|
80269
|
-
/* harmony import */ var
|
|
80319
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
80320
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
80321
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
80270
80322
|
|
|
80271
80323
|
|
|
80272
80324
|
|
|
@@ -80280,7 +80332,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80280
80332
|
|
|
80281
80333
|
|
|
80282
80334
|
|
|
80283
|
-
|
|
80335
|
+
|
|
80336
|
+
const makeArrayLiteral = text => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(`["${text}"]`);
|
|
80284
80337
|
const makeMessage = (constraints, sugarTypeDescription, schemaTypeDescription) => {
|
|
80285
80338
|
var _ref, _ref2;
|
|
80286
80339
|
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 : "Поле должно быть заполнено");
|
|
@@ -80315,7 +80368,7 @@ class FLangValidationBuildContext {
|
|
|
80315
80368
|
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
80316
80369
|
var _typeNode$base, _typeNode$description;
|
|
80317
80370
|
const validations = [];
|
|
80318
|
-
const valueReference = new
|
|
80371
|
+
const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
|
|
80319
80372
|
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;
|
|
80320
80373
|
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;
|
|
80321
80374
|
if (baseName != undefined) {
|
|
@@ -80335,12 +80388,12 @@ class FLangValidationBuildContext {
|
|
|
80335
80388
|
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
80336
80389
|
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
80337
80390
|
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;
|
|
80338
|
-
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new
|
|
80391
|
+
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);
|
|
80339
80392
|
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
80340
80393
|
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);
|
|
80341
80394
|
const result = [];
|
|
80342
80395
|
result.push({
|
|
80343
|
-
statement: new
|
|
80396
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "error"), errorExpression),
|
|
80344
80397
|
checkType: "error"
|
|
80345
80398
|
});
|
|
80346
80399
|
const warningValidations = validations.filter(x => x.checkType === "warning");
|
|
@@ -80349,7 +80402,7 @@ class FLangValidationBuildContext {
|
|
|
80349
80402
|
}
|
|
80350
80403
|
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);
|
|
80351
80404
|
result.push({
|
|
80352
|
-
statement: new
|
|
80405
|
+
statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(targetPath, "warning"), warningExpression),
|
|
80353
80406
|
checkType: "warning"
|
|
80354
80407
|
});
|
|
80355
80408
|
return result;
|
|
@@ -80358,30 +80411,30 @@ class FLangValidationBuildContext {
|
|
|
80358
80411
|
let expression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.IterUtils.reduce(validations, (result, {
|
|
80359
80412
|
condition,
|
|
80360
80413
|
message
|
|
80361
|
-
}) => new
|
|
80414
|
+
}) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(condition, message, result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
|
|
80362
80415
|
if (!optional) {
|
|
80363
80416
|
if (parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement) {
|
|
80364
|
-
const requiredExpression = new
|
|
80365
|
-
const targetCheck = new
|
|
80417
|
+
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);
|
|
80418
|
+
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("")));
|
|
80366
80419
|
if (restChecks != undefined) {
|
|
80367
|
-
const finalChildrenCondition = new
|
|
80368
|
-
expression = new
|
|
80420
|
+
const finalChildrenCondition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AndBinaryExpression(targetCheck, restChecks);
|
|
80421
|
+
expression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(finalChildrenCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression(), requiredExpression);
|
|
80369
80422
|
} else {
|
|
80370
80423
|
expression = requiredExpression;
|
|
80371
80424
|
}
|
|
80372
80425
|
} else {
|
|
80373
|
-
expression = new
|
|
80426
|
+
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);
|
|
80374
80427
|
}
|
|
80375
80428
|
} else {
|
|
80376
|
-
expression = new
|
|
80429
|
+
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);
|
|
80377
80430
|
}
|
|
80378
80431
|
const visibilityFlangCondition = this.visibilityConditions.map(x => {
|
|
80379
|
-
const target = new
|
|
80432
|
+
const target = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_11__.AbsoluteModelFieldPath(targetPath, checkType);
|
|
80380
80433
|
const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(x.path.getPathPartsAsArray().filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken));
|
|
80381
80434
|
const flangExpr = this.getFlangExpressionFromKCLangCondition(prefix, target, x.condition, x.invertRequired);
|
|
80382
80435
|
return flangExpr;
|
|
80383
|
-
}).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined).reduce((acc, current) => acc != undefined ? new
|
|
80384
|
-
return visibilityFlangCondition != undefined ? new
|
|
80436
|
+
}).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);
|
|
80437
|
+
return visibilityFlangCondition != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(visibilityFlangCondition, expression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression()) : expression;
|
|
80385
80438
|
}
|
|
80386
80439
|
getFlangExpressionFromKCLangCondition(prefix, target, condition, invertRequired) {
|
|
80387
80440
|
const fullKcLangExpr = `
|
|
@@ -80397,13 +80450,13 @@ class FLangValidationBuildContext {
|
|
|
80397
80450
|
const formulaExpr = this.formulaExprConverter.compileExpressionToFlangExpression(formulaNode.expression, prefix, target, value => {
|
|
80398
80451
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotSupportedError("In contextual KcLang conditions should not be summation.");
|
|
80399
80452
|
});
|
|
80400
|
-
const flangExpr = formulaExpr instanceof
|
|
80453
|
+
const flangExpr = formulaExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression ? formulaExpr.condition : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
|
|
80401
80454
|
const getTypeCorrectedExpression = () => {
|
|
80402
|
-
const argExpr = (0,
|
|
80403
|
-
return new
|
|
80455
|
+
const argExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.castOperandToStringIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_12__.tryExtractValueReferenceAsStringFromDecimal)(flangExpr));
|
|
80456
|
+
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("")));
|
|
80404
80457
|
};
|
|
80405
|
-
const correctedFLangExpr = flangExpr.getType() ===
|
|
80406
|
-
return invertRequired ? new
|
|
80458
|
+
const correctedFLangExpr = flangExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.bool ? flangExpr : getTypeCorrectedExpression();
|
|
80459
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(correctedFLangExpr) : correctedFLangExpr;
|
|
80407
80460
|
} catch (e) {
|
|
80408
80461
|
try {
|
|
80409
80462
|
var _match$, _match$2, _match$3;
|
|
@@ -80414,26 +80467,26 @@ class FLangValidationBuildContext {
|
|
|
80414
80467
|
const value = match === null || match === void 0 ? void 0 : (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
|
|
80415
80468
|
if (path != undefined && sign != undefined && value != undefined) {
|
|
80416
80469
|
const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
|
|
80417
|
-
const valueRef = new
|
|
80418
|
-
const len = new
|
|
80419
|
-
const argument = new
|
|
80470
|
+
const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(fullPath, "children");
|
|
80471
|
+
const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LenExpression(valueRef);
|
|
80472
|
+
const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(value);
|
|
80420
80473
|
const getOperation = () => {
|
|
80421
80474
|
switch (sign) {
|
|
80422
80475
|
case ">":
|
|
80423
|
-
return new
|
|
80476
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.GtExpression(len, argument);
|
|
80424
80477
|
case "<":
|
|
80425
|
-
return new
|
|
80478
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.LtExpression(len, argument);
|
|
80426
80479
|
case "==":
|
|
80427
80480
|
case "===":
|
|
80428
|
-
return new
|
|
80481
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.EqExpression(len, argument);
|
|
80429
80482
|
case "!=":
|
|
80430
80483
|
case "!==":
|
|
80431
|
-
return new
|
|
80484
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(len, argument);
|
|
80432
80485
|
default:
|
|
80433
80486
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotImplementedError();
|
|
80434
80487
|
}
|
|
80435
80488
|
};
|
|
80436
|
-
return invertRequired ? new
|
|
80489
|
+
return invertRequired ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(getOperation()) : getOperation();
|
|
80437
80490
|
}
|
|
80438
80491
|
} catch {
|
|
80439
80492
|
// eslint-disable-next-line no-console
|
|
@@ -80450,9 +80503,9 @@ class FLangValidationBuildContext {
|
|
|
80450
80503
|
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 : [];
|
|
80451
80504
|
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 : [];
|
|
80452
80505
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayIsNotEmpty)(enumerationItems)) {
|
|
80453
|
-
const enumerationRuleBody = new
|
|
80506
|
+
const enumerationRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OneOfExpression(valueReference, enumerationItems.map(item => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression(item)));
|
|
80454
80507
|
yield {
|
|
80455
|
-
condition: new
|
|
80508
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(enumerationRuleBody),
|
|
80456
80509
|
message: makeMessage({
|
|
80457
80510
|
enumerationAllowedValues: enumerationItems
|
|
80458
80511
|
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description),
|
|
@@ -80463,9 +80516,9 @@ class FLangValidationBuildContext {
|
|
|
80463
80516
|
const gId = (_digest$gId = digest === null || digest === void 0 ? void 0 : digest.gId) !== null && _digest$gId !== void 0 ? _digest$gId : nodeGId;
|
|
80464
80517
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrEmpty)(gId) && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.arrayHasLength)(enumerationItems, 0)) {
|
|
80465
80518
|
var _ref3, _digest$description, _ref4, _digest$checkType;
|
|
80466
|
-
const ruleBody = new
|
|
80519
|
+
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]`));
|
|
80467
80520
|
yield {
|
|
80468
|
-
condition: new
|
|
80521
|
+
condition: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(ruleBody),
|
|
80469
80522
|
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 : "Поле заполнено не по справочнику"),
|
|
80470
80523
|
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"
|
|
80471
80524
|
};
|
|
@@ -80473,7 +80526,7 @@ class FLangValidationBuildContext {
|
|
|
80473
80526
|
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));
|
|
80474
80527
|
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;
|
|
80475
80528
|
if (lengthValue != undefined) {
|
|
80476
|
-
const lengthExprRuleBody = new
|
|
80529
|
+
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)));
|
|
80477
80530
|
yield {
|
|
80478
80531
|
condition: lengthExprRuleBody,
|
|
80479
80532
|
message: makeMessage({
|
|
@@ -80487,7 +80540,7 @@ class FLangValidationBuildContext {
|
|
|
80487
80540
|
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));
|
|
80488
80541
|
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;
|
|
80489
80542
|
if (minLengthValue != undefined && maxLengthValue != undefined) {
|
|
80490
|
-
const lengthExprRuleBody = new
|
|
80543
|
+
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))));
|
|
80491
80544
|
yield {
|
|
80492
80545
|
condition: lengthExprRuleBody,
|
|
80493
80546
|
message: makeMessage({
|
|
@@ -80497,7 +80550,7 @@ class FLangValidationBuildContext {
|
|
|
80497
80550
|
checkType: checkType
|
|
80498
80551
|
};
|
|
80499
80552
|
} else if (minLengthValue != undefined) {
|
|
80500
|
-
const lengthExprRuleBody = new
|
|
80553
|
+
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)));
|
|
80501
80554
|
yield {
|
|
80502
80555
|
condition: lengthExprRuleBody,
|
|
80503
80556
|
message: makeMessage({
|
|
@@ -80506,7 +80559,7 @@ class FLangValidationBuildContext {
|
|
|
80506
80559
|
checkType: checkType
|
|
80507
80560
|
};
|
|
80508
80561
|
} else if (maxLengthValue != undefined) {
|
|
80509
|
-
const lengthExprRuleBody = new
|
|
80562
|
+
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)));
|
|
80510
80563
|
yield {
|
|
80511
80564
|
condition: lengthExprRuleBody,
|
|
80512
80565
|
message: makeMessage({
|
|
@@ -80518,7 +80571,7 @@ class FLangValidationBuildContext {
|
|
|
80518
80571
|
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));
|
|
80519
80572
|
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;
|
|
80520
80573
|
if (minInclusiveValue != undefined) {
|
|
80521
|
-
const minInclusiveRuleBody = new
|
|
80574
|
+
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)));
|
|
80522
80575
|
yield {
|
|
80523
80576
|
condition: minInclusiveRuleBody,
|
|
80524
80577
|
message: makeMessage({
|
|
@@ -80530,7 +80583,7 @@ class FLangValidationBuildContext {
|
|
|
80530
80583
|
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));
|
|
80531
80584
|
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;
|
|
80532
80585
|
if (maxInclusiveValue != undefined) {
|
|
80533
|
-
const maxInclusiveRuleBody = new
|
|
80586
|
+
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)));
|
|
80534
80587
|
yield {
|
|
80535
80588
|
condition: maxInclusiveRuleBody,
|
|
80536
80589
|
message: makeMessage({
|
|
@@ -80542,7 +80595,7 @@ class FLangValidationBuildContext {
|
|
|
80542
80595
|
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));
|
|
80543
80596
|
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;
|
|
80544
80597
|
if (totalDigitsValue != undefined) {
|
|
80545
|
-
const totalDigitsRuleBody = new
|
|
80598
|
+
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)));
|
|
80546
80599
|
yield {
|
|
80547
80600
|
condition: totalDigitsRuleBody,
|
|
80548
80601
|
message: makeMessage({
|
|
@@ -80553,9 +80606,9 @@ class FLangValidationBuildContext {
|
|
|
80553
80606
|
}
|
|
80554
80607
|
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 : [];
|
|
80555
80608
|
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);
|
|
80556
|
-
const patterns = stringPatterns.map(pattern => new
|
|
80609
|
+
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);
|
|
80557
80610
|
if (patterns != undefined) {
|
|
80558
|
-
const totalDigitsRuleBody = new
|
|
80611
|
+
const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(patterns);
|
|
80559
80612
|
yield {
|
|
80560
80613
|
condition: totalDigitsRuleBody,
|
|
80561
80614
|
message: makeMessage({
|
|
@@ -80567,7 +80620,7 @@ class FLangValidationBuildContext {
|
|
|
80567
80620
|
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));
|
|
80568
80621
|
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;
|
|
80569
80622
|
if (integerDigits != undefined) {
|
|
80570
|
-
const integerDigitsRuleBody = new
|
|
80623
|
+
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)));
|
|
80571
80624
|
yield {
|
|
80572
80625
|
condition: integerDigitsRuleBody,
|
|
80573
80626
|
message: makeMessage({
|
|
@@ -80579,7 +80632,7 @@ class FLangValidationBuildContext {
|
|
|
80579
80632
|
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));
|
|
80580
80633
|
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;
|
|
80581
80634
|
if (fractionalDigits != undefined) {
|
|
80582
|
-
const fractionalDigitsRuleBody = new
|
|
80635
|
+
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)));
|
|
80583
80636
|
yield {
|
|
80584
80637
|
condition: fractionalDigitsRuleBody,
|
|
80585
80638
|
message: makeMessage({
|
|
@@ -80598,35 +80651,35 @@ class FLangValidationBuildContext {
|
|
|
80598
80651
|
case "integer":
|
|
80599
80652
|
{
|
|
80600
80653
|
return {
|
|
80601
|
-
condition: new
|
|
80654
|
+
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+$"))),
|
|
80602
80655
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80603
80656
|
};
|
|
80604
80657
|
}
|
|
80605
80658
|
case "decimal":
|
|
80606
80659
|
{
|
|
80607
80660
|
return {
|
|
80608
|
-
condition: new
|
|
80661
|
+
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+$)|($))"))),
|
|
80609
80662
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80610
80663
|
};
|
|
80611
80664
|
}
|
|
80612
80665
|
case "date":
|
|
80613
80666
|
{
|
|
80614
80667
|
return {
|
|
80615
|
-
condition: new
|
|
80668
|
+
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}$"))),
|
|
80616
80669
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80617
80670
|
};
|
|
80618
80671
|
}
|
|
80619
80672
|
case "gYear":
|
|
80620
80673
|
{
|
|
80621
80674
|
return {
|
|
80622
|
-
condition: new
|
|
80675
|
+
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}$"))),
|
|
80623
80676
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80624
80677
|
};
|
|
80625
80678
|
}
|
|
80626
80679
|
case "gMonth":
|
|
80627
80680
|
{
|
|
80628
80681
|
return {
|
|
80629
|
-
condition: new
|
|
80682
|
+
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]))$"))),
|
|
80630
80683
|
message: makeArrayLiteral(baseDescription !== null && baseDescription !== void 0 ? baseDescription : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_10__.StringTypeMessageGenerator.getBaseTypeMessage(baseType))
|
|
80631
80684
|
};
|
|
80632
80685
|
}
|
|
@@ -80752,6 +80805,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80752
80805
|
/* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
|
|
80753
80806
|
/* harmony export */ "TrimExpression": () => (/* binding */ TrimExpression),
|
|
80754
80807
|
/* harmony export */ "PrepareNumberExpression": () => (/* binding */ PrepareNumberExpression),
|
|
80808
|
+
/* harmony export */ "IncrementalFlagExpression": () => (/* binding */ IncrementalFlagExpression),
|
|
80809
|
+
/* harmony export */ "GetOldExpression": () => (/* binding */ GetOldExpression),
|
|
80755
80810
|
/* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
|
|
80756
80811
|
/* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
|
|
80757
80812
|
/* harmony export */ });
|
|
@@ -81859,6 +81914,33 @@ class PrepareNumberExpression extends FLangExpression {
|
|
|
81859
81914
|
return `prepareNumber(${this.expression.convertToString()})`;
|
|
81860
81915
|
}
|
|
81861
81916
|
}
|
|
81917
|
+
class IncrementalFlagExpression extends FLangExpression {
|
|
81918
|
+
getChildNodes() {
|
|
81919
|
+
return [];
|
|
81920
|
+
}
|
|
81921
|
+
getType() {
|
|
81922
|
+
return BuildInTypeExpression.bool;
|
|
81923
|
+
}
|
|
81924
|
+
convertToString() {
|
|
81925
|
+
return `incremental`;
|
|
81926
|
+
}
|
|
81927
|
+
}
|
|
81928
|
+
class GetOldExpression extends FLangExpression {
|
|
81929
|
+
constructor(expression) {
|
|
81930
|
+
super();
|
|
81931
|
+
this.expression = void 0;
|
|
81932
|
+
this.expression = expression;
|
|
81933
|
+
}
|
|
81934
|
+
getChildNodes() {
|
|
81935
|
+
return [];
|
|
81936
|
+
}
|
|
81937
|
+
getType() {
|
|
81938
|
+
return BuildInTypeExpression.bool;
|
|
81939
|
+
}
|
|
81940
|
+
convertToString() {
|
|
81941
|
+
return `old(${this.expression.convertToString()})`;
|
|
81942
|
+
}
|
|
81943
|
+
}
|
|
81862
81944
|
class FLangStatement extends FLangNode {}
|
|
81863
81945
|
class SetStatement extends FLangStatement {
|
|
81864
81946
|
constructor(left, right) {
|
|
@@ -82498,9 +82580,9 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82498
82580
|
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");
|
|
82499
82581
|
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");
|
|
82500
82582
|
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");
|
|
82501
|
-
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()));
|
|
82583
|
+
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())));
|
|
82502
82584
|
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(""))));
|
|
82503
|
-
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));
|
|
82585
|
+
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)));
|
|
82504
82586
|
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"))));
|
|
82505
82587
|
resultValueExpression = currentSumExpression;
|
|
82506
82588
|
countValueExpression = currenCountExpression;
|
|
@@ -82591,8 +82673,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82591
82673
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
82592
82674
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82593
82675
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82594
|
-
/* harmony import */ var
|
|
82595
|
-
/* harmony import */ var
|
|
82676
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
82677
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
82678
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
82679
|
+
|
|
82596
82680
|
|
|
82597
82681
|
|
|
82598
82682
|
|
|
@@ -82613,7 +82697,7 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82613
82697
|
}
|
|
82614
82698
|
generateRules() {
|
|
82615
82699
|
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(this.buildFormulaFLangRules(), this.optionalSectionRuleBuilder.buildRules());
|
|
82616
|
-
return (0,
|
|
82700
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRuleBuilder);
|
|
82617
82701
|
}
|
|
82618
82702
|
*buildFormulaFLangRules() {
|
|
82619
82703
|
for (const formula of (_this$formulas = this.formulas) !== null && _this$formulas !== void 0 ? _this$formulas : []) {
|
|
@@ -82629,11 +82713,11 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
82629
82713
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
82630
82714
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82631
82715
|
const result = [];
|
|
82632
|
-
const getFormulaExpression = field => new
|
|
82716
|
+
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));
|
|
82633
82717
|
if (isTargetAutoField) {
|
|
82634
|
-
result.push(new
|
|
82718
|
+
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)));
|
|
82635
82719
|
} else {
|
|
82636
|
-
result.push(new
|
|
82720
|
+
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
82637
82721
|
}
|
|
82638
82722
|
result.push(...precalculationRules);
|
|
82639
82723
|
return result;
|
|
@@ -82757,6 +82841,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82757
82841
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
82758
82842
|
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
82759
82843
|
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
82844
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
82845
|
+
|
|
82760
82846
|
|
|
82761
82847
|
|
|
82762
82848
|
|
|
@@ -82786,12 +82872,14 @@ class FormulaRulesBuilder {
|
|
|
82786
82872
|
const precalculationRules = [];
|
|
82787
82873
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
82788
82874
|
const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
|
|
82789
|
-
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
|
|
82875
|
+
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));
|
|
82790
82876
|
const result = [];
|
|
82791
82877
|
if (isTargetAutoField) {
|
|
82792
|
-
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)));
|
|
82878
|
+
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")))));
|
|
82793
82879
|
if (isDisabled) {
|
|
82794
82880
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
82881
|
+
} else {
|
|
82882
|
+
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)))));
|
|
82795
82883
|
}
|
|
82796
82884
|
} else {
|
|
82797
82885
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
@@ -83012,15 +83100,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83012
83100
|
|
|
83013
83101
|
|
|
83014
83102
|
class SugarRulesBuilder {
|
|
83015
|
-
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, typeRegistry, useSchemaValidations) {
|
|
83103
|
+
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations) {
|
|
83016
83104
|
this.sugarRoot = void 0;
|
|
83017
83105
|
this.controlCustomizationContext = void 0;
|
|
83018
83106
|
this.fetchFunctions = void 0;
|
|
83019
83107
|
this.formSchemaRng = void 0;
|
|
83108
|
+
this.dataDeclarationHelper = void 0;
|
|
83020
83109
|
this.useSchemaValidations = void 0;
|
|
83021
83110
|
this.typeRegistry = void 0;
|
|
83022
83111
|
this.useSchemaValidations = useSchemaValidations;
|
|
83023
83112
|
this.typeRegistry = typeRegistry;
|
|
83113
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
83024
83114
|
this.formSchemaRng = formSchemaRng;
|
|
83025
83115
|
this.fetchFunctions = fetchFunctions;
|
|
83026
83116
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -83028,7 +83118,7 @@ class SugarRulesBuilder {
|
|
|
83028
83118
|
}
|
|
83029
83119
|
buildRules() {
|
|
83030
83120
|
const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_0__.FormConverter(this.sugarRoot);
|
|
83031
|
-
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));
|
|
83121
|
+
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));
|
|
83032
83122
|
return converter.buildNormalizeRules(builder, this.formSchemaRng);
|
|
83033
83123
|
}
|
|
83034
83124
|
}
|
|
@@ -83053,9 +83143,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83053
83143
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
83054
83144
|
/* harmony import */ var _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Common/ModelPath/Map/AbsoluteModelPathMap */ "./Common/ModelPath/Map/AbsoluteModelPathMap.ts");
|
|
83055
83145
|
/* harmony import */ var _Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Common/ModelPath/EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
83056
|
-
/* harmony import */ var
|
|
83057
|
-
/* harmony import */ var
|
|
83146
|
+
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
83147
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83058
83148
|
/* harmony import */ var _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../NodeTypeInfoHelper */ "./Generator/src/generators/ServerSideFLangNormalization/NodeTypeInfoHelper.ts");
|
|
83149
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
83150
|
+
|
|
83059
83151
|
|
|
83060
83152
|
|
|
83061
83153
|
|
|
@@ -83093,7 +83185,7 @@ class ValidationRulesBuilder {
|
|
|
83093
83185
|
const precalculationRules = [];
|
|
83094
83186
|
return {
|
|
83095
83187
|
target: fullTarget,
|
|
83096
|
-
checkExpression: this.formulaExprConverter.compileExpressionToFlangExpression(condition.expression, prefix, new
|
|
83188
|
+
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)),
|
|
83097
83189
|
message: condition.description,
|
|
83098
83190
|
errorLevel: condition.errorLevel,
|
|
83099
83191
|
precalculationRules: precalculationRules
|
|
@@ -83156,51 +83248,59 @@ class ValidationRulesBuilder {
|
|
|
83156
83248
|
const tokens = modelPath.getPathPartsAsArray();
|
|
83157
83249
|
for (let i = 0; i < tokens.length; i++) {
|
|
83158
83250
|
const currentModelPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(tokens.slice(0, i));
|
|
83159
|
-
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath)) {
|
|
83251
|
+
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath) || i == 1) {
|
|
83160
83252
|
yield currentModelPath;
|
|
83161
83253
|
}
|
|
83162
83254
|
}
|
|
83163
83255
|
}
|
|
83164
|
-
|
|
83165
|
-
const
|
|
83166
|
-
const
|
|
83167
|
-
|
|
83168
|
-
|
|
83169
|
-
|
|
83170
|
-
|
|
83171
|
-
|
|
83172
|
-
|
|
83173
|
-
|
|
83174
|
-
|
|
83175
|
-
|
|
83176
|
-
|
|
83177
|
-
|
|
83178
|
-
|
|
83179
|
-
|
|
83180
|
-
|
|
83181
|
-
|
|
83182
|
-
|
|
83183
|
-
|
|
83184
|
-
|
|
83185
|
-
|
|
83186
|
-
|
|
83187
|
-
|
|
83188
|
-
|
|
83189
|
-
|
|
83190
|
-
|
|
83191
|
-
|
|
83192
|
-
|
|
83193
|
-
|
|
83194
|
-
|
|
83195
|
-
|
|
83196
|
-
const allRules = Iterator.from(totalErrorCountExpressions.values()).reduce((result, expression) => result === zeroExpression ? expression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(result, expression), zeroExpression);
|
|
83197
|
-
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")));
|
|
83256
|
+
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83257
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83258
|
+
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)));
|
|
83259
|
+
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")));
|
|
83260
|
+
}
|
|
83261
|
+
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83262
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83263
|
+
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")));
|
|
83264
|
+
}
|
|
83265
|
+
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
83266
|
+
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);
|
|
83267
|
+
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));
|
|
83268
|
+
}
|
|
83269
|
+
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
83270
|
+
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));
|
|
83271
|
+
}
|
|
83272
|
+
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
83273
|
+
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) => {
|
|
83274
|
+
const nextResultCountExpression = oldValues => this.getReadErrorCountValueExpression(iterationPath, countFieldName, oldValues);
|
|
83275
|
+
const info = {
|
|
83276
|
+
target: iterationPath,
|
|
83277
|
+
getExpressionFunc: result.resultCountExpression
|
|
83278
|
+
};
|
|
83279
|
+
return {
|
|
83280
|
+
resultCountExpression: nextResultCountExpression,
|
|
83281
|
+
items: result.items.concat(info)
|
|
83282
|
+
};
|
|
83283
|
+
}, {
|
|
83284
|
+
resultCountExpression: oldValues => this.getErrorWarningCountExpression(path.toCurrentIteration(), fieldName, oldValues),
|
|
83285
|
+
items: []
|
|
83286
|
+
});
|
|
83287
|
+
return reduceResult.items;
|
|
83198
83288
|
}
|
|
83199
|
-
|
|
83200
|
-
|
|
83289
|
+
buildErrorWarningCountRules(allPathsWithValidations, fieldName) {
|
|
83290
|
+
const countFieldName = `${fieldName}sCount`;
|
|
83291
|
+
const errorCountByTarget = Iterator.from(allPathsWithValidations).flatMap(path => this.buildChainOfErrorCountRules(path, countFieldName, fieldName)).reduce((result, current) => {
|
|
83292
|
+
result.getOrSet(current.target, () => []).push(current.getExpressionFunc);
|
|
83293
|
+
return result;
|
|
83294
|
+
}, new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__.EachCurrentCollision.AreDifferent));
|
|
83295
|
+
const rules = Iterator.from(errorCountByTarget.entries()).map(([iterable, getExpressionFunctions]) => {
|
|
83296
|
+
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());
|
|
83297
|
+
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);
|
|
83298
|
+
return isTargetRequiredReduce ? this.buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) : this.buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression);
|
|
83299
|
+
});
|
|
83300
|
+
return rules;
|
|
83201
83301
|
}
|
|
83202
83302
|
adjustPathMultiplicity(path) {
|
|
83203
|
-
return (0,
|
|
83303
|
+
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
83204
83304
|
}
|
|
83205
83305
|
}
|
|
83206
83306
|
|
|
@@ -106959,12 +107059,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106959
107059
|
|
|
106960
107060
|
|
|
106961
107061
|
class FLangNormalizationRulesBuilder {
|
|
106962
|
-
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, schemaRng, nodeTypeInfoHelper) {
|
|
107062
|
+
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, dataDeclarationHelper, schemaRng, nodeTypeInfoHelper) {
|
|
106963
107063
|
this.controlCustomizationContext = void 0;
|
|
106964
107064
|
this.fetchFunctions = void 0;
|
|
106965
107065
|
this.schemaRng = void 0;
|
|
106966
107066
|
this.nodeTypeInfoHelper = void 0;
|
|
106967
107067
|
this.fetchFuncToFlangConverter = void 0;
|
|
107068
|
+
this.dataDeclarationHelper = void 0;
|
|
107069
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
106968
107070
|
this.nodeTypeInfoHelper = nodeTypeInfoHelper;
|
|
106969
107071
|
this.schemaRng = schemaRng;
|
|
106970
107072
|
this.fetchFuncToFlangConverter = fetchFuncToFlangConverter;
|
|
@@ -107006,7 +107108,8 @@ class FLangNormalizationRulesBuilder {
|
|
|
107006
107108
|
if (!disabled && !dataBinding.settings) {
|
|
107007
107109
|
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);
|
|
107008
107110
|
}
|
|
107009
|
-
|
|
107111
|
+
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;
|
|
107112
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
107010
107113
|
}
|
|
107011
107114
|
*specialFieldsInitializer(node, options) {
|
|
107012
107115
|
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)());
|
|
@@ -109834,7 +109937,8 @@ function getSettings(sugarRoot, gfv, additionalSettings, formJsonSettings) {
|
|
|
109834
109937
|
isReadOnly: (_sugarRoot$isReadOnly = sugarRoot.isReadOnly) !== null && _sugarRoot$isReadOnly !== void 0 ? _sugarRoot$isReadOnly : false,
|
|
109835
109938
|
gfv: gfv,
|
|
109836
109939
|
...additionalSettings,
|
|
109837
|
-
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization
|
|
109940
|
+
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization,
|
|
109941
|
+
useServerSideCalculations: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideCalculations
|
|
109838
109942
|
};
|
|
109839
109943
|
return `module.exports = ${JSON.stringify(settings, undefined, 2)}`;
|
|
109840
109944
|
}
|