@kontur.candy/generator 5.67.2 → 5.68.0-fix-default-value.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 +181 -60
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66235,6 +66235,28 @@ function getObjectPropertyName(property) {
|
|
|
66235
66235
|
|
|
66236
66236
|
/***/ }),
|
|
66237
66237
|
|
|
66238
|
+
/***/ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts":
|
|
66239
|
+
/*!******************************************************************************!*\
|
|
66240
|
+
!*** ./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts ***!
|
|
66241
|
+
\******************************************************************************/
|
|
66242
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
66243
|
+
|
|
66244
|
+
"use strict";
|
|
66245
|
+
__webpack_require__.r(__webpack_exports__);
|
|
66246
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
66247
|
+
/* harmony export */ DataDeclarationInitSourceValueSequence: () => (/* binding */ DataDeclarationInitSourceValueSequence)
|
|
66248
|
+
/* harmony export */ });
|
|
66249
|
+
// tslint:disable-next-line:ban-types
|
|
66250
|
+
|
|
66251
|
+
let DataDeclarationInitSourceValueSequence = /*#__PURE__*/function (DataDeclarationInitSourceValueSequence) {
|
|
66252
|
+
DataDeclarationInitSourceValueSequence["SETTINGS"] = "settings";
|
|
66253
|
+
DataDeclarationInitSourceValueSequence["DISABLED"] = "disabled";
|
|
66254
|
+
DataDeclarationInitSourceValueSequence["DEFAULT"] = "default";
|
|
66255
|
+
return DataDeclarationInitSourceValueSequence;
|
|
66256
|
+
}({});
|
|
66257
|
+
|
|
66258
|
+
/***/ }),
|
|
66259
|
+
|
|
66238
66260
|
/***/ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationContext.ts":
|
|
66239
66261
|
/*!***********************************************************************************************!*\
|
|
66240
66262
|
!*** ./Generator/src/generators/DataDeclarationGenerator/DataDeclarationGenerationContext.ts ***!
|
|
@@ -66259,6 +66281,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66259
66281
|
/* harmony import */ var _markupGenerator_getBindingPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../markupGenerator/getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
66260
66282
|
/* harmony import */ var _markupGenerator_ElementProcessors_FormParts_Page_PageNode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../markupGenerator/ElementProcessors/FormParts/Page/PageNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/Page/PageNode.ts");
|
|
66261
66283
|
/* harmony import */ var _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/SchemaRng/FormSchemaRng */ "./Generator/src/common/SchemaRng/FormSchemaRng.ts");
|
|
66284
|
+
/* harmony import */ var _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
|
|
66285
|
+
/* harmony import */ var _DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./DataDeclarationInitSourceSequenceFactory */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationInitSourceSequenceFactory.ts");
|
|
66286
|
+
|
|
66287
|
+
|
|
66262
66288
|
|
|
66263
66289
|
|
|
66264
66290
|
|
|
@@ -66302,6 +66328,37 @@ class DataDeclarationGenerationContext {
|
|
|
66302
66328
|
}
|
|
66303
66329
|
return [result];
|
|
66304
66330
|
}
|
|
66331
|
+
const srcDataValue = srcValue === null || srcValue === void 0 ? void 0 : srcValue.value;
|
|
66332
|
+
const objDataValue = objValue === null || objValue === void 0 ? void 0 : objValue.value;
|
|
66333
|
+
if (!srcDataValue || !objDataValue) {
|
|
66334
|
+
// eslint-disable-next-line consistent-return
|
|
66335
|
+
return;
|
|
66336
|
+
}
|
|
66337
|
+
const objVal = objDataValue[objDataValue.length - 1];
|
|
66338
|
+
const srcVal = srcDataValue[srcDataValue.length - 1];
|
|
66339
|
+
if (objDataValue.sequenceType === srcDataValue.sequenceType && objVal !== srcVal && objVal && srcVal) {
|
|
66340
|
+
throw new Error(`Duplicated attributes "defaultValue" have different values. Path: "${key}"`);
|
|
66341
|
+
}
|
|
66342
|
+
const nodeWithSettings = _DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory.getTypedValue([srcValue, srcDataValue.sequenceType], [objValue, objDataValue.sequenceType], _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.SETTINGS);
|
|
66343
|
+
if (nodeWithSettings) {
|
|
66344
|
+
return nodeWithSettings;
|
|
66345
|
+
}
|
|
66346
|
+
if (objDataValue.sequenceType === _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.DEFAULT && srcDataValue.sequenceType === _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
66347
|
+
if (objVal) {
|
|
66348
|
+
const res = lodash_mergewith__WEBPACK_IMPORTED_MODULE_0___default()(objValue, srcValue);
|
|
66349
|
+
res.value[res.value.length - 1] = objVal;
|
|
66350
|
+
return res;
|
|
66351
|
+
}
|
|
66352
|
+
} else if (srcDataValue.sequenceType === _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
66353
|
+
return srcValue;
|
|
66354
|
+
} else if (objDataValue.sequenceType === _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
66355
|
+
return objValue;
|
|
66356
|
+
}
|
|
66357
|
+
const nodeDisabled = _DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_11__.DataDeclarationInitSourceSequenceFactory.getTypedValue([srcValue, srcDataValue.sequenceType], [objValue, objDataValue.sequenceType], _DataDeclaration__WEBPACK_IMPORTED_MODULE_10__.DataDeclarationInitSourceValueSequence.DISABLED);
|
|
66358
|
+
if (nodeDisabled) {
|
|
66359
|
+
return nodeDisabled;
|
|
66360
|
+
}
|
|
66361
|
+
|
|
66305
66362
|
/* eslint-enable @typescript-eslint/no-unsafe-argument */
|
|
66306
66363
|
return undefined;
|
|
66307
66364
|
};
|
|
@@ -66786,6 +66843,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66786
66843
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
66787
66844
|
/* harmony export */ DataDeclarationInitSourceSequenceFactory: () => (/* binding */ DataDeclarationInitSourceSequenceFactory)
|
|
66788
66845
|
/* harmony export */ });
|
|
66846
|
+
/* harmony import */ var _DataDeclaration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
|
|
66847
|
+
|
|
66789
66848
|
class DataDeclarationInitSourceSequenceFactory {
|
|
66790
66849
|
constructor(fetchFunctions) {
|
|
66791
66850
|
this.fetchFunctions = void 0;
|
|
@@ -66795,13 +66854,13 @@ class DataDeclarationInitSourceSequenceFactory {
|
|
|
66795
66854
|
var _ref3;
|
|
66796
66855
|
if (node.settings) {
|
|
66797
66856
|
var _ref;
|
|
66798
|
-
return [...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.takeFromModel(), ...this.setValueUnconditionally((_ref = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref !== void 0 ? _ref : "")];
|
|
66857
|
+
return this.setSequenceType([...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.takeFromModel(), ...this.setValueUnconditionally((_ref = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref !== void 0 ? _ref : "")], _DataDeclaration__WEBPACK_IMPORTED_MODULE_0__.DataDeclarationInitSourceValueSequence.SETTINGS);
|
|
66799
66858
|
}
|
|
66800
66859
|
if (disabled) {
|
|
66801
66860
|
var _ref2;
|
|
66802
|
-
return [...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.setValueUnconditionally((_ref2 = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref2 !== void 0 ? _ref2 : "")];
|
|
66861
|
+
return this.setSequenceType([...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.setValueUnconditionally((_ref2 = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref2 !== void 0 ? _ref2 : "")], _DataDeclaration__WEBPACK_IMPORTED_MODULE_0__.DataDeclarationInitSourceValueSequence.DISABLED);
|
|
66803
66862
|
}
|
|
66804
|
-
return [...this.takeFromModel(), ...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.setValueUnconditionally((_ref3 = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref3 !== void 0 ? _ref3 : "")];
|
|
66863
|
+
return this.setSequenceType([...this.takeFromModel(), ...this.takeFromFetchFunctionIfExists(node.fetchfn, "value"), ...this.setValueUnconditionally((_ref3 = defaultValue !== null && defaultValue !== void 0 ? defaultValue : node.defaultValue) !== null && _ref3 !== void 0 ? _ref3 : "")], _DataDeclaration__WEBPACK_IMPORTED_MODULE_0__.DataDeclarationInitSourceValueSequence.DEFAULT);
|
|
66805
66864
|
}
|
|
66806
66865
|
takeFromFetchFunctionOrDefault(fetchFnName, fieldName, defaultValue) {
|
|
66807
66866
|
return [...this.takeFromFetchFunction(fetchFnName, fieldName), ...this.setValueUnconditionally(defaultValue !== null && defaultValue !== void 0 ? defaultValue : "")];
|
|
@@ -66844,6 +66903,13 @@ class DataDeclarationInitSourceSequenceFactory {
|
|
|
66844
66903
|
}
|
|
66845
66904
|
return [];
|
|
66846
66905
|
}
|
|
66906
|
+
setSequenceType(arr, sequenceType) {
|
|
66907
|
+
arr["sequenceType"] = sequenceType;
|
|
66908
|
+
return arr;
|
|
66909
|
+
}
|
|
66910
|
+
static getTypedValue([prevVal, prevType], [nextVal, nextType], type) {
|
|
66911
|
+
return prevType === type ? prevVal : nextType === type ? nextVal : null;
|
|
66912
|
+
}
|
|
66847
66913
|
}
|
|
66848
66914
|
|
|
66849
66915
|
/***/ }),
|
|
@@ -71115,12 +71181,14 @@ class GetOldExpression extends FLangExpression {
|
|
|
71115
71181
|
}
|
|
71116
71182
|
class FLangStatement extends FLangNode {}
|
|
71117
71183
|
class SetStatement extends FLangStatement {
|
|
71118
|
-
constructor(left, right) {
|
|
71184
|
+
constructor(left, right, sequenceType) {
|
|
71119
71185
|
super();
|
|
71120
71186
|
this.left = void 0;
|
|
71121
71187
|
this.right = void 0;
|
|
71188
|
+
this.sequenceType = void 0;
|
|
71122
71189
|
this.right = right;
|
|
71123
71190
|
this.left = left;
|
|
71191
|
+
this.sequenceType = sequenceType;
|
|
71124
71192
|
}
|
|
71125
71193
|
*getChildNodes() {
|
|
71126
71194
|
yield this.left;
|
|
@@ -71158,6 +71226,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71158
71226
|
/* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
|
|
71159
71227
|
/* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
|
|
71160
71228
|
/* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
|
|
71229
|
+
/* harmony export */ getSelectorIdFromRule: () => (/* binding */ getSelectorIdFromRule),
|
|
71161
71230
|
/* harmony export */ hashSetFieldNameSuffix: () => (/* binding */ hashSetFieldNameSuffix),
|
|
71162
71231
|
/* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
|
|
71163
71232
|
/* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
|
|
@@ -71172,7 +71241,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71172
71241
|
/* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
|
|
71173
71242
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
71174
71243
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
71175
|
-
/* harmony import */ var
|
|
71244
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../DataDeclarationGenerator/DataDeclarationInitSourceSequenceFactory */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclarationInitSourceSequenceFactory.ts");
|
|
71245
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../DataDeclarationGenerator/DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
|
|
71246
|
+
/* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
|
|
71247
|
+
|
|
71248
|
+
|
|
71176
71249
|
|
|
71177
71250
|
|
|
71178
71251
|
|
|
@@ -71191,135 +71264,183 @@ function* getAllExpressionChildren(node, descendantsFilter) {
|
|
|
71191
71264
|
}
|
|
71192
71265
|
}
|
|
71193
71266
|
function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression) {
|
|
71194
|
-
return new
|
|
71267
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.EqExpression(makeStringValueReference(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression("true")), makeNoDeps(castOperandIfNeed(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(path.toCurrentIteration(), "value"), originalExpression.getType())), originalExpression));
|
|
71195
71268
|
}
|
|
71196
71269
|
function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
|
|
71197
71270
|
var _formSchemaRng$getEle;
|
|
71198
|
-
return x instanceof
|
|
71271
|
+
return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
|
|
71199
71272
|
}
|
|
71200
71273
|
function wrapWithArgumentsCondition(expression) {
|
|
71201
|
-
const childFilter = node => !(node instanceof
|
|
71202
|
-
const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof
|
|
71274
|
+
const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NoDepsExpression);
|
|
71275
|
+
const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined);
|
|
71203
71276
|
const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
|
|
71204
71277
|
const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
|
|
71205
|
-
const currExpr = new
|
|
71206
|
-
return acc != undefined ? new
|
|
71278
|
+
const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ExistsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(curr.modePath, curr.valueName));
|
|
71279
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.OrBinaryExpression(acc, currExpr) : currExpr;
|
|
71207
71280
|
}, undefined);
|
|
71208
71281
|
if (conditionExpression == undefined) {
|
|
71209
71282
|
return expression;
|
|
71210
71283
|
}
|
|
71211
|
-
return new
|
|
71284
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression());
|
|
71212
71285
|
}
|
|
71286
|
+
const getSelectorIdFromRule = x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement ? x.left.convertToString() : x.convertToString();
|
|
71287
|
+
const mergeRules = function (items) {
|
|
71288
|
+
const rulesDictionary = new Map();
|
|
71289
|
+
for (const item of items) {
|
|
71290
|
+
const id = getSelectorIdFromRule(item);
|
|
71291
|
+
const prevVal = rulesDictionary.get(id);
|
|
71292
|
+
if (!prevVal) {
|
|
71293
|
+
rulesDictionary.set(id, item);
|
|
71294
|
+
} else if (item instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement && prevVal instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement) {
|
|
71295
|
+
if (!prevVal.sequenceType) {
|
|
71296
|
+
continue;
|
|
71297
|
+
} else if (!item.sequenceType) {
|
|
71298
|
+
rulesDictionary.set(id, item);
|
|
71299
|
+
continue;
|
|
71300
|
+
}
|
|
71301
|
+
const itemWithSettings = _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_4__.DataDeclarationInitSourceSequenceFactory.getTypedValue([prevVal, prevVal.sequenceType], [item, item.sequenceType], _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.SETTINGS);
|
|
71302
|
+
if (itemWithSettings) {
|
|
71303
|
+
rulesDictionary.set(id, itemWithSettings);
|
|
71304
|
+
continue;
|
|
71305
|
+
}
|
|
71306
|
+
if (prevVal.sequenceType === _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.DEFAULT && item.sequenceType === _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
71307
|
+
var _prevVal$right, _item$right;
|
|
71308
|
+
const prevDefaultVal = (_prevVal$right = prevVal.right) === null || _prevVal$right === void 0 || (_prevVal$right = _prevVal$right["trueResult"]) === null || _prevVal$right === void 0 ? void 0 : _prevVal$right.convertToString();
|
|
71309
|
+
const itemDefaultVal = (_item$right = item.right) === null || _item$right === void 0 || (_item$right = _item$right["trueResult"]) === null || _item$right === void 0 ? void 0 : _item$right.convertToString();
|
|
71310
|
+
const hasPrevDefaultVal = prevDefaultVal && prevDefaultVal !== '""';
|
|
71311
|
+
const hasItemDefaultVal = itemDefaultVal && itemDefaultVal !== '""';
|
|
71312
|
+
if (hasPrevDefaultVal && hasItemDefaultVal && prevDefaultVal === itemDefaultVal) {
|
|
71313
|
+
continue;
|
|
71314
|
+
}
|
|
71315
|
+
if (hasItemDefaultVal) {
|
|
71316
|
+
rulesDictionary.set(id, item);
|
|
71317
|
+
continue;
|
|
71318
|
+
}
|
|
71319
|
+
} else if (prevVal.sequenceType === _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
71320
|
+
continue;
|
|
71321
|
+
} else if (item.sequenceType === _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.DEFAULT) {
|
|
71322
|
+
rulesDictionary.set(id, item);
|
|
71323
|
+
continue;
|
|
71324
|
+
}
|
|
71325
|
+
const itemDisabled = _DataDeclarationGenerator_DataDeclarationInitSourceSequenceFactory__WEBPACK_IMPORTED_MODULE_4__.DataDeclarationInitSourceSequenceFactory.getTypedValue([prevVal, prevVal.sequenceType], [item, item.sequenceType], _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_5__.DataDeclarationInitSourceValueSequence.DISABLED);
|
|
71326
|
+
if (itemDisabled) {
|
|
71327
|
+
rulesDictionary.set(id, itemDisabled);
|
|
71328
|
+
continue;
|
|
71329
|
+
}
|
|
71330
|
+
}
|
|
71331
|
+
}
|
|
71332
|
+
return rulesDictionary.values();
|
|
71333
|
+
};
|
|
71213
71334
|
function combineRulesWithOptionalSectionChecking(allRules, optionalSectionRulesBuilder) {
|
|
71214
|
-
const allUniqueRules =
|
|
71335
|
+
const allUniqueRules = mergeRules(allRules);
|
|
71215
71336
|
const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
|
|
71216
71337
|
return allUniqueRulesWithOptionalChecks;
|
|
71217
71338
|
}
|
|
71218
71339
|
function tryExtractValueReferenceAsStringFromDecimal(expression) {
|
|
71219
|
-
if (expression.getType() ===
|
|
71340
|
+
if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71220
71341
|
return expression.targetExpression;
|
|
71221
71342
|
}
|
|
71222
71343
|
return expression;
|
|
71223
71344
|
}
|
|
71224
71345
|
function castFinalExpressionToStringIfNeed(operandExpression, enableTypedExpression, decimalFormat = "G29") {
|
|
71225
|
-
if (enableTypedExpression && (operandExpression.getType() ===
|
|
71346
|
+
if (enableTypedExpression && (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.dict || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.hashSet)) {
|
|
71226
71347
|
return operandExpression;
|
|
71227
71348
|
}
|
|
71228
71349
|
return castOperandToStringIfNeed(operandExpression, decimalFormat);
|
|
71229
71350
|
}
|
|
71230
71351
|
function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
|
|
71231
|
-
if (operandExpression instanceof
|
|
71232
|
-
return new
|
|
71352
|
+
if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DateNowExpression) {
|
|
71353
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression("dd.MM.yyyy"));
|
|
71233
71354
|
}
|
|
71234
|
-
if (operandExpression.getType() ===
|
|
71235
|
-
return new
|
|
71355
|
+
if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.hashSet) {
|
|
71356
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SerializeEnumerationExpression(operandExpression);
|
|
71236
71357
|
}
|
|
71237
|
-
return operandExpression.getType() !=
|
|
71358
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
|
|
71238
71359
|
}
|
|
71239
71360
|
function castOperandIfNeed(operandExpression, type) {
|
|
71240
|
-
if (type instanceof
|
|
71241
|
-
return operandExpression.getType() != type ? new
|
|
71361
|
+
if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression) {
|
|
71362
|
+
return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(operandExpression, type) : operandExpression;
|
|
71242
71363
|
}
|
|
71243
71364
|
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
|
|
71244
71365
|
}
|
|
71245
71366
|
function castOperandToBoolIfNeed(operandExpression) {
|
|
71246
|
-
return operandExpression.getType() !=
|
|
71367
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.bool) : operandExpression;
|
|
71247
71368
|
}
|
|
71248
71369
|
function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
|
|
71249
|
-
return operandExpression.getType() !==
|
|
71370
|
+
return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
|
|
71250
71371
|
}
|
|
71251
71372
|
const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
|
|
71252
71373
|
function castOperandToDateTimeIfNeed(operandExpression) {
|
|
71253
|
-
return operandExpression.getType() !=
|
|
71374
|
+
return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.dateTime) : operandExpression;
|
|
71254
71375
|
}
|
|
71255
71376
|
function nullCoalesceWithTypeCheck(argument, replacement) {
|
|
71256
|
-
const isValid = argument.getType() === replacement.getType() || argument.getType() ===
|
|
71377
|
+
const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.null;
|
|
71257
71378
|
if (!isValid) {
|
|
71258
71379
|
throw new Error("Couldn't build null coalesce expression: types not match");
|
|
71259
71380
|
}
|
|
71260
|
-
return new
|
|
71381
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullCoalesceExpression(argument, replacement);
|
|
71261
71382
|
}
|
|
71262
71383
|
function ensureOperandsOfTypeOrNull(type, ...operands) {
|
|
71263
71384
|
for (const operand of operands) {
|
|
71264
71385
|
const operandType = operand.getType();
|
|
71265
|
-
if (operandType !==
|
|
71386
|
+
if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.null && operandType !== type) {
|
|
71266
71387
|
throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
|
|
71267
71388
|
}
|
|
71268
71389
|
}
|
|
71269
71390
|
}
|
|
71270
71391
|
function combineByOrFlangExpr(acc, current) {
|
|
71271
|
-
return acc != undefined ? new
|
|
71392
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.OrBinaryExpression(acc, current) : current;
|
|
71272
71393
|
}
|
|
71273
71394
|
function combineByAndFlangExpr(acc, current) {
|
|
71274
|
-
return acc != undefined ? new
|
|
71395
|
+
return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.AndBinaryExpression(acc, current) : current;
|
|
71275
71396
|
}
|
|
71276
71397
|
function makeNoDeps(expression) {
|
|
71277
|
-
if (expression instanceof
|
|
71278
|
-
return new
|
|
71398
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71399
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NoDepsExpression(expression);
|
|
71279
71400
|
}
|
|
71280
|
-
if (expression instanceof
|
|
71281
|
-
return new
|
|
71401
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71402
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
71282
71403
|
}
|
|
71283
71404
|
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
71284
71405
|
}
|
|
71285
71406
|
function makeGetOld(expression) {
|
|
71286
|
-
if (expression instanceof
|
|
71287
|
-
return new
|
|
71407
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71408
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.GetOldExpression(expression);
|
|
71288
71409
|
}
|
|
71289
|
-
if (expression instanceof
|
|
71290
|
-
return new
|
|
71410
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71411
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
|
|
71291
71412
|
}
|
|
71292
71413
|
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
|
|
71293
71414
|
}
|
|
71294
71415
|
function makeStringValueReference(modePath, valueName) {
|
|
71295
|
-
return new
|
|
71416
|
+
return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string);
|
|
71296
71417
|
}
|
|
71297
71418
|
function extractValueReferenceFromCast(expression) {
|
|
71298
|
-
if (expression instanceof
|
|
71419
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71299
71420
|
return expression;
|
|
71300
71421
|
}
|
|
71301
|
-
if (expression instanceof
|
|
71422
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression) {
|
|
71302
71423
|
return expression.targetExpression;
|
|
71303
71424
|
}
|
|
71304
|
-
if (expression instanceof
|
|
71425
|
+
if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NoDepsExpression) {
|
|
71305
71426
|
return expression.targetExpression;
|
|
71306
71427
|
}
|
|
71307
71428
|
return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
|
|
71308
71429
|
}
|
|
71309
71430
|
function ensureCorrectFieldNameByExpressionType(statement) {
|
|
71310
|
-
if (statement instanceof
|
|
71431
|
+
if (statement instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement) {
|
|
71311
71432
|
const lastPart = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(statement.left.modePath.getPathParts());
|
|
71312
71433
|
const lastStringPart = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.isSimpleToken(lastPart) ? lastPart : "";
|
|
71313
|
-
if (statement.right.getType() ===
|
|
71434
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.dict && !lastStringPart.endsWith(dictFieldNameSuffix)) {
|
|
71314
71435
|
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${dictFieldNameSuffix}"`);
|
|
71315
71436
|
}
|
|
71316
|
-
if (statement.right.getType() ===
|
|
71437
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.hashSet && !lastStringPart.endsWith(hashSetFieldNameSuffix)) {
|
|
71317
71438
|
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${hashSetFieldNameSuffix}"`);
|
|
71318
71439
|
}
|
|
71319
|
-
if (statement.right.getType() ===
|
|
71440
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.array && !lastStringPart.endsWith(arrayFieldNameSuffix)) {
|
|
71320
71441
|
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${arrayFieldNameSuffix}"`);
|
|
71321
71442
|
}
|
|
71322
|
-
if (statement.right.getType() ===
|
|
71443
|
+
if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string && (lastStringPart.endsWith(arrayFieldNameSuffix) || lastStringPart.endsWith(hashSetFieldNameSuffix) || lastStringPart.endsWith(dictFieldNameSuffix))) {
|
|
71323
71444
|
throw new Error(`Suffix of path ${statement.left.modePath.toString()} must NOT be "${arrayFieldNameSuffix}", "${hashSetFieldNameSuffix}" or "${dictFieldNameSuffix}"`);
|
|
71324
71445
|
}
|
|
71325
71446
|
}
|
|
@@ -98061,8 +98182,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
98061
98182
|
/* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
|
|
98062
98183
|
/* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
|
|
98063
98184
|
/* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
|
|
98064
|
-
/* harmony import */ var
|
|
98065
|
-
/* harmony import */ var
|
|
98185
|
+
/* harmony import */ var _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../DataDeclarationGenerator/DataDeclaration */ "./Generator/src/generators/DataDeclarationGenerator/DataDeclaration.ts");
|
|
98186
|
+
/* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
|
|
98187
|
+
/* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
|
|
98188
|
+
|
|
98066
98189
|
|
|
98067
98190
|
|
|
98068
98191
|
|
|
@@ -98085,7 +98208,7 @@ class FLangNormalizationRulesBuilder {
|
|
|
98085
98208
|
this.controlCustomizationContext = controlCustomizationContext;
|
|
98086
98209
|
}
|
|
98087
98210
|
*childrenInitializer(node, optional, defaultChildren) {
|
|
98088
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
98211
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_5__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
|
|
98089
98212
|
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
|
|
98090
98213
|
}
|
|
98091
98214
|
*childrenInitializerForPicklist(node, optional, defaultChildren) {
|
|
@@ -98094,36 +98217,34 @@ class FLangNormalizationRulesBuilder {
|
|
|
98094
98217
|
}
|
|
98095
98218
|
valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
|
|
98096
98219
|
var _dataBinding$defaultV;
|
|
98097
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
98220
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_5__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
|
|
98098
98221
|
const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
98099
98222
|
const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
|
|
98100
98223
|
const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
|
|
98224
|
+
const sourceSequenceType = node.sourceXmlNode.attributes.settings ? _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_4__.DataDeclarationInitSourceValueSequence.SETTINGS : disabled ? _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_4__.DataDeclarationInitSourceValueSequence.DISABLED : _DataDeclarationGenerator_DataDeclaration__WEBPACK_IMPORTED_MODULE_4__.DataDeclarationInitSourceValueSequence.DEFAULT;
|
|
98101
98225
|
if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
|
|
98102
98226
|
try {
|
|
98103
98227
|
var _this$fetchFunctions$, _this$fetchFunctions$2;
|
|
98104
98228
|
const fetchFnText = (_this$fetchFunctions$ = (_this$fetchFunctions$2 = this.fetchFunctions.getFetchFunction(dataBinding.fetchfn + (fetchFunctionSuffix !== null && fetchFunctionSuffix !== void 0 ? fetchFunctionSuffix : ""))) === null || _this$fetchFunctions$2 === void 0 ? void 0 : _this$fetchFunctions$2.toString()) !== null && _this$fetchFunctions$ !== void 0 ? _this$fetchFunctions$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)();
|
|
98105
98229
|
const flangExpression = this.fetchFuncToFlangConverter.convert(`const x = ${fetchFnText}`);
|
|
98106
|
-
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NotEqExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GetExternalInfoExpression("@settings/isReadOnly"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NotEqExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), sourceValueReference, flangExpression), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
|
|
98230
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NotEqExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GetExternalInfoExpression("@settings/isReadOnly"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NotEqExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), sourceValueReference, flangExpression), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))), sourceSequenceType);
|
|
98107
98231
|
} catch (e) {
|
|
98108
98232
|
// eslint-disable-next-line no-console
|
|
98109
98233
|
console.error(`fetchfn = "${dataBinding.fetchfn}". Не удалось преобразовать fetch-функцию во FLANG-выражение!`);
|
|
98110
98234
|
// eslint-disable-next-line no-console
|
|
98111
98235
|
console.error(e instanceof Error ? e.message : e);
|
|
98112
|
-
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), sourceValueReference);
|
|
98236
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), sourceValueReference, sourceSequenceType);
|
|
98113
98237
|
}
|
|
98114
98238
|
}
|
|
98115
98239
|
let valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue);
|
|
98116
|
-
if (dataBinding.settings) {
|
|
98117
|
-
valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), valueExpression, sourceValueReference);
|
|
98118
|
-
}
|
|
98119
|
-
if (!disabled && !dataBinding.settings) {
|
|
98240
|
+
if (dataBinding.settings || !disabled && !dataBinding.settings) {
|
|
98120
98241
|
valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), valueExpression, sourceValueReference);
|
|
98121
98242
|
}
|
|
98122
98243
|
const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
|
|
98123
|
-
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
|
|
98244
|
+
return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression, sourceSequenceType);
|
|
98124
98245
|
}
|
|
98125
98246
|
*specialFieldsInitializer(node, options) {
|
|
98126
|
-
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,
|
|
98247
|
+
const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_5__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
|
|
98127
98248
|
if (options.disabled) {
|
|
98128
98249
|
yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "disabled"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"));
|
|
98129
98250
|
}
|
|
@@ -98141,7 +98262,7 @@ class FLangNormalizationRulesBuilder {
|
|
|
98141
98262
|
var _typeNode$base, _this$schemaRng$getTy;
|
|
98142
98263
|
// eslint-disable-next-line
|
|
98143
98264
|
const validationInfoSource = node === null || node === void 0 ? void 0 : node.validationInfo;
|
|
98144
|
-
const typeNode = validationInfoSource instanceof
|
|
98265
|
+
const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_6__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
|
|
98145
98266
|
const baseType = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : (_this$schemaRng$getTy = this.schemaRng.getTypeNodeByPath(targetPathReference)) === null || _this$schemaRng$getTy === void 0 ? void 0 : _this$schemaRng$getTy.baseType;
|
|
98146
98267
|
const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
|
|
98147
98268
|
return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
|