@kontur.candy/generator 4.246.0 → 4.247.0-nightly.73h41

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 +83 -39
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -124327,6 +124327,7 @@ function normalizeToArray(value) {
124327
124327
  "use strict";
124328
124328
  __webpack_require__.r(__webpack_exports__);
124329
124329
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
124330
+ /* harmony export */ "getNodeSource": () => (/* binding */ getNodeSource),
124330
124331
  /* harmony export */ "XmlNode": () => (/* binding */ XmlNode),
124331
124332
  /* harmony export */ "ASTNode": () => (/* binding */ ASTNode),
124332
124333
  /* harmony export */ "SugarReadingError": () => (/* binding */ SugarReadingError),
@@ -124339,6 +124340,18 @@ __webpack_require__.r(__webpack_exports__);
124339
124340
 
124340
124341
 
124341
124342
 
124343
+ function getNodeSource(node) {
124344
+ if (node.source == undefined) {
124345
+ return "N/A";
124346
+ }
124347
+
124348
+ try {
124349
+ const sourceLines = node.source.sourceText.split("\n");
124350
+ return sourceLines.slice(node.source.location.start.line - 1, node.source.location.end.line).join("\n");
124351
+ } catch {
124352
+ return "N/A";
124353
+ }
124354
+ }
124342
124355
  class XmlNode {
124343
124356
  constructor(createParams) {
124344
124357
  var _createParams$parent, _createParams$attribu, _createParams$childre;
@@ -127243,6 +127256,8 @@ __webpack_require__.r(__webpack_exports__);
127243
127256
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
127244
127257
  /* harmony import */ var _markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../markupGenerator/getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
127245
127258
  /* 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");
127259
+ /* harmony import */ var _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/SchemaRng/FormSchemaRng */ "./Generator/src/common/SchemaRng/FormSchemaRng.ts");
127260
+
127246
127261
 
127247
127262
 
127248
127263
 
@@ -127262,8 +127277,10 @@ var RequisiteSectionMode;
127262
127277
 
127263
127278
  const emptyDataDeclarationCollection = {};
127264
127279
  class DataDeclarationGenerationContext {
127265
- constructor(initSequenceFactory, controlCustomizationContext, typesRegistry) {
127280
+ constructor(initSequenceFactory, controlCustomizationContext, typesRegistry, formSchemaRng, schemeValidations) {
127266
127281
  this.initSequenceFactory = void 0;
127282
+ this.formSchemaRng = void 0;
127283
+ this.schemeValidations = void 0;
127267
127284
  this.controlCustomizationContext = void 0;
127268
127285
  this.typesRegistry = void 0;
127269
127286
 
@@ -127293,11 +127310,29 @@ class DataDeclarationGenerationContext {
127293
127310
  return undefined;
127294
127311
  };
127295
127312
 
127313
+ this.formSchemaRng = formSchemaRng;
127314
+ this.schemeValidations = schemeValidations;
127296
127315
  this.initSequenceFactory = initSequenceFactory;
127297
127316
  this.controlCustomizationContext = controlCustomizationContext;
127298
127317
  this.typesRegistry = typesRegistry;
127299
127318
  }
127300
127319
 
127320
+ isMultipleNodeOptionalFromScheme(path) {
127321
+ if (!this.schemeValidations) {
127322
+ return undefined;
127323
+ }
127324
+
127325
+ const schemaNode = this.formSchemaRng.getElementByPath(path);
127326
+
127327
+ if (schemaNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__.FormSchemaRngElement) {
127328
+ var _schemaNode$optional;
127329
+
127330
+ return (_schemaNode$optional = schemaNode.optional) !== null && _schemaNode$optional !== void 0 ? _schemaNode$optional : false;
127331
+ }
127332
+
127333
+ return undefined;
127334
+ }
127335
+
127301
127336
  getTypeNode(node) {
127302
127337
  if (node.anonymousType != undefined) {
127303
127338
  return node.anonymousType;
@@ -127606,11 +127641,15 @@ __webpack_require__.r(__webpack_exports__);
127606
127641
 
127607
127642
 
127608
127643
  class DataDeclarationGenerator {
127609
- constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry) {
127644
+ constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry, formSchemaRng, schemeValidations) {
127610
127645
  this.sugarRoot = void 0;
127611
127646
  this.initSequenceFactory = void 0;
127647
+ this.formSchemaRng = void 0;
127648
+ this.schemeValidations = void 0;
127612
127649
  this.controlCustomizationContext = void 0;
127613
127650
  this.typesRegistry = void 0;
127651
+ this.formSchemaRng = formSchemaRng;
127652
+ this.schemeValidations = schemeValidations;
127614
127653
  this.sugarRoot = sugarRoot;
127615
127654
  this.initSequenceFactory = initSequenceFactory;
127616
127655
  this.controlCustomizationContext = controlCustomizationContext;
@@ -127622,7 +127661,7 @@ class DataDeclarationGenerator {
127622
127661
 
127623
127662
  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)();
127624
127663
  const converter = new converterClass(this.sugarRoot);
127625
- const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
127664
+ const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry, this.formSchemaRng, this.schemeValidations);
127626
127665
  const dataDeclaration = converter.buildDataDeclaration(context);
127627
127666
  const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
127628
127667
  const result = this.replaceHolder(`
@@ -127656,7 +127695,7 @@ class DataDeclarationGenerator {
127656
127695
 
127657
127696
  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)();
127658
127697
  const converter = new converterClass(this.sugarRoot);
127659
- const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
127698
+ const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry, this.formSchemaRng, this.schemeValidations);
127660
127699
  const dataDeclaration = converter.buildDataDeclaration(context);
127661
127700
  const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
127662
127701
  return `
@@ -128574,6 +128613,8 @@ __webpack_require__.r(__webpack_exports__);
128574
128613
  /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
128575
128614
  /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
128576
128615
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
128616
+ /* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
128617
+
128577
128618
 
128578
128619
 
128579
128620
 
@@ -128620,7 +128661,7 @@ class KCXmlValidationGenerator {
128620
128661
  const target = prefix.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(condition.target, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each));
128621
128662
  const deps = [];
128622
128663
  const compiledExpression = this.compileExpression(prefix, condition.expression, deps);
128623
- return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `)`;
128664
+ return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `, ` + JSON.stringify((0,_common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__.getNodeSource)(condition.sourceXmlNode)) + `)`;
128624
128665
  }
128625
128666
 
128626
128667
  compileExpression(prefix, expression, deps) {
@@ -128776,7 +128817,7 @@ __webpack_require__.r(__webpack_exports__);
128776
128817
 
128777
128818
  function processSugar(formSugarContent, additionalContent, generationOptions) {
128778
128819
  try {
128779
- var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _generationOptions$re, _sugarRoot$schemaVali3, _additionalContent$fo, _additionalContent$fo2;
128820
+ var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _sugarRoot$schemaVali3, _generationOptions$re, _sugarRoot$schemaVali4, _additionalContent$fo, _additionalContent$fo2;
128780
128821
 
128781
128822
  const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
128782
128823
  const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_12__.createDefaultSugarSerializer)();
@@ -128791,17 +128832,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
128791
128832
  const fetchFunctions = new _common_FetchFunctions__WEBPACK_IMPORTED_MODULE_2__.FetchFunctions(referencedFetchFunctions); // tslint:disable-next-line no-unsafe-any
128792
128833
 
128793
128834
  const additionalSettings = JSON.parse(additionalContent.additionalSettings || "{}");
128794
- const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_18__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_19__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry);
128835
+ 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);
128795
128836
  const {
128796
128837
  dataDeclarationContent,
128797
128838
  dataDeclaration
128798
128839
  } = dataDeclarationGenerator.generate();
128799
128840
  const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_25__.DataDeclarationGenerationTimeHelper(dataDeclaration);
128800
- 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);
128801
- 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);
128841
+ 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);
128842
+ 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);
128802
128843
  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");
128803
128844
  const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_20__.FormSourcesBuilder(additionalContent.formSourcesPath);
128804
- 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);
128845
+ 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);
128805
128846
  markupGenerator.generate(sugarRoot, builder);
128806
128847
  builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_8__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings));
128807
128848
  builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_23__.getRequisiteList)(sugarRoot, fetchFunctions));
@@ -135880,7 +135921,7 @@ class UserPicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
135880
135921
  type: "Expression",
135881
135922
  expression: validationGenerator.generateValidationsFactory()
135882
135923
  });
135883
- 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);
135924
+ 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);
135884
135925
  userPicklistDeclarationBuilder.prop(x => x.editorDataDeclaration).set({
135885
135926
  type: "Expression",
135886
135927
  expression: dataDeclarationGenerator.generateDataDeclarationFactory()
@@ -140708,10 +140749,10 @@ class CrossfitTableConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
140708
140749
  }
140709
140750
 
140710
140751
  if (rowNode instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.MultilineNode) {
140711
- var _rowNode$optional2;
140752
+ var _ref, _rowNode$optional2;
140712
140753
 
140713
140754
  this.ensurePathExists(rowNode, rowNode.dataScope.path);
140714
- 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, {
140755
+ 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, {
140715
140756
  optional: rowNode.optional
140716
140757
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => {
140717
140758
  if (rowNode2 instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.CrossfitTableRowNode) {
@@ -142633,10 +142674,10 @@ class MultilineFieldConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
142633
142674
  }
142634
142675
 
142635
142676
  doBuildDataDeclaration(context) {
142636
- var _node$optional;
142677
+ var _ref, _node$optional;
142637
142678
 
142638
142679
  const node = this.getCurrentNodeAs(_MultilineFieldNode__WEBPACK_IMPORTED_MODULE_3__.MultilineFieldNode);
142639
- 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, {
142680
+ 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, {
142640
142681
  optional: node.optional
142641
142682
  }), context.addPathSectionDeclarationEntry(node), context.addVisibilityPathDeclEntryNew(node));
142642
142683
  }
@@ -142802,10 +142843,10 @@ class MultipleConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_0__
142802
142843
  }
142803
142844
 
142804
142845
  doBuildDataDeclaration(context) {
142805
- var _node$optional;
142846
+ var _ref, _node$optional;
142806
142847
 
142807
142848
  const node = this.getCurrentNodeAs(_MultipleNode__WEBPACK_IMPORTED_MODULE_3__.MultipleNode);
142808
- 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, {
142849
+ 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, {
142809
142850
  optional: node.optional
142810
142851
  }), context.addPathSectionDeclarationEntry(node));
142811
142852
  }
@@ -143985,9 +144026,9 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
143985
144026
 
143986
144027
  processMultilineNode(context, rowNode) {
143987
144028
  if (rowNode instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.StickyTableMultilineNode) {
143988
- var _rowNode$optional;
144029
+ var _ref, _rowNode$optional;
143989
144030
 
143990
- 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, {
144031
+ 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, {
143991
144032
  optional: rowNode.optional
143992
144033
  }), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => this.processMultilineRowNode(context, rowNode2)));
143993
144034
  }
@@ -144060,11 +144101,11 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
144060
144101
  const sideSize = (_node$side2 = node.side) !== null && _node$side2 !== void 0 ? _node$side2 : 0;
144061
144102
 
144062
144103
  if (this.isSimpleForm()) {
144063
- var _ref, _node$deprecatedDiado;
144104
+ var _ref2, _node$deprecatedDiado;
144064
144105
 
144065
144106
  mb.prop(x => x.maxWidth).set(orientation === "landscape" ? maxWidth : undefined);
144066
144107
  mb.prop(x => x.sideSize).set(this.hasActionButton(node) && sideSize !== 0 ? sideSize + 1 : sideSize);
144067
- const width = (_ref = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref !== void 0 ? _ref : maxWidthSimpleForm;
144108
+ const width = (_ref2 = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref2 !== void 0 ? _ref2 : maxWidthSimpleForm;
144068
144109
  mb.prop(x => x.width).set(width);
144069
144110
  mb.prop(x => x.footerHeight).set(160);
144070
144111
  } else {
@@ -144347,10 +144388,10 @@ BindingPath: ${errorPath}`));
144347
144388
  if (this.isSimpleForm()) {
144348
144389
  mb.prop(x => x.buttonType).set(undefined);
144349
144390
  } else {
144350
- var _multiline$rowmenu, _ref2, _tableNode$removeButt;
144391
+ var _multiline$rowmenu, _ref3, _tableNode$removeButt;
144351
144392
 
144352
144393
  const rowMenu = (_multiline$rowmenu = multiline.rowmenu) !== null && _multiline$rowmenu !== void 0 ? _multiline$rowmenu : false;
144353
- const removebutton = (_ref2 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref2 !== void 0 ? _ref2 : true;
144394
+ const removebutton = (_ref3 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true;
144354
144395
  mb.prop(x => x.buttonType).set(rowMenu ? "RowMenu" : removebutton ? "RemoveRowButton" : undefined);
144355
144396
  }
144356
144397
 
@@ -144363,7 +144404,7 @@ BindingPath: ${errorPath}`));
144363
144404
  }
144364
144405
 
144365
144406
  getMultiline(context, node, multiline, start, end = Infinity) {
144366
- var _ref3, _node$removeButton, _multiline$rowmenu2, _ref4, _node$removeButton2, _context$popPathsCont2;
144407
+ var _ref4, _node$removeButton, _multiline$rowmenu2, _ref5, _node$removeButton2, _context$popPathsCont2;
144367
144408
 
144368
144409
  const overrideInfo = multiline.override ? context.controlCustomizationContext.getControlCustomizationInfo("multiline", multiline.override) : undefined;
144369
144410
  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);
@@ -144376,7 +144417,7 @@ BindingPath: ${errorPath}`));
144376
144417
  mb.prop(x => x.isList).set(multiline.usepager === false ? true : undefined);
144377
144418
  mb.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_13__.getNewBindingPathExpression)(multiline));
144378
144419
  mb.prop(x => x.showRowBorder).set(multiline.showRowBorder);
144379
- 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);
144420
+ 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);
144380
144421
  const needAddButton = multiline.addbutton !== "false";
144381
144422
 
144382
144423
  if (this.isSimpleForm()) {
@@ -144389,7 +144430,7 @@ BindingPath: ${errorPath}`));
144389
144430
  mb.prop(x => x.removeButtonPosition).set(undefined);
144390
144431
  }
144391
144432
 
144392
- 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);
144433
+ 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);
144393
144434
  context.pushPathsContext();
144394
144435
 
144395
144436
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayHasLength)(multiline.rows, 1)) {
@@ -144415,9 +144456,9 @@ BindingPath: ${errorPath}`));
144415
144456
  hasActionButton(node) {
144416
144457
  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);
144417
144458
  return multilines.some(multiline => {
144418
- var _ref5, _node$removeButton3;
144459
+ var _ref6, _node$removeButton3;
144419
144460
 
144420
- return ((_ref5 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref5 !== void 0 ? _ref5 : true) || multiline.rowmenu;
144461
+ return ((_ref6 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref6 !== void 0 ? _ref6 : true) || multiline.rowmenu;
144421
144462
  });
144422
144463
  }
144423
144464
 
@@ -144643,10 +144684,10 @@ class Table2MultirowConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
144643
144684
  }
144644
144685
 
144645
144686
  doBuildDataDeclaration(context) {
144646
- var _node$optional;
144687
+ var _ref, _node$optional;
144647
144688
 
144648
144689
  const node = this.getCurrentNodeAs(_Table2Node__WEBPACK_IMPORTED_MODULE_3__.Table2MultirowNode);
144649
- 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));
144690
+ 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));
144650
144691
  }
144651
144692
 
144652
144693
  buildChildrenDataDeclaration(context) {
@@ -145465,10 +145506,10 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
145465
145506
  }
145466
145507
 
145467
145508
  doBuildDataDeclaration(context) {
145468
- var _node$optional;
145509
+ var _ref, _node$optional;
145469
145510
 
145470
145511
  const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
145471
- 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));
145512
+ 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));
145472
145513
  }
145473
145514
 
145474
145515
  buildChildrenDataDeclaration(context) {
@@ -149903,15 +149944,15 @@ __webpack_require__.r(__webpack_exports__);
149903
149944
 
149904
149945
 
149905
149946
  function setCurrencyProps(markupBuilder, context, node) {
149947
+ var _typeNode$base, _node$currency;
149948
+
149906
149949
  const typeNode = context.getTypeNode(node.validationInfo);
149907
149950
  const schemaTypeInfo = context.getSchemaTypeInfo(node.getFullPath());
149908
- markupBuilder.prop(x => x.currency).set(node.currency);
149909
-
149910
- if (node.currency) {
149911
- var _typeNode$base;
149912
-
149913
- 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;
149951
+ 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;
149952
+ const currency = (_node$currency = node.currency) !== null && _node$currency !== void 0 ? _node$currency : baseTypeName === "integer" || baseTypeName === "decimal";
149953
+ markupBuilder.prop(x => x.currency).set(currency);
149914
149954
 
149955
+ if (currency) {
149915
149956
  if (baseTypeName === "decimal") {
149916
149957
  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;
149917
149958
 
@@ -149937,11 +149978,14 @@ function setCurrencyProps(markupBuilder, context, node) {
149937
149978
  } else if (maxLength == undefined && fractionDigits == undefined && integerDigits == undefined) {
149938
149979
  markupBuilder.prop(x => x.currencyIntegerDigits).set(undefined);
149939
149980
  markupBuilder.prop(x => x.currencyFractionDigits).set(2);
149981
+ } else if (maxLength != undefined && fractionDigits != undefined && integerDigits != undefined) {
149982
+ markupBuilder.prop(x => x.currencyIntegerDigits).set(integerDigits);
149983
+ markupBuilder.prop(x => x.currencyFractionDigits).set(fractionDigits);
149940
149984
  } else if (totalDigits != undefined && fractionDigits == undefined && integerDigits == undefined) {
149941
149985
  markupBuilder.prop(x => x.currencyIntegerDigits).set(totalDigits);
149942
149986
  markupBuilder.prop(x => x.currencyFractionDigits).set(0);
149943
149987
  } else {
149944
- 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");
149988
+ 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");
149945
149989
  }
149946
149990
  } else if (baseTypeName === "integer") {
149947
149991
  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.246.0",
3
+ "version": "4.247.0-nightly.73h41",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,