How to use the @uform/react.createVirtualBox function in @uform/react

To help you get started, we’ve selected a few @uform/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / uform / packages / antd / src / components / layout.tsx View on Github external
{children.reduce((buf, child, key) => {
            return child
              ? buf.concat(
                  
                    {child}
                  
                )
              : buf
          }, [])}
        
      )
    }
  }
)

export const FormCard = createVirtualBox(
  'card',
  styled(
    class extends Component {
      public static defaultProps = {
        // bodyHeight: 'auto'
      }
      public render() {
        const { children, className, ...props } = this.props
        return (
          
            {children}
          
        )
      }
    }
  )`
github alibaba / uform / packages / antd / src / components / layout.tsx View on Github external
}
    }
  )`
    margin-bottom: 30px;
    .ant-card-body {
      padding-top: 30px;
      padding-bottom: 0 !important;
    }
    &.ant-card {
      display: block;
      margin-bottom: 30px;
    }
  `
)

export const FormBlock = createVirtualBox(
  'block',
  styled(
    class extends Component {
      public static defaultProps = {
        // bodyHeight: 'auto'
      }

      public render() {
        const { children, className, ...props } = this.props
        return (
          
            {children}
          
        )
      }
    }
github alibaba / uform / packages / next / src / components / layout.tsx View on Github external
} from '../type'

const { Row, Col } = Grid

const normalizeCol = (
  col: { span: number; offset?: number } | number,
  defaultValue: { span: number } = { span: 0 }
): { span: number; offset?: number } => {
  if (!col) {
    return defaultValue
  } else {
    return typeof col === 'object' ? col : { span: col }
  }
}

export const FormLayout = createVirtualBox(
  'layout',
  ({ children, ...props }) => {
    return (
      
        {value => {
          let newValue = { ...value, ...props }
          let child =
            newValue.inline || newValue.className || newValue.style ? (
              <div style="{newValue.style}">
                {children}
              </div>
github alibaba / uform / packages / next / src / components / layout.tsx View on Github external
FormItem,
        {
          labelAlign,
          labelTextAlign,
          labelCol,
          wrapperCol,
          autoAddColon,
          size,
          ...props
        },
        props.children
      )
    }
  )

export const FormItemGrid = createVirtualBox(
  'grid',
  class extends Component {
    renderFormItem(children) {
      const { title, help, name, extra, ...props } = this.props
      return React.createElement(
        FormLayoutItem,
        {
          label: title,
          noMinHeight: true,
          id: name,
          extra,
          help,
          ...props
        } as IFormItemGridProps,
        children
      )
github alibaba / uform / packages / next / src / components / layout.tsx View on Github external
{children}
          
        )
      }
    }
  )`
    margin-bottom: 30px;
    .next-card-body {
      padding-top: 30px;
      padding-bottom: 0 !important;
    }
  `
)

export const FormBlock = createVirtualBox(
  'block',
  styled(
    class extends Component {
      static defaultProps = {
        contentHeight: 'auto'
      }
      render() {
        const { children, className, ...props } = this.props
        return (
          
            {children}
          
        )
      }
    }
  )`
github alibaba / uform / packages / antd / src / components / layout.tsx View on Github external
&gt;
                {children}
              
            ) : (
              children
            )
          return (
            {child}
          )
        }}
      
    )
  }
)

export const FormItemGrid = createVirtualBox(
  'grid',
  class extends Component {
    public render() {
      const { title } = this.props
      if (title) {
        return this.renderFormItem(this.renderGrid())
      } else {
        return this.renderGrid()
      }
    }

    private renderFormItem(children) {
      const { title, help, name, extra, ...props } = this.props
      return React.createElement(
        FormLayoutItem,
        {
github alibaba / uform / packages / antd / src / components / layout.tsx View on Github external
{
          labelAlign,
          labelTextAlign,
          labelCol,
          wrapperCol,
          autoAddColon,
          size,
          ...props
        },
        props.children
      )
    }
  )
}

export const FormLayout = createVirtualBox(
  'layout',
  ({ children, ...props }) =&gt; {
    return (
      
        {value =&gt; {
          const newValue = { ...value, ...props }
          const child =
            newValue.inline || newValue.className || newValue.style ? (
              <div style="{newValue.style}">
                {children}
              </div>
github alibaba / uform / packages / next / src / components / layout.tsx View on Github external
)
    }

    render() {
      const { title } = this.props
      if (title) {
        return this.renderFormItem(this.renderGrid())
      } else {
        return this.renderGrid()
      }
    }
  }
)

export const FormCard = createVirtualBox(
  'card',
  styled(
    class extends Component {
      static defaultProps = {
        contentHeight: 'auto'
      }
      render() {
        const { children, className, ...props } = this.props
        return (
          
            {children}
          
        )
      }
    }
  )`

@uform/react

English | [简体中文](./README.zh-cn.md)

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis

Similar packages