@kontur.candy/generator 5.53.0 → 5.54.1-crlfhash.0
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 +645 -222
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48658,6 +48658,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48658
48658
|
/* harmony export */ getDaysInMonthKCLangFunction: () => (/* binding */ getDaysInMonthKCLangFunction),
|
|
48659
48659
|
/* harmony export */ getMonthKCLangFunction: () => (/* binding */ getMonthKCLangFunction),
|
|
48660
48660
|
/* harmony export */ getPicklistValuesKCLangFunction: () => (/* binding */ getPicklistValuesKCLangFunction),
|
|
48661
|
+
/* harmony export */ getSumByKeysKCLangFunction: () => (/* binding */ getSumByKeysKCLangFunction),
|
|
48661
48662
|
/* harmony export */ getYearKCLangFunction: () => (/* binding */ getYearKCLangFunction),
|
|
48662
48663
|
/* harmony export */ groupCountKCLangFunction: () => (/* binding */ groupCountKCLangFunction),
|
|
48663
48664
|
/* harmony export */ groupSumKCLangFunction: () => (/* binding */ groupSumKCLangFunction),
|
|
@@ -48670,6 +48671,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48670
48671
|
/* harmony export */ isValidAccountNumberKCLangFunction: () => (/* binding */ isValidAccountNumberKCLangFunction),
|
|
48671
48672
|
/* harmony export */ isValidMirCardNumberKCLangFunction: () => (/* binding */ isValidMirCardNumberKCLangFunction),
|
|
48672
48673
|
/* harmony export */ lengthKCLangFunction: () => (/* binding */ lengthKCLangFunction),
|
|
48674
|
+
/* harmony export */ makeDictKCLangFunction: () => (/* binding */ makeDictKCLangFunction),
|
|
48673
48675
|
/* harmony export */ newlineKCLangFunction: () => (/* binding */ newlineKCLangFunction),
|
|
48674
48676
|
/* harmony export */ noDepsKCLangFunction: () => (/* binding */ noDepsKCLangFunction),
|
|
48675
48677
|
/* harmony export */ regexMatchKCLangFunction: () => (/* binding */ regexMatchKCLangFunction),
|
|
@@ -49357,6 +49359,46 @@ const hasAutoFlagKCLangFunction = params => {
|
|
|
49357
49359
|
expression: param
|
|
49358
49360
|
};
|
|
49359
49361
|
};
|
|
49362
|
+
const makeDictKCLangFunction = params => {
|
|
49363
|
+
var _params$48, _params$49;
|
|
49364
|
+
const errors = Array.from(validateParams(params, 2));
|
|
49365
|
+
if (errors.length > 0) {
|
|
49366
|
+
return new FunctionValidationErrorCollection(errors);
|
|
49367
|
+
}
|
|
49368
|
+
const sourceKeyPathParam = (_params$48 = params[0]) === null || _params$48 === void 0 ? void 0 : _params$48.value;
|
|
49369
|
+
const sourceValuePathParam = (_params$49 = params[1]) === null || _params$49 === void 0 ? void 0 : _params$49.value;
|
|
49370
|
+
if ((sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || sourceValuePathParam == undefined) {
|
|
49371
|
+
const argumentsValidationError = new ArgumentValidationError("Invalid argument sourceKeyPath");
|
|
49372
|
+
return new FunctionValidationErrorCollection([argumentsValidationError]);
|
|
49373
|
+
}
|
|
49374
|
+
return {
|
|
49375
|
+
type: "makeDict",
|
|
49376
|
+
sourceKeyPath: sourceKeyPathParam.select,
|
|
49377
|
+
sourceValueExpression: sourceValuePathParam
|
|
49378
|
+
};
|
|
49379
|
+
};
|
|
49380
|
+
const getSumByKeysKCLangFunction = params => {
|
|
49381
|
+
var _params$50, _params$51;
|
|
49382
|
+
const errors = Array.from(validateParams(params, 2));
|
|
49383
|
+
if (errors.length > 0) {
|
|
49384
|
+
return new FunctionValidationErrorCollection(errors);
|
|
49385
|
+
}
|
|
49386
|
+
const dictPathParam = (_params$50 = params[0]) === null || _params$50 === void 0 ? void 0 : _params$50.value;
|
|
49387
|
+
const targetKeysParam = (_params$51 = params[1]) === null || _params$51 === void 0 ? void 0 : _params$51.value;
|
|
49388
|
+
if (targetKeysParam == undefined || (dictPathParam === null || dictPathParam === void 0 ? void 0 : dictPathParam.type) !== "argument") {
|
|
49389
|
+
const argumentsValidationError = new ArgumentValidationError("Invalid arguments dictPathParam, targetKeysParam");
|
|
49390
|
+
return new FunctionValidationErrorCollection([argumentsValidationError]);
|
|
49391
|
+
}
|
|
49392
|
+
const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
|
|
49393
|
+
type: "array",
|
|
49394
|
+
items: [targetKeysParam]
|
|
49395
|
+
};
|
|
49396
|
+
return {
|
|
49397
|
+
type: "getSumByKeys",
|
|
49398
|
+
dictPath: dictPathParam.select,
|
|
49399
|
+
targetKeys: targetKeys
|
|
49400
|
+
};
|
|
49401
|
+
};
|
|
49360
49402
|
|
|
49361
49403
|
/***/ }),
|
|
49362
49404
|
|
|
@@ -49421,7 +49463,9 @@ const getKCLangGlobalFunctionBuilders = () => ({
|
|
|
49421
49463
|
addYears: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.addYearsKCLangFunction],
|
|
49422
49464
|
dateToString: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateToStringKCLangFunction],
|
|
49423
49465
|
dateTime: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateTimeKCLangFunction],
|
|
49424
|
-
hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction]
|
|
49466
|
+
hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction],
|
|
49467
|
+
makeDict: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.makeDictKCLangFunction],
|
|
49468
|
+
getSumByKeys: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.getSumByKeysKCLangFunction]
|
|
49425
49469
|
});
|
|
49426
49470
|
class ErrorListener {
|
|
49427
49471
|
constructor() {
|
|
@@ -49772,6 +49816,12 @@ class KCLangAntlrVisitor {
|
|
|
49772
49816
|
case "string":
|
|
49773
49817
|
dataType = "string";
|
|
49774
49818
|
break;
|
|
49819
|
+
case "dict":
|
|
49820
|
+
dataType = "dict";
|
|
49821
|
+
break;
|
|
49822
|
+
case "array":
|
|
49823
|
+
dataType = "array";
|
|
49824
|
+
break;
|
|
49775
49825
|
default:
|
|
49776
49826
|
throw Error("visitType syntax incorrect");
|
|
49777
49827
|
}
|
|
@@ -56973,6 +57023,12 @@ function traverseKCLangExpression(node, visitor) {
|
|
|
56973
57023
|
case "hasAutoFlag":
|
|
56974
57024
|
visitor.visitHasAutoFlagKCLangNode(node);
|
|
56975
57025
|
break;
|
|
57026
|
+
case "makeDict":
|
|
57027
|
+
visitor.visitMakeDictKCLangNode(node);
|
|
57028
|
+
break;
|
|
57029
|
+
case "getSumByKeys":
|
|
57030
|
+
visitor.visitGetSumByKeysKCLangNode(node);
|
|
57031
|
+
break;
|
|
56976
57032
|
default:
|
|
56977
57033
|
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
|
|
56978
57034
|
break;
|
|
@@ -57129,6 +57185,12 @@ class DefaultKCLangExpressionVisitor {
|
|
|
57129
57185
|
visitHasAutoFlagKCLangNode(node) {
|
|
57130
57186
|
// default empty implementation
|
|
57131
57187
|
}
|
|
57188
|
+
visitGetSumByKeysKCLangNode(node) {
|
|
57189
|
+
// default empty implementation
|
|
57190
|
+
}
|
|
57191
|
+
visitMakeDictKCLangNode(node) {
|
|
57192
|
+
// default empty implementation
|
|
57193
|
+
}
|
|
57132
57194
|
}
|
|
57133
57195
|
|
|
57134
57196
|
/***/ }),
|
|
@@ -57490,6 +57552,12 @@ const getGenerateJsExpressionFunc = options => {
|
|
|
57490
57552
|
case "hasAutoFlag":
|
|
57491
57553
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57492
57554
|
break;
|
|
57555
|
+
case "makeDict":
|
|
57556
|
+
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57557
|
+
break;
|
|
57558
|
+
case "getSumByKeys":
|
|
57559
|
+
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57560
|
+
break;
|
|
57493
57561
|
default:
|
|
57494
57562
|
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(expression);
|
|
57495
57563
|
}
|
|
@@ -57567,6 +57635,10 @@ function generateKCXmlExpression(expression) {
|
|
|
57567
57635
|
return `<m:${expression.type} select="${expression.select}" />`;
|
|
57568
57636
|
case "isValidAccountNumber":
|
|
57569
57637
|
return `<m:${expression.type} bik="${expression.bik}" account="${expression.account}" />`;
|
|
57638
|
+
case "makeDict":
|
|
57639
|
+
return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.sourceValueExpression), 1), `</m:${expression.type}>`].join("\n");
|
|
57640
|
+
case "getSumByKeys":
|
|
57641
|
+
return [`<m:${expression.type} dictPath="${expression.dictPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
|
|
57570
57642
|
case "groupSum":
|
|
57571
57643
|
return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}" sourceValuePath="${expression.sourceValuePath}" >`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
|
|
57572
57644
|
case "groupCount":
|
|
@@ -63678,6 +63750,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63678
63750
|
/* harmony export */ FormulaGetDaysInMonthExpression: () => (/* binding */ FormulaGetDaysInMonthExpression),
|
|
63679
63751
|
/* harmony export */ FormulaGetMonthExpression: () => (/* binding */ FormulaGetMonthExpression),
|
|
63680
63752
|
/* harmony export */ FormulaGetPicklistValuesExpression: () => (/* binding */ FormulaGetPicklistValuesExpression),
|
|
63753
|
+
/* harmony export */ FormulaGetSumByKeysExpression: () => (/* binding */ FormulaGetSumByKeysExpression),
|
|
63681
63754
|
/* harmony export */ FormulaGetYearExpression: () => (/* binding */ FormulaGetYearExpression),
|
|
63682
63755
|
/* harmony export */ FormulaGroupCountExpression: () => (/* binding */ FormulaGroupCountExpression),
|
|
63683
63756
|
/* harmony export */ FormulaGroupSumExpression: () => (/* binding */ FormulaGroupSumExpression),
|
|
@@ -63693,6 +63766,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63693
63766
|
/* harmony export */ FormulaLeExpression: () => (/* binding */ FormulaLeExpression),
|
|
63694
63767
|
/* harmony export */ FormulaLengthExpression: () => (/* binding */ FormulaLengthExpression),
|
|
63695
63768
|
/* harmony export */ FormulaLtExpression: () => (/* binding */ FormulaLtExpression),
|
|
63769
|
+
/* harmony export */ FormulaMakeDictExpression: () => (/* binding */ FormulaMakeDictExpression),
|
|
63696
63770
|
/* harmony export */ FormulaMinusExpression: () => (/* binding */ FormulaMinusExpression),
|
|
63697
63771
|
/* harmony export */ FormulaMultiplyExpression: () => (/* binding */ FormulaMultiplyExpression),
|
|
63698
63772
|
/* harmony export */ FormulaMultySumExpression: () => (/* binding */ FormulaMultySumExpression),
|
|
@@ -63724,7 +63798,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63724
63798
|
|
|
63725
63799
|
|
|
63726
63800
|
|
|
63727
|
-
var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class3, _dec4, _dec5, _class4, _class5, _descriptor2, _dec6, _dec7, _class6, _class7, _descriptor3, _dec8, _dec9, _class8, _class9, _descriptor4, _dec10, _dec11, _class10, _class11, _descriptor5, _dec12, _dec13, _class12, _class13, _descriptor6, _dec14, _dec15, _dec16, _class14, _class15, _descriptor7, _descriptor8, _dec17, _dec18, _dec19, _class16, _class17, _descriptor9, _descriptor10, _dec20, _dec21, _class18, _class19, _descriptor11, _dec22, _dec23, _class20, _class21, _descriptor12, _dec24, _dec25, _class22, _class23, _descriptor13, _dec26, _dec27, _class24, _class25, _descriptor14, _dec28, _dec29, _class26, _class27, _descriptor15, _dec30, _dec31, _class28, _class29, _descriptor16, _dec32, _dec33, _class30, _class31, _descriptor17, _dec34, _dec35, _class32, _class33, _descriptor18, _dec36, _dec37, _class34, _class35, _descriptor19, _dec38, _dec39, _dec40, _dec41, _class36, _class37, _descriptor20, _descriptor21, _descriptor22, _dec42, _dec43, _class38, _class39, _descriptor23, _dec44, _dec45, _class40, _class41, _descriptor24, _dec46, _dec47, _dec48, _class42, _class43, _descriptor25, _descriptor26, _dec49, _dec50, _class44, _class45, _descriptor27, _dec51, _dec52, _class46, _class47, _descriptor28, _dec53, _dec54, _class48, _class49, _descriptor29, _dec55, _dec56, _class50, _class51, _descriptor30, _dec57, _dec58, _dec59, _class52, _class53, _descriptor31, _descriptor32, _dec60, _dec61, _dec62, _dec63, _class54, _class55, _descriptor33, _descriptor34, _descriptor35, _dec64, _dec65, _dec66, _class56, _class57, _descriptor36, _descriptor37, _dec67, _class58, _dec68, _dec69, _class59, _class60, _descriptor38, _dec70, _dec71, _class61, _class62, _descriptor39, _dec72, _dec73, _class63, _class64, _descriptor40, _dec74, _dec75, _class65, _class66, _descriptor41, _dec76, _dec77, _class67, _class68, _descriptor42, _dec78, _dec79, _class69, _class70, _descriptor43, _dec80, _dec81, _class71, _class72, _descriptor44, _dec82, _dec83, _class73, _class74, _descriptor45, _dec84, _dec85, _dec86, _class75, _class76, _descriptor46, _descriptor47, _dec87, _dec88, _dec89, _class77, _class78, _descriptor48, _descriptor49, _dec90, _dec91, _dec92, _class79, _class80, _descriptor50, _descriptor51, _dec93, _dec94, _dec95, _class81, _class82, _descriptor52, _descriptor53, _dec96, _dec97, _class83, _class84, _descriptor54, _dec98, _dec99, _class85, _class86, _descriptor55, _dec100, _dec101, _class87, _class88, _descriptor56, _dec102, _dec103, _class89, _class90, _descriptor57, _dec104, _dec105, _class91, _class92, _descriptor58, _dec106, _dec107, _dec108, _class93, _class94, _descriptor59, _descriptor60, _dec109, _dec110, _dec111, _class95, _class96, _descriptor61, _descriptor62, _dec112, _dec113, _class97, _class98, _descriptor63, _dec114, _dec115, _class99, _class100, _descriptor64, _dec116, _dec117, _class101, _class102, _descriptor65, _dec118, _dec119, _dec120, _dec121, _dec122, _class103, _class104, _descriptor66, _descriptor67, _descriptor68, _descriptor69, _dec123, _dec124, _class105, _class106, _descriptor70, _dec125, _dec126, _class107, _class108, _descriptor71, _dec127, _dec128, _class109, _class110, _descriptor72, _dec129, _dec130, _class111, _class112, _descriptor73, _dec131, _dec132, _dec133, _class113, _class114, _descriptor74, _descriptor75, _dec134, _dec135, _class115, _class116, _descriptor76, _dec136, _class117, _dec137, _dec138, _dec139, _dec140, _class118, _class119, _descriptor77, _descriptor78, _descriptor79, _dec141, _dec142, _class120, _class121, _descriptor80, _dec143, _dec144, _class122, _class123, _descriptor81, _dec145, _dec146, _dec147, _dec148, _dec149, _dec150, _class124, _class125, _descriptor82, _descriptor83, _descriptor84, _descriptor85, _descriptor86, _dec151, _dec152, _class126, _class127, _descriptor87, _dec153, _dec154, _dec155, _class128, _class129, _descriptor88, _descriptor89, _dec156, _dec157, _dec158,
|
|
63801
|
+
var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class3, _dec4, _dec5, _class4, _class5, _descriptor2, _dec6, _dec7, _class6, _class7, _descriptor3, _dec8, _dec9, _class8, _class9, _descriptor4, _dec10, _dec11, _class10, _class11, _descriptor5, _dec12, _dec13, _class12, _class13, _descriptor6, _dec14, _dec15, _dec16, _class14, _class15, _descriptor7, _descriptor8, _dec17, _dec18, _dec19, _class16, _class17, _descriptor9, _descriptor10, _dec20, _dec21, _class18, _class19, _descriptor11, _dec22, _dec23, _class20, _class21, _descriptor12, _dec24, _dec25, _class22, _class23, _descriptor13, _dec26, _dec27, _class24, _class25, _descriptor14, _dec28, _dec29, _class26, _class27, _descriptor15, _dec30, _dec31, _class28, _class29, _descriptor16, _dec32, _dec33, _class30, _class31, _descriptor17, _dec34, _dec35, _class32, _class33, _descriptor18, _dec36, _dec37, _class34, _class35, _descriptor19, _dec38, _dec39, _dec40, _dec41, _class36, _class37, _descriptor20, _descriptor21, _descriptor22, _dec42, _dec43, _class38, _class39, _descriptor23, _dec44, _dec45, _class40, _class41, _descriptor24, _dec46, _dec47, _dec48, _class42, _class43, _descriptor25, _descriptor26, _dec49, _dec50, _class44, _class45, _descriptor27, _dec51, _dec52, _class46, _class47, _descriptor28, _dec53, _dec54, _class48, _class49, _descriptor29, _dec55, _dec56, _class50, _class51, _descriptor30, _dec57, _dec58, _dec59, _class52, _class53, _descriptor31, _descriptor32, _dec60, _dec61, _dec62, _dec63, _class54, _class55, _descriptor33, _descriptor34, _descriptor35, _dec64, _dec65, _dec66, _class56, _class57, _descriptor36, _descriptor37, _dec67, _class58, _dec68, _dec69, _class59, _class60, _descriptor38, _dec70, _dec71, _class61, _class62, _descriptor39, _dec72, _dec73, _class63, _class64, _descriptor40, _dec74, _dec75, _class65, _class66, _descriptor41, _dec76, _dec77, _class67, _class68, _descriptor42, _dec78, _dec79, _class69, _class70, _descriptor43, _dec80, _dec81, _class71, _class72, _descriptor44, _dec82, _dec83, _class73, _class74, _descriptor45, _dec84, _dec85, _dec86, _class75, _class76, _descriptor46, _descriptor47, _dec87, _dec88, _dec89, _class77, _class78, _descriptor48, _descriptor49, _dec90, _dec91, _dec92, _class79, _class80, _descriptor50, _descriptor51, _dec93, _dec94, _dec95, _class81, _class82, _descriptor52, _descriptor53, _dec96, _dec97, _class83, _class84, _descriptor54, _dec98, _dec99, _class85, _class86, _descriptor55, _dec100, _dec101, _class87, _class88, _descriptor56, _dec102, _dec103, _class89, _class90, _descriptor57, _dec104, _dec105, _class91, _class92, _descriptor58, _dec106, _dec107, _dec108, _class93, _class94, _descriptor59, _descriptor60, _dec109, _dec110, _dec111, _class95, _class96, _descriptor61, _descriptor62, _dec112, _dec113, _class97, _class98, _descriptor63, _dec114, _dec115, _class99, _class100, _descriptor64, _dec116, _dec117, _class101, _class102, _descriptor65, _dec118, _dec119, _dec120, _dec121, _dec122, _class103, _class104, _descriptor66, _descriptor67, _descriptor68, _descriptor69, _dec123, _dec124, _class105, _class106, _descriptor70, _dec125, _dec126, _class107, _class108, _descriptor71, _dec127, _dec128, _class109, _class110, _descriptor72, _dec129, _dec130, _class111, _class112, _descriptor73, _dec131, _dec132, _dec133, _class113, _class114, _descriptor74, _descriptor75, _dec134, _dec135, _class115, _class116, _descriptor76, _dec136, _class117, _dec137, _dec138, _dec139, _dec140, _class118, _class119, _descriptor77, _descriptor78, _descriptor79, _dec141, _dec142, _class120, _class121, _descriptor80, _dec143, _dec144, _class122, _class123, _descriptor81, _dec145, _dec146, _dec147, _dec148, _dec149, _dec150, _class124, _class125, _descriptor82, _descriptor83, _descriptor84, _descriptor85, _descriptor86, _dec151, _dec152, _class126, _class127, _descriptor87, _dec153, _dec154, _dec155, _class128, _class129, _descriptor88, _descriptor89, _dec156, _dec157, _dec158, _class130, _class131, _descriptor90, _descriptor91, _dec159, _dec160, _dec161, _class132, _class133, _descriptor92, _descriptor93, _dec162, _dec163, _dec164, _dec165, _class134, _class135, _descriptor94, _descriptor95, _descriptor96, _dec166, _dec167, _dec168, _class136, _class137, _descriptor97, _descriptor98;
|
|
63728
63802
|
|
|
63729
63803
|
|
|
63730
63804
|
|
|
@@ -63740,7 +63814,7 @@ class FormulaExpression extends _markupGenerator_Serializer_SugarSerializer__WEB
|
|
|
63740
63814
|
throw new Error(`${this.constructor} does not decorated with sugarNode() properly`);
|
|
63741
63815
|
}
|
|
63742
63816
|
}
|
|
63743
|
-
const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string");
|
|
63817
|
+
const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string", "dict", "array");
|
|
63744
63818
|
let FormulaWhenExpression = (_dec = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("when", `TODO`), _dec2 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec(_class = (_class2 = class FormulaWhenExpression extends FormulaExpression {
|
|
63745
63819
|
constructor(...args) {
|
|
63746
63820
|
super(...args);
|
|
@@ -64677,47 +64751,81 @@ let MathContainer = (_dec153 = (0,_markupGenerator_Serializer_SugarSerializer__W
|
|
|
64677
64751
|
writable: true,
|
|
64678
64752
|
initializer: null
|
|
64679
64753
|
})), _class129)) || _class128);
|
|
64680
|
-
let
|
|
64754
|
+
let FormulaMakeDictExpression = (_dec156 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("makedict", `Получение словаря по ключу-значению из иннера`), _dec157 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ`), _dec158 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)(undefined, [FormulaArgumentExpression, FormulaConstExpression, FormulaCastExpression], `Путь откуда брать значение или константа`), _dec156(_class130 = (_class131 = class FormulaMakeDictExpression extends FormulaExpression {
|
|
64681
64755
|
constructor(...args) {
|
|
64682
64756
|
super(...args);
|
|
64683
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
64684
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
64685
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor92, this);
|
|
64757
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor90, this);
|
|
64758
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValueExpression", _descriptor91, this);
|
|
64686
64759
|
}
|
|
64687
|
-
}, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "
|
|
64760
|
+
}, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec157], {
|
|
64688
64761
|
configurable: true,
|
|
64689
64762
|
enumerable: true,
|
|
64690
64763
|
writable: true,
|
|
64691
64764
|
initializer: null
|
|
64692
|
-
}), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "
|
|
64765
|
+
}), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValueExpression", [_dec158], {
|
|
64693
64766
|
configurable: true,
|
|
64694
64767
|
enumerable: true,
|
|
64695
64768
|
writable: true,
|
|
64696
64769
|
initializer: null
|
|
64697
|
-
}),
|
|
64770
|
+
})), _class131)) || _class130);
|
|
64771
|
+
let FormulaGetSumByKeysExpression = (_dec159 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("getsumbykeys", `Вычисление суммы с группировкой в разных множественностях`), _dec160 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("dictPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь к словарю`), _dec161 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec159(_class132 = (_class133 = class FormulaGetSumByKeysExpression extends FormulaExpression {
|
|
64772
|
+
constructor(...args) {
|
|
64773
|
+
super(...args);
|
|
64774
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dictPath", _descriptor92, this);
|
|
64775
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor93, this);
|
|
64776
|
+
}
|
|
64777
|
+
}, (_descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "dictPath", [_dec160], {
|
|
64698
64778
|
configurable: true,
|
|
64699
64779
|
enumerable: true,
|
|
64700
64780
|
writable: true,
|
|
64701
64781
|
initializer: null
|
|
64702
|
-
})
|
|
64703
|
-
|
|
64782
|
+
}), _descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
|
|
64783
|
+
configurable: true,
|
|
64784
|
+
enumerable: true,
|
|
64785
|
+
writable: true,
|
|
64786
|
+
initializer: null
|
|
64787
|
+
})), _class133)) || _class132);
|
|
64788
|
+
let FormulaGroupSumExpression = (_dec162 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupsum", `Вычисление суммы с группировкой в разных множественностях`), _dec163 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec164 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec165 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceValuePath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь в суммируемой множественности откуда берем значение для свёртки`), _dec162(_class134 = (_class135 = class FormulaGroupSumExpression extends FormulaExpression {
|
|
64704
64789
|
constructor(...args) {
|
|
64705
64790
|
super(...args);
|
|
64706
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys",
|
|
64707
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath",
|
|
64791
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor94, this);
|
|
64792
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor95, this);
|
|
64793
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor96, this);
|
|
64708
64794
|
}
|
|
64709
|
-
}, (
|
|
64795
|
+
}, (_descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "targetKeys", [_dec163], {
|
|
64710
64796
|
configurable: true,
|
|
64711
64797
|
enumerable: true,
|
|
64712
64798
|
writable: true,
|
|
64713
64799
|
initializer: null
|
|
64714
|
-
}),
|
|
64800
|
+
}), _descriptor95 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceKeyPath", [_dec164], {
|
|
64715
64801
|
configurable: true,
|
|
64716
64802
|
enumerable: true,
|
|
64717
64803
|
writable: true,
|
|
64718
64804
|
initializer: null
|
|
64719
|
-
})
|
|
64720
|
-
|
|
64805
|
+
}), _descriptor96 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceValuePath", [_dec165], {
|
|
64806
|
+
configurable: true,
|
|
64807
|
+
enumerable: true,
|
|
64808
|
+
writable: true,
|
|
64809
|
+
initializer: null
|
|
64810
|
+
})), _class135)) || _class134);
|
|
64811
|
+
let FormulaGroupCountExpression = (_dec166 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupcount", `Вычисление количества элементов по группам в разных множественностях`), _dec167 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec168 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec166(_class136 = (_class137 = class FormulaGroupCountExpression extends FormulaExpression {
|
|
64812
|
+
constructor(...args) {
|
|
64813
|
+
super(...args);
|
|
64814
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor97, this);
|
|
64815
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor98, this);
|
|
64816
|
+
}
|
|
64817
|
+
}, (_descriptor97 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "targetKeys", [_dec167], {
|
|
64818
|
+
configurable: true,
|
|
64819
|
+
enumerable: true,
|
|
64820
|
+
writable: true,
|
|
64821
|
+
initializer: null
|
|
64822
|
+
}), _descriptor98 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "sourceKeyPath", [_dec168], {
|
|
64823
|
+
configurable: true,
|
|
64824
|
+
enumerable: true,
|
|
64825
|
+
writable: true,
|
|
64826
|
+
initializer: null
|
|
64827
|
+
})), _class137)) || _class136);
|
|
64828
|
+
const formulaExpressions = [FormulaSumExpression, FormulaArgumentExpression, FormulaConstExpression, FormulaMultySumExpression, FormulaRoundExpression, FormulaFloorExpression, FormulaAbsExpression, FormulaDivisionExpression, FormulaMinusExpression, FormulaMultiplyExpression, FormulaChooseExpression, FormulaEqExpression, FormulaGtExpression, FormulaLtExpression, FormulaGeExpression, FormulaLeExpression, FormulaAndExpression, FormulaOrExpression, FormulaNotExpression, FormulaRegexMatchExpression, FormulaSubstringExpression, FormulaXAbsExpression, FormulaExistsExpression, FormulaLengthExpression, FormulaWhenExpression, FormulaCountExpression, FormulaDateNowExpression, FormulaGetDaysInMonthExpression, FormulaGetDayExpression, FormulaGetMonthExpression, FormulaGetYearExpression, FormulaIsDateExpression, FormulaDifferenceInMonthsExpression, FormulaDifferenceInDaysExpression, FormulaAddDaysExpression, FormulaAddMonthsExpression, FormulaAddYearsExpression, FormulaDateToStringExpression, FormulaDateTimeExpression, FormulaIsSnilsExpression, FormulaIsRegNumSfrExpression, FormulaIsInnExpression, FormulaIsValidAccountNumberExpression, FormulaIsValidMirCardNumberExpression, FormulaCastExpression, FormulaConcatExpression, FormulaGroupSumExpression, FormulaGroupCountExpression, FormulaNewLineExpression, FormulaOneOfExpression, FormulaGetPicklistValuesExpression, FormulaArrayExpression, FormulaFirstOrDefaultExpression, FormulaHashSetExpression, FormulaFilterColumnExpression, FormulaFilterKeyExpression, FormulaNoDepsNode, FormulaHasAutoFlagExpression, FormulaMakeDictExpression, FormulaGetSumByKeysExpression];
|
|
64721
64829
|
|
|
64722
64830
|
/***/ }),
|
|
64723
64831
|
|
|
@@ -67177,7 +67285,7 @@ class LazyLoadDeclarationGenerator {
|
|
|
67177
67285
|
thresholdValue: lazyLoadingNodeDeclaration.thresholdValue
|
|
67178
67286
|
};
|
|
67179
67287
|
}
|
|
67180
|
-
const result =
|
|
67288
|
+
const result = LazyLoadDeclarationGenerator.replaceHolder(`
|
|
67181
67289
|
export default function lazyLoadDeclaration() {
|
|
67182
67290
|
return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
|
|
67183
67291
|
space: " "
|
|
@@ -67189,6 +67297,16 @@ class LazyLoadDeclarationGenerator {
|
|
|
67189
67297
|
declaration: declaration
|
|
67190
67298
|
};
|
|
67191
67299
|
}
|
|
67300
|
+
static convertDeclarationToContent(declaration) {
|
|
67301
|
+
const result = LazyLoadDeclarationGenerator.replaceHolder(`
|
|
67302
|
+
export default function lazyLoadDeclaration() {
|
|
67303
|
+
return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
|
|
67304
|
+
space: " "
|
|
67305
|
+
})};
|
|
67306
|
+
};`);
|
|
67307
|
+
const content = unescape(result.replace(/(\\)(u[\dA-Fa-f]{4})/g, "%$2"));
|
|
67308
|
+
return content;
|
|
67309
|
+
}
|
|
67192
67310
|
*extractLazyLoadingDeclarationFromSugar(sugarRoot) {
|
|
67193
67311
|
const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.getNodeClass)(sugarRoot));
|
|
67194
67312
|
if (controlConverterClass != undefined) {
|
|
@@ -67267,7 +67385,7 @@ class LazyLoadDeclarationGenerator {
|
|
|
67267
67385
|
yield* this.processElement(nextPath, child);
|
|
67268
67386
|
}
|
|
67269
67387
|
}
|
|
67270
|
-
replaceHolder(decl) {
|
|
67388
|
+
static replaceHolder(decl) {
|
|
67271
67389
|
let replacedDecl = decl;
|
|
67272
67390
|
for (const [placeholderName, placeHoldersFunction] of (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.iterateEntries)(_DataDeclarationGenerator_placeholders__WEBPACK_IMPORTED_MODULE_2__.placeHolders)) {
|
|
67273
67391
|
const checkName = `"#(${placeholderName})(\\('[\\w]*'\\))?#"`;
|
|
@@ -67390,7 +67508,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67390
67508
|
|
|
67391
67509
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
67392
67510
|
try {
|
|
67393
|
-
var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _sugarRoot$schemaVali, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _generationOptions$re, _additionalContent$fo5, _additionalContent$fo6;
|
|
67511
|
+
var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _sugarRoot$schemaVali, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _generationOptions$re, _additionalContent$fo5, _additionalContent$fo6, _additionalContent$fo7, _additionalContent$fo8, _additionalContent$fo9, _additionalContent$fo10, _additionalContent$fo11, _additionalContent$fo12;
|
|
67394
67512
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
67395
67513
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
67396
67514
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
|
|
@@ -67427,15 +67545,21 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67427
67545
|
const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
|
|
67428
67546
|
const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
|
|
67429
67547
|
const resourcesHash = (_generationOptions$re = generationOptions === null || generationOptions === void 0 ? void 0 : generationOptions.resourcesHash) !== null && _generationOptions$re !== void 0 ? _generationOptions$re : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)("Current generator version requires resources hash");
|
|
67430
|
-
const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper)
|
|
67431
|
-
|
|
67548
|
+
const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper), {
|
|
67549
|
+
enableGroupSumAutoConversion: (_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.enableTypedFlang) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false
|
|
67550
|
+
});
|
|
67551
|
+
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, {
|
|
67552
|
+
enableTypedFlang: (_additionalContent$fo7 = (_additionalContent$fo8 = additionalContent.formJsonSettings) === null || _additionalContent$fo8 === void 0 ? void 0 : _additionalContent$fo8.enableTypedFlang) !== null && _additionalContent$fo7 !== void 0 ? _additionalContent$fo7 : false
|
|
67553
|
+
});
|
|
67432
67554
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
67433
67555
|
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
67434
67556
|
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
|
|
67435
67557
|
const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, useSchemaValidations);
|
|
67436
67558
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
67437
67559
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
67438
|
-
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder
|
|
67560
|
+
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
|
|
67561
|
+
enableTypedFlang: (_additionalContent$fo9 = (_additionalContent$fo10 = additionalContent.formJsonSettings) === null || _additionalContent$fo10 === void 0 ? void 0 : _additionalContent$fo10.enableTypedFlang) !== null && _additionalContent$fo9 !== void 0 ? _additionalContent$fo9 : false
|
|
67562
|
+
});
|
|
67439
67563
|
const formulaAndInitOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_41__.FormulaAndInitOnlyNormalizationRuleGenerator(sugarRulesBuilder, formulaRulesBuilder, optionalSectionRuleBuilder, formSchemaRng);
|
|
67440
67564
|
const autoValueForValueByDefaultNormalizationRuleGenerator = new _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_45__.AutoValueForValueByDefaultNormalizationRuleGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, dataDeclarationHelper);
|
|
67441
67565
|
const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_21__.FormSourcesBuilder(additionalContent.formSourcesPath);
|
|
@@ -67443,23 +67567,24 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67443
67567
|
markupGenerator.generate(sugarRoot, builder);
|
|
67444
67568
|
builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_9__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
|
|
67445
67569
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
67446
|
-
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
67447
67570
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
67448
67571
|
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
67449
67572
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
67450
67573
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
67451
|
-
|
|
67452
|
-
|
|
67574
|
+
let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
|
|
67575
|
+
if ((_additionalContent$fo11 = (_additionalContent$fo12 = additionalContent.formJsonSettings) === null || _additionalContent$fo12 === void 0 ? void 0 : _additionalContent$fo12.useServerSideFLangNormalization) !== null && _additionalContent$fo11 !== void 0 ? _additionalContent$fo11 : false) {
|
|
67576
|
+
var _additionalContent$fo13, _additionalContent$fo14, _additionalContent$fo15;
|
|
67453
67577
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
67578
|
+
finalLazyLoadDeclaration = mixLazyLoadingDeclarationWithServerOnlyPaths(lazyLoadGeneratorResult.declaration, defaultNormalizationRules.serverOnlyPaths);
|
|
67454
67579
|
const customNormalizers = [{
|
|
67455
67580
|
normalizerId: "formulas",
|
|
67456
|
-
content: (_additionalContent$
|
|
67581
|
+
content: (_additionalContent$fo13 = additionalContent.formJsonSettings) !== null && _additionalContent$fo13 !== void 0 && _additionalContent$fo13.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
67457
67582
|
}, {
|
|
67458
67583
|
normalizerId: "formulasWithInitializers",
|
|
67459
|
-
content: (_additionalContent$
|
|
67584
|
+
content: (_additionalContent$fo14 = additionalContent.formJsonSettings) !== null && _additionalContent$fo14 !== void 0 && _additionalContent$fo14.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
67460
67585
|
}, {
|
|
67461
67586
|
normalizerId: "autoValueForValueByDefault",
|
|
67462
|
-
content: (_additionalContent$
|
|
67587
|
+
content: (_additionalContent$fo15 = additionalContent.formJsonSettings) !== null && _additionalContent$fo15 !== void 0 && _additionalContent$fo15.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
|
|
67463
67588
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
67464
67589
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
67465
67590
|
switch (additionalNormalizer.extension) {
|
|
@@ -67483,9 +67608,10 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67483
67608
|
throw new Error(`Cannot transform normalization file with ${additionalNormalizer.extension} extension`);
|
|
67484
67609
|
}
|
|
67485
67610
|
}) : [];
|
|
67486
|
-
const resultRules = combineFlangRules(defaultNormalizationRules, ...additionalNormalizationRules, ...customNormalizers);
|
|
67611
|
+
const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
|
|
67487
67612
|
builder.addServerSideResource("ServerSide.normalize", resultRules);
|
|
67488
67613
|
}
|
|
67614
|
+
builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
|
|
67489
67615
|
const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_27__.AttachmentPathsGenerator();
|
|
67490
67616
|
const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
|
|
67491
67617
|
builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
|
|
@@ -67526,6 +67652,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67526
67652
|
return (0,_common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__.processSugarErrors)(e, additionalContent.gfv);
|
|
67527
67653
|
}
|
|
67528
67654
|
}
|
|
67655
|
+
function mixLazyLoadingDeclarationWithServerOnlyPaths(declaration, paths) {
|
|
67656
|
+
const updateDeclaration = {
|
|
67657
|
+
...declaration
|
|
67658
|
+
};
|
|
67659
|
+
for (const path of paths) {
|
|
67660
|
+
updateDeclaration[path.toString()] = {
|
|
67661
|
+
lazyLoadMode: "serverOnly"
|
|
67662
|
+
};
|
|
67663
|
+
}
|
|
67664
|
+
return updateDeclaration;
|
|
67665
|
+
}
|
|
67529
67666
|
function combineFlangRules(baseRules, ...rules) {
|
|
67530
67667
|
const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
|
|
67531
67668
|
const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
|
|
@@ -67747,19 +67884,9 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
67747
67884
|
}
|
|
67748
67885
|
return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "converters"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "mergers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "jsHelpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "xsltTemplates"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
|
|
67749
67886
|
}
|
|
67750
|
-
function normalizeLineEndings(content) {
|
|
67751
|
-
return content.replace(/\r\n/gi, "\n").replace(/\n\r/gi, "\n");
|
|
67752
|
-
}
|
|
67753
67887
|
async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
67754
67888
|
const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
|
|
67755
|
-
const hashes = await Promise.all(allDeps.map(async depFilePath =>
|
|
67756
|
-
if ([".js", ".xml", ".xslt", ".json"].some(ext => depFilePath.endsWith(ext))) {
|
|
67757
|
-
let content = await readFileAsync(depFilePath, "utf-8");
|
|
67758
|
-
content = normalizeLineEndings(content);
|
|
67759
|
-
return md5__WEBPACK_IMPORTED_MODULE_4___default()(content);
|
|
67760
|
-
}
|
|
67761
|
-
return md5_file__WEBPACK_IMPORTED_MODULE_5___default()(depFilePath);
|
|
67762
|
-
}));
|
|
67889
|
+
const hashes = await Promise.all(allDeps.map(async depFilePath => md5_file__WEBPACK_IMPORTED_MODULE_5___default()(depFilePath)));
|
|
67763
67890
|
return md5__WEBPACK_IMPORTED_MODULE_4___default()(hashes.join(""));
|
|
67764
67891
|
}
|
|
67765
67892
|
async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
@@ -68014,7 +68141,7 @@ class CustomKCLangToFlangRuleGenerator {
|
|
|
68014
68141
|
const result = [];
|
|
68015
68142
|
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));
|
|
68016
68143
|
if (isTargetAutoField) {
|
|
68017
|
-
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(
|
|
68144
|
+
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((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
|
|
68018
68145
|
} else {
|
|
68019
68146
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
68020
68147
|
}
|
|
@@ -68104,8 +68231,8 @@ class FLangValidationBuildContext {
|
|
|
68104
68231
|
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
68105
68232
|
var _typeNode$base, _typeNode$description;
|
|
68106
68233
|
const validations = [];
|
|
68107
|
-
const valueReference =
|
|
68108
|
-
const autoValueReference =
|
|
68234
|
+
const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "value");
|
|
68235
|
+
const autoValueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "autoValue");
|
|
68109
68236
|
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;
|
|
68110
68237
|
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;
|
|
68111
68238
|
if (baseName != undefined) {
|
|
@@ -68128,7 +68255,7 @@ class FLangValidationBuildContext {
|
|
|
68128
68255
|
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
68129
68256
|
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
68130
68257
|
const allChildrenPaths = parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement ? this.schemaRng.getAllChildValueNodes(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;
|
|
68131
|
-
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(
|
|
68258
|
+
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
|
|
68132
68259
|
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
68133
68260
|
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);
|
|
68134
68261
|
const result = [];
|
|
@@ -68223,7 +68350,7 @@ class FLangValidationBuildContext {
|
|
|
68223
68350
|
const value = match === null || match === void 0 || (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
|
|
68224
68351
|
if (path != undefined && sign != undefined && value != undefined) {
|
|
68225
68352
|
const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
|
|
68226
|
-
const valueRef =
|
|
68353
|
+
const valueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(fullPath, "children");
|
|
68227
68354
|
const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression(valueRef);
|
|
68228
68355
|
const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(value);
|
|
68229
68356
|
const getOperation = () => {
|
|
@@ -68507,6 +68634,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68507
68634
|
/* harmony export */ ArgumentDeclarationExpression: () => (/* binding */ ArgumentDeclarationExpression),
|
|
68508
68635
|
/* harmony export */ ArgumentReferenceExpression: () => (/* binding */ ArgumentReferenceExpression),
|
|
68509
68636
|
/* harmony export */ ArrayExpression: () => (/* binding */ ArrayExpression),
|
|
68637
|
+
/* harmony export */ ArrayLengthExpression: () => (/* binding */ ArrayLengthExpression),
|
|
68510
68638
|
/* harmony export */ BinaryBooleanExpression: () => (/* binding */ BinaryBooleanExpression),
|
|
68511
68639
|
/* harmony export */ BinaryExpression: () => (/* binding */ BinaryExpression),
|
|
68512
68640
|
/* harmony export */ BoolLiteralExpression: () => (/* binding */ BoolLiteralExpression),
|
|
@@ -68526,6 +68654,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68526
68654
|
/* harmony export */ DifferenceInMonthsExpression: () => (/* binding */ DifferenceInMonthsExpression),
|
|
68527
68655
|
/* harmony export */ DivisionBinaryExpression: () => (/* binding */ DivisionBinaryExpression),
|
|
68528
68656
|
/* harmony export */ EqExpression: () => (/* binding */ EqExpression),
|
|
68657
|
+
/* harmony export */ ExistsExpression: () => (/* binding */ ExistsExpression),
|
|
68529
68658
|
/* harmony export */ FLangBoolExpression: () => (/* binding */ FLangBoolExpression),
|
|
68530
68659
|
/* harmony export */ FLangDecimalExpression: () => (/* binding */ FLangDecimalExpression),
|
|
68531
68660
|
/* harmony export */ FLangDictExpression: () => (/* binding */ FLangDictExpression),
|
|
@@ -68677,7 +68806,7 @@ class ValueReferenceExpression extends FLangExpression {
|
|
|
68677
68806
|
return [];
|
|
68678
68807
|
}
|
|
68679
68808
|
getType() {
|
|
68680
|
-
return BuildInTypeExpression.
|
|
68809
|
+
return BuildInTypeExpression.object;
|
|
68681
68810
|
}
|
|
68682
68811
|
convertToString() {
|
|
68683
68812
|
return `${toFLangString(this.modePath)}.${this.valueName}`;
|
|
@@ -68875,6 +69004,7 @@ class BuildInTypeExpression extends TypeReferenceExpression {
|
|
|
68875
69004
|
}
|
|
68876
69005
|
}
|
|
68877
69006
|
_BuildInTypeExpression = BuildInTypeExpression;
|
|
69007
|
+
BuildInTypeExpression.object = new _BuildInTypeExpression("object");
|
|
68878
69008
|
BuildInTypeExpression.decimal = new _BuildInTypeExpression("decimal");
|
|
68879
69009
|
BuildInTypeExpression.string = new _BuildInTypeExpression("string");
|
|
68880
69010
|
BuildInTypeExpression.dict = new _BuildInTypeExpression("dict");
|
|
@@ -69131,7 +69261,7 @@ class StringLiteralExpression extends ConstExpression {
|
|
|
69131
69261
|
return JSON.stringify(this.stringValue);
|
|
69132
69262
|
}
|
|
69133
69263
|
}
|
|
69134
|
-
class DecimalLiteralExpression extends
|
|
69264
|
+
class DecimalLiteralExpression extends ConstExpression {
|
|
69135
69265
|
constructor(value) {
|
|
69136
69266
|
super();
|
|
69137
69267
|
this.value = void 0;
|
|
@@ -69148,6 +69278,11 @@ class DecimalLiteralExpression extends FLangDecimalExpression {
|
|
|
69148
69278
|
}
|
|
69149
69279
|
}
|
|
69150
69280
|
class DictLiteralExpression extends FLangExpression {
|
|
69281
|
+
constructor(value) {
|
|
69282
|
+
super();
|
|
69283
|
+
this.value = void 0;
|
|
69284
|
+
this.value = value;
|
|
69285
|
+
}
|
|
69151
69286
|
getChildNodes() {
|
|
69152
69287
|
return [];
|
|
69153
69288
|
}
|
|
@@ -69155,7 +69290,9 @@ class DictLiteralExpression extends FLangExpression {
|
|
|
69155
69290
|
return BuildInTypeExpression.dict;
|
|
69156
69291
|
}
|
|
69157
69292
|
convertToString() {
|
|
69158
|
-
|
|
69293
|
+
var _this$value;
|
|
69294
|
+
const argument = this.value != undefined ? (_this$value = this.value) === null || _this$value === void 0 ? void 0 : _this$value.convertToString() : "";
|
|
69295
|
+
return `dict(${argument})`;
|
|
69159
69296
|
}
|
|
69160
69297
|
}
|
|
69161
69298
|
class BoolLiteralExpression extends ConstExpression {
|
|
@@ -69701,7 +69838,39 @@ class ArrayExpression extends FLangExpression {
|
|
|
69701
69838
|
}
|
|
69702
69839
|
convertToString() {
|
|
69703
69840
|
const items = this.items.map(x => x.convertToString()).join(", ");
|
|
69704
|
-
return `
|
|
69841
|
+
return `makeArray(${items})`;
|
|
69842
|
+
}
|
|
69843
|
+
}
|
|
69844
|
+
class ArrayLengthExpression extends FLangExpression {
|
|
69845
|
+
constructor(expression) {
|
|
69846
|
+
super();
|
|
69847
|
+
this.expression = void 0;
|
|
69848
|
+
this.expression = expression;
|
|
69849
|
+
}
|
|
69850
|
+
getType() {
|
|
69851
|
+
return BuildInTypeExpression.decimal;
|
|
69852
|
+
}
|
|
69853
|
+
*getChildNodes() {
|
|
69854
|
+
yield this.expression;
|
|
69855
|
+
}
|
|
69856
|
+
convertToString() {
|
|
69857
|
+
return `arrayLength(${this.expression.convertToString()})`;
|
|
69858
|
+
}
|
|
69859
|
+
}
|
|
69860
|
+
class ExistsExpression extends FLangExpression {
|
|
69861
|
+
constructor(source) {
|
|
69862
|
+
super();
|
|
69863
|
+
this.source = void 0;
|
|
69864
|
+
this.source = source;
|
|
69865
|
+
}
|
|
69866
|
+
getType() {
|
|
69867
|
+
return BuildInTypeExpression.bool;
|
|
69868
|
+
}
|
|
69869
|
+
*getChildNodes() {
|
|
69870
|
+
yield this.source;
|
|
69871
|
+
}
|
|
69872
|
+
convertToString() {
|
|
69873
|
+
return `exists(${this.source.convertToString()})`;
|
|
69705
69874
|
}
|
|
69706
69875
|
}
|
|
69707
69876
|
class NullCoalesceExpression extends FLangExpression {
|
|
@@ -69837,7 +70006,7 @@ class GetOldExpression extends FLangExpression {
|
|
|
69837
70006
|
return [];
|
|
69838
70007
|
}
|
|
69839
70008
|
getType() {
|
|
69840
|
-
return
|
|
70009
|
+
return this.expression.getType();
|
|
69841
70010
|
}
|
|
69842
70011
|
convertToString() {
|
|
69843
70012
|
return `old(${this.expression.convertToString()})`;
|
|
@@ -69872,6 +70041,9 @@ class SetStatement extends FLangStatement {
|
|
|
69872
70041
|
"use strict";
|
|
69873
70042
|
__webpack_require__.r(__webpack_exports__);
|
|
69874
70043
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
70044
|
+
/* harmony export */ arrayFieldNameSuffix: () => (/* binding */ arrayFieldNameSuffix),
|
|
70045
|
+
/* harmony export */ castFinalExpressionToStringIfNeed: () => (/* binding */ castFinalExpressionToStringIfNeed),
|
|
70046
|
+
/* harmony export */ castOperandIfNeed: () => (/* binding */ castOperandIfNeed),
|
|
69875
70047
|
/* harmony export */ castOperandToBoolIfNeed: () => (/* binding */ castOperandToBoolIfNeed),
|
|
69876
70048
|
/* harmony export */ castOperandToDateTimeIfNeed: () => (/* binding */ castOperandToDateTimeIfNeed),
|
|
69877
70049
|
/* harmony export */ castOperandToDecimalIfNeed: () => (/* binding */ castOperandToDecimalIfNeed),
|
|
@@ -69880,19 +70052,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
69880
70052
|
/* harmony export */ combineByOrFlangExpr: () => (/* binding */ combineByOrFlangExpr),
|
|
69881
70053
|
/* harmony export */ combineRulesWithOptionalSectionChecking: () => (/* binding */ combineRulesWithOptionalSectionChecking),
|
|
69882
70054
|
/* harmony export */ decimalWrapper: () => (/* binding */ decimalWrapper),
|
|
70055
|
+
/* harmony export */ dictFieldNameSuffix: () => (/* binding */ dictFieldNameSuffix),
|
|
70056
|
+
/* harmony export */ ensureCorrectFieldNameByExpressionType: () => (/* binding */ ensureCorrectFieldNameByExpressionType),
|
|
69883
70057
|
/* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
|
|
70058
|
+
/* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
|
|
69884
70059
|
/* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
|
|
70060
|
+
/* harmony export */ hashSetFieldNameSuffix: () => (/* binding */ hashSetFieldNameSuffix),
|
|
70061
|
+
/* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
|
|
70062
|
+
/* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
|
|
70063
|
+
/* harmony export */ makeStringValueReference: () => (/* binding */ makeStringValueReference),
|
|
69885
70064
|
/* harmony export */ nullCoalesceWithTypeCheck: () => (/* binding */ nullCoalesceWithTypeCheck),
|
|
69886
70065
|
/* harmony export */ tryExtractValueReferenceAsStringFromDecimal: () => (/* binding */ tryExtractValueReferenceAsStringFromDecimal),
|
|
69887
70066
|
/* harmony export */ wrapWithArgumentsCondition: () => (/* binding */ wrapWithArgumentsCondition),
|
|
69888
70067
|
/* harmony export */ wrapWithDisableValueAutoInitFlagCheckIfRequired: () => (/* binding */ wrapWithDisableValueAutoInitFlagCheckIfRequired)
|
|
69889
70068
|
/* harmony export */ });
|
|
69890
|
-
/* harmony import */ var
|
|
69891
|
-
/* harmony import */ var
|
|
69892
|
-
/* harmony import */ var
|
|
70069
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
|
|
70070
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
|
|
70071
|
+
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
70072
|
+
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70073
|
+
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
70074
|
+
/* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
70075
|
+
|
|
69893
70076
|
|
|
69894
70077
|
|
|
69895
70078
|
|
|
70079
|
+
|
|
70080
|
+
const dictFieldNameSuffix = "_dict";
|
|
70081
|
+
const arrayFieldNameSuffix = "_array";
|
|
70082
|
+
const hashSetFieldNameSuffix = "_hashSet";
|
|
69896
70083
|
function* getAllExpressionChildren(node, descendantsFilter) {
|
|
69897
70084
|
const children = node.getChildNodes();
|
|
69898
70085
|
for (const child of children) {
|
|
@@ -69903,75 +70090,138 @@ function* getAllExpressionChildren(node, descendantsFilter) {
|
|
|
69903
70090
|
}
|
|
69904
70091
|
}
|
|
69905
70092
|
function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression) {
|
|
69906
|
-
return new
|
|
70093
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.EqExpression(makeStringValueReference(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("true")), makeNoDeps(castOperandIfNeed(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(path.toCurrentIteration(), "value"), originalExpression.getType())), originalExpression));
|
|
69907
70094
|
}
|
|
69908
70095
|
function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
|
|
69909
70096
|
var _formSchemaRng$getEle;
|
|
69910
|
-
return x instanceof
|
|
70097
|
+
return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
|
|
69911
70098
|
}
|
|
69912
70099
|
function wrapWithArgumentsCondition(expression) {
|
|
69913
|
-
const childFilter = node => !(node instanceof
|
|
69914
|
-
const allValueRefNodes =
|
|
69915
|
-
const uniquePaths =
|
|
69916
|
-
const conditionExpression =
|
|
69917
|
-
const currExpr = new
|
|
69918
|
-
return acc != undefined ? new
|
|
70100
|
+
const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression);
|
|
70101
|
+
const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined);
|
|
70102
|
+
const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
|
|
70103
|
+
const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
|
|
70104
|
+
const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ExistsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(curr.modePath, curr.valueName));
|
|
70105
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, currExpr) : currExpr;
|
|
69919
70106
|
}, undefined);
|
|
69920
70107
|
if (conditionExpression == undefined) {
|
|
69921
70108
|
return expression;
|
|
69922
70109
|
}
|
|
69923
|
-
return new
|
|
70110
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression());
|
|
69924
70111
|
}
|
|
69925
70112
|
function combineRulesWithOptionalSectionChecking(allRules, optionalSectionRulesBuilder) {
|
|
69926
|
-
const allUniqueRules =
|
|
70113
|
+
const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allRules, x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement ? x.left.convertToString() : x.convertToString());
|
|
69927
70114
|
const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
|
|
69928
70115
|
return allUniqueRulesWithOptionalChecks;
|
|
69929
70116
|
}
|
|
69930
70117
|
function tryExtractValueReferenceAsStringFromDecimal(expression) {
|
|
69931
|
-
if (expression.getType() ===
|
|
70118
|
+
if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
69932
70119
|
return expression.targetExpression;
|
|
69933
70120
|
}
|
|
69934
70121
|
return expression;
|
|
69935
70122
|
}
|
|
70123
|
+
function castFinalExpressionToStringIfNeed(operandExpression, enableTypedExpression, decimalFormat = "G29") {
|
|
70124
|
+
if (enableTypedExpression && (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet)) {
|
|
70125
|
+
return operandExpression;
|
|
70126
|
+
}
|
|
70127
|
+
return castOperandToStringIfNeed(operandExpression, decimalFormat);
|
|
70128
|
+
}
|
|
69936
70129
|
function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
|
|
69937
|
-
if (operandExpression instanceof
|
|
69938
|
-
return new
|
|
70130
|
+
if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateNowExpression) {
|
|
70131
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("dd.MM.yyyy"));
|
|
69939
70132
|
}
|
|
69940
|
-
if (operandExpression
|
|
69941
|
-
return new
|
|
70133
|
+
if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet) {
|
|
70134
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SerializeEnumerationExpression(operandExpression);
|
|
69942
70135
|
}
|
|
69943
|
-
return operandExpression.getType() !=
|
|
70136
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
|
|
70137
|
+
}
|
|
70138
|
+
function castOperandIfNeed(operandExpression, type) {
|
|
70139
|
+
if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression) {
|
|
70140
|
+
return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, type) : operandExpression;
|
|
70141
|
+
}
|
|
70142
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
|
|
69944
70143
|
}
|
|
69945
70144
|
function castOperandToBoolIfNeed(operandExpression) {
|
|
69946
|
-
return operandExpression.getType() !=
|
|
70145
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.bool) : operandExpression;
|
|
69947
70146
|
}
|
|
69948
70147
|
function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
|
|
69949
|
-
return operandExpression.getType() !==
|
|
70148
|
+
return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
|
|
69950
70149
|
}
|
|
69951
|
-
const decimalWrapper = (ex, needWrapped) => needWrapped ?
|
|
70150
|
+
const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
|
|
69952
70151
|
function castOperandToDateTimeIfNeed(operandExpression) {
|
|
69953
|
-
return operandExpression.getType() !=
|
|
70152
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dateTime) : operandExpression;
|
|
69954
70153
|
}
|
|
69955
70154
|
function nullCoalesceWithTypeCheck(argument, replacement) {
|
|
69956
|
-
const isValid = argument.getType() === replacement.getType() || argument.getType() ===
|
|
70155
|
+
const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null;
|
|
69957
70156
|
if (!isValid) {
|
|
69958
70157
|
throw new Error("Couldn't build null coalesce expression: types not match");
|
|
69959
70158
|
}
|
|
69960
|
-
return new
|
|
70159
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression(argument, replacement);
|
|
69961
70160
|
}
|
|
69962
70161
|
function ensureOperandsOfTypeOrNull(type, ...operands) {
|
|
69963
70162
|
for (const operand of operands) {
|
|
69964
70163
|
const operandType = operand.getType();
|
|
69965
|
-
if (operandType !==
|
|
70164
|
+
if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null && operandType !== type) {
|
|
69966
70165
|
throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
|
|
69967
70166
|
}
|
|
69968
70167
|
}
|
|
69969
70168
|
}
|
|
69970
70169
|
function combineByOrFlangExpr(acc, current) {
|
|
69971
|
-
return acc != undefined ? new
|
|
70170
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, current) : current;
|
|
69972
70171
|
}
|
|
69973
70172
|
function combineByAndFlangExpr(acc, current) {
|
|
69974
|
-
return acc != undefined ? new
|
|
70173
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(acc, current) : current;
|
|
70174
|
+
}
|
|
70175
|
+
function makeNoDeps(expression) {
|
|
70176
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70177
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression);
|
|
70178
|
+
}
|
|
70179
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70180
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
70181
|
+
}
|
|
70182
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
70183
|
+
}
|
|
70184
|
+
function makeGetOld(expression) {
|
|
70185
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70186
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression);
|
|
70187
|
+
}
|
|
70188
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70189
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
70190
|
+
}
|
|
70191
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
70192
|
+
}
|
|
70193
|
+
function makeStringValueReference(modePath, valueName) {
|
|
70194
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string);
|
|
70195
|
+
}
|
|
70196
|
+
function extractValueReferenceFromCast(expression) {
|
|
70197
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70198
|
+
return expression;
|
|
70199
|
+
}
|
|
70200
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70201
|
+
return expression.targetExpression;
|
|
70202
|
+
}
|
|
70203
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression) {
|
|
70204
|
+
return expression.targetExpression;
|
|
70205
|
+
}
|
|
70206
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
|
|
70207
|
+
}
|
|
70208
|
+
function ensureCorrectFieldNameByExpressionType(statement) {
|
|
70209
|
+
if (statement instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement) {
|
|
70210
|
+
const lastPart = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(statement.left.modePath.getPathParts());
|
|
70211
|
+
const lastStringPart = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.isSimpleToken(lastPart) ? lastPart : "";
|
|
70212
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict && !lastStringPart.endsWith(dictFieldNameSuffix)) {
|
|
70213
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${dictFieldNameSuffix}"`);
|
|
70214
|
+
}
|
|
70215
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet && !lastStringPart.endsWith(hashSetFieldNameSuffix)) {
|
|
70216
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${hashSetFieldNameSuffix}"`);
|
|
70217
|
+
}
|
|
70218
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array && !lastStringPart.endsWith(arrayFieldNameSuffix)) {
|
|
70219
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${arrayFieldNameSuffix}"`);
|
|
70220
|
+
}
|
|
70221
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string && (lastStringPart.endsWith(arrayFieldNameSuffix) || lastStringPart.endsWith(hashSetFieldNameSuffix) || lastStringPart.endsWith(dictFieldNameSuffix))) {
|
|
70222
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must NOT be "${arrayFieldNameSuffix}", "${hashSetFieldNameSuffix}" or "${dictFieldNameSuffix}"`);
|
|
70223
|
+
}
|
|
70224
|
+
}
|
|
69975
70225
|
}
|
|
69976
70226
|
|
|
69977
70227
|
/***/ }),
|
|
@@ -70147,8 +70397,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70147
70397
|
/* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
|
|
70148
70398
|
/* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
|
|
70149
70399
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70150
|
-
/* harmony import */ var
|
|
70151
|
-
/* harmony import */ var
|
|
70400
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
70401
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
70402
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
70403
|
+
|
|
70152
70404
|
|
|
70153
70405
|
|
|
70154
70406
|
|
|
@@ -70159,14 +70411,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70159
70411
|
|
|
70160
70412
|
|
|
70161
70413
|
class FormulaExpressionToFlangExpressionConverter {
|
|
70162
|
-
constructor(adjustPathMultiplicityFunc) {
|
|
70414
|
+
constructor(adjustPathMultiplicityFunc, options) {
|
|
70163
70415
|
this.adjustPathMultiplicity = void 0;
|
|
70416
|
+
this.options = void 0;
|
|
70417
|
+
this.options = options;
|
|
70164
70418
|
this.adjustPathMultiplicity = adjustPathMultiplicityFunc;
|
|
70165
70419
|
}
|
|
70166
70420
|
compileExpressionToFlangExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70167
70421
|
const resultExpr = this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
|
|
70168
70422
|
// Если формула это только прямое обращение к значене, то трактовать его как строку
|
|
70169
|
-
if (resultExpr instanceof
|
|
70423
|
+
if (resultExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && resultExpr.targetType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && resultExpr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70170
70424
|
return resultExpr.targetExpression;
|
|
70171
70425
|
}
|
|
70172
70426
|
return resultExpr;
|
|
@@ -70183,24 +70437,24 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70183
70437
|
return this.compiledArgumentExpression(prefix, target, expression.select, "decimal", addPrecalculationRule);
|
|
70184
70438
|
}
|
|
70185
70439
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAbsExpression) {
|
|
70186
|
-
return new
|
|
70440
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70187
70441
|
}
|
|
70188
70442
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaXAbsExpression) {
|
|
70189
|
-
const expr = (0,
|
|
70190
|
-
return new
|
|
70443
|
+
const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
|
|
70444
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression(expr));
|
|
70191
70445
|
}
|
|
70192
70446
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRoundExpression) {
|
|
70193
|
-
return new
|
|
70447
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(expression.fractionalDigits));
|
|
70194
70448
|
}
|
|
70195
70449
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFloorExpression) {
|
|
70196
|
-
return new
|
|
70450
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70197
70451
|
}
|
|
70198
70452
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaChooseExpression) {
|
|
70199
70453
|
const condExpr = this.compileExpressionToFlangExpressionInternal(expression.ifNode.condition, prefix, target, addPrecalculationRule);
|
|
70200
70454
|
const thenExpr = this.compileExpressionToFlangExpressionInternal(expression.thenNode.expression, prefix, target, addPrecalculationRule);
|
|
70201
70455
|
const elseExpr = this.compileExpressionToFlangExpressionInternal(expression.elseNode.expression, prefix, target, addPrecalculationRule);
|
|
70202
|
-
const castToStringRequired = thenExpr.getType() ===
|
|
70203
|
-
return new
|
|
70456
|
+
const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
|
|
70457
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(thenExpr) : thenExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(elseExpr) : elseExpr);
|
|
70204
70458
|
}
|
|
70205
70459
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultiplyExpression) {
|
|
70206
70460
|
return this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule);
|
|
@@ -70212,14 +70466,14 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70212
70466
|
return this.compileAndExpression(expression, prefix, target, addPrecalculationRule);
|
|
70213
70467
|
}
|
|
70214
70468
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNotExpression) {
|
|
70215
|
-
return new
|
|
70469
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
|
|
70216
70470
|
}
|
|
70217
70471
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConstExpression) {
|
|
70218
70472
|
switch (expression.type) {
|
|
70219
70473
|
case "string":
|
|
70220
|
-
return new
|
|
70474
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.value);
|
|
70221
70475
|
case "decimal":
|
|
70222
|
-
return new
|
|
70476
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.value);
|
|
70223
70477
|
default:
|
|
70224
70478
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Unknown constant type!");
|
|
70225
70479
|
}
|
|
@@ -70228,35 +70482,35 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70228
70482
|
return this.compileDivisionExpression(expression, prefix, target, addPrecalculationRule);
|
|
70229
70483
|
}
|
|
70230
70484
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMinusExpression) {
|
|
70231
|
-
return new
|
|
70485
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70232
70486
|
}
|
|
70233
70487
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGtExpression) {
|
|
70234
70488
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70235
70489
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70236
70490
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70237
70491
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70238
|
-
return new
|
|
70492
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GtExpression(left, right);
|
|
70239
70493
|
}
|
|
70240
70494
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLtExpression) {
|
|
70241
70495
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70242
70496
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70243
70497
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70244
70498
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70245
|
-
return new
|
|
70499
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression(left, right);
|
|
70246
70500
|
}
|
|
70247
70501
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGeExpression) {
|
|
70248
70502
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70249
70503
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70250
70504
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70251
70505
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70252
|
-
return new
|
|
70506
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GeExpression(left, right);
|
|
70253
70507
|
}
|
|
70254
70508
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLeExpression) {
|
|
70255
70509
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70256
70510
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70257
70511
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70258
70512
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70259
|
-
return new
|
|
70513
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LeExpression(left, right);
|
|
70260
70514
|
}
|
|
70261
70515
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaEqExpression) {
|
|
70262
70516
|
return this.compileEqExpression(prefix, target, expression, addPrecalculationRule);
|
|
@@ -70266,105 +70520,105 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70266
70520
|
// TODO: тут необходимо учесть, что exists может смотреть на множественность
|
|
70267
70521
|
// TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
|
|
70268
70522
|
/* eslint-enable no-warning-comments */
|
|
70269
|
-
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70270
|
-
return new
|
|
70523
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule));
|
|
70524
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ExistsExpression(arg);
|
|
70271
70525
|
}
|
|
70272
70526
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaWhenExpression) {
|
|
70273
70527
|
const condition = this.compileExpressionToFlangExpressionInternal(expression.expressions[0], prefix, target, addPrecalculationRule);
|
|
70274
70528
|
const thenExpression = this.compileExpressionToFlangExpressionInternal(expression.expressions[1], prefix, target, addPrecalculationRule);
|
|
70275
|
-
return new
|
|
70529
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1)));
|
|
70276
70530
|
}
|
|
70277
70531
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
|
|
70278
70532
|
const arg = this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule);
|
|
70279
|
-
const correctedArg = (0,
|
|
70280
|
-
return new
|
|
70533
|
+
const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
|
|
70534
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
|
|
70281
70535
|
}
|
|
70282
70536
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaCountExpression) {
|
|
70283
|
-
return (0,
|
|
70537
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
|
|
70284
70538
|
}
|
|
70285
70539
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLengthExpression) {
|
|
70286
|
-
return new
|
|
70540
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
|
|
70287
70541
|
}
|
|
70288
70542
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConcatExpression) {
|
|
70289
70543
|
return this.compileConcatExpression(expression, prefix, target, addPrecalculationRule);
|
|
70290
70544
|
}
|
|
70291
70545
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSubstringExpression) {
|
|
70292
70546
|
const arg = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70293
|
-
const argAsString = (0,
|
|
70294
|
-
return new
|
|
70547
|
+
const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal ? "G29" : undefined);
|
|
70548
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SubstringExpression(argAsString, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.length));
|
|
70295
70549
|
}
|
|
70296
70550
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNewLineExpression) {
|
|
70297
|
-
return new
|
|
70551
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("\r\n");
|
|
70298
70552
|
}
|
|
70299
70553
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNoDepsNode) {
|
|
70300
70554
|
const noDepsExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70301
|
-
return
|
|
70555
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(noDepsExpression);
|
|
70302
70556
|
}
|
|
70303
70557
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
|
|
70304
|
-
return new
|
|
70558
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateNowExpression();
|
|
70305
70559
|
}
|
|
70306
70560
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDaysInMonthExpression) {
|
|
70307
|
-
return new
|
|
70561
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70308
70562
|
}
|
|
70309
70563
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDayExpression) {
|
|
70310
|
-
return new
|
|
70564
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70311
70565
|
}
|
|
70312
70566
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetMonthExpression) {
|
|
70313
|
-
return new
|
|
70567
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70314
70568
|
}
|
|
70315
70569
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetYearExpression) {
|
|
70316
|
-
return new
|
|
70570
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70317
70571
|
}
|
|
70318
70572
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsDateExpression) {
|
|
70319
|
-
return new
|
|
70573
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70320
70574
|
}
|
|
70321
70575
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInMonthsExpression) {
|
|
70322
|
-
const expressions = expression.arguments.map(x => (0,
|
|
70323
|
-
return new
|
|
70576
|
+
const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
|
|
70577
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInMonthsExpression(expressions);
|
|
70324
70578
|
}
|
|
70325
70579
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInDaysExpression) {
|
|
70326
|
-
const expressions = expression.arguments.map(x => (0,
|
|
70327
|
-
return new
|
|
70580
|
+
const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
|
|
70581
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInDaysExpression(expressions);
|
|
70328
70582
|
}
|
|
70329
70583
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddDaysExpression) {
|
|
70330
|
-
return new
|
|
70584
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddDaysExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
|
|
70331
70585
|
}
|
|
70332
70586
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddMonthsExpression) {
|
|
70333
|
-
return new
|
|
70587
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddMonthsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
|
|
70334
70588
|
}
|
|
70335
70589
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddYearsExpression) {
|
|
70336
|
-
return new
|
|
70590
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddYearsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
|
|
70337
70591
|
}
|
|
70338
70592
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateToStringExpression) {
|
|
70339
70593
|
var _expression$format;
|
|
70340
|
-
return new
|
|
70594
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateToStringExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression((_expression$format = expression.format) !== null && _expression$format !== void 0 ? _expression$format : "dd.MM.yyyy"));
|
|
70341
70595
|
}
|
|
70342
70596
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression) {
|
|
70343
|
-
return new
|
|
70597
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dateTime);
|
|
70344
70598
|
}
|
|
70345
70599
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsSnilsExpression) {
|
|
70346
70600
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70347
|
-
return new
|
|
70601
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70348
70602
|
}
|
|
70349
70603
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsRegNumSfrExpression) {
|
|
70350
70604
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70351
|
-
return new
|
|
70605
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70352
70606
|
}
|
|
70353
70607
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsInnExpression) {
|
|
70354
70608
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70355
|
-
return new
|
|
70609
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70356
70610
|
}
|
|
70357
70611
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidMirCardNumberExpression) {
|
|
70358
70612
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70359
|
-
return new
|
|
70613
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70360
70614
|
}
|
|
70361
70615
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArrayExpression) {
|
|
70362
70616
|
const items = expression.items.map(arg => this.compileEnumerationItem(arg, prefix, target, addPrecalculationRule));
|
|
70363
|
-
return new
|
|
70617
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArrayExpression(items);
|
|
70364
70618
|
}
|
|
70365
70619
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFirstOrDefaultExpression) {
|
|
70366
70620
|
const firstOrDefaultExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70367
|
-
return new
|
|
70621
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FirstOrDefaultExpression(firstOrDefaultExpression);
|
|
70368
70622
|
}
|
|
70369
70623
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHashSetExpression) {
|
|
70370
70624
|
if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
|
|
@@ -70380,21 +70634,21 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70380
70634
|
const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
70381
70635
|
const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
|
|
70382
70636
|
const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
|
|
70383
|
-
return new
|
|
70637
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression());
|
|
70384
70638
|
}
|
|
70385
70639
|
}
|
|
70386
70640
|
const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70387
|
-
return new
|
|
70641
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(hashSetExpression);
|
|
70388
70642
|
}
|
|
70389
70643
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression) {
|
|
70390
70644
|
const filterColumn = this.compileExpressionToFlangExpressionInternal(expression.filterColumn.filterColumn, prefix, target, addPrecalculationRule);
|
|
70391
70645
|
const filterKey = this.compileExpressionToFlangExpressionInternal(expression.filterKey.filterKey, prefix, target, addPrecalculationRule);
|
|
70392
|
-
return new
|
|
70646
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetPicklistValuesExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.gId), filterColumn, filterKey, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.resultColumn));
|
|
70393
70647
|
}
|
|
70394
70648
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidAccountNumberExpression) {
|
|
70395
70649
|
const bik = this.compiledArgumentExpression(prefix, target, expression.bik, "string", addPrecalculationRule);
|
|
70396
70650
|
const account = this.compiledArgumentExpression(prefix, target, expression.account, "string", addPrecalculationRule);
|
|
70397
|
-
return new
|
|
70651
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidAccountNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(bik), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(account));
|
|
70398
70652
|
}
|
|
70399
70653
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupSumExpression) {
|
|
70400
70654
|
return this.compileGroupSumExpression(prefix, target, expression, addPrecalculationRule);
|
|
@@ -70402,18 +70656,30 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70402
70656
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupCountExpression) {
|
|
70403
70657
|
return this.compileGroupCountExpression(prefix, target, expression, addPrecalculationRule);
|
|
70404
70658
|
}
|
|
70659
|
+
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMakeDictExpression) {
|
|
70660
|
+
return this.compileMakeDictExpression(prefix, target, expression, addPrecalculationRule);
|
|
70661
|
+
}
|
|
70662
|
+
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetSumByKeysExpression) {
|
|
70663
|
+
return this.compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule);
|
|
70664
|
+
}
|
|
70405
70665
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOneOfExpression) {
|
|
70406
|
-
const arg = (0,
|
|
70407
|
-
const items = expression.items.expressions.map(item => (0,
|
|
70408
|
-
return new
|
|
70666
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
|
|
70667
|
+
const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
|
|
70668
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OneOfExpression(arg, items);
|
|
70409
70669
|
}
|
|
70410
70670
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHasAutoFlagExpression) {
|
|
70411
|
-
const arg = (0,
|
|
70412
|
-
const
|
|
70413
|
-
|
|
70414
|
-
|
|
70415
|
-
|
|
70416
|
-
|
|
70671
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
|
|
70672
|
+
const getValueReferenceExpression = () => {
|
|
70673
|
+
if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70674
|
+
return arg;
|
|
70675
|
+
}
|
|
70676
|
+
if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && arg.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70677
|
+
return arg.targetExpression;
|
|
70678
|
+
}
|
|
70679
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
|
|
70680
|
+
};
|
|
70681
|
+
const valueRefExpression = getValueReferenceExpression();
|
|
70682
|
+
const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(valueRefExpression.modePath, "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(valueRefExpression.modePath, "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("true")));
|
|
70417
70683
|
return expr;
|
|
70418
70684
|
}
|
|
70419
70685
|
throw new Error(`Unsupported type of node: ${expression.constructor.name}, ${expression.sourceXmlNode.name}`);
|
|
@@ -70422,7 +70688,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70422
70688
|
if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
|
|
70423
70689
|
return flangExpression;
|
|
70424
70690
|
}
|
|
70425
|
-
return (0,
|
|
70691
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(flangExpression);
|
|
70426
70692
|
}
|
|
70427
70693
|
compileEqExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70428
70694
|
const left = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
@@ -70430,12 +70696,109 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70430
70696
|
|
|
70431
70697
|
// Сейчас в АР иногда проверку на decimal значение делаем через [Значение != "Какая-то строка"]
|
|
70432
70698
|
// Поэтому при такой проверке вычитываем поле "Значение" как строку
|
|
70433
|
-
if (left.getType() ===
|
|
70434
|
-
return new
|
|
70699
|
+
if (left.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string && left instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && left.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70700
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left.targetExpression), right);
|
|
70435
70701
|
}
|
|
70436
|
-
return new
|
|
70702
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(right));
|
|
70437
70703
|
}
|
|
70438
|
-
|
|
70704
|
+
compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70705
|
+
const getOldSourceValueExpression = () => {
|
|
70706
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70707
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression);
|
|
70708
|
+
}
|
|
70709
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70710
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
|
|
70711
|
+
}
|
|
70712
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
|
|
70713
|
+
return sourceValueExpression;
|
|
70714
|
+
}
|
|
70715
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`SourceValueExpression for makeDict must be reference to value or constant.
|
|
70716
|
+
Converted Object: ${JSON.stringify(sourceValueExpression)}`);
|
|
70717
|
+
};
|
|
70718
|
+
const oldSourceValueExpression = getOldSourceValueExpression();
|
|
70719
|
+
const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70720
|
+
const firstPart = matchedPaths.matchedPath.toCurrentIteration();
|
|
70721
|
+
const secondPart = matchedPaths.differentPath;
|
|
70722
|
+
const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
|
|
70723
|
+
const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70724
|
+
const oldKeys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"))], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70725
|
+
const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)), oldKeys, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(oldSourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(target.path.toCurrentIteration(), "value"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression()));
|
|
70726
|
+
return reduceExpression;
|
|
70727
|
+
}
|
|
70728
|
+
compileMakeDictExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70729
|
+
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70730
|
+
const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
|
|
70731
|
+
const reduceExpression = this.compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70732
|
+
return reduceExpression;
|
|
70733
|
+
}
|
|
70734
|
+
compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule) {
|
|
70735
|
+
const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => {
|
|
70736
|
+
const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
|
|
70737
|
+
if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
|
|
70738
|
+
return item;
|
|
70739
|
+
}
|
|
70740
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
|
|
70741
|
+
}), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70742
|
+
return deserializedKeys;
|
|
70743
|
+
}
|
|
70744
|
+
compileGetSumByKeysExpressionImpl(prefix, target, dictPath, targetKeys, addPrecalculationRule) {
|
|
70745
|
+
const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPath, "value")), targetKeys);
|
|
70746
|
+
return finalValueExpression;
|
|
70747
|
+
}
|
|
70748
|
+
compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70749
|
+
const dictPath = this.preparePathAndAdjustMultiplicity(prefix, expression.dictPath);
|
|
70750
|
+
const targetKeys = expression.targetKeys;
|
|
70751
|
+
const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
|
|
70752
|
+
return this.compileGetSumByKeysExpressionImpl(prefix, target, dictPath, deserializedKeys, addPrecalculationRule);
|
|
70753
|
+
}
|
|
70754
|
+
compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70755
|
+
const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70756
|
+
const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
|
|
70757
|
+
const firstPart = matchPaths.matchedPath;
|
|
70758
|
+
const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
|
|
70759
|
+
const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
|
|
70760
|
+
const getIterationPathWithNestedMultiplicity = () => firstPart;
|
|
70761
|
+
const getIterationPathWithoutNestedMultiplicity = () => {
|
|
70762
|
+
const firstPartParts = matchPaths.matchedPath.getPathPartsAsArray();
|
|
70763
|
+
const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
70764
|
+
return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).getParentPath();
|
|
70765
|
+
};
|
|
70766
|
+
const finalIterPath = secondParts.isContainCurrentOrEachIteration() ? getIterationPathWithNestedMultiplicity() : getIterationPathWithoutNestedMultiplicity();
|
|
70767
|
+
if (finalIterPath.isEmpty()) {
|
|
70768
|
+
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|
|
70769
|
+
}
|
|
70770
|
+
const extractNameFromPath = path => Iterator.from(path.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray().join("_");
|
|
70771
|
+
const extractNameFromExpression = (basePathForDict, expr) => {
|
|
70772
|
+
const exprAsValueRef = expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression ? expr : expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && expr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression ? expr.targetExpression : undefined;
|
|
70773
|
+
if (exprAsValueRef != undefined) {
|
|
70774
|
+
return extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, exprAsValueRef.modePath).differentPath);
|
|
70775
|
+
}
|
|
70776
|
+
const exprAsConst = expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression ? expr : expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && expr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression ? expr.targetExpression : undefined;
|
|
70777
|
+
if (exprAsConst != undefined) {
|
|
70778
|
+
if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression) {
|
|
70779
|
+
return `constant_${exprAsConst.value}`;
|
|
70780
|
+
}
|
|
70781
|
+
if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression) {
|
|
70782
|
+
return `constant_${exprAsConst.stringValue}`;
|
|
70783
|
+
}
|
|
70784
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name: unsupported type of constant!");
|
|
70785
|
+
}
|
|
70786
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name!");
|
|
70787
|
+
};
|
|
70788
|
+
const basePathForDict = finalIterPath;
|
|
70789
|
+
const keyDiffPathText = extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, sourceKeyPath).differentPath);
|
|
70790
|
+
const valueDiffPathText = extractNameFromExpression(basePathForDict, sourceValueExpression);
|
|
70791
|
+
const dictPath = basePathForDict.joinWith(`${keyDiffPathText}_${valueDiffPathText}_generated${_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.dictFieldNameSuffix}`);
|
|
70792
|
+
const dictPathWithField = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(dictPath, "value");
|
|
70793
|
+
const basePathForDictPrefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(Iterator.from(basePathForDict.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray());
|
|
70794
|
+
const dictExpression = this.compileMakeDictExpressionImpl(basePathForDictPrefix, dictPathWithField, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70795
|
+
const dictStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path, "value"), dictExpression);
|
|
70796
|
+
addPrecalculationRule(dictStatement);
|
|
70797
|
+
const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
|
|
70798
|
+
const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictStatement.left.modePath.toCurrentIteration(), dictStatement.left.valueName)), deserializedKeys);
|
|
70799
|
+
return finalValueExpression;
|
|
70800
|
+
}
|
|
70801
|
+
compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70439
70802
|
const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70440
70803
|
const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
|
|
70441
70804
|
const firstPart = matchPaths.matchedPath.toCurrentIteration();
|
|
@@ -70456,10 +70819,10 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70456
70819
|
if (finalIterPath.isEmpty()) {
|
|
70457
70820
|
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|
|
70458
70821
|
}
|
|
70459
|
-
const keys = new
|
|
70460
|
-
const reduceExpression = new
|
|
70461
|
-
const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new
|
|
70462
|
-
const finalValueExpression = new
|
|
70822
|
+
const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70823
|
+
const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression());
|
|
70824
|
+
const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70825
|
+
const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(reduceExpression, deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
|
|
70463
70826
|
return finalValueExpression;
|
|
70464
70827
|
}
|
|
70465
70828
|
compileEnumerationItem(expression, prefix, target, addPrecalculationRule) {
|
|
@@ -70468,62 +70831,80 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70468
70831
|
}
|
|
70469
70832
|
return this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
|
|
70470
70833
|
}
|
|
70834
|
+
compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70835
|
+
return this.options.enableGroupSumAutoConversion ? this.compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) : this.compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70836
|
+
}
|
|
70471
70837
|
compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70472
70838
|
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70473
70839
|
const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
|
|
70474
|
-
const sourceValueExpression =
|
|
70840
|
+
const sourceValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(sourceValuePath.toCurrentIteration(), "value");
|
|
70475
70841
|
return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70476
70842
|
}
|
|
70477
70843
|
compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70478
70844
|
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70479
|
-
const sourceValueExpression = new
|
|
70845
|
+
const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
|
|
70480
70846
|
return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70481
70847
|
}
|
|
70848
|
+
convertExpressionTypePropertyToFLangType(type) {
|
|
70849
|
+
switch (type) {
|
|
70850
|
+
case "string":
|
|
70851
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
|
|
70852
|
+
case "array":
|
|
70853
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.array;
|
|
70854
|
+
case "decimal":
|
|
70855
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal;
|
|
70856
|
+
case "dict":
|
|
70857
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict;
|
|
70858
|
+
default:
|
|
70859
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`Unknown ExpressionTypeProperty [${type}]`);
|
|
70860
|
+
}
|
|
70861
|
+
}
|
|
70482
70862
|
compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
|
|
70863
|
+
const builtInType = this.convertExpressionTypePropertyToFLangType(selectType !== null && selectType !== void 0 ? selectType : "string");
|
|
70483
70864
|
const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
|
|
70484
70865
|
const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
|
|
70485
70866
|
const baseSelectPath = splitInfo.matchedPath;
|
|
70486
70867
|
if (!splitInfo.differentPath.isContainIteration()) {
|
|
70487
|
-
const valueRefExpression = new
|
|
70488
|
-
const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ?
|
|
70489
|
-
return
|
|
70868
|
+
const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
|
|
70869
|
+
const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(valueRefExpression) : valueRefExpression;
|
|
70870
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
|
|
70490
70871
|
} else {
|
|
70491
70872
|
var _countValueExpression;
|
|
70492
|
-
let resultValueExpression =
|
|
70873
|
+
let resultValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(adjustedSelectPath.toCurrentIteration().normalize(), "value");
|
|
70493
70874
|
let countValueExpression = undefined;
|
|
70494
70875
|
const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__.buildIterationSequence)(splitInfo.differentPath))];
|
|
70495
70876
|
for (const iterationEntry of iterationEntries) {
|
|
70496
70877
|
const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
|
|
70497
70878
|
const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken(x));
|
|
70498
|
-
const nextResultValueExpression = new
|
|
70499
|
-
const currentSumExpression =
|
|
70500
|
-
const countResultValueExpression = new
|
|
70501
|
-
const currenCountExpression =
|
|
70502
|
-
const sumReduceExpr = new
|
|
70503
|
-
addPrecalculationRule(new
|
|
70504
|
-
const countReduceExpr = new
|
|
70505
|
-
addPrecalculationRule(new
|
|
70879
|
+
const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
|
|
70880
|
+
const currentSumExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
|
|
70881
|
+
const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
|
|
70882
|
+
const currenCountExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
|
|
70883
|
+
const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())));
|
|
70884
|
+
addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(""))));
|
|
70885
|
+
const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)));
|
|
70886
|
+
addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29"))));
|
|
70506
70887
|
resultValueExpression = currentSumExpression;
|
|
70507
70888
|
countValueExpression = currenCountExpression;
|
|
70508
70889
|
}
|
|
70509
70890
|
const finalValue = aggregationFunction === "Sum" ? resultValueExpression : (_countValueExpression = countValueExpression) !== null && _countValueExpression !== void 0 ? _countValueExpression : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
|
|
70510
|
-
return
|
|
70891
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
|
|
70511
70892
|
}
|
|
70512
70893
|
}
|
|
70513
70894
|
compileSumExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70514
70895
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70515
|
-
const currExpr = new
|
|
70516
|
-
return acc != undefined ? new
|
|
70896
|
+
const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
|
|
70897
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(acc, currExpr) : currExpr;
|
|
70517
70898
|
}, undefined);
|
|
70518
70899
|
if (result == undefined) {
|
|
70519
70900
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70520
70901
|
}
|
|
70521
|
-
return (0,
|
|
70902
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70522
70903
|
}
|
|
70523
70904
|
compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70524
70905
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70525
|
-
const currExpr = (0,
|
|
70526
|
-
return acc != undefined ? new
|
|
70906
|
+
const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
|
|
70907
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConcatStringsExpression(acc, currExpr) : currExpr;
|
|
70527
70908
|
}, undefined);
|
|
70528
70909
|
if (result == undefined) {
|
|
70529
70910
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70533,7 +70914,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70533
70914
|
compileOrExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70534
70915
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70535
70916
|
const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
|
|
70536
|
-
return acc != undefined ? new
|
|
70917
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(acc, currExpr) : currExpr;
|
|
70537
70918
|
}, undefined);
|
|
70538
70919
|
if (result == undefined) {
|
|
70539
70920
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70543,7 +70924,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70543
70924
|
compileAndExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70544
70925
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70545
70926
|
const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
|
|
70546
|
-
return acc != undefined ? new
|
|
70927
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(acc, currExpr) : currExpr;
|
|
70547
70928
|
}, undefined);
|
|
70548
70929
|
if (result == undefined) {
|
|
70549
70930
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70552,24 +70933,24 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70552
70933
|
}
|
|
70553
70934
|
compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70554
70935
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70555
|
-
const expr = new
|
|
70556
|
-
return acc != undefined ? new
|
|
70936
|
+
const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
|
|
70937
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MultiplyBinaryExpression(acc, expr) : expr;
|
|
70557
70938
|
}, undefined);
|
|
70558
70939
|
if (result == undefined) {
|
|
70559
70940
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70560
70941
|
}
|
|
70561
|
-
return (0,
|
|
70942
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70562
70943
|
}
|
|
70563
70944
|
compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70564
|
-
const makeDivision = (numerator, denominator) => new
|
|
70945
|
+
const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression());
|
|
70565
70946
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70566
|
-
const currExpr = (0,
|
|
70947
|
+
const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
|
|
70567
70948
|
return acc != undefined ? makeDivision(acc, currExpr) : currExpr;
|
|
70568
70949
|
}, undefined);
|
|
70569
70950
|
if (result == undefined) {
|
|
70570
70951
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70571
70952
|
}
|
|
70572
|
-
return (0,
|
|
70953
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70573
70954
|
}
|
|
70574
70955
|
preparePathAndAdjustMultiplicity(prefix, path) {
|
|
70575
70956
|
const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
|
|
@@ -70679,9 +71060,10 @@ class AutoValueForValueByDefaultNormalizationRuleGenerator {
|
|
|
70679
71060
|
const createValueRuleFromAutoValueRule = autoValueRule => {
|
|
70680
71061
|
var _formulaRulesMap$get$, _formulaRulesMap$get;
|
|
70681
71062
|
const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath, "value");
|
|
71063
|
+
const autoValueExpressionType = autoValueRule.right.getType();
|
|
70682
71064
|
const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value");
|
|
70683
71065
|
const autoFlagRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "autoFlag");
|
|
70684
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(
|
|
71066
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())), autoValueRule.right, formulaRulesMap.has(valueRef) ? (_formulaRulesMap$get$ = (_formulaRulesMap$get = formulaRulesMap.get(valueRef)) === null || _formulaRulesMap$get === void 0 ? void 0 : _formulaRulesMap$get.right) !== null && _formulaRulesMap$get$ !== void 0 ? _formulaRulesMap$get$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)("Unexpected error") : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value"), autoValueExpressionType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(this.dataDeclarationHelper.getDefaultValue(autoValueRule.left.modePath)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())));
|
|
70685
71067
|
};
|
|
70686
71068
|
const updatedFormulaRules = Iterator.from(formulaFLangRules).flatMap(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "autoValue" ? [x, createValueRuleFromAutoValueRule(x)] : [x]);
|
|
70687
71069
|
|
|
@@ -70728,8 +71110,8 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
|
|
|
70728
71110
|
this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
|
|
70729
71111
|
}
|
|
70730
71112
|
generateRules() {
|
|
70731
|
-
const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(
|
|
70732
|
-
const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"),
|
|
71113
|
+
const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), autoValueRule.right));
|
|
71114
|
+
const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), "value")));
|
|
70733
71115
|
const createDisableValueAutoInitRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "disableValueAutoInit"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("true"));
|
|
70734
71116
|
const ignoredValueSetRuleMapper = x => {
|
|
70735
71117
|
var _this$formSchemaRng$g;
|
|
@@ -70776,13 +71158,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70776
71158
|
* 2) переводит autoFlag в true
|
|
70777
71159
|
*/
|
|
70778
71160
|
class FormulaOnlyNormalizationRuleGenerator {
|
|
70779
|
-
constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder) {
|
|
71161
|
+
constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, options) {
|
|
70780
71162
|
this.dataDeclarationHelper = void 0;
|
|
70781
71163
|
this.formSchemaRng = void 0;
|
|
70782
71164
|
this.formulas = void 0;
|
|
71165
|
+
this.options = void 0;
|
|
70783
71166
|
this.formulaExprConverter = void 0;
|
|
70784
71167
|
this.optionalSectionRuleBuilder = void 0;
|
|
70785
71168
|
this.validationRulesBuilder = void 0;
|
|
71169
|
+
this.options = options;
|
|
70786
71170
|
this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
|
|
70787
71171
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
70788
71172
|
this.formSchemaRng = formSchemaRng;
|
|
@@ -70809,10 +71193,14 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
70809
71193
|
const precalculationRules = [];
|
|
70810
71194
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
70811
71195
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
71196
|
+
const getFormulaExpression = field => {
|
|
71197
|
+
const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castFinalExpressionToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), this.options.enableTypedFlang, "G29");
|
|
71198
|
+
const resultType = result.getType();
|
|
71199
|
+
return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue)) : result;
|
|
71200
|
+
};
|
|
70812
71201
|
const result = [];
|
|
70813
|
-
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));
|
|
70814
71202
|
if (isTargetAutoField) {
|
|
70815
|
-
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)));
|
|
71203
|
+
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((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value")), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue"))), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string)));
|
|
70816
71204
|
} else {
|
|
70817
71205
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
70818
71206
|
}
|
|
@@ -70839,6 +71227,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70839
71227
|
/* harmony export */ });
|
|
70840
71228
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
70841
71229
|
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71230
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
71231
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
71232
|
+
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
71233
|
+
|
|
71234
|
+
|
|
71235
|
+
|
|
70842
71236
|
|
|
70843
71237
|
|
|
70844
71238
|
|
|
@@ -70871,8 +71265,16 @@ class NormalizationRulesGenerator {
|
|
|
70871
71265
|
const dataDeclarationRules = this.sugarRulesBuilder.buildRules();
|
|
70872
71266
|
|
|
70873
71267
|
// Порядок важен, т.к. потом делаем distinctBy.
|
|
70874
|
-
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule =>
|
|
70875
|
-
|
|
71268
|
+
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => {
|
|
71269
|
+
(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.ensureCorrectFieldNameByExpressionType)(rule);
|
|
71270
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule);
|
|
71271
|
+
}).toArray();
|
|
71272
|
+
const dictionaryRules = Iterator.from(allRules).filter(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && (rule.right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression && rule.right.expression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.expression.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict)).map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.isNotNullOrUndefined).toArray();
|
|
71273
|
+
const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
|
|
71274
|
+
return {
|
|
71275
|
+
content: content,
|
|
71276
|
+
serverOnlyPaths: dictionaryRules
|
|
71277
|
+
};
|
|
70876
71278
|
}
|
|
70877
71279
|
}
|
|
70878
71280
|
|
|
@@ -70926,12 +71328,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70926
71328
|
|
|
70927
71329
|
|
|
70928
71330
|
class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.BaseRuleBuilder {
|
|
70929
|
-
constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter) {
|
|
71331
|
+
constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, options) {
|
|
70930
71332
|
super();
|
|
70931
71333
|
this.formSchemaRng = void 0;
|
|
70932
71334
|
this.formulas = void 0;
|
|
71335
|
+
this.options = void 0;
|
|
70933
71336
|
this.formulaExprConverter = void 0;
|
|
70934
71337
|
this.dataDeclarationHelper = void 0;
|
|
71338
|
+
this.options = options;
|
|
70935
71339
|
this.formulaExprConverter = formulaExprConverter;
|
|
70936
71340
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
70937
71341
|
this.formulas = formulas;
|
|
@@ -70953,7 +71357,11 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
|
|
|
70953
71357
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
70954
71358
|
const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
|
|
70955
71359
|
const isDecimal = ((_this$formSchemaRng$g = this.formSchemaRng.getTypeNodeByPath(fullTarget.toAbsolute())) === null || _this$formSchemaRng$g === void 0 ? void 0 : _this$formSchemaRng$g.baseType) === "decimal";
|
|
70956
|
-
const getFormulaExpression = targetField =>
|
|
71360
|
+
const getFormulaExpression = targetField => {
|
|
71361
|
+
const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castFinalExpressionToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), this.options.enableTypedFlang, "G29");
|
|
71362
|
+
const resultType = result.getType();
|
|
71363
|
+
return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)) : result;
|
|
71364
|
+
};
|
|
70957
71365
|
const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
|
|
70958
71366
|
const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
|
|
70959
71367
|
const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
|
|
@@ -70967,13 +71375,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
|
|
|
70967
71375
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
|
|
70968
71376
|
}
|
|
70969
71377
|
createAutoFlagRule(fullTarget, isDecimal) {
|
|
70970
|
-
return 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(
|
|
71378
|
+
return 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((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(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((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
|
|
70971
71379
|
}
|
|
70972
71380
|
createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
|
|
70973
71381
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
|
|
70974
71382
|
}
|
|
70975
71383
|
createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) {
|
|
70976
|
-
return 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(
|
|
71384
|
+
return 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((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(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))));
|
|
70977
71385
|
}
|
|
70978
71386
|
adjustPathMultiplicity(path) {
|
|
70979
71387
|
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
@@ -71032,12 +71440,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71032
71440
|
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
71033
71441
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
71034
71442
|
/* harmony import */ var _markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../markupGenerator/getRootPath */ "./Generator/src/generators/markupGenerator/getRootPath.ts");
|
|
71035
|
-
/* harmony import */ var
|
|
71443
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71444
|
+
/* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
|
|
71036
71445
|
|
|
71037
71446
|
|
|
71038
71447
|
|
|
71039
71448
|
|
|
71040
|
-
|
|
71449
|
+
|
|
71450
|
+
class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__.BaseRuleBuilder {
|
|
71041
71451
|
constructor(sugarRoot, lazyLoadingDeclaration) {
|
|
71042
71452
|
super();
|
|
71043
71453
|
this.sugarRoot = void 0;
|
|
@@ -71053,11 +71463,22 @@ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_
|
|
|
71053
71463
|
const thresholdEntry = Object.entries(this.lazyLoadingDeclaration).find(x => x[1].thresholdValue != undefined);
|
|
71054
71464
|
if (thresholdEntry != undefined) {
|
|
71055
71465
|
var _thresholdEntry$1$thr, _thresholdEntry$;
|
|
71056
|
-
const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
71466
|
+
const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).trimLastStarIfLastToken();
|
|
71057
71467
|
const thresholdValue = (_thresholdEntry$1$thr = (_thresholdEntry$ = thresholdEntry[1]) === null || _thresholdEntry$ === void 0 ? void 0 : _thresholdEntry$.thresholdValue) !== null && _thresholdEntry$1$thr !== void 0 ? _thresholdEntry$1$thr : 0;
|
|
71058
71468
|
const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
|
|
71059
|
-
const
|
|
71060
|
-
|
|
71469
|
+
const childrenPathReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(thresholdEntryPath.toCurrentIteration(), "children");
|
|
71470
|
+
const getLengthExpression = (useOldValue = false) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArrayLengthExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DeserializeEnumerationExpression([useOldValue ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeGetOld)(childrenPathReference) : childrenPathReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BoolLiteralExpression(true))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0));
|
|
71471
|
+
if (thresholdEntryPath.isContainIteration()) {
|
|
71472
|
+
const lazyLoadingCounterRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingCounter"), "value");
|
|
71473
|
+
const iterationPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(thresholdEntryPath.getLastListPath());
|
|
71474
|
+
const counterStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingCounterRef, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ReduceCallExpression(iterationPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentReferenceExpression("result"), getLengthExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IncrementalFlagExpression(), getLengthExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(lazyLoadingCounterRef)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)))));
|
|
71475
|
+
yield counterStatement;
|
|
71476
|
+
const lazyFlagStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToDecimalIfNeed)(counterStatement.left), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
|
|
71477
|
+
yield lazyFlagStatement;
|
|
71478
|
+
} else {
|
|
71479
|
+
const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression(getLengthExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
|
|
71480
|
+
yield statement;
|
|
71481
|
+
}
|
|
71061
71482
|
}
|
|
71062
71483
|
}
|
|
71063
71484
|
}
|
|
@@ -71084,7 +71505,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71084
71505
|
/* harmony import */ var _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Engine/src/Engine/Core/PathUtils/PathUtils */ "./Engine/src/Engine/Core/PathUtils/PathUtils.ts");
|
|
71085
71506
|
/* harmony import */ var _Common_ModelPath_ModelPathHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPathHelper */ "./Common/ModelPath/ModelPathHelper.ts");
|
|
71086
71507
|
/* harmony import */ var _Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Common/PathConstants */ "./Common/PathConstants.ts");
|
|
71087
|
-
/* harmony import */ var
|
|
71508
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71509
|
+
/* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
|
|
71088
71510
|
|
|
71089
71511
|
|
|
71090
71512
|
|
|
@@ -71095,7 +71517,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71095
71517
|
|
|
71096
71518
|
|
|
71097
71519
|
|
|
71098
|
-
|
|
71520
|
+
|
|
71521
|
+
class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__.BaseRuleBuilder {
|
|
71099
71522
|
constructor(sugarRoot, dataDeclarationHelper) {
|
|
71100
71523
|
super();
|
|
71101
71524
|
this.sugarRoot = void 0;
|
|
@@ -71181,7 +71604,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
|
|
|
71181
71604
|
const targetIsFilledPath = targetOptionalSection.path.joinWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__.OptionalSectionFilledFieldName);
|
|
71182
71605
|
if (!targetIsFilledPath.isEquals(targetPath)) {
|
|
71183
71606
|
const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
|
|
71184
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.EqExpression(targetIsFilledValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()));
|
|
71607
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(targetIsFilledValueRef), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()));
|
|
71185
71608
|
}
|
|
71186
71609
|
}
|
|
71187
71610
|
return rule;
|
|
@@ -71203,7 +71626,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
|
|
|
71203
71626
|
var _pathGroup$, _pathGroup$map$reduce;
|
|
71204
71627
|
const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
|
|
71205
71628
|
const pathCheckExpr = (_pathGroup$map$reduce = pathGroup.map(pathInfo => {
|
|
71206
|
-
const pathValueRef =
|
|
71629
|
+
const pathValueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
|
|
71207
71630
|
const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
|
|
71208
71631
|
return checkExpression;
|
|
71209
71632
|
}).reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(acc, current), undefined)) !== null && _pathGroup$map$reduce !== void 0 ? _pathGroup$map$reduce : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)();
|
|
@@ -71357,11 +71780,9 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71357
71780
|
const validationText = next.message.reduce((acc, item) => {
|
|
71358
71781
|
if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
|
|
71359
71782
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(item));
|
|
71360
|
-
} else if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression) {
|
|
71361
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([item], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
|
|
71362
|
-
} else {
|
|
71363
|
-
throw new Error(`Invalid WithDescription ${item.toString()}`);
|
|
71364
71783
|
}
|
|
71784
|
+
const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
|
|
71785
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([valueReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
|
|
71365
71786
|
}, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(""));
|
|
71366
71787
|
const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NegateUnaryExpression(next.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`["`), validationText), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`"]`)), current);
|
|
71367
71788
|
return condition;
|
|
@@ -71415,7 +71836,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71415
71836
|
}
|
|
71416
71837
|
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
71417
71838
|
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
71418
|
-
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)(
|
|
71839
|
+
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)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
|
|
71419
71840
|
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")));
|
|
71420
71841
|
}
|
|
71421
71842
|
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
@@ -71423,11 +71844,11 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71423
71844
|
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")));
|
|
71424
71845
|
}
|
|
71425
71846
|
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
71426
|
-
const valueGetExpression = readOldValues ?
|
|
71847
|
+
const valueGetExpression = readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName);
|
|
71427
71848
|
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));
|
|
71428
71849
|
}
|
|
71429
71850
|
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
71430
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ?
|
|
71851
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
|
|
71431
71852
|
}
|
|
71432
71853
|
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
71433
71854
|
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) => {
|
|
@@ -95892,8 +96313,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
95892
96313
|
/* harmony import */ var _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
95893
96314
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
95894
96315
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
95895
|
-
/* harmony import */ var
|
|
95896
|
-
/* harmony import */ var
|
|
96316
|
+
/* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
96317
|
+
/* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
96318
|
+
/* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
|
|
96319
|
+
|
|
95897
96320
|
|
|
95898
96321
|
|
|
95899
96322
|
|
|
@@ -95915,17 +96338,17 @@ class FLangNormalizationRulesBuilder {
|
|
|
95915
96338
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
95916
96339
|
}
|
|
95917
96340
|
*childrenInitializer(node, optional, defaultChildren) {
|
|
95918
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
95919
|
-
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(
|
|
96341
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
96342
|
+
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
|
|
95920
96343
|
}
|
|
95921
96344
|
*childrenInitializerForPicklist(node, optional, defaultChildren) {
|
|
95922
96345
|
const targetPathReference = node.getFullPath().toEachIteration().trimLastStarIfLastToken();
|
|
95923
|
-
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(
|
|
96346
|
+
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
|
|
95924
96347
|
}
|
|
95925
96348
|
valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
|
|
95926
96349
|
var _dataBinding$defaultV;
|
|
95927
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
95928
|
-
const originalValueReference =
|
|
96350
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
|
|
96351
|
+
const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
95929
96352
|
const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
|
|
95930
96353
|
const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
|
|
95931
96354
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
|
|
@@ -95949,11 +96372,11 @@ class FLangNormalizationRulesBuilder {
|
|
|
95949
96372
|
if (!disabled && !dataBinding.settings) {
|
|
95950
96373
|
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);
|
|
95951
96374
|
}
|
|
95952
|
-
const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(
|
|
96375
|
+
const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
|
|
95953
96376
|
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
95954
96377
|
}
|
|
95955
96378
|
*specialFieldsInitializer(node, options) {
|
|
95956
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
96379
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.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)());
|
|
95957
96380
|
if (options.disabled) {
|
|
95958
96381
|
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "disabled"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"));
|
|
95959
96382
|
}
|
|
@@ -95971,9 +96394,9 @@ class FLangNormalizationRulesBuilder {
|
|
|
95971
96394
|
var _typeNode$base, _this$schemaRng$getTy;
|
|
95972
96395
|
// eslint-disable-next-line
|
|
95973
96396
|
const validationInfoSource = node === null || node === void 0 ? void 0 : node.validationInfo;
|
|
95974
|
-
const typeNode = validationInfoSource instanceof
|
|
96397
|
+
const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
|
|
95975
96398
|
const baseType = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : (_this$schemaRng$getTy = this.schemaRng.getTypeNodeByPath(targetPathReference)) === null || _this$schemaRng$getTy === void 0 ? void 0 : _this$schemaRng$getTy.baseType;
|
|
95976
|
-
const sourceValueReference =
|
|
96399
|
+
const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
95977
96400
|
return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
|
|
95978
96401
|
}
|
|
95979
96402
|
}
|
|
@@ -97438,9 +97861,9 @@ function children(onlyTagName, nodeClasses = [], skipNodeNames = []) {
|
|
|
97438
97861
|
(0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_ChildrenNodesValueSource__WEBPACK_IMPORTED_MODULE_19__.ChildrenNodesValueSource(onlyTagNames != undefined ? node => onlyTagNames.includes(node.name) && !skipNodeNames.includes(node.name) : node => !skipNodeNames.includes(node.name), nodeClasses)));
|
|
97439
97862
|
};
|
|
97440
97863
|
}
|
|
97441
|
-
function singleChild(tagName, nodeClasses = []) {
|
|
97864
|
+
function singleChild(tagName, nodeClasses = [], dec) {
|
|
97442
97865
|
return (targetClass, propName) => {
|
|
97443
|
-
(0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_SingleChildValueSource__WEBPACK_IMPORTED_MODULE_20__.SingleChildValueSource(tagName, nodeClasses)));
|
|
97866
|
+
(0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_SingleChildValueSource__WEBPACK_IMPORTED_MODULE_20__.SingleChildValueSource(tagName, nodeClasses), dec));
|
|
97444
97867
|
};
|
|
97445
97868
|
}
|
|
97446
97869
|
function attr(attrName, valueParser, dec) {
|