@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 顺序一致),不旋转、不缩放,原始尺寸即渲染尺寸;
|
|
@@ -137,4 +159,5 @@ function packCanvasesIntoShelves(boxes, gap, aspectBias = 2.5) {
|
|
|
137
159
|
}
|
|
138
160
|
//#endregion
|
|
139
161
|
exports.computeFloorMapContentStage = computeFloorMapContentStage;
|
|
162
|
+
exports.getOverviewGridDims = getOverviewGridDims;
|
|
140
163
|
exports.packCanvasesIntoShelves = 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 = require_floorMapBuiltinShapes.getFloorMapBuiltinShapeDef(element === null || element === void 0 ? void 0 : element.builtinShapeKey);
|
|
23
28
|
return def ? require_objectSpread2._objectSpread2({}, def.defaultSize) : require_objectSpread2._objectSpread2({}, BUILTIN_SHAPE_FALLBACK_SIZE);
|
|
24
29
|
}
|
|
30
|
+
if (elementKind === "floorMapZone") return require_objectSpread2._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 = require_floorMapElementKindUtils.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
|
}
|
|
@@ -17,6 +17,18 @@ function resolveDataBindingPolicy(kind) {
|
|
|
17
17
|
var _kind$dataBindingPoli;
|
|
18
18
|
return (_kind$dataBindingPoli = kind === null || kind === void 0 ? void 0 : kind.dataBindingPolicy) !== null && _kind$dataBindingPoli !== void 0 ? _kind$dataBindingPoli : "none";
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* 侧栏调色板:点击即可落点,无需数据源 / 数据行等二次选择。
|
|
22
|
+
* 含预约「装饰」下的内置图形(厕所/分隔/柱子等)、底图图片等(`dataBindingPolicy: none`)。
|
|
23
|
+
* 不含舞台;内置图形须带 `builtinShapeKey` 由 {@link isDirectPlacePaletteEntry} 判断。
|
|
24
|
+
*/
|
|
25
|
+
function isDirectPlacePaletteKind(kind) {
|
|
26
|
+
if (!kind) return false;
|
|
27
|
+
if (kind.value === "stage") return false;
|
|
28
|
+
/** 内置图形在调色板按预设展开为多张卡,不单靠 kind 落点 */
|
|
29
|
+
if (kind.value === "floorMapBuiltinShape") return false;
|
|
30
|
+
return resolveDataBindingPolicy(kind) === "none";
|
|
31
|
+
}
|
|
20
32
|
function getElementKindConfig(config, elementKind) {
|
|
21
33
|
var _config$elementKinds;
|
|
22
34
|
if (!elementKind || !(config === null || config === void 0 || (_config$elementKinds = config.elementKinds) === null || _config$elementKinds === void 0 ? void 0 : _config$elementKinds.length)) return void 0;
|
|
@@ -46,8 +58,13 @@ function getSwappableElementKindsInSameCategory(config, elementKind) {
|
|
|
46
58
|
return ((_k$categoryId = k.categoryId) !== null && _k$categoryId !== void 0 ? _k$categoryId : fallbackId) === cid;
|
|
47
59
|
});
|
|
48
60
|
}
|
|
49
|
-
|
|
50
|
-
const
|
|
61
|
+
/** 绑定资源类图元(dataBindingPolicy 为 required/optional)新建默认尺寸 */
|
|
62
|
+
const FLOOR_MAP_RESOURCE_PLACE_DEFAULT = {
|
|
63
|
+
width: 300,
|
|
64
|
+
height: 200
|
|
65
|
+
};
|
|
66
|
+
const DEFAULT_PLACE_W = FLOOR_MAP_RESOURCE_PLACE_DEFAULT.width;
|
|
67
|
+
const DEFAULT_PLACE_H = FLOOR_MAP_RESOURCE_PLACE_DEFAULT.height;
|
|
51
68
|
const IMAGE_PLACE_W = 400;
|
|
52
69
|
const IMAGE_PLACE_H = 240;
|
|
53
70
|
const DECO_SIZE = 48;
|
|
@@ -128,9 +145,11 @@ function getSceneElementRenderIssue(element, kind, dataSources) {
|
|
|
128
145
|
return null;
|
|
129
146
|
}
|
|
130
147
|
//#endregion
|
|
148
|
+
exports.FLOOR_MAP_RESOURCE_PLACE_DEFAULT = FLOOR_MAP_RESOURCE_PLACE_DEFAULT;
|
|
131
149
|
exports.getElementKindConfig = getElementKindConfig;
|
|
132
150
|
exports.getSceneElementRenderIssue = getSceneElementRenderIssue;
|
|
133
151
|
exports.getSwappableElementKindsInSameCategory = getSwappableElementKindsInSameCategory;
|
|
152
|
+
exports.isDirectPlacePaletteKind = isDirectPlacePaletteKind;
|
|
134
153
|
exports.isFloorMapBuiltinShapeElementKind = isFloorMapBuiltinShapeElementKind;
|
|
135
154
|
exports.isFloorMapImageElementKind = isFloorMapImageElementKind;
|
|
136
155
|
exports.patchSceneElementForKindSwitch = patchSceneElementForKindSwitch;
|
|
@@ -2,6 +2,7 @@ const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
|
2
2
|
const require_types = require("../types.js");
|
|
3
3
|
const require_floorMapStageDefaults = require("./floorMapStageDefaults.js");
|
|
4
4
|
const require_floorMapElementKindUtils = require("./floorMapElementKindUtils.js");
|
|
5
|
+
const require_FloorMapZoneElement = require("../components/FloorMapZoneElement.js");
|
|
5
6
|
const require_FloorMapImageElement = require("../components/FloorMapImageElement.js");
|
|
6
7
|
const require_FloorMapBuiltinShapeElement = require("../components/FloorMapBuiltinShapeElement.js");
|
|
7
8
|
let react = require("react");
|
|
@@ -35,22 +36,27 @@ function renderFloorMapFallbackPlaceholder(item) {
|
|
|
35
36
|
const kind = (item === null || item === void 0 ? void 0 : item.elementKind) || "item";
|
|
36
37
|
const isCircle = (item === null || item === void 0 ? void 0 : item.shape) === "circle";
|
|
37
38
|
const isStage = kind === require_types.FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
39
|
+
const isZone = Boolean(item.isZone) || kind === "floorMapZone";
|
|
38
40
|
const nameText = (item === null || item === void 0 ? void 0 : item.name) != null ? String(item.name).trim() : "";
|
|
39
41
|
const fallbackLabel = nameText || kind;
|
|
42
|
+
if (isZone) {
|
|
43
|
+
var _item$name, _item$_sceneElement;
|
|
44
|
+
return /* @__PURE__ */ react.default.createElement(require_FloorMapZoneElement.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 });
|
|
45
|
+
}
|
|
40
46
|
if (require_floorMapElementKindUtils.isFloorMapImageElementKind(kind)) {
|
|
41
|
-
var _item$
|
|
42
|
-
const url = (_item$
|
|
47
|
+
var _item$_sceneElement2, _item$name2, _item$_sceneElement3;
|
|
48
|
+
const url = (_item$_sceneElement2 = item._sceneElement) === null || _item$_sceneElement2 === void 0 ? void 0 : _item$_sceneElement2.imageUrl;
|
|
43
49
|
return /* @__PURE__ */ react.default.createElement(require_FloorMapImageElement.FloorMapImageElement, {
|
|
44
50
|
imageUrl: url,
|
|
45
|
-
name: (_item$
|
|
51
|
+
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
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
if (require_floorMapElementKindUtils.isFloorMapBuiltinShapeElementKind(kind)) {
|
|
49
|
-
var _item$
|
|
55
|
+
var _item$name3;
|
|
50
56
|
const el = item._sceneElement;
|
|
51
57
|
return /* @__PURE__ */ react.default.createElement(require_FloorMapBuiltinShapeElement.FloorMapBuiltinShapeElement, {
|
|
52
58
|
builtinShapeKey: el === null || el === void 0 ? void 0 : el.builtinShapeKey,
|
|
53
|
-
name: (_item$
|
|
59
|
+
name: (_item$name3 = item.name) !== null && _item$name3 !== void 0 ? _item$name3 : el === null || el === void 0 ? void 0 : el.name,
|
|
54
60
|
fillColor: el === null || el === void 0 ? void 0 : el.fillColor,
|
|
55
61
|
strokeColor: el === null || el === void 0 ? void 0 : el.strokeColor
|
|
56
62
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
2
|
const require_mergeCanvasesForTabs = require("./mergeCanvasesForTabs.js");
|
|
3
|
-
const require_floorMapConfigMerge = require("./floorMapConfigMerge.js");
|
|
4
3
|
const require_layoutMeasurements = require("./layoutMeasurements.js");
|
|
4
|
+
const require_floorMapConfigMerge = require("./floorMapConfigMerge.js");
|
|
5
5
|
const require_floorMapCanvasStage = require("./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 = require_floorMapCanvasStage.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 require_objectSpread2._objectSpread2(require_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,64 @@
|
|
|
1
|
+
const require_floorMapDataRecordLabel = require("./floorMapDataRecordLabel.js");
|
|
2
|
+
const require_floorMapResourcePickerTypes = require("./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 require_floorMapResourcePickerTypes.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 = require_floorMapDataRecordLabel.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
|
+
exports.floorMapResourcePickerRecordSearchText = floorMapResourcePickerRecordSearchText;
|
|
63
|
+
exports.getFloorMapCardPickerCategoryConfig = getFloorMapCardPickerCategoryConfig;
|
|
64
|
+
exports.getFloorMapResourcePickerCardMeta = 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
|
+
exports.parseNestedPathSegments = parseNestedPathSegments;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
require("../types.js");
|
|
3
|
+
const require_floorMapBuiltinShapes = require("./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 require_floorMapBuiltinShapes.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(require_objectSpread2._objectSpread2({ elementKind: e.kind.value }, e.builtinShapeKey ? { builtinShapeKey: e.builtinShapeKey } : {}));
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.buildToolbarPaletteEntries = buildToolbarPaletteEntries;
|
|
52
|
+
exports.expandPaletteEntriesByQuantity = expandPaletteEntriesByQuantity;
|
|
53
|
+
exports.getPaletteSidebarVisibleEntries = getPaletteSidebarVisibleEntries;
|
|
54
|
+
exports.shouldShowPaletteViewAll = shouldShowPaletteViewAll;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_index = require("../timeRange/index.js");
|
|
3
|
+
const require_index$1 = require("../resources/index.js");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react);
|
|
6
|
+
let antd = require("antd");
|
|
7
|
+
let classnames = require("classnames");
|
|
8
|
+
classnames = require_runtime.__toESM(classnames);
|
|
9
|
+
require("./index.less");
|
|
10
|
+
//#region src/components/productCard/cartSkuCard/components/BookingItem/index.tsx
|
|
11
|
+
const PREFIX = "pisell-cart-sku-card-booking-item";
|
|
12
|
+
const BookingItem = (props) => {
|
|
13
|
+
const { children, isShowRelatedProduct = true, isShowDelete = false, dataSource } = props;
|
|
14
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: PREFIX }, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}__info`, { [`${PREFIX}__info--with-delete`]: isShowDelete }) }, /* @__PURE__ */ react.default.createElement(require_index.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$1.default, { dataSource })), isShowRelatedProduct && /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__related-product` }, children)));
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.default = BookingItem;
|
|
@@ -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
|
+
}
|
|
@@ -4,7 +4,6 @@ const require_utils = require("../../../utils.js");
|
|
|
4
4
|
const require_index$1 = require("../../index.js");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_runtime.__toESM(react);
|
|
7
|
-
let antd = require("antd");
|
|
8
7
|
let dayjs = require("dayjs");
|
|
9
8
|
dayjs = require_runtime.__toESM(dayjs);
|
|
10
9
|
require("dayjs/locale/zh-cn");
|
|
@@ -35,7 +34,7 @@ const TimeRange = (props) => {
|
|
|
35
34
|
(0, react.useMemo)(() => {
|
|
36
35
|
return isEn ? "HH:mm DD/MM/YYYY" : "YYYY-MM-DD HH:mm";
|
|
37
36
|
}, [isEn]);
|
|
38
|
-
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(
|
|
37
|
+
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__time-range` }, /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
39
38
|
className: "time-icon",
|
|
40
39
|
type: "pisell2-clock"
|
|
41
40
|
}), require_utils.getServiceTime(dataSource, start_date)));
|
|
@@ -18,6 +18,7 @@ const require_index$10 = require("./components/AmountFooter/index.js");
|
|
|
18
18
|
const require_index$11 = require("./components/MultiDay/index.js");
|
|
19
19
|
const require_index$12 = require("./components/Promotion/index.js");
|
|
20
20
|
const require_index$13 = require("./components/Gift/index.js");
|
|
21
|
+
const require_index$14 = require("./components/BookingItem/index.js");
|
|
21
22
|
let react = require("react");
|
|
22
23
|
react = require_runtime.__toESM(react);
|
|
23
24
|
let _pisell_utils = require("@pisell/utils");
|
|
@@ -47,15 +48,17 @@ const _excluded = [
|
|
|
47
48
|
"onPromotion",
|
|
48
49
|
"onGift",
|
|
49
50
|
"onChangeHolder",
|
|
51
|
+
"itemType",
|
|
50
52
|
"type",
|
|
51
53
|
"rightActions",
|
|
52
54
|
"escapeDom",
|
|
53
|
-
"maxSpecsCount"
|
|
55
|
+
"maxSpecsCount",
|
|
56
|
+
"isShowRelatedProduct"
|
|
54
57
|
];
|
|
55
58
|
const PREFIX = "pisell-cart-sku-card";
|
|
56
59
|
const CartSkuCard = (props) => {
|
|
57
60
|
var _context$appHelper$ut;
|
|
58
|
-
const { dataSource = require_status.defaultValue.dataSource, isShowImage = require_status.defaultValue.isShowImage, isShowOriginalPrice = require_status.defaultValue.isShowOriginalPrice, isShowHolder = require_status.defaultValue.isShowHolder, isShowNote = require_status.defaultValue.isShowNote, isShowDelete = require_status.defaultValue.isShowDelete, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, isShowPackageNote = require_status.defaultValue.isShowPackageNote, isShowEditProduct = require_status.defaultValue.isShowEditProduct, disabledClick = require_status.defaultValue.disabledClick, disabledEditClick = require_status.defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, type, rightActions = [], escapeDom, maxSpecsCount = 1 } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
61
|
+
const { dataSource = require_status.defaultValue.dataSource, isShowImage = require_status.defaultValue.isShowImage, isShowOriginalPrice = require_status.defaultValue.isShowOriginalPrice, isShowHolder = require_status.defaultValue.isShowHolder, isShowNote = require_status.defaultValue.isShowNote, isShowDelete = require_status.defaultValue.isShowDelete, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, isShowPackageNote = require_status.defaultValue.isShowPackageNote, isShowEditProduct = require_status.defaultValue.isShowEditProduct, disabledClick = require_status.defaultValue.disabledClick, disabledEditClick = require_status.defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
59
62
|
const useOpenNoteRef = (0, react.useRef)();
|
|
60
63
|
const context = require_useEngineContext.default();
|
|
61
64
|
_pisell_utils.locales.init(require_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");
|
|
@@ -71,13 +74,11 @@ const CartSkuCard = (props) => {
|
|
|
71
74
|
color: "white",
|
|
72
75
|
cursor: "pointer",
|
|
73
76
|
padding: "10px 0px"
|
|
74
|
-
} }, /* @__PURE__ */ react.default.createElement(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}), /* @__PURE__ */ react.default.createElement("span", { style: {
|
|
77
|
+
} }, /* @__PURE__ */ react.default.createElement("span", { style: {
|
|
78
|
+
fontSize: 20,
|
|
79
|
+
marginRight: 4,
|
|
80
|
+
lineHeight: 1
|
|
81
|
+
} }, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })), /* @__PURE__ */ react.default.createElement("span", { style: {
|
|
81
82
|
fontSize: 12,
|
|
82
83
|
fontWeight: 500
|
|
83
84
|
} }, _pisell_utils.locales.getText("pisell2.cart.sku-card.actions.delete"))),
|
|
@@ -143,7 +144,7 @@ const CartSkuCard = (props) => {
|
|
|
143
144
|
isShowEditProduct,
|
|
144
145
|
disabledEditClick,
|
|
145
146
|
onEditProduct
|
|
146
|
-
}), /* @__PURE__ */ react.default.createElement(require_index$4.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$5.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$6.default, {
|
|
147
|
+
}), itemType !== "booking" ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(require_index$4.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$5.default, { dataSource })) : null, /* @__PURE__ */ react.default.createElement(require_index$6.default, {
|
|
147
148
|
dataSource,
|
|
148
149
|
isShowImage
|
|
149
150
|
}), /* @__PURE__ */ react.default.createElement(require_index$7.default, {
|
|
@@ -205,6 +206,7 @@ const CartSkuCard = (props) => {
|
|
|
205
206
|
return renderA2();
|
|
206
207
|
};
|
|
207
208
|
if (dataSource === null || dataSource === void 0 ? void 0 : dataSource.isGift) return null;
|
|
209
|
+
const content = renderContent();
|
|
208
210
|
return /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}-wrapper-container` }, /* @__PURE__ */ react.default.createElement(require_index$8.SwipeAction, {
|
|
209
211
|
closeOnAction: false,
|
|
210
212
|
className: (0, classnames.default)(`${PREFIX}-wrapper`),
|
|
@@ -218,7 +220,11 @@ const CartSkuCard = (props) => {
|
|
|
218
220
|
e.stopPropagation();
|
|
219
221
|
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
220
222
|
}
|
|
221
|
-
},
|
|
223
|
+
}, itemType === "booking" ? /* @__PURE__ */ react.default.createElement(require_index$14.default, {
|
|
224
|
+
dataSource,
|
|
225
|
+
isShowRelatedProduct,
|
|
226
|
+
isShowDelete
|
|
227
|
+
}, content) : content)), /* @__PURE__ */ react.default.createElement(require_index$13.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.giftData) || {}), {}, { onClick: () => onGift === null || onGift === void 0 ? void 0 : onGift(dataSource) })));
|
|
222
228
|
};
|
|
223
229
|
//#endregion
|
|
224
230
|
exports.PREFIX = PREFIX;
|
|
@@ -11,6 +11,8 @@ const require_index$5 = require("../cartSkuCard/components/Note/index.js");
|
|
|
11
11
|
const require_index$6 = require("../cartSkuCard/components/AmountFooter/index.js");
|
|
12
12
|
const require_index$7 = require("../cartSkuCard/components/Promotion/index.js");
|
|
13
13
|
const require_index$8 = require("../cartSkuCard/components/Gift/index.js");
|
|
14
|
+
const require_index$9 = require("./components/TimeRange/index.js");
|
|
15
|
+
const require_index$10 = require("./components/Resources/index.js");
|
|
14
16
|
let react = require("react");
|
|
15
17
|
react = require_runtime.__toESM(react);
|
|
16
18
|
let _pisell_utils = require("@pisell/utils");
|
|
@@ -103,9 +105,9 @@ const BookingLineItem = (props) => {
|
|
|
103
105
|
}
|
|
104
106
|
};
|
|
105
107
|
const bookingRightActions = isShowDelete ? [deleteAction, ...rightActions] : rightActions;
|
|
106
|
-
const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "");
|
|
109
|
+
formatBookingTime(dataSource, locale);
|
|
110
|
+
getResourceName(dataSource, translationOriginal);
|
|
109
111
|
const renderStatusButton = () => /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
110
112
|
className: `${PREFIX}__status`,
|
|
111
113
|
htmlType: "button",
|
|
@@ -151,7 +153,7 @@ const BookingLineItem = (props) => {
|
|
|
151
153
|
e.stopPropagation();
|
|
152
154
|
onDelete === null || onDelete === void 0 || onDelete(dataSource);
|
|
153
155
|
}
|
|
154
|
-
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null))), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__booking-detail` }, /* @__PURE__ */ react.default.createElement(
|
|
156
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null))), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__booking-detail` }, /* @__PURE__ */ react.default.createElement(require_index$9.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$10.default, { dataSource })), isShowRelatedProduct && relatedProductDataSource ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__related-product-card` }, /* @__PURE__ */ react.default.createElement(require_index$2.default, {
|
|
155
157
|
isShowImage,
|
|
156
158
|
dataSource: relatedProductDataSource,
|
|
157
159
|
type: cartSkuType,
|