@kontur.candy/generator 4.272.0-pribyl-copy-application5.3 → 4.272.0-server-normalization-fixes.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.
Files changed (2) hide show
  1. package/dist/index.js +198 -114
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -115386,7 +115386,7 @@ class KCLangAntlrVisitor {
115386
115386
  const expression = ctx.expression();
115387
115387
  const withBlocks = ctx.withBlock().map(i => i.accept(this));
115388
115388
  let description = "";
115389
- let errorLevel = "warning";
115389
+ let errorLevel = undefined;
115390
115390
 
115391
115391
  for (const withBlock of withBlocks) {
115392
115392
  if (withBlock) {
@@ -121532,10 +121532,12 @@ __webpack_require__.r(__webpack_exports__);
121532
121532
  /* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
121533
121533
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
121534
121534
  /* harmony import */ var _Common_IndentString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/IndentString */ "./Common/IndentString.ts");
121535
- /* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
121536
- /* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
121537
- /* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
121538
- /* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
121535
+ /* harmony import */ var _StringUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../StringUtils */ "./Generator/src/common/StringUtils.ts");
121536
+ /* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
121537
+ /* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
121538
+ /* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
121539
+ /* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
121540
+
121539
121541
 
121540
121542
 
121541
121543
 
@@ -121640,7 +121642,7 @@ function generateKCXmlExpression(expression) {
121640
121642
  }
121641
121643
 
121642
121644
  function formatDescribeStatement(ast, matchPath, describe) {
121643
- return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_4__.KCLangDescriptionParser.parse(describe.text).map(item => {
121645
+ return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_5__.KCLangDescriptionParser.parse(describe.text).map(item => {
121644
121646
  if (typeof item === "string") {
121645
121647
  return item;
121646
121648
  } else {
@@ -121672,12 +121674,12 @@ function generateBlockKCXmlFormulas(block, parents) {
121672
121674
  let lastDescribeStatement;
121673
121675
 
121674
121676
  for (const statement of block.statements) {
121675
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isFormulaStatement)(statement)) {
121677
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
121676
121678
  result.push(generateKCXmlFormula(statement, matchPath, lastDescribeStatement));
121677
121679
  lastDescribeStatement = undefined;
121678
121680
  }
121679
121681
 
121680
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isEnsureStatement)(statement)) {
121682
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
121681
121683
  lastDescribeStatement = undefined;
121682
121684
  }
121683
121685
 
@@ -121685,11 +121687,11 @@ function generateBlockKCXmlFormulas(block, parents) {
121685
121687
  throw new Error("Describe should be placed before assign of ensure statements");
121686
121688
  }
121687
121689
 
121688
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isDescribeStatement)(statement)) {
121690
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
121689
121691
  lastDescribeStatement = statement;
121690
121692
  }
121691
121693
 
121692
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isBlockStatement)(statement)) {
121694
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
121693
121695
  result.push(generateBlockKCXmlFormulas(statement, [...(parents !== null && parents !== void 0 ? parents : []), block]));
121694
121696
  }
121695
121697
  }
@@ -121700,7 +121702,7 @@ function generateBlockKCXmlFormulas(block, parents) {
121700
121702
  function guessConditionTarget(condition) {
121701
121703
  let result;
121702
121704
 
121703
- class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_3__.DefaultKCLangExpressionVisitor {
121705
+ class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_4__.DefaultKCLangExpressionVisitor {
121704
121706
  visitExistsKCLangNode(node) {
121705
121707
  if (result == undefined) {
121706
121708
  result = node.select;
@@ -121721,12 +121723,12 @@ function guessConditionTarget(condition) {
121721
121723
 
121722
121724
  }
121723
121725
 
121724
- (0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_3__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
121726
+ (0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_4__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
121725
121727
  return result;
121726
121728
  }
121727
121729
 
121728
121730
  function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
121729
- const levelAttr = ast.level === "error" ? ` errorLevel="Error"` : "";
121731
+ const levelAttr = ast.level === undefined ? "" : ` errorLevel="${(0,_StringUtils__WEBPACK_IMPORTED_MODULE_3__.capitalizeFirstLetter)(ast.level)}"`;
121730
121732
  const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
121731
121733
  const guessedTarget = guessConditionTarget(ast);
121732
121734
  const targetAttr = guessedTarget != undefined ? ` target="${guessedTarget}"` : "";
@@ -121734,7 +121736,7 @@ function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
121734
121736
  if (parentConditions != undefined && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.arrayIsNotEmpty)(parentConditions)) {
121735
121737
  var _parentConditions$map;
121736
121738
 
121737
- const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
121739
+ const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
121738
121740
  return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + ` <m:when>\n` + (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(condition), 2) + "\n" + (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(ast.expression), 2) + "\n" + ` </m:when>\n` + `</m:condition>`;
121739
121741
  }
121740
121742
 
@@ -121747,11 +121749,11 @@ function generateBlockKCXmlConditions(block, parents, parentConditions) {
121747
121749
  let lastDescribeStatement;
121748
121750
 
121749
121751
  for (const statement of block.statements) {
121750
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isFormulaStatement)(statement)) {
121752
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isFormulaStatement)(statement)) {
121751
121753
  lastDescribeStatement = undefined;
121752
121754
  }
121753
121755
 
121754
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isEnsureStatement)(statement)) {
121756
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(statement)) {
121755
121757
  result.push(generateKCXmlCondition(statement, matchPath, parentConditions, lastDescribeStatement));
121756
121758
  lastDescribeStatement = undefined;
121757
121759
  }
@@ -121760,15 +121762,15 @@ function generateBlockKCXmlConditions(block, parents, parentConditions) {
121760
121762
  throw new Error("Describe should be placed before assign of ensure statements");
121761
121763
  }
121762
121764
 
121763
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isDescribeStatement)(statement)) {
121765
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(statement)) {
121764
121766
  lastDescribeStatement = statement;
121765
121767
  }
121766
121768
 
121767
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isConditionalStatement)(statement)) {
121769
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(statement)) {
121768
121770
  result.push(generateConditionalConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
121769
121771
  }
121770
121772
 
121771
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isBlockStatement)(statement)) {
121773
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(statement)) {
121772
121774
  result.push(generateBlockKCXmlConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
121773
121775
  }
121774
121776
  }
@@ -121782,7 +121784,7 @@ function generateConditionalConditions(conditionalStatement, parents, parentCond
121782
121784
  let lastDescribeStatement;
121783
121785
 
121784
121786
  for (const x of conditionalStatement.statements) {
121785
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isEnsureStatement)(x)) {
121787
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isEnsureStatement)(x)) {
121786
121788
  result.push(generateKCXmlCondition(x, matchPath, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement], lastDescribeStatement));
121787
121789
  lastDescribeStatement = undefined;
121788
121790
  }
@@ -121791,15 +121793,15 @@ function generateConditionalConditions(conditionalStatement, parents, parentCond
121791
121793
  throw new Error("Describe should be placed before assign of ensure statements");
121792
121794
  }
121793
121795
 
121794
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isDescribeStatement)(x)) {
121796
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isDescribeStatement)(x)) {
121795
121797
  lastDescribeStatement = x;
121796
121798
  }
121797
121799
 
121798
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isConditionalStatement)(x)) {
121800
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isConditionalStatement)(x)) {
121799
121801
  result.push(generateConditionalConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
121800
121802
  }
121801
121803
 
121802
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_5__.isBlockStatement)(x)) {
121804
+ if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_6__.isBlockStatement)(x)) {
121803
121805
  result.push(generateBlockKCXmlConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
121804
121806
  }
121805
121807
  }
@@ -121833,7 +121835,7 @@ function generateKCXml(blocks) {
121833
121835
 
121834
121836
  class KCLangToXmlTranspiler {
121835
121837
  static transpile(kcLang, customParser) {
121836
- const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__.KCLangAntlrParser.parse;
121838
+ const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_7__.KCLangAntlrParser.parse;
121837
121839
  const kcxml = generateKCXml(parser(kcLang).blocks);
121838
121840
  return kcxml;
121839
121841
  }
@@ -121927,6 +121929,10 @@ class FormSchemaRngAttribute {
121927
121929
  return this.optional || this.nillable || false;
121928
121930
  }
121929
121931
 
121932
+ isOptional() {
121933
+ return this.isOptionalOrNillable() || this.parent.isOptionalOrNillable();
121934
+ }
121935
+
121930
121936
  }
121931
121937
  const RootParent = Symbol.for("__ROOT_ELEMENT_PARENT__");
121932
121938
  class FormSchemaRngElement {
@@ -121978,6 +121984,10 @@ class FormSchemaRngElement {
121978
121984
  return this.optional || this.nillable || false;
121979
121985
  }
121980
121986
 
121987
+ isOptional() {
121988
+ return this.isOptionalOrNillable();
121989
+ }
121990
+
121981
121991
  getChildren() {
121982
121992
  return this.children;
121983
121993
  }
@@ -131501,7 +131511,7 @@ class FLangValidationBuildContext {
131501
131511
  }, undefined);
131502
131512
 
131503
131513
  if (enumerationRuleBody != undefined) {
131504
- yield [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(enumerationRuleBody), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Поле должно быть заполнено"]`)];
131514
+ yield [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(enumerationRuleBody), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Поле заполнено не по справочнику"]`)];
131505
131515
  }
131506
131516
 
131507
131517
  const makeArrayLiteral = text => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["${text}"]`);
@@ -131562,7 +131572,7 @@ class FLangValidationBuildContext {
131562
131572
  const totalDigitsValue = (_typeNodeTotalDigits$ = typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.value) !== null && _typeNodeTotalDigits$ !== void 0 ? _typeNodeTotalDigits$ : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.totalDigits;
131563
131573
 
131564
131574
  if (totalDigitsValue != undefined) {
131565
- const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DecimalLiteralExpression(totalDigitsValue)));
131575
+ const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NumLenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DecimalLiteralExpression(totalDigitsValue)));
131566
131576
  yield [totalDigitsRuleBody, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Число не может содержать более ${totalDigitsValue} знаков"]`)];
131567
131577
  }
131568
131578
 
@@ -131570,8 +131580,11 @@ class FLangValidationBuildContext {
131570
131580
  const pattern = (_typeNodePattern$valu = typeNodePattern === null || typeNodePattern === void 0 ? void 0 : typeNodePattern.value) !== null && _typeNodePattern$valu !== void 0 ? _typeNodePattern$valu : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : (_schemaTypeNode$patte = schemaTypeNode.patterns) === null || _schemaTypeNode$patte === void 0 ? void 0 : _schemaTypeNode$patte[0];
131571
131581
 
131572
131582
  if (pattern != undefined) {
131583
+ var _schemaTypeNode$descr;
131584
+
131573
131585
  const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CallExpression("regexMatch", [valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(pattern)]));
131574
- yield [totalDigitsRuleBody, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Поле должно быть заполнено"]`)];
131586
+ const validationErrorMessage = (_schemaTypeNode$descr = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description) !== null && _schemaTypeNode$descr !== void 0 ? _schemaTypeNode$descr : "Поле заполнено неверно";
131587
+ yield [totalDigitsRuleBody, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["${validationErrorMessage}"]`)];
131575
131588
  }
131576
131589
 
131577
131590
  const typeNodeFractional = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children9 = typeNode.children) === null || _typeNode$children9 === void 0 ? void 0 : _typeNode$children9.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.FractiondigitsTypeCheckNode));
@@ -131704,6 +131717,7 @@ __webpack_require__.r(__webpack_exports__);
131704
131717
  /* harmony export */ "BoolLiteralExpression": () => (/* binding */ BoolLiteralExpression),
131705
131718
  /* harmony export */ "AbsExpression": () => (/* binding */ AbsExpression),
131706
131719
  /* harmony export */ "LenExpression": () => (/* binding */ LenExpression),
131720
+ /* harmony export */ "NumLenExpression": () => (/* binding */ NumLenExpression),
131707
131721
  /* harmony export */ "FractionalLenExpression": () => (/* binding */ FractionalLenExpression),
131708
131722
  /* harmony export */ "RoundExpression": () => (/* binding */ RoundExpression),
131709
131723
  /* harmony export */ "IntegerLiteralExpression": () => (/* binding */ IntegerLiteralExpression),
@@ -132060,6 +132074,18 @@ class LenExpression extends FLangExpression {
132060
132074
  return `len(${this.expression.convertToString()})`;
132061
132075
  }
132062
132076
 
132077
+ }
132078
+ class NumLenExpression extends FLangExpression {
132079
+ constructor(expression) {
132080
+ super();
132081
+ this.expression = void 0;
132082
+ this.expression = expression;
132083
+ }
132084
+
132085
+ convertToString() {
132086
+ return `numLen(${this.expression.convertToString()})`;
132087
+ }
132088
+
132063
132089
  }
132064
132090
  class FractionalLenExpression extends FLangExpression {
132065
132091
  constructor(expression) {
@@ -132326,7 +132352,7 @@ class NormalizationRulesGenerator {
132326
132352
  buildSugarFLangRules() {
132327
132353
  const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_2__.FormConverter(this.sugarRoot);
132328
132354
  const builder = new _markupGenerator_FLangNormalizationRulesBuilder__WEBPACK_IMPORTED_MODULE_8__.FLangNormalizationRulesBuilder(this.controlCustomizationContext);
132329
- return converter.buildNormalizeRules(builder);
132355
+ return converter.buildNormalizeRules(builder, this.formSchemaRng);
132330
132356
  }
132331
132357
 
132332
132358
  *buildFormulaFLangRules() {
@@ -132514,15 +132540,35 @@ class NormalizationRulesGenerator {
132514
132540
  }
132515
132541
 
132516
132542
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
132517
- const result = expression.arguments.reduce((acc, curr) => {
132518
- const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
132543
+ const args = this.getFlatArgumentExpressions(expression.arguments);
132544
+ const conditionExpression = args.reduce((acc, curr) => {
132545
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
132546
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(acc, currExpr) : currExpr;
132547
+ }, undefined);
132548
+
132549
+ if (conditionExpression == undefined) {
132550
+ const result = expression.arguments.reduce((acc, curr) => {
132551
+ const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
132552
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(acc, currExpr) : currExpr;
132553
+ }, undefined);
132554
+
132555
+ if (result == undefined) {
132556
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
132557
+ }
132558
+
132559
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132560
+ }
132561
+
132562
+ const trueResultExpression = expression.arguments.reduce((acc, curr) => {
132563
+ const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), 0);
132519
132564
  return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(acc, currExpr) : currExpr;
132520
132565
  }, undefined);
132521
132566
 
132522
- if (result == undefined) {
132567
+ if (trueResultExpression == undefined) {
132523
132568
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
132524
132569
  }
132525
132570
 
132571
+ const result = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(conditionExpression, trueResultExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
132526
132572
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132527
132573
  }
132528
132574
 
@@ -132592,19 +132638,33 @@ class NormalizationRulesGenerator {
132592
132638
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132593
132639
  }
132594
132640
 
132641
+ getFlatArgumentExpressions(expressions) {
132642
+ return expressions.reduce((acc, curr) => {
132643
+ if (curr instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaArgumentExpression) {
132644
+ return acc.concat(curr);
132645
+ }
132646
+
132647
+ if (curr instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaSumExpression || curr instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaDivisionExpression || curr instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaMultiplyExpression) {
132648
+ return acc.concat(this.getFlatArgumentExpressions(curr.arguments));
132649
+ }
132650
+
132651
+ return acc;
132652
+ }, []);
132653
+ }
132654
+
132595
132655
  castOperandToStringIfNeed(operandExpression) {
132596
132656
  return operandExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression || operandExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression && operandExpression.getTargetType() == "string" ? operandExpression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(operandExpression, "string");
132597
132657
  }
132598
132658
 
132599
- castOperandToDecimalIfNeed(operandExpression) {
132600
- return operandExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression ? operandExpression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(operandExpression, "decimal");
132659
+ castOperandToDecimalIfNeed(operandExpression, defaultValue) {
132660
+ return operandExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression ? operandExpression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(operandExpression, "decimal", defaultValue != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(defaultValue) : undefined);
132601
132661
  }
132602
132662
 
132603
132663
  *buildSugarValidationRules() {
132604
132664
  const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_2__.FormConverter(this.sugarRoot);
132605
132665
  const context = new _FLangValidationBuildContext__WEBPACK_IMPORTED_MODULE_14__.FLangValidationBuildContext(this.typesRegistry, this.formSchemaRng, this.useSchemaValidations);
132606
132666
  const kcRules = this.buildKcValidationRules();
132607
- const allRules = Iterator.from(converter.buildFLangValidations(context)).reduce((ctx, current) => {
132667
+ const allRules = Iterator.from(converter.buildFLangValidations(context, this.formSchemaRng)).reduce((ctx, current) => {
132608
132668
  const statement = current.statement;
132609
132669
 
132610
132670
  if (!(statement instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement)) {
@@ -137089,6 +137149,7 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
137089
137149
  bindingPath: (0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(pageNode),
137090
137150
  optional: pageNode.optional,
137091
137151
  pageActions: pageNode.pageActions,
137152
+ hideEnableAutoValues: pageNode.hideEnableAutoValues,
137092
137153
  showOnDemand: pageNode.showOnDemand,
137093
137154
  onNavigateFromErrorLog: context.generateHelperFunctionExpressionWithoutContext(pageNode, "onNavigateFromErrorLog", pageNode.onNavigateFromErrorLog)
137094
137155
  };
@@ -137200,6 +137261,10 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
137200
137261
  markupBuilder.prop(x => x.pageActions).set(pageNode.pageActions);
137201
137262
  }
137202
137263
 
137264
+ if (pageNode.hideEnableAutoValues != undefined) {
137265
+ markupBuilder.prop(x => x.hideEnableAutoValues).set(pageNode.hideEnableAutoValues);
137266
+ }
137267
+
137203
137268
  const pageMarkupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)([], this.getPageName(pageNode));
137204
137269
  markupBuilder.appendChild(pageMarkupBuilder);
137205
137270
  markupBuilder.appendChildren(pageNode.pages.map(x => this.buildPageUnit(node, x)));
@@ -138037,19 +138102,18 @@ class PageConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4__.Sug
138037
138102
  return false;
138038
138103
  }
138039
138104
 
138040
- *doBuildNormalizeRules(builder) {
138105
+ *doBuildNormalizeRules(builder, formSchemaRng) {
138041
138106
  const node = this.getCurrentNodeAs(_PageNode__WEBPACK_IMPORTED_MODULE_14__.PageNode);
138107
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
138042
138108
 
138043
138109
  if (node.path == undefined) {
138044
138110
  return;
138045
138111
  }
138046
138112
 
138047
138113
  if (node.multiple) {
138048
- var _node$optional;
138049
-
138050
- yield* builder.childrenInitializer(node, (_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false);
138114
+ const isOptional = node.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.optional;
138115
+ yield* builder.childrenInitializer(node, isOptional !== null && isOptional !== void 0 ? isOptional : false);
138051
138116
  yield* builder.specialFieldsInitializer(node, {
138052
- optional: node.optional,
138053
138117
  disabled: undefined
138054
138118
  });
138055
138119
  }
@@ -138207,7 +138271,7 @@ __webpack_require__.r(__webpack_exports__);
138207
138271
 
138208
138272
 
138209
138273
 
138210
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23;
138274
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24;
138211
138275
 
138212
138276
 
138213
138277
 
@@ -138215,7 +138279,7 @@ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11
138215
138279
 
138216
138280
 
138217
138281
 
138218
- let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("page", `Страница (раздел)`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Page sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("id", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Уникальный идентификатор странцы. Все страницы в форме должны иметь уникальный идентификатор. 1111`), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("template", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("default", "title", "multiple", "diadoc"), 'Для множественных разделов необходимо указать `template="multiple"`, для обычных разделов `template="default"`'), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.bindingPathLink)} данного элемента`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("headerpanel", [_UnitParts_HeaderPanel_HeaderPanelNode__WEBPACK_IMPORTED_MODULE_3__.HeaderPanelNode]), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.deprecatedAttr)("title", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_4__.DeprecationReason.Removed), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.deprecatedAttr)("formName", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_4__.DeprecationReason.Removed), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("showOnDemand", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Раздел не будет отображаться на странице, пока не будет вызван явно. Например, через механизм отображения раздела в разделе.`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("onNavigateFromErrorLog", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.helperFunctionName, "Имя кастомной helpers функции, которая вызовется перед попыткой навигации в контрол внутри раздела"), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("orientation", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("landscape"), `Ориентация страницы. При значении landscape станницы займёт всю доступную ширину экрана`), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("navigationName", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.localizedString, `Название Раздела в меню, если в сахаре есть отдельное описание навигации (unitList), то указывать не нужно`), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("height", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Начальная высота раздела`), _dec13 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("minHeight", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Минимальная высота раздела`), _dec14 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("multiple", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Обозначение множественного раздела`), _dec15 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("unitsCountForPaging", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Количество инстансов множественного раздела на котором включается паджинация раздела`), _dec16 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("multipleAppearance", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("nested", "flat"), "Представление множественных разделов: вложенное или плоское"), _dec17 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("optional", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Опциональный раздел`), _dec18 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("pageActions", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.objectLiteral(), `Атрибут для кастомизации действий с разделом`), _dec19 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("navigationLimit", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Количество экземпляров множественного раздела после которого в левом меню будет включаться компактный режим отображения разделов. По умолчанию: 15. Используется только для множественных разделов`), _dec20 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("addingHint", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.localizedString, `Подсказка на кнопке добавления раздела в боковом меню. Используется только для множественных разделов`), _dec21 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)("page"), _dec22 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec23 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("title", [_PageTitleNode__WEBPACK_IMPORTED_MODULE_8__.PageTitleNode]), _dec24 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("visible", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.javaScriptExpressionLink)} для условного скрытия раздела`), _dec(_class = (_class2 = class PageNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.SugarNodeBase {
138282
+ let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("page", `Страница (раздел)`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Page sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("id", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Уникальный идентификатор странцы. Все страницы в форме должны иметь уникальный идентификатор. 1111`), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("template", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("default", "title", "multiple", "diadoc"), 'Для множественных разделов необходимо указать `template="multiple"`, для обычных разделов `template="default"`'), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.bindingPathLink)} данного элемента`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("headerpanel", [_UnitParts_HeaderPanel_HeaderPanelNode__WEBPACK_IMPORTED_MODULE_3__.HeaderPanelNode]), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.deprecatedAttr)("title", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_4__.DeprecationReason.Removed), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.deprecatedAttr)("formName", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_4__.DeprecationReason.Removed), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("showOnDemand", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Раздел не будет отображаться на странице, пока не будет вызван явно. Например, через механизм отображения раздела в разделе.`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("onNavigateFromErrorLog", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.helperFunctionName, "Имя кастомной helpers функции, которая вызовется перед попыткой навигации в контрол внутри раздела"), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("orientation", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("landscape"), `Ориентация страницы. При значении landscape станницы займёт всю доступную ширину экрана`), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("navigationName", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.localizedString, `Название Раздела в меню, если в сахаре есть отдельное описание навигации (unitList), то указывать не нужно`), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("height", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Начальная высота раздела`), _dec13 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("minHeight", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Минимальная высота раздела`), _dec14 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("multiple", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Обозначение множественного раздела`), _dec15 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("unitsCountForPaging", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Количество инстансов множественного раздела на котором включается паджинация раздела`), _dec16 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("multipleAppearance", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("nested", "flat"), "Представление множественных разделов: вложенное или плоское"), _dec17 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("optional", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Опциональный раздел`), _dec18 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("pageActions", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.objectLiteral(), `Атрибут для кастомизации действий с разделом`), _dec19 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("hideEnableAutoValues", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Всегда скрывать кнопку "Включить авторасчет", даже при включенной серверной нормализации`), _dec20 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("navigationLimit", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Количество экземпляров множественного раздела после которого в левом меню будет включаться компактный режим отображения разделов. По умолчанию: 15. Используется только для множественных разделов`), _dec21 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("addingHint", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.localizedString, `Подсказка на кнопке добавления раздела в боковом меню. Используется только для множественных разделов`), _dec22 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)("page"), _dec23 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec24 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("title", [_PageTitleNode__WEBPACK_IMPORTED_MODULE_8__.PageTitleNode]), _dec25 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("visible", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_6__.javaScriptExpressionLink)} для условного скрытия раздела`), _dec(_class = (_class2 = class PageNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.SugarNodeBase {
138219
138283
  constructor(...args) {
138220
138284
  super(...args);
138221
138285
 
@@ -138253,17 +138317,19 @@ let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5
138253
138317
 
138254
138318
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pageActions", _descriptor17, this);
138255
138319
 
138256
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "navigationLimit", _descriptor18, this);
138320
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "hideEnableAutoValues", _descriptor18, this);
138257
138321
 
138258
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "addingHint", _descriptor19, this);
138322
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "navigationLimit", _descriptor19, this);
138259
138323
 
138260
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pages", _descriptor20, this);
138324
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "addingHint", _descriptor20, this);
138261
138325
 
138262
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor21, this);
138326
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pages", _descriptor21, this);
138327
+
138328
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor22, this);
138263
138329
 
138264
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "title", _descriptor22, this);
138330
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "title", _descriptor23, this);
138265
138331
 
138266
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "visible", _descriptor23, this);
138332
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "visible", _descriptor24, this);
138267
138333
  }
138268
138334
 
138269
138335
  getOwnPath() {
@@ -138361,32 +138427,37 @@ let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5
138361
138427
  enumerable: true,
138362
138428
  writable: true,
138363
138429
  initializer: null
138364
- }), _descriptor18 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "navigationLimit", [_dec19], {
138430
+ }), _descriptor18 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "hideEnableAutoValues", [_dec19], {
138365
138431
  configurable: true,
138366
138432
  enumerable: true,
138367
138433
  writable: true,
138368
138434
  initializer: null
138369
- }), _descriptor19 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "addingHint", [_dec20], {
138435
+ }), _descriptor19 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "navigationLimit", [_dec20], {
138370
138436
  configurable: true,
138371
138437
  enumerable: true,
138372
138438
  writable: true,
138373
138439
  initializer: null
138374
- }), _descriptor20 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "pages", [_dec21], {
138440
+ }), _descriptor20 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "addingHint", [_dec21], {
138375
138441
  configurable: true,
138376
138442
  enumerable: true,
138377
138443
  writable: true,
138378
138444
  initializer: null
138379
- }), _descriptor21 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec22], {
138445
+ }), _descriptor21 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "pages", [_dec22], {
138446
+ configurable: true,
138447
+ enumerable: true,
138448
+ writable: true,
138449
+ initializer: null
138450
+ }), _descriptor22 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec23], {
138380
138451
  configurable: true,
138381
138452
  enumerable: true,
138382
138453
  writable: true,
138383
138454
  initializer: null
138384
- }), _descriptor22 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "title", [_dec23], {
138455
+ }), _descriptor23 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "title", [_dec24], {
138385
138456
  configurable: true,
138386
138457
  enumerable: true,
138387
138458
  writable: true,
138388
138459
  initializer: null
138389
- }), _descriptor23 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "visible", [_dec24], {
138460
+ }), _descriptor24 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "visible", [_dec25], {
138390
138461
  configurable: true,
138391
138462
  enumerable: true,
138392
138463
  writable: true,
@@ -144031,7 +144102,6 @@ class CrossfitTableConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
144031
144102
 
144032
144103
  yield* builder.childrenInitializer(rowNode, (_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : false, rowNode.defaultChildren);
144033
144104
  yield* builder.specialFieldsInitializer(rowNode, {
144034
- optional: rowNode.optional,
144035
144105
  disabled: undefined
144036
144106
  });
144037
144107
  }
@@ -147348,6 +147418,20 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147348
147418
  return _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode;
147349
147419
  }
147350
147420
 
147421
+ *doBuildNormalizeRules(builder, formSchemaRng) {
147422
+ const node = this.getCurrentNodeAs(_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode);
147423
+
147424
+ for (const row of node.rows) {
147425
+ if (row instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableMultilineNode) {
147426
+ var _ref;
147427
+
147428
+ const element = formSchemaRng.getElementByPath(row.getFullPath());
147429
+ const isOptional = (_ref = row.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : row.optional) !== null && _ref !== void 0 ? _ref : false;
147430
+ yield* builder.childrenInitializer(row, isOptional);
147431
+ }
147432
+ }
147433
+ }
147434
+
147351
147435
  *doTraverseChildren() {
147352
147436
  const node = this.getCurrentNodeAs(_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode);
147353
147437
 
@@ -147455,9 +147539,9 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147455
147539
 
147456
147540
  processMultilineNode(context, rowNode) {
147457
147541
  if (rowNode instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableMultilineNode) {
147458
- var _ref, _rowNode$optional;
147542
+ var _ref2, _rowNode$optional;
147459
147543
 
147460
- return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_ref = (_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : context.isMultipleNodeOptionalFromScheme(rowNode.getFullPath())) !== null && _ref !== void 0 ? _ref : false, rowNode.defaultChildren)]]), rowNode.maxOccurs != undefined && /^\d+$/.test(rowNode.maxOccurs) && context.maxOccurs(rowNode.getFullPath(), rowNode.maxOccurs), context.addSpecialFieldsEntry(rowNode, {
147544
+ return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_ref2 = (_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : context.isMultipleNodeOptionalFromScheme(rowNode.getFullPath())) !== null && _ref2 !== void 0 ? _ref2 : false, rowNode.defaultChildren)]]), rowNode.maxOccurs != undefined && /^\d+$/.test(rowNode.maxOccurs) && context.maxOccurs(rowNode.getFullPath(), rowNode.maxOccurs), context.addSpecialFieldsEntry(rowNode, {
147461
147545
  optional: rowNode.optional
147462
147546
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => this.processMultilineRowNode(context, rowNode2)));
147463
147547
  }
@@ -147530,11 +147614,11 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147530
147614
  const sideSize = (_node$side2 = node.side) !== null && _node$side2 !== void 0 ? _node$side2 : 0;
147531
147615
 
147532
147616
  if (this.isSimpleForm()) {
147533
- var _ref2, _node$deprecatedDiado;
147617
+ var _ref3, _node$deprecatedDiado;
147534
147618
 
147535
147619
  mb.prop(x => x.maxWidth).set(orientation === "landscape" ? maxWidth : undefined);
147536
147620
  mb.prop(x => x.sideSize).set(this.hasActionButton(node) && sideSize !== 0 ? sideSize + 1 : sideSize);
147537
- const width = (_ref2 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref2 !== void 0 ? _ref2 : maxWidthSimpleForm;
147621
+ const width = (_ref3 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref3 !== void 0 ? _ref3 : maxWidthSimpleForm;
147538
147622
  mb.prop(x => x.width).set(width);
147539
147623
  mb.prop(x => x.footerHeight).set(160);
147540
147624
  } else {
@@ -147823,10 +147907,10 @@ BindingPath: ${errorPath}`));
147823
147907
  if (this.isSimpleForm()) {
147824
147908
  mb.prop(x => x.buttonType).set(undefined);
147825
147909
  } else {
147826
- var _multiline$rowmenu, _ref3, _tableNode$removeButt;
147910
+ var _multiline$rowmenu, _ref4, _tableNode$removeButt;
147827
147911
 
147828
147912
  const rowMenu = (_multiline$rowmenu = multiline.rowmenu) !== null && _multiline$rowmenu !== void 0 ? _multiline$rowmenu : false;
147829
- const removebutton = (_ref3 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true;
147913
+ const removebutton = (_ref4 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref4 !== void 0 ? _ref4 : true;
147830
147914
  mb.prop(x => x.buttonType).set(rowMenu ? "RowMenu" : removebutton ? "RemoveRowButton" : undefined);
147831
147915
  }
147832
147916
 
@@ -147849,7 +147933,7 @@ BindingPath: ${errorPath}`));
147849
147933
  }
147850
147934
 
147851
147935
  getMultiline(context, node, multiline, start, end = Infinity) {
147852
- var _ref4, _node$removeButton, _multiline$rowmenu2, _ref5, _node$removeButton2, _context$popPathsCont2;
147936
+ var _ref5, _node$removeButton, _multiline$rowmenu2, _ref6, _node$removeButton2, _context$popPathsCont2;
147853
147937
 
147854
147938
  const overrideInfo = multiline.override ? context.controlCustomizationContext.getControlCustomizationInfo("multiline", multiline.override) : undefined;
147855
147939
  const mb = overrideInfo == undefined ? (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("MultiLine") : (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)(overrideInfo.dependencies, overrideInfo.controlName);
@@ -147863,7 +147947,7 @@ BindingPath: ${errorPath}`));
147863
147947
  mb.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_13__.getNewBindingPathExpression)(multiline));
147864
147948
  mb.prop(x => x.showRowBorder).set(multiline.showRowBorder);
147865
147949
  mb.prop(x => x.onRowCLick).set(context.generateHelperFunctionExpression(multiline, "onRowClick", multiline.onRowClick));
147866
- const hasRemoveButton = ((_ref4 = (_node$removeButton = node.removeButton) !== null && _node$removeButton !== void 0 ? _node$removeButton : multiline.removebutton) !== null && _ref4 !== void 0 ? _ref4 : true) || ((_multiline$rowmenu2 = multiline.rowmenu) !== null && _multiline$rowmenu2 !== void 0 ? _multiline$rowmenu2 : false);
147950
+ const hasRemoveButton = ((_ref5 = (_node$removeButton = node.removeButton) !== null && _node$removeButton !== void 0 ? _node$removeButton : multiline.removebutton) !== null && _ref5 !== void 0 ? _ref5 : true) || ((_multiline$rowmenu2 = multiline.rowmenu) !== null && _multiline$rowmenu2 !== void 0 ? _multiline$rowmenu2 : false);
147867
147951
  const needAddButton = multiline.addbutton !== "false";
147868
147952
 
147869
147953
  if (this.isSimpleForm()) {
@@ -147876,7 +147960,7 @@ BindingPath: ${errorPath}`));
147876
147960
  mb.prop(x => x.removeButtonPosition).set(undefined);
147877
147961
  }
147878
147962
 
147879
- mb.prop(x => x.disableScroll).set(needAddButton || ((_ref5 = (_node$removeButton2 = node.removeButton) !== null && _node$removeButton2 !== void 0 ? _node$removeButton2 : multiline.removebutton) !== null && _ref5 !== void 0 ? _ref5 : true) ? undefined : true);
147963
+ mb.prop(x => x.disableScroll).set(needAddButton || ((_ref6 = (_node$removeButton2 = node.removeButton) !== null && _node$removeButton2 !== void 0 ? _node$removeButton2 : multiline.removebutton) !== null && _ref6 !== void 0 ? _ref6 : true) ? undefined : true);
147880
147964
  context.pushPathsContext();
147881
147965
 
147882
147966
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayHasLength)(multiline.rows, 1)) {
@@ -147902,9 +147986,9 @@ BindingPath: ${errorPath}`));
147902
147986
  hasActionButton(node) {
147903
147987
  const multilines = node.rows.map(child => (0,_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.isMultilineNode)(child) ? child : child.columns.find(_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.isMultilineNode)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined);
147904
147988
  return multilines.some(multiline => {
147905
- var _ref6, _node$removeButton3;
147989
+ var _ref7, _node$removeButton3;
147906
147990
 
147907
- return ((_ref6 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref6 !== void 0 ? _ref6 : true) || multiline.rowmenu;
147991
+ return ((_ref7 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref7 !== void 0 ? _ref7 : true) || multiline.rowmenu;
147908
147992
  });
147909
147993
  }
147910
147994
 
@@ -148155,13 +148239,14 @@ class Table2MultirowConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
148155
148239
  return markupBuilder.buildConverterResult();
148156
148240
  }
148157
148241
 
148158
- *doBuildNormalizeRules(builder) {
148159
- var _node$optional2;
148242
+ *doBuildNormalizeRules(builder, formSchemaRng) {
148243
+ var _ref2;
148160
148244
 
148161
148245
  const node = this.getCurrentNodeAs(_Table2Node__WEBPACK_IMPORTED_MODULE_3__.Table2MultirowNode);
148162
- yield* builder.childrenInitializer(node, (_node$optional2 = node.optional) !== null && _node$optional2 !== void 0 ? _node$optional2 : false);
148246
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
148247
+ const isOptional = (_ref2 = node.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.optional) !== null && _ref2 !== void 0 ? _ref2 : false;
148248
+ yield* builder.childrenInitializer(node, isOptional);
148163
148249
  yield* builder.specialFieldsInitializer(node, {
148164
- optional: node.optional,
148165
148250
  disabled: undefined
148166
148251
  });
148167
148252
  }
@@ -148976,13 +149061,14 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
148976
149061
  return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_ref = (_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : context.isMultipleNodeOptionalFromScheme(node.getFullPath())) !== null && _ref !== void 0 ? _ref : false)]]), context.maxOccurs(node.getFullPath(), node.maxOccurs), context.addPathSectionDeclarationEntry(node));
148977
149062
  }
148978
149063
 
148979
- *doBuildNormalizeRules(builder) {
148980
- var _node$optional2;
149064
+ *doBuildNormalizeRules(builder, formSchemaRng) {
149065
+ var _ref2;
148981
149066
 
148982
149067
  const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
148983
- yield* builder.childrenInitializer(node, (_node$optional2 = node.optional) !== null && _node$optional2 !== void 0 ? _node$optional2 : false);
149068
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
149069
+ const isOptional = (_ref2 = node.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.optional) !== null && _ref2 !== void 0 ? _ref2 : false;
149070
+ yield* builder.childrenInitializer(node, isOptional);
148984
149071
  yield* builder.specialFieldsInitializer(node, {
148985
- optional: node.optional,
148986
149072
  disabled: undefined
148987
149073
  });
148988
149074
  }
@@ -150311,7 +150397,6 @@ class CheckboxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
150311
150397
  doBuildNormalizeRules(builder) {
150312
150398
  const node = this.getCurrentNodeAs(_CheckboxNode__WEBPACK_IMPORTED_MODULE_5__.CheckboxNode);
150313
150399
  return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {
150314
- optional: node.dataBinding.optional,
150315
150400
  disabled: false
150316
150401
  })];
150317
150402
  }
@@ -150543,13 +150628,13 @@ class ComboBoxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__
150543
150628
  doBuildNormalizeRules(builder) {
150544
150629
  const node = this.getCurrentNodeAs(_ComboBoxNode__WEBPACK_IMPORTED_MODULE_7__.ComboBoxNode);
150545
150630
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
150546
- optional: node.dataBinding.optional,
150547
150631
  disabled: node.disabled
150548
150632
  })];
150549
150633
  }
150550
150634
 
150551
- doBuildFLangValidations(buildContext) {
150635
+ doBuildFLangValidations(buildContext, formSchemaRng) {
150552
150636
  const node = this.getCurrentNodeAs(_ComboBoxNode__WEBPACK_IMPORTED_MODULE_7__.ComboBoxNode);
150637
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
150553
150638
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_6__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_6__.PathTokens.each);
150554
150639
  const typeNode = buildContext.getTypeNode(node.validationInfo);
150555
150640
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -150558,7 +150643,7 @@ class ComboBoxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__
150558
150643
  return [];
150559
150644
  }
150560
150645
 
150561
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
150646
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
150562
150647
  }
150563
150648
 
150564
150649
  buildChildrenDataDeclaration(context) {
@@ -151029,8 +151114,9 @@ class DateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__.Sug
151029
151114
  return _DateNode__WEBPACK_IMPORTED_MODULE_6__.DateNode;
151030
151115
  }
151031
151116
 
151032
- doBuildFLangValidations(buildContext) {
151117
+ doBuildFLangValidations(buildContext, formSchemaRng) {
151033
151118
  const node = this.getCurrentNodeAs(_DateNode__WEBPACK_IMPORTED_MODULE_6__.DateNode);
151119
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
151034
151120
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.each);
151035
151121
  const typeNode = buildContext.getTypeNode(node.validationInfo);
151036
151122
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -151039,7 +151125,7 @@ class DateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__.Sug
151039
151125
  return [];
151040
151126
  }
151041
151127
 
151042
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
151128
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
151043
151129
  }
151044
151130
 
151045
151131
  doBuildNodeValidations(validationGenerator) {
@@ -151055,7 +151141,6 @@ class DateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__.Sug
151055
151141
  doBuildNormalizeRules(builder) {
151056
151142
  const node = this.getCurrentNodeAs(_DateNode__WEBPACK_IMPORTED_MODULE_6__.DateNode);
151057
151143
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
151058
- optional: node.dataBinding.optional,
151059
151144
  disabled: node.disabled
151060
151145
  })];
151061
151146
  }
@@ -152910,8 +152995,9 @@ class InputConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Su
152910
152995
  return [(0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getNewBindingPathExpression)(node)];
152911
152996
  }
152912
152997
 
152913
- doBuildFLangValidations(buildContext) {
152998
+ doBuildFLangValidations(buildContext, formSchemaRng) {
152914
152999
  const node = this.getCurrentNodeAs(_InputNode__WEBPACK_IMPORTED_MODULE_7__.InputNode);
153000
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
152915
153001
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each);
152916
153002
  const typeNode = buildContext.getTypeNode(node.validationInfo);
152917
153003
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -152920,7 +153006,7 @@ class InputConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Su
152920
153006
  return [];
152921
153007
  }
152922
153008
 
152923
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
153009
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
152924
153010
  }
152925
153011
 
152926
153012
  doBuildNodeValidations(validationGenerator) {
@@ -152939,7 +153025,6 @@ class InputConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Su
152939
153025
  doBuildNormalizeRules(builder) {
152940
153026
  const node = this.getCurrentNodeAs(_InputNode__WEBPACK_IMPORTED_MODULE_7__.InputNode);
152941
153027
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
152942
- optional: node.dataBinding.optional,
152943
153028
  disabled: node.disabled
152944
153029
  })];
152945
153030
  }
@@ -154000,8 +154085,9 @@ class PicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__
154000
154085
  return _PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode;
154001
154086
  }
154002
154087
 
154003
- doBuildFLangValidations(buildContext) {
154088
+ doBuildFLangValidations(buildContext, formSchemaRng) {
154004
154089
  const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
154090
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
154005
154091
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.each);
154006
154092
  const typeNode = buildContext.getTypeNode(node.validationInfo);
154007
154093
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -154010,7 +154096,7 @@ class PicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__
154010
154096
  return [];
154011
154097
  }
154012
154098
 
154013
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
154099
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
154014
154100
  }
154015
154101
 
154016
154102
  doBuildNodeValidations(validationGenerator) {
@@ -154018,27 +154104,27 @@ class PicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__
154018
154104
  validationGenerator.processValidations(this.getResolvedBindingPath(node), node.validationInfo.optional, validationGenerator.getTypeNode(node.validationInfo), node.gId, node.validationInfo.emptydescription, undefined);
154019
154105
  }
154020
154106
 
154021
- *doBuildNormalizeRules(builder) {
154107
+ *doBuildNormalizeRules(builder, formSchemaRng) {
154108
+ var _ref;
154109
+
154022
154110
  const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
154111
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
154023
154112
  yield builder.valueInitializer(node, node.dataBinding, false);
154024
- yield* builder.specialFieldsInitializer(node, {
154025
- optional: node.dataBinding.optional
154026
- });
154113
+ const isOptional = (_ref = node.dataBinding.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.dataBinding.optional) !== null && _ref !== void 0 ? _ref : false;
154114
+ yield* builder.specialFieldsInitializer(node, {});
154027
154115
 
154028
154116
  if (node.multiple) {
154029
- var _node$dataBinding$opt;
154030
-
154031
- yield* builder.childrenInitializerForPicklist(node, (_node$dataBinding$opt = node.dataBinding.optional) !== null && _node$dataBinding$opt !== void 0 ? _node$dataBinding$opt : false);
154117
+ yield* builder.childrenInitializerForPicklist(node, isOptional);
154032
154118
  }
154033
154119
  }
154034
154120
 
154035
154121
  doBuildDataDeclaration(context) {
154036
- var _node$dataBinding$opt2;
154122
+ var _node$dataBinding$opt;
154037
154123
 
154038
154124
  const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
154039
154125
  return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["value", context.initSequenceFactory.dataValue(node.dataBinding, false)]]), context.addSpecialFieldsEntry(node, {
154040
154126
  optional: node.dataBinding.optional
154041
- }), context.addPathSectionDeclarationEntry(node, node.dataBinding.requisite), context.addVisibilityPathDeclEntryNew(node, node.dataBinding.requisite), context.addChildrenPathDeclEntry(node, node.dataBinding.path, (_node$dataBinding$opt2 = node.dataBinding.optional) !== null && _node$dataBinding$opt2 !== void 0 ? _node$dataBinding$opt2 : false, node.dataBinding.requisite));
154127
+ }), context.addPathSectionDeclarationEntry(node, node.dataBinding.requisite), context.addVisibilityPathDeclEntryNew(node, node.dataBinding.requisite), context.addChildrenPathDeclEntry(node, node.dataBinding.path, (_node$dataBinding$opt = node.dataBinding.optional) !== null && _node$dataBinding$opt !== void 0 ? _node$dataBinding$opt : false, node.dataBinding.requisite));
154042
154128
  }
154043
154129
 
154044
154130
  get nodePaths() {
@@ -154478,9 +154564,7 @@ class RadioGroupConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1
154478
154564
 
154479
154565
  doBuildNormalizeRules(builder) {
154480
154566
  const node = this.getCurrentNodeAs(_RadioGroupNode__WEBPACK_IMPORTED_MODULE_5__.RadioGroupNode);
154481
- return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {
154482
- optional: node.dataBinding.optional
154483
- })];
154567
+ return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {})];
154484
154568
  }
154485
154569
 
154486
154570
  doBuildDataDeclaration(context) {
@@ -155239,8 +155323,9 @@ class TaxRebateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3_
155239
155323
  return [(0,_getBindingPath__WEBPACK_IMPORTED_MODULE_5__.getNewBindingPathExpression)(node)];
155240
155324
  }
155241
155325
 
155242
- doBuildFLangValidations(buildContext) {
155326
+ doBuildFLangValidations(buildContext, formSchemaRng) {
155243
155327
  const node = this.getCurrentNodeAs(_TaxRebateNode__WEBPACK_IMPORTED_MODULE_7__.TaxRebateNode);
155328
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
155244
155329
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each);
155245
155330
  const typeNode = buildContext.getTypeNode(node.validationInfo);
155246
155331
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -155249,7 +155334,7 @@ class TaxRebateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3_
155249
155334
  return [];
155250
155335
  }
155251
155336
 
155252
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
155337
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
155253
155338
  }
155254
155339
 
155255
155340
  doBuildNodeValidations(validationGenerator) {
@@ -155266,9 +155351,7 @@ class TaxRebateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3_
155266
155351
 
155267
155352
  doBuildNormalizeRules(builder) {
155268
155353
  const node = this.getCurrentNodeAs(_TaxRebateNode__WEBPACK_IMPORTED_MODULE_7__.TaxRebateNode);
155269
- return [builder.valueInitializer(node, node.dataBinding, undefined), ...builder.specialFieldsInitializer(node, {
155270
- optional: node.dataBinding.optional
155271
- })];
155354
+ return [builder.valueInitializer(node, node.dataBinding, undefined), ...builder.specialFieldsInitializer(node, {})];
155272
155355
  }
155273
155356
 
155274
155357
  buildChildrenDataDeclaration(context) {
@@ -155461,8 +155544,9 @@ class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
155461
155544
  validationGenerator.processValidations(this.getResolvedBindingPath(node), node.validationInfo.optional, validationGenerator.getTypeNode(node.validationInfo), undefined, node.validationInfo.emptydescription, undefined);
155462
155545
  }
155463
155546
 
155464
- doBuildFLangValidations(buildContext) {
155547
+ doBuildFLangValidations(buildContext, formSchemaRng) {
155465
155548
  const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_8__.TextAreaNode);
155549
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
155466
155550
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.each);
155467
155551
  const typeNode = buildContext.getTypeNode(node.validationInfo);
155468
155552
  const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
@@ -155471,7 +155555,7 @@ class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
155471
155555
  return [];
155472
155556
  }
155473
155557
 
155474
- return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional);
155558
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
155475
155559
  }
155476
155560
 
155477
155561
  doBuildDataDeclaration(context) {
@@ -159255,15 +159339,15 @@ class SugarNodeConverterBase {
159255
159339
  *getAttachmentPaths() {// no paths by default
159256
159340
  }
159257
159341
 
159258
- *buildFLangValidations(buildContext) {
159259
- yield* this.doBuildFLangValidations(buildContext);
159260
- yield* this.buildChildrenFLangValidations(buildContext);
159342
+ *buildFLangValidations(buildContext, formSchemaRng) {
159343
+ yield* this.doBuildFLangValidations(buildContext, formSchemaRng);
159344
+ yield* this.buildChildrenFLangValidations(buildContext, formSchemaRng);
159261
159345
  }
159262
159346
 
159263
159347
  doBuildNodeValidations(validationGenerator) {// noop
159264
159348
  }
159265
159349
 
159266
- doBuildFLangValidations(buildContext) {
159350
+ doBuildFLangValidations(buildContext, formSchemaRng) {
159267
159351
  return [];
159268
159352
  }
159269
159353
 
@@ -159314,8 +159398,8 @@ class SugarNodeConverterBase {
159314
159398
  return this.node.sourceXmlNode;
159315
159399
  }
159316
159400
 
159317
- *buildNormalizeRules(builder) {
159318
- yield* this.doBuildNormalizeRules(builder);
159401
+ *buildNormalizeRules(builder, formSchemaRng) {
159402
+ yield* this.doBuildNormalizeRules(builder, formSchemaRng);
159319
159403
 
159320
159404
  for (const child of this.traverseChildren()) {
159321
159405
  const controlConverterClass = (0,_AllConverters__WEBPACK_IMPORTED_MODULE_3__.getConverterByNodeClass)((0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.getNodeClass)(child));
@@ -159332,12 +159416,12 @@ class SugarNodeConverterBase {
159332
159416
  }
159333
159417
  } else {
159334
159418
  const converter = new controlConverterClass(child);
159335
- yield* converter.buildNormalizeRules(builder);
159419
+ yield* converter.buildNormalizeRules(builder, formSchemaRng);
159336
159420
  }
159337
159421
  }
159338
159422
  }
159339
159423
 
159340
- doBuildNormalizeRules(builder) {
159424
+ doBuildNormalizeRules(builder, formSchemaRng) {
159341
159425
  return [];
159342
159426
  }
159343
159427
 
@@ -159385,7 +159469,7 @@ class SugarNodeConverterBase {
159385
159469
  }
159386
159470
  }
159387
159471
 
159388
- *buildChildrenFLangValidations(buildContext) {
159472
+ *buildChildrenFLangValidations(buildContext, formSchemaRng) {
159389
159473
  for (const child of this.doTraverseChildren()) {
159390
159474
  const controlConverterClass = (0,_AllConverters__WEBPACK_IMPORTED_MODULE_3__.getConverterByNodeClass)((0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.getNodeClass)(child));
159391
159475
 
@@ -159394,7 +159478,7 @@ class SugarNodeConverterBase {
159394
159478
  }
159395
159479
 
159396
159480
  const converter = new controlConverterClass(child);
159397
- yield* converter.buildFLangValidations(buildContext);
159481
+ yield* converter.buildFLangValidations(buildContext, formSchemaRng);
159398
159482
  }
159399
159483
  }
159400
159484
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.272.0-pribyl-copy-application5.3",
3
+ "version": "4.272.0-server-normalization-fixes.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,