@univerjs/design 0.16.1 → 0.17.0
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/cjs/index.js +69 -57
- package/lib/es/index.js +6520 -10733
- package/lib/index.css +1 -1
- package/lib/index.js +6520 -10733
- package/lib/types/components/draggable-list/DraggableList.d.ts +13 -5
- package/lib/types/components/draggable-list/index.d.ts +1 -1
- package/lib/types/components/tree/Tree.d.ts +0 -1
- package/lib/types/components/tree/index.d.ts +1 -1
- package/lib/types/components/virtual-list/VirtualList.d.ts +12 -0
- package/lib/types/components/virtual-list/index.d.ts +16 -0
- package/lib/types/index.d.ts +1 -3
- package/lib/umd/index.js +69 -57
- package/package.json +5 -9
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface IDragPosition {
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
interface IDraggableListDragCallbacks {
|
|
6
|
+
onDragStart?: (layout: unknown, from: IDragPosition) => void;
|
|
7
|
+
onDragStop?: (layout: unknown, from: IDragPosition, to: IDragPosition) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface IDraggableListProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'onDragStart'>, IDraggableListDragCallbacks {
|
|
6
10
|
list: T[];
|
|
7
11
|
onListChange: (list: T[]) => void;
|
|
8
12
|
idKey: keyof T;
|
|
9
13
|
itemRender: (item: T, index: number) => ReactNode;
|
|
14
|
+
draggableHandle?: string;
|
|
15
|
+
rowHeight?: number;
|
|
16
|
+
margin?: [number, number];
|
|
10
17
|
}
|
|
11
18
|
export declare function DraggableList<T = any>(props: IDraggableListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export { DraggableList
|
|
16
|
+
export { DraggableList } from './DraggableList';
|
|
17
17
|
export type { IDraggableListProps } from './DraggableList';
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export { type ITreeNodeProps, type ITreeProps, Tree, TreeSelectionMode } from './Tree';
|
|
17
|
-
export {
|
|
17
|
+
export { filterLeafNode, findNodePathFromTree, findSubTreeFromPath, mergeTreeSelected } from './util';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties, Key, ReactNode } from 'react';
|
|
2
|
+
export interface IVirtualListProps<T extends object> {
|
|
3
|
+
data: T[];
|
|
4
|
+
itemKey: Key | ((item: T) => Key);
|
|
5
|
+
children: (item: T, index: number) => ReactNode;
|
|
6
|
+
height?: number;
|
|
7
|
+
itemHeight?: number;
|
|
8
|
+
overscan?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export declare function VirtualList<T extends object>(props: IVirtualListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { type IVirtualListProps, VirtualList } from './VirtualList';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { Confirm, type IConfirmProps } from './components/confirm/Confirm';
|
|
|
29
29
|
export { DatePicker } from './components/date-picker/DatePicker';
|
|
30
30
|
export { DateRangePicker } from './components/date-range-picker';
|
|
31
31
|
export { Dialog, type IDialogProps } from './components/dialog/Dialog';
|
|
32
|
-
export { DraggableList, type IDraggableListProps
|
|
32
|
+
export { DraggableList, type IDraggableListProps } from './components/draggable-list';
|
|
33
33
|
export { DropdownMenu, type IDropdownMenuProps } from './components/dropdown-menu/DropdownMenu';
|
|
34
34
|
export { Dropdown, type IDropdownProps } from './components/dropdown/Dropdown';
|
|
35
35
|
export { FormDualColumnLayout, FormLayout, type IFormDualColumnLayoutProps, type IFormLayoutProps } from './components/form-layout';
|
|
@@ -61,5 +61,3 @@ export { clsx } from './helper/clsx';
|
|
|
61
61
|
export { isBrowser } from './helper/is-browser';
|
|
62
62
|
export { render, unmount } from './helper/react-dom';
|
|
63
63
|
export { resizeObserverCtor } from './helper/resize-observer';
|
|
64
|
-
/** @deprecated Only for compatibility with versions before 0.7.0, will be removed in future versions */
|
|
65
|
-
export { defaultTheme, greenTheme } from '@univerjs/themes';
|