@pisell/materials 6.11.19 → 6.11.20
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.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/PisellCards/components/GraphicTextCard/types.d.ts +290 -0
- package/es/components/PisellCards/components/TextCard/TextCard.d.ts +8 -0
- package/es/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +26 -0
- package/es/components/PisellCards/components/TextCard/components/TextContent.d.ts +21 -0
- package/es/components/PisellCards/components/TextCard/types.d.ts +270 -0
- package/es/components/PisellCards/index.d.ts +0 -1
- package/es/components/PisellFields/index.d.ts +0 -1
- package/es/components/PisellLayouts/index.d.ts +0 -1
- package/es/components/PisellMetrics/index.d.ts +0 -1
- package/es/components/PisellSteps/PisellSteps.d.ts +14 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +4 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -2
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +15 -16
- package/es/components/date-picker/index.d.ts +0 -1
- package/es/components/drag-sort-tree/index.d.ts +5 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/login-and-register/index.d.ts +82 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
- package/es/components/pisellEmpty/index.d.ts +19 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +48 -0
- package/es/components/pisellGridPro/index.d.ts +4 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
- package/es/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
- package/es/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
- package/es/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/es/components/pisellModal/components/index.d.ts +0 -1
- package/es/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
- package/es/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
- package/es/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
- package/es/components/pisellTimeNavigator/types.d.ts +160 -0
- package/es/components/pisellTimeNavigator/utils/index.d.ts +30 -0
- package/es/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +95 -0
- package/es/components/select-time/index.js +1 -0
- package/es/components/table/Actions/component/ViewMode/index.d.ts +9 -0
- package/es/components/table/Table/fields/date/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +2 -3
- package/es/components/table/Table/fields/link/index.d.ts +0 -1
- package/es/components/table/Table/fields/number/index.d.ts +0 -1
- package/es/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/es/components/table/Table/fields/search/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/types.d.ts +268 -0
- package/es/components/versionModal/index.d.ts +23 -0
- package/es/hooks/useResponsive.d.ts +1 -1
- package/lib/components/PisellCards/components/GraphicTextCard/types.d.ts +290 -0
- package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +8 -0
- package/lib/components/PisellCards/components/TextCard/components/BadgeWrapper.d.ts +26 -0
- package/lib/components/PisellCards/components/TextCard/components/TextContent.d.ts +21 -0
- package/lib/components/PisellCards/components/TextCard/types.d.ts +270 -0
- package/lib/components/PisellCards/index.d.ts +0 -1
- package/lib/components/PisellFields/index.d.ts +0 -1
- package/lib/components/PisellLayouts/index.d.ts +0 -1
- package/lib/components/PisellMetrics/index.d.ts +0 -1
- package/lib/components/PisellSteps/PisellSteps.d.ts +14 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +4 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -2
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +15 -16
- package/lib/components/date-picker/index.d.ts +0 -1
- package/lib/components/drag-sort-tree/index.d.ts +5 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/login-and-register/index.d.ts +82 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +0 -1
- package/lib/components/pisellEmpty/index.d.ts +19 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +48 -0
- package/lib/components/pisellGridPro/index.d.ts +4 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
- package/lib/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
- package/lib/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
- package/lib/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/lib/components/pisellModal/components/index.d.ts +0 -1
- package/lib/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
- package/lib/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
- package/lib/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
- package/lib/components/pisellTimeNavigator/types.d.ts +160 -0
- package/lib/components/pisellTimeNavigator/utils/index.d.ts +30 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +95 -0
- package/lib/components/select-time/index.js +1 -0
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +9 -0
- package/lib/components/table/Table/fields/date/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +2 -3
- package/lib/components/table/Table/fields/link/index.d.ts +0 -1
- package/lib/components/table/Table/fields/number/index.d.ts +0 -1
- package/lib/components/table/Table/fields/numberRange/index.d.ts +0 -1
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +0 -1
- package/lib/components/table/Table/fields/search/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/types.d.ts +268 -0
- package/lib/components/versionModal/index.d.ts +23 -0
- package/lib/hooks/useResponsive.d.ts +1 -1
- package/lowcode/floor-map-image-element/meta.ts +1 -1
- package/lowcode/floor-map-layout-provider/meta.ts +1 -1
- package/lowcode/pisell-floor-map-layout/meta.ts +1 -1
- package/lowcode/render-figma-style-round-table-card/meta.ts +1 -1
- package/lowcode/render-figma-style-table-card/meta.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
export declare type PisellHierarchicalSummaryListKey = React.Key;
|
|
4
|
+
export interface PisellHierarchicalSummaryListItem {
|
|
5
|
+
/**
|
|
6
|
+
* 行标题。最小字段(必填)
|
|
7
|
+
*/
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* 行数值。允许 ReactNode(string/number/组合展示)。
|
|
11
|
+
* 若不传且开启聚合,可能由 children 聚合得到。
|
|
12
|
+
*/
|
|
13
|
+
value?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* 子级数据(无限层级递归)
|
|
16
|
+
*/
|
|
17
|
+
children?: PisellHierarchicalSummaryListItem[];
|
|
18
|
+
/**
|
|
19
|
+
* 可选:稳定 key(推荐传入以保证展开态稳定)。
|
|
20
|
+
* 不传时组件会基于层级路径生成 key。
|
|
21
|
+
*/
|
|
22
|
+
key?: PisellHierarchicalSummaryListKey;
|
|
23
|
+
/**
|
|
24
|
+
* 可选:是否隐藏该项
|
|
25
|
+
*/
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 可选:排序权重,值越小越靠前
|
|
29
|
+
*/
|
|
30
|
+
order?: number;
|
|
31
|
+
/**
|
|
32
|
+
* 可选:条目数提示(如 "N items" / "N 条"),允许 ReactNode
|
|
33
|
+
*/
|
|
34
|
+
itemsCount?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* 可选:信息提示 tooltip 内容(hover 触达)
|
|
37
|
+
*/
|
|
38
|
+
infoTooltip?: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* 可选:右侧 value 后附加轻量操作(tag/pill/button 等)
|
|
41
|
+
*/
|
|
42
|
+
extra?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* 可选:覆盖当前行样式
|
|
45
|
+
*/
|
|
46
|
+
rowStyle?: CSSProperties;
|
|
47
|
+
/**
|
|
48
|
+
* 可选:覆盖当前行类名
|
|
49
|
+
*/
|
|
50
|
+
rowClassName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 可选:自定义展开内容。若设置,行可展开且展开后渲染此内容(不再渲染 children 列表)。
|
|
53
|
+
* 用于在列表中嵌入 Collapse 等自定义区块。
|
|
54
|
+
*/
|
|
55
|
+
expandedContent?: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export interface PisellHierarchicalSummaryListLevelTextStyle {
|
|
58
|
+
fontSize?: number | string;
|
|
59
|
+
fontWeight?: number | string;
|
|
60
|
+
color?: string;
|
|
61
|
+
/** 行高,如 24 或 '24px' */
|
|
62
|
+
lineHeight?: number | string;
|
|
63
|
+
}
|
|
64
|
+
export interface PisellHierarchicalSummaryListIconStyle {
|
|
65
|
+
/** 图标尺寸(px),用于 fontSize 或宽高一致时的边长) */
|
|
66
|
+
size?: number;
|
|
67
|
+
color?: string;
|
|
68
|
+
/** 图标容器宽(px),不传则用 size */
|
|
69
|
+
width?: number;
|
|
70
|
+
/** 图标容器高(px),不传则用 size */
|
|
71
|
+
height?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface PisellHierarchicalSummaryListDividerStyle {
|
|
74
|
+
show?: boolean;
|
|
75
|
+
color?: string;
|
|
76
|
+
style?: 'solid' | 'dashed' | 'dotted';
|
|
77
|
+
}
|
|
78
|
+
export interface PisellHierarchicalSummaryListLevelConfig {
|
|
79
|
+
/**
|
|
80
|
+
* 层级缩进(px)。不传则继承全局 indent 规则。
|
|
81
|
+
*/
|
|
82
|
+
indent?: number;
|
|
83
|
+
/**
|
|
84
|
+
* 是否显示 "·" 分隔符(标题区元信息前的点)
|
|
85
|
+
*/
|
|
86
|
+
showDotSeparator?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 层级内分割线
|
|
89
|
+
*/
|
|
90
|
+
divider?: PisellHierarchicalSummaryListDividerStyle;
|
|
91
|
+
/**
|
|
92
|
+
* 行容器样式(背景/边框/padding/圆角/阴影等)
|
|
93
|
+
*/
|
|
94
|
+
rowStyle?: CSSProperties;
|
|
95
|
+
/**
|
|
96
|
+
* 行容器类名
|
|
97
|
+
*/
|
|
98
|
+
rowClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* 标题文本样式
|
|
101
|
+
*/
|
|
102
|
+
labelTextStyle?: PisellHierarchicalSummaryListLevelTextStyle;
|
|
103
|
+
/**
|
|
104
|
+
* 数值文本样式
|
|
105
|
+
*/
|
|
106
|
+
valueTextStyle?: PisellHierarchicalSummaryListLevelTextStyle;
|
|
107
|
+
/**
|
|
108
|
+
* info icon 样式(size/color)
|
|
109
|
+
*/
|
|
110
|
+
infoIconStyle?: PisellHierarchicalSummaryListIconStyle;
|
|
111
|
+
/**
|
|
112
|
+
* 展开/收起箭头 icon 样式(size/color)
|
|
113
|
+
*/
|
|
114
|
+
expandIconStyle?: PisellHierarchicalSummaryListIconStyle;
|
|
115
|
+
/**
|
|
116
|
+
* 行内元信息样式(如 "·"、N items、info icon 的文案颜色/字号等)
|
|
117
|
+
*/
|
|
118
|
+
metaTextStyle?: PisellHierarchicalSummaryListLevelTextStyle;
|
|
119
|
+
}
|
|
120
|
+
export declare type PisellHierarchicalSummaryListAggregateMode = 'none' | 'sum';
|
|
121
|
+
export interface PisellHierarchicalSummaryListAggregateConfig {
|
|
122
|
+
/**
|
|
123
|
+
* 聚合模式
|
|
124
|
+
* - none: 不聚合
|
|
125
|
+
* - sum: 对子级 number 值求和(或使用 getNumberValue 提取)
|
|
126
|
+
* @default 'none'
|
|
127
|
+
*/
|
|
128
|
+
mode?: PisellHierarchicalSummaryListAggregateMode;
|
|
129
|
+
/**
|
|
130
|
+
* 从条目提取 number 值,用于 sum 聚合。
|
|
131
|
+
* 默认:若 item.value 是 number,则使用该值;否则忽略。
|
|
132
|
+
*/
|
|
133
|
+
getNumberValue?: (item: PisellHierarchicalSummaryListItem) => number | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* 聚合结果格式化(sum 输出到 value 区)
|
|
136
|
+
*/
|
|
137
|
+
format?: (sum: number, ctx: {
|
|
138
|
+
item: PisellHierarchicalSummaryListItem;
|
|
139
|
+
level: number;
|
|
140
|
+
}) => React.ReactNode;
|
|
141
|
+
}
|
|
142
|
+
export interface PisellHierarchicalSummaryListRenderContext {
|
|
143
|
+
level: number;
|
|
144
|
+
pathKeys: PisellHierarchicalSummaryListKey[];
|
|
145
|
+
expanded: boolean;
|
|
146
|
+
hasChildren: boolean;
|
|
147
|
+
aggregatedValue?: React.ReactNode;
|
|
148
|
+
}
|
|
149
|
+
export interface PisellHierarchicalSummaryListProps {
|
|
150
|
+
/**
|
|
151
|
+
* 数据源
|
|
152
|
+
*/
|
|
153
|
+
items: PisellHierarchicalSummaryListItem[];
|
|
154
|
+
/**
|
|
155
|
+
* 展开项 keys(受控)
|
|
156
|
+
*/
|
|
157
|
+
expandedKeys?: PisellHierarchicalSummaryListKey[];
|
|
158
|
+
/**
|
|
159
|
+
* 默认展开项 keys(非受控)
|
|
160
|
+
*/
|
|
161
|
+
defaultExpandedKeys?: PisellHierarchicalSummaryListKey[];
|
|
162
|
+
/**
|
|
163
|
+
* 默认展开层级(非受控初始化)。0 表示只展示 L1(不默认展开子级)。
|
|
164
|
+
* @default 0
|
|
165
|
+
*/
|
|
166
|
+
defaultExpandedLevel?: number;
|
|
167
|
+
/**
|
|
168
|
+
* 展开项变化回调
|
|
169
|
+
*/
|
|
170
|
+
onExpandedKeysChange?: (keys: PisellHierarchicalSummaryListKey[]) => void;
|
|
171
|
+
/**
|
|
172
|
+
* 手风琴模式:同一层级下仅允许一个子项展开
|
|
173
|
+
* @default false
|
|
174
|
+
*/
|
|
175
|
+
accordion?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* 最大渲染层级(从 1 开始)。超过层级仍保留行,但不再渲染 children。
|
|
178
|
+
*/
|
|
179
|
+
maxRenderLevel?: number;
|
|
180
|
+
/**
|
|
181
|
+
* 最大可展开层级(从 1 开始)。超过层级不显示展开箭头。
|
|
182
|
+
*/
|
|
183
|
+
maxExpandLevel?: number;
|
|
184
|
+
/**
|
|
185
|
+
* 全局缩进(px),作用于 L2+;也可通过 levelConfig 覆盖。
|
|
186
|
+
* @default 16
|
|
187
|
+
*/
|
|
188
|
+
indent?: number;
|
|
189
|
+
/**
|
|
190
|
+
* 行间距(px)
|
|
191
|
+
* @default 8
|
|
192
|
+
*/
|
|
193
|
+
rowGap?: number;
|
|
194
|
+
/**
|
|
195
|
+
* 容器内边距(px 或 CSS 值),不传则使用 less 默认 20px
|
|
196
|
+
*/
|
|
197
|
+
padding?: number | string;
|
|
198
|
+
/**
|
|
199
|
+
* 行内间距(px),用于 1:1 复刻设计稿
|
|
200
|
+
* - row: 行内左右两栏间距
|
|
201
|
+
* - rowLeft: 左侧 label 与 meta(· / N items)间距
|
|
202
|
+
* - meta: meta 内 dot / items-count / info 间距
|
|
203
|
+
* - rowRight: 右侧 value 与 extra / 展开图标间距
|
|
204
|
+
*/
|
|
205
|
+
gaps?: {
|
|
206
|
+
row?: number;
|
|
207
|
+
rowLeft?: number;
|
|
208
|
+
meta?: number;
|
|
209
|
+
rowRight?: number;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* 按层级配置样式与功能开关(key 为 level,从 1 开始)
|
|
213
|
+
*/
|
|
214
|
+
levelConfig?: Record<number, PisellHierarchicalSummaryListLevelConfig>;
|
|
215
|
+
/**
|
|
216
|
+
* 自定义渲染 label
|
|
217
|
+
*/
|
|
218
|
+
renderLabel?: (item: PisellHierarchicalSummaryListItem, ctx: PisellHierarchicalSummaryListRenderContext) => React.ReactNode;
|
|
219
|
+
/**
|
|
220
|
+
* 自定义渲染 value
|
|
221
|
+
*/
|
|
222
|
+
renderValue?: (item: PisellHierarchicalSummaryListItem, ctx: PisellHierarchicalSummaryListRenderContext) => React.ReactNode;
|
|
223
|
+
/**
|
|
224
|
+
* 自定义 key 生成(当 item.key 不存在时使用)
|
|
225
|
+
*/
|
|
226
|
+
getKey?: (item: PisellHierarchicalSummaryListItem, ctx: {
|
|
227
|
+
level: number;
|
|
228
|
+
index: number;
|
|
229
|
+
parentPathKeys: PisellHierarchicalSummaryListKey[];
|
|
230
|
+
}) => PisellHierarchicalSummaryListKey;
|
|
231
|
+
/**
|
|
232
|
+
* 聚合配置:支持内置或外部传入
|
|
233
|
+
*/
|
|
234
|
+
aggregate?: PisellHierarchicalSummaryListAggregateConfig;
|
|
235
|
+
/**
|
|
236
|
+
* 根节点类名
|
|
237
|
+
*/
|
|
238
|
+
className?: string;
|
|
239
|
+
/**
|
|
240
|
+
* 根节点样式
|
|
241
|
+
*/
|
|
242
|
+
style?: CSSProperties;
|
|
243
|
+
/**
|
|
244
|
+
* 是否渲染根节点 div。为 false 时只渲染内部内容(用于外层用同一 DOM 包裹列表与其它区块)。
|
|
245
|
+
* @default true
|
|
246
|
+
*/
|
|
247
|
+
renderRoot?: boolean;
|
|
248
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BackgroundLayerProps {
|
|
3
|
+
orientation: 'horizontal' | 'vertical';
|
|
4
|
+
/** 过去时间淡化色 */
|
|
5
|
+
pastTimeFade?: string;
|
|
6
|
+
/** 营业时间区间 [startPx, endPx],用于视觉高亮 */
|
|
7
|
+
businessHoursPx?: [number, number];
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 背景区间层:营业时间高亮、过去时间淡化等(当前时间渐变已拆为独立块,见 axis-wrap 内 .pisell-time-navigator-current-gradient)
|
|
13
|
+
*/
|
|
14
|
+
export declare function BackgroundLayer({ orientation, pastTimeFade, businessHoursPx, className, style, }: BackgroundLayerProps): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface UseDragInertiaOptions {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
orientation: 'horizontal' | 'vertical';
|
|
4
|
+
getScrollContainer: () => HTMLElement | null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 惯性滚动:根据拖动末段速度在松手后继续滚动并衰减
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDragInertia(options: UseDragInertiaOptions): {
|
|
10
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
11
|
+
onPointerMove: (e: React.PointerEvent) => void;
|
|
12
|
+
onPointerUp: (e: React.PointerEvent) => void;
|
|
13
|
+
stopInertia: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeRangeOption } from '../types';
|
|
3
|
+
export interface UseTimeAxisOptions {
|
|
4
|
+
range?: TimeRangeOption;
|
|
5
|
+
stepMinutes: number;
|
|
6
|
+
referenceDate: Dayjs;
|
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
|
8
|
+
/** 横向时每格宽度(px),竖向时每格高度(px) */
|
|
9
|
+
cellSizePx: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TimeAxisState {
|
|
12
|
+
rangeStart: Dayjs;
|
|
13
|
+
rangeEnd: Dayjs;
|
|
14
|
+
ticks: Dayjs[];
|
|
15
|
+
/** 时间转主轴偏移(px) */
|
|
16
|
+
timeToOffset: (t: Dayjs) => number;
|
|
17
|
+
/** 主轴偏移(px)转时间(最近刻度,用于刻度对齐) */
|
|
18
|
+
offsetToTime: (offset: number) => Dayjs | null;
|
|
19
|
+
/** 主轴偏移(px)转时间(连续插值,用于拖动时按分钟步长显示) */
|
|
20
|
+
offsetToTimeContinuous: (offset: number) => Dayjs | null;
|
|
21
|
+
/** 主轴总长度(px) */
|
|
22
|
+
totalLengthPx: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 时间轴刻度与时间↔像素换算
|
|
26
|
+
*/
|
|
27
|
+
export declare function useTimeAxis(options: UseTimeAxisOptions): TimeAxisState;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
/**
|
|
4
|
+
* value / defaultValue 的 dayjs 兼容类型(组件内部统一为 Dayjs)
|
|
5
|
+
*/
|
|
6
|
+
export declare type TimeNavigatorValue = Dayjs | string | null;
|
|
7
|
+
/**
|
|
8
|
+
* 时间范围(HH:mm 或 HH:mm:ss,相对 referenceDate 的营业日)
|
|
9
|
+
* - 同自然日:如 08:00–22:00
|
|
10
|
+
* - 跨日:结束钟面 ≤ 开始时视为次日结束,如 02:01–02:00 表示至次日 02:00
|
|
11
|
+
*/
|
|
12
|
+
export interface TimeRangeOption {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 拖动/指示器模式
|
|
18
|
+
* - axis-moves:指示器固定视口中央,刻度移动(默认)
|
|
19
|
+
* - cursor-moves:刻度固定,指示器在轴上移动
|
|
20
|
+
*/
|
|
21
|
+
export declare type CursorMode = 'axis-moves' | 'cursor-moves';
|
|
22
|
+
/**
|
|
23
|
+
* 布局方向
|
|
24
|
+
*/
|
|
25
|
+
export declare type TimeNavigatorOrientation = 'horizontal' | 'vertical';
|
|
26
|
+
/**
|
|
27
|
+
* PisellTimeNavigator 组件 Props
|
|
28
|
+
*/
|
|
29
|
+
export interface PisellTimeNavigatorProps {
|
|
30
|
+
/**
|
|
31
|
+
* 当前选中时间(受控)。支持 dayjs 实例或可被 dayjs 解析的字符串
|
|
32
|
+
*/
|
|
33
|
+
value?: TimeNavigatorValue;
|
|
34
|
+
/**
|
|
35
|
+
* 时间变更回调(受控时必传)
|
|
36
|
+
*/
|
|
37
|
+
onChange?: (value: Dayjs) => void;
|
|
38
|
+
/**
|
|
39
|
+
* 默认选中时间(非受控)
|
|
40
|
+
*/
|
|
41
|
+
defaultValue?: TimeNavigatorValue;
|
|
42
|
+
/**
|
|
43
|
+
* 时间轴锚定到的日历日(startOf day)。`range` 的 HH:mm 均相对于该日。
|
|
44
|
+
* 不传则与历史一致:取「当天」0 点,避免跨天后刻度错位。
|
|
45
|
+
*/
|
|
46
|
+
referenceDate?: TimeNavigatorValue;
|
|
47
|
+
/**
|
|
48
|
+
* 是否 Realtime 模式:value 自动跟随系统当前时间更新
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
realtime?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 时间范围(支持跨日营业,见 {@link TimeRangeOption})。不传则默认当日 00:00–24:00
|
|
54
|
+
*/
|
|
55
|
+
range?: TimeRangeOption;
|
|
56
|
+
/**
|
|
57
|
+
* 吸附步长(分钟),如 15、30、60
|
|
58
|
+
* @default 15
|
|
59
|
+
*/
|
|
60
|
+
stepMinutes?: number;
|
|
61
|
+
/**
|
|
62
|
+
* 大刻度间隔(分钟),用于整点刻度;不传则与 stepMinutes 一致或 60
|
|
63
|
+
* @default 60
|
|
64
|
+
*/
|
|
65
|
+
majorStepMinutes?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 指示器/轴移动模式
|
|
68
|
+
* @default 'axis-moves'
|
|
69
|
+
*/
|
|
70
|
+
cursorMode?: CursorMode;
|
|
71
|
+
/**
|
|
72
|
+
* 横向或竖向展示
|
|
73
|
+
* @default 'horizontal'
|
|
74
|
+
*/
|
|
75
|
+
orientation?: TimeNavigatorOrientation;
|
|
76
|
+
/**
|
|
77
|
+
* 营业时间范围(视觉高亮,可选限制选择范围)
|
|
78
|
+
*/
|
|
79
|
+
businessHours?: TimeRangeOption;
|
|
80
|
+
/**
|
|
81
|
+
* 禁用时间段,禁止选中(点击/吸附到该区间无效)
|
|
82
|
+
*/
|
|
83
|
+
disabledRanges?: TimeRangeOption[];
|
|
84
|
+
/**
|
|
85
|
+
* 是否显示 Now 按钮(固定入口)
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
showNowButton?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 为 true 时禁止用户拖动/滚动时间轴、点击刻度改时间(仍随 `value` 程序性对齐视口;用于「跟随当前时刻」等只读轴)
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
userInteractionLocked?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 是否吸附到 step 刻度
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
snapToStep?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* 是否开启惯性滚动(拖动松手后减速)
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
inertia?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 过去时间淡化背景色(CSS 颜色值)
|
|
106
|
+
*/
|
|
107
|
+
pastTimeFade?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 容器样式覆盖
|
|
110
|
+
*/
|
|
111
|
+
containerStyle?: CSSProperties;
|
|
112
|
+
/**
|
|
113
|
+
* 刻度层样式覆盖
|
|
114
|
+
*/
|
|
115
|
+
scaleStyle?: CSSProperties;
|
|
116
|
+
/**
|
|
117
|
+
* 时间气泡/竖线样式覆盖(区分 realtime 时由组件内部应用主题色)
|
|
118
|
+
*/
|
|
119
|
+
cursorStyle?: CSSProperties;
|
|
120
|
+
/**
|
|
121
|
+
* Now 按钮样式覆盖
|
|
122
|
+
*/
|
|
123
|
+
nowButtonStyle?: CSSProperties;
|
|
124
|
+
/**
|
|
125
|
+
* 自定义类名
|
|
126
|
+
*/
|
|
127
|
+
className?: string;
|
|
128
|
+
/**
|
|
129
|
+
* 根节点自定义样式
|
|
130
|
+
*/
|
|
131
|
+
style?: CSSProperties;
|
|
132
|
+
/**
|
|
133
|
+
* dayjs locale
|
|
134
|
+
*/
|
|
135
|
+
locale?: string;
|
|
136
|
+
/**
|
|
137
|
+
* 时间气泡展示格式(dayjs format)
|
|
138
|
+
* @default 'HH:mm'
|
|
139
|
+
*/
|
|
140
|
+
timeFormat?: string;
|
|
141
|
+
/**
|
|
142
|
+
* 自定义 Now 按钮内容(覆盖默认文案与图标时使用)
|
|
143
|
+
*/
|
|
144
|
+
renderNowButton?: () => ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* 横向轴上与刻度槽位数一致的密度序列(任意正数,内部按最大值归一化折线高度)
|
|
147
|
+
*/
|
|
148
|
+
densitySeries?: number[];
|
|
149
|
+
/**
|
|
150
|
+
* 未传 `densitySeries` 时按 `referenceDate` 拉取;日历日变更会重新请求,过期响应丢弃
|
|
151
|
+
*/
|
|
152
|
+
loadDensity?: (params: {
|
|
153
|
+
referenceDate: Dayjs;
|
|
154
|
+
stepMinutes: number;
|
|
155
|
+
}) => Promise<number[]>;
|
|
156
|
+
/**
|
|
157
|
+
* 用户开始操作时间轴(拖轴、点刻度、键盘、拖指针等)时回调;用于上层关闭「跟随当前」等。
|
|
158
|
+
*/
|
|
159
|
+
onUserInteraction?: () => void;
|
|
160
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeNavigatorValue, TimeRangeOption } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 解析 value 为 Dayjs,无效则返回 null。
|
|
5
|
+
* 支持 dayjs 可解析的日期时间;纯时间字符串(如 '12:00'、'14:30')会基于 reference 的日期解析。
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseValue(value: TimeNavigatorValue, reference?: Dayjs): Dayjs | null;
|
|
8
|
+
/**
|
|
9
|
+
* 将 range 转为 [startDayjs, endDayjs](reference 为营业锚定日的 0 点)
|
|
10
|
+
* - 同日内:如 08:00–22:00
|
|
11
|
+
* - 跨日营业:结束钟面早于或等于开始(如 02:01–次日 02:00)时,end 解析为 reference 的次日同一时刻
|
|
12
|
+
*/
|
|
13
|
+
export declare function getRangeBounds(range: TimeRangeOption | undefined, reference: Dayjs): [Dayjs, Dayjs];
|
|
14
|
+
/**
|
|
15
|
+
* 将时间吸附到 step 分钟刻度(0、15、30、45 等):四舍五入到最近刻度。
|
|
16
|
+
*/
|
|
17
|
+
export declare function snapToStepMinutes(t: Dayjs, stepMinutes: number): Dayjs;
|
|
18
|
+
/**
|
|
19
|
+
* 判断时间是否落在任一禁用区间内(按绝对时间与区间 [start,end) 比较)
|
|
20
|
+
* 注:与主时间轴同 reference 的跨日 range 一致时需传入同一营业锚定日解析出的区间。
|
|
21
|
+
*/
|
|
22
|
+
export declare function isInDisabledRanges(t: Dayjs, disabledRanges: TimeRangeOption[] | undefined): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 在 [rangeStart, rangeEnd] 内按 stepMinutes 生成刻度时间列表(Dayjs)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getTicks(rangeStart: Dayjs, rangeEnd: Dayjs, stepMinutes: number): Dayjs[];
|
|
27
|
+
/**
|
|
28
|
+
* 横向时间轴「格」数量,与 useTimeAxis 中 totalLengthPx 算法一致(含尾格)
|
|
29
|
+
*/
|
|
30
|
+
export declare function getHorizontalAxisSlotCount(range: TimeRangeOption | undefined, referenceDate: Dayjs, stepMinutes: number): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* 赠品项数据结构
|
|
4
|
+
*/
|
|
5
|
+
export interface IGiftItem {
|
|
6
|
+
/** 图片 URL */
|
|
7
|
+
image?: string;
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** 唯一标识 */
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Gift 组件 Props
|
|
15
|
+
*/
|
|
16
|
+
export interface IGiftProps {
|
|
17
|
+
/** 是否显示赠品组件 */
|
|
18
|
+
isShow?: boolean;
|
|
19
|
+
/** 赠品总数量(可选择的总数) */
|
|
20
|
+
totalCount?: number;
|
|
21
|
+
/** 已选择的赠品列表 */
|
|
22
|
+
selectedGifts?: IGiftItem[];
|
|
23
|
+
/** 选择的赠品原始数据列表 */
|
|
24
|
+
_selectedOriginGifts?: any[];
|
|
25
|
+
/** 提示文本(未选择时显示) */
|
|
26
|
+
promptText?: string;
|
|
27
|
+
/** 点击事件回调 */
|
|
28
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
29
|
+
}
|