Skip to content

Scala Changes to Moveable against the old Moveable #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: latest-moveable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ statistics/
demo/storybook
demo/storybook2
dist/
.idea/
8,324 changes: 5,904 additions & 2,420 deletions packages/react-moveable/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions packages/react-moveable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-moveable",
"version": "0.29.0",
"name": "@scala-universal/react-moveable",
"version": "0.29.13",
"description": "A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.",
"main": "./dist/moveable.cjs.js",
"module": "./dist/moveable.esm.js",
Expand Down Expand Up @@ -69,11 +69,11 @@
"@scenejs/effects": "^1.0.1",
"@storybook/addon-actions": "^6.0.21",
"@storybook/addon-controls": "^6.0.21",
"@storybook/addon-docs": "^6.0.21",
"@storybook/addon-docs": "^6.2.9",
"@storybook/addon-links": "^6.0.21",
"@storybook/addon-viewport": "^6.0.21",
"@storybook/addons": "^6.0.21",
"@storybook/react": "^6.0.21",
"@storybook/react": "^6.2.9",
"@types/karma-chai": "^0.1.2",
"@types/mocha": "^5.2.7",
"@types/node": "^14.6.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/react-moveable/src/react-moveable/MoveableGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ function getMinPos(poses: number[][][], index: number) {
return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);
}));
}
function getGroupRect(moveables: MoveableManager[], rotation: number) {
if (!moveables.length) {
function getGroupRect(moveables_: MoveableManager[], rotation: number) {
if (!moveables_.length) {
return [0, 0, 0, 0];
}

const moveables = moveables_.filter(moveable => !moveable.props.target?.classList.contains('mask-group-ignore'));

const moveablePoses = moveables.map(({ state }) => getAbsolutePosesByState(state));
let minX = MAX_NUM;
let minY = MAX_NUM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export default class MoveableManager<T = {}>
const { left: parentLeft, top: parentTop } = parentPosition! || { left: 0, top: 0 };
const { left, top, target: stateTarget, direction, renderPoses } = state;
const groupTargets = (props as any).targets;
const isDisplay = ((groupTargets && groupTargets.length) || propsTarget) && stateTarget;
const isDisplay = ((groupTargets && groupTargets.length)
|| (propsTarget && !propsTarget?.classList?.contains('mask-group-ignore')))
&& stateTarget;
const isDragging = this.isDragging();
const ableAttributes: IObject<boolean> = {};
const Renderer = {
Expand Down
Loading