@pisell/materials 1.0.1055 → 1.0.1057
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/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +24 -24
- package/es/components/PisellLayouts/index.d.ts +9 -5
- package/es/components/PisellLayouts/index.js +5 -3
- package/es/components/dataSourceComponents/dataSourceSubForm/index.js +18 -5
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +38 -32
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +58 -26
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.js +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +2 -1
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +12 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +264 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +7 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +42 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +1234 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +36 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +121 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +19 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.d.ts +23 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.js +74 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.less +7 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +22 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +59 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.less +76 -0
- package/es/components/pisellFloorMapLayout/components/index.d.ts +7 -0
- package/es/components/pisellFloorMapLayout/components/index.js +6 -0
- package/es/components/pisellFloorMapLayout/index.d.ts +6 -0
- package/es/components/pisellFloorMapLayout/index.js +5 -0
- package/es/components/pisellFloorMapLayout/types.d.ts +197 -0
- package/es/components/pisellFloorMapLayout/types.js +1 -0
- package/es/components/pisellMultipleSelect/components/EditView.js +3 -3
- package/es/index.d.ts +4 -3
- package/es/index.js +1 -0
- package/lib/components/PisellLayouts/index.d.ts +9 -5
- package/lib/components/PisellLayouts/index.js +2 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.js +16 -3
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +38 -32
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +49 -21
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.js +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +2 -1
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +12 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +257 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +7 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +42 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +755 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +36 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +153 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +19 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.d.ts +23 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.js +103 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.less +7 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +22 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +89 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.less +76 -0
- package/lib/components/pisellFloorMapLayout/components/index.d.ts +7 -0
- package/lib/components/pisellFloorMapLayout/components/index.js +35 -0
- package/lib/components/pisellFloorMapLayout/index.d.ts +6 -0
- package/lib/components/pisellFloorMapLayout/index.js +29 -0
- package/lib/components/pisellFloorMapLayout/types.d.ts +197 -0
- package/lib/components/pisellFloorMapLayout/types.js +17 -0
- package/lib/index.d.ts +4 -3
- package/lib/index.js +3 -0
- package/lowcode/data-source-form/utils.ts +3 -0
- package/lowcode/pisell-floor-map-layout/meta.ts +1511 -0
- package/package.json +4 -3
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 资源项形状
|
|
4
|
+
* @description 展示层支持的基础形状
|
|
5
|
+
*/
|
|
6
|
+
export declare type FloorMapItemShape = 'rect' | 'circle' | 'triangle' | 'polygon' | 'custom';
|
|
7
|
+
/**
|
|
8
|
+
* 底层背景类型
|
|
9
|
+
* @description 地图底层的展示方式
|
|
10
|
+
*/
|
|
11
|
+
export declare type FloorMapBackgroundType = 'none' | 'color' | 'image' | 'svg';
|
|
12
|
+
/**
|
|
13
|
+
* 平移边界策略
|
|
14
|
+
* @description 拖拽/手势平移时的边界行为
|
|
15
|
+
*/
|
|
16
|
+
export declare type FloorMapPanBoundary = 'none' | 'clamp' | 'bounce';
|
|
17
|
+
/**
|
|
18
|
+
* 资源项坐标/尺寸单位
|
|
19
|
+
* - cell:x/y/width/height 为格子数,由 cellSize 转为像素
|
|
20
|
+
* - pixel:x/y/width/height 为像素
|
|
21
|
+
*/
|
|
22
|
+
export declare type FloorMapItemUnit = 'cell' | 'pixel';
|
|
23
|
+
/**
|
|
24
|
+
* 资源项基础类型
|
|
25
|
+
* @description 每个资源至少包含 id 与坐标 (x, y),其余由外部扩展。
|
|
26
|
+
* 单位由布局的 itemUnit 决定:cell 时为格子数,pixel 时为像素。
|
|
27
|
+
*/
|
|
28
|
+
export interface FloorMapItemBase {
|
|
29
|
+
/** 唯一标识 */
|
|
30
|
+
id: string;
|
|
31
|
+
/** 坐标 x(cell 时为格子索引,pixel 时为像素) */
|
|
32
|
+
x: number;
|
|
33
|
+
/** 坐标 y */
|
|
34
|
+
y: number;
|
|
35
|
+
/** 宽度(可选;cell 时为格子数,pixel 时为像素,缺省时 cell 为 1,pixel 为 cellSize) */
|
|
36
|
+
width?: number;
|
|
37
|
+
/** 高度(可选) */
|
|
38
|
+
height?: number;
|
|
39
|
+
/** 形状,默认 rect */
|
|
40
|
+
shape?: FloorMapItemShape;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 底层(MapLayer)配置
|
|
44
|
+
*/
|
|
45
|
+
export interface FloorMapLayerConfig {
|
|
46
|
+
/** 背景类型 */
|
|
47
|
+
backgroundType?: FloorMapBackgroundType;
|
|
48
|
+
/** 纯色背景时的颜色(backgroundType 为 color 时有效) */
|
|
49
|
+
backgroundColor?: string;
|
|
50
|
+
/** 图片背景 URL(backgroundType 为 image 时有效) */
|
|
51
|
+
backgroundImage?: string;
|
|
52
|
+
/** SVG 背景内容或 URL(backgroundType 为 svg 时有效) */
|
|
53
|
+
backgroundSvg?: string;
|
|
54
|
+
/** 是否显示网格线,默认 false */
|
|
55
|
+
showGrid?: boolean;
|
|
56
|
+
/** 底层内边距(如 16 或 "16px") */
|
|
57
|
+
padding?: number | string;
|
|
58
|
+
/** 格子/元素间距 */
|
|
59
|
+
gap?: number | string;
|
|
60
|
+
/** 坐标吸附间隔(逻辑单位),0 表示不吸附 */
|
|
61
|
+
snapStep?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 缩放配置
|
|
65
|
+
*/
|
|
66
|
+
export interface FloorMapZoomConfig {
|
|
67
|
+
/** 默认缩放比例,如 1 表示 100% */
|
|
68
|
+
defaultScale?: number;
|
|
69
|
+
/** 最小缩放,默认 0.5 (50%) */
|
|
70
|
+
min?: number;
|
|
71
|
+
/** 最大缩放,默认 2 (200%) */
|
|
72
|
+
max?: number;
|
|
73
|
+
/** 缩放步进,默认 0.1 (10%) */
|
|
74
|
+
step?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 平移配置
|
|
78
|
+
*/
|
|
79
|
+
export interface FloorMapPanConfig {
|
|
80
|
+
/** 是否允许平移,默认 false */
|
|
81
|
+
enabled?: boolean;
|
|
82
|
+
/** 边界策略,默认 none */
|
|
83
|
+
boundary?: FloorMapPanBoundary;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 视图控制显隐(默认仅显示放大/缩小,复位与区域定位需配置开启)
|
|
87
|
+
*/
|
|
88
|
+
export interface FloorMapControlsConfig {
|
|
89
|
+
/** 是否显示缩放按钮(+ / −),默认 true */
|
|
90
|
+
showZoom?: boolean;
|
|
91
|
+
/** 是否显示复位按钮,默认 false */
|
|
92
|
+
showReset?: boolean;
|
|
93
|
+
/** 是否显示区域定位(fitBounds)按钮,默认 false */
|
|
94
|
+
showFitBounds?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 布局模式(规则网格 vs 完全自由坐标)
|
|
98
|
+
*/
|
|
99
|
+
export declare type FloorMapLayoutMode = 'grid' | 'free';
|
|
100
|
+
/**
|
|
101
|
+
* 规则网格布局配置(layoutMode 为 grid 时可用)
|
|
102
|
+
*/
|
|
103
|
+
export interface FloorMapGridLayoutConfig {
|
|
104
|
+
/** 每行列数 */
|
|
105
|
+
columns?: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* PisellFloorMapLayout 组件 Props
|
|
109
|
+
* @template T - 资源项类型,需继承 FloorMapItemBase 或兼容 id/x/y
|
|
110
|
+
*/
|
|
111
|
+
export interface PisellFloorMapLayoutProps<T extends FloorMapItemBase = FloorMapItemBase> {
|
|
112
|
+
/**
|
|
113
|
+
* 自定义类名
|
|
114
|
+
*/
|
|
115
|
+
className?: string;
|
|
116
|
+
/**
|
|
117
|
+
* 自定义样式(作用于最外层容器)
|
|
118
|
+
*/
|
|
119
|
+
style?: CSSProperties;
|
|
120
|
+
/**
|
|
121
|
+
* 资源列表;每项至少包含 id、x、y
|
|
122
|
+
*/
|
|
123
|
+
items: T[];
|
|
124
|
+
/**
|
|
125
|
+
* 每个资源项的渲染函数;内容与样式由调用方完全控制
|
|
126
|
+
*/
|
|
127
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* 指定每项的唯一 key,默认使用 item.id
|
|
130
|
+
*/
|
|
131
|
+
rowKey?: string | ((item: T, index: number) => string);
|
|
132
|
+
/**
|
|
133
|
+
* 底层(地图层)配置:背景、网格、padding、gap、吸附
|
|
134
|
+
*/
|
|
135
|
+
mapLayer?: FloorMapLayerConfig;
|
|
136
|
+
/**
|
|
137
|
+
* 每格像素尺寸(itemUnit 为 cell 时:逻辑 1 单位对应的像素;为 pixel 时:缺省宽高的默认像素)
|
|
138
|
+
* @default 64
|
|
139
|
+
*/
|
|
140
|
+
cellSize?: number;
|
|
141
|
+
/**
|
|
142
|
+
* item 坐标与尺寸单位:cell 格子数,pixel 像素
|
|
143
|
+
* @default 'cell'
|
|
144
|
+
*/
|
|
145
|
+
itemUnit?: FloorMapItemUnit;
|
|
146
|
+
/**
|
|
147
|
+
* 布局模式:grid 规则网格,free 完全按坐标
|
|
148
|
+
* @default 'free'
|
|
149
|
+
*/
|
|
150
|
+
layoutMode?: FloorMapLayoutMode;
|
|
151
|
+
/**
|
|
152
|
+
* 规则网格时的配置(列数等)
|
|
153
|
+
*/
|
|
154
|
+
gridLayout?: FloorMapGridLayoutConfig;
|
|
155
|
+
/**
|
|
156
|
+
* 缩放配置
|
|
157
|
+
*/
|
|
158
|
+
zoom?: FloorMapZoomConfig;
|
|
159
|
+
/**
|
|
160
|
+
* 平移配置
|
|
161
|
+
*/
|
|
162
|
+
pan?: FloorMapPanConfig;
|
|
163
|
+
/**
|
|
164
|
+
* 视图控制按钮显隐
|
|
165
|
+
*/
|
|
166
|
+
controls?: FloorMapControlsConfig;
|
|
167
|
+
/**
|
|
168
|
+
* 是否开启 hover 高亮或 hover 事件,默认 true
|
|
169
|
+
*/
|
|
170
|
+
enableHover?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* 资源项点击回调
|
|
173
|
+
*/
|
|
174
|
+
onItemClick?: (item: T, index: number, event: ReactMouseEvent<HTMLElement>) => void;
|
|
175
|
+
/**
|
|
176
|
+
* 资源项鼠标进入
|
|
177
|
+
*/
|
|
178
|
+
onItemHover?: (item: T, index: number, event: ReactMouseEvent<HTMLElement>) => void;
|
|
179
|
+
/**
|
|
180
|
+
* 资源项鼠标离开
|
|
181
|
+
*/
|
|
182
|
+
onItemLeave?: (item: T, index: number, event: ReactMouseEvent<HTMLElement>) => void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* PisellFloorMapLayout Ref 方法
|
|
186
|
+
* @description 供外部调用缩放、复位、区域定位等
|
|
187
|
+
*/
|
|
188
|
+
export interface PisellFloorMapLayoutRef {
|
|
189
|
+
/** 放大 */
|
|
190
|
+
zoomIn: () => void;
|
|
191
|
+
/** 缩小 */
|
|
192
|
+
zoomOut: () => void;
|
|
193
|
+
/** 复位到默认缩放与位置 */
|
|
194
|
+
reset: () => void;
|
|
195
|
+
/** 区域定位:使所有 items 落在视口内 */
|
|
196
|
+
fitBounds: () => void;
|
|
197
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/pisellFloorMapLayout/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type { PisellSingleLineTextProps, PisellLongTextProps, PisellNumberProps,
|
|
|
14
14
|
* <PisellMetrics.MetricCard title="Total Sales" value={1580} />
|
|
15
15
|
*/
|
|
16
16
|
export { default as PisellMetrics } from './components/PisellMetrics';
|
|
17
|
-
export type { PisellMetricCardProps, PisellStatisticProps } from './components/PisellMetrics';
|
|
17
|
+
export type { PisellMetricCardProps, PisellStatisticProps, } from './components/PisellMetrics';
|
|
18
18
|
/**
|
|
19
19
|
* PisellLayouts - 布局组件命名空间
|
|
20
20
|
* @example
|
|
@@ -22,7 +22,7 @@ export type { PisellMetricCardProps, PisellStatisticProps } from './components/P
|
|
|
22
22
|
* <PisellLayouts.BasicGrid columns={3}>{children}</PisellLayouts.BasicGrid>
|
|
23
23
|
*/
|
|
24
24
|
export { default as PisellLayouts } from './components/PisellLayouts';
|
|
25
|
-
export type { PisellBasicGridProps, PisellScrollViewProps, PisellLayoutProps, CompoundedComponent, PisellRowProps, } from './components/PisellLayouts';
|
|
25
|
+
export type { PisellBasicGridProps, PisellScrollViewProps, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef, PisellLayoutProps, CompoundedComponent, PisellRowProps, } from './components/PisellLayouts';
|
|
26
26
|
export { Affix, Alert, Anchor, Avatar, Breadcrumb, Card, Carousel, Col, ColorPicker, Descriptions, Divider, Empty, Grid, InputNumber, Mentions, Menu, Pagination, Popconfirm, Popover, Progress, Rate, Result, Row, Space, Spin, Statistic, Steps, Switch, Tag, Timeline, Tooltip, Transfer, Tree, message, notification, version, } from 'antd';
|
|
27
27
|
export { default as AutoComplete } from './components/auto-complete';
|
|
28
28
|
export { default as AutoCompleteNumber } from './components/auto-complete-number';
|
|
@@ -114,6 +114,7 @@ export { default as PisellRow } from './components/pisellRow';
|
|
|
114
114
|
export { default as Div } from './components/div';
|
|
115
115
|
export { default as PisellBasicGrid } from './components/PisellBasicGrid';
|
|
116
116
|
export { default as PisellScrollView } from './components/PisellScrollView';
|
|
117
|
+
export { PisellFloorMapLayout } from './components/pisellFloorMapLayout';
|
|
117
118
|
export { default as PisellViewGrid } from './components/pisellViewGrid';
|
|
118
119
|
export { default as Table } from './components/table';
|
|
119
120
|
export { default as PisellGridView } from './components/pisellGridPro/GridView';
|
|
@@ -143,7 +144,7 @@ export { default as CropPhoto } from './components/cropPhoto';
|
|
|
143
144
|
export { default as PisellUpload } from './components/pisellUpload';
|
|
144
145
|
export { default as Translation } from './components/translation';
|
|
145
146
|
export { PisellLookup } from './components/pisellLookup';
|
|
146
|
-
export type { PisellLookupProps, PisellLookupRef } from './components/pisellLookup';
|
|
147
|
+
export type { PisellLookupProps, PisellLookupRef, } from './components/pisellLookup';
|
|
147
148
|
export { PisellFind } from './components/pisellFind';
|
|
148
149
|
export type { PisellFindProps, PisellFindRef } from './components/pisellFind';
|
|
149
150
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
package/lib/index.js
CHANGED
|
@@ -146,6 +146,7 @@ __export(src_exports, {
|
|
|
146
146
|
PisellFilter: () => import_pisellFilter.default,
|
|
147
147
|
PisellFind: () => import_pisellFind.PisellFind,
|
|
148
148
|
PisellFloatingPanel: () => import_pisellFloatingPanel.default,
|
|
149
|
+
PisellFloorMapLayout: () => import_pisellFloorMapLayout.PisellFloorMapLayout,
|
|
149
150
|
PisellFooter: () => import_footer.default,
|
|
150
151
|
PisellGoodPassCard: () => import_pisellGoodPassCard.default,
|
|
151
152
|
PisellGridPro: () => import_pisellGridPro.default,
|
|
@@ -344,6 +345,7 @@ var import_pisellRow = __toESM(require("./components/pisellRow"));
|
|
|
344
345
|
var import_div = __toESM(require("./components/div"));
|
|
345
346
|
var import_PisellBasicGrid = __toESM(require("./components/PisellBasicGrid"));
|
|
346
347
|
var import_PisellScrollView = __toESM(require("./components/PisellScrollView"));
|
|
348
|
+
var import_pisellFloorMapLayout = require("./components/pisellFloorMapLayout");
|
|
347
349
|
var import_pisellViewGrid = __toESM(require("./components/pisellViewGrid"));
|
|
348
350
|
var import_table = __toESM(require("./components/table"));
|
|
349
351
|
var import_GridView = __toESM(require("./components/pisellGridPro/GridView"));
|
|
@@ -570,6 +572,7 @@ var import_usePisellConfig = __toESM(require("./components/pisell-config-provide
|
|
|
570
572
|
PisellFilter,
|
|
571
573
|
PisellFind,
|
|
572
574
|
PisellFloatingPanel,
|
|
575
|
+
PisellFloorMapLayout,
|
|
573
576
|
PisellFooter,
|
|
574
577
|
PisellGoodPassCard,
|
|
575
578
|
PisellGridPro,
|
|
@@ -306,6 +306,9 @@ export const createFormItemSchema = (
|
|
|
306
306
|
componentName = 'Translation';
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
// 注入默认值
|
|
310
|
+
props.defaultValue = defaultValue;
|
|
311
|
+
|
|
309
312
|
// 获取选项配置
|
|
310
313
|
const dataSourceConfig = (uiSchema as any)?.['x-data-source'] || item?.schema?.['x-data-source'];
|
|
311
314
|
const recordSchemaConfig = (uiSchema as any)?.['x-record-schema'] || item?.schema?.['x-record-schema'];
|