@wzyjs/uis 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +49 -0
- package/src/antd/form/CheckboxButton/index.module.scss +24 -0
- package/src/antd/form/CheckboxButton/index.tsx +31 -0
- package/src/antd/form/RadioButton/index.tsx +30 -0
- package/src/antd/form/Upload/index.tsx +65 -0
- package/src/antd/form/UploadImage/index.tsx +338 -0
- package/src/antd/form/index.ts +5 -0
- package/src/antd/index.ts +43 -0
- package/src/antd/pro/Alert/index.tsx +24 -0
- package/src/antd/pro/Button/components/Confirm.tsx +24 -0
- package/src/antd/pro/Button/components/Copy.tsx +46 -0
- package/src/antd/pro/Button/components/Drawer.tsx +37 -0
- package/src/antd/pro/Button/components/Group.tsx +26 -0
- package/src/antd/pro/Button/index.tsx +11 -0
- package/src/antd/pro/Card/index.tsx +92 -0
- package/src/antd/pro/Collapse/components/Item.tsx +30 -0
- package/src/antd/pro/Collapse/index.tsx +27 -0
- package/src/antd/pro/Image/index.tsx +17 -0
- package/src/antd/pro/Input/components/Range.tsx +46 -0
- package/src/antd/pro/Input/index.tsx +61 -0
- package/src/antd/pro/Popconfirm/index.tsx +16 -0
- package/src/antd/pro/Radio/components/Cancel.tsx +30 -0
- package/src/antd/pro/Radio/index.tsx +7 -0
- package/src/antd/pro/Space/index.tsx +15 -0
- package/src/antd/pro/Typography/components/String.tsx +72 -0
- package/src/antd/pro/Typography/index.tsx +9 -0
- package/src/antd/pro/index.ts +10 -0
- package/src/components/BottomBar/index.tsx +28 -0
- package/src/components/CodeView/index.tsx +85 -0
- package/src/components/Collapse/index.tsx +26 -0
- package/src/components/Com2Canvas/index.tsx +60 -0
- package/src/components/CompileHtml/index.tsx +26 -0
- package/src/components/DateSwitcher/index.module.scss +10 -0
- package/src/components/DateSwitcher/index.tsx +75 -0
- package/src/components/DownloadLink/index.tsx +36 -0
- package/src/components/DragSort/index.tsx +77 -0
- package/src/components/DynamicSelect/index.tsx +77 -0
- package/src/components/DynamicSelect/utils.ts +47 -0
- package/src/components/EnumTag/index.tsx +24 -0
- package/src/components/FetchSelect/index.tsx +57 -0
- package/src/components/Fold/index.tsx +52 -0
- package/src/components/FormPro/index.tsx +28 -0
- package/src/components/GroupLayout/index.tsx +45 -0
- package/src/components/HtmlPro/index.tsx +18 -0
- package/src/components/IframePro/index.tsx +52 -0
- package/src/components/JsonRenderer/index.tsx +115 -0
- package/src/components/JsonView/index.tsx +21 -0
- package/src/components/Markdown/index.tsx +152 -0
- package/src/components/Markdown/style.ts +106 -0
- package/src/components/MultiImageDisplay/index.tsx +63 -0
- package/src/components/SectorButton/index.tsx +247 -0
- package/src/components/TextInput/index.tsx +61 -0
- package/src/components/Video/index.tsx +37 -0
- package/src/components/index.ts +22 -0
- package/src/web.ts +2 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Input } from 'antd'
|
|
6
|
+
import { useBoolean } from '@wzyjs/hooks/web'
|
|
7
|
+
|
|
8
|
+
interface TextInputProps {
|
|
9
|
+
value: string
|
|
10
|
+
onChange?: (value: string) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TextInput = (props: TextInputProps) => {
|
|
14
|
+
const { value, onChange } = props
|
|
15
|
+
|
|
16
|
+
const [text, setText] = useState(value)
|
|
17
|
+
|
|
18
|
+
const [isEditing, { setTrue, setFalse }] = useBoolean(false)
|
|
19
|
+
|
|
20
|
+
const onSubmit = () => {
|
|
21
|
+
if (!text.trim()) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (text === value) {
|
|
26
|
+
setFalse()
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
onChange?.(text.trim())
|
|
31
|
+
setFalse()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const onBlur = () => {
|
|
35
|
+
onSubmit()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const onKeyDown = (e: React.KeyboardEvent) => {
|
|
39
|
+
if (e.key === 'Enter') {
|
|
40
|
+
onSubmit()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div onDoubleClick={setTrue}>
|
|
46
|
+
{!isEditing ? (
|
|
47
|
+
<span>{text}</span>
|
|
48
|
+
) : (
|
|
49
|
+
<Input
|
|
50
|
+
value={text}
|
|
51
|
+
onChange={ev => setText(ev.target.value)}
|
|
52
|
+
onBlur={onBlur}
|
|
53
|
+
onKeyDown={onKeyDown}
|
|
54
|
+
autoFocus
|
|
55
|
+
size='small'
|
|
56
|
+
style={{ width: 200 }}
|
|
57
|
+
/>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { CSSProperties, useRef } from 'react'
|
|
4
|
+
|
|
5
|
+
interface VideoProps {
|
|
6
|
+
url: string,
|
|
7
|
+
width?: number,
|
|
8
|
+
height?: number,
|
|
9
|
+
style?: CSSProperties
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Video = (props: VideoProps) => {
|
|
13
|
+
const { url, width = 175, height = 310, style } = props
|
|
14
|
+
|
|
15
|
+
const videoRef = useRef<HTMLVideoElement>(null)
|
|
16
|
+
|
|
17
|
+
if (!url) {
|
|
18
|
+
return null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<video
|
|
23
|
+
ref={videoRef}
|
|
24
|
+
width={width}
|
|
25
|
+
height={height}
|
|
26
|
+
style={style}
|
|
27
|
+
onMouseEnter={() => {
|
|
28
|
+
videoRef.current?.play()
|
|
29
|
+
}}
|
|
30
|
+
onMouseLeave={() => {
|
|
31
|
+
videoRef.current?.pause()
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<source src={url} type='video/mp4' />
|
|
35
|
+
</video>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './CodeView'
|
|
2
|
+
export * from './HtmlPro'
|
|
3
|
+
export * from './IframePro'
|
|
4
|
+
export * from './FormPro'
|
|
5
|
+
export * from './Com2Canvas'
|
|
6
|
+
export * from './Video'
|
|
7
|
+
export * from './MultiImageDisplay'
|
|
8
|
+
export * from './DownloadLink'
|
|
9
|
+
export * from './Fold'
|
|
10
|
+
export * from './DragSort'
|
|
11
|
+
export * from './DateSwitcher'
|
|
12
|
+
export * from './GroupLayout'
|
|
13
|
+
export * from './TextInput'
|
|
14
|
+
export * from './SectorButton'
|
|
15
|
+
export * from './Markdown'
|
|
16
|
+
export * from './DynamicSelect'
|
|
17
|
+
export * from './JsonRenderer'
|
|
18
|
+
export * from './EnumTag'
|
|
19
|
+
|
|
20
|
+
// export * from './JsonView'
|
|
21
|
+
|
|
22
|
+
export { default as ReactEchart } from 'echarts-for-react'
|
package/src/web.ts
ADDED