antd-solid 0.0.11 → 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 -73
- package/dist/index.esm.js +7802 -2378
- 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 +32 -0
- package/es/Button/index.js +123 -0
- package/es/Button/index.scss.js +6 -0
- 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 +14 -0
- package/es/Compact/index.js +32 -0
- 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 -112
- 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 +9 -3
- package/es/Empty/index.js +24 -9
- 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 +6 -4
- package/es/Progress/index.js +75 -60
- 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/index.d.ts +64 -0
- 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 +53 -23
- 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/Button.d.ts +0 -19
- package/es/Button.js +0 -73
- package/es/ColorPicker.d.ts +0 -8
- package/es/ColorPicker.js +0 -6
- package/es/Compact.d.ts +0 -12
- package/es/Compact.js +0 -17
- 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 -48
- package/es/Modal.js +0 -209
- 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 -9
- package/es/Spin.js +0 -22
- 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.d.ts +0 -11
- package/es/Upload.js +0 -6
- 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.tsx +0 -128
- package/src/Collapse/index.tsx +0 -86
- package/src/ColorPicker.tsx +0 -11
- package/src/Compact.tsx +0 -15
- package/src/DatePicker.tsx +0 -30
- package/src/Drawer/index.scss +0 -53
- package/src/Drawer/index.tsx +0 -212
- 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/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 -125
- package/src/Modal.tsx +0 -220
- package/src/Popconfirm.tsx +0 -75
- package/src/Popover.tsx +0 -30
- package/src/Progress/index.tsx +0 -73
- package/src/Radio.tsx +0 -142
- 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 -340
- package/src/Tree.tsx +0 -246
- package/src/Upload.tsx +0 -10
- 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
package/es/types/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import { type JSXElement } from 'solid-js';
|
|
1
|
+
import { type JSXElement, type JSX } from 'solid-js';
|
|
2
2
|
export type Key = string | number;
|
|
3
|
-
export type StringOrJSXElement =
|
|
3
|
+
export type StringOrJSXElement = JSXElement | (() => JSXElement);
|
|
4
|
+
export interface StyleProps {
|
|
5
|
+
class?: string;
|
|
6
|
+
style?: JSX.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export interface RootStyleProps {
|
|
9
|
+
rootClass?: string;
|
|
10
|
+
rootStyle?: JSX.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export type ComponentSize = 'small' | 'middle' | 'large';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import cs from 'classnames';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 水波动画
|
|
5
|
+
* @param parent
|
|
6
|
+
* @param color
|
|
7
|
+
*/
|
|
8
|
+
function wave(parent, color) {
|
|
9
|
+
const div = document.createElement('div');
|
|
10
|
+
div.style.color = color;
|
|
11
|
+
div.className = cs('absolute inset-0 z--1 rounded-inherit border-solid border-[currentColor] keyframes-wave [animation:wave_ease-out_.3s]');
|
|
12
|
+
const onAnimationEnd = () => {
|
|
13
|
+
div.remove();
|
|
14
|
+
div.removeEventListener('animationend', onAnimationEnd);
|
|
15
|
+
};
|
|
16
|
+
div.addEventListener('animationend', onAnimationEnd);
|
|
17
|
+
parent.insertBefore(div, parent.childNodes[0]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { wave };
|
package/es/utils/array.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 如果传入一个非数组字段,则将其转化为数组
|
|
3
3
|
* @param value
|
|
4
|
+
* @param allowNil 如果设置为 false,则 value isNil 的情况下,会返回空数组
|
|
4
5
|
* @returns
|
|
5
6
|
*/
|
|
6
|
-
export declare function toArray<T>(value: T | T[]): T[];
|
|
7
|
+
export declare function toArray<T>(value: T | T[], allowNil?: boolean): T[];
|
|
7
8
|
export interface StandardNode {
|
|
8
9
|
children?: this[];
|
|
9
10
|
}
|
package/es/utils/array.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { isNil } from 'lodash-es';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* 如果传入一个非数组字段,则将其转化为数组
|
|
3
5
|
* @param value
|
|
6
|
+
* @param allowNil 如果设置为 false,则 value isNil 的情况下,会返回空数组
|
|
4
7
|
* @returns
|
|
5
8
|
*/
|
|
6
|
-
function toArray(value) {
|
|
9
|
+
function toArray(value, allowNil = true) {
|
|
10
|
+
if (!allowNil && isNil(value)) return [];
|
|
7
11
|
return Array.isArray(value) ? value : [value];
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 角度转弧度
|
|
3
|
+
* @param degrees
|
|
4
|
+
*/
|
|
5
|
+
export declare function degToRad(degrees: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* 弧度转角度
|
|
8
|
+
* @param degrees
|
|
9
|
+
*/
|
|
10
|
+
export declare function radToDeg(radian: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* 获取两个点之间的距离
|
|
13
|
+
* @param p1
|
|
14
|
+
* @param p2
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function distance(p1: DOMPoint, p2: DOMPoint): number;
|
package/es/utils/math.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 角度转弧度
|
|
3
|
+
* @param degrees
|
|
4
|
+
*/
|
|
5
|
+
function degToRad(degrees) {
|
|
6
|
+
return degrees / 180 * Math.PI;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 弧度转角度
|
|
10
|
+
* @param degrees
|
|
11
|
+
*/
|
|
12
|
+
function radToDeg(radian) {
|
|
13
|
+
return radian / Math.PI * 180;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 获取两个点之间的距离
|
|
17
|
+
* @param p1
|
|
18
|
+
* @param p2
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
function distance(p1, p2) {
|
|
22
|
+
return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { degToRad, distance, radToDeg };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function inRange(number: number, start: number, end: number, boundary?: '()' | '[]' | '[)' | '(]'): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function inRange(number, start, end, boundary = '[)') {
|
|
2
|
+
switch (boundary) {
|
|
3
|
+
case '()':
|
|
4
|
+
return number > start && number < end;
|
|
5
|
+
case '[]':
|
|
6
|
+
return number >= start && number <= end;
|
|
7
|
+
case '[)':
|
|
8
|
+
return number >= start && number < end;
|
|
9
|
+
case '(]':
|
|
10
|
+
return number > start && number <= end;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { inRange };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置全局拖动监听器,用于解决:
|
|
3
|
+
* - 鼠标移到 disabled 元素上后 mouseup 事件丢失
|
|
4
|
+
* - 拖动过程中误选中文字
|
|
5
|
+
*
|
|
6
|
+
* @param onMove - 鼠标移动时触发的回调函数
|
|
7
|
+
* @param onEnd - 鼠标抬起时触发的回调函数
|
|
8
|
+
* @param cursor - 拖拽过程中的 style.cursor
|
|
9
|
+
*/
|
|
10
|
+
export declare function setupGlobalDrag(onMove: (e: MouseEvent) => void, onEnd?: (e: MouseEvent) => void, cursor?: string): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置全局拖动监听器,用于解决:
|
|
3
|
+
* - 鼠标移到 disabled 元素上后 mouseup 事件丢失
|
|
4
|
+
* - 拖动过程中误选中文字
|
|
5
|
+
*
|
|
6
|
+
* @param onMove - 鼠标移动时触发的回调函数
|
|
7
|
+
* @param onEnd - 鼠标抬起时触发的回调函数
|
|
8
|
+
* @param cursor - 拖拽过程中的 style.cursor
|
|
9
|
+
*/
|
|
10
|
+
function setupGlobalDrag(onMove, onEnd, cursor) {
|
|
11
|
+
const originalPointerEvents = document.body.style.pointerEvents;
|
|
12
|
+
const originalCursor = document.documentElement.style.cursor;
|
|
13
|
+
if (cursor) {
|
|
14
|
+
document.documentElement.style.cursor = cursor;
|
|
15
|
+
}
|
|
16
|
+
const abortController = new AbortController();
|
|
17
|
+
window.addEventListener('mousemove', e => {
|
|
18
|
+
// 延迟设置 document.body.style.pointerEvents,直到 mousemove 触发,这样才算 drag。避免影响自身及子元素的 click 事件
|
|
19
|
+
document.body.style.pointerEvents = 'none'; // 防止 mouseup 被 disabled 元素吞掉,以及拖拽时误选中文字等
|
|
20
|
+
onMove(e);
|
|
21
|
+
}, {
|
|
22
|
+
signal: abortController.signal,
|
|
23
|
+
capture: true
|
|
24
|
+
});
|
|
25
|
+
window.addEventListener('mouseup', e => {
|
|
26
|
+
onEnd?.(e);
|
|
27
|
+
document.body.style.pointerEvents = originalPointerEvents;
|
|
28
|
+
if (cursor) {
|
|
29
|
+
document.documentElement.style.cursor = originalCursor;
|
|
30
|
+
}
|
|
31
|
+
abortController.abort();
|
|
32
|
+
}, {
|
|
33
|
+
once: true,
|
|
34
|
+
capture: true
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { setupGlobalDrag };
|
package/es/utils/solid.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type JSXElement, type JSX, type Ref } from 'solid-js';
|
|
3
2
|
import { type StringOrJSXElement } from '../types';
|
|
4
3
|
/**
|
|
@@ -7,7 +6,6 @@ import { type StringOrJSXElement } from '../types';
|
|
|
7
6
|
* @returns
|
|
8
7
|
*/
|
|
9
8
|
export declare function isBaseType(value: JSXElement): value is string | number | boolean | null | undefined;
|
|
10
|
-
export declare function solidToReact(children: JSXElement): number | boolean | (string & {}) | React.FunctionComponentElement<import("./SolidToReact").SolidToReactProps> | null | undefined;
|
|
11
9
|
export declare function dispatchEventHandlerUnion<T, E extends Event>(handler: JSX.EventHandlerUnion<T, E> | undefined, e: E & {
|
|
12
10
|
currentTarget: T;
|
|
13
11
|
target: Element;
|
|
@@ -16,3 +14,5 @@ export declare function unwrapStringOrJSXElement(value: StringOrJSXElement): JSX
|
|
|
16
14
|
export declare function setRef<T>(props: {
|
|
17
15
|
ref?: Ref<T>;
|
|
18
16
|
}, value: T | null): void;
|
|
17
|
+
export declare function unwrapFunction<T>(value: T | (() => T)): T;
|
|
18
|
+
export declare function isEmptyJSXElement(element: JSXElement): boolean;
|
package/es/utils/solid.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { untrack } from 'solid-js';
|
|
3
2
|
import { isNil } from 'lodash-es';
|
|
4
|
-
import SolidToReact from './SolidToReact.js';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* 判断 JSXElement 是否是基础类型
|
|
@@ -11,11 +9,6 @@ import SolidToReact from './SolidToReact.js';
|
|
|
11
9
|
function isBaseType(value) {
|
|
12
10
|
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null || value === undefined;
|
|
13
11
|
}
|
|
14
|
-
function solidToReact(children) {
|
|
15
|
-
return isBaseType(children) ? children : React.createElement(SolidToReact, {
|
|
16
|
-
children
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
12
|
function dispatchEventHandlerUnion(handler, e) {
|
|
20
13
|
if (isNil(handler)) {
|
|
21
14
|
return;
|
|
@@ -36,5 +29,11 @@ function setRef(props, value) {
|
|
|
36
29
|
}
|
|
37
30
|
});
|
|
38
31
|
}
|
|
32
|
+
function unwrapFunction(value) {
|
|
33
|
+
return typeof value === 'function' ? value() : value;
|
|
34
|
+
}
|
|
35
|
+
function isEmptyJSXElement(element) {
|
|
36
|
+
return element === undefined || element === null || typeof element === 'boolean' || element === '' || Array.isArray(element) && element.length === 0;
|
|
37
|
+
}
|
|
39
38
|
|
|
40
|
-
export { dispatchEventHandlerUnion, isBaseType, setRef,
|
|
39
|
+
export { dispatchEventHandlerUnion, isBaseType, isEmptyJSXElement, setRef, unwrapFunction, unwrapStringOrJSXElement };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"devDependencies": {
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
"@solidjs/testing-library": "^0.7.0",
|
|
15
15
|
"@testing-library/jest-dom": "^5.16.5",
|
|
16
16
|
"@types/lodash-es": "^4.17.7",
|
|
17
|
-
"@types/react": "^18.0.26",
|
|
18
|
-
"@types/react-dom": "^18.0.9",
|
|
19
17
|
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
20
18
|
"@typescript-eslint/parser": "^6.16.0",
|
|
21
19
|
"@unocss/cli": "^0.51.8",
|
|
@@ -35,6 +33,7 @@
|
|
|
35
33
|
"husky": "^8.0.3",
|
|
36
34
|
"jsdom": "^21.1.1",
|
|
37
35
|
"lint-staged": "^15.2.0",
|
|
36
|
+
"prettier": "^3.2.4",
|
|
38
37
|
"rollup": "^3.21.0",
|
|
39
38
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
40
39
|
"rollup-plugin-import-css": "^3.2.1",
|
|
@@ -43,23 +42,24 @@
|
|
|
43
42
|
"sass": "^1.69.6",
|
|
44
43
|
"typescript": "^5.1.6",
|
|
45
44
|
"vite-plugin-solid": "^2.7.0",
|
|
46
|
-
"vitepress": "1.
|
|
45
|
+
"vitepress": "1.3.4",
|
|
47
46
|
"vitest": "^0.30.1"
|
|
48
47
|
},
|
|
49
48
|
"keywords": [],
|
|
50
49
|
"author": "",
|
|
51
50
|
"license": "ISC",
|
|
52
51
|
"dependencies": {
|
|
52
|
+
"@ant-design/colors": "^7.0.2",
|
|
53
|
+
"@ctrl/tinycolor": "^4.1.0",
|
|
53
54
|
"antd": "^5.10.2",
|
|
54
55
|
"classnames": "^2.3.2",
|
|
55
56
|
"lodash-es": "^4.17.21",
|
|
56
57
|
"nanoid": "^5.0.1",
|
|
58
|
+
"number-precision": "^1.6.0",
|
|
57
59
|
"prismjs": "^1.29.0",
|
|
58
|
-
"
|
|
59
|
-
"react-dom": "^18.2.0",
|
|
60
|
-
"solid-js": "^1.8.7",
|
|
60
|
+
"solid-js": "^1.9.7",
|
|
61
61
|
"solid-transition-group": "^0.2.3",
|
|
62
|
-
"yup": "^1.
|
|
62
|
+
"yup": "^1.6.1"
|
|
63
63
|
},
|
|
64
64
|
"lint-staged": {
|
|
65
65
|
"**/*.{js,jsx,ts,tsx}": [
|
|
@@ -70,8 +70,7 @@
|
|
|
70
70
|
"files": [
|
|
71
71
|
"dist",
|
|
72
72
|
"es",
|
|
73
|
-
"css"
|
|
74
|
-
"src"
|
|
73
|
+
"css"
|
|
75
74
|
],
|
|
76
75
|
"scripts": {
|
|
77
76
|
"docs:dev": "vitepress dev docs",
|
package/es/Button.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type Component, type ParentProps, type JSX } from 'solid-js';
|
|
2
|
-
interface ButtonProps extends ParentProps, JSX.CustomAttributes<HTMLButtonElement> {
|
|
3
|
-
type?: 'default' | 'primary' | 'dashed' | 'text' | 'link';
|
|
4
|
-
onClick?: ((e: MouseEvent) => void) | ((e: MouseEvent) => Promise<unknown>);
|
|
5
|
-
/**
|
|
6
|
-
* 默认: middle
|
|
7
|
-
* plain: 没有多余的 padding 和高度等
|
|
8
|
-
*/
|
|
9
|
-
size?: 'large' | 'middle' | 'small' | 'plain';
|
|
10
|
-
class?: string;
|
|
11
|
-
style?: JSX.CSSProperties;
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* 设置危险按钮
|
|
15
|
-
*/
|
|
16
|
-
danger?: boolean;
|
|
17
|
-
}
|
|
18
|
-
declare const Button: Component<ButtonProps>;
|
|
19
|
-
export default Button;
|
package/es/Button.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { delegateEvents, use, insert, createComponent, effect, className, style, template } from 'solid-js/web';
|
|
2
|
-
import { mergeProps, createSignal, createMemo, Show } from 'solid-js';
|
|
3
|
-
import cs from 'classnames';
|
|
4
|
-
|
|
5
|
-
const _tmpl$ = /*#__PURE__*/template(`<span class="i-ant-design:loading ant-[vertical-align:-0.125em] keyframes-spin ant-[animation:spin_1s_linear_infinite] ant-mr-8px">`),
|
|
6
|
-
_tmpl$2 = /*#__PURE__*/template(`<button><span>`);
|
|
7
|
-
const sizeClassMap = {
|
|
8
|
-
large: 'ant-px-15px ant-py-6px ant-h-40px ant-rounded-8px',
|
|
9
|
-
middle: 'ant-px-15px ant-py-4px ant-h-32px ant-rounded-6px',
|
|
10
|
-
small: 'ant-px-7px ant-h-24px ant-rounded-4px',
|
|
11
|
-
plain: 'ant-p-0'
|
|
12
|
-
};
|
|
13
|
-
const typeClassMap = {
|
|
14
|
-
default: danger => cs('ant-bg-white', danger ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_solid_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]'),
|
|
15
|
-
primary: danger => cs('ant-text-white', danger ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-bg-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-bg-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-bg-[var(--dark-error-color)]' : 'ant-[border:1px_solid_var(--primary-color)] ant-bg-[var(--primary-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-bg-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-bg-[var(--dark-primary-color)]'),
|
|
16
|
-
dashed: danger => cs(' ant-bg-white', danger ? 'ant-[border:1px_dashed_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-[border:1px_dashed_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]'),
|
|
17
|
-
text: danger => cs('ant-border-none ant-bg-transparent', danger ? 'ant-text-[var(--ant-color-error)] hover:ant-bg-[var(--error-bg-color)] active:ant-bg-[var(--error-bg-color)]' : 'ant-text-[var(--dark-color)] hover:ant-bg-[rgba(0,0,0,0.06)] active:ant-bg-[rgba(0,0,0,.15)]'),
|
|
18
|
-
link: danger => cs('ant-border-none ant-bg-transparent', danger ? 'ant-text-[var(--ant-color-error)] hover:ant-text-[var(--light-error-color)] active:ant-text-[var(--dark-error-color)]' : 'ant-text-[var(--primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-text-[var(--dark-primary-color)]')
|
|
19
|
-
};
|
|
20
|
-
const Button = props => {
|
|
21
|
-
const mergedProps = mergeProps({
|
|
22
|
-
type: 'default',
|
|
23
|
-
size: 'middle'
|
|
24
|
-
}, props);
|
|
25
|
-
const [innerLoading, setLoading] = createSignal(false);
|
|
26
|
-
const loading = createMemo(() => props.loading ?? innerLoading());
|
|
27
|
-
return (() => {
|
|
28
|
-
const _el$ = _tmpl$2(),
|
|
29
|
-
_el$3 = _el$.firstChild;
|
|
30
|
-
_el$.$$click = e => {
|
|
31
|
-
const res = mergedProps.onClick?.(e);
|
|
32
|
-
if (res instanceof Promise) {
|
|
33
|
-
setLoading(true);
|
|
34
|
-
res.finally(() => setLoading(false));
|
|
35
|
-
}
|
|
36
|
-
if (mergedProps.type === 'default' || mergedProps.type === 'primary' || mergedProps.type === 'dashed') {
|
|
37
|
-
const div = document.createElement('div');
|
|
38
|
-
div.className = cs(props.danger ? 'ant-[--color:var(--light-error-color)]' : 'ant-[--color:var(--light-primary-color)]', 'ant-absolute ant-inset-0 ant-rounded-inherit ant-[background:radial-gradient(var(--color),rgba(0,0,0,0))] ant-z--1 ant-keyframes-button-border[inset:0px][inset:-6px] ant-[animation:button-border_ease-out_0.3s]');
|
|
39
|
-
const onAnimationEnd = () => {
|
|
40
|
-
div.remove();
|
|
41
|
-
div.removeEventListener('animationend', onAnimationEnd);
|
|
42
|
-
};
|
|
43
|
-
div.addEventListener('animationend', onAnimationEnd);
|
|
44
|
-
e.currentTarget.insertBefore(div, e.currentTarget.childNodes[0]);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const _ref$ = mergedProps.ref;
|
|
48
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : mergedProps.ref = _el$;
|
|
49
|
-
insert(_el$, createComponent(Show, {
|
|
50
|
-
get when() {
|
|
51
|
-
return loading();
|
|
52
|
-
},
|
|
53
|
-
get children() {
|
|
54
|
-
return _tmpl$();
|
|
55
|
-
}
|
|
56
|
-
}), _el$3);
|
|
57
|
-
insert(_el$3, () => mergedProps.children);
|
|
58
|
-
effect(_p$ => {
|
|
59
|
-
const _v$ = cs('ant-relative ant-cursor-pointer', 'focus-visible:ant-[outline:4px_solid_var(--ant-color-primary-border)] focus-visible:ant-[outline-offset:1px]', mergedProps.class, sizeClassMap[mergedProps.size], typeClassMap[mergedProps.type](props.danger ?? false), loading() && 'ant-opacity-65', 'ant-[--color:--light-primary-color]'),
|
|
60
|
-
_v$2 = mergedProps.style;
|
|
61
|
-
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
62
|
-
_p$._v$2 = style(_el$, _v$2, _p$._v$2);
|
|
63
|
-
return _p$;
|
|
64
|
-
}, {
|
|
65
|
-
_v$: undefined,
|
|
66
|
-
_v$2: undefined
|
|
67
|
-
});
|
|
68
|
-
return _el$;
|
|
69
|
-
})();
|
|
70
|
-
};
|
|
71
|
-
delegateEvents(["click"]);
|
|
72
|
-
|
|
73
|
-
export { Button as default };
|
package/es/ColorPicker.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Color } from 'antd/es/color-picker';
|
|
2
|
-
export interface ColorPickerProps {
|
|
3
|
-
defaultValue?: string | Color;
|
|
4
|
-
value?: string | Color;
|
|
5
|
-
onChange?: (value: Color, hex: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: (props: import("antd").ColorPickerProps) => import("solid-js").JSX.Element;
|
|
8
|
-
export default _default;
|
package/es/ColorPicker.js
DELETED
package/es/Compact.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ParentProps } from 'solid-js';
|
|
2
|
-
interface CompactProps extends ParentProps {
|
|
3
|
-
}
|
|
4
|
-
declare function Compact(props: CompactProps): import("solid-js").JSX.Element;
|
|
5
|
-
declare namespace Compact {
|
|
6
|
-
var compactItemClass: string;
|
|
7
|
-
var compactItemRounded0Class: string;
|
|
8
|
-
var compactItemRoundedLeftClass: string;
|
|
9
|
-
var compactItemRoundedRightClass: string;
|
|
10
|
-
var compactItemZIndexClass: string;
|
|
11
|
-
}
|
|
12
|
-
export default Compact;
|
package/es/Compact.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { insert, template } from 'solid-js/web';
|
|
2
|
-
|
|
3
|
-
const _tmpl$ = /*#__PURE__*/template(`<div class="ant-compact ant-flex">`);
|
|
4
|
-
function Compact(props) {
|
|
5
|
-
return (() => {
|
|
6
|
-
const _el$ = _tmpl$();
|
|
7
|
-
insert(_el$, () => props.children);
|
|
8
|
-
return _el$;
|
|
9
|
-
})();
|
|
10
|
-
}
|
|
11
|
-
Compact.compactItemClass = 'p[.ant-compact]:ant-ml--1px';
|
|
12
|
-
Compact.compactItemRounded0Class = 'p[.ant-compact>*]:ant-rounded-0';
|
|
13
|
-
Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-l-6px';
|
|
14
|
-
Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px';
|
|
15
|
-
Compact.compactItemZIndexClass = 'p[.ant-compact>*]:focus:ant-z-10 p[.ant-compact>*]:focus-within:ant-z-10';
|
|
16
|
-
|
|
17
|
-
export { Compact as default };
|
package/es/DatePicker.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type DatePickerProps, type RangePickerProps } from 'antd/es/date-picker';
|
|
2
|
-
declare const RangePicker: import("solid-js").Component<Omit<RangePickerProps & {
|
|
3
|
-
dropdownClassName?: string | undefined;
|
|
4
|
-
popupClassName?: string | undefined;
|
|
5
|
-
rootClassName?: string | undefined;
|
|
6
|
-
}, "className"> & {
|
|
7
|
-
class?: string | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
declare const DatePicker: import("solid-js").Component<Omit<DatePickerProps & {
|
|
10
|
-
status?: '' | 'error' | 'warning' | undefined;
|
|
11
|
-
hashId?: string | undefined;
|
|
12
|
-
popupClassName?: string | undefined;
|
|
13
|
-
rootClassName?: string | undefined;
|
|
14
|
-
}, "className"> & {
|
|
15
|
-
class?: string | undefined;
|
|
16
|
-
}> & {
|
|
17
|
-
RangePicker: typeof RangePicker;
|
|
18
|
-
};
|
|
19
|
-
export default DatePicker;
|
package/es/DatePicker.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DatePicker as DatePicker$1 } from 'antd';
|
|
2
|
-
import { replaceClassName, reactToSolidComponent } from './utils/component.js';
|
|
3
|
-
|
|
4
|
-
const RangePicker = replaceClassName(reactToSolidComponent(DatePicker$1.RangePicker));
|
|
5
|
-
const _DatePicker = replaceClassName(reactToSolidComponent(DatePicker$1));
|
|
6
|
-
const DatePicker = _DatePicker;
|
|
7
|
-
DatePicker.RangePicker = RangePicker;
|
|
8
|
-
|
|
9
|
-
export { DatePicker as default };
|
package/es/Image.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type JSXElement } from 'solid-js';
|
|
2
|
-
declare const _Image: import("solid-js").Component<Omit<import("antd").ImageProps, "className"> & {
|
|
3
|
-
class?: string | undefined;
|
|
4
|
-
}>;
|
|
5
|
-
type ImageProps = Omit<Parameters<typeof _Image>[0], 'placeholder'> & {
|
|
6
|
-
placeholder?: JSXElement;
|
|
7
|
-
};
|
|
8
|
-
declare function Image(_props: ImageProps): import("solid-js").JSX.Element;
|
|
9
|
-
export default Image;
|
package/es/Image.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createComponent, mergeProps, template } from 'solid-js/web';
|
|
2
|
-
import { Image as Image$1 } from 'antd';
|
|
3
|
-
import { replaceClassName, reactToSolidComponent, configProvider } from './utils/component.js';
|
|
4
|
-
import { solidToReact } from './utils/solid.js';
|
|
5
|
-
import { createMemo } from 'solid-js';
|
|
6
|
-
import { mapValues } from 'lodash-es';
|
|
7
|
-
|
|
8
|
-
const _tmpl$ = /*#__PURE__*/template(`<div class="ant-inline-flex">`);
|
|
9
|
-
const _Image = replaceClassName(reactToSolidComponent(configProvider(Image$1), () => _tmpl$()));
|
|
10
|
-
function Image(_props) {
|
|
11
|
-
const props = createMemo(() => mapValues(_props, (value, key) => {
|
|
12
|
-
switch (key) {
|
|
13
|
-
case 'placeholder':
|
|
14
|
-
return solidToReact(value);
|
|
15
|
-
default:
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
}));
|
|
19
|
-
return createComponent(_Image, mergeProps(props));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { Image as default };
|
package/es/Input.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { JSX, JSXElement, Component } from 'solid-js';
|
|
2
|
-
type CommonInputProps<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement> = JSX.CustomAttributes<T> & {
|
|
3
|
-
textarea?: boolean;
|
|
4
|
-
defaultValue?: string | undefined;
|
|
5
|
-
value?: string | undefined;
|
|
6
|
-
addonBefore?: JSXElement;
|
|
7
|
-
addonAfter?: JSXElement;
|
|
8
|
-
prefix?: JSXElement;
|
|
9
|
-
suffix?: JSXElement;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 仅供 InputNumber 使用
|
|
13
|
-
*/
|
|
14
|
-
actions?: JSXElement;
|
|
15
|
-
/**
|
|
16
|
-
* 设置校验状态
|
|
17
|
-
*/
|
|
18
|
-
status?: 'error' | 'warning';
|
|
19
|
-
onChange?: JSX.InputEventHandler<T, InputEvent>;
|
|
20
|
-
onPressEnter?: JSX.EventHandler<T, KeyboardEvent>;
|
|
21
|
-
onKeyDown?: JSX.EventHandler<T, KeyboardEvent>;
|
|
22
|
-
};
|
|
23
|
-
export declare function CommonInput<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(props: CommonInputProps<T> & Omit<JSX.InputHTMLAttributes<T>, 'onChange' | 'onInput' | 'onKeyDown'>): JSX.Element;
|
|
24
|
-
export type InputProps = Omit<CommonInputProps, 'actions' | 'textarea'> & Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'onInput' | 'onKeyDown'>;
|
|
25
|
-
export type TextAreaProps = Omit<CommonInputProps<HTMLTextAreaElement>, 'prefix' | 'suffix' | 'textarea'> & Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'actions' | 'onChange' | 'onInput' | 'onKeyDown'>;
|
|
26
|
-
declare const Input: Component<InputProps> & {
|
|
27
|
-
TextArea: Component<TextAreaProps>;
|
|
28
|
-
};
|
|
29
|
-
export default Input;
|