@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.
Files changed (183) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +4 -4
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +7 -7
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +24 -24
  9. package/es/components/PisellCards/index.d.ts +1 -0
  10. package/es/components/PisellFields/index.d.ts +1 -0
  11. package/es/components/PisellGroupView/PisellGroupView.d.ts +9 -0
  12. package/es/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
  13. package/es/components/PisellGroupView/index.d.ts +6 -0
  14. package/es/components/PisellGroupView/types.d.ts +124 -0
  15. package/es/components/PisellGroupView/utils/index.d.ts +20 -0
  16. package/es/components/PisellLayouts/index.d.ts +1 -0
  17. package/es/components/PisellMetrics/index.d.ts +1 -0
  18. package/es/components/PisellTabbar/PisellTabbar.js +3 -4
  19. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  20. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
  21. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  22. package/es/components/dataSourceComponents/fields/index.d.ts +5 -4
  23. package/es/components/date-picker/index.d.ts +1 -0
  24. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
  25. package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
  26. package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
  27. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
  28. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
  29. package/es/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
  30. package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
  31. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
  32. package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
  33. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
  34. package/es/components/pisellFloorMapLayout/index.d.ts +39 -0
  35. package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
  36. package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
  37. package/es/components/pisellFloorMapLayout/types.d.ts +769 -0
  38. package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
  39. package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
  40. package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
  41. package/es/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
  42. package/es/components/pisellModal/components/index.d.ts +1 -0
  43. package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
  44. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
  45. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
  46. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
  47. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
  48. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
  49. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
  50. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
  51. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
  52. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
  53. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
  54. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
  55. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
  56. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
  57. package/es/components/pisellRecordBoard/types.d.ts +899 -0
  58. package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
  59. package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
  60. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
  61. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -3
  62. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
  63. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +4 -5
  64. package/es/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
  65. package/es/components/productCard/cartSkuCard/components/inlineActions/index.js +3 -1
  66. package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
  67. package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
  68. package/es/components/productCard/cartSkuCard/components/weighing/index.js +12 -14
  69. package/es/components/productCard/cartSkuCard/index.d.ts +15 -0
  70. package/es/components/productCard/cartSkuCard/index.less +8 -1
  71. package/es/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
  72. package/es/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
  73. package/es/components/productCard/lineItem/index.d.ts +72 -0
  74. package/es/components/table/Table/fields/date/index.d.ts +1 -0
  75. package/es/components/table/Table/fields/index.d.ts +3 -2
  76. package/es/components/table/Table/fields/link/index.d.ts +1 -0
  77. package/es/components/table/Table/fields/number/index.d.ts +1 -0
  78. package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
  79. package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
  80. package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
  81. package/es/components/table/Table/fields/search/index.d.ts +1 -0
  82. package/es/components/table/Table/fields/select/index.d.ts +1 -0
  83. package/es/components/table/Table/fields/text/index.d.ts +1 -0
  84. package/es/components/table/Table/fields/treeSelect/index.d.ts +1 -0
  85. package/es/components/table/Table/utils.d.ts +1 -1
  86. package/es/components/table/hooks/useTableSetting.d.ts +21 -0
  87. package/es/components/virtual-keyboard/Time/index.d.ts +14 -0
  88. package/es/components/virtual-keyboard/index.d.ts +25 -0
  89. package/es/hooks/useTranslationOriginal.d.ts +4 -0
  90. package/es/pisell-materials.tw.css +1 -1
  91. package/lib/components/PisellCards/index.d.ts +1 -0
  92. package/lib/components/PisellFields/index.d.ts +1 -0
  93. package/lib/components/PisellGroupView/PisellGroupView.d.ts +9 -0
  94. package/lib/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
  95. package/lib/components/PisellGroupView/index.d.ts +6 -0
  96. package/lib/components/PisellGroupView/types.d.ts +124 -0
  97. package/lib/components/PisellGroupView/utils/index.d.ts +20 -0
  98. package/lib/components/PisellLayouts/index.d.ts +1 -0
  99. package/lib/components/PisellMetrics/index.d.ts +1 -0
  100. package/lib/components/PisellTabbar/PisellTabbar.js +2 -2
  101. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  102. package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
  103. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  104. package/lib/components/dataSourceComponents/fields/index.d.ts +5 -4
  105. package/lib/components/date-picker/index.d.ts +1 -0
  106. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
  107. package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
  108. package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
  109. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
  110. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
  111. package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
  112. package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
  113. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
  114. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
  115. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
  116. package/lib/components/pisellFloorMapLayout/index.d.ts +39 -0
  117. package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
  118. package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
  119. package/lib/components/pisellFloorMapLayout/types.d.ts +769 -0
  120. package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
  121. package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
  122. package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
  123. package/lib/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
  124. package/lib/components/pisellModal/components/index.d.ts +1 -0
  125. package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
  126. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
  127. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
  128. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
  129. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
  130. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
  131. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
  132. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
  133. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
  134. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
  135. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
  136. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
  137. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
  138. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
  139. package/lib/components/pisellRecordBoard/types.d.ts +899 -0
  140. package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
  141. package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
  142. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
  143. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +1 -2
  144. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
  145. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +3 -6
  146. package/lib/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
  147. package/lib/components/productCard/cartSkuCard/components/inlineActions/index.js +2 -1
  148. package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
  149. package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
  150. package/lib/components/productCard/cartSkuCard/components/weighing/index.js +11 -14
  151. package/lib/components/productCard/cartSkuCard/index.d.ts +15 -0
  152. package/lib/components/productCard/cartSkuCard/index.less +8 -1
  153. package/lib/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
  154. package/lib/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
  155. package/lib/components/productCard/lineItem/index.d.ts +72 -0
  156. package/lib/components/table/Table/fields/date/index.d.ts +1 -0
  157. package/lib/components/table/Table/fields/index.d.ts +3 -2
  158. package/lib/components/table/Table/fields/link/index.d.ts +1 -0
  159. package/lib/components/table/Table/fields/number/index.d.ts +1 -0
  160. package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
  161. package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
  162. package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
  163. package/lib/components/table/Table/fields/search/index.d.ts +1 -0
  164. package/lib/components/table/Table/fields/select/index.d.ts +1 -0
  165. package/lib/components/table/Table/fields/text/index.d.ts +1 -0
  166. package/lib/components/table/Table/fields/treeSelect/index.d.ts +1 -0
  167. package/lib/components/table/Table/utils.d.ts +1 -1
  168. package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
  169. package/lib/components/virtual-keyboard/Time/index.d.ts +14 -0
  170. package/lib/components/virtual-keyboard/index.d.ts +25 -0
  171. package/lib/hooks/useTranslationOriginal.d.ts +4 -0
  172. package/lib/pisell-materials.tw.css +1 -1
  173. package/package.json +1 -1
  174. package/es/components/pisellLookup/PisellLookup.d.ts +0 -4
  175. package/es/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
  176. package/es/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
  177. package/es/components/pisellLookup/types.d.ts +0 -797
  178. package/es/components/pisellTimeRangeDisplay/index.d.ts +0 -3
  179. package/lib/components/pisellLookup/PisellLookup.d.ts +0 -4
  180. package/lib/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
  181. package/lib/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
  182. package/lib/components/pisellLookup/types.d.ts +0 -797
  183. package/lib/components/pisellTimeRangeDisplay/index.d.ts +0 -3
@@ -1,797 +0,0 @@
1
- import type React from 'react';
2
- /**
3
- * 触发器类型
4
- */
5
- export declare type TriggerType = 'input' | 'button' | 'icon' | 'text';
6
- /**
7
- * 展示类型
8
- */
9
- export declare type DisplayType = 'inline' | 'popup' | 'modal' | 'drawer' | 'detached';
10
- /**
11
- * 搜索模式
12
- */
13
- export declare type SearchMode = 'realtime' | 'confirm';
14
- /**
15
- * 搜索来源
16
- */
17
- export declare type LookupSearchSource = 'keyboard' | 'scan';
18
- /**
19
- * 输入框尺寸
20
- */
21
- export declare type SizeType = 'large' | 'middle' | 'small';
22
- /**
23
- * PisellLookup Ref 接口
24
- */
25
- export interface PisellLookupRef {
26
- /**
27
- * 打开搜索
28
- */
29
- open: () => void;
30
- /**
31
- * 关闭搜索
32
- */
33
- close: () => void;
34
- /**
35
- * 获取当前关键词
36
- */
37
- getKeyword: () => string;
38
- /**
39
- * 设置关键词
40
- */
41
- setKeyword: (keyword: string, source?: LookupSearchSource) => void;
42
- }
43
- /**
44
- * Drawer 位置
45
- */
46
- export declare type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
47
- /**
48
- * 输入栏插槽上下文
49
- *
50
- * 通过 `inputRender` 自定义「输入框」形态触发器时,组件会把内部已经接好的受控状态与回调
51
- * 透传给插槽。插槽只需把这些值绑定到自定义输入控件上,即可完全复用 PisellLookup 的
52
- * 搜索状态机(受控值 / 防抖实时搜索 / 确认搜索 / 历史 / inline·popup 聚焦展开等)。
53
- *
54
- * 仅在 `triggerType='input'`(或 modal/drawer 内置输入框)形态下生效;button/icon/text
55
- * 触发器不会调用 `inputRender`。
56
- */
57
- export interface LookupInputRenderContext {
58
- /** 当前关键词(受控值) */
59
- value: string;
60
- /** 占位符 */
61
- placeholder?: string;
62
- /** 是否禁用 */
63
- disabled?: boolean;
64
- /** 尺寸 */
65
- size?: SizeType;
66
- /** 是否处于加载态(透传自 PisellLookup 的 loading) */
67
- loading?: boolean;
68
- /** 输入变化:写回关键词(受控) */
69
- onChange: (value: string) => void;
70
- /** 确认搜索:回车 / 点击搜索按钮时调用,可显式传入当前值 */
71
- onConfirm: (value?: string) => void;
72
- /** 清除:清空关键词并恢复结果 */
73
- onClear: () => void;
74
- /** 扫码结果回填 */
75
- onScan?: (code: string) => void;
76
- /** 最近一次搜索来源,用于输入栏区分键盘输入与扫码结果态 */
77
- searchSource?: LookupSearchSource;
78
- /** 聚焦:inline/popup 形态用于展开结果容器 */
79
- onFocus?: () => void;
80
- /** 失焦:inline/popup 形态用于延迟关闭结果容器 */
81
- onBlur?: () => void;
82
- }
83
- /**
84
- * PisellLookup 组件 Props
85
- */
86
- export interface PisellLookupProps {
87
- /**
88
- * 是否渲染外部触发器;受控打开浮层时可关闭。
89
- * @default true
90
- */
91
- showTrigger?: boolean;
92
- /**
93
- * 预设触发器类型(与 trigger 互斥)
94
- * @default 'input'
95
- */
96
- triggerType?: TriggerType;
97
- /**
98
- * 自定义触发器(与 triggerType 互斥)
99
- * 传入任意 ReactNode 作为触发器,点击时打开搜索
100
- */
101
- trigger?: React.ReactNode;
102
- /**
103
- * 触发器文本(triggerType='text' 时有效)
104
- */
105
- triggerText?: string;
106
- /**
107
- * 触发器图标(triggerType='icon' 时有效)
108
- */
109
- triggerIcon?: React.ReactNode;
110
- /**
111
- * 按钮文本(triggerType='button' 时有效)
112
- * @default '搜索'
113
- */
114
- buttonText?: string;
115
- /**
116
- * 是否禁用
117
- * @default false
118
- */
119
- disabled?: boolean;
120
- /**
121
- * 占位符文本
122
- * @default '请输入搜索内容'
123
- */
124
- placeholder?: string;
125
- /**
126
- * 输入框尺寸
127
- * @default 'default'
128
- */
129
- size?: SizeType;
130
- /**
131
- * 是否显示前缀图标
132
- * @default false
133
- */
134
- showPrefixIcon?: boolean;
135
- /**
136
- * 前缀图标
137
- */
138
- prefixIcon?: React.ReactNode;
139
- /**
140
- * 输入框前置内容(透传给底层 antd Input 的 `addonBefore`)。
141
- *
142
- * 与输入框连成一体显示在左侧,例如在搜索框内嵌一个「搜索字段」Select。
143
- * 仅 `triggerType='input'` 形态生效。
144
- */
145
- addonBefore?: React.ReactNode;
146
- /**
147
- * 是否显示清除按钮
148
- * @default true
149
- */
150
- showClear?: boolean;
151
- /**
152
- * 是否显示确认触发按钮
153
- * @default true
154
- */
155
- showConfirmButton?: boolean;
156
- /**
157
- * 确认按钮文本
158
- * @default 'Lookup'
159
- */
160
- confirmButtonText?: string;
161
- /**
162
- * Modal 搜索栏关闭按钮文本
163
- * @default 'Close'
164
- */
165
- closeButtonText?: string;
166
- /**
167
- * 搜索触发模式
168
- * - realtime: 实时搜索(输入即触发)
169
- * - confirm: 确认触发(点击按钮或按 Enter 键触发)
170
- * 注意:如果 showConfirmButton=false,会自动使用 realtime 模式
171
- * @default 'realtime'
172
- */
173
- searchMode?: SearchMode;
174
- /**
175
- * 防抖时间(毫秒)
176
- * @default 300
177
- */
178
- debounceTime?: number;
179
- /**
180
- * 搜索关键词(受控)
181
- */
182
- value?: string;
183
- /**
184
- * 默认搜索关键词(非受控)
185
- */
186
- defaultValue?: string;
187
- /**
188
- * 关键词变化回调
189
- * @param value 当前关键词
190
- */
191
- onChange?: (value: string) => void;
192
- /**
193
- * 搜索触发回调
194
- * @param keyword 搜索关键词
195
- */
196
- onSearch?: (keyword: string) => void;
197
- /**
198
- * 是否允许重复确认同一个关键词。
199
- * 适用于提交失败后需要原值重试的场景;默认保持去重行为。
200
- * @default false
201
- */
202
- allowRepeatSearch?: boolean;
203
- /**
204
- * 是否显示扫码按钮
205
- * @default true
206
- */
207
- showScan?: boolean;
208
- /**
209
- * 扫码完成回调
210
- * @param code 扫码结果
211
- */
212
- onScan?: (code: string) => void;
213
- /**
214
- * 是否显示搜索历史
215
- * @default false
216
- */
217
- showHistory?: boolean;
218
- /**
219
- * 历史记录存储 key
220
- * @default 'pisell_lookup_history'
221
- */
222
- historyKey?: string;
223
- /**
224
- * 历史记录数量上限
225
- * @default 10
226
- */
227
- maxHistoryCount?: number;
228
- /**
229
- * 加载历史记录回调(用于自定义存储)
230
- * @returns 历史记录数组
231
- */
232
- onLoadHistory?: () => string[];
233
- /**
234
- * 保存历史记录回调(用于自定义存储)
235
- * @param history 历史记录数组
236
- */
237
- onSaveHistory?: (history: string[]) => void;
238
- /**
239
- * 自定义历史记录渲染
240
- * @param history 历史记录数组
241
- * @param onSelect 选择历史记录的回调
242
- * @returns 渲染内容
243
- */
244
- historyRender?: (history: string[], onSelect: (keyword: string) => void) => React.ReactNode;
245
- /**
246
- * 是否显示联想词
247
- * @default false
248
- */
249
- showSuggestions?: boolean;
250
- /**
251
- * 加载联想词回调
252
- * @param keyword 当前输入的关键词
253
- * @returns 联想词数组或 Promise
254
- */
255
- onLoadSuggestions?: (keyword: string) => Promise<string[]> | string[];
256
- /**
257
- * 自定义联想词渲染
258
- * @param suggestions 联想词数组
259
- * @param onSelect 选择联想词的回调
260
- * @returns 渲染内容
261
- */
262
- suggestionsRender?: (suggestions: string[], onSelect: (keyword: string) => void) => React.ReactNode;
263
- /**
264
- * 是否显示热门搜索
265
- * @default false
266
- */
267
- showHotWords?: boolean;
268
- /**
269
- * 加载热门搜索回调
270
- * @returns 热门搜索数组或 Promise
271
- */
272
- onLoadHotWords?: () => Promise<string[]> | string[];
273
- /**
274
- * 自定义热门搜索渲染
275
- * @param hotWords 热门搜索数组
276
- * @param onSelect 选择热门搜索的回调
277
- * @returns 渲染内容
278
- */
279
- hotWordsRender?: (hotWords: string[], onSelect: (keyword: string) => void) => React.ReactNode;
280
- /**
281
- * 结果展示方式
282
- * 如果不指定,将根据 triggerType 智能判断:
283
- * - triggerType='input' → 'inline'
284
- * - 其他 → 'modal'
285
- */
286
- displayType?: DisplayType;
287
- /**
288
- * 结果渲染函数
289
- * @param keyword 搜索关键词
290
- * @param onClose 关闭搜索的回调(可选)
291
- * @returns 渲染的结果内容
292
- */
293
- resultRender?: (keyword: string, onClose?: () => void) => React.ReactNode;
294
- /**
295
- * 是否显示加载状态
296
- * @default false
297
- */
298
- loading?: boolean;
299
- /**
300
- * 空状态渲染
301
- * @returns 空状态内容
302
- */
303
- emptyRender?: () => React.ReactNode;
304
- /**
305
- * Modal 宽度
306
- * @default 834
307
- */
308
- modalWidth?: number | string;
309
- /**
310
- * Modal 自定义样式
311
- */
312
- modalStyle?: React.CSSProperties;
313
- /**
314
- * Modal 是否使用容器原生的垂直居中布局。
315
- * @default false
316
- */
317
- modalCentered?: boolean;
318
- /** Modal 进出场动画名称。 */
319
- modalTransitionName?: string;
320
- /**
321
- * Modal 挂载节点
322
- * - HTMLElement: 挂载到指定的 DOM 节点
323
- * - () => HTMLElement: 返回挂载节点的函数
324
- * - false: 挂载到触发器的父节点
325
- * - undefined: 默认挂载到 document.body
326
- * @default undefined
327
- */
328
- getContainer?: HTMLElement | (() => HTMLElement) | false;
329
- /**
330
- * Drawer 宽度
331
- * @default 378
332
- */
333
- drawerWidth?: number | string;
334
- /** Drawer 高度;placement 为 top / bottom 时生效。 */
335
- drawerHeight?: number | string;
336
- /**
337
- * Drawer 位置
338
- * @default 'right'
339
- */
340
- drawerPlacement?: DrawerPlacement;
341
- /** Drawer 标题;传 null 可隐藏默认标题。 */
342
- drawerTitle?: React.ReactNode | null;
343
- /** 是否展示 Drawer 自带关闭按钮。 */
344
- drawerClosable?: boolean;
345
- /**
346
- * Popup 宽度
347
- */
348
- popupWidth?: number | string;
349
- /**
350
- * 容器自定义样式
351
- */
352
- containerStyle?: React.CSSProperties;
353
- /**
354
- * 容器自定义类名
355
- */
356
- containerClassName?: string;
357
- /**
358
- * 是否可见(受控)
359
- */
360
- visible?: boolean;
361
- /**
362
- * 默认是否可见(非受控)
363
- * @default false
364
- */
365
- defaultVisible?: boolean;
366
- /**
367
- * 可见性变化回调
368
- * @param visible 当前可见性
369
- */
370
- onVisibleChange?: (visible: boolean) => void;
371
- /**
372
- * 打开回调
373
- */
374
- onOpen?: () => void;
375
- /**
376
- * 关闭回调
377
- */
378
- onClose?: () => void;
379
- /**
380
- * 是否显示遮罩层(仅 Modal/Drawer)
381
- * @default false
382
- */
383
- mask?: boolean;
384
- /**
385
- * 点击遮罩是否关闭(仅 Modal/Drawer)
386
- * 注意:只有 mask=true 时此配置才生效
387
- * @default true
388
- */
389
- maskClosable?: boolean;
390
- /**
391
- * 关闭时是否清空关键词
392
- * @default false
393
- */
394
- clearOnClose?: boolean;
395
- /**
396
- * Modal/Drawer 打开后是否自动聚焦输入框
397
- * @default true
398
- */
399
- autoFocusOnOpen?: boolean;
400
- /**
401
- * 输入栏插槽
402
- *
403
- * 自定义「输入框」形态的触发器渲染。传入后会**替换内置 antd Input**,但完整复用
404
- * PisellLookup 的搜索状态机(受控值 / 实时·确认搜索 / 历史 / 容器形态)。
405
- * 仅 input 形态生效(含 modal/drawer 内置输入框),button/icon/text 触发器不受影响。
406
- *
407
- * @example
408
- * ```tsx
409
- * <PisellLookup
410
- * inputRender={(ctx) => (
411
- * <MyInput
412
- * value={ctx.value}
413
- * onChange={ctx.onChange}
414
- * onSearch={ctx.onConfirm}
415
- * />
416
- * )}
417
- * />
418
- * ```
419
- */
420
- inputRender?: (ctx: LookupInputRenderContext) => React.ReactNode;
421
- /** Modal / Drawer 内置搜索栏上方的自定义内容。 */
422
- headerRender?: React.ReactNode | (() => React.ReactNode);
423
- /**
424
- * 自定义类名
425
- */
426
- className?: string;
427
- /**
428
- * 自定义样式
429
- */
430
- style?: React.CSSProperties;
431
- /**
432
- * 层级
433
- */
434
- zIndex?: number;
435
- }
436
- /**
437
- * LookupTrigger Ref 接口
438
- */
439
- export interface LookupTriggerRef {
440
- /**
441
- * 聚焦到输入框
442
- */
443
- focus: () => void;
444
- /**
445
- * 选中输入框文字
446
- */
447
- select: () => void;
448
- }
449
- /**
450
- * LookupTrigger 组件 Props
451
- */
452
- export interface LookupTriggerProps {
453
- /**
454
- * 触发器类型
455
- */
456
- type?: TriggerType;
457
- /**
458
- * 自定义触发器
459
- */
460
- trigger?: React.ReactNode;
461
- /**
462
- * 触发器文本
463
- */
464
- triggerText?: string;
465
- /**
466
- * 触发器图标
467
- */
468
- triggerIcon?: React.ReactNode;
469
- /**
470
- * 按钮文本
471
- */
472
- buttonText?: string;
473
- /**
474
- * 是否禁用
475
- */
476
- disabled?: boolean;
477
- /**
478
- * 占位符
479
- */
480
- placeholder?: string;
481
- /**
482
- * 尺寸
483
- */
484
- size?: SizeType;
485
- /**
486
- * 是否显示前缀图标
487
- */
488
- showPrefixIcon?: boolean;
489
- /**
490
- * 前缀图标
491
- */
492
- prefixIcon?: React.ReactNode;
493
- /**
494
- * 输入框前置内容(透传给底层 antd Input 的 `addonBefore`)
495
- */
496
- addonBefore?: React.ReactNode;
497
- /**
498
- * 是否显示清除按钮
499
- */
500
- showClear?: boolean;
501
- /**
502
- * 是否显示确认按钮
503
- */
504
- showConfirmButton?: boolean;
505
- /**
506
- * 确认按钮文本
507
- */
508
- confirmButtonText?: string;
509
- /**
510
- * 是否显示扫码按钮
511
- */
512
- showScan?: boolean;
513
- /**
514
- * 当前值
515
- */
516
- value?: string;
517
- /**
518
- * 最近一次搜索来源
519
- */
520
- searchSource?: LookupSearchSource;
521
- /**
522
- * 值变化回调
523
- */
524
- onChange?: (value: string) => void;
525
- /**
526
- * 点击事件
527
- */
528
- onClick?: () => void;
529
- /**
530
- * 聚焦事件
531
- */
532
- onFocus?: () => void;
533
- /**
534
- * 确认触发回调
535
- */
536
- /** 确认搜索(回车或点击按钮);可传入当前输入值,受控下回车时传 input 当前值以保证历史能正确保存 */
537
- onConfirm?: (value?: string) => void;
538
- /**
539
- * 扫码回调
540
- */
541
- onScan?: (code: string) => void;
542
- /**
543
- * 清除回调
544
- */
545
- onClear?: () => void;
546
- /**
547
- * 失焦回调
548
- */
549
- onBlur?: () => void;
550
- /**
551
- * 是否自动聚焦
552
- */
553
- autoFocus?: boolean;
554
- /**
555
- * 加载态(透传给输入栏插槽 ctx.loading)
556
- */
557
- loading?: boolean;
558
- /**
559
- * 输入栏插槽:自定义 input 形态触发器渲染(仅 type='input' 生效)
560
- */
561
- inputRender?: (ctx: LookupInputRenderContext) => React.ReactNode;
562
- /**
563
- * 自定义类名
564
- */
565
- className?: string;
566
- /**
567
- * 自定义样式
568
- */
569
- style?: React.CSSProperties;
570
- }
571
- /**
572
- * LookupAuxiliary 组件 Props
573
- */
574
- export interface LookupAuxiliaryProps {
575
- /**
576
- * 当前关键词
577
- */
578
- keyword: string;
579
- /**
580
- * 是否显示搜索历史
581
- */
582
- showHistory?: boolean;
583
- /**
584
- * 搜索历史数组
585
- */
586
- history?: string[];
587
- /**
588
- * 是否显示联想词
589
- */
590
- showSuggestions?: boolean;
591
- /**
592
- * 联想词数组
593
- */
594
- suggestions?: string[];
595
- /**
596
- * 是否显示热门搜索
597
- */
598
- showHotWords?: boolean;
599
- /**
600
- * 热门搜索数组
601
- */
602
- hotWords?: string[];
603
- /**
604
- * 选择回调
605
- */
606
- onSelect?: (keyword: string) => void;
607
- /**
608
- * 删除历史记录回调
609
- */
610
- onRemoveHistory?: (keyword: string) => void;
611
- /**
612
- * 清除全部历史记录回调
613
- */
614
- onClearHistory?: () => void;
615
- /**
616
- * 自定义历史记录渲染
617
- */
618
- historyRender?: (history: string[], onSelect: (keyword: string) => void) => React.ReactNode;
619
- /**
620
- * 自定义联想词渲染
621
- */
622
- suggestionsRender?: (suggestions: string[], onSelect: (keyword: string) => void) => React.ReactNode;
623
- /**
624
- * 自定义热门搜索渲染
625
- */
626
- hotWordsRender?: (hotWords: string[], onSelect: (keyword: string) => void) => React.ReactNode;
627
- /**
628
- * 自定义类名
629
- */
630
- className?: string;
631
- /**
632
- * 自定义样式
633
- */
634
- style?: React.CSSProperties;
635
- }
636
- /**
637
- * LookupResultHost 组件 Props
638
- */
639
- export interface LookupResultHostProps {
640
- /**
641
- * 展示类型
642
- */
643
- displayType: DisplayType;
644
- /**
645
- * 是否可见
646
- */
647
- visible: boolean;
648
- /**
649
- * 关闭回调
650
- */
651
- onClose: () => void;
652
- /**
653
- * 子元素(输入区 + 辅助区 + 结果区)
654
- */
655
- children: React.ReactNode;
656
- /**
657
- * Modal 宽度
658
- */
659
- modalWidth?: number | string;
660
- /** Modal 是否垂直居中 */
661
- modalCentered?: boolean;
662
- /** Modal 进出场动画名称 */
663
- modalTransitionName?: string;
664
- /**
665
- * Modal 样式
666
- */
667
- modalStyle?: React.CSSProperties;
668
- /**
669
- * Modal 挂载节点
670
- */
671
- getContainer?: HTMLElement | (() => HTMLElement) | false;
672
- /**
673
- * Drawer 宽度
674
- */
675
- drawerWidth?: number | string;
676
- /** Drawer 高度 */
677
- drawerHeight?: number | string;
678
- /**
679
- * Drawer 位置
680
- */
681
- drawerPlacement?: DrawerPlacement;
682
- /** Drawer 标题 */
683
- drawerTitle?: React.ReactNode | null;
684
- /** 是否展示 Drawer 自带关闭按钮 */
685
- drawerClosable?: boolean;
686
- /**
687
- * Popup 宽度
688
- */
689
- popupWidth?: number | string;
690
- /**
691
- * 容器样式
692
- */
693
- containerStyle?: React.CSSProperties;
694
- /**
695
- * 容器类名
696
- */
697
- containerClassName?: string;
698
- /**
699
- * 是否显示遮罩层
700
- */
701
- mask?: boolean;
702
- /**
703
- * 点击遮罩是否关闭
704
- */
705
- maskClosable?: boolean;
706
- /**
707
- * 层级
708
- */
709
- zIndex?: number;
710
- /**
711
- * Modal/Drawer 打开后的回调
712
- */
713
- onAfterOpen?: () => void;
714
- }
715
- /**
716
- * SearchHistory 组件 Props
717
- */
718
- export interface SearchHistoryProps {
719
- /**
720
- * 历史记录数组
721
- */
722
- history: string[];
723
- /**
724
- * 选择历史记录回调
725
- */
726
- onSelect: (keyword: string) => void;
727
- /**
728
- * 删除历史记录回调
729
- */
730
- onRemove?: (keyword: string) => void;
731
- /**
732
- * 清除全部历史记录回调
733
- */
734
- onClear?: () => void;
735
- /**
736
- * 自定义渲染
737
- */
738
- render?: (history: string[], onSelect: (keyword: string) => void) => React.ReactNode;
739
- /**
740
- * 自定义类名
741
- */
742
- className?: string;
743
- /**
744
- * 自定义样式
745
- */
746
- style?: React.CSSProperties;
747
- }
748
- /**
749
- * SuggestWords 组件 Props
750
- */
751
- export interface SuggestWordsProps {
752
- /**
753
- * 联想词数组
754
- */
755
- suggestions: string[];
756
- /**
757
- * 选择联想词回调
758
- */
759
- onSelect: (keyword: string) => void;
760
- /**
761
- * 自定义渲染
762
- */
763
- render?: (suggestions: string[], onSelect: (keyword: string) => void) => React.ReactNode;
764
- /**
765
- * 自定义类名
766
- */
767
- className?: string;
768
- /**
769
- * 自定义样式
770
- */
771
- style?: React.CSSProperties;
772
- }
773
- /**
774
- * HotWords 组件 Props
775
- */
776
- export interface HotWordsProps {
777
- /**
778
- * 热门搜索数组
779
- */
780
- hotWords: string[];
781
- /**
782
- * 选择热门搜索回调
783
- */
784
- onSelect: (keyword: string) => void;
785
- /**
786
- * 自定义渲染
787
- */
788
- render?: (hotWords: string[], onSelect: (keyword: string) => void) => React.ReactNode;
789
- /**
790
- * 自定义类名
791
- */
792
- className?: string;
793
- /**
794
- * 自定义样式
795
- */
796
- style?: React.CSSProperties;
797
- }