@pisell/materials 1.8.54 → 1.8.56
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/async/view.js +1 -1
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/async/view.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +37 -37
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +37 -37
- package/es/components/buttonGroupPreview/index.js +8 -4
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +207 -49
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +33 -2
- package/es/components/pisellFloorMapLayout/appearance/floorMapAppearance.js +50 -2
- package/es/components/pisellFloorMapLayout/components/EdgeLayer.js +252 -0
- package/es/components/pisellFloorMapLayout/components/EdgeLayer.less +11 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.js +179 -29
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.less +0 -28
- package/es/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.js +131 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.less +65 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +5 -4
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +12 -1
- package/es/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.js +8 -1
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.js +16 -8
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.less +69 -17
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +290 -147
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +210 -11
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.js +81 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.js +21 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.less +74 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +3 -1
- package/es/components/pisellFloorMapLayout/components/NodePortMarkers.js +70 -0
- package/es/components/pisellFloorMapLayout/components/NodePortMarkers.less +33 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +13 -5
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +2 -0
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -1
- package/es/components/pisellFloorMapLayout/floorMapLayoutConstants.js +1 -1
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEdgeEditing.js +340 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEdgeViewModel.js +102 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +244 -84
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +54 -0
- package/es/components/pisellFloorMapLayout/hooks/useShopFloorPlanSubscription.js +7 -4
- package/es/components/pisellFloorMapLayout/index.d.ts +5 -1
- package/es/components/pisellFloorMapLayout/locales-ja.js +14 -2
- package/es/components/pisellFloorMapLayout/locales-pt.js +14 -2
- package/es/components/pisellFloorMapLayout/locales.js +161 -8
- package/es/components/pisellFloorMapLayout/types.d.ts +86 -4
- package/es/components/pisellFloorMapLayout/types.js +5 -1
- package/es/components/pisellFloorMapLayout/utils/alignSnap.js +170 -0
- package/es/components/pisellFloorMapLayout/utils/batchScenePlacementLayout.js +86 -0
- package/es/components/pisellFloorMapLayout/utils/edgeRouting.js +942 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +7 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasStage.js +23 -1
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +11 -2
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +20 -3
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +11 -5
- package/es/components/pisellFloorMapLayout/utils/floorMapOverviewLayout.js +5 -3
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +20 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.js +62 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +83 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.js +29 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapToolbarPalette.js +51 -0
- package/es/components/productCard/cartSkuCard/components/BookingItem/index.js +14 -0
- package/es/components/productCard/cartSkuCard/components/BookingItem/index.less +32 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.less +4 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +1 -2
- package/es/components/productCard/cartSkuCard/index.js +17 -11
- package/es/components/productCard/lineItem/BookingLineItem.js +17 -6
- package/es/components/productCard/lineItem/components/Holders/index.js +51 -0
- package/es/components/productCard/lineItem/components/Holders/index.less +39 -0
- package/es/components/productCard/lineItem/components/Resources/index.js +45 -0
- package/es/components/productCard/lineItem/components/TimeRange/index.js +64 -0
- package/es/components/productCard/lineItem/index.js +5 -2
- package/es/components/productCard/lineItem/index.less +21 -10
- package/es/components/productCard/types.d.ts +1 -0
- package/es/index.d.ts +6 -2
- package/es/index.js +6 -2
- package/es/pisell-materials.tw.css +3 -0
- package/lib/components/buttonGroupPreview/index.js +8 -4
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +206 -48
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +33 -2
- package/lib/components/pisellFloorMapLayout/appearance/floorMapAppearance.js +50 -2
- package/lib/components/pisellFloorMapLayout/components/EdgeLayer.js +255 -0
- package/lib/components/pisellFloorMapLayout/components/EdgeLayer.less +11 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.js +179 -29
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.less +0 -28
- package/lib/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.js +134 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.less +65 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +4 -3
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +12 -1
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.js +8 -1
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.js +16 -8
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.less +69 -17
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +287 -144
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +210 -11
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.js +84 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.js +23 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.less +74 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +3 -1
- package/lib/components/pisellFloorMapLayout/components/NodePortMarkers.js +73 -0
- package/lib/components/pisellFloorMapLayout/components/NodePortMarkers.less +33 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +12 -4
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +2 -0
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -1
- package/lib/components/pisellFloorMapLayout/floorMapLayoutConstants.js +1 -1
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEdgeEditing.js +341 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEdgeViewModel.js +103 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +242 -82
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +54 -0
- package/lib/components/pisellFloorMapLayout/hooks/useShopFloorPlanSubscription.js +7 -4
- package/lib/components/pisellFloorMapLayout/index.d.ts +5 -1
- package/lib/components/pisellFloorMapLayout/locales-ja.js +14 -2
- package/lib/components/pisellFloorMapLayout/locales-pt.js +14 -2
- package/lib/components/pisellFloorMapLayout/locales.js +161 -8
- package/lib/components/pisellFloorMapLayout/types.d.ts +86 -4
- package/lib/components/pisellFloorMapLayout/types.js +5 -0
- package/lib/components/pisellFloorMapLayout/utils/alignSnap.js +170 -0
- package/lib/components/pisellFloorMapLayout/utils/batchScenePlacementLayout.js +87 -0
- package/lib/components/pisellFloorMapLayout/utils/edgeRouting.js +956 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +7 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasStage.js +23 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +11 -2
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +21 -2
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +11 -5
- package/lib/components/pisellFloorMapLayout/utils/floorMapOverviewLayout.js +5 -3
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +20 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.js +64 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +83 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.js +29 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapToolbarPalette.js +54 -0
- package/lib/components/productCard/cartSkuCard/components/BookingItem/index.js +17 -0
- package/lib/components/productCard/cartSkuCard/components/BookingItem/index.less +32 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.less +4 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +1 -2
- package/lib/components/productCard/cartSkuCard/index.js +17 -11
- package/lib/components/productCard/lineItem/BookingLineItem.js +17 -6
- package/lib/components/productCard/lineItem/components/Holders/index.js +53 -0
- package/lib/components/productCard/lineItem/components/Holders/index.less +39 -0
- package/lib/components/productCard/lineItem/components/Resources/index.js +47 -0
- package/lib/components/productCard/lineItem/components/TimeRange/index.js +67 -0
- package/lib/components/productCard/lineItem/index.js +5 -2
- package/lib/components/productCard/lineItem/index.less +21 -10
- package/lib/components/productCard/types.d.ts +1 -0
- package/lib/index.d.ts +6 -2
- package/lib/index.js +11 -0
- package/lib/pisell-materials.tw.css +3 -0
- package/package.json +6 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { ANCHORS } from "../utils/edgeRouting.js";
|
|
2
|
+
import React, { useCallback, useRef } from "react";
|
|
3
|
+
import { locales } from "@pisell/utils";
|
|
4
|
+
import { Button, Form, Input, InputNumber, Popconfirm, Select } from "antd";
|
|
5
|
+
import { CloseOutlined } from "@ant-design/icons";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
import "./FloorMapEdgeEditPanel.less";
|
|
8
|
+
//#region src/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.tsx
|
|
9
|
+
/**
|
|
10
|
+
* FloorMapEdgeEditPanel - 选中连线后的侧栏编辑
|
|
11
|
+
*/
|
|
12
|
+
const PREFIX = "pisell-floor-map-layout";
|
|
13
|
+
const I18N = "pisell-floor-map-layout.edge-panel";
|
|
14
|
+
const STATUS_OPTIONS = [
|
|
15
|
+
{
|
|
16
|
+
value: "online",
|
|
17
|
+
labelKey: `${I18N}.status-online`
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "offline",
|
|
21
|
+
labelKey: `${I18N}.status-offline`
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: "warning",
|
|
25
|
+
labelKey: `${I18N}.status-warning`
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "unknown",
|
|
29
|
+
labelKey: `${I18N}.status-unknown`
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
const ANCHOR_OPTIONS = ANCHORS.map((a) => ({
|
|
33
|
+
value: a,
|
|
34
|
+
label: a
|
|
35
|
+
}));
|
|
36
|
+
function nodeLabel(config, instanceId) {
|
|
37
|
+
var _config$sceneElements, _el$name;
|
|
38
|
+
const el = ((_config$sceneElements = config.sceneElements) !== null && _config$sceneElements !== void 0 ? _config$sceneElements : []).find((e) => e.instanceId === instanceId);
|
|
39
|
+
return (el === null || el === void 0 || (_el$name = el.name) === null || _el$name === void 0 ? void 0 : _el$name.trim()) || instanceId;
|
|
40
|
+
}
|
|
41
|
+
function FloorMapEdgeEditPanel(props) {
|
|
42
|
+
var _edge$sourceAnchor, _edge$targetAnchor, _edge$sourceLabel, _edge$targetLabel, _edge$label, _edge$status, _edge$color, _edge$strokeWidth;
|
|
43
|
+
const { edge, config, onUpdate, onClose, onDelete, layoutDraftDirty, className } = props;
|
|
44
|
+
const t = useCallback((key) => locales.getText(key), []);
|
|
45
|
+
const panelScrollRef = useRef(null);
|
|
46
|
+
/** 与图元编辑面板一致:下拉挂到表单项父节点,避免侧栏 overflow 裁切 */
|
|
47
|
+
const getSelectPopupContainer = useCallback((node) => {
|
|
48
|
+
var _ref, _node$parentElement;
|
|
49
|
+
return (_ref = (_node$parentElement = node.parentElement) !== null && _node$parentElement !== void 0 ? _node$parentElement : panelScrollRef.current) !== null && _ref !== void 0 ? _ref : document.body;
|
|
50
|
+
}, []);
|
|
51
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
52
|
+
ref: panelScrollRef,
|
|
53
|
+
className: classNames(`${PREFIX}-edge-edit-panel`, className)
|
|
54
|
+
}, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-edge-edit-panel-header` }, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}-edge-edit-panel-title` }, t(`${I18N}.title`)), /* @__PURE__ */ React.createElement(Button, {
|
|
55
|
+
type: "text",
|
|
56
|
+
size: "large",
|
|
57
|
+
className: `${PREFIX}-edge-edit-panel-close`,
|
|
58
|
+
icon: /* @__PURE__ */ React.createElement(CloseOutlined, null),
|
|
59
|
+
onClick: onClose,
|
|
60
|
+
"aria-label": "close"
|
|
61
|
+
})), layoutDraftDirty ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-edge-edit-panel-dirty-hint` }, t(`${I18N}.dirty-hint`)) : null, /* @__PURE__ */ React.createElement(Form, {
|
|
62
|
+
layout: "vertical",
|
|
63
|
+
size: "large",
|
|
64
|
+
className: `${PREFIX}-edge-edit-form`
|
|
65
|
+
}, /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.source-node`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
66
|
+
value: nodeLabel(config, edge.sourceId),
|
|
67
|
+
disabled: true
|
|
68
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.target-node`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
69
|
+
value: nodeLabel(config, edge.targetId),
|
|
70
|
+
disabled: true
|
|
71
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.source-anchor`) }, /* @__PURE__ */ React.createElement(Select, {
|
|
72
|
+
value: (_edge$sourceAnchor = edge.sourceAnchor) !== null && _edge$sourceAnchor !== void 0 ? _edge$sourceAnchor : "right",
|
|
73
|
+
options: ANCHOR_OPTIONS,
|
|
74
|
+
getPopupContainer: getSelectPopupContainer,
|
|
75
|
+
onChange: (v) => onUpdate({ sourceAnchor: v })
|
|
76
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.target-anchor`) }, /* @__PURE__ */ React.createElement(Select, {
|
|
77
|
+
value: (_edge$targetAnchor = edge.targetAnchor) !== null && _edge$targetAnchor !== void 0 ? _edge$targetAnchor : "left",
|
|
78
|
+
options: ANCHOR_OPTIONS,
|
|
79
|
+
getPopupContainer: getSelectPopupContainer,
|
|
80
|
+
onChange: (v) => onUpdate({ targetAnchor: v })
|
|
81
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.source-label`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
82
|
+
value: (_edge$sourceLabel = edge.sourceLabel) !== null && _edge$sourceLabel !== void 0 ? _edge$sourceLabel : "",
|
|
83
|
+
onChange: (e) => onUpdate({ sourceLabel: e.target.value }),
|
|
84
|
+
placeholder: "G3/WAN"
|
|
85
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.target-label`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
86
|
+
value: (_edge$targetLabel = edge.targetLabel) !== null && _edge$targetLabel !== void 0 ? _edge$targetLabel : "",
|
|
87
|
+
onChange: (e) => onUpdate({ targetLabel: e.target.value })
|
|
88
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.center-label`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
89
|
+
value: (_edge$label = edge.label) !== null && _edge$label !== void 0 ? _edge$label : "",
|
|
90
|
+
onChange: (e) => onUpdate({ label: e.target.value })
|
|
91
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.status`) }, /* @__PURE__ */ React.createElement(Select, {
|
|
92
|
+
value: (_edge$status = edge.status) !== null && _edge$status !== void 0 ? _edge$status : "unknown",
|
|
93
|
+
options: STATUS_OPTIONS.map((o) => ({
|
|
94
|
+
value: o.value,
|
|
95
|
+
label: t(o.labelKey)
|
|
96
|
+
})),
|
|
97
|
+
getPopupContainer: getSelectPopupContainer,
|
|
98
|
+
onChange: (v) => onUpdate({ status: v })
|
|
99
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.color`) }, /* @__PURE__ */ React.createElement(Input, {
|
|
100
|
+
value: (_edge$color = edge.color) !== null && _edge$color !== void 0 ? _edge$color : "",
|
|
101
|
+
onChange: (e) => onUpdate({ color: e.target.value || void 0 }),
|
|
102
|
+
placeholder: "#12B76A"
|
|
103
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.stroke-width`) }, /* @__PURE__ */ React.createElement(InputNumber, {
|
|
104
|
+
min: .5,
|
|
105
|
+
max: 8,
|
|
106
|
+
step: .5,
|
|
107
|
+
value: (_edge$strokeWidth = edge.strokeWidth) !== null && _edge$strokeWidth !== void 0 ? _edge$strokeWidth : 1.5,
|
|
108
|
+
onChange: (v) => onUpdate({ strokeWidth: v !== null && v !== void 0 ? v : void 0 }),
|
|
109
|
+
style: { width: "100%" }
|
|
110
|
+
})), /* @__PURE__ */ React.createElement(Form.Item, { label: t(`${I18N}.dashed`) }, /* @__PURE__ */ React.createElement(Select, {
|
|
111
|
+
value: edge.dashed ? "yes" : "no",
|
|
112
|
+
options: [{
|
|
113
|
+
value: "no",
|
|
114
|
+
label: t(`${I18N}.dashed-no`)
|
|
115
|
+
}, {
|
|
116
|
+
value: "yes",
|
|
117
|
+
label: t(`${I18N}.dashed-yes`)
|
|
118
|
+
}],
|
|
119
|
+
getPopupContainer: getSelectPopupContainer,
|
|
120
|
+
onChange: (v) => onUpdate({ dashed: v === "yes" })
|
|
121
|
+
})), onDelete ? /* @__PURE__ */ React.createElement(Popconfirm, {
|
|
122
|
+
title: t(`${I18N}.delete-confirm`),
|
|
123
|
+
onConfirm: onDelete
|
|
124
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
125
|
+
danger: true,
|
|
126
|
+
block: true,
|
|
127
|
+
size: "large"
|
|
128
|
+
}, t(`${I18N}.delete`))) : null));
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { FloorMapEdgeEditPanel };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** 连线编辑侧栏:尺寸与图元 {@link FloorMapEditPanel} 对齐 */
|
|
2
|
+
.pisell-floor-map-layout-edge-edit-panel {
|
|
3
|
+
width: 280px;
|
|
4
|
+
/** 未放入 edit-panel-wrap 时的兜底;wrap 内由父级 flex 限制为 100% 高度 */
|
|
5
|
+
max-height: 80vh;
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
touch-action: pan-y;
|
|
8
|
+
padding: 12px;
|
|
9
|
+
padding-bottom: calc(
|
|
10
|
+
12px + var(--fmap-viewport-dock-bottom-clearance, 78px)
|
|
11
|
+
);
|
|
12
|
+
background: #fff;
|
|
13
|
+
border: 1px solid #e8e8e8;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pisell-floor-map-layout-edge-edit-panel-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
margin-bottom: 12px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pisell-floor-map-layout-edge-edit-panel-title {
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
color: #262626;
|
|
30
|
+
line-height: 1.4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pisell-floor-map-layout-edge-edit-panel-close {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
color: rgba(0, 0, 0, 0.45);
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
color: rgba(0, 0, 0, 0.88);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pisell-floor-map-layout-edge-edit-panel-dirty-hint {
|
|
43
|
+
margin: 0 0 10px;
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
line-height: 1.45;
|
|
46
|
+
color: #595959;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** 手机抽屉内与图元面板同款铺满 */
|
|
50
|
+
.pisell-floor-map-layout-edit-panel--phone-drawer.pisell-floor-map-layout-edge-edit-panel {
|
|
51
|
+
flex: 1;
|
|
52
|
+
min-height: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
max-height: none;
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
border: none;
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
overflow-x: hidden;
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
-webkit-overflow-scrolling: touch;
|
|
61
|
+
padding-bottom: calc(
|
|
62
|
+
12px + env(safe-area-inset-bottom, 0px) +
|
|
63
|
+
var(--fmap-viewport-dock-bottom-clearance, 78px)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types.js";
|
|
2
2
|
import { FLOOR_MAP_BUILTIN_SHAPES, getFloorMapBuiltinShapeDef } from "../utils/floorMapBuiltinShapes.js";
|
|
3
|
-
import { getElementKindConfig, getSwappableElementKindsInSameCategory, isFloorMapBuiltinShapeElementKind, isFloorMapImageElementKind, patchSceneElementForKindSwitch, resolveDataBindingPolicy } from "../utils/floorMapElementKindUtils.js";
|
|
4
|
-
import { formatDataRecordOptionLabel } from "../utils/floorMapDataRecordLabel.js";
|
|
3
|
+
import { FLOOR_MAP_RESOURCE_PLACE_DEFAULT, getElementKindConfig, getSwappableElementKindsInSameCategory, isFloorMapBuiltinShapeElementKind, isFloorMapImageElementKind, patchSceneElementForKindSwitch, resolveDataBindingPolicy } from "../utils/floorMapElementKindUtils.js";
|
|
5
4
|
import { FLOOR_MAP_CONFIRM_OVERLAY_Z_INDEX } from "../floorMapLayoutConstants.js";
|
|
6
5
|
import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
7
6
|
import { getFloorMapCanvasDisplayName, initFloorMapLayoutLocales } from "../utils/floorMapCanvasDisplay.js";
|
|
8
7
|
import { buildNameAsTitleExtensionsPatch, isElementNameAsTitleEnabled } from "../utils/floorMapElementNameAsTitle.js";
|
|
9
8
|
import FloorMapDataForm from "./FloorMapDataForm.js";
|
|
9
|
+
import { formatDataRecordOptionLabel } from "../utils/floorMapDataRecordLabel.js";
|
|
10
10
|
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
11
11
|
import { locales } from "@pisell/utils";
|
|
12
12
|
import { Button, Checkbox, Form, Input, InputNumber, Popconfirm, Select, message } from "antd";
|
|
@@ -109,8 +109,9 @@ function FloorMapEditPanel(props) {
|
|
|
109
109
|
var _builtinDef$defaultSi, _builtinDef$defaultSi2, _sceneElement$name, _sceneElement$zIndex, _sceneElement$width, _sceneElement$height, _sceneElement$imageUr, _sceneElement$builtin;
|
|
110
110
|
/** 内置图形宽高优先采用当前选定预设的 defaultSize,未选则给一个保底正方形 */
|
|
111
111
|
const builtinDef = isBuiltinShapeKind ? getFloorMapBuiltinShapeDef(sceneElement.builtinShapeKey) : void 0;
|
|
112
|
-
const
|
|
113
|
-
const
|
|
112
|
+
const bindingPolicy = resolveDataBindingPolicy(kindConfig);
|
|
113
|
+
const dw = isImageKind ? 400 : isBuiltinShapeKind ? (_builtinDef$defaultSi = builtinDef === null || builtinDef === void 0 ? void 0 : builtinDef.defaultSize.width) !== null && _builtinDef$defaultSi !== void 0 ? _builtinDef$defaultSi : 96 : bindingPolicy !== "none" ? FLOOR_MAP_RESOURCE_PLACE_DEFAULT.width : 48;
|
|
114
|
+
const dh = isImageKind ? 240 : isBuiltinShapeKind ? (_builtinDef$defaultSi2 = builtinDef === null || builtinDef === void 0 ? void 0 : builtinDef.defaultSize.height) !== null && _builtinDef$defaultSi2 !== void 0 ? _builtinDef$defaultSi2 : 96 : bindingPolicy !== "none" ? FLOOR_MAP_RESOURCE_PLACE_DEFAULT.height : 48;
|
|
114
115
|
return {
|
|
115
116
|
x: sceneElement.x,
|
|
116
117
|
y: sceneElement.y,
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
.pisell-floor-map-layout-edit-panel {
|
|
2
2
|
width: 280px;
|
|
3
3
|
padding: 12px;
|
|
4
|
+
/**
|
|
5
|
+
* 桌面编辑面板可纵向滚动:底部多留一截,避免 Apply 等被右下 ViewControls Dock 挡住。
|
|
6
|
+
* 手机抽屉用 `--phone-drawer` 单独处理 safe-area,不叠加此项。
|
|
7
|
+
*/
|
|
8
|
+
padding-bottom: calc(
|
|
9
|
+
12px + var(--fmap-viewport-dock-bottom-clearance, 78px)
|
|
10
|
+
);
|
|
4
11
|
background: #fff;
|
|
5
12
|
border: 1px solid #e8e8e8;
|
|
6
13
|
border-radius: 8px;
|
|
7
14
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
15
|
+
/** 未放入 edit-panel-wrap 时的兜底;wrap 内由父级 flex 限制为 100% 高度 */
|
|
8
16
|
max-height: 80vh;
|
|
9
17
|
overflow-y: auto;
|
|
10
18
|
touch-action: pan-y;
|
|
@@ -155,7 +163,10 @@
|
|
|
155
163
|
overflow-x: hidden;
|
|
156
164
|
overflow-y: auto;
|
|
157
165
|
-webkit-overflow-scrolling: touch;
|
|
158
|
-
padding-bottom: calc(
|
|
166
|
+
padding-bottom: calc(
|
|
167
|
+
12px + env(safe-area-inset-bottom, 0px) +
|
|
168
|
+
var(--fmap-viewport-dock-bottom-clearance, 78px)
|
|
169
|
+
);
|
|
159
170
|
}
|
|
160
171
|
|
|
161
172
|
.pisell-floor-map-layout-edit-panel-wrap-constrained .pisell-floor-map-layout-edit-panel {
|
|
@@ -8,14 +8,21 @@ import classNames from "classnames";
|
|
|
8
8
|
*/
|
|
9
9
|
const PREFIX = "pisell-floor-map-layout";
|
|
10
10
|
function FloorMapEditQuickActions(props) {
|
|
11
|
-
const { className, labels, isLocked, onToggleLock, onDuplicate, onDelete } = props;
|
|
11
|
+
const { className, labels, isLocked, onToggleLock, onDuplicate, onDelete, viewportScale = 1 } = props;
|
|
12
12
|
const stopBubble = useCallback((e) => {
|
|
13
13
|
e.stopPropagation();
|
|
14
14
|
}, []);
|
|
15
|
+
const safeScale = Math.max(viewportScale, .01);
|
|
16
|
+
const inv = 1 / safeScale;
|
|
17
|
+
const gap = 10 / safeScale;
|
|
15
18
|
return /* @__PURE__ */ React.createElement("div", {
|
|
16
19
|
role: "toolbar",
|
|
17
20
|
"aria-label": labels.ariaToolbar,
|
|
18
21
|
className: classNames(`${PREFIX}-edit-quick-actions`, isLocked && `${PREFIX}-edit-quick-actions--locked`, className),
|
|
22
|
+
style: {
|
|
23
|
+
transform: `translate(-50%, ${gap}px) scale(${inv})`,
|
|
24
|
+
transformOrigin: "top center"
|
|
25
|
+
},
|
|
19
26
|
onPointerDown: (e) => e.stopPropagation()
|
|
20
27
|
}, /* @__PURE__ */ React.createElement(Tooltip, { title: isLocked ? labels.unlock : labels.lock }, /* @__PURE__ */ React.createElement(Button, {
|
|
21
28
|
type: "text",
|
|
@@ -18,9 +18,10 @@ import "./FloorMapOverview.less";
|
|
|
18
18
|
* 设计要点:
|
|
19
19
|
* - 不再自带 TransformWrapper / ResizeObserver / fit 算法;
|
|
20
20
|
* - 每个画布作为独立区域,仅一条细边框作分隔,无背景色/网格;
|
|
21
|
-
* -
|
|
21
|
+
* - 画布名显示在边框外的标题带;标题不拦截图元交互;
|
|
22
22
|
* - 仅渲染 ItemLayer(阅读态),与单画布的 hover/click 行为一致;编辑层不渲染。
|
|
23
23
|
*/
|
|
24
|
+
const I18N_OVERVIEW_AREA_BADGE = "pisell-floor-map-layout.overview.area-title-badge";
|
|
24
25
|
const I18N_EMPTY = "pisell-floor-map-layout.overview.empty";
|
|
25
26
|
function FloorMapOverview(props) {
|
|
26
27
|
var _engineCtx$engine;
|
|
@@ -54,23 +55,30 @@ function FloorMapOverview(props) {
|
|
|
54
55
|
const inverseScale = 1 / safeScale;
|
|
55
56
|
return /* @__PURE__ */ React.createElement("div", {
|
|
56
57
|
key: area.canvasId,
|
|
57
|
-
className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area`,
|
|
58
|
+
className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area-block`,
|
|
58
59
|
style: {
|
|
59
60
|
position: "absolute",
|
|
60
61
|
left: area.x,
|
|
61
62
|
top: area.y,
|
|
62
|
-
width: area.contentWidth
|
|
63
|
-
height: area.contentHeight
|
|
63
|
+
width: area.contentWidth
|
|
64
64
|
}
|
|
65
|
-
}, /* @__PURE__ */ React.createElement("
|
|
65
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
66
66
|
className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area-title`,
|
|
67
67
|
title: displayName,
|
|
68
68
|
style: {
|
|
69
|
+
height: area.titleBandHeight,
|
|
69
70
|
transform: `scale(${inverseScale})`,
|
|
70
71
|
transformOrigin: "top left",
|
|
71
|
-
|
|
72
|
+
width: `${100 * safeScale}%`,
|
|
73
|
+
maxWidth: `${area.contentWidth * safeScale}px`
|
|
74
|
+
}
|
|
75
|
+
}, /* @__PURE__ */ React.createElement("span", { className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area-title-inner` }, /* @__PURE__ */ React.createElement("span", { className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area-title-badge` }, locales.getText(I18N_OVERVIEW_AREA_BADGE)), /* @__PURE__ */ React.createElement("span", { className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area-title-text` }, displayName))), /* @__PURE__ */ React.createElement("div", {
|
|
76
|
+
className: `${FLOOR_MAP_LAYOUT_CLASS_PREFIX}-overview-area`,
|
|
77
|
+
style: {
|
|
78
|
+
width: area.contentWidth,
|
|
79
|
+
height: area.contentHeight
|
|
72
80
|
}
|
|
73
|
-
},
|
|
81
|
+
}, /* @__PURE__ */ React.createElement(ItemLayer, {
|
|
74
82
|
items: area.items,
|
|
75
83
|
renderItem,
|
|
76
84
|
viewportScale,
|
|
@@ -87,7 +95,7 @@ function FloorMapOverview(props) {
|
|
|
87
95
|
onItemLeave,
|
|
88
96
|
getMergedItemWrapperStyle,
|
|
89
97
|
readModeSelectedItemId
|
|
90
|
-
}));
|
|
98
|
+
})));
|
|
91
99
|
}));
|
|
92
100
|
}
|
|
93
101
|
//#endregion
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
* 视觉规则:
|
|
6
6
|
* - 大画布自身没有背景(沿用外层 map-area 背景);
|
|
7
7
|
* - 每个区域只有一条细边框 + 圆角;
|
|
8
|
-
* -
|
|
8
|
+
* - 标题条在画布边框外(上方),装箱时为标题带预留高度;
|
|
9
|
+
* - 区内资源图元与标题分层,标题不拦截交互。
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
.pisell-floor-map-layout-overview {
|
|
13
|
+
&-area-block {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
&--empty {
|
|
13
18
|
display: flex;
|
|
14
19
|
align-items: center;
|
|
@@ -39,27 +44,74 @@
|
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
43
|
-
* pointer-events: none 让标题不拦截图元交互(点击/拖拽)。
|
|
47
|
+
* 外置标题带:占布局预留高度,标签在带内底对齐,与下方画布边框留出间距。
|
|
44
48
|
*/
|
|
45
49
|
&-area-title {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
display: inline-block;
|
|
51
|
-
max-width: calc(100% - 16px);
|
|
52
|
-
padding: 2px 10px;
|
|
53
|
-
font-size: 12px;
|
|
54
|
-
line-height: 1.5;
|
|
55
|
-
color: rgba(0, 0, 0, 0.65);
|
|
56
|
-
background: rgba(255, 255, 255, 0.85);
|
|
57
|
-
backdrop-filter: blur(8px);
|
|
58
|
-
border-radius: 999px;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: flex-end;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
padding-bottom: 8px;
|
|
59
54
|
pointer-events: none;
|
|
55
|
+
overflow: visible;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&-area-title-inner {
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 6px;
|
|
62
|
+
max-width: 100%;
|
|
63
|
+
padding: 4px 12px 4px 8px;
|
|
64
|
+
background: #fff;
|
|
65
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
66
|
+
border-left: 3px solid var(--fmap-primary, #1677ff);
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
box-shadow: 0 2px 8px rgba(16, 24, 40, 0.12);
|
|
69
|
+
line-height: 1.35;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
|
|
72
|
+
[data-appearance-mode='dark'] & {
|
|
73
|
+
background: rgba(28, 28, 30, 0.94);
|
|
74
|
+
border-color: rgba(255, 255, 255, 0.18);
|
|
75
|
+
border-left-color: var(--fmap-primary, #1677ff);
|
|
76
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-area-title-badge {
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
padding: 1px 6px;
|
|
83
|
+
font-size: 10px;
|
|
84
|
+
font-weight: 700;
|
|
85
|
+
letter-spacing: 0.04em;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
color: var(--fmap-primary, #1677ff);
|
|
88
|
+
background: color-mix(
|
|
89
|
+
in srgb,
|
|
90
|
+
var(--fmap-primary, #1677ff) 14%,
|
|
91
|
+
#fff
|
|
92
|
+
);
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
|
|
95
|
+
[data-appearance-mode='dark'] & {
|
|
96
|
+
background: color-mix(
|
|
97
|
+
in srgb,
|
|
98
|
+
var(--fmap-primary, #1677ff) 22%,
|
|
99
|
+
rgba(28, 28, 30, 1)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-area-title-text {
|
|
105
|
+
min-width: 0;
|
|
106
|
+
font-size: 13px;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
color: #101828;
|
|
60
109
|
white-space: nowrap;
|
|
61
110
|
overflow: hidden;
|
|
62
111
|
text-overflow: ellipsis;
|
|
63
|
-
|
|
112
|
+
|
|
113
|
+
[data-appearance-mode='dark'] & {
|
|
114
|
+
color: #f5f5f5;
|
|
115
|
+
}
|
|
64
116
|
}
|
|
65
117
|
}
|