@kontur.candy/generator 6.7.0-test-9327.0 → 6.7.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 +177 -45
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -46001,6 +46001,57 @@ class ExtendedError extends Error {
46001
46001
 
46002
46002
  /***/ }),
46003
46003
 
46004
+ /***/ "./Common/ExtractGFVPath/ExtractGFVPath.ts":
46005
+ /*!*************************************************!*\
46006
+ !*** ./Common/ExtractGFVPath/ExtractGFVPath.ts ***!
46007
+ \*************************************************/
46008
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46009
+
46010
+ "use strict";
46011
+ __webpack_require__.r(__webpack_exports__);
46012
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46013
+ /* harmony export */ extractGFV: () => (/* binding */ extractGFV),
46014
+ /* harmony export */ extractGFVPath: () => (/* binding */ extractGFVPath),
46015
+ /* harmony export */ extractGFVPathFromCandyFarmPath: () => (/* binding */ extractGFVPathFromCandyFarmPath)
46016
+ /* harmony export */ });
46017
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ "path");
46018
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
46019
+ /* harmony import */ var _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../WellKnownDirectories */ "./Common/WellKnownDirectories.ts");
46020
+
46021
+
46022
+ function extractGFV(gfv) {
46023
+ const version = gfv.slice(-2);
46024
+ const format = gfv.slice(-5, -2);
46025
+ const group = gfv.slice(0, -5);
46026
+ return {
46027
+ group: group,
46028
+ format: format,
46029
+ version: version
46030
+ };
46031
+ }
46032
+ function extractGFVPath(gfv) {
46033
+ const {
46034
+ format,
46035
+ group
46036
+ } = extractGFV(gfv);
46037
+ const repositoryRoot = path__WEBPACK_IMPORTED_MODULE_0___default().join(__dirname, "..", "..", "..", _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.ExternFormsDefaultCheckoutDirectory);
46038
+ const formPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(repositoryRoot, _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.FormsDirectory, group, format, gfv, _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.CandySubdirectoryName);
46039
+ const farmPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(__dirname, repositoryRoot, _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.CandyFarmDirectory);
46040
+ return {
46041
+ formPath: formPath,
46042
+ farmPath: farmPath
46043
+ };
46044
+ }
46045
+ function extractGFVPathFromCandyFarmPath(candyFarmPath, gfv) {
46046
+ const {
46047
+ format,
46048
+ group
46049
+ } = extractGFV(gfv);
46050
+ return path__WEBPACK_IMPORTED_MODULE_0___default().join(candyFarmPath, "..", _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.FormsDirectory, group, format, gfv, _WellKnownDirectories__WEBPACK_IMPORTED_MODULE_1__.WellKnownDirectories.CandySubdirectoryName);
46051
+ }
46052
+
46053
+ /***/ }),
46054
+
46004
46055
  /***/ "./Common/FormActionHandlers/ContextualActionNames.ts":
46005
46056
  /*!************************************************************!*\
46006
46057
  !*** ./Common/FormActionHandlers/ContextualActionNames.ts ***!
@@ -47683,6 +47734,57 @@ function checkIsReservedPath(path) {
47683
47734
 
47684
47735
  /***/ }),
47685
47736
 
47737
+ /***/ "./Common/ModelPath/ModelPathValidator.ts":
47738
+ /*!************************************************!*\
47739
+ !*** ./Common/ModelPath/ModelPathValidator.ts ***!
47740
+ \************************************************/
47741
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
47742
+
47743
+ "use strict";
47744
+ __webpack_require__.r(__webpack_exports__);
47745
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
47746
+ /* harmony export */ ModelPathValidator: () => (/* binding */ ModelPathValidator)
47747
+ /* harmony export */ });
47748
+ /* harmony import */ var _ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModelPath */ "./Common/ModelPath/ModelPath.ts");
47749
+ var _ModelPathValidator;
47750
+
47751
+ class ModelPathValidator {
47752
+ static validate(path) {
47753
+ for (const token of path.getPathParts()) {
47754
+ if (_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.isMultiToken(token)) {
47755
+ continue;
47756
+ }
47757
+ if (_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.isInstanceTokenOrInstancesSpec(token)) {
47758
+ continue;
47759
+ }
47760
+ if (token === "." || token === "..") {
47761
+ continue;
47762
+ }
47763
+ if (!ModelPathValidator.isValidXmlName(token)) {
47764
+ return {
47765
+ valid: false,
47766
+ invalidToken: token,
47767
+ error: `Token "${token}" is not a valid XML name`
47768
+ };
47769
+ }
47770
+ }
47771
+ return {
47772
+ valid: true
47773
+ };
47774
+ }
47775
+ static isValidXmlName(name) {
47776
+ return ModelPathValidator.XML_NAME_REGEX.test(name);
47777
+ }
47778
+ }
47779
+ _ModelPathValidator = ModelPathValidator;
47780
+ ModelPathValidator.NAME_START_CHAR = "[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF" + "\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F" + "\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]";
47781
+ ModelPathValidator.NAME_CHAR = "[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF" + "\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F" + "\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD" + "\\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]";
47782
+ // Full XML Name regex built from the two character classes above.
47783
+ // The `u` flag enables proper handling of Unicode code points > U+FFFF.
47784
+ ModelPathValidator.XML_NAME_REGEX = new RegExp(`^${_ModelPathValidator.NAME_START_CHAR}${_ModelPathValidator.NAME_CHAR}*$`, "u");
47785
+
47786
+ /***/ }),
47787
+
47686
47788
  /***/ "./Common/ModelPath/PathMatcher.ts":
47687
47789
  /*!*****************************************!*\
47688
47790
  !*** ./Common/ModelPath/PathMatcher.ts ***!
@@ -62856,9 +62958,9 @@ class FormSchemaRngAttribute {
62856
62958
  isEditorOnly() {
62857
62959
  return this.editorOnly || false;
62858
62960
  }
62859
- isIgnoreForcedValueSet() {
62961
+ isDisableValueAutoInit() {
62860
62962
  var _this$disableValueAut;
62861
- return (_this$disableValueAut = this.disableValueAutoInit) !== null && _this$disableValueAut !== void 0 ? _this$disableValueAut : this.parent.isIgnoreForcedValueSet();
62963
+ return (_this$disableValueAut = this.disableValueAutoInit) !== null && _this$disableValueAut !== void 0 ? _this$disableValueAut : this.parent.isDisableValueAutoInit();
62862
62964
  }
62863
62965
  }
62864
62966
  const RootParent = Symbol.for("__ROOT_ELEMENT_PARENT__");
@@ -62933,9 +63035,9 @@ class FormSchemaRngElement {
62933
63035
  getAttributesArray() {
62934
63036
  return this.attributes.values().toArray();
62935
63037
  }
62936
- isIgnoreForcedValueSet() {
63038
+ isDisableValueAutoInit() {
62937
63039
  var _this$disableValueAut2;
62938
- return (_this$disableValueAut2 = this.disableValueAutoInit) !== null && _this$disableValueAut2 !== void 0 ? _this$disableValueAut2 : this.parent instanceof FormSchemaRngElement ? this.parent.isIgnoreForcedValueSet() : false;
63040
+ return (_this$disableValueAut2 = this.disableValueAutoInit) !== null && _this$disableValueAut2 !== void 0 ? _this$disableValueAut2 : this.parent instanceof FormSchemaRngElement ? this.parent.isDisableValueAutoInit() : undefined;
62939
63041
  }
62940
63042
  getUseServerFilters() {
62941
63043
  return this.useServerFilters;
@@ -70592,6 +70694,9 @@ class DataDeclarationGenerationContext {
70592
70694
  [(0,_markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_8__.getResolvedBindingPath)(sugarNode)]: declEntry
70593
70695
  };
70594
70696
  }
70697
+ adjustPathMultiplicityByScheme(path) {
70698
+ return this.formSchemaRng.adjustPathMultiplicity(path);
70699
+ }
70595
70700
  }
70596
70701
 
70597
70702
  /***/ }),
@@ -70690,6 +70795,10 @@ class DataDeclarationGenerationTimeHelper {
70690
70795
  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());
70691
70796
  return optionalBlocksPaths;
70692
70797
  }
70798
+ isNodeHasDisableValueAutoInitEntry(targetPath) {
70799
+ const declEntry = this.getDataDeclarationEntry(targetPath);
70800
+ return declEntry === null || declEntry === void 0 ? void 0 : declEntry.hasDisableValueAutoInitFlag;
70801
+ }
70693
70802
  getDataDeclarationRootPath() {
70694
70803
  const anyPath = Object.keys(this.dataDeclaration)[0];
70695
70804
  if (anyPath == undefined) {
@@ -70845,8 +70954,9 @@ class DataDeclarationGenerator {
70845
70954
  if (entry instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_6__.FormSchemaRngElement && entry.useServerFilters != undefined) {
70846
70955
  declarationEntry.useServerFilters = entry.useServerFilters;
70847
70956
  }
70848
- if (entry.disableValueAutoInit != undefined) {
70849
- declarationEntry.disableValueAutoInit = entry.disableValueAutoInit;
70957
+ const disableValueAutoInit = entry.isDisableValueAutoInit();
70958
+ if (disableValueAutoInit != undefined) {
70959
+ declarationEntry.hasDisableValueAutoInitFlag = disableValueAutoInit;
70850
70960
  }
70851
70961
  }
70852
70962
  }
@@ -71659,6 +71769,7 @@ function buildExtendedSchemaInfo(dataDeclaration) {
71659
71769
  props.isPage = isPage || undefined;
71660
71770
  props.isForceFilledOptional = props.isFilledOptionalRequired = isPage && optional && (isMultiple && singleSectionsSet.has(path) || !isMultiple) || undefined;
71661
71771
  props.fields = buildFieldsConfiguration(path, dataDeclaration);
71772
+ props.disableValueAutoInit = dataDeclaration.isNodeHasDisableValueAutoInitEntry(path);
71662
71773
  }
71663
71774
  return {
71664
71775
  roots: [...nodes.values()].map(x => x[0])
@@ -73399,8 +73510,8 @@ __webpack_require__.r(__webpack_exports__);
73399
73510
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
73400
73511
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
73401
73512
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
73402
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
73403
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_12__);
73513
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
73514
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_13__);
73404
73515
  /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
73405
73516
  /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
73406
73517
  /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
@@ -73409,7 +73520,9 @@ __webpack_require__.r(__webpack_exports__);
73409
73520
  /* harmony import */ var _Common_GetRngSchemaFileExtension__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../Common/GetRngSchemaFileExtension */ "./Common/GetRngSchemaFileExtension.ts");
73410
73521
  /* harmony import */ var _Common_FormPathUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../Common/FormPathUtils */ "./Common/FormPathUtils.ts");
73411
73522
  /* harmony import */ var _Common_WellKnownDirectories__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../Common/WellKnownDirectories */ "./Common/WellKnownDirectories.ts");
73412
- /* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
73523
+ /* harmony import */ var _Common_ExtractGFVPath_ExtractGFVPath__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../Common/ExtractGFVPath/ExtractGFVPath */ "./Common/ExtractGFVPath/ExtractGFVPath.ts");
73524
+ /* harmony import */ var _FsUtils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./FsUtils */ "./Generator/src/generators/FsUtils.ts");
73525
+
73413
73526
 
73414
73527
 
73415
73528
 
@@ -73468,7 +73581,7 @@ async function readFormSources(formSourcesPath, farmDirectory) {
73468
73581
  additionalNormalizers: additionalNormalizers
73469
73582
  }
73470
73583
  };
73471
- if (gfv.startsWith("4")) {
73584
+ if ((0,_Common_ExtractGFVPath_ExtractGFVPath__WEBPACK_IMPORTED_MODULE_11__.extractGFV)(gfv).group === "4") {
73472
73585
  const commonResourcesPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "commonResources");
73473
73586
  const {
73474
73587
  elements
@@ -73507,7 +73620,7 @@ async function extractReferences(formSugarDirectoryPath) {
73507
73620
  return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
73508
73621
  }
73509
73622
  async function getAllFilePathsInDirectory(directoryPath, _filelist) {
73510
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(directoryPath))) {
73623
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_13__.pathExists)(directoryPath))) {
73511
73624
  return [];
73512
73625
  }
73513
73626
  const files = await readdirAsync(directoryPath);
@@ -73522,18 +73635,18 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
73522
73635
  return filelist;
73523
73636
  }
73524
73637
  async function checkFileExists(filePath) {
73525
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(filePath))) {
73638
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_13__.pathExists)(filePath))) {
73526
73639
  return [];
73527
73640
  }
73528
73641
  return [filePath];
73529
73642
  }
73530
73643
  async function getKclangFetchFunctionsFiles(farmDirectory) {
73531
73644
  const kcLangFetchFunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "kclangfetchfunctions");
73532
- const kcLangFetchFunctions = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(kcLangFetchFunctionsDirectory)) ? (await readdirAsync(kcLangFetchFunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(kcLangFetchFunctionsDirectory, x)) : [];
73645
+ const kcLangFetchFunctions = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_13__.pathExists)(kcLangFetchFunctionsDirectory)) ? (await readdirAsync(kcLangFetchFunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(kcLangFetchFunctionsDirectory, x)) : [];
73533
73646
  return kcLangFetchFunctions;
73534
73647
  }
73535
73648
  async function getLegacyFetchFunctionsFiles(farmDirectory) {
73536
- const legacyFetchFunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_12__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
73649
+ const legacyFetchFunctionsDirectory = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_13__.pathExists)(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions"))) ? path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions") : path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "candy.farm", "legacyfetchfunctions");
73537
73650
  const legacyFetchFunctions = (await readdirAsync(legacyFetchFunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyFetchFunctionsDirectory, x));
73538
73651
  return legacyFetchFunctions;
73539
73652
  }
@@ -73572,7 +73685,7 @@ async function readSugarFiles(formSugarDirectoryPath, references) {
73572
73685
  return result;
73573
73686
  }
73574
73687
  async function readCustomControlsFiles(formSugarDirectoryPath) {
73575
- if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_11__.isDirectoryExists)(formSugarDirectoryPath))) {
73688
+ if (!(await (0,_FsUtils__WEBPACK_IMPORTED_MODULE_12__.isDirectoryExists)(formSugarDirectoryPath))) {
73576
73689
  return {};
73577
73690
  }
73578
73691
  const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default()(formSugarDirectoryPath);
@@ -75463,7 +75576,7 @@ function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression)
75463
75576
  }
75464
75577
  function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
75465
75578
  var _formSchemaRng$getEle;
75466
- return isSetStatement(x) && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
75579
+ return isSetStatement(x) && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isDisableValueAutoInit() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
75467
75580
  }
75468
75581
  function wrapWithArgumentsCondition(expression) {
75469
75582
  const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NoDepsExpression);
@@ -76696,7 +76809,7 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
76696
76809
  const createDisableValueAutoInitRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "disableValueAutoInit"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("true"));
76697
76810
  const ignoredValueSetRuleMapper = x => {
76698
76811
  var _this$formSchemaRng$g;
76699
- return x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement && x.left.valueName === "value" && (_this$formSchemaRng$g = this.formSchemaRng.getElementByPath(x.left.modePath)) !== null && _this$formSchemaRng$g !== void 0 && _this$formSchemaRng$g.isIgnoreForcedValueSet() ? [createValueRuleEmptyRule(x.left.modePath), createDisableValueAutoInitRule(x.left.modePath)] : [x];
76812
+ return x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement && x.left.valueName === "value" && (_this$formSchemaRng$g = this.formSchemaRng.getElementByPath(x.left.modePath)) !== null && _this$formSchemaRng$g !== void 0 && _this$formSchemaRng$g.isDisableValueAutoInit() ? [createValueRuleEmptyRule(x.left.modePath), createDisableValueAutoInitRule(x.left.modePath)] : [x];
76700
76813
  };
76701
76814
  const allFormulaRules = this.formulaRulesBuilder.buildRules();
76702
76815
  const updatedFormulaRules = Iterator.from(allFormulaRules).flatMap(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.isSetStatement)(x) && x.left.valueName === "autoValue" ? [x, createValueRuleFromAutoValueRule(x)] : [x]);
@@ -80392,16 +80505,22 @@ __webpack_require__.r(__webpack_exports__);
80392
80505
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
80393
80506
  /* harmony export */ LinkConverter: () => (/* binding */ LinkConverter)
80394
80507
  /* harmony export */ });
80395
- /* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
80396
- /* harmony import */ var _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../DataDeclarationGenerator/DataDeclarationGenerationContext */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationContext.ts");
80397
- /* harmony import */ var _ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ComponentMarkupBuilder/ComponentMarkupBuilder */ "./Generator/src/generators/markupGenerator/ComponentMarkupBuilder/ComponentMarkupBuilder.ts");
80398
- /* harmony import */ var _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../SugarNodeConverter */ "./Generator/src/generators/markupGenerator/SugarNodeConverter.ts");
80399
- /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
80400
- /* harmony import */ var _Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Typography/Icon/GetIconName */ "./Generator/src/generators/markupGenerator/ElementProcessors/Typography/Icon/GetIconName.ts");
80401
- /* harmony import */ var _SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../SugarNodes/SugarNodeUtils */ "./Generator/src/generators/markupGenerator/SugarNodes/SugarNodeUtils.ts");
80402
- /* harmony import */ var _Common_KCLangRuntimeUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../../../Common/KCLangRuntimeUtils */ "./Common/KCLangRuntimeUtils.ts");
80403
- /* harmony import */ var _common_ConditionUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../common/ConditionUtils */ "./Generator/src/common/ConditionUtils.ts");
80404
- /* harmony import */ var _LinkNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./LinkNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/Action/Link/LinkNode.ts");
80508
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
80509
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__);
80510
+ /* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
80511
+ /* harmony import */ var _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../DataDeclarationGenerator/DataDeclarationGenerationContext */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationContext.ts");
80512
+ /* harmony import */ var _ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ComponentMarkupBuilder/ComponentMarkupBuilder */ "./Generator/src/generators/markupGenerator/ComponentMarkupBuilder/ComponentMarkupBuilder.ts");
80513
+ /* harmony import */ var _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../SugarNodeConverter */ "./Generator/src/generators/markupGenerator/SugarNodeConverter.ts");
80514
+ /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
80515
+ /* harmony import */ var _Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Typography/Icon/GetIconName */ "./Generator/src/generators/markupGenerator/ElementProcessors/Typography/Icon/GetIconName.ts");
80516
+ /* harmony import */ var _SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../SugarNodes/SugarNodeUtils */ "./Generator/src/generators/markupGenerator/SugarNodes/SugarNodeUtils.ts");
80517
+ /* harmony import */ var _Common_KCLangRuntimeUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../../../Common/KCLangRuntimeUtils */ "./Common/KCLangRuntimeUtils.ts");
80518
+ /* harmony import */ var _common_ConditionUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../../common/ConditionUtils */ "./Generator/src/common/ConditionUtils.ts");
80519
+ /* harmony import */ var _Common_ModelPath_ModelPathValidator__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../../../Common/ModelPath/ModelPathValidator */ "./Common/ModelPath/ModelPathValidator.ts");
80520
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
80521
+ /* harmony import */ var _LinkNode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./LinkNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/Action/Link/LinkNode.ts");
80522
+
80523
+
80405
80524
 
80406
80525
 
80407
80526
 
@@ -80412,44 +80531,57 @@ __webpack_require__.r(__webpack_exports__);
80412
80531
 
80413
80532
 
80414
80533
 
80415
- class LinkConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.SugarNodeConverterBase {
80534
+
80535
+ class LinkConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4__.SugarNodeConverterBase {
80416
80536
  static getAcceptNodeClass() {
80417
- return _LinkNode__WEBPACK_IMPORTED_MODULE_9__.LinkNode;
80537
+ return _LinkNode__WEBPACK_IMPORTED_MODULE_12__.LinkNode;
80418
80538
  }
80419
80539
  doBuildDataDeclaration(context) {
80420
- const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_9__.LinkNode);
80421
- return context.mergeDataDeclaration(node.path ? context.addPathDeclEntry(node, [["value", context.initSequenceFactory.takeFromModelOrDefaultValue(node.defaultValue)]]) : _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_1__.emptyDataDeclarationCollection, context.addSpecialFieldsEntry(node, {
80540
+ const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_12__.LinkNode);
80541
+ const nodePath = node.getFullPath();
80542
+ if (!_Common_ModelPath_ModelPathValidator__WEBPACK_IMPORTED_MODULE_10__.ModelPathValidator.validate(nodePath).valid) {
80543
+ // eslint-disable-next-line no-console
80544
+ console.warn(chalk__WEBPACK_IMPORTED_MODULE_0___default().yellow(`WARN: [LinkConverter] Not supported path is used: [${nodePath.toLegacyPath()}]`));
80545
+ return _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_2__.emptyDataDeclarationCollection;
80546
+ }
80547
+ const nodePathWithoutMultiplicity = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_11__.createAbsoluteFromTokens)(nodePath.getPathPartsAsArray().filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_11__.PathTokens.isSimpleToken));
80548
+
80549
+ // Если в Link передали путь, который не матчится со схемой (не совпадают множественность), то игнорируем его
80550
+ if (!nodePath.isEquals(context.adjustPathMultiplicityByScheme(nodePathWithoutMultiplicity))) {
80551
+ return _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_2__.emptyDataDeclarationCollection;
80552
+ }
80553
+ return context.mergeDataDeclaration(node.path ? context.addPathDeclEntry(node, [["value", context.initSequenceFactory.takeFromModelOrDefaultValue(node.defaultValue)]]) : _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_2__.emptyDataDeclarationCollection, context.addSpecialFieldsEntry(node, {
80422
80554
  optional: node.optional
80423
- }), node.path ? context.addPathSectionDeclarationEntry(node) : _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_1__.emptyDataDeclarationCollection, context.addVisibilityPathDeclEntryNew(node));
80555
+ }), node.path ? context.addPathSectionDeclarationEntry(node) : _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_2__.emptyDataDeclarationCollection, context.addVisibilityPathDeclEntryNew(node));
80424
80556
  }
80425
80557
  buildChildrenDataDeclaration(context) {
80426
- const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_9__.LinkNode);
80558
+ const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_12__.LinkNode);
80427
80559
  return context.processChildrenDataDeclaration(node.children);
80428
80560
  }
80429
80561
  *doTraverseChildren() {
80430
- const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_9__.LinkNode);
80562
+ const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_12__.LinkNode);
80431
80563
  yield* node.children;
80432
80564
  }
80433
80565
  doConvert(context) {
80434
- const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_9__.LinkNode);
80566
+ const node = this.getCurrentNodeAs(_LinkNode__WEBPACK_IMPORTED_MODULE_12__.LinkNode);
80435
80567
  if (node.path != undefined && node.onClick == undefined) {
80436
- throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_0__.SugarAttributeReadError(`onClick is required when path attribute specified`, node, "path");
80568
+ throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError(`onClick is required when path attribute specified`, node, "path");
80437
80569
  }
80438
80570
  return node.onClick ? this.getLinkForModelChanging(context, node) : this.getLinkWithHref(context, node);
80439
80571
  }
80440
80572
  getLinkForModelChanging(context, node) {
80441
- const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_2__.componentMarkupBuilder)("Link");
80573
+ const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_3__.componentMarkupBuilder)("Link");
80442
80574
  markupBuilder.prop("data-tid").set(node.tid);
80443
- markupBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getNewBindingPathExpression)(node));
80575
+ markupBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_5__.getNewBindingPathExpression)(node));
80444
80576
  markupBuilder.prop(x => x.onClick).set(context.generateHelperFunctionExpression(node, "onClick", node.onClick));
80445
80577
  markupBuilder.prop(x => x.use).set(node.use);
80446
80578
  markupBuilder.prop(x => x.hint).set(this.getConverterResultFromAttributeWithMarkup(context, node.hint));
80447
80579
  markupBuilder.prop(x => x.metricsId).set(node.metricsId);
80448
- markupBuilder.prop(x => x.icon).set((0,_Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_5__.getIconName)(node, node.icon));
80580
+ markupBuilder.prop(x => x.icon).set((0,_Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_6__.getIconName)(node, node.icon));
80449
80581
  markupBuilder.appendChild(context.convertChildNodes(node.children));
80450
80582
  markupBuilder.prop(x => x.stopPropagation).set(node.stopPropagation);
80451
80583
  if (node.disabled2 != undefined) {
80452
- markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_6__.buildExpressionPropValue)(node.disabled2));
80584
+ markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_7__.buildExpressionPropValue)(node.disabled2));
80453
80585
  }
80454
80586
  if (this.getLegacyNode().getParent() != undefined) {
80455
80587
  if (node.disabled2 != undefined) {
@@ -80459,21 +80591,21 @@ class LinkConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.Sug
80459
80591
  return markupBuilder.buildConverterResult();
80460
80592
  }
80461
80593
  getLinkWithHref(context, node) {
80462
- const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_2__.componentMarkupBuilder)("Link");
80594
+ const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_3__.componentMarkupBuilder)("Link");
80463
80595
  markupBuilder.prop("data-tid").set(node.tid);
80464
80596
  markupBuilder.prop(x => x.href).set(node.href);
80465
80597
  markupBuilder.prop(x => x.target).set("_blank");
80466
80598
  markupBuilder.prop(x => x.use).set(node.use);
80467
80599
  markupBuilder.prop(x => x.hint).set(this.getConverterResultFromAttributeWithMarkup(context, node.hint));
80468
80600
  markupBuilder.prop(x => x.metricsId).set(node.metricsId);
80469
- markupBuilder.prop(x => x.icon).set((0,_Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_5__.getIconName)(node, node.icon));
80601
+ markupBuilder.prop(x => x.icon).set((0,_Typography_Icon_GetIconName__WEBPACK_IMPORTED_MODULE_6__.getIconName)(node, node.icon));
80470
80602
  markupBuilder.prop(x => x.stopPropagation).set(node.stopPropagation);
80471
80603
  if (node.disabled2 != undefined) {
80472
- markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_6__.buildExpressionPropValue)(node.disabled2));
80604
+ markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_7__.buildExpressionPropValue)(node.disabled2));
80473
80605
  }
80474
80606
  if (node.hrefExpression != undefined) {
80475
- const conditionWithDependencies = (0,_common_ConditionUtils__WEBPACK_IMPORTED_MODULE_8__.convertConditionToJsOrFailWithFriendlySugarError)(node.hrefExpression, "path", "count", _Common_KCLangRuntimeUtils__WEBPACK_IMPORTED_MODULE_7__.KCLangRuntimeUtils.kcLangUtilsName, node, "condition");
80476
- markupBuilder.prop(x => x.hrefExpression).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_6__.buildExpressionPropValue)(conditionWithDependencies.condition, conditionWithDependencies.dependencies));
80607
+ const conditionWithDependencies = (0,_common_ConditionUtils__WEBPACK_IMPORTED_MODULE_9__.convertConditionToJsOrFailWithFriendlySugarError)(node.hrefExpression, "path", "count", _Common_KCLangRuntimeUtils__WEBPACK_IMPORTED_MODULE_8__.KCLangRuntimeUtils.kcLangUtilsName, node, "condition");
80608
+ markupBuilder.prop(x => x.hrefExpression).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_7__.buildExpressionPropValue)(conditionWithDependencies.condition, conditionWithDependencies.dependencies));
80477
80609
  }
80478
80610
  if (this.getLegacyNode().getParent() != undefined) {
80479
80611
  if (node.disabled2 != undefined || node.hrefExpression != undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "6.7.0-test-9327.0",
3
+ "version": "6.7.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,