@kontur.candy/generator 5.58.1-novalidationsmchd.0 → 5.59.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 +22 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49607,15 +49607,16 @@ class KCLangAntlrVisitor {
|
|
|
49607
49607
|
}
|
|
49608
49608
|
}
|
|
49609
49609
|
visitWithBlock(ctx) {
|
|
49610
|
-
var _ctx$withBlockValue;
|
|
49611
|
-
const
|
|
49610
|
+
var _ctx$withBlockValue, _ctx$withBlockValue2;
|
|
49611
|
+
const hasInterpolation = ((_ctx$withBlockValue = ctx.withBlockValue()) === null || _ctx$withBlockValue === void 0 ? void 0 : _ctx$withBlockValue.interpolationExpression()) != undefined;
|
|
49612
|
+
const value = (_ctx$withBlockValue2 = ctx.withBlockValue()) === null || _ctx$withBlockValue2 === void 0 ? void 0 : _ctx$withBlockValue2.text;
|
|
49612
49613
|
if (value == undefined) {
|
|
49613
49614
|
throw Error("visitWithBlock syntax incorrect");
|
|
49614
49615
|
}
|
|
49615
49616
|
return {
|
|
49616
49617
|
type: "withBlock",
|
|
49617
49618
|
name: ctx.NAME().text,
|
|
49618
|
-
value: value.replace(/```/g, "")
|
|
49619
|
+
value: hasInterpolation ? value.replace(/```/g, "") : value.replace(/^'|^"|'$|"$/g, "")
|
|
49619
49620
|
};
|
|
49620
49621
|
}
|
|
49621
49622
|
visitFormula(ctx) {
|
|
@@ -67563,7 +67564,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
|
|
|
67563
67564
|
const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
|
|
67564
67565
|
const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, useSchemaValidations);
|
|
67565
67566
|
const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
|
|
67566
|
-
const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
|
|
67567
|
+
const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, false);
|
|
67567
67568
|
const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
|
|
67568
67569
|
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
|
|
67569
67570
|
});
|
|
@@ -71322,14 +71323,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71322
71323
|
* Базовый нормализатор для основного сценария серверной нормализации
|
|
71323
71324
|
*/
|
|
71324
71325
|
class NormalizationRulesGenerator {
|
|
71325
|
-
constructor(optionalSectionRulesBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng) {
|
|
71326
|
+
constructor(optionalSectionRulesBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, calculateServerOnlyPaths) {
|
|
71326
71327
|
this.formulaRulesBuilder = void 0;
|
|
71328
|
+
this.calculateServerOnlyPaths = void 0;
|
|
71327
71329
|
this.initializationRulesBuilder = void 0;
|
|
71328
71330
|
this.sugarRulesBuilder = void 0;
|
|
71329
71331
|
this.lazyLoadingRulesBuilder = void 0;
|
|
71330
71332
|
this.validationRulesBuilder = void 0;
|
|
71331
71333
|
this.optionalSectionRulesBuilder = void 0;
|
|
71332
71334
|
this.formSchemaRng = void 0;
|
|
71335
|
+
this.calculateServerOnlyPaths = calculateServerOnlyPaths;
|
|
71333
71336
|
this.formulaRulesBuilder = formulaRulesBuilder;
|
|
71334
71337
|
this.initializationRulesBuilder = initializationRulesBuilder;
|
|
71335
71338
|
this.sugarRulesBuilder = sugarRulesBuilder;
|
|
@@ -71351,11 +71354,11 @@ class NormalizationRulesGenerator {
|
|
|
71351
71354
|
(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.ensureCorrectFieldNameByExpressionType)(rule);
|
|
71352
71355
|
return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule);
|
|
71353
71356
|
}).toArray();
|
|
71354
|
-
const
|
|
71357
|
+
const getDictionaryTargets = () => Iterator.from(allRules).filter(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && (rule.right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression && rule.right.expression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.expression.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict)).map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.isNotNullOrUndefined).toArray();
|
|
71355
71358
|
const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
|
|
71356
71359
|
return {
|
|
71357
71360
|
content: content,
|
|
71358
|
-
serverOnlyPaths:
|
|
71361
|
+
serverOnlyPaths: this.calculateServerOnlyPaths ? getDictionaryTargets() : []
|
|
71359
71362
|
};
|
|
71360
71363
|
}
|
|
71361
71364
|
}
|
|
@@ -71851,10 +71854,12 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71851
71854
|
const currentExpression = (_targetCtx$path = targetCtx[path]) !== null && _targetCtx$path !== void 0 ? _targetCtx$path : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression();
|
|
71852
71855
|
const validationRule = this.generateValidationText(currentExpression, current);
|
|
71853
71856
|
targetCtx[path] = validationRule;
|
|
71857
|
+
ctx.additionalRules.push(...current.precalculationRules);
|
|
71854
71858
|
return ctx;
|
|
71855
71859
|
}, {
|
|
71856
71860
|
errors: {},
|
|
71857
|
-
warnings: {}
|
|
71861
|
+
warnings: {},
|
|
71862
|
+
additionalRules: []
|
|
71858
71863
|
});
|
|
71859
71864
|
return allRulesCheck;
|
|
71860
71865
|
}
|
|
@@ -71898,6 +71903,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
|
|
|
71898
71903
|
const kcRules = this.buildKcValidationRules();
|
|
71899
71904
|
const allErrorRules = mergeRules(kcRules.errors, sugarRules.errors);
|
|
71900
71905
|
const allWarningRules = mergeRules(kcRules.warnings, sugarRules.warnings);
|
|
71906
|
+
yield* kcRules.additionalRules;
|
|
71901
71907
|
const createRule = (rules, path, checkType) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createFromMask)(path, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), checkType), rules[path]);
|
|
71902
71908
|
const rules = Object.keys(allErrorRules).map(path => createRule(allErrorRules, path, "error")).concat(Object.keys(allWarningRules).map(path => createRule(allWarningRules, path, "warning")));
|
|
71903
71909
|
for (const rule of rules) {
|
|
@@ -76128,7 +76134,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
76128
76134
|
/* harmony import */ var _Engine_src_Controls_FormParts_Unit_UnitId_UnitId__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../../../Engine/src/Controls/FormParts/Unit/UnitId/UnitId */ "./Engine/src/Controls/FormParts/Unit/UnitId/UnitId.ts");
|
|
76129
76135
|
/* harmony import */ var _Common_PathConstants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../../../Common/PathConstants */ "./Common/PathConstants.ts");
|
|
76130
76136
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
76131
|
-
/* harmony import */ var
|
|
76137
|
+
/* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
76138
|
+
/* harmony import */ var _AttachmentFormNode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AttachmentFormNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/AttachmentForm/AttachmentFormNode.ts");
|
|
76139
|
+
|
|
76132
76140
|
|
|
76133
76141
|
|
|
76134
76142
|
|
|
@@ -76138,10 +76146,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
76138
76146
|
|
|
76139
76147
|
class AttachmentFormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_2__.SugarNodeConverterBase {
|
|
76140
76148
|
static getAcceptNodeClass() {
|
|
76141
|
-
return
|
|
76149
|
+
return _AttachmentFormNode__WEBPACK_IMPORTED_MODULE_7__.AttachmentFormNode;
|
|
76142
76150
|
}
|
|
76143
76151
|
*getAttachmentPaths() {
|
|
76144
|
-
const node = this.getCurrentNodeAs(
|
|
76152
|
+
const node = this.getCurrentNodeAs(_AttachmentFormNode__WEBPACK_IMPORTED_MODULE_7__.AttachmentFormNode);
|
|
76145
76153
|
yield (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_5__.createAbsolute)(node.path).joinWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_4__.AttachmentInfoPath);
|
|
76146
76154
|
}
|
|
76147
76155
|
doBuildDataDeclaration(context) {
|
|
@@ -76154,14 +76162,14 @@ class AttachmentFormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
|
|
|
76154
76162
|
// no children
|
|
76155
76163
|
}
|
|
76156
76164
|
doConvert(context) {
|
|
76157
|
-
const attachmentFormNode = this.getCurrentNodeAs(
|
|
76165
|
+
const attachmentFormNode = this.getCurrentNodeAs(_AttachmentFormNode__WEBPACK_IMPORTED_MODULE_7__.AttachmentFormNode);
|
|
76158
76166
|
const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_1__.componentMarkupBuilder)("AttachmentFormUnit");
|
|
76159
76167
|
markupBuilder.prop("data-tid").set("attachment-" + attachmentFormNode.gfv);
|
|
76160
76168
|
markupBuilder.prop(x => x.unitId).set((0,_Engine_src_Controls_FormParts_Unit_UnitId_UnitId__WEBPACK_IMPORTED_MODULE_3__.createUnitId)("attachment-" + attachmentFormNode.gfv));
|
|
76161
76169
|
markupBuilder.prop(x => x.gfv).set(attachmentFormNode.gfv);
|
|
76162
76170
|
markupBuilder.prop(x => x.caption).set(attachmentFormNode.name);
|
|
76163
76171
|
markupBuilder.prop(x => x.description).set(attachmentFormNode.description);
|
|
76164
|
-
markupBuilder.prop(x => x.
|
|
76172
|
+
markupBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_6__.getNewBindingPathExpression)(attachmentFormNode, attachmentFormNode.path));
|
|
76165
76173
|
return markupBuilder.buildConverterResult();
|
|
76166
76174
|
}
|
|
76167
76175
|
}
|
|
@@ -77248,7 +77256,7 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
|
|
|
77248
77256
|
markupBuilder.prop(x => x.gfv).set(attachmentFormNode.gfv);
|
|
77249
77257
|
markupBuilder.prop(x => x.caption).set(attachmentFormNode.name);
|
|
77250
77258
|
markupBuilder.prop(x => x.description).set(attachmentFormNode.description);
|
|
77251
|
-
markupBuilder.prop(x => x.
|
|
77259
|
+
markupBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(attachmentFormNode, attachmentFormNode.path));
|
|
77252
77260
|
return markupBuilder;
|
|
77253
77261
|
}
|
|
77254
77262
|
isPageContainsTableWithStickyElements(pageNode) {
|