@kontur.candy/generator 5.121.0-fixes-for-flang-generator.1 → 5.121.0-fixes-for-flang-generator.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46776,10 +46776,10 @@ class AbsoluteModelFieldPath {
|
|
|
46776
46776
|
toString(includeLeadingSlash = false) {
|
|
46777
46777
|
return `${includeLeadingSlash ? "/" : ""}${this.path.toLegacyPath()}.${this.field}`;
|
|
46778
46778
|
}
|
|
46779
|
-
toLegacyPath() {
|
|
46779
|
+
toLegacyPath(addSlashIfLastTokenIsInstanceOrMultiplicity = true) {
|
|
46780
46780
|
const lastToken = _IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.last(this.path.getPathParts());
|
|
46781
46781
|
const isLastTokenAnInstanceOrMultiplicity = _ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.isInstanceTokenOrInstancesSpec(lastToken) || _ModelPath__WEBPACK_IMPORTED_MODULE_5__.PathTokens.isMultiToken(lastToken);
|
|
46782
|
-
const slashIfRequired = isLastTokenAnInstanceOrMultiplicity && (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(this.field) ? "/" : "";
|
|
46782
|
+
const slashIfRequired = addSlashIfLastTokenIsInstanceOrMultiplicity && isLastTokenAnInstanceOrMultiplicity && (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(this.field) ? "/" : "";
|
|
46783
46783
|
const dotIfRequired = (0,_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(this.field) ? "." : "";
|
|
46784
46784
|
return `${this.path.toLegacyPath()}${slashIfRequired}${dotIfRequired}${this.field}`;
|
|
46785
46785
|
}
|
|
@@ -70242,8 +70242,9 @@ class DataDeclarationGenerationTimeHelper {
|
|
|
70242
70242
|
return declEntry !== undefined && "autoValue" in declEntry;
|
|
70243
70243
|
}
|
|
70244
70244
|
isNodeHasDisabledEntry(targetPath) {
|
|
70245
|
+
var _declEntry$disabled;
|
|
70245
70246
|
const declEntry = this.getDataDeclarationEntry(targetPath);
|
|
70246
|
-
return
|
|
70247
|
+
return (declEntry === null || declEntry === void 0 || (_declEntry$disabled = declEntry.disabled) === null || _declEntry$disabled === void 0 ? void 0 : _declEntry$disabled[0]) == true;
|
|
70247
70248
|
}
|
|
70248
70249
|
getDefaultValue(targetPath) {
|
|
70249
70250
|
const declEntry = this.getDataDeclarationEntry(targetPath);
|
|
@@ -81166,7 +81167,7 @@ function naiveConvertJsConditionToKCLangCondition(condition) {
|
|
|
81166
81167
|
applyReplacements([/path\('([^']*?)',\s*'error'\)\s*!==?\s*''/g, "1 == 1"]);
|
|
81167
81168
|
applyReplacements([/path\('([^']*?)',\s*'warning'\)\s*===?\s*''/g, "1 == 0"]);
|
|
81168
81169
|
applyReplacements([/path\('([^']*?)',\s*'warning'\)\s*!==?\s*''/g, "1 == 1"]);
|
|
81169
|
-
applyReplacements([/path\('([^']*?)'\)\.length/g, "length($1)"]);
|
|
81170
|
+
applyReplacements([/path\('([^']*?)'\)\.length/g, "length($1 as string)"]);
|
|
81170
81171
|
applyReplacements([/path\('@formsClientInfo\/[^']*?'\)/g, "''"]);
|
|
81171
81172
|
applyReplacements([/path\('@featureFlags\/([^']*?)'\)/g, "getProperty('$1')"]);
|
|
81172
81173
|
applyReplacements([/path\('@draftMeta\/([^']*?)'\)/g, "getProperty('draftMeta/$1')"]);
|
|
@@ -81199,8 +81200,8 @@ function naiveConvertJsConditionToKCLangCondition(condition) {
|
|
|
81199
81200
|
applyReplacements([/path\('@settings\/isFormInFormNds'\)\s*===?\s*'true'/g, "1 == 1"]);
|
|
81200
81201
|
applyReplacements([/path\('@settings\/isFormInFormNds'\)\s*===?\s*false/g, "0 == 1"]);
|
|
81201
81202
|
applyReplacements([/path\('@settings\/isFormInFormNds'\)\s*===?\s*'false'/g, "0 == 1"]);
|
|
81202
|
-
applyReplacements([/path\('([^']*?)'\)\s*===?\s*'/g, "($1 as string) ==
|
|
81203
|
-
applyReplacements([/path\('([^']*?)'\)\s*!==?\s*'/g, "($1 as string) !=
|
|
81203
|
+
applyReplacements([/path\('([^']*?)'\)\s*===?\s*('|")/g, "($1 as string) == $2"]);
|
|
81204
|
+
applyReplacements([/path\('([^']*?)'\)\s*!==?\s*('|")/g, "($1 as string) != $2"]);
|
|
81204
81205
|
applyReplacements([/path\('([^']*?)'\)\s*===?\s*(\d)/g, "$1 == $2"]);
|
|
81205
81206
|
applyReplacements([[/path\('([^']*?)'\)\s*===?\s*(\d)/g, "$1 == $2"], [/path\('([^']*?)'\)\s*!==?\s*(\d)/g, "$1 != $2"], [/path\('([^']*?)'\)\s*>=?\s*(\d)/g, "$1 >= $2"], [/path\('([^']*?)'\)\s*<=?\s*(\d)/g, "$1 <= $2"], [/path\('([^']*?)'\)\s*>?\s*(\d)/g, "$1 > $2"], [/path\('([^']*?)'\)\s*<?\s*(\d)/g, "$1 < $2"], [/path\('([^']*?)'\)\s*===?\s*'(\d+)'/g, "$1 == $2"], [/path\('([^']*?)'\)\s*!==?\s*'(\d+)'/g, "$1 != $2"], [/path\('([^']*?)'\)\s*>?\s*'(\d+)'/g, "$1 > $2"], [/path\('([^']*?)'\)\s*<?\s*'(\d+)'/g, "$1 < $2"], [/path\('([^']*?)'\)\s*>=?\s*'(\d+)'/g, "$1 >= $2"], [/path\('([^']*?)'\)\s*<=?\s*'(\d+)'/g, "$1 <= $2"]]);
|
|
81206
81207
|
applyReplacements([/\|\|/g, "or"]);
|
|
@@ -81245,7 +81246,7 @@ const predefinedJsConditions = {
|
|
|
81245
81246
|
"path`('ПризнакПродавец') === '2'": "ПризнакПродавец == 2",
|
|
81246
81247
|
"(path('checked1') === 'true' && path('checked2') === 'true') or (path('checked1') === 'true')": "(checked1 and checked2) or checked1",
|
|
81247
81248
|
"path('СНИЛС') != ''": "СНИЛС != ''",
|
|
81248
|
-
"path('/Файл/LazyLoadingEnabled') !== 'true'": "not /Файл/LazyLoadingEnabled",
|
|
81249
|
+
"path('/Файл/LazyLoadingEnabled') !== 'true'": "not (/Файл/LazyLoadingEnabled == 'true')",
|
|
81249
81250
|
"path('НомКорр') !== '99'": "НомКорр != 99",
|
|
81250
81251
|
"tableIsEmpty != 'true'": "tableIsEmpty as string != 'true'",
|
|
81251
81252
|
"tableIsEmpty == 'true'": "tableIsEmpty as string == 'true'",
|
|
@@ -103367,6 +103368,12 @@ class PopupTextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODUL
|
|
|
103367
103368
|
const node = this.getCurrentNodeAs(_PopupTextAreaNode__WEBPACK_IMPORTED_MODULE_8__.PopupTextAreaNode);
|
|
103368
103369
|
validationGenerator.processValidations(this.getResolvedBindingPath(node), node.validationInfo.optional, validationGenerator.getTypeNode(node.validationInfo), undefined, node.validationInfo.emptydescription, undefined);
|
|
103369
103370
|
}
|
|
103371
|
+
doBuildNormalizeRules(builder, __) {
|
|
103372
|
+
const node = this.getCurrentNodeAs(_PopupTextAreaNode__WEBPACK_IMPORTED_MODULE_8__.PopupTextAreaNode);
|
|
103373
|
+
return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
|
|
103374
|
+
disabled: node.disabled
|
|
103375
|
+
})];
|
|
103376
|
+
}
|
|
103370
103377
|
*doBuildKCLangValidations(buildContext, formSchemaRng, prefixPath) {
|
|
103371
103378
|
const node = this.getCurrentNodeAs(_PopupTextAreaNode__WEBPACK_IMPORTED_MODULE_8__.PopupTextAreaNode);
|
|
103372
103379
|
const element = formSchemaRng.getElementByPath(node.getFullPath());
|
|
@@ -104306,6 +104313,9 @@ class TextConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.Sug
|
|
|
104306
104313
|
}
|
|
104307
104314
|
doBuildNormalizeRules(builder) {
|
|
104308
104315
|
const node = this.getCurrentNodeAs(_TextNode__WEBPACK_IMPORTED_MODULE_7__.TextNode);
|
|
104316
|
+
if (!node.dataBinding.path) {
|
|
104317
|
+
return [];
|
|
104318
|
+
}
|
|
104309
104319
|
return [builder.valueInitializer(node, node.dataBinding, node.disabled), ...builder.specialFieldsInitializer(node, {
|
|
104310
104320
|
disabled: node.disabled
|
|
104311
104321
|
})];
|
package/package.json
CHANGED