@kontur.candy/generator 5.121.0-fixes-for-flang-generator.8 → 5.121.0-fixes-for-flang-generator.9

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 +58 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47766,6 +47766,52 @@ function getMatchedAndDifferentModelPaths(baseModelPath, splittingModelPath) {
47766
47766
 
47767
47767
  /***/ }),
47768
47768
 
47769
+ /***/ "./Common/ModelPath/Set/AbsoluteModelPathSet.ts":
47770
+ /*!******************************************************!*\
47771
+ !*** ./Common/ModelPath/Set/AbsoluteModelPathSet.ts ***!
47772
+ \******************************************************/
47773
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
47774
+
47775
+ "use strict";
47776
+ __webpack_require__.r(__webpack_exports__);
47777
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
47778
+ /* harmony export */ AbsoluteModelPathSet: () => (/* binding */ AbsoluteModelPathSet)
47779
+ /* harmony export */ });
47780
+ /* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
47781
+ /* harmony import */ var _Set2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Set2 */ "./Common/ModelPath/Set/Set2.ts");
47782
+
47783
+
47784
+ class AbsoluteModelPathSet extends _Set2__WEBPACK_IMPORTED_MODULE_1__.Set2 {
47785
+ constructor(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_0__.EachCurrentCollision.AreSame) {
47786
+ super();
47787
+ this.eachCurrentCollision = void 0;
47788
+ this.eachCurrentCollision = eachCurrentCollision;
47789
+ }
47790
+ static *unique(paths) {
47791
+ const set = new AbsoluteModelPathSet();
47792
+ for (const path of paths) {
47793
+ if (set.add(path)) {
47794
+ yield path;
47795
+ }
47796
+ }
47797
+ }
47798
+ areItemsEqual(left, right) {
47799
+ return left.isEquals(right, this.eachCurrentCollision);
47800
+ }
47801
+ getItemHash(key) {
47802
+ return key.getHash(this.eachCurrentCollision);
47803
+ }
47804
+ static from(source) {
47805
+ const set = new AbsoluteModelPathSet();
47806
+ for (const sourceElement of source) {
47807
+ set.add(sourceElement);
47808
+ }
47809
+ return set;
47810
+ }
47811
+ }
47812
+
47813
+ /***/ }),
47814
+
47769
47815
  /***/ "./Common/ModelPath/Set/Set2.ts":
47770
47816
  /*!**************************************!*\
47771
47817
  !*** ./Common/ModelPath/Set/Set2.ts ***!
@@ -70404,6 +70450,11 @@ class DataDeclarationGenerationTimeHelper {
70404
70450
  const rootPath = this.getDataDeclarationRootPath();
70405
70451
  return (_this$dataDeclaration = (_this$dataDeclaration2 = this.dataDeclaration[rootPath]) === null || _this$dataDeclaration2 === void 0 ? void 0 : _this$dataDeclaration2.optionalSections) !== null && _this$dataDeclaration !== void 0 ? _this$dataDeclaration : [];
70406
70452
  }
70453
+ getAllSingleSections() {
70454
+ var _this$dataDeclaration3, _this$dataDeclaration4;
70455
+ const rootPath = this.getDataDeclarationRootPath();
70456
+ return (_this$dataDeclaration3 = (_this$dataDeclaration4 = this.dataDeclaration[rootPath]) === null || _this$dataDeclaration4 === void 0 ? void 0 : _this$dataDeclaration4.allSingleSections) !== null && _this$dataDeclaration3 !== void 0 ? _this$dataDeclaration3 : [];
70457
+ }
70407
70458
  getOptionalBlocksPaths() {
70408
70459
  const visibilityFieldsPaths = Object.keys(this.dataDeclaration).filter(path => path.endsWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_5__.OptionalBlockVisibilityFieldName));
70409
70460
  const optionalBlocksPaths = visibilityFieldsPaths.map(fieldPath => (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromMask)(fieldPath, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).getParentPath());
@@ -71291,6 +71342,8 @@ __webpack_require__.r(__webpack_exports__);
71291
71342
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
71292
71343
  /* harmony import */ var _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DataDeclarationGenerator/DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
71293
71344
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
71345
+ /* harmony import */ var _Common_ModelPath_Set_AbsoluteModelPathSet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/ModelPath/Set/AbsoluteModelPathSet */ "./Common/ModelPath/Set/AbsoluteModelPathSet.ts");
71346
+
71294
71347
 
71295
71348
 
71296
71349
 
@@ -71343,6 +71396,7 @@ function buildFieldsConfiguration(path, dataDeclaration) {
71343
71396
  return resultFields;
71344
71397
  }
71345
71398
  function buildExtendedSchemaInfo(dataDeclaration) {
71399
+ const singleSectionsSet = _Common_ModelPath_Set_AbsoluteModelPathSet__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelPathSet.from(dataDeclaration.getAllSingleSections().map(x => (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromMask)(x.path, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each)));
71346
71400
  const nodes = new Map();
71347
71401
  for (const path of dataDeclaration.getAllPaths()) {
71348
71402
  if (path.isEmpty() || path.endsWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createRelativeFromTokens)([_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each]))) {
@@ -71368,9 +71422,8 @@ function buildExtendedSchemaInfo(dataDeclaration) {
71368
71422
  props.optional = optional;
71369
71423
  props.type = dataDeclaration.getType(path);
71370
71424
  props.disabled = dataDeclaration.isNodeHasDisabledEntry(path);
71371
- if (isPage) {
71372
- props.isPage = isPage;
71373
- }
71425
+ props.isPage = isPage || undefined;
71426
+ props.isForceFilledOptional = isPage && isMultiple && singleSectionsSet.has(path) || undefined;
71374
71427
  props.fields = buildFieldsConfiguration(path, dataDeclaration);
71375
71428
  }
71376
71429
  return {
@@ -77212,7 +77265,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
77212
77265
  while ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.arrayIsNotEmpty)(pagesToProcess)) {
77213
77266
  const info = pagesToProcess.pop();
77214
77267
  if (info != null && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.isNotNullOrUndefined)(info.page.path)) {
77215
- var _page$optional;
77268
+ var _page$optional, _page$multiple;
77216
77269
  const {
77217
77270
  page,
77218
77271
  parentId
@@ -77221,7 +77274,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
77221
77274
  sectionId: page.id,
77222
77275
  path: page.getFullPath(),
77223
77276
  optional: (_page$optional = page.optional) !== null && _page$optional !== void 0 ? _page$optional : false,
77224
- multiple: this.dataDeclarationHelper.isNodeHasChildrenEntry(page.getFullPath()),
77277
+ multiple: (_page$multiple = page.multiple) !== null && _page$multiple !== void 0 ? _page$multiple : false,
77225
77278
  parentSectionId: parentId
77226
77279
  };
77227
77280
  pagesToProcess.push(...page.pages.map(x => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.121.0-fixes-for-flang-generator.8",
3
+ "version": "5.121.0-fixes-for-flang-generator.9",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,