Skip to content

Commit

Permalink
docs: add hideChildMoveableDefaultLines docs
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jul 16, 2022
1 parent a140e5b commit 9e02faa
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 19 deletions.
22 changes: 20 additions & 2 deletions packages/react-moveable/src/react-moveable/MoveableGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ class MoveableGroup extends MoveableManager<GroupableProps> {
}

/**
* Sets the initial rotation of the group. (default 0)
* Sets the initial rotation of the group.
* @name Moveable.Group#defaultGroupRotate
* @default 0
* @example
* import Moveable from "moveable";
*
Expand All @@ -262,8 +263,9 @@ class MoveableGroup extends MoveableManager<GroupableProps> {
*/

/**
* Sets the initial origin of the group. (default 0)
* Sets the initial origin of the group.
* @name Moveable.Group#defaultGroupOrigin
* @default 0
* @example
* import Moveable from "moveable";
*
Expand All @@ -274,4 +276,20 @@ class MoveableGroup extends MoveableManager<GroupableProps> {
*
* moveable.defaultGroupOrigin = "20% 40%";
*/


/**
* Whether to hide the line in child moveable for group corresponding to the rect of the target.
* @name Moveable.Group#hideChildMoveableDefaultLines
* @default false
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* hideChildMoveableDefaultLines: false,
* });
*
* moveable.hideChildMoveableDefaultLines = true;
*/
export default MoveableGroup;
19 changes: 12 additions & 7 deletions packages/react-moveable/src/react-moveable/ables/Clippable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,9 @@ export default {
*/

/**
* You can drag the clip by setting clipArea. (default: false)
* You can drag the clip by setting clipArea.
* @name Moveable.Clippable#clipArea
* @default false
* @example
* import Moveable from "moveable";
*
Expand All @@ -1263,8 +1264,9 @@ export default {
*/

/**
* Whether the clip is bound to the target. (default: false)
* Whether the clip is bound to the target.
* @name Moveable.Clippable#clipTargetBounds
* @default false
* @example
* import Moveable from "moveable";
*
Expand All @@ -1291,9 +1293,10 @@ export default {
*/

/**
* Add clip guidelines in the vertical direction. (default: [])
* @name Moveable.Clippable#clipVerticalGuidelines
* @example
* Add clip guidelines in the vertical direction.
* @name Moveable.Clippable#clipVerticalGuidelines
* @default 0
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
Expand All @@ -1310,8 +1313,9 @@ export default {
*/

/**
* Add clip guidelines in the horizontal direction. (default: [])
* Add clip guidelines in the horizontal direction.
* @name Moveable.Clippable#clipHorizontalGuidelines
* @default []
* @example
* import Moveable from "moveable";
*
Expand All @@ -1328,8 +1332,9 @@ export default {
* });
*/
/**
* istance value that can snap to clip guidelines. (default: 5)
* istance value that can snap to clip guidelines.
* @name Moveable.Clippable#clipSnapThreshold
* @default 5
* @example
* import Moveable from "moveable";
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default {
cspNonce: String,
translateZ: Number,
hideDefaultLines: Boolean,
hideChildMoveableDefaultLines: Boolean,
props: Object,
flushSync: Function,
} as const,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { refs } from "framework-utils";
import MoveableManager from "../MoveableManager";
import { Renderer, MoveableGroupInterface } from "../types";
import { Renderer, MoveableGroupInterface, GroupableProps } from "../types";

export default {
name: "groupable",
props: {
defaultGroupRotate: Number,
defaultGroupOrigin: String,
groupable: Boolean,
hideChildMoveableDefaultLines: Boolean,
} as const,
events: {} as const,
render(moveable: MoveableGroupInterface, React: Renderer): any[] {
render(moveable: MoveableGroupInterface<GroupableProps>, React: Renderer): any[] {
const targets = moveable.props.targets || [];

moveable.moveables = [];
Expand All @@ -19,7 +20,7 @@ export default {
const props = moveable.props;

return targets.map((target, i) => {
return <MoveableManager
return <MoveableManager<GroupableProps>
key={"moveable" + i}
ref={refs(moveable, "moveables", i)}
target={target}
Expand Down
10 changes: 5 additions & 5 deletions packages/react-moveable/src/react-moveable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ export interface DefaultOptions {
* @default false
*/
hideDefaultLines?: boolean;
/**
* Whether to hide the line in child moveable for group corresponding to the rect of the target.
* @default false
*/
hideChildMoveableDefaultLines?: boolean;
/**
* You can use props in object format or custom props.
* @default empty object
Expand Down Expand Up @@ -1889,6 +1884,11 @@ export interface GroupableOptions {
* @private
*/
groupable?: boolean;
/**
* Whether to hide the line in child moveable for group corresponding to the rect of the target.
* @default false
*/
hideChildMoveableDefaultLines?: boolean;
}


Expand Down
2 changes: 1 addition & 1 deletion packages/react-moveable/stories/controls/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const DEFAULT_GROUPPABLE_GROUP_CONTROLS = {
description: makeLink("Grouppable", "hideChildMoveableDefaultLines"),
defaultValue: false,
}),
}
};
export const DEFAULT_RESIZABLE_GROUP_CONTROLS = {
maxWidth: makeArgType({
type: "number",
Expand Down

0 comments on commit 9e02faa

Please sign in to comment.