antd-solid 0.0.12 → 0.0.13
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 +10 -77
- package/dist/index.esm.js +7819 -2492
- package/dist/index.umd.js +1 -1
- package/es/Alert/index.d.ts +10 -0
- package/es/Alert/index.js +26 -0
- package/es/Button/index.d.ts +16 -4
- package/es/Button/index.js +107 -59
- package/es/Button/index.scss.js +1 -1
- package/es/Checkbox/Group.d.ts +19 -0
- package/es/Checkbox/Group.js +49 -0
- package/es/Checkbox/index.d.ts +15 -0
- package/es/Checkbox/index.js +60 -0
- package/es/CodeInput/index.d.ts +18 -0
- package/es/CodeInput/index.js +72 -0
- package/es/Collapse/Item.d.ts +46 -0
- package/es/Collapse/Item.js +130 -0
- package/es/Collapse/context.d.ts +5 -0
- package/es/Collapse/context.js +8 -0
- package/es/Collapse/index.d.ts +25 -10
- package/es/Collapse/index.js +95 -74
- package/es/Collapse/utils.d.ts +8 -0
- package/es/Collapse/utils.js +35 -0
- package/es/ColorPicker/ColorPickerInput.d.ts +3 -0
- package/es/ColorPicker/ColorPickerInput.js +250 -0
- package/es/ColorPicker/ColorPickerSelect.d.ts +3 -0
- package/es/ColorPicker/ColorPickerSelect.js +71 -0
- package/es/ColorPicker/ColorPickerSlider.d.ts +3 -0
- package/es/ColorPicker/ColorPickerSlider.js +115 -0
- package/es/ColorPicker/color.d.ts +24 -0
- package/es/ColorPicker/color.js +63 -0
- package/es/ColorPicker/context.d.ts +9 -0
- package/es/ColorPicker/context.js +5 -0
- package/es/ColorPicker/index.d.ts +31 -0
- package/es/ColorPicker/index.js +139 -0
- package/es/Command/context.d.ts +9 -0
- package/es/Command/context.js +11 -0
- package/es/Command/createCommand.d.ts +17 -0
- package/es/Command/createCommand.js +112 -0
- package/es/Command/index.d.ts +7 -0
- package/es/Command/index.js +9 -0
- package/es/Command/useCommandProps.d.ts +13 -0
- package/es/Command/useCommandProps.js +28 -0
- package/es/Compact/CompactContextIsolator.d.ts +3 -0
- package/es/Compact/CompactContextIsolator.js +15 -0
- package/es/Compact/context.d.ts +4 -0
- package/es/Compact/context.js +7 -0
- package/es/Compact/index.d.ts +11 -9
- package/es/Compact/index.js +28 -13
- package/es/Compact/index.scss.js +6 -0
- package/es/ConfigProvider/context.d.ts +11 -0
- package/es/ConfigProvider/context.js +15 -0
- package/es/ConfigProvider/dark/colorAlgorithm.d.ts +2 -0
- package/es/ConfigProvider/dark/colorAlgorithm.js +9 -0
- package/es/ConfigProvider/dark/colors.d.ts +3 -0
- package/es/ConfigProvider/dark/colors.js +47 -0
- package/es/ConfigProvider/dark/index.d.ts +2 -0
- package/es/ConfigProvider/dark/index.js +11 -0
- package/es/ConfigProvider/index.d.ts +32 -0
- package/es/ConfigProvider/index.js +44 -0
- package/es/ConfigProvider/light/colorAlgorithm.d.ts +2 -0
- package/es/ConfigProvider/light/colorAlgorithm.js +9 -0
- package/es/ConfigProvider/light/colors.d.ts +3 -0
- package/es/ConfigProvider/light/colors.js +45 -0
- package/es/ConfigProvider/light/index.d.ts +2 -0
- package/es/ConfigProvider/light/index.js +11 -0
- package/es/ConfigProvider/seed.d.ts +3 -0
- package/es/ConfigProvider/seed.js +22 -0
- package/es/ConfigProvider/types/index.d.ts +594 -0
- package/es/ConfigProvider/types/index.js +1 -0
- package/es/ConfigProvider/utils/genColorMapToken.d.ts +7 -0
- package/es/ConfigProvider/utils/genColorMapToken.js +85 -0
- package/es/ConfigProvider/utils/getAlphaColor.d.ts +2 -0
- package/es/ConfigProvider/utils/getAlphaColor.js +44 -0
- package/es/ConfigProvider/utils/index.d.ts +3 -0
- package/es/ConfigProvider/utils/index.js +181 -0
- package/es/ContextMenu/index.d.ts +8 -0
- package/es/ContextMenu/index.js +99 -0
- package/es/Cursor/index.d.ts +6 -0
- package/es/Cursor/index.js +71 -0
- package/es/DelayShow/index.d.ts +16 -0
- package/es/DelayShow/index.js +27 -0
- package/es/Divider/index.d.ts +17 -0
- package/es/Divider/index.js +71 -0
- package/es/Drawer/index.d.ts +20 -16
- package/es/Drawer/index.js +162 -111
- package/es/Drawer/index.scss.js +1 -1
- package/es/Dropdown/index.d.ts +16 -0
- package/es/Dropdown/index.js +47 -0
- package/es/Element/index.d.ts +10 -0
- package/es/Element/index.js +42 -0
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.d.ts +2 -1
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +25 -9
- package/es/Empty/assets/EmptySvg.js +1 -1
- package/es/Empty/assets/SimpleEmptySvg.js +1 -1
- package/es/Empty/index.d.ts +4 -2
- package/es/Empty/index.js +23 -13
- package/es/Form/Form.d.ts +8 -5
- package/es/Form/Form.js +50 -34
- package/es/Form/FormItem.d.ts +10 -5
- package/es/Form/FormItem.js +121 -104
- package/es/Form/context.d.ts +9 -9
- package/es/Form/context.js +4 -2
- package/es/Fragment/index.d.ts +4 -0
- package/es/Fragment/index.js +7 -0
- package/es/Image/index.d.ts +10 -0
- package/es/Image/index.js +37 -0
- package/es/Input/TextArea.d.ts +23 -0
- package/es/Input/TextArea.js +84 -0
- package/es/Input/index.d.ts +44 -0
- package/es/Input/index.js +213 -0
- package/es/Input/index.scss.js +6 -0
- package/es/InputNumber/index.d.ts +30 -0
- package/es/InputNumber/index.js +122 -0
- package/es/{InputNumber.test.js → InputNumber/index.test.js} +2 -1
- package/es/Menu/InternalMenu.d.ts +22 -0
- package/es/Menu/InternalMenu.js +196 -0
- package/es/Menu/index.d.ts +75 -0
- package/es/Menu/index.js +64 -0
- package/es/Message/Message.d.ts +9 -0
- package/es/Message/Message.js +34 -0
- package/es/Message/index.d.ts +12 -0
- package/es/Message/index.js +80 -0
- package/es/Message/index.scss.js +6 -0
- package/es/Message/useMessage.d.ts +6 -0
- package/es/Message/useMessage.js +54 -0
- package/es/Modal/index.d.ts +73 -0
- package/es/Modal/index.js +237 -0
- package/es/Modal/index.scss.js +6 -0
- package/es/Modal/useModal.d.ts +5 -0
- package/es/Modal/useModal.js +51 -0
- package/es/Modal/warning.d.ts +5 -0
- package/es/Modal/warning.js +43 -0
- package/es/{Popconfirm.d.ts → Popconfirm/index.d.ts} +2 -2
- package/es/Popconfirm/index.js +62 -0
- package/es/{Popover.d.ts → Popover/index.d.ts} +2 -2
- package/es/{Popover.js → Popover/index.js} +7 -12
- package/es/Progress/Circle.d.ts +16 -0
- package/es/Progress/Circle.js +122 -0
- package/es/Progress/index.d.ts +5 -2
- package/es/Progress/index.js +70 -65
- package/es/Radio/Button.d.ts +7 -0
- package/es/Radio/Button.js +72 -0
- package/es/Radio/Group.d.ts +18 -0
- package/es/Radio/Group.js +57 -0
- package/es/Radio/index.d.ts +14 -0
- package/es/Radio/index.js +68 -0
- package/es/RangeInput/index.d.ts +23 -0
- package/es/RangeInput/index.js +208 -0
- package/es/Result/index.js +49 -0
- package/es/Segmented/index.d.ts +10 -7
- package/es/Segmented/index.js +54 -53
- package/es/Select/index.d.ts +17 -0
- package/es/Select/index.js +75 -0
- package/es/SelectInput/index.d.ts +39 -0
- package/es/SelectInput/index.js +245 -0
- package/es/Slider/index.d.ts +47 -0
- package/es/Slider/index.js +177 -0
- package/es/Space/index.d.ts +13 -0
- package/es/Space/index.js +16 -0
- package/es/Spin/index.d.ts +19 -0
- package/es/Spin/index.js +82 -0
- package/es/{Switch.d.ts → Switch/index.d.ts} +9 -0
- package/es/Switch/index.js +41 -0
- package/es/{Table.d.ts → Table/index.d.ts} +6 -2
- package/es/Table/index.js +71 -0
- package/es/Tabs/index.d.ts +49 -0
- package/es/Tabs/index.js +256 -0
- package/es/Timeline/index.js +31 -0
- package/es/Tooltip/context.d.ts +5 -0
- package/es/Tooltip/context.js +5 -0
- package/es/Tooltip/index.d.ts +64 -0
- package/es/Tooltip/index.js +499 -0
- package/es/Transformer/index.d.ts +88 -0
- package/es/Transformer/index.js +882 -0
- package/es/Tree/SingleLevelTree.d.ts +28 -0
- package/es/Tree/SingleLevelTree.js +299 -0
- package/es/Tree/index.d.ts +83 -0
- package/es/Tree/index.js +197 -0
- package/es/TreeFor/index.d.ts +31 -0
- package/es/TreeFor/index.js +80 -0
- package/es/TreeSelect/index.d.ts +26 -0
- package/es/TreeSelect/index.js +98 -0
- package/es/{Upload.d.ts → Upload/index.d.ts} +8 -1
- package/es/Upload/index.js +112 -0
- package/es/assets/svg/ColorPickUp.d.ts +4 -0
- package/es/assets/svg/ColorPickUp.js +25 -0
- package/es/assets/svg/Crosshair.d.ts +7 -0
- package/es/assets/svg/Crosshair.js +51 -0
- package/es/assets/svg/Resize.d.ts +4 -0
- package/es/assets/svg/Resize.js +25 -0
- package/es/assets/svg/Rotate.d.ts +4 -0
- package/es/assets/svg/Rotate.js +20 -0
- package/es/assets/svg/RotateArrow.d.ts +4 -0
- package/es/assets/svg/RotateArrow.js +21 -0
- package/es/assets/svg/common.d.ts +2 -0
- package/es/assets/svg/common.js +9 -0
- package/es/hooks/createControllableValue.d.ts +1 -1
- package/es/hooks/createControllableValue.js +16 -17
- package/es/hooks/createTransition.d.ts +6 -2
- package/es/hooks/createTransition.js +12 -8
- package/es/hooks/useClickAway.d.ts +1 -1
- package/es/hooks/useClickAway.js +4 -3
- package/es/hooks/useComponentSize.d.ts +3 -0
- package/es/hooks/useComponentSize.js +12 -0
- package/es/hooks/useCounter.d.ts +12 -0
- package/es/hooks/useCounter.js +30 -0
- package/es/hooks/useFocus.d.ts +2 -0
- package/es/hooks/useFocus.js +24 -0
- package/es/hooks/useHover.d.ts +2 -0
- package/es/hooks/useHover.js +33 -0
- package/es/hooks/useLocale.d.ts +1 -0
- package/es/hooks/useLocale.js +11 -0
- package/es/hooks/useMouse.d.ts +1 -0
- package/es/hooks/useMouse.js +18 -0
- package/es/hooks/useScroll.d.ts +2 -0
- package/es/hooks/useScroll.js +29 -0
- package/es/hooks/useSize.d.ts +8 -2
- package/es/hooks/useSize.js +25 -13
- package/es/hooks/useVirtualList.d.ts +14 -0
- package/es/hooks/useVirtualList.js +45 -0
- package/es/index.d.ts +59 -8
- package/es/index.js +51 -21
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +9 -0
- package/es/locale/index.d.ts +5 -0
- package/es/locale/index.js +1 -0
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_CN.js +9 -0
- package/es/types/index.d.ts +11 -2
- package/es/utils/animation.d.ts +6 -0
- package/es/utils/animation.js +20 -0
- package/es/utils/array.d.ts +2 -1
- package/es/utils/array.js +5 -1
- package/es/utils/domPoint.d.ts +7 -0
- package/es/utils/domPoint.js +11 -0
- package/es/utils/math.d.ts +17 -0
- package/es/utils/math.js +25 -0
- package/es/utils/number.d.ts +1 -0
- package/es/utils/number.js +14 -0
- package/es/utils/setupGlobalDrag.d.ts +10 -0
- package/es/utils/setupGlobalDrag.js +38 -0
- package/es/utils/solid.d.ts +2 -2
- package/es/utils/solid.js +7 -8
- package/package.json +10 -11
- package/es/ColorPicker.d.ts +0 -8
- package/es/ColorPicker.js +0 -6
- package/es/DatePicker.d.ts +0 -19
- package/es/DatePicker.js +0 -9
- package/es/Image.d.ts +0 -9
- package/es/Image.js +0 -22
- package/es/Input.d.ts +0 -29
- package/es/Input.js +0 -144
- package/es/InputNumber.d.ts +0 -11
- package/es/InputNumber.js +0 -92
- package/es/Modal.d.ts +0 -47
- package/es/Modal.js +0 -210
- package/es/Popconfirm.js +0 -64
- package/es/Radio.d.ts +0 -27
- package/es/Radio.js +0 -93
- package/es/Result.js +0 -29
- package/es/Select.d.ts +0 -16
- package/es/Select.js +0 -113
- package/es/Skeleton.d.ts +0 -9
- package/es/Skeleton.js +0 -9
- package/es/Spin.d.ts +0 -10
- package/es/Spin.js +0 -28
- package/es/Switch.js +0 -30
- package/es/Table.js +0 -57
- package/es/Tabs.d.ts +0 -17
- package/es/Tabs.js +0 -117
- package/es/Timeline.js +0 -30
- package/es/Tooltip.d.ts +0 -34
- package/es/Tooltip.js +0 -302
- package/es/Tree.d.ts +0 -28
- package/es/Tree.js +0 -198
- package/es/Upload.js +0 -96
- package/es/hooks/createUpdateEffect.d.ts +0 -5
- package/es/hooks/createUpdateEffect.js +0 -12
- package/es/utils/EventEmitter.d.ts +0 -7
- package/es/utils/EventEmitter.js +0 -13
- package/es/utils/ReactToSolid.d.ts +0 -8
- package/es/utils/ReactToSolid.js +0 -30
- package/es/utils/SolidToReact.d.ts +0 -8
- package/es/utils/SolidToReact.js +0 -23
- package/es/utils/component.d.ts +0 -31
- package/es/utils/component.js +0 -68
- package/es/utils/zh_CN.d.ts +0 -2
- package/es/utils/zh_CN.js +0 -236
- package/src/Button/index.scss +0 -9
- package/src/Button/index.tsx +0 -137
- package/src/Collapse/index.tsx +0 -86
- package/src/ColorPicker.tsx +0 -11
- package/src/Compact/index.tsx +0 -20
- package/src/DatePicker.tsx +0 -30
- package/src/Drawer/index.scss +0 -53
- package/src/Drawer/index.tsx +0 -211
- 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 -25
- package/src/Form/Form.tsx +0 -94
- package/src/Form/FormItem.tsx +0 -141
- package/src/Form/context.ts +0 -16
- package/src/Form/index.ts +0 -13
- package/src/Image.tsx +0 -29
- package/src/Input.tsx +0 -202
- package/src/InputNumber.test.tsx +0 -46
- package/src/InputNumber.tsx +0 -139
- package/src/Modal.tsx +0 -221
- package/src/Popconfirm.tsx +0 -75
- package/src/Popover.tsx +0 -30
- package/src/Progress/index.tsx +0 -81
- package/src/Radio.tsx +0 -142
- package/src/Result.tsx +0 -38
- package/src/Segmented/index.tsx +0 -95
- package/src/Select.tsx +0 -138
- package/src/Skeleton.tsx +0 -14
- package/src/Spin.tsx +0 -34
- 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 -340
- package/src/Tree.tsx +0 -247
- package/src/Upload.tsx +0 -143
- package/src/hooks/createControllableValue.ts +0 -68
- package/src/hooks/createTransition.ts +0 -52
- 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/index.ts +0 -47
- 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 -61
- package/src/utils/zh_CN.ts +0 -236
- /package/es/{InputNumber.test.d.ts → InputNumber/index.test.d.ts} +0 -0
- /package/es/{Result.d.ts → Result/index.d.ts} +0 -0
- /package/es/{Timeline.d.ts → Timeline/index.d.ts} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { type FunctionComponent, type ReactElement, useEffect, useRef } from 'react'
|
|
2
|
-
import { type JSX } from 'solid-js'
|
|
3
|
-
import { render } from 'solid-js/web'
|
|
4
|
-
|
|
5
|
-
export interface SolidToReactProps {
|
|
6
|
-
children?: JSX.Element
|
|
7
|
-
container?: ReactElement
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const SolidToReact: FunctionComponent<SolidToReactProps> = ({ children, container }) => {
|
|
11
|
-
const ref = useRef<HTMLDivElement>()
|
|
12
|
-
|
|
13
|
-
useEffect(() => render(() => children, ref.current!), [])
|
|
14
|
-
|
|
15
|
-
// if (import.meta.env.SSR) {
|
|
16
|
-
// return React.createElement('div', {
|
|
17
|
-
// dangerouslySetInnerHTML: { __html: renderToString(() => children) },
|
|
18
|
-
// })
|
|
19
|
-
// }
|
|
20
|
-
return container
|
|
21
|
-
? React.cloneElement(container, {
|
|
22
|
-
ref,
|
|
23
|
-
})
|
|
24
|
-
: React.createElement('div', { ref, role: 'SolidToReact' })
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default SolidToReact
|
package/src/utils/array.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 如果传入一个非数组字段,则将其转化为数组
|
|
3
|
-
* @param value
|
|
4
|
-
* @returns
|
|
5
|
-
*/
|
|
6
|
-
export function toArray<T>(value: T | T[]) {
|
|
7
|
-
return Array.isArray(value) ? value : [value]
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface StandardNode {
|
|
11
|
-
children?: this[]
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* 将数组中每个对象的 children 拍扁后返回
|
|
15
|
-
* @param nodes
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
export function flatChildren<T extends StandardNode = StandardNode>(nodes: T[] | undefined): T[] {
|
|
19
|
-
if (!nodes) return []
|
|
20
|
-
return nodes.flatMap(node => [node, ...flatChildren(node.children)])
|
|
21
|
-
}
|
package/src/utils/component.tsx
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { type Component, createMemo, type JSXElement } from 'solid-js'
|
|
3
|
-
import { omit } from 'lodash-es'
|
|
4
|
-
import { solidToReact } from './solid'
|
|
5
|
-
import ReactToSolid from './ReactToSolid'
|
|
6
|
-
import { ConfigProvider } from 'antd'
|
|
7
|
-
import zhCN from './zh_CN'
|
|
8
|
-
import { type ConfigProviderProps } from 'antd/es/config-provider'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 将组件 props 中的 className 替换为 class
|
|
12
|
-
* @param C
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export function replaceClassName<
|
|
16
|
-
T extends { className?: string },
|
|
17
|
-
Target extends Omit<T, 'className'> & { class?: string },
|
|
18
|
-
>(C: Component<T>): Component<Target> {
|
|
19
|
-
return function (_props: Target) {
|
|
20
|
-
const props = createMemo(() => {
|
|
21
|
-
return {
|
|
22
|
-
...omit(_props, 'class'),
|
|
23
|
-
className: _props.class,
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
return <C {...(props() as unknown as T)} />
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 将组件 props 中的 children 替换为 JSXElement
|
|
32
|
-
* @param C
|
|
33
|
-
* @returns
|
|
34
|
-
*/
|
|
35
|
-
export function replaceChildren<
|
|
36
|
-
T extends { children?: React.ReactNode },
|
|
37
|
-
Target extends Omit<T, 'children'> & { children?: JSXElement },
|
|
38
|
-
>(C: Component<T>): Component<Target> {
|
|
39
|
-
return function (_props: Target) {
|
|
40
|
-
const props = createMemo(() => {
|
|
41
|
-
return {
|
|
42
|
-
..._props,
|
|
43
|
-
children: solidToReact(_props.children),
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
return <C {...(props() as unknown as T)} />
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function reactToSolidComponent<P extends {} = {}>(
|
|
51
|
-
component: React.FunctionComponent<P> | React.ComponentClass<P>,
|
|
52
|
-
container?: Element | (() => Element),
|
|
53
|
-
) {
|
|
54
|
-
return function (props: P) {
|
|
55
|
-
return (
|
|
56
|
-
<ReactToSolid
|
|
57
|
-
component={component}
|
|
58
|
-
props={props}
|
|
59
|
-
container={typeof container === 'function' ? container() : container}
|
|
60
|
-
/>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 返回被 ConfigProvider 包裹后的 component
|
|
67
|
-
* @param component
|
|
68
|
-
* @param configProviderProps
|
|
69
|
-
* @returns
|
|
70
|
-
*/
|
|
71
|
-
export function configProvider<P extends {} = {}>(
|
|
72
|
-
component: React.FunctionComponent<P> | React.ComponentClass<P>,
|
|
73
|
-
configProviderProps?: ConfigProviderProps,
|
|
74
|
-
) {
|
|
75
|
-
return function (props: P) {
|
|
76
|
-
return React.createElement(
|
|
77
|
-
ConfigProvider,
|
|
78
|
-
{
|
|
79
|
-
locale: zhCN,
|
|
80
|
-
...configProviderProps,
|
|
81
|
-
},
|
|
82
|
-
React.createElement(component, props),
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
}
|
package/src/utils/solid.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { type JSXElement, type JSX, untrack, type Ref } from 'solid-js'
|
|
3
|
-
import { isNil } from 'lodash-es'
|
|
4
|
-
import SolidToReact from './SolidToReact'
|
|
5
|
-
import { type StringOrJSXElement } from '../types'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 判断 JSXElement 是否是基础类型
|
|
9
|
-
* @param value JSXElement
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export function isBaseType(
|
|
13
|
-
value: JSXElement,
|
|
14
|
-
): value is string | number | boolean | null | undefined {
|
|
15
|
-
return (
|
|
16
|
-
typeof value === 'string' ||
|
|
17
|
-
typeof value === 'number' ||
|
|
18
|
-
typeof value === 'boolean' ||
|
|
19
|
-
value === null ||
|
|
20
|
-
value === undefined
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function solidToReact(children: JSXElement) {
|
|
25
|
-
return isBaseType(children)
|
|
26
|
-
? children
|
|
27
|
-
: React.createElement(SolidToReact, {
|
|
28
|
-
children,
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function dispatchEventHandlerUnion<T, E extends Event>(
|
|
33
|
-
handler: JSX.EventHandlerUnion<T, E> | undefined,
|
|
34
|
-
e: E & {
|
|
35
|
-
currentTarget: T
|
|
36
|
-
target: Element
|
|
37
|
-
},
|
|
38
|
-
) {
|
|
39
|
-
if (isNil(handler)) {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (typeof handler === 'function') {
|
|
44
|
-
handler(e)
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
handler[0](handler[1], e)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function unwrapStringOrJSXElement(value: StringOrJSXElement): JSXElement {
|
|
52
|
-
return typeof value === 'function' ? value() : value
|
|
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/src/utils/zh_CN.ts
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { type ConfigProviderProps } from 'antd/es/config-provider'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
locale: 'zh-cn',
|
|
5
|
-
Pagination: {
|
|
6
|
-
items_per_page: '条/页',
|
|
7
|
-
jump_to: '跳至',
|
|
8
|
-
jump_to_confirm: '确定',
|
|
9
|
-
page: '页',
|
|
10
|
-
prev_page: '上一页',
|
|
11
|
-
next_page: '下一页',
|
|
12
|
-
prev_5: '向前 5 页',
|
|
13
|
-
next_5: '向后 5 页',
|
|
14
|
-
prev_3: '向前 3 页',
|
|
15
|
-
next_3: '向后 3 页',
|
|
16
|
-
page_size: '页码',
|
|
17
|
-
},
|
|
18
|
-
DatePicker: {
|
|
19
|
-
lang: {
|
|
20
|
-
placeholder: '请选择日期',
|
|
21
|
-
yearPlaceholder: '请选择年份',
|
|
22
|
-
quarterPlaceholder: '请选择季度',
|
|
23
|
-
monthPlaceholder: '请选择月份',
|
|
24
|
-
weekPlaceholder: '请选择周',
|
|
25
|
-
rangePlaceholder: ['开始日期', '结束日期'],
|
|
26
|
-
rangeYearPlaceholder: ['开始年份', '结束年份'],
|
|
27
|
-
rangeMonthPlaceholder: ['开始月份', '结束月份'],
|
|
28
|
-
rangeQuarterPlaceholder: ['开始季度', '结束季度'],
|
|
29
|
-
rangeWeekPlaceholder: ['开始周', '结束周'],
|
|
30
|
-
locale: 'zh_CN',
|
|
31
|
-
today: '今天',
|
|
32
|
-
now: '此刻',
|
|
33
|
-
backToToday: '返回今天',
|
|
34
|
-
ok: '确定',
|
|
35
|
-
timeSelect: '选择时间',
|
|
36
|
-
dateSelect: '选择日期',
|
|
37
|
-
weekSelect: '选择周',
|
|
38
|
-
clear: '清除',
|
|
39
|
-
month: '月',
|
|
40
|
-
year: '年',
|
|
41
|
-
previousMonth: '上个月 (翻页上键)',
|
|
42
|
-
nextMonth: '下个月 (翻页下键)',
|
|
43
|
-
monthSelect: '选择月份',
|
|
44
|
-
yearSelect: '选择年份',
|
|
45
|
-
decadeSelect: '选择年代',
|
|
46
|
-
yearFormat: 'YYYY年',
|
|
47
|
-
dayFormat: 'D日',
|
|
48
|
-
dateFormat: 'YYYY年M月D日',
|
|
49
|
-
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
|
|
50
|
-
previousYear: '上一年 (Control键加左方向键)',
|
|
51
|
-
nextYear: '下一年 (Control键加右方向键)',
|
|
52
|
-
previousDecade: '上一年代',
|
|
53
|
-
nextDecade: '下一年代',
|
|
54
|
-
previousCentury: '上一世纪',
|
|
55
|
-
nextCentury: '下一世纪',
|
|
56
|
-
},
|
|
57
|
-
timePickerLocale: {
|
|
58
|
-
placeholder: '请选择时间',
|
|
59
|
-
rangePlaceholder: ['开始时间', '结束时间'],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
TimePicker: {
|
|
63
|
-
placeholder: '请选择时间',
|
|
64
|
-
rangePlaceholder: ['开始时间', '结束时间'],
|
|
65
|
-
},
|
|
66
|
-
Calendar: {
|
|
67
|
-
lang: {
|
|
68
|
-
placeholder: '请选择日期',
|
|
69
|
-
yearPlaceholder: '请选择年份',
|
|
70
|
-
quarterPlaceholder: '请选择季度',
|
|
71
|
-
monthPlaceholder: '请选择月份',
|
|
72
|
-
weekPlaceholder: '请选择周',
|
|
73
|
-
rangePlaceholder: ['开始日期', '结束日期'],
|
|
74
|
-
rangeYearPlaceholder: ['开始年份', '结束年份'],
|
|
75
|
-
rangeMonthPlaceholder: ['开始月份', '结束月份'],
|
|
76
|
-
rangeQuarterPlaceholder: ['开始季度', '结束季度'],
|
|
77
|
-
rangeWeekPlaceholder: ['开始周', '结束周'],
|
|
78
|
-
locale: 'zh_CN',
|
|
79
|
-
today: '今天',
|
|
80
|
-
now: '此刻',
|
|
81
|
-
backToToday: '返回今天',
|
|
82
|
-
ok: '确定',
|
|
83
|
-
timeSelect: '选择时间',
|
|
84
|
-
dateSelect: '选择日期',
|
|
85
|
-
weekSelect: '选择周',
|
|
86
|
-
clear: '清除',
|
|
87
|
-
month: '月',
|
|
88
|
-
year: '年',
|
|
89
|
-
previousMonth: '上个月 (翻页上键)',
|
|
90
|
-
nextMonth: '下个月 (翻页下键)',
|
|
91
|
-
monthSelect: '选择月份',
|
|
92
|
-
yearSelect: '选择年份',
|
|
93
|
-
decadeSelect: '选择年代',
|
|
94
|
-
yearFormat: 'YYYY年',
|
|
95
|
-
dayFormat: 'D日',
|
|
96
|
-
dateFormat: 'YYYY年M月D日',
|
|
97
|
-
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
|
|
98
|
-
previousYear: '上一年 (Control键加左方向键)',
|
|
99
|
-
nextYear: '下一年 (Control键加右方向键)',
|
|
100
|
-
previousDecade: '上一年代',
|
|
101
|
-
nextDecade: '下一年代',
|
|
102
|
-
previousCentury: '上一世纪',
|
|
103
|
-
nextCentury: '下一世纪',
|
|
104
|
-
},
|
|
105
|
-
timePickerLocale: {
|
|
106
|
-
placeholder: '请选择时间',
|
|
107
|
-
rangePlaceholder: ['开始时间', '结束时间'],
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
global: {
|
|
111
|
-
placeholder: '请选择',
|
|
112
|
-
},
|
|
113
|
-
Table: {
|
|
114
|
-
filterTitle: '筛选',
|
|
115
|
-
filterConfirm: '确定',
|
|
116
|
-
filterReset: '重置',
|
|
117
|
-
filterEmptyText: '无筛选项',
|
|
118
|
-
filterCheckall: '全选',
|
|
119
|
-
filterSearchPlaceholder: '在筛选项中搜索',
|
|
120
|
-
selectAll: '全选当页',
|
|
121
|
-
selectInvert: '反选当页',
|
|
122
|
-
selectNone: '清空所有',
|
|
123
|
-
selectionAll: '全选所有',
|
|
124
|
-
sortTitle: '排序',
|
|
125
|
-
expand: '展开行',
|
|
126
|
-
collapse: '关闭行',
|
|
127
|
-
triggerDesc: '点击降序',
|
|
128
|
-
triggerAsc: '点击升序',
|
|
129
|
-
cancelSort: '取消排序',
|
|
130
|
-
},
|
|
131
|
-
Modal: {
|
|
132
|
-
okText: '确定',
|
|
133
|
-
cancelText: '取消',
|
|
134
|
-
justOkText: '知道了',
|
|
135
|
-
},
|
|
136
|
-
Tour: {
|
|
137
|
-
Next: '下一步',
|
|
138
|
-
Previous: '上一步',
|
|
139
|
-
Finish: '结束导览',
|
|
140
|
-
},
|
|
141
|
-
Popconfirm: {
|
|
142
|
-
cancelText: '取消',
|
|
143
|
-
okText: '确定',
|
|
144
|
-
},
|
|
145
|
-
Transfer: {
|
|
146
|
-
titles: ['', ''],
|
|
147
|
-
searchPlaceholder: '请输入搜索内容',
|
|
148
|
-
itemUnit: '项',
|
|
149
|
-
itemsUnit: '项',
|
|
150
|
-
remove: '删除',
|
|
151
|
-
selectCurrent: '全选当页',
|
|
152
|
-
removeCurrent: '删除当页',
|
|
153
|
-
selectAll: '全选所有',
|
|
154
|
-
removeAll: '删除全部',
|
|
155
|
-
selectInvert: '反选当页',
|
|
156
|
-
},
|
|
157
|
-
Upload: {
|
|
158
|
-
uploading: '文件上传中',
|
|
159
|
-
removeFile: '删除文件',
|
|
160
|
-
uploadError: '上传错误',
|
|
161
|
-
previewFile: '预览文件',
|
|
162
|
-
downloadFile: '下载文件',
|
|
163
|
-
},
|
|
164
|
-
Empty: {
|
|
165
|
-
description: '暂无数据',
|
|
166
|
-
},
|
|
167
|
-
Icon: {
|
|
168
|
-
icon: '图标',
|
|
169
|
-
},
|
|
170
|
-
Text: {
|
|
171
|
-
edit: '编辑',
|
|
172
|
-
copy: '复制',
|
|
173
|
-
copied: '复制成功',
|
|
174
|
-
expand: '展开',
|
|
175
|
-
},
|
|
176
|
-
PageHeader: {
|
|
177
|
-
back: '返回',
|
|
178
|
-
},
|
|
179
|
-
Form: {
|
|
180
|
-
optional: '(可选)',
|
|
181
|
-
defaultValidateMessages: {
|
|
182
|
-
default: '字段验证错误${label}',
|
|
183
|
-
required: '请输入${label}',
|
|
184
|
-
enum: '${label}必须是其中一个[${enum}]',
|
|
185
|
-
whitespace: '${label}不能为空字符',
|
|
186
|
-
date: {
|
|
187
|
-
format: '${label}日期格式无效',
|
|
188
|
-
parse: '${label}不能转换为日期',
|
|
189
|
-
invalid: '${label}是一个无效日期',
|
|
190
|
-
},
|
|
191
|
-
types: {
|
|
192
|
-
string: '${label}不是一个有效的${type}',
|
|
193
|
-
method: '${label}不是一个有效的${type}',
|
|
194
|
-
array: '${label}不是一个有效的${type}',
|
|
195
|
-
object: '${label}不是一个有效的${type}',
|
|
196
|
-
number: '${label}不是一个有效的${type}',
|
|
197
|
-
date: '${label}不是一个有效的${type}',
|
|
198
|
-
boolean: '${label}不是一个有效的${type}',
|
|
199
|
-
integer: '${label}不是一个有效的${type}',
|
|
200
|
-
float: '${label}不是一个有效的${type}',
|
|
201
|
-
regexp: '${label}不是一个有效的${type}',
|
|
202
|
-
email: '${label}不是一个有效的${type}',
|
|
203
|
-
url: '${label}不是一个有效的${type}',
|
|
204
|
-
hex: '${label}不是一个有效的${type}',
|
|
205
|
-
},
|
|
206
|
-
string: {
|
|
207
|
-
len: '${label}须为${len}个字符',
|
|
208
|
-
min: '${label}最少${min}个字符',
|
|
209
|
-
max: '${label}最多${max}个字符',
|
|
210
|
-
range: '${label}须在${min}-${max}字符之间',
|
|
211
|
-
},
|
|
212
|
-
number: {
|
|
213
|
-
len: '${label}必须等于${len}',
|
|
214
|
-
min: '${label}最小值为${min}',
|
|
215
|
-
max: '${label}最大值为${max}',
|
|
216
|
-
range: '${label}须在${min}-${max}之间',
|
|
217
|
-
},
|
|
218
|
-
array: {
|
|
219
|
-
len: '须为${len}个${label}',
|
|
220
|
-
min: '最少${min}个${label}',
|
|
221
|
-
max: '最多${max}个${label}',
|
|
222
|
-
range: '${label}数量须在${min}-${max}之间',
|
|
223
|
-
},
|
|
224
|
-
pattern: {
|
|
225
|
-
mismatch: '${label}与模式不匹配${pattern}',
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
Image: {
|
|
230
|
-
preview: '预览',
|
|
231
|
-
},
|
|
232
|
-
QRCode: {
|
|
233
|
-
expired: '二维码过期',
|
|
234
|
-
refresh: '点击刷新',
|
|
235
|
-
},
|
|
236
|
-
} as ConfigProviderProps['locale']
|
|
File without changes
|
|
File without changes
|
|
File without changes
|