antd-solid 0.0.10 → 0.0.12
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/css/index.css +23 -6
- package/dist/index.esm.js +555 -152
- package/dist/index.umd.js +1 -1
- package/es/{Button.d.ts → Button/index.d.ts} +3 -2
- package/es/{Button.js → Button/index.js} +11 -9
- package/es/Button/index.scss.js +6 -0
- package/es/{Compact.js → Compact/index.js} +4 -4
- package/es/Drawer/index.d.ts +44 -0
- package/es/Drawer/index.js +162 -0
- package/es/Drawer/index.scss.js +6 -0
- package/es/Empty/index.d.ts +6 -2
- package/es/Empty/index.js +7 -2
- package/es/Input.js +3 -3
- package/es/InputNumber.js +1 -1
- package/es/Modal.js +23 -8
- package/es/Popconfirm.js +1 -1
- package/es/Progress/index.d.ts +24 -0
- package/es/Progress/index.js +81 -0
- package/es/Radio.js +25 -21
- package/es/Result.js +1 -1
- package/es/Select.js +2 -2
- package/es/Spin.d.ts +1 -0
- package/es/Spin.js +12 -6
- package/es/Switch.js +1 -1
- package/es/Tabs.js +2 -2
- package/es/Timeline.js +1 -1
- package/es/Tree.js +2 -2
- package/es/Upload.d.ts +56 -10
- package/es/Upload.js +93 -3
- package/es/hooks/createControllableValue.d.ts +1 -1
- package/es/hooks/createTransition.d.ts +8 -0
- package/es/hooks/createTransition.js +39 -0
- package/es/index.d.ts +5 -2
- package/es/index.js +5 -4
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +26 -0
- package/es/utils/solid.d.ts +4 -1
- package/es/utils/solid.js +9 -1
- package/package.json +3 -1
- package/src/Button/index.scss +9 -0
- package/src/{Button.tsx → Button/index.tsx} +23 -11
- package/src/Compact/index.tsx +20 -0
- package/src/Drawer/index.scss +53 -0
- package/src/Drawer/index.tsx +211 -0
- package/src/Empty/index.tsx +11 -6
- package/src/{form → Form}/FormItem.tsx +9 -7
- package/src/Input.tsx +2 -2
- package/src/InputNumber.tsx +34 -20
- package/src/Modal.tsx +37 -12
- package/src/Progress/index.tsx +81 -0
- package/src/Radio.tsx +26 -16
- package/src/Result.tsx +1 -1
- package/src/Select.tsx +14 -4
- package/src/Spin.tsx +16 -5
- package/src/Switch.tsx +1 -1
- package/src/Tabs.tsx +2 -2
- package/src/Timeline.tsx +1 -1
- package/src/Tree.tsx +4 -3
- package/src/Upload.tsx +138 -5
- package/src/hooks/createControllableValue.ts +3 -3
- package/src/hooks/createTransition.ts +52 -0
- package/src/index.ts +5 -2
- package/src/utils/solid.ts +9 -1
- package/es/Progress.d.ts +0 -7
- package/es/Progress.js +0 -6
- package/src/Compact.tsx +0 -15
- package/src/Progress.tsx +0 -4
- /package/es/{Compact.d.ts → Compact/index.d.ts} +0 -0
- /package/es/{form → Form}/Form.d.ts +0 -0
- /package/es/{form → Form}/Form.js +0 -0
- /package/es/{form → Form}/FormItem.d.ts +0 -0
- /package/es/{form → Form}/FormItem.js +0 -0
- /package/es/{form → Form}/context.d.ts +0 -0
- /package/es/{form → Form}/context.js +0 -0
- /package/es/{form → Form}/index.d.ts +0 -0
- /package/es/{form → Form}/index.js +0 -0
- /package/src/{form → Form}/Form.tsx +0 -0
- /package/src/{form → Form}/context.ts +0 -0
- /package/src/{form → Form}/index.ts +0 -0
package/src/Select.tsx
CHANGED
|
@@ -33,7 +33,9 @@ const Select: Component<SelectProps> = props => {
|
|
|
33
33
|
|
|
34
34
|
const [value, setValue] = createControllableValue<Key | undefined>(props)
|
|
35
35
|
const selectedValue = createSelector(value)
|
|
36
|
-
const selectedOption = createMemo(() =>
|
|
36
|
+
const selectedOption = createMemo(() =>
|
|
37
|
+
!isNil(value()) ? props.options.find(option => option.value === value()) : undefined,
|
|
38
|
+
)
|
|
37
39
|
|
|
38
40
|
const [open, setOpen] = createSignal(false)
|
|
39
41
|
useClickAway(
|
|
@@ -63,7 +65,7 @@ const Select: Component<SelectProps> = props => {
|
|
|
63
65
|
<div
|
|
64
66
|
class={cs(
|
|
65
67
|
'ant-box-content ant-px-12px ant-py-5px ant-h-22px ant-leading-22px hover:ant-bg-[var(--hover-bg-color)]',
|
|
66
|
-
selectedValue(item.value) ? '!ant-bg-[var(--
|
|
68
|
+
selectedValue(item.value) ? '!ant-bg-[var(--ant-select-option-selected-bg)]' : '',
|
|
67
69
|
)}
|
|
68
70
|
onClick={() => {
|
|
69
71
|
setValue(item.value)
|
|
@@ -79,7 +81,10 @@ const Select: Component<SelectProps> = props => {
|
|
|
79
81
|
>
|
|
80
82
|
<div
|
|
81
83
|
ref={select!}
|
|
82
|
-
class={cs(
|
|
84
|
+
class={cs(
|
|
85
|
+
'ant-h-32px ant-leading-32px ant-rounded-6px ant-[border:1px_solid_var(--ant-color-border)] ant-px-11px focus:ant-[border-color:var(--ant-color-primary)]',
|
|
86
|
+
props.class,
|
|
87
|
+
)}
|
|
83
88
|
tabIndex="0"
|
|
84
89
|
onClick={e => {
|
|
85
90
|
setOpen(true)
|
|
@@ -109,7 +114,12 @@ const Select: Component<SelectProps> = props => {
|
|
|
109
114
|
</Show>
|
|
110
115
|
|
|
111
116
|
<div class="ant-absolute ant-top-0 ant-bottom-0 ant-right-0">
|
|
112
|
-
<Show
|
|
117
|
+
<Show
|
|
118
|
+
when={showClearBtn()}
|
|
119
|
+
fallback={
|
|
120
|
+
<span class="i-ant-design:down-outlined ant-text-[var(--ant-allow-color)]" />
|
|
121
|
+
}
|
|
122
|
+
>
|
|
113
123
|
<span
|
|
114
124
|
class="i-ant-design:close-circle-filled ant-cursor-pointer ant-text-[var(--ant-clear-color)] hover:ant-text-[var(--ant-clear-color-hover)]"
|
|
115
125
|
onClick={e => {
|
package/src/Spin.tsx
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import { Show, type Component, type ParentProps } from 'solid-js'
|
|
1
|
+
import { Show, type Component, type ParentProps, mergeProps } from 'solid-js'
|
|
2
2
|
|
|
3
3
|
interface SpinProps extends ParentProps {
|
|
4
4
|
/**
|
|
5
5
|
* 是否为加载中状态
|
|
6
6
|
*/
|
|
7
7
|
spinning?: boolean
|
|
8
|
+
size?: number
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
const Spin: Component<SpinProps> =
|
|
11
|
+
const Spin: Component<SpinProps> = _props => {
|
|
12
|
+
const props = mergeProps(
|
|
13
|
+
{
|
|
14
|
+
size: 20,
|
|
15
|
+
},
|
|
16
|
+
_props,
|
|
17
|
+
)
|
|
18
|
+
|
|
11
19
|
return (
|
|
12
|
-
<div
|
|
20
|
+
<div>
|
|
13
21
|
{props.children}
|
|
14
22
|
<Show when={props.spinning}>
|
|
15
|
-
<div class="ant-
|
|
16
|
-
<span
|
|
23
|
+
<div class="ant-flex ant-items-center ant-justify-center ant-bg-[rgba(255,255,255,.5)]">
|
|
24
|
+
<span
|
|
25
|
+
class="i-ant-design:loading keyframes-spin ant-[animation:spin_1s_linear_infinite] ant-text-[var(--ant-color-primary)]"
|
|
26
|
+
style={{ 'font-size': `${props.size}px` }}
|
|
27
|
+
/>
|
|
17
28
|
</div>
|
|
18
29
|
</Show>
|
|
19
30
|
</div>
|
package/src/Switch.tsx
CHANGED
|
@@ -17,7 +17,7 @@ const Switch: Component<SwitchProps> = props => {
|
|
|
17
17
|
<button
|
|
18
18
|
class={cs(
|
|
19
19
|
'ant-w-44px ant-h-22px ant-rounded-100px ant-relative',
|
|
20
|
-
checked() ? 'ant-bg-[var(--
|
|
20
|
+
checked() ? 'ant-bg-[var(--ant-color-primary)]' : 'ant-bg-[rgba(0,0,0,0.45)]',
|
|
21
21
|
)}
|
|
22
22
|
onClick={() => setChecked(c => !c)}
|
|
23
23
|
>
|
package/src/Tabs.tsx
CHANGED
|
@@ -92,7 +92,7 @@ const Tabs: Component<TabsProps> = _props => {
|
|
|
92
92
|
class={cs(
|
|
93
93
|
'ant-py-12px ant-cursor-pointer',
|
|
94
94
|
props.navItemClass,
|
|
95
|
-
isSelectedItem(item.key) && 'ant-text-[var(--
|
|
95
|
+
isSelectedItem(item.key) && 'ant-text-[var(--ant-color-primary)] selected',
|
|
96
96
|
)}
|
|
97
97
|
onClick={() => {
|
|
98
98
|
setSelectedItem(item)
|
|
@@ -106,7 +106,7 @@ const Tabs: Component<TabsProps> = _props => {
|
|
|
106
106
|
|
|
107
107
|
<div
|
|
108
108
|
role={'selected-bar' as any}
|
|
109
|
-
class="ant-absolute ant-bottom-0 ant-bg-[var(--
|
|
109
|
+
class="ant-absolute ant-bottom-0 ant-bg-[var(--ant-color-primary)] ant-h-2px ant-transition-left"
|
|
110
110
|
style={selectedBarStyle()}
|
|
111
111
|
/>
|
|
112
112
|
</div>
|
package/src/Timeline.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const Timeline: Component<TimelineProps> = props => {
|
|
|
21
21
|
{i() !== props.items.length - 1 && (
|
|
22
22
|
<div class="ant-absolute ant-top-[8px] ant-bottom-[-24px] ant-left-[4px] ant-w-[2px] ant-bg-[rgba(5,5,5,.06)]" />
|
|
23
23
|
)}
|
|
24
|
-
<div class="ant-w-[10px] ant-h-[10px] ant-border-solid ant-border-width-[3px] ant-border-[var(--
|
|
24
|
+
<div class="ant-w-[10px] ant-h-[10px] ant-border-solid ant-border-width-[3px] ant-border-[var(--ant-color-primary)] ant-bg-white ant-rounded-[50%] ant-mt-[8px]" />
|
|
25
25
|
<div class="ant-ml-[8px]">{item.children?.()}</div>
|
|
26
26
|
</div>
|
|
27
27
|
)}
|
package/src/Tree.tsx
CHANGED
|
@@ -98,7 +98,8 @@ function SingleLevelTree<T extends {} = {}>(props: SingleLevelTreeProps<T>) {
|
|
|
98
98
|
<div
|
|
99
99
|
class={cs(
|
|
100
100
|
'ant-flex ant-items-center ant-h-28px ant-pb-4px',
|
|
101
|
-
isDraggable(item()) &&
|
|
101
|
+
isDraggable(item()) &&
|
|
102
|
+
'ant-[border:1px_solid_var(--ant-color-primary)] ant-bg-white',
|
|
102
103
|
draggableNode() && 'child[]:ant-pointer-events-none',
|
|
103
104
|
)}
|
|
104
105
|
draggable={draggable}
|
|
@@ -168,9 +169,9 @@ function SingleLevelTree<T extends {} = {}>(props: SingleLevelTreeProps<T>) {
|
|
|
168
169
|
class={cs(
|
|
169
170
|
'ant-h-full ant-leading-24px hover:ant-bg-[var(--hover-bg-color)] ant-rounded-1 ant-px-1 ant-cursor-pointer ant-relative',
|
|
170
171
|
props.blockNode && 'w-full',
|
|
171
|
-
selectedNodes()?.includes(item()) && '!ant-bg-[var(--
|
|
172
|
+
selectedNodes()?.includes(item()) && '!ant-bg-[var(--ant-tree-node-selected-bg)]',
|
|
172
173
|
isTarget(item()) &&
|
|
173
|
-
"before:ant-content-[''] before:ant-inline-block before:ant-w-8px before:ant-h-8px before:ant-absolute before:ant-bottom-0 before:ant-left-0 before:-ant-translate-x-full before:ant-translate-y-1/2 before:ant-rounded-1/2 before:ant-[border:2px_solid_var(--
|
|
174
|
+
"before:ant-content-[''] before:ant-inline-block before:ant-w-8px before:ant-h-8px before:ant-absolute before:ant-bottom-0 before:ant-left-0 before:-ant-translate-x-full before:ant-translate-y-1/2 before:ant-rounded-1/2 before:ant-[border:2px_solid_var(--ant-color-primary)] after:ant-content-[''] after:ant-inline-block after:ant-h-2px after:ant-absolute after:ant-left-0 after:ant-right-0 after:ant-bottom--1px after:ant-bg-[var(--ant-color-primary)]",
|
|
174
175
|
)}
|
|
175
176
|
onClick={() => {
|
|
176
177
|
setSelectedNodes([item()])
|
package/src/Upload.tsx
CHANGED
|
@@ -1,10 +1,143 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { nanoid } from 'nanoid'
|
|
2
|
+
import { type Component, mergeProps, type ParentProps, createSignal, type Signal } from 'solid-js'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface UploadProgressEvent extends Partial<ProgressEvent> {
|
|
5
|
+
percent?: number
|
|
6
|
+
}
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
export interface UploadRequestOption<T = any> {
|
|
9
|
+
file: File
|
|
10
|
+
onProgress?: (event: UploadProgressEvent) => void
|
|
11
|
+
onError?: (event: Error) => void
|
|
12
|
+
onSuccess?: (body: T) => void
|
|
13
|
+
}
|
|
7
14
|
|
|
8
|
-
export
|
|
15
|
+
export interface UploadFile<T = any> {
|
|
16
|
+
/**
|
|
17
|
+
* 文件唯一标识
|
|
18
|
+
*/
|
|
19
|
+
id: string
|
|
20
|
+
/**
|
|
21
|
+
* 文件名
|
|
22
|
+
*/
|
|
23
|
+
name: string
|
|
24
|
+
/**
|
|
25
|
+
* MIME 类型
|
|
26
|
+
*/
|
|
27
|
+
type?: string
|
|
28
|
+
/**
|
|
29
|
+
* 文件大小
|
|
30
|
+
*/
|
|
31
|
+
size?: number
|
|
32
|
+
file?: File
|
|
33
|
+
response?: T
|
|
34
|
+
status?: 'pending' | 'uploading' | 'error' | 'finished'
|
|
35
|
+
percent?: number
|
|
36
|
+
/**
|
|
37
|
+
* 下载地址
|
|
38
|
+
*/
|
|
39
|
+
url?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface UploadProps<T = any> extends ParentProps {
|
|
43
|
+
class?: string
|
|
44
|
+
accept?: string
|
|
45
|
+
/**
|
|
46
|
+
* 上传的地址
|
|
47
|
+
*/
|
|
48
|
+
action?: string
|
|
49
|
+
/**
|
|
50
|
+
* 上传请求的 http method
|
|
51
|
+
* 默认 'post'
|
|
52
|
+
*/
|
|
53
|
+
method?: string
|
|
54
|
+
customRequest?: (option: UploadRequestOption<T>) => void
|
|
55
|
+
onAdd?: (fileList: Array<Signal<T>>) => void
|
|
56
|
+
multiple?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function request(file: File, customRequest: UploadProps['customRequest']) {
|
|
60
|
+
const id = `upload-${nanoid()}`
|
|
61
|
+
// eslint-disable-next-line solid/reactivity
|
|
62
|
+
const uploadFileSignal = createSignal<UploadFile>({
|
|
63
|
+
id,
|
|
64
|
+
file,
|
|
65
|
+
name: file.name,
|
|
66
|
+
type: file.type,
|
|
67
|
+
size: file.size,
|
|
68
|
+
status: 'pending',
|
|
69
|
+
percent: 0,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const [, setUploadFile] = uploadFileSignal
|
|
73
|
+
|
|
74
|
+
customRequest?.({
|
|
75
|
+
file,
|
|
76
|
+
onProgress(event) {
|
|
77
|
+
setUploadFile(value => ({
|
|
78
|
+
...value,
|
|
79
|
+
status: 'uploading',
|
|
80
|
+
percent: event.percent ?? 0,
|
|
81
|
+
}))
|
|
82
|
+
},
|
|
83
|
+
onSuccess(response) {
|
|
84
|
+
setUploadFile(value => ({ ...value, status: 'finished', response }))
|
|
85
|
+
},
|
|
86
|
+
onError() {
|
|
87
|
+
setUploadFile(value => ({ ...value, status: 'error' }))
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
return uploadFileSignal
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const Upload: Component<UploadProps> & {
|
|
95
|
+
request: typeof request
|
|
96
|
+
} = _props => {
|
|
97
|
+
let input: HTMLInputElement | undefined
|
|
98
|
+
const props = mergeProps(
|
|
99
|
+
{
|
|
100
|
+
customRequest: ({ file, onSuccess, onError }) => {
|
|
101
|
+
if (!_props.action) return
|
|
102
|
+
|
|
103
|
+
const formData = new FormData()
|
|
104
|
+
formData.append('file', file)
|
|
105
|
+
fetch(_props.action, {
|
|
106
|
+
method: _props.method ?? 'post',
|
|
107
|
+
body: formData,
|
|
108
|
+
})
|
|
109
|
+
.then(onSuccess)
|
|
110
|
+
.catch(onError)
|
|
111
|
+
},
|
|
112
|
+
} as UploadProps,
|
|
113
|
+
_props,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<span class={props.class} onClick={() => input?.click()}>
|
|
118
|
+
{props.children}
|
|
119
|
+
|
|
120
|
+
<input
|
|
121
|
+
ref={input}
|
|
122
|
+
class="hidden"
|
|
123
|
+
type="file"
|
|
124
|
+
accept={props.accept}
|
|
125
|
+
multiple={props.multiple}
|
|
126
|
+
onInput={e => {
|
|
127
|
+
const fileList: Array<Signal<UploadFile>> = []
|
|
128
|
+
for (const file of e.target.files ?? []) {
|
|
129
|
+
const uploadFileSignal = request(file, props.customRequest)
|
|
130
|
+
fileList.push(uploadFileSignal)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
props.onAdd?.(fileList)
|
|
134
|
+
e.target.value = ''
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</span>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
Upload.request = request
|
|
9
142
|
|
|
10
143
|
export default Upload
|
|
@@ -5,7 +5,7 @@ export interface Options<T> {
|
|
|
5
5
|
defaultValue?: T
|
|
6
6
|
defaultValuePropName?: string
|
|
7
7
|
valuePropName?: string
|
|
8
|
-
trigger?: string |
|
|
8
|
+
trigger?: string | null
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type Props = Record<string, any>
|
|
@@ -46,8 +46,8 @@ function createControllableValue<T = any>(props: Props, options: Options<T> = {}
|
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
const setValue = (v: ((prev: T) => T) | T | undefined) => {
|
|
49
|
-
const newValue = typeof v === 'function'? (v as (prev: T) => T)(value()!) : v
|
|
50
|
-
|
|
49
|
+
const newValue = typeof v === 'function' ? (v as (prev: T) => T)(value()!) : v
|
|
50
|
+
|
|
51
51
|
if (!isControlled()) {
|
|
52
52
|
_setValue(newValue as any)
|
|
53
53
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createEffect, type Accessor, on } from 'solid-js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* dom 节点显示或隐藏时的动画
|
|
5
|
+
* @param target
|
|
6
|
+
* @param when
|
|
7
|
+
* @param className 动画类名
|
|
8
|
+
*/
|
|
9
|
+
export default function createTransition(
|
|
10
|
+
target: Accessor<HTMLElement | undefined | null>,
|
|
11
|
+
when: Accessor<boolean>,
|
|
12
|
+
className: string,
|
|
13
|
+
) {
|
|
14
|
+
createEffect(
|
|
15
|
+
on(when, input => {
|
|
16
|
+
const targetValue = target()
|
|
17
|
+
if (!targetValue) return
|
|
18
|
+
|
|
19
|
+
if (input) {
|
|
20
|
+
targetValue.style.display = ''
|
|
21
|
+
targetValue.classList.add(
|
|
22
|
+
`${className}-enter-active`,
|
|
23
|
+
`${className}-enter`,
|
|
24
|
+
`${className}-enter-to`,
|
|
25
|
+
)
|
|
26
|
+
requestAnimationFrame(() => {
|
|
27
|
+
targetValue!.classList.remove(`${className}-enter`)
|
|
28
|
+
})
|
|
29
|
+
const onTransitionEnd = () => {
|
|
30
|
+
targetValue!.classList.remove(`${className}-enter-active`, `${className}-enter-to`)
|
|
31
|
+
targetValue!.removeEventListener('transitionend', onTransitionEnd)
|
|
32
|
+
}
|
|
33
|
+
targetValue.addEventListener('transitionend', onTransitionEnd)
|
|
34
|
+
} else {
|
|
35
|
+
targetValue.classList.add(
|
|
36
|
+
`${className}-exit-active`,
|
|
37
|
+
`${className}-exit`,
|
|
38
|
+
`${className}-exit-to`,
|
|
39
|
+
)
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
targetValue!.classList.remove(`${className}-exit`)
|
|
42
|
+
})
|
|
43
|
+
const onTransitionEnd = () => {
|
|
44
|
+
targetValue!.style.display = 'none'
|
|
45
|
+
targetValue!.classList.remove(`${className}-exit-active`, `${className}-exit-to`)
|
|
46
|
+
targetValue!.removeEventListener('transitionend', onTransitionEnd)
|
|
47
|
+
}
|
|
48
|
+
targetValue.addEventListener('transitionend', onTransitionEnd)
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
)
|
|
52
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type { InputNumberProps } from './InputNumber'
|
|
|
6
6
|
export { default as Timeline } from './Timeline'
|
|
7
7
|
export { default as Modal } from './Modal'
|
|
8
8
|
export type { ModalInstance } from './Modal'
|
|
9
|
+
export { default as Drawer } from './Drawer'
|
|
10
|
+
export type { DrawerProps, DrawerInstance } from './Drawer'
|
|
9
11
|
export { default as DatePicker } from './DatePicker'
|
|
10
12
|
export { default as Select } from './Select'
|
|
11
13
|
export { default as Tree } from './Tree'
|
|
@@ -16,6 +18,7 @@ export { default as ColorPicker } from './ColorPicker'
|
|
|
16
18
|
export type { ColorPickerProps } from './ColorPicker'
|
|
17
19
|
export { default as Result } from './Result'
|
|
18
20
|
export { default as Progress } from './Progress'
|
|
21
|
+
export type { ProgressProps } from './Progress'
|
|
19
22
|
export { default as Tabs } from './Tabs'
|
|
20
23
|
export type { TabsProps, Tab } from './Tabs'
|
|
21
24
|
export { default as Popconfirm } from './Popconfirm'
|
|
@@ -23,8 +26,8 @@ export { default as Upload } from './Upload'
|
|
|
23
26
|
export type { UploadProps, UploadFile } from './Upload'
|
|
24
27
|
export { default as Radio } from './Radio'
|
|
25
28
|
export type { RadioProps, RadioGroupProps } from './Radio'
|
|
26
|
-
export { default as Form } from './
|
|
27
|
-
export type { FormInstance, FormProps, FormItemProps, FormItemComponentProps } from './
|
|
29
|
+
export { default as Form } from './Form'
|
|
30
|
+
export type { FormInstance, FormProps, FormItemProps, FormItemComponentProps } from './Form'
|
|
28
31
|
export { default as Switch } from './Switch'
|
|
29
32
|
export type { SwitchProps } from './Switch'
|
|
30
33
|
export { default as Skeleton } from './Skeleton'
|
package/src/utils/solid.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { type JSXElement, type JSX } from 'solid-js'
|
|
2
|
+
import { type JSXElement, type JSX, untrack, type Ref } from 'solid-js'
|
|
3
3
|
import { isNil } from 'lodash-es'
|
|
4
4
|
import SolidToReact from './SolidToReact'
|
|
5
5
|
import { type StringOrJSXElement } from '../types'
|
|
@@ -51,3 +51,11 @@ export function dispatchEventHandlerUnion<T, E extends Event>(
|
|
|
51
51
|
export function unwrapStringOrJSXElement(value: StringOrJSXElement): JSXElement {
|
|
52
52
|
return typeof value === 'function' ? value() : value
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
export function setRef<T>(props: { ref?: Ref<T> }, value: T | null) {
|
|
56
|
+
untrack(() => {
|
|
57
|
+
if (typeof props.ref === 'function') {
|
|
58
|
+
;(props.ref as (v: T | null) => void)?.(value)
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
package/es/Progress.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("solid-js").Component<Omit<Omit<import("antd").ProgressProps & import("react").RefAttributes<HTMLDivElement>, "className"> & {
|
|
3
|
-
class?: string | undefined;
|
|
4
|
-
}, "children"> & {
|
|
5
|
-
children?: import("solid-js").JSX.Element;
|
|
6
|
-
}>;
|
|
7
|
-
export default _default;
|
package/es/Progress.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Progress as Progress$1 } from 'antd';
|
|
2
|
-
import { replaceChildren, replaceClassName, reactToSolidComponent } from './utils/component.js';
|
|
3
|
-
|
|
4
|
-
var Progress = replaceChildren(replaceClassName(reactToSolidComponent(Progress$1)));
|
|
5
|
-
|
|
6
|
-
export { Progress as default };
|
package/src/Compact.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type ParentProps } from 'solid-js'
|
|
2
|
-
|
|
3
|
-
interface CompactProps extends ParentProps {}
|
|
4
|
-
|
|
5
|
-
function Compact(props: CompactProps) {
|
|
6
|
-
return <div class="ant-compact ant-flex">{props.children}</div>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
Compact.compactItemClass = 'p[.ant-compact]:ant-ml--1px'
|
|
10
|
-
Compact.compactItemRounded0Class = 'p[.ant-compact>*]:ant-rounded-0'
|
|
11
|
-
Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-l-6px'
|
|
12
|
-
Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px'
|
|
13
|
-
Compact.compactItemZIndexClass = 'p[.ant-compact>*]:focus:ant-z-10 p[.ant-compact>*]:focus-within:ant-z-10'
|
|
14
|
-
|
|
15
|
-
export default Compact
|
package/src/Progress.tsx
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|