@kontur.candy/generator 6.23.0 → 6.24.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 +22 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -111126,6 +111126,7 @@ WellKnownDirectories.TestFarmDir = "candy.farm";
111126
111126
  "use strict";
111127
111127
  __webpack_require__.r(__webpack_exports__);
111128
111128
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
111129
+ /* harmony export */ generateSimpleHash: () => (/* binding */ generateSimpleHash),
111129
111130
  /* harmony export */ getSimpleHashByString: () => (/* binding */ getSimpleHashByString)
111130
111131
  /* harmony export */ });
111131
111132
  function getSimpleHashByString(source) {
@@ -111135,6 +111136,13 @@ function getSimpleHashByString(source) {
111135
111136
  }
111136
111137
  return result;
111137
111138
  }
111139
+ const generateSimpleHash = (length = 8) => {
111140
+ let result = "";
111141
+ while (result.length < length) {
111142
+ result += Math.random().toString(36).slice(2);
111143
+ }
111144
+ return result.slice(0, length);
111145
+ };
111138
111146
 
111139
111147
  /***/ }),
111140
111148
 
@@ -113167,10 +113175,21 @@ __webpack_require__.r(__webpack_exports__);
113167
113175
  /* harmony export */ HelperFunctionsStringHelpers: () => (/* binding */ HelperFunctionsStringHelpers),
113168
113176
  /* harmony export */ pluralize: () => (/* binding */ pluralize),
113169
113177
  /* harmony export */ splitHighlightedParts: () => (/* binding */ splitHighlightedParts),
113170
- /* harmony export */ splitLastOccurrence: () => (/* binding */ splitLastOccurrence)
113178
+ /* harmony export */ splitLastOccurrence: () => (/* binding */ splitLastOccurrence),
113179
+ /* harmony export */ truncateText: () => (/* binding */ truncateText)
113171
113180
  /* harmony export */ });
113172
113181
  /* harmony import */ var _Common_IntRangeUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../Common/IntRangeUtils */ "./Common/IntRangeUtils.ts");
113173
113182
 
113183
+ const truncateText = (text, maxLength = 40) => {
113184
+ if (!text) {
113185
+ return "";
113186
+ }
113187
+ if (text.length <= maxLength) {
113188
+ return text;
113189
+ }
113190
+ const half = Math.floor(maxLength / 2);
113191
+ return `${text.slice(0, half)}…${text.slice(-half)}`;
113192
+ };
113174
113193
  const splitLastOccurrence = (source, substring) => {
113175
113194
  const lastIndex = source.lastIndexOf(substring);
113176
113195
  let before = "";
@@ -159037,7 +159056,7 @@ class AddRowButtonConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE
159037
159056
  const element = formSchemaRng.getElementByPath(node.getFullPath());
159038
159057
 
159039
159058
  // eslint-disable-next-line no-warning-comments
159040
- // TODO(2026-05-31): Необходимо разобраться с тем, что тут конфликтят свойства в type. Подробности в задаче https://yt.skbkontur.ru/issue/FS-9234
159059
+ // TODO(2026-06-30): Необходимо разобраться с тем, что тут конфликтят свойства в type. Подробности в задаче https://yt.skbkontur.ru/issue/FS-9234
159041
159060
  const fakeNode = new _validationGenerator_Nodes_TypeNode__WEBPACK_IMPORTED_MODULE_7__.TypeNode();
159042
159061
  fakeNode.base = "string";
159043
159062
  fakeNode.children = [];
@@ -168498,7 +168517,7 @@ class FileLoaderConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_4
168498
168517
  }
168499
168518
 
168500
168519
  // eslint-disable-next-line no-warning-comments
168501
- // TODO(2026-05-31): Исправить в рамках задачи https://yt.skbkontur.ru/issue/FS-9386
168520
+ // TODO(2026-06-30): Исправить в рамках задачи https://yt.skbkontur.ru/issue/FS-9386
168502
168521
  *doBuildKCLangValidations_REMOVE_THIS_SUFFIX(buildContext, formSchemaRng, prefixPath) {
168503
168522
  const node = this.getCurrentNodeAs(_FileLoaderNode__WEBPACK_IMPORTED_MODULE_11__.FileLoaderNode);
168504
168523
  const element = formSchemaRng.getElementByPath(node.getFullPath());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "6.23.0",
3
+ "version": "6.24.0",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,