Skip to content

Commit

Permalink
fix: fix floating point for min limit size
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jun 17, 2022
1 parent 7c01017 commit 766561c
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
]
},
"resolutions": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"@types/react": "^16.9.17",
"typescript": "^4.5.0 <4.6.0",
"@storybook/react": "^6.4.22",
Expand All @@ -98,7 +98,7 @@
"react-css-styled": "^1.0.3"
},
"overrides": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"@types/react": "^16.9.17",
"typescript": "^4.5.0 <4.6.0",
"@storybook/react": "^6.4.22",
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"framework-utils": "^1.1.0",
"moveable": "~0.30.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-compat-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@scena/dragscroll": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-moveable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"typescript": "^4.5.0 <4.6.0"
},
"dependencies": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@scena/dragscroll": "^1.1.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-moveable/stories/99-Tests/Deafult.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ group.add("Click a tag", {
app: require("./ReactATagApp").default,
text: require("!!raw-loader!./ReactATagApp").default,
});
group.add("Limit Sizes with Group", {
app: require("./ReactGroupMinSizeApp").default,
text: require("!!raw-loader!./ReactGroupMinSizeApp").default,
});
35 changes: 35 additions & 0 deletions packages/react-moveable/stories/99-Tests/ReactGroupMinSizeApp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import * as React from "react";
import Moveable from "@/react-moveable";

export default function App() {
return <div className="container">
<div className="target target1">Target1</div>
<div className="target target2">Target2</div>
<div className="target target3">Target3</div>
<Moveable
target={".target"}
draggable={true}
resizable={true}
onResizeGroupStart={({ events }) => {
events[0].setMin([50, 50]);
events[1].setMin([60, 50]);
events[2].setMin([50, 60]);
}}
onResizeGroup={({ events }) => {
events.forEach(ev => {
ev.target.style.width = `${ev.width}px`;
ev.target.style.height = `${ev.height}px`;
ev.target.style.transform = ev.drag.transform;
});
}}
onDragGroup={({ events }) => {
events.forEach(ev => {
ev.target.style.transform = ev.transform;
});
}}
onDragGroupEnd={({ events }) => {
console.log(events);
}}
/>
</div>;
}
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Daybrush",
"license": "MIT",
"dependencies": {
"@daybrush/utils": "^1.7.0",
"@daybrush/utils": "^1.7.1",
"moveable-helper": "^0.4.0",
"react-infinite-viewer": "^0.11.0",
"react-moveable": "~0.33.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-moveable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-moveable",
"version": "0.22.0",
"version": "0.22.1-beta.0",
"description": "A Svelte Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.",
"svelte": "./src/index.js",
"main": "./dist/moveable.cjs.js",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1781,10 +1781,10 @@
sinon "^7.4.1"
source-map-support "^0.5.13"

"@daybrush/utils@1.6.0", "@daybrush/utils@^0.10.0", "@daybrush/utils@^0.10.1", "@daybrush/utils@^0.10.5", "@daybrush/utils@^0.11.0", "@daybrush/utils@^0.5.2", "@daybrush/utils@^0.7.1", "@daybrush/utils@^1.0.0", "@daybrush/utils@^1.1.1", "@daybrush/utils@^1.3.1", "@daybrush/utils@^1.4.0", "@daybrush/utils@^1.6.0", "@daybrush/utils@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@daybrush/utils/-/utils-1.7.0.tgz#b256b91c78b6b9f4d7e22a02f3f5de01c8272a1d"
integrity sha512-52QInHXL1tffnEIxURWav7ZoIdhiK6ioQr2tzitZr8Uul0g3X58jdyDG7UeqCAFnbH4bZUp0QSznPSX8fHdZZQ==
"@daybrush/utils@1.6.0", "@daybrush/utils@^0.10.0", "@daybrush/utils@^0.10.1", "@daybrush/utils@^0.10.5", "@daybrush/utils@^0.11.0", "@daybrush/utils@^0.5.2", "@daybrush/utils@^0.7.1", "@daybrush/utils@^1.0.0", "@daybrush/utils@^1.1.1", "@daybrush/utils@^1.3.1", "@daybrush/utils@^1.4.0", "@daybrush/utils@^1.6.0", "@daybrush/utils@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@daybrush/utils/-/utils-1.7.1.tgz#82de000e69a0b85212933801df9b7c4c5ae15be5"
integrity sha512-ruVDIfXeVAF4s0RxJoNx5hTjxlIRMnKoJ7N5e2m9eDyluIXB12EvhMPQdoq4a/ohJ+cPgj2MiWS5Lvmpsrx8Gg==

"@discoveryjs/json-ext@0.5.6":
version "0.5.6"
Expand Down

0 comments on commit 766561c

Please sign in to comment.