@kontur.candy/generator 5.6.0 → 5.7.0-fs-7964-multiple-keys-groupsum.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +167 -73
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -60452,6 +60452,7 @@ let PatchFufSteps = /*#__PURE__*/function (PatchFufSteps) {
60452
60452
  PatchFufSteps[PatchFufSteps["SelectFiles"] = 1] = "SelectFiles";
60453
60453
  PatchFufSteps[PatchFufSteps["ErrorMessage"] = 2] = "ErrorMessage";
60454
60454
  PatchFufSteps[PatchFufSteps["LoadToForm"] = 3] = "LoadToForm";
60455
+ PatchFufSteps[PatchFufSteps["ConfirmMerge"] = 4] = "ConfirmMerge";
60455
60456
  return PatchFufSteps;
60456
60457
  }({});
60457
60458
  let TableType = /*#__PURE__*/function (TableType) {
@@ -61727,7 +61728,8 @@ __webpack_require__.r(__webpack_exports__);
61727
61728
  /* harmony export */ "groupCountKCLangFunction": () => (/* binding */ groupCountKCLangFunction),
61728
61729
  /* harmony export */ "concatKCLangFunction": () => (/* binding */ concatKCLangFunction),
61729
61730
  /* harmony export */ "newlineKCLangFunction": () => (/* binding */ newlineKCLangFunction),
61730
- /* harmony export */ "dateNowKCLangFunction": () => (/* binding */ dateNowKCLangFunction)
61731
+ /* harmony export */ "dateNowKCLangFunction": () => (/* binding */ dateNowKCLangFunction),
61732
+ /* harmony export */ "listOfKCLangFunction": () => (/* binding */ listOfKCLangFunction)
61731
61733
  /* harmony export */ });
61732
61734
  class ArgumentValidationError {
61733
61735
  constructor(validationMessage) {
@@ -62024,16 +62026,20 @@ const groupSumKCLangFunction = params => {
62024
62026
  if (errors.length > 0) {
62025
62027
  return new FunctionValidationErrorCollection(errors);
62026
62028
  }
62027
- const targetKeyPathParam = (_params$20 = params[0]) === null || _params$20 === void 0 ? void 0 : _params$20.value;
62029
+ const targetKeysParam = (_params$20 = params[0]) === null || _params$20 === void 0 ? void 0 : _params$20.value;
62028
62030
  const sourceKeyPathParam = (_params$21 = params[1]) === null || _params$21 === void 0 ? void 0 : _params$21.value;
62029
62031
  const sourceValuePathParam = (_params$22 = params[2]) === null || _params$22 === void 0 ? void 0 : _params$22.value;
62030
- if ((targetKeyPathParam === null || targetKeyPathParam === void 0 ? void 0 : targetKeyPathParam.type) !== "argument" || (sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || (sourceValuePathParam === null || sourceValuePathParam === void 0 ? void 0 : sourceValuePathParam.type) !== "argument") {
62031
- const argumentsValidationError = new ArgumentValidationError("Expected 3 paths as arguments: targetKeyPath, sourceKeyPath, sourceValuePath");
62032
+ if (targetKeysParam == undefined || (sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || (sourceValuePathParam === null || sourceValuePathParam === void 0 ? void 0 : sourceValuePathParam.type) !== "argument") {
62033
+ const argumentsValidationError = new ArgumentValidationError("Expected 3 paths as arguments: targetKeys, sourceKeyPath, sourceValuePath");
62032
62034
  return new FunctionValidationErrorCollection([argumentsValidationError]);
62033
62035
  }
62036
+ const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
62037
+ type: "array",
62038
+ items: [targetKeysParam]
62039
+ };
62034
62040
  return {
62035
62041
  type: "groupSum",
62036
- targetKeyPath: targetKeyPathParam.select,
62042
+ targetKeys: targetKeys,
62037
62043
  sourceKeyPath: sourceKeyPathParam.select,
62038
62044
  sourceValuePath: sourceValuePathParam.select
62039
62045
  };
@@ -62044,15 +62050,19 @@ const groupCountKCLangFunction = params => {
62044
62050
  if (errors.length > 0) {
62045
62051
  return new FunctionValidationErrorCollection(errors);
62046
62052
  }
62047
- const targetKeyPathParam = (_params$23 = params[0]) === null || _params$23 === void 0 ? void 0 : _params$23.value;
62053
+ const targetKeysParam = (_params$23 = params[0]) === null || _params$23 === void 0 ? void 0 : _params$23.value;
62048
62054
  const sourceKeyPathParam = (_params$24 = params[1]) === null || _params$24 === void 0 ? void 0 : _params$24.value;
62049
- if ((targetKeyPathParam === null || targetKeyPathParam === void 0 ? void 0 : targetKeyPathParam.type) !== "argument" || (sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument") {
62055
+ if (targetKeysParam == undefined || (sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument") {
62050
62056
  const argumentsValidationError = new ArgumentValidationError("Expected 2 paths as arguments: targetKeyPath, sourceKeyPath");
62051
62057
  return new FunctionValidationErrorCollection([argumentsValidationError]);
62052
62058
  }
62059
+ const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
62060
+ type: "array",
62061
+ items: [targetKeysParam]
62062
+ };
62053
62063
  return {
62054
62064
  type: "groupCount",
62055
- targetKeyPath: targetKeyPathParam.select,
62065
+ targetKeys: targetKeys,
62056
62066
  sourceKeyPath: sourceKeyPathParam.select
62057
62067
  };
62058
62068
  };
@@ -62084,6 +62094,16 @@ const dateNowKCLangFunction = params => {
62084
62094
  type: "dateNow"
62085
62095
  };
62086
62096
  };
62097
+ const listOfKCLangFunction = params => {
62098
+ const errors = Array.from(validateParams(params, 0, 1000));
62099
+ if (errors.length > 0) {
62100
+ return new FunctionValidationErrorCollection(errors);
62101
+ }
62102
+ return {
62103
+ type: "array",
62104
+ items: params.map(x => x.value)
62105
+ };
62106
+ };
62087
62107
 
62088
62108
  /***/ }),
62089
62109
 
@@ -62129,7 +62149,8 @@ const getKCLangGlobalFunctionBuilders = () => ({
62129
62149
  groupCount: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.groupCountKCLangFunction],
62130
62150
  concat: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.concatKCLangFunction],
62131
62151
  newline: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.newlineKCLangFunction],
62132
- dateNow: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateNowKCLangFunction]
62152
+ dateNow: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateNowKCLangFunction],
62153
+ listOf: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.listOfKCLangFunction]
62133
62154
  });
62134
62155
  class ErrorListener {
62135
62156
  constructor() {
@@ -69590,6 +69611,8 @@ function traverseKCLangExpression(node, visitor) {
69590
69611
  case "dateNow":
69591
69612
  visitor.visitDateNowKCLangNode(node);
69592
69613
  break;
69614
+ case "array":
69615
+ break;
69593
69616
  default:
69594
69617
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
69595
69618
  break;
@@ -69689,6 +69712,9 @@ class DefaultKCLangExpressionVisitor {
69689
69712
  visitDateNowKCLangNode(node) {
69690
69713
  // default empty implementation
69691
69714
  }
69715
+ visitArrayKCLangNode(node) {
69716
+ // default empty implementation
69717
+ }
69692
69718
  }
69693
69719
 
69694
69720
  /***/ }),
@@ -70030,6 +70056,8 @@ const getGenerateJsExpressionFunc = options => {
70030
70056
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
70031
70057
  case "dateNow":
70032
70058
  return `${utilsName}.dateNow()`;
70059
+ case "array":
70060
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
70033
70061
  default:
70034
70062
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(expression);
70035
70063
  }
@@ -70104,9 +70132,9 @@ function generateKCXmlExpression(expression) {
70104
70132
  case "isValidAccountNumber":
70105
70133
  return `<m:${expression.type} bik="${expression.bik}" account="${expression.account}" />`;
70106
70134
  case "groupSum":
70107
- return `<m:${expression.type} targetKeyPath="${expression.targetKeyPath}" sourceKeyPath="${expression.sourceKeyPath}" sourceValuePath="${expression.sourceValuePath}" />`;
70135
+ 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");
70108
70136
  case "groupCount":
70109
- return `<m:${expression.type} targetKeyPath="${expression.targetKeyPath}" sourceKeyPath="${expression.sourceKeyPath}" />`;
70137
+ return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}" >`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
70110
70138
  case "cast":
70111
70139
  if (expression.expression.type === "argument") {
70112
70140
  return `<m:argument select="${expression.expression.select}" type="${expression.targetType}" />`;
@@ -70171,6 +70199,11 @@ function generateKCXmlExpression(expression) {
70171
70199
  const enumerationItems = expression.expressions.items.map(generateKCXmlExpression);
70172
70200
  return [`<m:oneof>`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(testExpr, 1), [`<m:oneofitems>`, enumerationItems.map(x => (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(x, 1)), `</m:oneofitems>`].flat().map(x => (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(x, 1)).join("\n"), `</m:oneof>`].join("\n");
70173
70201
  }
70202
+ case "array":
70203
+ {
70204
+ const enumerationItems = expression.items.map(generateKCXmlExpression);
70205
+ return [`<m:oneofitems>`, enumerationItems.map(x => (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(x, 1)), `</m:oneofitems>`].flat().map(x => (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(x, 1)).join("\n");
70206
+ }
70174
70207
  default:
70175
70208
  // @ts-ignore
70176
70209
  throw new Error(`Expression of type '${expression.type}' is not supported`);
@@ -75466,12 +75499,12 @@ __webpack_require__.r(__webpack_exports__);
75466
75499
  /* harmony export */ "FormulaWhenExpression": () => (/* binding */ FormulaWhenExpression),
75467
75500
  /* harmony export */ "DummyContent": () => (/* binding */ DummyContent),
75468
75501
  /* harmony export */ "FormulaSumExpression": () => (/* binding */ FormulaSumExpression),
75502
+ /* harmony export */ "FormulaOneOfItemsExpression": () => (/* binding */ FormulaOneOfItemsExpression),
75469
75503
  /* harmony export */ "FormulaGroupSumExpression": () => (/* binding */ FormulaGroupSumExpression),
75470
75504
  /* harmony export */ "FormulaGroupCountExpression": () => (/* binding */ FormulaGroupCountExpression),
75471
75505
  /* harmony export */ "FormulaAndExpression": () => (/* binding */ FormulaAndExpression),
75472
75506
  /* harmony export */ "FormulaOrExpression": () => (/* binding */ FormulaOrExpression),
75473
75507
  /* harmony export */ "FormulaGtExpression": () => (/* binding */ FormulaGtExpression),
75474
- /* harmony export */ "FormulaOneOfItemsExpression": () => (/* binding */ FormulaOneOfItemsExpression),
75475
75508
  /* harmony export */ "FormulaOneOfExpression": () => (/* binding */ FormulaOneOfExpression),
75476
75509
  /* harmony export */ "FormulaRegexMatchExpression": () => (/* binding */ FormulaRegexMatchExpression),
75477
75510
  /* harmony export */ "FormulaLengthExpression": () => (/* binding */ FormulaLengthExpression),
@@ -75524,7 +75557,7 @@ __webpack_require__.r(__webpack_exports__);
75524
75557
 
75525
75558
 
75526
75559
 
75527
- var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class4, _dec4, _dec5, _class5, _class6, _descriptor2, _dec6, _dec7, _dec8, _dec9, _class8, _class9, _descriptor3, _descriptor4, _descriptor5, _dec10, _dec11, _dec12, _class11, _class12, _descriptor6, _descriptor7, _dec13, _dec14, _class14, _class15, _descriptor8, _dec15, _dec16, _class17, _class18, _descriptor9, _dec17, _dec18, _class20, _class21, _descriptor10, _dec19, _dec20, _class23, _class24, _descriptor11, _dec21, _dec22, _dec23, _class26, _class27, _descriptor12, _descriptor13, _dec24, _dec25, _dec26, _class29, _class30, _descriptor14, _descriptor15, _dec27, _dec28, _class32, _class33, _descriptor16, _dec29, _dec30, _class35, _class36, _descriptor17, _dec31, _dec32, _class38, _class39, _descriptor18, _dec33, _dec34, _class41, _class42, _descriptor19, _dec35, _dec36, _class44, _class45, _descriptor20, _dec37, _dec38, _class47, _class48, _descriptor21, _dec39, _dec40, _class50, _class51, _descriptor22, _dec41, _dec42, _class53, _class54, _descriptor23, _dec43, _dec44, _class56, _class57, _descriptor24, _dec45, _dec46, _dec47, _dec48, _class59, _class60, _descriptor25, _descriptor26, _descriptor27, _dec49, _dec50, _class62, _class63, _descriptor28, _dec51, _dec52, _class65, _class66, _descriptor29, _dec53, _dec54, _dec55, _class68, _class69, _descriptor30, _descriptor31, _dec56, _dec57, _class71, _class72, _descriptor32, _dec58, _dec59, _class74, _class75, _descriptor33, _dec60, _dec61, _class77, _class78, _descriptor34, _dec62, _dec63, _class80, _class81, _descriptor35, _dec64, _dec65, _dec66, _class83, _class84, _descriptor36, _descriptor37, _dec67, _dec68, _dec69, _dec70, _class86, _class87, _descriptor38, _descriptor39, _descriptor40, _dec71, _dec72, _dec73, _class89, _class90, _descriptor41, _descriptor42, _dec74, _class92, _dec75, _dec76, _class93, _class94, _descriptor43, _dec77, _dec78, _class96, _class97, _descriptor44, _dec79, _dec80, _class99, _class100, _descriptor45, _dec81, _dec82, _dec83, _class102, _class103, _descriptor46, _descriptor47, _dec84, _dec85, _dec86, _class105, _class106, _descriptor48, _descriptor49, _dec87, _dec88, _class108, _class109, _descriptor50, _dec89, _dec90, _class111, _class112, _descriptor51, _dec91, _dec92, _dec93, _class114, _class115, _descriptor52, _descriptor53, _dec94, _dec95, _class117, _class118, _descriptor54, _dec96, _class120, _dec97, _dec98, _dec99, _dec100, _class121, _class122, _descriptor55, _descriptor56, _descriptor57, _dec101, _dec102, _class124, _class125, _descriptor58, _dec103, _dec104, _dec105, _dec106, _dec107, _dec108, _class127, _class128, _descriptor59, _descriptor60, _descriptor61, _descriptor62, _descriptor63, _dec109, _dec110, _class130, _class131, _descriptor64, _dec111, _dec112, _dec113, _class133, _class134, _descriptor65, _descriptor66;
75560
+ var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class4, _dec4, _dec5, _class5, _class6, _descriptor2, _dec6, _dec7, _class8, _class9, _descriptor3, _dec8, _dec9, _dec10, _dec11, _class11, _class12, _descriptor4, _descriptor5, _descriptor6, _dec12, _dec13, _dec14, _class14, _class15, _descriptor7, _descriptor8, _dec15, _dec16, _class17, _class18, _descriptor9, _dec17, _dec18, _class20, _class21, _descriptor10, _dec19, _dec20, _class23, _class24, _descriptor11, _dec21, _dec22, _dec23, _class26, _class27, _descriptor12, _descriptor13, _dec24, _dec25, _dec26, _class29, _class30, _descriptor14, _descriptor15, _dec27, _dec28, _class32, _class33, _descriptor16, _dec29, _dec30, _class35, _class36, _descriptor17, _dec31, _dec32, _class38, _class39, _descriptor18, _dec33, _dec34, _class41, _class42, _descriptor19, _dec35, _dec36, _class44, _class45, _descriptor20, _dec37, _dec38, _class47, _class48, _descriptor21, _dec39, _dec40, _class50, _class51, _descriptor22, _dec41, _dec42, _class53, _class54, _descriptor23, _dec43, _dec44, _class56, _class57, _descriptor24, _dec45, _dec46, _dec47, _dec48, _class59, _class60, _descriptor25, _descriptor26, _descriptor27, _dec49, _dec50, _class62, _class63, _descriptor28, _dec51, _dec52, _class65, _class66, _descriptor29, _dec53, _dec54, _dec55, _class68, _class69, _descriptor30, _descriptor31, _dec56, _dec57, _class71, _class72, _descriptor32, _dec58, _dec59, _class74, _class75, _descriptor33, _dec60, _dec61, _class77, _class78, _descriptor34, _dec62, _dec63, _class80, _class81, _descriptor35, _dec64, _dec65, _dec66, _class83, _class84, _descriptor36, _descriptor37, _dec67, _dec68, _dec69, _dec70, _class86, _class87, _descriptor38, _descriptor39, _descriptor40, _dec71, _dec72, _dec73, _class89, _class90, _descriptor41, _descriptor42, _dec74, _class92, _dec75, _dec76, _class93, _class94, _descriptor43, _dec77, _dec78, _class96, _class97, _descriptor44, _dec79, _dec80, _class99, _class100, _descriptor45, _dec81, _dec82, _dec83, _class102, _class103, _descriptor46, _descriptor47, _dec84, _dec85, _dec86, _class105, _class106, _descriptor48, _descriptor49, _dec87, _dec88, _class108, _class109, _descriptor50, _dec89, _dec90, _class111, _class112, _descriptor51, _dec91, _dec92, _dec93, _class114, _class115, _descriptor52, _descriptor53, _dec94, _dec95, _class117, _class118, _descriptor54, _dec96, _class120, _dec97, _dec98, _dec99, _dec100, _class121, _class122, _descriptor55, _descriptor56, _descriptor57, _dec101, _dec102, _class124, _class125, _descriptor58, _dec103, _dec104, _dec105, _dec106, _dec107, _dec108, _class127, _class128, _descriptor59, _descriptor60, _descriptor61, _descriptor62, _descriptor63, _dec109, _dec110, _class130, _class131, _descriptor64, _dec111, _dec112, _dec113, _class133, _class134, _descriptor65, _descriptor66;
75528
75561
 
75529
75562
 
75530
75563
 
@@ -75567,67 +75600,64 @@ let FormulaSumExpression = (_dec4 = (0,_markupGenerator_Serializer_SugarSerializ
75567
75600
  writable: true,
75568
75601
  initializer: null
75569
75602
  })), _class6)) || _class5);
75570
- let FormulaGroupSumExpression = (_dec6 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupsum", `Вычисление суммы с группировкой в разных множественностях`), _dec7 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("targetKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в целевой множественности`), _dec8 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec9 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceValuePath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь в суммируемой множественности откуда берем значение для свёртки`), _dec6(_class8 = (_class9 = class FormulaGroupSumExpression extends FormulaExpression {
75603
+ let FormulaOneOfItemsExpression = (_dec6 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("oneofitems", `TODO`), _dec7 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec6(_class8 = (_class9 = class FormulaOneOfItemsExpression extends FormulaExpression {
75571
75604
  constructor(...args) {
75572
75605
  super(...args);
75573
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeyPath", _descriptor3, this);
75574
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor4, this);
75575
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor5, this);
75606
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "expressions", _descriptor3, this);
75576
75607
  }
75577
- }, (_descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class9.prototype, "targetKeyPath", [_dec7], {
75578
- configurable: true,
75579
- enumerable: true,
75580
- writable: true,
75581
- initializer: null
75582
- }), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class9.prototype, "sourceKeyPath", [_dec8], {
75583
- configurable: true,
75584
- enumerable: true,
75585
- writable: true,
75586
- initializer: null
75587
- }), _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class9.prototype, "sourceValuePath", [_dec9], {
75608
+ }, (_descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class9.prototype, "expressions", [_dec7], {
75588
75609
  configurable: true,
75589
75610
  enumerable: true,
75590
75611
  writable: true,
75591
75612
  initializer: null
75592
75613
  })), _class9)) || _class8);
75593
- let FormulaGroupCountExpression = (_dec10 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupcount", `Вычисление количества элементов по группам в разных множественностях`), _dec11 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("targetKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в целевой множественности`), _dec12 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec10(_class11 = (_class12 = class FormulaGroupCountExpression extends FormulaExpression {
75614
+ let FormulaGroupSumExpression = (_dec8 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupsum", `Вычисление суммы с группировкой в разных множественностях`), _dec9 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("oneofitems", [FormulaOneOfItemsExpression]), _dec10 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec11 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceValuePath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь в суммируемой множественности откуда берем значение для свёртки`), _dec8(_class11 = (_class12 = class FormulaGroupSumExpression extends FormulaExpression {
75594
75615
  constructor(...args) {
75595
75616
  super(...args);
75596
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeyPath", _descriptor6, this);
75597
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor7, this);
75617
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor4, this);
75618
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor5, this);
75619
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor6, this);
75598
75620
  }
75599
- }, (_descriptor6 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class12.prototype, "targetKeyPath", [_dec11], {
75621
+ }, (_descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class12.prototype, "targetKeys", [_dec9], {
75622
+ configurable: true,
75623
+ enumerable: true,
75624
+ writable: true,
75625
+ initializer: null
75626
+ }), _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class12.prototype, "sourceKeyPath", [_dec10], {
75600
75627
  configurable: true,
75601
75628
  enumerable: true,
75602
75629
  writable: true,
75603
75630
  initializer: null
75604
- }), _descriptor7 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class12.prototype, "sourceKeyPath", [_dec12], {
75631
+ }), _descriptor6 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class12.prototype, "sourceValuePath", [_dec11], {
75605
75632
  configurable: true,
75606
75633
  enumerable: true,
75607
75634
  writable: true,
75608
75635
  initializer: null
75609
75636
  })), _class12)) || _class11);
75610
- let FormulaAndExpression = (_dec13 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("and", `TODO`), _dec14 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec13(_class14 = (_class15 = class FormulaAndExpression extends FormulaExpression {
75637
+ let FormulaGroupCountExpression = (_dec12 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupcount", `Вычисление количества элементов по группам в разных множественностях`), _dec13 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("oneofitems", [FormulaOneOfItemsExpression]), _dec14 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec12(_class14 = (_class15 = class FormulaGroupCountExpression extends FormulaExpression {
75611
75638
  constructor(...args) {
75612
75639
  super(...args);
75613
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "arguments", _descriptor8, this);
75640
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor7, this);
75641
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor8, this);
75614
75642
  }
75615
- getLegacyExpressionTypeForFunctionName() {
75616
- return "and";
75617
- }
75618
- }, (_descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class15.prototype, "arguments", [_dec14], {
75643
+ }, (_descriptor7 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class15.prototype, "targetKeys", [_dec13], {
75644
+ configurable: true,
75645
+ enumerable: true,
75646
+ writable: true,
75647
+ initializer: null
75648
+ }), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class15.prototype, "sourceKeyPath", [_dec14], {
75619
75649
  configurable: true,
75620
75650
  enumerable: true,
75621
75651
  writable: true,
75622
75652
  initializer: null
75623
75653
  })), _class15)) || _class14);
75624
- let FormulaOrExpression = (_dec15 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("or", `TODO`), _dec16 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec15(_class17 = (_class18 = class FormulaOrExpression extends FormulaExpression {
75654
+ let FormulaAndExpression = (_dec15 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("and", `TODO`), _dec16 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec15(_class17 = (_class18 = class FormulaAndExpression extends FormulaExpression {
75625
75655
  constructor(...args) {
75626
75656
  super(...args);
75627
75657
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "arguments", _descriptor9, this);
75628
75658
  }
75629
75659
  getLegacyExpressionTypeForFunctionName() {
75630
- return "or";
75660
+ return "and";
75631
75661
  }
75632
75662
  }, (_descriptor9 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class18.prototype, "arguments", [_dec16], {
75633
75663
  configurable: true,
@@ -75635,13 +75665,13 @@ let FormulaOrExpression = (_dec15 = (0,_markupGenerator_Serializer_SugarSerializ
75635
75665
  writable: true,
75636
75666
  initializer: null
75637
75667
  })), _class18)) || _class17);
75638
- let FormulaGtExpression = (_dec17 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("gt", `TODO`), _dec18 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec17(_class20 = (_class21 = class FormulaGtExpression extends FormulaExpression {
75668
+ let FormulaOrExpression = (_dec17 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("or", `TODO`), _dec18 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec17(_class20 = (_class21 = class FormulaOrExpression extends FormulaExpression {
75639
75669
  constructor(...args) {
75640
75670
  super(...args);
75641
75671
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "arguments", _descriptor10, this);
75642
75672
  }
75643
75673
  getLegacyExpressionTypeForFunctionName() {
75644
- return "gt";
75674
+ return "or";
75645
75675
  }
75646
75676
  }, (_descriptor10 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class21.prototype, "arguments", [_dec18], {
75647
75677
  configurable: true,
@@ -75649,12 +75679,15 @@ let FormulaGtExpression = (_dec17 = (0,_markupGenerator_Serializer_SugarSerializ
75649
75679
  writable: true,
75650
75680
  initializer: null
75651
75681
  })), _class21)) || _class20);
75652
- let FormulaOneOfItemsExpression = (_dec19 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("oneofitems", `TODO`), _dec20 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec19(_class23 = (_class24 = class FormulaOneOfItemsExpression extends FormulaExpression {
75682
+ let FormulaGtExpression = (_dec19 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("gt", `TODO`), _dec20 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec19(_class23 = (_class24 = class FormulaGtExpression extends FormulaExpression {
75653
75683
  constructor(...args) {
75654
75684
  super(...args);
75655
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "expressions", _descriptor11, this);
75685
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "arguments", _descriptor11, this);
75686
+ }
75687
+ getLegacyExpressionTypeForFunctionName() {
75688
+ return "gt";
75656
75689
  }
75657
- }, (_descriptor11 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class24.prototype, "expressions", [_dec20], {
75690
+ }, (_descriptor11 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class24.prototype, "arguments", [_dec20], {
75658
75691
  configurable: true,
75659
75692
  enumerable: true,
75660
75693
  writable: true,
@@ -76233,7 +76266,7 @@ let MathContainer = (_dec111 = (0,_markupGenerator_Serializer_SugarSerializer__W
76233
76266
  writable: true,
76234
76267
  initializer: null
76235
76268
  })), _class134)) || _class133);
76236
- 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, FormulaIsSnilsExpression, FormulaIsInnExpression, FormulaIsValidAccountNumberExpression, FormulaIsValidMirCardNumberExpression, FormulaCastExpression, FormulaConcatExpression, FormulaGroupSumExpression, FormulaGroupCountExpression, FormulaNewLineExpression, FormulaOneOfExpression];
76269
+ 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, FormulaIsSnilsExpression, FormulaIsInnExpression, FormulaIsValidAccountNumberExpression, FormulaIsValidMirCardNumberExpression, FormulaCastExpression, FormulaConcatExpression, FormulaGroupSumExpression, FormulaGroupCountExpression, FormulaNewLineExpression, FormulaOneOfExpression, FormulaOneOfItemsExpression];
76237
76270
 
76238
76271
  /***/ }),
76239
76272
 
@@ -78318,24 +78351,27 @@ class KCXmlGeneratorBase {
78318
78351
  const compiledExpressions = expression.arguments.map(arg => this.compileExpression(prefix, targetFullPath, arg, deps)).join(",");
78319
78352
  return `expression.sum([${compiledExpressions}])`;
78320
78353
  }
78354
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaOneOfItemsExpression) {
78355
+ const itemsText = expression.expressions.map(x => this.compileExpression(prefix, targetFullPath, x, deps)).join(", ");
78356
+ return `JSON.stringify([${itemsText}])`;
78357
+ }
78321
78358
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGroupSumExpression) {
78322
- const targetKeyPath = this.getModelPath(prefix, expression.targetKeyPath);
78323
- deps.push(new DependencyWithoutChecks(targetKeyPath));
78359
+ const targetKeys = this.compileExpression(prefix, targetFullPath, expression.targetKeys, deps);
78324
78360
  const sourceKeyPath = this.getModelPath(prefix, expression.sourceKeyPath);
78325
- const sourceKeyDeps = this.calculatedGroupSumDependencyForSourcePath(targetKeyPath, sourceKeyPath);
78361
+ const sourceKeyDeps = this.calculatedGroupSumDependencyForSourcePath(targetFullPath, sourceKeyPath);
78326
78362
  deps.push(new DependencyWithoutChecks(sourceKeyDeps.currentDepsPath, sourceKeyDeps.eachDepsPath));
78327
78363
  const sourceValuePath = this.getModelPath(prefix, expression.sourceValuePath);
78328
- const sourceValueDeps = this.calculatedGroupSumDependencyForSourcePath(targetKeyPath, sourceValuePath);
78364
+ const sourceValueDeps = this.calculatedGroupSumDependencyForSourcePath(targetFullPath, sourceValuePath);
78329
78365
  deps.push(new DependencyWithoutChecks(sourceValueDeps.currentDepsPath, sourceValueDeps.eachDepsPath));
78330
- return gcf(x => x.groupSum, `"${targetKeyPath}", "${sourceKeyPath}", "${sourceValuePath}"`);
78366
+ return gcf(x => x.groupSum, `${targetKeys}, "${sourceKeyPath}", "${sourceValuePath}"`);
78331
78367
  }
78332
78368
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGroupCountExpression) {
78333
- const targetKeyPath = this.getModelPath(prefix, expression.targetKeyPath);
78334
- deps.push(new DependencyWithoutChecks(targetKeyPath));
78369
+ const targetKeys = this.compileExpression(prefix, targetFullPath, expression.targetKeys, deps);
78370
+ deps.push(new DependencyWithoutChecks(targetFullPath));
78335
78371
  const sourceKeyPath = this.getModelPath(prefix, expression.sourceKeyPath);
78336
- const sourceKeyDeps = this.calculatedGroupSumDependencyForSourcePath(targetKeyPath, sourceKeyPath);
78372
+ const sourceKeyDeps = this.calculatedGroupSumDependencyForSourcePath(targetFullPath, sourceKeyPath);
78337
78373
  deps.push(new DependencyWithoutChecks(sourceKeyDeps.currentDepsPath, sourceKeyDeps.eachDepsPath));
78338
- return gcf(x => x.groupCount, `"${targetKeyPath}", "${sourceKeyPath}"`);
78374
+ return gcf(x => x.groupCount, `${targetKeys}, "${sourceKeyPath}"`);
78339
78375
  }
78340
78376
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaConcatExpression) {
78341
78377
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.ensureArrayLengthGreaterThenOrEqual)(expression.arguments, 2);
@@ -79847,6 +79883,7 @@ __webpack_require__.r(__webpack_exports__);
79847
79883
  /* harmony export */ "OneOfExpression": () => (/* binding */ OneOfExpression),
79848
79884
  /* harmony export */ "NoDepsExpression": () => (/* binding */ NoDepsExpression),
79849
79885
  /* harmony export */ "HasPicklistValueExpression": () => (/* binding */ HasPicklistValueExpression),
79886
+ /* harmony export */ "ArrayStringExpression": () => (/* binding */ ArrayStringExpression),
79850
79887
  /* harmony export */ "FLangStatement": () => (/* binding */ FLangStatement),
79851
79888
  /* harmony export */ "SetStatement": () => (/* binding */ SetStatement)
79852
79889
  /* harmony export */ });
@@ -80690,6 +80727,23 @@ class HasPicklistValueExpression extends FLangExpression {
80690
80727
  return `hasPicklistValue(${expression}, ${this.gidExpression})`;
80691
80728
  }
80692
80729
  }
80730
+ class ArrayStringExpression extends FLangExpression {
80731
+ constructor(expressions) {
80732
+ super();
80733
+ this.expressions = void 0;
80734
+ this.expressions = expressions;
80735
+ }
80736
+ *getChildNodes() {
80737
+ yield* this.expressions;
80738
+ }
80739
+ getType() {
80740
+ return BuildInTypeExpression.string;
80741
+ }
80742
+ convertToString() {
80743
+ const stringItems = this.expressions.map(x => x.convertToString()).join(", ");
80744
+ return `"[" ${stringItems} "]"`;
80745
+ }
80746
+ }
80693
80747
  class FLangStatement extends FLangNode {}
80694
80748
  class SetStatement extends FLangStatement {
80695
80749
  constructor(left, right) {
@@ -81193,6 +81247,10 @@ class FormulaExpressionToFlangExpressionConverter {
81193
81247
  const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
81194
81248
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OneOfExpression(arg, items);
81195
81249
  }
81250
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOneOfItemsExpression) {
81251
+ const items = expression.expressions.map(item => this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule));
81252
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArrayStringExpression(items);
81253
+ }
81196
81254
  throw new Error(`Unsupported type of node: ${expression.constructor.name}`);
81197
81255
  }
81198
81256
  compileEqExpression(prefix, target, expression, addPrecalculationRule) {
@@ -81206,7 +81264,7 @@ class FormulaExpressionToFlangExpressionConverter {
81206
81264
  }
81207
81265
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(right));
81208
81266
  }
81209
- compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeyPath, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
81267
+ compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
81210
81268
  const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
81211
81269
  const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
81212
81270
  const firstPart = matchPaths.matchedPath.toCurrentIteration();
@@ -81216,21 +81274,29 @@ class FormulaExpressionToFlangExpressionConverter {
81216
81274
  const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
81217
81275
  const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
81218
81276
  const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddSumExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DictLiteralExpression());
81219
- const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetExpression(reduceExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(targetKeyPath.toCurrentIteration(), "value"));
81220
- return finalValueExpression;
81277
+ if (reduceExpression == undefined) {
81278
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Target and source must be in different collections! " + "\n" + `Target: ${target}` + "\n" + `SourceKey: ${sourceKeyPath}`);
81279
+ }
81280
+ if (targetKeys instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArrayStringExpression && targetKeys.expressions.length === 1) {
81281
+ var _targetKeys$expressio;
81282
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetExpression(reduceExpression, (_targetKeys$expressio = targetKeys.expressions[0]) !== null && _targetKeys$expressio !== void 0 ? _targetKeys$expressio : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
81283
+ return finalValueExpression;
81284
+ } else {
81285
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Server normalization does not support multiple keys in groupSum operator");
81286
+ }
81221
81287
  }
81222
81288
  compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
81223
- const targetKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.targetKeyPath);
81289
+ const targetKeys = this.compileExpressionToFlangExpressionInternal(expression.targetKeys, prefix, target, addPrecalculationRule);
81224
81290
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
81225
81291
  const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
81226
81292
  const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value");
81227
- return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeyPath, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
81293
+ return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
81228
81294
  }
81229
81295
  compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
81230
- const targetKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.targetKeyPath);
81296
+ const targetKeys = this.compileExpressionToFlangExpressionInternal(expression.targetKeys, prefix, target, addPrecalculationRule);
81231
81297
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
81232
81298
  const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1);
81233
- return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeyPath, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
81299
+ return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
81234
81300
  }
81235
81301
  compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
81236
81302
  const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
@@ -81283,6 +81349,19 @@ class FormulaExpressionToFlangExpressionConverter {
81283
81349
  }
81284
81350
  return result;
81285
81351
  }
81352
+
81353
+ // private makeConcat(expressions: FLangExpression[]) {
81354
+ // const result = expressions.reduce<FLangExpression | undefined>((acc, curr) => {
81355
+ // const currExpr = castOperandToStringIfNeed(curr);
81356
+ // return acc != undefined ? new ConcatStringsExpression(acc, currExpr) : currExpr;
81357
+ // }, undefined);
81358
+ //
81359
+ // if (result == undefined) {
81360
+ // throw new InvalidProgramStateError();
81361
+ // }
81362
+ // return result;
81363
+ // }
81364
+
81286
81365
  compileOrExpression(expression, prefix, target, addPrecalculationRule) {
81287
81366
  const result = expression.arguments.reduce((acc, curr) => {
81288
81367
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
@@ -83399,11 +83478,11 @@ __webpack_require__.r(__webpack_exports__);
83399
83478
 
83400
83479
 
83401
83480
 
83402
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
83481
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
83403
83482
 
83404
83483
 
83405
83484
 
83406
- let ActionNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("action", `Элемент выпадашки/кнопки с выпадющим меню`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/Action/Common sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_4__.DataReferenceMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("onClick", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.helperFunctionName, "Имя кастомной helpers функции, которая вызовется при клике"), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("metricName", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, "Название метрики"), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("tid", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, "Возможность установки произвольных data-tid атрибутов, может пригодиться другим командам, или для идентификации элемента в тестах"), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disabled", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, ""), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_5__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_5__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("icon", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, `Название кастомной иконки`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)(), _dec(_class = (_class2 = class ActionNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
83485
+ let ActionNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("action", `Элемент выпадашки/кнопки с выпадющим меню`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/Action/Common sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_4__.DataReferenceMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("onClick", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.helperFunctionName, "Имя кастомной helpers функции, которая вызовется при клике"), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("metricName", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, "Название метрики"), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("tid", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, "Возможность установки произвольных data-tid атрибутов, может пригодиться другим командам, или для идентификации элемента в тестах"), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disabled", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, ""), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_5__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_5__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("icon", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, `Название кастомной иконки`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("menuSeparator", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, `Элемент разделителя меню`), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)(), _dec(_class = (_class2 = class ActionNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
83407
83486
  constructor(...args) {
83408
83487
  super(...args);
83409
83488
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dataReference", _descriptor, this);
@@ -83413,7 +83492,8 @@ let ActionNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE
83413
83492
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disabled", _descriptor5, this);
83414
83493
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disabled2", _descriptor6, this);
83415
83494
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "icon", _descriptor7, this);
83416
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor8, this);
83495
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "menuSeparator", _descriptor8, this);
83496
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor9, this);
83417
83497
  }
83418
83498
  getOwnPath() {
83419
83499
  return this.dataReference.getOwnPath();
@@ -83453,7 +83533,12 @@ let ActionNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE
83453
83533
  enumerable: true,
83454
83534
  writable: true,
83455
83535
  initializer: null
83456
- }), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec9], {
83536
+ }), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "menuSeparator", [_dec9], {
83537
+ configurable: true,
83538
+ enumerable: true,
83539
+ writable: true,
83540
+ initializer: null
83541
+ }), _descriptor9 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec10], {
83457
83542
  configurable: true,
83458
83543
  enumerable: true,
83459
83544
  writable: true,
@@ -83785,7 +83870,9 @@ __webpack_require__.r(__webpack_exports__);
83785
83870
  /* harmony import */ var _ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ComponentMarkupBuilder/ComponentMarkupBuilder */ "./Generator/src/generators/markupGenerator/ComponentMarkupBuilder/ComponentMarkupBuilder.ts");
83786
83871
  /* harmony import */ var _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../SugarNodeConverter */ "./Generator/src/generators/markupGenerator/SugarNodeConverter.ts");
83787
83872
  /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
83788
- /* harmony import */ var _DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DropdownButtonNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/Action/DropdownButton/DropdownButtonNode.ts");
83873
+ /* harmony import */ var _SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../SugarNodes/SugarNodeUtils */ "./Generator/src/generators/markupGenerator/SugarNodes/SugarNodeUtils.ts");
83874
+ /* harmony import */ var _DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DropdownButtonNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/Action/DropdownButton/DropdownButtonNode.ts");
83875
+
83789
83876
 
83790
83877
 
83791
83878
 
@@ -83793,27 +83880,27 @@ __webpack_require__.r(__webpack_exports__);
83793
83880
 
83794
83881
  class DropdownButtonConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.SugarNodeConverterBase {
83795
83882
  static getAcceptNodeClass() {
83796
- return _DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__.DropdownButtonNode;
83883
+ return _DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__.DropdownButtonNode;
83797
83884
  }
83798
83885
  get nodePaths() {
83799
- const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__.DropdownButtonNode);
83886
+ const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__.DropdownButtonNode);
83800
83887
  return [(0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getNewBindingPathExpression)(node)];
83801
83888
  }
83802
83889
  doBuildDataDeclaration(context) {
83803
83890
  return _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_0__.emptyDataDeclarationCollection;
83804
83891
  }
83805
83892
  buildChildrenDataDeclaration(context) {
83806
- const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__.DropdownButtonNode);
83893
+ const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__.DropdownButtonNode);
83807
83894
  return context.mergeDataDeclaration(...node.items.map(item => context.processChildrenDataDeclaration(item.children)));
83808
83895
  }
83809
83896
  *doTraverseChildren() {
83810
- const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__.DropdownButtonNode);
83897
+ const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__.DropdownButtonNode);
83811
83898
  for (const item of node.items) {
83812
83899
  yield* item.children;
83813
83900
  }
83814
83901
  }
83815
83902
  doConvert(context) {
83816
- const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_4__.DropdownButtonNode);
83903
+ const node = this.getCurrentNodeAs(_DropdownButtonNode__WEBPACK_IMPORTED_MODULE_5__.DropdownButtonNode);
83817
83904
  const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_1__.componentMarkupBuilder)("DropdownButton");
83818
83905
  markupBuilder.prop("data-tid").set(node.tid);
83819
83906
  markupBuilder.prop(x => x.width).set(node.width);
@@ -83825,6 +83912,13 @@ class DropdownButtonConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
83825
83912
  itemBuilder.prop("data-tid").set(item.tid);
83826
83913
  itemBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getNewBindingPathExpression)(item));
83827
83914
  itemBuilder.prop(x => x.metricName).set(item.metricName);
83915
+ itemBuilder.prop(x => x.menuSeparator).set(item.menuSeparator);
83916
+ if (item.disabled2 != undefined) {
83917
+ itemBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_4__.buildExpressionPropValue)(item.disabled2));
83918
+ if (this.getLegacyNode().getParent() != undefined) {
83919
+ itemBuilder.prop(x => x.evaluatorsContextPath).set(this.getEvaluatorsContextPathExpression());
83920
+ }
83921
+ }
83828
83922
  itemBuilder.prop(x => x.onActionClick).set(context.generateHelperFunctionExpression(node, "onClick", item.onClick));
83829
83923
  itemBuilder.appendChild(context.convertChildNodes(item.children));
83830
83924
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.6.0",
3
+ "version": "5.7.0-fs-7964-multiple-keys-groupsum.8",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,