1.0.91 • Published 3 years ago

ant-seed-ui v1.0.91

Weekly downloads
132
License
MIT
Repository
-
Last release
3 years ago

ant-seed-ui

Ant seed UI Toolkit based on Ant Design and React

初衷

  • 在 antd 上封装一层,项目中不引用antd,方便以后将antd替换
  • 业务大组件封装,方便快速开发,风格统一

设计

  • JSON In, JSON Out
    • 组件参数接收 配置 JSON
    • 组件回调输出 结果 JSON
  • 默认值覆盖大多数情况
  • 尽量可自定义满足少数情况

组件

  • NavFrame
    • layout
    • menus
    • pageLinks
    • title
    • actions
  • Form
    • forms 必填 , 为Object的数组, Object字段如下
      • key 必填
      • label 必填
      • type
        • input default
        • add 动态添加
        • header
        • info
        • select
        • textArea
        • date
        • checkbox
        • radio
        • rangeDate
        • month
      • placeholder
      • required
        • bool
        • function
      • reg
        • pattern
        • message
      • value
      • disabled
      • alwaysEnable
      • meta type为select时有效
        • ref
          • 表单联动时需要参考的字段的 key
        • mode
          • undefined default
          • tags
          • multiple
        • data function / array
          • 若有ref配置,function的参数 refValue 为参考字段的值
        • showSearch
      • addLabel type为add时有效
      • addKeys type为add时有效
        • 需要动态添加的字段的key值的数组
      • showTime type为date时有效
      • onChange
      • data type为select时有效
    • accessoryComponent
      • 函数
      • 可返回不受表单控制的附加 UI,
      • 参数为函数 getFormItem,可返回受表单控制的自定义UI
      • getFormItem 接收参数为Object, Object 字段如下
        • label必填
        • key必填
        • value
        • required
        • reg
    • onSubmit,参数如下
      • values
        • JSON Out
      • clear
        • 函数,调用可清空表单
    • onReset
      • 重置表单回调
    • layout
      • columnCount
        • 默认列数
      • rowColCounts
        • 每行列数的数组
        • 若数组列数之和小于所有表单字段数,数组最后一项的列数为之后剩余字段的布局列数
      • actionDirection
        • 页末操作按钮的位置
        • left
        • center
        • right
      • labelPostion
        • 字段Label的位置
          • left
          • top
      • . . . . . .
    • disableEnterSubmit
    • … …
  • Table
    • columns 必填, 为Object的数组, Object字段如下
      • title 必填
      • dataIndex必填
      • editable
        • bool
        • function
      • type editable 为 true时有效
        • input default
        • select
        • tags
        • multiple
      • meta type 为 select tags multiple 时有效
        • ref
          • 可以参考 Table 同 Row 的其他列字段,与之联动
        • data function / array
          • 若有ref配置,function的参数 refValue 为参考字段的值
      • required
      • disabled
      • fixed
      • width
      • reg
        • pattern
        • message
      • actions
        • label 必填
        • callback
          • 接收参数 text, record, index
        • show bool / function
          • 函数时接收参数 text, record, index
          • 函数时需返回bool
        • confirm
        • confirmLabel
    • dataSource 必填
    • onCellSave editable为true时回调
    • scrollWidth
      • 建议指定为大于表格宽度的固定值或百分比, 如 1000
      • 配合 fixed column 或 floatingScrollDomQuery 使用
    • floatingScrollDomQuery
      • 一般为 ".ant-table-scroll .ant-table-body",使滚动条 floating
    • pagination
      • 参考 antd 的 pagination
    • onChange
      • 参数 pagination, filters, sorter
      • 主要用 pagination 进行分页
    • columnsConfigGlobalTableKey
      • 列配置的开启并指定全局唯一key(建议:项目唯一性简称+功能Model名+页面名+Table名等),用于缓存
    • . . . . . .
  • . . . . . .

Install

npm install --save ant-seed-ui

Usage

import React, { Component } from 'react'

import { Button } from 'ant-seed-ui'

class Example extends Component {
  render () {
    return (
      <Button title="Default"/>
    )
  }
}

License

1.0.73

3 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.77-beta

3 years ago

1.0.80

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.82

3 years ago

1.0.81

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.85

3 years ago

1.0.89

3 years ago

1.0.91

3 years ago

1.0.90

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.69

3 years ago

1.0.68

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.67

3 years ago

1.0.55

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.48

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.29

4 years ago

1.0.30

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago