@pinnacle0/web-ui 0.3.24 → 0.3.25
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/admin/AdminApp/Menu.d.ts +1 -1
- package/admin/AdminApp/Navigator.d.ts +1 -1
- package/core/Card.d.ts +1 -1
- package/core/Checkbox/index.d.ts +1 -1
- package/core/Collapse.d.ts +1 -1
- package/core/DarkOverlay/index.d.ts +1 -1
- package/core/FlatList/VirtualFlatList/Item.d.ts +6 -6
- package/core/FlatList/VirtualFlatList/Item.js +4 -10
- package/core/FlatList/VirtualFlatList/Item.js.map +1 -1
- package/core/FlatList/VirtualFlatList/index.d.ts +2 -1
- package/core/FlatList/VirtualFlatList/index.js +25 -6
- package/core/FlatList/VirtualFlatList/index.js.map +1 -1
- package/core/FlatList/index.d.ts +1 -0
- package/core/FlatList/index.js +3 -2
- package/core/FlatList/index.js.map +1 -1
- package/core/FlatList/shared/Footer/index.d.ts +2 -1
- package/core/FlatList/shared/GetRowKey.d.ts +2 -0
- package/core/FlatList/shared/GetRowKey.js +12 -0
- package/core/FlatList/shared/GetRowKey.js.map +1 -0
- package/core/FlatList/shared/Spinner/index.d.ts +1 -0
- package/core/FlatList/shared/Wrapper/Loading.d.ts +1 -0
- package/core/FlatList/type.d.ts +3 -0
- package/core/Grid.d.ts +1 -0
- package/core/Input/index.d.ts +1 -1
- package/core/Radio/index.d.ts +2 -2
- package/core/VirtualTable/TableRow.d.ts +1 -0
- package/core/VirtualTable/index.d.ts +1 -0
- package/package.json +1 -1
package/admin/AdminApp/Menu.d.ts
CHANGED
|
@@ -40,5 +40,5 @@ declare class RouterAwareMenu extends React.PureComponent<Props, State> {
|
|
|
40
40
|
renderMenuGroup: (groupItem: NavigationGroupItem<any, any>) => JSX.Element;
|
|
41
41
|
render(): JSX.Element;
|
|
42
42
|
}
|
|
43
|
-
export declare const Menu:
|
|
43
|
+
export declare const Menu: React.ComponentClass<Pick<Props, "siteName" | "navigationService" | "menuExpanded" | "badges">, any> & import("react-router").WithRouterStatics<typeof RouterAwareMenu>;
|
|
44
44
|
export {};
|
|
@@ -26,5 +26,5 @@ declare class RouterAwareNavigator extends React.PureComponent<Props, State> {
|
|
|
26
26
|
onTabChange: (url: string) => void;
|
|
27
27
|
render(): JSX.Element;
|
|
28
28
|
}
|
|
29
|
-
export declare const Navigator:
|
|
29
|
+
export declare const Navigator: React.ComponentClass<Pick<Props, "navigationService">, any> & import("react-router").WithRouterStatics<typeof RouterAwareNavigator>;
|
|
30
30
|
export {};
|
package/core/Card.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export interface Props extends CardProps {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class Card extends React.PureComponent<Props> {
|
|
7
7
|
static displayName: string;
|
|
8
|
-
static Grid:
|
|
8
|
+
static Grid: React.FC<import("antd/lib/card").CardGridProps>;
|
|
9
9
|
render(): JSX.Element;
|
|
10
10
|
}
|
package/core/Checkbox/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface Props extends Omit<CheckboxProps, "value" | "onChange" | "check
|
|
|
8
8
|
}
|
|
9
9
|
export declare class Checkbox extends React.PureComponent<Props> {
|
|
10
10
|
static displayName: string;
|
|
11
|
-
static Group:
|
|
11
|
+
static Group: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd/lib/checkbox").CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>>;
|
|
12
12
|
onChange: (e: CheckboxChangeEvent) => void;
|
|
13
13
|
render(): JSX.Element;
|
|
14
14
|
}
|
package/core/Collapse.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface Props extends CollapseProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class Collapse extends React.PureComponent<Props> {
|
|
8
8
|
static displayName: string;
|
|
9
|
-
static Panel:
|
|
9
|
+
static Panel: React.FC<CollapsePanelProps>;
|
|
10
10
|
render(): JSX.Element;
|
|
11
11
|
}
|
|
12
12
|
export declare type PanelProps = CollapsePanelProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VirtualItem } from "react-virtual";
|
|
3
|
+
import type { ItemRenderer } from "./type";
|
|
3
4
|
export interface Gap {
|
|
4
5
|
top?: number;
|
|
5
6
|
bottom?: number;
|
|
@@ -7,10 +8,9 @@ export interface Gap {
|
|
|
7
8
|
right?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface ListItemProps<T> {
|
|
10
|
-
|
|
11
|
-
data:
|
|
12
|
-
|
|
13
|
-
itemRenderer: ItemRenderer<T>;
|
|
11
|
+
virtualItem: VirtualItem;
|
|
12
|
+
data: T;
|
|
13
|
+
renderItem: ItemRenderer<T>;
|
|
14
14
|
gap?: Gap;
|
|
15
15
|
}
|
|
16
16
|
export declare const Item: <T>(props: ListItemProps<T>) => JSX.Element;
|
|
@@ -10,17 +10,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from "react";
|
|
13
|
-
import { Footer } from "../shared/Footer";
|
|
14
13
|
export var Item = function (props) {
|
|
15
|
-
var data = props.data,
|
|
14
|
+
var data = props.data, virtualItem = props.virtualItem, gap = props.gap, ItemRenderer = props.renderItem;
|
|
16
15
|
var padding = React.useMemo(function () { return (gap ? { paddingLeft: gap.left, paddingRight: gap.right, paddingBottom: gap.bottom, paddingTop: gap.top } : {}); }, [gap]);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return (React.createElement("div", { className: "g-virtual-flat-list-item", style: __assign({}, padding) },
|
|
23
|
-
React.createElement(ItemRenderer, { data: data[index], index: index, measure: measure })));
|
|
24
|
-
}
|
|
16
|
+
return (React.createElement("div", { className: "g-virtual-flat-list-item-wrapper", style: { transform: "translateY(".concat(virtualItem.start, "px)") }, ref: virtualItem.measureRef },
|
|
17
|
+
React.createElement("div", { className: "g-virtual-flat-list-item", style: __assign({}, padding) },
|
|
18
|
+
React.createElement(ItemRenderer, { data: data, index: virtualItem.index, measure: virtualItem.measureRef }))));
|
|
25
19
|
};
|
|
26
20
|
//# sourceMappingURL=Item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/core/FlatList/VirtualFlatList/Item.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/core/FlatList/VirtualFlatList/Item.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,MAAM,CAAC,IAAM,IAAI,GAAG,UAAa,KAAuB;IAC7C,IAAA,IAAI,GAAgD,KAAK,KAArD,EAAE,WAAW,GAAmC,KAAK,YAAxC,EAAE,GAAG,GAA8B,KAAK,IAAnC,EAAc,YAAY,GAAI,KAAK,WAAT,CAAU;IAEjE,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,cAA2B,OAAA,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,GAAG,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAA7G,CAA6G,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/K,OAAO,CACH,6BAAK,SAAS,EAAC,kCAAkC,EAAC,KAAK,EAAE,EAAC,SAAS,EAAE,qBAAc,WAAW,CAAC,KAAK,QAAK,EAAC,EAAE,GAAG,EAAE,WAAW,CAAC,UAAU;QACnI,6BAAK,SAAS,EAAC,0BAA0B,EAAC,KAAK,eAAM,OAAO;YACxD,oBAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,UAAU,GAAI,CACrF,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { VirtualFlatListProps } from "./type";
|
|
3
|
+
import "./index.less";
|
|
3
4
|
/**
|
|
4
5
|
* VirtualizedFlatList currently only work with item without and size related animation and transition since it break the layout. This will be improve in the future
|
|
5
6
|
*/
|
|
@@ -25,23 +25,35 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
25
25
|
};
|
|
26
26
|
import React from "react";
|
|
27
27
|
import { defaultRangeExtractor, useVirtual } from "react-virtual";
|
|
28
|
+
import { classNames } from "../../../util/ClassNames";
|
|
29
|
+
import { useLoadingWithDelay } from "../shared/hooks/useLoadingWithDelay";
|
|
28
30
|
import { Wrapper } from "../shared/Wrapper";
|
|
31
|
+
import { Footer } from "../shared/Footer";
|
|
32
|
+
import { GetRowKey } from "../shared/GetRowKey";
|
|
29
33
|
import { Item } from "./Item";
|
|
30
34
|
import "./index.less";
|
|
31
|
-
import { useLoadingWithDelay } from "../shared/hooks/useLoadingWithDelay";
|
|
32
|
-
import { classNames } from "../../../util/ClassNames";
|
|
33
35
|
/**
|
|
34
36
|
* VirtualizedFlatList currently only work with item without and size related animation and transition since it break the layout. This will be improve in the future
|
|
35
37
|
*/
|
|
36
38
|
export var VirtualFlatList = function (props) {
|
|
37
|
-
var data = props.data, renderItem = props.renderItem, loading = props.loading, _a = props.bounceEffect, bounceEffect = _a === void 0 ? true : _a, className = props.className, style = props.style, onPullDownRefresh = props.onPullDownRefresh, onPullUpLoading = props.onPullUpLoading, emptyPlaceholder = props.emptyPlaceholder, contentStyle = props.contentStyle, gap = props.gap, _b = props.autoLoad, autoLoad = _b === void 0 ? true : _b, _c = props.overscan, overscan = _c === void 0 ? 3 : _c, hideFooter = props.hideFooter, estimateSize = props.estimateSize, listRef = props.listRef, pullUpLoadingMessage = props.pullUpLoadingMessage, endOfListMessage = props.endOfListMessage, pullDownRefreshMessage = props.pullDownRefreshMessage;
|
|
39
|
+
var data = props.data, renderItem = props.renderItem, rowKey = props.rowKey, loading = props.loading, _a = props.bounceEffect, bounceEffect = _a === void 0 ? true : _a, className = props.className, style = props.style, onPullDownRefresh = props.onPullDownRefresh, onPullUpLoading = props.onPullUpLoading, emptyPlaceholder = props.emptyPlaceholder, contentStyle = props.contentStyle, gap = props.gap, _b = props.autoLoad, autoLoad = _b === void 0 ? true : _b, _c = props.overscan, overscan = _c === void 0 ? 3 : _c, hideFooter = props.hideFooter, estimateSize = props.estimateSize, listRef = props.listRef, pullUpLoadingMessage = props.pullUpLoadingMessage, endOfListMessage = props.endOfListMessage, pullDownRefreshMessage = props.pullDownRefreshMessage;
|
|
38
40
|
var listWrapperRef = React.useRef(null);
|
|
39
41
|
var _d = __read(React.useState(null), 2), loadingType = _d[0], setLoadingType = _d[1];
|
|
40
42
|
var currentRangeRef = React.useRef();
|
|
41
43
|
var previousRangeRef = React.useRef();
|
|
42
44
|
var loadingWithDelay = useLoadingWithDelay(loading !== null && loading !== void 0 ? loading : false, 300);
|
|
43
45
|
var listData = React.useMemo(function () {
|
|
44
|
-
return hideFooter
|
|
46
|
+
return hideFooter
|
|
47
|
+
? data
|
|
48
|
+
: __spreadArray(__spreadArray([], __read(data), false), [
|
|
49
|
+
{
|
|
50
|
+
loading: loadingWithDelay && loadingType === "loading",
|
|
51
|
+
ended: !onPullUpLoading,
|
|
52
|
+
endMessage: endOfListMessage,
|
|
53
|
+
loadingMessage: pullUpLoadingMessage,
|
|
54
|
+
__markedAsFooterData: true,
|
|
55
|
+
},
|
|
56
|
+
], false);
|
|
45
57
|
}, [loadingWithDelay, loadingType, endOfListMessage, onPullUpLoading, pullUpLoadingMessage, data, hideFooter]);
|
|
46
58
|
var rangeExtractor = React.useCallback(function (range) {
|
|
47
59
|
var _a;
|
|
@@ -84,8 +96,15 @@ export var VirtualFlatList = function (props) {
|
|
|
84
96
|
};
|
|
85
97
|
// TODO/Alvis loading more when item can not fill the whole viewport
|
|
86
98
|
return (React.createElement(Wrapper, { className: classNames("g-virtual-flat-list", className), bounceEffect: bounceEffect, listWrapperRef: listWrapperRef, loadingType: loadingType, onLoadingTypeChange: setLoadingType, loading: loadingWithDelay, onPullDownRefresh: onPullDownRefresh, onPullUpLoading: onPullUpLoading, innerStyle: contentStyle, style: style, pullDownRefreshMessage: pullDownRefreshMessage, onScroll: onAutoLoad }, data.length === 0 ? (emptyPlaceholder) : (React.createElement("div", { className: "list", style: { height: rowVirtualizer.totalSize } }, rowVirtualizer.virtualItems.map(function (virtualItem) {
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
var _a;
|
|
100
|
+
var data = listData[virtualItem.index];
|
|
101
|
+
if (((_a = listData[virtualItem.index]) === null || _a === void 0 ? void 0 : _a["__markedAsFooterData"]) === true) {
|
|
102
|
+
var _b = data, loading_1 = _b.loading, loadingMessage = _b.loadingMessage, endMessage = _b.endMessage, ended = _b.ended;
|
|
103
|
+
return React.createElement(Footer, { key: virtualItem.index, loading: loading_1, ended: ended, loadingMessage: loadingMessage, endMessage: endMessage, measure: virtualItem.measureRef });
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return React.createElement(Item, { key: GetRowKey(rowKey, data, virtualItem.index), virtualItem: virtualItem, data: data, gap: gap, renderItem: renderItem });
|
|
107
|
+
}
|
|
89
108
|
})))));
|
|
90
109
|
};
|
|
91
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/VirtualFlatList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,qBAAqB,EAAE,UAAU,EAAC,MAAM,eAAe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EAAE,IAAS,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;SACtJ;IACL,CAAC,CAAC,CACA,CACT,CACK,CACb,CAAC;AACN,CAAC,CAAC"}
|
package/core/FlatList/index.d.ts
CHANGED
package/core/FlatList/index.js
CHANGED
|
@@ -19,8 +19,9 @@ import { Wrapper } from "./shared/Wrapper";
|
|
|
19
19
|
import { Footer } from "./shared/Footer";
|
|
20
20
|
import { useLoadingWithDelay } from "./shared/hooks/useLoadingWithDelay";
|
|
21
21
|
import { classNames } from "../../util/ClassNames";
|
|
22
|
+
import { GetRowKey } from "./shared/GetRowKey";
|
|
22
23
|
export var FlatList = function (props) {
|
|
23
|
-
var data = props.data, ItemRenderer = props.renderItem, loading = props.loading, _a = props.bounceEffect, bounceEffect = _a === void 0 ? true : _a, className = props.className, style = props.style, onPullDownRefresh = props.onPullDownRefresh, onPullUpLoading = props.onPullUpLoading, pullDownRefreshMessage = props.pullDownRefreshMessage, pullUpLoadingMessage = props.pullUpLoadingMessage, contentStyle = props.contentStyle, emptyPlaceholder = props.emptyPlaceholder, endOfListMessage = props.endOfListMessage, hideFooter = props.hideFooter;
|
|
24
|
+
var data = props.data, ItemRenderer = props.renderItem, rowKey = props.rowKey, loading = props.loading, _a = props.bounceEffect, bounceEffect = _a === void 0 ? true : _a, className = props.className, style = props.style, onPullDownRefresh = props.onPullDownRefresh, onPullUpLoading = props.onPullUpLoading, pullDownRefreshMessage = props.pullDownRefreshMessage, pullUpLoadingMessage = props.pullUpLoadingMessage, contentStyle = props.contentStyle, emptyPlaceholder = props.emptyPlaceholder, endOfListMessage = props.endOfListMessage, hideFooter = props.hideFooter;
|
|
24
25
|
var listWrapperRef = React.useRef(null);
|
|
25
26
|
var _b = __read(React.useState(null), 2), loadingType = _b[0], setLoadingType = _b[1];
|
|
26
27
|
var loadingWithDelay = useLoadingWithDelay(loading !== null && loading !== void 0 ? loading : false, 250);
|
|
@@ -40,7 +41,7 @@ export var FlatList = function (props) {
|
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
return (React.createElement(Wrapper, { className: classNames("g-flat-list", className), listWrapperRef: listWrapperRef, bounceEffect: bounceEffect, innerStyle: contentStyle, loadingType: loadingType, onLoadingTypeChange: setLoadingType, loading: loadingWithDelay, style: style, onPullDownRefresh: onPullDownRefresh, onPullUpLoading: onPullUpLoading, pullDownRefreshMessage: pullDownRefreshMessage, onScroll: onScroll }, data.length === 0 ? (emptyPlaceholder) : (React.createElement("div", { className: "list" },
|
|
43
|
-
data.map(function (d, i) { return (React.createElement("div", { className: "g-flat-list-item", key: i },
|
|
44
|
+
data.map(function (d, i) { return (React.createElement("div", { className: "g-flat-list-item", key: GetRowKey(rowKey, d, i) },
|
|
44
45
|
React.createElement(ItemRenderer, { data: d, index: i }))); }),
|
|
45
46
|
!hideFooter && React.createElement(Footer, { loading: loadingWithDelay && loadingType === "loading", ended: !onPullUpLoading, endMessage: endOfListMessage, loadingMessage: pullUpLoadingMessage })))));
|
|
46
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/FlatList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/FlatList/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,MAAM,EAAC,MAAM,iBA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M,IAAC,OAAO,EAAE,gBAAgB,IAAI,WAAW,KAAK,SAAS,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,oBAAoB,GAAI,CAC7K,CACT,CACK,CACb,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { Measure } from "../../VirtualFlatList/type";
|
|
2
3
|
import type { FooterData } from "../../type";
|
|
3
4
|
import "./index.less";
|
|
4
|
-
export interface Props extends FooterData {
|
|
5
|
+
export interface Props extends Omit<FooterData, "__markedAsFooterData"> {
|
|
5
6
|
measure?: Measure;
|
|
6
7
|
}
|
|
7
8
|
export declare const Footer: (props: Props) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetRowKey.js","sourceRoot":"","sources":["../../../../src/core/FlatList/shared/GetRowKey.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAI,MAAiB,EAAE,IAAO,EAAE,KAAa;IAClE,IAAI,MAAM,KAAK,OAAO,EAAE;QACpB,OAAO,KAAK,CAAC;KAChB;SAAM,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;QACrC,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KAC9B;SAAM;QACH,OAAO,IAAI,CAAC,MAAM,CAAQ,CAAC;KAC9B;AACL,CAAC"}
|
package/core/FlatList/type.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ export interface FlatListItemProps<T> {
|
|
|
6
6
|
index: number;
|
|
7
7
|
}
|
|
8
8
|
export declare type ItemRenderer<T> = React.FunctionComponent<FlatListItemProps<T>>;
|
|
9
|
+
export declare type RowKey<T> = (keyof T & string) | ((data: T, index: number) => string) | "index";
|
|
9
10
|
export interface FlatListProps<T> {
|
|
10
11
|
data: T[];
|
|
11
12
|
renderItem: ItemRenderer<T>;
|
|
13
|
+
rowKey: RowKey<T>;
|
|
12
14
|
loading?: boolean;
|
|
13
15
|
className?: string;
|
|
14
16
|
style?: React.CSSProperties;
|
|
@@ -28,6 +30,7 @@ export interface FlatListItemProps<T> {
|
|
|
28
30
|
index: number;
|
|
29
31
|
}
|
|
30
32
|
export interface FooterData {
|
|
33
|
+
__markedAsFooterData: true;
|
|
31
34
|
loading: boolean;
|
|
32
35
|
ended: boolean;
|
|
33
36
|
loadingMessage?: string;
|
package/core/Grid.d.ts
CHANGED
package/core/Input/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface Props extends Omit<InputProps, ExcludedAntInputKeys>, Controlle
|
|
|
22
22
|
}
|
|
23
23
|
export declare class Input extends React.PureComponent<Props> {
|
|
24
24
|
static displayName: string;
|
|
25
|
-
static Group:
|
|
25
|
+
static Group: React.FC<import("antd/lib/input").GroupProps>;
|
|
26
26
|
static Readonly: (props: InputReadonlyProps) => JSX.Element;
|
|
27
27
|
static Search: ({ onChange, ...rest }: InputSearchProps) => JSX.Element;
|
|
28
28
|
static TextArea: ({ onChange, ...rest }: InputTextAreaProps) => JSX.Element;
|
package/core/Radio/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface Props extends RadioProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class Radio extends React.PureComponent<Props> {
|
|
8
8
|
static displayName: string;
|
|
9
|
-
static Button:
|
|
10
|
-
static Group:
|
|
9
|
+
static Button: React.ForwardRefExoticComponent<import("antd/lib/radio/radioButton").RadioButtonProps & React.RefAttributes<any>>;
|
|
10
|
+
static Group: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd/lib/radio").RadioGroupProps & React.RefAttributes<HTMLDivElement>>>;
|
|
11
11
|
render(): JSX.Element;
|
|
12
12
|
}
|
|
13
13
|
export type { RadioChangeEvent };
|