@kontur.candy/generator 5.74.0-forminform.0 → 5.74.0-forminform.1

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 +45 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -50114,9 +50114,11 @@ class KCLangAntlrVisitor {
50114
50114
  };
50115
50115
  }
50116
50116
  visitConstString(ctx) {
50117
+ const stringLiteralAsIs = ctx.STRING_LITERAL().text;
50118
+ const literalValue = stringLiteralAsIs.startsWith("'") ? stringLiteralAsIs.replace(/^\'|\'$/g, "").replace(/\\'/g, "'") : stringLiteralAsIs.replace(/^\"|\"$/g, "").replace(/\\"/g, '"');
50117
50119
  return {
50118
50120
  type: "string",
50119
- value: ctx.STRING_LITERAL().text.replace(/^\'|\'$/g, "").replace(/^\"|\"$/g, "")
50121
+ value: literalValue
50120
50122
  };
50121
50123
  }
50122
50124
  visitConstDecimal(ctx) {
@@ -60190,7 +60192,15 @@ function removeTrailingSlash(inputStr) {
60190
60192
  return inputStr;
60191
60193
  }
60192
60194
  function joinPaths(paths) {
60193
- return paths.map(removeTrailingSlash).join("/");
60195
+ let result = "";
60196
+ for (const path of paths) {
60197
+ if (path.startsWith("/")) {
60198
+ result = removeTrailingSlash(path);
60199
+ } else {
60200
+ result += (result == "" ? "" : "/") + removeTrailingSlash(path);
60201
+ }
60202
+ }
60203
+ return result;
60194
60204
  }
60195
60205
  function generateBlockKCXmlFormulas(block, parents) {
60196
60206
  const nextParents = [...parents, {
@@ -69733,7 +69743,7 @@ class KCXmlGeneratorBase {
69733
69743
  return gcf(x => x.eq, ...compiledParts);
69734
69744
  }
69735
69745
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaConstExpression) {
69736
- return gcf(x => x.const, `"${expression.value}"`);
69746
+ return gcf(x => x.const, `${JSON.stringify(expression.value)}`);
69737
69747
  }
69738
69748
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGtExpression) {
69739
69749
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.ensureArrayHasLength)(expression.arguments, 2);
@@ -69761,8 +69771,8 @@ class KCXmlGeneratorBase {
69761
69771
  }
69762
69772
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaRegexMatchExpression) {
69763
69773
  const compiledArgument = this.compileExpression(prefix, targetFullPath, expression.argument, deps);
69764
- const preparedPattern = expression.pattern.replace(/"/g, '\\"').replace(/\\/g, "\\\\");
69765
- return gcf(x => x.regexMatch, compiledArgument, `"${preparedPattern}"`);
69774
+ const preparedPattern = JSON.stringify(expression.pattern);
69775
+ return gcf(x => x.regexMatch, compiledArgument, preparedPattern);
69766
69776
  }
69767
69777
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaMultiplyExpression) {
69768
69778
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.ensureArrayLengthGreaterThenOrEqual)(expression.arguments, 2);
@@ -70972,7 +70982,7 @@ function getAllMatches(regexPattern, sourceString) {
70972
70982
  }
70973
70983
  function getRequisitesFromEvaluablePropValue(filter) {
70974
70984
  var _filter$match$map$fil, _filter$match, _getAllMatches$map$fi;
70975
- return [...((_filter$match$map$fil = (_filter$match = filter.match(/path([^)]+)/g)) === null || _filter$match === void 0 ? void 0 : _filter$match.map(path => path.slice(6, -1)).filter(path => path.startsWith("@clientInfo") || path.startsWith("@formsClientInfo")).map(path => `${path}.value`)) !== null && _filter$match$map$fil !== void 0 ? _filter$match$map$fil : []), ...((_getAllMatches$map$fi = getAllMatches(/getProperty\('([^']+?)'\)/g, filter).map(path => path[1]).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.isNotNullOrUndefined).filter(path => path.startsWith("currentAccount") || path.startsWith("recipient") || (path === null || path === void 0 ? void 0 : path.startsWith("sender"))).map(path => `@formsClientInfo/${path}.value`)) !== null && _getAllMatches$map$fi !== void 0 ? _getAllMatches$map$fi : [])];
70985
+ return [...((_filter$match$map$fil = (_filter$match = filter.match(/path([^)]+)/g)) === null || _filter$match === void 0 ? void 0 : _filter$match.map(path => path.slice(6, -1)).filter(path => path.startsWith("@clientInfo") || path.startsWith("@formsClientInfo") || path.startsWith("@draftMeta")).map(path => `${path}.value`)) !== null && _filter$match$map$fil !== void 0 ? _filter$match$map$fil : []), ...((_getAllMatches$map$fi = getAllMatches(/getProperty\('([^']+?)'\)/g, filter).map(path => path[1]).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.isNotNullOrUndefined).filter(path => path.startsWith("currentAccount") || path.startsWith("recipient") || (path === null || path === void 0 ? void 0 : path.startsWith("sender"))).map(path => `@formsClientInfo/${path}.value`)) !== null && _getAllMatches$map$fi !== void 0 ? _getAllMatches$map$fi : [])];
70976
70986
  }
70977
70987
  function getPathsFromEvaluablePropValue(evaluableProp) {
70978
70988
  const pathRegex = /(?<=path\((?:'|")).*?(?=(?:'|"))/g;
@@ -74360,7 +74370,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_9
74360
74370
  }
74361
74371
  buildKcValidationRuleCheck(condition) {
74362
74372
  const prefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createModelPath)(condition.match.replace(/\@/g, ""), true).normalize();
74363
- const target = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createModelPath)(condition.target.replace(/\@/g, ""), false);
74373
+ const target = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createModelPath)(condition.target.replace(/\@/g, ""), "auto");
74364
74374
  const fullTarget = this.adjustPathMultiplicity(prefix.joinWith(target).normalize());
74365
74375
  const precalculationRules = [];
74366
74376
  return {
@@ -78143,6 +78153,7 @@ function naiveConvertJsConditionToKCLangCondition(condition) {
78143
78153
  applyReplacements([/path\('([^']*?)'\)\.length/g, "length($1)"]);
78144
78154
  applyReplacements([/path\('@formsClientInfo\/[^']*?'\)/g, "''"]);
78145
78155
  applyReplacements([/path\('@featureFlags\/([^']*?)'\)/g, "getProperty('$1')"]);
78156
+ applyReplacements([/path\('@draftMeta\/([^']*?)'\)/g, "getProperty('draftMeta/$1')"]);
78146
78157
  applyReplacements([/path\('@settings\/someSettings'\)/g, "getProperty('someSettings')"]);
78147
78158
  applyReplacements([/path\('@settings\/scenario'\)/g, "''"]);
78148
78159
  applyReplacements([/path\('@settings\/isForeign'\)/g, "'false'"]);
@@ -78879,7 +78890,7 @@ class AttachmentFormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODU
78879
78890
  }
78880
78891
  doConvert(context) {
78881
78892
  const attachmentFormNode = this.getCurrentNodeAs(_AttachmentFormNode__WEBPACK_IMPORTED_MODULE_7__.AttachmentFormNode);
78882
- const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_1__.componentMarkupBuilder)("AttachmentFormUnit");
78893
+ const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_1__.componentMarkupBuilder)("AttachmentUnit");
78883
78894
  markupBuilder.prop("data-tid").set("attachment" + attachmentFormNode.gfv);
78884
78895
  markupBuilder.prop(x => x.unitId).set((0,_Engine_src_Controls_FormParts_Unit_UnitId_UnitId__WEBPACK_IMPORTED_MODULE_3__.createUnitId)("attachment" + attachmentFormNode.gfv));
78885
78896
  markupBuilder.prop(x => x.gfv).set(attachmentFormNode.gfv);
@@ -78914,16 +78925,18 @@ __webpack_require__.r(__webpack_exports__);
78914
78925
 
78915
78926
 
78916
78927
 
78917
- var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
78928
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
78918
78929
 
78919
78930
 
78920
- let AttachmentFormNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("attachmentform", `Встроенный редактор для формализованного приложения`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/AttachmentForm sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("gfv", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `ГФВ приложения`), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("name", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Крактое название раздела, в который поместить форму`), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("description", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Описание формы приложения`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Путь до поля с именем приложения`), _dec(_class = (_class2 = class AttachmentFormNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
78931
+ let AttachmentFormNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.sugarNode)("attachmentform", `Встроенный редактор для формализованного приложения`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/FormParts/AttachmentForm sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("gfv", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `ГФВ приложения`), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("name", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Крактое название раздела, в который поместить форму`), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("description", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Описание формы приложения`), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.string.required, `Путь до поля с именем приложения`), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("multiple", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.boolean, `Обозначение множественного раздела`), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attr)("navigationLimit", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.attrType.number, `Количество экземпляров множественного раздела после которого в левом меню будет включаться компактный режим отображения разделов. По умолчанию: 15. Используется только для множественных разделов`), _dec(_class = (_class2 = class AttachmentFormNode extends _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_3__.SugarNodeBase {
78921
78932
  constructor(...args) {
78922
78933
  super(...args);
78923
78934
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "gfv", _descriptor, this);
78924
78935
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "name", _descriptor2, this);
78925
78936
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "description", _descriptor3, this);
78926
78937
  _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "path", _descriptor4, this);
78938
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "multiple", _descriptor5, this);
78939
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "navigationLimit", _descriptor6, this);
78927
78940
  }
78928
78941
  getOwnPath() {
78929
78942
  return this.path != undefined ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_4__.createFromMask)(this.path, "auto", _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_4__.PathTokens.each) : undefined;
@@ -78948,6 +78961,16 @@ let AttachmentFormNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTE
78948
78961
  enumerable: true,
78949
78962
  writable: true,
78950
78963
  initializer: null
78964
+ }), _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "multiple", [_dec6], {
78965
+ configurable: true,
78966
+ enumerable: true,
78967
+ writable: true,
78968
+ initializer: null
78969
+ }), _descriptor6 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class2.prototype, "navigationLimit", [_dec7], {
78970
+ configurable: true,
78971
+ enumerable: true,
78972
+ writable: true,
78973
+ initializer: null
78951
78974
  })), _class2)) || _class);
78952
78975
 
78953
78976
  /***/ }),
@@ -79997,13 +80020,14 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
79997
80020
  return markupBuilder;
79998
80021
  }
79999
80022
  buildAttachmentFormUnit(node, attachmentFormNode, context) {
80000
- const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("AttachmentFormUnit");
80023
+ const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("AttachmentUnit");
80001
80024
  markupBuilder.prop("data-tid").set(this.getAttachmentFormId(attachmentFormNode));
80002
80025
  markupBuilder.prop(x => x.unitId).set((0,_Engine_src_Controls_FormParts_Unit_UnitId_UnitId__WEBPACK_IMPORTED_MODULE_13__.createUnitId)(this.getAttachmentFormId(attachmentFormNode)));
80003
80026
  markupBuilder.prop(x => x.gfv).set(attachmentFormNode.gfv);
80004
80027
  markupBuilder.prop(x => x.caption).set(attachmentFormNode.name);
80005
80028
  markupBuilder.prop(x => x.description).set(attachmentFormNode.description);
80006
80029
  markupBuilder.prop(x => x.bindingPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(attachmentFormNode));
80030
+ markupBuilder.prop(x => x.multiple).set(attachmentFormNode.multiple);
80007
80031
  return markupBuilder;
80008
80032
  }
80009
80033
  isPageContainsTableWithStickyElements(pageNode) {
@@ -80050,19 +80074,28 @@ class FormConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_7__.Sug
80050
80074
  buildUnitItemsFromAttachmentForms(formNode, attachmentFormNodes) {
80051
80075
  const unitItemBuilders = [];
80052
80076
  for (const attachmentForm of attachmentFormNodes) {
80077
+ var _attachmentForm$multi;
80053
80078
  const unitItemBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_5__.componentMarkupBuilder)("UnitItem");
80054
80079
  unitItemBuilder.prop("data-tid").set(this.getAttachmentFormId(attachmentForm));
80055
80080
  unitItemBuilder.prop(x => x.id).set((0,_Engine_src_Controls_FormParts_Unit_UnitId_UnitId__WEBPACK_IMPORTED_MODULE_13__.createUnitId)(this.getAttachmentFormId(attachmentForm)));
80056
80081
  unitItemBuilder.prop(x => x.name).set(attachmentForm.name);
80057
80082
  unitItemBuilder.prop(x => x.optional).set(true);
80058
- unitItemBuilder.prop(x => x.multiple).set(false);
80083
+ unitItemBuilder.prop(x => x.multiple).set((_attachmentForm$multi = attachmentForm.multiple) !== null && _attachmentForm$multi !== void 0 ? _attachmentForm$multi : false);
80059
80084
  unitItemBuilder.prop(x => x.multipleAppearance).set("flat");
80060
80085
  unitItemBuilder.prop(x => x.pages).set([]);
80061
80086
  unitItemBuilder.prop(x => x.clearConfirmationSettings).set({});
80087
+ //unitItemBuilder.prop(x => x.maxOccurs).set(attachmentForm.maxOccurs ?? context.getPathMaxOccurs(page.getFullPath()));
80088
+
80062
80089
  if (attachmentForm.path != undefined) {
80063
80090
  unitItemBuilder.prop(x => x.unitPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(attachmentForm));
80064
80091
  }
80065
80092
  unitItemBuilder.prop(x => x.evaluatorsContextPath).set((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_15__.getNewBindingPathExpression)(formNode));
80093
+ if (attachmentForm.multiple) {
80094
+ const navigationLimit = attachmentForm.navigationLimit != undefined ? attachmentForm.navigationLimit : formNode.navigationLimit != undefined ? formNode.navigationLimit : undefined;
80095
+ if (navigationLimit != undefined) {
80096
+ unitItemBuilder.prop(x => x.navigationLimit).set(navigationLimit);
80097
+ }
80098
+ }
80066
80099
  unitItemBuilders.push(unitItemBuilder);
80067
80100
  }
80068
80101
  return unitItemBuilders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.74.0-forminform.0",
3
+ "version": "5.74.0-forminform.1",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,