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 }) => (