@kontur.candy/generator 4.235.1 → 4.235.2

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 +40 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -310076,7 +310076,9 @@ __webpack_require__.r(__webpack_exports__);
310076
310076
  /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
310077
310077
  /* harmony import */ var _CommonNodeProperties_TooltipProperties_SetTooltipSettingsProps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../CommonNodeProperties/TooltipProperties/SetTooltipSettingsProps */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/TooltipProperties/SetTooltipSettingsProps.ts");
310078
310078
  /* harmony import */ var _SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../SugarNodes/SugarNodeUtils */ "./Generator/src/generators/markupGenerator/SugarNodes/SugarNodeUtils.ts");
310079
- /* harmony import */ var _TextAreaNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TextAreaNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Textarea/TextAreaNode.ts");
310079
+ /* harmony import */ var _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../validationGenerator/Nodes/TypeNode */ "./Generator/src/generators/validationGenerator/Nodes/TypeNode.ts");
310080
+ /* harmony import */ var _TextAreaNode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TextAreaNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Textarea/TextAreaNode.ts");
310081
+
310080
310082
 
310081
310083
 
310082
310084
 
@@ -310086,16 +310088,16 @@ __webpack_require__.r(__webpack_exports__);
310086
310088
 
310087
310089
  class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__.SugarNodeConverterBase {
310088
310090
  static getAcceptNodeClass() {
310089
- return _TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode;
310091
+ return _TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode;
310090
310092
  }
310091
310093
 
310092
310094
  doBuildNodeValidations(validationGenerator) {
310093
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310095
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310094
310096
  validationGenerator.processValidations(this.getResolvedBindingPath(node), node.validationInfo.optional, validationGenerator.getTypeNode(node.validationInfo), undefined, node.validationInfo.emptydescription);
310095
310097
  }
310096
310098
 
310097
310099
  doBuildDataDeclaration(context) {
310098
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310100
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310099
310101
  return context.mergeDataDeclaration(context.addPathDeclEntry(node, [["value", context.initSequenceFactory.dataValue(node.dataBinding, node.disabled)]]), context.addSpecialFieldsEntry(node, {
310100
310102
  optional: node.dataBinding.optional,
310101
310103
  disabled: node.disabled
@@ -310103,22 +310105,22 @@ class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
310103
310105
  }
310104
310106
 
310105
310107
  buildChildrenDataDeclaration(context) {
310106
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310108
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310107
310109
  return context.processChildrenDataDeclaration(node.helpNodes);
310108
310110
  }
310109
310111
 
310110
310112
  *doTraverseChildren() {
310111
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310113
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310112
310114
  yield* node.helpNodes;
310113
310115
  }
310114
310116
 
310115
310117
  get nodePaths() {
310116
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310118
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310117
310119
  return [(0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getNewBindingPathExpression)(node)];
310118
310120
  }
310119
310121
 
310120
310122
  doConvert(context) {
310121
- const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_6__.TextAreaNode);
310123
+ const node = this.getCurrentNodeAs(_TextAreaNode__WEBPACK_IMPORTED_MODULE_7__.TextAreaNode);
310122
310124
  this.ensurePathExists(node, node.dataBinding.path);
310123
310125
  const markupBuilder = (0,_ComponentMarkupBuilder_ComponentMarkupBuilder__WEBPACK_IMPORTED_MODULE_0__.componentMarkupBuilder)("TextArea");
310124
310126
 
@@ -310134,6 +310136,12 @@ class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
310134
310136
  markupBuilder.prop(x => x.resize).set(node.resize);
310135
310137
  markupBuilder.prop(x => x.autoResize).set(node.autoResize);
310136
310138
 
310139
+ if (node.useLengthLimit) {
310140
+ var _node$maxTextLength;
310141
+
310142
+ markupBuilder.prop(x => x.textMaxLength).set((_node$maxTextLength = node.maxTextLength) !== null && _node$maxTextLength !== void 0 ? _node$maxTextLength : this.getTextMaxLength(context, node, node.validationInfo));
310143
+ }
310144
+
310137
310145
  if (node.disabled2 != undefined) {
310138
310146
  markupBuilder.prop(x => x.disabled2).set((0,_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_5__.buildExpressionPropValue)(node.disabled2));
310139
310147
 
@@ -310146,6 +310154,14 @@ class TextAreaConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_1__
310146
310154
  return markupBuilder.buildConverterResultWithHelp(node, context);
310147
310155
  }
310148
310156
 
310157
+ getTextMaxLength(context, node, nodeValidationInfo) {
310158
+ var _ref, _ref2, _typeNode$flattenType, _typeNode$flattenType2, _typeNode$flattenType3;
310159
+
310160
+ const typeNode = context.getTypeNode(nodeValidationInfo);
310161
+ const schemaTypeInfo = context.getSchemaTypeInfo(node.getFullPath());
310162
+ return (_ref = (_ref2 = (_typeNode$flattenType = typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$flattenType2 = typeNode.flattenTypeCheckNodes().find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_6__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_6__.LengthTypeCheckNode))) === null || _typeNode$flattenType2 === void 0 ? void 0 : _typeNode$flattenType2.value) !== null && _typeNode$flattenType !== void 0 ? _typeNode$flattenType : schemaTypeInfo === null || schemaTypeInfo === void 0 ? void 0 : schemaTypeInfo.length) !== null && _ref2 !== void 0 ? _ref2 : typeNode === null || typeNode === void 0 ? void 0 : (_typeNode$flattenType3 = typeNode.flattenTypeCheckNodes().find((0,_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_6__.ofType)(_validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_6__.MaxlengthTypeCheckNode))) === null || _typeNode$flattenType3 === void 0 ? void 0 : _typeNode$flattenType3.value) !== null && _ref !== void 0 ? _ref : schemaTypeInfo === null || schemaTypeInfo === void 0 ? void 0 : schemaTypeInfo.maxLength;
310163
+ }
310164
+
310149
310165
  }
310150
310166
 
310151
310167
  /***/ }),
@@ -310169,7 +310185,7 @@ __webpack_require__.r(__webpack_exports__);
310169
310185
  /* harmony import */ var _Helpers_Help_HelpNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Helpers/Help/HelpNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/Helpers/Help/HelpNode.ts");
310170
310186
  /* harmony import */ var _CommonNodeProperties_TooltipProperties_TooltipSettingsNode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../CommonNodeProperties/TooltipProperties/TooltipSettingsNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/TooltipProperties/TooltipSettingsNode.ts");
310171
310187
  /* harmony import */ var _Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../Commons/DocumentationLinks */ "./Generator/src/generators/markupGenerator/ElementProcessors/Commons/DocumentationLinks.ts");
310172
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14;
310188
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16;
310173
310189
 
310174
310190
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
310175
310191
 
@@ -310185,7 +310201,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
310185
310201
 
310186
310202
 
310187
310203
 
310188
- let TextAreaNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.sugarNode)("textarea", `Расширяющееся поле`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Textarea sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_0__.DataBindingMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_1__.ValidationInfoNode), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_TooltipProperties_TooltipSettingsNode__WEBPACK_IMPORTED_MODULE_6__.TooltipSettingsNode), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("width", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.lengthUnit, `Ширина. Не может быть меньше 250`), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("placeholder", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.localizedString, ``), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("disabled", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.boolean, ``), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_7__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_7__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("autoResize", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.boolean, ``), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("rows", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.number, ``), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.deprecatedAttr)("row", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_2__.DeprecationReason.Typo), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("resize", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.enum("-moz-initial", "inherit", "initial", "revert", "unset", "block", "both", "horizontal", "inline", "none", "vertical"), ``), _dec13 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.bindingPath, ``), _dec14 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("help", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.string, ``), _dec15 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.children)("help", [_Helpers_Help_HelpNode__WEBPACK_IMPORTED_MODULE_5__.HelpNode]), _dec(_class = (_class2 = class TextAreaNode extends _Serializer_SugarNodeWithLegacyVisibility__WEBPACK_IMPORTED_MODULE_3__.SugarNodeWithLegacyVisibility {
310204
+ let TextAreaNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.sugarNode)("textarea", `Расширяющееся поле`, __webpack_require__("./Generator/src/generators/markupGenerator/ElementProcessors/ValueEditors/Textarea sync recursive .md$")), _dec2 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_DataBindingMixinNode__WEBPACK_IMPORTED_MODULE_0__.DataBindingMixinNode), _dec3 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_1__.ValidationInfoNode), _dec4 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrMixin)(_CommonNodeProperties_TooltipProperties_TooltipSettingsNode__WEBPACK_IMPORTED_MODULE_6__.TooltipSettingsNode), _dec5 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("width", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.lengthUnit, `Ширина. Не может быть меньше 250`), _dec6 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("placeholder", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.localizedString, ``), _dec7 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("disabled", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.boolean, ``), _dec8 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("disabled2", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.javascriptExpression, `${(0,_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_7__.docLink)(_Commons_DocumentationLinks__WEBPACK_IMPORTED_MODULE_7__.javaScriptExpressionLink)} для условного задизейбливания контрола`), _dec9 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("autoResize", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.boolean, ``), _dec10 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("rows", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.number, ``), _dec11 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.deprecatedAttr)("row", _Serializer_DeprecationReason__WEBPACK_IMPORTED_MODULE_2__.DeprecationReason.Typo), _dec12 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("resize", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.enum("-moz-initial", "inherit", "initial", "revert", "unset", "block", "both", "horizontal", "inline", "none", "vertical"), ``), _dec13 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("path", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.bindingPath, ``), _dec14 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("help", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.string, ``), _dec15 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.children)("help", [_Helpers_Help_HelpNode__WEBPACK_IMPORTED_MODULE_5__.HelpNode]), _dec16 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("useLengthLimit", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.boolean, `Включает отображение счётчик длины текста`), _dec17 = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attr)("maxTextLength", _Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.attrType.number, `Задаёт максимальное кол-во символов для счётчика длины текста. Если не указано, значение будет братся из валидации или схемы`), _dec(_class = (_class2 = class TextAreaNode extends _Serializer_SugarNodeWithLegacyVisibility__WEBPACK_IMPORTED_MODULE_3__.SugarNodeWithLegacyVisibility {
310189
310205
  constructor(...args) {
310190
310206
  super(...args);
310191
310207
 
@@ -310216,6 +310232,10 @@ let TextAreaNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODU
310216
310232
  _initializerDefineProperty(this, "help", _descriptor13, this);
310217
310233
 
310218
310234
  _initializerDefineProperty(this, "helpNodes", _descriptor14, this);
310235
+
310236
+ _initializerDefineProperty(this, "useLengthLimit", _descriptor15, this);
310237
+
310238
+ _initializerDefineProperty(this, "maxTextLength", _descriptor16, this);
310219
310239
  }
310220
310240
 
310221
310241
  getOwnPath() {
@@ -310292,6 +310312,16 @@ let TextAreaNode = (_dec = (0,_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODU
310292
310312
  enumerable: true,
310293
310313
  writable: true,
310294
310314
  initializer: null
310315
+ }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "useLengthLimit", [_dec16], {
310316
+ configurable: true,
310317
+ enumerable: true,
310318
+ writable: true,
310319
+ initializer: null
310320
+ }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "maxTextLength", [_dec17], {
310321
+ configurable: true,
310322
+ enumerable: true,
310323
+ writable: true,
310324
+ initializer: null
310295
310325
  })), _class2)) || _class);
310296
310326
 
310297
310327
  /***/ }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.235.1",
3
+ "version": "4.235.2",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,