@kontur.candy/generator 5.49.1-savingevent.0 → 5.50.0-incremental-dictionaries.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 +644 -211
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48640,6 +48640,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48640
48640
|
/* harmony export */ getDaysInMonthKCLangFunction: () => (/* binding */ getDaysInMonthKCLangFunction),
|
|
48641
48641
|
/* harmony export */ getMonthKCLangFunction: () => (/* binding */ getMonthKCLangFunction),
|
|
48642
48642
|
/* harmony export */ getPicklistValuesKCLangFunction: () => (/* binding */ getPicklistValuesKCLangFunction),
|
|
48643
|
+
/* harmony export */ getSumByKeysKCLangFunction: () => (/* binding */ getSumByKeysKCLangFunction),
|
|
48643
48644
|
/* harmony export */ getYearKCLangFunction: () => (/* binding */ getYearKCLangFunction),
|
|
48644
48645
|
/* harmony export */ groupCountKCLangFunction: () => (/* binding */ groupCountKCLangFunction),
|
|
48645
48646
|
/* harmony export */ groupSumKCLangFunction: () => (/* binding */ groupSumKCLangFunction),
|
|
@@ -48652,6 +48653,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48652
48653
|
/* harmony export */ isValidAccountNumberKCLangFunction: () => (/* binding */ isValidAccountNumberKCLangFunction),
|
|
48653
48654
|
/* harmony export */ isValidMirCardNumberKCLangFunction: () => (/* binding */ isValidMirCardNumberKCLangFunction),
|
|
48654
48655
|
/* harmony export */ lengthKCLangFunction: () => (/* binding */ lengthKCLangFunction),
|
|
48656
|
+
/* harmony export */ makeDictKCLangFunction: () => (/* binding */ makeDictKCLangFunction),
|
|
48655
48657
|
/* harmony export */ newlineKCLangFunction: () => (/* binding */ newlineKCLangFunction),
|
|
48656
48658
|
/* harmony export */ noDepsKCLangFunction: () => (/* binding */ noDepsKCLangFunction),
|
|
48657
48659
|
/* harmony export */ regexMatchKCLangFunction: () => (/* binding */ regexMatchKCLangFunction),
|
|
@@ -49339,6 +49341,46 @@ const hasAutoFlagKCLangFunction = params => {
|
|
|
49339
49341
|
expression: param
|
|
49340
49342
|
};
|
|
49341
49343
|
};
|
|
49344
|
+
const makeDictKCLangFunction = params => {
|
|
49345
|
+
var _params$48, _params$49;
|
|
49346
|
+
const errors = Array.from(validateParams(params, 2));
|
|
49347
|
+
if (errors.length > 0) {
|
|
49348
|
+
return new FunctionValidationErrorCollection(errors);
|
|
49349
|
+
}
|
|
49350
|
+
const sourceKeyPathParam = (_params$48 = params[0]) === null || _params$48 === void 0 ? void 0 : _params$48.value;
|
|
49351
|
+
const sourceValuePathParam = (_params$49 = params[1]) === null || _params$49 === void 0 ? void 0 : _params$49.value;
|
|
49352
|
+
if ((sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || sourceValuePathParam == undefined) {
|
|
49353
|
+
const argumentsValidationError = new ArgumentValidationError("Invalid argument sourceKeyPath");
|
|
49354
|
+
return new FunctionValidationErrorCollection([argumentsValidationError]);
|
|
49355
|
+
}
|
|
49356
|
+
return {
|
|
49357
|
+
type: "makeDict",
|
|
49358
|
+
sourceKeyPath: sourceKeyPathParam.select,
|
|
49359
|
+
sourceValueExpression: sourceValuePathParam
|
|
49360
|
+
};
|
|
49361
|
+
};
|
|
49362
|
+
const getSumByKeysKCLangFunction = params => {
|
|
49363
|
+
var _params$50, _params$51;
|
|
49364
|
+
const errors = Array.from(validateParams(params, 2));
|
|
49365
|
+
if (errors.length > 0) {
|
|
49366
|
+
return new FunctionValidationErrorCollection(errors);
|
|
49367
|
+
}
|
|
49368
|
+
const dictPathParam = (_params$50 = params[0]) === null || _params$50 === void 0 ? void 0 : _params$50.value;
|
|
49369
|
+
const targetKeysParam = (_params$51 = params[1]) === null || _params$51 === void 0 ? void 0 : _params$51.value;
|
|
49370
|
+
if (targetKeysParam == undefined || (dictPathParam === null || dictPathParam === void 0 ? void 0 : dictPathParam.type) !== "argument") {
|
|
49371
|
+
const argumentsValidationError = new ArgumentValidationError("Invalid arguments dictPathParam, targetKeysParam");
|
|
49372
|
+
return new FunctionValidationErrorCollection([argumentsValidationError]);
|
|
49373
|
+
}
|
|
49374
|
+
const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
|
|
49375
|
+
type: "array",
|
|
49376
|
+
items: [targetKeysParam]
|
|
49377
|
+
};
|
|
49378
|
+
return {
|
|
49379
|
+
type: "getSumByKeys",
|
|
49380
|
+
dictPath: dictPathParam.select,
|
|
49381
|
+
targetKeys: targetKeys
|
|
49382
|
+
};
|
|
49383
|
+
};
|
|
49342
49384
|
|
|
49343
49385
|
/***/ }),
|
|
49344
49386
|
|
|
@@ -49403,7 +49445,9 @@ const getKCLangGlobalFunctionBuilders = () => ({
|
|
|
49403
49445
|
addYears: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.addYearsKCLangFunction],
|
|
49404
49446
|
dateToString: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateToStringKCLangFunction],
|
|
49405
49447
|
dateTime: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateTimeKCLangFunction],
|
|
49406
|
-
hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction]
|
|
49448
|
+
hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction],
|
|
49449
|
+
makeDict: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.makeDictKCLangFunction],
|
|
49450
|
+
getSumByKeys: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.getSumByKeysKCLangFunction]
|
|
49407
49451
|
});
|
|
49408
49452
|
class ErrorListener {
|
|
49409
49453
|
constructor() {
|
|
@@ -49754,6 +49798,12 @@ class KCLangAntlrVisitor {
|
|
|
49754
49798
|
case "string":
|
|
49755
49799
|
dataType = "string";
|
|
49756
49800
|
break;
|
|
49801
|
+
case "dict":
|
|
49802
|
+
dataType = "dict";
|
|
49803
|
+
break;
|
|
49804
|
+
case "array":
|
|
49805
|
+
dataType = "array";
|
|
49806
|
+
break;
|
|
49757
49807
|
default:
|
|
49758
49808
|
throw Error("visitType syntax incorrect");
|
|
49759
49809
|
}
|
|
@@ -56955,6 +57005,12 @@ function traverseKCLangExpression(node, visitor) {
|
|
|
56955
57005
|
case "hasAutoFlag":
|
|
56956
57006
|
visitor.visitHasAutoFlagKCLangNode(node);
|
|
56957
57007
|
break;
|
|
57008
|
+
case "makeDict":
|
|
57009
|
+
visitor.visitMakeDictKCLangNode(node);
|
|
57010
|
+
break;
|
|
57011
|
+
case "getSumByKeys":
|
|
57012
|
+
visitor.visitGetSumByKeysKCLangNode(node);
|
|
57013
|
+
break;
|
|
56958
57014
|
default:
|
|
56959
57015
|
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
|
|
56960
57016
|
break;
|
|
@@ -57111,6 +57167,12 @@ class DefaultKCLangExpressionVisitor {
|
|
|
57111
57167
|
visitHasAutoFlagKCLangNode(node) {
|
|
57112
57168
|
// default empty implementation
|
|
57113
57169
|
}
|
|
57170
|
+
visitGetSumByKeysKCLangNode(node) {
|
|
57171
|
+
// default empty implementation
|
|
57172
|
+
}
|
|
57173
|
+
visitMakeDictKCLangNode(node) {
|
|
57174
|
+
// default empty implementation
|
|
57175
|
+
}
|
|
57114
57176
|
}
|
|
57115
57177
|
|
|
57116
57178
|
/***/ }),
|
|
@@ -57472,6 +57534,12 @@ const getGenerateJsExpressionFunc = options => {
|
|
|
57472
57534
|
case "hasAutoFlag":
|
|
57473
57535
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57474
57536
|
break;
|
|
57537
|
+
case "makeDict":
|
|
57538
|
+
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57539
|
+
break;
|
|
57540
|
+
case "getSumByKeys":
|
|
57541
|
+
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
|
|
57542
|
+
break;
|
|
57475
57543
|
default:
|
|
57476
57544
|
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(expression);
|
|
57477
57545
|
}
|
|
@@ -57549,6 +57617,10 @@ function generateKCXmlExpression(expression) {
|
|
|
57549
57617
|
return `<m:${expression.type} select="${expression.select}" />`;
|
|
57550
57618
|
case "isValidAccountNumber":
|
|
57551
57619
|
return `<m:${expression.type} bik="${expression.bik}" account="${expression.account}" />`;
|
|
57620
|
+
case "makeDict":
|
|
57621
|
+
return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.sourceValueExpression), 1), `</m:${expression.type}>`].join("\n");
|
|
57622
|
+
case "getSumByKeys":
|
|
57623
|
+
return [`<m:${expression.type} dictPath="${expression.dictPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
|
|
57552
57624
|
case "groupSum":
|
|
57553
57625
|
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");
|
|
57554
57626
|
case "groupCount":
|
|
@@ -63658,6 +63730,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63658
63730
|
/* harmony export */ FormulaGetDaysInMonthExpression: () => (/* binding */ FormulaGetDaysInMonthExpression),
|
|
63659
63731
|
/* harmony export */ FormulaGetMonthExpression: () => (/* binding */ FormulaGetMonthExpression),
|
|
63660
63732
|
/* harmony export */ FormulaGetPicklistValuesExpression: () => (/* binding */ FormulaGetPicklistValuesExpression),
|
|
63733
|
+
/* harmony export */ FormulaGetSumByKeysExpression: () => (/* binding */ FormulaGetSumByKeysExpression),
|
|
63661
63734
|
/* harmony export */ FormulaGetYearExpression: () => (/* binding */ FormulaGetYearExpression),
|
|
63662
63735
|
/* harmony export */ FormulaGroupCountExpression: () => (/* binding */ FormulaGroupCountExpression),
|
|
63663
63736
|
/* harmony export */ FormulaGroupSumExpression: () => (/* binding */ FormulaGroupSumExpression),
|
|
@@ -63673,6 +63746,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63673
63746
|
/* harmony export */ FormulaLeExpression: () => (/* binding */ FormulaLeExpression),
|
|
63674
63747
|
/* harmony export */ FormulaLengthExpression: () => (/* binding */ FormulaLengthExpression),
|
|
63675
63748
|
/* harmony export */ FormulaLtExpression: () => (/* binding */ FormulaLtExpression),
|
|
63749
|
+
/* harmony export */ FormulaMakeDictExpression: () => (/* binding */ FormulaMakeDictExpression),
|
|
63676
63750
|
/* harmony export */ FormulaMinusExpression: () => (/* binding */ FormulaMinusExpression),
|
|
63677
63751
|
/* harmony export */ FormulaMultiplyExpression: () => (/* binding */ FormulaMultiplyExpression),
|
|
63678
63752
|
/* harmony export */ FormulaMultySumExpression: () => (/* binding */ FormulaMultySumExpression),
|
|
@@ -63704,7 +63778,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63704
63778
|
|
|
63705
63779
|
|
|
63706
63780
|
|
|
63707
|
-
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,
|
|
63781
|
+
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;
|
|
63708
63782
|
|
|
63709
63783
|
|
|
63710
63784
|
|
|
@@ -63720,7 +63794,7 @@ class FormulaExpression extends _markupGenerator_Serializer_SugarSerializer__WEB
|
|
|
63720
63794
|
throw new Error(`${this.constructor} does not decorated with sugarNode() properly`);
|
|
63721
63795
|
}
|
|
63722
63796
|
}
|
|
63723
|
-
const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string");
|
|
63797
|
+
const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string", "dict", "array");
|
|
63724
63798
|
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 {
|
|
63725
63799
|
constructor(...args) {
|
|
63726
63800
|
super(...args);
|
|
@@ -64657,47 +64731,81 @@ let MathContainer = (_dec153 = (0,_markupGenerator_Serializer_SugarSerializer__W
|
|
|
64657
64731
|
writable: true,
|
|
64658
64732
|
initializer: null
|
|
64659
64733
|
})), _class129)) || _class128);
|
|
64660
|
-
let
|
|
64734
|
+
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 {
|
|
64661
64735
|
constructor(...args) {
|
|
64662
64736
|
super(...args);
|
|
64663
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
64664
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
64665
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor92, this);
|
|
64737
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor90, this);
|
|
64738
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValueExpression", _descriptor91, this);
|
|
64666
64739
|
}
|
|
64667
|
-
}, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "
|
|
64740
|
+
}, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec157], {
|
|
64668
64741
|
configurable: true,
|
|
64669
64742
|
enumerable: true,
|
|
64670
64743
|
writable: true,
|
|
64671
64744
|
initializer: null
|
|
64672
|
-
}), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "
|
|
64745
|
+
}), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValueExpression", [_dec158], {
|
|
64673
64746
|
configurable: true,
|
|
64674
64747
|
enumerable: true,
|
|
64675
64748
|
writable: true,
|
|
64676
64749
|
initializer: null
|
|
64677
|
-
}),
|
|
64750
|
+
})), _class131)) || _class130);
|
|
64751
|
+
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 {
|
|
64752
|
+
constructor(...args) {
|
|
64753
|
+
super(...args);
|
|
64754
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dictPath", _descriptor92, this);
|
|
64755
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor93, this);
|
|
64756
|
+
}
|
|
64757
|
+
}, (_descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "dictPath", [_dec160], {
|
|
64678
64758
|
configurable: true,
|
|
64679
64759
|
enumerable: true,
|
|
64680
64760
|
writable: true,
|
|
64681
64761
|
initializer: null
|
|
64682
|
-
})
|
|
64683
|
-
|
|
64762
|
+
}), _descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
|
|
64763
|
+
configurable: true,
|
|
64764
|
+
enumerable: true,
|
|
64765
|
+
writable: true,
|
|
64766
|
+
initializer: null
|
|
64767
|
+
})), _class133)) || _class132);
|
|
64768
|
+
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 {
|
|
64684
64769
|
constructor(...args) {
|
|
64685
64770
|
super(...args);
|
|
64686
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys",
|
|
64687
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath",
|
|
64771
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor94, this);
|
|
64772
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor95, this);
|
|
64773
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor96, this);
|
|
64688
64774
|
}
|
|
64689
|
-
}, (
|
|
64775
|
+
}, (_descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "targetKeys", [_dec163], {
|
|
64690
64776
|
configurable: true,
|
|
64691
64777
|
enumerable: true,
|
|
64692
64778
|
writable: true,
|
|
64693
64779
|
initializer: null
|
|
64694
|
-
}),
|
|
64780
|
+
}), _descriptor95 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceKeyPath", [_dec164], {
|
|
64695
64781
|
configurable: true,
|
|
64696
64782
|
enumerable: true,
|
|
64697
64783
|
writable: true,
|
|
64698
64784
|
initializer: null
|
|
64699
|
-
})
|
|
64700
|
-
|
|
64785
|
+
}), _descriptor96 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceValuePath", [_dec165], {
|
|
64786
|
+
configurable: true,
|
|
64787
|
+
enumerable: true,
|
|
64788
|
+
writable: true,
|
|
64789
|
+
initializer: null
|
|
64790
|
+
})), _class135)) || _class134);
|
|
64791
|
+
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 {
|
|
64792
|
+
constructor(...args) {
|
|
64793
|
+
super(...args);
|
|
64794
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor97, this);
|
|
64795
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor98, this);
|
|
64796
|
+
}
|
|
64797
|
+
}, (_descriptor97 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "targetKeys", [_dec167], {
|
|
64798
|
+
configurable: true,
|
|
64799
|
+
enumerable: true,
|
|
64800
|
+
writable: true,
|
|
64801
|
+
initializer: null
|
|
64802
|
+
}), _descriptor98 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "sourceKeyPath", [_dec168], {
|
|
64803
|
+
configurable: true,
|
|
64804
|
+
enumerable: true,
|
|
64805
|
+
writable: true,
|
|
64806
|
+
initializer: null
|
|
64807
|
+
})), _class137)) || _class136);
|
|
64808
|
+
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];
|
|
64701
64809
|
|
|
64702
64810
|
/***/ }),
|
|
64703
64811
|
|
|
@@ -67157,7 +67265,7 @@ class LazyLoadDeclarationGenerator {
|
|
|
67157
67265
|
thresholdValue: lazyLoadingNodeDeclaration.thresholdValue
|
|
67158
67266
|
};
|
|
67159
67267
|
}
|
|
67160
|
-
const result =
|
|
67268
|
+
const result = LazyLoadDeclarationGenerator.replaceHolder(`
|
|
67161
67269
|
export default function lazyLoadDeclaration() {
|
|
67162
67270
|
return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
|
|
67163
67271
|
space: " "
|
|
@@ -67169,6 +67277,16 @@ class LazyLoadDeclarationGenerator {
|
|
|
67169
67277
|
declaration: declaration
|
|
67170
67278
|
};
|
|
67171
67279
|
}
|
|
67280
|
+
static convertDeclarationToContent(declaration) {
|
|
67281
|
+
const result = LazyLoadDeclarationGenerator.replaceHolder(`
|
|
67282
|
+
export default function lazyLoadDeclaration() {
|
|
67283
|
+
return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
|
|
67284
|
+
space: " "
|
|
67285
|
+
})};
|
|
67286
|
+
};`);
|
|
67287
|
+
const content = unescape(result.replace(/(\\)(u[\dA-Fa-f]{4})/g, "%$2"));
|
|
67288
|
+
return content;
|
|
67289
|
+
}
|
|
67172
67290
|
*extractLazyLoadingDeclarationFromSugar(sugarRoot) {
|
|
67173
67291
|
const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.getNodeClass)(sugarRoot));
|
|
67174
67292
|
if (controlConverterClass != undefined) {
|
|
@@ -67247,7 +67365,7 @@ class LazyLoadDeclarationGenerator {
|
|
|
67247
67365
|
yield* this.processElement(nextPath, child);
|
|
67248
67366
|
}
|
|
67249
67367
|
}
|
|
67250
|
-
replaceHolder(decl) {
|
|
67368
|
+
static replaceHolder(decl) {
|
|
67251
67369
|
let replacedDecl = decl;
|
|
67252
67370
|
for (const [placeholderName, placeHoldersFunction] of (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.iterateEntries)(_DataDeclarationGenerator_placeholders__WEBPACK_IMPORTED_MODULE_2__.placeHolders)) {
|
|
67253
67371
|
const checkName = `"#(${placeholderName})(\\('[\\w]*'\\))?#"`;
|
|
@@ -67370,7 +67488,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67370
67488
|
|
|
67371
67489
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
67372
67490
|
try {
|
|
67373
|
-
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;
|
|
67491
|
+
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;
|
|
67374
67492
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
67375
67493
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
|
|
67376
67494
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
|
|
@@ -67407,15 +67525,21 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67407
67525
|
const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
|
|
67408
67526
|
const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
|
|
67409
67527
|
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");
|
|
67410
|
-
const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper)
|
|
67411
|
-
|
|
67528
|
+
const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper), {
|
|
67529
|
+
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
|
|
67530
|
+
});
|
|
67531
|
+
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, {
|
|
67532
|
+
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
|
|
67533
|
+
});
|
|
67412
67534
|
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
67413
67535
|
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
67414
67536
|
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
|
|
67415
67537
|
const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, useSchemaValidations);
|
|
67416
67538
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
67417
67539
|
const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
67418
|
-
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder
|
|
67540
|
+
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
|
|
67541
|
+
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
|
|
67542
|
+
});
|
|
67419
67543
|
const formulaAndInitOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_41__.FormulaAndInitOnlyNormalizationRuleGenerator(sugarRulesBuilder, formulaRulesBuilder, optionalSectionRuleBuilder, formSchemaRng);
|
|
67420
67544
|
const autoValueForValueByDefaultNormalizationRuleGenerator = new _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_45__.AutoValueForValueByDefaultNormalizationRuleGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, dataDeclarationHelper);
|
|
67421
67545
|
const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_21__.FormSourcesBuilder(additionalContent.formSourcesPath);
|
|
@@ -67423,23 +67547,24 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67423
67547
|
markupGenerator.generate(sugarRoot, builder);
|
|
67424
67548
|
builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_9__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
|
|
67425
67549
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
67426
|
-
builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
|
|
67427
67550
|
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
67428
67551
|
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
67429
67552
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
67430
67553
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
67431
|
-
|
|
67432
|
-
|
|
67554
|
+
let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
|
|
67555
|
+
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) {
|
|
67556
|
+
var _additionalContent$fo13, _additionalContent$fo14, _additionalContent$fo15;
|
|
67433
67557
|
const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
|
|
67558
|
+
finalLazyLoadDeclaration = mixLazyLoadingDeclarationWithServerOnlyPaths(lazyLoadGeneratorResult.declaration, defaultNormalizationRules.serverOnlyPaths);
|
|
67434
67559
|
const customNormalizers = [{
|
|
67435
67560
|
normalizerId: "formulas",
|
|
67436
|
-
content: (_additionalContent$
|
|
67561
|
+
content: (_additionalContent$fo13 = additionalContent.formJsonSettings) !== null && _additionalContent$fo13 !== void 0 && _additionalContent$fo13.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
|
|
67437
67562
|
}, {
|
|
67438
67563
|
normalizerId: "formulasWithInitializers",
|
|
67439
|
-
content: (_additionalContent$
|
|
67564
|
+
content: (_additionalContent$fo14 = additionalContent.formJsonSettings) !== null && _additionalContent$fo14 !== void 0 && _additionalContent$fo14.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
|
|
67440
67565
|
}, {
|
|
67441
67566
|
normalizerId: "autoValueForValueByDefault",
|
|
67442
|
-
content: (_additionalContent$
|
|
67567
|
+
content: (_additionalContent$fo15 = additionalContent.formJsonSettings) !== null && _additionalContent$fo15 !== void 0 && _additionalContent$fo15.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
|
|
67443
67568
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
67444
67569
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
67445
67570
|
switch (additionalNormalizer.extension) {
|
|
@@ -67463,9 +67588,10 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67463
67588
|
throw new Error(`Cannot transform normalization file with ${additionalNormalizer.extension} extension`);
|
|
67464
67589
|
}
|
|
67465
67590
|
}) : [];
|
|
67466
|
-
const resultRules = combineFlangRules(defaultNormalizationRules, ...additionalNormalizationRules, ...customNormalizers);
|
|
67591
|
+
const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
|
|
67467
67592
|
builder.addServerSideResource("ServerSide.normalize", resultRules);
|
|
67468
67593
|
}
|
|
67594
|
+
builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
|
|
67469
67595
|
const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_27__.AttachmentPathsGenerator();
|
|
67470
67596
|
const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
|
|
67471
67597
|
builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
|
|
@@ -67506,6 +67632,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67506
67632
|
return (0,_common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__.processSugarErrors)(e, additionalContent.gfv);
|
|
67507
67633
|
}
|
|
67508
67634
|
}
|
|
67635
|
+
function mixLazyLoadingDeclarationWithServerOnlyPaths(declaration, paths) {
|
|
67636
|
+
const updateDeclaration = {
|
|
67637
|
+
...declaration
|
|
67638
|
+
};
|
|
67639
|
+
for (const path of paths) {
|
|
67640
|
+
updateDeclaration[path.toString()] = {
|
|
67641
|
+
lazyLoadMode: "serverOnly"
|
|
67642
|
+
};
|
|
67643
|
+
}
|
|
67644
|
+
return updateDeclaration;
|
|
67645
|
+
}
|
|
67509
67646
|
function combineFlangRules(baseRules, ...rules) {
|
|
67510
67647
|
const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
|
|
67511
67648
|
const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
|
|
@@ -67994,7 +68131,7 @@ class CustomKCLangToFlangRuleGenerator {
|
|
|
67994
68131
|
const result = [];
|
|
67995
68132
|
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));
|
|
67996
68133
|
if (isTargetAutoField) {
|
|
67997
|
-
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(
|
|
68134
|
+
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)));
|
|
67998
68135
|
} else {
|
|
67999
68136
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
68000
68137
|
}
|
|
@@ -68084,8 +68221,8 @@ class FLangValidationBuildContext {
|
|
|
68084
68221
|
buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
|
|
68085
68222
|
var _typeNode$base, _typeNode$description;
|
|
68086
68223
|
const validations = [];
|
|
68087
|
-
const valueReference =
|
|
68088
|
-
const autoValueReference =
|
|
68224
|
+
const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "value");
|
|
68225
|
+
const autoValueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "autoValue");
|
|
68089
68226
|
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;
|
|
68090
68227
|
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;
|
|
68091
68228
|
if (baseName != undefined) {
|
|
@@ -68108,7 +68245,7 @@ class FLangValidationBuildContext {
|
|
|
68108
68245
|
const schemaNode = this.schemaRng.getElementByPath(targetPath);
|
|
68109
68246
|
const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
|
|
68110
68247
|
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;
|
|
68111
|
-
const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(
|
|
68248
|
+
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);
|
|
68112
68249
|
const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
|
|
68113
68250
|
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);
|
|
68114
68251
|
const result = [];
|
|
@@ -68203,7 +68340,7 @@ class FLangValidationBuildContext {
|
|
|
68203
68340
|
const value = match === null || match === void 0 || (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
|
|
68204
68341
|
if (path != undefined && sign != undefined && value != undefined) {
|
|
68205
68342
|
const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
|
|
68206
|
-
const valueRef =
|
|
68343
|
+
const valueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(fullPath, "children");
|
|
68207
68344
|
const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression(valueRef);
|
|
68208
68345
|
const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(value);
|
|
68209
68346
|
const getOperation = () => {
|
|
@@ -68487,6 +68624,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68487
68624
|
/* harmony export */ ArgumentDeclarationExpression: () => (/* binding */ ArgumentDeclarationExpression),
|
|
68488
68625
|
/* harmony export */ ArgumentReferenceExpression: () => (/* binding */ ArgumentReferenceExpression),
|
|
68489
68626
|
/* harmony export */ ArrayExpression: () => (/* binding */ ArrayExpression),
|
|
68627
|
+
/* harmony export */ ArrayLengthExpression: () => (/* binding */ ArrayLengthExpression),
|
|
68490
68628
|
/* harmony export */ BinaryBooleanExpression: () => (/* binding */ BinaryBooleanExpression),
|
|
68491
68629
|
/* harmony export */ BinaryExpression: () => (/* binding */ BinaryExpression),
|
|
68492
68630
|
/* harmony export */ BoolLiteralExpression: () => (/* binding */ BoolLiteralExpression),
|
|
@@ -68506,6 +68644,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68506
68644
|
/* harmony export */ DifferenceInMonthsExpression: () => (/* binding */ DifferenceInMonthsExpression),
|
|
68507
68645
|
/* harmony export */ DivisionBinaryExpression: () => (/* binding */ DivisionBinaryExpression),
|
|
68508
68646
|
/* harmony export */ EqExpression: () => (/* binding */ EqExpression),
|
|
68647
|
+
/* harmony export */ ExistsExpression: () => (/* binding */ ExistsExpression),
|
|
68509
68648
|
/* harmony export */ FLangBoolExpression: () => (/* binding */ FLangBoolExpression),
|
|
68510
68649
|
/* harmony export */ FLangDecimalExpression: () => (/* binding */ FLangDecimalExpression),
|
|
68511
68650
|
/* harmony export */ FLangDictExpression: () => (/* binding */ FLangDictExpression),
|
|
@@ -68657,7 +68796,7 @@ class ValueReferenceExpression extends FLangExpression {
|
|
|
68657
68796
|
return [];
|
|
68658
68797
|
}
|
|
68659
68798
|
getType() {
|
|
68660
|
-
return BuildInTypeExpression.
|
|
68799
|
+
return BuildInTypeExpression.object;
|
|
68661
68800
|
}
|
|
68662
68801
|
convertToString() {
|
|
68663
68802
|
return `${toFLangString(this.modePath)}.${this.valueName}`;
|
|
@@ -68855,6 +68994,7 @@ class BuildInTypeExpression extends TypeReferenceExpression {
|
|
|
68855
68994
|
}
|
|
68856
68995
|
}
|
|
68857
68996
|
_BuildInTypeExpression = BuildInTypeExpression;
|
|
68997
|
+
BuildInTypeExpression.object = new _BuildInTypeExpression("object");
|
|
68858
68998
|
BuildInTypeExpression.decimal = new _BuildInTypeExpression("decimal");
|
|
68859
68999
|
BuildInTypeExpression.string = new _BuildInTypeExpression("string");
|
|
68860
69000
|
BuildInTypeExpression.dict = new _BuildInTypeExpression("dict");
|
|
@@ -69111,7 +69251,7 @@ class StringLiteralExpression extends ConstExpression {
|
|
|
69111
69251
|
return JSON.stringify(this.stringValue);
|
|
69112
69252
|
}
|
|
69113
69253
|
}
|
|
69114
|
-
class DecimalLiteralExpression extends
|
|
69254
|
+
class DecimalLiteralExpression extends ConstExpression {
|
|
69115
69255
|
constructor(value) {
|
|
69116
69256
|
super();
|
|
69117
69257
|
this.value = void 0;
|
|
@@ -69128,6 +69268,11 @@ class DecimalLiteralExpression extends FLangDecimalExpression {
|
|
|
69128
69268
|
}
|
|
69129
69269
|
}
|
|
69130
69270
|
class DictLiteralExpression extends FLangExpression {
|
|
69271
|
+
constructor(value) {
|
|
69272
|
+
super();
|
|
69273
|
+
this.value = void 0;
|
|
69274
|
+
this.value = value;
|
|
69275
|
+
}
|
|
69131
69276
|
getChildNodes() {
|
|
69132
69277
|
return [];
|
|
69133
69278
|
}
|
|
@@ -69135,7 +69280,9 @@ class DictLiteralExpression extends FLangExpression {
|
|
|
69135
69280
|
return BuildInTypeExpression.dict;
|
|
69136
69281
|
}
|
|
69137
69282
|
convertToString() {
|
|
69138
|
-
|
|
69283
|
+
var _this$value;
|
|
69284
|
+
const argument = this.value != undefined ? (_this$value = this.value) === null || _this$value === void 0 ? void 0 : _this$value.convertToString() : "";
|
|
69285
|
+
return `dict(${argument})`;
|
|
69139
69286
|
}
|
|
69140
69287
|
}
|
|
69141
69288
|
class BoolLiteralExpression extends ConstExpression {
|
|
@@ -69681,7 +69828,39 @@ class ArrayExpression extends FLangExpression {
|
|
|
69681
69828
|
}
|
|
69682
69829
|
convertToString() {
|
|
69683
69830
|
const items = this.items.map(x => x.convertToString()).join(", ");
|
|
69684
|
-
return `
|
|
69831
|
+
return `makeArray(${items})`;
|
|
69832
|
+
}
|
|
69833
|
+
}
|
|
69834
|
+
class ArrayLengthExpression extends FLangExpression {
|
|
69835
|
+
constructor(expression) {
|
|
69836
|
+
super();
|
|
69837
|
+
this.expression = void 0;
|
|
69838
|
+
this.expression = expression;
|
|
69839
|
+
}
|
|
69840
|
+
getType() {
|
|
69841
|
+
return BuildInTypeExpression.decimal;
|
|
69842
|
+
}
|
|
69843
|
+
*getChildNodes() {
|
|
69844
|
+
yield this.expression;
|
|
69845
|
+
}
|
|
69846
|
+
convertToString() {
|
|
69847
|
+
return `arrayLength(${this.expression.convertToString()})`;
|
|
69848
|
+
}
|
|
69849
|
+
}
|
|
69850
|
+
class ExistsExpression extends FLangExpression {
|
|
69851
|
+
constructor(source) {
|
|
69852
|
+
super();
|
|
69853
|
+
this.source = void 0;
|
|
69854
|
+
this.source = source;
|
|
69855
|
+
}
|
|
69856
|
+
getType() {
|
|
69857
|
+
return BuildInTypeExpression.bool;
|
|
69858
|
+
}
|
|
69859
|
+
*getChildNodes() {
|
|
69860
|
+
yield this.source;
|
|
69861
|
+
}
|
|
69862
|
+
convertToString() {
|
|
69863
|
+
return `exists(${this.source.convertToString()})`;
|
|
69685
69864
|
}
|
|
69686
69865
|
}
|
|
69687
69866
|
class NullCoalesceExpression extends FLangExpression {
|
|
@@ -69817,7 +69996,7 @@ class GetOldExpression extends FLangExpression {
|
|
|
69817
69996
|
return [];
|
|
69818
69997
|
}
|
|
69819
69998
|
getType() {
|
|
69820
|
-
return
|
|
69999
|
+
return this.expression.getType();
|
|
69821
70000
|
}
|
|
69822
70001
|
convertToString() {
|
|
69823
70002
|
return `old(${this.expression.convertToString()})`;
|
|
@@ -69852,6 +70031,9 @@ class SetStatement extends FLangStatement {
|
|
|
69852
70031
|
"use strict";
|
|
69853
70032
|
__webpack_require__.r(__webpack_exports__);
|
|
69854
70033
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
70034
|
+
/* harmony export */ arrayFieldNameSuffix: () => (/* binding */ arrayFieldNameSuffix),
|
|
70035
|
+
/* harmony export */ castFinalExpressionToStringIfNeed: () => (/* binding */ castFinalExpressionToStringIfNeed),
|
|
70036
|
+
/* harmony export */ castOperandIfNeed: () => (/* binding */ castOperandIfNeed),
|
|
69855
70037
|
/* harmony export */ castOperandToBoolIfNeed: () => (/* binding */ castOperandToBoolIfNeed),
|
|
69856
70038
|
/* harmony export */ castOperandToDateTimeIfNeed: () => (/* binding */ castOperandToDateTimeIfNeed),
|
|
69857
70039
|
/* harmony export */ castOperandToDecimalIfNeed: () => (/* binding */ castOperandToDecimalIfNeed),
|
|
@@ -69860,19 +70042,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
69860
70042
|
/* harmony export */ combineByOrFlangExpr: () => (/* binding */ combineByOrFlangExpr),
|
|
69861
70043
|
/* harmony export */ combineRulesWithOptionalSectionChecking: () => (/* binding */ combineRulesWithOptionalSectionChecking),
|
|
69862
70044
|
/* harmony export */ decimalWrapper: () => (/* binding */ decimalWrapper),
|
|
70045
|
+
/* harmony export */ dictFieldNameSuffix: () => (/* binding */ dictFieldNameSuffix),
|
|
70046
|
+
/* harmony export */ ensureCorrectFieldNameByExpressionType: () => (/* binding */ ensureCorrectFieldNameByExpressionType),
|
|
69863
70047
|
/* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
|
|
70048
|
+
/* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
|
|
69864
70049
|
/* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
|
|
70050
|
+
/* harmony export */ hashSetFieldNameSuffix: () => (/* binding */ hashSetFieldNameSuffix),
|
|
70051
|
+
/* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
|
|
70052
|
+
/* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
|
|
70053
|
+
/* harmony export */ makeStringValueReference: () => (/* binding */ makeStringValueReference),
|
|
69865
70054
|
/* harmony export */ nullCoalesceWithTypeCheck: () => (/* binding */ nullCoalesceWithTypeCheck),
|
|
69866
70055
|
/* harmony export */ tryExtractValueReferenceAsStringFromDecimal: () => (/* binding */ tryExtractValueReferenceAsStringFromDecimal),
|
|
69867
70056
|
/* harmony export */ wrapWithArgumentsCondition: () => (/* binding */ wrapWithArgumentsCondition),
|
|
69868
70057
|
/* harmony export */ wrapWithDisableValueAutoInitFlagCheckIfRequired: () => (/* binding */ wrapWithDisableValueAutoInitFlagCheckIfRequired)
|
|
69869
70058
|
/* harmony export */ });
|
|
69870
|
-
/* harmony import */ var
|
|
69871
|
-
/* harmony import */ var
|
|
69872
|
-
/* harmony import */ var
|
|
70059
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
|
|
70060
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
|
|
70061
|
+
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
70062
|
+
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70063
|
+
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
70064
|
+
/* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
69873
70065
|
|
|
69874
70066
|
|
|
69875
70067
|
|
|
70068
|
+
|
|
70069
|
+
|
|
70070
|
+
const dictFieldNameSuffix = "_dict";
|
|
70071
|
+
const arrayFieldNameSuffix = "_array";
|
|
70072
|
+
const hashSetFieldNameSuffix = "_hashSet";
|
|
69876
70073
|
function* getAllExpressionChildren(node, descendantsFilter) {
|
|
69877
70074
|
const children = node.getChildNodes();
|
|
69878
70075
|
for (const child of children) {
|
|
@@ -69883,75 +70080,138 @@ function* getAllExpressionChildren(node, descendantsFilter) {
|
|
|
69883
70080
|
}
|
|
69884
70081
|
}
|
|
69885
70082
|
function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression) {
|
|
69886
|
-
return new
|
|
70083
|
+
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));
|
|
69887
70084
|
}
|
|
69888
70085
|
function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
|
|
69889
70086
|
var _formSchemaRng$getEle;
|
|
69890
|
-
return x instanceof
|
|
70087
|
+
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];
|
|
69891
70088
|
}
|
|
69892
70089
|
function wrapWithArgumentsCondition(expression) {
|
|
69893
|
-
const childFilter = node => !(node instanceof
|
|
69894
|
-
const allValueRefNodes =
|
|
69895
|
-
const uniquePaths =
|
|
69896
|
-
const conditionExpression =
|
|
69897
|
-
const currExpr = new
|
|
69898
|
-
return acc != undefined ? new
|
|
70090
|
+
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);
|
|
70091
|
+
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);
|
|
70092
|
+
const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
|
|
70093
|
+
const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
|
|
70094
|
+
const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ExistsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(curr.modePath, curr.valueName));
|
|
70095
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, currExpr) : currExpr;
|
|
69899
70096
|
}, undefined);
|
|
69900
70097
|
if (conditionExpression == undefined) {
|
|
69901
70098
|
return expression;
|
|
69902
70099
|
}
|
|
69903
|
-
return new
|
|
70100
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression());
|
|
69904
70101
|
}
|
|
69905
70102
|
function combineRulesWithOptionalSectionChecking(allRules, optionalSectionRulesBuilder) {
|
|
69906
|
-
const allUniqueRules =
|
|
70103
|
+
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());
|
|
69907
70104
|
const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
|
|
69908
70105
|
return allUniqueRulesWithOptionalChecks;
|
|
69909
70106
|
}
|
|
69910
70107
|
function tryExtractValueReferenceAsStringFromDecimal(expression) {
|
|
69911
|
-
if (expression.getType() ===
|
|
70108
|
+
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) {
|
|
69912
70109
|
return expression.targetExpression;
|
|
69913
70110
|
}
|
|
69914
70111
|
return expression;
|
|
69915
70112
|
}
|
|
70113
|
+
function castFinalExpressionToStringIfNeed(operandExpression, enableTypedExpression, decimalFormat = "G29") {
|
|
70114
|
+
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)) {
|
|
70115
|
+
return operandExpression;
|
|
70116
|
+
}
|
|
70117
|
+
return castOperandToStringIfNeed(operandExpression, decimalFormat);
|
|
70118
|
+
}
|
|
69916
70119
|
function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
|
|
69917
|
-
if (operandExpression instanceof
|
|
69918
|
-
return new
|
|
70120
|
+
if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateNowExpression) {
|
|
70121
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("dd.MM.yyyy"));
|
|
70122
|
+
}
|
|
70123
|
+
if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet) {
|
|
70124
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SerializeEnumerationExpression(operandExpression);
|
|
69919
70125
|
}
|
|
69920
|
-
|
|
69921
|
-
|
|
70126
|
+
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;
|
|
70127
|
+
}
|
|
70128
|
+
function castOperandIfNeed(operandExpression, type) {
|
|
70129
|
+
if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression) {
|
|
70130
|
+
return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, type) : operandExpression;
|
|
69922
70131
|
}
|
|
69923
|
-
return
|
|
70132
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
|
|
69924
70133
|
}
|
|
69925
70134
|
function castOperandToBoolIfNeed(operandExpression) {
|
|
69926
|
-
return operandExpression.getType() !=
|
|
70135
|
+
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;
|
|
69927
70136
|
}
|
|
69928
70137
|
function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
|
|
69929
|
-
return operandExpression.getType() !==
|
|
70138
|
+
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;
|
|
69930
70139
|
}
|
|
69931
|
-
const decimalWrapper = (ex, needWrapped) => needWrapped ?
|
|
70140
|
+
const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
|
|
69932
70141
|
function castOperandToDateTimeIfNeed(operandExpression) {
|
|
69933
|
-
return operandExpression.getType() !=
|
|
70142
|
+
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;
|
|
69934
70143
|
}
|
|
69935
70144
|
function nullCoalesceWithTypeCheck(argument, replacement) {
|
|
69936
|
-
const isValid = argument.getType() === replacement.getType() || argument.getType() ===
|
|
70145
|
+
const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null;
|
|
69937
70146
|
if (!isValid) {
|
|
69938
70147
|
throw new Error("Couldn't build null coalesce expression: types not match");
|
|
69939
70148
|
}
|
|
69940
|
-
return new
|
|
70149
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression(argument, replacement);
|
|
69941
70150
|
}
|
|
69942
70151
|
function ensureOperandsOfTypeOrNull(type, ...operands) {
|
|
69943
70152
|
for (const operand of operands) {
|
|
69944
70153
|
const operandType = operand.getType();
|
|
69945
|
-
if (operandType !==
|
|
70154
|
+
if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null && operandType !== type) {
|
|
69946
70155
|
throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
|
|
69947
70156
|
}
|
|
69948
70157
|
}
|
|
69949
70158
|
}
|
|
69950
70159
|
function combineByOrFlangExpr(acc, current) {
|
|
69951
|
-
return acc != undefined ? new
|
|
70160
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, current) : current;
|
|
69952
70161
|
}
|
|
69953
70162
|
function combineByAndFlangExpr(acc, current) {
|
|
69954
|
-
return acc != undefined ? new
|
|
70163
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(acc, current) : current;
|
|
70164
|
+
}
|
|
70165
|
+
function makeNoDeps(expression) {
|
|
70166
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70167
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression);
|
|
70168
|
+
}
|
|
70169
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70170
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
70171
|
+
}
|
|
70172
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
70173
|
+
}
|
|
70174
|
+
function makeGetOld(expression) {
|
|
70175
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70176
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression);
|
|
70177
|
+
}
|
|
70178
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70179
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
70180
|
+
}
|
|
70181
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
70182
|
+
}
|
|
70183
|
+
function makeStringValueReference(modePath, valueName) {
|
|
70184
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string);
|
|
70185
|
+
}
|
|
70186
|
+
function extractValueReferenceFromCast(expression) {
|
|
70187
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70188
|
+
return expression;
|
|
70189
|
+
}
|
|
70190
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
|
|
70191
|
+
return expression.targetExpression;
|
|
70192
|
+
}
|
|
70193
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression) {
|
|
70194
|
+
return expression.targetExpression;
|
|
70195
|
+
}
|
|
70196
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
|
|
70197
|
+
}
|
|
70198
|
+
function ensureCorrectFieldNameByExpressionType(statement) {
|
|
70199
|
+
if (statement instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement) {
|
|
70200
|
+
const lastPart = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(statement.left.modePath.getPathParts());
|
|
70201
|
+
const lastStringPart = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.isSimpleToken(lastPart) ? lastPart : "";
|
|
70202
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict && !lastStringPart.endsWith(dictFieldNameSuffix)) {
|
|
70203
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${dictFieldNameSuffix}"`);
|
|
70204
|
+
}
|
|
70205
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet && !lastStringPart.endsWith(hashSetFieldNameSuffix)) {
|
|
70206
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${hashSetFieldNameSuffix}"`);
|
|
70207
|
+
}
|
|
70208
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array && !lastStringPart.endsWith(arrayFieldNameSuffix)) {
|
|
70209
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${arrayFieldNameSuffix}"`);
|
|
70210
|
+
}
|
|
70211
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string && (lastStringPart.endsWith(arrayFieldNameSuffix) || lastStringPart.endsWith(hashSetFieldNameSuffix) || lastStringPart.endsWith(dictFieldNameSuffix))) {
|
|
70212
|
+
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must NOT be "${arrayFieldNameSuffix}", "${hashSetFieldNameSuffix}" or "${dictFieldNameSuffix}"`);
|
|
70213
|
+
}
|
|
70214
|
+
}
|
|
69955
70215
|
}
|
|
69956
70216
|
|
|
69957
70217
|
/***/ }),
|
|
@@ -70127,8 +70387,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70127
70387
|
/* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
|
|
70128
70388
|
/* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
|
|
70129
70389
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70130
|
-
/* harmony import */ var
|
|
70131
|
-
/* harmony import */ var
|
|
70390
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
70391
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
70392
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
70393
|
+
|
|
70132
70394
|
|
|
70133
70395
|
|
|
70134
70396
|
|
|
@@ -70139,14 +70401,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70139
70401
|
|
|
70140
70402
|
|
|
70141
70403
|
class FormulaExpressionToFlangExpressionConverter {
|
|
70142
|
-
constructor(adjustPathMultiplicityFunc) {
|
|
70404
|
+
constructor(adjustPathMultiplicityFunc, options) {
|
|
70143
70405
|
this.adjustPathMultiplicity = void 0;
|
|
70406
|
+
this.options = void 0;
|
|
70407
|
+
this.options = options;
|
|
70144
70408
|
this.adjustPathMultiplicity = adjustPathMultiplicityFunc;
|
|
70145
70409
|
}
|
|
70146
70410
|
compileExpressionToFlangExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70147
70411
|
const resultExpr = this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
|
|
70148
70412
|
// Если формула это только прямое обращение к значене, то трактовать его как строку
|
|
70149
|
-
if (resultExpr instanceof
|
|
70413
|
+
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) {
|
|
70150
70414
|
return resultExpr.targetExpression;
|
|
70151
70415
|
}
|
|
70152
70416
|
return resultExpr;
|
|
@@ -70163,24 +70427,24 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70163
70427
|
return this.compiledArgumentExpression(prefix, target, expression.select, "decimal", addPrecalculationRule);
|
|
70164
70428
|
}
|
|
70165
70429
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAbsExpression) {
|
|
70166
|
-
return new
|
|
70430
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70167
70431
|
}
|
|
70168
70432
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaXAbsExpression) {
|
|
70169
|
-
const expr = (0,
|
|
70170
|
-
return new
|
|
70433
|
+
const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
|
|
70434
|
+
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));
|
|
70171
70435
|
}
|
|
70172
70436
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRoundExpression) {
|
|
70173
|
-
return new
|
|
70437
|
+
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));
|
|
70174
70438
|
}
|
|
70175
70439
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFloorExpression) {
|
|
70176
|
-
return new
|
|
70440
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70177
70441
|
}
|
|
70178
70442
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaChooseExpression) {
|
|
70179
70443
|
const condExpr = this.compileExpressionToFlangExpressionInternal(expression.ifNode.condition, prefix, target, addPrecalculationRule);
|
|
70180
70444
|
const thenExpr = this.compileExpressionToFlangExpressionInternal(expression.thenNode.expression, prefix, target, addPrecalculationRule);
|
|
70181
70445
|
const elseExpr = this.compileExpressionToFlangExpressionInternal(expression.elseNode.expression, prefix, target, addPrecalculationRule);
|
|
70182
|
-
const castToStringRequired = thenExpr.getType() ===
|
|
70183
|
-
return new
|
|
70446
|
+
const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
|
|
70447
|
+
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);
|
|
70184
70448
|
}
|
|
70185
70449
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultiplyExpression) {
|
|
70186
70450
|
return this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule);
|
|
@@ -70192,14 +70456,14 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70192
70456
|
return this.compileAndExpression(expression, prefix, target, addPrecalculationRule);
|
|
70193
70457
|
}
|
|
70194
70458
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNotExpression) {
|
|
70195
|
-
return new
|
|
70459
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
|
|
70196
70460
|
}
|
|
70197
70461
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConstExpression) {
|
|
70198
70462
|
switch (expression.type) {
|
|
70199
70463
|
case "string":
|
|
70200
|
-
return new
|
|
70464
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.value);
|
|
70201
70465
|
case "decimal":
|
|
70202
|
-
return new
|
|
70466
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.value);
|
|
70203
70467
|
default:
|
|
70204
70468
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Unknown constant type!");
|
|
70205
70469
|
}
|
|
@@ -70208,35 +70472,35 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70208
70472
|
return this.compileDivisionExpression(expression, prefix, target, addPrecalculationRule);
|
|
70209
70473
|
}
|
|
70210
70474
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMinusExpression) {
|
|
70211
|
-
return new
|
|
70475
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70212
70476
|
}
|
|
70213
70477
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGtExpression) {
|
|
70214
70478
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70215
70479
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70216
70480
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70217
70481
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70218
|
-
return new
|
|
70482
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GtExpression(left, right);
|
|
70219
70483
|
}
|
|
70220
70484
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLtExpression) {
|
|
70221
70485
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70222
70486
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70223
70487
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70224
70488
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70225
|
-
return new
|
|
70489
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression(left, right);
|
|
70226
70490
|
}
|
|
70227
70491
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGeExpression) {
|
|
70228
70492
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70229
70493
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70230
70494
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70231
70495
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70232
|
-
return new
|
|
70496
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GeExpression(left, right);
|
|
70233
70497
|
}
|
|
70234
70498
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLeExpression) {
|
|
70235
70499
|
const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
70236
70500
|
const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
|
|
70237
70501
|
const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
|
|
70238
70502
|
const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
|
|
70239
|
-
return new
|
|
70503
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LeExpression(left, right);
|
|
70240
70504
|
}
|
|
70241
70505
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaEqExpression) {
|
|
70242
70506
|
return this.compileEqExpression(prefix, target, expression, addPrecalculationRule);
|
|
@@ -70246,105 +70510,105 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70246
70510
|
// TODO: тут необходимо учесть, что exists может смотреть на множественность
|
|
70247
70511
|
// TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
|
|
70248
70512
|
/* eslint-enable no-warning-comments */
|
|
70249
|
-
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70250
|
-
return new
|
|
70513
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule));
|
|
70514
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ExistsExpression(arg);
|
|
70251
70515
|
}
|
|
70252
70516
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaWhenExpression) {
|
|
70253
70517
|
const condition = this.compileExpressionToFlangExpressionInternal(expression.expressions[0], prefix, target, addPrecalculationRule);
|
|
70254
70518
|
const thenExpression = this.compileExpressionToFlangExpressionInternal(expression.expressions[1], prefix, target, addPrecalculationRule);
|
|
70255
|
-
return new
|
|
70519
|
+
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)));
|
|
70256
70520
|
}
|
|
70257
70521
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
|
|
70258
70522
|
const arg = this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule);
|
|
70259
|
-
const correctedArg = (0,
|
|
70260
|
-
return new
|
|
70523
|
+
const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
|
|
70524
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
|
|
70261
70525
|
}
|
|
70262
70526
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaCountExpression) {
|
|
70263
|
-
return (0,
|
|
70527
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
|
|
70264
70528
|
}
|
|
70265
70529
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLengthExpression) {
|
|
70266
|
-
return new
|
|
70530
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
|
|
70267
70531
|
}
|
|
70268
70532
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConcatExpression) {
|
|
70269
70533
|
return this.compileConcatExpression(expression, prefix, target, addPrecalculationRule);
|
|
70270
70534
|
}
|
|
70271
70535
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSubstringExpression) {
|
|
70272
70536
|
const arg = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70273
|
-
const argAsString = (0,
|
|
70274
|
-
return new
|
|
70537
|
+
const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal ? "G29" : undefined);
|
|
70538
|
+
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));
|
|
70275
70539
|
}
|
|
70276
70540
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNewLineExpression) {
|
|
70277
|
-
return new
|
|
70541
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("\r\n");
|
|
70278
70542
|
}
|
|
70279
70543
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNoDepsNode) {
|
|
70280
70544
|
const noDepsExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70281
|
-
return
|
|
70545
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(noDepsExpression);
|
|
70282
70546
|
}
|
|
70283
70547
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
|
|
70284
|
-
return new
|
|
70548
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateNowExpression();
|
|
70285
70549
|
}
|
|
70286
70550
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDaysInMonthExpression) {
|
|
70287
|
-
return new
|
|
70551
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70288
70552
|
}
|
|
70289
70553
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDayExpression) {
|
|
70290
|
-
return new
|
|
70554
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70291
70555
|
}
|
|
70292
70556
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetMonthExpression) {
|
|
70293
|
-
return new
|
|
70557
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70294
70558
|
}
|
|
70295
70559
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetYearExpression) {
|
|
70296
|
-
return new
|
|
70560
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70297
70561
|
}
|
|
70298
70562
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsDateExpression) {
|
|
70299
|
-
return new
|
|
70563
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
|
|
70300
70564
|
}
|
|
70301
70565
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInMonthsExpression) {
|
|
70302
|
-
const expressions = expression.arguments.map(x => (0,
|
|
70303
|
-
return new
|
|
70566
|
+
const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
|
|
70567
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInMonthsExpression(expressions);
|
|
70304
70568
|
}
|
|
70305
70569
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInDaysExpression) {
|
|
70306
|
-
const expressions = expression.arguments.map(x => (0,
|
|
70307
|
-
return new
|
|
70570
|
+
const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
|
|
70571
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInDaysExpression(expressions);
|
|
70308
70572
|
}
|
|
70309
70573
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddDaysExpression) {
|
|
70310
|
-
return new
|
|
70574
|
+
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));
|
|
70311
70575
|
}
|
|
70312
70576
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddMonthsExpression) {
|
|
70313
|
-
return new
|
|
70577
|
+
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));
|
|
70314
70578
|
}
|
|
70315
70579
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddYearsExpression) {
|
|
70316
|
-
return new
|
|
70580
|
+
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));
|
|
70317
70581
|
}
|
|
70318
70582
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateToStringExpression) {
|
|
70319
70583
|
var _expression$format;
|
|
70320
|
-
return new
|
|
70584
|
+
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"));
|
|
70321
70585
|
}
|
|
70322
70586
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression) {
|
|
70323
|
-
return new
|
|
70587
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dateTime);
|
|
70324
70588
|
}
|
|
70325
70589
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsSnilsExpression) {
|
|
70326
70590
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70327
|
-
return new
|
|
70591
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70328
70592
|
}
|
|
70329
70593
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsRegNumSfrExpression) {
|
|
70330
70594
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70331
|
-
return new
|
|
70595
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70332
70596
|
}
|
|
70333
70597
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsInnExpression) {
|
|
70334
70598
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70335
|
-
return new
|
|
70599
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70336
70600
|
}
|
|
70337
70601
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidMirCardNumberExpression) {
|
|
70338
70602
|
const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
|
|
70339
|
-
return new
|
|
70603
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
|
|
70340
70604
|
}
|
|
70341
70605
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArrayExpression) {
|
|
70342
70606
|
const items = expression.items.map(arg => this.compileEnumerationItem(arg, prefix, target, addPrecalculationRule));
|
|
70343
|
-
return new
|
|
70607
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArrayExpression(items);
|
|
70344
70608
|
}
|
|
70345
70609
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFirstOrDefaultExpression) {
|
|
70346
70610
|
const firstOrDefaultExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70347
|
-
return new
|
|
70611
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FirstOrDefaultExpression(firstOrDefaultExpression);
|
|
70348
70612
|
}
|
|
70349
70613
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHashSetExpression) {
|
|
70350
70614
|
if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
|
|
@@ -70360,21 +70624,21 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70360
70624
|
const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
70361
70625
|
const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
|
|
70362
70626
|
const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
|
|
70363
|
-
return new
|
|
70627
|
+
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());
|
|
70364
70628
|
}
|
|
70365
70629
|
}
|
|
70366
70630
|
const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
|
|
70367
|
-
return new
|
|
70631
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(hashSetExpression);
|
|
70368
70632
|
}
|
|
70369
70633
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression) {
|
|
70370
70634
|
const filterColumn = this.compileExpressionToFlangExpressionInternal(expression.filterColumn.filterColumn, prefix, target, addPrecalculationRule);
|
|
70371
70635
|
const filterKey = this.compileExpressionToFlangExpressionInternal(expression.filterKey.filterKey, prefix, target, addPrecalculationRule);
|
|
70372
|
-
return new
|
|
70636
|
+
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));
|
|
70373
70637
|
}
|
|
70374
70638
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidAccountNumberExpression) {
|
|
70375
70639
|
const bik = this.compiledArgumentExpression(prefix, target, expression.bik, "string", addPrecalculationRule);
|
|
70376
70640
|
const account = this.compiledArgumentExpression(prefix, target, expression.account, "string", addPrecalculationRule);
|
|
70377
|
-
return new
|
|
70641
|
+
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));
|
|
70378
70642
|
}
|
|
70379
70643
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupSumExpression) {
|
|
70380
70644
|
return this.compileGroupSumExpression(prefix, target, expression, addPrecalculationRule);
|
|
@@ -70382,18 +70646,30 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70382
70646
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupCountExpression) {
|
|
70383
70647
|
return this.compileGroupCountExpression(prefix, target, expression, addPrecalculationRule);
|
|
70384
70648
|
}
|
|
70649
|
+
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMakeDictExpression) {
|
|
70650
|
+
return this.compileMakeDictExpression(prefix, target, expression, addPrecalculationRule);
|
|
70651
|
+
}
|
|
70652
|
+
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetSumByKeysExpression) {
|
|
70653
|
+
return this.compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule);
|
|
70654
|
+
}
|
|
70385
70655
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOneOfExpression) {
|
|
70386
|
-
const arg = (0,
|
|
70387
|
-
const items = expression.items.expressions.map(item => (0,
|
|
70388
|
-
return new
|
|
70656
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
|
|
70657
|
+
const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
|
|
70658
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OneOfExpression(arg, items);
|
|
70389
70659
|
}
|
|
70390
70660
|
if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHasAutoFlagExpression) {
|
|
70391
|
-
const arg = (0,
|
|
70392
|
-
const
|
|
70393
|
-
|
|
70394
|
-
|
|
70395
|
-
|
|
70396
|
-
|
|
70661
|
+
const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
|
|
70662
|
+
const getValueReferenceExpression = () => {
|
|
70663
|
+
if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70664
|
+
return arg;
|
|
70665
|
+
}
|
|
70666
|
+
if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && arg.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70667
|
+
return arg.targetExpression;
|
|
70668
|
+
}
|
|
70669
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
|
|
70670
|
+
};
|
|
70671
|
+
const valueRefExpression = getValueReferenceExpression();
|
|
70672
|
+
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")));
|
|
70397
70673
|
return expr;
|
|
70398
70674
|
}
|
|
70399
70675
|
throw new Error(`Unsupported type of node: ${expression.constructor.name}, ${expression.sourceXmlNode.name}`);
|
|
@@ -70402,7 +70678,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70402
70678
|
if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
|
|
70403
70679
|
return flangExpression;
|
|
70404
70680
|
}
|
|
70405
|
-
return (0,
|
|
70681
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(flangExpression);
|
|
70406
70682
|
}
|
|
70407
70683
|
compileEqExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70408
70684
|
const left = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
|
|
@@ -70410,12 +70686,109 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70410
70686
|
|
|
70411
70687
|
// Сейчас в АР иногда проверку на decimal значение делаем через [Значение != "Какая-то строка"]
|
|
70412
70688
|
// Поэтому при такой проверке вычитываем поле "Значение" как строку
|
|
70413
|
-
if (left.getType() ===
|
|
70414
|
-
return new
|
|
70689
|
+
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) {
|
|
70690
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left.targetExpression), right);
|
|
70415
70691
|
}
|
|
70416
|
-
return new
|
|
70692
|
+
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));
|
|
70417
70693
|
}
|
|
70418
|
-
|
|
70694
|
+
compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70695
|
+
const getOldSourceValueExpression = () => {
|
|
70696
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70697
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression);
|
|
70698
|
+
}
|
|
70699
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
|
|
70700
|
+
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
|
|
70701
|
+
}
|
|
70702
|
+
if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
|
|
70703
|
+
return sourceValueExpression;
|
|
70704
|
+
}
|
|
70705
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`SourceValueExpression for makeDict must be reference to value or constant.
|
|
70706
|
+
Converted Object: ${JSON.stringify(sourceValueExpression)}`);
|
|
70707
|
+
};
|
|
70708
|
+
const oldSourceValueExpression = getOldSourceValueExpression();
|
|
70709
|
+
const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70710
|
+
const firstPart = matchedPaths.matchedPath.toCurrentIteration();
|
|
70711
|
+
const secondPart = matchedPaths.differentPath;
|
|
70712
|
+
const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
|
|
70713
|
+
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));
|
|
70714
|
+
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));
|
|
70715
|
+
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()));
|
|
70716
|
+
return reduceExpression;
|
|
70717
|
+
}
|
|
70718
|
+
compileMakeDictExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70719
|
+
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70720
|
+
const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
|
|
70721
|
+
const reduceExpression = this.compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70722
|
+
return reduceExpression;
|
|
70723
|
+
}
|
|
70724
|
+
compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule) {
|
|
70725
|
+
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 => {
|
|
70726
|
+
const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
|
|
70727
|
+
if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
|
|
70728
|
+
return item;
|
|
70729
|
+
}
|
|
70730
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
|
|
70731
|
+
}), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
|
|
70732
|
+
return deserializedKeys;
|
|
70733
|
+
}
|
|
70734
|
+
compileGetSumByKeysExpressionImpl(prefix, target, dictPath, targetKeys, addPrecalculationRule) {
|
|
70735
|
+
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);
|
|
70736
|
+
return finalValueExpression;
|
|
70737
|
+
}
|
|
70738
|
+
compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70739
|
+
const dictPath = this.preparePathAndAdjustMultiplicity(prefix, expression.dictPath);
|
|
70740
|
+
const targetKeys = expression.targetKeys;
|
|
70741
|
+
const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
|
|
70742
|
+
return this.compileGetSumByKeysExpressionImpl(prefix, target, dictPath, deserializedKeys, addPrecalculationRule);
|
|
70743
|
+
}
|
|
70744
|
+
compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70745
|
+
const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70746
|
+
const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
|
|
70747
|
+
const firstPart = matchPaths.matchedPath;
|
|
70748
|
+
const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
|
|
70749
|
+
const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
|
|
70750
|
+
const getIterationPathWithNestedMultiplicity = () => firstPart;
|
|
70751
|
+
const getIterationPathWithoutNestedMultiplicity = () => {
|
|
70752
|
+
const firstPartParts = matchPaths.matchedPath.getPathPartsAsArray();
|
|
70753
|
+
const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
70754
|
+
return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).getParentPath();
|
|
70755
|
+
};
|
|
70756
|
+
const finalIterPath = secondParts.isContainCurrentOrEachIteration() ? getIterationPathWithNestedMultiplicity() : getIterationPathWithoutNestedMultiplicity();
|
|
70757
|
+
if (finalIterPath.isEmpty()) {
|
|
70758
|
+
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|
|
70759
|
+
}
|
|
70760
|
+
const extractNameFromPath = path => Iterator.from(path.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray().join("_");
|
|
70761
|
+
const extractNameFromExpression = (basePathForDict, expr) => {
|
|
70762
|
+
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;
|
|
70763
|
+
if (exprAsValueRef != undefined) {
|
|
70764
|
+
return extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, exprAsValueRef.modePath).differentPath);
|
|
70765
|
+
}
|
|
70766
|
+
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;
|
|
70767
|
+
if (exprAsConst != undefined) {
|
|
70768
|
+
if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression) {
|
|
70769
|
+
return `constant_${exprAsConst.value}`;
|
|
70770
|
+
}
|
|
70771
|
+
if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression) {
|
|
70772
|
+
return `constant_${exprAsConst.stringValue}`;
|
|
70773
|
+
}
|
|
70774
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name: unsupported type of constant!");
|
|
70775
|
+
}
|
|
70776
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name!");
|
|
70777
|
+
};
|
|
70778
|
+
const basePathForDict = finalIterPath;
|
|
70779
|
+
const keyDiffPathText = extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, sourceKeyPath).differentPath);
|
|
70780
|
+
const valueDiffPathText = extractNameFromExpression(basePathForDict, sourceValueExpression);
|
|
70781
|
+
const dictPath = basePathForDict.joinWith(`${keyDiffPathText}_${valueDiffPathText}_generated${_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.dictFieldNameSuffix}`);
|
|
70782
|
+
const dictPathWithField = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(dictPath, "value");
|
|
70783
|
+
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());
|
|
70784
|
+
const dictExpression = this.compileMakeDictExpressionImpl(basePathForDictPrefix, dictPathWithField, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70785
|
+
const dictStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path, "value"), dictExpression);
|
|
70786
|
+
addPrecalculationRule(dictStatement);
|
|
70787
|
+
const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
|
|
70788
|
+
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);
|
|
70789
|
+
return finalValueExpression;
|
|
70790
|
+
}
|
|
70791
|
+
compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70419
70792
|
const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
|
|
70420
70793
|
const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
|
|
70421
70794
|
const firstPart = matchPaths.matchedPath.toCurrentIteration();
|
|
@@ -70436,10 +70809,10 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70436
70809
|
if (finalIterPath.isEmpty()) {
|
|
70437
70810
|
throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
|
|
70438
70811
|
}
|
|
70439
|
-
const keys = new
|
|
70440
|
-
const reduceExpression = new
|
|
70441
|
-
const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new
|
|
70442
|
-
const finalValueExpression = new
|
|
70812
|
+
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));
|
|
70813
|
+
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());
|
|
70814
|
+
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));
|
|
70815
|
+
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)());
|
|
70443
70816
|
return finalValueExpression;
|
|
70444
70817
|
}
|
|
70445
70818
|
compileEnumerationItem(expression, prefix, target, addPrecalculationRule) {
|
|
@@ -70448,62 +70821,80 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70448
70821
|
}
|
|
70449
70822
|
return this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
|
|
70450
70823
|
}
|
|
70824
|
+
compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
|
|
70825
|
+
return this.options.enableGroupSumAutoConversion ? this.compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) : this.compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70826
|
+
}
|
|
70451
70827
|
compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70452
70828
|
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70453
70829
|
const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
|
|
70454
|
-
const sourceValueExpression =
|
|
70830
|
+
const sourceValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(sourceValuePath.toCurrentIteration(), "value");
|
|
70455
70831
|
return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70456
70832
|
}
|
|
70457
70833
|
compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
|
|
70458
70834
|
const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
|
|
70459
|
-
const sourceValueExpression = new
|
|
70835
|
+
const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
|
|
70460
70836
|
return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
|
|
70461
70837
|
}
|
|
70838
|
+
convertExpressionTypePropertyToFLangType(type) {
|
|
70839
|
+
switch (type) {
|
|
70840
|
+
case "string":
|
|
70841
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
|
|
70842
|
+
case "array":
|
|
70843
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.array;
|
|
70844
|
+
case "decimal":
|
|
70845
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal;
|
|
70846
|
+
case "dict":
|
|
70847
|
+
return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict;
|
|
70848
|
+
default:
|
|
70849
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`Unknown ExpressionTypeProperty [${type}]`);
|
|
70850
|
+
}
|
|
70851
|
+
}
|
|
70462
70852
|
compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
|
|
70853
|
+
const builtInType = this.convertExpressionTypePropertyToFLangType(selectType !== null && selectType !== void 0 ? selectType : "string");
|
|
70463
70854
|
const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
|
|
70464
70855
|
const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
|
|
70465
70856
|
const baseSelectPath = splitInfo.matchedPath;
|
|
70466
70857
|
if (!splitInfo.differentPath.isContainIteration()) {
|
|
70467
|
-
const valueRefExpression = new
|
|
70468
|
-
const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ?
|
|
70469
|
-
return
|
|
70858
|
+
const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
|
|
70859
|
+
const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(valueRefExpression) : valueRefExpression;
|
|
70860
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
|
|
70470
70861
|
} else {
|
|
70471
70862
|
var _countValueExpression;
|
|
70472
|
-
let resultValueExpression =
|
|
70863
|
+
let resultValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(adjustedSelectPath.toCurrentIteration().normalize(), "value");
|
|
70473
70864
|
let countValueExpression = undefined;
|
|
70474
70865
|
const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__.buildIterationSequence)(splitInfo.differentPath))];
|
|
70475
70866
|
for (const iterationEntry of iterationEntries) {
|
|
70476
70867
|
const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
|
|
70477
70868
|
const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken(x));
|
|
70478
|
-
const nextResultValueExpression = new
|
|
70479
|
-
const currentSumExpression =
|
|
70480
|
-
const countResultValueExpression = new
|
|
70481
|
-
const currenCountExpression =
|
|
70482
|
-
const sumReduceExpr = new
|
|
70483
|
-
addPrecalculationRule(new
|
|
70484
|
-
const countReduceExpr = new
|
|
70485
|
-
addPrecalculationRule(new
|
|
70869
|
+
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");
|
|
70870
|
+
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");
|
|
70871
|
+
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");
|
|
70872
|
+
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");
|
|
70873
|
+
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())));
|
|
70874
|
+
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(""))));
|
|
70875
|
+
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)));
|
|
70876
|
+
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"))));
|
|
70486
70877
|
resultValueExpression = currentSumExpression;
|
|
70487
70878
|
countValueExpression = currenCountExpression;
|
|
70488
70879
|
}
|
|
70489
70880
|
const finalValue = aggregationFunction === "Sum" ? resultValueExpression : (_countValueExpression = countValueExpression) !== null && _countValueExpression !== void 0 ? _countValueExpression : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
|
|
70490
|
-
return
|
|
70881
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
|
|
70491
70882
|
}
|
|
70492
70883
|
}
|
|
70493
70884
|
compileSumExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70494
70885
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70495
|
-
const currExpr = new
|
|
70496
|
-
return acc != undefined ? new
|
|
70886
|
+
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));
|
|
70887
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(acc, currExpr) : currExpr;
|
|
70497
70888
|
}, undefined);
|
|
70498
70889
|
if (result == undefined) {
|
|
70499
70890
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70500
70891
|
}
|
|
70501
|
-
return (0,
|
|
70892
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70502
70893
|
}
|
|
70503
70894
|
compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70504
70895
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70505
|
-
const currExpr = (0,
|
|
70506
|
-
return acc != undefined ? new
|
|
70896
|
+
const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
|
|
70897
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConcatStringsExpression(acc, currExpr) : currExpr;
|
|
70507
70898
|
}, undefined);
|
|
70508
70899
|
if (result == undefined) {
|
|
70509
70900
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70513,7 +70904,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70513
70904
|
compileOrExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70514
70905
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70515
70906
|
const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
|
|
70516
|
-
return acc != undefined ? new
|
|
70907
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(acc, currExpr) : currExpr;
|
|
70517
70908
|
}, undefined);
|
|
70518
70909
|
if (result == undefined) {
|
|
70519
70910
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70523,7 +70914,7 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70523
70914
|
compileAndExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70524
70915
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70525
70916
|
const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
|
|
70526
|
-
return acc != undefined ? new
|
|
70917
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(acc, currExpr) : currExpr;
|
|
70527
70918
|
}, undefined);
|
|
70528
70919
|
if (result == undefined) {
|
|
70529
70920
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
@@ -70532,24 +70923,24 @@ class FormulaExpressionToFlangExpressionConverter {
|
|
|
70532
70923
|
}
|
|
70533
70924
|
compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70534
70925
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70535
|
-
const expr = new
|
|
70536
|
-
return acc != undefined ? new
|
|
70926
|
+
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));
|
|
70927
|
+
return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MultiplyBinaryExpression(acc, expr) : expr;
|
|
70537
70928
|
}, undefined);
|
|
70538
70929
|
if (result == undefined) {
|
|
70539
70930
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70540
70931
|
}
|
|
70541
|
-
return (0,
|
|
70932
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70542
70933
|
}
|
|
70543
70934
|
compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
|
|
70544
|
-
const makeDivision = (numerator, denominator) => new
|
|
70935
|
+
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());
|
|
70545
70936
|
const result = expression.arguments.reduce((acc, curr) => {
|
|
70546
|
-
const currExpr = (0,
|
|
70937
|
+
const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
|
|
70547
70938
|
return acc != undefined ? makeDivision(acc, currExpr) : currExpr;
|
|
70548
70939
|
}, undefined);
|
|
70549
70940
|
if (result == undefined) {
|
|
70550
70941
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
|
|
70551
70942
|
}
|
|
70552
|
-
return (0,
|
|
70943
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
|
|
70553
70944
|
}
|
|
70554
70945
|
preparePathAndAdjustMultiplicity(prefix, path) {
|
|
70555
70946
|
const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
|
|
@@ -70659,9 +71050,10 @@ class AutoValueForValueByDefaultNormalizationRuleGenerator {
|
|
|
70659
71050
|
const createValueRuleFromAutoValueRule = autoValueRule => {
|
|
70660
71051
|
var _formulaRulesMap$get$, _formulaRulesMap$get;
|
|
70661
71052
|
const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath, "value");
|
|
71053
|
+
const autoValueExpressionType = autoValueRule.right.getType();
|
|
70662
71054
|
const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value");
|
|
70663
71055
|
const autoFlagRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "autoFlag");
|
|
70664
|
-
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(
|
|
71056
|
+
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())));
|
|
70665
71057
|
};
|
|
70666
71058
|
const updatedFormulaRules = Iterator.from(formulaFLangRules).flatMap(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "autoValue" ? [x, createValueRuleFromAutoValueRule(x)] : [x]);
|
|
70667
71059
|
|
|
@@ -70708,8 +71100,8 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
|
|
|
70708
71100
|
this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
|
|
70709
71101
|
}
|
|
70710
71102
|
generateRules() {
|
|
70711
|
-
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(
|
|
70712
|
-
const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"),
|
|
71103
|
+
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));
|
|
71104
|
+
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")));
|
|
70713
71105
|
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"));
|
|
70714
71106
|
const ignoredValueSetRuleMapper = x => {
|
|
70715
71107
|
var _this$formSchemaRng$g;
|
|
@@ -70756,13 +71148,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70756
71148
|
* 2) переводит autoFlag в true
|
|
70757
71149
|
*/
|
|
70758
71150
|
class FormulaOnlyNormalizationRuleGenerator {
|
|
70759
|
-
constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder) {
|
|
71151
|
+
constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, options) {
|
|
70760
71152
|
this.dataDeclarationHelper = void 0;
|
|
70761
71153
|
this.formSchemaRng = void 0;
|
|
70762
71154
|
this.formulas = void 0;
|
|
71155
|
+
this.options = void 0;
|
|
70763
71156
|
this.formulaExprConverter = void 0;
|
|
70764
71157
|
this.optionalSectionRuleBuilder = void 0;
|
|
70765
71158
|
this.validationRulesBuilder = void 0;
|
|
71159
|
+
this.options = options;
|
|
70766
71160
|
this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
|
|
70767
71161
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
70768
71162
|
this.formSchemaRng = formSchemaRng;
|
|
@@ -70789,10 +71183,14 @@ class FormulaOnlyNormalizationRuleGenerator {
|
|
|
70789
71183
|
const precalculationRules = [];
|
|
70790
71184
|
const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
|
|
70791
71185
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
71186
|
+
const getFormulaExpression = field => {
|
|
71187
|
+
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");
|
|
71188
|
+
const resultType = result.getType();
|
|
71189
|
+
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;
|
|
71190
|
+
};
|
|
70792
71191
|
const result = [];
|
|
70793
|
-
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));
|
|
70794
71192
|
if (isTargetAutoField) {
|
|
70795
|
-
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)));
|
|
71193
|
+
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)));
|
|
70796
71194
|
} else {
|
|
70797
71195
|
result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
|
|
70798
71196
|
}
|
|
@@ -70819,6 +71217,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70819
71217
|
/* harmony export */ });
|
|
70820
71218
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
70821
71219
|
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71220
|
+
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
71221
|
+
/* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
|
|
71222
|
+
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
71223
|
+
|
|
71224
|
+
|
|
71225
|
+
|
|
70822
71226
|
|
|
70823
71227
|
|
|
70824
71228
|
|
|
@@ -70851,8 +71255,16 @@ class NormalizationRulesGenerator {
|
|
|
70851
71255
|
const dataDeclarationRules = this.sugarRulesBuilder.buildRules();
|
|
70852
71256
|
|
|
70853
71257
|
// Порядок важен, т.к. потом делаем distinctBy.
|
|
70854
|
-
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule =>
|
|
70855
|
-
|
|
71258
|
+
const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => {
|
|
71259
|
+
(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.ensureCorrectFieldNameByExpressionType)(rule);
|
|
71260
|
+
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule);
|
|
71261
|
+
}).toArray();
|
|
71262
|
+
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();
|
|
71263
|
+
const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
|
|
71264
|
+
return {
|
|
71265
|
+
content: content,
|
|
71266
|
+
serverOnlyPaths: dictionaryRules
|
|
71267
|
+
};
|
|
70856
71268
|
}
|
|
70857
71269
|
}
|
|
70858
71270
|
|
|
@@ -70906,12 +71318,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70906
71318
|
|
|
70907
71319
|
|
|
70908
71320
|
class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.BaseRuleBuilder {
|
|
70909
|
-
constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter) {
|
|
71321
|
+
constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, options) {
|
|
70910
71322
|
super();
|
|
70911
71323
|
this.formSchemaRng = void 0;
|
|
70912
71324
|
this.formulas = void 0;
|
|
71325
|
+
this.options = void 0;
|
|
70913
71326
|
this.formulaExprConverter = void 0;
|
|
70914
71327
|
this.dataDeclarationHelper = void 0;
|
|
71328
|
+
this.options = options;
|
|
70915
71329
|
this.formulaExprConverter = formulaExprConverter;
|
|
70916
71330
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
70917
71331
|
this.formulas = formulas;
|
|
@@ -70933,7 +71347,11 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
|
|
|
70933
71347
|
const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
|
|
70934
71348
|
const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
|
|
70935
71349
|
const isDecimal = ((_this$formSchemaRng$g = this.formSchemaRng.getTypeNodeByPath(fullTarget.toAbsolute())) === null || _this$formSchemaRng$g === void 0 ? void 0 : _this$formSchemaRng$g.baseType) === "decimal";
|
|
70936
|
-
const getFormulaExpression = targetField =>
|
|
71350
|
+
const getFormulaExpression = targetField => {
|
|
71351
|
+
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");
|
|
71352
|
+
const resultType = result.getType();
|
|
71353
|
+
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;
|
|
71354
|
+
};
|
|
70937
71355
|
const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
|
|
70938
71356
|
const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
|
|
70939
71357
|
const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
|
|
@@ -70947,13 +71365,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
|
|
|
70947
71365
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
|
|
70948
71366
|
}
|
|
70949
71367
|
createAutoFlagRule(fullTarget, isDecimal) {
|
|
70950
|
-
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(
|
|
71368
|
+
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"))));
|
|
70951
71369
|
}
|
|
70952
71370
|
createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
|
|
70953
71371
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
|
|
70954
71372
|
}
|
|
70955
71373
|
createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) {
|
|
70956
|
-
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(
|
|
71374
|
+
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))));
|
|
70957
71375
|
}
|
|
70958
71376
|
adjustPathMultiplicity(path) {
|
|
70959
71377
|
return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
|
|
@@ -71012,12 +71430,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71012
71430
|
/* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
71013
71431
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
71014
71432
|
/* harmony import */ var _markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../markupGenerator/getRootPath */ "./Generator/src/generators/markupGenerator/getRootPath.ts");
|
|
71015
|
-
/* harmony import */ var
|
|
71433
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71434
|
+
/* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
|
|
71016
71435
|
|
|
71017
71436
|
|
|
71018
71437
|
|
|
71019
71438
|
|
|
71020
|
-
|
|
71439
|
+
|
|
71440
|
+
class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__.BaseRuleBuilder {
|
|
71021
71441
|
constructor(sugarRoot, lazyLoadingDeclaration) {
|
|
71022
71442
|
super();
|
|
71023
71443
|
this.sugarRoot = void 0;
|
|
@@ -71033,11 +71453,22 @@ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_
|
|
|
71033
71453
|
const thresholdEntry = Object.entries(this.lazyLoadingDeclaration).find(x => x[1].thresholdValue != undefined);
|
|
71034
71454
|
if (thresholdEntry != undefined) {
|
|
71035
71455
|
var _thresholdEntry$1$thr, _thresholdEntry$;
|
|
71036
|
-
const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
71456
|
+
const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).trimLastStarIfLastToken();
|
|
71037
71457
|
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;
|
|
71038
71458
|
const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
|
|
71039
|
-
const
|
|
71040
|
-
|
|
71459
|
+
const childrenPathReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(thresholdEntryPath.toCurrentIteration(), "children");
|
|
71460
|
+
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));
|
|
71461
|
+
if (thresholdEntryPath.isContainIteration()) {
|
|
71462
|
+
const lazyLoadingCounterRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingCounter"), "value");
|
|
71463
|
+
const iterationPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(thresholdEntryPath.getLastListPath());
|
|
71464
|
+
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)))));
|
|
71465
|
+
yield counterStatement;
|
|
71466
|
+
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")));
|
|
71467
|
+
yield lazyFlagStatement;
|
|
71468
|
+
} else {
|
|
71469
|
+
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")));
|
|
71470
|
+
yield statement;
|
|
71471
|
+
}
|
|
71041
71472
|
}
|
|
71042
71473
|
}
|
|
71043
71474
|
}
|
|
@@ -71064,7 +71495,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71064
71495
|
/* 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");
|
|
71065
71496
|
/* harmony import */ var _Common_ModelPath_ModelPathHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPathHelper */ "./Common/ModelPath/ModelPathHelper.ts");
|
|
71066
71497
|
/* harmony import */ var _Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Common/PathConstants */ "./Common/PathConstants.ts");
|
|
71067
|
-
/* harmony import */ var
|
|
71498
|
+
/* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
71499
|
+
/* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
|
|
71068
71500
|
|
|
71069
71501
|
|
|
71070
71502
|
|
|
@@ -71075,7 +71507,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71075
71507
|
|
|
71076
71508
|
|
|
71077
71509
|
|
|
71078
|
-
|
|
71510
|
+
|
|
71511
|
+
class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__.BaseRuleBuilder {
|
|
71079
71512
|
constructor(sugarRoot, dataDeclarationHelper) {
|
|
71080
71513
|
super();
|
|
71081
71514
|
this.sugarRoot = void 0;
|
|
@@ -71161,7 +71594,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
|
|
|
71161
71594
|
const targetIsFilledPath = targetOptionalSection.path.joinWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__.OptionalSectionFilledFieldName);
|
|
71162
71595
|
if (!targetIsFilledPath.isEquals(targetPath)) {
|
|
71163
71596
|
const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
|
|
71164
|
-
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()));
|
|
71597
|
+
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()));
|
|
71165
71598
|
}
|
|
71166
71599
|
}
|
|
71167
71600
|
return rule;
|
|
@@ -71183,7 +71616,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
|
|
|
71183
71616
|
var _pathGroup$, _pathGroup$map$reduce;
|
|
71184
71617
|
const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
|
|
71185
71618
|
const pathCheckExpr = (_pathGroup$map$reduce = pathGroup.map(pathInfo => {
|
|
71186
|
-
const pathValueRef =
|
|
71619
|
+
const pathValueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
|
|
71187
71620
|
const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
|
|
71188
71621
|
return checkExpression;
|
|
71189
71622
|
}).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)();
|
|
@@ -71337,11 +71770,9 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71337
71770
|
const validationText = next.message.reduce((acc, item) => {
|
|
71338
71771
|
if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
|
|
71339
71772
|
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(item));
|
|
71340
|
-
} else if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression) {
|
|
71341
|
-
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(", ")));
|
|
71342
|
-
} else {
|
|
71343
|
-
throw new Error(`Invalid WithDescription ${item.toString()}`);
|
|
71344
71773
|
}
|
|
71774
|
+
const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
|
|
71775
|
+
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(", ")));
|
|
71345
71776
|
}, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(""));
|
|
71346
71777
|
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);
|
|
71347
71778
|
return condition;
|
|
@@ -71395,7 +71826,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71395
71826
|
}
|
|
71396
71827
|
buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
71397
71828
|
const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
|
|
71398
|
-
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)(
|
|
71829
|
+
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)));
|
|
71399
71830
|
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")));
|
|
71400
71831
|
}
|
|
71401
71832
|
buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
|
|
@@ -71403,11 +71834,11 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71403
71834
|
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")));
|
|
71404
71835
|
}
|
|
71405
71836
|
getErrorWarningCountExpression(path, fieldName, readOldValues) {
|
|
71406
|
-
const valueGetExpression = readOldValues ?
|
|
71837
|
+
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);
|
|
71407
71838
|
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));
|
|
71408
71839
|
}
|
|
71409
71840
|
getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
|
|
71410
|
-
return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ?
|
|
71841
|
+
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));
|
|
71411
71842
|
}
|
|
71412
71843
|
buildChainOfErrorCountRules(path, countFieldName, fieldName) {
|
|
71413
71844
|
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) => {
|
|
@@ -95704,8 +96135,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
95704
96135
|
/* harmony import */ var _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
95705
96136
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
95706
96137
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
95707
|
-
/* harmony import */ var
|
|
95708
|
-
/* harmony import */ var
|
|
96138
|
+
/* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
96139
|
+
/* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
96140
|
+
/* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
|
|
96141
|
+
|
|
95709
96142
|
|
|
95710
96143
|
|
|
95711
96144
|
|
|
@@ -95727,17 +96160,17 @@ class FLangNormalizationRulesBuilder {
|
|
|
95727
96160
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
95728
96161
|
}
|
|
95729
96162
|
*childrenInitializer(node, optional, defaultChildren) {
|
|
95730
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
95731
|
-
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(
|
|
96163
|
+
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);
|
|
96164
|
+
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"))));
|
|
95732
96165
|
}
|
|
95733
96166
|
*childrenInitializerForPicklist(node, optional, defaultChildren) {
|
|
95734
96167
|
const targetPathReference = node.getFullPath().toEachIteration().trimLastStarIfLastToken();
|
|
95735
|
-
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(
|
|
96168
|
+
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"))));
|
|
95736
96169
|
}
|
|
95737
96170
|
valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
|
|
95738
96171
|
var _dataBinding$defaultV;
|
|
95739
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
95740
|
-
const originalValueReference =
|
|
96172
|
+
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)());
|
|
96173
|
+
const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
95741
96174
|
const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
|
|
95742
96175
|
const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
|
|
95743
96176
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
|
|
@@ -95761,11 +96194,11 @@ class FLangNormalizationRulesBuilder {
|
|
|
95761
96194
|
if (!disabled && !dataBinding.settings) {
|
|
95762
96195
|
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);
|
|
95763
96196
|
}
|
|
95764
|
-
const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(
|
|
96197
|
+
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;
|
|
95765
96198
|
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
95766
96199
|
}
|
|
95767
96200
|
*specialFieldsInitializer(node, options) {
|
|
95768
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
96201
|
+
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)());
|
|
95769
96202
|
if (options.disabled) {
|
|
95770
96203
|
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"));
|
|
95771
96204
|
}
|
|
@@ -95783,9 +96216,9 @@ class FLangNormalizationRulesBuilder {
|
|
|
95783
96216
|
var _typeNode$base, _this$schemaRng$getTy;
|
|
95784
96217
|
// eslint-disable-next-line
|
|
95785
96218
|
const validationInfoSource = node === null || node === void 0 ? void 0 : node.validationInfo;
|
|
95786
|
-
const typeNode = validationInfoSource instanceof
|
|
96219
|
+
const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
|
|
95787
96220
|
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;
|
|
95788
|
-
const sourceValueReference =
|
|
96221
|
+
const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
95789
96222
|
return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
|
|
95790
96223
|
}
|
|
95791
96224
|
}
|
|
@@ -97250,9 +97683,9 @@ function children(onlyTagName, nodeClasses = [], skipNodeNames = []) {
|
|
|
97250
97683
|
(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)));
|
|
97251
97684
|
};
|
|
97252
97685
|
}
|
|
97253
|
-
function singleChild(tagName, nodeClasses = []) {
|
|
97686
|
+
function singleChild(tagName, nodeClasses = [], dec) {
|
|
97254
97687
|
return (targetClass, propName) => {
|
|
97255
|
-
(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)));
|
|
97688
|
+
(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));
|
|
97256
97689
|
};
|
|
97257
97690
|
}
|
|
97258
97691
|
function attr(attrName, valueParser, dec) {
|