@kontur.candy/generator 5.90.0-refactoring-nds.0 → 5.91.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 +369 -209
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46622,7 +46622,7 @@ class AbsoluteModelFieldPath {
|
|
|
46622
46622
|
}
|
|
46623
46623
|
_AbsoluteModelFieldPath = AbsoluteModelFieldPath;
|
|
46624
46624
|
AbsoluteModelFieldPath.extraFieldNames = ["\\$errorCount", "\\$warningCount"];
|
|
46625
|
-
AbsoluteModelFieldPath.fieldExtractRegex = new RegExp(`^(.*)\\.(${_AbsoluteModelFieldPath.extraFieldNames.concat((0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__.getKnownViewModelFieldNames)()).join("|")})$`);
|
|
46625
|
+
AbsoluteModelFieldPath.fieldExtractRegex = new RegExp(`^(.*)\\.(${_AbsoluteModelFieldPath.extraFieldNames.concat(...(0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_0__.getKnownViewModelFieldNames)().values()).join("|")})$`);
|
|
46626
46626
|
|
|
46627
46627
|
/***/ }),
|
|
46628
46628
|
|
|
@@ -47414,7 +47414,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47414
47414
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47415
47415
|
/* harmony export */ getMask: () => (/* binding */ getMask),
|
|
47416
47416
|
/* harmony export */ getMaskWithInstances: () => (/* binding */ getMaskWithInstances),
|
|
47417
|
-
/* harmony export */ isAggregationPath: () => (/* binding */ isAggregationPath)
|
|
47417
|
+
/* harmony export */ isAggregationPath: () => (/* binding */ isAggregationPath),
|
|
47418
|
+
/* harmony export */ replaceInstancesWithMultiplicity: () => (/* binding */ replaceInstancesWithMultiplicity)
|
|
47418
47419
|
/* harmony export */ });
|
|
47419
47420
|
/* harmony import */ var _ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
47420
47421
|
|
|
@@ -47442,6 +47443,11 @@ function getMaskWithInstances(exactPath) {
|
|
|
47442
47443
|
instances: reduceResult.instances
|
|
47443
47444
|
};
|
|
47444
47445
|
}
|
|
47446
|
+
function replaceInstancesWithMultiplicity(path, replaceToken = _ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each) {
|
|
47447
|
+
const isAbsolute = path.isAbsolute();
|
|
47448
|
+
const resultTokens = path.getPathPartsAsArray().map(x => _ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.isInstanceToken(x) ? replaceToken : x);
|
|
47449
|
+
return isAbsolute ? (0,_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(resultTokens) : (0,_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createRelativeFromTokens)(resultTokens);
|
|
47450
|
+
}
|
|
47445
47451
|
|
|
47446
47452
|
/***/ }),
|
|
47447
47453
|
|
|
@@ -47666,6 +47672,27 @@ const OptionalSectionFilledFieldName = "isFilledOptional";
|
|
|
47666
47672
|
|
|
47667
47673
|
/***/ }),
|
|
47668
47674
|
|
|
47675
|
+
/***/ "./Common/SerializationUtils.ts":
|
|
47676
|
+
/*!**************************************!*\
|
|
47677
|
+
!*** ./Common/SerializationUtils.ts ***!
|
|
47678
|
+
\**************************************/
|
|
47679
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
47680
|
+
|
|
47681
|
+
"use strict";
|
|
47682
|
+
__webpack_require__.r(__webpack_exports__);
|
|
47683
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47684
|
+
/* harmony export */ excludeUndefinedOrEmptyObjectJsonReplacer: () => (/* binding */ excludeUndefinedOrEmptyObjectJsonReplacer)
|
|
47685
|
+
/* harmony export */ });
|
|
47686
|
+
function excludeUndefinedOrEmptyObjectJsonReplacer(key, value) {
|
|
47687
|
+
const originalValue = this[key];
|
|
47688
|
+
if (originalValue == undefined || typeof originalValue === "object" && Object.keys(originalValue).length == 0) {
|
|
47689
|
+
return undefined;
|
|
47690
|
+
}
|
|
47691
|
+
return value;
|
|
47692
|
+
}
|
|
47693
|
+
|
|
47694
|
+
/***/ }),
|
|
47695
|
+
|
|
47669
47696
|
/***/ "./Common/TypingUtils.ts":
|
|
47670
47697
|
/*!*******************************!*\
|
|
47671
47698
|
!*** ./Common/TypingUtils.ts ***!
|
|
@@ -48618,10 +48645,12 @@ function nonRegularFieldName(fieldName) {
|
|
|
48618
48645
|
return fieldName;
|
|
48619
48646
|
}
|
|
48620
48647
|
function ensureIsKnownViewModelFieldName(fieldName) {
|
|
48621
|
-
return getKnownViewModelFieldNames().
|
|
48648
|
+
return getKnownViewModelFieldNames().has(fieldName) ? fieldName : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)(`[${fieldName}] is not known ViewModelFieldName`);
|
|
48622
48649
|
}
|
|
48650
|
+
const keysOfViewModelFieldName = ["children", "error", "warning", "description", "id", "disabled", "visible", "disabledSending", "value", "autoValue", "autoFlag", "resourcesHash", "errorsCount", "warningsCount", "code", "picklist", "normalized", "emptyUnitsVisible", "pencilOpened", "ignoreAutoFlag", "disableValueAutoInit", "index", "regionCode", "district", "city", "settlement", "street", "house", "building", "room", "bossValue", "agentValue", "senderInn", "nameorg", "sum", "count", "normalizationSource", "referencedId", "dirtyChangedPathMasks"];
|
|
48651
|
+
const allKeysOfViewModelFieldName = keysOfViewModelFieldName;
|
|
48652
|
+
const names = new Set(allKeysOfViewModelFieldName);
|
|
48623
48653
|
function getKnownViewModelFieldNames() {
|
|
48624
|
-
const names = ["children", "error", "warning", "description", "id", "disabled", "visible", "disabledSending", "value", "autoValue", "autoFlag", "resourcesHash", "errorsCount", "warningsCount", "code", "picklist", "normalized", "emptyUnitsVisible", "pencilOpened", "ignoreAutoFlag", "disableValueAutoInit", "index", "regionCode", "district", "city", "settlement", "street", "house", "building", "room", "bossValue", "agentValue", "senderInn", "nameorg", "sum", "count", "normalizationSource", "referencedId", "dirtyChangedPathMasks"];
|
|
48625
48654
|
return names;
|
|
48626
48655
|
}
|
|
48627
48656
|
|
|
@@ -61571,6 +61600,7 @@ class KCLangToJsTranspiler {
|
|
|
61571
61600
|
__webpack_require__.r(__webpack_exports__);
|
|
61572
61601
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
61573
61602
|
/* harmony export */ KCLangToXmlTranspiler: () => (/* binding */ KCLangToXmlTranspiler),
|
|
61603
|
+
/* harmony export */ ensureKCLangConditionParsed: () => (/* binding */ ensureKCLangConditionParsed),
|
|
61574
61604
|
/* harmony export */ kclang: () => (/* binding */ kclang)
|
|
61575
61605
|
/* harmony export */ });
|
|
61576
61606
|
/* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
|
|
@@ -62077,6 +62107,9 @@ function kclang(str) {
|
|
|
62077
62107
|
function escapeHtmlCharacters(str) {
|
|
62078
62108
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
62079
62109
|
}
|
|
62110
|
+
function ensureKCLangConditionParsed(kcLangCondition) {
|
|
62111
|
+
KCLangToXmlTranspiler.transpile(`in Root { check A === ${kcLangCondition} ? 1 : 0; }`);
|
|
62112
|
+
}
|
|
62080
62113
|
|
|
62081
62114
|
/***/ }),
|
|
62082
62115
|
|
|
@@ -69383,85 +69416,6 @@ function getObjectPropertyName(property) {
|
|
|
69383
69416
|
|
|
69384
69417
|
/***/ }),
|
|
69385
69418
|
|
|
69386
|
-
/***/ "./Generator/src/generators/BuildExtendedSchemaInfo.ts":
|
|
69387
|
-
/*!*************************************************************!*\
|
|
69388
|
-
!*** ./Generator/src/generators/BuildExtendedSchemaInfo.ts ***!
|
|
69389
|
-
\*************************************************************/
|
|
69390
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
69391
|
-
|
|
69392
|
-
"use strict";
|
|
69393
|
-
__webpack_require__.r(__webpack_exports__);
|
|
69394
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
69395
|
-
/* harmony export */ buildExtendedSchemaInfo: () => (/* binding */ buildExtendedSchemaInfo)
|
|
69396
|
-
/* harmony export */ });
|
|
69397
|
-
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
69398
|
-
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
69399
|
-
|
|
69400
|
-
|
|
69401
|
-
function buildExtendedSchemaInfo(dataDeclaration) {
|
|
69402
|
-
const nodes = new Map();
|
|
69403
|
-
for (const path of dataDeclaration.getAllPaths()) {
|
|
69404
|
-
if (path.isEmpty()) {
|
|
69405
|
-
continue;
|
|
69406
|
-
}
|
|
69407
|
-
const defaultValue = dataDeclaration.getDefaultValue(path);
|
|
69408
|
-
const isMultiple = dataDeclaration.isNodeHasChildrenEntry(path);
|
|
69409
|
-
const node = getOrCreateNode(nodes, path);
|
|
69410
|
-
if (isMultiple) {
|
|
69411
|
-
var _node$properties;
|
|
69412
|
-
(_node$properties = node.properties) !== null && _node$properties !== void 0 ? _node$properties : node.properties = {};
|
|
69413
|
-
node.properties.multiple = true;
|
|
69414
|
-
}
|
|
69415
|
-
if (defaultValue != undefined) {
|
|
69416
|
-
var _node$properties2;
|
|
69417
|
-
(_node$properties2 = node.properties) !== null && _node$properties2 !== void 0 ? _node$properties2 : node.properties = {};
|
|
69418
|
-
node.properties.defaultValue = defaultValue;
|
|
69419
|
-
}
|
|
69420
|
-
}
|
|
69421
|
-
if (nodes.size == 1) {
|
|
69422
|
-
var _;
|
|
69423
|
-
return {
|
|
69424
|
-
root: (_ = [...nodes.values()][0]) === null || _ === void 0 ? void 0 : _[0]
|
|
69425
|
-
};
|
|
69426
|
-
} else {
|
|
69427
|
-
return {
|
|
69428
|
-
root: [...nodes.values()].map(x => x[0])
|
|
69429
|
-
};
|
|
69430
|
-
}
|
|
69431
|
-
}
|
|
69432
|
-
function getOrCreateNode(nodes, path) {
|
|
69433
|
-
var _currentNode;
|
|
69434
|
-
if (path.isEmpty()) {
|
|
69435
|
-
throw new Error("Invalid path");
|
|
69436
|
-
}
|
|
69437
|
-
let currentNode;
|
|
69438
|
-
let currentMap = nodes;
|
|
69439
|
-
for (const pathPart of path.getPathParts()) {
|
|
69440
|
-
if (_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.isSimpleToken(pathPart)) {
|
|
69441
|
-
var _currentMap$get;
|
|
69442
|
-
let [nextNode, nextMap] = (_currentMap$get = currentMap.get(pathPart)) !== null && _currentMap$get !== void 0 ? _currentMap$get : [undefined, undefined];
|
|
69443
|
-
if (nextNode == undefined || nextMap == undefined) {
|
|
69444
|
-
nextNode = {
|
|
69445
|
-
name: pathPart,
|
|
69446
|
-
children: []
|
|
69447
|
-
};
|
|
69448
|
-
nextMap = new Map();
|
|
69449
|
-
if (currentNode != undefined) {
|
|
69450
|
-
currentNode.children.push(nextNode);
|
|
69451
|
-
}
|
|
69452
|
-
currentMap.set(pathPart, [nextNode, nextMap]);
|
|
69453
|
-
}
|
|
69454
|
-
currentNode = nextNode;
|
|
69455
|
-
// Пришлось так сделать ибо при объявлении ExtendedSchemaHashedNode с рекурсией, падает eslint
|
|
69456
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69457
|
-
currentMap = nextMap;
|
|
69458
|
-
}
|
|
69459
|
-
}
|
|
69460
|
-
return (_currentNode = currentNode) !== null && _currentNode !== void 0 ? _currentNode : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.reject)("Invalid state");
|
|
69461
|
-
}
|
|
69462
|
-
|
|
69463
|
-
/***/ }),
|
|
69464
|
-
|
|
69465
69419
|
/***/ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts":
|
|
69466
69420
|
/*!******************************************************************************!*\
|
|
69467
69421
|
!*** ./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts ***!
|
|
@@ -69471,7 +69425,10 @@ function getOrCreateNode(nodes, path) {
|
|
|
69471
69425
|
"use strict";
|
|
69472
69426
|
__webpack_require__.r(__webpack_exports__);
|
|
69473
69427
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
69474
|
-
/* harmony export */ DataDeclarationInitSourceValueSequence: () => (/* binding */ DataDeclarationInitSourceValueSequence)
|
|
69428
|
+
/* harmony export */ DataDeclarationInitSourceValueSequence: () => (/* binding */ DataDeclarationInitSourceValueSequence),
|
|
69429
|
+
/* harmony export */ isConstValueSource: () => (/* binding */ isConstValueSource),
|
|
69430
|
+
/* harmony export */ isFetchFunctionValueSource: () => (/* binding */ isFetchFunctionValueSource),
|
|
69431
|
+
/* harmony export */ isTakeFromModelValueSource: () => (/* binding */ isTakeFromModelValueSource)
|
|
69475
69432
|
/* harmony export */ });
|
|
69476
69433
|
let DataDeclarationInitSourceValueSequence = /*#__PURE__*/function (DataDeclarationInitSourceValueSequence) {
|
|
69477
69434
|
DataDeclarationInitSourceValueSequence["SETTINGS"] = "settings";
|
|
@@ -69479,6 +69436,15 @@ let DataDeclarationInitSourceValueSequence = /*#__PURE__*/function (DataDeclarat
|
|
|
69479
69436
|
DataDeclarationInitSourceValueSequence["DEFAULT"] = "default";
|
|
69480
69437
|
return DataDeclarationInitSourceValueSequence;
|
|
69481
69438
|
}({});
|
|
69439
|
+
function isConstValueSource(valueSource) {
|
|
69440
|
+
return typeof valueSource !== "object" || Array.isArray(valueSource);
|
|
69441
|
+
}
|
|
69442
|
+
function isTakeFromModelValueSource(valueSource) {
|
|
69443
|
+
return typeof valueSource === "object" && "model" in valueSource && valueSource.model !== undefined;
|
|
69444
|
+
}
|
|
69445
|
+
function isFetchFunctionValueSource(valueSource) {
|
|
69446
|
+
return typeof valueSource === "object" && "fn" in valueSource && valueSource.fn !== undefined;
|
|
69447
|
+
}
|
|
69482
69448
|
|
|
69483
69449
|
/***/ }),
|
|
69484
69450
|
|
|
@@ -69616,6 +69582,13 @@ class DataDeclarationGenerationContext {
|
|
|
69616
69582
|
type: baseType
|
|
69617
69583
|
} : {};
|
|
69618
69584
|
}
|
|
69585
|
+
addPageId(node, pageId) {
|
|
69586
|
+
const declEntry = {};
|
|
69587
|
+
declEntry.pageId = pageId;
|
|
69588
|
+
return {
|
|
69589
|
+
[(0,_markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_8__.getResolvedBindingPath)(node)]: declEntry
|
|
69590
|
+
};
|
|
69591
|
+
}
|
|
69619
69592
|
processChildrenDataDeclaration(children, nodeProcessor) {
|
|
69620
69593
|
const childrenDataDeclaration = [];
|
|
69621
69594
|
for (const child of children) {
|
|
@@ -69821,8 +69794,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
69821
69794
|
/* harmony export */ });
|
|
69822
69795
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
69823
69796
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
69824
|
-
/* harmony import */ var
|
|
69797
|
+
/* harmony import */ var _Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Engine/src/Engine/Core/CoreTypes */ "./Engine/src/Engine/Core/CoreTypes.ts");
|
|
69825
69798
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
69799
|
+
/* harmony import */ var _Common_ModelPath_Set_Set2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/Set/Set2 */ "./Common/ModelPath/Set/Set2.ts");
|
|
69800
|
+
|
|
69826
69801
|
|
|
69827
69802
|
|
|
69828
69803
|
|
|
@@ -69893,6 +69868,19 @@ class DataDeclarationGenerationTimeHelper {
|
|
|
69893
69868
|
yield (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromMask)(key, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
69894
69869
|
}
|
|
69895
69870
|
}
|
|
69871
|
+
getType(targetPath) {
|
|
69872
|
+
const entry = this.getDataDeclarationEntry(targetPath);
|
|
69873
|
+
return entry === null || entry === void 0 ? void 0 : entry.type;
|
|
69874
|
+
}
|
|
69875
|
+
getInitializationSteps(targetPath) {
|
|
69876
|
+
const entry = this.getDataDeclarationEntry(targetPath);
|
|
69877
|
+
const result = entry != undefined ? Object.fromEntries(Object.entries(entry).filter(([key]) => (0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_2__.getKnownViewModelFieldNames)().has(key))) : {};
|
|
69878
|
+
return result;
|
|
69879
|
+
}
|
|
69880
|
+
getPageId(targetPath) {
|
|
69881
|
+
const entry = this.getDataDeclarationEntry(targetPath);
|
|
69882
|
+
return entry === null || entry === void 0 ? void 0 : entry.pageId;
|
|
69883
|
+
}
|
|
69896
69884
|
getAllPathsBySection() {
|
|
69897
69885
|
const unpackSectionNameFromFn = fnCode => {
|
|
69898
69886
|
var _fnCode$match;
|
|
@@ -69909,7 +69897,7 @@ class DataDeclarationGenerationTimeHelper {
|
|
|
69909
69897
|
return [...allSections];
|
|
69910
69898
|
}).flat(1).reduce((acc, current) => {
|
|
69911
69899
|
var _acc$get;
|
|
69912
|
-
const currentPaths = (_acc$get = acc.get(current.section)) !== null && _acc$get !== void 0 ? _acc$get : new
|
|
69900
|
+
const currentPaths = (_acc$get = acc.get(current.section)) !== null && _acc$get !== void 0 ? _acc$get : new _Common_ModelPath_Set_Set2__WEBPACK_IMPORTED_MODULE_4__.Set2();
|
|
69913
69901
|
currentPaths.add(current.path);
|
|
69914
69902
|
acc.set(current.section, currentPaths);
|
|
69915
69903
|
return acc;
|
|
@@ -70133,14 +70121,18 @@ class DataDeclarationInitSourceSequenceFactory {
|
|
|
70133
70121
|
takeFromFetchFunction(fetchFnName, fieldName) {
|
|
70134
70122
|
const fetchFn = this.fetchFunctions.getFetchFunction(fetchFnName, fieldName);
|
|
70135
70123
|
return [{
|
|
70136
|
-
fn: fetchFn
|
|
70124
|
+
fn: fetchFn,
|
|
70125
|
+
fnName: fetchFnName,
|
|
70126
|
+
fnPropName: fieldName
|
|
70137
70127
|
}];
|
|
70138
70128
|
}
|
|
70139
70129
|
takeFromFetchFunctionIfExists(fetchFnName, fieldName) {
|
|
70140
70130
|
const fetchFn = this.fetchFunctions.getFetchFunction(fetchFnName, fieldName);
|
|
70141
70131
|
if (fetchFn) {
|
|
70142
70132
|
return [{
|
|
70143
|
-
fn: fetchFn
|
|
70133
|
+
fn: fetchFn,
|
|
70134
|
+
fnName: fetchFnName,
|
|
70135
|
+
fnPropName: fieldName
|
|
70144
70136
|
}];
|
|
70145
70137
|
}
|
|
70146
70138
|
return [];
|
|
@@ -70201,15 +70193,10 @@ function adjustPathMultiplicity(schema, extendedSchemaInfo, path) {
|
|
|
70201
70193
|
throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.InvalidArgumentError("path");
|
|
70202
70194
|
}
|
|
70203
70195
|
if (!rootWasSet) {
|
|
70204
|
-
var _extendedSchemaInfo$r;
|
|
70205
70196
|
if (schema.getRootElement().name === pathToken) {
|
|
70206
70197
|
currentSchemaElement = schema.getRootElement();
|
|
70207
70198
|
}
|
|
70208
|
-
|
|
70209
|
-
currentExtendedSchemaElement = extendedSchemaInfo.root.find(x => x.name == pathToken);
|
|
70210
|
-
} else if (((_extendedSchemaInfo$r = extendedSchemaInfo.root) === null || _extendedSchemaInfo$r === void 0 ? void 0 : _extendedSchemaInfo$r.name) === pathToken) {
|
|
70211
|
-
currentExtendedSchemaElement = extendedSchemaInfo.root;
|
|
70212
|
-
}
|
|
70199
|
+
currentExtendedSchemaElement = extendedSchemaInfo.roots.find(x => x.name == pathToken);
|
|
70213
70200
|
rootWasSet = true;
|
|
70214
70201
|
} else {
|
|
70215
70202
|
var _currentExtendedSchem;
|
|
@@ -70725,6 +70712,142 @@ function buildAttributeDocs(propertyDeserializer, documentationFilesContext) {
|
|
|
70725
70712
|
|
|
70726
70713
|
/***/ }),
|
|
70727
70714
|
|
|
70715
|
+
/***/ "./Generator/src/generators/ExtendedSchema/ExtendedSchemaInfoUtils.ts":
|
|
70716
|
+
/*!****************************************************************************!*\
|
|
70717
|
+
!*** ./Generator/src/generators/ExtendedSchema/ExtendedSchemaInfoUtils.ts ***!
|
|
70718
|
+
\****************************************************************************/
|
|
70719
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
70720
|
+
|
|
70721
|
+
"use strict";
|
|
70722
|
+
__webpack_require__.r(__webpack_exports__);
|
|
70723
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
70724
|
+
/* harmony export */ buildExtendedSchemaInfo: () => (/* binding */ buildExtendedSchemaInfo),
|
|
70725
|
+
/* harmony export */ buildFieldsConfiguration: () => (/* binding */ buildFieldsConfiguration),
|
|
70726
|
+
/* harmony export */ traverseExtendedSchemaInfo: () => (/* binding */ traverseExtendedSchemaInfo)
|
|
70727
|
+
/* harmony export */ });
|
|
70728
|
+
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
70729
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DataDeclarationGenerator/DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
|
|
70730
|
+
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
70731
|
+
|
|
70732
|
+
|
|
70733
|
+
|
|
70734
|
+
function traverseExtendedSchemaInfo(schemaInfo) {
|
|
70735
|
+
return Iterator.from(schemaInfo.roots).flatMap(root => traverseExtendedSchemaInfoInternal(root, (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)([])));
|
|
70736
|
+
}
|
|
70737
|
+
function* traverseExtendedSchemaInfoInternal(node, parentPath) {
|
|
70738
|
+
var _node$properties;
|
|
70739
|
+
let currentPath = parentPath.joinWith(node.name);
|
|
70740
|
+
if ((_node$properties = node.properties) !== null && _node$properties !== void 0 && _node$properties.multiple) {
|
|
70741
|
+
currentPath = currentPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each);
|
|
70742
|
+
}
|
|
70743
|
+
yield {
|
|
70744
|
+
path: currentPath,
|
|
70745
|
+
node: node
|
|
70746
|
+
};
|
|
70747
|
+
for (const child of node.children) {
|
|
70748
|
+
yield* traverseExtendedSchemaInfoInternal(child, currentPath);
|
|
70749
|
+
}
|
|
70750
|
+
}
|
|
70751
|
+
function buildFieldsConfiguration(path, dataDeclaration) {
|
|
70752
|
+
const fields = dataDeclaration.getInitializationSteps(path);
|
|
70753
|
+
const resultFields = Object.fromEntries(Object.entries(fields).map(([key, value]) => {
|
|
70754
|
+
const convertedSequence = Array.isArray(value) ? value.map(x => {
|
|
70755
|
+
if ((0,_DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_1__.isFetchFunctionValueSource)(x)) {
|
|
70756
|
+
return {
|
|
70757
|
+
type: "fetchFunction",
|
|
70758
|
+
fnName: x.fnName,
|
|
70759
|
+
propName: x.fnPropName
|
|
70760
|
+
};
|
|
70761
|
+
}
|
|
70762
|
+
if ((0,_DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_1__.isTakeFromModelValueSource)(x)) {
|
|
70763
|
+
return {
|
|
70764
|
+
type: "model"
|
|
70765
|
+
};
|
|
70766
|
+
}
|
|
70767
|
+
if ((0,_DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_1__.isConstValueSource)(x)) {
|
|
70768
|
+
return {
|
|
70769
|
+
type: "constant",
|
|
70770
|
+
value: x
|
|
70771
|
+
};
|
|
70772
|
+
}
|
|
70773
|
+
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)("Unknown init step");
|
|
70774
|
+
}) : [{
|
|
70775
|
+
type: "constant",
|
|
70776
|
+
value: value
|
|
70777
|
+
}];
|
|
70778
|
+
return [key, convertedSequence];
|
|
70779
|
+
}));
|
|
70780
|
+
return resultFields;
|
|
70781
|
+
}
|
|
70782
|
+
function buildExtendedSchemaInfo(dataDeclaration) {
|
|
70783
|
+
const nodes = new Map();
|
|
70784
|
+
for (const path of dataDeclaration.getAllPaths()) {
|
|
70785
|
+
var _node$properties2;
|
|
70786
|
+
if (path.isEmpty() || path.endsWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createRelativeFromTokens)([_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each]))) {
|
|
70787
|
+
continue;
|
|
70788
|
+
}
|
|
70789
|
+
const defaultValue = dataDeclaration.getDefaultValue(path);
|
|
70790
|
+
const isMultiple = dataDeclaration.isNodeHasChildrenEntry(path);
|
|
70791
|
+
const optional = dataDeclaration.isNodeOptionalBySchemaOrSugar(path);
|
|
70792
|
+
const node = getOrCreateNode(nodes, path);
|
|
70793
|
+
(_node$properties2 = node.properties) !== null && _node$properties2 !== void 0 ? _node$properties2 : node.properties = {};
|
|
70794
|
+
const props = node.properties;
|
|
70795
|
+
if (isMultiple) {
|
|
70796
|
+
props.multiple = true;
|
|
70797
|
+
props.errorAndWarningCountRequired = true;
|
|
70798
|
+
props.instanceFields = buildFieldsConfiguration(path.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), dataDeclaration);
|
|
70799
|
+
} else {
|
|
70800
|
+
props.errorAndWarningCountRequired = dataDeclaration.isErrorsAndWarningsCountRequired(path);
|
|
70801
|
+
}
|
|
70802
|
+
if (defaultValue != undefined) {
|
|
70803
|
+
props.defaultValue = defaultValue;
|
|
70804
|
+
}
|
|
70805
|
+
props.optional = optional;
|
|
70806
|
+
props.type = dataDeclaration.getType(path);
|
|
70807
|
+
props.disabled = dataDeclaration.isNodeHasDisabledEntry(path);
|
|
70808
|
+
const isPage = dataDeclaration.getPageId(path) != undefined;
|
|
70809
|
+
if (isPage) {
|
|
70810
|
+
props.isPage = isPage;
|
|
70811
|
+
}
|
|
70812
|
+
props.fields = buildFieldsConfiguration(path, dataDeclaration);
|
|
70813
|
+
}
|
|
70814
|
+
return {
|
|
70815
|
+
roots: [...nodes.values()].map(x => x[0])
|
|
70816
|
+
};
|
|
70817
|
+
}
|
|
70818
|
+
function getOrCreateNode(nodes, path) {
|
|
70819
|
+
var _currentNode;
|
|
70820
|
+
if (path.isEmpty()) {
|
|
70821
|
+
throw new Error("Invalid path");
|
|
70822
|
+
}
|
|
70823
|
+
let currentNode;
|
|
70824
|
+
let currentMap = nodes;
|
|
70825
|
+
for (const pathPart of path.getPathParts()) {
|
|
70826
|
+
if (_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.isSimpleToken(pathPart)) {
|
|
70827
|
+
var _currentMap$get;
|
|
70828
|
+
let [nextNode, nextMap] = (_currentMap$get = currentMap.get(pathPart)) !== null && _currentMap$get !== void 0 ? _currentMap$get : [undefined, undefined];
|
|
70829
|
+
if (nextNode == undefined || nextMap == undefined) {
|
|
70830
|
+
nextNode = {
|
|
70831
|
+
name: pathPart,
|
|
70832
|
+
children: []
|
|
70833
|
+
};
|
|
70834
|
+
nextMap = new Map();
|
|
70835
|
+
if (currentNode != undefined) {
|
|
70836
|
+
currentNode.children.push(nextNode);
|
|
70837
|
+
}
|
|
70838
|
+
currentMap.set(pathPart, [nextNode, nextMap]);
|
|
70839
|
+
}
|
|
70840
|
+
currentNode = nextNode;
|
|
70841
|
+
// Пришлось так сделать ибо при объявлении ExtendedSchemaHashedNode с рекурсией, падает eslint
|
|
70842
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70843
|
+
currentMap = nextMap;
|
|
70844
|
+
}
|
|
70845
|
+
}
|
|
70846
|
+
return (_currentNode = currentNode) !== null && _currentNode !== void 0 ? _currentNode : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)("Invalid state");
|
|
70847
|
+
}
|
|
70848
|
+
|
|
70849
|
+
/***/ }),
|
|
70850
|
+
|
|
70728
70851
|
/***/ "./Generator/src/generators/FormSourcesBuilder/FormSourcesBuilder.ts":
|
|
70729
70852
|
/*!***************************************************************************!*\
|
|
70730
70853
|
!*** ./Generator/src/generators/FormSourcesBuilder/FormSourcesBuilder.ts ***!
|
|
@@ -71969,50 +72092,52 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71969
72092
|
/* harmony import */ var _common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/SugarXmlParser/SugarParser */ "./Generator/src/common/SugarXmlParser/SugarParser.ts");
|
|
71970
72093
|
/* harmony import */ var _common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/XmlParser/XmlParser */ "./Generator/src/common/XmlParser/XmlParser.ts");
|
|
71971
72094
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
71972
|
-
/* harmony import */ var
|
|
71973
|
-
/* harmony import */ var
|
|
71974
|
-
/* harmony import */ var
|
|
71975
|
-
/* harmony import */ var
|
|
71976
|
-
/* harmony import */ var
|
|
71977
|
-
/* harmony import */ var
|
|
71978
|
-
/* harmony import */ var
|
|
71979
|
-
/* harmony import */ var
|
|
71980
|
-
/* harmony import */ var
|
|
71981
|
-
/* harmony import */ var
|
|
71982
|
-
/* harmony import */ var
|
|
71983
|
-
/* harmony import */ var
|
|
71984
|
-
/* harmony import */ var
|
|
71985
|
-
/* harmony import */ var
|
|
71986
|
-
/* harmony import */ var
|
|
71987
|
-
/* harmony import */ var
|
|
71988
|
-
/* harmony import */ var
|
|
71989
|
-
/* harmony import */ var
|
|
71990
|
-
/* harmony import */ var
|
|
71991
|
-
/* harmony import */ var
|
|
71992
|
-
/* harmony import */ var
|
|
71993
|
-
/* harmony import */ var
|
|
71994
|
-
/* harmony import */ var
|
|
71995
|
-
/* harmony import */ var
|
|
71996
|
-
/* harmony import */ var
|
|
71997
|
-
/* harmony import */ var
|
|
71998
|
-
/* harmony import */ var
|
|
71999
|
-
/* harmony import */ var
|
|
72000
|
-
/* harmony import */ var
|
|
72001
|
-
/* harmony import */ var
|
|
72002
|
-
/* harmony import */ var
|
|
72003
|
-
/* harmony import */ var
|
|
72004
|
-
/* harmony import */ var
|
|
72005
|
-
/* harmony import */ var
|
|
72006
|
-
/* harmony import */ var
|
|
72007
|
-
/* harmony import */ var
|
|
72008
|
-
/* harmony import */ var
|
|
72009
|
-
/* harmony import */ var
|
|
72010
|
-
/* harmony import */ var
|
|
72011
|
-
/* harmony import */ var
|
|
72012
|
-
/* harmony import */ var
|
|
72013
|
-
/* harmony import */ var
|
|
72014
|
-
/* harmony import */ var
|
|
72015
|
-
/* harmony import */ var
|
|
72095
|
+
/* harmony import */ var _Common_SerializationUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../Common/SerializationUtils */ "./Common/SerializationUtils.ts");
|
|
72096
|
+
/* harmony import */ var _localization_localization__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./localization/localization */ "./Generator/src/generators/localization/localization.ts");
|
|
72097
|
+
/* harmony import */ var _markupGenerator_controlCustomization_ControlCustomizationContextBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./markupGenerator/controlCustomization/ControlCustomizationContextBuilder */ "./Generator/src/generators/markupGenerator/controlCustomization/ControlCustomizationContextBuilder.ts");
|
|
72098
|
+
/* harmony import */ var _markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./markupGenerator/getSettings */ "./Generator/src/generators/markupGenerator/getSettings.ts");
|
|
72099
|
+
/* harmony import */ var _markupGenerator_IFarmFileSystem__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./markupGenerator/IFarmFileSystem */ "./Generator/src/generators/markupGenerator/IFarmFileSystem.ts");
|
|
72100
|
+
/* harmony import */ var _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./markupGenerator/ElementProcessors/FormParts/Form/FormNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Form/FormNode.ts");
|
|
72101
|
+
/* harmony import */ var _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./markupGenerator/MarkupGenerator */ "./Generator/src/generators/markupGenerator/MarkupGenerator.ts");
|
|
72102
|
+
/* harmony import */ var _markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./markupGenerator/SugarNodes/DefaultSugarSerializer */ "./Generator/src/generators/markupGenerator/SugarNodes/DefaultSugarSerializer.ts");
|
|
72103
|
+
/* harmony import */ var _markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./markupGenerator/SugarNodes/SugarNodeUtils */ "./Generator/src/generators/markupGenerator/SugarNodes/SugarNodeUtils.ts");
|
|
72104
|
+
/* harmony import */ var _validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./validationGenerator/TypesRegistry */ "./Generator/src/generators/validationGenerator/TypesRegistry.ts");
|
|
72105
|
+
/* harmony import */ var _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./validationGenerator/ValidationGenerator */ "./Generator/src/generators/validationGenerator/ValidationGenerator.ts");
|
|
72106
|
+
/* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/FormulaReader.ts");
|
|
72107
|
+
/* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./AutoCalculationsGenerator/AutoCalculationsGenerator */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsGenerator.ts");
|
|
72108
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./DataDeclarationGenerator/DataDeclarationGenerator */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerator.ts");
|
|
72109
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./DataDeclarationGenerator/DataDeclarationInitSourceSequenceFactory */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationInitSourceSequenceFactory.ts");
|
|
72110
|
+
/* harmony import */ var _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./FormSourcesBuilder/FormSourcesBuilder */ "./Generator/src/generators/FormSourcesBuilder/FormSourcesBuilder.ts");
|
|
72111
|
+
/* harmony import */ var _HelperFunctionsGenerator_HelperFunctionsGenerator__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./HelperFunctionsGenerator/HelperFunctionsGenerator */ "./Generator/src/generators/HelperFunctionsGenerator/HelperFunctionsGenerator.ts");
|
|
72112
|
+
/* harmony import */ var _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./KCXmlValidationGenerator/KCXmlValidationGenerator */ "./Generator/src/generators/KCXmlValidationGenerator/KCXmlValidationGenerator.ts");
|
|
72113
|
+
/* harmony import */ var _RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./RequisiteLIst/requisiteList */ "./Generator/src/generators/RequisiteLIst/requisiteList.ts");
|
|
72114
|
+
/* harmony import */ var _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./ServerSideFLangNormalization/Normalizers/NormalizationRulesGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/Normalizers/NormalizationRulesGenerator.ts");
|
|
72115
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./DataDeclarationGenerator/DataDeclarationGenerationTimeHelper */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationTimeHelper.ts");
|
|
72116
|
+
/* harmony import */ var _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./AttachmentPaths/AttachmentPathsGenerator */ "./Generator/src/generators/AttachmentPaths/AttachmentPathsGenerator.ts");
|
|
72117
|
+
/* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_Calculator2_AutoCalculationsCalculator2Generator__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./AutoCalculationsGenerator/AutoCalculationsFromFormulas/Calculator2/AutoCalculationsCalculator2Generator */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/Calculator2/AutoCalculationsCalculator2Generator.ts");
|
|
72118
|
+
/* harmony import */ var _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./LazyLoadDeclarationGenerator/LazyLoadDeclarationGenerator */ "./Generator/src/generators/LazyLoadDeclarationGenerator/LazyLoadDeclarationGenerator.ts");
|
|
72119
|
+
/* harmony import */ var _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./ServerSideFLangNormalization/Normalizers/FormulaOnlyNormalizationRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/Normalizers/FormulaOnlyNormalizationRuleGenerator.ts");
|
|
72120
|
+
/* harmony import */ var _HelperFunctionsGenerator_CommonHelperFunctionsGenerator__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./HelperFunctionsGenerator/CommonHelperFunctionsGenerator */ "./Generator/src/generators/HelperFunctionsGenerator/CommonHelperFunctionsGenerator.ts");
|
|
72121
|
+
/* harmony import */ var _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./ServerSideFLangNormalization/AdditionalNormalizerFile */ "./Generator/src/generators/ServerSideFLangNormalization/AdditionalNormalizerFile.ts");
|
|
72122
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/OptionalSectionRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/OptionalSectionRulesBuilder.ts");
|
|
72123
|
+
/* harmony import */ var _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./ServerSideFLangNormalization/FormulaExpressionToFlangExpressionConverter */ "./Generator/src/generators/ServerSideFLangNormalization/FormulaExpressionToFlangExpressionConverter.ts");
|
|
72124
|
+
/* harmony import */ var _DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./DataSchema/DataSchemaUtils */ "./Generator/src/generators/DataSchema/DataSchemaUtils.ts");
|
|
72125
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/FormulaRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/FormulaRulesBuilder.ts");
|
|
72126
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/InitializationRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/InitializationRulesBuilder.ts");
|
|
72127
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/LazyLoadingRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/LazyLoadingRulesBuilder.ts");
|
|
72128
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/SugarRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/SugarRulesBuilder.ts");
|
|
72129
|
+
/* harmony import */ var _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./ServerSideFLangNormalization/RuleBuilders/ValidationRulesBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/ValidationRulesBuilder.ts");
|
|
72130
|
+
/* harmony import */ var _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./ServerSideFLangNormalization/Normalizers/FormulaAndInitOnlyNormalizationRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/Normalizers/FormulaAndInitOnlyNormalizationRuleGenerator.ts");
|
|
72131
|
+
/* harmony import */ var _ServerSideFLangNormalization_CustomKCLangToFlangRuleGenerator__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./ServerSideFLangNormalization/CustomKCLangToFlangRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/CustomKCLangToFlangRuleGenerator.ts");
|
|
72132
|
+
/* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
|
|
72133
|
+
/* harmony import */ var _markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./markupGenerator/AllConverters */ "./Generator/src/generators/markupGenerator/AllConverters.ts");
|
|
72134
|
+
/* harmony import */ var _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./ServerSideFLangNormalization/Normalizers/AutoValueForValueByDefaultNormalizationRuleGenerator */ "./Generator/src/generators/ServerSideFLangNormalization/Normalizers/AutoValueForValueByDefaultNormalizationRuleGenerator.ts");
|
|
72135
|
+
/* harmony import */ var _markupGenerator_KCLangCalculationsBuildContext__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./markupGenerator/KCLangCalculationsBuildContext */ "./Generator/src/generators/markupGenerator/KCLangCalculationsBuildContext.ts");
|
|
72136
|
+
/* harmony import */ var _ServerSideFLangNormalization_NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./ServerSideFLangNormalization/NodeTypeInfoHelper */ "./Generator/src/generators/ServerSideFLangNormalization/NodeTypeInfoHelper.ts");
|
|
72137
|
+
/* harmony import */ var _ExtendedSchema_ExtendedSchemaInfoUtils__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./ExtendedSchema/ExtendedSchemaInfoUtils */ "./Generator/src/generators/ExtendedSchema/ExtendedSchemaInfoUtils.ts");
|
|
72138
|
+
/* harmony import */ var _markupGenerator_ElementProcessors_Commons_NodePathsContext__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./markupGenerator/ElementProcessors/Commons/NodePathsContext */ "./Generator/src/generators/markupGenerator/ElementProcessors/Commons/NodePathsContext.ts");
|
|
72139
|
+
/* harmony import */ var _markupGenerator_IMarkupBuildingContext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./markupGenerator/IMarkupBuildingContext */ "./Generator/src/generators/markupGenerator/IMarkupBuildingContext.ts");
|
|
72140
|
+
|
|
72016
72141
|
|
|
72017
72142
|
|
|
72018
72143
|
|
|
@@ -72068,17 +72193,20 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72068
72193
|
try {
|
|
72069
72194
|
var _sugarRoot$schemaVali, _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _mathContainerFromSug, _mathContainerFromSug2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _Iterator$from$map$fl, _mathContainerFromSug3, _mathContainerFromSug4, _generationOptions$in, _generationOptions$in2, _generationOptions$re, _additionalContent$fo5, _additionalContent$fo6, _additionalContent$fo7, _additionalContent$fo8, _additionalContent$fo9, _additionalContent$fo10, _additionalContent$fo11, _additionalContent$fo12;
|
|
72070
72195
|
const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
|
|
72071
|
-
const serializer = (0,
|
|
72072
|
-
const sugarRoot = (0,
|
|
72196
|
+
const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_14__.createDefaultSugarSerializer)();
|
|
72197
|
+
const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_15__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_12__.FormNode);
|
|
72073
72198
|
const formSchemaRng = _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.FormSchemaRng.createFromSchemaRng(additionalContent.schemaRngContent);
|
|
72074
|
-
const typeRegistry = (0,
|
|
72199
|
+
const typeRegistry = (0,_validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_16__.buildTypesRegistry)(sugarRoot);
|
|
72075
72200
|
const useSchemaValidations = (_sugarRoot$schemaVali = sugarRoot.schemaValidations) !== null && _sugarRoot$schemaVali !== void 0 ? _sugarRoot$schemaVali : true;
|
|
72076
|
-
const formulaReader = new
|
|
72201
|
+
const formulaReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_18__.FormulaReader();
|
|
72077
72202
|
const kcLangMathContainer = formulaReader.readFormulas(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_6__.KCLangToXmlTranspiler.transpile(additionalContent.kcLangContent));
|
|
72078
|
-
const kxXmlMathContainer = new
|
|
72079
|
-
const kcLangFromSugar = extractKCLangFromSugar(sugarRoot, formSchemaRng, new
|
|
72080
|
-
const builder = new
|
|
72203
|
+
const kxXmlMathContainer = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_18__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
|
|
72204
|
+
const kcLangFromSugar = extractKCLangFromSugar(sugarRoot, formSchemaRng, new _ServerSideFLangNormalization_NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_48__.NodeTypeInfoHelper(formSchemaRng, typeRegistry, useSchemaValidations)).map(x => x.toString()).join("\n");
|
|
72205
|
+
const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_22__.FormSourcesBuilder(additionalContent.formSourcesPath);
|
|
72081
72206
|
builder.addBuildOutput("Sugar.generated.kclang", kcLangFromSugar);
|
|
72207
|
+
const kclangValidatios = Iterator.from(getImportedKclangValidations(sugarRoot, additionalContent)).toArray().join("\n");
|
|
72208
|
+
const fullKcLangContent = ["// KCLang User Formulas\n\n", additionalContent.kcLangContent, "// KCLang User Validations\n\n", kclangValidatios, "// KCLang Generated Sugar Rules\n\n", kcLangFromSugar].join("\n");
|
|
72209
|
+
builder.addServerSideResource("All.kclang", fullKcLangContent);
|
|
72082
72210
|
const mathContainerFromSugar = _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_6__.KCLangToXmlTranspiler.transpileAsMathContainer(kcLangFromSugar);
|
|
72083
72211
|
const formulas = ((_kxXmlMathContainer$f = kxXmlMathContainer === null || kxXmlMathContainer === 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 || (_kcLangMathContainer$2 = kcLangMathContainer.formulas) === null || _kcLangMathContainer$2 === void 0 ? void 0 : _kcLangMathContainer$2.items) !== null && _kcLangMathContainer$ !== void 0 ? _kcLangMathContainer$ : []).concat((_mathContainerFromSug = mathContainerFromSugar === null || mathContainerFromSugar === void 0 || (_mathContainerFromSug2 = mathContainerFromSugar.formulas) === null || _mathContainerFromSug2 === void 0 ? void 0 : _mathContainerFromSug2.items) !== null && _mathContainerFromSug !== void 0 ? _mathContainerFromSug : []);
|
|
72084
72212
|
const useServerCalculations = (_additionalContent$fo = (_additionalContent$fo2 = additionalContent.formJsonSettings) === null || _additionalContent$fo2 === void 0 ? void 0 : _additionalContent$fo2.useServerSideCalculations) !== null && _additionalContent$fo !== void 0 ? _additionalContent$fo : false;
|
|
@@ -72090,48 +72218,49 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72090
72218
|
return (_container$conditions = (_container$conditions2 = container.conditions) === null || _container$conditions2 === void 0 ? void 0 : _container$conditions2.items) !== null && _container$conditions !== void 0 ? _container$conditions : [];
|
|
72091
72219
|
}).flatMap(x => x).toArray()) !== null && _Iterator$from$map$fl !== void 0 ? _Iterator$from$map$fl : []).concat((_mathContainerFromSug3 = (_mathContainerFromSug4 = mathContainerFromSugar.conditions) === null || _mathContainerFromSug4 === void 0 ? void 0 : _mathContainerFromSug4.items) !== null && _mathContainerFromSug3 !== void 0 ? _mathContainerFromSug3 : []);
|
|
72092
72220
|
const schemaRng = (0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__.parseXml)(additionalContent.schemaRngContent);
|
|
72093
|
-
const farmFileSystem = (_generationOptions$in = generationOptions === null || generationOptions === void 0 || (_generationOptions$in2 = generationOptions.internalOptions) === null || _generationOptions$in2 === void 0 ? void 0 : _generationOptions$in2.fileSystem) !== null && _generationOptions$in !== void 0 ? _generationOptions$in : new
|
|
72094
|
-
const controlCustomizationContext = (0,
|
|
72221
|
+
const farmFileSystem = (_generationOptions$in = generationOptions === null || generationOptions === void 0 || (_generationOptions$in2 = generationOptions.internalOptions) === null || _generationOptions$in2 === void 0 ? void 0 : _generationOptions$in2.fileSystem) !== null && _generationOptions$in !== void 0 ? _generationOptions$in : new _markupGenerator_IFarmFileSystem__WEBPACK_IMPORTED_MODULE_11__.NativeFarmFileSystem();
|
|
72222
|
+
const controlCustomizationContext = (0,_markupGenerator_controlCustomization_ControlCustomizationContextBuilder__WEBPACK_IMPORTED_MODULE_9__.buildControlCustomizationContext)(sugarRoot, additionalContent.formSourcesPath, farmFileSystem);
|
|
72095
72223
|
const referencedFetchFunctions = additionalContent.fetchFunctionSources != undefined ? getReferencedFetchFunctions(additionalContent.fetchFunctionSources) : {};
|
|
72096
72224
|
const fetchFunctions = new _common_FetchFunctions__WEBPACK_IMPORTED_MODULE_2__.FetchFunctions(referencedFetchFunctions);
|
|
72097
72225
|
const additionalSettings = typeof additionalContent.additionalSettings === "string" ? JSON.parse(additionalContent.additionalSettings || "{}") : additionalContent.additionalSettings;
|
|
72098
|
-
const dataDeclarationGenerator = new
|
|
72226
|
+
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_20__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_21__.DataDeclarationInitSourceSequenceFactory(fetchFunctions), controlCustomizationContext, typeRegistry, formSchemaRng, useSchemaValidations);
|
|
72099
72227
|
const {
|
|
72100
72228
|
dataDeclarationContent,
|
|
72101
72229
|
dataDeclaration
|
|
72102
72230
|
} = dataDeclarationGenerator.generate();
|
|
72103
|
-
const dataDeclarationHelper = new
|
|
72104
|
-
const extendedSchemaInfo = (0,
|
|
72105
|
-
const markupBuilderContext = new
|
|
72106
|
-
const validationGenerator = new
|
|
72107
|
-
const lazyLoadGenerator = new
|
|
72231
|
+
const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_27__.DataDeclarationGenerationTimeHelper(dataDeclaration, formSchemaRng);
|
|
72232
|
+
const extendedSchemaInfo = (0,_ExtendedSchema_ExtendedSchemaInfoUtils__WEBPACK_IMPORTED_MODULE_49__.buildExtendedSchemaInfo)(dataDeclarationHelper);
|
|
72233
|
+
const markupBuilderContext = new _markupGenerator_IMarkupBuildingContext__WEBPACK_IMPORTED_MODULE_51__.MarkupBuildingContext(new _markupGenerator_ElementProcessors_Commons_NodePathsContext__WEBPACK_IMPORTED_MODULE_50__.NodePathsContext(), additionalContent.formSourcesPath, additionalContent.helpersContent, additionalContent.tourSteps, controlCustomizationContext, typeRegistry, formSchemaRng, dataDeclarationHelper, useSchemaValidations);
|
|
72234
|
+
const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_17__.ValidationGenerator(sugarRoot, typeRegistry, markupBuilderContext, controlCustomizationContext, formSchemaRng, useSchemaValidations, additionalContent.validationsContent, additionalContent.formJsonSettings);
|
|
72235
|
+
const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_30__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
|
|
72108
72236
|
const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
|
|
72109
72237
|
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");
|
|
72110
|
-
const formulaExprConverter = new
|
|
72238
|
+
const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_35__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_36__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper), {
|
|
72111
72239
|
enableGroupSumAutoConversion: (_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.enableTypedFlang) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false
|
|
72112
72240
|
});
|
|
72113
|
-
const formulaRulesBuilder = new
|
|
72241
|
+
const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, {
|
|
72114
72242
|
enableTypedFlang: (_additionalContent$fo7 = (_additionalContent$fo8 = additionalContent.formJsonSettings) === null || _additionalContent$fo8 === void 0 ? void 0 : _additionalContent$fo8.enableTypedFlang) !== null && _additionalContent$fo7 !== void 0 ? _additionalContent$fo7 : false
|
|
72115
72243
|
});
|
|
72116
|
-
const initializationRulesBuilder = new
|
|
72117
|
-
const lazyLoadingRulesBuilder = new
|
|
72118
|
-
const sugarRulesBuilder = new
|
|
72119
|
-
const validationRulesBuilder = new
|
|
72120
|
-
const optionalSectionRuleBuilder = new
|
|
72121
|
-
const normalizationRulesGenerator = new
|
|
72122
|
-
const formulaOnlyNormalizationRulesGenerator = new
|
|
72244
|
+
const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.InitializationRulesBuilder(sugarRoot, resourcesHash);
|
|
72245
|
+
const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
|
|
72246
|
+
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
|
|
72247
|
+
const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_41__.ValidationRulesBuilder(dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions);
|
|
72248
|
+
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_34__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
72249
|
+
const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_26__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, false);
|
|
72250
|
+
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_31__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
|
|
72123
72251
|
enableTypedFlang: (_additionalContent$fo9 = (_additionalContent$fo10 = additionalContent.formJsonSettings) === null || _additionalContent$fo10 === void 0 ? void 0 : _additionalContent$fo10.enableTypedFlang) !== null && _additionalContent$fo9 !== void 0 ? _additionalContent$fo9 : false
|
|
72124
72252
|
});
|
|
72125
|
-
const formulaAndInitOnlyNormalizationRulesGenerator = new
|
|
72126
|
-
const autoValueForValueByDefaultNormalizationRuleGenerator = new
|
|
72127
|
-
const markupGenerator = new
|
|
72253
|
+
const formulaAndInitOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_42__.FormulaAndInitOnlyNormalizationRuleGenerator(sugarRulesBuilder, formulaRulesBuilder, optionalSectionRuleBuilder, formSchemaRng);
|
|
72254
|
+
const autoValueForValueByDefaultNormalizationRuleGenerator = new _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_46__.AutoValueForValueByDefaultNormalizationRuleGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, dataDeclarationHelper);
|
|
72255
|
+
const markupGenerator = new _markupGenerator_MarkupGenerator__WEBPACK_IMPORTED_MODULE_13__.MarkupGenerator(markupBuilderContext);
|
|
72128
72256
|
markupGenerator.generate(sugarRoot, builder);
|
|
72129
|
-
builder.addResource("settings.js", (0,
|
|
72130
|
-
builder.addResource("requisiteList.js", (0,
|
|
72131
|
-
const autocalcGenerator = new
|
|
72257
|
+
builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_10__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
|
|
72258
|
+
builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_25__.getRequisiteList)(sugarRoot, fetchFunctions));
|
|
72259
|
+
const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_19__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
|
|
72132
72260
|
const formulasForCalculator = useOldCalculator ? formulas : [];
|
|
72133
72261
|
builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
|
|
72134
72262
|
builder.addResource("dataDeclaration.js", dataDeclarationContent);
|
|
72263
|
+
builder.addServerSideResource("extendedSchema.json", JSON.stringify(extendedSchemaInfo, _Common_SerializationUtils__WEBPACK_IMPORTED_MODULE_7__.excludeUndefinedOrEmptyObjectJsonReplacer, 4));
|
|
72135
72264
|
let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
|
|
72136
72265
|
if ((_additionalContent$fo11 = (_additionalContent$fo12 = additionalContent.formJsonSettings) === null || _additionalContent$fo12 === void 0 ? void 0 : _additionalContent$fo12.useServerSideFLangNormalization) !== null && _additionalContent$fo11 !== void 0 ? _additionalContent$fo11 : false) {
|
|
72137
72266
|
var _additionalContent$fo13, _additionalContent$fo14, _additionalContent$fo15;
|
|
@@ -72149,17 +72278,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72149
72278
|
}].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
|
|
72150
72279
|
const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
|
|
72151
72280
|
switch (additionalNormalizer.extension) {
|
|
72152
|
-
case
|
|
72281
|
+
case _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_33__.NormalizerFileExtension.FLANG:
|
|
72153
72282
|
{
|
|
72154
|
-
const isDefault = additionalNormalizer.filename.toLowerCase() ===
|
|
72283
|
+
const isDefault = additionalNormalizer.filename.toLowerCase() === _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_33__.defaultNormalizerFilename.toLowerCase();
|
|
72155
72284
|
return {
|
|
72156
72285
|
content: additionalNormalizer.content,
|
|
72157
72286
|
normalizerId: isDefault ? undefined : additionalNormalizer.filename
|
|
72158
72287
|
};
|
|
72159
72288
|
}
|
|
72160
|
-
case
|
|
72289
|
+
case _ServerSideFLangNormalization_AdditionalNormalizerFile__WEBPACK_IMPORTED_MODULE_33__.NormalizerFileExtension.KCLANG:
|
|
72161
72290
|
{
|
|
72162
|
-
const customNormalizationRules = new
|
|
72291
|
+
const customNormalizationRules = new _ServerSideFLangNormalization_CustomKCLangToFlangRuleGenerator__WEBPACK_IMPORTED_MODULE_43__.CustomKCLangToFlangRuleGenerator(additionalNormalizer.content, formulaReader, dataDeclarationHelper, formSchemaRng, formulaExprConverter);
|
|
72163
72292
|
return {
|
|
72164
72293
|
content: customNormalizationRules.generateRules(),
|
|
72165
72294
|
normalizerId: additionalNormalizer.filename
|
|
@@ -72172,8 +72301,8 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72172
72301
|
const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
|
|
72173
72302
|
builder.addServerSideResource("ServerSide.normalize", resultRules);
|
|
72174
72303
|
}
|
|
72175
|
-
builder.addResource("lazyLoadDeclaration.js",
|
|
72176
|
-
const attachmentPathsGenerator = new
|
|
72304
|
+
builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_30__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
|
|
72305
|
+
const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_28__.AttachmentPathsGenerator(markupBuilderContext);
|
|
72177
72306
|
const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
|
|
72178
72307
|
builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
|
|
72179
72308
|
const attachmentPathsWithGfvs = attachmentPathsGenerator.generateWithGfvs(sugarRoot);
|
|
@@ -72185,11 +72314,11 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72185
72314
|
const rngSchemaValidationConfigurator = validationGenerator.generateRngSchemaValidationConfigurator();
|
|
72186
72315
|
builder.addResource("rngSchemaValidationConfigurator.js", rngSchemaValidationConfigurator);
|
|
72187
72316
|
const formulasForCalculator2 = useCalculator2 ? formulas : [];
|
|
72188
|
-
const kcXmlAutoCalcGenerator = new
|
|
72317
|
+
const kcXmlAutoCalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_Calculator2_AutoCalculationsCalculator2Generator__WEBPACK_IMPORTED_MODULE_29__.AutoCalculationsCalculator2Generator(formSchemaRng, dataDeclarationHelper, extendedSchemaInfo);
|
|
72189
72318
|
builder.addResource("kcXmlAutoCalculationConfigurator.js", kcXmlAutoCalcGenerator.generate(formulasForCalculator2, {
|
|
72190
72319
|
skipNotSupportedFunction: useServerCalculations
|
|
72191
72320
|
}));
|
|
72192
|
-
const kcXmlValidationGenerator = new
|
|
72321
|
+
const kcXmlValidationGenerator = new _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_24__.KCXmlValidationGenerator(formSchemaRng, extendedSchemaInfo);
|
|
72193
72322
|
const kcXmlConditionsForCalculator2 = kcXmlConditions;
|
|
72194
72323
|
const content = kcXmlValidationGenerator.generate(kcXmlConditionsForCalculator2, {
|
|
72195
72324
|
skipNotSupportedFunction: useServerCalculations
|
|
@@ -72198,14 +72327,14 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
72198
72327
|
// const importedAutoCalculations = getImportedAutoCalculations(sugarRoot);
|
|
72199
72328
|
builder.addResource("autocalculationConfigurators.js", `export default []`);
|
|
72200
72329
|
builder.addResource("FakeStyles.less", `// empty styles to enforce style files`);
|
|
72201
|
-
const localizationResources = (0,
|
|
72330
|
+
const localizationResources = (0,_localization_localization__WEBPACK_IMPORTED_MODULE_8__.generateLocalizationResources)(additionalContent.localization);
|
|
72202
72331
|
if (localizationResources) {
|
|
72203
72332
|
builder.addResource("localizationDictionary.js", localizationResources);
|
|
72204
72333
|
}
|
|
72205
|
-
const helperFunctionsContent = new
|
|
72334
|
+
const helperFunctionsContent = new _HelperFunctionsGenerator_HelperFunctionsGenerator__WEBPACK_IMPORTED_MODULE_23__.HelperFunctionsGenerator().generate(additionalContent.helpersContent);
|
|
72206
72335
|
if (helperFunctionsContent) {
|
|
72207
72336
|
builder.addResource("helperFunctions.js", helperFunctionsContent);
|
|
72208
|
-
const commonHelperFunctionsContent = new
|
|
72337
|
+
const commonHelperFunctionsContent = new _HelperFunctionsGenerator_CommonHelperFunctionsGenerator__WEBPACK_IMPORTED_MODULE_32__.CommonHelperFunctionsGenerator().generate(additionalContent.commonHelpersContent);
|
|
72209
72338
|
if (commonHelperFunctionsContent) {
|
|
72210
72339
|
builder.addResource("commonHelperFunctions.js", commonHelperFunctionsContent);
|
|
72211
72340
|
}
|
|
@@ -72267,11 +72396,21 @@ function* getImportedKcXmlValidations(formNode, additionalContent) {
|
|
|
72267
72396
|
yield getKcXmlByKclangOrKcXml(importedFilePath, content);
|
|
72268
72397
|
}
|
|
72269
72398
|
}
|
|
72399
|
+
function* getImportedKclangValidations(formNode, additionalContent) {
|
|
72400
|
+
for (const validationNode of (_formNode$imports$val2 = (_formNode$imports2 = formNode.imports) === null || _formNode$imports2 === void 0 ? void 0 : _formNode$imports2.validations) !== null && _formNode$imports$val2 !== void 0 ? _formNode$imports$val2 : []) {
|
|
72401
|
+
var _formNode$imports$val2, _formNode$imports2, _additionalContent$im3, _additionalContent$im4;
|
|
72402
|
+
const importedFilePath = validationNode.from;
|
|
72403
|
+
const content = (_additionalContent$im3 = (_additionalContent$im4 = additionalContent.importedFiles) === null || _additionalContent$im4 === void 0 ? void 0 : _additionalContent$im4[importedFilePath]) !== null && _additionalContent$im3 !== void 0 ? _additionalContent$im3 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)("File not found");
|
|
72404
|
+
if (kclangExtensionRegex.test(importedFilePath)) {
|
|
72405
|
+
yield content;
|
|
72406
|
+
}
|
|
72407
|
+
}
|
|
72408
|
+
}
|
|
72270
72409
|
function extractKCLangFromSugar(sugarRoot, formSchemaRng, nodeTypeInfoHelper) {
|
|
72271
|
-
const controlConverterClass = (0,
|
|
72410
|
+
const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_45__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_44__.getNodeClass)(sugarRoot));
|
|
72272
72411
|
if (controlConverterClass != undefined) {
|
|
72273
72412
|
const converter = new controlConverterClass(sugarRoot);
|
|
72274
|
-
const result = converter.buildSugarKCLangCalculations(new
|
|
72413
|
+
const result = converter.buildSugarKCLangCalculations(new _markupGenerator_KCLangCalculationsBuildContext__WEBPACK_IMPORTED_MODULE_47__.KCLangCalculationsBuildContext(formSchemaRng, nodeTypeInfoHelper), formSchemaRng);
|
|
72275
72414
|
return Iterator.from(result).toArray();
|
|
72276
72415
|
}
|
|
72277
72416
|
return [];
|
|
@@ -79605,10 +79744,11 @@ class IfConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sugar
|
|
|
79605
79744
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.isNullOrEmpty)(condition) || ((_node$doNotIncludeInV = node.doNotIncludeInValidations) !== null && _node$doNotIncludeInV !== void 0 ? _node$doNotIncludeInV : false)) {
|
|
79606
79745
|
return super.buildChildrenKCLangValidations(buildContext, formSchemaRng, children);
|
|
79607
79746
|
}
|
|
79747
|
+
const kclangCondition = (0,_PredefinedJsConditions__WEBPACK_IMPORTED_MODULE_14__.convertToKCLangCondition)(node, condition);
|
|
79608
79748
|
const thenChildrenValidations = [...super.buildChildrenKCLangValidations(buildContext, formSchemaRng, Iterator.from(((_node$then = node.then) !== null && _node$then !== void 0 ? _node$then : node).children))];
|
|
79609
79749
|
const elseChildrenValidations = node.else != undefined ? [...super.buildChildrenKCLangValidations(buildContext, formSchemaRng, Iterator.from(node.else.children))] : undefined;
|
|
79610
79750
|
if (thenChildrenValidations.length > 0 || ((_elseChildrenValidati = elseChildrenValidations === null || elseChildrenValidations === void 0 ? void 0 : elseChildrenValidations.length) !== null && _elseChildrenValidati !== void 0 ? _elseChildrenValidati : 0) > 0) {
|
|
79611
|
-
return [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_10__.IfStatement(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_11__.KCLangRawStringExpression(
|
|
79751
|
+
return [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_10__.IfStatement(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_11__.KCLangRawStringExpression(kclangCondition, _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_12__.BoolType.default), thenChildrenValidations, elseChildrenValidations)];
|
|
79612
79752
|
}
|
|
79613
79753
|
return [];
|
|
79614
79754
|
}
|
|
@@ -79665,7 +79805,7 @@ class IfConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sugar
|
|
|
79665
79805
|
if (node.condition == undefined) {
|
|
79666
79806
|
return "";
|
|
79667
79807
|
}
|
|
79668
|
-
return
|
|
79808
|
+
return node.condition;
|
|
79669
79809
|
}
|
|
79670
79810
|
doBuildDataDeclaration(context) {
|
|
79671
79811
|
return _DataDeclarationGenerator_DataDeclarationGenerationContext__WEBPACK_IMPORTED_MODULE_0__.emptyDataDeclarationCollection;
|
|
@@ -79719,10 +79859,6 @@ class IfConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.Sugar
|
|
|
79719
79859
|
}
|
|
79720
79860
|
return builder.buildConverterResult();
|
|
79721
79861
|
}
|
|
79722
|
-
tryConvertToKCLangCondition(condition) {
|
|
79723
|
-
var _tryConvertToKCLangCo;
|
|
79724
|
-
return (_tryConvertToKCLangCo = (0,_PredefinedJsConditions__WEBPACK_IMPORTED_MODULE_14__.tryConvertToKCLangCondition)(condition)) !== null && _tryConvertToKCLangCo !== void 0 ? _tryConvertToKCLangCo : condition;
|
|
79725
|
-
}
|
|
79726
79862
|
}
|
|
79727
79863
|
|
|
79728
79864
|
/***/ }),
|
|
@@ -79827,10 +79963,15 @@ let IfNode = (_dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3_
|
|
|
79827
79963
|
"use strict";
|
|
79828
79964
|
__webpack_require__.r(__webpack_exports__);
|
|
79829
79965
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
79966
|
+
/* harmony export */ convertToKCLangCondition: () => (/* binding */ convertToKCLangCondition),
|
|
79830
79967
|
/* harmony export */ naiveConvertJsConditionToKCLangCondition: () => (/* binding */ naiveConvertJsConditionToKCLangCondition),
|
|
79831
79968
|
/* harmony export */ predefinedJsConditions: () => (/* binding */ predefinedJsConditions),
|
|
79832
79969
|
/* harmony export */ tryConvertToKCLangCondition: () => (/* binding */ tryConvertToKCLangCondition)
|
|
79833
79970
|
/* harmony export */ });
|
|
79971
|
+
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
79972
|
+
/* harmony import */ var _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../common/XmlParser/XmlNode */ "./Generator/src/common/XmlParser/XmlNode.ts");
|
|
79973
|
+
|
|
79974
|
+
|
|
79834
79975
|
function tryConvertToKCLangCondition(condition) {
|
|
79835
79976
|
var _predefinedJsConditio;
|
|
79836
79977
|
const result = (_predefinedJsConditio = predefinedJsConditions[condition]) !== null && _predefinedJsConditio !== void 0 ? _predefinedJsConditio : naiveConvertJsConditionToKCLangCondition(condition);
|
|
@@ -79864,6 +80005,8 @@ function naiveConvertJsConditionToKCLangCondition(condition) {
|
|
|
79864
80005
|
applyReplacements([/path\('([^']*?)',\s*'value'\)/g, "path('$1')"]);
|
|
79865
80006
|
applyReplacements([/path\('([^']*?)',\s*'error'\)\s*===?\s*''/g, "1 == 0"]);
|
|
79866
80007
|
applyReplacements([/path\('([^']*?)',\s*'error'\)\s*!==?\s*''/g, "1 == 1"]);
|
|
80008
|
+
applyReplacements([/path\('([^']*?)',\s*'warning'\)\s*===?\s*''/g, "1 == 0"]);
|
|
80009
|
+
applyReplacements([/path\('([^']*?)',\s*'warning'\)\s*!==?\s*''/g, "1 == 1"]);
|
|
79867
80010
|
applyReplacements([/path\('([^']*?)'\)\.length/g, "length($1)"]);
|
|
79868
80011
|
applyReplacements([/path\('@formsClientInfo\/[^']*?'\)/g, "''"]);
|
|
79869
80012
|
applyReplacements([/path\('@featureFlags\/([^']*?)'\)/g, "getProperty('$1')"]);
|
|
@@ -79999,6 +80142,17 @@ const predefinedJsConditions = {
|
|
|
79999
80142
|
"ИС/Основание": "exists(ИС/Основание) and ИС/Основание != ''",
|
|
80000
80143
|
"ВЛ/Основание": "exists(ВЛ/Основание) and ВЛ/Основание != ''"
|
|
80001
80144
|
};
|
|
80145
|
+
function convertToKCLangCondition(node, condition) {
|
|
80146
|
+
var _tryConvertToKCLangCo;
|
|
80147
|
+
const kcLangCondition = (_tryConvertToKCLangCo = tryConvertToKCLangCondition(condition)) !== null && _tryConvertToKCLangCo !== void 0 ? _tryConvertToKCLangCo : condition;
|
|
80148
|
+
// Раннее обнаружение ошибки компиляции KCLang
|
|
80149
|
+
try {
|
|
80150
|
+
(0,_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_0__.ensureKCLangConditionParsed)(kcLangCondition);
|
|
80151
|
+
} catch (e) {
|
|
80152
|
+
throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_1__.SugarAttributeReadError(`Failed to parse KCLang expression! Expression: ${condition}`, node, "condition", e);
|
|
80153
|
+
}
|
|
80154
|
+
return kcLangCondition;
|
|
80155
|
+
}
|
|
80002
80156
|
|
|
80003
80157
|
/***/ }),
|
|
80004
80158
|
|
|
@@ -80149,9 +80303,9 @@ class SwitchConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.S
|
|
|
80149
80303
|
if (thenStatements.length == 0 && (elseStatements == undefined || elseStatements.length == 0)) {
|
|
80150
80304
|
resultConditions = [];
|
|
80151
80305
|
} else if (thenStatements.length == 0 && elseStatements != undefined && (elseStatements === null || elseStatements === void 0 ? void 0 : elseStatements.length) > 0) {
|
|
80152
|
-
resultConditions = [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_9__.IfStatement(new _common_KCLang_CodeDom_NotExpression__WEBPACK_IMPORTED_MODULE_13__.NotExpression(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_10__.KCLangRawStringExpression(
|
|
80306
|
+
resultConditions = node.doNotIncludeInValidations ? elseStatements : [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_9__.IfStatement(new _common_KCLang_CodeDom_NotExpression__WEBPACK_IMPORTED_MODULE_13__.NotExpression(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_10__.KCLangRawStringExpression((0,_If_PredefinedJsConditions__WEBPACK_IMPORTED_MODULE_12__.convertToKCLangCondition)(caseNode, caseNode.condition), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_11__.BoolType.default)), elseStatements)];
|
|
80153
80307
|
} else {
|
|
80154
|
-
resultConditions = [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_9__.IfStatement(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_10__.KCLangRawStringExpression(
|
|
80308
|
+
resultConditions = node.doNotIncludeInValidations ? thenStatements.concat(...(elseStatements !== null && elseStatements !== void 0 ? elseStatements : [])) : [new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_9__.IfStatement(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_10__.KCLangRawStringExpression((0,_If_PredefinedJsConditions__WEBPACK_IMPORTED_MODULE_12__.convertToKCLangCondition)(caseNode, caseNode.condition), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_11__.BoolType.default), thenStatements, elseStatements)];
|
|
80155
80309
|
}
|
|
80156
80310
|
}
|
|
80157
80311
|
return resultConditions;
|
|
@@ -80168,6 +80322,10 @@ class SwitchConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.S
|
|
|
80168
80322
|
}
|
|
80169
80323
|
buildChildrenValidations(validationGenerator, context) {
|
|
80170
80324
|
const node = this.getCurrentNodeAs(_SwitchNode__WEBPACK_IMPORTED_MODULE_14__.SwitchNode);
|
|
80325
|
+
if (node.doNotIncludeInValidations) {
|
|
80326
|
+
super.buildChildrenValidations(validationGenerator, context);
|
|
80327
|
+
return;
|
|
80328
|
+
}
|
|
80171
80329
|
const evaluatorsContextPathExpression = this.getEvaluatorsContextPathExpression();
|
|
80172
80330
|
const prevConditions = [];
|
|
80173
80331
|
for (const caseNode of node.cases) {
|
|
@@ -80218,10 +80376,6 @@ class SwitchConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.S
|
|
|
80218
80376
|
}
|
|
80219
80377
|
return builder.buildConverterResult();
|
|
80220
80378
|
}
|
|
80221
|
-
adjustCondition(condition) {
|
|
80222
|
-
var _tryConvertToKCLangCo;
|
|
80223
|
-
return (_tryConvertToKCLangCo = (0,_If_PredefinedJsConditions__WEBPACK_IMPORTED_MODULE_12__.tryConvertToKCLangCondition)(condition)) !== null && _tryConvertToKCLangCo !== void 0 ? _tryConvertToKCLangCo : condition;
|
|
80224
|
-
}
|
|
80225
80379
|
}
|
|
80226
80380
|
|
|
80227
80381
|
/***/ }),
|
|
@@ -80249,7 +80403,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80249
80403
|
|
|
80250
80404
|
|
|
80251
80405
|
|
|
80252
|
-
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _dec4, _dec5, _class3, _class4, _descriptor3, _dec6, _dec7, _dec8, _class5, _class6, _descriptor4, _descriptor5;
|
|
80406
|
+
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _dec4, _dec5, _class3, _class4, _descriptor3, _dec6, _dec7, _dec8, _dec9, _class5, _class6, _descriptor4, _descriptor5, _descriptor6;
|
|
80253
80407
|
|
|
80254
80408
|
let SwitchCaseNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("case", `Отображает блок, если выполняется условие.`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ControlFlow/Switch sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("condition", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.javascriptExpression, "Условие, при котором блок отображается"), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)(), _dec(_class = (_class2 = class SwitchCaseNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
80255
80409
|
constructor(...args) {
|
|
@@ -80279,11 +80433,12 @@ let SwitchDefaultNode = (_dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTE
|
|
|
80279
80433
|
writable: true,
|
|
80280
80434
|
initializer: null
|
|
80281
80435
|
}), _class4)) || _class3);
|
|
80282
|
-
let SwitchNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("switch", ``, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ControlFlow/Switch sync recursive .md$")), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)("case", [SwitchCaseNode]), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.singleChild)("default", [SwitchDefaultNode]), _dec6(_class5 = (_class6 = class SwitchNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
80436
|
+
let SwitchNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("switch", ``, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ControlFlow/Switch sync recursive .md$")), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)("case", [SwitchCaseNode]), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.singleChild)("default", [SwitchDefaultNode]), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("doNotIncludeInValidations", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, "Не включать это условие в валидацию видимых элементов"), _dec6(_class5 = (_class6 = class SwitchNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
80283
80437
|
constructor(...args) {
|
|
80284
80438
|
super(...args);
|
|
80285
80439
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "cases", _descriptor4, this);
|
|
80286
80440
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "default", _descriptor5, this);
|
|
80441
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "doNotIncludeInValidations", _descriptor6, this);
|
|
80287
80442
|
}
|
|
80288
80443
|
}, _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class6.prototype, "cases", [_dec7], {
|
|
80289
80444
|
configurable: true,
|
|
@@ -80295,6 +80450,11 @@ let SwitchNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODUL
|
|
|
80295
80450
|
enumerable: true,
|
|
80296
80451
|
writable: true,
|
|
80297
80452
|
initializer: null
|
|
80453
|
+
}), _descriptor6 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class6.prototype, "doNotIncludeInValidations", [_dec9], {
|
|
80454
|
+
configurable: true,
|
|
80455
|
+
enumerable: true,
|
|
80456
|
+
writable: true,
|
|
80457
|
+
initializer: null
|
|
80298
80458
|
}), _class6)) || _class5);
|
|
80299
80459
|
|
|
80300
80460
|
/***/ }),
|
|
@@ -82901,7 +83061,7 @@ class PageConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4__.Sug
|
|
|
82901
83061
|
const optionalFieldRequired = ((_node$optional = node.optional) !== null && _node$optional !== void 0 ? _node$optional : false) && !((_node$multiple = node.multiple) !== null && _node$multiple !== void 0 ? _node$multiple : false);
|
|
82902
83062
|
return context.mergeDataDeclaration({
|
|
82903
83063
|
[this.getResolvedBindingPath(node)]: result
|
|
82904
|
-
}, context.addPathSectionDeclarationEntry(node), optionalFieldRequired ? {
|
|
83064
|
+
}, context.addPageId(node, node.id), context.addPathSectionDeclarationEntry(node), optionalFieldRequired ? {
|
|
82905
83065
|
[optionalFieldPath]: {
|
|
82906
83066
|
value: context.initSequenceFactory.dataValue({
|
|
82907
83067
|
defaultValue: "1",
|
|
@@ -83746,10 +83906,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83746
83906
|
/* harmony import */ var _ProcessFormSources__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../ProcessFormSources */ "./Generator/src/generators/ProcessFormSources.ts");
|
|
83747
83907
|
/* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
|
|
83748
83908
|
/* harmony import */ var _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../KCXmlValidationGenerator/KCXmlValidationGenerator */ "./Generator/src/generators/KCXmlValidationGenerator/KCXmlValidationGenerator.ts");
|
|
83749
|
-
/* harmony import */ var
|
|
83750
|
-
/* harmony import */ var
|
|
83751
|
-
/* harmony import */ var
|
|
83752
|
-
/* harmony import */ var
|
|
83909
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../DataDeclarationGenerator/DataDeclarationGenerationTimeHelper */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationTimeHelper.ts");
|
|
83910
|
+
/* harmony import */ var _common_KCLang_CodeDom_InBlock__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../../common/KCLang/CodeDom/InBlock */ "./Generator/src/common/KCLang/CodeDom/InBlock.ts");
|
|
83911
|
+
/* harmony import */ var _common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../../common/KCLang/CodeDom/KCLangPath */ "./Generator/src/common/KCLang/CodeDom/KCLangPath.ts");
|
|
83912
|
+
/* harmony import */ var _ExtendedSchema_ExtendedSchemaInfoUtils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../../ExtendedSchema/ExtendedSchemaInfoUtils */ "./Generator/src/generators/ExtendedSchema/ExtendedSchemaInfoUtils.ts");
|
|
83753
83913
|
/* harmony import */ var _UserPicklistNode__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./UserPicklistNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/UserPicklist/UserPicklistNode.ts");
|
|
83754
83914
|
|
|
83755
83915
|
|
|
@@ -83815,13 +83975,13 @@ class UserPicklistConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
|
|
|
83815
83975
|
const useSchemaValidations = false;
|
|
83816
83976
|
const dataDeclarationGenerator = new _DataDeclarationGenerator_DataDeclarationGenerator__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationGenerator(sugarRoot, new _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory(_common_FetchFunctions__WEBPACK_IMPORTED_MODULE_12__.FetchFunctions.empty()), context.controlCustomizationContext, typeRegistry, _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_7__.FormSchemaRng.createEmpty(), false);
|
|
83817
83977
|
let kcLangStatements = (0,_ProcessFormSources__WEBPACK_IMPORTED_MODULE_14__.extractKCLangFromSugar)(sugarRoot, formSchemaRng, new _ServerSideFLangNormalization_NodeTypeInfoHelper__WEBPACK_IMPORTED_MODULE_13__.NodeTypeInfoHelper(formSchemaRng, typeRegistry, useSchemaValidations));
|
|
83818
|
-
kcLangStatements = [new
|
|
83978
|
+
kcLangStatements = [new _common_KCLang_CodeDom_InBlock__WEBPACK_IMPORTED_MODULE_18__.InBlock(new _common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_19__.KCLangPath(false, [new _common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_19__.PathElement(".")]), kcLangStatements)];
|
|
83819
83979
|
const kcLangFromSugar = kcLangStatements.map(x => x.toString()).join("\n");
|
|
83820
83980
|
const {
|
|
83821
83981
|
dataDeclaration
|
|
83822
83982
|
} = dataDeclarationGenerator.generate();
|
|
83823
|
-
const dataDeclarationHelper = new
|
|
83824
|
-
const extendedSchemaInfo = (0,
|
|
83983
|
+
const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_17__.DataDeclarationGenerationTimeHelper(dataDeclaration, formSchemaRng);
|
|
83984
|
+
const extendedSchemaInfo = (0,_ExtendedSchema_ExtendedSchemaInfoUtils__WEBPACK_IMPORTED_MODULE_20__.buildExtendedSchemaInfo)(dataDeclarationHelper);
|
|
83825
83985
|
const mathContainerFromSugar = _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_15__.KCLangToXmlTranspiler.transpileAsMathContainer(kcLangFromSugar);
|
|
83826
83986
|
const kcXmlValidationGenerator = new _KCXmlValidationGenerator_KCXmlValidationGenerator__WEBPACK_IMPORTED_MODULE_16__.KCXmlValidationGenerator(formSchemaRng, extendedSchemaInfo);
|
|
83827
83987
|
const kcXmlValidationConfiguratorFunction = kcXmlValidationGenerator.generateConfigurationFunction((_mathContainerFromSug = (_mathContainerFromSug2 = mathContainerFromSugar.conditions) === null || _mathContainerFromSug2 === void 0 ? void 0 : _mathContainerFromSug2.items) !== null && _mathContainerFromSug !== void 0 ? _mathContainerFromSug : [], {
|
|
@@ -102641,14 +102801,14 @@ class KCLangCalculationsBuildContext {
|
|
|
102641
102801
|
allChildrenPaths = undefined;
|
|
102642
102802
|
}
|
|
102643
102803
|
const restChecks = (_allChildrenPaths2 = allChildrenPaths) === null || _allChildrenPaths2 === void 0 ? void 0 : _allChildrenPaths2.map(childPath => new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_5__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_11__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(childPath, true))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_21__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(childPath, true)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression("")))).reduce(combineByAndKCLangExpr, undefined);
|
|
102644
|
-
const checkRequiredStatement = new _common_KCLang_CodeDom_CheckStatement__WEBPACK_IMPORTED_MODULE_7__.CheckStatement(new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_5__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_11__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_21__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression(""))), [new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("description", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_36__.omitLocalization)(requiredDescription))), new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("target", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((_IterUtils$last = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(Iterator.from(targetPath.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken))) !== null && _IterUtils$last !== void 0 ? _IterUtils$last : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)()))]);
|
|
102804
|
+
const checkRequiredStatement = new _common_KCLang_CodeDom_CheckStatement__WEBPACK_IMPORTED_MODULE_7__.CheckStatement(new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_5__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_11__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_21__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression(""))), [new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("description", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_36__.omitLocalization)(requiredDescription))), new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("target", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((_IterUtils$last = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(Iterator.from(targetPath.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken))) !== null && _IterUtils$last !== void 0 ? _IterUtils$last : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)()))]);
|
|
102645
102805
|
if (restChecks != undefined) {
|
|
102646
102806
|
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_17__.IfStatement(restChecks, [checkRequiredStatement]);
|
|
102647
102807
|
} else {
|
|
102648
102808
|
yield checkRequiredStatement;
|
|
102649
102809
|
}
|
|
102650
102810
|
}
|
|
102651
|
-
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_17__.IfStatement(new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_5__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_11__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_21__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression(""))), valueChecks);
|
|
102811
|
+
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_17__.IfStatement(new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_5__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_11__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_21__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression(""))), valueChecks);
|
|
102652
102812
|
}
|
|
102653
102813
|
getFirstAcceptedParent(schemaNode) {
|
|
102654
102814
|
let parentNode = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.parent;
|
|
@@ -102670,7 +102830,7 @@ class KCLangCalculationsBuildContext {
|
|
|
102670
102830
|
}
|
|
102671
102831
|
createCheck(targetPath, condition, message, checkType) {
|
|
102672
102832
|
var _IterUtils$last2;
|
|
102673
|
-
const withBlocks = [new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("description", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText(message.replace(/\[/gi, "\\[").replace(/]/gi, "\\]"))), new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("target", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((_IterUtils$last2 = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(Iterator.from(targetPath.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken))) !== null && _IterUtils$last2 !== void 0 ? _IterUtils$last2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)()))];
|
|
102833
|
+
const withBlocks = [new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("description", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText(message.replace(/\[/gi, "\\[").replace(/]/gi, "\\]"))), new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("target", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText((_IterUtils$last2 = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(Iterator.from(targetPath.getPathParts()).filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken(x) && !_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isInstanceToken(x)))) !== null && _IterUtils$last2 !== void 0 ? _IterUtils$last2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)()))];
|
|
102674
102834
|
if (checkType == "warning") {
|
|
102675
102835
|
withBlocks.push(new _common_KCLang_CodeDom_WithBlock__WEBPACK_IMPORTED_MODULE_28__.WithBlock("errorLevel", new _common_KCLang_CodeDom_DescriptionText__WEBPACK_IMPORTED_MODULE_9__.DescriptionText("Warning")));
|
|
102676
102836
|
}
|
|
@@ -102685,7 +102845,7 @@ class KCLangCalculationsBuildContext {
|
|
|
102685
102845
|
var _ref5, _ref6, _ref7, _omitLocalization;
|
|
102686
102846
|
return (_ref5 = (_ref6 = (_ref7 = (_omitLocalization = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_36__.omitLocalization)(sugarTypeCheckDescription)) !== null && _omitLocalization !== void 0 ? _omitLocalization : (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_36__.omitLocalization)(sugarTypeDescription)) !== null && _ref7 !== void 0 ? _ref7 : (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_36__.omitLocalization)(schemaTypeDescription)) !== null && _ref6 !== void 0 ? _ref6 : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_31__.StringTypeMessageGenerator.generate(constraints !== null && constraints !== void 0 ? constraints : {})) !== null && _ref5 !== void 0 ? _ref5 : "Поле должно быть заполнено";
|
|
102687
102847
|
};
|
|
102688
|
-
const valueReferenceExpression = new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath));
|
|
102848
|
+
const valueReferenceExpression = new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_27__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true));
|
|
102689
102849
|
const stringValueReference = new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_6__.CastExpression(valueReferenceExpression, _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_19__.StringType.default);
|
|
102690
102850
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.arrayIsNotEmpty)(enumerationItems)) {
|
|
102691
102851
|
yield this.createCheck(targetPath, new _common_KCLang_CodeDom_OneOfExpression__WEBPACK_IMPORTED_MODULE_23__.OneOfExpression(stringValueReference, enumerationItems.map(item => new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_26__.StringConstExpression(item))), makeMessage({
|
|
@@ -102802,7 +102962,7 @@ class KCLangCalculationsBuildContext {
|
|
|
102802
102962
|
*createBaseTypeValidation(targetPath, baseType, baseDescription) {
|
|
102803
102963
|
var _IterUtils$last3, _IterUtils$last4, _IterUtils$last5, _IterUtils$last6, _IterUtils$last7;
|
|
102804
102964
|
const targetAttributeName = Iterator.from(targetPath.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken);
|
|
102805
|
-
const path = _common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath);
|
|
102965
|
+
const path = _common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_18__.KCLangPath.fromModelPath(targetPath, true);
|
|
102806
102966
|
switch (baseType) {
|
|
102807
102967
|
case "string":
|
|
102808
102968
|
case "pattern":
|
|
@@ -104448,7 +104608,7 @@ class SugarNodeConverterBase {
|
|
|
104448
104608
|
const children = this.buildChildrenKCLangValidations(buildContext, formSchemaRng);
|
|
104449
104609
|
const childrenArray = Iterator.from(children).toArray();
|
|
104450
104610
|
const ownPath = this.node.getOwnPathForKCLang();
|
|
104451
|
-
if (ownPath != undefined) {
|
|
104611
|
+
if (ownPath != undefined && !ownPath.isEmpty()) {
|
|
104452
104612
|
if (childrenArray.length > 0) {
|
|
104453
104613
|
result.push(new _common_KCLang_CodeDom_InBlock__WEBPACK_IMPORTED_MODULE_3__.InBlock(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_4__.KCLangPath.fromModelPath(ownPath, true), childrenArray));
|
|
104454
104614
|
}
|