@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/style.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.1.5-beta.1 Mon Jun 27 2022 19:39:29 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v1.1.5-beta.4 Wed Jul 06 2022 14:29:11 GMT+0800 (China Standard Time)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -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(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
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,2 @@
1
+ import { VirtualList } from './virtuallist';
2
+ export default VirtualList;
@@ -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 };
@@ -0,0 +1,3 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ import { VirtualListProps } from './type';
3
+ export declare const VirtualList: FunctionComponent<VirtualListProps & React.HTMLAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "1.1.5-beta.1",
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"