Progress Commit

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-05-17 16:29:46 -04:00
parent c3108a17f4
commit 55d729339f
9 changed files with 440 additions and 511 deletions

View File

@@ -51,52 +51,27 @@ class Container extends Component {
getContainerOptions() {
const functionProps = {};
const propKeys = [
"onDragStart",
"onDragEnd",
"onDrop",
"getChildPayload",
"shouldAnimateDrop",
"shouldAcceptDrop",
"onDragEnter",
"onDragLeave",
"render",
"onDropReady",
"getGhostParent"
];
if (this.props.onDragStart) {
functionProps.onDragStart = (...p) => this.props.onDragStart(...p);
}
propKeys.forEach((key) => {
if (this.props[key]) {
functionProps[key] = (...p) => this.props[key](...p);
}
});
if (this.props.onDragEnd) {
functionProps.onDragEnd = (...p) => this.props.onDragEnd(...p);
}
if (this.props.onDrop) {
functionProps.onDrop = (...p) => this.props.onDrop(...p);
}
if (this.props.getChildPayload) {
functionProps.getChildPayload = (...p) => this.props.getChildPayload(...p);
}
if (this.props.shouldAnimateDrop) {
functionProps.shouldAnimateDrop = (...p) => this.props.shouldAnimateDrop(...p);
}
if (this.props.shouldAcceptDrop) {
functionProps.shouldAcceptDrop = (...p) => this.props.shouldAcceptDrop(...p);
}
if (this.props.onDragEnter) {
functionProps.onDragEnter = (...p) => this.props.onDragEnter(...p);
}
if (this.props.onDragLeave) {
functionProps.onDragLeave = (...p) => this.props.onDragLeave(...p);
}
if (this.props.render) {
functionProps.render = (...p) => this.props.render(...p);
}
if (this.props.onDropReady) {
functionProps.onDropReady = (...p) => this.props.onDropReady(...p);
}
if (this.props.getGhostParent) {
functionProps.getGhostParent = (...p) => this.props.getGhostParent(...p);
}
return Object.assign({}, this.props, functionProps);
return { ...this.props, ...functionProps };
}
}