2.0.0 • Published 10 months ago

mui-tree-selects v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Mui-Tree-Selects

使用 Mui Tree 搭配 checkbox 實現樹狀多選單

install

npm

npm install mui-tree-selects

yarn

yarn add mui-tree-selects

Props

props功能
iconDirection調整按鈕位置
collapseIcon收合時的 icon
expandIco展開時的 icon
treeData樹狀資料
selectNode已選擇的節點
setSelectNode選取節點的 function (???)
iconReverseicon 顯示在後方,預設為 false => UIUX 怪怪的
checkboxColorcheckbox 顏色,可自定義 => (border 可調整??)
expanded可點擊的節點 (使用者自控) => 待補
wrapperBorder最外層的 border 樣式

有想加的 props 都歡迎發 PR

treeData 格式

export type TreeData = {
  name: string
  id: string
  parent?: string
  children?: TreeData[]
}

使用

import React from 'react'

import { MuiTreeSelect } from 'mui-tree-selects'

import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import ChevronRightIcon from '@mui/icons-material/ChevronRight'

import data from './fakeData.json'

const App = () => {
  return (
    <MuiTreeSelect
      treeData={data}
      collapseIcon={<ExpandMoreIcon />}
      expandIcon={<ChevronRightIcon />}
      iconReverse={true}
    />
  )
}

export default App
2.0.0

10 months ago

1.0.0

11 months ago

0.0.11-beta.0

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago