@pisell/materials 6.11.241 → 6.11.242
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 +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +24 -24
- package/es/components/PisellCards/index.d.ts +1 -0
- package/es/components/PisellFields/index.d.ts +1 -0
- package/es/components/PisellGroupView/PisellGroupView.d.ts +9 -0
- package/es/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
- package/es/components/PisellGroupView/index.d.ts +6 -0
- package/es/components/PisellGroupView/types.d.ts +124 -0
- package/es/components/PisellGroupView/utils/index.d.ts +20 -0
- package/es/components/PisellLayouts/index.d.ts +1 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/PisellTabbar/PisellTabbar.js +3 -4
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +5 -4
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
- package/es/components/pisellFloorMapLayout/index.d.ts +39 -0
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
- package/es/components/pisellFloorMapLayout/types.d.ts +769 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
- package/es/components/pisellModal/components/index.d.ts +1 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/es/components/pisellRecordBoard/types.d.ts +899 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -3
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +4 -5
- package/es/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
- package/es/components/productCard/cartSkuCard/components/inlineActions/index.js +3 -1
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.js +12 -14
- package/es/components/productCard/cartSkuCard/index.d.ts +15 -0
- package/es/components/productCard/cartSkuCard/index.less +8 -1
- package/es/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
- package/es/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
- package/es/components/productCard/lineItem/index.d.ts +72 -0
- package/es/components/table/Table/fields/date/index.d.ts +1 -0
- package/es/components/table/Table/fields/index.d.ts +3 -2
- package/es/components/table/Table/fields/link/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.d.ts +21 -0
- package/es/components/virtual-keyboard/Time/index.d.ts +14 -0
- package/es/components/virtual-keyboard/index.d.ts +25 -0
- package/es/hooks/useTranslationOriginal.d.ts +4 -0
- package/es/pisell-materials.tw.css +1 -1
- package/lib/components/PisellCards/index.d.ts +1 -0
- package/lib/components/PisellFields/index.d.ts +1 -0
- package/lib/components/PisellGroupView/PisellGroupView.d.ts +9 -0
- package/lib/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
- package/lib/components/PisellGroupView/index.d.ts +6 -0
- package/lib/components/PisellGroupView/types.d.ts +124 -0
- package/lib/components/PisellGroupView/utils/index.d.ts +20 -0
- package/lib/components/PisellLayouts/index.d.ts +1 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/PisellTabbar/PisellTabbar.js +2 -2
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +5 -4
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
- package/lib/components/pisellFloorMapLayout/index.d.ts +39 -0
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
- package/lib/components/pisellFloorMapLayout/types.d.ts +769 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
- package/lib/components/pisellModal/components/index.d.ts +1 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/lib/components/pisellRecordBoard/types.d.ts +899 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +1 -2
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +3 -6
- package/lib/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
- package/lib/components/productCard/cartSkuCard/components/inlineActions/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.js +11 -14
- package/lib/components/productCard/cartSkuCard/index.d.ts +15 -0
- package/lib/components/productCard/cartSkuCard/index.less +8 -1
- package/lib/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
- package/lib/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
- package/lib/components/productCard/lineItem/index.d.ts +72 -0
- package/lib/components/table/Table/fields/date/index.d.ts +1 -0
- package/lib/components/table/Table/fields/index.d.ts +3 -2
- package/lib/components/table/Table/fields/link/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
- package/lib/components/virtual-keyboard/Time/index.d.ts +14 -0
- package/lib/components/virtual-keyboard/index.d.ts +25 -0
- package/lib/hooks/useTranslationOriginal.d.ts +4 -0
- package/lib/pisell-materials.tw.css +1 -1
- package/package.json +1 -1
- package/es/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/es/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/es/components/pisellLookup/types.d.ts +0 -797
- package/es/components/pisellTimeRangeDisplay/index.d.ts +0 -3
- package/lib/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/lib/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/lib/components/pisellLookup/types.d.ts +0 -797
- package/lib/components/pisellTimeRangeDisplay/index.d.ts +0 -3
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FloorMapToolbar - 编辑态左侧侧边栏:按分类添加图元、绑定数据源与行;保存可选(默认用顶栏)
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { FloorMapViewConfig, FloorMapDataSources, FloorMapMergedItem, FloorMapSceneElement, FloorMapPlaceMode } from '../types';
|
|
6
|
+
import { type FloorMapPaletteDragPayload } from '../utils/floorMapDropUtils';
|
|
7
|
+
import { type FloorMapPaletteBulkPlaceItem, type FloorMapToolbarPaletteEntry } from '../utils/floorMapToolbarPalette';
|
|
8
|
+
import type { FloorMapResourcePickerSlotProps } from '../utils/floorMapResourcePickerTypes';
|
|
9
|
+
import './FloorMapToolbar.less';
|
|
10
|
+
export type { FloorMapPlaceMode as PlaceMode };
|
|
11
|
+
export interface FloorMapToolbarProps {
|
|
12
|
+
config: FloorMapViewConfig;
|
|
13
|
+
dataSources: FloorMapDataSources;
|
|
14
|
+
dataSourceLabels?: Record<string, string>;
|
|
15
|
+
canCreate: boolean;
|
|
16
|
+
placeMode: FloorMapPlaceMode;
|
|
17
|
+
onPlaceModeChange: (mode: FloorMapPlaceMode) => void;
|
|
18
|
+
renderPreviewItem?: (item: FloorMapMergedItem) => React.ReactNode;
|
|
19
|
+
placementPreviewSize?: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
decorationPreviewSize?: number;
|
|
24
|
+
sceneElements?: FloorMapSceneElement[];
|
|
25
|
+
onSave?: () => void;
|
|
26
|
+
saving?: boolean;
|
|
27
|
+
saveError?: Error | string;
|
|
28
|
+
/** 布局草稿已相对持久化配置变更,提示用户点击本栏「保存」 */
|
|
29
|
+
layoutDirty?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
/** 触摸/笔:Pointer 拖拽落点(mouse 仍用 HTML5 DnD) */
|
|
32
|
+
onPaletteCardPointerDown?: (payload: FloorMapPaletteDragPayload, e: React.PointerEvent<HTMLButtonElement>) => void;
|
|
33
|
+
/** 触摸拖放结束后吞掉按钮 click,避免误触切换落点模式 */
|
|
34
|
+
consumeToolbarClickIfTouchDrag?: () => boolean;
|
|
35
|
+
/** 手机布局:侧栏悬浮覆盖画布(由 PisellFloorMapLayout + Less 控制定位) */
|
|
36
|
+
phoneLayout?: boolean;
|
|
37
|
+
/** 为 true 时初始为收起(预约手机编辑态默认收起图元栏) */
|
|
38
|
+
defaultCollapsed?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 手机布局:选中图元种类后,一键在当前视口中心落点(与画布点击落点规则一致)。
|
|
41
|
+
*/
|
|
42
|
+
onRequestPlaceAtCanvasCenter?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* 每个调色板分类在侧栏直接展示的图元数量;超出则显示「查看全部」(默认见
|
|
45
|
+
* floorMapLayoutConstants.FLOOR_MAP_TOOLBAR_PALETTE_SIDEBAR_LIMIT,默认 5)。
|
|
46
|
+
*/
|
|
47
|
+
paletteSidebarVisibleLimit?: number;
|
|
48
|
+
/** 「查看全部」弹窗确认:批量落在画布右侧空白区(所有分类通用)。 */
|
|
49
|
+
onBulkAddPaletteToCanvas?: (items: FloorMapPaletteBulkPlaceItem[]) => void;
|
|
50
|
+
/**
|
|
51
|
+
* 「查看全部」弹窗渲染槽位:用于业务侧复用统一的选择弹窗(如 Selector + 数量选择)。
|
|
52
|
+
* 未传时使用内置 `FloorMapToolbarViewAllModal`(加减步进器)。
|
|
53
|
+
*/
|
|
54
|
+
renderPaletteViewAllModal?: (props: {
|
|
55
|
+
open: boolean;
|
|
56
|
+
categoryLabel: string;
|
|
57
|
+
entries: FloorMapToolbarPaletteEntry[];
|
|
58
|
+
onClose: () => void;
|
|
59
|
+
onConfirm: (items: FloorMapPaletteBulkPlaceItem[]) => void;
|
|
60
|
+
renderEntryPreview: (entry: FloorMapToolbarPaletteEntry) => React.ReactNode;
|
|
61
|
+
/** 容器平台:手机布局透传 `'h5'`,默认 `'pc'` */
|
|
62
|
+
platform?: 'pc' | 'h5' | 'ipad';
|
|
63
|
+
}) => React.ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* 资源选择弹窗点「确定」:按已选 recordIds 落画布(多选走批量网格,单选落视口中心附近)。
|
|
66
|
+
* @returns 是否已成功写入草稿
|
|
67
|
+
*/
|
|
68
|
+
onResourcePickerConfirmPlace?: (scene: Extract<FloorMapPlaceMode, {
|
|
69
|
+
type: 'scene';
|
|
70
|
+
}>) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 资源选择 Modal 渲染(必传)。
|
|
73
|
+
* 通用基础 modal 已下线,业务侧需注入实现(如 `PisellProResourcePickerModal`);
|
|
74
|
+
* 未注入时仅打 warn,不渲染选择弹窗,资源选择交互不可用。
|
|
75
|
+
*/
|
|
76
|
+
renderResourcePickerModal?: (props: FloorMapResourcePickerSlotProps) => React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* 无二次选择的调色板项(装饰内置图形、底图图片、`dataBindingPolicy: none` 等):
|
|
79
|
+
* 侧栏点击即落在画布右侧空白区,不进入「再点画布」落点模式。
|
|
80
|
+
*/
|
|
81
|
+
onDirectPlacePaletteItem?: (item: FloorMapPaletteBulkPlaceItem) => void;
|
|
82
|
+
}
|
|
83
|
+
export declare function FloorMapToolbar(props: FloorMapToolbarProps): React.JSX.Element;
|
|
84
|
+
export default FloorMapToolbar;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 侧栏 palette「查看全部」:任意分类下图元超过展示上限时,弹窗内按数量多选并一键落点。
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { type FloorMapPaletteBulkPlaceItem, type FloorMapToolbarPaletteEntry } from '../utils/floorMapToolbarPalette';
|
|
6
|
+
export interface FloorMapToolbarViewAllModalProps {
|
|
7
|
+
open: boolean;
|
|
8
|
+
categoryLabel: string;
|
|
9
|
+
entries: FloorMapToolbarPaletteEntry[];
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onConfirm: (items: FloorMapPaletteBulkPlaceItem[]) => void;
|
|
12
|
+
renderEntryPreview: (entry: FloorMapToolbarPaletteEntry) => React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 容器平台:透传到 `PisellContainer` 的 `props.platform`。
|
|
15
|
+
* 手机布局应传 `'h5'`,否则默认 `'pc'`。
|
|
16
|
+
*/
|
|
17
|
+
platform?: 'pc' | 'h5' | 'ipad';
|
|
18
|
+
}
|
|
19
|
+
export declare function FloorMapToolbarViewAllModal(props: FloorMapToolbarViewAllModalProps): React.JSX.Element;
|
|
20
|
+
export default FloorMapToolbarViewAllModal;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { MouseEvent, MutableRefObject } from 'react';
|
|
2
|
+
import { type PlacementBoundingBox } from '../utils/batchScenePlacementLayout';
|
|
3
|
+
import type { DataSourceFormColumn, FloorMapCanvasNameI18n, FloorMapDataSourceRecordFormContent, FloorMapDataSources, FloorMapItemBase, FloorMapMergedItem, FloorMapPlaceMode, FloorMapSceneElement, FloorMapViewConfig } from '../types';
|
|
4
|
+
export interface UseFloorMapEditStateParams<T extends FloorMapItemBase> {
|
|
5
|
+
floorMapConfigProp: FloorMapViewConfig | undefined;
|
|
6
|
+
isFloorMapView: boolean;
|
|
7
|
+
itemsProp: T[];
|
|
8
|
+
cellSizeProp?: number;
|
|
9
|
+
dataSources: FloorMapDataSources | undefined;
|
|
10
|
+
onSave: ((config: FloorMapViewConfig) => void) | undefined;
|
|
11
|
+
onDataSourceRecordSave: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
|
|
12
|
+
dataSourceFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
|
|
13
|
+
dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
|
|
14
|
+
dataSourceLabels?: Record<string, string>;
|
|
15
|
+
layoutPrefix: string;
|
|
16
|
+
contentOffsetRef: MutableRefObject<{
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}>;
|
|
20
|
+
showDataSourceRecordFormBlock?: boolean;
|
|
21
|
+
/** 批量落点后由布局层注入:将视口移至新增图元区域 */
|
|
22
|
+
focusViewportOnBoundsRef?: MutableRefObject<((bounds: PlacementBoundingBox) => void) | null>;
|
|
23
|
+
/**
|
|
24
|
+
* 网格显隐缓存命名空间(通常与视口 `viewportPersistNamespace` 同源,拼自业务/门店/平面图)。
|
|
25
|
+
* 传入后网格 localStorage key 变为 `prefix:namespace:canvasId`,隔离不同门店/场景;
|
|
26
|
+
* 不传则沿用 `prefix:canvasId`(向后兼容,跨场景可能共享)。
|
|
27
|
+
*/
|
|
28
|
+
gridPersistNamespace?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function useFloorMapEditState<T extends FloorMapItemBase>(params: UseFloorMapEditStateParams<T>): {
|
|
31
|
+
config: FloorMapViewConfig | null;
|
|
32
|
+
currentCanvasId: string | null;
|
|
33
|
+
setCurrentCanvasId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
34
|
+
selectedId: string | null;
|
|
35
|
+
setSelectedId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
36
|
+
placeMode: FloorMapPlaceMode;
|
|
37
|
+
setPlaceMode: import("react").Dispatch<import("react").SetStateAction<FloorMapPlaceMode>>;
|
|
38
|
+
mergedItems: FloorMapMergedItem[];
|
|
39
|
+
items: T[];
|
|
40
|
+
saving: boolean;
|
|
41
|
+
savingRecord: boolean;
|
|
42
|
+
handleAddCanvas: () => void;
|
|
43
|
+
handleRemoveCanvas: (canvasId: string) => void;
|
|
44
|
+
handleRenameCanvas: (canvasId: string, name: string | FloorMapCanvasNameI18n) => void;
|
|
45
|
+
handleUpdateItem: (itemId: string, patch: Partial<{
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}>) => void;
|
|
51
|
+
handleUpdateItemsBatch: (patches: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
patch: Partial<{
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
}>;
|
|
59
|
+
}>) => void;
|
|
60
|
+
handleCanvasPlaceClick: (e: MouseEvent<HTMLDivElement>) => void;
|
|
61
|
+
handleSave: () => void;
|
|
62
|
+
discardDraft: () => void;
|
|
63
|
+
placeSceneElementFromPaletteDrop: (contentX: number, contentY: number, scene: Extract<FloorMapPlaceMode, {
|
|
64
|
+
type: 'scene';
|
|
65
|
+
}>) => boolean;
|
|
66
|
+
bulkPlacePaletteItems: (items: Array<{
|
|
67
|
+
elementKind: string;
|
|
68
|
+
builtinShapeKey?: string;
|
|
69
|
+
}>) => void;
|
|
70
|
+
editPanelParams: {
|
|
71
|
+
itemId: string;
|
|
72
|
+
sceneElement: FloorMapSceneElement;
|
|
73
|
+
onUpdate: (patch: Partial<FloorMapSceneElement>) => void;
|
|
74
|
+
onSaveRecord: ((dataSourceKey: string, id: string, newData: Record<string, unknown>) => void) | undefined;
|
|
75
|
+
onClose: () => void;
|
|
76
|
+
onDelete: (() => void) | undefined;
|
|
77
|
+
recordFormColumns: Record<string, DataSourceFormColumn[]> | undefined;
|
|
78
|
+
dataSourceRecordForm: Record<string, FloorMapDataSourceRecordFormContent> | undefined;
|
|
79
|
+
dataSourceLabels: Record<string, string> | undefined;
|
|
80
|
+
layoutDraftDirty: boolean;
|
|
81
|
+
showDataSourceRecordFormBlock: boolean | undefined;
|
|
82
|
+
} | null;
|
|
83
|
+
placeOverlayClass: string;
|
|
84
|
+
isLayoutDirty: boolean;
|
|
85
|
+
toggleDraftCanvasShowGrid: () => void;
|
|
86
|
+
toggleSelectedLayoutLock: () => void;
|
|
87
|
+
duplicateSelectedElement: () => void;
|
|
88
|
+
deleteSelectedElement: () => void;
|
|
89
|
+
undoDraft: () => void;
|
|
90
|
+
redoDraft: () => void;
|
|
91
|
+
canUndo: boolean;
|
|
92
|
+
canRedo: boolean;
|
|
93
|
+
commitDraft: (next: FloorMapViewConfig | ((prev: FloorMapViewConfig | null) => FloorMapViewConfig | null) | null, options?: import("./useDraftConfigHistory").DraftHistoryCommitOptions | undefined) => void;
|
|
94
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellFloorMapLayout 组件入口
|
|
3
|
+
* 空间布局视图:在二维平面按坐标渲染资源,支持缩放/平移/复位;支持 floorMapConfig + mode 平面图视图
|
|
4
|
+
*/
|
|
5
|
+
export { PisellFloorMapLayout } from './PisellFloorMapLayout';
|
|
6
|
+
export type { PisellFloorMapLayoutProps, PisellFloorMapLayoutRef, FloorMapItemBase, FloorMapItemUnit, FloorMapLayerConfig, FloorMapZoomConfig, FloorMapPanConfig, FloorMapControlsConfig, FloorMapItemShape, FloorMapBackgroundType, FloorMapPanBoundary, FloorMapLayoutMode, FloorMapGridLayoutConfig, FloorMapCanvas, FloorMapCanvasNameI18n, FloorMapElement, FloorMapData, FloorMapViewConfig, FloorMapCanvasUiConfig, FloorMapSceneElement, FloorMapSceneElementDataBinding, FloorMapPlaceMode, FloorMapElementKindCategory, FloorMapElementDataBindingPolicy, FloorMapElementDefaultPresentation, FloorMapEdge, FloorMapEdgeAnchor, FloorMapEdgeStatus, FloorMapElementKindConfig, FloorMapElementType, FloorMapTextSlot, FloorMapDataSources, FloorMapRenderOptions, FloorMapEditPanelParams, DataSourceFormColumn, FloorMapMergedItem, FloorMapRecordFormRenderContext, FloorMapDataSourceRecordFormContent, FloorMapFullscreenMode, FloorMapLayoutContextValue, FloorMapViewportOverlayRenderArgs, } from './types';
|
|
7
|
+
export { FLOOR_MAP_STAGE_ELEMENT_KIND, FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND, FLOOR_MAP_IMAGE_ELEMENT_KIND, FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND, } from './types';
|
|
8
|
+
export { renderFloorMapFallbackPlaceholder } from './utils/floorMapFallbackRender';
|
|
9
|
+
export { isFloorMapImageElementKind, isFloorMapBuiltinShapeElementKind, } from './utils/floorMapElementKindUtils';
|
|
10
|
+
export { FLOOR_MAP_BUILTIN_SHAPES, getFloorMapBuiltinShapeDef, } from './utils/floorMapBuiltinShapes';
|
|
11
|
+
export type { FloorMapBuiltinShapeDef, FloorMapBuiltinShapeRenderProps, } from './utils/floorMapBuiltinShapes';
|
|
12
|
+
export { NAME_AS_TITLE_EXT_KEY, isElementNameAsTitleEnabled, buildNameAsTitleExtensionsPatch, resolveSceneElementDisplayTitle, } from './utils/floorMapElementNameAsTitle';
|
|
13
|
+
export { findFloorMapRowByDataBinding, getFloorMapBindingPlaceholderReason, } from './utils/floorMapDataBindingUtils';
|
|
14
|
+
export type { FloorMapDataSourceRow, FloorMapBindingPlaceholderReason, } from './utils/floorMapDataBindingUtils';
|
|
15
|
+
export { createShopFloorPlanClient, SHOP_FLOOR_PLAN_DUPLICATE_CODE, } from './shopFloorPlan/shopFloorPlanClient';
|
|
16
|
+
export type { ShopFloorPlanDetail, ShopFloorPlanLayoutItem, PostShopFloorPlanBody, PutShopFloorPlanBody, ShopFloorPlanByCodeRequestOptions, ShopFloorPlanHttpAdapter, CreateShopFloorPlanClientOptions, EnsureShopFloorPlanByCodeOptions, } from './shopFloorPlan/shopFloorPlanTypes';
|
|
17
|
+
export type { UseShopFloorPlanSubscriptionParams } from './hooks/useShopFloorPlanSubscription';
|
|
18
|
+
export { pickFloorPlanDetail, parseLayoutFieldToViewConfigPatch, mergeFloorPlanViewRemote, floorMapSavedConfigToRemotePatch, viewConfigToLayoutPayload, inferCanvasSizeFromScene, buildFloorPlanPutBody, isShopFloorPlanNotFoundResponse, isHttpNotFoundError, isFloorPlanDuplicateCodeError, } from './shopFloorPlan/shopFloorPlanPure';
|
|
19
|
+
export { sceneElementsToShopLayout, shopLayoutToSceneElements, } from './shopFloorPlan/shopFloorPlanMapping';
|
|
20
|
+
export { useShopFloorPlanSubscription } from './hooks/useShopFloorPlanSubscription';
|
|
21
|
+
export { wrapFloorMapOnSaveWithRemotePersist, } from './utils/floorMapRemotePersist';
|
|
22
|
+
export type { WrapFloorMapOnSaveWithRemotePersistParams } from './utils/floorMapRemotePersist';
|
|
23
|
+
export { FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, } from './context/FloorMapLayoutContext';
|
|
24
|
+
export type { FloorMapLayoutProviderProps } from './context/FloorMapLayoutContext';
|
|
25
|
+
export { mergeFloorMapLayoutPropsFromContext } from './context/mergeFloorMapLayoutContext';
|
|
26
|
+
export type { FloorMapResourcePickerSlotProps, PisellCardPickerItem, PisellCardPickerMode, PisellCardPickerCategoryConfig, PisellCardPickerCategoryLevelConfig, PisellCardPickerCategoryPath, PisellCardPickerCategoryMode, PisellCardPickerCardMeta, } from './utils/floorMapResourcePickerTypes';
|
|
27
|
+
export { parseNestedPathSegments } from './utils/floorMapResourcePickerTypes';
|
|
28
|
+
export type { FloorMapResourcePickerRecord } from './utils/floorMapResourcePickerDisplay';
|
|
29
|
+
export { getFloorMapResourcePickerCardMeta, getFloorMapCardPickerCategoryConfig, getFloorMapResourcePickerCategoryPath, floorMapResourcePickerRecordSearchText, } from './utils/floorMapResourcePickerDisplay';
|
|
30
|
+
export { getFloorMapDisplayLocale, initFloorMapLayoutLocales, } from './utils/floorMapCanvasDisplay';
|
|
31
|
+
/** 平面图内置文案表,供跨包组件在本包 `locales` 单例上自行 init */
|
|
32
|
+
export { default as floorMapLayoutLocales } from './locales';
|
|
33
|
+
export { FloorMapImageElement } from './components/FloorMapImageElement';
|
|
34
|
+
export { FloorMapBuiltinShapeElement } from './components/FloorMapBuiltinShapeElement';
|
|
35
|
+
export { FloorMapSelectionZoneElement } from './components/FloorMapSelectionZoneElement';
|
|
36
|
+
export { isSelectionZoneItem, rectFullyContains, computeSelectionZoneMemberIds, } from './utils/floorMapSelectionZone';
|
|
37
|
+
export type { SelectionZoneRect } from './utils/floorMapSelectionZone';
|
|
38
|
+
export { getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable, } from './components/FigmaTableCard';
|
|
39
|
+
export type { FigmaTableCardItem, FigmaTableStatus, } from './components/FigmaTableCard';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CreateShopFloorPlanClientOptions, EnsureShopFloorPlanByCodeOptions, PostShopFloorPlanBody, PutShopFloorPlanBody, ShopFloorPlanByCodeRequestOptions, ShopFloorPlanDetail } from './shopFloorPlanTypes';
|
|
2
|
+
export { SHOP_FLOOR_PLAN_DUPLICATE_CODE } from './shopFloorPlanTypes';
|
|
3
|
+
export declare function createShopFloorPlanClient(options: CreateShopFloorPlanClientOptions): {
|
|
4
|
+
unsubscribeShopFloorPlanCodeQuery(subscriberId: string): Promise<void>;
|
|
5
|
+
getShopFloorPlanByCode(code: string, subscribe?: ShopFloorPlanByCodeRequestOptions): Promise<ShopFloorPlanDetail | null>;
|
|
6
|
+
postShopFloorPlan: (body: PostShopFloorPlanBody) => Promise<ShopFloorPlanDetail | null>;
|
|
7
|
+
putShopFloorPlan(id: number, body: PutShopFloorPlanBody): Promise<unknown>;
|
|
8
|
+
ensureShopFloorPlanByCode: (code: string, subscribe?: EnsureShopFloorPlanByCodeOptions) => Promise<ShopFloorPlanDetail | null>;
|
|
9
|
+
};
|
|
10
|
+
export declare type ShopFloorPlanClient = ReturnType<typeof createShopFloorPlanClient>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FloorMapSceneElement, FloorMapViewConfig } from '../types';
|
|
2
|
+
import type { PutShopFloorPlanBody, ShopFloorPlanDetail } from './shopFloorPlanTypes';
|
|
3
|
+
export declare function pickFloorPlanDetail(res: unknown): ShopFloorPlanDetail | null;
|
|
4
|
+
export declare function isShopFloorPlanNotFoundResponse(res: unknown): boolean;
|
|
5
|
+
export declare function isHttpNotFoundError(err: unknown): boolean;
|
|
6
|
+
export declare function isFloorPlanDuplicateCodeError(err: unknown): boolean;
|
|
7
|
+
export declare function parseLayoutFieldToViewConfigPatch(raw: unknown): Partial<FloorMapViewConfig> | null;
|
|
8
|
+
export declare function floorMapSavedConfigToRemotePatch(config: FloorMapViewConfig): Partial<FloorMapViewConfig>;
|
|
9
|
+
export declare function mergeFloorPlanViewRemote(base: FloorMapViewConfig, remote: Partial<FloorMapViewConfig>): FloorMapViewConfig;
|
|
10
|
+
export declare function viewConfigToLayoutPayload(config: FloorMapViewConfig): Record<string, unknown>;
|
|
11
|
+
export declare function inferCanvasSizeFromScene(sceneElements: FloorMapSceneElement[], fallbackWidth?: number, fallbackHeight?: number, padding?: number): {
|
|
12
|
+
w: number;
|
|
13
|
+
h: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function buildFloorPlanPutBody(config: FloorMapViewConfig, options: {
|
|
16
|
+
canvasWidth?: number;
|
|
17
|
+
canvasHeight?: number;
|
|
18
|
+
code?: string;
|
|
19
|
+
name?: Record<string, string>;
|
|
20
|
+
sort?: number;
|
|
21
|
+
status?: number;
|
|
22
|
+
}): PutShopFloorPlanBody;
|