@kontur.candy/generator 4.268.0 → 4.269.0-normalization-sum-fix.1

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 +124 -69
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -121911,6 +121911,10 @@ class FormSchemaRngAttribute {
121911
121911
  return this.optional || this.nillable || false;
121912
121912
  }
121913
121913
 
121914
+ isOptional() {
121915
+ return this.optional;
121916
+ }
121917
+
121914
121918
  }
121915
121919
  const RootParent = Symbol.for("__ROOT_ELEMENT_PARENT__");
121916
121920
  class FormSchemaRngElement {
@@ -121967,6 +121971,10 @@ class FormSchemaRngElement {
121967
121971
  return this.optional || this.nillable || this.innerTextOptional || false;
121968
121972
  }
121969
121973
 
121974
+ isOptional() {
121975
+ return this.optional;
121976
+ }
121977
+
121970
121978
  getChildren() {
121971
121979
  return this.children;
121972
121980
  }
@@ -132083,7 +132091,7 @@ class NormalizationRulesGenerator {
132083
132091
  buildSugarFLangRules() {
132084
132092
  const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_2__.FormConverter(this.sugarRoot);
132085
132093
  const builder = new _markupGenerator_FLangNormalizationRulesBuilder__WEBPACK_IMPORTED_MODULE_8__.FLangNormalizationRulesBuilder(this.controlCustomizationContext);
132086
- return converter.buildNormalizeRules(builder);
132094
+ return converter.buildNormalizeRules(builder, this.formSchemaRng);
132087
132095
  }
132088
132096
 
132089
132097
  *buildFormulaFLangRules() {
@@ -132271,15 +132279,35 @@ class NormalizationRulesGenerator {
132271
132279
  }
132272
132280
 
132273
132281
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
132274
- const result = expression.arguments.reduce((acc, curr) => {
132275
- const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
132282
+ const args = this.getFlatArgumentExpressions(expression.arguments);
132283
+ const conditionExpression = args.reduce((acc, curr) => {
132284
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
132285
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.OrBinaryExpression(acc, currExpr) : currExpr;
132286
+ }, undefined);
132287
+
132288
+ if (conditionExpression == undefined) {
132289
+ const result = expression.arguments.reduce((acc, curr) => {
132290
+ const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
132291
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(acc, currExpr) : currExpr;
132292
+ }, undefined);
132293
+
132294
+ if (result == undefined) {
132295
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
132296
+ }
132297
+
132298
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132299
+ }
132300
+
132301
+ const trueResultExpression = expression.arguments.reduce((acc, curr) => {
132302
+ const currExpr = this.castOperandToDecimalIfNeed(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), 0);
132276
132303
  return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(acc, currExpr) : currExpr;
132277
132304
  }, undefined);
132278
132305
 
132279
- if (result == undefined) {
132306
+ if (trueResultExpression == undefined) {
132280
132307
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
132281
132308
  }
132282
132309
 
132310
+ const result = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(conditionExpression, trueResultExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression());
132283
132311
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132284
132312
  }
132285
132313
 
@@ -132349,12 +132377,26 @@ class NormalizationRulesGenerator {
132349
132377
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(result, "string");
132350
132378
  }
132351
132379
 
132380
+ getFlatArgumentExpressions(expressions) {
132381
+ return expressions.reduce((acc, curr) => {
132382
+ if (curr instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaArgumentExpression) {
132383
+ return acc.concat(curr);
132384
+ }
132385
+
132386
+ 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) {
132387
+ return acc.concat(this.getFlatArgumentExpressions(curr.arguments));
132388
+ }
132389
+
132390
+ return acc;
132391
+ }, []);
132392
+ }
132393
+
132352
132394
  castOperandToStringIfNeed(operandExpression) {
132353
132395
  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");
132354
132396
  }
132355
132397
 
132356
- castOperandToDecimalIfNeed(operandExpression) {
132357
- return operandExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression ? operandExpression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(operandExpression, "decimal");
132398
+ castOperandToDecimalIfNeed(operandExpression, defaultValue) {
132399
+ 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);
132358
132400
  }
132359
132401
 
132360
132402
  *buildSugarValidationRules() {
@@ -136849,6 +136891,7 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
136849
136891
  bindingPath: (0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(pageNode),
136850
136892
  optional: pageNode.optional,
136851
136893
  pageActions: pageNode.pageActions,
136894
+ hideEnableAutoValues: pageNode.hideEnableAutoValues,
136852
136895
  showOnDemand: pageNode.showOnDemand,
136853
136896
  onNavigateFromErrorLog: context.generateHelperFunctionExpressionWithoutContext(pageNode, "onNavigateFromErrorLog", pageNode.onNavigateFromErrorLog)
136854
136897
  };
@@ -136957,6 +137000,10 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
136957
137000
  markupBuilder.prop(x => x.pageActions).set(pageNode.pageActions);
136958
137001
  }
136959
137002
 
137003
+ if (pageNode.hideEnableAutoValues != undefined) {
137004
+ markupBuilder.prop(x => x.hideEnableAutoValues).set(pageNode.hideEnableAutoValues);
137005
+ }
137006
+
136960
137007
  const pageMarkupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)([], this.getPageName(pageNode));
136961
137008
  markupBuilder.appendChild(pageMarkupBuilder);
136962
137009
  markupBuilder.appendChildren(pageNode.pages.map(x => this.buildPageUnit(node, x)));
@@ -137741,19 +137788,18 @@ class PageConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4__.Sug
137741
137788
  return false;
137742
137789
  }
137743
137790
 
137744
- *doBuildNormalizeRules(builder) {
137791
+ *doBuildNormalizeRules(builder, formSchemaRng) {
137745
137792
  const node = this.getCurrentNodeAs(_PageNode__WEBPACK_IMPORTED_MODULE_14__.PageNode);
137793
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
137746
137794
 
137747
137795
  if (node.path == undefined) {
137748
137796
  return;
137749
137797
  }
137750
137798
 
137751
137799
  if (node.multiple) {
137752
- var _node$optional;
137753
-
137754
- yield* builder.childrenInitializer(node, (_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false);
137800
+ const isOptional = node.optional || (element === null || element === void 0 ? void 0 : element.isOptional());
137801
+ yield* builder.childrenInitializer(node, isOptional !== null && isOptional !== void 0 ? isOptional : false);
137755
137802
  yield* builder.specialFieldsInitializer(node, {
137756
- optional: node.optional,
137757
137803
  disabled: undefined
137758
137804
  });
137759
137805
  }
@@ -137911,7 +137957,7 @@ __webpack_require__.r(__webpack_exports__);
137911
137957
 
137912
137958
 
137913
137959
 
137914
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22;
137960
+ 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;
137915
137961
 
137916
137962
 
137917
137963
 
@@ -137919,7 +137965,7 @@ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11
137919
137965
 
137920
137966
 
137921
137967
 
137922
- 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)("multipleAppearance", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("nested", "flat"), "Представление множественных разделов: вложенное или плоское"), _dec16 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("optional", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Опциональный раздел`), _dec17 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("pageActions", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.objectLiteral(), `Атрибут для кастомизации действий с разделом`), _dec18 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("navigationLimit", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.number, `Количество экземпляров множественного раздела после которого в левом меню будет включаться компактный режим отображения разделов. По умолчанию: 15. Используется только для множественных разделов`), _dec19 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("addingHint", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.localizedString, `Подсказка на кнопке добавления раздела в боковом меню. Используется только для множественных разделов`), _dec20 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)("page"), _dec21 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec22 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("title", [_PageTitleNode__WEBPACK_IMPORTED_MODULE_8__.PageTitleNode]), _dec23 = (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 {
137968
+ 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)("multipleAppearance", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType["enum"]("nested", "flat"), "Представление множественных разделов: вложенное или плоское"), _dec16 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("optional", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Опциональный раздел`), _dec17 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("pageActions", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.objectLiteral(), `Атрибут для кастомизации действий с разделом`), _dec18 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("hideEnableAutoValues", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.boolean, `Всегда скрывать кнопку "Включить авторасчет", даже при включенной серверной нормализации`), _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 {
137923
137969
  constructor(...args) {
137924
137970
  super(...args);
137925
137971
 
@@ -137955,17 +138001,19 @@ let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5
137955
138001
 
137956
138002
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pageActions", _descriptor16, this);
137957
138003
 
137958
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "navigationLimit", _descriptor17, this);
138004
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "hideEnableAutoValues", _descriptor17, this);
138005
+
138006
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "navigationLimit", _descriptor18, this);
137959
138007
 
137960
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "addingHint", _descriptor18, this);
138008
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "addingHint", _descriptor19, this);
137961
138009
 
137962
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pages", _descriptor19, this);
138010
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "pages", _descriptor20, this);
137963
138011
 
137964
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor20, this);
138012
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "children", _descriptor21, this);
137965
138013
 
137966
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "title", _descriptor21, this);
138014
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "title", _descriptor22, this);
137967
138015
 
137968
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "visible", _descriptor22, this);
138016
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "visible", _descriptor23, this);
137969
138017
  }
137970
138018
 
137971
138019
  getOwnPath() {
@@ -138058,32 +138106,37 @@ let PageNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5
138058
138106
  enumerable: true,
138059
138107
  writable: true,
138060
138108
  initializer: null
138061
- }), _descriptor17 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "navigationLimit", [_dec18], {
138109
+ }), _descriptor17 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "hideEnableAutoValues", [_dec18], {
138062
138110
  configurable: true,
138063
138111
  enumerable: true,
138064
138112
  writable: true,
138065
138113
  initializer: null
138066
- }), _descriptor18 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "addingHint", [_dec19], {
138114
+ }), _descriptor18 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "navigationLimit", [_dec19], {
138067
138115
  configurable: true,
138068
138116
  enumerable: true,
138069
138117
  writable: true,
138070
138118
  initializer: null
138071
- }), _descriptor19 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "pages", [_dec20], {
138119
+ }), _descriptor19 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "addingHint", [_dec20], {
138072
138120
  configurable: true,
138073
138121
  enumerable: true,
138074
138122
  writable: true,
138075
138123
  initializer: null
138076
- }), _descriptor20 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec21], {
138124
+ }), _descriptor20 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "pages", [_dec21], {
138077
138125
  configurable: true,
138078
138126
  enumerable: true,
138079
138127
  writable: true,
138080
138128
  initializer: null
138081
- }), _descriptor21 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "title", [_dec22], {
138129
+ }), _descriptor21 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "children", [_dec22], {
138082
138130
  configurable: true,
138083
138131
  enumerable: true,
138084
138132
  writable: true,
138085
138133
  initializer: null
138086
- }), _descriptor22 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "visible", [_dec23], {
138134
+ }), _descriptor22 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "title", [_dec23], {
138135
+ configurable: true,
138136
+ enumerable: true,
138137
+ writable: true,
138138
+ initializer: null
138139
+ }), _descriptor23 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "visible", [_dec24], {
138087
138140
  configurable: true,
138088
138141
  enumerable: true,
138089
138142
  writable: true,
@@ -143728,7 +143781,6 @@ class CrossfitTableConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
143728
143781
 
143729
143782
  yield* builder.childrenInitializer(rowNode, (_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : false, rowNode.defaultChildren);
143730
143783
  yield* builder.specialFieldsInitializer(rowNode, {
143731
- optional: rowNode.optional,
143732
143784
  disabled: undefined
143733
143785
  });
143734
143786
  }
@@ -147045,6 +147097,20 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147045
147097
  return _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode;
147046
147098
  }
147047
147099
 
147100
+ *doBuildNormalizeRules(builder, formSchemaRng) {
147101
+ const node = this.getCurrentNodeAs(_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode);
147102
+
147103
+ for (const row of node.rows) {
147104
+ if (row instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableMultilineNode) {
147105
+ var _ref;
147106
+
147107
+ const element = formSchemaRng.getElementByPath(row.getFullPath());
147108
+ const isOptional = (_ref = row.optional || (element === null || element === void 0 ? void 0 : element.isOptional())) !== null && _ref !== void 0 ? _ref : false;
147109
+ yield* builder.childrenInitializer(row, isOptional);
147110
+ }
147111
+ }
147112
+ }
147113
+
147048
147114
  *doTraverseChildren() {
147049
147115
  const node = this.getCurrentNodeAs(_StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableNode);
147050
147116
 
@@ -147152,9 +147218,9 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147152
147218
 
147153
147219
  processMultilineNode(context, rowNode) {
147154
147220
  if (rowNode instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_17__.StickyTableMultilineNode) {
147155
- var _ref, _rowNode$optional;
147221
+ var _ref2, _rowNode$optional;
147156
147222
 
147157
- 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, {
147223
+ 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, {
147158
147224
  optional: rowNode.optional
147159
147225
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => this.processMultilineRowNode(context, rowNode2)));
147160
147226
  }
@@ -147227,11 +147293,11 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
147227
147293
  const sideSize = (_node$side2 = node.side) !== null && _node$side2 !== void 0 ? _node$side2 : 0;
147228
147294
 
147229
147295
  if (this.isSimpleForm()) {
147230
- var _ref2, _node$deprecatedDiado;
147296
+ var _ref3, _node$deprecatedDiado;
147231
147297
 
147232
147298
  mb.prop(x => x.maxWidth).set(orientation === "landscape" ? maxWidth : undefined);
147233
147299
  mb.prop(x => x.sideSize).set(this.hasActionButton(node) && sideSize !== 0 ? sideSize + 1 : sideSize);
147234
- const width = (_ref2 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref2 !== void 0 ? _ref2 : maxWidthSimpleForm;
147300
+ const width = (_ref3 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref3 !== void 0 ? _ref3 : maxWidthSimpleForm;
147235
147301
  mb.prop(x => x.width).set(width);
147236
147302
  mb.prop(x => x.footerHeight).set(160);
147237
147303
  } else {
@@ -147520,10 +147586,10 @@ BindingPath: ${errorPath}`));
147520
147586
  if (this.isSimpleForm()) {
147521
147587
  mb.prop(x => x.buttonType).set(undefined);
147522
147588
  } else {
147523
- var _multiline$rowmenu, _ref3, _tableNode$removeButt;
147589
+ var _multiline$rowmenu, _ref4, _tableNode$removeButt;
147524
147590
 
147525
147591
  const rowMenu = (_multiline$rowmenu = multiline.rowmenu) !== null && _multiline$rowmenu !== void 0 ? _multiline$rowmenu : false;
147526
- const removebutton = (_ref3 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true;
147592
+ const removebutton = (_ref4 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref4 !== void 0 ? _ref4 : true;
147527
147593
  mb.prop(x => x.buttonType).set(rowMenu ? "RowMenu" : removebutton ? "RemoveRowButton" : undefined);
147528
147594
  }
147529
147595
 
@@ -147546,7 +147612,7 @@ BindingPath: ${errorPath}`));
147546
147612
  }
147547
147613
 
147548
147614
  getMultiline(context, node, multiline, start, end = Infinity) {
147549
- var _ref4, _node$removeButton, _multiline$rowmenu2, _ref5, _node$removeButton2, _context$popPathsCont2;
147615
+ var _ref5, _node$removeButton, _multiline$rowmenu2, _ref6, _node$removeButton2, _context$popPathsCont2;
147550
147616
 
147551
147617
  const overrideInfo = multiline.override ? context.controlCustomizationContext.getControlCustomizationInfo("multiline", multiline.override) : undefined;
147552
147618
  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);
@@ -147560,7 +147626,7 @@ BindingPath: ${errorPath}`));
147560
147626
  mb.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_13__.getNewBindingPathExpression)(multiline));
147561
147627
  mb.prop(x => x.showRowBorder).set(multiline.showRowBorder);
147562
147628
  mb.prop(x => x.onRowCLick).set(context.generateHelperFunctionExpression(multiline, "onRowClick", multiline.onRowClick));
147563
- 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);
147629
+ 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);
147564
147630
  const needAddButton = multiline.addbutton !== "false";
147565
147631
 
147566
147632
  if (this.isSimpleForm()) {
@@ -147573,7 +147639,7 @@ BindingPath: ${errorPath}`));
147573
147639
  mb.prop(x => x.removeButtonPosition).set(undefined);
147574
147640
  }
147575
147641
 
147576
- 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);
147642
+ 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);
147577
147643
  context.pushPathsContext();
147578
147644
 
147579
147645
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayHasLength)(multiline.rows, 1)) {
@@ -147599,9 +147665,9 @@ BindingPath: ${errorPath}`));
147599
147665
  hasActionButton(node) {
147600
147666
  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);
147601
147667
  return multilines.some(multiline => {
147602
- var _ref6, _node$removeButton3;
147668
+ var _ref7, _node$removeButton3;
147603
147669
 
147604
- return ((_ref6 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref6 !== void 0 ? _ref6 : true) || multiline.rowmenu;
147670
+ return ((_ref7 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref7 !== void 0 ? _ref7 : true) || multiline.rowmenu;
147605
147671
  });
147606
147672
  }
147607
147673
 
@@ -147852,13 +147918,13 @@ class Table2MultirowConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
147852
147918
  return markupBuilder.buildConverterResult();
147853
147919
  }
147854
147920
 
147855
- *doBuildNormalizeRules(builder) {
147856
- var _node$optional2;
147921
+ *doBuildNormalizeRules(builder, formSchemaRng) {
147922
+ var _ref2;
147857
147923
 
147858
147924
  const node = this.getCurrentNodeAs(_Table2Node__WEBPACK_IMPORTED_MODULE_3__.Table2MultirowNode);
147859
- yield* builder.childrenInitializer(node, (_node$optional2 = node.optional) !== null && _node$optional2 !== void 0 ? _node$optional2 : false);
147925
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
147926
+ yield* builder.childrenInitializer(node, (_ref2 = node.optional || (element === null || element === void 0 ? void 0 : element.isOptional())) !== null && _ref2 !== void 0 ? _ref2 : false);
147860
147927
  yield* builder.specialFieldsInitializer(node, {
147861
- optional: node.optional,
147862
147928
  disabled: undefined
147863
147929
  });
147864
147930
  }
@@ -148673,13 +148739,12 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
148673
148739
  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));
148674
148740
  }
148675
148741
 
148676
- *doBuildNormalizeRules(builder) {
148677
- var _node$optional2;
148678
-
148742
+ *doBuildNormalizeRules(builder, formSchemaRng) {
148679
148743
  const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
148680
- yield* builder.childrenInitializer(node, (_node$optional2 = node.optional) !== null && _node$optional2 !== void 0 ? _node$optional2 : false);
148744
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
148745
+ const isOptional = node.optional || (element === null || element === void 0 ? void 0 : element.isOptional());
148746
+ yield* builder.childrenInitializer(node, isOptional !== null && isOptional !== void 0 ? isOptional : false);
148681
148747
  yield* builder.specialFieldsInitializer(node, {
148682
- optional: node.optional,
148683
148748
  disabled: undefined
148684
148749
  });
148685
148750
  }
@@ -150008,7 +150073,6 @@ class CheckboxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
150008
150073
  doBuildNormalizeRules(builder) {
150009
150074
  const node = this.getCurrentNodeAs(_CheckboxNode__WEBPACK_IMPORTED_MODULE_5__.CheckboxNode);
150010
150075
  return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {
150011
- optional: node.dataBinding.optional,
150012
150076
  disabled: false
150013
150077
  })];
150014
150078
  }
@@ -150240,7 +150304,6 @@ class ComboBoxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__
150240
150304
  doBuildNormalizeRules(builder) {
150241
150305
  const node = this.getCurrentNodeAs(_ComboBoxNode__WEBPACK_IMPORTED_MODULE_7__.ComboBoxNode);
150242
150306
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
150243
- optional: node.dataBinding.optional,
150244
150307
  disabled: node.disabled
150245
150308
  })];
150246
150309
  }
@@ -150752,7 +150815,6 @@ class DateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__.Sug
150752
150815
  doBuildNormalizeRules(builder) {
150753
150816
  const node = this.getCurrentNodeAs(_DateNode__WEBPACK_IMPORTED_MODULE_6__.DateNode);
150754
150817
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
150755
- optional: node.dataBinding.optional,
150756
150818
  disabled: node.disabled
150757
150819
  })];
150758
150820
  }
@@ -152636,7 +152698,6 @@ class InputConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Su
152636
152698
  doBuildNormalizeRules(builder) {
152637
152699
  const node = this.getCurrentNodeAs(_InputNode__WEBPACK_IMPORTED_MODULE_7__.InputNode);
152638
152700
  return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
152639
- optional: node.dataBinding.optional,
152640
152701
  disabled: node.disabled
152641
152702
  })];
152642
152703
  }
@@ -153715,27 +153776,25 @@ class PicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__
153715
153776
  validationGenerator.processValidations(this.getResolvedBindingPath(node), node.validationInfo.optional, validationGenerator.getTypeNode(node.validationInfo), node.gId, node.validationInfo.emptydescription, undefined);
153716
153777
  }
153717
153778
 
153718
- *doBuildNormalizeRules(builder) {
153779
+ *doBuildNormalizeRules(builder, formSchemaRng) {
153719
153780
  const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
153781
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
153720
153782
  yield builder.valueInitializer(node, node.dataBinding, false);
153721
- yield* builder.specialFieldsInitializer(node, {
153722
- optional: node.dataBinding.optional
153723
- });
153783
+ const isOptional = node.dataBinding.optional || (element === null || element === void 0 ? void 0 : element.isOptional());
153784
+ yield* builder.specialFieldsInitializer(node, {});
153724
153785
 
153725
153786
  if (node.multiple) {
153726
- var _node$dataBinding$opt;
153727
-
153728
- yield* builder.childrenInitializerForPicklist(node, (_node$dataBinding$opt = node.dataBinding.optional) !== null && _node$dataBinding$opt !== void 0 ? _node$dataBinding$opt : false);
153787
+ yield* builder.childrenInitializerForPicklist(node, isOptional !== null && isOptional !== void 0 ? isOptional : false);
153729
153788
  }
153730
153789
  }
153731
153790
 
153732
153791
  doBuildDataDeclaration(context) {
153733
- var _node$dataBinding$opt2;
153792
+ var _node$dataBinding$opt;
153734
153793
 
153735
153794
  const node = this.getCurrentNodeAs(_PicklistNode__WEBPACK_IMPORTED_MODULE_6__.PicklistNode);
153736
153795
  return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["value", context.initSequenceFactory.dataValue(node.dataBinding, false)]]), context.addSpecialFieldsEntry(node, {
153737
153796
  optional: node.dataBinding.optional
153738
- }), 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));
153797
+ }), 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));
153739
153798
  }
153740
153799
 
153741
153800
  get nodePaths() {
@@ -154175,9 +154234,7 @@ class RadioGroupConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1
154175
154234
 
154176
154235
  doBuildNormalizeRules(builder) {
154177
154236
  const node = this.getCurrentNodeAs(_RadioGroupNode__WEBPACK_IMPORTED_MODULE_5__.RadioGroupNode);
154178
- return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {
154179
- optional: node.dataBinding.optional
154180
- })];
154237
+ return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {})];
154181
154238
  }
154182
154239
 
154183
154240
  doBuildDataDeclaration(context) {
@@ -154963,9 +155020,7 @@ class TaxRebateConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3_
154963
155020
 
154964
155021
  doBuildNormalizeRules(builder) {
154965
155022
  const node = this.getCurrentNodeAs(_TaxRebateNode__WEBPACK_IMPORTED_MODULE_7__.TaxRebateNode);
154966
- return [builder.valueInitializer(node, node.dataBinding, undefined), ...builder.specialFieldsInitializer(node, {
154967
- optional: node.dataBinding.optional
154968
- })];
155023
+ return [builder.valueInitializer(node, node.dataBinding, undefined), ...builder.specialFieldsInitializer(node, {})];
154969
155024
  }
154970
155025
 
154971
155026
  buildChildrenDataDeclaration(context) {
@@ -159015,8 +159070,8 @@ class SugarNodeConverterBase {
159015
159070
  return this.node.sourceXmlNode;
159016
159071
  }
159017
159072
 
159018
- *buildNormalizeRules(builder) {
159019
- yield* this.doBuildNormalizeRules(builder);
159073
+ *buildNormalizeRules(builder, formSchemaRng) {
159074
+ yield* this.doBuildNormalizeRules(builder, formSchemaRng);
159020
159075
 
159021
159076
  for (const child of this.traverseChildren()) {
159022
159077
  const controlConverterClass = (0,_AllConverters__WEBPACK_IMPORTED_MODULE_3__.getConverterByNodeClass)((0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_7__.getNodeClass)(child));
@@ -159033,12 +159088,12 @@ class SugarNodeConverterBase {
159033
159088
  }
159034
159089
  } else {
159035
159090
  const converter = new controlConverterClass(child);
159036
- yield* converter.buildNormalizeRules(builder);
159091
+ yield* converter.buildNormalizeRules(builder, formSchemaRng);
159037
159092
  }
159038
159093
  }
159039
159094
  }
159040
159095
 
159041
- doBuildNormalizeRules(builder) {
159096
+ doBuildNormalizeRules(builder, formSchemaRng) {
159042
159097
  return [];
159043
159098
  }
159044
159099
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.268.0",
3
+ "version": "4.269.0-normalization-sum-fix.1",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,