@pisell/materials 1.8.54 → 1.8.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +35 -35
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +35 -35
- package/es/components/buttonGroupPreview/index.js +8 -4
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +207 -49
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +33 -2
- package/es/components/pisellFloorMapLayout/appearance/floorMapAppearance.js +50 -2
- package/es/components/pisellFloorMapLayout/components/EdgeLayer.js +252 -0
- package/es/components/pisellFloorMapLayout/components/EdgeLayer.less +11 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.js +179 -29
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.less +0 -28
- package/es/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.js +131 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.less +65 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +5 -4
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +12 -1
- package/es/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.js +8 -1
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.js +16 -8
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.less +69 -17
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +290 -147
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +210 -11
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.js +81 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.js +21 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapZoneElement.less +74 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +3 -1
- package/es/components/pisellFloorMapLayout/components/NodePortMarkers.js +70 -0
- package/es/components/pisellFloorMapLayout/components/NodePortMarkers.less +33 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +13 -5
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +2 -0
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -1
- package/es/components/pisellFloorMapLayout/floorMapLayoutConstants.js +1 -1
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEdgeEditing.js +340 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEdgeViewModel.js +102 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +244 -84
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +54 -0
- package/es/components/pisellFloorMapLayout/hooks/useShopFloorPlanSubscription.js +7 -4
- package/es/components/pisellFloorMapLayout/index.d.ts +5 -1
- package/es/components/pisellFloorMapLayout/locales-ja.js +14 -2
- package/es/components/pisellFloorMapLayout/locales-pt.js +14 -2
- package/es/components/pisellFloorMapLayout/locales.js +161 -8
- package/es/components/pisellFloorMapLayout/types.d.ts +86 -4
- package/es/components/pisellFloorMapLayout/types.js +5 -1
- package/es/components/pisellFloorMapLayout/utils/alignSnap.js +170 -0
- package/es/components/pisellFloorMapLayout/utils/batchScenePlacementLayout.js +86 -0
- package/es/components/pisellFloorMapLayout/utils/edgeRouting.js +942 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +7 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasStage.js +23 -1
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +11 -2
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +20 -3
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +11 -5
- package/es/components/pisellFloorMapLayout/utils/floorMapOverviewLayout.js +5 -3
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +20 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.js +62 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +83 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.js +29 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapToolbarPalette.js +51 -0
- package/es/components/productCard/cartSkuCard/components/BookingItem/index.js +14 -0
- package/es/components/productCard/cartSkuCard/components/BookingItem/index.less +32 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +1 -2
- package/es/components/productCard/cartSkuCard/index.js +17 -11
- package/es/components/productCard/lineItem/BookingLineItem.js +6 -4
- package/es/components/productCard/lineItem/components/Resources/index.js +45 -0
- package/es/components/productCard/lineItem/components/TimeRange/index.js +64 -0
- package/es/components/productCard/lineItem/index.js +2 -1
- package/es/components/productCard/lineItem/index.less +21 -10
- package/es/index.d.ts +6 -2
- package/es/index.js +6 -2
- package/es/pisell-materials.tw.css +3 -0
- package/lib/components/buttonGroupPreview/index.js +8 -4
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +206 -48
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +33 -2
- package/lib/components/pisellFloorMapLayout/appearance/floorMapAppearance.js +50 -2
- package/lib/components/pisellFloorMapLayout/components/EdgeLayer.js +255 -0
- package/lib/components/pisellFloorMapLayout/components/EdgeLayer.less +11 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.js +179 -29
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.less +0 -28
- package/lib/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.js +134 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEdgeEditPanel.less +65 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +4 -3
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +12 -1
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.js +8 -1
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.js +16 -8
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.less +69 -17
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +287 -144
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +210 -11
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.js +84 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.js +23 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapZoneElement.less +74 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +3 -1
- package/lib/components/pisellFloorMapLayout/components/NodePortMarkers.js +73 -0
- package/lib/components/pisellFloorMapLayout/components/NodePortMarkers.less +33 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +12 -4
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +2 -0
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -1
- package/lib/components/pisellFloorMapLayout/floorMapLayoutConstants.js +1 -1
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEdgeEditing.js +341 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEdgeViewModel.js +103 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +242 -82
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +54 -0
- package/lib/components/pisellFloorMapLayout/hooks/useShopFloorPlanSubscription.js +7 -4
- package/lib/components/pisellFloorMapLayout/index.d.ts +5 -1
- package/lib/components/pisellFloorMapLayout/locales-ja.js +14 -2
- package/lib/components/pisellFloorMapLayout/locales-pt.js +14 -2
- package/lib/components/pisellFloorMapLayout/locales.js +161 -8
- package/lib/components/pisellFloorMapLayout/types.d.ts +86 -4
- package/lib/components/pisellFloorMapLayout/types.js +5 -0
- package/lib/components/pisellFloorMapLayout/utils/alignSnap.js +170 -0
- package/lib/components/pisellFloorMapLayout/utils/batchScenePlacementLayout.js +87 -0
- package/lib/components/pisellFloorMapLayout/utils/edgeRouting.js +956 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +7 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasStage.js +23 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +11 -2
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +21 -2
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +11 -5
- package/lib/components/pisellFloorMapLayout/utils/floorMapOverviewLayout.js +5 -3
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +20 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.js +64 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +83 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.js +29 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapToolbarPalette.js +54 -0
- package/lib/components/productCard/cartSkuCard/components/BookingItem/index.js +17 -0
- package/lib/components/productCard/cartSkuCard/components/BookingItem/index.less +32 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +1 -2
- package/lib/components/productCard/cartSkuCard/index.js +17 -11
- package/lib/components/productCard/lineItem/BookingLineItem.js +6 -4
- package/lib/components/productCard/lineItem/components/Resources/index.js +47 -0
- package/lib/components/productCard/lineItem/components/TimeRange/index.js +67 -0
- package/lib/components/productCard/lineItem/index.js +2 -1
- package/lib/components/productCard/lineItem/index.less +21 -10
- package/lib/index.d.ts +6 -2
- package/lib/index.js +11 -0
- package/lib/pisell-materials.tw.css +3 -0
- package/package.json +4 -1
|
@@ -26,6 +26,28 @@ function computeFloorMapContentStage(params) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
+
* 全览网格行列:n≤3 单行;n≥4 用 ceil(√n) 列、ceil(n/cols) 行,行列接近且末行空格最少。
|
|
30
|
+
* 例:2→2×1,3→3×1,4→2×2,5/6→3×2,7-9→3×3,10-12→4×3。
|
|
31
|
+
*
|
|
32
|
+
* 仅供旧版「等大缩略图卡片」全览使用;新版 All 视图按原始尺寸装箱,请用
|
|
33
|
+
* {@link packCanvasesIntoShelves}。
|
|
34
|
+
*/
|
|
35
|
+
function getOverviewGridDims(count) {
|
|
36
|
+
if (count <= 0) return {
|
|
37
|
+
cols: 1,
|
|
38
|
+
rows: 1
|
|
39
|
+
};
|
|
40
|
+
if (count <= 3) return {
|
|
41
|
+
cols: count,
|
|
42
|
+
rows: 1
|
|
43
|
+
};
|
|
44
|
+
const cols = Math.ceil(Math.sqrt(count));
|
|
45
|
+
return {
|
|
46
|
+
cols,
|
|
47
|
+
rows: Math.ceil(count / cols)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
29
51
|
* 多画布 All 视图的紧凑装箱(Bottom-Left Fill, BLF):
|
|
30
52
|
*
|
|
31
53
|
* - 保留输入顺序(与 Tab 顺序一致),不旋转、不缩放,原始尺寸即渲染尺寸;
|
|
@@ -136,4 +158,4 @@ function packCanvasesIntoShelves(boxes, gap, aspectBias = 2.5) {
|
|
|
136
158
|
};
|
|
137
159
|
}
|
|
138
160
|
//#endregion
|
|
139
|
-
export { computeFloorMapContentStage, packCanvasesIntoShelves };
|
|
161
|
+
export { computeFloorMapContentStage, getOverviewGridDims, packCanvasesIntoShelves };
|
|
@@ -12,6 +12,11 @@ const BUILTIN_SHAPE_FALLBACK_SIZE = {
|
|
|
12
12
|
width: 96,
|
|
13
13
|
height: 96
|
|
14
14
|
};
|
|
15
|
+
const ZONE_KIND_DEFAULT_SIZE = {
|
|
16
|
+
width: 240,
|
|
17
|
+
height: 160
|
|
18
|
+
};
|
|
19
|
+
const ZONE_DEFAULT_Z_INDEX = -100;
|
|
15
20
|
function getDefaultSize(elementKind, elementKinds, element) {
|
|
16
21
|
if (!elementKind) return {
|
|
17
22
|
width: DEFAULT_SIZE,
|
|
@@ -22,6 +27,7 @@ function getDefaultSize(elementKind, elementKinds, element) {
|
|
|
22
27
|
const def = getFloorMapBuiltinShapeDef(element === null || element === void 0 ? void 0 : element.builtinShapeKey);
|
|
23
28
|
return def ? _objectSpread2({}, def.defaultSize) : _objectSpread2({}, BUILTIN_SHAPE_FALLBACK_SIZE);
|
|
24
29
|
}
|
|
30
|
+
if (elementKind === "floorMapZone") return _objectSpread2({}, ZONE_KIND_DEFAULT_SIZE);
|
|
25
31
|
if (!elementKinds.find((k) => k.value === elementKind)) return {
|
|
26
32
|
width: DEFAULT_SIZE,
|
|
27
33
|
height: DEFAULT_SIZE
|
|
@@ -39,11 +45,12 @@ function mergeCanvasItems(canvasId, config, defaultCellSize = DEFAULT_SIZE) {
|
|
|
39
45
|
const items = [];
|
|
40
46
|
const onCanvas = sceneElements.filter((el) => el.canvasId === canvasId);
|
|
41
47
|
for (const el of onCanvas) {
|
|
42
|
-
var _ref, _el$width, _ref2, _el$height, _el$shape;
|
|
48
|
+
var _ref, _el$width, _ref2, _el$height, _el$shape, _el$parentId;
|
|
43
49
|
const size = getDefaultSize(el.elementKind, elementKinds, el);
|
|
44
50
|
const w = (_ref = (_el$width = el.width) !== null && _el$width !== void 0 ? _el$width : size.width) !== null && _ref !== void 0 ? _ref : defaultCellSize;
|
|
45
51
|
const h = (_ref2 = (_el$height = el.height) !== null && _el$height !== void 0 ? _el$height : size.height) !== null && _ref2 !== void 0 ? _ref2 : defaultCellSize;
|
|
46
52
|
const kindConfig = getElementKindConfig({ elementKinds }, el.elementKind);
|
|
53
|
+
const isZone = Boolean(el.isZone) || el.elementKind === "floorMapZone";
|
|
47
54
|
items.push({
|
|
48
55
|
id: el.instanceId,
|
|
49
56
|
instanceId: el.instanceId,
|
|
@@ -52,9 +59,11 @@ function mergeCanvasItems(canvasId, config, defaultCellSize = DEFAULT_SIZE) {
|
|
|
52
59
|
width: w,
|
|
53
60
|
height: h,
|
|
54
61
|
name: el.name,
|
|
55
|
-
zIndex: el.zIndex,
|
|
62
|
+
zIndex: isZone && el.zIndex == null ? ZONE_DEFAULT_Z_INDEX : el.zIndex,
|
|
56
63
|
shape: (_el$shape = el.shape) !== null && _el$shape !== void 0 ? _el$shape : kindConfig === null || kindConfig === void 0 ? void 0 : kindConfig.defaultShape,
|
|
57
64
|
elementKind: el.elementKind,
|
|
65
|
+
isZone,
|
|
66
|
+
parentId: (_el$parentId = el.parentId) !== null && _el$parentId !== void 0 ? _el$parentId : null,
|
|
58
67
|
_sceneElement: el
|
|
59
68
|
});
|
|
60
69
|
}
|
|
@@ -16,6 +16,18 @@ function resolveDataBindingPolicy(kind) {
|
|
|
16
16
|
var _kind$dataBindingPoli;
|
|
17
17
|
return (_kind$dataBindingPoli = kind === null || kind === void 0 ? void 0 : kind.dataBindingPolicy) !== null && _kind$dataBindingPoli !== void 0 ? _kind$dataBindingPoli : "none";
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* 侧栏调色板:点击即可落点,无需数据源 / 数据行等二次选择。
|
|
21
|
+
* 含预约「装饰」下的内置图形(厕所/分隔/柱子等)、底图图片等(`dataBindingPolicy: none`)。
|
|
22
|
+
* 不含舞台;内置图形须带 `builtinShapeKey` 由 {@link isDirectPlacePaletteEntry} 判断。
|
|
23
|
+
*/
|
|
24
|
+
function isDirectPlacePaletteKind(kind) {
|
|
25
|
+
if (!kind) return false;
|
|
26
|
+
if (kind.value === "stage") return false;
|
|
27
|
+
/** 内置图形在调色板按预设展开为多张卡,不单靠 kind 落点 */
|
|
28
|
+
if (kind.value === "floorMapBuiltinShape") return false;
|
|
29
|
+
return resolveDataBindingPolicy(kind) === "none";
|
|
30
|
+
}
|
|
19
31
|
function getElementKindConfig(config, elementKind) {
|
|
20
32
|
var _config$elementKinds;
|
|
21
33
|
if (!elementKind || !(config === null || config === void 0 || (_config$elementKinds = config.elementKinds) === null || _config$elementKinds === void 0 ? void 0 : _config$elementKinds.length)) return void 0;
|
|
@@ -45,8 +57,13 @@ function getSwappableElementKindsInSameCategory(config, elementKind) {
|
|
|
45
57
|
return ((_k$categoryId = k.categoryId) !== null && _k$categoryId !== void 0 ? _k$categoryId : fallbackId) === cid;
|
|
46
58
|
});
|
|
47
59
|
}
|
|
48
|
-
|
|
49
|
-
const
|
|
60
|
+
/** 绑定资源类图元(dataBindingPolicy 为 required/optional)新建默认尺寸 */
|
|
61
|
+
const FLOOR_MAP_RESOURCE_PLACE_DEFAULT = {
|
|
62
|
+
width: 300,
|
|
63
|
+
height: 200
|
|
64
|
+
};
|
|
65
|
+
const DEFAULT_PLACE_W = FLOOR_MAP_RESOURCE_PLACE_DEFAULT.width;
|
|
66
|
+
const DEFAULT_PLACE_H = FLOOR_MAP_RESOURCE_PLACE_DEFAULT.height;
|
|
50
67
|
const IMAGE_PLACE_W = 400;
|
|
51
68
|
const IMAGE_PLACE_H = 240;
|
|
52
69
|
const DECO_SIZE = 48;
|
|
@@ -127,4 +144,4 @@ function getSceneElementRenderIssue(element, kind, dataSources) {
|
|
|
127
144
|
return null;
|
|
128
145
|
}
|
|
129
146
|
//#endregion
|
|
130
|
-
export { getElementKindConfig, getSceneElementRenderIssue, getSwappableElementKindsInSameCategory, isFloorMapBuiltinShapeElementKind, isFloorMapImageElementKind, patchSceneElementForKindSwitch, resolveDataBindingPolicy };
|
|
147
|
+
export { FLOOR_MAP_RESOURCE_PLACE_DEFAULT, getElementKindConfig, getSceneElementRenderIssue, getSwappableElementKindsInSameCategory, isDirectPlacePaletteKind, isFloorMapBuiltinShapeElementKind, isFloorMapImageElementKind, patchSceneElementForKindSwitch, resolveDataBindingPolicy };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types.js";
|
|
2
2
|
import { STAGE_DECO_DEFAULT } from "./floorMapStageDefaults.js";
|
|
3
3
|
import { isFloorMapBuiltinShapeElementKind, isFloorMapImageElementKind } from "./floorMapElementKindUtils.js";
|
|
4
|
+
import { FloorMapZoneElement } from "../components/FloorMapZoneElement.js";
|
|
4
5
|
import { FloorMapImageElement } from "../components/FloorMapImageElement.js";
|
|
5
6
|
import { FloorMapBuiltinShapeElement } from "../components/FloorMapBuiltinShapeElement.js";
|
|
6
7
|
import React from "react";
|
|
@@ -33,22 +34,27 @@ function renderFloorMapFallbackPlaceholder(item) {
|
|
|
33
34
|
const kind = (item === null || item === void 0 ? void 0 : item.elementKind) || "item";
|
|
34
35
|
const isCircle = (item === null || item === void 0 ? void 0 : item.shape) === "circle";
|
|
35
36
|
const isStage = kind === FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
37
|
+
const isZone = Boolean(item.isZone) || kind === "floorMapZone";
|
|
36
38
|
const nameText = (item === null || item === void 0 ? void 0 : item.name) != null ? String(item.name).trim() : "";
|
|
37
39
|
const fallbackLabel = nameText || kind;
|
|
40
|
+
if (isZone) {
|
|
41
|
+
var _item$name, _item$_sceneElement;
|
|
42
|
+
return /* @__PURE__ */ React.createElement(FloorMapZoneElement, { name: (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : (_item$_sceneElement = item._sceneElement) === null || _item$_sceneElement === void 0 ? void 0 : _item$_sceneElement.name });
|
|
43
|
+
}
|
|
38
44
|
if (isFloorMapImageElementKind(kind)) {
|
|
39
|
-
var _item$
|
|
40
|
-
const url = (_item$
|
|
45
|
+
var _item$_sceneElement2, _item$name2, _item$_sceneElement3;
|
|
46
|
+
const url = (_item$_sceneElement2 = item._sceneElement) === null || _item$_sceneElement2 === void 0 ? void 0 : _item$_sceneElement2.imageUrl;
|
|
41
47
|
return /* @__PURE__ */ React.createElement(FloorMapImageElement, {
|
|
42
48
|
imageUrl: url,
|
|
43
|
-
name: (_item$
|
|
49
|
+
name: (_item$name2 = item.name) !== null && _item$name2 !== void 0 ? _item$name2 : (_item$_sceneElement3 = item._sceneElement) === null || _item$_sceneElement3 === void 0 ? void 0 : _item$_sceneElement3.name
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
if (isFloorMapBuiltinShapeElementKind(kind)) {
|
|
47
|
-
var _item$
|
|
53
|
+
var _item$name3;
|
|
48
54
|
const el = item._sceneElement;
|
|
49
55
|
return /* @__PURE__ */ React.createElement(FloorMapBuiltinShapeElement, {
|
|
50
56
|
builtinShapeKey: el === null || el === void 0 ? void 0 : el.builtinShapeKey,
|
|
51
|
-
name: (_item$
|
|
57
|
+
name: (_item$name3 = item.name) !== null && _item$name3 !== void 0 ? _item$name3 : el === null || el === void 0 ? void 0 : el.name,
|
|
52
58
|
fillColor: el === null || el === void 0 ? void 0 : el.fillColor,
|
|
53
59
|
strokeColor: el === null || el === void 0 ? void 0 : el.strokeColor
|
|
54
60
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import { mergeCanvasesForTabs } from "./mergeCanvasesForTabs.js";
|
|
3
|
-
import { mergeCanvasItems } from "./floorMapConfigMerge.js";
|
|
4
3
|
import { gapToPx } from "./layoutMeasurements.js";
|
|
4
|
+
import { mergeCanvasItems } from "./floorMapConfigMerge.js";
|
|
5
5
|
import { computeFloorMapContentStage, packCanvasesIntoShelves } from "./floorMapCanvasStage.js";
|
|
6
6
|
//#region src/components/pisellFloorMapLayout/utils/floorMapOverviewLayout.ts
|
|
7
7
|
/**
|
|
@@ -44,16 +44,18 @@ function buildFloorMapOverviewLayout(params) {
|
|
|
44
44
|
cellSize
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
+
const titleBandHeight = 36;
|
|
47
48
|
const pack = packCanvasesIntoShelves(stageList.map((s) => ({
|
|
48
49
|
width: s.contentWidth,
|
|
49
|
-
height: s.contentHeight
|
|
50
|
+
height: s.contentHeight + titleBandHeight
|
|
50
51
|
})), areaGap);
|
|
51
52
|
return {
|
|
52
53
|
areas: stageList.map((s, i) => {
|
|
53
54
|
var _pack$positions$i$x, _pack$positions$i, _pack$positions$i$y, _pack$positions$i2;
|
|
54
55
|
return _objectSpread2(_objectSpread2({}, s), {}, {
|
|
55
56
|
x: (_pack$positions$i$x = (_pack$positions$i = pack.positions[i]) === null || _pack$positions$i === void 0 ? void 0 : _pack$positions$i.x) !== null && _pack$positions$i$x !== void 0 ? _pack$positions$i$x : 0,
|
|
56
|
-
y: (_pack$positions$i$y = (_pack$positions$i2 = pack.positions[i]) === null || _pack$positions$i2 === void 0 ? void 0 : _pack$positions$i2.y) !== null && _pack$positions$i$y !== void 0 ? _pack$positions$i$y : 0
|
|
57
|
+
y: (_pack$positions$i$y = (_pack$positions$i2 = pack.positions[i]) === null || _pack$positions$i2 === void 0 ? void 0 : _pack$positions$i2.y) !== null && _pack$positions$i$y !== void 0 ? _pack$positions$i$y : 0,
|
|
58
|
+
titleBandHeight
|
|
57
59
|
});
|
|
58
60
|
}),
|
|
59
61
|
totalWidth: pack.totalWidth,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PisellCardPickerCategoryConfig, PisellCardPickerItem } from "./floorMapResourcePickerTypes.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts
|
|
4
|
+
/** @deprecated 使用 PisellCardPickerItem */
|
|
5
|
+
type FloorMapResourcePickerRecord = PisellCardPickerItem;
|
|
6
|
+
interface FloorMapResourcePickerCardMeta {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
subtitles: string[];
|
|
10
|
+
capacity: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** 平面图 / 预约:area 最多三级;仅展示 chip,不显示行左侧「区域」等标签 */
|
|
13
|
+
declare function getFloorMapCardPickerCategoryConfig(): PisellCardPickerCategoryConfig;
|
|
14
|
+
/**
|
|
15
|
+
* 小卡片主标题 + 副文案(容量、编号等;区域已在筛选区展示,副文案不再重复 area)。
|
|
16
|
+
*/
|
|
17
|
+
declare function getFloorMapResourcePickerCardMeta(record: PisellCardPickerItem): FloorMapResourcePickerCardMeta;
|
|
18
|
+
declare function floorMapResourcePickerRecordSearchText(record: PisellCardPickerItem): string;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FloorMapResourcePickerRecord, floorMapResourcePickerRecordSearchText, getFloorMapCardPickerCategoryConfig, getFloorMapResourcePickerCardMeta };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { formatDataRecordOptionLabel } from "./floorMapDataRecordLabel.js";
|
|
2
|
+
import { parseNestedPathSegments } from "./floorMapResourcePickerTypes.js";
|
|
3
|
+
//#region src/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.ts
|
|
4
|
+
function pickField(record, key) {
|
|
5
|
+
const raw = record[key];
|
|
6
|
+
if (raw == null) return null;
|
|
7
|
+
const t = String(raw).trim();
|
|
8
|
+
return t ? t : null;
|
|
9
|
+
}
|
|
10
|
+
function resolveReservationAreaRaw(record) {
|
|
11
|
+
return pickField(record, "area");
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 预约桌位:从 `area` 解析路径,最多 3 段。
|
|
15
|
+
* 当前资源多为单段(如 `party_room1`);将来 `广东/中山/三乡` 会自动出现二、三级筛选行。
|
|
16
|
+
*/
|
|
17
|
+
function getFloorMapResourcePickerCategoryPath(record) {
|
|
18
|
+
return parseNestedPathSegments(resolveReservationAreaRaw(record), 3);
|
|
19
|
+
}
|
|
20
|
+
/** 平面图 / 预约:area 最多三级;仅展示 chip,不显示行左侧「区域」等标签 */
|
|
21
|
+
function getFloorMapCardPickerCategoryConfig() {
|
|
22
|
+
return {
|
|
23
|
+
mode: "nested",
|
|
24
|
+
levels: [
|
|
25
|
+
{},
|
|
26
|
+
{},
|
|
27
|
+
{}
|
|
28
|
+
],
|
|
29
|
+
getCategoryPath: getFloorMapResourcePickerCategoryPath
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 小卡片主标题 + 副文案(容量、编号等;区域已在筛选区展示,副文案不再重复 area)。
|
|
34
|
+
*/
|
|
35
|
+
function getFloorMapResourcePickerCardMeta(record) {
|
|
36
|
+
var _pickField, _record$id;
|
|
37
|
+
const title = formatDataRecordOptionLabel(record);
|
|
38
|
+
const subtitles = [];
|
|
39
|
+
const capacityRaw = (_pickField = pickField(record, "capacityLabel")) !== null && _pickField !== void 0 ? _pickField : pickField(record, "capacity");
|
|
40
|
+
const capacity = capacityRaw ? String(capacityRaw) : null;
|
|
41
|
+
const idStr = String((_record$id = record.id) !== null && _record$id !== void 0 ? _record$id : "").trim();
|
|
42
|
+
if (idStr && idStr !== title) subtitles.push(`#${idStr}`);
|
|
43
|
+
return {
|
|
44
|
+
id: idStr,
|
|
45
|
+
title,
|
|
46
|
+
subtitles,
|
|
47
|
+
capacity
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function floorMapResourcePickerRecordSearchText(record) {
|
|
51
|
+
const meta = getFloorMapResourcePickerCardMeta(record);
|
|
52
|
+
const areaRaw = resolveReservationAreaRaw(record);
|
|
53
|
+
return [
|
|
54
|
+
meta.title,
|
|
55
|
+
areaRaw,
|
|
56
|
+
meta.capacity,
|
|
57
|
+
...meta.subtitles,
|
|
58
|
+
meta.id
|
|
59
|
+
].filter(Boolean).join(" ").toLowerCase();
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { floorMapResourcePickerRecordSearchText, getFloorMapCardPickerCategoryConfig, getFloorMapResourcePickerCardMeta };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts
|
|
4
|
+
/** 选择模式 */
|
|
5
|
+
type PisellCardPickerMode = 'single' | 'multiple';
|
|
6
|
+
/** 可选条目:至少包含稳定主键 id */
|
|
7
|
+
interface PisellCardPickerItem {
|
|
8
|
+
id: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** 分类路径,最多 3 级(不足时后续为 null;未选层级表示「全部」) */
|
|
12
|
+
type PisellCardPickerCategoryPath = [string | null | undefined, string | null | undefined, string | null | undefined];
|
|
13
|
+
/** 单级分类配置(最多 3 级) */
|
|
14
|
+
interface PisellCardPickerCategoryLevelConfig {
|
|
15
|
+
/** 嵌套模式下该级行左侧标签(如「省」「市」「区/镇」) */
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* parallel 模式:从 item[field] 读取该维度的 key。
|
|
19
|
+
* nested 模式:请用 getCategoryPath / nestedPathField 从单字段拆路径。
|
|
20
|
+
*/
|
|
21
|
+
field?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* nested:同一维度嵌套分级(广东 → 中山 → 三乡),子级依赖父级已选。
|
|
25
|
+
* parallel:三个独立维度(每级互不影响)。
|
|
26
|
+
*/
|
|
27
|
+
type PisellCardPickerCategoryMode = 'nested' | 'parallel';
|
|
28
|
+
/** 分类筛选配置(最多 3 级;数据只有 1 级时 UI 只展示有值的那一行) */
|
|
29
|
+
interface PisellCardPickerCategoryConfig {
|
|
30
|
+
/** 默认 nested */
|
|
31
|
+
mode?: PisellCardPickerCategoryMode;
|
|
32
|
+
/**
|
|
33
|
+
* 最多 3 级配置位。
|
|
34
|
+
* nested:单字段拆路径;仅 1 段时只出现第 1 行,多段时再逐级出现。
|
|
35
|
+
*/
|
|
36
|
+
levels: [PisellCardPickerCategoryLevelConfig?, PisellCardPickerCategoryLevelConfig?, PisellCardPickerCategoryLevelConfig?];
|
|
37
|
+
/** 自定义 [L1,L2,L3];优先于 levels[].field */
|
|
38
|
+
getCategoryPath?: (item: PisellCardPickerItem) => PisellCardPickerCategoryPath;
|
|
39
|
+
/**
|
|
40
|
+
* nested 便捷项:从 item[nestedPathField] 用 `/` `>` 等拆成最多 3 段。
|
|
41
|
+
* 与 getCategoryPath 同时存在时以 getCategoryPath 为准。
|
|
42
|
+
*/
|
|
43
|
+
nestedPathField?: string;
|
|
44
|
+
}
|
|
45
|
+
interface PisellCardPickerCardMeta {
|
|
46
|
+
title: string;
|
|
47
|
+
subtitles: string[];
|
|
48
|
+
/** 容量/人数;卡片副文案前可由业务侧渲染人数图标(如平面图资源选择) */
|
|
49
|
+
capacity?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 平面图工具栏「打开资源选择」槽位 props。
|
|
53
|
+
* 与 `PisellProResourcePickerModalProps` 字段对齐;业务注入 modal 时可透传
|
|
54
|
+
* `categoryConfig` / `getSearchText` / `getCardMeta` 等扩展项。
|
|
55
|
+
*/
|
|
56
|
+
interface FloorMapResourcePickerSlotProps {
|
|
57
|
+
open: boolean;
|
|
58
|
+
onClose: () => void;
|
|
59
|
+
onConfirm: (selectedIds: string[]) => void;
|
|
60
|
+
records: PisellCardPickerItem[];
|
|
61
|
+
mode?: PisellCardPickerMode;
|
|
62
|
+
value?: string[];
|
|
63
|
+
title?: string;
|
|
64
|
+
disabledIds?: string[];
|
|
65
|
+
/** 最多三级分类;不传则仅搜索 + 列表 */
|
|
66
|
+
categoryConfig?: PisellCardPickerCategoryConfig;
|
|
67
|
+
getSearchText?: (record: PisellCardPickerItem) => string;
|
|
68
|
+
getCardMeta?: (record: PisellCardPickerItem) => PisellCardPickerCardMeta;
|
|
69
|
+
renderCard?: (record: PisellCardPickerItem, ctx: {
|
|
70
|
+
selected: boolean;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
}) => ReactNode;
|
|
73
|
+
zIndex?: number;
|
|
74
|
+
width?: number;
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 把单字段中的层级路径解析为 [L1, L2, L3]。
|
|
79
|
+
* 例:`广东/中山/三乡` → `['广东','中山','三乡']`;不足三级后续为 null。
|
|
80
|
+
*/
|
|
81
|
+
declare function parseNestedPathSegments(raw: unknown, maxDepth?: number): PisellCardPickerCategoryPath;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { FloorMapResourcePickerSlotProps, PisellCardPickerCardMeta, PisellCardPickerCategoryConfig, PisellCardPickerCategoryLevelConfig, PisellCardPickerCategoryMode, PisellCardPickerCategoryPath, PisellCardPickerItem, PisellCardPickerMode, parseNestedPathSegments };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.ts
|
|
2
|
+
/** 将「广东/中山/三乡」类字符串拆成最多 3 段(嵌套路径,非三个独立维度) */
|
|
3
|
+
const NESTED_PATH_SPLIT = /(?:\s*\/\s*|\s*>\s*|\s*\\\s*|\s*\|\s*|\s*·\s*)/;
|
|
4
|
+
/**
|
|
5
|
+
* 把单字段中的层级路径解析为 [L1, L2, L3]。
|
|
6
|
+
* 例:`广东/中山/三乡` → `['广东','中山','三乡']`;不足三级后续为 null。
|
|
7
|
+
*/
|
|
8
|
+
function parseNestedPathSegments(raw, maxDepth = 3) {
|
|
9
|
+
var _parts$, _parts$2, _parts$3;
|
|
10
|
+
if (raw == null) return [
|
|
11
|
+
null,
|
|
12
|
+
null,
|
|
13
|
+
null
|
|
14
|
+
];
|
|
15
|
+
const t = String(raw).trim();
|
|
16
|
+
if (!t) return [
|
|
17
|
+
null,
|
|
18
|
+
null,
|
|
19
|
+
null
|
|
20
|
+
];
|
|
21
|
+
const parts = t.split(NESTED_PATH_SPLIT).map((s) => s.trim()).filter(Boolean).slice(0, maxDepth);
|
|
22
|
+
return [
|
|
23
|
+
(_parts$ = parts[0]) !== null && _parts$ !== void 0 ? _parts$ : null,
|
|
24
|
+
(_parts$2 = parts[1]) !== null && _parts$2 !== void 0 ? _parts$2 : null,
|
|
25
|
+
(_parts$3 = parts[2]) !== null && _parts$3 !== void 0 ? _parts$3 : null
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { parseNestedPathSegments };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
|
+
import "../types.js";
|
|
3
|
+
import { FLOOR_MAP_BUILTIN_SHAPES } from "./floorMapBuiltinShapes.js";
|
|
4
|
+
//#region src/components/pisellFloorMapLayout/utils/floorMapToolbarPalette.ts
|
|
5
|
+
/** 解析侧栏每类展示上限(至少 1) */
|
|
6
|
+
function resolvePaletteSidebarVisibleLimit(limit) {
|
|
7
|
+
return Math.max(1, Math.floor(limit !== null && limit !== void 0 ? limit : 5));
|
|
8
|
+
}
|
|
9
|
+
/** 分类下图元数是否应显示「查看全部」 */
|
|
10
|
+
function shouldShowPaletteViewAll(entryCount, limit) {
|
|
11
|
+
return entryCount > resolvePaletteSidebarVisibleLimit(limit);
|
|
12
|
+
}
|
|
13
|
+
/** 侧栏直接展示的 palette 条目(前 N 项) */
|
|
14
|
+
function getPaletteSidebarVisibleEntries(entries, limit) {
|
|
15
|
+
return entries.slice(0, resolvePaletteSidebarVisibleLimit(limit));
|
|
16
|
+
}
|
|
17
|
+
function buildToolbarPaletteEntries(kinds, resolveBuiltinLabel) {
|
|
18
|
+
const out = [];
|
|
19
|
+
for (const kind of kinds) {
|
|
20
|
+
if (kind.value === "floorMapBuiltinShape") {
|
|
21
|
+
for (const shapeDef of FLOOR_MAP_BUILTIN_SHAPES) out.push({
|
|
22
|
+
key: `builtin:${kind.value}:${shapeDef.key}`,
|
|
23
|
+
kind,
|
|
24
|
+
builtinShapeKey: shapeDef.key,
|
|
25
|
+
shapeDef,
|
|
26
|
+
label: resolveBuiltinLabel(shapeDef)
|
|
27
|
+
});
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
out.push({
|
|
31
|
+
key: `kind:${kind.value}`,
|
|
32
|
+
kind,
|
|
33
|
+
label: kind.label
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 按弹窗内各条目数量展开为落点列表(数量为 n 则重复 n 次,落点时阶梯偏移)。
|
|
40
|
+
*/
|
|
41
|
+
function expandPaletteEntriesByQuantity(entries, quantities) {
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const e of entries) {
|
|
44
|
+
var _quantities$e$key;
|
|
45
|
+
const n = Math.max(0, Math.floor((_quantities$e$key = quantities[e.key]) !== null && _quantities$e$key !== void 0 ? _quantities$e$key : 0));
|
|
46
|
+
for (let i = 0; i < n; i += 1) out.push(_objectSpread2({ elementKind: e.kind.value }, e.builtinShapeKey ? { builtinShapeKey: e.builtinShapeKey } : {}));
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { buildToolbarPaletteEntries, expandPaletteEntriesByQuantity, getPaletteSidebarVisibleEntries, shouldShowPaletteViewAll };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import TimeRange from "../timeRange/index.js";
|
|
2
|
+
import Resources from "../resources/index.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Divider } from "antd";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import "./index.less";
|
|
7
|
+
//#region src/components/productCard/cartSkuCard/components/BookingItem/index.tsx
|
|
8
|
+
const PREFIX = "pisell-cart-sku-card-booking-item";
|
|
9
|
+
const BookingItem = (props) => {
|
|
10
|
+
const { children, isShowRelatedProduct = true, isShowDelete = false, dataSource } = props;
|
|
11
|
+
return /* @__PURE__ */ React.createElement("div", { className: PREFIX }, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__info`, { [`${PREFIX}__info--with-delete`]: isShowDelete }) }, /* @__PURE__ */ React.createElement(TimeRange, { dataSource }), /* @__PURE__ */ React.createElement(Resources, { dataSource })), isShowRelatedProduct && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, { style: { margin: 0 } }), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__related-product` }, children)));
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { BookingItem as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.pisell-cart-sku-card-booking-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
|
|
6
|
+
&__info {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
|
|
12
|
+
&--with-delete {
|
|
13
|
+
padding-right: 44px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__resource-title {
|
|
18
|
+
color: var(--Gray-900, #101828);
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__related-product {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 4px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -2,7 +2,6 @@ import IconFont from "../../../../iconfont/index.js";
|
|
|
2
2
|
import { getServiceTime } from "../../../utils.js";
|
|
3
3
|
import { PREFIX } from "../../index.js";
|
|
4
4
|
import React, { useEffect, useMemo } from "react";
|
|
5
|
-
import { Divider } from "antd";
|
|
6
5
|
import dayjs from "dayjs";
|
|
7
6
|
import "dayjs/locale/zh-cn";
|
|
8
7
|
import "dayjs/locale/en";
|
|
@@ -32,7 +31,7 @@ const TimeRange = (props) => {
|
|
|
32
31
|
useMemo(() => {
|
|
33
32
|
return isEn ? "HH:mm DD/MM/YYYY" : "YYYY-MM-DD HH:mm";
|
|
34
33
|
}, [isEn]);
|
|
35
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
34
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__time-range` }, /* @__PURE__ */ React.createElement(IconFont, {
|
|
36
35
|
className: "time-icon",
|
|
37
36
|
type: "pisell2-clock"
|
|
38
37
|
}), getServiceTime(dataSource, start_date)));
|
|
@@ -17,6 +17,7 @@ import Footer from "./components/AmountFooter/index.js";
|
|
|
17
17
|
import MultiDay from "./components/MultiDay/index.js";
|
|
18
18
|
import Promotion from "./components/Promotion/index.js";
|
|
19
19
|
import Gift from "./components/Gift/index.js";
|
|
20
|
+
import BookingItem from "./components/BookingItem/index.js";
|
|
20
21
|
import React, { useMemo, useRef } from "react";
|
|
21
22
|
import { locales } from "@pisell/utils";
|
|
22
23
|
import classNames from "classnames";
|
|
@@ -44,15 +45,17 @@ const _excluded = [
|
|
|
44
45
|
"onPromotion",
|
|
45
46
|
"onGift",
|
|
46
47
|
"onChangeHolder",
|
|
48
|
+
"itemType",
|
|
47
49
|
"type",
|
|
48
50
|
"rightActions",
|
|
49
51
|
"escapeDom",
|
|
50
|
-
"maxSpecsCount"
|
|
52
|
+
"maxSpecsCount",
|
|
53
|
+
"isShowRelatedProduct"
|
|
51
54
|
];
|
|
52
55
|
const PREFIX = "pisell-cart-sku-card";
|
|
53
56
|
const CartSkuCard = (props) => {
|
|
54
57
|
var _context$appHelper$ut;
|
|
55
|
-
const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, type, rightActions = [], escapeDom, maxSpecsCount = 1 } = props, other = _objectWithoutProperties(props, _excluded);
|
|
58
|
+
const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = _objectWithoutProperties(props, _excluded);
|
|
56
59
|
const useOpenNoteRef = useRef();
|
|
57
60
|
const context = useEngineContext();
|
|
58
61
|
locales.init(locales_default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
@@ -68,13 +71,11 @@ const CartSkuCard = (props) => {
|
|
|
68
71
|
color: "white",
|
|
69
72
|
cursor: "pointer",
|
|
70
73
|
padding: "10px 0px"
|
|
71
|
-
} }, /* @__PURE__ */ React.createElement(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}), /* @__PURE__ */ React.createElement("span", { style: {
|
|
74
|
+
} }, /* @__PURE__ */ React.createElement("span", { style: {
|
|
75
|
+
fontSize: 20,
|
|
76
|
+
marginRight: 4,
|
|
77
|
+
lineHeight: 1
|
|
78
|
+
} }, /* @__PURE__ */ React.createElement(IconFont, { type: "pisell2-trash-01" })), /* @__PURE__ */ React.createElement("span", { style: {
|
|
78
79
|
fontSize: 12,
|
|
79
80
|
fontWeight: 500
|
|
80
81
|
} }, locales.getText("pisell2.cart.sku-card.actions.delete"))),
|
|
@@ -140,7 +141,7 @@ const CartSkuCard = (props) => {
|
|
|
140
141
|
isShowEditProduct,
|
|
141
142
|
disabledEditClick,
|
|
142
143
|
onEditProduct
|
|
143
|
-
}), /* @__PURE__ */ React.createElement(TimeRange, { dataSource }), /* @__PURE__ */ React.createElement(Resources, { dataSource }), /* @__PURE__ */ React.createElement(Packages, {
|
|
144
|
+
}), itemType !== "booking" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TimeRange, { dataSource }), /* @__PURE__ */ React.createElement(Resources, { dataSource })) : null, /* @__PURE__ */ React.createElement(Packages, {
|
|
144
145
|
dataSource,
|
|
145
146
|
isShowImage
|
|
146
147
|
}), /* @__PURE__ */ React.createElement(Sales, {
|
|
@@ -202,6 +203,7 @@ const CartSkuCard = (props) => {
|
|
|
202
203
|
return renderA2();
|
|
203
204
|
};
|
|
204
205
|
if (dataSource === null || dataSource === void 0 ? void 0 : dataSource.isGift) return null;
|
|
206
|
+
const content = renderContent();
|
|
205
207
|
return /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-wrapper-container` }, /* @__PURE__ */ React.createElement(SwipeAction, {
|
|
206
208
|
closeOnAction: false,
|
|
207
209
|
className: classNames(`${PREFIX}-wrapper`),
|
|
@@ -215,7 +217,11 @@ const CartSkuCard = (props) => {
|
|
|
215
217
|
e.stopPropagation();
|
|
216
218
|
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
217
219
|
}
|
|
218
|
-
},
|
|
220
|
+
}, itemType === "booking" ? /* @__PURE__ */ React.createElement(BookingItem, {
|
|
221
|
+
dataSource,
|
|
222
|
+
isShowRelatedProduct,
|
|
223
|
+
isShowDelete
|
|
224
|
+
}, content) : content)), /* @__PURE__ */ React.createElement(Gift, _objectSpread2(_objectSpread2({}, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.giftData) || {}), {}, { onClick: () => onGift === null || onGift === void 0 ? void 0 : onGift(dataSource) })));
|
|
219
225
|
};
|
|
220
226
|
//#endregion
|
|
221
227
|
export { PREFIX, CartSkuCard as default };
|
|
@@ -10,6 +10,8 @@ import Note from "../cartSkuCard/components/Note/index.js";
|
|
|
10
10
|
import Footer from "../cartSkuCard/components/AmountFooter/index.js";
|
|
11
11
|
import Promotion from "../cartSkuCard/components/Promotion/index.js";
|
|
12
12
|
import Gift from "../cartSkuCard/components/Gift/index.js";
|
|
13
|
+
import LineItemTimeRange from "./components/TimeRange/index.js";
|
|
14
|
+
import LineItemResources from "./components/Resources/index.js";
|
|
13
15
|
import React, { useMemo } from "react";
|
|
14
16
|
import { locales } from "@pisell/utils";
|
|
15
17
|
import { Button, Divider, Dropdown } from "antd";
|
|
@@ -99,9 +101,9 @@ const BookingLineItem = (props) => {
|
|
|
99
101
|
}
|
|
100
102
|
};
|
|
101
103
|
const bookingRightActions = isShowDelete ? [deleteAction, ...rightActions] : rightActions;
|
|
102
|
-
const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "");
|
|
105
|
+
formatBookingTime(dataSource, locale);
|
|
106
|
+
getResourceName(dataSource, translationOriginal);
|
|
105
107
|
const renderStatusButton = () => /* @__PURE__ */ React.createElement(Button, {
|
|
106
108
|
className: `${PREFIX}__status`,
|
|
107
109
|
htmlType: "button",
|
|
@@ -147,7 +149,7 @@ const BookingLineItem = (props) => {
|
|
|
147
149
|
e.stopPropagation();
|
|
148
150
|
onDelete === null || onDelete === void 0 || onDelete(dataSource);
|
|
149
151
|
}
|
|
150
|
-
}, /* @__PURE__ */ React.createElement(IconFont, { type: "pisell2-trash-01" })) : null))), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__booking-detail` }, /* @__PURE__ */ React.createElement(
|
|
152
|
+
}, /* @__PURE__ */ React.createElement(IconFont, { type: "pisell2-trash-01" })) : null))), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__booking-detail` }, /* @__PURE__ */ React.createElement(LineItemTimeRange, { dataSource }), /* @__PURE__ */ React.createElement(LineItemResources, { dataSource })), isShowRelatedProduct && relatedProductDataSource ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, { style: { margin: 0 } }), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__related-product-card` }, /* @__PURE__ */ React.createElement(BasicInfo, {
|
|
151
153
|
isShowImage,
|
|
152
154
|
dataSource: relatedProductDataSource,
|
|
153
155
|
type: cartSkuType,
|