@kontur.candy/generator 5.47.0-support-server-filters.0 → 5.47.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 +45 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46386,16 +46386,6 @@ class ModelPathImpl {
|
|
|
46386
46386
|
}
|
|
46387
46387
|
return this;
|
|
46388
46388
|
}
|
|
46389
|
-
trimFirstStarIfLastToken() {
|
|
46390
|
-
const firstItem = _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.first(this.tokens);
|
|
46391
|
-
if (firstItem != undefined && PathTokens.isMultiToken(firstItem)) {
|
|
46392
|
-
return new ModelPathImpl(this.tokens.slice(1), this.absolute);
|
|
46393
|
-
}
|
|
46394
|
-
return this;
|
|
46395
|
-
}
|
|
46396
|
-
getSuffixPathFrom(modelFieldPath) {
|
|
46397
|
-
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()));
|
|
46398
|
-
}
|
|
46399
46389
|
getParentPath() {
|
|
46400
46390
|
const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.absolute);
|
|
46401
46391
|
for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
|
|
@@ -57932,7 +57922,7 @@ class FormSchemaRngAttribute {
|
|
|
57932
57922
|
}
|
|
57933
57923
|
const RootParent = Symbol.for("__ROOT_ELEMENT_PARENT__");
|
|
57934
57924
|
class FormSchemaRngElement {
|
|
57935
|
-
constructor(name, parent, optional, multiple, nillable, maxOccurs, lazyLoadMode, lazyLoadAggregations, errorAndWarningCountRequired, lazyLoadingThreshold, disableValueAutoInit, editorOnly
|
|
57925
|
+
constructor(name, parent, optional, multiple, nillable, maxOccurs, lazyLoadMode, lazyLoadAggregations, errorAndWarningCountRequired, lazyLoadingThreshold, disableValueAutoInit, editorOnly) {
|
|
57936
57926
|
this.name = void 0;
|
|
57937
57927
|
this.multiple = void 0;
|
|
57938
57928
|
this.lazyLoadMode = void 0;
|
|
@@ -57943,7 +57933,6 @@ class FormSchemaRngElement {
|
|
|
57943
57933
|
this.innerTextType = void 0;
|
|
57944
57934
|
this.children = new Map();
|
|
57945
57935
|
this.maxOccurs = void 0;
|
|
57946
|
-
this.useServerFilters = void 0;
|
|
57947
57936
|
this.attributes = new Map();
|
|
57948
57937
|
this.parent = void 0;
|
|
57949
57938
|
this.optional = void 0;
|
|
@@ -57961,7 +57950,6 @@ class FormSchemaRngElement {
|
|
|
57961
57950
|
this.lazyLoadingThreshold = lazyLoadingThreshold;
|
|
57962
57951
|
this.disableValueAutoInit = disableValueAutoInit;
|
|
57963
57952
|
this.editorOnly = editorOnly;
|
|
57964
|
-
this.useServerFilters = useServerFilters;
|
|
57965
57953
|
}
|
|
57966
57954
|
addElement(element) {
|
|
57967
57955
|
this.children.set(element.name, element);
|
|
@@ -57995,9 +57983,6 @@ class FormSchemaRngElement {
|
|
|
57995
57983
|
var _this$disableValueAut2;
|
|
57996
57984
|
return (_this$disableValueAut2 = this.disableValueAutoInit) !== null && _this$disableValueAut2 !== void 0 ? _this$disableValueAut2 : this.parent instanceof FormSchemaRngElement ? this.parent.isIgnoreForcedValueSet() : false;
|
|
57997
57985
|
}
|
|
57998
|
-
getUseServerFilters() {
|
|
57999
|
-
return this.useServerFilters;
|
|
58000
|
-
}
|
|
58001
57986
|
}
|
|
58002
57987
|
class FormSchemaRng {
|
|
58003
57988
|
constructor(rootElement) {
|
|
@@ -58013,7 +57998,7 @@ class FormSchemaRng {
|
|
|
58013
57998
|
return new FormSchemaRng(this.convertSchemaRngElement(schemaRngElement, RootParent));
|
|
58014
57999
|
}
|
|
58015
58000
|
static convertSchemaRngElement(schemaRngElement, parent) {
|
|
58016
|
-
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
|
|
58001
|
+
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);
|
|
58017
58002
|
if (schemaRngElement.innerText != undefined) {
|
|
58018
58003
|
if (schemaRngElement.innerText.type != undefined) {
|
|
58019
58004
|
result.setInnerTextType(this.buildTypeInfo(schemaRngElement.innerText.type));
|
|
@@ -58364,7 +58349,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
58364
58349
|
|
|
58365
58350
|
|
|
58366
58351
|
|
|
58367
|
-
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,
|
|
58352
|
+
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;
|
|
58368
58353
|
|
|
58369
58354
|
class SchemaRngTypeCheck extends _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {}
|
|
58370
58355
|
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 {
|
|
@@ -58611,7 +58596,7 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
|
|
|
58611
58596
|
- deferred: ставится на коллекцию, которую хотим получать частями; например, в 6-НДФЛ при открытии одной справки, загрузятся все данные по ней
|
|
58612
58597
|
- initial: данные загружаются всегда; например, данные для фильтров
|
|
58613
58598
|
- request: загрузка по запросу с фронта; используется для постраничного отображения списков; например, видимые пользователю поля в таблице
|
|
58614
|
-
`), _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)("
|
|
58599
|
+
`), _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,
|
|
58615
58600
|
полученное из ФУФа, даже если оно пустое`), _dec43(_class31 = (_class32 = class SchemaRngElement extends _generators_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
|
|
58616
58601
|
constructor(...args) {
|
|
58617
58602
|
super(...args);
|
|
@@ -58629,9 +58614,8 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
|
|
|
58629
58614
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadAggregations", _descriptor39, this);
|
|
58630
58615
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadMode", _descriptor40, this);
|
|
58631
58616
|
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "errorAndWarningCountRequired", _descriptor41, this);
|
|
58632
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
58633
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "
|
|
58634
|
-
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disableValueAutoInit", _descriptor44, this);
|
|
58617
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "lazyLoadingThreshold", _descriptor42, this);
|
|
58618
|
+
_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "disableValueAutoInit", _descriptor43, this);
|
|
58635
58619
|
}
|
|
58636
58620
|
}, (_descriptor28 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "name", [_dec44], {
|
|
58637
58621
|
configurable: true,
|
|
@@ -58703,17 +58687,12 @@ let SchemaRngElement = (_dec43 = (0,_generators_markupGenerator_Serializer_Sugar
|
|
|
58703
58687
|
enumerable: true,
|
|
58704
58688
|
writable: true,
|
|
58705
58689
|
initializer: null
|
|
58706
|
-
}), _descriptor42 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "
|
|
58690
|
+
}), _descriptor42 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "lazyLoadingThreshold", [_dec58], {
|
|
58707
58691
|
configurable: true,
|
|
58708
58692
|
enumerable: true,
|
|
58709
58693
|
writable: true,
|
|
58710
58694
|
initializer: null
|
|
58711
|
-
}), _descriptor43 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "
|
|
58712
|
-
configurable: true,
|
|
58713
|
-
enumerable: true,
|
|
58714
|
-
writable: true,
|
|
58715
|
-
initializer: null
|
|
58716
|
-
}), _descriptor44 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "disableValueAutoInit", [_dec60], {
|
|
58695
|
+
}), _descriptor43 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class32.prototype, "disableValueAutoInit", [_dec59], {
|
|
58717
58696
|
configurable: true,
|
|
58718
58697
|
enumerable: true,
|
|
58719
58698
|
writable: true,
|
|
@@ -65533,9 +65512,6 @@ class DataDeclarationGenerator {
|
|
|
65533
65512
|
if (entry instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_6__.FormSchemaRngElement && entry.errorAndWarningCountRequired != undefined) {
|
|
65534
65513
|
declarationEntry.errorAndWarningCountRequired = [entry.errorAndWarningCountRequired];
|
|
65535
65514
|
}
|
|
65536
|
-
if (entry instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_6__.FormSchemaRngElement && entry.useServerFilters != undefined) {
|
|
65537
|
-
declarationEntry.useServerFilters = entry.useServerFilters;
|
|
65538
|
-
}
|
|
65539
65515
|
if (entry.disableValueAutoInit != undefined) {
|
|
65540
65516
|
declarationEntry.disableValueAutoInit = entry.disableValueAutoInit;
|
|
65541
65517
|
}
|
|
@@ -67196,9 +67172,7 @@ class LazyLoadDeclarationGenerator {
|
|
|
67196
67172
|
}
|
|
67197
67173
|
}
|
|
67198
67174
|
*processElement(path, element) {
|
|
67199
|
-
|
|
67200
|
-
const useServerFilters = (_element$useServerFil = element.useServerFilters) !== null && _element$useServerFil !== void 0 ? _element$useServerFil : false;
|
|
67201
|
-
if (element.lazyLoadMode != undefined && (!useServerFilters || element.lazyLoadMode === "deferred")) {
|
|
67175
|
+
if (element.lazyLoadMode != undefined) {
|
|
67202
67176
|
const adjustedPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name));
|
|
67203
67177
|
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")];
|
|
67204
67178
|
const items = currentPaths.map(currentPath => {
|
|
@@ -67219,51 +67193,45 @@ class LazyLoadDeclarationGenerator {
|
|
|
67219
67193
|
lazyLoadMode: "initial"
|
|
67220
67194
|
}));
|
|
67221
67195
|
yield* additionalItems;
|
|
67222
|
-
|
|
67223
|
-
|
|
67224
|
-
|
|
67225
|
-
|
|
67226
|
-
|
|
67227
|
-
|
|
67228
|
-
|
|
67229
|
-
|
|
67230
|
-
};
|
|
67231
|
-
}
|
|
67196
|
+
yield {
|
|
67197
|
+
path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".errorsCount")),
|
|
67198
|
+
lazyLoadMode: "initial"
|
|
67199
|
+
};
|
|
67200
|
+
yield {
|
|
67201
|
+
path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name).joinWith(".warningsCount")),
|
|
67202
|
+
lazyLoadMode: "initial"
|
|
67203
|
+
};
|
|
67232
67204
|
} else {
|
|
67233
|
-
|
|
67234
|
-
|
|
67235
|
-
|
|
67236
|
-
|
|
67237
|
-
|
|
67238
|
-
|
|
67239
|
-
|
|
67240
|
-
|
|
67241
|
-
};
|
|
67242
|
-
}
|
|
67205
|
+
yield {
|
|
67206
|
+
path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".errorsCount")),
|
|
67207
|
+
lazyLoadMode: "request"
|
|
67208
|
+
};
|
|
67209
|
+
yield {
|
|
67210
|
+
path: this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name + ".warningsCount")),
|
|
67211
|
+
lazyLoadMode: "request"
|
|
67212
|
+
};
|
|
67243
67213
|
}
|
|
67244
67214
|
}
|
|
67245
|
-
|
|
67246
|
-
|
|
67247
|
-
|
|
67248
|
-
|
|
67249
|
-
|
|
67250
|
-
|
|
67251
|
-
|
|
67252
|
-
|
|
67253
|
-
|
|
67254
|
-
|
|
67255
|
-
|
|
67256
|
-
|
|
67257
|
-
|
|
67258
|
-
|
|
67259
|
-
|
|
67260
|
-
|
|
67261
|
-
|
|
67262
|
-
|
|
67263
|
-
|
|
67264
|
-
|
|
67265
|
-
};
|
|
67266
|
-
}
|
|
67215
|
+
for (const attr of element.attributes.values()) {
|
|
67216
|
+
if (attr.lazyLoadMode != undefined) {
|
|
67217
|
+
const currentPath = path.joinWith(element.name, attr.name + ".value");
|
|
67218
|
+
yield {
|
|
67219
|
+
path: this.formSchemaRng.adjustPathMultiplicity(currentPath),
|
|
67220
|
+
lazyLoadMode: attr.lazyLoadMode
|
|
67221
|
+
};
|
|
67222
|
+
}
|
|
67223
|
+
if (attr.lazyLoadMode != undefined && attr.lazyLoadAggregations) {
|
|
67224
|
+
const baseAggregationPath = this.formSchemaRng.adjustPathMultiplicity(path.joinWith(element.name)).trimLastStarIfLastToken().joinWith(attr.name);
|
|
67225
|
+
const sumPath = baseAggregationPath.joinWith("Sum.value");
|
|
67226
|
+
yield {
|
|
67227
|
+
path: sumPath,
|
|
67228
|
+
lazyLoadMode: "initial"
|
|
67229
|
+
};
|
|
67230
|
+
const countPath = baseAggregationPath.joinWith("Count.value");
|
|
67231
|
+
yield {
|
|
67232
|
+
path: countPath,
|
|
67233
|
+
lazyLoadMode: "initial"
|
|
67234
|
+
};
|
|
67267
67235
|
}
|
|
67268
67236
|
}
|
|
67269
67237
|
const nextPath = path.joinWith(element.name);
|