doui-react 2.0.2 → 2.0.6
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/es/api/component/sort.d.ts +1 -1
- package/es/api/component/sort.js +4 -8
- package/es/form/component/utils.d.ts +5 -5
- package/es/grid/component/pagination.d.ts +8 -8
- package/es/icon/hook/index.d.ts +24 -24
- package/es/radio/component/abstract-box.d.ts +24 -24
- package/es/table/component/date-time.d.ts +3 -0
- package/es/table/component/date-time.js +27 -0
- package/es/table/component/filter.js +1 -1
- package/es/table/component/sort.js +1 -1
- package/es/table/component/table.js +5 -3
- package/es/table/component/utils.d.ts +3 -2
- package/es/table/component/utils.js +18 -6
- package/es/tabs/component/utils.d.ts +4 -4
- package/es/tooltip/component/index.d.ts +5 -5
- package/lib/api/component/sort.d.ts +1 -1
- package/lib/api/component/sort.js +4 -8
- package/lib/form/component/utils.d.ts +5 -5
- package/lib/grid/component/pagination.d.ts +8 -8
- package/lib/icon/hook/index.d.ts +24 -24
- package/lib/radio/component/abstract-box.d.ts +24 -24
- package/lib/table/component/date-time.d.ts +3 -0
- package/lib/table/component/date-time.js +35 -0
- package/lib/table/component/filter.js +1 -1
- package/lib/table/component/sort.js +1 -1
- package/lib/table/component/table.js +5 -3
- package/lib/table/component/utils.d.ts +3 -2
- package/lib/table/component/utils.js +18 -6
- package/lib/tabs/component/utils.d.ts +4 -4
- package/lib/tooltip/component/index.d.ts +5 -5
- package/package.json +2 -2
- package/es/table/component/time.d.ts +0 -2
- package/es/table/component/time.js +0 -12
- package/lib/table/component/time.d.ts +0 -2
- package/lib/table/component/time.js +0 -19
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function sorter(a
|
|
1
|
+
export declare function sorter(a?: any, b?: any): any;
|
|
2
2
|
export declare function sortBy(data: any[] | undefined, key: string): any[];
|
package/es/api/component/sort.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
export function sorter(
|
|
2
|
+
export function sorter() {
|
|
3
|
+
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
4
|
+
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3
5
|
if (_.isNumber(a)) {
|
|
4
6
|
return a - b;
|
|
5
7
|
}
|
|
6
|
-
if (_.isNil(a) && _.isNil(b)) {
|
|
7
|
-
return 0;
|
|
8
|
-
}
|
|
9
|
-
if (_.isNil(a)) {
|
|
10
|
-
return -1;
|
|
11
|
-
}
|
|
12
8
|
return a.localeCompare(b);
|
|
13
9
|
}
|
|
14
10
|
export function sortBy() {
|
|
15
11
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
12
|
var key = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
13
|
return data.sort(function (a, b) {
|
|
18
|
-
return sorter(a
|
|
14
|
+
return sorter(_.get(a, key), _.get(b, key));
|
|
19
15
|
});
|
|
20
16
|
}
|
|
@@ -38,14 +38,13 @@ export declare function getFormItemProps(props: any): {
|
|
|
38
38
|
defaultVisible?: boolean | undefined;
|
|
39
39
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
40
40
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
42
|
+
id?: string | undefined;
|
|
43
43
|
prefixCls?: string | undefined;
|
|
44
44
|
zIndex?: number | undefined;
|
|
45
|
-
|
|
46
|
-
id?: string | undefined;
|
|
47
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
45
|
+
animation?: string | undefined;
|
|
48
46
|
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
47
|
+
transitionName?: string | undefined;
|
|
49
48
|
mouseEnterDelay?: number | undefined;
|
|
50
49
|
mouseLeaveDelay?: number | undefined;
|
|
51
50
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -53,6 +52,7 @@ export declare function getFormItemProps(props: any): {
|
|
|
53
52
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
54
53
|
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
55
54
|
popupVisible?: boolean | undefined;
|
|
55
|
+
forceRender?: boolean | undefined;
|
|
56
56
|
fresh?: boolean | undefined;
|
|
57
57
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
58
58
|
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
@@ -15,7 +15,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
15
15
|
showQuickJumper?: boolean | {
|
|
16
16
|
goButton?: import("react").ReactNode;
|
|
17
17
|
} | undefined;
|
|
18
|
-
size?: "
|
|
18
|
+
size?: "default" | "small" | undefined;
|
|
19
19
|
responsive?: boolean | undefined;
|
|
20
20
|
role?: string | undefined;
|
|
21
21
|
totalBoundaryShowSizeChanger?: number | undefined;
|
|
@@ -24,12 +24,12 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
24
24
|
selectComponentClass?: any;
|
|
25
25
|
pageSizeOptions?: (string | number)[] | undefined;
|
|
26
26
|
className?: string | undefined;
|
|
27
|
-
|
|
28
|
-
prefixCls?: string | undefined;
|
|
27
|
+
align?: "start" | "end" | "center" | undefined;
|
|
29
28
|
disabled?: boolean | undefined;
|
|
29
|
+
style?: import("react").CSSProperties | undefined;
|
|
30
30
|
"aria-activedescendant"?: string | undefined;
|
|
31
31
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
32
|
-
"aria-autocomplete"?: "
|
|
32
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
33
33
|
"aria-braillelabel"?: string | undefined;
|
|
34
34
|
"aria-brailleroledescription"?: string | undefined;
|
|
35
35
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -39,7 +39,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
39
39
|
"aria-colindextext"?: string | undefined;
|
|
40
40
|
"aria-colspan"?: number | undefined;
|
|
41
41
|
"aria-controls"?: string | undefined;
|
|
42
|
-
"aria-current"?: boolean | "
|
|
42
|
+
"aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
|
|
43
43
|
"aria-describedby"?: string | undefined;
|
|
44
44
|
"aria-description"?: string | undefined;
|
|
45
45
|
"aria-details"?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
49
49
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
50
50
|
"aria-flowto"?: string | undefined;
|
|
51
51
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
52
|
-
"aria-haspopup"?: boolean | "
|
|
52
|
+
"aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
|
|
53
53
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
54
54
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
55
55
|
"aria-keyshortcuts"?: string | undefined;
|
|
@@ -80,8 +80,8 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
80
80
|
"aria-valuemin"?: number | undefined;
|
|
81
81
|
"aria-valuenow"?: number | undefined;
|
|
82
82
|
"aria-valuetext"?: string | undefined;
|
|
83
|
+
prefixCls?: string | undefined;
|
|
83
84
|
locale?: import("rc-pagination").PaginationLocale | undefined;
|
|
84
|
-
align?: "center" | "start" | "end" | undefined;
|
|
85
85
|
prevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
86
86
|
nextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
87
87
|
selectPrefixCls?: string | undefined;
|
|
@@ -100,7 +100,7 @@ export declare function usePagination({ data, rows, column, pagination }: Pagina
|
|
|
100
100
|
onShowSizeChange?: ((current: number, size: number) => void) | undefined;
|
|
101
101
|
itemRender?: ((page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: import("react").ReactNode) => import("react").ReactNode) | undefined;
|
|
102
102
|
showTotal?: ((total: number, range: [number, number]) => import("react").ReactNode) | undefined;
|
|
103
|
-
justify?: "
|
|
103
|
+
justify?: "left" | "right" | "center" | "between" | undefined;
|
|
104
104
|
};
|
|
105
105
|
export type PaginationProps = TablePaginationConfig & Pick<HStackProps, 'justify'>;
|
|
106
106
|
export declare function Pagination({ justify, className, style, ...props }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
package/es/icon/hook/index.d.ts
CHANGED
|
@@ -7,18 +7,21 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
7
7
|
refs?: import("../../api").Refs | undefined;
|
|
8
8
|
string?: string | number | undefined;
|
|
9
9
|
width?: string | number | undefined;
|
|
10
|
-
mask?: string | undefined;
|
|
11
|
-
children?: import("react").ReactNode;
|
|
12
|
-
height?: string | number | undefined;
|
|
13
|
-
clipPath?: string | undefined;
|
|
14
|
-
filter?: string | undefined;
|
|
15
|
-
path?: string | undefined;
|
|
16
|
-
ref?: import("react").LegacyRef<SVGSVGElement> | undefined;
|
|
17
10
|
key?: import("react").Key | null | undefined;
|
|
18
|
-
|
|
11
|
+
type?: string | undefined;
|
|
19
12
|
onChange?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
20
|
-
|
|
13
|
+
onSelect?: import("react").ReactEventHandler<SVGSVGElement> | undefined;
|
|
14
|
+
end?: string | number | undefined;
|
|
15
|
+
ref?: import("react").LegacyRef<SVGSVGElement> | undefined;
|
|
16
|
+
rotate?: string | number | undefined;
|
|
17
|
+
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
18
|
+
height?: string | number | undefined;
|
|
19
|
+
href?: string | undefined;
|
|
20
|
+
max?: string | number | undefined;
|
|
21
|
+
media?: string | undefined;
|
|
21
22
|
method?: string | undefined;
|
|
23
|
+
min?: string | number | undefined;
|
|
24
|
+
name?: string | undefined;
|
|
22
25
|
target?: string | undefined;
|
|
23
26
|
suppressHydrationWarning?: boolean | undefined;
|
|
24
27
|
id?: string | undefined;
|
|
@@ -27,7 +30,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
27
30
|
role?: import("react").AriaRole | undefined;
|
|
28
31
|
"aria-activedescendant"?: string | undefined;
|
|
29
32
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
30
|
-
"aria-autocomplete"?: "
|
|
33
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
31
34
|
"aria-braillelabel"?: string | undefined;
|
|
32
35
|
"aria-brailleroledescription"?: string | undefined;
|
|
33
36
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -37,7 +40,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
37
40
|
"aria-colindextext"?: string | undefined;
|
|
38
41
|
"aria-colspan"?: number | undefined;
|
|
39
42
|
"aria-controls"?: string | undefined;
|
|
40
|
-
"aria-current"?: boolean | "
|
|
43
|
+
"aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
|
|
41
44
|
"aria-describedby"?: string | undefined;
|
|
42
45
|
"aria-description"?: string | undefined;
|
|
43
46
|
"aria-details"?: string | undefined;
|
|
@@ -47,7 +50,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
47
50
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
48
51
|
"aria-flowto"?: string | undefined;
|
|
49
52
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
50
|
-
"aria-haspopup"?: boolean | "
|
|
53
|
+
"aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
|
|
51
54
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
52
55
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
53
56
|
"aria-keyshortcuts"?: string | undefined;
|
|
@@ -78,6 +81,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
78
81
|
"aria-valuemin"?: number | undefined;
|
|
79
82
|
"aria-valuenow"?: number | undefined;
|
|
80
83
|
"aria-valuetext"?: string | undefined;
|
|
84
|
+
children?: import("react").ReactNode;
|
|
81
85
|
dangerouslySetInnerHTML?: {
|
|
82
86
|
__html: string | TrustedHTML;
|
|
83
87
|
} | undefined;
|
|
@@ -104,6 +108,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
104
108
|
onInputCapture?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
105
109
|
onReset?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
106
110
|
onResetCapture?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
111
|
+
onSubmit?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
107
112
|
onSubmitCapture?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
108
113
|
onInvalid?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
109
114
|
onInvalidCapture?: import("react").FormEventHandler<SVGSVGElement> | undefined;
|
|
@@ -197,7 +202,6 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
197
202
|
onMouseOverCapture?: import("react").MouseEventHandler<SVGSVGElement> | undefined;
|
|
198
203
|
onMouseUp?: import("react").MouseEventHandler<SVGSVGElement> | undefined;
|
|
199
204
|
onMouseUpCapture?: import("react").MouseEventHandler<SVGSVGElement> | undefined;
|
|
200
|
-
onSelect?: import("react").ReactEventHandler<SVGSVGElement> | undefined;
|
|
201
205
|
onSelectCapture?: import("react").ReactEventHandler<SVGSVGElement> | undefined;
|
|
202
206
|
onTouchCancel?: import("react").TouchEventHandler<SVGSVGElement> | undefined;
|
|
203
207
|
onTouchCancelCapture?: import("react").TouchEventHandler<SVGSVGElement> | undefined;
|
|
@@ -238,17 +242,12 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
238
242
|
onTransitionEnd?: import("react").TransitionEventHandler<SVGSVGElement> | undefined;
|
|
239
243
|
onTransitionEndCapture?: import("react").TransitionEventHandler<SVGSVGElement> | undefined;
|
|
240
244
|
direction?: string | number | undefined;
|
|
241
|
-
|
|
242
|
-
end?: string | number | undefined;
|
|
245
|
+
filter?: string | undefined;
|
|
243
246
|
fill?: string | undefined;
|
|
244
247
|
values?: string | undefined;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
media?: string | undefined;
|
|
249
|
-
min?: string | number | undefined;
|
|
250
|
-
result?: string | undefined;
|
|
251
|
-
transform?: string | undefined;
|
|
248
|
+
clipPath?: string | undefined;
|
|
249
|
+
mask?: string | undefined;
|
|
250
|
+
path?: string | undefined;
|
|
252
251
|
origin?: string | number | undefined;
|
|
253
252
|
cursor?: string | number | undefined;
|
|
254
253
|
display?: string | number | undefined;
|
|
@@ -264,9 +263,9 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
264
263
|
order?: string | number | undefined;
|
|
265
264
|
paintOrder?: string | number | undefined;
|
|
266
265
|
pointerEvents?: string | number | undefined;
|
|
267
|
-
rotate?: string | number | undefined;
|
|
268
266
|
scale?: string | number | undefined;
|
|
269
267
|
textRendering?: string | number | undefined;
|
|
268
|
+
transform?: string | undefined;
|
|
270
269
|
transformOrigin?: string | undefined;
|
|
271
270
|
unicodeBidi?: string | number | undefined;
|
|
272
271
|
visibility?: string | number | undefined;
|
|
@@ -277,7 +276,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
277
276
|
textDecoration?: string | number | undefined;
|
|
278
277
|
azimuth?: string | number | undefined;
|
|
279
278
|
clip?: string | number | undefined;
|
|
280
|
-
alignmentBaseline?: "
|
|
279
|
+
alignmentBaseline?: "inherit" | "middle" | "auto" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "baseline" | "before-edge" | "text-before-edge" | "central" | "after-edge" | "text-after-edge" | undefined;
|
|
281
280
|
baselineShift?: string | number | undefined;
|
|
282
281
|
clipRule?: string | number | undefined;
|
|
283
282
|
colorInterpolation?: string | number | undefined;
|
|
@@ -314,6 +313,7 @@ export declare function useIcon(props: IconProps, defaultColors: Record<string,
|
|
|
314
313
|
local?: string | number | undefined;
|
|
315
314
|
in?: string | undefined;
|
|
316
315
|
from?: string | number | undefined;
|
|
316
|
+
result?: string | undefined;
|
|
317
317
|
orientation?: string | number | undefined;
|
|
318
318
|
requiredExtensions?: string | number | undefined;
|
|
319
319
|
systemLanguage?: string | number | undefined;
|
|
@@ -36,14 +36,13 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
36
36
|
defaultVisible?: boolean | undefined;
|
|
37
37
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
38
38
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
40
|
+
id?: string | undefined;
|
|
41
41
|
prefixCls?: string | undefined;
|
|
42
42
|
zIndex?: number | undefined;
|
|
43
|
-
|
|
44
|
-
id?: string | undefined;
|
|
45
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
43
|
+
animation?: string | undefined;
|
|
46
44
|
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
45
|
+
transitionName?: string | undefined;
|
|
47
46
|
mouseEnterDelay?: number | undefined;
|
|
48
47
|
mouseLeaveDelay?: number | undefined;
|
|
49
48
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -51,6 +50,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
51
50
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
52
51
|
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
53
52
|
popupVisible?: boolean | undefined;
|
|
53
|
+
forceRender?: boolean | undefined;
|
|
54
54
|
fresh?: boolean | undefined;
|
|
55
55
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
56
56
|
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
@@ -65,48 +65,49 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
65
65
|
value?: any;
|
|
66
66
|
boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
67
67
|
inGroup?: boolean | undefined;
|
|
68
|
-
className?: string | undefined;
|
|
69
|
-
style?: import("react").CSSProperties | undefined;
|
|
70
68
|
title?: string | undefined;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
className?: string | undefined;
|
|
70
|
+
type?: string | undefined;
|
|
71
|
+
checked?: boolean | undefined;
|
|
74
72
|
disabled?: boolean | undefined;
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
required?: boolean | undefined;
|
|
75
75
|
defaultChecked?: boolean | undefined;
|
|
76
76
|
autoFocus?: boolean | undefined;
|
|
77
77
|
id?: string | undefined;
|
|
78
|
+
style?: import("react").CSSProperties | undefined;
|
|
78
79
|
tabIndex?: number | undefined;
|
|
79
80
|
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
80
81
|
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
81
82
|
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
82
83
|
onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
83
84
|
onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
prefixCls?: string | undefined;
|
|
86
|
+
rootClassName?: string | undefined;
|
|
86
87
|
indeterminate?: boolean | undefined;
|
|
87
88
|
skipGroup?: boolean | undefined;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
content?: string | undefined;
|
|
92
|
-
onSubmit?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
89
|
+
hidden?: boolean | undefined;
|
|
90
|
+
onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
91
|
+
rows?: number | false | undefined;
|
|
93
92
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
94
93
|
suppressContentEditableWarning?: boolean | undefined;
|
|
95
94
|
suppressHydrationWarning?: boolean | undefined;
|
|
96
95
|
accessKey?: string | undefined;
|
|
97
96
|
autoCapitalize?: (string & {}) | "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
98
|
-
contentEditable?: (boolean | "true" | "false") | "
|
|
97
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
99
98
|
contextMenu?: string | undefined;
|
|
99
|
+
dir?: string | undefined;
|
|
100
100
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
101
101
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
102
|
-
hidden?: boolean | undefined;
|
|
103
102
|
lang?: string | undefined;
|
|
104
103
|
nonce?: string | undefined;
|
|
104
|
+
slot?: string | undefined;
|
|
105
105
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
106
106
|
translate?: "yes" | "no" | undefined;
|
|
107
107
|
radioGroup?: string | undefined;
|
|
108
108
|
role?: import("react").AriaRole | undefined;
|
|
109
109
|
about?: string | undefined;
|
|
110
|
+
content?: string | undefined;
|
|
110
111
|
datatype?: string | undefined;
|
|
111
112
|
inlist?: any;
|
|
112
113
|
prefix?: string | undefined;
|
|
@@ -133,7 +134,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
133
134
|
part?: string | undefined;
|
|
134
135
|
"aria-activedescendant"?: string | undefined;
|
|
135
136
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
136
|
-
"aria-autocomplete"?: "
|
|
137
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
137
138
|
"aria-braillelabel"?: string | undefined;
|
|
138
139
|
"aria-brailleroledescription"?: string | undefined;
|
|
139
140
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -143,7 +144,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
143
144
|
"aria-colindextext"?: string | undefined;
|
|
144
145
|
"aria-colspan"?: number | undefined;
|
|
145
146
|
"aria-controls"?: string | undefined;
|
|
146
|
-
"aria-current"?: boolean | "
|
|
147
|
+
"aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
|
|
147
148
|
"aria-describedby"?: string | undefined;
|
|
148
149
|
"aria-description"?: string | undefined;
|
|
149
150
|
"aria-details"?: string | undefined;
|
|
@@ -153,7 +154,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
153
154
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
154
155
|
"aria-flowto"?: string | undefined;
|
|
155
156
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
156
|
-
"aria-haspopup"?: boolean | "
|
|
157
|
+
"aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
|
|
157
158
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
158
159
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
159
160
|
"aria-keyshortcuts"?: string | undefined;
|
|
@@ -208,6 +209,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
208
209
|
onInputCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
209
210
|
onReset?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
210
211
|
onResetCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
212
|
+
onSubmit?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
211
213
|
onSubmitCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
212
214
|
onInvalid?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
213
215
|
onInvalidCapture?: import("react").FormEventHandler<HTMLElement> | undefined;
|
|
@@ -296,7 +298,6 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
296
298
|
onMouseOverCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
297
299
|
onMouseUp?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
298
300
|
onMouseUpCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
299
|
-
onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
300
301
|
onSelectCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
301
302
|
onTouchCancel?: import("react").TouchEventHandler<HTMLElement> | undefined;
|
|
302
303
|
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
|
|
@@ -337,7 +338,6 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
337
338
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
338
339
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
339
340
|
direction?: import("antd/es/config-provider").DirectionType;
|
|
340
|
-
rows?: number | false | undefined;
|
|
341
341
|
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
342
342
|
autoShowTooltip?: boolean | undefined;
|
|
343
343
|
refs?: import("../../api").Refs | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
5
|
+
function BaseComponent(_ref) {
|
|
6
|
+
var column = _ref.column,
|
|
7
|
+
children = _ref.children;
|
|
8
|
+
var timeFormat = column.timeFormat;
|
|
9
|
+
return _jsx(_Fragment, {
|
|
10
|
+
children: dayjs(children).format(timeFormat)
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function mergerTimeFormat(props, timeFormat) {
|
|
14
|
+
return _.merge({
|
|
15
|
+
column: {
|
|
16
|
+
timeFormat: timeFormat
|
|
17
|
+
}
|
|
18
|
+
}, props);
|
|
19
|
+
}
|
|
20
|
+
export function Date(props) {
|
|
21
|
+
var params = mergerTimeFormat(props, 'YYYY-MM-DD');
|
|
22
|
+
return _jsx(BaseComponent, _objectSpread({}, params));
|
|
23
|
+
}
|
|
24
|
+
export function DateTime(props) {
|
|
25
|
+
var params = mergerTimeFormat(props, 'YYYY-MM-DD hh:mm:ss');
|
|
26
|
+
return _jsx(BaseComponent, _objectSpread({}, params));
|
|
27
|
+
}
|
|
@@ -38,7 +38,7 @@ function filter(column, search, record) {
|
|
|
38
38
|
var _column$dataIndex = column.dataIndex,
|
|
39
39
|
dataIndex = _column$dataIndex === void 0 ? '' : _column$dataIndex,
|
|
40
40
|
filterBy = column.filterBy;
|
|
41
|
-
var current = record
|
|
41
|
+
var current = _.get(record, dataIndex);
|
|
42
42
|
if (_.isFunction(filterBy)) {
|
|
43
43
|
return filterBy({
|
|
44
44
|
record: record,
|
|
@@ -106,10 +106,12 @@ function useInit(_ref2) {
|
|
|
106
106
|
editorValueKey: editorValueKey
|
|
107
107
|
});
|
|
108
108
|
function updateSelectedStatus(keys) {
|
|
109
|
-
_.
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
var data = _.map(dataSource, function (item) {
|
|
110
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
111
|
+
__selected__: includesNonStrictMode(keys, item[rowKey])
|
|
112
|
+
});
|
|
112
113
|
});
|
|
114
|
+
setDataSource(data);
|
|
113
115
|
}
|
|
114
116
|
function refresh() {
|
|
115
117
|
return _refresh.apply(this, arguments);
|
|
@@ -3,15 +3,16 @@ import type { ColumnType } from 'antd/es/table';
|
|
|
3
3
|
import type { TableRowSelection } from 'antd/es/table/interface';
|
|
4
4
|
import { Column, DataSource, GetSearchColumn, TableContext, TableProps } from '../type';
|
|
5
5
|
import { Actions } from './actions';
|
|
6
|
+
import { Date, DateTime } from './date-time';
|
|
6
7
|
import { Editor } from './editor';
|
|
7
8
|
import { Link } from './link';
|
|
8
9
|
import { Switch } from './switch';
|
|
9
|
-
import { Time } from './time';
|
|
10
10
|
interface GenerateColumnsProps extends TableProps {
|
|
11
11
|
getSearchColumn: GetSearchColumn;
|
|
12
12
|
}
|
|
13
13
|
export declare const componentMap: {
|
|
14
|
-
|
|
14
|
+
date: typeof Date;
|
|
15
|
+
dateTime: typeof DateTime;
|
|
15
16
|
link: typeof Link;
|
|
16
17
|
switch: typeof Switch;
|
|
17
18
|
actions: typeof Actions;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
var _excluded = ["type", "disabled", "onClick"];
|
|
4
|
+
var _excluded = ["type", "disabled", "onClick", "fixed", "width"];
|
|
5
5
|
import { executeFunction } from "../../api";
|
|
6
|
+
import { transformNameToPath } from "../../form/component/utils";
|
|
6
7
|
import _ from 'lodash';
|
|
7
8
|
import { Actions } from "./actions";
|
|
8
9
|
import { formPropsKeysInTable } from "./constant";
|
|
10
|
+
import { Date, DateTime } from "./date-time";
|
|
9
11
|
import { Editor } from "./editor";
|
|
10
12
|
import { getFilterColumn } from "./filter";
|
|
11
13
|
import { Link } from "./link";
|
|
12
14
|
import { getSortColumn } from "./sort";
|
|
13
15
|
import { Switch } from "./switch";
|
|
14
|
-
import { Time } from "./time";
|
|
15
16
|
import { Wrapper } from "./wrapper";
|
|
16
17
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
18
|
export var componentMap = {
|
|
18
|
-
|
|
19
|
+
date: Date,
|
|
20
|
+
dateTime: DateTime,
|
|
19
21
|
link: Link,
|
|
20
22
|
switch: Switch,
|
|
21
23
|
actions: Actions,
|
|
@@ -30,10 +32,13 @@ export function generateColumns(_ref) {
|
|
|
30
32
|
getSearchColumn = _ref.getSearchColumn;
|
|
31
33
|
return _.map(columns, function (column) {
|
|
32
34
|
var newColumn = _.clone(column);
|
|
33
|
-
var
|
|
35
|
+
var dataIndex = newColumn.dataIndex,
|
|
36
|
+
search = newColumn.search,
|
|
34
37
|
sort = newColumn.sort,
|
|
35
38
|
filters = newColumn.filters,
|
|
36
|
-
originRender = newColumn.render
|
|
39
|
+
originRender = newColumn.render,
|
|
40
|
+
_newColumn$align = newColumn.align,
|
|
41
|
+
align = _newColumn$align === void 0 ? 'center' : _newColumn$align;
|
|
37
42
|
_.assign(newColumn, getColumnWidth(newColumn));
|
|
38
43
|
if (search) {
|
|
39
44
|
_.assign(newColumn, getSearchColumn(column));
|
|
@@ -78,6 +83,8 @@ export function generateColumns(_ref) {
|
|
|
78
83
|
return component;
|
|
79
84
|
};
|
|
80
85
|
return _objectSpread(_objectSpread({}, newColumn), {}, {
|
|
86
|
+
dataIndex: transformNameToPath(dataIndex),
|
|
87
|
+
align: align,
|
|
81
88
|
render: render
|
|
82
89
|
});
|
|
83
90
|
});
|
|
@@ -140,8 +147,13 @@ export function getRowSelection(_ref3) {
|
|
|
140
147
|
var type = column.type,
|
|
141
148
|
disabled = column.disabled,
|
|
142
149
|
onClick = column.onClick,
|
|
150
|
+
_column$fixed = column.fixed,
|
|
151
|
+
fixed = _column$fixed === void 0 ? 'left' : _column$fixed,
|
|
152
|
+
width = column.width,
|
|
143
153
|
rest = _objectWithoutProperties(column, _excluded);
|
|
144
154
|
return _objectSpread({
|
|
155
|
+
fixed: fixed,
|
|
156
|
+
columnWidth: width,
|
|
145
157
|
selectedRowKeys: selectedRowKeys,
|
|
146
158
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
147
159
|
return {
|
|
@@ -209,7 +221,7 @@ export function getTableFormInitialValues(_ref5) {
|
|
|
209
221
|
return;
|
|
210
222
|
}
|
|
211
223
|
return _.map(dataSource, function (item) {
|
|
212
|
-
return _.pick(item, [rowKey].concat(_toConsumableArray(keys)));
|
|
224
|
+
return _.pick(item, [rowKey, '__selected__'].concat(_toConsumableArray(keys)));
|
|
213
225
|
});
|
|
214
226
|
}
|
|
215
227
|
export function updateDataSourceByFormValues(formValues, dataSource) {
|
|
@@ -7,16 +7,16 @@ export declare function generateTabItems({ items }: TabsProps): {
|
|
|
7
7
|
label: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
8
|
key: string;
|
|
9
9
|
className?: string | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
id?: string | undefined;
|
|
10
12
|
style?: import("react").CSSProperties | undefined;
|
|
11
13
|
children?: import("react").ReactNode;
|
|
12
|
-
closable?: boolean | undefined;
|
|
13
14
|
prefixCls?: string | undefined;
|
|
15
|
+
closable?: boolean | undefined;
|
|
14
16
|
closeIcon?: import("react").ReactNode;
|
|
15
|
-
forceRender?: boolean | undefined;
|
|
16
|
-
disabled?: boolean | undefined;
|
|
17
|
-
id?: string | undefined;
|
|
18
17
|
active?: boolean | undefined;
|
|
19
18
|
icon?: import("react").ReactNode;
|
|
19
|
+
forceRender?: boolean | undefined;
|
|
20
20
|
destroyInactiveTabPane?: boolean | undefined;
|
|
21
21
|
animated?: boolean | undefined;
|
|
22
22
|
tabKey?: string | undefined;
|
|
@@ -34,14 +34,13 @@ export declare function getTooltipProps(props: TooltipProps): {
|
|
|
34
34
|
defaultVisible?: boolean | undefined;
|
|
35
35
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
36
36
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
38
|
+
id?: string | undefined;
|
|
39
39
|
prefixCls?: string | undefined;
|
|
40
40
|
zIndex?: number | undefined;
|
|
41
|
-
|
|
42
|
-
id?: string | undefined;
|
|
43
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
41
|
+
animation?: string | undefined;
|
|
44
42
|
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
43
|
+
transitionName?: string | undefined;
|
|
45
44
|
mouseEnterDelay?: number | undefined;
|
|
46
45
|
mouseLeaveDelay?: number | undefined;
|
|
47
46
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
@@ -49,6 +48,7 @@ export declare function getTooltipProps(props: TooltipProps): {
|
|
|
49
48
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
50
49
|
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
51
50
|
popupVisible?: boolean | undefined;
|
|
51
|
+
forceRender?: boolean | undefined;
|
|
52
52
|
fresh?: boolean | undefined;
|
|
53
53
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
54
54
|
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function sorter(a
|
|
1
|
+
export declare function sorter(a?: any, b?: any): any;
|
|
2
2
|
export declare function sortBy(data: any[] | undefined, key: string): any[];
|
|
@@ -7,22 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.sortBy = sortBy;
|
|
8
8
|
exports.sorter = sorter;
|
|
9
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
-
function sorter(
|
|
10
|
+
function sorter() {
|
|
11
|
+
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
12
|
+
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
11
13
|
if (_lodash.default.isNumber(a)) {
|
|
12
14
|
return a - b;
|
|
13
15
|
}
|
|
14
|
-
if (_lodash.default.isNil(a) && _lodash.default.isNil(b)) {
|
|
15
|
-
return 0;
|
|
16
|
-
}
|
|
17
|
-
if (_lodash.default.isNil(a)) {
|
|
18
|
-
return -1;
|
|
19
|
-
}
|
|
20
16
|
return a.localeCompare(b);
|
|
21
17
|
}
|
|
22
18
|
function sortBy() {
|
|
23
19
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
24
20
|
var key = arguments.length > 1 ? arguments[1] : undefined;
|
|
25
21
|
return data.sort(function (a, b) {
|
|
26
|
-
return sorter(a
|
|
22
|
+
return sorter(_lodash.default.get(a, key), _lodash.default.get(b, key));
|
|
27
23
|
});
|
|
28
24
|
}
|