@kontur.candy/generator 4.245.0-nightly.6n6cm → 4.246.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 +163 -821
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113312,7 +113312,11 @@ function ensureNotNullOrUndefined(input) {
|
|
|
113312
113312
|
function noop() {// noop
|
|
113313
113313
|
}
|
|
113314
113314
|
function reject(message) {
|
|
113315
|
-
|
|
113315
|
+
if (typeof message === "string" || message == undefined) {
|
|
113316
|
+
throw new Error(message !== null && message !== void 0 ? message : "Undefined is not allowed");
|
|
113317
|
+
} else {
|
|
113318
|
+
throw message;
|
|
113319
|
+
}
|
|
113316
113320
|
}
|
|
113317
113321
|
function isLengthGreaterThenOrEqual(items, minLength) {
|
|
113318
113322
|
return items.length >= minLength;
|
|
@@ -120490,293 +120494,6 @@ class CompositionOperandContext extends antlr4ts_ParserRuleContext__WEBPACK_IMPO
|
|
|
120490
120494
|
|
|
120491
120495
|
/***/ }),
|
|
120492
120496
|
|
|
120493
|
-
/***/ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts":
|
|
120494
|
-
/*!*****************************************************************!*\
|
|
120495
|
-
!*** ./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts ***!
|
|
120496
|
-
\*****************************************************************/
|
|
120497
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120498
|
-
|
|
120499
|
-
"use strict";
|
|
120500
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120501
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120502
|
-
/* harmony export */ "traverseKCLangExpression": () => (/* binding */ traverseKCLangExpression),
|
|
120503
|
-
/* harmony export */ "DefaultKCLangExpressionVisitor": () => (/* binding */ DefaultKCLangExpressionVisitor)
|
|
120504
|
-
/* harmony export */ });
|
|
120505
|
-
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
120506
|
-
|
|
120507
|
-
// tslint:disable-next-line:cyclomatic-complexity
|
|
120508
|
-
function traverseKCLangExpression(node, visitor) {
|
|
120509
|
-
switch (node.type) {
|
|
120510
|
-
case "cast":
|
|
120511
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120512
|
-
visitor.visitCastExpressionKCLangNode(node);
|
|
120513
|
-
break;
|
|
120514
|
-
|
|
120515
|
-
case "oneof":
|
|
120516
|
-
traverseKCLangExpression(node.testExpression, visitor);
|
|
120517
|
-
visitor.visitOneOfExpressionKCLangNode(node);
|
|
120518
|
-
break;
|
|
120519
|
-
|
|
120520
|
-
case "abs":
|
|
120521
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120522
|
-
visitor.visitAbsKCLangNode(node);
|
|
120523
|
-
break;
|
|
120524
|
-
|
|
120525
|
-
case "xabs":
|
|
120526
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120527
|
-
visitor.visitXAbsKCLangNode(node);
|
|
120528
|
-
break;
|
|
120529
|
-
|
|
120530
|
-
case "exists":
|
|
120531
|
-
visitor.visitExistsKCLangNode(node);
|
|
120532
|
-
break;
|
|
120533
|
-
|
|
120534
|
-
case "length":
|
|
120535
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120536
|
-
visitor.visitLengthKCLangNode(node);
|
|
120537
|
-
break;
|
|
120538
|
-
|
|
120539
|
-
case "and":
|
|
120540
|
-
for (const expression of node.expressions) {
|
|
120541
|
-
traverseKCLangExpression(expression, visitor);
|
|
120542
|
-
}
|
|
120543
|
-
|
|
120544
|
-
visitor.visitAndKCLangNode(node);
|
|
120545
|
-
break;
|
|
120546
|
-
|
|
120547
|
-
case "sum":
|
|
120548
|
-
visitor.visitSumKCLangNode(node);
|
|
120549
|
-
break;
|
|
120550
|
-
|
|
120551
|
-
case "gt":
|
|
120552
|
-
case "ge":
|
|
120553
|
-
case "lt":
|
|
120554
|
-
case "le":
|
|
120555
|
-
case "eq":
|
|
120556
|
-
case "noteq":
|
|
120557
|
-
for (const expression of node.expressions) {
|
|
120558
|
-
traverseKCLangExpression(expression, visitor);
|
|
120559
|
-
}
|
|
120560
|
-
|
|
120561
|
-
visitor.visitComparisonKCLangNode(node);
|
|
120562
|
-
break;
|
|
120563
|
-
|
|
120564
|
-
case "division":
|
|
120565
|
-
case "multiply":
|
|
120566
|
-
for (const expression of node.expressions) {
|
|
120567
|
-
traverseKCLangExpression(expression, visitor);
|
|
120568
|
-
}
|
|
120569
|
-
|
|
120570
|
-
visitor.visitMultiplyKCLangNode(node);
|
|
120571
|
-
break;
|
|
120572
|
-
|
|
120573
|
-
case "minus":
|
|
120574
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120575
|
-
visitor.visitMinusKCLangNode(node);
|
|
120576
|
-
break;
|
|
120577
|
-
|
|
120578
|
-
case "not":
|
|
120579
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120580
|
-
visitor.visitNotKCLangNode(node);
|
|
120581
|
-
break;
|
|
120582
|
-
|
|
120583
|
-
case "round":
|
|
120584
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120585
|
-
visitor.visitRoundKCLangNode(node);
|
|
120586
|
-
break;
|
|
120587
|
-
|
|
120588
|
-
case "choose":
|
|
120589
|
-
traverseKCLangExpression(node.if, visitor);
|
|
120590
|
-
traverseKCLangExpression(node.else, visitor);
|
|
120591
|
-
traverseKCLangExpression(node.then, visitor);
|
|
120592
|
-
visitor.visitChooseKCLangNode(node);
|
|
120593
|
-
break;
|
|
120594
|
-
|
|
120595
|
-
case "const":
|
|
120596
|
-
visitor.visitConstKCLangNode(node);
|
|
120597
|
-
break;
|
|
120598
|
-
|
|
120599
|
-
case "argument":
|
|
120600
|
-
visitor.visitArgumentKCLangNode(node);
|
|
120601
|
-
break;
|
|
120602
|
-
|
|
120603
|
-
case "or":
|
|
120604
|
-
for (const expression of node.expressions) {
|
|
120605
|
-
traverseKCLangExpression(expression, visitor);
|
|
120606
|
-
}
|
|
120607
|
-
|
|
120608
|
-
visitor.visitOrKCLangNode(node);
|
|
120609
|
-
break;
|
|
120610
|
-
|
|
120611
|
-
case "multySum":
|
|
120612
|
-
visitor.visitMultySumKCLangNode(node);
|
|
120613
|
-
break;
|
|
120614
|
-
|
|
120615
|
-
case "substring":
|
|
120616
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120617
|
-
visitor.visitSubstringKCLangNode(node);
|
|
120618
|
-
break;
|
|
120619
|
-
|
|
120620
|
-
case "regexMatch":
|
|
120621
|
-
traverseKCLangExpression(node.expression, visitor);
|
|
120622
|
-
visitor.visitRegexMatchKCLangNode(node);
|
|
120623
|
-
break;
|
|
120624
|
-
|
|
120625
|
-
default:
|
|
120626
|
-
(0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
|
|
120627
|
-
break;
|
|
120628
|
-
}
|
|
120629
|
-
}
|
|
120630
|
-
class DefaultKCLangExpressionVisitor {
|
|
120631
|
-
visitAbsKCLangNode(node) {// default empty implementation
|
|
120632
|
-
}
|
|
120633
|
-
|
|
120634
|
-
visitAndKCLangNode(node) {// default empty implementation
|
|
120635
|
-
}
|
|
120636
|
-
|
|
120637
|
-
visitArgumentKCLangNode(node) {// default empty implementation
|
|
120638
|
-
}
|
|
120639
|
-
|
|
120640
|
-
visitCastExpressionKCLangNode(node) {// default empty implementation
|
|
120641
|
-
}
|
|
120642
|
-
|
|
120643
|
-
visitChooseKCLangNode(node) {// default empty implementation
|
|
120644
|
-
}
|
|
120645
|
-
|
|
120646
|
-
visitComparisonKCLangNode(node) {// default empty implementation
|
|
120647
|
-
}
|
|
120648
|
-
|
|
120649
|
-
visitConstKCLangNode(node) {// default empty implementation
|
|
120650
|
-
}
|
|
120651
|
-
|
|
120652
|
-
visitExistsKCLangNode(node) {// default empty implementation
|
|
120653
|
-
}
|
|
120654
|
-
|
|
120655
|
-
visitLengthKCLangNode(node) {// default empty implementation
|
|
120656
|
-
}
|
|
120657
|
-
|
|
120658
|
-
visitMinusKCLangNode(node) {// default empty implementation
|
|
120659
|
-
}
|
|
120660
|
-
|
|
120661
|
-
visitMultiplyKCLangNode(node) {// default empty implementation
|
|
120662
|
-
}
|
|
120663
|
-
|
|
120664
|
-
visitMultySumKCLangNode(node) {// default empty implementation
|
|
120665
|
-
}
|
|
120666
|
-
|
|
120667
|
-
visitNotKCLangNode(node) {// default empty implementation
|
|
120668
|
-
}
|
|
120669
|
-
|
|
120670
|
-
visitOneOfExpressionKCLangNode(node) {// default empty implementation
|
|
120671
|
-
}
|
|
120672
|
-
|
|
120673
|
-
visitOrKCLangNode(node) {// default empty implementation
|
|
120674
|
-
}
|
|
120675
|
-
|
|
120676
|
-
visitRegexMatchKCLangNode(node) {// default empty implementation
|
|
120677
|
-
}
|
|
120678
|
-
|
|
120679
|
-
visitRoundKCLangNode(node) {// default empty implementation
|
|
120680
|
-
}
|
|
120681
|
-
|
|
120682
|
-
visitSubstringKCLangNode(node) {// default empty implementation
|
|
120683
|
-
}
|
|
120684
|
-
|
|
120685
|
-
visitSumKCLangNode(node) {// default empty implementation
|
|
120686
|
-
}
|
|
120687
|
-
|
|
120688
|
-
visitXAbsKCLangNode(node) {// default empty implementation
|
|
120689
|
-
}
|
|
120690
|
-
|
|
120691
|
-
}
|
|
120692
|
-
|
|
120693
|
-
/***/ }),
|
|
120694
|
-
|
|
120695
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts":
|
|
120696
|
-
/*!*****************************************************************!*\
|
|
120697
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts ***!
|
|
120698
|
-
\*****************************************************************/
|
|
120699
|
-
/***/ ((module) => {
|
|
120700
|
-
|
|
120701
|
-
// this file was prevaled
|
|
120702
|
-
|
|
120703
|
-
/* eslint-disable */
|
|
120704
|
-
// @ts-ignore
|
|
120705
|
-
module.exports = "/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { Text: peg$parseText },\n peg$startRuleFunction = peg$parseText,\n\n peg$c0 = function(items) {\r\n \treturn items.filter(x => x !== \"\");\r\n },\n peg$c1 = \"[\",\n peg$c2 = peg$literalExpectation(\"[\", false),\n peg$c3 = \"]\",\n peg$c4 = peg$literalExpectation(\"]\", false),\n peg$c5 = \"(\",\n peg$c6 = peg$literalExpectation(\"(\", false),\n peg$c7 = \")\",\n peg$c8 = peg$literalExpectation(\")\", false),\n peg$c9 = function(text, src) {\r\n return {\r\n \ttype: \"link\",\r\n text: text,\r\n src: src,\r\n }\r\n },\n peg$c10 = /^[^ \\]\\t\\n\\r]/,\n peg$c11 = peg$classExpectation([\" \", \"]\", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c12 = function(w) { return w.join(\"\") },\n peg$c13 = function(items) {\r\n return items.filter(x => x !== \"\");\r\n },\n peg$c14 = /^[^)]/,\n peg$c15 = peg$classExpectation([\")\"], true, false),\n peg$c16 = function(w) {\r\n \treturn w.join(\"\").trim()\r\n },\n peg$c17 = /^[\\n]/,\n peg$c18 = peg$classExpectation([\"\\n\"], false, false),\n peg$c19 = /^[ \\t\\n\\r]/,\n peg$c20 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], false, false),\n peg$c21 = function() {\r\n \treturn \"\\n\"\r\n },\n peg$c22 = /^[^ \\t\\n\\r]/,\n peg$c23 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c24 = function(w) {\r\n \treturn w.join(\"\");\r\n },\n peg$c25 = function() {\r\n \treturn \"\";\r\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parseText() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLink() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseLinkText();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 40) {\n s4 = peg$c5;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c6); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseLinkSrc();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s6 = peg$c7;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9(s2, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseLinkText() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c13(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLinkSrc() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseNewLine() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s1 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseWord() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c25();\n }\n s0 = s1;\n\n return s0;\n }\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n})()";
|
|
120706
|
-
|
|
120707
|
-
/***/ }),
|
|
120708
|
-
|
|
120709
|
-
/***/ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts":
|
|
120710
|
-
/*!****************************************************************!*\
|
|
120711
|
-
!*** ./Generator/src/common/KCLang/KCLangDescriptionParser.ts ***!
|
|
120712
|
-
\****************************************************************/
|
|
120713
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120714
|
-
|
|
120715
|
-
"use strict";
|
|
120716
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120717
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120718
|
-
/* harmony export */ "KCLangDescriptionParser": () => (/* binding */ KCLangDescriptionParser)
|
|
120719
|
-
/* harmony export */ });
|
|
120720
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KCLangDescriptionGrammar */ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts");
|
|
120721
|
-
/* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__);
|
|
120722
|
-
// @ts-ignore
|
|
120723
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
120724
|
-
|
|
120725
|
-
const evalParse = eval((_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default())).parse;
|
|
120726
|
-
class KCLangDescriptionParser {
|
|
120727
|
-
static getOrCreateParser() {
|
|
120728
|
-
return evalParse;
|
|
120729
|
-
}
|
|
120730
|
-
|
|
120731
|
-
static parse(code) {
|
|
120732
|
-
const parser = this.getOrCreateParser();
|
|
120733
|
-
return parser(code);
|
|
120734
|
-
}
|
|
120735
|
-
|
|
120736
|
-
}
|
|
120737
|
-
|
|
120738
|
-
/***/ }),
|
|
120739
|
-
|
|
120740
|
-
/***/ "./Generator/src/common/KCLang/KCLangNodes.ts":
|
|
120741
|
-
/*!****************************************************!*\
|
|
120742
|
-
!*** ./Generator/src/common/KCLang/KCLangNodes.ts ***!
|
|
120743
|
-
\****************************************************/
|
|
120744
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
120745
|
-
|
|
120746
|
-
"use strict";
|
|
120747
|
-
__webpack_require__.r(__webpack_exports__);
|
|
120748
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120749
|
-
/* harmony export */ "isFormulaStatement": () => (/* binding */ isFormulaStatement),
|
|
120750
|
-
/* harmony export */ "isBlockStatement": () => (/* binding */ isBlockStatement),
|
|
120751
|
-
/* harmony export */ "isEnsureStatement": () => (/* binding */ isEnsureStatement),
|
|
120752
|
-
/* harmony export */ "isConditionalStatement": () => (/* binding */ isConditionalStatement),
|
|
120753
|
-
/* harmony export */ "isDescribeStatement": () => (/* binding */ isDescribeStatement),
|
|
120754
|
-
/* harmony export */ "andKCLangNode": () => (/* binding */ andKCLangNode)
|
|
120755
|
-
/* harmony export */ });
|
|
120756
|
-
function isFormulaStatement(node) {
|
|
120757
|
-
return node.type === "formula";
|
|
120758
|
-
}
|
|
120759
|
-
function isBlockStatement(node) {
|
|
120760
|
-
return node.type === "block";
|
|
120761
|
-
}
|
|
120762
|
-
function isEnsureStatement(node) {
|
|
120763
|
-
return node.type === "ensure";
|
|
120764
|
-
}
|
|
120765
|
-
function isConditionalStatement(node) {
|
|
120766
|
-
return node.type === "if";
|
|
120767
|
-
}
|
|
120768
|
-
function isDescribeStatement(node) {
|
|
120769
|
-
return node.type === "describe";
|
|
120770
|
-
}
|
|
120771
|
-
function andKCLangNode(...expressions) {
|
|
120772
|
-
return {
|
|
120773
|
-
type: "and",
|
|
120774
|
-
expressions: expressions
|
|
120775
|
-
};
|
|
120776
|
-
}
|
|
120777
|
-
|
|
120778
|
-
/***/ }),
|
|
120779
|
-
|
|
120780
120497
|
/***/ "./Generator/src/common/KCLang/KCLangToJsTranspiler.ts":
|
|
120781
120498
|
/*!*************************************************************!*\
|
|
120782
120499
|
!*** ./Generator/src/common/KCLang/KCLangToJsTranspiler.ts ***!
|
|
@@ -121074,345 +120791,6 @@ class KCLangToJsTranspiler {
|
|
|
121074
120791
|
|
|
121075
120792
|
/***/ }),
|
|
121076
120793
|
|
|
121077
|
-
/***/ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts":
|
|
121078
|
-
/*!**************************************************************!*\
|
|
121079
|
-
!*** ./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts ***!
|
|
121080
|
-
\**************************************************************/
|
|
121081
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
121082
|
-
|
|
121083
|
-
"use strict";
|
|
121084
|
-
__webpack_require__.r(__webpack_exports__);
|
|
121085
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
121086
|
-
/* harmony export */ "KCLangToXmlTranspiler": () => (/* binding */ KCLangToXmlTranspiler),
|
|
121087
|
-
/* harmony export */ "kclang": () => (/* binding */ kclang)
|
|
121088
|
-
/* harmony export */ });
|
|
121089
|
-
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
121090
|
-
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
121091
|
-
/* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
|
|
121092
|
-
/* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
|
|
121093
|
-
/* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
|
|
121094
|
-
/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "./Generator/src/common/KCLang/Utils.ts");
|
|
121095
|
-
/* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
|
|
121096
|
-
|
|
121097
|
-
|
|
121098
|
-
|
|
121099
|
-
|
|
121100
|
-
|
|
121101
|
-
|
|
121102
|
-
// tslint:disable-next-line:cyclomatic-complexity
|
|
121103
|
-
|
|
121104
|
-
function generateKCXmlExpression(expression) {
|
|
121105
|
-
switch (expression.type) {
|
|
121106
|
-
case "abs":
|
|
121107
|
-
case "xabs":
|
|
121108
|
-
case "length":
|
|
121109
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
|
|
121110
|
-
|
|
121111
|
-
case "exists":
|
|
121112
|
-
case "multySum":
|
|
121113
|
-
return `<m:${expression.type} select="${expression.select}" />`;
|
|
121114
|
-
|
|
121115
|
-
case "cast":
|
|
121116
|
-
if (expression.expression.type === "argument") {
|
|
121117
|
-
return `<m:argument select="${expression.expression.select}" type="${expression.targetType}" />`;
|
|
121118
|
-
}
|
|
121119
|
-
|
|
121120
|
-
throw new Error("Cast supports only for argument");
|
|
121121
|
-
|
|
121122
|
-
case "and":
|
|
121123
|
-
case "or":
|
|
121124
|
-
return [`<m:${expression.type}>`, ...expression.expressions.map(generateKCXmlExpression).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:${expression.type}>`].join("\n");
|
|
121125
|
-
|
|
121126
|
-
case "sum":
|
|
121127
|
-
return [`<m:sum>`, ...expression.operands.map(operand => {
|
|
121128
|
-
if (operand.operator === "+") {
|
|
121129
|
-
return generateKCXmlExpression(operand.expression);
|
|
121130
|
-
}
|
|
121131
|
-
|
|
121132
|
-
return [`<m:minus>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(operand.expression), 1), `</m:minus>`].join("\n");
|
|
121133
|
-
}).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:sum>`].join("\n");
|
|
121134
|
-
|
|
121135
|
-
case "gt":
|
|
121136
|
-
case "ge":
|
|
121137
|
-
case "lt":
|
|
121138
|
-
case "le":
|
|
121139
|
-
case "eq":
|
|
121140
|
-
case "multiply":
|
|
121141
|
-
case "division":
|
|
121142
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 1), `</m:${expression.type}>`].join("\n");
|
|
121143
|
-
|
|
121144
|
-
case "noteq":
|
|
121145
|
-
return [`<m:not>`, ` <m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 2), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 2), ` </m:eq>`, `</m:not>`].join("\n");
|
|
121146
|
-
|
|
121147
|
-
case "minus":
|
|
121148
|
-
case "not":
|
|
121149
|
-
return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
|
|
121150
|
-
break;
|
|
121151
|
-
break;
|
|
121152
|
-
|
|
121153
|
-
case "round":
|
|
121154
|
-
return [expression.fractionalDigits != undefined ? `<m:round fractionalDigits="${expression.fractionalDigits}">` : `<m:round>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:round>`].join("\n");
|
|
121155
|
-
|
|
121156
|
-
case "substring":
|
|
121157
|
-
return [expression.length != undefined ? `<m:substring start="${expression.start}" length="${expression.length}">` : `<m:substring start="${expression.start}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:substring>`].join("\n");
|
|
121158
|
-
|
|
121159
|
-
case "regexMatch":
|
|
121160
|
-
return [`<m:regexMatch pattern="${expression.pattern}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:regexMatch>`].join("\n");
|
|
121161
|
-
|
|
121162
|
-
case "choose":
|
|
121163
|
-
return [`<m:choose>`, ` <m:if>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.if), 2), ` </m:if>`, ` <m:then>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.then), 2), ` </m:then>`, ` <m:else>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.else), 2), ` </m:else>`, `</m:choose>`].join("\n");
|
|
121164
|
-
break;
|
|
121165
|
-
|
|
121166
|
-
case "const":
|
|
121167
|
-
if (expression.value.type === "decimal") {
|
|
121168
|
-
return `<m:const value="${expression.value.value}" type="decimal" />`;
|
|
121169
|
-
}
|
|
121170
|
-
|
|
121171
|
-
if (expression.value.type === "string") {
|
|
121172
|
-
return `<m:const value="${expression.value.value}" type="string" />`;
|
|
121173
|
-
}
|
|
121174
|
-
|
|
121175
|
-
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_0__.NotImplementedError();
|
|
121176
|
-
|
|
121177
|
-
case "argument":
|
|
121178
|
-
return `<m:argument select="${expression.select}" />`;
|
|
121179
|
-
|
|
121180
|
-
case "oneof":
|
|
121181
|
-
{
|
|
121182
|
-
const testExpr = generateKCXmlExpression(expression.testExpression);
|
|
121183
|
-
return [`<m:or>`, ...expression.expressions.items.map(x => [`<m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(testExpr, 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(x), 1), `</m:eq>`]).flat().map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:or>`].join("\n");
|
|
121184
|
-
}
|
|
121185
|
-
|
|
121186
|
-
default:
|
|
121187
|
-
// @ts-ignore
|
|
121188
|
-
throw new Error(`Expression of type '${expression.type}' is not supported`);
|
|
121189
|
-
}
|
|
121190
|
-
}
|
|
121191
|
-
|
|
121192
|
-
function formatDescribeStatement(ast, matchPath, describe) {
|
|
121193
|
-
return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__.KCLangDescriptionParser.parse(describe.text).map(item => {
|
|
121194
|
-
if (typeof item === "string") {
|
|
121195
|
-
return item;
|
|
121196
|
-
} else {
|
|
121197
|
-
return `{{link ref=${item.src}}}${item.text.join(" ")}{{/link}}`;
|
|
121198
|
-
}
|
|
121199
|
-
}).join(" ");
|
|
121200
|
-
}
|
|
121201
|
-
|
|
121202
|
-
function generateKCXmlFormula(ast, matchPath, describe) {
|
|
121203
|
-
const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
|
|
121204
|
-
return `<m:formula match="${matchPath}" target="${ast.target}"${descriptionAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:formula>`;
|
|
121205
|
-
}
|
|
121206
|
-
|
|
121207
|
-
function removeTrailingSlash(inputStr) {
|
|
121208
|
-
if (inputStr.endsWith("/")) {
|
|
121209
|
-
return inputStr.substring(0, inputStr.length - 1);
|
|
121210
|
-
}
|
|
121211
|
-
|
|
121212
|
-
return inputStr;
|
|
121213
|
-
}
|
|
121214
|
-
|
|
121215
|
-
function joinPaths(paths) {
|
|
121216
|
-
return paths.map(removeTrailingSlash).join("/");
|
|
121217
|
-
}
|
|
121218
|
-
|
|
121219
|
-
function generateBlockKCXmlFormulas(block, parents) {
|
|
121220
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
|
|
121221
|
-
const result = [];
|
|
121222
|
-
let lastDescribeStatement;
|
|
121223
|
-
|
|
121224
|
-
for (const statement of block.statements) {
|
|
121225
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
|
|
121226
|
-
result.push(generateKCXmlFormula(statement, matchPath, lastDescribeStatement));
|
|
121227
|
-
lastDescribeStatement = undefined;
|
|
121228
|
-
}
|
|
121229
|
-
|
|
121230
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
|
|
121231
|
-
lastDescribeStatement = undefined;
|
|
121232
|
-
}
|
|
121233
|
-
|
|
121234
|
-
if (lastDescribeStatement != undefined) {
|
|
121235
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121236
|
-
}
|
|
121237
|
-
|
|
121238
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
|
|
121239
|
-
lastDescribeStatement = statement;
|
|
121240
|
-
}
|
|
121241
|
-
|
|
121242
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
|
|
121243
|
-
result.push(generateBlockKCXmlFormulas(statement, [...(parents !== null && parents !== void 0 ? parents : []), block]));
|
|
121244
|
-
}
|
|
121245
|
-
}
|
|
121246
|
-
|
|
121247
|
-
return result.join("\n");
|
|
121248
|
-
}
|
|
121249
|
-
|
|
121250
|
-
function guessConditionTarget(condition) {
|
|
121251
|
-
let result;
|
|
121252
|
-
|
|
121253
|
-
class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.DefaultKCLangExpressionVisitor {
|
|
121254
|
-
visitExistsKCLangNode(node) {
|
|
121255
|
-
if (result == undefined) {
|
|
121256
|
-
result = node.select;
|
|
121257
|
-
}
|
|
121258
|
-
}
|
|
121259
|
-
|
|
121260
|
-
visitArgumentKCLangNode(node) {
|
|
121261
|
-
if (result == undefined) {
|
|
121262
|
-
result = node.select;
|
|
121263
|
-
}
|
|
121264
|
-
}
|
|
121265
|
-
|
|
121266
|
-
}
|
|
121267
|
-
|
|
121268
|
-
(0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
|
|
121269
|
-
return result;
|
|
121270
|
-
}
|
|
121271
|
-
|
|
121272
|
-
function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
|
|
121273
|
-
const levelAttr = ast.level === "error" ? ` errorLevel="Error"` : "";
|
|
121274
|
-
const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
|
|
121275
|
-
const guessedTarget = guessConditionTarget(ast);
|
|
121276
|
-
const targetAttr = guessedTarget != undefined ? ` target="${guessedTarget}"` : "";
|
|
121277
|
-
|
|
121278
|
-
if (parentConditions != undefined && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.arrayIsNotEmpty)(parentConditions)) {
|
|
121279
|
-
var _parentConditions$map;
|
|
121280
|
-
|
|
121281
|
-
const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
|
|
121282
|
-
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + ` <m:when>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(condition), 2) + "\n" + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 2) + "\n" + ` </m:when>\n` + `</m:condition>`;
|
|
121283
|
-
}
|
|
121284
|
-
|
|
121285
|
-
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:condition>`;
|
|
121286
|
-
}
|
|
121287
|
-
|
|
121288
|
-
function generateBlockKCXmlConditions(block, parents, parentConditions) {
|
|
121289
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
|
|
121290
|
-
const result = [];
|
|
121291
|
-
let lastDescribeStatement;
|
|
121292
|
-
|
|
121293
|
-
for (const statement of block.statements) {
|
|
121294
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
|
|
121295
|
-
lastDescribeStatement = undefined;
|
|
121296
|
-
}
|
|
121297
|
-
|
|
121298
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
|
|
121299
|
-
result.push(generateKCXmlCondition(statement, matchPath, parentConditions, lastDescribeStatement));
|
|
121300
|
-
lastDescribeStatement = undefined;
|
|
121301
|
-
}
|
|
121302
|
-
|
|
121303
|
-
if (lastDescribeStatement != undefined) {
|
|
121304
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121305
|
-
}
|
|
121306
|
-
|
|
121307
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
|
|
121308
|
-
lastDescribeStatement = statement;
|
|
121309
|
-
}
|
|
121310
|
-
|
|
121311
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(statement)) {
|
|
121312
|
-
result.push(generateConditionalConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
121313
|
-
}
|
|
121314
|
-
|
|
121315
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
|
|
121316
|
-
result.push(generateBlockKCXmlConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
121317
|
-
}
|
|
121318
|
-
}
|
|
121319
|
-
|
|
121320
|
-
return result.join("\n");
|
|
121321
|
-
}
|
|
121322
|
-
|
|
121323
|
-
function generateConditionalConditions(conditionalStatement, parents, parentConditions) {
|
|
121324
|
-
const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path)]);
|
|
121325
|
-
const result = [];
|
|
121326
|
-
let lastDescribeStatement;
|
|
121327
|
-
|
|
121328
|
-
for (const x of conditionalStatement.statements) {
|
|
121329
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(x)) {
|
|
121330
|
-
result.push(generateKCXmlCondition(x, matchPath, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement], lastDescribeStatement));
|
|
121331
|
-
lastDescribeStatement = undefined;
|
|
121332
|
-
}
|
|
121333
|
-
|
|
121334
|
-
if (lastDescribeStatement != undefined) {
|
|
121335
|
-
throw new Error("Describe should be placed before assign of ensure statements");
|
|
121336
|
-
}
|
|
121337
|
-
|
|
121338
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(x)) {
|
|
121339
|
-
lastDescribeStatement = x;
|
|
121340
|
-
}
|
|
121341
|
-
|
|
121342
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(x)) {
|
|
121343
|
-
result.push(generateConditionalConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
121344
|
-
}
|
|
121345
|
-
|
|
121346
|
-
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(x)) {
|
|
121347
|
-
result.push(generateBlockKCXmlConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
121348
|
-
}
|
|
121349
|
-
}
|
|
121350
|
-
|
|
121351
|
-
return result.join("\n");
|
|
121352
|
-
}
|
|
121353
|
-
|
|
121354
|
-
function generateKCXmlFormulas(blocks) {
|
|
121355
|
-
const formulas = Iterator.from(blocks).map(generateBlockKCXmlFormulas).toArray();
|
|
121356
|
-
|
|
121357
|
-
if (formulas.filter(x => x !== "").length > 0) {
|
|
121358
|
-
return `<m:formulas>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(formulas.join("\n"), 1) + "\n" + `</m:formulas>\n`;
|
|
121359
|
-
} else {
|
|
121360
|
-
return "";
|
|
121361
|
-
}
|
|
121362
|
-
}
|
|
121363
|
-
|
|
121364
|
-
function generateKCXmlConditions(blocks) {
|
|
121365
|
-
const conditions = Iterator.from(blocks).map(generateBlockKCXmlConditions).toArray();
|
|
121366
|
-
|
|
121367
|
-
if (conditions.filter(x => x !== "").length > 0) {
|
|
121368
|
-
return `<m:conditions>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(conditions.join("\n"), 1) + "\n" + `</m:conditions>\n`;
|
|
121369
|
-
} else {
|
|
121370
|
-
return "";
|
|
121371
|
-
}
|
|
121372
|
-
}
|
|
121373
|
-
|
|
121374
|
-
function generateKCXml(blocks) {
|
|
121375
|
-
return `<?xml version="1.0" encoding="utf-8"?>\n` + `<m:math xmlns:m="http://www.kontur-extern.ru/ФНС 4.0/math.xsd">\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlFormulas(blocks), 1) + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlConditions(blocks), 1) + `</m:math>`;
|
|
121376
|
-
}
|
|
121377
|
-
|
|
121378
|
-
class KCLangToXmlTranspiler {
|
|
121379
|
-
static transpile(kcLang, customParser) {
|
|
121380
|
-
const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__.KCLangAntlrParser.parse;
|
|
121381
|
-
const kcxml = generateKCXml(parser(kcLang).blocks);
|
|
121382
|
-
return kcxml;
|
|
121383
|
-
}
|
|
121384
|
-
|
|
121385
|
-
}
|
|
121386
|
-
function kclang(str) {
|
|
121387
|
-
return KCLangToXmlTranspiler.transpile(str.join(""));
|
|
121388
|
-
}
|
|
121389
|
-
|
|
121390
|
-
/***/ }),
|
|
121391
|
-
|
|
121392
|
-
/***/ "./Generator/src/common/KCLang/Utils.ts":
|
|
121393
|
-
/*!**********************************************!*\
|
|
121394
|
-
!*** ./Generator/src/common/KCLang/Utils.ts ***!
|
|
121395
|
-
\**********************************************/
|
|
121396
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
121397
|
-
|
|
121398
|
-
"use strict";
|
|
121399
|
-
__webpack_require__.r(__webpack_exports__);
|
|
121400
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
121401
|
-
/* harmony export */ "indent": () => (/* binding */ indent)
|
|
121402
|
-
/* harmony export */ });
|
|
121403
|
-
function indent(str, count) {
|
|
121404
|
-
const indentStr = new Array(count * 2).fill(" ").join("");
|
|
121405
|
-
return str.split("\n").map(x => {
|
|
121406
|
-
if (x === "") {
|
|
121407
|
-
return x;
|
|
121408
|
-
}
|
|
121409
|
-
|
|
121410
|
-
return indentStr + x;
|
|
121411
|
-
}).join("\n");
|
|
121412
|
-
}
|
|
121413
|
-
|
|
121414
|
-
/***/ }),
|
|
121415
|
-
|
|
121416
120794
|
/***/ "./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts":
|
|
121417
120795
|
/*!*********************************************************************************!*\
|
|
121418
120796
|
!*** ./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts ***!
|
|
@@ -126806,7 +126184,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
126806
126184
|
|
|
126807
126185
|
|
|
126808
126186
|
class FormulasAutoCalculationsGenerator {
|
|
126809
|
-
generate(
|
|
126187
|
+
generate(formulaContainer, schemaRng, dataDeclarationHelper) {
|
|
126188
|
+
const formulas = formulaContainer.formulas == undefined || formulaContainer.formulas.items == undefined ? [] : formulaContainer.formulas.items;
|
|
126810
126189
|
const formulaAutoCalculations = formulas.map(formula => this.buildFormulaAutoCalculation(formula, schemaRng, dataDeclarationHelper)).flat();
|
|
126811
126190
|
return this.mergeFormulaAutoCalculations(formulaAutoCalculations);
|
|
126812
126191
|
}
|
|
@@ -127536,73 +126915,35 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
127536
126915
|
/* harmony export */ });
|
|
127537
126916
|
/* harmony import */ var _common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../common/XmlParser/XmlParser */ "./Generator/src/common/XmlParser/XmlParser.ts");
|
|
127538
126917
|
/* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
|
|
127539
|
-
/* harmony import */ var
|
|
127540
|
-
/* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
|
|
127541
|
-
|
|
126918
|
+
/* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
|
|
127542
126919
|
|
|
127543
126920
|
|
|
127544
126921
|
|
|
127545
126922
|
class FormulaReader {
|
|
127546
|
-
readFormulas(
|
|
126923
|
+
readFormulas(kcxmlSource) {
|
|
127547
126924
|
const serializer = this.createFormulaSerializer();
|
|
127548
|
-
const result =
|
|
127549
|
-
|
|
127550
|
-
for (const kcxmlSource of kcxmlSources) {
|
|
127551
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
127552
|
-
|
|
127553
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127554
|
-
var _rootNode$formulas$it, _rootNode$formulas;
|
|
127555
|
-
|
|
127556
|
-
result.push(...((_rootNode$formulas$it = (_rootNode$formulas = rootNode.formulas) === null || _rootNode$formulas === void 0 ? void 0 : _rootNode$formulas.items) !== null && _rootNode$formulas$it !== void 0 ? _rootNode$formulas$it : []));
|
|
127557
|
-
}
|
|
127558
|
-
}
|
|
126925
|
+
const result = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
127559
126926
|
|
|
127560
|
-
|
|
127561
|
-
|
|
127562
|
-
|
|
127563
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127564
|
-
var _rootNode$formulas$it2, _rootNode$formulas2;
|
|
127565
|
-
|
|
127566
|
-
result.push(...((_rootNode$formulas$it2 = (_rootNode$formulas2 = rootNode.formulas) === null || _rootNode$formulas2 === void 0 ? void 0 : _rootNode$formulas2.items) !== null && _rootNode$formulas$it2 !== void 0 ? _rootNode$formulas$it2 : []));
|
|
127567
|
-
}
|
|
126927
|
+
if (result instanceof _Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent) {
|
|
126928
|
+
return this.createEmptyMathContainer();
|
|
127568
126929
|
}
|
|
127569
126930
|
|
|
127570
126931
|
return result;
|
|
127571
126932
|
}
|
|
127572
126933
|
|
|
127573
|
-
|
|
127574
|
-
const
|
|
127575
|
-
|
|
127576
|
-
|
|
127577
|
-
|
|
127578
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
|
|
127579
|
-
|
|
127580
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127581
|
-
var _rootNode$conditions$, _rootNode$conditions;
|
|
127582
|
-
|
|
127583
|
-
result.push(...((_rootNode$conditions$ = (_rootNode$conditions = rootNode.conditions) === null || _rootNode$conditions === void 0 ? void 0 : _rootNode$conditions.items) !== null && _rootNode$conditions$ !== void 0 ? _rootNode$conditions$ : []));
|
|
127584
|
-
}
|
|
127585
|
-
}
|
|
127586
|
-
|
|
127587
|
-
for (const kclangSource of kclangSources) {
|
|
127588
|
-
const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__.KCLangToXmlTranspiler.transpile(kclangSource)));
|
|
127589
|
-
|
|
127590
|
-
if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
|
|
127591
|
-
var _rootNode$conditions$2, _rootNode$conditions2;
|
|
127592
|
-
|
|
127593
|
-
result.push(...((_rootNode$conditions$2 = (_rootNode$conditions2 = rootNode.conditions) === null || _rootNode$conditions2 === void 0 ? void 0 : _rootNode$conditions2.items) !== null && _rootNode$conditions$2 !== void 0 ? _rootNode$conditions$2 : []));
|
|
127594
|
-
}
|
|
127595
|
-
}
|
|
127596
|
-
|
|
127597
|
-
return result;
|
|
126934
|
+
createEmptyMathContainer() {
|
|
126935
|
+
const mathContainer = new _Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer();
|
|
126936
|
+
mathContainer.formulas = new _Formula__WEBPACK_IMPORTED_MODULE_2__.Formulas();
|
|
126937
|
+
mathContainer.formulas.items = [];
|
|
126938
|
+
return mathContainer;
|
|
127598
126939
|
}
|
|
127599
126940
|
|
|
127600
126941
|
createFormulaSerializer() {
|
|
127601
126942
|
const result = new _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.SugarSerializer();
|
|
127602
|
-
result.registerNode(
|
|
127603
|
-
result.registerNode(
|
|
126943
|
+
result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent);
|
|
126944
|
+
result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer);
|
|
127604
126945
|
|
|
127605
|
-
for (const formulaExpression of
|
|
126946
|
+
for (const formulaExpression of _Formula__WEBPACK_IMPORTED_MODULE_2__.formulaExpressions) {
|
|
127606
126947
|
result.registerNode(formulaExpression);
|
|
127607
126948
|
}
|
|
127608
126949
|
|
|
@@ -127902,8 +127243,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
127902
127243
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
127903
127244
|
/* harmony import */ var _markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../markupGenerator/getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
127904
127245
|
/* harmony import */ var _markupGenerator_ElementProcessors_FormParts_Page_PageNode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../markupGenerator/ElementProcessors/FormParts/Page/PageNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Page/PageNode.ts");
|
|
127905
|
-
/* harmony import */ var _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/SchemaRng/FormSchemaRng */ "./Generator/src/common/SchemaRng/FormSchemaRng.ts");
|
|
127906
|
-
|
|
127907
127246
|
|
|
127908
127247
|
|
|
127909
127248
|
|
|
@@ -127923,10 +127262,8 @@ var RequisiteSectionMode;
|
|
|
127923
127262
|
|
|
127924
127263
|
const emptyDataDeclarationCollection = {};
|
|
127925
127264
|
class DataDeclarationGenerationContext {
|
|
127926
|
-
constructor(initSequenceFactory, controlCustomizationContext, typesRegistry
|
|
127265
|
+
constructor(initSequenceFactory, controlCustomizationContext, typesRegistry) {
|
|
127927
127266
|
this.initSequenceFactory = void 0;
|
|
127928
|
-
this.formSchemaRng = void 0;
|
|
127929
|
-
this.schemeValidations = void 0;
|
|
127930
127267
|
this.controlCustomizationContext = void 0;
|
|
127931
127268
|
this.typesRegistry = void 0;
|
|
127932
127269
|
|
|
@@ -127956,29 +127293,11 @@ class DataDeclarationGenerationContext {
|
|
|
127956
127293
|
return undefined;
|
|
127957
127294
|
};
|
|
127958
127295
|
|
|
127959
|
-
this.formSchemaRng = formSchemaRng;
|
|
127960
|
-
this.schemeValidations = schemeValidations;
|
|
127961
127296
|
this.initSequenceFactory = initSequenceFactory;
|
|
127962
127297
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
127963
127298
|
this.typesRegistry = typesRegistry;
|
|
127964
127299
|
}
|
|
127965
127300
|
|
|
127966
|
-
isMultipleNodeOptionalFromScheme(path) {
|
|
127967
|
-
if (!this.schemeValidations) {
|
|
127968
|
-
return undefined;
|
|
127969
|
-
}
|
|
127970
|
-
|
|
127971
|
-
const schemaNode = this.formSchemaRng.getElementByPath(path);
|
|
127972
|
-
|
|
127973
|
-
if (schemaNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__.FormSchemaRngElement) {
|
|
127974
|
-
var _schemaNode$optional;
|
|
127975
|
-
|
|
127976
|
-
return (_schemaNode$optional = schemaNode.optional) !== null && _schemaNode$optional !== void 0 ? _schemaNode$optional : false;
|
|
127977
|
-
}
|
|
127978
|
-
|
|
127979
|
-
return undefined;
|
|
127980
|
-
}
|
|
127981
|
-
|
|
127982
127301
|
getTypeNode(node) {
|
|
127983
127302
|
if (node.anonymousType != undefined) {
|
|
127984
127303
|
return node.anonymousType;
|
|
@@ -128287,15 +127606,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
128287
127606
|
|
|
128288
127607
|
|
|
128289
127608
|
class DataDeclarationGenerator {
|
|
128290
|
-
constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry
|
|
127609
|
+
constructor(sugarRoot, initSequenceFactory, controlCustomizationContext, typesRegistry) {
|
|
128291
127610
|
this.sugarRoot = void 0;
|
|
128292
127611
|
this.initSequenceFactory = void 0;
|
|
128293
|
-
this.formSchemaRng = void 0;
|
|
128294
|
-
this.schemeValidations = void 0;
|
|
128295
127612
|
this.controlCustomizationContext = void 0;
|
|
128296
127613
|
this.typesRegistry = void 0;
|
|
128297
|
-
this.formSchemaRng = formSchemaRng;
|
|
128298
|
-
this.schemeValidations = schemeValidations;
|
|
128299
127614
|
this.sugarRoot = sugarRoot;
|
|
128300
127615
|
this.initSequenceFactory = initSequenceFactory;
|
|
128301
127616
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -128307,7 +127622,7 @@ class DataDeclarationGenerator {
|
|
|
128307
127622
|
|
|
128308
127623
|
const converterClass = (_getConverterByNodeCl = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_4__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.getNodeClass)(this.sugarRoot))) !== null && _getConverterByNodeCl !== void 0 ? _getConverterByNodeCl : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
|
|
128309
127624
|
const converter = new converterClass(this.sugarRoot);
|
|
128310
|
-
const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry
|
|
127625
|
+
const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
|
|
128311
127626
|
const dataDeclaration = converter.buildDataDeclaration(context);
|
|
128312
127627
|
const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
|
|
128313
127628
|
const result = this.replaceHolder(`
|
|
@@ -128341,7 +127656,7 @@ class DataDeclarationGenerator {
|
|
|
128341
127656
|
|
|
128342
127657
|
const converterClass = (_getConverterByNodeCl2 = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_4__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.getNodeClass)(this.sugarRoot))) !== null && _getConverterByNodeCl2 !== void 0 ? _getConverterByNodeCl2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_5__.reject)();
|
|
128343
127658
|
const converter = new converterClass(this.sugarRoot);
|
|
128344
|
-
const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry
|
|
127659
|
+
const context = new _DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_7__.DataDeclarationGenerationContext(this.initSequenceFactory, this.controlCustomizationContext, this.typesRegistry);
|
|
128345
127660
|
const dataDeclaration = converter.buildDataDeclaration(context);
|
|
128346
127661
|
const orderedDataDeclaration = this.sortDataDeclarationKeys(dataDeclaration);
|
|
128347
127662
|
return `
|
|
@@ -129069,26 +128384,47 @@ const gfv = '${gfv}'
|
|
|
129069
128384
|
const resourcesHash = ${JSON.stringify(resourcesHash)}
|
|
129070
128385
|
|
|
129071
128386
|
window.CF.entryPoint = window.CF.entryPoint || {};
|
|
129072
|
-
window.CF.entryPoint[gfv]
|
|
129073
|
-
const
|
|
129074
|
-
|
|
129075
|
-
|
|
129076
|
-
|
|
129077
|
-
|
|
129078
|
-
|
|
129079
|
-
|
|
129080
|
-
|
|
129081
|
-
|
|
129082
|
-
settings: {
|
|
129083
|
-
...defaultSettings,
|
|
129084
|
-
...settings,
|
|
129085
|
-
isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
|
|
129086
|
-
isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
|
|
129087
|
-
isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
|
|
129088
|
-
}
|
|
128387
|
+
if (window.CF.entryPoint[gfv]) {
|
|
128388
|
+
for (const instance of window.CF.entryPoint[gfv].instances) {
|
|
128389
|
+
const resources = {
|
|
128390
|
+
dataDeclaration: dataDeclaration,
|
|
128391
|
+
calculationFunctions: calculationFunctions,
|
|
128392
|
+
validationFunctions: validationFunctions,
|
|
128393
|
+
requisiteList: requisiteList,
|
|
128394
|
+
autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
|
|
128395
|
+
}
|
|
128396
|
+
instance.updateFormResources(Form, resources);
|
|
129089
128397
|
}
|
|
129090
|
-
|
|
129091
|
-
}
|
|
128398
|
+
} else {
|
|
128399
|
+
window.CF.entryPoint[gfv] = async function(container, { renderForm, ...settings }) {
|
|
128400
|
+
const resources = {
|
|
128401
|
+
dataDeclaration: dataDeclaration,
|
|
128402
|
+
calculationFunctions: calculationFunctions,
|
|
128403
|
+
validationFunctions: validationFunctions,
|
|
128404
|
+
requisiteList: requisiteList,
|
|
128405
|
+
resourcesHash: resourcesHash,
|
|
128406
|
+
localizationDictionary: localizationDictionary,
|
|
128407
|
+
hooks: hooks,
|
|
128408
|
+
autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
|
|
128409
|
+
settings: {
|
|
128410
|
+
...defaultSettings,
|
|
128411
|
+
...settings,
|
|
128412
|
+
isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
|
|
128413
|
+
isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
|
|
128414
|
+
isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
|
|
128415
|
+
}
|
|
128416
|
+
}
|
|
128417
|
+
const formInstance = await renderForm(Form, resources, container)
|
|
128418
|
+
window.CF.entryPoint[gfv].instances = window.CF.entryPoint[gfv].instances ?? [];
|
|
128419
|
+
window.CF.entryPoint[gfv].instances.push(formInstance)
|
|
128420
|
+
return formInstance;
|
|
128421
|
+
}
|
|
128422
|
+
}
|
|
128423
|
+
|
|
128424
|
+
if (module.hot) {
|
|
128425
|
+
module.hot.accept();
|
|
128426
|
+
}
|
|
128427
|
+
`;
|
|
129092
128428
|
}
|
|
129093
128429
|
|
|
129094
128430
|
/***/ }),
|
|
@@ -129256,9 +128592,11 @@ class KCXmlValidationGenerator {
|
|
|
129256
128592
|
const conditionReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__.FormulaReader();
|
|
129257
128593
|
|
|
129258
128594
|
for (const file of importedKcXmlValidations) {
|
|
129259
|
-
const
|
|
128595
|
+
const math = conditionReader.readFormulas(file);
|
|
128596
|
+
|
|
128597
|
+
for (const condition of (_math$conditions$item = math === null || math === void 0 ? void 0 : (_math$conditions = math.conditions) === null || _math$conditions === void 0 ? void 0 : _math$conditions.items) !== null && _math$conditions$item !== void 0 ? _math$conditions$item : []) {
|
|
128598
|
+
var _math$conditions$item, _math$conditions;
|
|
129260
128599
|
|
|
129261
|
-
for (const condition of conditions) {
|
|
129262
128600
|
compiledConditions.push(this.compileCondition(condition));
|
|
129263
128601
|
}
|
|
129264
128602
|
}
|
|
@@ -129438,12 +128776,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129438
128776
|
|
|
129439
128777
|
function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
129440
128778
|
try {
|
|
129441
|
-
var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2,
|
|
128779
|
+
var _generationOptions$in, _generationOptions$in2, _sugarRoot$schemaVali, _sugarRoot$schemaVali2, _generationOptions$re, _sugarRoot$schemaVali3, _additionalContent$fo, _additionalContent$fo2;
|
|
129442
128780
|
|
|
129443
128781
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
129444
128782
|
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_12__.createDefaultSugarSerializer)();
|
|
129445
128783
|
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_13__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_10__.FormNode);
|
|
129446
|
-
const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent
|
|
128784
|
+
const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
129447
128785
|
const schemaRng = (0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__.parseXml)(additionalContent.schemaRngContent);
|
|
129448
128786
|
const formSchemaRng = _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.FormSchemaRng.createFromSchemaRng(additionalContent.schemaRngContent);
|
|
129449
128787
|
const typeRegistry = (0,_validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_14__.buildTypesRegistry)(sugarRoot);
|
|
@@ -129453,17 +128791,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
129453
128791
|
const fetchFunctions = new _common_FetchFunctions__WEBPACK_IMPORTED_MODULE_2__.FetchFunctions(referencedFetchFunctions); // tslint:disable-next-line no-unsafe-any
|
|
129454
128792
|
|
|
129455
128793
|
const additionalSettings = JSON.parse(additionalContent.additionalSettings || "{}");
|
|
129456
|
-
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_18__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_19__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry
|
|
128794
|
+
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_18__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_19__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry);
|
|
129457
128795
|
const {
|
|
129458
128796
|
dataDeclarationContent,
|
|
129459
128797
|
dataDeclaration
|
|
129460
128798
|
} = dataDeclarationGenerator.generate();
|
|
129461
128799
|
const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_25__.DataDeclarationGenerationTimeHelper(dataDeclaration);
|
|
129462
|
-
const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_15__.ValidationGenerator(sugarRoot, typeRegistry, controlCustomizationContext, formSchemaRng, (_sugarRoot$
|
|
129463
|
-
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_24__.NormalizationRulesGenerator(sugarRoot, dataDeclarationHelper, formSchemaRng, formulas, typeRegistry, (_sugarRoot$
|
|
128800
|
+
const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_15__.ValidationGenerator(sugarRoot, typeRegistry, controlCustomizationContext, formSchemaRng, (_sugarRoot$schemaVali = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali !== void 0 ? _sugarRoot$schemaVali : false, additionalContent.validationsContent);
|
|
128801
|
+
const normalizationRulesGenerator = new _ServerSideFLangNormalization_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_24__.NormalizationRulesGenerator(sugarRoot, dataDeclarationHelper, formSchemaRng, formulas, typeRegistry, (_sugarRoot$schemaVali2 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali2 !== void 0 ? _sugarRoot$schemaVali2 : false, controlCustomizationContext);
|
|
129464
128802
|
const resourcesHash = (_generationOptions$re = generationOptions === null || generationOptions === void 0 ? void 0 : generationOptions.resourcesHash) !== null && _generationOptions$re !== void 0 ? _generationOptions$re : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)("Current generator version requires resources hash");
|
|
129465
128803
|
const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_20__.FormSourcesBuilder(additionalContent.formSourcesPath);
|
|
129466
|
-
const markupGenerator = new _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_11__.MarkupGenerator(additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, (_sugarRoot$
|
|
128804
|
+
const markupGenerator = new _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_11__.MarkupGenerator(additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, (_sugarRoot$schemaVali3 = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali3 !== void 0 ? _sugarRoot$schemaVali3 : false);
|
|
129467
128805
|
markupGenerator.generate(sugarRoot, builder);
|
|
129468
128806
|
builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_8__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings));
|
|
129469
128807
|
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_23__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
@@ -129573,17 +128911,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129573
128911
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
129574
128912
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ "path");
|
|
129575
128913
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
129576
|
-
/* harmony import */ var
|
|
129577
|
-
/* harmony import */ var
|
|
129578
|
-
/* harmony import */ var
|
|
129579
|
-
/* harmony import */ var
|
|
129580
|
-
/* harmony import */ var
|
|
129581
|
-
/* harmony import */ var
|
|
129582
|
-
/* harmony import */ var
|
|
129583
|
-
/* harmony import */ var
|
|
129584
|
-
/* harmony import */ var
|
|
129585
|
-
/* harmony import */ var
|
|
129586
|
-
/* harmony import */ var
|
|
128914
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! util */ "util");
|
|
128915
|
+
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
|
|
128916
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
|
|
128917
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
|
|
128918
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
|
|
128919
|
+
/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_4__);
|
|
128920
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
|
|
128921
|
+
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
|
|
128922
|
+
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5-file */ "./node_modules/md5-file/index.js");
|
|
128923
|
+
/* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5_file__WEBPACK_IMPORTED_MODULE_6__);
|
|
128924
|
+
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
|
|
128925
|
+
/* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(recursive_readdir__WEBPACK_IMPORTED_MODULE_7__);
|
|
128926
|
+
/* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
|
|
129587
128927
|
|
|
129588
128928
|
|
|
129589
128929
|
|
|
@@ -129592,6 +128932,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
129592
128932
|
|
|
129593
128933
|
|
|
129594
128934
|
|
|
128935
|
+
|
|
128936
|
+
const statAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.stat);
|
|
128937
|
+
const readFileAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readFile);
|
|
128938
|
+
const readdirAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readdir);
|
|
129595
128939
|
async function readFormSources(formSourcesPath, farmDirectory) {
|
|
129596
128940
|
var _JSON$parse$settings;
|
|
129597
128941
|
|
|
@@ -129603,9 +128947,9 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
129603
128947
|
|
|
129604
128948
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
129605
128949
|
// eslint-disable-next-line no-console
|
|
129606
|
-
console.warn(
|
|
128950
|
+
console.warn(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
|
|
129607
128951
|
const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
|
|
129608
|
-
sugarReferences.fetchFunctionFiles = (await (
|
|
128952
|
+
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
129609
128953
|
}
|
|
129610
128954
|
|
|
129611
128955
|
const result = {
|
|
@@ -129615,12 +128959,11 @@ async function readFormSources(formSourcesPath, farmDirectory) {
|
|
|
129615
128959
|
formSourcesPath: formSourcesPath,
|
|
129616
128960
|
formJsonSettings: (_JSON$parse$settings = JSON.parse(await readFileSource(formSourcesPath, "form.json", "{}"))["settings"]) !== null && _JSON$parse$settings !== void 0 ? _JSON$parse$settings : {},
|
|
129617
128961
|
additionalSettings: await readFileSource(formSourcesPath, "settings.json", "{}"),
|
|
129618
|
-
autocalcsContent: await
|
|
128962
|
+
autocalcsContent: await readAutoCalcFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc")),
|
|
129619
128963
|
helpersContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers")),
|
|
129620
128964
|
validationsContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations")),
|
|
129621
128965
|
schemaRngContent: await readSchemaRngFile(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"), formName),
|
|
129622
|
-
kcJsXmlContent: await
|
|
129623
|
-
kclangAutocaclulationsContent: await readFilesFromDir(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), /\.kclang$/),
|
|
128966
|
+
kcJsXmlContent: (await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), `${formName}.КС.candy.js.xml`, "<dummy/>")) || "",
|
|
129624
128967
|
tourSteps: await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "tour"), "tour.js", "{}"),
|
|
129625
128968
|
hooksContent: await readHooksFile(formSourcesPath),
|
|
129626
128969
|
customControlsContent: await readCustomControlsFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls")),
|
|
@@ -129664,7 +129007,7 @@ function evalModule(moduleCode) {
|
|
|
129664
129007
|
|
|
129665
129008
|
async function isDirectoryExists(directoryPath) {
|
|
129666
129009
|
try {
|
|
129667
|
-
const dirStat = await (
|
|
129010
|
+
const dirStat = await statAsync(directoryPath);
|
|
129668
129011
|
return dirStat.isDirectory();
|
|
129669
129012
|
} catch (ignoreError) {
|
|
129670
129013
|
return false;
|
|
@@ -129675,27 +129018,27 @@ async function readFiles(filePaths) {
|
|
|
129675
129018
|
const result = [];
|
|
129676
129019
|
|
|
129677
129020
|
for (const filePath of filePaths) {
|
|
129678
|
-
result.push(await (
|
|
129021
|
+
result.push(await readFileAsync(filePath, "utf-8"));
|
|
129679
129022
|
}
|
|
129680
129023
|
|
|
129681
129024
|
return result;
|
|
129682
129025
|
}
|
|
129683
129026
|
|
|
129684
129027
|
async function extractReferences(formSugarDirectoryPath) {
|
|
129685
|
-
const indexContent = await (
|
|
129686
|
-
return (0,
|
|
129028
|
+
const indexContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8");
|
|
129029
|
+
return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
|
|
129687
129030
|
}
|
|
129688
129031
|
|
|
129689
129032
|
async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
129690
|
-
if (!(await (0,
|
|
129033
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(directoryPath))) {
|
|
129691
129034
|
return [];
|
|
129692
129035
|
}
|
|
129693
129036
|
|
|
129694
|
-
const files = await (
|
|
129037
|
+
const files = await readdirAsync(directoryPath);
|
|
129695
129038
|
let filelist = _filelist || [];
|
|
129696
129039
|
|
|
129697
129040
|
for (const file of files) {
|
|
129698
|
-
if ((await (
|
|
129041
|
+
if ((await statAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file))).isDirectory()) {
|
|
129699
129042
|
filelist = await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file), filelist);
|
|
129700
129043
|
} else {
|
|
129701
129044
|
filelist.push(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file));
|
|
@@ -129706,7 +129049,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
|
|
|
129706
129049
|
}
|
|
129707
129050
|
|
|
129708
129051
|
async function checkFileExists(filePath) {
|
|
129709
|
-
if (!(await (0,
|
|
129052
|
+
if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(filePath))) {
|
|
129710
129053
|
return [];
|
|
129711
129054
|
}
|
|
129712
129055
|
|
|
@@ -129719,7 +129062,7 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
|
|
|
129719
129062
|
|
|
129720
129063
|
if (sugarReferences.fetchFunctionFiles.length === 0) {
|
|
129721
129064
|
const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
|
|
129722
|
-
sugarReferences.fetchFunctionFiles = (await (
|
|
129065
|
+
sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
|
|
129723
129066
|
}
|
|
129724
129067
|
|
|
129725
129068
|
return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
|
|
@@ -129732,23 +129075,23 @@ function normalizeLineEndings(content) {
|
|
|
129732
129075
|
async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
129733
129076
|
const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
|
|
129734
129077
|
const hashes = await Promise.all(allDeps.map(async depFilePath => {
|
|
129735
|
-
if ([".js", ".
|
|
129736
|
-
let content = await (
|
|
129078
|
+
if ([".js", ".xml", ".xslt", ".json"].some(ext => depFilePath.endsWith(ext))) {
|
|
129079
|
+
let content = await readFileAsync(depFilePath, "utf-8");
|
|
129737
129080
|
content = normalizeLineEndings(content);
|
|
129738
|
-
return
|
|
129081
|
+
return md5__WEBPACK_IMPORTED_MODULE_5___default()(content);
|
|
129739
129082
|
}
|
|
129740
129083
|
|
|
129741
|
-
return
|
|
129084
|
+
return md5_file__WEBPACK_IMPORTED_MODULE_6___default()(depFilePath);
|
|
129742
129085
|
}));
|
|
129743
|
-
return
|
|
129086
|
+
return md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join(""));
|
|
129744
129087
|
}
|
|
129745
129088
|
async function readSugarFiles(formSugarDirectoryPath, references) {
|
|
129746
129089
|
const result = {
|
|
129747
|
-
"./index": await (
|
|
129090
|
+
"./index": await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8")
|
|
129748
129091
|
};
|
|
129749
129092
|
|
|
129750
129093
|
for (const sugarPath of references.sugarFiles) {
|
|
129751
|
-
const sugarModuleContent = await (
|
|
129094
|
+
const sugarModuleContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, sugarPath + ".sugar.xml"), "utf-8");
|
|
129752
129095
|
result[sugarPath] = sugarModuleContent;
|
|
129753
129096
|
}
|
|
129754
129097
|
|
|
@@ -129760,11 +129103,11 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
|
129760
129103
|
return {};
|
|
129761
129104
|
}
|
|
129762
129105
|
|
|
129763
|
-
const fileNames = await
|
|
129106
|
+
const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default()(formSugarDirectoryPath);
|
|
129764
129107
|
const result = {};
|
|
129765
129108
|
|
|
129766
129109
|
for (const fileName of fileNames) {
|
|
129767
|
-
const sugarModuleContent = await (
|
|
129110
|
+
const sugarModuleContent = await readFileAsync(fileName, "utf-8");
|
|
129768
129111
|
const relativeFileName = ("controls\\" + fileName.replace(formSugarDirectoryPath + "\\", "")).replace(/\\/g, "/");
|
|
129769
129112
|
result[relativeFileName] = sugarModuleContent;
|
|
129770
129113
|
}
|
|
@@ -129772,23 +129115,23 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
|
|
|
129772
129115
|
return result;
|
|
129773
129116
|
}
|
|
129774
129117
|
|
|
129775
|
-
async function
|
|
129776
|
-
|
|
129118
|
+
async function readAutoCalcFiles(formAutoCalcPath) {
|
|
129119
|
+
try {
|
|
129120
|
+
const files = await readdirAsync(formAutoCalcPath);
|
|
129121
|
+
const jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129122
|
+
return Promise.all(jsFiles.map(filename => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formAutoCalcPath, filename), "utf-8")));
|
|
129123
|
+
} catch (ignoreError) {
|
|
129777
129124
|
return [];
|
|
129778
129125
|
}
|
|
129779
|
-
|
|
129780
|
-
const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(directoryPath);
|
|
129781
|
-
const jsFiles = files.filter(filename => fileNameTest.test(filename));
|
|
129782
|
-
return Promise.all(jsFiles.map(filename => (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, filename), "utf-8")));
|
|
129783
129126
|
}
|
|
129784
129127
|
|
|
129785
129128
|
async function readImportedFiles(rootPath) {
|
|
129786
129129
|
try {
|
|
129787
129130
|
const result = {};
|
|
129788
|
-
const files = await (
|
|
129131
|
+
const files = await readdirAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations"));
|
|
129789
129132
|
|
|
129790
129133
|
for (const fileName of files) {
|
|
129791
|
-
result["../validations/" + fileName] = await (
|
|
129134
|
+
result["../validations/" + fileName] = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations", fileName), "utf-8");
|
|
129792
129135
|
}
|
|
129793
129136
|
|
|
129794
129137
|
return result;
|
|
@@ -129799,11 +129142,11 @@ async function readImportedFiles(rootPath) {
|
|
|
129799
129142
|
|
|
129800
129143
|
async function readJavaScriptFilesWithNames(formJavaScriptFilesPath) {
|
|
129801
129144
|
try {
|
|
129802
|
-
const files = await (
|
|
129145
|
+
const files = await readdirAsync(formJavaScriptFilesPath);
|
|
129803
129146
|
const jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129804
129147
|
return Promise.all(jsFiles.map(async filename => ({
|
|
129805
129148
|
filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
|
|
129806
|
-
content: await (
|
|
129149
|
+
content: await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8")
|
|
129807
129150
|
})));
|
|
129808
129151
|
} catch (ignoreError) {
|
|
129809
129152
|
return [];
|
|
@@ -129814,7 +129157,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129814
129157
|
let jsFiles;
|
|
129815
129158
|
|
|
129816
129159
|
try {
|
|
129817
|
-
const files = await (
|
|
129160
|
+
const files = await readdirAsync(formJavaScriptFilesPath);
|
|
129818
129161
|
jsFiles = files.filter(filename => /\.js$/.test(filename));
|
|
129819
129162
|
const result = [];
|
|
129820
129163
|
|
|
@@ -129822,7 +129165,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129822
129165
|
result.push({
|
|
129823
129166
|
filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
|
|
129824
129167
|
// tslint:disable-next-line no-unsafe-any
|
|
129825
|
-
content: evalModule(await (
|
|
129168
|
+
content: evalModule(await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8"))
|
|
129826
129169
|
});
|
|
129827
129170
|
}
|
|
129828
129171
|
|
|
@@ -129833,16 +129176,16 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
|
|
|
129833
129176
|
}
|
|
129834
129177
|
|
|
129835
129178
|
function readSchemaRngFile(formSchemasPath, gfv) {
|
|
129836
|
-
return (
|
|
129179
|
+
return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasPath, `${gfv}.rng.xml`), "utf-8");
|
|
129837
129180
|
}
|
|
129838
129181
|
|
|
129839
129182
|
function readHooksFile(formDirectoryPath) {
|
|
129840
|
-
return (
|
|
129183
|
+
return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formDirectoryPath, "hooks.js"), "utf-8").catch(() => "");
|
|
129841
129184
|
}
|
|
129842
129185
|
|
|
129843
129186
|
async function readFileSource(filePath, filename, defaultValue) {
|
|
129844
129187
|
try {
|
|
129845
|
-
return await (
|
|
129188
|
+
return await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(filePath, filename), "utf-8");
|
|
129846
129189
|
} catch (ingoreError) {
|
|
129847
129190
|
return defaultValue;
|
|
129848
129191
|
}
|
|
@@ -130402,18 +129745,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
130402
129745
|
|
|
130403
129746
|
|
|
130404
129747
|
class NormalizationRulesGenerator {
|
|
130405
|
-
constructor(sugarRoot, dataDeclarationHelper, formSchemaRng,
|
|
129748
|
+
constructor(sugarRoot, dataDeclarationHelper, formSchemaRng, mathContainer, typesRegistry, useSchemaValidations, controlCustomizationContext) {
|
|
130406
129749
|
this.sugarRoot = void 0;
|
|
130407
129750
|
this.dataDeclarationHelper = void 0;
|
|
130408
129751
|
this.formSchemaRng = void 0;
|
|
130409
|
-
this.
|
|
129752
|
+
this.mathContainer = void 0;
|
|
130410
129753
|
this.typesRegistry = void 0;
|
|
130411
129754
|
this.controlCustomizationContext = void 0;
|
|
130412
129755
|
this.useSchemaValidations = void 0;
|
|
130413
129756
|
this.sugarRoot = sugarRoot;
|
|
130414
129757
|
this.dataDeclarationHelper = dataDeclarationHelper;
|
|
130415
129758
|
this.formSchemaRng = formSchemaRng;
|
|
130416
|
-
this.
|
|
129759
|
+
this.mathContainer = mathContainer;
|
|
130417
129760
|
this.typesRegistry = typesRegistry;
|
|
130418
129761
|
this.useSchemaValidations = useSchemaValidations;
|
|
130419
129762
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
@@ -130443,7 +129786,9 @@ class NormalizationRulesGenerator {
|
|
|
130443
129786
|
}
|
|
130444
129787
|
|
|
130445
129788
|
*buildFormulaFLangRules() {
|
|
130446
|
-
for (const formula of this.formulas) {
|
|
129789
|
+
for (const formula of (_this$mathContainer$f = (_this$mathContainer = this.mathContainer) === null || _this$mathContainer === void 0 ? void 0 : (_this$mathContainer$f2 = _this$mathContainer.formulas) === null || _this$mathContainer$f2 === void 0 ? void 0 : _this$mathContainer$f2.items) !== null && _this$mathContainer$f !== void 0 ? _this$mathContainer$f : []) {
|
|
129790
|
+
var _this$mathContainer$f, _this$mathContainer, _this$mathContainer$f2;
|
|
129791
|
+
|
|
130447
129792
|
yield* this.buildFormulaFlashRule(formula);
|
|
130448
129793
|
}
|
|
130449
129794
|
}
|
|
@@ -136535,7 +135880,7 @@ class UserPicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
|
|
|
136535
135880
|
type: "Expression",
|
|
136536
135881
|
expression: validationGenerator.generateValidationsFactory()
|
|
136537
135882
|
});
|
|
136538
|
-
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationGenerator((_findSugarNodeBases$2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.findSugarNodeBases)(node.editor)[0]) !== null && _findSugarNodeBases$2 !== void 0 ? _findSugarNodeBases$2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_8__.reject)(), new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory(_common_FetchFunctions__WEBPACK_IMPORTED_MODULE_12__.FetchFunctions.empty()), context.controlCustomizationContext, context.typesRegistry
|
|
135883
|
+
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationGenerator((_findSugarNodeBases$2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.findSugarNodeBases)(node.editor)[0]) !== null && _findSugarNodeBases$2 !== void 0 ? _findSugarNodeBases$2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_8__.reject)(), new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory(_common_FetchFunctions__WEBPACK_IMPORTED_MODULE_12__.FetchFunctions.empty()), context.controlCustomizationContext, context.typesRegistry);
|
|
136539
135884
|
userPicklistDeclarationBuilder.prop(x => x.editorDataDeclaration).set({
|
|
136540
135885
|
type: "Expression",
|
|
136541
135886
|
expression: dataDeclarationGenerator.generateDataDeclarationFactory()
|
|
@@ -141363,10 +140708,10 @@ class CrossfitTableConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
|
|
|
141363
140708
|
}
|
|
141364
140709
|
|
|
141365
140710
|
if (rowNode instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.MultilineNode) {
|
|
141366
|
-
var
|
|
140711
|
+
var _rowNode$optional2;
|
|
141367
140712
|
|
|
141368
140713
|
this.ensurePathExists(rowNode, rowNode.dataScope.path);
|
|
141369
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((
|
|
140714
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_rowNode$optional2 = rowNode.optional) !== null && _rowNode$optional2 !== void 0 ? _rowNode$optional2 : false, rowNode.defaultChildren)]]), context.addSpecialFieldsEntry(rowNode, {
|
|
141370
140715
|
optional: rowNode.optional
|
|
141371
140716
|
}), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => {
|
|
141372
140717
|
if (rowNode2 instanceof _CrossfitTableNode__WEBPACK_IMPORTED_MODULE_11__.CrossfitTableRowNode) {
|
|
@@ -143288,10 +142633,10 @@ class MultilineFieldConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
|
|
|
143288
142633
|
}
|
|
143289
142634
|
|
|
143290
142635
|
doBuildDataDeclaration(context) {
|
|
143291
|
-
var
|
|
142636
|
+
var _node$optional;
|
|
143292
142637
|
|
|
143293
142638
|
const node = this.getCurrentNodeAs(_MultilineFieldNode__WEBPACK_IMPORTED_MODULE_3__.MultilineFieldNode);
|
|
143294
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((
|
|
142639
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addSpecialFieldsEntry(node, {
|
|
143295
142640
|
optional: node.optional
|
|
143296
142641
|
}), context.addPathSectionDeclarationEntry(node), context.addVisibilityPathDeclEntryNew(node));
|
|
143297
142642
|
}
|
|
@@ -143457,10 +142802,10 @@ class MultipleConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_0__
|
|
|
143457
142802
|
}
|
|
143458
142803
|
|
|
143459
142804
|
doBuildDataDeclaration(context) {
|
|
143460
|
-
var
|
|
142805
|
+
var _node$optional;
|
|
143461
142806
|
|
|
143462
142807
|
const node = this.getCurrentNodeAs(_MultipleNode__WEBPACK_IMPORTED_MODULE_3__.MultipleNode);
|
|
143463
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((
|
|
142808
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addSpecialFieldsEntry(node, {
|
|
143464
142809
|
optional: node.optional
|
|
143465
142810
|
}), context.addPathSectionDeclarationEntry(node));
|
|
143466
142811
|
}
|
|
@@ -144640,9 +143985,9 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
|
|
|
144640
143985
|
|
|
144641
143986
|
processMultilineNode(context, rowNode) {
|
|
144642
143987
|
if (rowNode instanceof _StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.StickyTableMultilineNode) {
|
|
144643
|
-
var
|
|
143988
|
+
var _rowNode$optional;
|
|
144644
143989
|
|
|
144645
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((
|
|
143990
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(rowNode, [["children", context.initSequenceFactory.children((_rowNode$optional = rowNode.optional) !== null && _rowNode$optional !== void 0 ? _rowNode$optional : false, rowNode.defaultChildren)]]), context.addSpecialFieldsEntry(rowNode, {
|
|
144646
143991
|
optional: rowNode.optional
|
|
144647
143992
|
}), context.addPathSectionDeclarationEntry(rowNode), context.addVisibilityPathDeclEntryNew(rowNode), context.processChildrenDataDeclaration(rowNode.rows, rowNode2 => this.processMultilineRowNode(context, rowNode2)));
|
|
144648
143993
|
}
|
|
@@ -144715,11 +144060,11 @@ class StickyTableWithMultilineConverter extends _SugarNodeConverter__WEBPACK_IMP
|
|
|
144715
144060
|
const sideSize = (_node$side2 = node.side) !== null && _node$side2 !== void 0 ? _node$side2 : 0;
|
|
144716
144061
|
|
|
144717
144062
|
if (this.isSimpleForm()) {
|
|
144718
|
-
var
|
|
144063
|
+
var _ref, _node$deprecatedDiado;
|
|
144719
144064
|
|
|
144720
144065
|
mb.prop(x => x.maxWidth).set(orientation === "landscape" ? maxWidth : undefined);
|
|
144721
144066
|
mb.prop(x => x.sideSize).set(this.hasActionButton(node) && sideSize !== 0 ? sideSize + 1 : sideSize);
|
|
144722
|
-
const width = (
|
|
144067
|
+
const width = (_ref = (_node$deprecatedDiado = node.deprecatedDiadocWidth) !== null && _node$deprecatedDiado !== void 0 ? _node$deprecatedDiado : node.width) !== null && _ref !== void 0 ? _ref : maxWidthSimpleForm;
|
|
144723
144068
|
mb.prop(x => x.width).set(width);
|
|
144724
144069
|
mb.prop(x => x.footerHeight).set(160);
|
|
144725
144070
|
} else {
|
|
@@ -145002,10 +144347,10 @@ BindingPath: ${errorPath}`));
|
|
|
145002
144347
|
if (this.isSimpleForm()) {
|
|
145003
144348
|
mb.prop(x => x.buttonType).set(undefined);
|
|
145004
144349
|
} else {
|
|
145005
|
-
var _multiline$rowmenu,
|
|
144350
|
+
var _multiline$rowmenu, _ref2, _tableNode$removeButt;
|
|
145006
144351
|
|
|
145007
144352
|
const rowMenu = (_multiline$rowmenu = multiline.rowmenu) !== null && _multiline$rowmenu !== void 0 ? _multiline$rowmenu : false;
|
|
145008
|
-
const removebutton = (
|
|
144353
|
+
const removebutton = (_ref2 = (_tableNode$removeButt = tableNode.removeButton) !== null && _tableNode$removeButt !== void 0 ? _tableNode$removeButt : multiline.removebutton) !== null && _ref2 !== void 0 ? _ref2 : true;
|
|
145009
144354
|
mb.prop(x => x.buttonType).set(rowMenu ? "RowMenu" : removebutton ? "RemoveRowButton" : undefined);
|
|
145010
144355
|
}
|
|
145011
144356
|
|
|
@@ -145018,7 +144363,7 @@ BindingPath: ${errorPath}`));
|
|
|
145018
144363
|
}
|
|
145019
144364
|
|
|
145020
144365
|
getMultiline(context, node, multiline, start, end = Infinity) {
|
|
145021
|
-
var
|
|
144366
|
+
var _ref3, _node$removeButton, _multiline$rowmenu2, _ref4, _node$removeButton2, _context$popPathsCont2;
|
|
145022
144367
|
|
|
145023
144368
|
const overrideInfo = multiline.override ? context.controlCustomizationContext.getControlCustomizationInfo("multiline", multiline.override) : undefined;
|
|
145024
144369
|
const mb = overrideInfo == undefined ? (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("MultiLine") : (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)(overrideInfo.dependencies, overrideInfo.controlName);
|
|
@@ -145031,7 +144376,7 @@ BindingPath: ${errorPath}`));
|
|
|
145031
144376
|
mb.prop(x => x.isList).set(multiline.usepager === false ? true : undefined);
|
|
145032
144377
|
mb.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_13__.getNewBindingPathExpression)(multiline));
|
|
145033
144378
|
mb.prop(x => x.showRowBorder).set(multiline.showRowBorder);
|
|
145034
|
-
const hasRemoveButton = ((
|
|
144379
|
+
const hasRemoveButton = ((_ref3 = (_node$removeButton = node.removeButton) !== null && _node$removeButton !== void 0 ? _node$removeButton : multiline.removebutton) !== null && _ref3 !== void 0 ? _ref3 : true) || ((_multiline$rowmenu2 = multiline.rowmenu) !== null && _multiline$rowmenu2 !== void 0 ? _multiline$rowmenu2 : false);
|
|
145035
144380
|
const needAddButton = multiline.addbutton !== "false";
|
|
145036
144381
|
|
|
145037
144382
|
if (this.isSimpleForm()) {
|
|
@@ -145044,7 +144389,7 @@ BindingPath: ${errorPath}`));
|
|
|
145044
144389
|
mb.prop(x => x.removeButtonPosition).set(undefined);
|
|
145045
144390
|
}
|
|
145046
144391
|
|
|
145047
|
-
mb.prop(x => x.disableScroll).set(needAddButton || ((
|
|
144392
|
+
mb.prop(x => x.disableScroll).set(needAddButton || ((_ref4 = (_node$removeButton2 = node.removeButton) !== null && _node$removeButton2 !== void 0 ? _node$removeButton2 : multiline.removebutton) !== null && _ref4 !== void 0 ? _ref4 : true) ? undefined : true);
|
|
145048
144393
|
context.pushPathsContext();
|
|
145049
144394
|
|
|
145050
144395
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayHasLength)(multiline.rows, 1)) {
|
|
@@ -145070,9 +144415,9 @@ BindingPath: ${errorPath}`));
|
|
|
145070
144415
|
hasActionButton(node) {
|
|
145071
144416
|
const multilines = node.rows.map(child => (0,_StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.isMultilineNode)(child) ? child : child.columns.find(_StickyTableNode__WEBPACK_IMPORTED_MODULE_14__.isMultilineNode)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined);
|
|
145072
144417
|
return multilines.some(multiline => {
|
|
145073
|
-
var
|
|
144418
|
+
var _ref5, _node$removeButton3;
|
|
145074
144419
|
|
|
145075
|
-
return ((
|
|
144420
|
+
return ((_ref5 = (_node$removeButton3 = node.removeButton) !== null && _node$removeButton3 !== void 0 ? _node$removeButton3 : multiline.removebutton) !== null && _ref5 !== void 0 ? _ref5 : true) || multiline.rowmenu;
|
|
145076
144421
|
});
|
|
145077
144422
|
}
|
|
145078
144423
|
|
|
@@ -145298,10 +144643,10 @@ class Table2MultirowConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
|
|
|
145298
144643
|
}
|
|
145299
144644
|
|
|
145300
144645
|
doBuildDataDeclaration(context) {
|
|
145301
|
-
var
|
|
144646
|
+
var _node$optional;
|
|
145302
144647
|
|
|
145303
144648
|
const node = this.getCurrentNodeAs(_Table2Node__WEBPACK_IMPORTED_MODULE_3__.Table2MultirowNode);
|
|
145304
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((
|
|
144649
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addPathSectionDeclarationEntry(node));
|
|
145305
144650
|
}
|
|
145306
144651
|
|
|
145307
144652
|
buildChildrenDataDeclaration(context) {
|
|
@@ -146120,10 +145465,10 @@ class TabsConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sug
|
|
|
146120
145465
|
}
|
|
146121
145466
|
|
|
146122
145467
|
doBuildDataDeclaration(context) {
|
|
146123
|
-
var
|
|
145468
|
+
var _node$optional;
|
|
146124
145469
|
|
|
146125
145470
|
const node = this.getCurrentNodeAs(_TabsNode__WEBPACK_IMPORTED_MODULE_4__.TabsNode);
|
|
146126
|
-
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((
|
|
145471
|
+
return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["children", context.initSequenceFactory.children((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false)]]), context.addPathSectionDeclarationEntry(node));
|
|
146127
145472
|
}
|
|
146128
145473
|
|
|
146129
145474
|
buildChildrenDataDeclaration(context) {
|
|
@@ -150558,15 +149903,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
150558
149903
|
|
|
150559
149904
|
|
|
150560
149905
|
function setCurrencyProps(markupBuilder, context, node) {
|
|
150561
|
-
var _typeNode$base, _node$currency;
|
|
150562
|
-
|
|
150563
149906
|
const typeNode = context.getTypeNode(node.validationInfo);
|
|
150564
149907
|
const schemaTypeInfo = context.getSchemaTypeInfo(node.getFullPath());
|
|
150565
|
-
|
|
150566
|
-
|
|
150567
|
-
|
|
149908
|
+
markupBuilder.prop(x => x.currency).set(node.currency);
|
|
149909
|
+
|
|
149910
|
+
if (node.currency) {
|
|
149911
|
+
var _typeNode$base;
|
|
149912
|
+
|
|
149913
|
+
const baseTypeName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeInfo === null || schemaTypeInfo === void 0 ? void 0 : schemaTypeInfo.baseType;
|
|
150568
149914
|
|
|
150569
|
-
if (currency) {
|
|
150570
149915
|
if (baseTypeName === "decimal") {
|
|
150571
149916
|
var _typeNode$flattenType, _typeNode$flattenType2, _ref, _ref2, _ref3, _ref4, _typeNode$flattenType3, _typeNode$flattenType4, _typeNode$flattenType5, _typeNode$flattenType6, _typeNode$flattenType7, _typeNode$flattenType8, _typeNode$flattenType9, _typeNode$flattenType10;
|
|
150572
149917
|
|
|
@@ -150592,14 +149937,11 @@ function setCurrencyProps(markupBuilder, context, node) {
|
|
|
150592
149937
|
} else if (maxLength == undefined && fractionDigits == undefined && integerDigits == undefined) {
|
|
150593
149938
|
markupBuilder.prop(x => x.currencyIntegerDigits).set(undefined);
|
|
150594
149939
|
markupBuilder.prop(x => x.currencyFractionDigits).set(2);
|
|
150595
|
-
} else if (maxLength != undefined && fractionDigits != undefined && integerDigits != undefined) {
|
|
150596
|
-
markupBuilder.prop(x => x.currencyIntegerDigits).set(integerDigits);
|
|
150597
|
-
markupBuilder.prop(x => x.currencyFractionDigits).set(fractionDigits);
|
|
150598
149940
|
} else if (totalDigits != undefined && fractionDigits == undefined && integerDigits == undefined) {
|
|
150599
149941
|
markupBuilder.prop(x => x.currencyIntegerDigits).set(totalDigits);
|
|
150600
149942
|
markupBuilder.prop(x => x.currencyFractionDigits).set(0);
|
|
150601
149943
|
} else {
|
|
150602
|
-
throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError(
|
|
149944
|
+
throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError("Unable to use currency editor with decimal type with length, maxLength or totaldigits constraints", node, "currency");
|
|
150603
149945
|
}
|
|
150604
149946
|
} else if (baseTypeName === "integer") {
|
|
150605
149947
|
var _ref5, _typeNode$flattenType11, _typeNode$flattenType12, _ref6, _typeNode$flattenType13, _typeNode$flattenType14, _ref7, _typeNode$flattenType15, _typeNode$flattenType16;
|