@kontur.candy/generator 4.248.2 → 4.249.0-nightly.7ag0j

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 +76 -44
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -127319,6 +127319,8 @@ __webpack_require__.r(__webpack_exports__);
127319
127319
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
127320
127320
  /* harmony import */ var _markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../markupGenerator/getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
127321
127321
  /* harmony import */ var _markupGenerator_ElementProcessors_FormParts_Page_PageNode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../markupGenerator/ElementProcessors/FormParts/Page/PageNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Page/PageNode.ts");
127322
+ /* harmony import */ var _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/SchemaRng/FormSchemaRng */ "./Generator/src/common/SchemaRng/FormSchemaRng.ts");
127323
+
127322
127324
 
127323
127325
 
127324
127326
 
@@ -127338,8 +127340,10 @@ var RequisiteSectionMode;
127338
127340
 
127339
127341
  const emptyDataDeclarationCollection = {};
127340
127342
  class DataDeclarationGenerationContext {
127341
- constructor(initSequenceFactory, controlCustomizationContext, typesRegistry) {
127343
+ constructor(initSequenceFactory, controlCustomizationContext, typesRegistry, formSchemaRng, schemeValidations) {
127342
127344
  this.initSequenceFactory = void 0;
127345
+ this.formSchemaRng = void 0;
127346
+ this.schemeValidations = void 0;
127343
127347
  this.controlCustomizationContext = void 0;
127344
127348
  this.typesRegistry = void 0;
127345
127349
 
@@ -127369,11 +127373,29 @@ class DataDeclarationGenerationContext {
127369
127373
  return undefined;
127370
127374
  };
127371
127375
 
127376
+ this.formSchemaRng = formSchemaRng;
127377
+ this.schemeValidations = schemeValidations;
127372
127378
  this.initSequenceFactory = initSequenceFactory;
127373
127379
  this.controlCustomizationContext = controlCustomizationContext;
127374
127380
  this.typesRegistry = typesRegistry;
127375
127381
  }
127376
127382
 
127383
+ isMultipleNodeOptionalFromScheme(path) {
127384
+ if (!this.schemeValidations) {
127385
+ return undefined;
127386
+ }
127387
+
127388
+ const schemaNode = this.formSchemaRng.getElementByPath(path);
127389
+
127390
+ if (schemaNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__.FormSchemaRngElement) {
127391
+ var _schemaNode$optional;
127392
+
127393
+ return (_schemaNode$optional = schemaNode.optional) !== null && _schemaNode$optional !== void 0 ? _schemaNode$optional : false;
127394
+ }
127395
+
127396
+ return undefined;
127397
+ }
127398
+
127377
127399
  getTypeNode(node) {
127378
127400
  if (node.anonymousType != undefined) {
127379
127401
  return node.anonymousType;
@@ -127682,11 +127704,15 @@ __webpack_require__.r(__webpack_exports__);
127682
127704
 
127683
127705
 
127684
127706
  class DataDeclarationGenerator {
127685
- constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry) {
127707
+ constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry, formSchemaRng, schemeValidations) {
127686
127708
  this.sugarRoot = void 0;
127687
127709
  this.initSequenceFactory = void 0;
127710
+ this.formSchemaRng = void 0;
127711
+ this.schemeValidations = void 0;
127688
127712
  this.controlCustomizationContext = void 0;
127689
127713
  this.typesRegistry = void 0;
127714
+ this.formSchemaRng = formSchemaRng;
127715
+ this.schemeValidations = schemeValidations;
127690
127716
  this.sugarRoot = sugarRoot;
127691
127717
  this.initSequenceFactory = initSequenceFactory;
127692
127718
  this.controlCustomizationContext = controlCustomizationContext;
@@ -127698,7 +127724,7 @@ class DataDeclarationGenerator {
127698
127724
 
127699
127725
  const converterClass = (_getConverterByNodeCl = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_4__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.getNodeClass)(this.sugarRoot))) !== null && _getConverterByNodeCl !== void 0 ? _getConverterByNodeCl : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
127700
127726
  const converter = new converterClass(this.sugarRoot);
127701
- const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
127727
+ const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry, this.formSchemaRng, this.schemeValidations);
127702
127728
  const dataDeclaration = converter.buildDataDeclaration(context);
127703
127729
  const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
127704
127730
  const result = this.replaceHolder(`
@@ -127732,7 +127758,7 @@ class DataDeclarationGenerator {
127732
127758
 
127733
127759
  const converterClass = (_getConverterByNodeCl2 = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_4__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.getNodeClass)(this.sugarRoot))) !== null && _getConverterByNodeCl2 !== void 0 ? _getConverterByNodeCl2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
127734
127760
  const converter = new converterClass(this.sugarRoot);
127735
- const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
127761
+ const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry, this.formSchemaRng, this.schemeValidations);
127736
127762
  const dataDeclaration = converter.buildDataDeclaration(context);
127737
127763
  const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
127738
127764
  return `
@@ -128856,7 +128882,7 @@ __webpack_require__.r(__webpack_exports__);
128856
128882
 
128857
128883
  function processSugar(formSugarContent, additionalContent, generationOptions) {
128858
128884
  try {
128859
- var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _generationOptions$re, _sugarRoot$schemaVali3, _additionalContent$fo, _additionalContent$fo2;
128885
+ var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _sugarRoot$schemaVali3, _generationOptions$re, _sugarRoot$schemaVali4, _additionalContent$fo, _additionalContent$fo2;
128860
128886
 
128861
128887
  const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
128862
128888
  const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_12__.createDefaultSugarSerializer)();
@@ -128871,17 +128897,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
128871
128897
  const fetchFunctions = new _common_FetchFunctions__WEBPACK_IMPORTED_MODULE_2__.FetchFunctions(referencedFetchFunctions); // tslint:disable-next-line no-unsafe-any
128872
128898
 
128873
128899
  const additionalSettings = typeof additionalContent.additionalSettings === "string" ? JSON.parse(additionalContent.additionalSettings || "{}") : additionalContent.additionalSettings;
128874
- const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_18__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_19__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry);
128900
+ const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_18__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_19__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry, formSchemaRng, (_sugarRoot$schemaVali = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali !== void 0 ? _sugarRoot$schemaVali : false);
128875
128901
  const {
128876
128902
  dataDeclarationContent,
128877
128903
  dataDeclaration
128878
128904
  } = dataDeclarationGenerator.generate();
128879
128905
  const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_25__.DataDeclarationGenerationTimeHelper(dataDeclaration);
128880
- const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_15__.ValidationGenerator(sugarRoot, typeRegistry, controlCustomizationContext, formSchemaRng, (_sugarRoot$schemaVali = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali !== void 0 ? _sugarRoot$schemaVali : false, additionalContent.validationsContent);
128881
- const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_24__.NormalizationRulesGenerator(sugarRoot, dataDeclarationHelper, formSchemaRng, formulas, typeRegistry, (_sugarRoot$schemaVali2 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali2 !== void 0 ? _sugarRoot$schemaVali2 : false, controlCustomizationContext);
128906
+ const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_15__.ValidationGenerator(sugarRoot, typeRegistry, controlCustomizationContext, formSchemaRng, (_sugarRoot$schemaVali2 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali2 !== void 0 ? _sugarRoot$schemaVali2 : false, additionalContent.validationsContent);
128907
+ const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_24__.NormalizationRulesGenerator(sugarRoot, dataDeclarationHelper, formSchemaRng, formulas, typeRegistry, (_sugarRoot$schemaVali3 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali3 !== void 0 ? _sugarRoot$schemaVali3 : false, controlCustomizationContext);
128882
128908
  const resourcesHash = (_generationOptions$re = generationOptions === null || generationOptions === void 0 ? void 0 : generationOptions.resourcesHash) !== null && _generationOptions$re !== void 0 ? _generationOptions$re : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)("Current generator version requires resources hash");
128883
128909
  const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_20__.FormSourcesBuilder(additionalContent.formSourcesPath);
128884
- const markupGenerator = new _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_11__.MarkupGenerator(additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, (_sugarRoot$schemaVali3 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali3 !== void 0 ? _sugarRoot$schemaVali3 : false);
128910
+ const markupGenerator = new _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_11__.MarkupGenerator(additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, (_sugarRoot$schemaVali4 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali4 !== void 0 ? _sugarRoot$schemaVali4 : false);
128885
128911
  markupGenerator.generate(sugarRoot, builder);
128886
128912
  builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_8__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings));
128887
128913
  builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_23__.getRequisiteList)(sugarRoot, fetchFunctions));
@@ -134044,7 +134070,9 @@ __webpack_require__.r(__webpack_exports__);
134044
134070
  /* harmony import */ var _Content_ContentNode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Content/ContentNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Content/ContentNode.ts");
134045
134071
  /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
134046
134072
  /* harmony import */ var _UserPicklist_UserPicklistConverter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../UserPicklist/UserPicklistConverter */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/UserPicklist/UserPicklistConverter.ts");
134047
- /* harmony import */ var _FormNode__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./FormNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Form/FormNode.ts");
134073
+ /* harmony import */ var _DefaultContent_DefaultContentNode__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../DefaultContent/DefaultContentNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/DefaultContent/DefaultContentNode.ts");
134074
+ /* harmony import */ var _FormNode__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./FormNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Form/FormNode.ts");
134075
+
134048
134076
 
134049
134077
 
134050
134078
 
@@ -134065,11 +134093,11 @@ __webpack_require__.r(__webpack_exports__);
134065
134093
 
134066
134094
  class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.SugarNodeConverterBase {
134067
134095
  static getAcceptNodeClass() {
134068
- return _FormNode__WEBPACK_IMPORTED_MODULE_17__.FormNode;
134096
+ return _FormNode__WEBPACK_IMPORTED_MODULE_18__.FormNode;
134069
134097
  }
134070
134098
 
134071
134099
  doBuildDataDeclaration(context) {
134072
- const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_17__.FormNode);
134100
+ const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_18__.FormNode);
134073
134101
  const rootPath = (0,_getRootPath__WEBPACK_IMPORTED_MODULE_3__.getRootPath)(node);
134074
134102
  const entrySections = ["default"];
134075
134103
  const optionalSections = this.findOptionalSections(node);
@@ -134089,17 +134117,17 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
134089
134117
  }
134090
134118
 
134091
134119
  buildChildrenDataDeclaration(context) {
134092
- const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_17__.FormNode);
134120
+ const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_18__.FormNode);
134093
134121
  return context.processChildrenDataDeclaration(node.pages);
134094
134122
  }
134095
134123
 
134096
134124
  *doTraverseChildren() {
134097
- const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_17__.FormNode);
134125
+ const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_18__.FormNode);
134098
134126
  yield* node.pages;
134099
134127
  }
134100
134128
 
134101
134129
  doConvert(context) {
134102
- const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_17__.FormNode);
134130
+ const node = this.getCurrentNodeAs(_FormNode__WEBPACK_IMPORTED_MODULE_18__.FormNode);
134103
134131
 
134104
134132
  if (node.simple) {
134105
134133
  return this.buildSimpleForm(context, node);
@@ -134272,6 +134300,7 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
134272
134300
  }
134273
134301
 
134274
134302
  const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("Unit");
134303
+ markupBuilder.prop(x => x.hasDefaultContent).set(pageNode.children.some(x => x instanceof _DefaultContent_DefaultContentNode__WEBPACK_IMPORTED_MODULE_17__.DefaultContentNode));
134275
134304
  markupBuilder.prop(x => x.height).set(pageNode.height);
134276
134305
  markupBuilder.prop(x => x.minHeight).set(pageNode.minHeight);
134277
134306
  markupBuilder.prop("data-tid").set(pageNode.id);
@@ -136005,7 +136034,7 @@ class UserPicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
136005
136034
  type: "Expression",
136006
136035
  expression: validationGenerator.generateValidationsFactory()
136007
136036
  });
136008
- const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationGenerator((_findSugarNodeBases$2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.findSugarNodeBases)(node.editor)[0]) !== null && _findSugarNodeBases$2 !== void 0 ? _findSugarNodeBases$2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_8__.reject)(), new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory(_common_FetchFunctions__WEBPACK_IMPORTED_MODULE_12__.FetchFunctions.empty()), context.controlCustomizationContext, context.typesRegistry);
136037
+ const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationGenerator((_findSugarNodeBases$2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.findSugarNodeBases)(node.editor)[0]) !== null && _findSugarNodeBases$2 !== void 0 ? _findSugarNodeBases$2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_8__.reject)(), new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory(_common_FetchFunctions__WEBPACK_IMPORTED_MODULE_12__.FetchFunctions.empty()), context.controlCustomizationContext, context.typesRegistry, _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_7__.FormSchemaRng.createEmpty(), false);
136009
136038
  userPicklistDeclarationBuilder.prop(x => x.editorDataDeclaration).set({
136010
136039
  type: "Expression",
136011
136040
  expression: dataDeclarationGenerator.generateDataDeclarationFactory()
@@ -140833,10 +140862,10 @@ class CrossfitTableConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
140833
140862
  }
140834
140863
 
140835
140864
  if (rowNode instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.MultilineNode) {
140836
- var _rowNode$optional2;
140865
+ var _ref, _rowNode$optional2;
140837
140866
 
140838
140867
  this.ensurePathExists(rowNode, rowNode.dataScope.path);
140839
- return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_rowNode$optional2 = rowNode.optional) !== null && _rowNode$optional2 !== void 0 ? _rowNode$optional2 : false, rowNode.defaultChildren)]]), context.addSpecialFieldsEntry(rowNode, {
140868
+ return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_ref = (_rowNode$optional2 = rowNode.optional) !== null && _rowNode$optional2 !== void 0 ? _rowNode$optional2 : context.isMultipleNodeOptionalFromScheme(rowNode.getFullPath())) !== null && _ref !== void 0 ? _ref : false, rowNode.defaultChildren)]]), context.addSpecialFieldsEntry(rowNode, {
140840
140869
  optional: rowNode.optional
140841
140870
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => {
140842
140871
  if (rowNode2 instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.CrossfitTableRowNode) {
@@ -142758,10 +142787,10 @@ class MultilineFieldConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
142758
142787
  }
142759
142788
 
142760
142789
  doBuildDataDeclaration(context) {
142761
- var _node$optional;
142790
+ var _ref, _node$optional;
142762
142791
 
142763
142792
  const node = this.getCurrentNodeAs(_MultilineFieldNode__WEBPACK_IMPORTED_MODULE_3__.MultilineFieldNode);
142764
- return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addSpecialFieldsEntry(node, {
142793
+ 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.addSpecialFieldsEntry(node, {
142765
142794
  optional: node.optional
142766
142795
  }), context.addPathSectionDeclarationEntry(node), context.addVisibilityPathDeclEntryNew(node));
142767
142796
  }
@@ -142927,10 +142956,10 @@ class MultipleConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_0__
142927
142956
  }
142928
142957
 
142929
142958
  doBuildDataDeclaration(context) {
142930
- var _node$optional;
142959
+ var _ref, _node$optional;
142931
142960
 
142932
142961
  const node = this.getCurrentNodeAs(_MultipleNode__WEBPACK_IMPORTED_MODULE_3__.MultipleNode);
142933
- return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addSpecialFieldsEntry(node, {
142962
+ 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.addSpecialFieldsEntry(node, {
142934
142963
  optional: node.optional
142935
142964
  }), context.addPathSectionDeclarationEntry(node));
142936
142965
  }
@@ -144110,9 +144139,9 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
144110
144139
 
144111
144140
  processMultilineNode(context, rowNode) {
144112
144141
  if (rowNode instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.StickyTableMultilineNode) {
144113
- var _rowNode$optional;
144142
+ var _ref, _rowNode$optional;
144114
144143
 
144115
- return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : false, rowNode.defaultChildren)]]), context.addSpecialFieldsEntry(rowNode, {
144144
+ 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)]]), context.addSpecialFieldsEntry(rowNode, {
144116
144145
  optional: rowNode.optional
144117
144146
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => this.processMultilineRowNode(context, rowNode2)));
144118
144147
  }
@@ -144185,11 +144214,11 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
144185
144214
  const sideSize = (_node$side2 = node.side) !== null && _node$side2 !== void 0 ? _node$side2 : 0;
144186
144215
 
144187
144216
  if (this.isSimpleForm()) {
144188
- var _ref, _node$deprecatedDiado;
144217
+ var _ref2, _node$deprecatedDiado;
144189
144218
 
144190
144219
  mb.prop(x => x.maxWidth).set(orientation === "landscape" ? maxWidth : undefined);
144191
144220
  mb.prop(x => x.sideSize).set(this.hasActionButton(node) && sideSize !== 0 ? sideSize + 1 : sideSize);
144192
- const width = (_ref = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref !== void 0 ? _ref : maxWidthSimpleForm;
144221
+ const width = (_ref2 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref2 !== void 0 ? _ref2 : maxWidthSimpleForm;
144193
144222
  mb.prop(x => x.width).set(width);
144194
144223
  mb.prop(x => x.footerHeight).set(160);
144195
144224
  } else {
@@ -144472,10 +144501,10 @@ BindingPath: ${errorPath}`));
144472
144501
  if (this.isSimpleForm()) {
144473
144502
  mb.prop(x => x.buttonType).set(undefined);
144474
144503
  } else {
144475
- var _multiline$rowmenu, _ref2, _tableNode$removeButt;
144504
+ var _multiline$rowmenu, _ref3, _tableNode$removeButt;
144476
144505
 
144477
144506
  const rowMenu = (_multiline$rowmenu = multiline.rowmenu) !== null && _multiline$rowmenu !== void 0 ? _multiline$rowmenu : false;
144478
- const removebutton = (_ref2 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref2 !== void 0 ? _ref2 : true;
144507
+ const removebutton = (_ref3 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true;
144479
144508
  mb.prop(x => x.buttonType).set(rowMenu ? "RowMenu" : removebutton ? "RemoveRowButton" : undefined);
144480
144509
  }
144481
144510
 
@@ -144488,7 +144517,7 @@ BindingPath: ${errorPath}`));
144488
144517
  }
144489
144518
 
144490
144519
  getMultiline(context, node, multiline, start, end = Infinity) {
144491
- var _ref3, _node$removeButton, _multiline$rowmenu2, _ref4, _node$removeButton2, _context$popPathsCont2;
144520
+ var _ref4, _node$removeButton, _multiline$rowmenu2, _ref5, _node$removeButton2, _context$popPathsCont2;
144492
144521
 
144493
144522
  const overrideInfo = multiline.override ? context.controlCustomizationContext.getControlCustomizationInfo("multiline", multiline.override) : undefined;
144494
144523
  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);
@@ -144501,7 +144530,7 @@ BindingPath: ${errorPath}`));
144501
144530
  mb.prop(x => x.isList).set(multiline.usepager === false ? true : undefined);
144502
144531
  mb.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_13__.getNewBindingPathExpression)(multiline));
144503
144532
  mb.prop(x => x.showRowBorder).set(multiline.showRowBorder);
144504
- const hasRemoveButton = ((_ref3 = (_node$removeButton = node.removeButton) !== null && _node$removeButton !== void 0 ? _node$removeButton : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true) || ((_multiline$rowmenu2 = multiline.rowmenu) !== null && _multiline$rowmenu2 !== void 0 ? _multiline$rowmenu2 : false);
144533
+ 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);
144505
144534
  const needAddButton = multiline.addbutton !== "false";
144506
144535
 
144507
144536
  if (this.isSimpleForm()) {
@@ -144514,7 +144543,7 @@ BindingPath: ${errorPath}`));
144514
144543
  mb.prop(x => x.removeButtonPosition).set(undefined);
144515
144544
  }
144516
144545
 
144517
- mb.prop(x => x.disableScroll).set(needAddButton || ((_ref4 = (_node$removeButton2 = node.removeButton) !== null && _node$removeButton2 !== void 0 ? _node$removeButton2 : multiline.removebutton) !== null && _ref4 !== void 0 ? _ref4 : true) ? undefined : true);
144546
+ 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);
144518
144547
  context.pushPathsContext();
144519
144548
 
144520
144549
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayHasLength)(multiline.rows, 1)) {
@@ -144540,9 +144569,9 @@ BindingPath: ${errorPath}`));
144540
144569
  hasActionButton(node) {
144541
144570
  const multilines = node.rows.map(child => (0,_StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.isMultilineNode)(child) ? child : child.columns.find(_StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.isMultilineNode)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined);
144542
144571
  return multilines.some(multiline => {
144543
- var _ref5, _node$removeButton3;
144572
+ var _ref6, _node$removeButton3;
144544
144573
 
144545
- return ((_ref5 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref5 !== void 0 ? _ref5 : true) || multiline.rowmenu;
144574
+ return ((_ref6 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref6 !== void 0 ? _ref6 : true) || multiline.rowmenu;
144546
144575
  });
144547
144576
  }
144548
144577
 
@@ -144768,10 +144797,10 @@ class Table2MultirowConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
144768
144797
  }
144769
144798
 
144770
144799
  doBuildDataDeclaration(context) {
144771
- var _node$optional;
144800
+ var _ref, _node$optional;
144772
144801
 
144773
144802
  const node = this.getCurrentNodeAs(_Table2Node__WEBPACK_IMPORTED_MODULE_3__.Table2MultirowNode);
144774
- return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addPathSectionDeclarationEntry(node));
144803
+ 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.addPathSectionDeclarationEntry(node));
144775
144804
  }
144776
144805
 
144777
144806
  buildChildrenDataDeclaration(context) {
@@ -145590,10 +145619,10 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
145590
145619
  }
145591
145620
 
145592
145621
  doBuildDataDeclaration(context) {
145593
- var _node$optional;
145622
+ var _ref, _node$optional;
145594
145623
 
145595
145624
  const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
145596
- return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addPathSectionDeclarationEntry(node));
145625
+ 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.addPathSectionDeclarationEntry(node));
145597
145626
  }
145598
145627
 
145599
145628
  buildChildrenDataDeclaration(context) {
@@ -150028,15 +150057,15 @@ __webpack_require__.r(__webpack_exports__);
150028
150057
 
150029
150058
 
150030
150059
  function setCurrencyProps(markupBuilder, context, node) {
150060
+ var _typeNode$base, _node$currency;
150061
+
150031
150062
  const typeNode = context.getTypeNode(node.validationInfo);
150032
150063
  const schemaTypeInfo = context.getSchemaTypeInfo(node.getFullPath());
150033
- markupBuilder.prop(x => x.currency).set(node.currency);
150034
-
150035
- if (node.currency) {
150036
- var _typeNode$base;
150037
-
150038
- const baseTypeName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeInfo === null || schemaTypeInfo === void 0 ? void 0 : schemaTypeInfo.baseType;
150064
+ const baseTypeName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeInfo === null || schemaTypeInfo === void 0 ? void 0 : schemaTypeInfo.baseType;
150065
+ const currency = (_node$currency = node.currency) !== null && _node$currency !== void 0 ? _node$currency : baseTypeName === "integer" || baseTypeName === "decimal";
150066
+ markupBuilder.prop(x => x.currency).set(currency);
150039
150067
 
150068
+ if (currency) {
150040
150069
  if (baseTypeName === "decimal") {
150041
150070
  var _typeNode$flattenType, _typeNode$flattenType2, _ref, _ref2, _ref3, _ref4, _typeNode$flattenType3, _typeNode$flattenType4, _typeNode$flattenType5, _typeNode$flattenType6, _typeNode$flattenType7, _typeNode$flattenType8, _typeNode$flattenType9, _typeNode$flattenType10;
150042
150071
 
@@ -150062,11 +150091,14 @@ function setCurrencyProps(markupBuilder, context, node) {
150062
150091
  } else if (maxLength == undefined && fractionDigits == undefined && integerDigits == undefined) {
150063
150092
  markupBuilder.prop(x => x.currencyIntegerDigits).set(undefined);
150064
150093
  markupBuilder.prop(x => x.currencyFractionDigits).set(2);
150094
+ } else if (maxLength != undefined && fractionDigits != undefined && integerDigits != undefined) {
150095
+ markupBuilder.prop(x => x.currencyIntegerDigits).set(integerDigits);
150096
+ markupBuilder.prop(x => x.currencyFractionDigits).set(fractionDigits);
150065
150097
  } else if (totalDigits != undefined && fractionDigits == undefined && integerDigits == undefined) {
150066
150098
  markupBuilder.prop(x => x.currencyIntegerDigits).set(totalDigits);
150067
150099
  markupBuilder.prop(x => x.currencyFractionDigits).set(0);
150068
150100
  } else {
150069
- throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError("Unable to use currency editor with decimal type with length, maxLength or totaldigits constraints", node, "currency");
150101
+ throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError(`Unable to use currency editor with decimal type with length, maxLength or totaldigits constraints (path: ${node.getFullPath().toString()})`, node, "currency");
150070
150102
  }
150071
150103
  } else if (baseTypeName === "integer") {
150072
150104
  var _ref5, _typeNode$flattenType11, _typeNode$flattenType12, _ref6, _typeNode$flattenType13, _typeNode$flattenType14, _ref7, _typeNode$flattenType15, _typeNode$flattenType16;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.248.2",
3
+ "version": "4.249.0-nightly.7ag0j",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,