UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

36 lines 2.29 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React, { memo } from "react"; import { MiniMap as ReactFlowMiniMap } from "@xyflow/react"; import { miniMapUtils } from "./utils.js"; /** * Mini-map support for for React Flow v12. * @deprecated (v26) will be removed when `MiniMap` supports v12 directly */ export var MiniMapV12 = memo(function (_a) { var _b; var _c = _a.enableNavigation, enableNavigation = _c === void 0 ? false : _c, _d = _a.nodeClassName, nodeClassName = _d === void 0 ? miniMapUtils.nodeClassName : _d, _e = _a.nodeColor, nodeColor = _e === void 0 ? miniMapUtils.nodeColor : _e, _f = _a.nodeStrokeColor, nodeStrokeColor = _f === void 0 ? miniMapUtils.borderColor : _f, wrapperProps = _a.wrapperProps, minimapProps = __rest(_a, ["enableNavigation", "nodeClassName", "nodeColor", "nodeStrokeColor", "wrapperProps"]); return (React.createElement("div", __assign({}, wrapperProps, { style: enableNavigation ? __assign(__assign({}, ((_b = wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style) !== null && _b !== void 0 ? _b : {})), { cursor: "grab" }) : wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style }), React.createElement(ReactFlowMiniMap, __assign({ nodeClassName: nodeClassName, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor }, minimapProps, { zoomable: enableNavigation, pannable: enableNavigation })))); }); //# sourceMappingURL=MiniMapV12.js.map