2021-06-18 07:42:57 +00:00
|
|
|
import React, { useContext, useRef, memo, useMemo } from "react";
|
2021-08-24 11:38:20 +00:00
|
|
|
import { XYCord } from "utils/hooks/useCanvasDragging";
|
2020-02-18 19:56:58 +00:00
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
WidgetOperations,
|
|
|
|
|
WidgetRowCols,
|
|
|
|
|
WidgetProps,
|
|
|
|
|
} from "widgets/BaseWidget";
|
2019-11-13 07:00:25 +00:00
|
|
|
import { EditorContext } from "components/editorComponents/EditorContextProvider";
|
|
|
|
|
import { generateClassName } from "utils/generators";
|
2020-01-16 11:46:21 +00:00
|
|
|
import { DropTargetContext } from "./DropTargetComponent";
|
2019-11-13 07:00:25 +00:00
|
|
|
import {
|
|
|
|
|
UIElementSize,
|
2020-02-18 19:56:58 +00:00
|
|
|
computeFinalRowCols,
|
|
|
|
|
computeRowCols,
|
2019-11-13 07:00:25 +00:00
|
|
|
} from "./ResizableUtils";
|
2020-01-20 09:00:37 +00:00
|
|
|
import {
|
|
|
|
|
useShowPropertyPane,
|
2021-07-20 05:18:58 +00:00
|
|
|
useShowTableFilterPane,
|
2020-01-20 09:00:37 +00:00
|
|
|
useWidgetDragResize,
|
|
|
|
|
} from "utils/hooks/dragResizeHooks";
|
2020-01-21 07:14:47 +00:00
|
|
|
import { useSelector } from "react-redux";
|
|
|
|
|
import { AppState } from "reducers";
|
2020-02-18 19:56:58 +00:00
|
|
|
import Resizable from "resizable";
|
2021-08-09 05:35:01 +00:00
|
|
|
import { omit, get, ceil } from "lodash";
|
2021-05-18 18:29:39 +00:00
|
|
|
import { getSnapColumns, isDropZoneOccupied } from "utils/WidgetPropsUtils";
|
2020-02-19 10:00:03 +00:00
|
|
|
import {
|
|
|
|
|
VisibilityContainer,
|
|
|
|
|
LeftHandleStyles,
|
|
|
|
|
RightHandleStyles,
|
|
|
|
|
TopHandleStyles,
|
|
|
|
|
BottomHandleStyles,
|
|
|
|
|
TopLeftHandleStyles,
|
|
|
|
|
TopRightHandleStyles,
|
|
|
|
|
BottomLeftHandleStyles,
|
|
|
|
|
BottomRightHandleStyles,
|
|
|
|
|
} from "./ResizeStyledComponents";
|
2020-03-03 07:02:53 +00:00
|
|
|
import AnalyticsUtil from "utils/AnalyticsUtil";
|
2020-03-27 09:02:11 +00:00
|
|
|
import { scrollElementIntoParentCanvasView } from "utils/helpers";
|
|
|
|
|
import { getNearestParentCanvas } from "utils/generators";
|
2021-08-12 05:45:38 +00:00
|
|
|
import { getOccupiedSpaces } from "selectors/editorSelectors";
|
2021-06-09 10:35:10 +00:00
|
|
|
import { commentModeSelector } from "selectors/commentsSelectors";
|
2021-07-26 16:44:10 +00:00
|
|
|
import { snipingModeSelector } from "selectors/editorSelectors";
|
2021-06-17 13:26:54 +00:00
|
|
|
import { useWidgetSelection } from "utils/hooks/useWidgetSelection";
|
2021-08-09 05:35:01 +00:00
|
|
|
import { getCanvasWidgets } from "selectors/entitiesSelector";
|
|
|
|
|
import { focusWidget } from "actions/widgetActions";
|
2021-08-23 14:12:17 +00:00
|
|
|
import { getParentToOpenIfAny } from "utils/hooks/useClickToSelectWidget";
|
2020-02-18 19:56:58 +00:00
|
|
|
|
2020-10-12 13:06:05 +00:00
|
|
|
export type ResizableComponentProps = WidgetProps & {
|
2020-02-18 19:56:58 +00:00
|
|
|
paddingOffset: number;
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-11 06:33:07 +00:00
|
|
|
export const ResizableComponent = memo(function ResizableComponent(
|
|
|
|
|
props: ResizableComponentProps,
|
|
|
|
|
) {
|
2020-03-27 09:02:11 +00:00
|
|
|
const resizableRef = useRef<HTMLDivElement>(null);
|
2019-11-13 07:00:25 +00:00
|
|
|
// Fetch information from the context
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
const { updateWidget } = useContext(EditorContext);
|
2021-08-12 05:45:38 +00:00
|
|
|
const occupiedSpaces = useSelector(getOccupiedSpaces);
|
2021-08-09 05:35:01 +00:00
|
|
|
const canvasWidgets = useSelector(getCanvasWidgets);
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
|
2021-09-21 07:55:56 +00:00
|
|
|
const { updateDropTargetRows } = useContext(DropTargetContext);
|
2020-01-17 12:34:58 +00:00
|
|
|
|
2021-06-09 10:35:10 +00:00
|
|
|
const isCommentMode = useSelector(commentModeSelector);
|
2021-07-26 16:44:10 +00:00
|
|
|
const isSnipingMode = useSelector(snipingModeSelector);
|
2021-06-09 10:35:10 +00:00
|
|
|
|
2020-01-20 09:00:37 +00:00
|
|
|
const showPropertyPane = useShowPropertyPane();
|
2021-07-20 05:18:58 +00:00
|
|
|
const showTableFilterPane = useShowTableFilterPane();
|
2020-01-20 09:00:37 +00:00
|
|
|
const { selectWidget } = useWidgetSelection();
|
|
|
|
|
const { setIsResizing } = useWidgetDragResize();
|
|
|
|
|
const selectedWidget = useSelector(
|
2021-05-18 18:29:39 +00:00
|
|
|
(state: AppState) => state.ui.widgetDragResize.lastSelectedWidget,
|
|
|
|
|
);
|
|
|
|
|
const selectedWidgets = useSelector(
|
|
|
|
|
(state: AppState) => state.ui.widgetDragResize.selectedWidgets,
|
2020-01-20 09:00:37 +00:00
|
|
|
);
|
|
|
|
|
const focusedWidget = useSelector(
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
(state: AppState) => state.ui.widgetDragResize.focusedWidget,
|
2020-01-20 09:00:37 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const isDragging = useSelector(
|
|
|
|
|
(state: AppState) => state.ui.widgetDragResize.isDragging,
|
|
|
|
|
);
|
2020-02-18 19:56:58 +00:00
|
|
|
const isResizing = useSelector(
|
|
|
|
|
(state: AppState) => state.ui.widgetDragResize.isResizing,
|
|
|
|
|
);
|
2021-08-09 05:35:01 +00:00
|
|
|
const parentWidgetToSelect = getParentToOpenIfAny(
|
|
|
|
|
props.widgetId,
|
|
|
|
|
canvasWidgets,
|
|
|
|
|
);
|
2021-05-18 18:29:39 +00:00
|
|
|
|
2021-08-12 05:45:38 +00:00
|
|
|
const occupiedSpacesBySiblingWidgets = useMemo(() => {
|
|
|
|
|
return occupiedSpaces && props.parentId && occupiedSpaces[props.parentId]
|
|
|
|
|
? occupiedSpaces[props.parentId]
|
|
|
|
|
: undefined;
|
|
|
|
|
}, [occupiedSpaces, props.parentId]);
|
|
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
// isFocused (string | boolean) -> isWidgetFocused (boolean)
|
2020-01-06 11:02:22 +00:00
|
|
|
const isWidgetFocused =
|
2021-05-18 18:29:39 +00:00
|
|
|
focusedWidget === props.widgetId ||
|
|
|
|
|
selectedWidget === props.widgetId ||
|
|
|
|
|
selectedWidgets.includes(props.widgetId);
|
2019-10-08 06:19:10 +00:00
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
// Calculate the dimensions of the widget,
|
|
|
|
|
// The ResizableContainer's size prop is controlled
|
|
|
|
|
const dimensions: UIElementSize = {
|
2020-03-06 09:33:20 +00:00
|
|
|
width:
|
|
|
|
|
(props.rightColumn - props.leftColumn) * props.parentColumnSpace -
|
|
|
|
|
2 * props.paddingOffset,
|
|
|
|
|
height:
|
|
|
|
|
(props.bottomRow - props.topRow) * props.parentRowSpace -
|
|
|
|
|
2 * props.paddingOffset,
|
2019-11-13 07:00:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Resize bound's className - defaults to body
|
|
|
|
|
// ResizableContainer accepts the className of the element,
|
|
|
|
|
// whose clientRect will act as the bounds for resizing.
|
|
|
|
|
// Note, if there are many containers with the same className
|
|
|
|
|
// the bounding container becomes the nearest parent with the className
|
2020-02-18 19:56:58 +00:00
|
|
|
const boundingElementClassName = generateClassName(props.parentId);
|
|
|
|
|
const possibleBoundingElements = document.getElementsByClassName(
|
|
|
|
|
boundingElementClassName,
|
|
|
|
|
);
|
|
|
|
|
const boundingElement =
|
|
|
|
|
possibleBoundingElements.length > 0
|
|
|
|
|
? possibleBoundingElements[0]
|
|
|
|
|
: undefined;
|
2019-10-08 06:19:10 +00:00
|
|
|
|
2019-11-13 07:00:25 +00:00
|
|
|
// onResize handler
|
|
|
|
|
// Checks if the current resize position has any collisions
|
|
|
|
|
// If yes, set isColliding flag to true.
|
|
|
|
|
// If no, set isColliding flag to false.
|
2021-08-24 11:38:20 +00:00
|
|
|
const isColliding = (newDimensions: UIElementSize, position: XYCord) => {
|
2021-05-11 14:39:09 +00:00
|
|
|
// Moving the bounding element calculations inside
|
|
|
|
|
// to make this expensive operation only whne
|
|
|
|
|
const boundingElementClientRect = boundingElement
|
|
|
|
|
? boundingElement.getBoundingClientRect()
|
|
|
|
|
: undefined;
|
|
|
|
|
|
2020-01-16 11:46:21 +00:00
|
|
|
const bottom =
|
2020-02-18 19:56:58 +00:00
|
|
|
props.topRow +
|
|
|
|
|
position.y / props.parentRowSpace +
|
|
|
|
|
newDimensions.height / props.parentRowSpace;
|
2020-01-16 11:46:21 +00:00
|
|
|
// Make sure to calculate collision IF we don't update the main container's rows
|
|
|
|
|
let updated = false;
|
2020-03-27 09:02:11 +00:00
|
|
|
if (updateDropTargetRows) {
|
2021-08-12 05:45:38 +00:00
|
|
|
updated = !!updateDropTargetRows(props.widgetId, bottom);
|
2020-03-27 09:02:11 +00:00
|
|
|
const el = resizableRef.current;
|
2021-08-12 05:45:38 +00:00
|
|
|
if (el) {
|
|
|
|
|
const { height } = el?.getBoundingClientRect();
|
|
|
|
|
const scrollParent = getNearestParentCanvas(resizableRef.current);
|
|
|
|
|
scrollElementIntoParentCanvasView(
|
|
|
|
|
{
|
|
|
|
|
top: 40,
|
|
|
|
|
height,
|
|
|
|
|
},
|
|
|
|
|
scrollParent,
|
|
|
|
|
el,
|
|
|
|
|
);
|
|
|
|
|
}
|
2020-02-18 19:56:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const delta: UIElementSize = {
|
|
|
|
|
height: newDimensions.height - dimensions.height,
|
|
|
|
|
width: newDimensions.width - dimensions.width,
|
|
|
|
|
};
|
|
|
|
|
const newRowCols: WidgetRowCols | false = computeRowCols(
|
|
|
|
|
delta,
|
|
|
|
|
position,
|
|
|
|
|
props,
|
|
|
|
|
);
|
|
|
|
|
|
2020-03-27 09:02:11 +00:00
|
|
|
if (newRowCols.rightColumn > getSnapColumns()) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-18 18:29:39 +00:00
|
|
|
// Minimum row and columns to be set to a widget.
|
2020-02-19 10:00:03 +00:00
|
|
|
if (
|
2021-05-18 18:29:39 +00:00
|
|
|
newRowCols.rightColumn - newRowCols.leftColumn < 2 ||
|
|
|
|
|
newRowCols.bottomRow - newRowCols.topRow < 4
|
2020-02-19 10:00:03 +00:00
|
|
|
) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 19:56:58 +00:00
|
|
|
if (
|
|
|
|
|
boundingElementClientRect &&
|
|
|
|
|
newRowCols.rightColumn * props.parentColumnSpace >
|
2021-08-09 05:35:01 +00:00
|
|
|
ceil(boundingElementClientRect.width)
|
2020-02-18 19:56:58 +00:00
|
|
|
) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (newRowCols && newRowCols.leftColumn < 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2020-01-16 11:46:21 +00:00
|
|
|
|
|
|
|
|
if (!updated) {
|
2020-02-18 19:56:58 +00:00
|
|
|
if (
|
|
|
|
|
boundingElementClientRect &&
|
|
|
|
|
newRowCols.bottomRow * props.parentRowSpace >
|
2021-08-09 05:35:01 +00:00
|
|
|
ceil(boundingElementClientRect.height)
|
2020-02-18 19:56:58 +00:00
|
|
|
) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (newRowCols && newRowCols.topRow < 0) {
|
|
|
|
|
return true;
|
2020-01-16 11:46:21 +00:00
|
|
|
}
|
2019-10-08 06:19:10 +00:00
|
|
|
}
|
2021-08-09 05:35:01 +00:00
|
|
|
|
|
|
|
|
// this is required for list widget so that template have no collision
|
|
|
|
|
if (props.ignoreCollision) return false;
|
|
|
|
|
|
2020-02-18 19:56:58 +00:00
|
|
|
// Check if new row cols are occupied by sibling widgets
|
|
|
|
|
return isDropZoneOccupied(
|
|
|
|
|
{
|
|
|
|
|
left: newRowCols.leftColumn,
|
|
|
|
|
top: newRowCols.topRow,
|
|
|
|
|
bottom: newRowCols.bottomRow,
|
|
|
|
|
right: newRowCols.rightColumn,
|
|
|
|
|
},
|
|
|
|
|
props.widgetId,
|
|
|
|
|
occupiedSpacesBySiblingWidgets,
|
|
|
|
|
);
|
2019-10-08 06:19:10 +00:00
|
|
|
};
|
2019-11-13 07:00:25 +00:00
|
|
|
|
|
|
|
|
// onResizeStop handler
|
|
|
|
|
// when done resizing, check if;
|
|
|
|
|
// 1) There is no collision
|
|
|
|
|
// 2) There is a change in widget size
|
|
|
|
|
// Update widget, if both of the above are true.
|
2021-08-24 11:38:20 +00:00
|
|
|
const updateSize = (newDimensions: UIElementSize, position: XYCord) => {
|
2019-11-13 07:00:25 +00:00
|
|
|
// Get the difference in size of the widget, before and after resizing.
|
|
|
|
|
const delta: UIElementSize = {
|
2020-02-18 19:56:58 +00:00
|
|
|
height: newDimensions.height - dimensions.height,
|
|
|
|
|
width: newDimensions.width - dimensions.width,
|
2019-11-13 07:00:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Get the updated Widget rows and columns props
|
|
|
|
|
// False, if there is collision
|
|
|
|
|
// False, if none of the rows and cols have changed.
|
2020-02-18 19:56:58 +00:00
|
|
|
const newRowCols: WidgetRowCols | false = computeFinalRowCols(
|
2019-11-13 07:00:25 +00:00
|
|
|
delta,
|
|
|
|
|
position,
|
|
|
|
|
props,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (newRowCols) {
|
|
|
|
|
updateWidget &&
|
2021-09-21 07:55:56 +00:00
|
|
|
updateWidget(WidgetOperations.RESIZE, props.widgetId, {
|
|
|
|
|
...newRowCols,
|
|
|
|
|
parentId: props.parentId,
|
|
|
|
|
});
|
2019-11-13 07:00:25 +00:00
|
|
|
}
|
|
|
|
|
// Tell the Canvas that we've stopped resizing
|
2020-03-04 08:10:40 +00:00
|
|
|
// Put it later in the stack so that other updates like click, are not propagated to the parent container
|
2020-01-07 12:28:58 +00:00
|
|
|
setTimeout(() => {
|
|
|
|
|
setIsResizing && setIsResizing(false);
|
2020-01-17 12:34:58 +00:00
|
|
|
}, 0);
|
2019-11-13 07:00:25 +00:00
|
|
|
// Tell the Canvas to put the focus back to this widget
|
|
|
|
|
// By setting the focus, we enable the control buttons on the widget
|
2020-03-04 08:10:40 +00:00
|
|
|
selectWidget &&
|
|
|
|
|
selectedWidget !== props.widgetId &&
|
2021-08-09 05:35:01 +00:00
|
|
|
parentWidgetToSelect?.widgetId !== props.widgetId &&
|
2020-03-04 08:10:40 +00:00
|
|
|
selectWidget(props.widgetId);
|
2021-08-09 05:35:01 +00:00
|
|
|
|
|
|
|
|
if (parentWidgetToSelect) {
|
|
|
|
|
selectWidget &&
|
|
|
|
|
selectedWidget !== parentWidgetToSelect.widgetId &&
|
|
|
|
|
selectWidget(parentWidgetToSelect.widgetId);
|
|
|
|
|
focusWidget(parentWidgetToSelect.widgetId);
|
|
|
|
|
} else {
|
|
|
|
|
selectWidget &&
|
|
|
|
|
selectedWidget !== props.widgetId &&
|
|
|
|
|
selectWidget(props.widgetId);
|
|
|
|
|
}
|
2021-08-23 14:12:17 +00:00
|
|
|
// Property pane closes after a resize/drag
|
|
|
|
|
showPropertyPane && showPropertyPane();
|
2020-03-03 07:02:53 +00:00
|
|
|
AnalyticsUtil.logEvent("WIDGET_RESIZE_END", {
|
|
|
|
|
widgetName: props.widgetName,
|
|
|
|
|
widgetType: props.type,
|
|
|
|
|
startHeight: dimensions.height,
|
|
|
|
|
startWidth: dimensions.width,
|
|
|
|
|
endHeight: newDimensions.height,
|
|
|
|
|
endWidth: newDimensions.width,
|
|
|
|
|
});
|
2020-02-18 19:56:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleResizeStart = () => {
|
|
|
|
|
setIsResizing && !isResizing && setIsResizing(true);
|
|
|
|
|
selectWidget &&
|
|
|
|
|
selectedWidget !== props.widgetId &&
|
|
|
|
|
selectWidget(props.widgetId);
|
2021-07-20 05:18:58 +00:00
|
|
|
// Make sure that this tableFilterPane should close
|
|
|
|
|
showTableFilterPane && showTableFilterPane();
|
2020-03-03 07:02:53 +00:00
|
|
|
AnalyticsUtil.logEvent("WIDGET_RESIZE_START", {
|
|
|
|
|
widgetName: props.widgetName,
|
|
|
|
|
widgetType: props.type,
|
|
|
|
|
});
|
2019-09-22 20:25:05 +00:00
|
|
|
};
|
2021-06-18 07:42:57 +00:00
|
|
|
const handles = useMemo(() => {
|
|
|
|
|
const allHandles = {
|
|
|
|
|
left: LeftHandleStyles,
|
|
|
|
|
top: TopHandleStyles,
|
|
|
|
|
bottom: BottomHandleStyles,
|
|
|
|
|
right: RightHandleStyles,
|
|
|
|
|
bottomRight: BottomRightHandleStyles,
|
|
|
|
|
topLeft: TopLeftHandleStyles,
|
|
|
|
|
topRight: TopRightHandleStyles,
|
|
|
|
|
bottomLeft: BottomLeftHandleStyles,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return omit(allHandles, get(props, "disabledResizeHandles", []));
|
|
|
|
|
}, [props]);
|
2020-02-18 19:56:58 +00:00
|
|
|
|
2021-06-09 10:35:10 +00:00
|
|
|
const isEnabled =
|
2021-07-26 16:44:10 +00:00
|
|
|
!isDragging &&
|
|
|
|
|
isWidgetFocused &&
|
|
|
|
|
!props.resizeDisabled &&
|
|
|
|
|
!isCommentMode &&
|
|
|
|
|
!isSnipingMode;
|
2021-08-12 05:45:38 +00:00
|
|
|
const isMultiSelectedWidget =
|
|
|
|
|
selectedWidgets &&
|
|
|
|
|
selectedWidgets.length > 1 &&
|
|
|
|
|
selectedWidgets.includes(props.widgetId);
|
2021-06-09 10:35:10 +00:00
|
|
|
|
2019-09-22 20:25:05 +00:00
|
|
|
return (
|
2020-02-18 19:56:58 +00:00
|
|
|
<Resizable
|
2021-08-12 05:45:38 +00:00
|
|
|
allowResize={!isMultiSelectedWidget}
|
2021-04-28 10:28:39 +00:00
|
|
|
componentHeight={dimensions.height}
|
|
|
|
|
componentWidth={dimensions.width}
|
2021-06-09 10:35:10 +00:00
|
|
|
enable={isEnabled}
|
2021-06-18 07:42:57 +00:00
|
|
|
handles={handles}
|
2021-04-28 10:28:39 +00:00
|
|
|
isColliding={isColliding}
|
2020-02-18 19:56:58 +00:00
|
|
|
onStart={handleResizeStart}
|
|
|
|
|
onStop={updateSize}
|
2021-04-28 10:28:39 +00:00
|
|
|
ref={resizableRef}
|
2020-02-18 19:56:58 +00:00
|
|
|
snapGrid={{ x: props.parentColumnSpace, y: props.parentRowSpace }}
|
2021-07-06 09:21:46 +00:00
|
|
|
// Used only for performance tracking, can be removed after optimization.
|
|
|
|
|
zWidgetId={props.widgetId}
|
|
|
|
|
zWidgetType={props.type}
|
2019-09-22 20:25:05 +00:00
|
|
|
>
|
2020-02-18 20:35:52 +00:00
|
|
|
<VisibilityContainer
|
|
|
|
|
padding={props.paddingOffset}
|
2021-04-28 10:28:39 +00:00
|
|
|
visible={!!props.isVisible}
|
2020-02-18 20:35:52 +00:00
|
|
|
>
|
|
|
|
|
{props.children}
|
|
|
|
|
</VisibilityContainer>
|
2020-02-18 19:56:58 +00:00
|
|
|
</Resizable>
|
2019-09-22 20:25:05 +00:00
|
|
|
);
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
});
|
2019-09-22 20:25:05 +00:00
|
|
|
export default ResizableComponent;
|