@fleet-frontend/mower-maps 0.2.6-beta.4 → 0.2.6-beta.6
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +148 -49
- package/dist/index.js +148 -49
- package/dist/render/MowerPartitionPickerMap.d.ts +1 -1
- package/dist/render/MowerPartitionPickerMap.d.ts.map +1 -1
- package/dist/render/partitionPicker/constants.d.ts +6 -2
- package/dist/render/partitionPicker/constants.d.ts.map +1 -1
- package/dist/render/partitionPicker/hooks/useMapViewport.d.ts +10 -1
- package/dist/render/partitionPicker/hooks/useMapViewport.d.ts.map +1 -1
- package/dist/render/partitionPicker/layers/MapGridBackground.d.ts.map +1 -1
- package/dist/render/partitionPicker/layers/PartitionNameLabels.d.ts +4 -2
- package/dist/render/partitionPicker/layers/PartitionNameLabels.d.ts.map +1 -1
- package/dist/render/partitionPicker/layers/PartitionPickerSvg.d.ts +2 -1
- package/dist/render/partitionPicker/layers/PartitionPickerSvg.d.ts.map +1 -1
- package/dist/render/partitionPicker/layers/SelectableBoundaryElement.d.ts +4 -2
- package/dist/render/partitionPicker/layers/SelectableBoundaryElement.d.ts.map +1 -1
- package/dist/render/partitionPicker/types.d.ts +23 -0
- package/dist/render/partitionPicker/types.d.ts.map +1 -1
- package/dist/render/partitionPicker/viewportUtils.d.ts +1 -2
- package/dist/render/partitionPicker/viewportUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { default as MowerMapRenderer } from './render/MowerMapRenderer';
|
|
|
2
2
|
export { default as BoundarySvgRender } from './render/BoundarySvgRender';
|
|
3
3
|
export { default as MowerPartitionPickerMap } from './render/MowerPartitionPickerMap';
|
|
4
4
|
export { getIsolatedBoundaryIds } from './render/partitionPicker/hooks/useIsolatedBoundaryIds';
|
|
5
|
-
export type { MowerPartitionPickerMapProps, MowerPartitionPickerMapRef, CssLength, ScreenPaddingBox, ScreenPaddingInput, PartitionPickerMapTransform, } from './render/partitionPicker/types';
|
|
5
|
+
export type { MowerPartitionPickerMapProps, MowerPartitionPickerMapRef, CssLength, ScreenPaddingBox, ScreenPaddingInput, PartitionPickerMapTransform, IsolatedBoundaryTapPayload, } from './render/partitionPicker/types';
|
|
6
6
|
export type { PartitionPickerStyleConfig, PartitionPickerBoundaryColors, PartitionPickerLabelStyles, PartitionPickerGridStyle, ResolvedPartitionPickerStyles, } from './render/partitionPicker/constants';
|
|
7
7
|
export { resolvePartitionPickerStyles, getPartitionPickerColors, getPartitionPickerLabelStyles, PARTITION_PICKER_COLORS_WEB, PARTITION_PICKER_COLORS_H5, PARTITION_PICKER_LABEL_STYLES_WEB, PARTITION_PICKER_LABEL_STYLES_H5, } from './render/partitionPicker/constants';
|
|
8
8
|
export { DEFAULT_SCREEN_PADDING, normalizeScreenPadding, } from './render/partitionPicker/types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,iBAAi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SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtD,YAAY,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -23439,6 +23439,73 @@ function computeFitViewBoxToContainer(content, containerWidth, containerHeight)
|
|
|
23439
23439
|
height: content.height,
|
|
23440
23440
|
};
|
|
23441
23441
|
}
|
|
23442
|
+
/** 地图内容在屏幕坐标系下的包围盒(meet 渲染,未考虑旋转) */
|
|
23443
|
+
function getContentScreenBounds(content, viewBox, containerWidth, containerHeight) {
|
|
23444
|
+
const { x: offsetX, y: offsetY, scale } = getViewBoxMeetOffset(viewBox, containerWidth, containerHeight);
|
|
23445
|
+
return {
|
|
23446
|
+
left: offsetX + (content.x - viewBox.x) * scale,
|
|
23447
|
+
top: offsetY + (content.y - viewBox.y) * scale,
|
|
23448
|
+
right: offsetX + (content.x + content.width - viewBox.x) * scale,
|
|
23449
|
+
bottom: offsetY + (content.y + content.height - viewBox.y) * scale,
|
|
23450
|
+
};
|
|
23451
|
+
}
|
|
23452
|
+
function contentFitsInScreenPadding(content, viewBox, pad, containerWidth, containerHeight) {
|
|
23453
|
+
const bounds = getContentScreenBounds(content, viewBox, containerWidth, containerHeight);
|
|
23454
|
+
return (bounds.left >= pad.left &&
|
|
23455
|
+
bounds.top >= pad.top &&
|
|
23456
|
+
bounds.right <= containerWidth - pad.right &&
|
|
23457
|
+
bounds.bottom <= containerHeight - pad.bottom);
|
|
23458
|
+
}
|
|
23459
|
+
function expandViewBoxFromCenter(viewBox, factor) {
|
|
23460
|
+
const centerX = viewBox.x + viewBox.width / 2;
|
|
23461
|
+
const centerY = viewBox.y + viewBox.height / 2;
|
|
23462
|
+
const width = viewBox.width * factor;
|
|
23463
|
+
const height = viewBox.height * factor;
|
|
23464
|
+
return {
|
|
23465
|
+
x: centerX - width / 2,
|
|
23466
|
+
y: centerY - height / 2,
|
|
23467
|
+
width,
|
|
23468
|
+
height,
|
|
23469
|
+
};
|
|
23470
|
+
}
|
|
23471
|
+
/** 将 viewBox 中心对齐到 padding 内矩形中心(增大 top/left → 内容向对应方向避让) */
|
|
23472
|
+
function applyViewBoxPaddingOffset(viewBox, pad, containerWidth, containerHeight) {
|
|
23473
|
+
const offsetX = ((pad.right - pad.left) / 2) * (viewBox.width / containerWidth);
|
|
23474
|
+
const offsetY = ((pad.bottom - pad.top) / 2) * (viewBox.height / containerHeight);
|
|
23475
|
+
return {
|
|
23476
|
+
...viewBox,
|
|
23477
|
+
x: viewBox.x + offsetX,
|
|
23478
|
+
y: viewBox.y + offsetY,
|
|
23479
|
+
};
|
|
23480
|
+
}
|
|
23481
|
+
function buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor) {
|
|
23482
|
+
const expanded = expandViewBoxFromCenter(baseFit, zoomOutFactor);
|
|
23483
|
+
return applyViewBoxPaddingOffset(expanded, pad, containerWidth, containerHeight);
|
|
23484
|
+
}
|
|
23485
|
+
function findMinimumZoomOutForPadding(content, baseFit, pad, containerWidth, containerHeight) {
|
|
23486
|
+
const fits = (zoomOutFactor) => contentFitsInScreenPadding(content, buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor), pad, containerWidth, containerHeight);
|
|
23487
|
+
if (fits(1)) {
|
|
23488
|
+
return 1;
|
|
23489
|
+
}
|
|
23490
|
+
const innerWidth = Math.max(containerWidth - pad.left - pad.right, 1);
|
|
23491
|
+
const innerHeight = Math.max(containerHeight - pad.top - pad.bottom, 1);
|
|
23492
|
+
const legacyScale = Math.min(innerWidth / containerWidth, innerHeight / containerHeight);
|
|
23493
|
+
let hi = legacyScale > 0 && legacyScale < 1 ? 1 / legacyScale : 2;
|
|
23494
|
+
while (!fits(hi) && hi < 1024) {
|
|
23495
|
+
hi *= 2;
|
|
23496
|
+
}
|
|
23497
|
+
let lo = 1;
|
|
23498
|
+
for (let i = 0; i < 32; i++) {
|
|
23499
|
+
const mid = (lo + hi) / 2;
|
|
23500
|
+
if (fits(mid)) {
|
|
23501
|
+
hi = mid;
|
|
23502
|
+
}
|
|
23503
|
+
else {
|
|
23504
|
+
lo = mid;
|
|
23505
|
+
}
|
|
23506
|
+
}
|
|
23507
|
+
return hi;
|
|
23508
|
+
}
|
|
23442
23509
|
/**
|
|
23443
23510
|
* 计算默认 fit viewBox
|
|
23444
23511
|
*
|
|
@@ -23450,26 +23517,8 @@ function computeFitViewBox(content, containerWidth, containerHeight, screenPaddi
|
|
|
23450
23517
|
if (isZeroScreenPadding(pad)) {
|
|
23451
23518
|
return baseFit;
|
|
23452
23519
|
}
|
|
23453
|
-
const
|
|
23454
|
-
|
|
23455
|
-
const scaleX = innerWidth / containerWidth;
|
|
23456
|
-
const scaleY = innerHeight / containerHeight;
|
|
23457
|
-
const scale = Math.min(scaleX, scaleY);
|
|
23458
|
-
if (!Number.isFinite(scale) || scale <= 0 || scale >= 1) {
|
|
23459
|
-
return baseFit;
|
|
23460
|
-
}
|
|
23461
|
-
const newWidth = baseFit.width / scale;
|
|
23462
|
-
const newHeight = baseFit.height / scale;
|
|
23463
|
-
const centerX = baseFit.x + baseFit.width / 2;
|
|
23464
|
-
const centerY = baseFit.y + baseFit.height / 2;
|
|
23465
|
-
const offsetX = ((pad.left - pad.right) / 2) * (newWidth / containerWidth);
|
|
23466
|
-
const offsetY = ((pad.top - pad.bottom) / 2) * (newHeight / containerHeight);
|
|
23467
|
-
return {
|
|
23468
|
-
x: centerX - newWidth / 2 + offsetX,
|
|
23469
|
-
y: centerY - newHeight / 2 + offsetY,
|
|
23470
|
-
width: newWidth,
|
|
23471
|
-
height: newHeight,
|
|
23472
|
-
};
|
|
23520
|
+
const zoomOutFactor = findMinimumZoomOutForPadding(content, baseFit, pad, containerWidth, containerHeight);
|
|
23521
|
+
return buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor);
|
|
23473
23522
|
}
|
|
23474
23523
|
function viewBoxToString(viewBox) {
|
|
23475
23524
|
return `${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}`;
|
|
@@ -30751,6 +30800,10 @@ const BoundarySvgRender = React__default.memo(({ mapJson, unStructMapData, id, m
|
|
|
30751
30800
|
|
|
30752
30801
|
/** ChannelClipPath 等内容裁剪使用的 SVG 坐标边距(与用户传入的屏幕 padding 无关) */
|
|
30753
30802
|
const PARTITION_PICKER_CONTENT_CLIP_PADDING = 0;
|
|
30803
|
+
/** 可选中地块 polygon / 标签 data 属性 */
|
|
30804
|
+
const PARTITION_BOUNDARY_ID_ATTR = 'data-partition-boundary-id';
|
|
30805
|
+
/** 孤立子地块命中标记(不可选中) */
|
|
30806
|
+
const PARTITION_ISOLATED_BOUNDARY_ID_ATTR = 'data-partition-isolated-boundary-id';
|
|
30754
30807
|
/** H5:子区域屏幕宽度超过该值才展示名称标签(px) */
|
|
30755
30808
|
const H5_PARTITION_LABEL_MIN_SCREEN_WIDTH_PX = 92;
|
|
30756
30809
|
/** H5:名称气泡总宽度(px) */
|
|
@@ -30780,9 +30833,9 @@ const PARTITION_PICKER_GRID_BASE_COLOR = '#E3E5EB';
|
|
|
30780
30833
|
/** 网格单元边长(SVG 地图坐标,与 viewBox 一致;zoom 时间距同比缩放) */
|
|
30781
30834
|
const PARTITION_PICKER_GRID_TILE_SIZE = 10;
|
|
30782
30835
|
/** 网格线宽(地图坐标;随 zoom 同比缩放,不做屏幕像素恒定) */
|
|
30783
|
-
const PARTITION_PICKER_GRID_LINE_WIDTH = 0.
|
|
30836
|
+
const PARTITION_PICKER_GRID_LINE_WIDTH = 0.2;
|
|
30784
30837
|
/** 网格交点圆点半径(地图坐标) */
|
|
30785
|
-
const PARTITION_PICKER_GRID_DOT_RADIUS = 0.
|
|
30838
|
+
const PARTITION_PICKER_GRID_DOT_RADIUS = 0.6;
|
|
30786
30839
|
/** 网格层整体不透明度(Figma 约 80%) */
|
|
30787
30840
|
const PARTITION_PICKER_GRID_OPACITY = 0.4;
|
|
30788
30841
|
/** 网格线与交点颜色 */
|
|
@@ -31173,9 +31226,9 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31173
31226
|
/** 位移是否超过 PAN_CLICK_THRESHOLD_PX,超过则视为拖拽 */
|
|
31174
31227
|
const markPanMoved = (startX, startY, currentX, currentY) => Math.hypot(currentX - startX, currentY - startY) > PAN_CLICK_THRESHOLD_PX;
|
|
31175
31228
|
/** 触发点击回调(仅当未发生拖拽时) */
|
|
31176
|
-
const emitViewportTap = (tapTarget) => {
|
|
31229
|
+
const emitViewportTap = (tapTarget, clientX, clientY) => {
|
|
31177
31230
|
if (tapTarget) {
|
|
31178
|
-
onViewportTapRef.current?.(tapTarget);
|
|
31231
|
+
onViewportTapRef.current?.({ target: tapTarget, clientX, clientY });
|
|
31179
31232
|
}
|
|
31180
31233
|
};
|
|
31181
31234
|
// ── 绑定容器交互事件:滚轮缩放 / 桌面拖拽 / H5 pinch+单指平移 ──
|
|
@@ -31201,7 +31254,7 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31201
31254
|
if (event) {
|
|
31202
31255
|
const state = pointerMapRef.current.get(event.pointerId);
|
|
31203
31256
|
if (state && !state.moved && state.tapTarget) {
|
|
31204
|
-
emitViewportTap(state.tapTarget);
|
|
31257
|
+
emitViewportTap(state.tapTarget, event.clientX, event.clientY);
|
|
31205
31258
|
}
|
|
31206
31259
|
pointerMapRef.current.delete(event.pointerId);
|
|
31207
31260
|
try {
|
|
@@ -31345,13 +31398,17 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31345
31398
|
if (touchState && !touchState.moved) {
|
|
31346
31399
|
let tapTarget = touchState.tapTarget;
|
|
31347
31400
|
const touch = event.changedTouches[0];
|
|
31401
|
+
let clientX = touchState.startX;
|
|
31402
|
+
let clientY = touchState.startY;
|
|
31348
31403
|
if (touch) {
|
|
31404
|
+
clientX = touch.clientX;
|
|
31405
|
+
clientY = touch.clientY;
|
|
31349
31406
|
const hitTarget = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
31350
31407
|
if (hitTarget instanceof Element) {
|
|
31351
31408
|
tapTarget = hitTarget;
|
|
31352
31409
|
}
|
|
31353
31410
|
}
|
|
31354
|
-
emitViewportTap(tapTarget);
|
|
31411
|
+
emitViewportTap(tapTarget, clientX, clientY);
|
|
31355
31412
|
}
|
|
31356
31413
|
if (pinchRef.current) {
|
|
31357
31414
|
pinchRef.current = null;
|
|
@@ -31799,12 +31856,11 @@ function usePartitionLabelItems(mapData, viewBox, containerWidth, containerHeigh
|
|
|
31799
31856
|
]);
|
|
31800
31857
|
}
|
|
31801
31858
|
|
|
31802
|
-
var css_248z = "@charset \"UTF-8\";\n/* 地图容器:裁剪溢出,禁用浏览器默认 touch 手势以便自定义 pinch */\n.index-module_container__nNYv7 {\n position: relative;\n overflow: hidden;\n touch-action: none;\n user-select: none;\n cursor: grab;\n /* H5 点击时不出现矩形 tap 高亮 */\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 网格 + 地块双层 SVG 叠放,共用 viewBox 保证平移/缩放同步 */\n.index-module_mapSvgStack__nz2s2 {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.index-module_gridSvg__MoJD6 {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n}\n\n/* 地图 SVG:地块/通道,可绕 viewBox 中心旋转 */\n.index-module_mapSvg__vN0LV {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/*
|
|
31859
|
+
var css_248z = "@charset \"UTF-8\";\n/* 地图容器:裁剪溢出,禁用浏览器默认 touch 手势以便自定义 pinch */\n.index-module_container__nNYv7 {\n position: relative;\n overflow: hidden;\n touch-action: none;\n user-select: none;\n cursor: grab;\n /* H5 点击时不出现矩形 tap 高亮 */\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 网格 + 地块双层 SVG 叠放,共用 viewBox 保证平移/缩放同步 */\n.index-module_mapSvgStack__nz2s2 {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.index-module_gridSvg__MoJD6 {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n}\n\n/* 地图 SVG:地块/通道,可绕 viewBox 中心旋转 */\n.index-module_mapSvg__vN0LV {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 可点击地块:悬停显示 pointer,与地图容器 grab 区分 */\n.index-module_boundaryPolygon__uHe-E {\n cursor: pointer;\n pointer-events: auto;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n outline: none;\n -webkit-touch-callout: none;\n}\n\n.index-module_container__nNYv7:active {\n cursor: grabbing;\n}\n\n/* Map 模式:OverlayViewF 内根节点,铺满 overlay 像素区域 */\n.index-module_googleOverlayRoot__TQ3II {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n overflow: visible;\n}\n\n/* HTML overlay 层:CSS rotate 与 MowerMapRenderer OverlayViewF 一致,子元素自行反向补偿 */\n.index-module_mapOverlayLayer__7jTDy {\n position: absolute;\n inset: 0;\n transform-origin: 50% 50%;\n pointer-events: none;\n z-index: 2;\n}\n\n/* 分区名气泡层,绝对定位覆盖在 SVG 之上 */\n.index-module_labelsLayer__Rcikw {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.index-module_label__xo3Kc {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n pointer-events: auto;\n cursor: pointer;\n white-space: nowrap;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n outline: none;\n -webkit-touch-callout: none;\n}\n\n.index-module_labelOrderOnly__TDLBU {\n gap: 0;\n}\n\n/* H5 名称标签:气泡宽度 / 文案最大宽度由 constants.ts 内联样式控制 */\n.index-module_labelH5Wrap__Es5cA {\n white-space: normal;\n}\n\n.index-module_labelPill__7jnOo {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: none;\n}\n\n.index-module_labelPillH5__iPeHi {\n box-sizing: border-box;\n}\n\n.index-module_labelText__ialST {\n word-break: break-word;\n text-align: center;\n}\n\n.index-module_labelTextH5__jz8SO {\n max-width: 100%;\n white-space: normal;\n overflow-wrap: anywhere;\n line-height: 1.33;\n}\n\n/* 选中序号徽章:尺寸与颜色由 constants 按 platform 注入 */\n.index-module_selectionOrderBadge__uj7LX {\n flex-shrink: 0;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.index-module_boundaryPolygonIsolated__syN4V {\n cursor: not-allowed;\n}\n\n.index-module_boundaryPolygonIsolated__syN4V:active {\n cursor: grabbing;\n}\n\n.index-module_labelIsolated__K3WAB {\n cursor: not-allowed;\n pointer-events: auto;\n}\n\n.index-module_labelIsolated__K3WAB:active {\n cursor: grabbing;\n}\n\n.index-module_labelIsolatedLayout__k-rwI {\n gap: 4px;\n}\n\n.index-module_isolatedIconBelow__PuVIF {\n position: static;\n transform: none;\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n pointer-events: none;\n}\n\n.index-module_isolatedIconBelow__PuVIF.index-module_isolatedIconWeb__iPkYp {\n width: 20px;\n height: 20px;\n}\n\n.index-module_isolatedIcon__Vbxl0 {\n position: absolute;\n width: 24px;\n height: 24px;\n left: 50%;\n bottom: calc(100% + 4px);\n transform: translateX(-50%);\n}\n\n.index-module_isolatedIconWeb__iPkYp {\n width: 20px;\n height: 20px;\n bottom: calc(100% + 2px);\n}";
|
|
31803
31860
|
var styles = {"container":"index-module_container__nNYv7","mapSvgStack":"index-module_mapSvgStack__nz2s2","gridSvg":"index-module_gridSvg__MoJD6","mapSvg":"index-module_mapSvg__vN0LV","boundaryPolygon":"index-module_boundaryPolygon__uHe-E","googleOverlayRoot":"index-module_googleOverlayRoot__TQ3II","mapOverlayLayer":"index-module_mapOverlayLayer__7jTDy","labelsLayer":"index-module_labelsLayer__Rcikw","label":"index-module_label__xo3Kc","labelOrderOnly":"index-module_labelOrderOnly__TDLBU","labelH5Wrap":"index-module_labelH5Wrap__Es5cA","labelPill":"index-module_labelPill__7jnOo","labelPillH5":"index-module_labelPillH5__iPeHi","labelText":"index-module_labelText__ialST","labelTextH5":"index-module_labelTextH5__jz8SO","selectionOrderBadge":"index-module_selectionOrderBadge__uj7LX","boundaryPolygonIsolated":"index-module_boundaryPolygonIsolated__syN4V","labelIsolated":"index-module_labelIsolated__K3WAB","labelIsolatedLayout":"index-module_labelIsolatedLayout__k-rwI","isolatedIconBelow":"index-module_isolatedIconBelow__PuVIF","isolatedIconWeb":"index-module_isolatedIconWeb__iPkYp"};
|
|
31804
31861
|
styleInject(css_248z);
|
|
31805
31862
|
|
|
31806
|
-
const
|
|
31807
|
-
const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isIsolated = false, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, }) => {
|
|
31863
|
+
const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isIsolated = false, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31808
31864
|
const style = data.style || {};
|
|
31809
31865
|
const boundaryId = Number(data.id);
|
|
31810
31866
|
const colors = boundaryColors;
|
|
@@ -31849,9 +31905,14 @@ const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isI
|
|
|
31849
31905
|
viewBoxWidth,
|
|
31850
31906
|
]);
|
|
31851
31907
|
if (isIsolated) {
|
|
31852
|
-
return (jsx("polygon", { className: `${styles.boundaryPolygon} ${styles.boundaryPolygonIsolated}`, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round"
|
|
31908
|
+
return (jsx("polygon", { className: `${styles.boundaryPolygon} ${styles.boundaryPolygonIsolated}`, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_ISOLATED_BOUNDARY_ID_ATTR]: boundaryId, onClick: onIsolatedTap
|
|
31909
|
+
? (event) => {
|
|
31910
|
+
event.stopPropagation();
|
|
31911
|
+
onIsolatedTap(boundaryId, event.clientX, event.clientY);
|
|
31912
|
+
}
|
|
31913
|
+
: undefined }));
|
|
31853
31914
|
}
|
|
31854
|
-
return (jsx("polygon", { className: styles.boundaryPolygon, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_BOUNDARY_ID_ATTR
|
|
31915
|
+
return (jsx("polygon", { className: styles.boundaryPolygon, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_BOUNDARY_ID_ATTR]: boundaryId, onMouseEnter: () => onHoverChange(boundaryId), onMouseLeave: () => onHoverChange(null), onClick: onBoundaryClick
|
|
31855
31916
|
? (event) => {
|
|
31856
31917
|
event.stopPropagation();
|
|
31857
31918
|
onBoundaryClick(boundaryId);
|
|
@@ -31860,7 +31921,7 @@ const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isI
|
|
|
31860
31921
|
};
|
|
31861
31922
|
var SelectableBoundaryElement$1 = memo(SelectableBoundaryElement);
|
|
31862
31923
|
|
|
31863
|
-
const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation = 0, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, }) => {
|
|
31924
|
+
const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation = 0, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31864
31925
|
const boundaries = (svgElementDatas[DataType.BOUNDARY] || []);
|
|
31865
31926
|
const channels = (svgElementDatas[DataType.CHANNEL] || []);
|
|
31866
31927
|
const selectedIdSet = useMemo(() => new Set(selectedIds), [selectedIds]);
|
|
@@ -31872,7 +31933,7 @@ const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containe
|
|
|
31872
31933
|
}, [mapRotation, viewBox.x, viewBox.y, viewBox.width, viewBox.height]);
|
|
31873
31934
|
const mapContent = (jsxs(Fragment, { children: [jsx(GElement, { type: "boundary", children: boundaries.map((item) => {
|
|
31874
31935
|
const boundaryId = Number(item.id);
|
|
31875
|
-
return (jsx(SelectableBoundaryElement$1, { data: item, boundaryColors: boundaryColors, boundaryStrokePx: boundaryStrokePx, isIsolated: isolatedBoundaryIds.has(boundaryId), selected: selectedIdSet.has(boundaryId), hovered: hoveredId === boundaryId, viewBoxWidth: viewBox.width, viewBoxHeight: viewBox.height, containerWidth: containerWidth, containerHeight: containerHeight, onHoverChange: onHoverChange, onBoundaryClick: onBoundaryClick }, item.id));
|
|
31936
|
+
return (jsx(SelectableBoundaryElement$1, { data: item, boundaryColors: boundaryColors, boundaryStrokePx: boundaryStrokePx, isIsolated: isolatedBoundaryIds.has(boundaryId), selected: selectedIdSet.has(boundaryId), hovered: hoveredId === boundaryId, viewBoxWidth: viewBox.width, viewBoxHeight: viewBox.height, containerWidth: containerWidth, containerHeight: containerHeight, onHoverChange: onHoverChange, onBoundaryClick: onBoundaryClick, onIsolatedTap: onIsolatedTap }, item.id));
|
|
31876
31937
|
}) }), jsxs(GElement, { type: "channel", children: [jsx(ChannelClipPath, {}), channels.map((item) => (jsx(ChannelElement, { data: item }, item.id)))] })] }));
|
|
31877
31938
|
return (jsx("svg", { className: styles.mapSvg, xmlns: "http://www.w3.org/2000/svg", viewBox: viewBoxToString(viewBox), width: "100%", height: "100%", preserveAspectRatio: "xMidYMid meet", shapeRendering: "geometricPrecision", children: mapContentTransform ? (jsx("g", { transform: mapContentTransform, children: mapContent })) : (mapContent) }));
|
|
31878
31939
|
};
|
|
@@ -31907,7 +31968,12 @@ const MapGridBackground = ({ viewBox, gridStyle }) => {
|
|
|
31907
31968
|
const patternId = useMemo(() => `partition-picker-grid-lines-${reactId.replace(/:/g, '-')}`, [reactId]);
|
|
31908
31969
|
const { baseColor, strokeColor, tileSize: tile, lineWidth, dotRadius, opacity, maxIntersectionDots, } = gridStyle;
|
|
31909
31970
|
const intersections = useMemo(() => getVisibleGridIntersections(viewBox, tile, maxIntersectionDots), [maxIntersectionDots, tile, viewBox.x, viewBox.y, viewBox.width, viewBox.height]);
|
|
31910
|
-
|
|
31971
|
+
/**
|
|
31972
|
+
* SVG stroke 以路径为中心;线在 tile 的 0 边绘制时,四格交点的视觉中心会偏向路径右下。
|
|
31973
|
+
* 线条内缩 lineWidth/2,圆点同步偏移,使圆心与网格线交叉中心对齐。
|
|
31974
|
+
*/
|
|
31975
|
+
const lineHalf = lineWidth / 2;
|
|
31976
|
+
return (jsxs("g", { className: "partition-picker-grid-bg", "aria-hidden": true, pointerEvents: "none", children: [jsx("defs", { children: jsxs("pattern", { id: patternId, patternUnits: "userSpaceOnUse", width: tile, height: tile, children: [jsx("line", { x1: 0, y1: lineHalf, x2: tile, y2: lineHalf, stroke: strokeColor, strokeWidth: lineWidth }), jsx("line", { x1: lineHalf, y1: 0, x2: lineHalf, y2: tile, stroke: strokeColor, strokeWidth: lineWidth })] }) }), jsx("rect", { x: viewBox.x, y: viewBox.y, width: viewBox.width, height: viewBox.height, fill: baseColor }), jsx("rect", { x: viewBox.x, y: viewBox.y, width: viewBox.width, height: viewBox.height, fill: `url(#${patternId})`, opacity: opacity }), jsx("g", { opacity: opacity, children: intersections.map((point, index) => (jsx("circle", { cx: point.x + lineHalf, cy: point.y + lineHalf, r: dotRadius, fill: strokeColor }, `${point.x}-${point.y}-${index}`))) })] }));
|
|
31911
31977
|
};
|
|
31912
31978
|
var MapGridBackground$1 = memo(MapGridBackground);
|
|
31913
31979
|
|
|
@@ -31926,7 +31992,7 @@ const PartitionPickerGridSvg = ({ viewBox, gridStyle }) => {
|
|
|
31926
31992
|
shapeRendering: "geometricPrecision", "aria-hidden": true, children: jsx(MapGridBackground$1, { viewBox: viewBox, gridStyle: gridStyle }) }));
|
|
31927
31993
|
};
|
|
31928
31994
|
|
|
31929
|
-
const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = PlatformType.WEB, showSelectionOrder = false, rotation = 0, onHoverChange, onBoundaryClick, }) => {
|
|
31995
|
+
const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = PlatformType.WEB, showSelectionOrder = false, rotation = 0, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31930
31996
|
const isWeb = platform === PlatformType.WEB;
|
|
31931
31997
|
const orderBadgeStyle = useMemo(() => ({
|
|
31932
31998
|
width: labelStyles.selectionOrderBadge.width,
|
|
@@ -31965,27 +32031,34 @@ const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = Platf
|
|
|
31965
32031
|
const selectionOrderGapPx = isWeb
|
|
31966
32032
|
? WEB_SELECTION_ORDER_GAP_PX
|
|
31967
32033
|
: H5_SELECTION_ORDER_GAP_PX;
|
|
31968
|
-
const boundaryIdProps = isIsolated
|
|
32034
|
+
const boundaryIdProps = isIsolated
|
|
32035
|
+
? { [PARTITION_ISOLATED_BOUNDARY_ID_ATTR]: item.id }
|
|
32036
|
+
: { [PARTITION_BOUNDARY_ID_ATTR]: item.id };
|
|
31969
32037
|
return (jsxs("div", { className: labelClassName, style: {
|
|
31970
32038
|
left: `${item.leftPct}%`,
|
|
31971
32039
|
top: `${item.topPct}%`,
|
|
31972
32040
|
transform: `translate(-50%, -50%) rotate(${-rotation}deg)`,
|
|
31973
32041
|
...(showOrderWithName ? { gap: selectionOrderGapPx } : undefined),
|
|
31974
|
-
}, ...boundaryIdProps, onMouseEnter: isIsolated ? undefined : () => onHoverChange(item.id), onMouseLeave: isIsolated ? undefined : () => onHoverChange(null), onClick:
|
|
31975
|
-
?
|
|
31976
|
-
event
|
|
31977
|
-
|
|
31978
|
-
|
|
31979
|
-
|
|
32042
|
+
}, ...boundaryIdProps, onMouseEnter: isIsolated ? undefined : () => onHoverChange(item.id), onMouseLeave: isIsolated ? undefined : () => onHoverChange(null), onClick: isIsolated
|
|
32043
|
+
? onIsolatedTap
|
|
32044
|
+
? (event) => {
|
|
32045
|
+
event.stopPropagation();
|
|
32046
|
+
onIsolatedTap(item.id, event.clientX, event.clientY);
|
|
32047
|
+
}
|
|
32048
|
+
: undefined
|
|
32049
|
+
: onBoundaryClick
|
|
32050
|
+
? (event) => {
|
|
32051
|
+
event.stopPropagation();
|
|
32052
|
+
onBoundaryClick(item.id);
|
|
32053
|
+
}
|
|
32054
|
+
: undefined, children: [showOrderBadge && (jsx("div", { className: styles.selectionOrderBadge, style: orderBadgeStyle, children: selectionOrder })), showNameLabel && (jsx("div", { className: `${styles.labelPill} ${!isWeb ? styles.labelPillH5 : ''}`, style: pillStyle, children: jsx("span", { className: `${styles.labelText} ${!isWeb ? styles.labelTextH5 : ''}`, children: item.name }) })), isIsolated && (jsx("div", { className: `${styles.isolatedIconBelow} ${isWeb ? styles.isolatedIconWeb : ''}`, dangerouslySetInnerHTML: { __html: ISOLATED_BOUNDARY_SVG } }))] }, item.id));
|
|
31980
32055
|
}) }));
|
|
31981
32056
|
};
|
|
31982
32057
|
|
|
31983
32058
|
const DEFAULT_BACKGROUND = PARTITION_PICKER_GRID_BASE_COLOR;
|
|
31984
|
-
/** 地块 polygon / 标签上的 data 属性,供 viewport 点击命中与表格联动 */
|
|
31985
|
-
const PARTITION_BOUNDARY_ID_ATTR = 'data-partition-boundary-id';
|
|
31986
32059
|
/** Map 模式下 OverlayViewF 默认 z-index */
|
|
31987
32060
|
const DEFAULT_OVERLAY_Z_INDEX = 100;
|
|
31988
|
-
const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleConfig, sn = '', platform = PlatformType.WEB, width, height, padding = 0, backgroundColor = DEFAULT_BACKGROUND, defaultTransform, mapRef, minZoom = 0.5, maxZoom = 3, enablePanZoom = true, refitOnResize = true, onSizeChange, selectedBoundaryIds, defaultSelectedBoundaryIds, onSelectionChange, hoveredBoundaryId, defaultHoveredBoundaryId, onBoundaryHoverChange, showSelectionOrder = false, zIndex = DEFAULT_OVERLAY_Z_INDEX, className, style, }, ref) => {
|
|
32061
|
+
const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleConfig, sn = '', platform = PlatformType.WEB, width, height, padding = 0, backgroundColor = DEFAULT_BACKGROUND, defaultTransform, mapRef, minZoom = 0.5, maxZoom = 3, enablePanZoom = true, refitOnResize = true, onSizeChange, selectedBoundaryIds, defaultSelectedBoundaryIds, onSelectionChange, hoveredBoundaryId, defaultHoveredBoundaryId, onBoundaryHoverChange, showSelectionOrder = false, onIsolatedBoundaryTap, zIndex = DEFAULT_OVERLAY_Z_INDEX, className, style, }, ref) => {
|
|
31989
32062
|
/**
|
|
31990
32063
|
* 是否为 Map 模式(传入 mapRef 时为 true):
|
|
31991
32064
|
* - true:Google Maps 底图 + OverlayViewF,平移/缩放/fit 由底图负责
|
|
@@ -32044,6 +32117,24 @@ const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleCon
|
|
|
32044
32117
|
}, [mapJson]);
|
|
32045
32118
|
/** 孤立地块 id 列表(未连接到主地块的子地块) */
|
|
32046
32119
|
const isolatedBoundaryIds = useIsolatedBoundaryIds(mapJson);
|
|
32120
|
+
const boundaryNameById = useMemo(() => {
|
|
32121
|
+
const names = new Map();
|
|
32122
|
+
for (const boundary of generateBoundaryData(mapJson)) {
|
|
32123
|
+
names.set(boundary.id, boundary.name);
|
|
32124
|
+
}
|
|
32125
|
+
return names;
|
|
32126
|
+
}, [mapJson]);
|
|
32127
|
+
const handleIsolatedTap = useCallback((boundaryId, clientX, clientY) => {
|
|
32128
|
+
if (!onIsolatedBoundaryTap || !isolatedBoundaryIds.has(boundaryId))
|
|
32129
|
+
return;
|
|
32130
|
+
onIsolatedBoundaryTap({
|
|
32131
|
+
boundaryId,
|
|
32132
|
+
boundaryName: boundaryNameById.get(boundaryId),
|
|
32133
|
+
clientX,
|
|
32134
|
+
clientY,
|
|
32135
|
+
});
|
|
32136
|
+
}, [boundaryNameById, isolatedBoundaryIds, onIsolatedBoundaryTap]);
|
|
32137
|
+
const isolatedTapHandler = onIsolatedBoundaryTap ? handleIsolatedTap : undefined;
|
|
32047
32138
|
/** 选中地块 id 列表(受控/非受控)与切换选中回调 */
|
|
32048
32139
|
const { selectedIds, toggleBoundary, setSelectedIds } = useBoundarySelection({
|
|
32049
32140
|
selectedBoundaryIds,
|
|
@@ -32069,7 +32160,15 @@ const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleCon
|
|
|
32069
32160
|
toggleBoundary(id);
|
|
32070
32161
|
}, [isolatedBoundaryIds, toggleBoundary]);
|
|
32071
32162
|
/** Standalone 模式:由 viewport 统一处理点击(支持在地块上拖拽平移) */
|
|
32072
|
-
const handleViewportTap = useCallback((target) => {
|
|
32163
|
+
const handleViewportTap = useCallback(({ target, clientX, clientY }) => {
|
|
32164
|
+
const isolatedEl = target.closest(`[${PARTITION_ISOLATED_BOUNDARY_ID_ATTR}]`);
|
|
32165
|
+
if (isolatedEl) {
|
|
32166
|
+
const isolatedId = Number(isolatedEl.getAttribute(PARTITION_ISOLATED_BOUNDARY_ID_ATTR));
|
|
32167
|
+
if (Number.isFinite(isolatedId) && isolatedBoundaryIds.has(isolatedId)) {
|
|
32168
|
+
handleIsolatedTap(isolatedId, clientX, clientY);
|
|
32169
|
+
}
|
|
32170
|
+
return;
|
|
32171
|
+
}
|
|
32073
32172
|
const boundaryEl = target.closest(`[${PARTITION_BOUNDARY_ID_ATTR}]`);
|
|
32074
32173
|
if (!boundaryEl)
|
|
32075
32174
|
return;
|
|
@@ -32077,7 +32176,7 @@ const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleCon
|
|
|
32077
32176
|
if (!Number.isFinite(id) || isolatedBoundaryIds.has(id))
|
|
32078
32177
|
return;
|
|
32079
32178
|
toggleBoundary(id);
|
|
32080
|
-
}, [isolatedBoundaryIds, toggleBoundary]);
|
|
32179
|
+
}, [handleIsolatedTap, isolatedBoundaryIds, toggleBoundary]);
|
|
32081
32180
|
/**
|
|
32082
32181
|
* Map 模式 overlay 状态(bounds / viewBox / fitBounds / overlayScale)。
|
|
32083
32182
|
* 无 mapRef 时 hook 内部 enabled=false,返回值不参与渲染。
|
|
@@ -32186,12 +32285,12 @@ const MowerPartitionPickerMap = forwardRef(({ mapJson, mapConfig, pickerStyleCon
|
|
|
32186
32285
|
...(isMapMode ? {} : layoutStyle),
|
|
32187
32286
|
}), [isMapMode, layoutStyle, resolvedBackgroundColor, style]);
|
|
32188
32287
|
/** 地块 + 通道 SVG;Map 模式不在 SVG 内旋转(由 OverlayViewF rotate 处理) */
|
|
32189
|
-
const mapSvgLayer = viewBox && isLayersReady ? (jsx(PartitionPickerSvg, { svgElementDatas: svgElementDatas, viewBox: viewBox, containerWidth: overlayWidth, containerHeight: overlayHeight, mapRotation: isMapMode ? 0 : actureRotate, boundaryColors: mergedPickerStyles.boundary, boundaryStrokePx: mergedPickerStyles.boundaryStrokePx, isolatedBoundaryIds: isolatedBoundaryIds, selectedIds: selectedIds, hoveredId: hoveredId, onHoverChange: handleHoverChange, onBoundaryClick: isMapMode ? handleBoundaryClick : undefined })) : null;
|
|
32288
|
+
const mapSvgLayer = viewBox && isLayersReady ? (jsx(PartitionPickerSvg, { svgElementDatas: svgElementDatas, viewBox: viewBox, containerWidth: overlayWidth, containerHeight: overlayHeight, mapRotation: isMapMode ? 0 : actureRotate, boundaryColors: mergedPickerStyles.boundary, boundaryStrokePx: mergedPickerStyles.boundaryStrokePx, isolatedBoundaryIds: isolatedBoundaryIds, selectedIds: selectedIds, hoveredId: hoveredId, onHoverChange: handleHoverChange, onBoundaryClick: isMapMode ? handleBoundaryClick : undefined, onIsolatedTap: isMapMode ? isolatedTapHandler : undefined })) : null;
|
|
32190
32289
|
/**
|
|
32191
32290
|
* 分区标签 + 充电桩 HTML 层。
|
|
32192
32291
|
* Map 模式:平铺于 overlay 根节点;Standalone:包在 mapOverlayLayer 内做 CSS 旋转。
|
|
32193
32292
|
*/
|
|
32194
|
-
const overlayLayers = viewBox && isLayersReady ? (isMapMode ? (jsxs(Fragment, { children: [jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onBoundaryClick: handleBoundaryClick }), jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate })] })) : (jsxs("div", { className: styles.mapOverlayLayer, style: mapOverlayLayerStyle, children: [jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange }), jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate, viewRotationMode: "overlay-parent", containerWidth: overlayWidth, containerHeight: overlayHeight, sizeInSvgUnits: true, minDisplaySizePx: PARTITION_PICKER_CHARGING_PILE_MIN_DISPLAY_PX })] }))) : null;
|
|
32293
|
+
const overlayLayers = viewBox && isLayersReady ? (isMapMode ? (jsxs(Fragment, { children: [jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onBoundaryClick: handleBoundaryClick, onIsolatedTap: isolatedTapHandler }), jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate })] })) : (jsxs("div", { className: styles.mapOverlayLayer, style: mapOverlayLayerStyle, children: [jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onIsolatedTap: isolatedTapHandler }), jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate, viewRotationMode: "overlay-parent", containerWidth: overlayWidth, containerHeight: overlayHeight, sizeInSvgUnits: true, minDisplaySizePx: PARTITION_PICKER_CHARGING_PILE_MIN_DISPLAY_PX })] }))) : null;
|
|
32195
32294
|
/** Map 模式:渲染 OverlayViewF,底图为 Google Maps */
|
|
32196
32295
|
if (isMapMode && mapRef) {
|
|
32197
32296
|
return (jsx(CommonContextProvider, { value: commonValue, children: jsx(SvgEditContextProvider, { value: svgEditValue, children: jsx(OverlayViewF, { map: mapRef, mapPaneName: "overlayMouseTarget", bounds: googleOverlay.bounds ?? undefined, rotate: actureRotate, zIndex: zIndex, onDraw: googleOverlay.handleOverlayDraw, children: jsxs("div", { className: `${styles.googleOverlayRoot} ${className || ''}`, style: containerStyle, onMouseLeave: () => setHoveredId(null), children: [mapSvgLayer, overlayLayers] }) }) }) }));
|
package/dist/index.js
CHANGED
|
@@ -23459,6 +23459,73 @@ function computeFitViewBoxToContainer(content, containerWidth, containerHeight)
|
|
|
23459
23459
|
height: content.height,
|
|
23460
23460
|
};
|
|
23461
23461
|
}
|
|
23462
|
+
/** 地图内容在屏幕坐标系下的包围盒(meet 渲染,未考虑旋转) */
|
|
23463
|
+
function getContentScreenBounds(content, viewBox, containerWidth, containerHeight) {
|
|
23464
|
+
const { x: offsetX, y: offsetY, scale } = getViewBoxMeetOffset(viewBox, containerWidth, containerHeight);
|
|
23465
|
+
return {
|
|
23466
|
+
left: offsetX + (content.x - viewBox.x) * scale,
|
|
23467
|
+
top: offsetY + (content.y - viewBox.y) * scale,
|
|
23468
|
+
right: offsetX + (content.x + content.width - viewBox.x) * scale,
|
|
23469
|
+
bottom: offsetY + (content.y + content.height - viewBox.y) * scale,
|
|
23470
|
+
};
|
|
23471
|
+
}
|
|
23472
|
+
function contentFitsInScreenPadding(content, viewBox, pad, containerWidth, containerHeight) {
|
|
23473
|
+
const bounds = getContentScreenBounds(content, viewBox, containerWidth, containerHeight);
|
|
23474
|
+
return (bounds.left >= pad.left &&
|
|
23475
|
+
bounds.top >= pad.top &&
|
|
23476
|
+
bounds.right <= containerWidth - pad.right &&
|
|
23477
|
+
bounds.bottom <= containerHeight - pad.bottom);
|
|
23478
|
+
}
|
|
23479
|
+
function expandViewBoxFromCenter(viewBox, factor) {
|
|
23480
|
+
const centerX = viewBox.x + viewBox.width / 2;
|
|
23481
|
+
const centerY = viewBox.y + viewBox.height / 2;
|
|
23482
|
+
const width = viewBox.width * factor;
|
|
23483
|
+
const height = viewBox.height * factor;
|
|
23484
|
+
return {
|
|
23485
|
+
x: centerX - width / 2,
|
|
23486
|
+
y: centerY - height / 2,
|
|
23487
|
+
width,
|
|
23488
|
+
height,
|
|
23489
|
+
};
|
|
23490
|
+
}
|
|
23491
|
+
/** 将 viewBox 中心对齐到 padding 内矩形中心(增大 top/left → 内容向对应方向避让) */
|
|
23492
|
+
function applyViewBoxPaddingOffset(viewBox, pad, containerWidth, containerHeight) {
|
|
23493
|
+
const offsetX = ((pad.right - pad.left) / 2) * (viewBox.width / containerWidth);
|
|
23494
|
+
const offsetY = ((pad.bottom - pad.top) / 2) * (viewBox.height / containerHeight);
|
|
23495
|
+
return {
|
|
23496
|
+
...viewBox,
|
|
23497
|
+
x: viewBox.x + offsetX,
|
|
23498
|
+
y: viewBox.y + offsetY,
|
|
23499
|
+
};
|
|
23500
|
+
}
|
|
23501
|
+
function buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor) {
|
|
23502
|
+
const expanded = expandViewBoxFromCenter(baseFit, zoomOutFactor);
|
|
23503
|
+
return applyViewBoxPaddingOffset(expanded, pad, containerWidth, containerHeight);
|
|
23504
|
+
}
|
|
23505
|
+
function findMinimumZoomOutForPadding(content, baseFit, pad, containerWidth, containerHeight) {
|
|
23506
|
+
const fits = (zoomOutFactor) => contentFitsInScreenPadding(content, buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor), pad, containerWidth, containerHeight);
|
|
23507
|
+
if (fits(1)) {
|
|
23508
|
+
return 1;
|
|
23509
|
+
}
|
|
23510
|
+
const innerWidth = Math.max(containerWidth - pad.left - pad.right, 1);
|
|
23511
|
+
const innerHeight = Math.max(containerHeight - pad.top - pad.bottom, 1);
|
|
23512
|
+
const legacyScale = Math.min(innerWidth / containerWidth, innerHeight / containerHeight);
|
|
23513
|
+
let hi = legacyScale > 0 && legacyScale < 1 ? 1 / legacyScale : 2;
|
|
23514
|
+
while (!fits(hi) && hi < 1024) {
|
|
23515
|
+
hi *= 2;
|
|
23516
|
+
}
|
|
23517
|
+
let lo = 1;
|
|
23518
|
+
for (let i = 0; i < 32; i++) {
|
|
23519
|
+
const mid = (lo + hi) / 2;
|
|
23520
|
+
if (fits(mid)) {
|
|
23521
|
+
hi = mid;
|
|
23522
|
+
}
|
|
23523
|
+
else {
|
|
23524
|
+
lo = mid;
|
|
23525
|
+
}
|
|
23526
|
+
}
|
|
23527
|
+
return hi;
|
|
23528
|
+
}
|
|
23462
23529
|
/**
|
|
23463
23530
|
* 计算默认 fit viewBox
|
|
23464
23531
|
*
|
|
@@ -23470,26 +23537,8 @@ function computeFitViewBox(content, containerWidth, containerHeight, screenPaddi
|
|
|
23470
23537
|
if (isZeroScreenPadding(pad)) {
|
|
23471
23538
|
return baseFit;
|
|
23472
23539
|
}
|
|
23473
|
-
const
|
|
23474
|
-
|
|
23475
|
-
const scaleX = innerWidth / containerWidth;
|
|
23476
|
-
const scaleY = innerHeight / containerHeight;
|
|
23477
|
-
const scale = Math.min(scaleX, scaleY);
|
|
23478
|
-
if (!Number.isFinite(scale) || scale <= 0 || scale >= 1) {
|
|
23479
|
-
return baseFit;
|
|
23480
|
-
}
|
|
23481
|
-
const newWidth = baseFit.width / scale;
|
|
23482
|
-
const newHeight = baseFit.height / scale;
|
|
23483
|
-
const centerX = baseFit.x + baseFit.width / 2;
|
|
23484
|
-
const centerY = baseFit.y + baseFit.height / 2;
|
|
23485
|
-
const offsetX = ((pad.left - pad.right) / 2) * (newWidth / containerWidth);
|
|
23486
|
-
const offsetY = ((pad.top - pad.bottom) / 2) * (newHeight / containerHeight);
|
|
23487
|
-
return {
|
|
23488
|
-
x: centerX - newWidth / 2 + offsetX,
|
|
23489
|
-
y: centerY - newHeight / 2 + offsetY,
|
|
23490
|
-
width: newWidth,
|
|
23491
|
-
height: newHeight,
|
|
23492
|
-
};
|
|
23540
|
+
const zoomOutFactor = findMinimumZoomOutForPadding(content, baseFit, pad, containerWidth, containerHeight);
|
|
23541
|
+
return buildPaddedFitViewBox(baseFit, pad, containerWidth, containerHeight, zoomOutFactor);
|
|
23493
23542
|
}
|
|
23494
23543
|
function viewBoxToString(viewBox) {
|
|
23495
23544
|
return `${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}`;
|
|
@@ -30771,6 +30820,10 @@ const BoundarySvgRender = React.memo(({ mapJson, unStructMapData, id, maxWidth =
|
|
|
30771
30820
|
|
|
30772
30821
|
/** ChannelClipPath 等内容裁剪使用的 SVG 坐标边距(与用户传入的屏幕 padding 无关) */
|
|
30773
30822
|
const PARTITION_PICKER_CONTENT_CLIP_PADDING = 0;
|
|
30823
|
+
/** 可选中地块 polygon / 标签 data 属性 */
|
|
30824
|
+
const PARTITION_BOUNDARY_ID_ATTR = 'data-partition-boundary-id';
|
|
30825
|
+
/** 孤立子地块命中标记(不可选中) */
|
|
30826
|
+
const PARTITION_ISOLATED_BOUNDARY_ID_ATTR = 'data-partition-isolated-boundary-id';
|
|
30774
30827
|
/** H5:子区域屏幕宽度超过该值才展示名称标签(px) */
|
|
30775
30828
|
const H5_PARTITION_LABEL_MIN_SCREEN_WIDTH_PX = 92;
|
|
30776
30829
|
/** H5:名称气泡总宽度(px) */
|
|
@@ -30800,9 +30853,9 @@ const PARTITION_PICKER_GRID_BASE_COLOR = '#E3E5EB';
|
|
|
30800
30853
|
/** 网格单元边长(SVG 地图坐标,与 viewBox 一致;zoom 时间距同比缩放) */
|
|
30801
30854
|
const PARTITION_PICKER_GRID_TILE_SIZE = 10;
|
|
30802
30855
|
/** 网格线宽(地图坐标;随 zoom 同比缩放,不做屏幕像素恒定) */
|
|
30803
|
-
const PARTITION_PICKER_GRID_LINE_WIDTH = 0.
|
|
30856
|
+
const PARTITION_PICKER_GRID_LINE_WIDTH = 0.2;
|
|
30804
30857
|
/** 网格交点圆点半径(地图坐标) */
|
|
30805
|
-
const PARTITION_PICKER_GRID_DOT_RADIUS = 0.
|
|
30858
|
+
const PARTITION_PICKER_GRID_DOT_RADIUS = 0.6;
|
|
30806
30859
|
/** 网格层整体不透明度(Figma 约 80%) */
|
|
30807
30860
|
const PARTITION_PICKER_GRID_OPACITY = 0.4;
|
|
30808
30861
|
/** 网格线与交点颜色 */
|
|
@@ -31193,9 +31246,9 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31193
31246
|
/** 位移是否超过 PAN_CLICK_THRESHOLD_PX,超过则视为拖拽 */
|
|
31194
31247
|
const markPanMoved = (startX, startY, currentX, currentY) => Math.hypot(currentX - startX, currentY - startY) > PAN_CLICK_THRESHOLD_PX;
|
|
31195
31248
|
/** 触发点击回调(仅当未发生拖拽时) */
|
|
31196
|
-
const emitViewportTap = (tapTarget) => {
|
|
31249
|
+
const emitViewportTap = (tapTarget, clientX, clientY) => {
|
|
31197
31250
|
if (tapTarget) {
|
|
31198
|
-
onViewportTapRef.current?.(tapTarget);
|
|
31251
|
+
onViewportTapRef.current?.({ target: tapTarget, clientX, clientY });
|
|
31199
31252
|
}
|
|
31200
31253
|
};
|
|
31201
31254
|
// ── 绑定容器交互事件:滚轮缩放 / 桌面拖拽 / H5 pinch+单指平移 ──
|
|
@@ -31221,7 +31274,7 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31221
31274
|
if (event) {
|
|
31222
31275
|
const state = pointerMapRef.current.get(event.pointerId);
|
|
31223
31276
|
if (state && !state.moved && state.tapTarget) {
|
|
31224
|
-
emitViewportTap(state.tapTarget);
|
|
31277
|
+
emitViewportTap(state.tapTarget, event.clientX, event.clientY);
|
|
31225
31278
|
}
|
|
31226
31279
|
pointerMapRef.current.delete(event.pointerId);
|
|
31227
31280
|
try {
|
|
@@ -31365,13 +31418,17 @@ function useMapViewport({ mapJson, containerRef: externalContainerRef, width, he
|
|
|
31365
31418
|
if (touchState && !touchState.moved) {
|
|
31366
31419
|
let tapTarget = touchState.tapTarget;
|
|
31367
31420
|
const touch = event.changedTouches[0];
|
|
31421
|
+
let clientX = touchState.startX;
|
|
31422
|
+
let clientY = touchState.startY;
|
|
31368
31423
|
if (touch) {
|
|
31424
|
+
clientX = touch.clientX;
|
|
31425
|
+
clientY = touch.clientY;
|
|
31369
31426
|
const hitTarget = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
31370
31427
|
if (hitTarget instanceof Element) {
|
|
31371
31428
|
tapTarget = hitTarget;
|
|
31372
31429
|
}
|
|
31373
31430
|
}
|
|
31374
|
-
emitViewportTap(tapTarget);
|
|
31431
|
+
emitViewportTap(tapTarget, clientX, clientY);
|
|
31375
31432
|
}
|
|
31376
31433
|
if (pinchRef.current) {
|
|
31377
31434
|
pinchRef.current = null;
|
|
@@ -31819,12 +31876,11 @@ function usePartitionLabelItems(mapData, viewBox, containerWidth, containerHeigh
|
|
|
31819
31876
|
]);
|
|
31820
31877
|
}
|
|
31821
31878
|
|
|
31822
|
-
var css_248z = "@charset \"UTF-8\";\n/* 地图容器:裁剪溢出,禁用浏览器默认 touch 手势以便自定义 pinch */\n.index-module_container__nNYv7 {\n position: relative;\n overflow: hidden;\n touch-action: none;\n user-select: none;\n cursor: grab;\n /* H5 点击时不出现矩形 tap 高亮 */\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 网格 + 地块双层 SVG 叠放,共用 viewBox 保证平移/缩放同步 */\n.index-module_mapSvgStack__nz2s2 {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.index-module_gridSvg__MoJD6 {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n}\n\n/* 地图 SVG:地块/通道,可绕 viewBox 中心旋转 */\n.index-module_mapSvg__vN0LV {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/*
|
|
31879
|
+
var css_248z = "@charset \"UTF-8\";\n/* 地图容器:裁剪溢出,禁用浏览器默认 touch 手势以便自定义 pinch */\n.index-module_container__nNYv7 {\n position: relative;\n overflow: hidden;\n touch-action: none;\n user-select: none;\n cursor: grab;\n /* H5 点击时不出现矩形 tap 高亮 */\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 网格 + 地块双层 SVG 叠放,共用 viewBox 保证平移/缩放同步 */\n.index-module_mapSvgStack__nz2s2 {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.index-module_gridSvg__MoJD6 {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n}\n\n/* 地图 SVG:地块/通道,可绕 viewBox 中心旋转 */\n.index-module_mapSvg__vN0LV {\n position: absolute;\n inset: 0;\n display: block;\n pointer-events: none;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n}\n\n/* 可点击地块:悬停显示 pointer,与地图容器 grab 区分 */\n.index-module_boundaryPolygon__uHe-E {\n cursor: pointer;\n pointer-events: auto;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n outline: none;\n -webkit-touch-callout: none;\n}\n\n.index-module_container__nNYv7:active {\n cursor: grabbing;\n}\n\n/* Map 模式:OverlayViewF 内根节点,铺满 overlay 像素区域 */\n.index-module_googleOverlayRoot__TQ3II {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n overflow: visible;\n}\n\n/* HTML overlay 层:CSS rotate 与 MowerMapRenderer OverlayViewF 一致,子元素自行反向补偿 */\n.index-module_mapOverlayLayer__7jTDy {\n position: absolute;\n inset: 0;\n transform-origin: 50% 50%;\n pointer-events: none;\n z-index: 2;\n}\n\n/* 分区名气泡层,绝对定位覆盖在 SVG 之上 */\n.index-module_labelsLayer__Rcikw {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.index-module_label__xo3Kc {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n pointer-events: auto;\n cursor: pointer;\n white-space: nowrap;\n -webkit-tap-highlight-color: transparent;\n tap-highlight-color: transparent;\n outline: none;\n -webkit-touch-callout: none;\n}\n\n.index-module_labelOrderOnly__TDLBU {\n gap: 0;\n}\n\n/* H5 名称标签:气泡宽度 / 文案最大宽度由 constants.ts 内联样式控制 */\n.index-module_labelH5Wrap__Es5cA {\n white-space: normal;\n}\n\n.index-module_labelPill__7jnOo {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: none;\n}\n\n.index-module_labelPillH5__iPeHi {\n box-sizing: border-box;\n}\n\n.index-module_labelText__ialST {\n word-break: break-word;\n text-align: center;\n}\n\n.index-module_labelTextH5__jz8SO {\n max-width: 100%;\n white-space: normal;\n overflow-wrap: anywhere;\n line-height: 1.33;\n}\n\n/* 选中序号徽章:尺寸与颜色由 constants 按 platform 注入 */\n.index-module_selectionOrderBadge__uj7LX {\n flex-shrink: 0;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.index-module_boundaryPolygonIsolated__syN4V {\n cursor: not-allowed;\n}\n\n.index-module_boundaryPolygonIsolated__syN4V:active {\n cursor: grabbing;\n}\n\n.index-module_labelIsolated__K3WAB {\n cursor: not-allowed;\n pointer-events: auto;\n}\n\n.index-module_labelIsolated__K3WAB:active {\n cursor: grabbing;\n}\n\n.index-module_labelIsolatedLayout__k-rwI {\n gap: 4px;\n}\n\n.index-module_isolatedIconBelow__PuVIF {\n position: static;\n transform: none;\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n pointer-events: none;\n}\n\n.index-module_isolatedIconBelow__PuVIF.index-module_isolatedIconWeb__iPkYp {\n width: 20px;\n height: 20px;\n}\n\n.index-module_isolatedIcon__Vbxl0 {\n position: absolute;\n width: 24px;\n height: 24px;\n left: 50%;\n bottom: calc(100% + 4px);\n transform: translateX(-50%);\n}\n\n.index-module_isolatedIconWeb__iPkYp {\n width: 20px;\n height: 20px;\n bottom: calc(100% + 2px);\n}";
|
|
31823
31880
|
var styles = {"container":"index-module_container__nNYv7","mapSvgStack":"index-module_mapSvgStack__nz2s2","gridSvg":"index-module_gridSvg__MoJD6","mapSvg":"index-module_mapSvg__vN0LV","boundaryPolygon":"index-module_boundaryPolygon__uHe-E","googleOverlayRoot":"index-module_googleOverlayRoot__TQ3II","mapOverlayLayer":"index-module_mapOverlayLayer__7jTDy","labelsLayer":"index-module_labelsLayer__Rcikw","label":"index-module_label__xo3Kc","labelOrderOnly":"index-module_labelOrderOnly__TDLBU","labelH5Wrap":"index-module_labelH5Wrap__Es5cA","labelPill":"index-module_labelPill__7jnOo","labelPillH5":"index-module_labelPillH5__iPeHi","labelText":"index-module_labelText__ialST","labelTextH5":"index-module_labelTextH5__jz8SO","selectionOrderBadge":"index-module_selectionOrderBadge__uj7LX","boundaryPolygonIsolated":"index-module_boundaryPolygonIsolated__syN4V","labelIsolated":"index-module_labelIsolated__K3WAB","labelIsolatedLayout":"index-module_labelIsolatedLayout__k-rwI","isolatedIconBelow":"index-module_isolatedIconBelow__PuVIF","isolatedIconWeb":"index-module_isolatedIconWeb__iPkYp"};
|
|
31824
31881
|
styleInject(css_248z);
|
|
31825
31882
|
|
|
31826
|
-
const
|
|
31827
|
-
const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isIsolated = false, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, }) => {
|
|
31883
|
+
const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isIsolated = false, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31828
31884
|
const style = data.style || {};
|
|
31829
31885
|
const boundaryId = Number(data.id);
|
|
31830
31886
|
const colors = boundaryColors;
|
|
@@ -31869,9 +31925,14 @@ const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isI
|
|
|
31869
31925
|
viewBoxWidth,
|
|
31870
31926
|
]);
|
|
31871
31927
|
if (isIsolated) {
|
|
31872
|
-
return (jsxRuntime.jsx("polygon", { className: `${styles.boundaryPolygon} ${styles.boundaryPolygonIsolated}`, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round"
|
|
31928
|
+
return (jsxRuntime.jsx("polygon", { className: `${styles.boundaryPolygon} ${styles.boundaryPolygonIsolated}`, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_ISOLATED_BOUNDARY_ID_ATTR]: boundaryId, onClick: onIsolatedTap
|
|
31929
|
+
? (event) => {
|
|
31930
|
+
event.stopPropagation();
|
|
31931
|
+
onIsolatedTap(boundaryId, event.clientX, event.clientY);
|
|
31932
|
+
}
|
|
31933
|
+
: undefined }));
|
|
31873
31934
|
}
|
|
31874
|
-
return (jsxRuntime.jsx("polygon", { className: styles.boundaryPolygon, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_BOUNDARY_ID_ATTR
|
|
31935
|
+
return (jsxRuntime.jsx("polygon", { className: styles.boundaryPolygon, points: pointsString, fill: fillColor, stroke: strokeColor, strokeWidth: strokeWidth, strokeLinejoin: "round", [PARTITION_BOUNDARY_ID_ATTR]: boundaryId, onMouseEnter: () => onHoverChange(boundaryId), onMouseLeave: () => onHoverChange(null), onClick: onBoundaryClick
|
|
31875
31936
|
? (event) => {
|
|
31876
31937
|
event.stopPropagation();
|
|
31877
31938
|
onBoundaryClick(boundaryId);
|
|
@@ -31880,7 +31941,7 @@ const SelectableBoundaryElement = ({ data, boundaryColors, boundaryStrokePx, isI
|
|
|
31880
31941
|
};
|
|
31881
31942
|
var SelectableBoundaryElement$1 = React.memo(SelectableBoundaryElement);
|
|
31882
31943
|
|
|
31883
|
-
const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation = 0, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, }) => {
|
|
31944
|
+
const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation = 0, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31884
31945
|
const boundaries = (svgElementDatas[exports.DataType.BOUNDARY] || []);
|
|
31885
31946
|
const channels = (svgElementDatas[exports.DataType.CHANNEL] || []);
|
|
31886
31947
|
const selectedIdSet = React.useMemo(() => new Set(selectedIds), [selectedIds]);
|
|
@@ -31892,7 +31953,7 @@ const PartitionPickerSvg = ({ svgElementDatas, viewBox, containerWidth, containe
|
|
|
31892
31953
|
}, [mapRotation, viewBox.x, viewBox.y, viewBox.width, viewBox.height]);
|
|
31893
31954
|
const mapContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(GElement, { type: "boundary", children: boundaries.map((item) => {
|
|
31894
31955
|
const boundaryId = Number(item.id);
|
|
31895
|
-
return (jsxRuntime.jsx(SelectableBoundaryElement$1, { data: item, boundaryColors: boundaryColors, boundaryStrokePx: boundaryStrokePx, isIsolated: isolatedBoundaryIds.has(boundaryId), selected: selectedIdSet.has(boundaryId), hovered: hoveredId === boundaryId, viewBoxWidth: viewBox.width, viewBoxHeight: viewBox.height, containerWidth: containerWidth, containerHeight: containerHeight, onHoverChange: onHoverChange, onBoundaryClick: onBoundaryClick }, item.id));
|
|
31956
|
+
return (jsxRuntime.jsx(SelectableBoundaryElement$1, { data: item, boundaryColors: boundaryColors, boundaryStrokePx: boundaryStrokePx, isIsolated: isolatedBoundaryIds.has(boundaryId), selected: selectedIdSet.has(boundaryId), hovered: hoveredId === boundaryId, viewBoxWidth: viewBox.width, viewBoxHeight: viewBox.height, containerWidth: containerWidth, containerHeight: containerHeight, onHoverChange: onHoverChange, onBoundaryClick: onBoundaryClick, onIsolatedTap: onIsolatedTap }, item.id));
|
|
31896
31957
|
}) }), jsxRuntime.jsxs(GElement, { type: "channel", children: [jsxRuntime.jsx(ChannelClipPath, {}), channels.map((item) => (jsxRuntime.jsx(ChannelElement, { data: item }, item.id)))] })] }));
|
|
31897
31958
|
return (jsxRuntime.jsx("svg", { className: styles.mapSvg, xmlns: "http://www.w3.org/2000/svg", viewBox: viewBoxToString(viewBox), width: "100%", height: "100%", preserveAspectRatio: "xMidYMid meet", shapeRendering: "geometricPrecision", children: mapContentTransform ? (jsxRuntime.jsx("g", { transform: mapContentTransform, children: mapContent })) : (mapContent) }));
|
|
31898
31959
|
};
|
|
@@ -31927,7 +31988,12 @@ const MapGridBackground = ({ viewBox, gridStyle }) => {
|
|
|
31927
31988
|
const patternId = React.useMemo(() => `partition-picker-grid-lines-${reactId.replace(/:/g, '-')}`, [reactId]);
|
|
31928
31989
|
const { baseColor, strokeColor, tileSize: tile, lineWidth, dotRadius, opacity, maxIntersectionDots, } = gridStyle;
|
|
31929
31990
|
const intersections = React.useMemo(() => getVisibleGridIntersections(viewBox, tile, maxIntersectionDots), [maxIntersectionDots, tile, viewBox.x, viewBox.y, viewBox.width, viewBox.height]);
|
|
31930
|
-
|
|
31991
|
+
/**
|
|
31992
|
+
* SVG stroke 以路径为中心;线在 tile 的 0 边绘制时,四格交点的视觉中心会偏向路径右下。
|
|
31993
|
+
* 线条内缩 lineWidth/2,圆点同步偏移,使圆心与网格线交叉中心对齐。
|
|
31994
|
+
*/
|
|
31995
|
+
const lineHalf = lineWidth / 2;
|
|
31996
|
+
return (jsxRuntime.jsxs("g", { className: "partition-picker-grid-bg", "aria-hidden": true, pointerEvents: "none", children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsxs("pattern", { id: patternId, patternUnits: "userSpaceOnUse", width: tile, height: tile, children: [jsxRuntime.jsx("line", { x1: 0, y1: lineHalf, x2: tile, y2: lineHalf, stroke: strokeColor, strokeWidth: lineWidth }), jsxRuntime.jsx("line", { x1: lineHalf, y1: 0, x2: lineHalf, y2: tile, stroke: strokeColor, strokeWidth: lineWidth })] }) }), jsxRuntime.jsx("rect", { x: viewBox.x, y: viewBox.y, width: viewBox.width, height: viewBox.height, fill: baseColor }), jsxRuntime.jsx("rect", { x: viewBox.x, y: viewBox.y, width: viewBox.width, height: viewBox.height, fill: `url(#${patternId})`, opacity: opacity }), jsxRuntime.jsx("g", { opacity: opacity, children: intersections.map((point, index) => (jsxRuntime.jsx("circle", { cx: point.x + lineHalf, cy: point.y + lineHalf, r: dotRadius, fill: strokeColor }, `${point.x}-${point.y}-${index}`))) })] }));
|
|
31931
31997
|
};
|
|
31932
31998
|
var MapGridBackground$1 = React.memo(MapGridBackground);
|
|
31933
31999
|
|
|
@@ -31946,7 +32012,7 @@ const PartitionPickerGridSvg = ({ viewBox, gridStyle }) => {
|
|
|
31946
32012
|
shapeRendering: "geometricPrecision", "aria-hidden": true, children: jsxRuntime.jsx(MapGridBackground$1, { viewBox: viewBox, gridStyle: gridStyle }) }));
|
|
31947
32013
|
};
|
|
31948
32014
|
|
|
31949
|
-
const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = exports.PlatformType.WEB, showSelectionOrder = false, rotation = 0, onHoverChange, onBoundaryClick, }) => {
|
|
32015
|
+
const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = exports.PlatformType.WEB, showSelectionOrder = false, rotation = 0, onHoverChange, onBoundaryClick, onIsolatedTap, }) => {
|
|
31950
32016
|
const isWeb = platform === exports.PlatformType.WEB;
|
|
31951
32017
|
const orderBadgeStyle = React.useMemo(() => ({
|
|
31952
32018
|
width: labelStyles.selectionOrderBadge.width,
|
|
@@ -31985,27 +32051,34 @@ const PartitionNameLabels = ({ items, selectedIds, labelStyles, platform = expor
|
|
|
31985
32051
|
const selectionOrderGapPx = isWeb
|
|
31986
32052
|
? WEB_SELECTION_ORDER_GAP_PX
|
|
31987
32053
|
: H5_SELECTION_ORDER_GAP_PX;
|
|
31988
|
-
const boundaryIdProps = isIsolated
|
|
32054
|
+
const boundaryIdProps = isIsolated
|
|
32055
|
+
? { [PARTITION_ISOLATED_BOUNDARY_ID_ATTR]: item.id }
|
|
32056
|
+
: { [PARTITION_BOUNDARY_ID_ATTR]: item.id };
|
|
31989
32057
|
return (jsxRuntime.jsxs("div", { className: labelClassName, style: {
|
|
31990
32058
|
left: `${item.leftPct}%`,
|
|
31991
32059
|
top: `${item.topPct}%`,
|
|
31992
32060
|
transform: `translate(-50%, -50%) rotate(${-rotation}deg)`,
|
|
31993
32061
|
...(showOrderWithName ? { gap: selectionOrderGapPx } : undefined),
|
|
31994
|
-
}, ...boundaryIdProps, onMouseEnter: isIsolated ? undefined : () => onHoverChange(item.id), onMouseLeave: isIsolated ? undefined : () => onHoverChange(null), onClick:
|
|
31995
|
-
?
|
|
31996
|
-
event
|
|
31997
|
-
|
|
31998
|
-
|
|
31999
|
-
|
|
32062
|
+
}, ...boundaryIdProps, onMouseEnter: isIsolated ? undefined : () => onHoverChange(item.id), onMouseLeave: isIsolated ? undefined : () => onHoverChange(null), onClick: isIsolated
|
|
32063
|
+
? onIsolatedTap
|
|
32064
|
+
? (event) => {
|
|
32065
|
+
event.stopPropagation();
|
|
32066
|
+
onIsolatedTap(item.id, event.clientX, event.clientY);
|
|
32067
|
+
}
|
|
32068
|
+
: undefined
|
|
32069
|
+
: onBoundaryClick
|
|
32070
|
+
? (event) => {
|
|
32071
|
+
event.stopPropagation();
|
|
32072
|
+
onBoundaryClick(item.id);
|
|
32073
|
+
}
|
|
32074
|
+
: undefined, children: [showOrderBadge && (jsxRuntime.jsx("div", { className: styles.selectionOrderBadge, style: orderBadgeStyle, children: selectionOrder })), showNameLabel && (jsxRuntime.jsx("div", { className: `${styles.labelPill} ${!isWeb ? styles.labelPillH5 : ''}`, style: pillStyle, children: jsxRuntime.jsx("span", { className: `${styles.labelText} ${!isWeb ? styles.labelTextH5 : ''}`, children: item.name }) })), isIsolated && (jsxRuntime.jsx("div", { className: `${styles.isolatedIconBelow} ${isWeb ? styles.isolatedIconWeb : ''}`, dangerouslySetInnerHTML: { __html: ISOLATED_BOUNDARY_SVG } }))] }, item.id));
|
|
32000
32075
|
}) }));
|
|
32001
32076
|
};
|
|
32002
32077
|
|
|
32003
32078
|
const DEFAULT_BACKGROUND = PARTITION_PICKER_GRID_BASE_COLOR;
|
|
32004
|
-
/** 地块 polygon / 标签上的 data 属性,供 viewport 点击命中与表格联动 */
|
|
32005
|
-
const PARTITION_BOUNDARY_ID_ATTR = 'data-partition-boundary-id';
|
|
32006
32079
|
/** Map 模式下 OverlayViewF 默认 z-index */
|
|
32007
32080
|
const DEFAULT_OVERLAY_Z_INDEX = 100;
|
|
32008
|
-
const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerStyleConfig, sn = '', platform = exports.PlatformType.WEB, width, height, padding = 0, backgroundColor = DEFAULT_BACKGROUND, defaultTransform, mapRef, minZoom = 0.5, maxZoom = 3, enablePanZoom = true, refitOnResize = true, onSizeChange, selectedBoundaryIds, defaultSelectedBoundaryIds, onSelectionChange, hoveredBoundaryId, defaultHoveredBoundaryId, onBoundaryHoverChange, showSelectionOrder = false, zIndex = DEFAULT_OVERLAY_Z_INDEX, className, style, }, ref) => {
|
|
32081
|
+
const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerStyleConfig, sn = '', platform = exports.PlatformType.WEB, width, height, padding = 0, backgroundColor = DEFAULT_BACKGROUND, defaultTransform, mapRef, minZoom = 0.5, maxZoom = 3, enablePanZoom = true, refitOnResize = true, onSizeChange, selectedBoundaryIds, defaultSelectedBoundaryIds, onSelectionChange, hoveredBoundaryId, defaultHoveredBoundaryId, onBoundaryHoverChange, showSelectionOrder = false, onIsolatedBoundaryTap, zIndex = DEFAULT_OVERLAY_Z_INDEX, className, style, }, ref) => {
|
|
32009
32082
|
/**
|
|
32010
32083
|
* 是否为 Map 模式(传入 mapRef 时为 true):
|
|
32011
32084
|
* - true:Google Maps 底图 + OverlayViewF,平移/缩放/fit 由底图负责
|
|
@@ -32064,6 +32137,24 @@ const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerSt
|
|
|
32064
32137
|
}, [mapJson]);
|
|
32065
32138
|
/** 孤立地块 id 列表(未连接到主地块的子地块) */
|
|
32066
32139
|
const isolatedBoundaryIds = useIsolatedBoundaryIds(mapJson);
|
|
32140
|
+
const boundaryNameById = React.useMemo(() => {
|
|
32141
|
+
const names = new Map();
|
|
32142
|
+
for (const boundary of generateBoundaryData(mapJson)) {
|
|
32143
|
+
names.set(boundary.id, boundary.name);
|
|
32144
|
+
}
|
|
32145
|
+
return names;
|
|
32146
|
+
}, [mapJson]);
|
|
32147
|
+
const handleIsolatedTap = React.useCallback((boundaryId, clientX, clientY) => {
|
|
32148
|
+
if (!onIsolatedBoundaryTap || !isolatedBoundaryIds.has(boundaryId))
|
|
32149
|
+
return;
|
|
32150
|
+
onIsolatedBoundaryTap({
|
|
32151
|
+
boundaryId,
|
|
32152
|
+
boundaryName: boundaryNameById.get(boundaryId),
|
|
32153
|
+
clientX,
|
|
32154
|
+
clientY,
|
|
32155
|
+
});
|
|
32156
|
+
}, [boundaryNameById, isolatedBoundaryIds, onIsolatedBoundaryTap]);
|
|
32157
|
+
const isolatedTapHandler = onIsolatedBoundaryTap ? handleIsolatedTap : undefined;
|
|
32067
32158
|
/** 选中地块 id 列表(受控/非受控)与切换选中回调 */
|
|
32068
32159
|
const { selectedIds, toggleBoundary, setSelectedIds } = useBoundarySelection({
|
|
32069
32160
|
selectedBoundaryIds,
|
|
@@ -32089,7 +32180,15 @@ const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerSt
|
|
|
32089
32180
|
toggleBoundary(id);
|
|
32090
32181
|
}, [isolatedBoundaryIds, toggleBoundary]);
|
|
32091
32182
|
/** Standalone 模式:由 viewport 统一处理点击(支持在地块上拖拽平移) */
|
|
32092
|
-
const handleViewportTap = React.useCallback((target) => {
|
|
32183
|
+
const handleViewportTap = React.useCallback(({ target, clientX, clientY }) => {
|
|
32184
|
+
const isolatedEl = target.closest(`[${PARTITION_ISOLATED_BOUNDARY_ID_ATTR}]`);
|
|
32185
|
+
if (isolatedEl) {
|
|
32186
|
+
const isolatedId = Number(isolatedEl.getAttribute(PARTITION_ISOLATED_BOUNDARY_ID_ATTR));
|
|
32187
|
+
if (Number.isFinite(isolatedId) && isolatedBoundaryIds.has(isolatedId)) {
|
|
32188
|
+
handleIsolatedTap(isolatedId, clientX, clientY);
|
|
32189
|
+
}
|
|
32190
|
+
return;
|
|
32191
|
+
}
|
|
32093
32192
|
const boundaryEl = target.closest(`[${PARTITION_BOUNDARY_ID_ATTR}]`);
|
|
32094
32193
|
if (!boundaryEl)
|
|
32095
32194
|
return;
|
|
@@ -32097,7 +32196,7 @@ const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerSt
|
|
|
32097
32196
|
if (!Number.isFinite(id) || isolatedBoundaryIds.has(id))
|
|
32098
32197
|
return;
|
|
32099
32198
|
toggleBoundary(id);
|
|
32100
|
-
}, [isolatedBoundaryIds, toggleBoundary]);
|
|
32199
|
+
}, [handleIsolatedTap, isolatedBoundaryIds, toggleBoundary]);
|
|
32101
32200
|
/**
|
|
32102
32201
|
* Map 模式 overlay 状态(bounds / viewBox / fitBounds / overlayScale)。
|
|
32103
32202
|
* 无 mapRef 时 hook 内部 enabled=false,返回值不参与渲染。
|
|
@@ -32206,12 +32305,12 @@ const MowerPartitionPickerMap = React.forwardRef(({ mapJson, mapConfig, pickerSt
|
|
|
32206
32305
|
...(isMapMode ? {} : layoutStyle),
|
|
32207
32306
|
}), [isMapMode, layoutStyle, resolvedBackgroundColor, style]);
|
|
32208
32307
|
/** 地块 + 通道 SVG;Map 模式不在 SVG 内旋转(由 OverlayViewF rotate 处理) */
|
|
32209
|
-
const mapSvgLayer = viewBox && isLayersReady ? (jsxRuntime.jsx(PartitionPickerSvg, { svgElementDatas: svgElementDatas, viewBox: viewBox, containerWidth: overlayWidth, containerHeight: overlayHeight, mapRotation: isMapMode ? 0 : actureRotate, boundaryColors: mergedPickerStyles.boundary, boundaryStrokePx: mergedPickerStyles.boundaryStrokePx, isolatedBoundaryIds: isolatedBoundaryIds, selectedIds: selectedIds, hoveredId: hoveredId, onHoverChange: handleHoverChange, onBoundaryClick: isMapMode ? handleBoundaryClick : undefined })) : null;
|
|
32308
|
+
const mapSvgLayer = viewBox && isLayersReady ? (jsxRuntime.jsx(PartitionPickerSvg, { svgElementDatas: svgElementDatas, viewBox: viewBox, containerWidth: overlayWidth, containerHeight: overlayHeight, mapRotation: isMapMode ? 0 : actureRotate, boundaryColors: mergedPickerStyles.boundary, boundaryStrokePx: mergedPickerStyles.boundaryStrokePx, isolatedBoundaryIds: isolatedBoundaryIds, selectedIds: selectedIds, hoveredId: hoveredId, onHoverChange: handleHoverChange, onBoundaryClick: isMapMode ? handleBoundaryClick : undefined, onIsolatedTap: isMapMode ? isolatedTapHandler : undefined })) : null;
|
|
32210
32309
|
/**
|
|
32211
32310
|
* 分区标签 + 充电桩 HTML 层。
|
|
32212
32311
|
* Map 模式:平铺于 overlay 根节点;Standalone:包在 mapOverlayLayer 内做 CSS 旋转。
|
|
32213
32312
|
*/
|
|
32214
|
-
const overlayLayers = viewBox && isLayersReady ? (isMapMode ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onBoundaryClick: handleBoundaryClick }), jsxRuntime.jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate })] })) : (jsxRuntime.jsxs("div", { className: styles.mapOverlayLayer, style: mapOverlayLayerStyle, children: [jsxRuntime.jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange }), jsxRuntime.jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate, viewRotationMode: "overlay-parent", containerWidth: overlayWidth, containerHeight: overlayHeight, sizeInSvgUnits: true, minDisplaySizePx: PARTITION_PICKER_CHARGING_PILE_MIN_DISPLAY_PX })] }))) : null;
|
|
32313
|
+
const overlayLayers = viewBox && isLayersReady ? (isMapMode ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onBoundaryClick: handleBoundaryClick, onIsolatedTap: isolatedTapHandler }), jsxRuntime.jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate })] })) : (jsxRuntime.jsxs("div", { className: styles.mapOverlayLayer, style: mapOverlayLayerStyle, children: [jsxRuntime.jsx(PartitionNameLabels, { items: labelItems, selectedIds: selectedIds, labelStyles: mergedPickerStyles.labels, platform: platform, showSelectionOrder: showSelectionOrder, rotation: actureRotate, onHoverChange: handleHoverChange, onIsolatedTap: isolatedTapHandler }), jsxRuntime.jsx(CharginPile, { viewBox: viewBox, rotation: actureRotate, viewRotationMode: "overlay-parent", containerWidth: overlayWidth, containerHeight: overlayHeight, sizeInSvgUnits: true, minDisplaySizePx: PARTITION_PICKER_CHARGING_PILE_MIN_DISPLAY_PX })] }))) : null;
|
|
32215
32314
|
/** Map 模式:渲染 OverlayViewF,底图为 Google Maps */
|
|
32216
32315
|
if (isMapMode && mapRef) {
|
|
32217
32316
|
return (jsxRuntime.jsx(CommonContextProvider, { value: commonValue, children: jsxRuntime.jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxRuntime.jsx(OverlayViewF, { map: mapRef, mapPaneName: "overlayMouseTarget", bounds: googleOverlay.bounds ?? undefined, rotate: actureRotate, zIndex: zIndex, onDraw: googleOverlay.handleOverlayDraw, children: jsxRuntime.jsxs("div", { className: `${styles.googleOverlayRoot} ${className || ''}`, style: containerStyle, onMouseLeave: () => setHoveredId(null), children: [mapSvgLayer, overlayLayers] }) }) }) }));
|
|
@@ -11,7 +11,7 @@ import React from 'react';
|
|
|
11
11
|
import { MowerPartitionPickerMapProps, MowerPartitionPickerMapRef } from './partitionPicker/types';
|
|
12
12
|
export declare const MowerPartitionPickerMap: React.ForwardRefExoticComponent<MowerPartitionPickerMapProps & React.RefAttributes<MowerPartitionPickerMapRef>>;
|
|
13
13
|
export default MowerPartitionPickerMap;
|
|
14
|
-
export type { MowerPartitionPickerMapProps, MowerPartitionPickerMapRef, CssLength, } from './partitionPicker/types';
|
|
14
|
+
export type { MowerPartitionPickerMapProps, MowerPartitionPickerMapRef, CssLength, IsolatedBoundaryTapPayload, } from './partitionPicker/types';
|
|
15
15
|
export type { PartitionPickerStyleConfig, PartitionPickerBoundaryColors, PartitionPickerLabelStyles, PartitionPickerGridStyle, ResolvedPartitionPickerStyles, } from './partitionPicker/constants';
|
|
16
16
|
export { resolvePartitionPickerStyles, getPartitionPickerColors, getPartitionPickerLabelStyles, PARTITION_PICKER_COLORS_WEB, PARTITION_PICKER_COLORS_H5, PARTITION_PICKER_LABEL_STYLES_WEB, PARTITION_PICKER_LABEL_STYLES_H5, } from './partitionPicker/constants';
|
|
17
17
|
//# sourceMappingURL=MowerPartitionPickerMap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MowerPartitionPickerMap.d.ts","sourceRoot":"","sources":["../../src/render/MowerPartitionPickerMap.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MowerPartitionPickerMap.d.ts","sourceRoot":"","sources":["../../src/render/MowerPartitionPickerMap.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAON,MAAM,OAAO,CAAC;AAqBf,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAiBnG,eAAO,MAAM,uBAAuB,iHA8cnC,CAAC;AAIF,eAAe,uBAAuB,CAAC;AAEvC,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,SAAS,EACT,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,6BAA6B,CAAC"}
|
|
@@ -2,6 +2,10 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { MapConfig, PlatformType } from '../../types';
|
|
3
3
|
/** ChannelClipPath 等内容裁剪使用的 SVG 坐标边距(与用户传入的屏幕 padding 无关) */
|
|
4
4
|
export declare const PARTITION_PICKER_CONTENT_CLIP_PADDING = 0;
|
|
5
|
+
/** 可选中地块 polygon / 标签 data 属性 */
|
|
6
|
+
export declare const PARTITION_BOUNDARY_ID_ATTR = "data-partition-boundary-id";
|
|
7
|
+
/** 孤立子地块命中标记(不可选中) */
|
|
8
|
+
export declare const PARTITION_ISOLATED_BOUNDARY_ID_ATTR = "data-partition-isolated-boundary-id";
|
|
5
9
|
/** H5:子区域屏幕宽度超过该值才展示名称标签(px) */
|
|
6
10
|
export declare const H5_PARTITION_LABEL_MIN_SCREEN_WIDTH_PX = 92;
|
|
7
11
|
/** H5:名称气泡总宽度(px) */
|
|
@@ -33,9 +37,9 @@ export declare const PARTITION_PICKER_GRID_BASE_COLOR = "#E3E5EB";
|
|
|
33
37
|
/** 网格单元边长(SVG 地图坐标,与 viewBox 一致;zoom 时间距同比缩放) */
|
|
34
38
|
export declare const PARTITION_PICKER_GRID_TILE_SIZE = 10;
|
|
35
39
|
/** 网格线宽(地图坐标;随 zoom 同比缩放,不做屏幕像素恒定) */
|
|
36
|
-
export declare const PARTITION_PICKER_GRID_LINE_WIDTH = 0.
|
|
40
|
+
export declare const PARTITION_PICKER_GRID_LINE_WIDTH = 0.2;
|
|
37
41
|
/** 网格交点圆点半径(地图坐标) */
|
|
38
|
-
export declare const PARTITION_PICKER_GRID_DOT_RADIUS = 0.
|
|
42
|
+
export declare const PARTITION_PICKER_GRID_DOT_RADIUS = 0.6;
|
|
39
43
|
/** 网格层整体不透明度(Figma 约 80%) */
|
|
40
44
|
export declare const PARTITION_PICKER_GRID_OPACITY = 0.4;
|
|
41
45
|
/** 网格线与交点颜色 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/render/partitionPicker/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtD,6DAA6D;AAC7D,eAAO,MAAM,qCAAqC,IAAI,CAAC;AAEvD,gCAAgC;AAChC,eAAO,MAAM,sCA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E,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,6BAA6B;IAC5C,oDAAoD;IACpD,QAAQ,EAAE,6BAA6B,CAAC;IACxC,uBAAuB;IACvB,MAAM,EAAE,0BAA0B,CAAC;IACnC,0BAA0B;IAC1B,IAAI,EAAE,wBAAwB,CAAC;IAC/B,gBAAgB,EAAE,+BAA+B,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,GAAE,YAA+B,EACzC,MAAM,CAAC,EAAE,0BAA0B,GAClC,6BAA6B,CAuB/B"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { MapData } from '@/types';
|
|
3
3
|
import { ViewBox, ScreenPaddingInput } from '../types';
|
|
4
|
+
/** Standalone 模式下容器内轻触/点击命中结果(未发生明显拖拽时) */
|
|
5
|
+
export interface ViewportTapPayload {
|
|
6
|
+
/** pointerdown / touchstart 时命中的 DOM 元素(touchend 时会用 elementFromPoint 修正) */
|
|
7
|
+
target: Element;
|
|
8
|
+
/** 抬起时指针相对视口的 X 坐标(px) */
|
|
9
|
+
clientX: number;
|
|
10
|
+
/** 抬起时指针相对视口的 Y 坐标(px) */
|
|
11
|
+
clientY: number;
|
|
12
|
+
}
|
|
4
13
|
interface UseMapViewportOptions {
|
|
5
14
|
/** 地图 JSON 数据,用于计算包围盒与初始 fit */
|
|
6
15
|
mapJson: MapData;
|
|
@@ -21,7 +30,7 @@ interface UseMapViewportOptions {
|
|
|
21
30
|
/** 容器尺寸变化时是否重新 fit,默认 true */
|
|
22
31
|
refitOnResize?: boolean;
|
|
23
32
|
/** 在容器内按下并抬起且未发生明显位移时触发(用于地块点击选中) */
|
|
24
|
-
onViewportTap?: (
|
|
33
|
+
onViewportTap?: (payload: ViewportTapPayload) => void;
|
|
25
34
|
/** 地图内容旋转角(度),用于修正平移方向与屏幕手势一致 */
|
|
26
35
|
mapRotationDeg?: number;
|
|
27
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMapViewport.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/hooks/useMapViewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAWvD,UAAU,qBAAqB;IAC7B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAChD,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,aAAa,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"useMapViewport.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/hooks/useMapViewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAWvD,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,MAAM,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,qBAAqB;IAC7B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAChD,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA0CD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,YAAY,EAAE,oBAAoB,EAClC,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAa,EACb,OAAW,EACX,aAAoB,EACpB,aAAoB,EACpB,aAAa,EACb,cAAkB,GACnB,EAAE,qBAAqB;IA4hBpB,qBAAqB;;IAErB,gCAAgC;;IAEhC,oCAAoC;;IAEpC,6CAA6C;;IAE7C,mBAAmB;;IAEnB,gCAAgC;8BAxUjB,kBAAkB;EA2UpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapGridBackground.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/MapGridBackground.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,UAAU,sBAAsB;IAC9B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,SAAS,EAAE,wBAAwB,CAAC;CACrC;2EA+BkD,sBAAsB;
|
|
1
|
+
{"version":3,"file":"MapGridBackground.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/MapGridBackground.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,UAAU,sBAAsB;IAC9B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,SAAS,EAAE,wBAAwB,CAAC;CACrC;2EA+BkD,sBAAsB;AA+FzE,wBAAuC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlatformType } from '@/types';
|
|
2
|
-
import { PartitionLabelItem } from '../hooks/usePartitionLabelItems';
|
|
3
2
|
import { PartitionPickerLabelStyles } from '../constants';
|
|
3
|
+
import { PartitionLabelItem } from '../hooks/usePartitionLabelItems';
|
|
4
4
|
interface PartitionNameLabelsProps {
|
|
5
5
|
items: PartitionLabelItem[];
|
|
6
6
|
selectedIds: number[];
|
|
@@ -13,7 +13,9 @@ interface PartitionNameLabelsProps {
|
|
|
13
13
|
onHoverChange: (id: number | null) => void;
|
|
14
14
|
/** Map 模式:点击标签切换选中(Standalone 由 viewport 统一处理) */
|
|
15
15
|
onBoundaryClick?: (id: number) => void;
|
|
16
|
+
/** 点击孤立子地块标签或图标(Map 模式直接点击;Standalone 由 viewport 处理) */
|
|
17
|
+
onIsolatedTap?: (id: number, clientX: number, clientY: number) => void;
|
|
16
18
|
}
|
|
17
|
-
declare const PartitionNameLabels: ({ items, selectedIds, labelStyles, platform, showSelectionOrder, rotation, onHoverChange, onBoundaryClick, }: PartitionNameLabelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const PartitionNameLabels: ({ items, selectedIds, labelStyles, platform, showSelectionOrder, rotation, onHoverChange, onBoundaryClick, onIsolatedTap, }: PartitionNameLabelsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export default PartitionNameLabels;
|
|
19
21
|
//# sourceMappingURL=PartitionNameLabels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartitionNameLabels.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/PartitionNameLabels.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PartitionNameLabels.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/PartitionNameLabels.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAML,0BAA0B,EAE3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,UAAU,wBAAwB;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,4CAA4C;IAC5C,WAAW,EAAE,0BAA0B,CAAC;IACxC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,kDAAkD;IAClD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,wDAAwD;IACxD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,QAAA,MAAM,mBAAmB,GAAI,6HAU1B,wBAAwB,4CAgH1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -17,7 +17,8 @@ interface PartitionPickerSvgProps {
|
|
|
17
17
|
hoveredId: number | null;
|
|
18
18
|
onHoverChange: (id: number | null) => void;
|
|
19
19
|
onBoundaryClick?: (id: number) => void;
|
|
20
|
+
onIsolatedTap?: (id: number, clientX: number, clientY: number) => void;
|
|
20
21
|
}
|
|
21
|
-
declare const PartitionPickerSvg: ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, }: PartitionPickerSvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const PartitionPickerSvg: ({ svgElementDatas, viewBox, containerWidth, containerHeight, mapRotation, boundaryColors, boundaryStrokePx, isolatedBoundaryIds, selectedIds, hoveredId, onHoverChange, onBoundaryClick, onIsolatedTap, }: PartitionPickerSvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export default PartitionPickerSvg;
|
|
23
24
|
//# sourceMappingURL=PartitionPickerSvg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartitionPickerSvg.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/PartitionPickerSvg.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,UAAU,uBAAuB;IAC/B,eAAe,EAAE,gBAAgB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,cAAc,EAAE,6BAA6B,CAAC;IAC9C,iBAAiB;IACjB,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IACnD,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"PartitionPickerSvg.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/PartitionPickerSvg.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,UAAU,uBAAuB;IAC/B,eAAe,EAAE,gBAAgB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,cAAc,EAAE,6BAA6B,CAAC;IAC9C,iBAAiB;IACjB,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IACnD,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,QAAA,MAAM,kBAAkB,GAAI,2MAczB,uBAAuB,4CAgEzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { BoundaryData } from '@/processor/unified';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { PartitionPickerBoundaryColors, PartitionPickerBoundaryStrokePx } from '../constants';
|
|
11
|
-
export declare const PARTITION_BOUNDARY_ID_ATTR = "data-partition-boundary-id";
|
|
12
11
|
interface SelectableBoundaryElementProps {
|
|
13
12
|
data: BoundaryData;
|
|
14
13
|
/** 地块交互态配色(由 resolvePartitionPickerStyles 合并外部配置后传入) */
|
|
@@ -26,7 +25,10 @@ interface SelectableBoundaryElementProps {
|
|
|
26
25
|
onHoverChange: (id: number | null) => void;
|
|
27
26
|
/** Map 模式:直接点击地块切换选中(Standalone 由 viewport 统一处理) */
|
|
28
27
|
onBoundaryClick?: (id: number) => void;
|
|
28
|
+
/** Map 模式:点击孤立子地块(Standalone 由 viewport + data 属性处理) */
|
|
29
|
+
onIsolatedTap?: (id: number, clientX: number, clientY: number) => void;
|
|
29
30
|
}
|
|
30
|
-
declare const _default: React.MemoExoticComponent<({ data, boundaryColors, boundaryStrokePx, isIsolated, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, }: SelectableBoundaryElementProps) => import("react/jsx-runtime").JSX.Element>;
|
|
31
|
+
declare const _default: React.MemoExoticComponent<({ data, boundaryColors, boundaryStrokePx, isIsolated, selected, hovered, viewBoxWidth, viewBoxHeight, containerWidth, containerHeight, onHoverChange, onBoundaryClick, onIsolatedTap, }: SelectableBoundaryElementProps) => import("react/jsx-runtime").JSX.Element>;
|
|
31
32
|
export default _default;
|
|
33
|
+
export { PARTITION_BOUNDARY_ID_ATTR, PARTITION_ISOLATED_BOUNDARY_ID_ATTR } from '../constants';
|
|
32
34
|
//# sourceMappingURL=SelectableBoundaryElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableBoundaryElement.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/SelectableBoundaryElement.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,
|
|
1
|
+
{"version":3,"file":"SelectableBoundaryElement.d.ts","sourceRoot":"","sources":["../../../../src/render/partitionPicker/layers/SelectableBoundaryElement.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAIhC,MAAM,cAAc,CAAC;AAItB,UAAU,8BAA8B;IACtC,IAAI,EAAE,YAAY,CAAC;IACnB,wDAAwD;IACxD,cAAc,EAAE,6BAA6B,CAAC;IAC9C,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,oDAAoD;IACpD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,wDAAwD;IACxD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;4OAgBE,8BAA8B;AA+FjC,wBAA+C;AAE/C,OAAO,EAAE,0BAA0B,EAAE,mCAAmC,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -27,6 +27,22 @@ export type ScreenPaddingInput = number | [number, number] | [number, number, nu
|
|
|
27
27
|
export declare const DEFAULT_SCREEN_PADDING = 50;
|
|
28
28
|
export declare function normalizeScreenPadding(padding?: ScreenPaddingInput, defaultValue?: number): ScreenPaddingBox;
|
|
29
29
|
export declare function isZeroScreenPadding(padding: ScreenPaddingBox): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 孤立子地块点击回调参数
|
|
32
|
+
*
|
|
33
|
+
* 地图包只负责识别点击并上报地块信息与指针坐标,不内置 Toast;
|
|
34
|
+
* 业务侧自行展示提示文案。
|
|
35
|
+
*/
|
|
36
|
+
export interface IsolatedBoundaryTapPayload {
|
|
37
|
+
/** 孤立子地块 id(与地图 JSON boundary id 一致) */
|
|
38
|
+
boundaryId: number;
|
|
39
|
+
/** 地块名称(来自地图 JSON),数据缺失时为 `undefined` */
|
|
40
|
+
boundaryName?: string;
|
|
41
|
+
/** 点击位置相对浏览器视口的 X 坐标(px) */
|
|
42
|
+
clientX: number;
|
|
43
|
+
/** 点击位置相对浏览器视口的 Y 坐标(px) */
|
|
44
|
+
clientY: number;
|
|
45
|
+
}
|
|
30
46
|
/** 地图叠加层默认偏移,与 MowerMapRenderer.defaultTransform 一致(Standalone 目前仅消费 rotation) */
|
|
31
47
|
export interface PartitionPickerMapTransform {
|
|
32
48
|
/** Web Mercator 米,预留 */
|
|
@@ -119,6 +135,13 @@ export interface MowerPartitionPickerMapProps {
|
|
|
119
135
|
* 序号按 selectedBoundaryIds 数组顺序从 1 开始
|
|
120
136
|
*/
|
|
121
137
|
showSelectionOrder?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* 孤立子地块点击回调(Web / H5 均触发)。
|
|
140
|
+
*
|
|
141
|
+
* Standalone 模式经 viewport 点击判定(与拖拽平移区分);Map 模式直接响应 polygon / 标签点击。
|
|
142
|
+
* 业务侧收到回调后自行 Toast 等提示,防抖策略由业务侧处理。
|
|
143
|
+
*/
|
|
144
|
+
onIsolatedBoundaryTap?: (payload: IsolatedBoundaryTapPayload) => void;
|
|
122
145
|
className?: string;
|
|
123
146
|
style?: React.CSSProperties;
|
|
124
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/render/partitionPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,kBAAkB;AAClB,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,CAAC,MAAM,EAAE,MAAM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|
|
1
1
|
import { MapBounds } from '@/types/utils';
|
|
2
|
-
import { ScreenPaddingInput } from './types';
|
|
3
|
-
import { ViewBox } from './types';
|
|
2
|
+
import { ScreenPaddingInput, ViewBox } from './types';
|
|
4
3
|
/** 拖拽超过该像素阈值时视为平移,而非点击 */
|
|
5
4
|
export declare const PAN_CLICK_THRESHOLD_PX = 5;
|
|
6
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewportUtils.d.ts","sourceRoot":"","sources":["../../../src/render/partitionPicker/viewportUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"viewportUtils.d.ts","sourceRoot":"","sources":["../../../src/render/partitionPicker/viewportUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAIL,kBAAkB,EAClB,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB,0BAA0B;AAC1B,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAclF;AAqKD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,aAAa,GAAE,kBAAsB,GACpC,OAAO,CAuBT;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAExD;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,UAGxB;AAED,+CAA+C;AAC/C,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAA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