@kontur.candy/generator 4.296.0-react-ui4.2 → 4.296.0-react-ui4.3
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 +56 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70016,10 +70016,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
70016
70016
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70017
70017
|
/* harmony import */ var _Common_IndentString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/IndentString */ "./Common/IndentString.ts");
|
|
70018
70018
|
/* harmony import */ var _StringUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../StringUtils */ "./Generator/src/common/StringUtils.ts");
|
|
70019
|
-
/* harmony import */ var
|
|
70020
|
-
/* harmony import */ var
|
|
70021
|
-
/* harmony import */ var
|
|
70022
|
-
/* harmony import */ var
|
|
70019
|
+
/* harmony import */ var _generators_AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
|
|
70020
|
+
/* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
|
|
70021
|
+
/* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
|
|
70022
|
+
/* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
|
|
70023
|
+
/* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
|
|
70024
|
+
|
|
70023
70025
|
|
|
70024
70026
|
|
|
70025
70027
|
|
|
@@ -70118,7 +70120,7 @@ function generateKCXmlExpression(expression) {
|
|
|
70118
70120
|
}
|
|
70119
70121
|
}
|
|
70120
70122
|
function formatDescribeStatement(ast, matchPath, describe) {
|
|
70121
|
-
return
|
|
70123
|
+
return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_6__.KCLangDescriptionParser.parse(describe.text).map(item => {
|
|
70122
70124
|
if (typeof item === "string") {
|
|
70123
70125
|
return item;
|
|
70124
70126
|
} else {
|
|
@@ -70144,20 +70146,20 @@ function generateBlockKCXmlFormulas(block, parents) {
|
|
|
70144
70146
|
const result = [];
|
|
70145
70147
|
let lastDescribeStatement;
|
|
70146
70148
|
for (const statement of block.statements) {
|
|
70147
|
-
if ((0,
|
|
70149
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isFormulaStatement)(statement)) {
|
|
70148
70150
|
result.push(generateKCXmlFormula(statement, matchPath, lastDescribeStatement));
|
|
70149
70151
|
lastDescribeStatement = undefined;
|
|
70150
70152
|
}
|
|
70151
|
-
if ((0,
|
|
70153
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(statement)) {
|
|
70152
70154
|
lastDescribeStatement = undefined;
|
|
70153
70155
|
}
|
|
70154
70156
|
if (lastDescribeStatement != undefined) {
|
|
70155
70157
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
70156
70158
|
}
|
|
70157
|
-
if ((0,
|
|
70159
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(statement)) {
|
|
70158
70160
|
lastDescribeStatement = statement;
|
|
70159
70161
|
}
|
|
70160
|
-
if ((0,
|
|
70162
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(statement)) {
|
|
70161
70163
|
result.push(generateBlockKCXmlFormulas(statement, [...(parents !== null && parents !== void 0 ? parents : []), block]));
|
|
70162
70164
|
}
|
|
70163
70165
|
}
|
|
@@ -70165,7 +70167,7 @@ function generateBlockKCXmlFormulas(block, parents) {
|
|
|
70165
70167
|
}
|
|
70166
70168
|
function guessConditionTarget(condition) {
|
|
70167
70169
|
let result;
|
|
70168
|
-
class GuessConditionTargetVisitor extends
|
|
70170
|
+
class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_5__.DefaultKCLangExpressionVisitor {
|
|
70169
70171
|
visitExistsKCLangNode(node) {
|
|
70170
70172
|
if (result == undefined) {
|
|
70171
70173
|
result = node.select;
|
|
@@ -70202,7 +70204,7 @@ function guessConditionTarget(condition) {
|
|
|
70202
70204
|
}
|
|
70203
70205
|
}
|
|
70204
70206
|
}
|
|
70205
|
-
(0,
|
|
70207
|
+
(0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_5__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
|
|
70206
70208
|
return result;
|
|
70207
70209
|
}
|
|
70208
70210
|
function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
|
|
@@ -70213,7 +70215,7 @@ function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
|
|
|
70213
70215
|
const targetAttr = guessedTarget != undefined ? ` target="${guessedTarget}"` : "";
|
|
70214
70216
|
if (parentConditions != undefined && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.arrayIsNotEmpty)(parentConditions)) {
|
|
70215
70217
|
var _parentConditions$map;
|
|
70216
|
-
const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,
|
|
70218
|
+
const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
|
|
70217
70219
|
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + ` <m:when>\n` + (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(condition), 2) + "\n" + (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(ast.expression), 2) + "\n" + ` </m:when>\n` + `</m:condition>`;
|
|
70218
70220
|
}
|
|
70219
70221
|
return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:condition>`;
|
|
@@ -70223,23 +70225,23 @@ function generateBlockKCXmlConditions(block, parents, parentConditions) {
|
|
|
70223
70225
|
const result = [];
|
|
70224
70226
|
let lastDescribeStatement;
|
|
70225
70227
|
for (const statement of block.statements) {
|
|
70226
|
-
if ((0,
|
|
70228
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isFormulaStatement)(statement)) {
|
|
70227
70229
|
lastDescribeStatement = undefined;
|
|
70228
70230
|
}
|
|
70229
|
-
if ((0,
|
|
70231
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(statement)) {
|
|
70230
70232
|
result.push(generateKCXmlCondition(statement, matchPath, parentConditions, lastDescribeStatement));
|
|
70231
70233
|
lastDescribeStatement = undefined;
|
|
70232
70234
|
}
|
|
70233
70235
|
if (lastDescribeStatement != undefined) {
|
|
70234
70236
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
70235
70237
|
}
|
|
70236
|
-
if ((0,
|
|
70238
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(statement)) {
|
|
70237
70239
|
lastDescribeStatement = statement;
|
|
70238
70240
|
}
|
|
70239
|
-
if ((0,
|
|
70241
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isConditionalStatement)(statement)) {
|
|
70240
70242
|
result.push(generateConditionalConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
70241
70243
|
}
|
|
70242
|
-
if ((0,
|
|
70244
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(statement)) {
|
|
70243
70245
|
result.push(generateBlockKCXmlConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
|
|
70244
70246
|
}
|
|
70245
70247
|
}
|
|
@@ -70250,20 +70252,20 @@ function generateConditionalConditions(conditionalStatement, parents, parentCond
|
|
|
70250
70252
|
const result = [];
|
|
70251
70253
|
let lastDescribeStatement;
|
|
70252
70254
|
for (const x of conditionalStatement.statements) {
|
|
70253
|
-
if ((0,
|
|
70255
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isEnsureStatement)(x)) {
|
|
70254
70256
|
result.push(generateKCXmlCondition(x, matchPath, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement], lastDescribeStatement));
|
|
70255
70257
|
lastDescribeStatement = undefined;
|
|
70256
70258
|
}
|
|
70257
70259
|
if (lastDescribeStatement != undefined) {
|
|
70258
70260
|
throw new Error("Describe should be placed before assign of ensure statements");
|
|
70259
70261
|
}
|
|
70260
|
-
if ((0,
|
|
70262
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isDescribeStatement)(x)) {
|
|
70261
70263
|
lastDescribeStatement = x;
|
|
70262
70264
|
}
|
|
70263
|
-
if ((0,
|
|
70265
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isConditionalStatement)(x)) {
|
|
70264
70266
|
result.push(generateConditionalConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
70265
70267
|
}
|
|
70266
|
-
if ((0,
|
|
70268
|
+
if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_7__.isBlockStatement)(x)) {
|
|
70267
70269
|
result.push(generateBlockKCXmlConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
|
|
70268
70270
|
}
|
|
70269
70271
|
}
|
|
@@ -70290,10 +70292,14 @@ function generateKCXml(blocks) {
|
|
|
70290
70292
|
}
|
|
70291
70293
|
class KCLangToXmlTranspiler {
|
|
70292
70294
|
static transpile(kcLang, customParser) {
|
|
70293
|
-
const parser = customParser !== null && customParser !== void 0 ? customParser :
|
|
70295
|
+
const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_8__.KCLangAntlrParser.parse;
|
|
70294
70296
|
const kcxml = generateKCXml(parser(kcLang).blocks);
|
|
70295
70297
|
return kcxml;
|
|
70296
70298
|
}
|
|
70299
|
+
static transpileAsMathContainer(kcLang, customParser) {
|
|
70300
|
+
const formulaReader = new _generators_AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_4__.FormulaReader();
|
|
70301
|
+
return formulaReader.readFormulas(KCLangToXmlTranspiler.transpile(kcLang, customParser));
|
|
70302
|
+
}
|
|
70297
70303
|
}
|
|
70298
70304
|
function kclang(str) {
|
|
70299
70305
|
return KCLangToXmlTranspiler.transpile(str.join(""));
|
|
@@ -78532,7 +78538,8 @@ class LazyLoadDeclarationGenerator {
|
|
|
78532
78538
|
"use strict";
|
|
78533
78539
|
__webpack_require__.r(__webpack_exports__);
|
|
78534
78540
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
78535
|
-
/* harmony export */ "processSugar": () => (/* binding */ processSugar)
|
|
78541
|
+
/* harmony export */ "processSugar": () => (/* binding */ processSugar),
|
|
78542
|
+
/* harmony export */ "extractFormulasFromSugarKCLang": () => (/* binding */ extractFormulasFromSugarKCLang)
|
|
78536
78543
|
/* harmony export */ });
|
|
78537
78544
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
78538
78545
|
/* harmony import */ var _common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/Errors/ProcessSugarErrors */ "./Generator/src/common/Errors/ProcessSugarErrors.ts");
|
|
@@ -78577,6 +78584,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
78577
78584
|
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/ValidationRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/ValidationRulesBuilder.ts");
|
|
78578
78585
|
/* harmony import */ var _ServerSideFLangNormalization_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./ServerSideFLangNormalization/FormulaAndInitOnlyNormalizationRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/FormulaAndInitOnlyNormalizationRuleGenerator.ts");
|
|
78579
78586
|
/* harmony import */ var _ServerSideFLangNormalization_CustomKCLangToFlangRuleGenerator__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./ServerSideFLangNormalization/CustomKCLangToFlangRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/CustomKCLangToFlangRuleGenerator.ts");
|
|
78587
|
+
/* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
|
|
78588
|
+
/* harmony import */ var _markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./markupGenerator/AllConverters */ "./Generator/src/generators/markupGenerator/AllConverters.ts");
|
|
78589
|
+
|
|
78590
|
+
|
|
78580
78591
|
|
|
78581
78592
|
|
|
78582
78593
|
|
|
@@ -78629,7 +78640,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
78629
78640
|
const formulaReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader();
|
|
78630
78641
|
const kcLangMathContainer = formulaReader.readFormulas(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_6__.KCLangToXmlTranspiler.transpile(additionalContent.kcLangContent));
|
|
78631
78642
|
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_17__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
78632
|
-
const
|
|
78643
|
+
const formulasFromSugar = extractFormulasFromSugarKCLang(sugarRoot);
|
|
78644
|
+
const formulas = ((_kxXmlMathContainer$f = kxXmlMathContainer === null || kxXmlMathContainer === void 0 ? void 0 : (_kxXmlMathContainer$f2 = kxXmlMathContainer.formulas) === null || _kxXmlMathContainer$f2 === void 0 ? void 0 : _kxXmlMathContainer$f2.items) !== null && _kxXmlMathContainer$f !== void 0 ? _kxXmlMathContainer$f : []).concat((_kcLangMathContainer$ = kcLangMathContainer === null || kcLangMathContainer === void 0 ? void 0 : (_kcLangMathContainer$2 = kcLangMathContainer.formulas) === null || _kcLangMathContainer$2 === void 0 ? void 0 : _kcLangMathContainer$2.items) !== null && _kcLangMathContainer$ !== void 0 ? _kcLangMathContainer$ : []).concat([...formulasFromSugar]);
|
|
78633
78645
|
const useCalculator2 = ((_additionalContent$fo = additionalContent.formJsonSettings) === null || _additionalContent$fo === void 0 ? void 0 : _additionalContent$fo.autoCalculationCalculatorImpl) === "calculator2" || ((_additionalContent$fo2 = additionalContent.formJsonSettings) === null || _additionalContent$fo2 === void 0 ? void 0 : _additionalContent$fo2.useServerSideFLangNormalization);
|
|
78634
78646
|
const kcXmlConditions = (_Iterator$from$map$fl = Iterator.from(getImportedKcXmlValidations(sugarRoot, additionalContent)).map(x => {
|
|
78635
78647
|
var _container$conditions, _container$conditions2;
|
|
@@ -78792,6 +78804,20 @@ function* getImportedKcXmlValidations(formNode, additionalContent) {
|
|
|
78792
78804
|
yield getKcXmlByKclangOrKcXml(importedFilePath, content);
|
|
78793
78805
|
}
|
|
78794
78806
|
}
|
|
78807
|
+
function* extractFormulasFromSugarKCLang(sugarRoot) {
|
|
78808
|
+
const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_44__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_43__.getNodeClass)(sugarRoot));
|
|
78809
|
+
if (controlConverterClass != undefined) {
|
|
78810
|
+
const converter = new controlConverterClass(sugarRoot);
|
|
78811
|
+
const result = Iterator.from(converter.buildSugarKCLangCalculations()).map(kclangDom => {
|
|
78812
|
+
var _KCLangToXmlTranspile, _KCLangToXmlTranspile2, _KCLangToXmlTranspile3;
|
|
78813
|
+
return (_KCLangToXmlTranspile = (_KCLangToXmlTranspile2 = _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_6__.KCLangToXmlTranspiler.transpileAsMathContainer(kclangDom.toString())) === null || _KCLangToXmlTranspile2 === void 0 ? void 0 : (_KCLangToXmlTranspile3 = _KCLangToXmlTranspile2.formulas) === null || _KCLangToXmlTranspile3 === void 0 ? void 0 : _KCLangToXmlTranspile3.items) !== null && _KCLangToXmlTranspile !== void 0 ? _KCLangToXmlTranspile : [];
|
|
78814
|
+
}).flatMap(x => x);
|
|
78815
|
+
yield* result;
|
|
78816
|
+
for (const child of converter.traverseChildren()) {
|
|
78817
|
+
yield* extractFormulasFromSugarKCLang(child);
|
|
78818
|
+
}
|
|
78819
|
+
}
|
|
78820
|
+
}
|
|
78795
78821
|
|
|
78796
78822
|
/***/ }),
|
|
78797
78823
|
|
|
@@ -106989,6 +107015,12 @@ class SugarNodeConverterBase {
|
|
|
106989
107015
|
buildSugarAutoCalculations() {
|
|
106990
107016
|
return Iterator.from([]);
|
|
106991
107017
|
}
|
|
107018
|
+
buildSugarKCLangCalculations() {
|
|
107019
|
+
return [];
|
|
107020
|
+
}
|
|
107021
|
+
buildLazyLoadingDeclaration(schemaRng) {
|
|
107022
|
+
return [];
|
|
107023
|
+
}
|
|
106992
107024
|
getParentStrictAs(nodeClass) {
|
|
106993
107025
|
const node = this.node.sourceXmlNode;
|
|
106994
107026
|
const parent = node.getParentStrict();
|