@kontur.candy/generator 6.30.0-kclang-force-validation.0 → 6.30.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 +57 -59
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -153430,7 +153430,7 @@ class AddRowButtonConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
|
|
|
153430
153430
|
const element = formSchemaRng.getElementByPath(node.getFullPath());
|
|
153431
153431
|
|
|
153432
153432
|
// eslint-disable-next-line no-warning-comments
|
|
153433
|
-
// TODO(2026-
|
|
153433
|
+
// TODO(2026-07-31): Необходимо разобраться с тем, что тут конфликтят свойства в type. Подробности в задаче https://yt.skbkontur.ru/issue/FS-9234
|
|
153434
153434
|
const fakeNode = new _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_7__.TypeNode();
|
|
153435
153435
|
fakeNode.base = "string";
|
|
153436
153436
|
fakeNode.children = [];
|
|
@@ -155769,6 +155769,7 @@ class FilterSelectConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
|
|
|
155769
155769
|
}
|
|
155770
155770
|
markupBuilder.prop(x => x.id).set(node.id);
|
|
155771
155771
|
markupBuilder.prop(x => x.width).set(node.width);
|
|
155772
|
+
markupBuilder.prop(x => x.maxMenuHeight).set(node.maxMenuHeight);
|
|
155772
155773
|
markupBuilder.prop(x => x.emptyItemName).set(node.emptyItemName);
|
|
155773
155774
|
if (node.tableId == undefined) {
|
|
155774
155775
|
throw new _common_XmlParser_XmlNode__WEBPACK_IMPORTED_MODULE_0__.SugarAttributeReadError("TableId для этого контрола обязательно. При необходимости обратитесь к разработчикам", node, "tableId");
|
|
@@ -155842,7 +155843,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
155842
155843
|
|
|
155843
155844
|
|
|
155844
155845
|
|
|
155845
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class3, _class4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
|
|
155846
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _class3, _class4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12;
|
|
155846
155847
|
|
|
155847
155848
|
let FilterSelectItemNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("item", ``, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/MultiControls/FilterSelect sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)(), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("id", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, ``), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("filter", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.objectLiteral(), ``), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("separated", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `Добавляет разделитель после элемента`), _dec(_class = (_class2 = class FilterSelectItemNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
155848
155849
|
constructor(...args) {
|
|
@@ -155873,17 +155874,18 @@ let FilterSelectItemNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPOR
|
|
|
155873
155874
|
writable: true,
|
|
155874
155875
|
initializer: null
|
|
155875
155876
|
}), _class2)) || _class);
|
|
155876
|
-
let FilterSelectNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("filterselect", `Набор преопредленных фильтров`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/MultiControls/FilterSelect sync recursive .md$")), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("multilinePath", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.bindingPath, ``), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("width", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.lengthUnit, `Ширина`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("tableId", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, ``),
|
|
155877
|
-
разными фильтрами. Задается произвольной строкой. Фильтры с одинаковым ключем фильтрации получают одинаковый результат фильтрации`),
|
|
155877
|
+
let FilterSelectNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("filterselect", `Набор преопредленных фильтров`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/MultiControls/FilterSelect sync recursive .md$")), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("multilinePath", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.bindingPath, ``), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("width", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.lengthUnit, `Ширина`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("maxMenuHeight", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, `Максимальная высота меню`), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("tableId", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, ``), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("filteredUniqKey", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string, `Уникальный ключ фильтрации multiline, используется, для фильтраций одних и тех же путей иннера
|
|
155878
|
+
разными фильтрами. Задается произвольной строкой. Фильтры с одинаковым ключем фильтрации получают одинаковый результат фильтрации`), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("emptyItemName", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.localizedString, ``), _dec13 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("id", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, ``), _dec14 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.children)("item", [FilterSelectItemNode]), _dec6(_class3 = (_class4 = class FilterSelectNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
155878
155879
|
constructor(...args) {
|
|
155879
155880
|
super(...args);
|
|
155880
155881
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "multilinePath", _descriptor5, this);
|
|
155881
155882
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "width", _descriptor6, this);
|
|
155882
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
155883
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
155884
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
155885
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
155886
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
155883
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "maxMenuHeight", _descriptor7, this);
|
|
155884
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "tableId", _descriptor8, this);
|
|
155885
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "filteredUniqKey", _descriptor9, this);
|
|
155886
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "emptyItemName", _descriptor10, this);
|
|
155887
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "id", _descriptor11, this);
|
|
155888
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "items", _descriptor12, this);
|
|
155887
155889
|
}
|
|
155888
155890
|
}, _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "multilinePath", [_dec7], {
|
|
155889
155891
|
configurable: true,
|
|
@@ -155895,27 +155897,32 @@ let FilterSelectNode = (_dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED
|
|
|
155895
155897
|
enumerable: true,
|
|
155896
155898
|
writable: true,
|
|
155897
155899
|
initializer: null
|
|
155898
|
-
}), _descriptor7 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "
|
|
155900
|
+
}), _descriptor7 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "maxMenuHeight", [_dec9], {
|
|
155899
155901
|
configurable: true,
|
|
155900
155902
|
enumerable: true,
|
|
155901
155903
|
writable: true,
|
|
155902
155904
|
initializer: null
|
|
155903
|
-
}), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "
|
|
155905
|
+
}), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "tableId", [_dec10], {
|
|
155904
155906
|
configurable: true,
|
|
155905
155907
|
enumerable: true,
|
|
155906
155908
|
writable: true,
|
|
155907
155909
|
initializer: null
|
|
155908
|
-
}), _descriptor9 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "
|
|
155910
|
+
}), _descriptor9 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "filteredUniqKey", [_dec11], {
|
|
155909
155911
|
configurable: true,
|
|
155910
155912
|
enumerable: true,
|
|
155911
155913
|
writable: true,
|
|
155912
155914
|
initializer: null
|
|
155913
|
-
}), _descriptor10 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "
|
|
155915
|
+
}), _descriptor10 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "emptyItemName", [_dec12], {
|
|
155914
155916
|
configurable: true,
|
|
155915
155917
|
enumerable: true,
|
|
155916
155918
|
writable: true,
|
|
155917
155919
|
initializer: null
|
|
155918
|
-
}), _descriptor11 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "
|
|
155920
|
+
}), _descriptor11 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "id", [_dec13], {
|
|
155921
|
+
configurable: true,
|
|
155922
|
+
enumerable: true,
|
|
155923
|
+
writable: true,
|
|
155924
|
+
initializer: null
|
|
155925
|
+
}), _descriptor12 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class4.prototype, "items", [_dec14], {
|
|
155919
155926
|
configurable: true,
|
|
155920
155927
|
enumerable: true,
|
|
155921
155928
|
writable: true,
|
|
@@ -162801,7 +162808,7 @@ class FileLoaderConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4
|
|
|
162801
162808
|
}
|
|
162802
162809
|
|
|
162803
162810
|
// eslint-disable-next-line no-warning-comments
|
|
162804
|
-
// TODO(2026-
|
|
162811
|
+
// TODO(2026-07-31): Исправить в рамках задачи https://yt.skbkontur.ru/issue/FS-9386
|
|
162805
162812
|
*doBuildKCLangValidations_REMOVE_THIS_SUFFIX(buildContext, formSchemaRng, prefixPath) {
|
|
162806
162813
|
const node = this.getCurrentNodeAs(_FileLoaderNode__WEBPACK_IMPORTED_MODULE_11__.FileLoaderNode);
|
|
162807
162814
|
const element = formSchemaRng.getElementByPath(node.getFullPath());
|
|
@@ -168919,16 +168926,11 @@ class KCLangCalculationsBuildContext {
|
|
|
168919
168926
|
var _typeNode$base, _typeNode$description;
|
|
168920
168927
|
const baseName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
|
|
168921
168928
|
const baseDescription = (_typeNode$description = typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _typeNode$description !== void 0 ? _typeNode$description : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description;
|
|
168922
|
-
const isForced = checkNode => {
|
|
168923
|
-
var _typeNode$isNodeForce;
|
|
168924
|
-
return (_typeNode$isNodeForce = typeNode === null || typeNode === void 0 ? void 0 : typeNode.isNodeForced(checkNode)) !== null && _typeNode$isNodeForce !== void 0 ? _typeNode$isNodeForce : false;
|
|
168925
|
-
};
|
|
168926
168929
|
const valueChecks = [];
|
|
168927
168930
|
if (baseName != undefined) {
|
|
168928
168931
|
valueChecks.push(...Iterator.from(this.createBaseTypeValidation(targetPath, baseName, (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_38__.omitLocalization)(baseDescription), node)).toArray());
|
|
168929
168932
|
}
|
|
168930
|
-
valueChecks.push(...Iterator.from(this.createTypeValidations(targetPath, typeNode, schemaTypeNode,
|
|
168931
|
-
const forcedValueChecks = Iterator.from(this.createTypeValidations(targetPath, typeNode, schemaTypeNode, n => isForced(n), false, nodeGId)).toArray();
|
|
168933
|
+
valueChecks.push(...Iterator.from(this.createTypeValidations(targetPath, typeNode, schemaTypeNode, nodeGId)).toArray());
|
|
168932
168934
|
const schemaNode = this.schemaRng.getElementByPath(targetFullPath);
|
|
168933
168935
|
if (!optional) {
|
|
168934
168936
|
var _ref, _ref2, _ref3, _ref4, _allChildrenPaths$len, _allChildrenPaths, _allChildrenPaths2;
|
|
@@ -168967,7 +168969,6 @@ class KCLangCalculationsBuildContext {
|
|
|
168967
168969
|
}
|
|
168968
168970
|
}
|
|
168969
168971
|
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_16__.IfStatement(new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_4__.AndExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_10__.ExistsFunctionCall(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_26__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_17__.KCLangPath.fromModelPath(targetPath, true))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_20__.NotEqExpression(new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_5__.CastExpression(new _common_KCLang_CodeDom_ValueReferenceExpression__WEBPACK_IMPORTED_MODULE_26__.ValueReferenceExpression(_common_KCLang_CodeDom_KCLangPath__WEBPACK_IMPORTED_MODULE_17__.KCLangPath.fromModelPath(targetPath, true)), _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_18__.StringType.default), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression(""))), valueChecks);
|
|
168970
|
-
yield* forcedValueChecks;
|
|
168971
168972
|
}
|
|
168972
168973
|
getFirstAcceptedParent(schemaNode) {
|
|
168973
168974
|
let parentNode = schemaNode === null || schemaNode === void 0 ? void 0 : schemaNode.parent;
|
|
@@ -168994,15 +168995,11 @@ class KCLangCalculationsBuildContext {
|
|
|
168994
168995
|
}
|
|
168995
168996
|
return new _common_KCLang_CodeDom_CheckStatement__WEBPACK_IMPORTED_MODULE_6__.CheckStatement(condition, withBlocks);
|
|
168996
168997
|
}
|
|
168997
|
-
*createTypeValidations(targetPath, typeNode, schemaTypeNode,
|
|
168998
|
-
var _typeNode$
|
|
168999
|
-
const typeCheckNodes = ((_typeNode$flattenType = typeNode === null || typeNode === void 0 ? void 0 : typeNode.flattenTypeCheckNodes()) !== null && _typeNode$flattenType !== void 0 ? _typeNode$flattenType : []).filter(nodeFilter);
|
|
169000
|
-
const findCheck = cl => typeCheckNodes.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(cl));
|
|
169001
|
-
const filterChecks = cl => typeCheckNodes.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(cl));
|
|
169002
|
-
const schema = includeSchemaConstraints ? schemaTypeNode : undefined;
|
|
168998
|
+
*createTypeValidations(targetPath, typeNode, schemaTypeNode, nodeGId) {
|
|
168999
|
+
var _typeNode$checkType, _typeNode$children$fi, _typeNode$children, _schemaTypeNode$enume, _digest$gId, _typeNode$children2, _typeNodeLength$value, _typeNode$children3, _typeNodeMinLength$va, _typeNode$children4, _typeNodeMaxLength$va, _typeNode$children5, _typeNodeMinInclusive, _typeNode$children6, _typeNodeMinExclusive, _typeNode$children7, _typeNodeMaxInclusive, _typeNode$children8, _typeNodeMaxExclusive, _typeNode$children9, _typeNodeTotalDigits$, _typeNode$children$fi2, _typeNode$children10, _typeNode$children11, _typeNode$children$fi3, _typeNode$children12, _schemaTypeNode$patte, _typeNode$children13, _typeNodeInteger$valu, _typeNode$children14, _typeNodeFractional$v, _ref10, _typeNode$children$fi4, _typeNode$children15, _typeNode$children16, _typeNode$base2;
|
|
169003
169000
|
const checkType = (_typeNode$checkType = typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _typeNode$checkType !== void 0 ? _typeNode$checkType : "error";
|
|
169004
|
-
const typeNodeEnumerations =
|
|
169005
|
-
const enumerationItems = (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayIsNotEmpty)(typeNodeEnumerations) ? typeNodeEnumerations : (
|
|
169001
|
+
const typeNodeEnumerations = (_typeNode$children$fi = typeNode === null || typeNode === void 0 || (_typeNode$children = typeNode.children) === null || _typeNode$children === void 0 || (_typeNode$children = _typeNode$children.filter(x => x instanceof _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.EnumerationTypeCheckNode)) === null || _typeNode$children === void 0 ? void 0 : _typeNode$children.map(x => x.value)) !== null && _typeNode$children$fi !== void 0 ? _typeNode$children$fi : [];
|
|
169002
|
+
const enumerationItems = (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayIsNotEmpty)(typeNodeEnumerations) ? typeNodeEnumerations : (_schemaTypeNode$enume = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.enumeration) !== null && _schemaTypeNode$enume !== void 0 ? _schemaTypeNode$enume : [];
|
|
169006
169003
|
const makeMessage = (constraints, sugarTypeCheckDescription, sugarTypeDescription, schemaTypeDescription) => {
|
|
169007
169004
|
var _ref5, _ref6, _ref7, _omitLocalization;
|
|
169008
169005
|
return (_ref5 = (_ref6 = (_ref7 = (_omitLocalization = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_38__.omitLocalization)(sugarTypeCheckDescription)) !== null && _omitLocalization !== void 0 ? _omitLocalization : (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_38__.omitLocalization)(sugarTypeDescription)) !== null && _ref7 !== void 0 ? _ref7 : (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_38__.omitLocalization)(schemaTypeDescription)) !== null && _ref6 !== void 0 ? _ref6 : _common_SchemaRng_StringTypeMessageGenerator__WEBPACK_IMPORTED_MODULE_30__.StringTypeMessageGenerator.generate(constraints !== null && constraints !== void 0 ? constraints : {})) !== null && _ref5 !== void 0 ? _ref5 : "Поле должно быть заполнено";
|
|
@@ -169014,7 +169011,7 @@ class KCLangCalculationsBuildContext {
|
|
|
169014
169011
|
enumerationAllowedValues: enumerationItems
|
|
169015
169012
|
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169016
169013
|
}
|
|
169017
|
-
const digest =
|
|
169014
|
+
const digest = typeNode === null || typeNode === void 0 ? void 0 : typeNode.getValidations(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.DigestcheckTypeCheckNode).find(x => x);
|
|
169018
169015
|
const gId = (_digest$gId = digest === null || digest === void 0 ? void 0 : digest.gId) !== null && _digest$gId !== void 0 ? _digest$gId : nodeGId;
|
|
169019
169016
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrEmpty)(gId) && digest != undefined) {
|
|
169020
169017
|
var _digest$keyColumnName, _digest$keyColumnName2, _ref8, _digest$description, _ref9, _digest$checkType;
|
|
@@ -169022,8 +169019,8 @@ class KCLangCalculationsBuildContext {
|
|
|
169022
169019
|
const ruleBody = new _common_KCLang_CodeDom_OrExpression__WEBPACK_IMPORTED_MODULE_23__.OrExpression(new _common_KCLang_CodeDom_OrExpression__WEBPACK_IMPORTED_MODULE_23__.OrExpression(new _common_KCLang_CodeDom_NotExpression__WEBPACK_IMPORTED_MODULE_21__.NotExpression(new _common_KCLang_CodeDom_Functions_ExistsFunctionCall__WEBPACK_IMPORTED_MODULE_10__.ExistsFunctionCall(valueReferenceExpression)), new _common_KCLang_CodeDom_EqExpression__WEBPACK_IMPORTED_MODULE_9__.EqExpression(stringValueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression(""))), new _common_KCLang_CodeDom_NotEqExpression__WEBPACK_IMPORTED_MODULE_20__.NotEqExpression(new _common_KCLang_CodeDom_Functions_JoinFunctionCall__WEBPACK_IMPORTED_MODULE_12__.JoinFunctionCall(new _common_KCLang_CodeDom_Functions_GetPicklistValuesFunctionCall__WEBPACK_IMPORTED_MODULE_11__.GetPicklistValuesFunctionCall(new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression(gId), new _common_KCLang_CodeDom_StringArrayConstExpression__WEBPACK_IMPORTED_MODULE_24__.StringArrayConstExpression([new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression((_digest$keyColumnName = digest.keyColumnName) !== null && _digest$keyColumnName !== void 0 ? _digest$keyColumnName : "code")]), new _common_KCLang_CodeDom_StringArrayConstExpression__WEBPACK_IMPORTED_MODULE_24__.StringArrayConstExpression([stringValueReference]), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression((_digest$keyColumnName2 = digest.keyColumnName) !== null && _digest$keyColumnName2 !== void 0 ? _digest$keyColumnName2 : "code"))), new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression("")));
|
|
169023
169020
|
yield this.createCheck(targetPath, ruleBody, (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_38__.omitLocalization)((_ref8 = (_digest$description = digest.description) !== null && _digest$description !== void 0 ? _digest$description : typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _ref8 !== void 0 ? _ref8 : "Поле заполнено не по справочнику"), (_ref9 = (_digest$checkType = digest.checkType) !== null && _digest$checkType !== void 0 ? _digest$checkType : typeNode === null || typeNode === void 0 ? void 0 : typeNode.checkType) !== null && _ref9 !== void 0 ? _ref9 : "error");
|
|
169024
169021
|
}
|
|
169025
|
-
const typeNodeLength =
|
|
169026
|
-
const lengthValue = (_typeNodeLength$value = typeNodeLength === null || typeNodeLength === void 0 ? void 0 : typeNodeLength.value) !== null && _typeNodeLength$value !== void 0 ? _typeNodeLength$value :
|
|
169022
|
+
const typeNodeLength = typeNode === null || typeNode === void 0 || (_typeNode$children2 = typeNode.children) === null || _typeNode$children2 === void 0 ? void 0 : _typeNode$children2.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.LengthTypeCheckNode));
|
|
169023
|
+
const lengthValue = (_typeNodeLength$value = typeNodeLength === null || typeNodeLength === void 0 ? void 0 : typeNodeLength.value) !== null && _typeNodeLength$value !== void 0 ? _typeNodeLength$value : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.length;
|
|
169027
169024
|
if (lengthValue != undefined) {
|
|
169028
169025
|
var _typeNodeLength$check;
|
|
169029
169026
|
yield this.createCheck(targetPath, new _common_KCLang_CodeDom_EqExpression__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _common_KCLang_CodeDom_Functions_LengthFunctionCall__WEBPACK_IMPORTED_MODULE_13__.LengthFunctionCall(stringValueReference), new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(lengthValue)), makeMessage({
|
|
@@ -169032,10 +169029,10 @@ class KCLangCalculationsBuildContext {
|
|
|
169032
169029
|
}
|
|
169033
169030
|
const valueReference = stringValueReference;
|
|
169034
169031
|
const decimalValueReference = valueReferenceExpression;
|
|
169035
|
-
const typeNodeMinLength =
|
|
169036
|
-
const minLengthValue = (_typeNodeMinLength$va = typeNodeMinLength === null || typeNodeMinLength === void 0 ? void 0 : typeNodeMinLength.value) !== null && _typeNodeMinLength$va !== void 0 ? _typeNodeMinLength$va :
|
|
169037
|
-
const typeNodeMaxLength =
|
|
169038
|
-
const maxLengthValue = (_typeNodeMaxLength$va = typeNodeMaxLength === null || typeNodeMaxLength === void 0 ? void 0 : typeNodeMaxLength.value) !== null && _typeNodeMaxLength$va !== void 0 ? _typeNodeMaxLength$va :
|
|
169032
|
+
const typeNodeMinLength = typeNode === null || typeNode === void 0 || (_typeNode$children3 = typeNode.children) === null || _typeNode$children3 === void 0 ? void 0 : _typeNode$children3.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MinlengthTypeCheckNode));
|
|
169033
|
+
const minLengthValue = (_typeNodeMinLength$va = typeNodeMinLength === null || typeNodeMinLength === void 0 ? void 0 : typeNodeMinLength.value) !== null && _typeNodeMinLength$va !== void 0 ? _typeNodeMinLength$va : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minLength;
|
|
169034
|
+
const typeNodeMaxLength = typeNode === null || typeNode === void 0 || (_typeNode$children4 = typeNode.children) === null || _typeNode$children4 === void 0 ? void 0 : _typeNode$children4.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MaxlengthTypeCheckNode));
|
|
169035
|
+
const maxLengthValue = (_typeNodeMaxLength$va = typeNodeMaxLength === null || typeNodeMaxLength === void 0 ? void 0 : typeNodeMaxLength.value) !== null && _typeNodeMaxLength$va !== void 0 ? _typeNodeMaxLength$va : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxLength;
|
|
169039
169036
|
if (minLengthValue != undefined && maxLengthValue != undefined) {
|
|
169040
169037
|
var _typeNodeMinLength$de;
|
|
169041
169038
|
const lengthExprRuleBody = new _common_KCLang_CodeDom_AndExpression__WEBPACK_IMPORTED_MODULE_4__.AndExpression(new _common_KCLang_CodeDom_GeExpression__WEBPACK_IMPORTED_MODULE_15__.GeExpression(new _common_KCLang_CodeDom_Functions_LengthFunctionCall__WEBPACK_IMPORTED_MODULE_13__.LengthFunctionCall(valueReference), new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(minLengthValue)), new _common_KCLang_CodeDom_LeExpression__WEBPACK_IMPORTED_MODULE_19__.LeExpression(new _common_KCLang_CodeDom_Functions_LengthFunctionCall__WEBPACK_IMPORTED_MODULE_13__.LengthFunctionCall(valueReference), new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(maxLengthValue)));
|
|
@@ -169054,32 +169051,32 @@ class KCLangCalculationsBuildContext {
|
|
|
169054
169051
|
maxLength: maxLengthValue
|
|
169055
169052
|
}, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169056
169053
|
}
|
|
169057
|
-
const typeNodeMinInclusive =
|
|
169058
|
-
const minInclusiveValue = (_typeNodeMinInclusive = typeNodeMinInclusive === null || typeNodeMinInclusive === void 0 ? void 0 : typeNodeMinInclusive.value) !== null && _typeNodeMinInclusive !== void 0 ? _typeNodeMinInclusive :
|
|
169054
|
+
const typeNodeMinInclusive = typeNode === null || typeNode === void 0 || (_typeNode$children5 = typeNode.children) === null || _typeNode$children5 === void 0 ? void 0 : _typeNode$children5.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MininclusiveTypeCheckNode));
|
|
169055
|
+
const minInclusiveValue = (_typeNodeMinInclusive = typeNodeMinInclusive === null || typeNodeMinInclusive === void 0 ? void 0 : typeNodeMinInclusive.value) !== null && _typeNodeMinInclusive !== void 0 ? _typeNodeMinInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minInclusive;
|
|
169059
169056
|
if (minInclusiveValue != undefined) {
|
|
169060
169057
|
const minInclusiveRuleBody = new _common_KCLang_CodeDom_GeExpression__WEBPACK_IMPORTED_MODULE_15__.GeExpression(decimalValueReference, new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(minInclusiveValue));
|
|
169061
169058
|
yield this.createCheck(targetPath, minInclusiveRuleBody, makeMessage({
|
|
169062
169059
|
minInclusive: minInclusiveValue
|
|
169063
169060
|
}, typeNodeMinInclusive === null || typeNodeMinInclusive === void 0 ? void 0 : typeNodeMinInclusive.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169064
169061
|
}
|
|
169065
|
-
const typeNodeMinExclusive =
|
|
169066
|
-
const minExclusiveValue = (_typeNodeMinExclusive = typeNodeMinExclusive === null || typeNodeMinExclusive === void 0 ? void 0 : typeNodeMinExclusive.value) !== null && _typeNodeMinExclusive !== void 0 ? _typeNodeMinExclusive :
|
|
169062
|
+
const typeNodeMinExclusive = typeNode === null || typeNode === void 0 || (_typeNode$children6 = typeNode.children) === null || _typeNode$children6 === void 0 ? void 0 : _typeNode$children6.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MinExclusiveTypeCheckNode));
|
|
169063
|
+
const minExclusiveValue = (_typeNodeMinExclusive = typeNodeMinExclusive === null || typeNodeMinExclusive === void 0 ? void 0 : typeNodeMinExclusive.value) !== null && _typeNodeMinExclusive !== void 0 ? _typeNodeMinExclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.minExclusive;
|
|
169067
169064
|
if (minExclusiveValue != undefined) {
|
|
169068
169065
|
const minExclusiveRuleBody = new _common_KCLang_CodeDom_GtExpression__WEBPACK_IMPORTED_MODULE_35__.GtExpression(decimalValueReference, new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(minExclusiveValue));
|
|
169069
169066
|
yield this.createCheck(targetPath, minExclusiveRuleBody, makeMessage({
|
|
169070
169067
|
minExclusive: minExclusiveValue
|
|
169071
169068
|
}, typeNodeMinExclusive === null || typeNodeMinExclusive === void 0 ? void 0 : typeNodeMinExclusive.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169072
169069
|
}
|
|
169073
|
-
const typeNodeMaxInclusive =
|
|
169074
|
-
const maxInclusiveValue = (_typeNodeMaxInclusive = typeNodeMaxInclusive === null || typeNodeMaxInclusive === void 0 ? void 0 : typeNodeMaxInclusive.value) !== null && _typeNodeMaxInclusive !== void 0 ? _typeNodeMaxInclusive :
|
|
169070
|
+
const typeNodeMaxInclusive = typeNode === null || typeNode === void 0 || (_typeNode$children7 = typeNode.children) === null || _typeNode$children7 === void 0 ? void 0 : _typeNode$children7.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MaxinclusiveTypeCheckNode));
|
|
169071
|
+
const maxInclusiveValue = (_typeNodeMaxInclusive = typeNodeMaxInclusive === null || typeNodeMaxInclusive === void 0 ? void 0 : typeNodeMaxInclusive.value) !== null && _typeNodeMaxInclusive !== void 0 ? _typeNodeMaxInclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxInclusive;
|
|
169075
169072
|
if (maxInclusiveValue != undefined) {
|
|
169076
169073
|
const maxInclusiveRuleBody = new _common_KCLang_CodeDom_LeExpression__WEBPACK_IMPORTED_MODULE_19__.LeExpression(decimalValueReference, new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(maxInclusiveValue));
|
|
169077
169074
|
yield this.createCheck(targetPath, maxInclusiveRuleBody, makeMessage({
|
|
169078
169075
|
maxInclusive: maxInclusiveValue
|
|
169079
169076
|
}, typeNodeMaxInclusive === null || typeNodeMaxInclusive === void 0 ? void 0 : typeNodeMaxInclusive.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169080
169077
|
}
|
|
169081
|
-
const typeNodeMaxExclusive =
|
|
169082
|
-
const maxExclusiveValue = (_typeNodeMaxExclusive = typeNodeMaxExclusive === null || typeNodeMaxExclusive === void 0 ? void 0 : typeNodeMaxExclusive.value) !== null && _typeNodeMaxExclusive !== void 0 ? _typeNodeMaxExclusive :
|
|
169078
|
+
const typeNodeMaxExclusive = typeNode === null || typeNode === void 0 || (_typeNode$children8 = typeNode.children) === null || _typeNode$children8 === void 0 ? void 0 : _typeNode$children8.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.MaxExclusiveTypeCheckNode));
|
|
169079
|
+
const maxExclusiveValue = (_typeNodeMaxExclusive = typeNodeMaxExclusive === null || typeNodeMaxExclusive === void 0 ? void 0 : typeNodeMaxExclusive.value) !== null && _typeNodeMaxExclusive !== void 0 ? _typeNodeMaxExclusive : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.maxExclusive;
|
|
169083
169080
|
if (maxExclusiveValue != undefined) {
|
|
169084
169081
|
const maxExclusiveRuleBody = new _common_KCLang_CodeDom_LtExpression__WEBPACK_IMPORTED_MODULE_36__.LtExpression(decimalValueReference, new _common_KCLang_CodeDom_DecimalConstExpression__WEBPACK_IMPORTED_MODULE_7__.DecimalConstExpression(maxExclusiveValue));
|
|
169085
169082
|
yield this.createCheck(targetPath, maxExclusiveRuleBody, makeMessage({
|
|
@@ -169087,19 +169084,18 @@ class KCLangCalculationsBuildContext {
|
|
|
169087
169084
|
}, typeNodeMaxExclusive === null || typeNodeMaxExclusive === void 0 ? void 0 : typeNodeMaxExclusive.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType);
|
|
169088
169085
|
}
|
|
169089
169086
|
const isDecimalCondition = new _common_KCLang_CodeDom_Functions_RegexMatchFunctionCall__WEBPACK_IMPORTED_MODULE_14__.RegexMatchFunctionCall(valueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression("^-?\\d+(([.]\\d+$)|($))"));
|
|
169090
|
-
const typeNodeTotalDigits =
|
|
169091
|
-
const totalDigitsValue = (_typeNodeTotalDigits$ = typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.value) !== null && _typeNodeTotalDigits$ !== void 0 ? _typeNodeTotalDigits$ :
|
|
169087
|
+
const typeNodeTotalDigits = typeNode === null || typeNode === void 0 || (_typeNode$children9 = typeNode.children) === null || _typeNode$children9 === void 0 ? void 0 : _typeNode$children9.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.TotaldigitsTypeCheckNode));
|
|
169088
|
+
const totalDigitsValue = (_typeNodeTotalDigits$ = typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.value) !== null && _typeNodeTotalDigits$ !== void 0 ? _typeNodeTotalDigits$ : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.totalDigits;
|
|
169092
169089
|
if (totalDigitsValue != undefined) {
|
|
169093
169090
|
const totalDigitsRuleBody = new _common_KCLang_CodeDom_Functions_RegexMatchFunctionCall__WEBPACK_IMPORTED_MODULE_14__.RegexMatchFunctionCall(valueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression("^-?(\\.?\\d){0," + totalDigitsValue.toString() + "}$"));
|
|
169094
169091
|
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_16__.IfStatement(isDecimalCondition, [this.createCheck(targetPath, totalDigitsRuleBody, makeMessage({
|
|
169095
169092
|
totalDigitsMaxCount: totalDigitsValue
|
|
169096
169093
|
}, typeNodeTotalDigits === null || typeNodeTotalDigits === void 0 ? void 0 : typeNodeTotalDigits.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType)]);
|
|
169097
169094
|
}
|
|
169098
|
-
const
|
|
169099
|
-
const
|
|
169100
|
-
const
|
|
169101
|
-
const
|
|
169102
|
-
const stringPatterns = ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayIsNotEmpty)(typeNodePatterns) ? typeNodePatterns : (_schema$patterns = schema === null || schema === void 0 ? void 0 : schema.patterns) !== null && _schema$patterns !== void 0 ? _schema$patterns : []).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined);
|
|
169095
|
+
const typeNodePatterns = (_typeNode$children$fi2 = typeNode === null || typeNode === void 0 || (_typeNode$children10 = typeNode.children) === null || _typeNode$children10 === void 0 ? void 0 : _typeNode$children10.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.PatternTypeCheckNode)).map(x => x.value).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined)) !== null && _typeNode$children$fi2 !== void 0 ? _typeNode$children$fi2 : [];
|
|
169096
|
+
const firstItemDescription = typeNode === null || typeNode === void 0 || (_typeNode$children11 = typeNode.children) === null || _typeNode$children11 === void 0 || (_typeNode$children11 = _typeNode$children11.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.PatternTypeCheckNode)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined)) === null || _typeNode$children11 === void 0 || (_typeNode$children11 = _typeNode$children11[0]) === null || _typeNode$children11 === void 0 ? void 0 : _typeNode$children11.description;
|
|
169097
|
+
const firstItemCheckType = (_typeNode$children$fi3 = typeNode === null || typeNode === void 0 || (_typeNode$children12 = typeNode.children) === null || _typeNode$children12 === void 0 || (_typeNode$children12 = _typeNode$children12.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.PatternTypeCheckNode)).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined)) === null || _typeNode$children12 === void 0 || (_typeNode$children12 = _typeNode$children12[0]) === null || _typeNode$children12 === void 0 ? void 0 : _typeNode$children12.checkType) !== null && _typeNode$children$fi3 !== void 0 ? _typeNode$children$fi3 : checkType;
|
|
169098
|
+
const stringPatterns = ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.arrayIsNotEmpty)(typeNodePatterns) ? typeNodePatterns : (_schemaTypeNode$patte = schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.patterns) !== null && _schemaTypeNode$patte !== void 0 ? _schemaTypeNode$patte : []).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.isNotNullOrUndefined);
|
|
169103
169099
|
const patterns = stringPatterns.map(pattern => new _common_KCLang_CodeDom_Functions_RegexMatchFunctionCall__WEBPACK_IMPORTED_MODULE_14__.RegexMatchFunctionCall(valueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression(pattern))).reduce((acc, current) => acc != undefined ? new _common_KCLang_CodeDom_OrExpression__WEBPACK_IMPORTED_MODULE_23__.OrExpression(acc, current) : current, undefined);
|
|
169104
169100
|
if (patterns != undefined) {
|
|
169105
169101
|
const stringPatternsRuleBody = patterns;
|
|
@@ -169107,28 +169103,30 @@ class KCLangCalculationsBuildContext {
|
|
|
169107
169103
|
patterns: stringPatterns
|
|
169108
169104
|
}, firstItemDescription, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), firstItemCheckType);
|
|
169109
169105
|
}
|
|
169110
|
-
const typeNodeInteger =
|
|
169111
|
-
const integerDigits = (_typeNodeInteger$valu = typeNodeInteger === null || typeNodeInteger === void 0 ? void 0 : typeNodeInteger.value) !== null && _typeNodeInteger$valu !== void 0 ? _typeNodeInteger$valu :
|
|
169106
|
+
const typeNodeInteger = typeNode === null || typeNode === void 0 || (_typeNode$children13 = typeNode.children) === null || _typeNode$children13 === void 0 ? void 0 : _typeNode$children13.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.IntegerdigitsTypeCheckNode));
|
|
169107
|
+
const integerDigits = (_typeNodeInteger$valu = typeNodeInteger === null || typeNodeInteger === void 0 ? void 0 : typeNodeInteger.value) !== null && _typeNodeInteger$valu !== void 0 ? _typeNodeInteger$valu : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.integerDigits;
|
|
169112
169108
|
if (integerDigits != undefined) {
|
|
169113
169109
|
const integerDigitsRuleBody = new _common_KCLang_CodeDom_Functions_RegexMatchFunctionCall__WEBPACK_IMPORTED_MODULE_14__.RegexMatchFunctionCall(valueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression("^-?\\d{0," + integerDigits.toString() + "}(([.]\\d+$)|($))"));
|
|
169114
169110
|
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_16__.IfStatement(isDecimalCondition, [this.createCheck(targetPath, integerDigitsRuleBody, makeMessage({
|
|
169115
169111
|
integerDigitsMaxCount: integerDigits
|
|
169116
169112
|
}, typeNodeInteger === null || typeNodeInteger === void 0 ? void 0 : typeNodeInteger.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType)]);
|
|
169117
169113
|
}
|
|
169118
|
-
const typeNodeFractional =
|
|
169119
|
-
const fractionalDigits = (_typeNodeFractional$v = typeNodeFractional === null || typeNodeFractional === void 0 ? void 0 : typeNodeFractional.value) !== null && _typeNodeFractional$v !== void 0 ? _typeNodeFractional$v :
|
|
169114
|
+
const typeNodeFractional = typeNode === null || typeNode === void 0 || (_typeNode$children14 = typeNode.children) === null || _typeNode$children14 === void 0 ? void 0 : _typeNode$children14.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.FractiondigitsTypeCheckNode));
|
|
169115
|
+
const fractionalDigits = (_typeNodeFractional$v = typeNodeFractional === null || typeNodeFractional === void 0 ? void 0 : typeNodeFractional.value) !== null && _typeNodeFractional$v !== void 0 ? _typeNodeFractional$v : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.fractionDigits;
|
|
169120
169116
|
if (fractionalDigits != undefined) {
|
|
169121
169117
|
const fractionalDigitsRuleBody = new _common_KCLang_CodeDom_Functions_RegexMatchFunctionCall__WEBPACK_IMPORTED_MODULE_14__.RegexMatchFunctionCall(valueReference, new _common_KCLang_CodeDom_StringConstExpression__WEBPACK_IMPORTED_MODULE_25__.StringConstExpression("^-?\\d+(([.]\\d{0," + fractionalDigits.toString() + "}$)|($))"));
|
|
169122
169118
|
yield new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_16__.IfStatement(isDecimalCondition, [this.createCheck(targetPath, fractionalDigitsRuleBody, makeMessage({
|
|
169123
169119
|
fractionalDigitsMaxCount: fractionalDigits
|
|
169124
169120
|
}, typeNodeFractional === null || typeNodeFractional === void 0 ? void 0 : typeNodeFractional.description, typeNode === null || typeNode === void 0 ? void 0 : typeNode.description, schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description), checkType)]);
|
|
169125
169121
|
}
|
|
169126
|
-
const valueEqlAutoValueErrorLevel = (_ref10 = (
|
|
169122
|
+
const valueEqlAutoValueErrorLevel = (_ref10 = (_typeNode$children$fi4 = typeNode === null || typeNode === void 0 || (_typeNode$children15 = typeNode.children) === null || _typeNode$children15 === void 0 || (_typeNode$children15 = _typeNode$children15.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_common_SchemaRng_Nodes_SchemaRngRoot__WEBPACK_IMPORTED_MODULE_29__.ValueEqlAutoValueTypeCheck))) === null || _typeNode$children15 === void 0 ? void 0 : _typeNode$children15.level) !== null && _typeNode$children$fi4 !== void 0 ? _typeNode$children$fi4 : typeNode === null || typeNode === void 0 || (_typeNode$children16 = typeNode.children) === null || _typeNode$children16 === void 0 || (_typeNode$children16 = _typeNode$children16.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ValueEqlAutoValueTypeCheckNode))) === null || _typeNode$children16 === void 0 ? void 0 : _typeNode$children16.level) !== null && _ref10 !== void 0 ? _ref10 : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.valueEqlAutoValue;
|
|
169127
169123
|
const baseName = (_typeNode$base2 = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base2 !== void 0 ? _typeNode$base2 : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
|
|
169128
169124
|
if (valueEqlAutoValueErrorLevel != undefined) {
|
|
169129
|
-
var
|
|
169125
|
+
var _typeNode$children$fi5, _typeNode$children17, _typeNode$children18, _typeNode$children$fi6, _typeNode$children19, _typeNode$children20;
|
|
169130
169126
|
const isDecimal = baseName == "decimal";
|
|
169131
|
-
|
|
169127
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
169128
|
+
(_typeNode$children$fi5 = typeNode === null || typeNode === void 0 || (_typeNode$children17 = typeNode.children) === null || _typeNode$children17 === void 0 || (_typeNode$children17 = _typeNode$children17.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_common_SchemaRng_Nodes_SchemaRngRoot__WEBPACK_IMPORTED_MODULE_29__.ValueEqlAutoValueTypeCheck))) === null || _typeNode$children17 === void 0 ? void 0 : _typeNode$children17.condition) !== null && _typeNode$children$fi5 !== void 0 ? _typeNode$children$fi5 : typeNode === null || typeNode === void 0 || (_typeNode$children18 = typeNode.children) === null || _typeNode$children18 === void 0 || (_typeNode$children18 = _typeNode$children18.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ValueEqlAutoValueTypeCheckNode))) === null || _typeNode$children18 === void 0 ? void 0 : _typeNode$children18.condition;
|
|
169129
|
+
const validationCondition = (_typeNode$children$fi6 = typeNode === null || typeNode === void 0 || (_typeNode$children19 = typeNode.children) === null || _typeNode$children19 === void 0 || (_typeNode$children19 = _typeNode$children19.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_common_SchemaRng_Nodes_SchemaRngRoot__WEBPACK_IMPORTED_MODULE_29__.ValueEqlAutoValueTypeCheck))) === null || _typeNode$children19 === void 0 ? void 0 : _typeNode$children19.condition) !== null && _typeNode$children$fi6 !== void 0 ? _typeNode$children$fi6 : typeNode === null || typeNode === void 0 || (_typeNode$children20 = typeNode.children) === null || _typeNode$children20 === void 0 || (_typeNode$children20 = _typeNode$children20.find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_32__.ValueEqlAutoValueTypeCheckNode))) === null || _typeNode$children20 === void 0 ? void 0 : _typeNode$children20.condition;
|
|
169132
169130
|
let result = this.createCheck(targetPath, new _common_KCLang_CodeDom_Functions_IsEqualToAutoCalculatedFunctionCall__WEBPACK_IMPORTED_MODULE_33__.IsEqualToAutoCalculatedFunctionCall(isDecimal ? new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_5__.CastExpression(valueReferenceExpression, _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_18__.DecimalType.default) : new _common_KCLang_CodeDom_CastExpression__WEBPACK_IMPORTED_MODULE_5__.CastExpression(valueReferenceExpression, _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_18__.StringType.default)), _Common_AutoValidationUtils__WEBPACK_IMPORTED_MODULE_0__.AutoValidationMessage, valueEqlAutoValueErrorLevel !== null && valueEqlAutoValueErrorLevel !== void 0 ? valueEqlAutoValueErrorLevel : checkType);
|
|
169133
169131
|
if (validationCondition != undefined) {
|
|
169134
169132
|
result = new _common_KCLang_CodeDom_IfStatement__WEBPACK_IMPORTED_MODULE_16__.IfStatement(new _common_KCLang_CodeDom_KCLangRawStringExpression__WEBPACK_IMPORTED_MODULE_34__.KCLangRawStringExpression(validationCondition, _common_KCLang_CodeDom_KCLangType__WEBPACK_IMPORTED_MODULE_18__.BoolType.default), [result]);
|