@kontur.candy/generator 5.8.1 → 5.9.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 +14 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -78975,6 +78975,8 @@ __webpack_require__.r(__webpack_exports__);
78975
78975
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
78976
78976
  /* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
78977
78977
  /* harmony import */ var _markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../markupGenerator/AllConverters */ "./Generator/src/generators/markupGenerator/AllConverters.ts");
78978
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
78979
+
78978
78980
 
78979
78981
 
78980
78982
 
@@ -79022,15 +79024,19 @@ class LazyLoadDeclarationGenerator {
79022
79024
  }
79023
79025
  *processElement(path, element) {
79024
79026
  if (element.lazyLoadMode != undefined) {
79025
- const currentPath = element.multiple ? path.joinWith(element.name) : path.joinWith(element.name + ".value");
79026
- const item = {
79027
- path: this.formSchemaRng.adjustPathMultiplicity(currentPath),
79028
- lazyLoadMode: element.lazyLoadMode
79029
- };
79030
- yield element.lazyLoadingThreshold != undefined ? {
79027
+ const adjustedPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name));
79028
+ const currentPaths = element.multiple ? [element.lazyLoadMode === "deferred" ? adjustedPath : adjustedPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.each)] : [adjustedPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.each), this.formSchemaRng.adjustPathMultiplicity(path).joinWith(element.name + ".value")];
79029
+ const items = currentPaths.map(currentPath => {
79030
+ var _element$lazyLoadMode;
79031
+ return {
79032
+ path: currentPath,
79033
+ lazyLoadMode: (_element$lazyLoadMode = element.lazyLoadMode) !== null && _element$lazyLoadMode !== void 0 ? _element$lazyLoadMode : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)()
79034
+ };
79035
+ }).map(item => element.lazyLoadingThreshold != undefined ? {
79031
79036
  ...item,
79032
79037
  thresholdValue: element.lazyLoadingThreshold
79033
- } : item;
79038
+ } : item);
79039
+ yield* items;
79034
79040
  if (element.multiple) {
79035
79041
  const additionalFields = ["children", "errorsCount", "warningsCount"];
79036
79042
  const additionalItems = additionalFields.map(field => ({
@@ -82330,7 +82336,7 @@ class LazyLoadingRulesBuilder {
82330
82336
  const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
82331
82337
  const thresholdValue = (_thresholdEntry$1$thr = (_thresholdEntry$ = thresholdEntry[1]) === null || _thresholdEntry$ === void 0 ? void 0 : _thresholdEntry$.thresholdValue) !== null && _thresholdEntry$1$thr !== void 0 ? _thresholdEntry$1$thr : 0;
82332
82338
  const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
82333
- const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ReduceCallExpression(thresholdEntryPath.trimLastStarIfLastToken().toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(1))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
82339
+ const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ReduceCallExpression(thresholdEntryPath.trimLastStarIfLastToken(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(1))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
82334
82340
  yield statement;
82335
82341
  }
82336
82342
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.8.1",
3
+ "version": "5.9.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,