seat-editor 3.1.6 → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,6 @@ import React, { useEffect, useMemo, useRef, useState, useImperativeHandle, } fro
|
|
|
3
3
|
import { TransformWrapper, TransformComponent, } from "react-zoom-pan-pinch";
|
|
4
4
|
import { useAppDispatch, useAppSelector } from "../../hooks/use-redux";
|
|
5
5
|
import Layers from "../../components/layer-v4";
|
|
6
|
-
import { isEmpty } from "lodash";
|
|
7
6
|
import { getTranslate } from "../board-v3/utils";
|
|
8
7
|
const LayerView = (props) => {
|
|
9
8
|
const { componentProps, extraComponentProps, onSelectComponent, onCurrentStateChange, mappingKey, statusKey, defaultBackground, iconTags, tooltipProps, onRightClick, allowTooltip = true, tableMatchKey, eventMatchTable, ghostAttributes, onDrop, onSwitch, refs, } = props;
|
|
@@ -18,6 +17,7 @@ const LayerView = (props) => {
|
|
|
18
17
|
y: 0,
|
|
19
18
|
visible: false,
|
|
20
19
|
});
|
|
20
|
+
console.log("tooltip", tooltip);
|
|
21
21
|
const isDragging = useRef(false);
|
|
22
22
|
const [panningGroup, setPanningGroup] = useState(false);
|
|
23
23
|
const [scale, setScale] = useState(1);
|
|
@@ -342,7 +342,7 @@ const LayerView = (props) => {
|
|
|
342
342
|
if (!hasMoved) {
|
|
343
343
|
const dataId = JSON.parse(targetGroup.getAttribute("data-id") || "{}");
|
|
344
344
|
isDragging.current = false;
|
|
345
|
-
const dataGroupEmty =
|
|
345
|
+
const dataGroupEmty = !dataId;
|
|
346
346
|
// TOOLTIP ACTION
|
|
347
347
|
const svgSize = svg.getBoundingClientRect();
|
|
348
348
|
const widthScreeen = svgSize.width;
|
|
@@ -373,7 +373,9 @@ const LayerView = (props) => {
|
|
|
373
373
|
else if (relY === centerY) {
|
|
374
374
|
newY = relY;
|
|
375
375
|
}
|
|
376
|
+
console.log({ dataGroupEmty, }, e.button);
|
|
376
377
|
const rightClick = e.button === 2 && !dataGroupEmty && allowTooltip;
|
|
378
|
+
console.log({ rightClick });
|
|
377
379
|
setTooltip({
|
|
378
380
|
x: newX,
|
|
379
381
|
y: newY,
|
|
@@ -537,7 +539,7 @@ const LayerView = (props) => {
|
|
|
537
539
|
{/* 🧠 Ghost universal */}
|
|
538
540
|
</svg>
|
|
539
541
|
{tooltip.visible && (<div className={`seat-editor tooltip-container ${tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.className}`} style={Object.assign({ top: tooltip.y, left: tooltip.x, minWidth: widthTooltip + "px" }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.style)}>
|
|
540
|
-
|
|
542
|
+
{tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.children}
|
|
541
543
|
</div>)}
|
|
542
544
|
</TransformComponent>
|
|
543
545
|
</TransformWrapper>
|