@kontur.candy/generator 4.245.0-lazy-loading.14 → 4.245.0-lazy-loading.18

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 +32 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -114258,6 +114258,22 @@ class PathUtils {
114258
114258
  return fullPathTokens.slice(0, i + 1).join("/");
114259
114259
  }
114260
114260
 
114261
+ static getFirstInstancePathWithMaskTail(fullPath, mask) {
114262
+ const fullPathTokens = this.split(fullPath);
114263
+ const maskTokens = this.split(mask);
114264
+ let i = 0;
114265
+
114266
+ while (maskTokens[i] && fullPathTokens[i] === maskTokens[i]) {
114267
+ i++;
114268
+ }
114269
+
114270
+ if (maskTokens[i] !== "*") {
114271
+ return null;
114272
+ }
114273
+
114274
+ return fullPathTokens.slice(0, i + 1).concat(maskTokens.slice(i + 1)).join("/");
114275
+ }
114276
+
114261
114277
  static isPicklistFieldValueName(valueName) {
114262
114278
  return valueName.startsWith("picklist@");
114263
114279
  }
@@ -135134,12 +135150,12 @@ class NormalizationRulesGenerator {
135134
135150
 
135135
135151
  buildKcValidationRules() {
135136
135152
  const allRulesCheck = this.conditions.map(x => this.buildKcValidationRuleCheck(x)).reduce((ctx, current) => {
135137
- var _ctx$path;
135153
+ var _targetCtx$path;
135138
135154
 
135139
135155
  const path = current.target.toLegacyPath();
135140
- const currentExpression = (_ctx$path = ctx[path]) !== null && _ctx$path !== void 0 ? _ctx$path : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression();
135141
- const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(current.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("[" + JSON.stringify(current.message) + "]"), currentExpression);
135142
135156
  const targetCtx = current.errorLevel === "Warning" ? ctx.warnings : ctx.errors;
135157
+ const currentExpression = (_targetCtx$path = targetCtx[path]) !== null && _targetCtx$path !== void 0 ? _targetCtx$path : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NullLiteralExpression();
135158
+ const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NegateUnaryExpression(current.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("[" + JSON.stringify(current.message) + "]"), currentExpression);
135143
135159
  targetCtx[path] = condition;
135144
135160
  return ctx;
135145
135161
  }, {
@@ -135334,7 +135350,7 @@ class NormalizationRulesGenerator {
135334
135350
  const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(iterablePath.joinWith(new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.ModelPath(suffixWithoutMultiple, false)).joinWith("Count").normalize(), "value");
135335
135351
  const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ValueReferenceExpression(iterablePath.joinWith(new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.ModelPath(suffixWithoutMultiple, false)).joinWith("Count").toCurrentIteration().normalize(), "value");
135336
135352
  addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(resultValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("G29"))));
135337
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentReferenceExpression("result"), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(1) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(countValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("G29"))));
135353
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ArgumentReferenceExpression("result"), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.CastExpression(countValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_13__.StringLiteralExpression("G29"))));
135338
135354
  resultValueExpression = currentSumExpression;
135339
135355
  countValueExpression = currenCountExpression;
135340
135356
  }
@@ -135444,7 +135460,7 @@ class NormalizationRulesGenerator {
135444
135460
  yield rule;
135445
135461
  }
135446
135462
 
135447
- const targetPaths = [..._Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(context.getAllPathsWithValidations(), x => x.toLegacyPath())];
135463
+ const targetPaths = [..._Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(context.getAllPathsWithValidations(), Object.keys(kcRules.errors).concat(Object.keys(kcRules.warnings)).map(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.ModelPath.createFromMask(x, "auto", _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each))), x => x.toLegacyPath())];
135448
135464
  yield* this.buildErrorWarningCountRules(targetPaths, "error");
135449
135465
  yield* this.buildErrorWarningCountRules(targetPaths, "warning");
135450
135466
  }
@@ -156885,6 +156901,17 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
156885
156901
  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));
156886
156902
  }
156887
156903
 
156904
+ *doBuildNormalizeRules(builder) {
156905
+ var _node$optional2;
156906
+
156907
+ const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
156908
+ yield* builder.childrenInitializer(node, (_node$optional2 = node.optional) !== null && _node$optional2 !== void 0 ? _node$optional2 : false);
156909
+ yield* builder.specialFieldsInitializer(node, {
156910
+ optional: node.optional,
156911
+ disabled: undefined
156912
+ });
156913
+ }
156914
+
156888
156915
  buildChildrenDataDeclaration(context) {
156889
156916
  var _node$title$children, _node$title, _node$content$childre, _node$content;
156890
156917
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.245.0-lazy-loading.14",
3
+ "version": "4.245.0-lazy-loading.18",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,