@kontur.candy/generator 5.69.0-markup-in-modalheader.0 → 5.69.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.
Files changed (2) hide show
  1. package/dist/index.js +105 -52
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -46492,6 +46492,16 @@ class ModelPathImpl {
46492
46492
  }
46493
46493
  return this;
46494
46494
  }
46495
+ trimFirstStarIfLastToken() {
46496
+ const firstItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.first(this.tokens);
46497
+ if (firstItem != undefined && PathTokens.isMultiToken(firstItem)) {
46498
+ return new ModelPathImpl(this.tokens.slice(1), this.absolute);
46499
+ }
46500
+ return this;
46501
+ }
46502
+ getSuffixPathFrom(modelFieldPath) {
46503
+ return createRelativeFromTokens(modelFieldPath.matchFor(this).map(x => x.kind === _PathMatcher__WEBPACK_IMPORTED_MODULE_4__.MatchKind.DifferentSuffix ? x.source : undefined).filter(_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.isNotNullOrUndefined).flatMap(x => x.getPathPartsAsArray()));
46504
+ }
46495
46505
  getParentPath() {
46496
46506
  const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.absolute);
46497
46507
  for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
@@ -59089,7 +59099,7 @@ class FormSchemaRngAttribute {
59089
59099
  }
59090
59100
  const RootParent = Symbol.for("__ROOT_ELEMENT_PARENT__");
59091
59101
  class FormSchemaRngElement {
59092
- constructor(name, parent, optional, multiple, nillable, maxOccurs, lazyLoadMode, lazyLoadAggregations, errorAndWarningCountRequired, lazyLoadingThreshold, disableValueAutoInit, editorOnly) {
59102
+ constructor(name, parent, optional, multiple, nillable, maxOccurs, lazyLoadMode, lazyLoadAggregations, errorAndWarningCountRequired, lazyLoadingThreshold, disableValueAutoInit, editorOnly, useServerFilters) {
59093
59103
  this.name = void 0;
59094
59104
  this.multiple = void 0;
59095
59105
  this.lazyLoadMode = void 0;
@@ -59100,6 +59110,7 @@ class FormSchemaRngElement {
59100
59110
  this.innerTextType = void 0;
59101
59111
  this.children = new Map();
59102
59112
  this.maxOccurs = void 0;
59113
+ this.useServerFilters = void 0;
59103
59114
  this.attributes = new Map();
59104
59115
  this.parent = void 0;
59105
59116
  this.optional = void 0;
@@ -59117,6 +59128,7 @@ class FormSchemaRngElement {
59117
59128
  this.lazyLoadingThreshold = lazyLoadingThreshold;
59118
59129
  this.disableValueAutoInit = disableValueAutoInit;
59119
59130
  this.editorOnly = editorOnly;
59131
+ this.useServerFilters = useServerFilters;
59120
59132
  }
59121
59133
  addElement(element) {
59122
59134
  this.children.set(element.name, element);
@@ -59150,6 +59162,9 @@ class FormSchemaRngElement {
59150
59162
  var _this$disableValueAut2;
59151
59163
  return (_this$disableValueAut2 = this.disableValueAutoInit) !== null && _this$disableValueAut2 !== void 0 ? _this$disableValueAut2 : this.parent instanceof FormSchemaRngElement ? this.parent.isIgnoreForcedValueSet() : false;
59152
59164
  }
59165
+ getUseServerFilters() {
59166
+ return this.useServerFilters;
59167
+ }
59153
59168
  }
59154
59169
  class FormSchemaRng {
59155
59170
  constructor(rootElement) {
@@ -59165,7 +59180,7 @@ class FormSchemaRng {
59165
59180
  return new FormSchemaRng(this.convertSchemaRngElement(schemaRngElement, RootParent));
59166
59181
  }
59167
59182
  static convertSchemaRngElement(schemaRngElement, parent) {
59168
- const result = new FormSchemaRngElement(schemaRngElement.name, parent, schemaRngElement.optional, schemaRngElement.multiple, schemaRngElement.nillable, schemaRngElement.maxOccurs, schemaRngElement.lazyLoadMode, schemaRngElement.lazyLoadAggregations, schemaRngElement.errorAndWarningCountRequired, schemaRngElement.lazyLoadingThreshold, schemaRngElement.disableValueAutoInit, schemaRngElement.editorOnly);
59183
+ const result = new FormSchemaRngElement(schemaRngElement.name, parent, schemaRngElement.optional, schemaRngElement.multiple, schemaRngElement.nillable, schemaRngElement.maxOccurs, schemaRngElement.lazyLoadMode, schemaRngElement.lazyLoadAggregations, schemaRngElement.errorAndWarningCountRequired, schemaRngElement.lazyLoadingThreshold, schemaRngElement.disableValueAutoInit, schemaRngElement.editorOnly, schemaRngElement.useServerFilters);
59169
59184
  if (schemaRngElement.innerText != undefined) {
59170
59185
  if (schemaRngElement.innerText.type != undefined) {
59171
59186
  result.setInnerTextType(this.buildTypeInfo(schemaRngElement.innerText.type));
@@ -59516,7 +59531,7 @@ __webpack_require__.r(__webpack_exports__);
59516
59531
 
59517
59532
 
59518
59533
 
59519
- var _dec, _dec2, _class, _class2, _descriptor, _dec3, _dec4, _class3, _class4, _descriptor2, _dec5, _dec6, _class5, _class6, _descriptor3, _dec7, _dec8, _class7, _class8, _descriptor4, _dec9, _dec10, _class9, _class10, _descriptor5, _dec11, _dec12, _class11, _class12, _descriptor6, _dec13, _dec14, _class13, _class14, _descriptor7, _dec15, _dec16, _class15, _class16, _descriptor8, _dec17, _dec18, _class17, _class18, _descriptor9, _dec19, _dec20, _class19, _class20, _descriptor10, _dec21, _dec22, _dec23, _class21, _class22, _descriptor11, _descriptor12, _dec24, _dec25, _dec26, _dec27, _dec28, _class23, _class24, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _class25, _class26, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25, _dec39, _dec40, _class27, _class28, _descriptor26, _dec41, _dec42, _class29, _class30, _descriptor27, _dec43, _dec44, _dec45, _dec46, _dec47, _dec48, _dec49, _dec50, _dec51, _dec52, _dec53, _dec54, _dec55, _dec56, _dec57, _dec58, _dec59, _class31, _class32, _descriptor28, _descriptor29, _descriptor30, _descriptor31, _descriptor32, _descriptor33, _descriptor34, _descriptor35, _descriptor36, _descriptor37, _descriptor38, _descriptor39, _descriptor40, _descriptor41, _descriptor42, _descriptor43;
59534
+ var _dec, _dec2, _class, _class2, _descriptor, _dec3, _dec4, _class3, _class4, _descriptor2, _dec5, _dec6, _class5, _class6, _descriptor3, _dec7, _dec8, _class7, _class8, _descriptor4, _dec9, _dec10, _class9, _class10, _descriptor5, _dec11, _dec12, _class11, _class12, _descriptor6, _dec13, _dec14, _class13, _class14, _descriptor7, _dec15, _dec16, _class15, _class16, _descriptor8, _dec17, _dec18, _class17, _class18, _descriptor9, _dec19, _dec20, _class19, _class20, _descriptor10, _dec21, _dec22, _dec23, _class21, _class22, _descriptor11, _descriptor12, _dec24, _dec25, _dec26, _dec27, _dec28, _class23, _class24, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _class25, _class26, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25, _dec39, _dec40, _class27, _class28, _descriptor26, _dec41, _dec42, _class29, _class30, _descriptor27, _dec43, _dec44, _dec45, _dec46, _dec47, _dec48, _dec49, _dec50, _dec51, _dec52, _dec53, _dec54, _dec55, _dec56, _dec57, _dec58, _dec59, _dec60, _class31, _class32, _descriptor28, _descriptor29, _descriptor30, _descriptor31, _descriptor32, _descriptor33, _descriptor34, _descriptor35, _descriptor36, _descriptor37, _descriptor38, _descriptor39, _descriptor40, _descriptor41, _descriptor42, _descriptor43, _descriptor44;
59520
59535
 
59521
59536
  class SchemaRngTypeCheck extends _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {}
59522
59537
  let PatternTypeCheck = (_dec = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("pattern", ``), _dec2 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("value", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, ``), _dec(_class = (_class2 = class PatternTypeCheck extends SchemaRngTypeCheck {
@@ -59763,7 +59778,7 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
59763
59778
  - deferred: ставится на коллекцию, которую хотим получать частями; например, в 6-НДФЛ при открытии одной справки, загрузятся все данные по ней
59764
59779
  - initial: данные загружаются всегда; например, данные для фильтров
59765
59780
  - request: загрузка по запросу с фронта; используется для постраничного отображения списков; например, видимые пользователю поля в таблице
59766
- `), _dec57 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("errorAndWarningCountRequired", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `Подсчет количества ошибок и предупреждений по элементу в множественности`), _dec58 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("lazyLoadingThreshold", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.number, `Количество элементов в множественности, начиная с которого включается частичная загрузка. Не поддерживается для вложенных множественностей, только для корневой с lazyLoadMode=deferred`), _dec59 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disableValueAutoInit", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `В значениии true запрещает при кастомной нормализации перезаписывать значение value,
59781
+ `), _dec57 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("errorAndWarningCountRequired", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `Подсчет количества ошибок и предупреждений по элементу в множественности`), _dec58 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("useServerFilters", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, "Включает режим серверной фильтрации для коллекции"), _dec59 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("lazyLoadingThreshold", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.number, `Количество элементов в множественности, начиная с которого включается частичная загрузка. Не поддерживается для вложенных множественностей, только для корневой с lazyLoadMode=deferred`), _dec60 = (0,_generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("disableValueAutoInit", _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `В значениии true запрещает при кастомной нормализации перезаписывать значение value,
59767
59782
  полученное из ФУФа, даже если оно пустое`), _dec43(_class31 = (_class32 = class SchemaRngElement extends _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
59768
59783
  constructor(...args) {
59769
59784
  super(...args);
@@ -59781,8 +59796,9 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
59781
59796
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadAggregations", _descriptor39, this);
59782
59797
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadMode", _descriptor40, this);
59783
59798
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "errorAndWarningCountRequired", _descriptor41, this);
59784
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadingThreshold", _descriptor42, this);
59785
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disableValueAutoInit", _descriptor43, this);
59799
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "useServerFilters", _descriptor42, this);
59800
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadingThreshold", _descriptor43, this);
59801
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disableValueAutoInit", _descriptor44, this);
59786
59802
  }
59787
59803
  }, (_descriptor28 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "name", [_dec44], {
59788
59804
  configurable: true,
@@ -59854,12 +59870,17 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
59854
59870
  enumerable: true,
59855
59871
  writable: true,
59856
59872
  initializer: null
59857
- }), _descriptor42 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "lazyLoadingThreshold", [_dec58], {
59873
+ }), _descriptor42 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "useServerFilters", [_dec58], {
59874
+ configurable: true,
59875
+ enumerable: true,
59876
+ writable: true,
59877
+ initializer: null
59878
+ }), _descriptor43 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "lazyLoadingThreshold", [_dec59], {
59858
59879
  configurable: true,
59859
59880
  enumerable: true,
59860
59881
  writable: true,
59861
59882
  initializer: null
59862
- }), _descriptor43 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "disableValueAutoInit", [_dec59], {
59883
+ }), _descriptor44 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "disableValueAutoInit", [_dec60], {
59863
59884
  configurable: true,
59864
59885
  enumerable: true,
59865
59886
  writable: true,
@@ -63913,6 +63934,7 @@ class AutoCalculationsCalculator2Generator extends _KCXmlGenerator_KCXmlGenerato
63913
63934
  const defaultValue = this.dataDeclarationHelper.getDefaultValue(target.toLegacyPath());
63914
63935
  const autoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(target.toLegacyPath());
63915
63936
  const disabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(target.toLegacyPath());
63937
+ const optional = this.dataDeclarationHelper.isNodeOptionalBySchemaOrSugar(target);
63916
63938
  const compiledTarget = this.modelPathInstance(target);
63917
63939
  const dependencyModelPaths = Array.from(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_2__.IterUtils.distinctBy(dependencies.map(x => ({
63918
63940
  path: x.asDependencyModelPath(),
@@ -63923,7 +63945,7 @@ class AutoCalculationsCalculator2Generator extends _KCXmlGenerator_KCXmlGenerato
63923
63945
  const compiledExpressionWithCheck = this.compileAllItemsIsEmptyCheckBlock(compiledExpression, dependencyModelPaths.filter(x => !x.isIgnoreForChecks).map(x => x.path));
63924
63946
  const compiledDelegate = `context => KCCalculation.execute(context, expression => ${compiledExpressionWithCheck}, "${defaultValue}")`;
63925
63947
  return {
63926
- compiledFunction: `new CalculationFunction(${compiledTarget}, [${compiledDeps}], ${compiledDelegate}, ${autoField}, ${disabled})`,
63948
+ compiledFunction: `new CalculationFunction(${compiledTarget}, [${compiledDeps}], ${compiledDelegate}, ${autoField}, ${disabled}, ${optional})`,
63927
63949
  dependencies: dependencies
63928
63950
  };
63929
63951
  }
@@ -66385,8 +66407,8 @@ class DataDeclarationGenerationContext {
66385
66407
  disabled
66386
66408
  }) {
66387
66409
  const declEntry = {};
66388
- if (optional) {
66389
- declEntry.optional = [true];
66410
+ if (optional != undefined) {
66411
+ declEntry.optional = [optional];
66390
66412
  }
66391
66413
  if (disabled) {
66392
66414
  declEntry.disabled = [true];
@@ -66549,8 +66571,10 @@ __webpack_require__.r(__webpack_exports__);
66549
66571
 
66550
66572
 
66551
66573
  class DataDeclarationGenerationTimeHelper {
66552
- constructor(dataDeclaration) {
66574
+ constructor(dataDeclaration, formSchemaRng) {
66553
66575
  this.dataDeclaration = void 0;
66576
+ this.formSchemaRng = void 0;
66577
+ this.formSchemaRng = formSchemaRng;
66554
66578
  this.dataDeclaration = dataDeclaration;
66555
66579
  }
66556
66580
  isErrorsAndWarningsCountRequired(targetPath) {
@@ -66587,6 +66611,13 @@ class DataDeclarationGenerationTimeHelper {
66587
66611
  const optionalValue = (_this$getDataDeclarat5 = this.getDataDeclarationEntry(targetPath)) === null || _this$getDataDeclarat5 === void 0 ? void 0 : _this$getDataDeclarat5.optional;
66588
66612
  return (_optionalValue$ = optionalValue === null || optionalValue === void 0 ? void 0 : optionalValue[0]) !== null && _optionalValue$ !== void 0 ? _optionalValue$ : false;
66589
66613
  }
66614
+ isNodeOptionalBySchemaOrSugar(targetPath) {
66615
+ var _this$getDataDeclarat6, _this$formSchemaRng$g, _this$formSchemaRng;
66616
+ const optionalValue = (_this$getDataDeclarat6 = this.getDataDeclarationEntry(targetPath)) === null || _this$getDataDeclarat6 === void 0 ? void 0 : _this$getDataDeclarat6.optional;
66617
+ const optionalBySugar = optionalValue === null || optionalValue === void 0 ? void 0 : optionalValue[0];
66618
+ const optionalBySchema = (_this$formSchemaRng$g = (_this$formSchemaRng = this.formSchemaRng) === null || _this$formSchemaRng === void 0 || (_this$formSchemaRng = _this$formSchemaRng.getElementByPath(targetPath)) === null || _this$formSchemaRng === void 0 ? void 0 : _this$formSchemaRng.isOptional()) !== null && _this$formSchemaRng$g !== void 0 ? _this$formSchemaRng$g : false;
66619
+ return optionalBySugar == undefined ? optionalBySchema : optionalBySugar;
66620
+ }
66590
66621
  getDataDeclarationEntry(targetPath) {
66591
66622
  return this.dataDeclaration[(0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.convertToLegacyPath)(targetPath)];
66592
66623
  }
@@ -66717,6 +66748,9 @@ class DataDeclarationGenerator {
66717
66748
  if (entry instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_6__.FormSchemaRngElement && entry.errorAndWarningCountRequired != undefined) {
66718
66749
  declarationEntry.errorAndWarningCountRequired = [entry.errorAndWarningCountRequired];
66719
66750
  }
66751
+ if (entry instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_6__.FormSchemaRngElement && entry.useServerFilters != undefined) {
66752
+ declarationEntry.useServerFilters = entry.useServerFilters;
66753
+ }
66720
66754
  if (entry.disableValueAutoInit != undefined) {
66721
66755
  declarationEntry.disableValueAutoInit = entry.disableValueAutoInit;
66722
66756
  }
@@ -68390,7 +68424,9 @@ class LazyLoadDeclarationGenerator {
68390
68424
  }
68391
68425
  }
68392
68426
  *processElement(path, element) {
68393
- if (element.lazyLoadMode != undefined) {
68427
+ var _element$useServerFil;
68428
+ const useServerFilters = (_element$useServerFil = element.useServerFilters) !== null && _element$useServerFil !== void 0 ? _element$useServerFil : false;
68429
+ if (element.lazyLoadMode != undefined && (!useServerFilters || element.lazyLoadMode === "deferred")) {
68394
68430
  const adjustedPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name));
68395
68431
  const currentPaths = element.multiple ? [element.lazyLoadMode === "deferred" ? adjustedPath : adjustedPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.each)] : [adjustedPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.each), this.formSchemaRng.adjustPathMultiplicity(path).joinWith(element.name + ".value")];
68396
68432
  const items = currentPaths.map(currentPath => {
@@ -68411,45 +68447,51 @@ class LazyLoadDeclarationGenerator {
68411
68447
  lazyLoadMode: "initial"
68412
68448
  }));
68413
68449
  yield* additionalItems;
68414
- yield {
68415
- path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".errorsCount")),
68416
- lazyLoadMode: "initial"
68417
- };
68418
- yield {
68419
- path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".warningsCount")),
68420
- lazyLoadMode: "initial"
68421
- };
68450
+ if (!useServerFilters) {
68451
+ yield {
68452
+ path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".errorsCount")),
68453
+ lazyLoadMode: "initial"
68454
+ };
68455
+ yield {
68456
+ path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".warningsCount")),
68457
+ lazyLoadMode: "initial"
68458
+ };
68459
+ }
68422
68460
  } else {
68423
- yield {
68424
- path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".errorsCount")),
68425
- lazyLoadMode: "request"
68426
- };
68427
- yield {
68428
- path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".warningsCount")),
68429
- lazyLoadMode: "request"
68430
- };
68461
+ if (!useServerFilters) {
68462
+ yield {
68463
+ path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".errorsCount")),
68464
+ lazyLoadMode: "request"
68465
+ };
68466
+ yield {
68467
+ path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".warningsCount")),
68468
+ lazyLoadMode: "request"
68469
+ };
68470
+ }
68431
68471
  }
68432
68472
  }
68433
- for (const attr of element.attributes.values()) {
68434
- if (attr.lazyLoadMode != undefined) {
68435
- const currentPath = path.joinWith(element.name, attr.name + ".value");
68436
- yield {
68437
- path: this.formSchemaRng.adjustPathMultiplicity(currentPath),
68438
- lazyLoadMode: attr.lazyLoadMode
68439
- };
68440
- }
68441
- if (attr.lazyLoadMode != undefined && attr.lazyLoadAggregations) {
68442
- const baseAggregationPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name)).trimLastStarIfLastToken().joinWith(attr.name);
68443
- const sumPath = baseAggregationPath.joinWith("Sum.value");
68444
- yield {
68445
- path: sumPath,
68446
- lazyLoadMode: "initial"
68447
- };
68448
- const countPath = baseAggregationPath.joinWith("Count.value");
68449
- yield {
68450
- path: countPath,
68451
- lazyLoadMode: "initial"
68452
- };
68473
+ if (!useServerFilters) {
68474
+ for (const attr of element.attributes.values()) {
68475
+ if (attr.lazyLoadMode != undefined) {
68476
+ const currentPath = path.joinWith(element.name, attr.name + ".value");
68477
+ yield {
68478
+ path: this.formSchemaRng.adjustPathMultiplicity(currentPath),
68479
+ lazyLoadMode: attr.lazyLoadMode
68480
+ };
68481
+ }
68482
+ if (attr.lazyLoadMode != undefined && attr.lazyLoadAggregations) {
68483
+ const baseAggregationPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name)).trimLastStarIfLastToken().joinWith(attr.name);
68484
+ const sumPath = baseAggregationPath.joinWith("Sum.value");
68485
+ yield {
68486
+ path: sumPath,
68487
+ lazyLoadMode: "initial"
68488
+ };
68489
+ const countPath = baseAggregationPath.joinWith("Count.value");
68490
+ yield {
68491
+ path: countPath,
68492
+ lazyLoadMode: "initial"
68493
+ };
68494
+ }
68453
68495
  }
68454
68496
  }
68455
68497
  const nextPath = path.joinWith(element.name);
@@ -68612,7 +68654,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
68612
68654
  dataDeclarationContent,
68613
68655
  dataDeclaration
68614
68656
  } = dataDeclarationGenerator.generate();
68615
- const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_26__.DataDeclarationGenerationTimeHelper(dataDeclaration);
68657
+ const dataDeclarationHelper = new _DataDeclarationGenerator_DataDeclarationGenerationTimeHelper__WEBPACK_IMPORTED_MODULE_26__.DataDeclarationGenerationTimeHelper(dataDeclaration, formSchemaRng);
68616
68658
  const validationGenerator = new _validationGenerator_ValidationGenerator__WEBPACK_IMPORTED_MODULE_16__.ValidationGenerator(sugarRoot, typeRegistry, controlCustomizationContext, formSchemaRng, useSchemaValidations, additionalContent.validationsContent, additionalContent.formJsonSettings);
68617
68659
  const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
68618
68660
  const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
@@ -69577,7 +69619,12 @@ class FLangValidationBuildContext {
69577
69619
  }
69578
69620
  const typeNodePatterns = (_typeNode$children$fi2 = typeNode === null || typeNode === void 0 || (_typeNode$children8 = typeNode.children) === null || _typeNode$children8 === void 0 ? void 0 : _typeNode$children8.filter((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_0__.PatternTypeCheckNode)).map(x => x.value).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.isNotNullOrUndefined)) !== null && _typeNode$children$fi2 !== void 0 ? _typeNode$children$fi2 : [];
69579
69621
  const stringPatterns = ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.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_6__.isNotNullOrUndefined);
69580
- const patterns = stringPatterns.map(pattern => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(pattern))).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(acc, current) : current, undefined);
69622
+ const patterns = stringPatterns.map(pattern => {
69623
+ if (pattern.startsWith("^") || pattern.endsWith("$")) {
69624
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(pattern));
69625
+ }
69626
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.RegexMatchExpression(valueReference, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(`^${pattern}$`));
69627
+ }).reduce((acc, current) => acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(acc, current) : current, undefined);
69581
69628
  if (patterns != undefined) {
69582
69629
  const totalDigitsRuleBody = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(patterns);
69583
69630
  yield {
@@ -72531,7 +72578,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
72531
72578
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
72532
72579
  }
72533
72580
  createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) {
72534
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
72581
+ const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value");
72582
+ const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value");
72583
+ const autoFlagRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag");
72584
+ const isRequiredField = !this.dataDeclarationHelper.isNodeOptionalBySchemaOrSugar(fullTarget);
72585
+ const autoFlagIsTrueCondition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"));
72586
+ const combinedCondition = isRequiredField ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(autoFlagIsTrueCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()))) : autoFlagIsTrueCondition;
72587
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(combinedCondition, getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
72535
72588
  }
72536
72589
  adjustPathMultiplicity(path) {
72537
72590
  return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.69.0-markup-in-modalheader.0",
3
+ "version": "5.69.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,