x-ui-design 0.8.88 → 0.8.89
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/lib/components/Popover/Popover.tsx +1 -1
- package/lib/components/Result/Result.tsx +1 -1
- package/lib/helpers/index.ts +32 -10
- package/lib/hooks/usePopupPosition.ts +73 -34
- package/package.json +1 -1
- package/src/app/page.tsx +32 -18
- package/dist/esm/types/components/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -8
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -1
- package/dist/esm/types/components/ConditionalWrapper/index.d.ts +0 -7
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +0 -8
- package/dist/esm/types/components/DatePicker/RangePicker/RangePicker.d.ts +0 -5
- package/dist/esm/types/components/DatePicker/RangePicker/index.d.ts +0 -1
- package/dist/esm/types/components/DatePicker/TimePicker/TimePicker.d.ts +0 -5
- package/dist/esm/types/components/DatePicker/TimePicker/index.d.ts +0 -1
- package/dist/esm/types/components/DatePicker/index.d.ts +0 -1
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +0 -5
- package/dist/esm/types/components/Dropdown/index.d.ts +0 -1
- package/dist/esm/types/components/Empty/Empty.d.ts +0 -5
- package/dist/esm/types/components/Empty/index.d.ts +0 -1
- package/dist/esm/types/components/Form/Form.d.ts +0 -7
- package/dist/esm/types/components/Form/Item/Item.d.ts +0 -8
- package/dist/esm/types/components/Form/Item/index.d.ts +0 -1
- package/dist/esm/types/components/Form/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/Icons.d.ts +0 -19
- package/dist/esm/types/components/Icons/index.d.ts +0 -1
- package/dist/esm/types/components/Input/Input.d.ts +0 -12
- package/dist/esm/types/components/Input/Textarea/Textarea.d.ts +0 -8
- package/dist/esm/types/components/Input/Textarea/index.d.ts +0 -1
- package/dist/esm/types/components/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Menu/Item/Item.d.ts +0 -4
- package/dist/esm/types/components/Menu/Menu.d.ts +0 -20
- package/dist/esm/types/components/Menu/SubMenu/SubMenu.d.ts +0 -4
- package/dist/esm/types/components/Menu/index.d.ts +0 -1
- package/dist/esm/types/components/Popover/Popover.d.ts +0 -5
- package/dist/esm/types/components/Popover/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Radio/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Group/Group.d.ts +0 -5
- package/dist/esm/types/components/Radio/Group/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Radio.d.ts +0 -8
- package/dist/esm/types/components/Radio/index.d.ts +0 -1
- package/dist/esm/types/components/Result/Result.d.ts +0 -5
- package/dist/esm/types/components/Result/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Option/Option.d.ts +0 -5
- package/dist/esm/types/components/Select/Option/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Select.d.ts +0 -8
- package/dist/esm/types/components/Select/Tag/Tag.d.ts +0 -5
- package/dist/esm/types/components/Select/Tag/index.d.ts +0 -1
- package/dist/esm/types/components/Select/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Avatar/Avatar.d.ts +0 -8
- package/dist/esm/types/components/Skeleton/Avatar/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Image/Image.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Image/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Input/Input.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Skeleton.d.ts +0 -10
- package/dist/esm/types/components/Skeleton/index.d.ts +0 -1
- package/dist/esm/types/components/Switch/Switch.d.ts +0 -8
- package/dist/esm/types/components/Switch/index.d.ts +0 -1
- package/dist/esm/types/components/Upload/Upload.d.ts +0 -5
- package/dist/esm/types/components/Upload/index.d.ts +0 -1
- package/dist/esm/types/helpers/flatten.d.ts +0 -2
- package/dist/esm/types/helpers/index.d.ts +0 -5
- package/dist/esm/types/helpers/mask.d.ts +0 -7
- package/dist/esm/types/hooks/useForm.d.ts +0 -7
- package/dist/esm/types/hooks/usePopupPosition.d.ts +0 -15
- package/dist/esm/types/hooks/usePosition.d.ts +0 -18
- package/dist/esm/types/hooks/useWatch.d.ts +0 -9
- package/dist/esm/types/hooks/useWatchError.d.ts +0 -2
- package/dist/esm/types/index.d.ts +0 -50
- package/dist/esm/types/types/button.d.ts +0 -44
- package/dist/esm/types/types/checkbox.d.ts +0 -25
- package/dist/esm/types/types/datepicker.d.ts +0 -122
- package/dist/esm/types/types/dropdown.d.ts +0 -37
- package/dist/esm/types/types/empty.d.ts +0 -7
- package/dist/esm/types/types/form.d.ts +0 -122
- package/dist/esm/types/types/index.d.ts +0 -28
- package/dist/esm/types/types/input.d.ts +0 -53
- package/dist/esm/types/types/menu.d.ts +0 -66
- package/dist/esm/types/types/popover.d.ts +0 -17
- package/dist/esm/types/types/radio.d.ts +0 -59
- package/dist/esm/types/types/result.d.ts +0 -13
- package/dist/esm/types/types/select.d.ts +0 -106
- package/dist/esm/types/types/skeleton.d.ts +0 -50
- package/dist/esm/types/types/switch.d.ts +0 -19
- package/dist/esm/types/types/upload.d.ts +0 -54
- package/dist/esm/types/utils/index.d.ts +0 -35
- package/dist/esm/types/utils/lazy.d.ts +0 -1
- package/dist/index.d.ts +0 -145
- package/dist/index.esm.js +0 -5708
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -5758
- package/dist/index.js.map +0 -1
|
@@ -48,7 +48,7 @@ const Popover = ({
|
|
|
48
48
|
placement,
|
|
49
49
|
open: isOpen,
|
|
50
50
|
setOpen: setInnerOpen,
|
|
51
|
-
|
|
51
|
+
popupContainer: getPopupContainer?.(targetRef.current as HTMLElement)
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
useEffect(() => {
|
package/lib/helpers/index.ts
CHANGED
|
@@ -51,28 +51,50 @@ export function clsx(...args: RuleType[]): string {
|
|
|
51
51
|
.join(' ');
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function
|
|
54
|
+
export function getElementParentDetails(
|
|
55
55
|
el: HTMLElement | null,
|
|
56
56
|
includeSelf = false
|
|
57
|
-
):
|
|
58
|
-
|
|
57
|
+
): {
|
|
58
|
+
relativePosition: {
|
|
59
|
+
left: number;
|
|
60
|
+
top: number;
|
|
61
|
+
},
|
|
62
|
+
scrollableParents: HTMLElement | null
|
|
63
|
+
} {
|
|
64
|
+
if (!el) {
|
|
65
|
+
return {
|
|
66
|
+
relativePosition: { left: 0, top: 0 },
|
|
67
|
+
scrollableParents: null
|
|
68
|
+
}
|
|
69
|
+
};
|
|
59
70
|
|
|
60
71
|
let current: HTMLElement | null = includeSelf ? el : el.parentElement;
|
|
72
|
+
const relativePosition = { left: 0, top: 0 };
|
|
61
73
|
|
|
62
74
|
while (current) {
|
|
63
75
|
const style = getComputedStyle(current);
|
|
64
76
|
|
|
65
|
-
const canScroll =
|
|
66
|
-
|
|
77
|
+
const canScroll =
|
|
78
|
+
['auto', 'scroll'].includes(style.overflowY) || ['auto', 'scroll'].includes(style.overflowX)
|
|
67
79
|
|
|
68
|
-
if (
|
|
69
|
-
|
|
80
|
+
if (current.style.position === 'relative') {
|
|
81
|
+
relativePosition.left += current.offsetLeft;
|
|
82
|
+
relativePosition.top += current.offsetTop;
|
|
83
|
+
}
|
|
70
84
|
|
|
71
|
-
|
|
85
|
+
if (canScroll) {
|
|
86
|
+
return {
|
|
87
|
+
relativePosition,
|
|
88
|
+
scrollableParents: current
|
|
89
|
+
};
|
|
72
90
|
}
|
|
73
91
|
|
|
74
92
|
current = current.parentElement;
|
|
75
93
|
}
|
|
76
94
|
|
|
77
|
-
return
|
|
78
|
-
}
|
|
95
|
+
return {
|
|
96
|
+
relativePosition: { left: 0, top: 0 },
|
|
97
|
+
scrollableParents: document.scrollingElement as HTMLElement
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
SetStateAction,
|
|
6
6
|
useCallback,
|
|
7
7
|
useEffect,
|
|
8
|
+
useMemo,
|
|
8
9
|
useState
|
|
9
10
|
} from "react";
|
|
10
11
|
import { Placement } from "../types";
|
|
11
|
-
import {
|
|
12
|
+
import { getElementParentDetails } from "../helpers";
|
|
12
13
|
|
|
13
14
|
const OFFSET = 12;
|
|
14
15
|
|
|
@@ -18,16 +19,16 @@ type TPopupPosition = {
|
|
|
18
19
|
targetRef: RefObject<HTMLDivElement | null>;
|
|
19
20
|
popupRef: RefObject<HTMLDivElement | null>;
|
|
20
21
|
placement?: Placement;
|
|
21
|
-
|
|
22
|
+
popupContainer?: HTMLElement | null;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export const usePopupPosition = ({
|
|
25
26
|
open,
|
|
26
27
|
setOpen,
|
|
27
|
-
inBody,
|
|
28
28
|
popupRef,
|
|
29
29
|
targetRef,
|
|
30
|
-
placement
|
|
30
|
+
placement,
|
|
31
|
+
popupContainer,
|
|
31
32
|
}: TPopupPosition): {
|
|
32
33
|
_placement: Placement;
|
|
33
34
|
popupStyle: CSSProperties
|
|
@@ -35,6 +36,8 @@ export const usePopupPosition = ({
|
|
|
35
36
|
const [_placement, _setPlacement] = useState<Placement>(placement ?? "bottomLeft");
|
|
36
37
|
const [popupPosition, setPopupPosition] = useState<CSSProperties>({});
|
|
37
38
|
|
|
39
|
+
const inBody = useMemo(() => popupContainer?.tagName === 'BODY', [popupContainer]);
|
|
40
|
+
|
|
38
41
|
const calculatePosition = useCallback((e?: Event) => {
|
|
39
42
|
const container = targetRef.current?.getBoundingClientRect();
|
|
40
43
|
|
|
@@ -42,25 +45,43 @@ export const usePopupPosition = ({
|
|
|
42
45
|
return;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
const scrollableParents =
|
|
46
|
-
const
|
|
48
|
+
const { scrollableParents, relativePosition } = getElementParentDetails(targetRef.current, true);
|
|
49
|
+
const _containsElement = scrollableParents?.contains(popupContainer as HTMLDivElement) && popupContainer !== scrollableParents
|
|
50
|
+
|
|
51
|
+
const positions = !popupContainer
|
|
52
|
+
? {
|
|
53
|
+
top: (targetRef.current?.offsetTop || 0) + OFFSET,
|
|
54
|
+
left: (targetRef.current?.offsetLeft || 0)
|
|
55
|
+
}
|
|
56
|
+
: _containsElement
|
|
57
|
+
? {
|
|
58
|
+
top: (targetRef.current?.clientLeft || 0) + (targetRef.current?.offsetTop || 0) + OFFSET,
|
|
59
|
+
left: (targetRef.current?.clientLeft || 0) + (targetRef.current?.offsetLeft || 0)
|
|
60
|
+
}
|
|
61
|
+
: inBody
|
|
62
|
+
? {
|
|
63
|
+
top: container.top,
|
|
64
|
+
left: container.left - (targetRef.current?.clientWidth || 0) / 2
|
|
65
|
+
}
|
|
66
|
+
: {
|
|
67
|
+
top: (relativePosition.top || 0) + (targetRef.current?.offsetTop || 0) - (scrollableParents?.offsetTop || 0) + OFFSET,
|
|
68
|
+
left: relativePosition.left + (targetRef.current?.offsetLeft || 0) - (targetRef.current?.clientWidth || 0) / 2
|
|
69
|
+
};
|
|
47
70
|
|
|
48
71
|
if (!inBody) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const spaceAboveFromTop = hidePopupFromTop - Math.round((popupRef.current?.clientHeight || 0) + container?.height + OFFSET);
|
|
52
|
-
const spaceAboveFromBottom = -Math.round((popupRef.current?.clientHeight || 0) + container?.height - OFFSET);
|
|
72
|
+
const hasNotSpaceFromBottom = relativePosition.top - ((scrollableParents?.scrollHeight || 0) - (scrollableParents?.scrollTop || 0) - (popupRef.current?.clientHeight || 0)) - OFFSET
|
|
73
|
+
const hasNotSpaceFromTop = (relativePosition.top + (popupRef.current?.clientHeight || 0) - container.height - (OFFSET * 2)) - (scrollableParents?.scrollTop || 0)
|
|
53
74
|
|
|
54
|
-
if (
|
|
75
|
+
if (hasNotSpaceFromBottom < 0) {
|
|
55
76
|
_setPlacement(_placement.replace('bottom', 'top') as Placement)
|
|
56
77
|
}
|
|
57
78
|
|
|
58
|
-
if (
|
|
79
|
+
if (hasNotSpaceFromTop <= 0) {
|
|
59
80
|
_setPlacement(_placement.replace('top', 'bottom') as Placement)
|
|
60
81
|
}
|
|
61
82
|
}
|
|
62
83
|
|
|
63
|
-
if (
|
|
84
|
+
if (e?.target === scrollableParents && inBody) {
|
|
64
85
|
setOpen(false);
|
|
65
86
|
setPopupPosition({});
|
|
66
87
|
|
|
@@ -68,62 +89,80 @@ export const usePopupPosition = ({
|
|
|
68
89
|
}
|
|
69
90
|
|
|
70
91
|
const _calculation = () => {
|
|
71
|
-
const _placementBottom = !_placement.includes('bottom') ? 0 : (inBody
|
|
72
|
-
? (targetRef.current?.offsetTop || 0) + (targetRef.current?.clientHeight || 0) - (scrollableParents?.scrollTop || 0) + (scrollableParents?.offsetTop || 0)
|
|
73
|
-
: (targetRef.current?.offsetTop || 0) + (targetRef.current?.clientHeight || 0)) + OFFSET;
|
|
74
|
-
|
|
75
|
-
const _placementTop = !_placement.includes('top') ? 0 : (inBody
|
|
76
|
-
? (targetRef.current?.offsetTop || 0) - (popupRef.current?.clientHeight || 0) - (scrollableParents?.scrollTop || 0) + (scrollableParents?.offsetTop || 0)
|
|
77
|
-
: (targetRef.current?.offsetTop || 0) - (popupRef.current?.clientHeight || 0)) - OFFSET;
|
|
78
|
-
|
|
79
|
-
const _positionLeft = inBody ? container.left : (targetRef.current?.offsetLeft || 0)
|
|
80
|
-
|
|
81
92
|
switch (_placement) {
|
|
82
93
|
case "bottom":
|
|
83
|
-
setPopupPosition({
|
|
94
|
+
setPopupPosition({
|
|
95
|
+
top: positions.top + container.height,
|
|
96
|
+
left: positions.left + ((container.width || 0) / 2) - ((popupRef.current?.offsetWidth || 0) / 2)
|
|
97
|
+
});
|
|
84
98
|
break;
|
|
85
99
|
case "bottomLeft":
|
|
86
|
-
setPopupPosition({
|
|
100
|
+
setPopupPosition({
|
|
101
|
+
top: positions.top + container.height,
|
|
102
|
+
left: positions.left
|
|
103
|
+
});
|
|
87
104
|
break;
|
|
88
105
|
case "bottomRight":
|
|
89
|
-
setPopupPosition({
|
|
106
|
+
setPopupPosition({
|
|
107
|
+
top: positions.top + container.height,
|
|
108
|
+
left: positions.left + (container.width || 0) - (popupRef.current?.offsetWidth || 0)
|
|
109
|
+
});
|
|
90
110
|
break;
|
|
91
111
|
case "top":
|
|
92
|
-
setPopupPosition({
|
|
112
|
+
setPopupPosition({
|
|
113
|
+
top: positions.top - (popupRef.current?.clientHeight || 0) - (OFFSET * 2),
|
|
114
|
+
left: positions.left + ((container.width || 0) / 2) - ((popupRef.current?.offsetWidth || 0) / 2)
|
|
115
|
+
});
|
|
93
116
|
break;
|
|
94
117
|
case "topLeft":
|
|
95
|
-
setPopupPosition({
|
|
118
|
+
setPopupPosition({
|
|
119
|
+
top: positions.top - (popupRef.current?.clientHeight || 0) - (OFFSET * 2),
|
|
120
|
+
left: positions.left
|
|
121
|
+
});
|
|
96
122
|
break;
|
|
97
123
|
case "topRight":
|
|
98
|
-
setPopupPosition({
|
|
124
|
+
setPopupPosition({
|
|
125
|
+
top: positions.top - (popupRef.current?.clientHeight || 0) - (OFFSET * 2),
|
|
126
|
+
left: positions.left + (container.width || 0) - (popupRef.current?.offsetWidth || 0)
|
|
127
|
+
});
|
|
99
128
|
break;
|
|
100
129
|
}
|
|
101
130
|
}
|
|
102
131
|
|
|
103
132
|
_calculation()
|
|
104
|
-
}, [targetRef, popupRef, inBody, _placement, setOpen]);
|
|
133
|
+
}, [targetRef, popupRef, popupContainer, inBody, _placement, setOpen]);
|
|
105
134
|
|
|
106
135
|
useEffect(() => {
|
|
107
136
|
if (!open) {
|
|
108
137
|
return;
|
|
109
138
|
}
|
|
110
139
|
|
|
111
|
-
|
|
140
|
+
const setPositionRelative = (position: string) => {
|
|
141
|
+
(scrollableParents as HTMLDivElement).style.position = position;
|
|
112
142
|
|
|
113
|
-
|
|
143
|
+
if (popupContainer) {
|
|
144
|
+
(popupContainer as HTMLDivElement).style.position = position;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
114
147
|
|
|
148
|
+
const controller = new AbortController();
|
|
115
149
|
const options = { passive: true, signal: controller.signal };
|
|
116
150
|
|
|
117
|
-
const scrollableParents =
|
|
151
|
+
const { scrollableParents } = getElementParentDetails(targetRef.current, true);
|
|
118
152
|
scrollableParents?.addEventListener("scroll", calculatePosition, options);
|
|
119
153
|
|
|
154
|
+
setPositionRelative('relative');
|
|
155
|
+
|
|
156
|
+
calculatePosition();
|
|
157
|
+
|
|
120
158
|
document.body.addEventListener("scroll", calculatePosition, options);
|
|
121
159
|
document.body.addEventListener("resize", calculatePosition, options);
|
|
122
160
|
|
|
123
161
|
return () => {
|
|
124
162
|
controller.abort();
|
|
163
|
+
setPositionRelative('unset');
|
|
125
164
|
};
|
|
126
|
-
}, [
|
|
165
|
+
}, [open, targetRef, popupContainer, inBody, calculatePosition]);
|
|
127
166
|
|
|
128
167
|
return {
|
|
129
168
|
_placement,
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
|
@@ -82,27 +82,37 @@ const items: ItemType[] = [
|
|
|
82
82
|
export default function Home() {
|
|
83
83
|
return (
|
|
84
84
|
<div style={{ height: 3000 }}>
|
|
85
|
-
<div style={{ height: 200, width:
|
|
85
|
+
<div style={{ height: 200, width: 900 }} />
|
|
86
86
|
<div
|
|
87
87
|
className='sdfdsgfsfdg'
|
|
88
88
|
style={{
|
|
89
|
-
height:
|
|
89
|
+
height: 700,
|
|
90
|
+
width: 2500,
|
|
90
91
|
display: "flex",
|
|
91
92
|
overflow: 'auto',
|
|
92
|
-
border: '1px solid'
|
|
93
|
+
border: '1px solid',
|
|
94
|
+
position: 'relative',
|
|
93
95
|
}}>
|
|
94
|
-
<div style={{ width:
|
|
96
|
+
<div style={{ width: 900 }} />
|
|
95
97
|
|
|
96
|
-
<div
|
|
98
|
+
<div style={{
|
|
99
|
+
width: 900,
|
|
100
|
+
position: 'relative',
|
|
101
|
+
height: 1500,
|
|
102
|
+
border: '1px solid',
|
|
103
|
+
}}>
|
|
104
|
+
<div style={{ height: 1000, width: '100%' }} />
|
|
105
|
+
<div
|
|
97
106
|
className='dsfdf'
|
|
98
107
|
style={{
|
|
99
|
-
width:
|
|
100
|
-
position: 'relative'
|
|
101
|
-
|
|
108
|
+
width: 1500,
|
|
109
|
+
position: 'relative',
|
|
110
|
+
height: 1500,
|
|
111
|
+
border: '1px solid',
|
|
102
112
|
}}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
placement='
|
|
113
|
+
<div style={{ height: 900, width: '100%' }} />
|
|
114
|
+
<Popover
|
|
115
|
+
placement='bottomRight'
|
|
106
116
|
content={
|
|
107
117
|
<Suspense>
|
|
108
118
|
<Result
|
|
@@ -113,17 +123,21 @@ export default function Home() {
|
|
|
113
123
|
/>
|
|
114
124
|
</Suspense>
|
|
115
125
|
}
|
|
116
|
-
// getPopupContainer={() => document.getElementsByClassName('sdfdsgfsfdg')?.[0] as HTMLDivElement}
|
|
117
126
|
// getPopupContainer={() => document.body}
|
|
127
|
+
// getPopupContainer={() => document.getElementsByClassName('sdfdsgfsfdg')?.[0] as HTMLDivElement}
|
|
128
|
+
// getPopupContainer={() => document.getElementsByClassName('dsfdf')?.[0] as HTMLDivElement}
|
|
118
129
|
>
|
|
119
130
|
Menu
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
<br />
|
|
132
|
+
Menu
|
|
133
|
+
</Popover>
|
|
134
|
+
{/* <DatePicker
|
|
135
|
+
// getPopupContainer={() => document.body}
|
|
136
|
+
getPopupContainer={() => document.getElementsByClassName('sdfdsgfsfdg')?.[0] as HTMLDivElement}
|
|
137
|
+
/> */}
|
|
138
|
+
</div>
|
|
125
139
|
</div>
|
|
126
|
-
<div style={{ width: '100%' }} />
|
|
140
|
+
{/* <div style={{ width: '100%' }} /> */}
|
|
127
141
|
</div>
|
|
128
142
|
</div>
|
|
129
143
|
)
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ButtonProps } from '../../types/button';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const ButtonComponent: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, prefixClsV3, icon, iconPosition, loading, disabled, ghost, danger, block, children, href, __injected, child, ...restProps }: ButtonProps) => ReactElement;
|
|
5
|
-
export default ButtonComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Checkbox: {
|
|
5
|
-
({ prefixCls, prefixClsV3, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle, titleClick, ref, controlled }: CheckboxProps): ReactElement;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Checkbox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from './Checkbox';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TDatePickerProps } from '../../types/datepicker';
|
|
3
|
-
import './style.css';
|
|
4
|
-
export declare const NUMBER_SIX = 6;
|
|
5
|
-
export declare const MONTH_LENGTH = 11;
|
|
6
|
-
export declare const NEXT_DAYS_COUNT_AS_CURRENT_MUNTH = 35;
|
|
7
|
-
declare const DatePicker: ({ value, onChange, onCalendarChange, disabled, error, placeholder, prefixCls, noStyle, feedbackIcons, locale, className, placement, defaultValue, size, format, getPopupContainer, showToday, allowClear, disabledDate, suffixIcon, picker, prefix, defaultOpen, inputReadOnly, bordered, defaultPickerValue }: TDatePickerProps) => React.JSX.Element;
|
|
8
|
-
export default DatePicker;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TRangePickerProps } from '../../../types/datepicker';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RangePicker: ({ prefixCls, value, onChange, placeholder, disabled, error, format, prefix, allowClear, inputReadOnly, size, picker, locale, disabledDate, onVisibleChange, onCalendarChange, style, className, separator, defaultValue, bordered, getPopupContainer, placement }: TRangePickerProps) => React.JSX.Element;
|
|
5
|
-
export default RangePicker;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RangePicker } from '../RangePicker/RangePicker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TimePicker } from '../TimePicker/TimePicker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as DatePicker } from '../DatePicker/DatePicker';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DropdownProps } from '../../types/dropdown';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Dropdown: ({ children, menu, open: controlledOpen, defaultOpen, onVisibleChange, trigger, placement, overlayClassName, overlayStyle, getPopupContainer, destroyOnHidden, disabled, arrow, autoFocus, popupRender, className, overlay, prefixCls, }: DropdownProps) => React.JSX.Element;
|
|
5
|
-
export default Dropdown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Dropdown } from '../Dropdown/Dropdown';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EmptyContentProps } from '../../types/empty';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const EmptyContent: ({ icon, style, className, title, description, prefixCls, prefixClsV3 }: EmptyContentProps) => React.JSX.Element;
|
|
5
|
-
export default EmptyContent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Empty } from '../Empty/Empty';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { FormInstance, FormItemProps, FormProps } from '../../types/form';
|
|
3
|
-
export declare const FormContext: React.Context<FormInstance | null>;
|
|
4
|
-
declare const Form: FC<FormProps> & {
|
|
5
|
-
Item: FC<FormItemProps>;
|
|
6
|
-
};
|
|
7
|
-
export default Form;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormItemProps } from '../../../types/form';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const FormItem: {
|
|
5
|
-
({ prefixCls, prefixClsV3, name, label, rules, children, className, layout, style, dependencies, initialValue, feedbackIcons, extra, hideLabel, removeErrorMessageHeight, ...props }: FormItemProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default FormItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Item } from './Item';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Form } from './Form';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ResultStatusType } from '../../types/result';
|
|
3
|
-
declare const ClearIcon: () => React.JSX.Element;
|
|
4
|
-
declare const ArrowIcon: ({ isOpen }: {
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
}) => React.JSX.Element;
|
|
7
|
-
declare const LoadingIcon: () => React.JSX.Element;
|
|
8
|
-
declare const CheckIcon: () => React.JSX.Element;
|
|
9
|
-
declare const SearchIcon: () => React.JSX.Element;
|
|
10
|
-
declare const CalendarIcon: () => React.JSX.Element;
|
|
11
|
-
declare const SuccessIcon: () => React.JSX.Element;
|
|
12
|
-
declare const ErrorIcon: () => React.JSX.Element;
|
|
13
|
-
declare const DateDistanceIcon: () => React.JSX.Element;
|
|
14
|
-
declare const TimeIcon: () => React.JSX.Element;
|
|
15
|
-
declare const StampleIcon: () => React.JSX.Element;
|
|
16
|
-
declare const TrashIcon: () => React.JSX.Element;
|
|
17
|
-
declare const SpinerIcon: () => React.JSX.Element;
|
|
18
|
-
declare const renderDefaultIcon: (status: ResultStatusType) => React.JSX.Element | null;
|
|
19
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon, renderDefaultIcon };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon } from './Icons';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InputProps } from '../../types/input';
|
|
3
|
-
import Textarea from './Textarea/Textarea';
|
|
4
|
-
import './style.css';
|
|
5
|
-
declare const InputComponent: {
|
|
6
|
-
({ size, error, suffix, prefix, addonAfter, addonBefore, onPressEnter, disabled, allowClear, prefixCls, prefixClsV3, className, value, iconRender, noStyle, feedbackIcons, mask, maskChar, maskRegex, __injected, defaultValue, child, ref, ...props }: InputProps): React.JSX.Element;
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
9
|
-
declare const Input: typeof InputComponent & {
|
|
10
|
-
TextArea: typeof Textarea;
|
|
11
|
-
};
|
|
12
|
-
export default Input;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextareaProps } from '../../../types/input';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Textarea: {
|
|
5
|
-
({ prefixCls, prefixClsV3, value, className, style, autoSize, onPressEnter, onResize, styles, bordered, size, status, rootClassName, variant, error, allowClear, ref, ...props }: TextareaProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Textarea;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Textarea } from '../Textarea/Textarea';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Input } from '../Input/Input';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { FC, MouseEvent } from "react";
|
|
2
|
-
import { MenuMode, MenuProps } from "../../types/menu";
|
|
3
|
-
import MenuItem from "./Item/Item";
|
|
4
|
-
import SubMenu from "./SubMenu/SubMenu";
|
|
5
|
-
import "./index.css";
|
|
6
|
-
export declare const MenuContext: React.Context<{
|
|
7
|
-
mode: MenuMode;
|
|
8
|
-
inlineIndent: number;
|
|
9
|
-
inlineCollapsed: boolean;
|
|
10
|
-
selectedKeys: string[];
|
|
11
|
-
openKeys: string[];
|
|
12
|
-
toggleOpen: (key: string, level?: "1" | "2") => void;
|
|
13
|
-
onItemClick: (key: string, domEvent?: MouseEvent) => void;
|
|
14
|
-
triggerSubMenuAction?: "hover" | "click";
|
|
15
|
-
} | null>;
|
|
16
|
-
declare const Menu: FC<MenuProps> & {
|
|
17
|
-
Item: typeof MenuItem;
|
|
18
|
-
SubMenu: typeof SubMenu;
|
|
19
|
-
};
|
|
20
|
-
export default Menu;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Menu } from './Menu';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PopoverProps } from "../../types/popover";
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Popover: ({ prefixCls, content, children, trigger, placement, open, visible, title, style, overlayClassName, overlayStyle, listenPopoverPositions, placementPositionOffset, onVisibleChange, getPopupContainer }: PopoverProps) => React.JSX.Element;
|
|
5
|
-
export default Popover;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Popover } from '../Popover/Popover';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioButtonProps } from '../../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RadioButton: ({ prefixCls, prefixClsV3, className, checked, disabled, children, size, ...props }: RadioButtonProps) => React.JSX.Element;
|
|
5
|
-
export default RadioButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RadioButton } from '../../Radio/Button/Button';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioGroupProps } from '../../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RadioGroup: ({ defaultValue, value, size, disabled, name, id, style, buttonStyle, block, prefixCls, prefixClsV3, className, options, children, ...props }: RadioGroupProps) => React.JSX.Element;
|
|
5
|
-
export default RadioGroup;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RadioGroup } from '../../Radio/Group/Group';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioProps } from '../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Radio: {
|
|
5
|
-
({ prefixCls, className, value, onChange, onClick, disabled, children, name, title, defaultChecked, checked, onBlur, onFocus, onMouseEnter, onMouseLeave, noStyle, ref }: RadioProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Radio;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Radio } from '../Radio/Radio';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Result } from '../Result/Result';
|