File tree Expand file tree Collapse file tree
form-render/src/form-render-core/src
tools/schema-generator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Tooltip } from 'antd';
22import React from 'react' ;
33import { useStore2 , useTools } from '../../hooks' ;
44import { isCheckBoxType } from '../../utils' ;
5+ import cn from 'classnames' ;
56
67const Description = ( { displayType, schema } ) => {
78 const { description, descType, descWidget } = schema ;
@@ -113,20 +114,20 @@ const Title = ({
113114 < div className = { labelClass } style = { labelStyle } >
114115 { title ? (
115116 < label
116- className = { `fr-label-title ${
117- isCheckBoxType ( schema , readOnly ) ||
118- _displayType === 'column' ||
119- ! colon
120- ? 'no-colon'
121- : ''
122- } `} // checkbox不带冒号
117+ className = { cn ( 'fr-label-title' , {
118+ 'no-colon' :
119+ isCheckBoxType ( schema , readOnly ) ||
120+ _displayType === 'column' ||
121+ ! colon ,
122+ } ) } // checkbox不带冒号
123123 title = { title }
124124 >
125125 { TitleRequiredMark }
126126 < span
127- className = { `${ isObjType ? 'b' : '' } ${
128- _displayType === 'column' ? 'flex-none' : ''
129- } `}
127+ className = { cn ( {
128+ b : isObjType ,
129+ 'flex-none' : _displayType === 'column' ,
130+ } ) }
130131 >
131132 < span dangerouslySetInnerHTML = { { __html : title } } />
132133 </ span >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import ErrorMessage from './ErrorMessage';
1212import ExtendedWidget from './ExtendedWidget' ;
1313import Extra from './Extra' ;
1414import FieldTitle from './Title' ;
15+ import cn from 'classnames' ;
1516
1617// TODO: 之后不要直接用get,收口到一个内部方法getValue,便于全局 ctrl + f 查找
1718const RenderField = props => {
@@ -241,7 +242,7 @@ const RenderField = props => {
241242 < >
242243 { _showTitle && titleElement }
243244 < div
244- className = { ` ${ contentClass } ${ hideTitle ? 'fr-content-no-title' : '' } ` }
245+ className = { cn ( contentClass , { 'fr-content-no-title' : hideTitle } ) }
245246 style = { contentStyle }
246247 datapath = { dataPath }
247248 >
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ const CoreRender = ({
259259 } ;
260260
261261 const objChildren = (
262- < div className = { `flex flex-wrap` } >
262+ < div className = { `flex flex-wrap fr-core-obj ` } >
263263 < RenderObject
264264 dataIndex = { dataIndex }
265265 errorFields = { errorFields }
Original file line number Diff line number Diff line change 148148 }
149149
150150 .fr-list-1 {
151+
152+ .flex-wrap.flex.fr-core-obj {
153+ flex-wrap : nowrap ;
154+ }
155+
151156 .fr-content {
152157 min-width : 140px ;
153158 }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ describe('Test TableRender valueType', () => {
77 } ) ;
88 test ( 'Test getDateTime' , ( ) => {
99 const current = new Date ( ) . getTime ( ) ;
10- expect ( getDateTime ( current ) ) . toHaveLength ( 16 ) ;
10+ expect ( getDateTime ( current ) ) . toHaveLength ( 19 ) ;
1111 } ) ;
1212 test ( 'Test getMoneyType' , ( ) => {
1313 expect ( getMoneyType ( 10000 ) ) . toEqual ( '¥10,000' ) ;
Original file line number Diff line number Diff line change 77} from '../../../utils' ;
88import { useStore } from '../../../utils/hooks' ;
99import { getWidgetName } from '../../../utils/mapping' ;
10+ import cn from 'classnames' ;
1011
1112const RenderField = ( {
1213 $id,
@@ -90,18 +91,17 @@ const RenderField = ({
9091 { schema . title ? (
9192 < div className = { labelClass } style = { labelStyle } >
9293 < label
93- className = { `fr-label-title ${
94- widgetName === 'checkbox' || displayType === 'column'
95- ? 'no-colon'
96- : ''
97- } `} // checkbox不带冒号
94+ className = { cn ( 'fr-label-title' , {
95+ 'no-colon' : widgetName === 'checkbox' || displayType === 'column' ,
96+ } ) } // checkbox不带冒号
9897 title = { title }
9998 >
10099 { required && < span className = "fr-label-required" > *</ span > }
101100 < span
102- className = { `${ isComplex ? 'b' : '' } ${
103- displayType === 'column' ? 'flex-none' : ''
104- } `}
101+ className = { cn ( {
102+ b : isComplex ,
103+ 'flex-none' : displayType === 'column' ,
104+ } ) }
105105 >
106106 < span dangerouslySetInnerHTML = { { __html : title } } />
107107 </ span >
Original file line number Diff line number Diff line change 88 margin : 0 ;
99}
1010
11- .fr-generator-container .dnd-container > .field-wrapper > .fr-field {
11+ .fr-generator-container .dnd-container > .field-wrapper > div .fr-field {
1212 margin : 0 ;
1313}
1414
Original file line number Diff line number Diff line change @@ -47,8 +47,6 @@ const transformTo = schema => {
4747 label : schema . enumNames [ idx ] ,
4848 } ) ) ;
4949 schema . enumList = list ;
50- schema . enum ;
51- schema . enumNames ;
5250 }
5351 } else {
5452 const childrenList = getChildren2 ( schema ) ;
You can’t perform that action at this time.
0 commit comments