@kontur.candy/generator 5.12.1 → 5.12.2-server-side-calculations.11
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 +189 -98
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -59315,12 +59315,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
59315
59315
|
/* harmony export */ "AbsoluteModelFieldPath": () => (/* binding */ AbsoluteModelFieldPath),
|
|
59316
59316
|
/* harmony export */ "ModelPathImpl": () => (/* binding */ ModelPathImpl)
|
|
59317
59317
|
/* harmony export */ });
|
|
59318
|
-
/* harmony import */ var
|
|
59319
|
-
/* harmony import */ var
|
|
59320
|
-
/* harmony import */ var
|
|
59321
|
-
/* harmony import */ var
|
|
59322
|
-
/* harmony import */ var
|
|
59323
|
-
/* harmony import */ var
|
|
59318
|
+
/* harmony import */ var _Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Engine/src/Engine/Core/CoreTypes */ "./Engine/src/Engine/Core/CoreTypes.ts");
|
|
59319
|
+
/* harmony import */ var _IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../IterableUtils */ "./Common/IterableUtils.ts");
|
|
59320
|
+
/* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
|
|
59321
|
+
/* harmony import */ var _hashUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hashUtils */ "./Common/hashUtils.ts");
|
|
59322
|
+
/* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
|
|
59323
|
+
/* harmony import */ var _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ModelPathBuilder */ "./Common/ModelPath/ModelPathBuilder.ts");
|
|
59324
|
+
/* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
|
|
59325
|
+
|
|
59324
59326
|
|
|
59325
59327
|
|
|
59326
59328
|
|
|
@@ -59450,39 +59452,45 @@ class AbsoluteModelFieldPath {
|
|
|
59450
59452
|
this.field = fieldName;
|
|
59451
59453
|
}
|
|
59452
59454
|
getHash() {
|
|
59453
|
-
return this.path.getHash() + (0,
|
|
59455
|
+
return this.path.getHash() + (0,_hashUtils__WEBPACK_IMPORTED_MODULE_3__.getSimpleHashByString)(this.field);
|
|
59454
59456
|
}
|
|
59455
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59457
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59456
59458
|
return this.path.isEquals(modelPath.path, eachCurrentCollision) && this.field === modelPath.field;
|
|
59457
59459
|
}
|
|
59458
59460
|
static createFromString(pathWithFieldName) {
|
|
59461
|
+
var _match$, _ref;
|
|
59459
59462
|
if (pathWithFieldName.endsWith(".$errorCount")) {
|
|
59460
59463
|
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName.replace(".$errorCount", "")), "$errorCount");
|
|
59461
59464
|
}
|
|
59462
59465
|
if (pathWithFieldName.endsWith(".$warningCount")) {
|
|
59463
59466
|
return new AbsoluteModelFieldPath(createAbsolute(pathWithFieldName.replace(".$warningCount", "")), "$warningCount");
|
|
59464
59467
|
}
|
|
59465
|
-
|
|
59468
|
+
const match = AbsoluteModelFieldPath.fieldExtractRegex.exec(pathWithFieldName);
|
|
59469
|
+
const path = match != undefined ? (_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : pathWithFieldName;
|
|
59470
|
+
const field = match != undefined ? (_ref = match[2]) !== null && _ref !== void 0 ? _ref : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : "value";
|
|
59471
|
+
return new AbsoluteModelFieldPath(createAbsolute(path), field);
|
|
59466
59472
|
}
|
|
59467
59473
|
static createFromMask(pathWithFieldName, multiplicitySymbol) {
|
|
59474
|
+
var _match$2, _ref2;
|
|
59468
59475
|
if (pathWithFieldName.endsWith(".$errorCount")) {
|
|
59469
59476
|
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".$errorCount", ""), multiplicitySymbol), "$errorCount");
|
|
59470
59477
|
}
|
|
59471
59478
|
if (pathWithFieldName.endsWith(".$warningCount")) {
|
|
59472
59479
|
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".$warningCount", ""), multiplicitySymbol), "$warningCount");
|
|
59473
59480
|
}
|
|
59474
|
-
|
|
59475
|
-
|
|
59476
|
-
|
|
59477
|
-
|
|
59478
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName.replace(".warningsCount", ""), multiplicitySymbol), "warningsCount");
|
|
59479
|
-
}
|
|
59480
|
-
return new AbsoluteModelFieldPath(createAbsoluteFromMask(pathWithFieldName, multiplicitySymbol), "value");
|
|
59481
|
+
const match = AbsoluteModelFieldPath.fieldExtractRegex.exec(pathWithFieldName);
|
|
59482
|
+
const path = match != undefined ? (_match$2 = match[1]) !== null && _match$2 !== void 0 ? _match$2 : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : pathWithFieldName;
|
|
59483
|
+
const field = match != undefined ? (_ref2 = match[2]) !== null && _ref2 !== void 0 ? _ref2 : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)() : "value";
|
|
59484
|
+
return new AbsoluteModelFieldPath(createAbsoluteFromMask(path, multiplicitySymbol), field);
|
|
59481
59485
|
}
|
|
59482
59486
|
toString() {
|
|
59483
59487
|
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59484
59488
|
}
|
|
59489
|
+
toLegacyPath() {
|
|
59490
|
+
return `${this.path.toLegacyPath()}.${this.field}`;
|
|
59491
|
+
}
|
|
59485
59492
|
}
|
|
59493
|
+
AbsoluteModelFieldPath.fieldExtractRegex = new RegExp(`^(.*)\\.(${(0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__.getKnownViewModelFieldNames)().join("|")})$`);
|
|
59486
59494
|
function isAllTokensResolved(tokens) {
|
|
59487
59495
|
// Я что-то немогу сообразить как тут всё строго написать...
|
|
59488
59496
|
// @ts-expect-error
|
|
@@ -59557,7 +59565,7 @@ class ModelPathImpl {
|
|
|
59557
59565
|
return this.tokens.slice(0, lastIterationIndex);
|
|
59558
59566
|
}
|
|
59559
59567
|
isEndsWithIteration() {
|
|
59560
|
-
const lastItem =
|
|
59568
|
+
const lastItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(this.tokens);
|
|
59561
59569
|
return lastItem == PathTokens.each;
|
|
59562
59570
|
}
|
|
59563
59571
|
isAbsolute() {
|
|
@@ -59573,25 +59581,25 @@ class ModelPathImpl {
|
|
|
59573
59581
|
var _this$legacyPath;
|
|
59574
59582
|
return (_this$legacyPath = this.legacyPath) !== null && _this$legacyPath !== void 0 ? _this$legacyPath : this.legacyPath = this.tokens.map(x => this.pathPartToString(x)).join("/");
|
|
59575
59583
|
}
|
|
59576
|
-
isEquals(modelPath, eachCurrentCollision =
|
|
59577
|
-
if (eachCurrentCollision ===
|
|
59584
|
+
isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59585
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59578
59586
|
return this.toLegacyPath() === modelPath.toLegacyPath();
|
|
59579
59587
|
} else {
|
|
59580
|
-
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(
|
|
59588
|
+
return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.zip(this.getPathParts(), modelPath.getPathParts())).every(([t1, t2]) => t1 === t2);
|
|
59581
59589
|
}
|
|
59582
59590
|
}
|
|
59583
59591
|
|
|
59584
59592
|
/**
|
|
59585
59593
|
* Всегда целое положительное беззнаковое 32-битное число
|
|
59586
59594
|
*/
|
|
59587
|
-
getHash(eachCurrentCollision =
|
|
59595
|
+
getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreSame) {
|
|
59588
59596
|
let hash = 5381;
|
|
59589
|
-
for (const token of (0,
|
|
59597
|
+
for (const token of (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.reverseArray)(this.tokens)) {
|
|
59590
59598
|
let currentStr;
|
|
59591
59599
|
if (PathTokens.isSimpleToken(token)) {
|
|
59592
59600
|
currentStr = token;
|
|
59593
59601
|
} else {
|
|
59594
|
-
if (eachCurrentCollision ===
|
|
59602
|
+
if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent) {
|
|
59595
59603
|
currentStr = token === PathTokens.each ? "*" : "!";
|
|
59596
59604
|
} else {
|
|
59597
59605
|
currentStr = "*";
|
|
@@ -59645,8 +59653,8 @@ class ModelPathImpl {
|
|
|
59645
59653
|
}
|
|
59646
59654
|
return true;
|
|
59647
59655
|
}
|
|
59648
|
-
getIterationRank(eachCurrentCollision =
|
|
59649
|
-
return (0,
|
|
59656
|
+
getIterationRank(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent) {
|
|
59657
|
+
return (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.count)(Iterator.from(this.tokens).filter(x => eachCurrentCollision == _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_4__.EachCurrentCollision.AreDifferent ? x === PathTokens.each : PathTokens.isMultiToken(x)));
|
|
59650
59658
|
}
|
|
59651
59659
|
isEmpty() {
|
|
59652
59660
|
return this.tokens.length === 0;
|
|
@@ -59658,17 +59666,17 @@ class ModelPathImpl {
|
|
|
59658
59666
|
if (!modelPath.isAbsolute()) {
|
|
59659
59667
|
throw new Error(`Cannot match non absolute path '${modelPath.toString()}'`);
|
|
59660
59668
|
}
|
|
59661
|
-
return
|
|
59669
|
+
return _PathMatcher__WEBPACK_IMPORTED_MODULE_6__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
|
|
59662
59670
|
}
|
|
59663
59671
|
*splitByMultiplicity() {
|
|
59664
|
-
let lastSimpleParts = new
|
|
59672
|
+
let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.isAbsolute());
|
|
59665
59673
|
for (const token of this.tokens) {
|
|
59666
59674
|
if (PathTokens.isSimpleToken(token)) {
|
|
59667
59675
|
lastSimpleParts.append(token);
|
|
59668
59676
|
} else {
|
|
59669
59677
|
if (!lastSimpleParts.empty) {
|
|
59670
59678
|
yield lastSimpleParts.toResolvedPath();
|
|
59671
|
-
lastSimpleParts = new
|
|
59679
|
+
lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(false);
|
|
59672
59680
|
}
|
|
59673
59681
|
yield token;
|
|
59674
59682
|
}
|
|
@@ -59728,22 +59736,22 @@ class ModelPathImpl {
|
|
|
59728
59736
|
return new ModelPathImpl(this.tokens, true);
|
|
59729
59737
|
}
|
|
59730
59738
|
*getAllParentPaths() {
|
|
59731
|
-
const result = new
|
|
59732
|
-
for (const token of
|
|
59739
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.isAbsolute());
|
|
59740
|
+
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59733
59741
|
result.append(token);
|
|
59734
59742
|
yield result.toPath();
|
|
59735
59743
|
}
|
|
59736
59744
|
}
|
|
59737
59745
|
trimLastStarIfLastToken() {
|
|
59738
|
-
const lastItem =
|
|
59746
|
+
const lastItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(this.tokens);
|
|
59739
59747
|
if (lastItem != undefined && PathTokens.isMultiToken(lastItem)) {
|
|
59740
59748
|
return new ModelPathImpl(this.tokens.slice(0, -1), this.absolute);
|
|
59741
59749
|
}
|
|
59742
59750
|
return this;
|
|
59743
59751
|
}
|
|
59744
59752
|
getParentPath() {
|
|
59745
|
-
const result = new
|
|
59746
|
-
for (const token of
|
|
59753
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(this.absolute);
|
|
59754
|
+
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
59747
59755
|
result.append(token);
|
|
59748
59756
|
}
|
|
59749
59757
|
// Тут получается так, что по другому никак
|
|
@@ -59755,11 +59763,11 @@ class ModelPathImpl {
|
|
|
59755
59763
|
return this;
|
|
59756
59764
|
}
|
|
59757
59765
|
let instanceCounter = 0;
|
|
59758
|
-
const result = new
|
|
59766
|
+
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_5__.ModelPathBuilder(true);
|
|
59759
59767
|
for (const token of this.getPathParts()) {
|
|
59760
59768
|
if (PathTokens.isMultiToken(token) && instanceCounter < instances.length) {
|
|
59761
59769
|
var _instances$instanceCo;
|
|
59762
|
-
result.append((_instances$instanceCo = instances[instanceCounter]) !== null && _instances$instanceCo !== void 0 ? _instances$instanceCo : (0,
|
|
59770
|
+
result.append((_instances$instanceCo = instances[instanceCounter]) !== null && _instances$instanceCo !== void 0 ? _instances$instanceCo : (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)());
|
|
59763
59771
|
instanceCounter++;
|
|
59764
59772
|
} else {
|
|
59765
59773
|
result.append(token);
|
|
@@ -59779,7 +59787,7 @@ class ModelPathImpl {
|
|
|
59779
59787
|
if (pathPart === PathTokens.current) {
|
|
59780
59788
|
return "*";
|
|
59781
59789
|
}
|
|
59782
|
-
throw new Error(`Unknown path part specified: ${(0,
|
|
59790
|
+
throw new Error(`Unknown path part specified: ${(0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.ensureAndGetString)(pathPart)}`);
|
|
59783
59791
|
}
|
|
59784
59792
|
}
|
|
59785
59793
|
|
|
@@ -60425,6 +60433,33 @@ function isMatchAbbreviation(abbreviation, value) {
|
|
|
60425
60433
|
|
|
60426
60434
|
/***/ }),
|
|
60427
60435
|
|
|
60436
|
+
/***/ "./Engine/src/Engine/Core/CoreTypes.ts":
|
|
60437
|
+
/*!*********************************************!*\
|
|
60438
|
+
!*** ./Engine/src/Engine/Core/CoreTypes.ts ***!
|
|
60439
|
+
\*********************************************/
|
|
60440
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60441
|
+
|
|
60442
|
+
"use strict";
|
|
60443
|
+
__webpack_require__.r(__webpack_exports__);
|
|
60444
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
60445
|
+
/* harmony export */ "nonRegularFieldName": () => (/* binding */ nonRegularFieldName),
|
|
60446
|
+
/* harmony export */ "getKnownViewModelFieldNames": () => (/* binding */ getKnownViewModelFieldNames)
|
|
60447
|
+
/* harmony export */ });
|
|
60448
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60449
|
+
|
|
60450
|
+
// Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
|
|
60451
|
+
|
|
60452
|
+
function nonRegularFieldName(fieldName) {
|
|
60453
|
+
// @ts-ignore
|
|
60454
|
+
return fieldName;
|
|
60455
|
+
}
|
|
60456
|
+
function getKnownViewModelFieldNames() {
|
|
60457
|
+
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"];
|
|
60458
|
+
return names;
|
|
60459
|
+
}
|
|
60460
|
+
|
|
60461
|
+
/***/ }),
|
|
60462
|
+
|
|
60428
60463
|
/***/ "./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts":
|
|
60429
60464
|
/*!*******************************************************************!*\
|
|
60430
60465
|
!*** ./Engine/src/Engine/Core/ModalManager/Modals/Utils/Types.ts ***!
|
|
@@ -79613,7 +79648,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79613
79648
|
|
|
79614
79649
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
79615
79650
|
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$
|
|
79651
|
+
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
79652
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
79618
79653
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
79619
79654
|
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,12 +79657,14 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79622
79657
|
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
79623
79658
|
const formulasFromSugar = extractFormulasFromSugarKCLang(sugarRoot);
|
|
79624
79659
|
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
|
|
79626
|
-
const
|
|
79660
|
+
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;
|
|
79661
|
+
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));
|
|
79662
|
+
const useOldCalculator = !useCalculator2 && !useServerCalculations;
|
|
79663
|
+
const kcXmlConditions = !useServerCalculations ? (_Iterator$from$map$fl = Iterator.from(getImportedKcXmlValidations(sugarRoot, additionalContent)).map(x => {
|
|
79627
79664
|
var _container$conditions, _container$conditions2;
|
|
79628
79665
|
const container = formulaReader.readFormulas(x);
|
|
79629
79666
|
return (_container$conditions = (_container$conditions2 = container.conditions) === null || _container$conditions2 === void 0 ? void 0 : _container$conditions2.items) !== null && _container$conditions !== void 0 ? _container$conditions : [];
|
|
79630
|
-
}).flatMap(x => x).toArray()) !== null && _Iterator$from$map$fl !== void 0 ? _Iterator$from$map$fl : [];
|
|
79667
|
+
}).flatMap(x => x).toArray()) !== null && _Iterator$from$map$fl !== void 0 ? _Iterator$from$map$fl : [] : [];
|
|
79631
79668
|
const schemaRng = (0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__.parseXml)(additionalContent.schemaRngContent);
|
|
79632
79669
|
const formSchemaRng = _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.FormSchemaRng.createFromSchemaRng(additionalContent.schemaRngContent);
|
|
79633
79670
|
const typeRegistry = (0,_validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_15__.buildTypesRegistry)(sugarRoot);
|
|
@@ -79651,7 +79688,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79651
79688
|
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter);
|
|
79652
79689
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
79653
79690
|
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);
|
|
79691
|
+
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
79692
|
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
79693
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
79657
79694
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
@@ -79664,18 +79701,18 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
79664
79701
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
79665
79702
|
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
79666
79703
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
79667
|
-
const formulasForCalculator =
|
|
79704
|
+
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
79668
79705
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
79669
79706
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
79670
|
-
if ((_additionalContent$
|
|
79671
|
-
var _additionalContent$
|
|
79707
|
+
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) {
|
|
79708
|
+
var _additionalContent$fo7, _additionalContent$fo8;
|
|
79672
79709
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
79673
79710
|
const customNormalizers = [{
|
|
79674
79711
|
normalizerId: "formulas",
|
|
79675
|
-
content: (_additionalContent$
|
|
79712
|
+
content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
79676
79713
|
}, {
|
|
79677
79714
|
normalizerId: "formulasWithInitializers",
|
|
79678
|
-
content: (_additionalContent$
|
|
79715
|
+
content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
79679
79716
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
79680
79717
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
79681
79718
|
switch (additionalNormalizer.extension) {
|
|
@@ -80752,6 +80789,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80752
80789
|
/* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
|
|
80753
80790
|
/* harmony export */ "TrimExpression": () => (/* binding */ TrimExpression),
|
|
80754
80791
|
/* harmony export */ "PrepareNumberExpression": () => (/* binding */ PrepareNumberExpression),
|
|
80792
|
+
/* harmony export */ "IncrementalFlagExpression": () => (/* binding */ IncrementalFlagExpression),
|
|
80793
|
+
/* harmony export */ "GetOldExpression": () => (/* binding */ GetOldExpression),
|
|
80755
80794
|
/* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
|
|
80756
80795
|
/* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
|
|
80757
80796
|
/* harmony export */ });
|
|
@@ -81859,6 +81898,33 @@ class PrepareNumberExpression extends FLangExpression {
|
|
|
81859
81898
|
return `prepareNumber(${this.expression.convertToString()})`;
|
|
81860
81899
|
}
|
|
81861
81900
|
}
|
|
81901
|
+
class IncrementalFlagExpression extends FLangExpression {
|
|
81902
|
+
getChildNodes() {
|
|
81903
|
+
return [];
|
|
81904
|
+
}
|
|
81905
|
+
getType() {
|
|
81906
|
+
return BuildInTypeExpression.bool;
|
|
81907
|
+
}
|
|
81908
|
+
convertToString() {
|
|
81909
|
+
return `incremental`;
|
|
81910
|
+
}
|
|
81911
|
+
}
|
|
81912
|
+
class GetOldExpression extends FLangExpression {
|
|
81913
|
+
constructor(expression) {
|
|
81914
|
+
super();
|
|
81915
|
+
this.expression = void 0;
|
|
81916
|
+
this.expression = expression;
|
|
81917
|
+
}
|
|
81918
|
+
getChildNodes() {
|
|
81919
|
+
return [];
|
|
81920
|
+
}
|
|
81921
|
+
getType() {
|
|
81922
|
+
return BuildInTypeExpression.bool;
|
|
81923
|
+
}
|
|
81924
|
+
convertToString() {
|
|
81925
|
+
return `old(${this.expression.convertToString()})`;
|
|
81926
|
+
}
|
|
81927
|
+
}
|
|
81862
81928
|
class FLangStatement extends FLangNode {}
|
|
81863
81929
|
class SetStatement extends FLangStatement {
|
|
81864
81930
|
constructor(left, right) {
|
|
@@ -82498,9 +82564,9 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
82498
82564
|
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
82565
|
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
82566
|
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()));
|
|
82567
|
+
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
82568
|
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));
|
|
82569
|
+
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
82570
|
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
82571
|
resultValueExpression = currentSumExpression;
|
|
82506
82572
|
countValueExpression = currenCountExpression;
|
|
@@ -82789,9 +82855,11 @@ class FormulaRulesBuilder {
|
|
|
82789
82855
|
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_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue));
|
|
82790
82856
|
const result = [];
|
|
82791
82857
|
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)));
|
|
82858
|
+
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
82859
|
if (isDisabled) {
|
|
82794
82860
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
82861
|
+
} else {
|
|
82862
|
+
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__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"))));
|
|
82795
82863
|
}
|
|
82796
82864
|
} else {
|
|
82797
82865
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
@@ -83012,15 +83080,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83012
83080
|
|
|
83013
83081
|
|
|
83014
83082
|
class SugarRulesBuilder {
|
|
83015
|
-
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, typeRegistry, useSchemaValidations) {
|
|
83083
|
+
constructor(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations) {
|
|
83016
83084
|
this.sugarRoot = void 0;
|
|
83017
83085
|
this.controlCustomizationContext = void 0;
|
|
83018
83086
|
this.fetchFunctions = void 0;
|
|
83019
83087
|
this.formSchemaRng = void 0;
|
|
83088
|
+
this.dataDeclarationHelper = void 0;
|
|
83020
83089
|
this.useSchemaValidations = void 0;
|
|
83021
83090
|
this.typeRegistry = void 0;
|
|
83022
83091
|
this.useSchemaValidations = useSchemaValidations;
|
|
83023
83092
|
this.typeRegistry = typeRegistry;
|
|
83093
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
83024
83094
|
this.formSchemaRng = formSchemaRng;
|
|
83025
83095
|
this.fetchFunctions = fetchFunctions;
|
|
83026
83096
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -83028,7 +83098,7 @@ class SugarRulesBuilder {
|
|
|
83028
83098
|
}
|
|
83029
83099
|
buildRules() {
|
|
83030
83100
|
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));
|
|
83101
|
+
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
83102
|
return converter.buildNormalizeRules(builder, this.formSchemaRng);
|
|
83033
83103
|
}
|
|
83034
83104
|
}
|
|
@@ -83053,8 +83123,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83053
83123
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
83054
83124
|
/* harmony import */ var _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Common/ModelPath/Map/AbsoluteModelPathMap */ "./Common/ModelPath/Map/AbsoluteModelPathMap.ts");
|
|
83055
83125
|
/* 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
|
|
83126
|
+
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
83127
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
83058
83128
|
/* harmony import */ var _NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../NodeTypeInfoHelper */ "./Generator/src/generators/ServerSideFLangNormalization/NodeTypeInfoHelper.ts");
|
|
83059
83129
|
|
|
83060
83130
|
|
|
@@ -83156,51 +83226,59 @@ class ValidationRulesBuilder {
|
|
|
83156
83226
|
const tokens = modelPath.getPathPartsAsArray();
|
|
83157
83227
|
for (let i = 0; i < tokens.length; i++) {
|
|
83158
83228
|
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)) {
|
|
83229
|
+
if (tokens[i] === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each || this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(currentModelPath) || i == 1) {
|
|
83160
83230
|
yield currentModelPath;
|
|
83161
83231
|
}
|
|
83162
83232
|
}
|
|
83163
83233
|
}
|
|
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")));
|
|
83234
|
+
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83235
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83236
|
+
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)));
|
|
83237
|
+
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")));
|
|
83238
|
+
}
|
|
83239
|
+
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
83240
|
+
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
83241
|
+
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")));
|
|
83242
|
+
}
|
|
83243
|
+
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
83244
|
+
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);
|
|
83245
|
+
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));
|
|
83246
|
+
}
|
|
83247
|
+
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
83248
|
+
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));
|
|
83249
|
+
}
|
|
83250
|
+
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
83251
|
+
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) => {
|
|
83252
|
+
const nextResultCountExpression = oldValues => this.getReadErrorCountValueExpression(iterationPath, countFieldName, oldValues);
|
|
83253
|
+
const info = {
|
|
83254
|
+
target: iterationPath,
|
|
83255
|
+
getExpressionFunc: result.resultCountExpression
|
|
83256
|
+
};
|
|
83257
|
+
return {
|
|
83258
|
+
resultCountExpression: nextResultCountExpression,
|
|
83259
|
+
items: result.items.concat(info)
|
|
83260
|
+
};
|
|
83261
|
+
}, {
|
|
83262
|
+
resultCountExpression: oldValues => this.getErrorWarningCountExpression(path.toCurrentIteration(), fieldName, oldValues),
|
|
83263
|
+
items: []
|
|
83264
|
+
});
|
|
83265
|
+
return reduceResult.items;
|
|
83198
83266
|
}
|
|
83199
|
-
|
|
83200
|
-
|
|
83267
|
+
buildErrorWarningCountRules(allPathsWithValidations, fieldName) {
|
|
83268
|
+
const countFieldName = `${fieldName}sCount`;
|
|
83269
|
+
const errorCountByTarget = Iterator.from(allPathsWithValidations).flatMap(path => this.buildChainOfErrorCountRules(path, countFieldName, fieldName)).reduce((result, current) => {
|
|
83270
|
+
result.getOrSet(current.target, () => []).push(current.getExpressionFunc);
|
|
83271
|
+
return result;
|
|
83272
|
+
}, new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_5__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_6__.EachCurrentCollision.AreDifferent));
|
|
83273
|
+
const rules = Iterator.from(errorCountByTarget.entries()).map(([iterable, getExpressionFunctions]) => {
|
|
83274
|
+
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());
|
|
83275
|
+
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);
|
|
83276
|
+
return isTargetRequiredReduce ? this.buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) : this.buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression);
|
|
83277
|
+
});
|
|
83278
|
+
return rules;
|
|
83201
83279
|
}
|
|
83202
83280
|
adjustPathMultiplicity(path) {
|
|
83203
|
-
return (0,
|
|
83281
|
+
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_7__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
83204
83282
|
}
|
|
83205
83283
|
}
|
|
83206
83284
|
|
|
@@ -100300,6 +100378,9 @@ class CheckboxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
|
|
|
100300
100378
|
markupBuilder.prop(x => x.checkedValue).set(node.checkedValue);
|
|
100301
100379
|
markupBuilder.prop("data-tid").set(node.tid);
|
|
100302
100380
|
markupBuilder.prop(x => x.uncheckedValue).set(node.uncheckedValue);
|
|
100381
|
+
if (node.callHelperOnChange) {
|
|
100382
|
+
markupBuilder.prop(x => x.callHelperOnChange).set(context.generateHelperFunctionExpression(node, "callHelperOnChange", node.callHelperOnChange));
|
|
100383
|
+
}
|
|
100303
100384
|
if (node.disabled2 != undefined) {
|
|
100304
100385
|
markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_4__.buildExpressionPropValue)(node.disabled2));
|
|
100305
100386
|
if (this.getLegacyNode().getParent() != undefined) {
|
|
@@ -100342,7 +100423,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
100342
100423
|
|
|
100343
100424
|
|
|
100344
100425
|
|
|
100345
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
|
|
100426
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
|
|
100346
100427
|
|
|
100347
100428
|
|
|
100348
100429
|
|
|
@@ -100351,7 +100432,7 @@ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11
|
|
|
100351
100432
|
|
|
100352
100433
|
|
|
100353
100434
|
|
|
100354
|
-
let CheckboxNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.sugarNode)("checkbox", ``, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Checkbox sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_3__.DataBindingMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_FocusManagementNode__WEBPACK_IMPORTED_MODULE_10__.FocusManagementNode), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_9__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_9__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.deprecatedAttr)("width", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_5__.DeprecationReason.InvalidUsage), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("tid", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, "Возможность установки произвольных data-tid атрибутов, может пригодиться другим командам, или для идентификации элемента в тестах"), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__.ValidationInfoNode), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_TooltipProperties_TooltipSettingsNode__WEBPACK_IMPORTED_MODULE_8__.TooltipSettingsNode), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("checkedValue", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, ``), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("uncheckedValue", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, ``), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.children)(undefined, undefined, ["type"]), _dec(_class = (_class2 = class CheckboxNode extends _Serializer_SugarNodeWithLegacyVisibility__WEBPACK_IMPORTED_MODULE_6__.SugarNodeWithLegacyVisibility {
|
|
100435
|
+
let CheckboxNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.sugarNode)("checkbox", ``, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Checkbox sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_3__.DataBindingMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_FocusManagementNode__WEBPACK_IMPORTED_MODULE_10__.FocusManagementNode), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_9__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_9__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.deprecatedAttr)("width", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_5__.DeprecationReason.InvalidUsage), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("tid", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, "Возможность установки произвольных data-tid атрибутов, может пригодиться другим командам, или для идентификации элемента в тестах"), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__.ValidationInfoNode), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrMixin)(_CommonNodeProperties_TooltipProperties_TooltipSettingsNode__WEBPACK_IMPORTED_MODULE_8__.TooltipSettingsNode), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("checkedValue", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, ``), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("uncheckedValue", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.string, ``), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attr)("callHelperOnChange", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.attrType.helperFunctionName, "Вызов helper функции на onChange контролла"), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.children)(undefined, undefined, ["type"]), _dec(_class = (_class2 = class CheckboxNode extends _Serializer_SugarNodeWithLegacyVisibility__WEBPACK_IMPORTED_MODULE_6__.SugarNodeWithLegacyVisibility {
|
|
100355
100436
|
constructor(...args) {
|
|
100356
100437
|
super(...args);
|
|
100357
100438
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dataBinding", _descriptor, this);
|
|
@@ -100363,7 +100444,8 @@ let CheckboxNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODU
|
|
|
100363
100444
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "tooltipSettings", _descriptor7, this);
|
|
100364
100445
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "checkedValue", _descriptor8, this);
|
|
100365
100446
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "uncheckedValue", _descriptor9, this);
|
|
100366
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
100447
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "callHelperOnChange", _descriptor10, this);
|
|
100448
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor11, this);
|
|
100367
100449
|
}
|
|
100368
100450
|
getOwnPath() {
|
|
100369
100451
|
return this.dataBinding.getOwnPath();
|
|
@@ -100413,7 +100495,12 @@ let CheckboxNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODU
|
|
|
100413
100495
|
enumerable: true,
|
|
100414
100496
|
writable: true,
|
|
100415
100497
|
initializer: null
|
|
100416
|
-
}), _descriptor10 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "
|
|
100498
|
+
}), _descriptor10 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "callHelperOnChange", [_dec11], {
|
|
100499
|
+
configurable: true,
|
|
100500
|
+
enumerable: true,
|
|
100501
|
+
writable: true,
|
|
100502
|
+
initializer: null
|
|
100503
|
+
}), _descriptor11 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec12], {
|
|
100417
100504
|
configurable: true,
|
|
100418
100505
|
enumerable: true,
|
|
100419
100506
|
writable: true,
|
|
@@ -106950,12 +107037,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106950
107037
|
|
|
106951
107038
|
|
|
106952
107039
|
class FLangNormalizationRulesBuilder {
|
|
106953
|
-
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, schemaRng, nodeTypeInfoHelper) {
|
|
107040
|
+
constructor(controlCustomizationContext, fetchFunctions, fetchFuncToFlangConverter, dataDeclarationHelper, schemaRng, nodeTypeInfoHelper) {
|
|
106954
107041
|
this.controlCustomizationContext = void 0;
|
|
106955
107042
|
this.fetchFunctions = void 0;
|
|
106956
107043
|
this.schemaRng = void 0;
|
|
106957
107044
|
this.nodeTypeInfoHelper = void 0;
|
|
106958
107045
|
this.fetchFuncToFlangConverter = void 0;
|
|
107046
|
+
this.dataDeclarationHelper = void 0;
|
|
107047
|
+
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
106959
107048
|
this.nodeTypeInfoHelper = nodeTypeInfoHelper;
|
|
106960
107049
|
this.schemaRng = schemaRng;
|
|
106961
107050
|
this.fetchFuncToFlangConverter = fetchFuncToFlangConverter;
|
|
@@ -106997,7 +107086,8 @@ class FLangNormalizationRulesBuilder {
|
|
|
106997
107086
|
if (!disabled && !dataBinding.settings) {
|
|
106998
107087
|
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);
|
|
106999
107088
|
}
|
|
107000
|
-
|
|
107089
|
+
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;
|
|
107090
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
107001
107091
|
}
|
|
107002
107092
|
*specialFieldsInitializer(node, options) {
|
|
107003
107093
|
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)());
|
|
@@ -109825,7 +109915,8 @@ function getSettings(sugarRoot, gfv, additionalSettings, formJsonSettings) {
|
|
|
109825
109915
|
isReadOnly: (_sugarRoot$isReadOnly = sugarRoot.isReadOnly) !== null && _sugarRoot$isReadOnly !== void 0 ? _sugarRoot$isReadOnly : false,
|
|
109826
109916
|
gfv: gfv,
|
|
109827
109917
|
...additionalSettings,
|
|
109828
|
-
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization
|
|
109918
|
+
useServerSideFLangNormalization: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideFLangNormalization,
|
|
109919
|
+
useServerSideCalculations: formJsonSettings === null || formJsonSettings === void 0 ? void 0 : formJsonSettings.useServerSideCalculations
|
|
109829
109920
|
};
|
|
109830
109921
|
return `module.exports = ${JSON.stringify(settings, undefined, 2)}`;
|
|
109831
109922
|
}
|