Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 490e16d

Browse files
committed
🚚 chore: 移动组件目录
1 parent 13bdaeb commit 490e16d

File tree

9 files changed

+37
-294
lines changed

9 files changed

+37
-294
lines changed

packages/sortable-list/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"@dnd-kit/core": "^5.0.1",
2828
"@dnd-kit/modifiers": "^5.0.0",
2929
"@dnd-kit/sortable": "^6.0.0",
30+
"antd": "^4.18.9",
3031
"classnames": "^2.3.1",
3132
"lodash.isequal": "^4.5.0",
32-
"use-merge-value": "^1.0.2"
33+
"zustand": "^3.7.1"
3334
}
3435
}

packages/sortable-list/src/Sortable.tsx

Lines changed: 0 additions & 187 deletions
This file was deleted.

packages/sortable-list/src/BaseItem/index.less renamed to packages/sortable-list/src/components/BaseItem/index.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@background-color: #fff;
1+
@import (reference) '~antd/es/style/themes/default.less';
2+
23
@border-color: #efefef;
34
@handle-color: rgba(0, 0, 0, 0.25);
45
@box-shadow-border: 0 0 0 calc(1px / var(--scale-x, 1)) hsla(240, 0%, 26%, 0.05);
@@ -54,7 +55,7 @@
5455
flex-grow: 1;
5556
align-items: center;
5657
padding: 16px 24px;
57-
background-color: @background-color;
58+
background-color: @component-background;
5859
box-shadow: @box-shadow;
5960
outline: none;
6061
border-radius: 4px;

packages/sortable-list/src/BaseItem/index.tsx renamed to packages/sortable-list/src/components/BaseItem/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import type { CSSProperties } from 'react';
22
import React, { forwardRef, memo, useEffect } from 'react';
33
import classNames from 'classnames';
44

5-
import { Handle, Remove } from '../components';
5+
import { Handle } from '../Handle';
6+
import { Remove } from '../Remove';
67

7-
import type { BaseItemProps } from '../types';
8+
import type { BaseItemProps } from '../../types';
89

910
import './index.less';
1011

packages/sortable-list/src/DraggingOverlay.tsx renamed to packages/sortable-list/src/components/DraggingOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DragOverlay } from '@dnd-kit/core';
33
import { Item } from './BaseItem';
44
import type { FC } from 'react';
55

6-
import type { DraggingOverlayProps } from './types';
6+
import type { DraggingOverlayProps } from '../types';
77

88
const DraggingOverlay: FC<DraggingOverlayProps> = ({
99
dragging,

packages/sortable-list/src/SortableItem.tsx renamed to packages/sortable-list/src/components/SortableItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react';
44
import { useSortable } from '@dnd-kit/sortable';
55

66
import { Item } from './BaseItem';
7-
import type { SortableItemProps } from './types';
7+
import type { SortableItemProps } from '../types';
88

99
const SortableItem: FC<SortableItemProps> = ({
1010
//数据
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { Action } from './Action';
22
export { Handle } from './Handle';
33
export { Remove } from './Remove';
4+
export { Item } from './BaseItem';
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { FC } from 'react';
2+
import React from 'react';
3+
4+
import { Provider, createStore, useStoreApi } from '../store';
5+
6+
const Wrapper: FC = ({ children }) => {
7+
let isWrapped = true;
8+
9+
try {
10+
useStoreApi();
11+
} catch (e) {
12+
isWrapped = false;
13+
}
14+
15+
if (isWrapped) {
16+
// we need to wrap it with a fragment because it's not allowed for children to be a ReactNode
17+
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051
18+
return <>{children}</>;
19+
}
20+
21+
return <Provider createStore={createStore}>{children}</Provider>;
22+
};
23+
24+
Wrapper.displayName = 'ExcelTableWrapper';
25+
26+
export default Wrapper;

packages/sortable-list/src/index.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)