@kontur.candy/generator 5.23.0-disable-employee.0 → 5.23.0-fixzeroes.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +12 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -59190,7 +59190,8 @@ class AbsoluteModelFieldPath {
59190
59190
  toLegacyPath() {
59191
59191
  const isLastTokenAnInstance = _ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.isInstanceTokenOrInstancesSpec(_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.last(this.path.getPathParts()));
59192
59192
  const slashIfRequired = isLastTokenAnInstance ? "/" : "";
59193
- return `${this.path.toLegacyPath()}${slashIfRequired}.${this.field}`;
59193
+ const dotIfRequired = (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(this.field) ? "." : "";
59194
+ return `${this.path.toLegacyPath()}${slashIfRequired}${dotIfRequired}${this.field}`;
59194
59195
  }
59195
59196
  }
59196
59197
  AbsoluteModelFieldPath.extraFieldNames = ["\\$errorCount", "\\$warningCount"];
@@ -80864,7 +80865,8 @@ class FLangValidationBuildContext {
80864
80865
  }
80865
80866
  const valueEqlAutoValueErrorLevel = (_ref5 = (_typeNode$children$fi4 = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children11 = typeNode.children) === null || _typeNode$children11 === void 0 ? void 0 : (_typeNode$children11$ = _typeNode$children11.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_common_SchemaRng_Nodes_SchemaRngRoot__WEBPACK_IMPORTED_MODULE_12__.ValueEqlAutoValueTypeCheck))) === null || _typeNode$children11$ === void 0 ? void 0 : _typeNode$children11$.level) !== null && _typeNode$children$fi4 !== void 0 ? _typeNode$children$fi4 : typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children12 = typeNode.children) === null || _typeNode$children12 === void 0 ? void 0 : (_typeNode$children12$ = _typeNode$children12.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ValueEqlAutoValueTypeCheckNode))) === null || _typeNode$children12$ === void 0 ? void 0 : _typeNode$children12$.level) !== null && _ref5 !== void 0 ? _ref5 : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.valueEqlAutoValue;
80866
80867
  if (valueEqlAutoValueErrorLevel != undefined) {
80867
- const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IsEqualsBinaryExpression(valueReference, autoValueReference));
80868
+ const isDecimal = (schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType) === "decimal";
80869
+ const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.decimalWrapper)(valueReference, isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.decimalWrapper)(autoValueReference, isDecimal)));
80868
80870
  yield {
80869
80871
  condition: condition,
80870
80872
  message: makeMessage({
@@ -82310,6 +82312,7 @@ __webpack_require__.r(__webpack_exports__);
82310
82312
  /* harmony export */ "castOperandToStringIfNeed": () => (/* binding */ castOperandToStringIfNeed),
82311
82313
  /* harmony export */ "castOperandToBoolIfNeed": () => (/* binding */ castOperandToBoolIfNeed),
82312
82314
  /* harmony export */ "castOperandToDecimalIfNeed": () => (/* binding */ castOperandToDecimalIfNeed),
82315
+ /* harmony export */ "decimalWrapper": () => (/* binding */ decimalWrapper),
82313
82316
  /* harmony export */ "castOperandToDateTimeIfNeed": () => (/* binding */ castOperandToDateTimeIfNeed),
82314
82317
  /* harmony export */ "nullCoalesceWithTypeCheck": () => (/* binding */ nullCoalesceWithTypeCheck),
82315
82318
  /* harmony export */ "ensureOperandsOfTypeOrNull": () => (/* binding */ ensureOperandsOfTypeOrNull),
@@ -82355,7 +82358,7 @@ function tryExtractValueReferenceAsStringFromDecimal(expression) {
82355
82358
  }
82356
82359
  return expression;
82357
82360
  }
82358
- function castOperandToStringIfNeed(operandExpression, decimalFormat) {
82361
+ function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
82359
82362
  if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateNowExpression) {
82360
82363
  return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("dd.MM.yyyy"));
82361
82364
  }
@@ -82370,6 +82373,7 @@ function castOperandToBoolIfNeed(operandExpression) {
82370
82373
  function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
82371
82374
  return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
82372
82375
  }
82376
+ const decimalWrapper = (ex, needWrapped) => needWrapped ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(ex, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal) : ex;
82373
82377
  function castOperandToDateTimeIfNeed(operandExpression) {
82374
82378
  return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime) : operandExpression;
82375
82379
  }
@@ -83241,6 +83245,7 @@ class FormulaRulesBuilder {
83241
83245
  }
83242
83246
  }
83243
83247
  buildFormulaFlashRule(formula) {
83248
+ var _this$formSchemaRng$g;
83244
83249
  const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(formula.match.replace(/\@/g, ""), true).normalize();
83245
83250
  const target = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(formula.target.replace(/\@/g, ""), false);
83246
83251
  const fullTarget = (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(prefix.joinWith(target).normalize(), this.formSchemaRng, this.dataDeclarationHelper);
@@ -83248,10 +83253,11 @@ class FormulaRulesBuilder {
83248
83253
  const precalculationRules = [];
83249
83254
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
83250
83255
  const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
83256
+ const isDecimal = ((_this$formSchemaRng$g = this.formSchemaRng.getTypeNodeByPath(fullTarget.toAbsolute())) === null || _this$formSchemaRng$g === void 0 ? void 0 : _this$formSchemaRng$g.baseType) === "decimal";
83251
83257
  const getFormulaExpression = targetField => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue));
83252
83258
  const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
83253
83259
  const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
83254
- const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget) : undefined;
83260
+ const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
83255
83261
  const result = [autoValueRule, autoFlagRule, valueRule].concat(...precalculationRules).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.isNotNullOrUndefined);
83256
83262
  return result;
83257
83263
  }
@@ -83261,8 +83267,8 @@ class FormulaRulesBuilder {
83261
83267
  createRegularValueRule(fullTarget, getFormulaExpression) {
83262
83268
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
83263
83269
  }
83264
- createAutoFlagRule(fullTarget) {
83265
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
83270
+ createAutoFlagRule(fullTarget, isDecimal) {
83271
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
83266
83272
  }
83267
83273
  createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
83268
83274
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.23.0-disable-employee.0",
3
+ "version": "5.23.0-fixzeroes.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,