Skip to content

Commit

Permalink
feat: 优化 MultipleWrapperData 组件排序逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
limaofeng committed Jun 27, 2022
1 parent 9da02b4 commit aa5c0e0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
}
],
"dependencies": {
"@asany/sortable": "^0.1.32",
"@asany/tree": "^0.1.22",
"@asany/sortable": "^0.1.36",
"@daybrush/drag": "^0.19.3",
"@scena/react-guides": "^0.17.1",
"moveable-helper": "^0.4.0",
Expand Down
6 changes: 5 additions & 1 deletion src/properties/combine/MultipleWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import Sortable, { ISortableItem, SortableItemContentProps } from '../../sortable';
import React, { memo, useCallback, useMemo, useRef, useState } from 'react';

import Sortable, { SortableItemProps } from '@asany/sortable';
import Sortable, { SortableItemProps, dragPreview } from '@asany/sortable';
import { Icon } from '@asany/icons';

import { generateUUID } from '../../utils';
Expand Down Expand Up @@ -235,6 +235,10 @@ export function MultipleWrapper<T>(props: MultipleWrapperProps) {
tag="ul"
items={value}
itemRender={itemRender}
preview={{
render: dragPreview(itemRender),
axisLocked: true,
}}
onChange={handleSortChange}
/>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum UISidebarActionType {
*/
ToolboardKey = 'UISidebar/ToolboardKey',
/**
* 选择的API
* 选择的API
*/
API = 'API',
/**
Expand Down
16 changes: 4 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,16 @@
fonteditor-core "^2.1.8"
lodash "^4.17.21"

"@asany/sortable@^0.1.32":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@asany/sortable/-/sortable-0.1.32.tgz#48dedf726c11d50bb1f46f304cb722997f0733f7"
integrity sha512-DR7gT1jTHnzRNNv67o+qW4d14U7WMIpq/fbBCqUl1NYyezeDJSF1dOgA1/vu0QsZIQbocvEPL9w93hKvit+tNw==
"@asany/sortable@^0.1.36":
version "0.1.36"
resolved "https://registry.npmjs.org/@asany/sortable/-/sortable-0.1.36.tgz#98d865d7f109aa8ae5ec296e99dbd9a06b42c372"
integrity sha512-BaY8SpIVHVE5sQOGly4cY1pYhj7+2YPYrtYtdlT5vIszz8HzW44Epxepjwt+olhTVZmu2Y8n+RAiUT+u/e+RNA==
dependencies:
classnames "^2.3.1"
immutability-helper "^3.1.1"
lodash-es "^4.17.21"
react-flip-toolkit "^7.0.14"

"@asany/tree@^0.1.22":
version "0.1.22"
resolved "https://registry.yarnpkg.com/@asany/tree/-/tree-0.1.22.tgz#5303f04b59bfe7424fe18665d71bc2c409b70db9"
integrity sha512-ap2kMi1az/QObbzAbE3QzORYrTBkVXSr2ax34vHRcWlqn0ypiLafYYqzOkoWObtVoi6m3epXwomrR/AUQXG8Mg==
dependencies:
"@asany/sortable" "^0.1.32"
classnames "^2.3.1"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3":
version "7.16.7"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
Expand Down

0 comments on commit aa5c0e0

Please sign in to comment.