-
-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setMin, setMax scale size in onScaleStart
- Loading branch information
Showing
5 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/react-moveable/stories/5A-Advanced/3-Scalable/Deafult.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { add } from "../../utils/story"; | ||
|
||
|
||
export default { | ||
title: "Advacned Scalable", | ||
}; | ||
|
||
export const AdvancedScalableMinMax = add("Scalable with min, max size", { | ||
app: require("./ReactScalableMinMaxApp").default, | ||
path: require.resolve("./ReactScalableMinMaxApp"), | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/react-moveable/stories/5A-Advanced/3-Scalable/ReactScalableMinMaxApp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from "react"; | ||
import Moveable from "@/react-moveable"; | ||
|
||
export default function App() { | ||
return <div className="container"> | ||
<div className="target">Target</div> | ||
<Moveable | ||
target={".target"} | ||
draggable={true} | ||
scalable={true} | ||
onScaleStart={e => { | ||
e.setMinScaleSize([100, 100]); | ||
e.setMaxScaleSize([500, 500]); | ||
}} | ||
onRender={e => { | ||
e.target.style.cssText += e.cssText; | ||
}} | ||
/> | ||
</div>; | ||
} |