@kontur.candy/generator 4.241.0-server-norm.11 → 4.241.0-server-norm-faster.16

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 +19 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -132857,6 +132857,10 @@ class KCXmlGeneratorBase {
132857
132857
  return pathPart.replace(/\@/g, "");
132858
132858
  }
132859
132859
 
132860
+ removeMultiplicity(path) {
132861
+ return path.replace(/\/\*/g, "");
132862
+ }
132863
+
132860
132864
  modelPathInstance(target) {
132861
132865
  return `new ModelPath([${[...target.getPathParts()].map(x => {
132862
132866
  if (x === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each) {
@@ -132947,8 +132951,8 @@ class KCXmlValidationGenerator extends _KCXmlGenerator_KCXmlGeneratorBase__WEBPA
132947
132951
  compileCondition(condition) {
132948
132952
  var _condition$descriptio, _condition$errorLevel;
132949
132953
 
132950
- const prefix = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(this.removeAttributePrefix(condition.match), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each).toAbsolute();
132951
- const target = this.schema.adjustPathMultiplicity(prefix.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(this.removeAttributePrefix(condition.target), false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each)).normalize());
132954
+ const prefix = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(this.removeMultiplicity(this.removeAttributePrefix(condition.match)), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each).toAbsolute();
132955
+ const target = this.schema.adjustPathMultiplicity(prefix.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(this.removeMultiplicity(this.removeAttributePrefix(condition.target)), false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each)).normalize());
132952
132956
  const deps = [];
132953
132957
  const compiledExpression = this.compileExpression(prefix, target, condition.expression, deps);
132954
132958
  const compiledTarget = this.modelPathInstance(target);
@@ -133705,7 +133709,7 @@ class FLangValidationBuildContext {
133705
133709
  }
133706
133710
 
133707
133711
  buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional) {
133708
- var _typeNode$base;
133712
+ var _typeNode$base, _typeNode$checkType;
133709
133713
 
133710
133714
  const validations = [];
133711
133715
  const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
@@ -133739,9 +133743,10 @@ class FLangValidationBuildContext {
133739
133743
  errorExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(""))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression(), errorExpression);
133740
133744
  }
133741
133745
 
133746
+ const checkType = (_typeNode$checkType = typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _typeNode$checkType !== void 0 ? _typeNode$checkType : "error";
133742
133747
  return [{
133743
- statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(targetPath, "error"), errorExpression),
133744
- checkType: "error"
133748
+ statement: new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(targetPath, checkType), errorExpression),
133749
+ checkType: checkType
133745
133750
  }];
133746
133751
  }
133747
133752
 
@@ -133819,7 +133824,7 @@ class FLangValidationBuildContext {
133819
133824
 
133820
133825
  if (totalDigitsValue != undefined) {
133821
133826
  const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LenExpression(valueReference), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DecimalLiteralExpression(totalDigitsValue)));
133822
- yield [totalDigitsRuleBody, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Поле должно быть заполнено"]`)];
133827
+ yield [totalDigitsRuleBody, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(`["Число не может содержать более ${totalDigitsValue} знаков"]`)];
133823
133828
  }
133824
133829
 
133825
133830
  const typeNodePattern = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$children8 = typeNode.children) === null || _typeNode$children8 === void 0 ? void 0 : _typeNode$children8.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_1__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_1__.PatternTypeCheckNode));
@@ -158609,6 +158614,14 @@ class CheckboxConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
158609
158614
  }), context.addPathSectionDeclarationEntry(node, node.dataBinding.requisite), context.addVisibilityPathDeclEntryNew(node, node.dataBinding.requisite));
158610
158615
  }
158611
158616
 
158617
+ doBuildNormalizeRules(builder) {
158618
+ const node = this.getCurrentNodeAs(_CheckboxNode__WEBPACK_IMPORTED_MODULE_5__.CheckboxNode);
158619
+ return [builder.valueInitializer(node, node.dataBinding, false), ...builder.specialFieldsInitializer(node, {
158620
+ optional: node.dataBinding.optional,
158621
+ disabled: false
158622
+ })];
158623
+ }
158624
+
158612
158625
  getDefaultValue(node) {
158613
158626
  var _node$dataBinding$def;
158614
158627
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.241.0-server-norm.11",
3
+ "version": "4.241.0-server-norm-faster.16",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,