Skip to content

Commit

Permalink
Merge pull request baidu#9746 from wibetter/master
Browse files Browse the repository at this point in the history
fix(amis-theme-editor-helper): 字体、边框、内外边距等外观配置增加默认placeholder
  • Loading branch information
hsm-lv committed Mar 7, 2024
2 parents b8e486f + 556a3b1 commit 108b46c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
14 changes: 8 additions & 6 deletions packages/amis-theme-editor-helper/src/renderers/Border.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,18 @@ function BoxBorder(props: BorderProps & FormControlProps) {
}-border-width`}
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.[getKey('width')]}
placeholder={editorDefaultValue?.[getKey('width')] || '边框粗细'}
/>
<div className="Theme-Border-settings-style-color">
<Select
options={borderStyleOptions}
value={borderData[getKey('style')]}
placeholder={getLabel(
editorDefaultValue?.[getKey('style')],
borderStyleOptions
)}
placeholder={
getLabel(
editorDefaultValue?.[getKey('style')],
borderStyleOptions
) || '边框样式'
}
onChange={(item: any) => changeItem('style')(item.value)}
clearable={!!editorDefaultValue}
renderMenu={(item: Options) => {
Expand Down Expand Up @@ -322,7 +324,7 @@ function BoxBorder(props: BorderProps & FormControlProps) {
itemName={`${
borderType === 'all' ? 'top' : borderType
}-border-color`}
placeholder={editorDefaultValue?.[getKey('color')]}
placeholder={editorDefaultValue?.[getKey('color')] || '边框颜色'}
/>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions packages/amis-theme-editor-helper/src/renderers/Font.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ function FontEditor(props: FontEditorProps) {
}}
itemName="color"
state={state}
placeholder={editorDefaultValue?.color}
placeholder={editorDefaultValue?.color || '字体颜色'}
editorInheritValue={editorInheritValue?.color}
/>
</div>
Expand All @@ -1019,7 +1019,7 @@ function FontEditor(props: FontEditorProps) {
menuTpl="label"
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.fontSize}
placeholder={editorDefaultValue?.fontSize || '字体大小'}
/>
</div>
)}
Expand All @@ -1038,7 +1038,7 @@ function FontEditor(props: FontEditorProps) {
menuTpl="label"
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.fontWeight}
placeholder={editorDefaultValue?.fontWeight || '字体字重'}
/>
{(!hideLineHeight || !hideFontFamily) && (
<div className="Theme-FontEditor-item-label">字重</div>
Expand All @@ -1058,7 +1058,7 @@ function FontEditor(props: FontEditorProps) {
menuTpl="label"
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.lineHeight}
placeholder={editorDefaultValue?.lineHeight || '字体行高'}
/>
<div className="Theme-FontEditor-item-label">行高</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function PaddingAndMarginDialog(props: PaddingAndMarginProps) {
itemName="margin-all"
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.margin}
placeholder={editorDefaultValue?.margin || '外边距'}
/>
<div className="Theme-PaddingAndMargin-input-label">外边距</div>
</div>
Expand All @@ -250,7 +250,7 @@ function PaddingAndMarginDialog(props: PaddingAndMarginProps) {
itemName="padding-all"
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.padding}
placeholder={editorDefaultValue?.padding || '内边距'}
/>
<div className="Theme-PaddingAndMargin-input-label">内边距</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/amis-theme-editor-helper/src/renderers/Radius.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function BoxRadius(props: RadiusProps & RendererProps) {
itemName={'all-border-radius'}
state={state}
inheritValue={editorThemePath ? 'inherit' : ''}
placeholder={editorDefaultValue?.[getKey('all')]}
placeholder={editorDefaultValue?.[getKey('all')] || '圆角'}
/>
</div>
</div>
Expand Down

0 comments on commit 108b46c

Please sign in to comment.