feat:add letter spacing

This commit is contained in:
Hufe921
2022-04-17 14:49:52 +08:00
parent 6b2d0dc4a4
commit 2152c00238
3 changed files with 7 additions and 0 deletions
+3
View File
@@ -1,5 +1,6 @@
import { deepClone, getUUID } from '.'
import { ElementType, IEditorOption, IElement } from '..'
import { defaultCheckboxOption } from '../dataset/constant/Checkbox'
import { ZERO } from '../dataset/constant/Common'
import { defaultControlOption } from '../dataset/constant/Control'
import { EDITOR_ELEMENT_ZIP_ATTR } from '../dataset/constant/Element'
@@ -123,10 +124,12 @@ export function formatElementList(elementList: IElement[], options: IFormatEleme
const valueStrList = valueSet.value.split('')
for (let e = 0; e < valueStrList.length; e++) {
const value = valueStrList[e]
const isLastLetter = e === valueStrList.length - 1
elementList.splice(i, 0, {
controlId,
value,
type: el.type,
letterSpacing: isLastLetter ? defaultCheckboxOption.gap : 0,
control: el.control,
controlComponent: ControlComponent.VALUE
})