feat(zhst/biz): treePanel添加

This commit is contained in:
NICE CODE BY DEV 2024-06-04 16:01:30 +08:00
parent e5b176c148
commit a129d39168
6 changed files with 84 additions and 12 deletions

View File

@ -1,12 +0,0 @@
import React from 'react'
import { Button } from '@zhst/meta'
import { useThrottleFn } from '@zhst/hooks'
export default () => {
const { run } = useThrottleFn(() => console.log('123'))
return (
<Button onClick={() => run()} ></Button>
)
}

View File

@ -21,6 +21,8 @@ export type { ViewLargerImageModalRef, ViewLargerImageModalProps } from './ViewL
export { default as ViewLargerImageModal, useViewLargerImageModal } from './ViewLargerImageModal' export { default as ViewLargerImageModal, useViewLargerImageModal } from './ViewLargerImageModal'
export type { VideoPlayerCardProps } from './VideoPlayerCard' export type { VideoPlayerCardProps } from './VideoPlayerCard'
export { default as VideoPlayerCard } from './VideoPlayerCard' export { default as VideoPlayerCard } from './VideoPlayerCard'
export type { TreePanelProps, TreePanelRefProps } from './treePanel'
export { default as TreePanel } from './treePanel'
export { default as RealTimeMonitor } from './RealTimeMonitor' export { default as RealTimeMonitor } from './RealTimeMonitor'
export { default as InfiniteList } from './infiniteList' export { default as InfiniteList } from './infiniteList'
export type { InfiniteListProps, InfiniteListRefProps } from './infiniteList' export type { InfiniteListProps, InfiniteListRefProps } from './infiniteList'

View File

@ -0,0 +1,33 @@
/**
* Created by jiangzhixiong on 2024/06/04
*/
import React, { forwardRef, useContext, useImperativeHandle } from 'react'
import { ConfigProvider } from '@zhst/meta'
import { Input } from 'antd';
const { ConfigContext } = ConfigProvider
export interface TreePanelProps {
prefixCls?: string;
}
export interface TreePanelRefProps {
}
const TreePanel = forwardRef<TreePanelRefProps, TreePanelProps>((props, ref) => {
const {
prefixCls: customizePrefixCls
} = props
const { getPrefixCls } = useContext(ConfigContext)
const componentName = getPrefixCls('', customizePrefixCls);
useImperativeHandle(ref, () => ({}))
return (
<div className={componentName}>
<Input />
</div>
)
})
export default TreePanel

View File

@ -0,0 +1,14 @@
import React, { useState, useRef } from 'react';
import { TreePanel } from '@zhst/biz';
const demo = () => {
return (
<div style={{ padding: '12px', width: '320px', border: '1px solid #09f' }}>
<TreePanel
/>
</div>
);
};
export default demo;

View File

@ -0,0 +1,28 @@
---
category: Components
title: TreePanel 树面板
toc: content
demo:
cols: 2
group:
title: 数据展示
---
## 代码演示
<code src="./demo/basic.tsx">基本用法</code>
## API
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
## 组件设计
该组件包含以下功能:
1. 顶部按钮支持
2. 输入框单行展示
3. 选择框和筛选框同一行
4. 按钮列表

View File

@ -0,0 +1,7 @@
/**
* Created by jiangzhixiong on 2024/06/04
*/
import TreePanel from './TreePanel'
export type { TreePanelProps, TreePanelRefProps } from './TreePanel'
export default TreePanel