@pisell/materials 1.8.31 → 1.8.33
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 +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Pagination/index.d.ts +2 -1
- package/es/components/Pagination/index.js +58 -24
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +201 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -2
- package/es/components/dataSourceComponents/fields/index.d.ts +13 -12
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +3 -1
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +4 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +9 -4
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +9 -2
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +74 -23
- package/es/components/pisellFloorMapLayout/types.d.ts +5 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +14 -6
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +193 -9
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +31 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +6 -3
- package/es/components/pisellRecordBoard/shellFrame/index.js +4 -1
- package/es/components/pisellRecordBoard/types.d.ts +9 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +13 -1
- package/es/locales/en-US.d.ts +4 -1
- package/es/locales/en-US.js +5 -2
- package/es/locales/ja.d.ts +3 -0
- package/es/locales/ja.js +3 -0
- package/es/locales/pt.d.ts +3 -0
- package/es/locales/pt.js +3 -0
- package/es/locales/zh-CN.d.ts +4 -1
- package/es/locales/zh-CN.js +5 -2
- package/es/locales/zh-TW.d.ts +4 -1
- package/es/locales/zh-TW.js +5 -2
- package/es/pisell-materials.tw.css +1 -1
- package/lib/components/Pagination/index.d.ts +2 -1
- package/lib/components/Pagination/index.js +50 -7
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +201 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +4 -2
- package/lib/components/dataSourceComponents/fields/index.d.ts +13 -12
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +3 -1
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +4 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +8 -3
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +9 -2
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +53 -18
- package/lib/components/pisellFloorMapLayout/types.d.ts +5 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +16 -6
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +189 -32
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +31 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +99 -96
- package/lib/components/pisellRecordBoard/shellFrame/index.js +2 -1
- package/lib/components/pisellRecordBoard/types.d.ts +9 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +9 -1
- package/lib/locales/en-US.d.ts +4 -1
- package/lib/locales/en-US.js +4 -1
- package/lib/locales/ja.d.ts +3 -0
- package/lib/locales/ja.js +3 -0
- package/lib/locales/pt.d.ts +3 -0
- package/lib/locales/pt.js +3 -0
- package/lib/locales/zh-CN.d.ts +4 -1
- package/lib/locales/zh-CN.js +4 -1
- package/lib/locales/zh-TW.d.ts +4 -1
- package/lib/locales/zh-TW.js +4 -1
- package/lib/pisell-materials.tw.css +1 -1
- package/lowcode/pisell-record-board-calendar-view/meta.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
export interface DataSourceType {
|
|
2
|
+
key: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
status: string;
|
|
5
|
+
type: string;
|
|
6
|
+
isDBInstance: boolean;
|
|
7
|
+
collections: Collection[];
|
|
8
|
+
}
|
|
9
|
+
export declare type ActionsItem = {
|
|
10
|
+
method: string;
|
|
11
|
+
path: string;
|
|
12
|
+
params: {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
headers: {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
body: Record<string, any>;
|
|
21
|
+
};
|
|
22
|
+
export interface Collection {
|
|
23
|
+
name: string;
|
|
24
|
+
title: string;
|
|
25
|
+
tableName: string;
|
|
26
|
+
timestamps: boolean;
|
|
27
|
+
autoGenId: boolean;
|
|
28
|
+
filterTargetKey: string;
|
|
29
|
+
fields: Field[];
|
|
30
|
+
introspected: boolean;
|
|
31
|
+
unavailableActions: any[];
|
|
32
|
+
actions: {
|
|
33
|
+
get: ActionsItem;
|
|
34
|
+
update: ActionsItem;
|
|
35
|
+
create: ActionsItem;
|
|
36
|
+
delete: ActionsItem;
|
|
37
|
+
list: ActionsItem;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface Field {
|
|
41
|
+
name: string;
|
|
42
|
+
type: string;
|
|
43
|
+
allowNull: boolean;
|
|
44
|
+
primaryKey: boolean;
|
|
45
|
+
unique: boolean;
|
|
46
|
+
autoIncrement: boolean;
|
|
47
|
+
description?: (null | string)[];
|
|
48
|
+
possibleTypes?: string[];
|
|
49
|
+
rawType: string;
|
|
50
|
+
interface: string;
|
|
51
|
+
uiSchema: UiSchema;
|
|
52
|
+
key?: string;
|
|
53
|
+
collectionName?: string;
|
|
54
|
+
collectionKey?: any;
|
|
55
|
+
dataSourceKey?: string;
|
|
56
|
+
defaultValue?: any;
|
|
57
|
+
}
|
|
58
|
+
interface UiSchema {
|
|
59
|
+
type?: string;
|
|
60
|
+
'x-component': string;
|
|
61
|
+
'x-component-props'?: Xcomponentprops;
|
|
62
|
+
'x-validator'?: string;
|
|
63
|
+
title: string;
|
|
64
|
+
default?: any;
|
|
65
|
+
enum?: any[];
|
|
66
|
+
}
|
|
67
|
+
interface Xcomponentprops {
|
|
68
|
+
style?: Style;
|
|
69
|
+
autoSize?: AutoSize;
|
|
70
|
+
stringMode?: boolean;
|
|
71
|
+
step?: string;
|
|
72
|
+
dateFormat?: string;
|
|
73
|
+
showTime?: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface AutoSize {
|
|
76
|
+
minRows: number;
|
|
77
|
+
}
|
|
78
|
+
interface Style {
|
|
79
|
+
width: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 获取nocobase自定义数据源
|
|
83
|
+
*/
|
|
84
|
+
export declare const getNocobaseDataSource: () => Promise<DataSourceType[]>;
|
|
85
|
+
/**
|
|
86
|
+
* 获取nocobase主数据源
|
|
87
|
+
*/
|
|
88
|
+
export declare const getNocobaseMainDataSource: () => Promise<any>;
|
|
89
|
+
/**
|
|
90
|
+
* 获取nocobase数据源设置
|
|
91
|
+
*/
|
|
92
|
+
export declare const getNocobaseDataSourceOptions: () => Promise<any>;
|
|
93
|
+
/**
|
|
94
|
+
* 创建nocobase数据
|
|
95
|
+
*/
|
|
96
|
+
export declare const createNocobaseData: (params: {
|
|
97
|
+
key: string;
|
|
98
|
+
data: any;
|
|
99
|
+
headers?: any;
|
|
100
|
+
}) => Promise<any>;
|
|
101
|
+
/**
|
|
102
|
+
* nocobase get数据
|
|
103
|
+
*/
|
|
104
|
+
export declare const getNocobaseData: (params: {
|
|
105
|
+
key: string;
|
|
106
|
+
query: Record<string, any>;
|
|
107
|
+
headers?: any;
|
|
108
|
+
}) => Promise<any>;
|
|
109
|
+
/**
|
|
110
|
+
* 自定义api接口
|
|
111
|
+
*/
|
|
112
|
+
export declare const customApi: (url: string, data: Record<string, any>, options: {
|
|
113
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
114
|
+
baseUrl?: string | undefined;
|
|
115
|
+
headers?: {
|
|
116
|
+
name: string;
|
|
117
|
+
value: any;
|
|
118
|
+
}[] | undefined;
|
|
119
|
+
params?: {
|
|
120
|
+
name: string;
|
|
121
|
+
value: any;
|
|
122
|
+
}[] | undefined;
|
|
123
|
+
body?: Record<string, any> | undefined;
|
|
124
|
+
dataSourceKey?: string | undefined;
|
|
125
|
+
}) => Promise<any>;
|
|
126
|
+
/**
|
|
127
|
+
* 更新nocobase数据
|
|
128
|
+
*/
|
|
129
|
+
export declare const updateNocobaseData: (params: {
|
|
130
|
+
key: string;
|
|
131
|
+
data: any;
|
|
132
|
+
headers?: any;
|
|
133
|
+
query?: Record<string, any> | undefined;
|
|
134
|
+
}) => Promise<any>;
|
|
135
|
+
/**
|
|
136
|
+
* 获取nocobase数据列表
|
|
137
|
+
*/
|
|
138
|
+
export declare const getNocobaseDataList: (allParams: {
|
|
139
|
+
key: string;
|
|
140
|
+
params: {
|
|
141
|
+
page: number;
|
|
142
|
+
pageSize: number;
|
|
143
|
+
};
|
|
144
|
+
headers?: any;
|
|
145
|
+
}) => Promise<any>;
|
|
146
|
+
/**
|
|
147
|
+
* 删除nocobase数据
|
|
148
|
+
*/
|
|
149
|
+
export declare const deleteNocobaseData: (key: string, id: string, headers?: any) => Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* 获取formSettingMeta数据
|
|
152
|
+
* @param params 请求参数
|
|
153
|
+
* @param params.sectionCodes 配置段代码数组,如 ['payment']
|
|
154
|
+
* @param params.businessCode 业务代码
|
|
155
|
+
* @param params.channelCode 渠道代码
|
|
156
|
+
* @param params.isBoard 是否包含board_code参数
|
|
157
|
+
* @returns Promise<any> 返回设置元数据
|
|
158
|
+
*/
|
|
159
|
+
export declare const getFormSettingMetaData: (params: {
|
|
160
|
+
sectionCodes: string[];
|
|
161
|
+
scope: string;
|
|
162
|
+
target?: string | undefined;
|
|
163
|
+
}) => Promise<any>;
|
|
164
|
+
/**
|
|
165
|
+
* 更新租户设置数据
|
|
166
|
+
* @param params 请求参数
|
|
167
|
+
* @param params.businessCode 业务代码
|
|
168
|
+
* @param params.channelCode 渠道代码
|
|
169
|
+
* @param params.boardCode 板块代码
|
|
170
|
+
* @param params.data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
171
|
+
* @returns Promise<any> 返回更新结果
|
|
172
|
+
*/
|
|
173
|
+
export declare const updateTenantSetting: (params: {
|
|
174
|
+
scope: string;
|
|
175
|
+
target?: string | undefined;
|
|
176
|
+
data: Record<string, any>;
|
|
177
|
+
}) => Promise<any>;
|
|
178
|
+
export declare type DeviceSettingScene = 'template' | 'profile' | 'instance';
|
|
179
|
+
/**
|
|
180
|
+
* 获取设备设置元数据(POST 类型 GET)
|
|
181
|
+
* @param params.scene 场景,默认 template
|
|
182
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
183
|
+
* @param params.items 需要获取的字段列表,例如 ['order.name', 'order.id']
|
|
184
|
+
*/
|
|
185
|
+
export declare const getDeviceSettingMetaData: (params: {
|
|
186
|
+
scene?: DeviceSettingScene | undefined;
|
|
187
|
+
sceneRequestId: string;
|
|
188
|
+
items: string[];
|
|
189
|
+
}) => Promise<any>;
|
|
190
|
+
/**
|
|
191
|
+
* 更新设备设置数据
|
|
192
|
+
* @param params.scene 场景,默认 template
|
|
193
|
+
* @param params.sceneRequestId URL 中 {id} 占位符的实际取值
|
|
194
|
+
* @param params.data 需要更新的字段值对象
|
|
195
|
+
*/
|
|
196
|
+
export declare const updateDeviceSetting: (params: {
|
|
197
|
+
scene?: DeviceSettingScene | undefined;
|
|
198
|
+
sceneRequestId: string;
|
|
199
|
+
data: Record<string, any>;
|
|
200
|
+
}) => Promise<any>;
|
|
201
|
+
export {};
|
|
@@ -232,7 +232,8 @@ var getDeviceSettingMetaData = async (params) => {
|
|
|
232
232
|
{
|
|
233
233
|
headers: {
|
|
234
234
|
"Content-Type": "application/json"
|
|
235
|
-
}
|
|
235
|
+
},
|
|
236
|
+
isPisell2: true
|
|
236
237
|
}
|
|
237
238
|
);
|
|
238
239
|
};
|
|
@@ -254,7 +255,8 @@ var updateDeviceSetting = async (params) => {
|
|
|
254
255
|
{
|
|
255
256
|
headers: {
|
|
256
257
|
"Content-Type": "application/json"
|
|
257
|
-
}
|
|
258
|
+
},
|
|
259
|
+
isPisell2: true
|
|
258
260
|
}
|
|
259
261
|
);
|
|
260
262
|
};
|
|
@@ -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" | "xzero" | "saas";
|
|
23
24
|
customDomain?: string | undefined;
|
|
24
25
|
value?: string | undefined;
|
|
25
26
|
tenantId: string;
|
|
@@ -34,7 +35,7 @@ declare const formFieldMap: {
|
|
|
34
35
|
};
|
|
35
36
|
FormItemSelect: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
36
37
|
options?: any;
|
|
37
|
-
optionSourceType?: "
|
|
38
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
38
39
|
labelField: string;
|
|
39
40
|
valueField: string;
|
|
40
41
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -61,7 +62,7 @@ declare const formFieldMap: {
|
|
|
61
62
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
62
63
|
FormItemRecordListWrapper: (props: import("./RecordListWrapper/type").RecordListWrapperProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
63
64
|
options?: any;
|
|
64
|
-
optionSourceType?: "
|
|
65
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
65
66
|
labelField: string;
|
|
66
67
|
valueField: string;
|
|
67
68
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -71,7 +72,7 @@ declare const formFieldMap: {
|
|
|
71
72
|
}) => import("react").JSX.Element;
|
|
72
73
|
FormItemTabs: (props: import("./Tabs/type").TabsProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
73
74
|
options?: any;
|
|
74
|
-
optionSourceType?: "
|
|
75
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
75
76
|
labelField: string;
|
|
76
77
|
valueField: string;
|
|
77
78
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -80,7 +81,7 @@ declare const formFieldMap: {
|
|
|
80
81
|
extraParams?: Record<string, any> | undefined;
|
|
81
82
|
}) => import("react").JSX.Element;
|
|
82
83
|
};
|
|
83
|
-
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<import("./Input/type").InputProps> & {
|
|
84
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./DatePicker").DataSourceDatePickerProps> | (import("react").FC<import("./Input/type").InputProps> & {
|
|
84
85
|
JSON: import("react").FC<any>;
|
|
85
86
|
Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
86
87
|
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>;
|
|
@@ -93,24 +94,24 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
93
94
|
Subdomain: import("react").FC<import("antd").InputProps & {
|
|
94
95
|
onChange: (value: string) => void;
|
|
95
96
|
onBlur?: ((e: import("react").FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
96
|
-
rootDomain: "custom" | "
|
|
97
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
97
98
|
customDomain?: string | undefined;
|
|
98
99
|
value?: string | undefined;
|
|
99
100
|
tenantId: string;
|
|
100
101
|
name?: string | undefined;
|
|
101
102
|
fieldKey?: string | undefined;
|
|
102
103
|
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
103
|
-
}) |
|
|
104
|
+
}) | (import("react").FC<{}> & {
|
|
104
105
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
105
106
|
} & {
|
|
106
107
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
107
|
-
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> |
|
|
108
|
+
}) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
|
|
108
109
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
109
110
|
} & {
|
|
110
111
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
111
112
|
}) | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
112
113
|
options?: any;
|
|
113
|
-
optionSourceType?: "
|
|
114
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
114
115
|
labelField: string;
|
|
115
116
|
valueField: string;
|
|
116
117
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -119,9 +120,9 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
119
120
|
extraParams?: Record<string, any> | undefined;
|
|
120
121
|
}) => import("react").JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
121
122
|
onChange: (value: string) => void;
|
|
122
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | ((props: import("./RecordListWrapper/type").RecordListWrapperProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
123
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | ((props: import("./RecordListWrapper/type").RecordListWrapperProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
123
124
|
options?: any;
|
|
124
|
-
optionSourceType?: "
|
|
125
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
125
126
|
labelField: string;
|
|
126
127
|
valueField: string;
|
|
127
128
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -130,7 +131,7 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
130
131
|
extraParams?: Record<string, any> | undefined;
|
|
131
132
|
}) => import("react").JSX.Element) | ((props: import("./Tabs/type").TabsProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
132
133
|
options?: any;
|
|
133
|
-
optionSourceType?: "
|
|
134
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
134
135
|
labelField: string;
|
|
135
136
|
valueField: string;
|
|
136
137
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
2
|
+
export interface UseActionsParams {
|
|
3
|
+
dataSource?: DataSourceType;
|
|
4
|
+
currentValue?: 'server' | 'local';
|
|
5
|
+
__designMode?: string;
|
|
6
|
+
extraParams?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, __designMode, extraParams: propsExtraParams, }?: UseActionsParams) => {
|
|
9
|
+
create: (this: unknown, values: Record<string, any>) => Promise<any>;
|
|
10
|
+
get: (this: unknown) => Promise<any>;
|
|
11
|
+
update: (this: unknown, values: Record<string, any>) => Promise<any>;
|
|
12
|
+
list: (this: unknown, params: {
|
|
13
|
+
page: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
}) => Promise<any>;
|
|
16
|
+
destroy: (this: unknown, id: string) => Promise<any>;
|
|
17
|
+
};
|
|
18
|
+
export default useActions;
|
|
@@ -79,6 +79,7 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
79
79
|
pan = {},
|
|
80
80
|
controls = {},
|
|
81
81
|
enableHover = true,
|
|
82
|
+
readModeSelectedItemId,
|
|
82
83
|
onItemClick,
|
|
83
84
|
onItemHover,
|
|
84
85
|
onItemLeave,
|
|
@@ -776,7 +777,8 @@ function PisellFloorMapLayoutInner(props, ref) {
|
|
|
776
777
|
onItemHover,
|
|
777
778
|
onItemLeave,
|
|
778
779
|
getMergedItemWrapperStyle,
|
|
779
|
-
onInteractionChange: setIsInteractingWithElement
|
|
780
|
+
onInteractionChange: setIsInteractingWithElement,
|
|
781
|
+
readModeSelectedItemId
|
|
780
782
|
}
|
|
781
783
|
),
|
|
782
784
|
isFloorMapView && mode === "edit" && (placeMode == null ? void 0 : placeMode.type) === "scene" && /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -42,6 +42,10 @@ export interface ItemLayerProps<T extends FloorMapItemBase> {
|
|
|
42
42
|
onItemLeave?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
43
43
|
/** 每项外层容器额外样式(与定位样式合并) */
|
|
44
44
|
getMergedItemWrapperStyle?: (item: T, index: number) => CSSProperties | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* 阅读态:与 {@link rowKey} 解析 id 相等的图元加选中外圈(如详情 Modal 打开时)。
|
|
47
|
+
*/
|
|
48
|
+
readModeSelectedItemId?: string | null;
|
|
45
49
|
/**
|
|
46
50
|
* 与编辑态一致:在含 `data-pisell-floor-room-scroll-surface` 的区域内按下时置 true,
|
|
47
51
|
* 用于禁用 Transform 画布平移,避免图元内纵向滑动拖动画布。
|
|
@@ -38,6 +38,7 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
38
38
|
var import_ItemLayer = require("./ItemLayer.less");
|
|
39
39
|
var PREFIX = "pisell-floor-map-layout";
|
|
40
40
|
var ROOM_SCROLL_SURFACE_SELECTOR = "[data-pisell-floor-room-scroll-surface]";
|
|
41
|
+
var READ_MODE_SELECTED_STACK_Z = 1e6;
|
|
41
42
|
function getItemKey(item, index, rowKey) {
|
|
42
43
|
if (!rowKey) return item.id;
|
|
43
44
|
if (typeof rowKey === "string")
|
|
@@ -76,6 +77,7 @@ function ItemLayer(props) {
|
|
|
76
77
|
onItemLeave,
|
|
77
78
|
getMergedItemWrapperStyle,
|
|
78
79
|
onInteractionChange,
|
|
80
|
+
readModeSelectedItemId,
|
|
79
81
|
className
|
|
80
82
|
} = props;
|
|
81
83
|
const notifyRoomScrollSurfaceActive = (0, import_react.useCallback)(() => {
|
|
@@ -142,13 +144,15 @@ function ItemLayer(props) {
|
|
|
142
144
|
}
|
|
143
145
|
const key = getItemKey(item, index, rowKey);
|
|
144
146
|
const shapeStyle = getShapeStyle(item.shape);
|
|
147
|
+
const selectedRead = readModeSelectedItemId != null && String(readModeSelectedItemId).trim() !== "" && key === String(readModeSelectedItemId);
|
|
145
148
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
146
149
|
"div",
|
|
147
150
|
{
|
|
148
151
|
key,
|
|
149
152
|
className: (0, import_classnames.default)(`${PREFIX}-item`, {
|
|
150
153
|
[`${PREFIX}-item-hoverable`]: enableHover,
|
|
151
|
-
[`${PREFIX}-item-hover-outline`]: enableHover && itemHoverOutline
|
|
154
|
+
[`${PREFIX}-item-hover-outline`]: enableHover && itemHoverOutline,
|
|
155
|
+
[`${PREFIX}-item-read-selected`]: selectedRead
|
|
152
156
|
}),
|
|
153
157
|
style: {
|
|
154
158
|
position: "absolute",
|
|
@@ -157,7 +161,7 @@ function ItemLayer(props) {
|
|
|
157
161
|
width,
|
|
158
162
|
height,
|
|
159
163
|
boxSizing: "border-box",
|
|
160
|
-
zIndex: item.zIndex ?? 0,
|
|
164
|
+
zIndex: selectedRead ? READ_MODE_SELECTED_STACK_Z + (item.zIndex ?? 0) : item.zIndex ?? 0,
|
|
161
165
|
...shapeStyle,
|
|
162
166
|
...getMergedItemWrapperStyle == null ? void 0 : getMergedItemWrapperStyle(item, index)
|
|
163
167
|
},
|
|
@@ -184,7 +188,8 @@ function ItemLayer(props) {
|
|
|
184
188
|
onItemLeave,
|
|
185
189
|
getMergedItemWrapperStyle,
|
|
186
190
|
handleItemPointerDownCapture,
|
|
187
|
-
handleItemTouchStartCapture
|
|
191
|
+
handleItemTouchStartCapture,
|
|
192
|
+
readModeSelectedItemId
|
|
188
193
|
]);
|
|
189
194
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
190
195
|
"div",
|
|
@@ -13,10 +13,17 @@
|
|
|
13
13
|
|
|
14
14
|
/** hover 描边与编辑态选中一致(见 EditableItemLayer:`pisell-floor-map-layout-editable-item-selected`) */
|
|
15
15
|
|
|
16
|
-
&-hoverable&-hover-outline:hover {
|
|
16
|
+
// &-hoverable&-hover-outline:hover {
|
|
17
|
+
// outline: 3px solid var(--fmap-primary, #1677ff);
|
|
18
|
+
// outline-offset: 0;
|
|
19
|
+
// box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.25);
|
|
20
|
+
// z-index: 1;
|
|
21
|
+
// }
|
|
22
|
+
|
|
23
|
+
/** 阅读态:详情弹层等打开时由业务传入 `readModeSelectedItemId`,与编辑态选中描边一致 */
|
|
24
|
+
&-read-selected {
|
|
17
25
|
outline: 3px solid var(--fmap-primary, #1677ff);
|
|
18
26
|
outline-offset: 0;
|
|
19
27
|
box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.25);
|
|
20
|
-
z-index: 1;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(useFloorMapTransformMetrics_exports);
|
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_layoutMeasurements = require("../utils/layoutMeasurements");
|
|
27
27
|
var import_floorMapViewportPersistence = require("./floorMapViewportPersistence");
|
|
28
|
+
var FIT_BOUNDS_PROGRAMMATIC_TWEEN_GUARD_MS = 400;
|
|
28
29
|
function useFloorMapTransformMetrics(params) {
|
|
29
30
|
const {
|
|
30
31
|
items,
|
|
@@ -79,6 +80,15 @@ function useFloorMapTransformMetrics(params) {
|
|
|
79
80
|
const [isFullscreen, setIsFullscreen] = (0, import_react.useState)(false);
|
|
80
81
|
const lastFitSnapshotRef = (0, import_react.useRef)(null);
|
|
81
82
|
const [isAtFitBounds, setIsAtFitBounds] = (0, import_react.useState)(false);
|
|
83
|
+
const fitBoundsTweenHoldRef = (0, import_react.useRef)(false);
|
|
84
|
+
const fitBoundsTweenHoldClearTimerRef = (0, import_react.useRef)(null);
|
|
85
|
+
const clearFitBoundsTweenHold = (0, import_react.useCallback)(() => {
|
|
86
|
+
if (fitBoundsTweenHoldClearTimerRef.current != null) {
|
|
87
|
+
clearTimeout(fitBoundsTweenHoldClearTimerRef.current);
|
|
88
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
89
|
+
}
|
|
90
|
+
fitBoundsTweenHoldRef.current = false;
|
|
91
|
+
}, []);
|
|
82
92
|
const [viewportLocked, setViewportLockedState] = (0, import_react.useState)(
|
|
83
93
|
() => viewportPersistKey ? (0, import_floorMapViewportPersistence.readPersistedViewportLock)(viewportPersistKey) : false
|
|
84
94
|
);
|
|
@@ -242,43 +252,56 @@ function useFloorMapTransformMetrics(params) {
|
|
|
242
252
|
const wrapper = container.querySelector(".react-transform-wrapper");
|
|
243
253
|
if (!wrapper) return false;
|
|
244
254
|
const wrapperRect = wrapper.getBoundingClientRect();
|
|
245
|
-
|
|
255
|
+
const wEl = wrapper;
|
|
256
|
+
const layoutW = wEl.clientWidth > 0 ? wEl.clientWidth : wrapperRect.width;
|
|
257
|
+
const layoutH = wEl.clientHeight > 0 ? wEl.clientHeight : wrapperRect.height;
|
|
258
|
+
if (layoutW <= 0 || layoutH <= 0) return false;
|
|
259
|
+
const applyProgrammaticFit = (fx, fy, fScale) => {
|
|
260
|
+
clearFitBoundsTweenHold();
|
|
261
|
+
lastFitSnapshotRef.current = { x: fx, y: fy, scale: fScale };
|
|
262
|
+
setIsAtFitBounds(true);
|
|
263
|
+
fitBoundsTweenHoldRef.current = true;
|
|
264
|
+
fitBoundsTweenHoldClearTimerRef.current = setTimeout(() => {
|
|
265
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
266
|
+
fitBoundsTweenHoldRef.current = false;
|
|
267
|
+
const cur = lastTransformRef.current;
|
|
268
|
+
const s = lastFitSnapshotRef.current;
|
|
269
|
+
if (!s) return;
|
|
270
|
+
const same = Math.abs(s.x - cur.x) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(s.y - cur.y) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(s.scale - cur.scale) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_SCALE_EPSILON;
|
|
271
|
+
setIsAtFitBounds(same);
|
|
272
|
+
}, FIT_BOUNDS_PROGRAMMATIC_TWEEN_GUARD_MS);
|
|
273
|
+
ctx.setTransform(fx, fy, fScale);
|
|
274
|
+
};
|
|
246
275
|
const pixelBox = isFloorMapView && effectiveItemUnit === "pixel" && items.length > 0 ? (0, import_layoutMeasurements.getPixelBoundingBox)(items, cellSize) : null;
|
|
247
276
|
if (pixelBox) {
|
|
248
277
|
const bw = Math.max(1, pixelBox.maxRight - pixelBox.minLeft);
|
|
249
278
|
const bh = Math.max(1, pixelBox.maxBottom - pixelBox.minTop);
|
|
250
279
|
const edgePx = 0;
|
|
251
|
-
const availW = Math.max(1,
|
|
252
|
-
const availH = Math.max(1,
|
|
280
|
+
const availW = Math.max(1, layoutW - 2 * edgePx);
|
|
281
|
+
const availH = Math.max(1, layoutH - 2 * edgePx);
|
|
253
282
|
const raw2 = Math.min(availW / bw, availH / bh);
|
|
254
283
|
const nextScale2 = Math.min(raw2, zoom.max ?? 2);
|
|
255
284
|
const ap = alignPadSingle ?? padSingle;
|
|
256
285
|
const bboxCx = ap + bw / 2;
|
|
257
286
|
const bboxCy = ap + bh / 2;
|
|
258
|
-
const x2 =
|
|
259
|
-
const y2 =
|
|
260
|
-
|
|
261
|
-
lastFitSnapshotRef.current = { x: x2, y: y2, scale: nextScale2 };
|
|
262
|
-
setIsAtFitBounds(true);
|
|
287
|
+
const x2 = layoutW / 2 - bboxCx * nextScale2;
|
|
288
|
+
const y2 = layoutH / 2 - bboxCy * nextScale2;
|
|
289
|
+
applyProgrammaticFit(x2, y2, nextScale2);
|
|
263
290
|
return true;
|
|
264
291
|
}
|
|
265
292
|
if (contentWidth <= 0 || contentHeight <= 0) return false;
|
|
266
|
-
const raw = Math.min(
|
|
267
|
-
wrapperRect.width / contentWidth,
|
|
268
|
-
wrapperRect.height / contentHeight
|
|
269
|
-
);
|
|
293
|
+
const raw = Math.min(layoutW / contentWidth, layoutH / contentHeight);
|
|
270
294
|
const nextScale = Math.min(raw, zoom.max ?? 2);
|
|
271
295
|
const padA = alignPadSingle ?? 0;
|
|
272
296
|
const x = import_floorMapViewportPersistence.VIEWPORT_TOP_LEFT_MARGIN - padA * nextScale;
|
|
273
297
|
const y = import_floorMapViewportPersistence.VIEWPORT_TOP_LEFT_MARGIN - padA * nextScale;
|
|
274
|
-
|
|
275
|
-
lastFitSnapshotRef.current = { x, y, scale: nextScale };
|
|
276
|
-
setIsAtFitBounds(true);
|
|
298
|
+
applyProgrammaticFit(x, y, nextScale);
|
|
277
299
|
return true;
|
|
278
300
|
}, [
|
|
301
|
+
clearFitBoundsTweenHold,
|
|
279
302
|
contentWidth,
|
|
280
303
|
contentHeight,
|
|
281
|
-
zoom
|
|
304
|
+
zoom,
|
|
282
305
|
transformRef,
|
|
283
306
|
alignPadSingle,
|
|
284
307
|
isFloorMapView,
|
|
@@ -424,12 +447,19 @@ function useFloorMapTransformMetrics(params) {
|
|
|
424
447
|
const snap = lastFitSnapshotRef.current;
|
|
425
448
|
if (snap) {
|
|
426
449
|
const same = Math.abs(snap.x - x) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(snap.y - y) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(snap.scale - nextScale) < import_floorMapViewportPersistence.FIT_BOUNDS_MATCH_SCALE_EPSILON;
|
|
450
|
+
if (fitBoundsTweenHoldRef.current) {
|
|
451
|
+
if (same) {
|
|
452
|
+
clearFitBoundsTweenHold();
|
|
453
|
+
setIsAtFitBounds(true);
|
|
454
|
+
}
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
427
457
|
setIsAtFitBounds((prev) => prev === same ? prev : same);
|
|
428
458
|
} else {
|
|
429
459
|
setIsAtFitBounds((prev) => prev ? false : prev);
|
|
430
460
|
}
|
|
431
461
|
},
|
|
432
|
-
[]
|
|
462
|
+
[clearFitBoundsTweenHold]
|
|
433
463
|
);
|
|
434
464
|
const persistCurrentViewport = (0, import_react.useCallback)(() => {
|
|
435
465
|
const snapshot = lastTransformRef.current;
|
|
@@ -445,6 +475,7 @@ function useFloorMapTransformMetrics(params) {
|
|
|
445
475
|
viewportPersistKeyRef.current = viewportPersistKey;
|
|
446
476
|
const applyPersistedViewport = (0, import_react.useCallback)(
|
|
447
477
|
(cached) => {
|
|
478
|
+
clearFitBoundsTweenHold();
|
|
448
479
|
const ctx = transformRef.current;
|
|
449
480
|
if (!ctx) return false;
|
|
450
481
|
ctx.setTransform(cached.x, cached.y, cached.scale, 0);
|
|
@@ -459,7 +490,7 @@ function useFloorMapTransformMetrics(params) {
|
|
|
459
490
|
}
|
|
460
491
|
return true;
|
|
461
492
|
},
|
|
462
|
-
[transformRef]
|
|
493
|
+
[clearFitBoundsTweenHold, transformRef]
|
|
463
494
|
);
|
|
464
495
|
(0, import_react.useEffect)(() => {
|
|
465
496
|
if (!viewportPersistKey) return;
|
|
@@ -516,6 +547,10 @@ function useFloorMapTransformMetrics(params) {
|
|
|
516
547
|
}
|
|
517
548
|
(_a = flushPersistRef.current) == null ? void 0 : _a.call(flushPersistRef);
|
|
518
549
|
flushPersistRef.current = null;
|
|
550
|
+
if (fitBoundsTweenHoldClearTimerRef.current != null) {
|
|
551
|
+
clearTimeout(fitBoundsTweenHoldClearTimerRef.current);
|
|
552
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
553
|
+
}
|
|
519
554
|
};
|
|
520
555
|
}, [viewportPersistKey]);
|
|
521
556
|
return {
|
|
@@ -528,6 +528,11 @@ export interface PisellFloorMapLayoutProps<T extends FloorMapItemBase = FloorMap
|
|
|
528
528
|
* 是否开启 hover 高亮或 hover 事件,默认 true
|
|
529
529
|
*/
|
|
530
530
|
enableHover?: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* 阅读态(`mode === 'read'`):与 {@link rowKey} 解析出的图元 id 相等时,外层容器加选中描边(如详情弹层打开时锚定画布上的桌位)。
|
|
533
|
+
* 传 `null` / `undefined` / 空字符串时不展示选中外圈。
|
|
534
|
+
*/
|
|
535
|
+
readModeSelectedItemId?: string | null;
|
|
531
536
|
/**
|
|
532
537
|
* 资源项点击回调
|
|
533
538
|
*/
|