添加单行文本组件

This commit is contained in:
2023-05-04 19:26:58 +08:00
parent 5516c6008b
commit 81f7f0563d
19 changed files with 153532 additions and 17558 deletions

View File

@@ -6,7 +6,7 @@
* @FilePath: \dooringx\packages\dooringx-lib\src\components\leftConfig.tsx
*/
import React, { ReactNode, useEffect, useMemo, useState } from 'react';
import { Input, Menu } from 'antd';
import { Input, Menu, Card } from 'antd';
import { dragEventResolve, LeftRegistComponentMapItem } from '../core/crossDrag';
import UserConfig from '../config';
import { DoubleLeftOutlined, DoubleRightOutlined, SearchOutlined } from '@ant-design/icons';
@@ -18,7 +18,7 @@ interface LeftConfigProps {
config: UserConfig;
showName?: Boolean;
footerConfig?: ReactNode;
mode?: modeType;
mode?: 'horizontal' | 'vertical';
}
/**
@@ -111,18 +111,86 @@ function LeftConfig(props: LeftConfigProps) {
key={index}
{...dragEventResolve(v, props.config)}
>
<div className={`${styles.redbox} yh-left-item-img-wrap`}>
{v.imgCustom ? (
v.imgCustom
) : (
<img
src={v.img}
style={{ width: '100%', height: '100%' }}
alt="component"
></img>
)}
</div>
<Card
hoverable
style={{ width: 100 }}
bordered
bodyStyle={{ padding: 5 }}
cover={
<div
style={{
width: 100,
height: 100,
border: '1px solid #f0f0f0',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
padding: '2px',
}}
>
{v.imgCustom ? (
v.imgCustom
) : (
<img
src={v.img}
style={{ width: '100%', height: '100%' }}
alt="component"
></img>
)}
</div>
}
>
{/* <Divider /> */}
<div
style={{
textAlign: 'center',
lineHeight: '20px',
height: '20px',
overflow: 'hidden',
}}
>
{v.displayName}
</div>
</Card>
</div>
))}
{(!search || search === '') &&
cache.map((v, index) => (
<div
className={`${styles.coitem} yh-left-item-wrap`}
key={index}
{...dragEventResolve(v, props.config)}
>
<Card
hoverable
style={{ width: 100 }}
bordered
bodyStyle={{ padding: 5 }}
cover={
<div
style={{
width: 100,
height: 100,
border: '1px solid #f0f0f0',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
padding: '5px',
}}
>
{v.imgCustom ? (
v.imgCustom
) : (
<img
src={v.img}
style={{ width: '100%', height: '100%' }}
alt="component"
></img>
)}
</div>
}
>
{/* <Divider /> */}
<div
style={{
textAlign: 'center',
@@ -133,36 +201,7 @@ function LeftConfig(props: LeftConfigProps) {
>
{v.displayName}
</div>
</div>
))}
{(!search || search === '') &&
cache.map((v, index) => (
<div
className={`${styles.coitem} yh-left-item-wrap`}
key={index}
{...dragEventResolve(v, props.config)}
>
<div className={`${styles.redbox} yh-left-item-img-wrap`}>
{v.imgCustom ? (
v.imgCustom
) : (
<img
src={v.img}
style={{ width: '100%', height: '100%' }}
alt="component"
></img>
)}
</div>
<div
style={{
textAlign: 'center',
lineHeight: '20px',
height: '20px',
overflow: 'hidden',
}}
>
{v.displayName}
</div>
</Card>
</div>
))}
</div>