@nutui/nutui-react 1.1.5-beta.1 → 1.1.5-beta.4
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/dist/esm/Address.js +3 -5
- package/dist/esm/CollapseItem.js +6 -3
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/VirtualList/style/index.js +2 -0
- package/dist/esm/VirtualList.js +344 -0
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +475 -178
- package/dist/nutui.react.umd.js +9 -9
- package/dist/packages/virtuallist/virtuallist.scss +51 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/collapse/__test__/collapse.spec.d.ts +1 -0
- package/dist/types/collapseitem/collapseitem.d.ts +2 -2
- package/dist/types/nutui.react.d.ts +2 -1
- package/dist/types/popover/Trigger.d.ts +1 -1
- package/dist/types/switch/__test__/switch.spec.d.ts +1 -0
- package/dist/types/tag/__test__/tag.spec.d.ts +1 -0
- package/dist/types/virtuallist/__test__/virtuallist.spec.d.ts +1 -0
- package/dist/types/virtuallist/index.d.ts +2 -0
- package/dist/types/virtuallist/type.d.ts +32 -0
- package/dist/types/virtuallist/utils.d.ts +16 -0
- package/dist/types/virtuallist/virtuallist.d.ts +3 -0
- package/package.json +3 -2
package/dist/style.es.js
CHANGED
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
@import '../../packages/animatingnumbers/animatingnumbers.scss';
|
|
60
60
|
@import '../../packages/empty/empty.scss';
|
|
61
61
|
@import '../../packages/configprovider/configprovider.scss';
|
|
62
|
+
@import '../../packages/virtuallist/virtuallist.scss';
|
|
62
63
|
@import '../../packages/address/address.scss';
|
|
63
64
|
@import '../../packages/barrage/barrage.scss';
|
|
64
65
|
@import '../../packages/signature/signature.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
2
|
export interface CollapseItemProps {
|
|
3
3
|
title: string;
|
|
4
4
|
name: string;
|
|
@@ -15,4 +15,4 @@ export interface CollapseItemProps {
|
|
|
15
15
|
titleIconSize: string;
|
|
16
16
|
onToggle: (isOpen: boolean, name: string) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare const CollapseItem: FunctionComponent<Partial<CollapseItemProps>>;
|
|
18
|
+
export declare const CollapseItem: FunctionComponent<Partial<CollapseItemProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -58,8 +58,9 @@ import CollapseItem from './collapseitem';
|
|
|
58
58
|
import AnimatingNumbers from './animatingnumbers';
|
|
59
59
|
import Empty from './empty';
|
|
60
60
|
import ConfigProvider from './configprovider';
|
|
61
|
+
import VirtualList from './virtuallist';
|
|
61
62
|
import Address from './address';
|
|
62
63
|
import Barrage from './barrage';
|
|
63
64
|
import Signature from './signature';
|
|
64
65
|
import Card from './card';
|
|
65
|
-
export { Button, Cell, CellGroup, Icon, Overlay, Popup, Layout, Col, Row, Divider, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, ConfigProvider, Address, Barrage, Signature, Card };
|
|
66
|
+
export { Button, Cell, CellGroup, Icon, Overlay, Popup, Layout, Col, Row, Divider, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, ConfigProvider, VirtualList, Address, Barrage, Signature, Card };
|
|
@@ -16,6 +16,6 @@ export declare function composeRef<T>(...refs: React.Ref<T>[]): React.Ref<T>;
|
|
|
16
16
|
export default class Trigger extends React.Component<TriggerProps, TriggerState> {
|
|
17
17
|
constructor(props: any);
|
|
18
18
|
fireEvents(type: string, e: Event): void;
|
|
19
|
-
render():
|
|
19
|
+
render(): JSX.Element;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type Data = any;
|
|
3
|
+
export interface VirtualListState {
|
|
4
|
+
startOffset: number;
|
|
5
|
+
startIndex: number;
|
|
6
|
+
overStart: number;
|
|
7
|
+
endIndex: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PositionType {
|
|
10
|
+
index: number;
|
|
11
|
+
top?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
width?: number;
|
|
15
|
+
left?: number;
|
|
16
|
+
right: number;
|
|
17
|
+
}
|
|
18
|
+
export interface VirtualListProps {
|
|
19
|
+
sourceData: Array<Data>;
|
|
20
|
+
containerSize?: number;
|
|
21
|
+
ItemRender?: React.FC<any>;
|
|
22
|
+
itemSize?: number;
|
|
23
|
+
itemEqualSize?: boolean;
|
|
24
|
+
horizontal?: boolean;
|
|
25
|
+
overscan?: number;
|
|
26
|
+
handleScroll?: (...args: any[]) => any;
|
|
27
|
+
key?: string;
|
|
28
|
+
locale?: {
|
|
29
|
+
[key in string]: string;
|
|
30
|
+
};
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PositionType, Data } from './type';
|
|
2
|
+
declare const initPositinoCache: (reaItemSize: number, length?: number) => PositionType[];
|
|
3
|
+
declare const getListTotalSize: (positions: Array<PositionType>, horizontal: true | false) => number;
|
|
4
|
+
declare const binarySearch: (positionsList: Array<PositionType>, value: number | undefined, horizontal: true | false) => number;
|
|
5
|
+
declare const getEndIndex: ({ sourceData, startIndex, visibleCount, itemEqualSize, positions, offSetSize, overscan, sizeKey, }: {
|
|
6
|
+
sourceData: Array<Data>;
|
|
7
|
+
startIndex: number;
|
|
8
|
+
visibleCount: number;
|
|
9
|
+
itemEqualSize?: boolean | undefined;
|
|
10
|
+
positions: PositionType[];
|
|
11
|
+
offSetSize: number;
|
|
12
|
+
overscan: number;
|
|
13
|
+
sizeKey?: "height" | "width" | undefined;
|
|
14
|
+
}) => number;
|
|
15
|
+
declare const updateItemSize: (positions: PositionType[], items: HTMLCollection, sizeKey: 'width' | 'height') => void;
|
|
16
|
+
export { initPositinoCache, getListTotalSize, binarySearch, getEndIndex, updateItemSize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutui/nutui-react",
|
|
3
|
-
"version": "1.1.5-beta.
|
|
3
|
+
"version": "1.1.5-beta.4",
|
|
4
4
|
"style": "dist/style.css",
|
|
5
5
|
"main": "dist/nutui.react.umd.js",
|
|
6
6
|
"module": "dist/esm/nutui-react.es.js",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"lint:fix": "eslint --fix .",
|
|
57
57
|
"publish:beta": "npm publish --tag beta",
|
|
58
58
|
"prepare": "husky install",
|
|
59
|
-
"test": "jest"
|
|
59
|
+
"test": "jest",
|
|
60
|
+
"test:demo": "jest --testNamePattern=^should match snapshot$ --runTestsByPath ./src/packages/collapse/__test__/collapse.spec.tsx"
|
|
60
61
|
},
|
|
61
62
|
"engines": {
|
|
62
63
|
"node": "^14.18.0 || >=15.0.0"
|