@kontur.candy/generator 4.246.1 → 4.247.0-diadoc.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 +38 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112944,7 +112944,8 @@ class ModelPathBuilder {
112944
112944
  __webpack_require__.r(__webpack_exports__);
112945
112945
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
112946
112946
  /* harmony export */ "Map2": () => (/* binding */ Map2),
112947
- /* harmony export */ "ModelPathMap": () => (/* binding */ ModelPathMap)
112947
+ /* harmony export */ "ModelPathMap": () => (/* binding */ ModelPathMap),
112948
+ /* harmony export */ "AbsoluteModelPathMap": () => (/* binding */ AbsoluteModelPathMap)
112948
112949
  /* harmony export */ });
112949
112950
  /* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
112950
112951
  /* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
@@ -112972,6 +112973,10 @@ class Map2 {
112972
112973
  has(key) {
112973
112974
  return this.getEntryOrUndefined(key) != undefined;
112974
112975
  }
112976
+
112977
+ get isEmpty() {
112978
+ return this.hashMap.size === 0;
112979
+ }
112975
112980
  /**
112976
112981
  * Обновляет значение в словаре по ключю, если значения нет -- устнавит новое
112977
112982
  * @param key ключ словаря для робновления
@@ -113052,6 +113057,22 @@ class ModelPathMap extends Map2 {
113052
113057
  return key.getHash(this.eachCurrentCollision);
113053
113058
  }
113054
113059
 
113060
+ }
113061
+ class AbsoluteModelPathMap extends Map2 {
113062
+ constructor(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_1__.EachCurrentCollision.AreSame) {
113063
+ super();
113064
+ this.eachCurrentCollision = void 0;
113065
+ this.eachCurrentCollision = eachCurrentCollision;
113066
+ }
113067
+
113068
+ areKeyEqual(left, right) {
113069
+ return left.isEquals(right, this.eachCurrentCollision);
113070
+ }
113071
+
113072
+ getKeyHash(key) {
113073
+ return key.getHash(this.eachCurrentCollision);
113074
+ }
113075
+
113055
113076
  }
113056
113077
 
113057
113078
  /***/ }),
@@ -124327,6 +124348,7 @@ function normalizeToArray(value) {
124327
124348
  "use strict";
124328
124349
  __webpack_require__.r(__webpack_exports__);
124329
124350
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
124351
+ /* harmony export */ "getNodeSource": () => (/* binding */ getNodeSource),
124330
124352
  /* harmony export */ "XmlNode": () => (/* binding */ XmlNode),
124331
124353
  /* harmony export */ "ASTNode": () => (/* binding */ ASTNode),
124332
124354
  /* harmony export */ "SugarReadingError": () => (/* binding */ SugarReadingError),
@@ -124339,6 +124361,18 @@ __webpack_require__.r(__webpack_exports__);
124339
124361
 
124340
124362
 
124341
124363
 
124364
+ function getNodeSource(node) {
124365
+ if (node.source == undefined) {
124366
+ return "N/A";
124367
+ }
124368
+
124369
+ try {
124370
+ const sourceLines = node.source.sourceText.split("\n");
124371
+ return sourceLines.slice(node.source.location.start.line - 1, node.source.location.end.line).join("\n");
124372
+ } catch {
124373
+ return "N/A";
124374
+ }
124375
+ }
124342
124376
  class XmlNode {
124343
124377
  constructor(createParams) {
124344
124378
  var _createParams$parent, _createParams$attribu, _createParams$childre;
@@ -128574,6 +128608,8 @@ __webpack_require__.r(__webpack_exports__);
128574
128608
  /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
128575
128609
  /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
128576
128610
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
128611
+ /* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
128612
+
128577
128613
 
128578
128614
 
128579
128615
 
@@ -128620,7 +128656,7 @@ class KCXmlValidationGenerator {
128620
128656
  const target = prefix.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.ModelPath.createFromMask(condition.target, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each));
128621
128657
  const deps = [];
128622
128658
  const compiledExpression = this.compileExpression(prefix, condition.expression, deps);
128623
- return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `)`;
128659
+ return `new ValidationFunction` + `(` + this.modelPathInstance(target) + `,` + `[${deps.map(x => x.toCurrentIteration()).map(x => this.modelPathInstance(x)).join(", ")}]` + `, ` + `context => KCCondition.execute(context, expression => ${compiledExpression}` + `, ` + `() => "${(_condition$descriptio = condition.description) !== null && _condition$descriptio !== void 0 ? _condition$descriptio : "Error Message"}"` + `, ` + `"${(_condition$errorLevel = condition.errorLevel) !== null && _condition$errorLevel !== void 0 ? _condition$errorLevel : "Error"}" )` + `, ` + JSON.stringify((0,_common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_4__.getNodeSource)(condition.sourceXmlNode)) + `)`;
128624
128660
  }
128625
128661
 
128626
128662
  compileExpression(prefix, expression, deps) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.246.1",
3
+ "version": "4.247.0-diadoc.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,