@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
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* <PisellFields.Number value={123} viewMode="readonly" />
|
|
10
10
|
* <PisellFields.Currency value={1000} currencySymbol="$" />
|
|
11
11
|
*/
|
|
12
|
+
/// <reference types="react" />
|
|
12
13
|
declare const PisellFields: {
|
|
13
14
|
SingleLineText: import("react").NamedExoticComponent<import("../pisellSingleLineText").PisellSingleLineTextProps>;
|
|
14
15
|
LongText: import("react").NamedExoticComponent<import("../pisellLongText").PisellLongTextProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PisellGroupViewProps } from './types';
|
|
3
|
+
import './PisellGroupView.less';
|
|
4
|
+
/**
|
|
5
|
+
* 使用 memo 优化性能:props 未变化时跳过重渲染
|
|
6
|
+
*/
|
|
7
|
+
declare const MemoizedPisellGroupView: <T>(props: PisellGroupViewProps<T>) => React.JSX.Element;
|
|
8
|
+
export { MemoizedPisellGroupView as PisellGroupView };
|
|
9
|
+
export default MemoizedPisellGroupView;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import PisellGroupView from './PisellGroupView';
|
|
3
|
+
/**
|
|
4
|
+
* PisellGroupView 分组展示组件
|
|
5
|
+
*
|
|
6
|
+
* 通用、数据无关的「分组展示容器」:先按条件把列表分组,
|
|
7
|
+
* 再为每个分组渲染 头部 / 统计 / 主体 / 操作 四块,各块均可自定义渲染。
|
|
8
|
+
*/
|
|
9
|
+
declare const meta: Meta<typeof PisellGroupView>;
|
|
10
|
+
export default meta;
|
|
11
|
+
declare type Story = StoryObj<typeof PisellGroupView>;
|
|
12
|
+
/**
|
|
13
|
+
* 基础用法:按「商品 + 时间」组合分组,展示四块结构
|
|
14
|
+
*/
|
|
15
|
+
export declare const Basic: Story;
|
|
16
|
+
/**
|
|
17
|
+
* 单字段分组 + 主体多列布局(itemLayout 对象,内部使用 PisellBasicGrid)
|
|
18
|
+
*/
|
|
19
|
+
export declare const GridBody: Story;
|
|
20
|
+
/**
|
|
21
|
+
* 利用 ItemContext.groupKeys 在主体卡片中省略「头部已展示」的字段
|
|
22
|
+
*/
|
|
23
|
+
export declare const OmitHeaderFields: Story;
|
|
24
|
+
/**
|
|
25
|
+
* 空数据态
|
|
26
|
+
*/
|
|
27
|
+
export declare const Empty: Story;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { GroupKey, GroupResult } from '@pisell/utils';
|
|
3
|
+
/**
|
|
4
|
+
* 单个分组的数据模型
|
|
5
|
+
* @template T - 数据项类型
|
|
6
|
+
* @description 复用 `@pisell/utils` 的 `GroupResult`,包含 groupId、keys、keyMap、items 等
|
|
7
|
+
*/
|
|
8
|
+
export declare type GroupModel<T> = GroupResult<T>;
|
|
9
|
+
/**
|
|
10
|
+
* 主体(第三块)渲染单条数据时的上下文
|
|
11
|
+
* @template T - 数据项类型
|
|
12
|
+
*/
|
|
13
|
+
export interface ItemContext<T> {
|
|
14
|
+
/** 当前数据所属分组 */
|
|
15
|
+
group: GroupModel<T>;
|
|
16
|
+
/** 当前数据在分组内的下标 */
|
|
17
|
+
index: number;
|
|
18
|
+
/**
|
|
19
|
+
* 参与分组的字段名列表
|
|
20
|
+
* @description
|
|
21
|
+
* 调用方可据此在卡片中省略「头部已展示」的字段,避免重复展示。
|
|
22
|
+
* 当使用自定义函数分组时,该数组为空。
|
|
23
|
+
*/
|
|
24
|
+
groupKeys: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 主体(第三块)的布局配置
|
|
28
|
+
* @description
|
|
29
|
+
* - `'stack'`:纵向堆叠每条卡片(默认)
|
|
30
|
+
* - 对象:透传给内部 `PisellBasicGrid` 实现多列/横向布局
|
|
31
|
+
*/
|
|
32
|
+
export declare type ItemLayout = 'stack' | {
|
|
33
|
+
/** 一行显示的卡片数 */
|
|
34
|
+
columns?: number;
|
|
35
|
+
/** 卡片间距 */
|
|
36
|
+
gap?: number | string;
|
|
37
|
+
/** 排列方向 */
|
|
38
|
+
direction?: 'horizontal' | 'vertical';
|
|
39
|
+
/** 是否换行 */
|
|
40
|
+
wrap?: 'wrap' | 'nowrap';
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 一个分组渲染出的四块内容
|
|
44
|
+
* @description 透传给 `renderGroup`,便于调用方自定义整组容器但复用四块默认内容
|
|
45
|
+
*/
|
|
46
|
+
export interface GroupBlocks {
|
|
47
|
+
/** ① 头部:分组条件对应的相同信息 */
|
|
48
|
+
header: ReactNode;
|
|
49
|
+
/** ② 统计栏:来自分组数据的统计信息 */
|
|
50
|
+
stats: ReactNode;
|
|
51
|
+
/** ③ 主体:分组内所有条目(卡片) */
|
|
52
|
+
body: ReactNode;
|
|
53
|
+
/** ④ 操作区:批量操作 */
|
|
54
|
+
actions: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 多端 variant
|
|
58
|
+
* @description 仅用于在根节点追加 `--${variant}` class,由 Less 控制展示差异
|
|
59
|
+
*/
|
|
60
|
+
export declare type GroupViewVariant = 'desktop' | 'tablet' | 'pos' | 'phone';
|
|
61
|
+
/**
|
|
62
|
+
* PisellGroupView 组件 Props
|
|
63
|
+
* @template T - 数据项类型
|
|
64
|
+
* @description
|
|
65
|
+
* 通用、数据无关的「分组展示容器」:先按 `groupBy` 将 `dataSource` 分组,
|
|
66
|
+
* 再为每个分组渲染头部 / 统计 / 主体 / 操作四块,各块均可由外部自定义渲染。
|
|
67
|
+
*/
|
|
68
|
+
export interface PisellGroupViewProps<T = unknown> {
|
|
69
|
+
/** 数据源(应为外部已映射好的列表) */
|
|
70
|
+
dataSource: T[];
|
|
71
|
+
/**
|
|
72
|
+
* 分组规则
|
|
73
|
+
* @description
|
|
74
|
+
* - `string`:单字段路径,支持 `'a.b.c'` 点路径
|
|
75
|
+
* - `string[]`:多字段组合(如 `['productId', 'time']`)
|
|
76
|
+
* - `(item, index) => GroupKey | GroupKey[]`:完全自定义
|
|
77
|
+
*/
|
|
78
|
+
groupBy: string | string[] | ((item: T, index: number) => GroupKey | GroupKey[]);
|
|
79
|
+
/** 自定义分组 id 生成,默认各键以 `|` 拼接 */
|
|
80
|
+
getGroupId?: (keys: GroupKey[]) => string;
|
|
81
|
+
/** 分组之间的排序;不传保持首次出现顺序 */
|
|
82
|
+
sortGroups?: (a: GroupModel<T>, b: GroupModel<T>) => number;
|
|
83
|
+
/** 分组内数据项的排序;不传保持原始相对顺序 */
|
|
84
|
+
sortItems?: (a: T, b: T) => number;
|
|
85
|
+
/** ① 头部:分组条件对应的相同信息(时间、商品名、客户等) */
|
|
86
|
+
renderHeader?: (group: GroupModel<T>) => ReactNode;
|
|
87
|
+
/** ② 统计栏:可自定义展示,数据来源于分组后的数据 */
|
|
88
|
+
renderStats?: (group: GroupModel<T>) => ReactNode;
|
|
89
|
+
/** ③ 主体:渲染分组内的单条数据为卡片 */
|
|
90
|
+
renderItem?: (item: T, ctx: ItemContext<T>) => ReactNode;
|
|
91
|
+
/** ④ 操作区:批量操作(加时、编辑等) */
|
|
92
|
+
renderActions?: (group: GroupModel<T>) => ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* 主体布局
|
|
95
|
+
* @default 'stack'
|
|
96
|
+
*/
|
|
97
|
+
itemLayout?: ItemLayout;
|
|
98
|
+
/**
|
|
99
|
+
* 自定义主体容器
|
|
100
|
+
* @param group - 当前分组
|
|
101
|
+
* @param defaultBody - 组件按 `itemLayout` + `renderItem` 渲染出的默认主体
|
|
102
|
+
*/
|
|
103
|
+
renderBody?: (group: GroupModel<T>, defaultBody: ReactNode) => ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* 自定义整组容器
|
|
106
|
+
* @param group - 当前分组
|
|
107
|
+
* @param blocks - 四块默认内容(header/stats/body/actions)
|
|
108
|
+
* @description 提供后将完全接管单个分组的结构,调用方可自由编排四块顺序与包裹
|
|
109
|
+
*/
|
|
110
|
+
renderGroup?: (group: GroupModel<T>, blocks: GroupBlocks) => ReactNode;
|
|
111
|
+
/** 数据源为空时的渲染 */
|
|
112
|
+
renderEmpty?: () => ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* 主体内单条卡片的 key
|
|
115
|
+
* @description 不传时使用 index(仅在列表无增删改时安全)
|
|
116
|
+
*/
|
|
117
|
+
rowKey?: string | ((item: T, index: number) => string);
|
|
118
|
+
/** 多端 variant,仅追加根节点 class */
|
|
119
|
+
variant?: GroupViewVariant;
|
|
120
|
+
/** 自定义类名 */
|
|
121
|
+
className?: string;
|
|
122
|
+
/** 自定义样式 */
|
|
123
|
+
style?: CSSProperties;
|
|
124
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PisellGroupViewProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 组件样式前缀
|
|
4
|
+
*/
|
|
5
|
+
export declare const COMPONENT_PREFIX = "pisell-group-view";
|
|
6
|
+
/**
|
|
7
|
+
* 解析参与分组的字段名列表
|
|
8
|
+
* @param groupBy - 组件的 groupBy 配置
|
|
9
|
+
* @returns 字段名数组;自定义函数分组时返回空数组
|
|
10
|
+
* @description 用于透传给 `renderItem`,让调用方据此省略头部已展示的字段
|
|
11
|
+
*/
|
|
12
|
+
export declare const getGroupFieldNames: <T>(groupBy: string | string[] | ((item: T, index: number) => any)) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* 获取主体内单条数据的稳定 key
|
|
15
|
+
* @param item - 数据项
|
|
16
|
+
* @param index - 索引
|
|
17
|
+
* @param rowKey - rowKey 配置
|
|
18
|
+
* @returns key 字符串
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveItemKey: <T>(item: T, index: number, rowKey?: string | ((item: T, index: number) => string) | undefined) => string;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* <Content />
|
|
14
14
|
* </PisellLayouts.ScrollView>
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
declare const PisellLayouts: {
|
|
17
18
|
BasicGrid: <T>(props: import("../PisellBasicGrid").PisellBasicGridProps<T>) => import("react").JSX.Element;
|
|
18
19
|
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("../PisellScrollView").PisellScrollViewProps, "ref"> & import("react").RefAttributes<import("../PisellScrollView").PisellScrollViewRef>>;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* />
|
|
14
14
|
* <PisellMetrics.StatisticList data={[...]} />
|
|
15
15
|
*/
|
|
16
|
+
/// <reference types="react" />
|
|
16
17
|
declare const PisellMetrics: {
|
|
17
18
|
MetricCard: import("react").FC<import("../pisellMetricCard").PisellMetricCardProps>;
|
|
18
19
|
StatisticList: (props: import("../pisellStatisticList").PisellStatisticListProps) => import("react").JSX.Element;
|
|
@@ -252,9 +252,8 @@ var PisellTabbar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
252
252
|
var _cardProps$active2;
|
|
253
253
|
var itemData = cardProps.dataSource;
|
|
254
254
|
var levelConfig = getLevelConfig(level);
|
|
255
|
-
return /*#__PURE__*/React.createElement(PisellCards.TextCard, _extends({
|
|
256
|
-
text: itemData.name
|
|
257
|
-
}, cardProps, {
|
|
255
|
+
return /*#__PURE__*/React.createElement(PisellCards.TextCard, _extends({}, cardProps, {
|
|
256
|
+
text: itemData.name,
|
|
258
257
|
variant: "outlined",
|
|
259
258
|
widthMode: "fixed",
|
|
260
259
|
textConfig: {
|
|
@@ -527,7 +526,7 @@ var PisellTabbar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
527
526
|
onClick: action.onClick,
|
|
528
527
|
card: function card(cardProps) {
|
|
529
528
|
var _action$label;
|
|
530
|
-
return
|
|
529
|
+
return renderLevelNCard(_objectSpread(_objectSpread({}, cardProps), {}, {
|
|
531
530
|
text: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.icon
|
|
532
531
|
}), 'level1');
|
|
533
532
|
}
|
|
@@ -15,4 +15,4 @@ export declare const getFileMetadataParams: (file: RcFile & {
|
|
|
15
15
|
metadata?: MediaMetadata;
|
|
16
16
|
}) => Record<string, any>;
|
|
17
17
|
export declare const isValueEqual: (value: any, fileListValue: any) => boolean;
|
|
18
|
-
export declare const getBaseTime: (size: number) =>
|
|
18
|
+
export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const formFieldMap: {
|
|
2
3
|
FormItemCheckbox: import("react").FC<{}> & {
|
|
3
4
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -19,7 +20,7 @@ declare const formFieldMap: {
|
|
|
19
20
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
20
21
|
onChange: (value: string) => void;
|
|
21
22
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
22
|
-
rootDomain: "custom" | "
|
|
23
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
23
24
|
customDomain?: string | undefined;
|
|
24
25
|
value?: string | undefined;
|
|
25
26
|
tenantId: string;
|
|
@@ -80,11 +81,11 @@ declare const formFieldMap: {
|
|
|
80
81
|
extraParams?: Record<string, any> | undefined;
|
|
81
82
|
}) => import("react").JSX.Element;
|
|
82
83
|
};
|
|
83
|
-
declare const getFieldComponent: (fieldComponent: string) =>
|
|
84
|
+
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<{}> & {
|
|
84
85
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
85
86
|
} & {
|
|
86
87
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
87
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
88
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
88
89
|
JSON: import("react").FC<any>;
|
|
89
90
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
90
91
|
TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
@@ -97,7 +98,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
|
|
|
97
98
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
98
99
|
onChange: (value: string) => void;
|
|
99
100
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
100
|
-
rootDomain: "custom" | "
|
|
101
|
+
rootDomain: "custom" | "saas" | "xzero";
|
|
101
102
|
customDomain?: string | undefined;
|
|
102
103
|
value?: string | undefined;
|
|
103
104
|
tenantId: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellFloorMapLayout - 空间布局视图
|
|
3
|
+
* 支持两种用法:1) 仅传入 items + renderItem(原有用法);2) 传入 floorMapConfig + dataSources + mode 使用平面图视图(含多画布/编辑态)
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { FloorMapItemBase, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from './types';
|
|
7
|
+
import './PisellFloorMapLayout.less';
|
|
8
|
+
/** 空间布局根组件:阅读/编辑、列表与平面图双模式,ref 见 {@link PisellFloorMapLayoutRef} */
|
|
9
|
+
declare const PisellFloorMapLayout: <T extends FloorMapItemBase = FloorMapItemBase>(props: PisellFloorMapLayoutProps<T> & {
|
|
10
|
+
ref?: React.Ref<PisellFloorMapLayoutRef | null> | undefined;
|
|
11
|
+
}) => React.ReactElement;
|
|
12
|
+
export { PisellFloorMapLayout };
|
|
13
|
+
export default PisellFloorMapLayout;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CanvasTabs - 多画布 Tab,支持切换、动态添加、删除与重命名(编辑态)
|
|
3
|
+
* - 展示名:可选 `nameKey` + `locales.getText`,否则用 `name`(字符串或多语言对象)
|
|
4
|
+
* - 角标:可选 `tabBadge` 或由布局层注入合并后的数量
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { FloorMapCanvas, FloorMapCanvasNameI18n } from '../types';
|
|
8
|
+
import './CanvasTabs.less';
|
|
9
|
+
export interface CanvasTabsProps {
|
|
10
|
+
/** 画布列表 */
|
|
11
|
+
canvases: FloorMapCanvas[];
|
|
12
|
+
/** 当前画布 id */
|
|
13
|
+
currentCanvasId: string | null;
|
|
14
|
+
/** 切换画布 */
|
|
15
|
+
onTabChange: (canvasId: string) => void;
|
|
16
|
+
/** 是否允许添加/删除/重命名画布(编辑态) */
|
|
17
|
+
canEdit?: boolean;
|
|
18
|
+
/** 添加画布 */
|
|
19
|
+
onAddCanvas?: () => void;
|
|
20
|
+
/** 删除画布(至少保留一个画布时可调用) */
|
|
21
|
+
onRemoveCanvas?: (canvasId: string) => void;
|
|
22
|
+
/** 重命名画布(对象写入 `name`,并清除 `nameKey`) */
|
|
23
|
+
onRenameCanvas?: (canvasId: string, name: string | FloorMapCanvasNameI18n) => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function CanvasTabs(props: CanvasTabsProps): React.JSX.Element;
|
|
27
|
+
export default CanvasTabs;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditableItemLayer - 编辑态图元层:拖拽、缩放、选中、吸附
|
|
3
|
+
*/
|
|
4
|
+
import React, { type CSSProperties } from 'react';
|
|
5
|
+
import type { FloorMapItemBase, FloorMapMergedItem, FloorMapRenderOptions } from '../types';
|
|
6
|
+
import { type AlignGuide } from '../utils/alignSnap';
|
|
7
|
+
import { type FloorMapEditQuickActionLabels } from './FloorMapEditQuickActions';
|
|
8
|
+
import './EditableItemLayer.less';
|
|
9
|
+
export interface EditableItemLayerProps<T extends FloorMapItemBase = FloorMapMergedItem> {
|
|
10
|
+
items: T[];
|
|
11
|
+
renderItem: (item: T, index: number, options?: FloorMapRenderOptions) => React.ReactNode;
|
|
12
|
+
rowKey?: string | ((item: T, index: number) => string);
|
|
13
|
+
cellSize: number;
|
|
14
|
+
itemUnit?: 'cell' | 'pixel';
|
|
15
|
+
itemGap?: number;
|
|
16
|
+
contentWidth: number;
|
|
17
|
+
contentHeight: number;
|
|
18
|
+
/** 内容区 X/Y 偏移(画布包围盒向左/上扩展时,图元层整体平移) */
|
|
19
|
+
contentOffsetX?: number;
|
|
20
|
+
contentOffsetY?: number;
|
|
21
|
+
selectedId: string | null;
|
|
22
|
+
onSelect: (id: string | null) => void;
|
|
23
|
+
onUpdateItem: (itemId: string, patch: Partial<{
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
}>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 一次提交多个图元的坐标变更(选区分组拖拽时整组落库),用于一步撤销。
|
|
31
|
+
* 未传时分组拖拽降级为不落库(仅预览)。
|
|
32
|
+
*/
|
|
33
|
+
onUpdateItemsBatch?: (patches: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
patch: Partial<{
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}>;
|
|
41
|
+
}>) => void;
|
|
42
|
+
snapStep?: number;
|
|
43
|
+
/** 画布当前缩放,用于将屏幕位移转为内容位移 */
|
|
44
|
+
scale?: number;
|
|
45
|
+
/** 拖拽/缩放图元时通知父组件,用于禁用画布平移,避免松手时画布跟着动 */
|
|
46
|
+
onInteractionChange?: (active: boolean) => void;
|
|
47
|
+
/**
|
|
48
|
+
* 拖拽/缩放过程中的像素矩形(内容坐标),用于 EdgeLayer 实时重算连线。
|
|
49
|
+
* itemId 为 null 表示结束交互。
|
|
50
|
+
*/
|
|
51
|
+
onLiveRectChange?: (itemId: string | null, rect: {
|
|
52
|
+
left: number;
|
|
53
|
+
top: number;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
} | null) => void;
|
|
57
|
+
/**
|
|
58
|
+
* 选区分组拖拽过程中,选区与全部成员的实时像素矩形(内容坐标),用于 EdgeLayer 重算连线。
|
|
59
|
+
* 传 null 表示结束分组交互。
|
|
60
|
+
*/
|
|
61
|
+
onLiveRectsChange?: (rects: Record<string, {
|
|
62
|
+
left: number;
|
|
63
|
+
top: number;
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
66
|
+
}> | null) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 对齐阈值(屏幕像素,组件内会按 scale 折算到内容坐标)。
|
|
69
|
+
* 0 或负数关闭对齐。
|
|
70
|
+
*/
|
|
71
|
+
alignSnapThresholdPx?: number;
|
|
72
|
+
/** 命中的对齐辅助线变化;交互结束时回调一次空数组 */
|
|
73
|
+
onAlignGuidesChange?: (guides: AlignGuide[]) => void;
|
|
74
|
+
/** 对齐辅助线颜色(推荐用主题 token `alignGuideStroke`) */
|
|
75
|
+
alignGuideStroke?: string;
|
|
76
|
+
/** 每项外层容器额外样式(与定位样式合并) */
|
|
77
|
+
getMergedItemWrapperStyle?: (item: T, index: number) => CSSProperties | undefined;
|
|
78
|
+
className?: string;
|
|
79
|
+
/** 编辑态选中时图元旁快捷栏(上锁 / 复制 / 删除) */
|
|
80
|
+
editQuickBar?: {
|
|
81
|
+
labels: FloorMapEditQuickActionLabels;
|
|
82
|
+
isLocked: boolean;
|
|
83
|
+
onToggleLock: () => void;
|
|
84
|
+
onDuplicate: () => void;
|
|
85
|
+
onDelete: () => void;
|
|
86
|
+
} | null;
|
|
87
|
+
}
|
|
88
|
+
export declare function EditableItemLayer<T extends FloorMapItemBase>(props: EditableItemLayerProps<T>): React.JSX.Element;
|
|
89
|
+
export default EditableItemLayer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FloorMapEditPanel - 选中图元后的编辑面板:画布属性 + 可选数据绑定 + 数据源记录表单
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { FloorMapEditPanelParams, FloorMapViewConfig, FloorMapDataSources } from '../types';
|
|
6
|
+
import './FloorMapEditPanel.less';
|
|
7
|
+
export interface FloorMapEditPanelProps extends FloorMapEditPanelParams {
|
|
8
|
+
config: FloorMapViewConfig;
|
|
9
|
+
dataSources: FloorMapDataSources;
|
|
10
|
+
savingRecord?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function FloorMapEditPanel(props: FloorMapEditPanelProps): React.JSX.Element;
|
|
14
|
+
export default FloorMapEditPanel;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FloorMapEditTopBar - 编辑态顶栏
|
|
3
|
+
* - `mode="compact"`:画布 Tab + 可选 `canvasTabsBarTrailing`(全屏入口在左下 Dock)
|
|
4
|
+
* - `mode="full"`:画布 Tab + `canvasTabsBarTrailing` + 保存(仅非浏览器全屏时)+ 扩展操作
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { CanvasTabsProps } from './CanvasTabs';
|
|
8
|
+
import type { FloorMapControlsConfig, FloorMapViewConfig } from '../types';
|
|
9
|
+
import './FloorMapEditTopBar.less';
|
|
10
|
+
export declare type FloorMapEditTopBarMode = 'full' | 'compact';
|
|
11
|
+
export interface FloorMapEditTopBarProps {
|
|
12
|
+
/** full:全屏时的完整顶栏;compact:非全屏时 Tab + 扩展区 */
|
|
13
|
+
mode?: FloorMapEditTopBarMode;
|
|
14
|
+
config: FloorMapViewConfig;
|
|
15
|
+
canvases: CanvasTabsProps['canvases'];
|
|
16
|
+
currentCanvasId: CanvasTabsProps['currentCanvasId'];
|
|
17
|
+
onTabChange: CanvasTabsProps['onTabChange'];
|
|
18
|
+
canEditTabs?: CanvasTabsProps['canEdit'];
|
|
19
|
+
onAddCanvas?: CanvasTabsProps['onAddCanvas'];
|
|
20
|
+
onRemoveCanvas?: CanvasTabsProps['onRemoveCanvas'];
|
|
21
|
+
onRenameCanvas?: CanvasTabsProps['onRenameCanvas'];
|
|
22
|
+
onSave?: () => void;
|
|
23
|
+
saving?: boolean;
|
|
24
|
+
saveError?: Error | string;
|
|
25
|
+
layoutDirty?: boolean;
|
|
26
|
+
/** full 模式:浏览器全屏时为 true,顶栏不展示保存(改由侧栏) */
|
|
27
|
+
isFullscreen?: boolean;
|
|
28
|
+
controls?: FloorMapControlsConfig;
|
|
29
|
+
/** 顶栏右侧扩展(如「区域定位」等),仅 full 模式 */
|
|
30
|
+
extraActions?: React.ReactNode;
|
|
31
|
+
/** 画布 Tab 同排最右侧业务区 */
|
|
32
|
+
canvasTabsBarTrailing?: React.ReactNode;
|
|
33
|
+
/** 启用画布仅 1 个时隐藏 Tab 行,仅保留右侧操作区(全屏顶栏保存等) */
|
|
34
|
+
hideCanvasTabs?: boolean;
|
|
35
|
+
/** 撤销当前编辑步骤(不传则不显示按钮) */
|
|
36
|
+
onUndo?: () => void;
|
|
37
|
+
/** 重做最近一次撤销(不传则不显示按钮) */
|
|
38
|
+
onRedo?: () => void;
|
|
39
|
+
/** 是否还有可撤销步骤 */
|
|
40
|
+
canUndo?: boolean;
|
|
41
|
+
/** 是否还有可重做步骤 */
|
|
42
|
+
canRedo?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 退出编辑模式回调(不保存)。
|
|
45
|
+
* 传入后顶栏右侧会渲染「取消编辑」+「完成」两个按钮,替代原独立「保存」按钮:
|
|
46
|
+
* - 取消编辑 → `onCancelEdit?.() ?? onExitEdit()`
|
|
47
|
+
* - 完成 → `onSave?.()` + `onExitEdit()`
|
|
48
|
+
* 不传则维持旧版「保存」按钮(保存但不退出)。
|
|
49
|
+
*/
|
|
50
|
+
onExitEdit?: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* 「取消编辑」专用回调(可选)。传入时取消按钮优先调它,业务层可以在这里
|
|
53
|
+
* 完成「丢弃草稿 + 退出编辑」组合,从而保证回到阅读态不会看到未保存的脏数据。
|
|
54
|
+
* 不传时取消按钮回退到 `onExitEdit`。完成按钮链路不受此 prop 影响。
|
|
55
|
+
*/
|
|
56
|
+
onCancelEdit?: () => void;
|
|
57
|
+
className?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 手机布局:顶栏拆两行(切换画布 / 操作区),并配合 Less 收紧 padding。
|
|
60
|
+
*/
|
|
61
|
+
phoneLayout?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export declare function FloorMapEditTopBar(props: FloorMapEditTopBarProps): React.JSX.Element | null;
|
|
64
|
+
export default FloorMapEditTopBar;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FloorMapOverview - 阅读态「All」全览视图(纯渲染版)
|
|
3
|
+
*
|
|
4
|
+
* 仅负责把 {@link OverviewLayout} 中各画布的图元渲染到对应的绝对定位区域里;
|
|
5
|
+
* 由 PisellFloorMapLayout 在主 TransformWrapper 内挂载,与单画布共享同一套
|
|
6
|
+
* 视口控件(缩放、平移、锁定、全屏、fitBounds、网格按钮等)。
|
|
7
|
+
*
|
|
8
|
+
* 设计要点:
|
|
9
|
+
* - 不再自带 TransformWrapper / ResizeObserver / fit 算法;
|
|
10
|
+
* - 每个画布作为独立区域,仅一条细边框作分隔,无背景色/网格;
|
|
11
|
+
* - 画布名显示在边框外的标题带;标题不拦截图元交互;
|
|
12
|
+
* - 仅渲染 ItemLayer(阅读态),与单画布的 hover/click 行为一致;编辑层不渲染。
|
|
13
|
+
*/
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import type { OverviewLayout } from '../utils/floorMapOverviewLayout';
|
|
16
|
+
import type { FloorMapItemBase, FloorMapItemUnit, FloorMapRenderOptions, FloorMapViewConfig } from '../types';
|
|
17
|
+
import './FloorMapOverview.less';
|
|
18
|
+
export interface FloorMapOverviewProps<T extends FloorMapItemBase> {
|
|
19
|
+
/** 由 PisellFloorMapLayout 算好的整体布局(区域位置 + 总尺寸) */
|
|
20
|
+
overviewLayout: OverviewLayout;
|
|
21
|
+
/**
|
|
22
|
+
* 仅用于把 `canvas.id` 映射成展示名(区域左上角 chip)。
|
|
23
|
+
* 直接传 config 而非映射表,避免父组件再多构造一层。
|
|
24
|
+
*/
|
|
25
|
+
config: FloorMapViewConfig;
|
|
26
|
+
itemUnit?: FloorMapItemUnit;
|
|
27
|
+
renderItem: (item: T, index: number, options?: FloorMapRenderOptions) => React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* 主 TransformWrapper 的当前缩放,透传到各区域 ItemLayer 的 `viewportScale`。
|
|
30
|
+
* 缺省(undefined)时下游 `renderItem` 拿不到 viewportScale,预约/桌位卡只能
|
|
31
|
+
* 按布局像素算 visualShortSide,**永远停在 comfortable 档**,进不去 tooltip-time
|
|
32
|
+
* 小卡片模式——这正是 All 视图缩放后看不到小卡的根因。
|
|
33
|
+
*/
|
|
34
|
+
viewportScale?: number;
|
|
35
|
+
enableHover?: boolean;
|
|
36
|
+
onItemClick?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
37
|
+
onItemHover?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
38
|
+
onItemLeave?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
39
|
+
getMergedItemWrapperStyle?: (item: T, index: number) => React.CSSProperties | undefined;
|
|
40
|
+
readModeSelectedItemId?: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* 点击区域标题(画布名标签)时回调,传入该区域的 `canvasId`。
|
|
43
|
+
* 传入后标题标签变为可点击(pointer-events 放开 + 指针光标),用于从 All 视图切回该画布。
|
|
44
|
+
*/
|
|
45
|
+
onSelectCanvas?: (canvasId: string) => void;
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function FloorMapOverview<T extends FloorMapItemBase>(props: FloorMapOverviewProps<T>): React.JSX.Element;
|
|
49
|
+
export default FloorMapOverview;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 选区(selection zone)图元展示:虚线框 + 左上角标题标签。
|
|
3
|
+
*
|
|
4
|
+
* 成员关系按「几何完全包含」实时计算(见 utils/floorMapSelectionZone),此组件仅负责视觉。
|
|
5
|
+
* 内部 body 设 `pointer-events: none`,仅外层定位容器接收拖拽,保证框内图元仍可单独点选/拖动。
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import './FloorMapSelectionZoneElement.less';
|
|
9
|
+
export interface FloorMapSelectionZoneElementProps {
|
|
10
|
+
/** 选区名称;为空时展示「未命名选区」占位 */
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function FloorMapSelectionZoneElement(props: FloorMapSelectionZoneElementProps): React.JSX.Element;
|