@kontur.candy/generator 4.278.0-efs-partial-load.7 → 4.278.0-efs-partial-load.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +39 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -115473,6 +115473,7 @@ class KCLangAntlrParser {
115473
115473
  const tokens = new antlr4ts__WEBPACK_IMPORTED_MODULE_0__.CommonTokenStream(lexer);
115474
115474
  const parser = new _KCLangGenerated_KCLangParser__WEBPACK_IMPORTED_MODULE_4__.KCLangParser(tokens);
115475
115475
  const errorListener = new ErrorListener();
115476
+ parser.removeErrorListeners();
115476
115477
  parser.addErrorListener(errorListener);
115477
115478
  const tree = parser.kclang();
115478
115479
 
@@ -131925,9 +131926,7 @@ class FLangValidationBuildContext {
131925
131926
  getFlangExpressionFromKclangCondition(prefix, target, condition, invertRequired) {
131926
131927
  const fullKcLangExpr = `
131927
131928
  in ${prefix.toLegacyPath()} {
131928
- check ${condition}
131929
- with description \`\`\`Condition must match\`\`\`
131930
- with errorLevel \`\`\`Error\`\`\`;
131929
+ check Test === (${condition}) ? 1 : 0;
131931
131930
  }
131932
131931
  `;
131933
131932
 
@@ -131936,10 +131935,11 @@ class FLangValidationBuildContext {
131936
131935
 
131937
131936
  const formulaReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_8__.FormulaReader();
131938
131937
  const kcLangMathContainer = formulaReader.readFormulas(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_7__.KCLangToXmlTranspiler.transpile(fullKcLangExpr));
131939
- const conditionNode = (_kcLangMathContainer$ = kcLangMathContainer === null || kcLangMathContainer === void 0 ? void 0 : (_kcLangMathContainer$2 = kcLangMathContainer.conditions) === null || _kcLangMathContainer$2 === void 0 ? void 0 : (_kcLangMathContainer$3 = _kcLangMathContainer$2.items) === null || _kcLangMathContainer$3 === void 0 ? void 0 : _kcLangMathContainer$3[0]) !== null && _kcLangMathContainer$ !== void 0 ? _kcLangMathContainer$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
131940
- const flangExpr = this.formulaExprConverter.compileExpressionToFlangExpression(conditionNode.expression, prefix, target, value => {
131938
+ const formulaNode = (_kcLangMathContainer$ = kcLangMathContainer === null || kcLangMathContainer === void 0 ? void 0 : (_kcLangMathContainer$2 = kcLangMathContainer.formulas) === null || _kcLangMathContainer$2 === void 0 ? void 0 : (_kcLangMathContainer$3 = _kcLangMathContainer$2.items) === null || _kcLangMathContainer$3 === void 0 ? void 0 : _kcLangMathContainer$3[0]) !== null && _kcLangMathContainer$ !== void 0 ? _kcLangMathContainer$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
131939
+ const formulaExpr = this.formulaExprConverter.compileExpressionToFlangExpression(formulaNode.expression, prefix, target, value => {
131941
131940
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_9__.NotSupportedError("In contextual KcLang conditions should not be summation.");
131942
131941
  });
131942
+ const flangExpr = formulaExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression ? formulaExpr.condition : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
131943
131943
 
131944
131944
  const getTypeCorrectedExpression = () => {
131945
131945
  const argExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_11__.castOperandToStringIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_11__.tryExtractValueReferenceAsStringFromDecimal)(flangExpr));
@@ -131994,6 +131994,12 @@ class FLangValidationBuildContext {
131994
131994
 
131995
131995
 
131996
131996
  console.warn(`Could not process kclang to flang: [${condition}]`);
131997
+
131998
+ if (e instanceof Error) {
131999
+ // eslint-disable-next-line no-console
132000
+ console.warn(e === null || e === void 0 ? void 0 : e.toString());
132001
+ }
132002
+
131997
132003
  return undefined;
131998
132004
  }
131999
132005
  }
@@ -157406,8 +157412,10 @@ __webpack_require__.r(__webpack_exports__);
157406
157412
  /* harmony import */ var _ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ComponentMarkupBuilder/ComponentMarkupBuilder */ "./Generator/src/generators/markupGenerator/ComponentMarkupBuilder/ComponentMarkupBuilder.ts");
157407
157413
  /* harmony import */ var _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../SugarNodeConverter */ "./Generator/src/generators/markupGenerator/SugarNodeConverter.ts");
157408
157414
  /* harmony import */ var _CommonNodeProperties_TooltipProperties_SetTooltipSettingsProps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../CommonNodeProperties/TooltipProperties/SetTooltipSettingsProps */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/TooltipProperties/SetTooltipSettingsProps.ts");
157409
- /* harmony import */ var _PicklistReference__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PicklistReference */ "./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Select/PicklistReference.ts");
157415
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
157410
157416
  /* harmony import */ var _SelectNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Select/SelectNode.ts");
157417
+ /* harmony import */ var _PicklistReference__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PicklistReference */ "./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Select/PicklistReference.ts");
157418
+
157411
157419
 
157412
157420
 
157413
157421
 
@@ -157433,6 +157441,27 @@ class SelectConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.S
157433
157441
  }), context.addPathSectionDeclarationEntry(node, node.dataBinding.requisite), context.addVisibilityPathDeclEntryNew(node, node.dataBinding.requisite));
157434
157442
  }
157435
157443
 
157444
+ doBuildFLangValidations(buildContext, formSchemaRng) {
157445
+ const node = this.getCurrentNodeAs(_SelectNode__WEBPACK_IMPORTED_MODULE_6__.SelectNode);
157446
+ const element = formSchemaRng.getElementByPath(node.getFullPath());
157447
+ const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsoluteFromMask)(this.getResolvedBindingPath(node), _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.each);
157448
+ const typeNode = buildContext.getTypeNode(node.validationInfo);
157449
+ const schemaTypeNode = buildContext.getSchemaTypeInfo(targetPath);
157450
+
157451
+ if (typeNode == undefined && schemaTypeNode == undefined) {
157452
+ return [];
157453
+ }
157454
+
157455
+ return buildContext.buildBasicValidations(targetPath, typeNode, schemaTypeNode, node.validationInfo.optional == undefined ? element === null || element === void 0 ? void 0 : element.isOptional() : node.validationInfo.optional);
157456
+ }
157457
+
157458
+ doBuildNormalizeRules(builder) {
157459
+ const node = this.getCurrentNodeAs(_SelectNode__WEBPACK_IMPORTED_MODULE_6__.SelectNode);
157460
+ return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
157461
+ disabled: node.disabled
157462
+ })];
157463
+ }
157464
+
157436
157465
  buildChildrenDataDeclaration(context) {
157437
157466
  const node = this.getCurrentNodeAs(_SelectNode__WEBPACK_IMPORTED_MODULE_6__.SelectNode);
157438
157467
  return context.processChildrenDataDeclaration(node.helpNodes);
@@ -157469,13 +157498,13 @@ class SelectConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.S
157469
157498
  markupBuilder.prop(x => x.reference).set(referenceData);
157470
157499
  }
157471
157500
 
157472
- const reference = (0,_PicklistReference__WEBPACK_IMPORTED_MODULE_5__.extractPicklistReference)(node);
157501
+ const reference = (0,_PicklistReference__WEBPACK_IMPORTED_MODULE_7__.extractPicklistReference)(node);
157473
157502
 
157474
- if ((reference === null || reference === void 0 ? void 0 : reference.type) === _PicklistReference__WEBPACK_IMPORTED_MODULE_5__.PicklistReferenceType.GlobalPicklist) {
157503
+ if ((reference === null || reference === void 0 ? void 0 : reference.type) === _PicklistReference__WEBPACK_IMPORTED_MODULE_7__.PicklistReferenceType.GlobalPicklist) {
157475
157504
  markupBuilder.prop(x => x.gId).set(reference.id);
157476
157505
  }
157477
157506
 
157478
- if ((reference === null || reference === void 0 ? void 0 : reference.type) === _PicklistReference__WEBPACK_IMPORTED_MODULE_5__.PicklistReferenceType.LocalPaths) {
157507
+ if ((reference === null || reference === void 0 ? void 0 : reference.type) === _PicklistReference__WEBPACK_IMPORTED_MODULE_7__.PicklistReferenceType.LocalPaths) {
157479
157508
  markupBuilder.prop(x => x.gPaths).set(reference.paths);
157480
157509
  }
157481
157510
 
@@ -160005,7 +160034,7 @@ class FLangNormalizationRulesBuilder {
160005
160034
  const currentValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "value"));
160006
160035
  const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
160007
160036
 
160008
- if (dataBinding.fetchfn !== undefined) {
160037
+ if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
160009
160038
  try {
160010
160039
  var _this$fetchFunctions$, _this$fetchFunctions$2;
160011
160040
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.278.0-efs-partial-load.7",
3
+ "version": "4.278.0-efs-partial-load.8",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,