@kontur.candy/generator 5.21.0-picklist-again.3 → 5.21.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.
- package/dist/index.js +13 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -60272,11 +60272,17 @@ const getRngSchemaFilename = (formSchemasDirPath, gfv) => {
|
|
|
60272
60272
|
if (!Boolean(Number(gfv))) {
|
|
60273
60273
|
return ".rng.xml";
|
|
60274
60274
|
}
|
|
60275
|
-
|
|
60276
|
-
|
|
60275
|
+
try {
|
|
60276
|
+
const maxSubversion = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(formSchemasDirPath).map(fileName => fileName.includes(".rng.xml") && !fileName.includes("схема.rng.xml")).filter(i => i === true).length - 1;
|
|
60277
|
+
if (maxSubversion === undefined || !(0,fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasDirPath, `${gfv}.${maxSubversion}.rng.xml`))) {
|
|
60278
|
+
return ".rng.xml";
|
|
60279
|
+
}
|
|
60280
|
+
return `.${maxSubversion}.rng.xml`;
|
|
60281
|
+
} catch (e) {
|
|
60282
|
+
// eslint-disable-next-line no-console
|
|
60283
|
+
console.log(`Folder not exist. ${formSchemasDirPath}`);
|
|
60277
60284
|
return ".rng.xml";
|
|
60278
60285
|
}
|
|
60279
|
-
return `.${maxSubversion}.rng.xml`;
|
|
60280
60286
|
};
|
|
60281
60287
|
|
|
60282
60288
|
/***/ }),
|
|
@@ -83281,14 +83287,14 @@ class OptionalSectionRulesBuilder {
|
|
|
83281
83287
|
}
|
|
83282
83288
|
}
|
|
83283
83289
|
wrapRulesWithOptionalPageCheck(rules) {
|
|
83284
|
-
const
|
|
83285
|
-
const wrappedRules = Iterator.from(rules).map(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement && rule.left.valueName != "children" ? this.wrapSetStatementWithOptionalPageCheckIfNeeded(rule,
|
|
83290
|
+
const allOrderedSections = (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.reverseArray)(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.IterUtils.sortBy(this.getAllSections(), x => x.path.toLegacyPath())).toArray();
|
|
83291
|
+
const wrappedRules = Iterator.from(rules).map(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement && rule.left.valueName != "children" ? this.wrapSetStatementWithOptionalPageCheckIfNeeded(rule, allOrderedSections) : rule);
|
|
83286
83292
|
return wrappedRules;
|
|
83287
83293
|
}
|
|
83288
83294
|
wrapSetStatementWithOptionalPageCheckIfNeeded(rule, orderedSections) {
|
|
83289
83295
|
const targetPath = rule.left.modePath;
|
|
83290
|
-
const targetOptionalSection = orderedSections.find(x => _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.isPrefix(x.path.toLegacyPath(), targetPath.toLegacyPath()));
|
|
83291
|
-
if (targetOptionalSection != undefined &&
|
|
83296
|
+
const targetOptionalSection = orderedSections.find(x => _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.isPrefix(x.path.toLegacyPath(), targetPath.toLegacyPath()) && x.optional);
|
|
83297
|
+
if (targetOptionalSection != undefined && !targetOptionalSection.multiple) {
|
|
83292
83298
|
const targetIsFilledPath = targetOptionalSection.path.joinWith(OptionalSectionRulesBuilder.optionalSectionFilledFieldName);
|
|
83293
83299
|
if (!targetIsFilledPath.isEquals(targetPath)) {
|
|
83294
83300
|
const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
|