Commit f7074a49 authored by 田翔's avatar 田翔

fix: 样式修改

parent ab185135
{
"name": "panda-xform",
"version": "2.6.4",
"description": "2.6.4: laoding优化",
"version": "2.6.5",
"description": "2.6.5: 样式修改",
"keywords": [
"panda-xform"
],
......
......@@ -400,23 +400,14 @@ const textWidgets = [
type: 'string',
widget: 'CalculateRule',
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
prefix: {
title: '前缀',
type: 'string',
widget: 'htmlInput',
displayType: 'row',
labelWidth: 60,
},
formatter: {
title: '格式化',
type: 'string',
displayType: 'row',
labelWidth: 60,
widget: 'select',
enum: ['%', '‰'],
default: '',
......@@ -425,6 +416,21 @@ const textWidgets = [
allowClear: true
}
},
groupStyle: {
title: '控件样式',
type: 'object',
properties: {}
},
addonBefore: {
title: '前置标签',
type: 'string',
widget: 'InputAddon',
},
addonAfter: {
title: '后置标签',
type: 'string',
widget: 'InputAddon',
},
width: {
title: '元素宽度',
type: 'string',
......
......@@ -23,6 +23,7 @@ const FormDesigner = (props, ref) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform')
const prefixClsPandaXform = getPrefixCls()
const [visible, setVisible] = useState(false)
const [schema, setSchema] = useState({})
const designerRef = useRef(null)
......@@ -220,7 +221,7 @@ const FormDesigner = (props, ref) => {
<div className={prefixCls} style={{ width: '100%', height: '100%', background: 'white' }}>
<div style={{ height: '100%' }}>
<Generator
configProvider={{ prefixCls: prefixCls }}
configProvider={{ prefixCls: prefixClsPandaXform }}
mapping={{
object: 'Header',
}}
......
......@@ -2,7 +2,7 @@ import React, { useMemo, useState, useContext } from 'react'
import { Input, Modal, ConfigProvider } from 'antd'
import Icon, { PlusOutlined } from '@ant-design/icons'
import * as icons from '@ant-design/icons'
import './index.less'
import styles from './index.less'
import Drag from '../../../components/Drag'
const iconList = Object.keys(icons).filter((item) => typeof icons[item] === 'object')
......@@ -32,8 +32,9 @@ const InputAddon = (props) => {
}
return (
<div className={`inputAddon`}>
<Input value={value} onChange={inputChange} addonAfter={<PlusOutlined onClick={iconClick} />} />
<div className={styles.inputAddon}>
<Input value={value} onChange={inputChange} />
<div className={styles.addon}><PlusOutlined onClick={iconClick} /></div>
<Drag
width={'50%'}
getContainer={false}
......
......@@ -2,6 +2,18 @@
@pandaXform: ~'@{ant-prefix}-pandaXform';
.@{pandaXform} {
.inputAddon {
position: relative;
.@{ant-prefix}-input {
padding-right: 30px;
}
.addon {
position: absolute;
right: 10px;
top: 5px;
&:hover {
color: #4096ff;
}
}
.iconBox {
width: 100%;
height: 100%;
......
......@@ -4,7 +4,7 @@ import { InputNumber } from 'antd'
const NumberInput = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, presetValue, placeholder, prefix, formatter } = schema
const { disabled, presetValue, placeholder, prefix, formatter, addonBefore, addonAfter } = schema
useEffect(() => {
if (addons) {
......@@ -22,9 +22,11 @@ const NumberInput = (props) => {
return (
<InputNumber
addonBefore={addonBefore}
addonAfter={addonAfter}
prefix={prefix}
placeholder={placeholder}
disabled={disabled}
disabled={disabled}
value={Number(value)}
formatter={(value) => value && formatter ? `${value}${formatter}` : value}
onChange={inputChange}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment