From 3a0d729042e2f39159be64ce687746b89e0293cc Mon Sep 17 00:00:00 2001 From: tlartem Date: Wed, 6 Aug 2025 22:57:37 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=B3=D0=B0=D0=BB=D0=BE=D1=87=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/implementations/TextElement.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/entity/element/model/implementations/TextElement.tsx b/src/entity/element/model/implementations/TextElement.tsx index c3a078c..ce28d85 100644 --- a/src/entity/element/model/implementations/TextElement.tsx +++ b/src/entity/element/model/implementations/TextElement.tsx @@ -9,6 +9,7 @@ interface TextConfig { placeholder?: string required?: boolean showIncrementButton?: boolean // Новый параметр для отображения кнопки +1 + addZeroWidthSpace?: boolean // Добавляем невидимый символ \u200B к значению targetCells: any[] name?: string id?: string // Добавляем id для совместимости с TemplateElement @@ -51,6 +52,7 @@ export const textDefinition: ElementDefinition = { placeholder: '', required: false, showIncrementButton: false, + addZeroWidthSpace: false, targetCells: [], name: '', }, @@ -65,7 +67,10 @@ export const textDefinition: ElementDefinition = { mapToCells: config => config.targetCells || [], mapToCellValues: (config, value) => { const cells = config.targetCells || [] - return cells.map(target => ({ target, value: value || '' })) + const cellValue = config.addZeroWidthSpace + ? `\u200B${value || ''}` + : value || '' + return cells.map(target => ({ target, value: cellValue })) }, Editor: ({ config, onChange }) => (
@@ -84,6 +89,21 @@ export const textDefinition: ElementDefinition = { Показывать кнопку +1
+
+ + onChange({ ...config, addZeroWidthSpace: !!checked }) + } + /> + +
), Preview: ({ config }) => (