antd-solid 0.0.3 → 0.0.5
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/dist/index.css +69 -0
- package/dist/index.esm.js +2369 -0
- package/dist/index.umd.js +1 -0
- package/package.json +5 -3
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -36
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -11
- package/.vscode/settings.json +0 -13
- package/docs/.vitepress/components/Code.vue +0 -175
- package/docs/.vitepress/config.ts +0 -87
- package/docs/.vitepress/theme/index.css +0 -19
- package/docs/.vitepress/theme/index.ts +0 -12
- package/docs/components/button/Base.tsx +0 -21
- package/docs/components/button/Danger.tsx +0 -21
- package/docs/components/button.md +0 -35
- package/docs/components/collapse/Base.tsx +0 -25
- package/docs/components/collapse.md +0 -26
- package/docs/components/color-picker/Base.tsx +0 -14
- package/docs/components/color-picker.md +0 -26
- package/docs/components/compact/Base.tsx +0 -27
- package/docs/components/compact.md +0 -26
- package/docs/components/date-picker/Base.tsx +0 -15
- package/docs/components/date-picker.md +0 -26
- package/docs/components/empty/Base.tsx +0 -8
- package/docs/components/empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -8
- package/docs/components/empty.md +0 -32
- package/docs/components/form/Base.tsx +0 -63
- package/docs/components/form.md +0 -27
- package/docs/components/image/Base.tsx +0 -13
- package/docs/components/image.md +0 -26
- package/docs/components/input/AddonBeforeAndAfter.tsx +0 -14
- package/docs/components/input/Base.tsx +0 -15
- package/docs/components/input/Disabled.tsx +0 -19
- package/docs/components/input/PrefixAndSuffix.tsx +0 -14
- package/docs/components/input/Status.tsx +0 -25
- package/docs/components/input/TextArea.tsx +0 -14
- package/docs/components/input-number/Base.tsx +0 -15
- package/docs/components/input-number/MinMax.tsx +0 -17
- package/docs/components/input-number.md +0 -34
- package/docs/components/input.md +0 -57
- package/docs/components/modal/Base.tsx +0 -35
- package/docs/components/modal.md +0 -26
- package/docs/components/popconfirm/Base.tsx +0 -25
- package/docs/components/popconfirm.md +0 -26
- package/docs/components/popover/Base.tsx +0 -19
- package/docs/components/popover.md +0 -26
- package/docs/components/progress/Base.tsx +0 -16
- package/docs/components/progress.md +0 -26
- package/docs/components/radio/Base.tsx +0 -10
- package/docs/components/radio.md +0 -26
- package/docs/components/segmented/Base.tsx +0 -10
- package/docs/components/segmented/Block.tsx +0 -10
- package/docs/components/segmented/Disabled.tsx +0 -28
- package/docs/components/segmented.md +0 -38
- package/docs/components/select/AllowClear.tsx +0 -18
- package/docs/components/select/Base.tsx +0 -17
- package/docs/components/select.md +0 -35
- package/docs/components/switch/Base.tsx +0 -14
- package/docs/components/switch.md +0 -26
- package/docs/components/table/Base.tsx +0 -34
- package/docs/components/table.md +0 -29
- package/docs/components/tabs/Base.tsx +0 -25
- package/docs/components/tabs/Segment.tsx +0 -25
- package/docs/components/tabs.md +0 -33
- package/docs/components/tooltip/Base.tsx +0 -12
- package/docs/components/tooltip/Placement.tsx +0 -90
- package/docs/components/tooltip.md +0 -32
- package/docs/components/tree/Base.tsx +0 -45
- package/docs/components/tree.md +0 -26
- package/docs/index.md +0 -28
- package/global.d.ts +0 -9
- package/patches/vitepress@1.0.0-rc.4.patch +0 -60
- package/rollup.config.js +0 -65
- package/scripts/annotationNonProductionCode.js +0 -30
- package/scripts/cancelAnnotationNonProductionCode.js +0 -30
- package/src/Button.tsx +0 -125
- package/src/Collapse/index.tsx +0 -86
- package/src/ColorPicker.tsx +0 -11
- package/src/Compact.tsx +0 -15
- package/src/DatePicker.tsx +0 -12
- package/src/Empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -15
- package/src/Empty/assets/EmptySvg.tsx +0 -43
- package/src/Empty/assets/SimpleEmptySvg.tsx +0 -16
- package/src/Empty/index.tsx +0 -20
- package/src/Image.tsx +0 -29
- package/src/Input.tsx +0 -202
- package/src/InputNumber.test.tsx +0 -46
- package/src/InputNumber.tsx +0 -125
- package/src/Modal.tsx +0 -196
- package/src/Popconfirm.tsx +0 -75
- package/src/Popover.tsx +0 -30
- package/src/Progress.tsx +0 -4
- package/src/Radio.tsx +0 -132
- package/src/Result.tsx +0 -38
- package/src/Segmented/index.tsx +0 -95
- package/src/Select.tsx +0 -128
- package/src/Skeleton.tsx +0 -14
- package/src/Spin.tsx +0 -23
- package/src/Switch.tsx +0 -34
- package/src/Table.tsx +0 -53
- package/src/Tabs.tsx +0 -131
- package/src/Timeline.tsx +0 -33
- package/src/Tooltip.tsx +0 -355
- package/src/Tree.tsx +0 -246
- package/src/Upload.tsx +0 -10
- package/src/form/Form.tsx +0 -94
- package/src/form/FormItem.tsx +0 -139
- package/src/form/context.ts +0 -16
- package/src/form/index.ts +0 -13
- package/src/hooks/createControllableValue.ts +0 -68
- package/src/hooks/createUpdateEffect.ts +0 -16
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useClickAway.ts +0 -18
- package/src/hooks/useSize.ts +0 -26
- package/src/types/index.ts +0 -5
- package/src/utils/EventEmitter.ts +0 -15
- package/src/utils/ReactToSolid.tsx +0 -38
- package/src/utils/SolidToReact.tsx +0 -27
- package/src/utils/array.ts +0 -21
- package/src/utils/component.tsx +0 -85
- package/src/utils/solid.ts +0 -53
- package/src/utils/zh_CN.ts +0 -236
- package/tsconfig.json +0 -25
- package/unocss.config.ts +0 -176
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Collapse } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
const items = [
|
|
6
|
-
{
|
|
7
|
-
key: '1',
|
|
8
|
-
label: 'Tab 1',
|
|
9
|
-
children: 'Content of Tab Pane 1',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
key: '2',
|
|
13
|
-
label: 'Tab 2',
|
|
14
|
-
children: 'Content of Tab Pane 2',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
key: '3',
|
|
18
|
-
label: 'Tab 3',
|
|
19
|
-
children: 'Content of Tab Pane 3',
|
|
20
|
-
},
|
|
21
|
-
]
|
|
22
|
-
return <Collapse items={items} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Index
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Collapse 折叠面板 {#title}
|
|
6
|
-
|
|
7
|
-
可以折叠/展开的内容区域。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 折叠面板
|
|
12
|
-
|
|
13
|
-
可以同时展开多个面板,这个例子默认展开了第一个。
|
|
14
|
-
|
|
15
|
-
<Code path="collapse/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### Collapse
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { ColorPicker } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Base: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<ColorPicker
|
|
7
|
-
onChange={(value, hex) => {
|
|
8
|
-
console.log('onChange', value, hex)
|
|
9
|
-
}}
|
|
10
|
-
/>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default Base
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# ColorPicker 颜色选择器 {#title}
|
|
6
|
-
|
|
7
|
-
提供颜色选取的组件。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本用法
|
|
12
|
-
|
|
13
|
-
最简单的使用方法。
|
|
14
|
-
|
|
15
|
-
<Code path="color-picker/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### InputNumber
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Compact, Input, InputNumber } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div style={{
|
|
7
|
-
display: 'grid',
|
|
8
|
-
gap: '8px',
|
|
9
|
-
}}>
|
|
10
|
-
<Compact>
|
|
11
|
-
<Input style={{ width: '20%' }} />
|
|
12
|
-
<InputNumber style={{ width: '30%' }} />
|
|
13
|
-
<Input style={{ width: '20%' }} />
|
|
14
|
-
</Compact>
|
|
15
|
-
<Compact>
|
|
16
|
-
<Input style={{ width: '50%' }} prefix="$" suffix=".00" />
|
|
17
|
-
<Input style={{ width: '50%' }} prefix="$" suffix=".00" />
|
|
18
|
-
</Compact>
|
|
19
|
-
<Compact>
|
|
20
|
-
<Input style={{ width: '50%' }} addonBefore="$" addonAfter=".00" />
|
|
21
|
-
<Input style={{ width: '50%' }} addonBefore="$" addonAfter=".00" />
|
|
22
|
-
</Compact>
|
|
23
|
-
</div>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default Index
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Compact 压缩 {#title}
|
|
6
|
-
|
|
7
|
-
需要表单组件之间紧凑连接且合并边框时,使用 Compact。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本
|
|
12
|
-
|
|
13
|
-
使用 Compact 让表单组件之间紧凑连接且合并边框。
|
|
14
|
-
|
|
15
|
-
<Code path="compact/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### Compact
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { DatePicker } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<DatePicker
|
|
7
|
-
placeholder="请选择日期"
|
|
8
|
-
onChange={value => {
|
|
9
|
-
console.log('onChange', value)
|
|
10
|
-
}}
|
|
11
|
-
/>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Index
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# DatePicker 日期选择框 {#title}
|
|
6
|
-
|
|
7
|
-
输入或选择日期的控件。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本
|
|
12
|
-
|
|
13
|
-
最简单的用法,在浮层中可以选择或者输入日期。
|
|
14
|
-
|
|
15
|
-
<Code path="date-picker/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### DatePicker
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|
package/docs/components/empty.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Empty 空状态 {#title}
|
|
6
|
-
|
|
7
|
-
空状态时的展示占位图。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本
|
|
12
|
-
|
|
13
|
-
简单的展示。
|
|
14
|
-
|
|
15
|
-
<Code path="empty/Base" />
|
|
16
|
-
|
|
17
|
-
### 选择图片
|
|
18
|
-
|
|
19
|
-
可以通过设置 `image` 为 `Empty.PRESENTED_IMAGE_SIMPLE` 选择另一种风格的图片。
|
|
20
|
-
|
|
21
|
-
<Code path="empty/PRESENTED_IMAGE_SIMPLE" />
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
### Empty
|
|
26
|
-
|
|
27
|
-
<div class="vp-table">
|
|
28
|
-
|
|
29
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
30
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
31
|
-
|
|
32
|
-
</div>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Button, Form, type FormInstance, Input } from 'antd-solid'
|
|
3
|
-
import { string } from 'yup'
|
|
4
|
-
|
|
5
|
-
const Base: Component = () => {
|
|
6
|
-
let ref: FormInstance
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<Form ref={ref!}>
|
|
10
|
-
<Form.Item
|
|
11
|
-
label="Username"
|
|
12
|
-
name="username"
|
|
13
|
-
component={props => (
|
|
14
|
-
<Input
|
|
15
|
-
{...props}
|
|
16
|
-
onChange={e => {
|
|
17
|
-
props.onChange?.(e.target.value)
|
|
18
|
-
}}
|
|
19
|
-
/>
|
|
20
|
-
)}
|
|
21
|
-
required
|
|
22
|
-
rules={[string().required('Please input your username!')]}
|
|
23
|
-
/>
|
|
24
|
-
<Form.Item
|
|
25
|
-
label="Password"
|
|
26
|
-
name="password"
|
|
27
|
-
component={props => (
|
|
28
|
-
<Input
|
|
29
|
-
{...props}
|
|
30
|
-
type="password"
|
|
31
|
-
onChange={e => {
|
|
32
|
-
props.onChange?.(e.target.value)
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
required
|
|
37
|
-
rules={[string().required('Please input your password!')]}
|
|
38
|
-
/>
|
|
39
|
-
<Form.Item
|
|
40
|
-
component={() => (
|
|
41
|
-
<Button
|
|
42
|
-
type="primary"
|
|
43
|
-
// eslint-disable-next-line solid/reactivity
|
|
44
|
-
onClick={() => {
|
|
45
|
-
ref
|
|
46
|
-
.validateFields()
|
|
47
|
-
.then(resp => {
|
|
48
|
-
console.log('resp', resp)
|
|
49
|
-
})
|
|
50
|
-
.catch(err => {
|
|
51
|
-
console.log('catch', err)
|
|
52
|
-
})
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
提交
|
|
56
|
-
</Button>
|
|
57
|
-
)}
|
|
58
|
-
/>
|
|
59
|
-
</Form>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export default Base
|
package/docs/components/form.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Form 表单 {#title}
|
|
6
|
-
|
|
7
|
-
高性能表单控件,自带数据域管理。包含数据录入、校验以及对应样式。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本用法
|
|
12
|
-
|
|
13
|
-
基本的表单数据域控制展示,包含布局、初始化、验证、提交。
|
|
14
|
-
|
|
15
|
-
<Code path="form/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### Form
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
| layout | 表单布局 | `horizontal` \| `vertical` \| `inline` | `horizontal` |
|
|
26
|
-
|
|
27
|
-
</div>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Image } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<Image
|
|
7
|
-
width={200}
|
|
8
|
-
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
|
9
|
-
/>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default Index
|
package/docs/components/image.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Image 图片 {#title}
|
|
6
|
-
|
|
7
|
-
可预览的图片。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本
|
|
12
|
-
|
|
13
|
-
单击图像可以放大显示。
|
|
14
|
-
|
|
15
|
-
<Code path="image/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### Image
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const AddonBeforeAndAfter: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div class='ant-flex ant-flex-col ant-gap-8px'>
|
|
7
|
-
<Input addonBefore="http://" addonAfter=".com" defaultValue="mysite" />
|
|
8
|
-
<Input addonBefore="http://" defaultValue="mysite" />
|
|
9
|
-
<Input addonAfter=".com" defaultValue="mysite" />
|
|
10
|
-
</div>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default AddonBeforeAndAfter
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Base: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<Input
|
|
7
|
-
placeholder="Basic usage"
|
|
8
|
-
onChange={e => {
|
|
9
|
-
console.log('onChange', e.target.value)
|
|
10
|
-
}}
|
|
11
|
-
/>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Base
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const App: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
style={{
|
|
8
|
-
display: 'flex',
|
|
9
|
-
'flex-direction': 'column',
|
|
10
|
-
gap: '8px',
|
|
11
|
-
}}
|
|
12
|
-
>
|
|
13
|
-
<Input disabled placeholder="disabled" />
|
|
14
|
-
<Input.TextArea disabled placeholder="disabled" />
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default App
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const PrefixAndSuffix: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div class="ant-flex ant-flex-col ant-gap-8px">
|
|
7
|
-
<Input prefix="http://" suffix=".com" defaultValue="mysite" />
|
|
8
|
-
<Input prefix="http://" defaultValue="mysite" />
|
|
9
|
-
<Input suffix=".com" defaultValue="mysite" />
|
|
10
|
-
</div>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default PrefixAndSuffix
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Status: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div class="ant-flex ant-flex-col ant-gap-8px">
|
|
7
|
-
<Input
|
|
8
|
-
placeholder="Error"
|
|
9
|
-
status="error"
|
|
10
|
-
onChange={e => {
|
|
11
|
-
console.log('onChange', e.target.value)
|
|
12
|
-
}}
|
|
13
|
-
/>
|
|
14
|
-
<Input
|
|
15
|
-
placeholder="Warning"
|
|
16
|
-
status="warning"
|
|
17
|
-
onChange={e => {
|
|
18
|
-
console.log('onChange', e.target.value)
|
|
19
|
-
}}
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Status
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Input } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const TextArea: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<Input.TextArea
|
|
7
|
-
onChange={e => {
|
|
8
|
-
console.log('onChange', e.target.value)
|
|
9
|
-
}}
|
|
10
|
-
/>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default TextArea
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { InputNumber } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Base: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<InputNumber
|
|
7
|
-
placeholder="请输入"
|
|
8
|
-
onChange={value => {
|
|
9
|
-
console.log('onChange', value)
|
|
10
|
-
}}
|
|
11
|
-
/>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Base
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { InputNumber } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
return (
|
|
6
|
-
<InputNumber
|
|
7
|
-
min={1}
|
|
8
|
-
max={10}
|
|
9
|
-
placeholder="最小值 & 最大值"
|
|
10
|
-
onChange={value => {
|
|
11
|
-
console.log('onChange', value)
|
|
12
|
-
}}
|
|
13
|
-
/>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default Index
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# InputNumber 数字输入框 {#title}
|
|
6
|
-
|
|
7
|
-
通过鼠标或键盘,输入范围内的数值。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本用法
|
|
12
|
-
|
|
13
|
-
数字输入框。
|
|
14
|
-
|
|
15
|
-
<Code path="input-number/Base" />
|
|
16
|
-
|
|
17
|
-
### 最小值 & 最大值
|
|
18
|
-
|
|
19
|
-
你可以设定最小值和最大值。
|
|
20
|
-
|
|
21
|
-
<Code path="input-number/MinMax" />
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
### InputNumber
|
|
26
|
-
|
|
27
|
-
<div class="vp-table">
|
|
28
|
-
|
|
29
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
30
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
31
|
-
| max | 最大值 | number | Infinity |
|
|
32
|
-
| min | 最小值 | number | -Infinity |
|
|
33
|
-
|
|
34
|
-
</div>
|
package/docs/components/input.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Input 输入框 {#title}
|
|
6
|
-
|
|
7
|
-
通过鼠标或键盘输入内容,是最基础的表单域的包装。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本用法
|
|
12
|
-
|
|
13
|
-
基本用法。
|
|
14
|
-
|
|
15
|
-
<Code path="input/Base" />
|
|
16
|
-
|
|
17
|
-
### 前置/后置标签
|
|
18
|
-
|
|
19
|
-
用于配置一些固定组合。
|
|
20
|
-
|
|
21
|
-
<Code path="input/AddonBeforeAndAfter" />
|
|
22
|
-
|
|
23
|
-
### 文本域
|
|
24
|
-
|
|
25
|
-
用于多行输入。
|
|
26
|
-
|
|
27
|
-
<Code path="input/TextArea" />
|
|
28
|
-
|
|
29
|
-
### 前缀和后缀
|
|
30
|
-
|
|
31
|
-
在输入框上添加前缀或后缀图标。
|
|
32
|
-
|
|
33
|
-
<Code path="input/PrefixAndSuffix" />
|
|
34
|
-
|
|
35
|
-
### 不可用状态
|
|
36
|
-
|
|
37
|
-
Input 不可用状态
|
|
38
|
-
|
|
39
|
-
<Code path="input/Disabled" />
|
|
40
|
-
|
|
41
|
-
### 自定义状态
|
|
42
|
-
|
|
43
|
-
使用 `status` 为 Input 添加状态,可选 `error` 或者 `warning`。
|
|
44
|
-
|
|
45
|
-
<Code path="input/Status" />
|
|
46
|
-
|
|
47
|
-
## API
|
|
48
|
-
|
|
49
|
-
### Input
|
|
50
|
-
|
|
51
|
-
<div class="vp-table">
|
|
52
|
-
|
|
53
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
54
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
55
|
-
| status | 设置校验状态 | 'error' \| 'warning' | - |
|
|
56
|
-
|
|
57
|
-
</div>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'solid-js'
|
|
2
|
-
import { Button, Modal, type ModalInstance } from 'antd-solid'
|
|
3
|
-
|
|
4
|
-
const Index: Component = () => {
|
|
5
|
-
let ref: ModalInstance
|
|
6
|
-
|
|
7
|
-
const showModal = () => {
|
|
8
|
-
ref.open()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const handleOk = () => {
|
|
12
|
-
console.log('确定')
|
|
13
|
-
return true
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const afterClose = () => {
|
|
17
|
-
console.log('取消')
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
<Button type="primary" onClick={showModal}>
|
|
23
|
-
Open Modal
|
|
24
|
-
</Button>
|
|
25
|
-
<Modal ref={ref!} title="Basic Modal" onOk={handleOk} afterClose={afterClose}>
|
|
26
|
-
<p>Some contents...</p>
|
|
27
|
-
<p>Some contents...</p>
|
|
28
|
-
<p>Some contents...</p>
|
|
29
|
-
<p>Some contents...</p>
|
|
30
|
-
</Modal>
|
|
31
|
-
</>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default Index
|
package/docs/components/modal.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Modal 对话框 {#title}
|
|
6
|
-
|
|
7
|
-
模态对话框。
|
|
8
|
-
|
|
9
|
-
## 代码演示
|
|
10
|
-
|
|
11
|
-
### 基本
|
|
12
|
-
|
|
13
|
-
基础弹框。
|
|
14
|
-
|
|
15
|
-
<Code path="modal/Base" />
|
|
16
|
-
|
|
17
|
-
## API
|
|
18
|
-
|
|
19
|
-
### Modal
|
|
20
|
-
|
|
21
|
-
<div class="vp-table">
|
|
22
|
-
|
|
23
|
-
| 参数 | 说明 | 类型 | 默认值
|
|
24
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
25
|
-
|
|
26
|
-
</div>
|