@baishuyun/ui-base 6.7.2 → 6.8.2

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 (218) hide show
  1. package/dist/Amap/{Amap-Dnvu_pUP.js → Amap-BNnmSPnl.js} +1 -1
  2. package/dist/Amap/AmapCircle/index.js +4 -3
  3. package/dist/Amap/{AmapCircle-Wfn43qco.js → AmapCircle-BDW6pnNR.js} +1 -1
  4. package/dist/Amap/AmapMarker/index.js +5 -4
  5. package/dist/Amap/{AmapMarker-CMlzx_nj.js → AmapMarker-CdoPWdff.js} +2 -2
  6. package/dist/Amap/AmapMarkerCluster/index.js +5 -4
  7. package/dist/Amap/{AmapMarkerCluster-MDUfcIqP.js → AmapMarkerCluster-CSIxiVC5.js} +2 -2
  8. package/dist/Amap/AmapProvider/index.js +5 -4
  9. package/dist/Amap/{AmapProvider-CGedZdvQ.js → AmapProvider-Cwi6WOe0.js} +2 -2
  10. package/dist/Amap/hooks/index.js +3 -2
  11. package/dist/Amap/{hooks-DwRvpafb.js → hooks-DAN31s_-.js} +1 -1
  12. package/dist/Amap/index.js +11 -10
  13. package/dist/Calendar/{AllDaySection-Bd5Po_DI.js → AllDaySection-a96dIzs3.js} +4 -4
  14. package/dist/Calendar/{Calendar-Bs4S-6rW.js → Calendar-DnQrN8KB.js} +13 -13
  15. package/dist/Calendar/{CurrentTimeIndicator-twXtFHIp.js → CurrentTimeIndicator-CNKsVEXH.js} +1 -1
  16. package/dist/Calendar/{EventCard-CvEnWcKd.js → EventCard-B1LoBxth.js} +3 -3
  17. package/dist/Calendar/{TimeGrid-DPtU6Qvo.js → TimeGrid-DIw8oCqY.js} +2 -2
  18. package/dist/Calendar/context/index.js +2 -1
  19. package/dist/Calendar/index.js +21 -20
  20. package/dist/Calendar/subcomponents/AllDaySection/index.js +8 -7
  21. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -4
  22. package/dist/Calendar/subcomponents/EventCard/index.js +6 -5
  23. package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -3
  24. package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -3
  25. package/dist/Calendar/{theme-BRVmxhqD.js → theme-xnrMsnkg.js} +2 -2
  26. package/dist/Calendar/utils/index.js +4 -3
  27. package/dist/Calendar/utils/layout/index.js +3 -2
  28. package/dist/Calendar/utils/theme/index.js +2 -1
  29. package/dist/Card/{Card-BjWdQRjq.js → Card-CtKLNh3n.js} +1 -1
  30. package/dist/Card/index.js +3 -2
  31. package/dist/CheckBox/{CheckBox-D7bCjlkU.js → CheckBox-ByWSy9Yr.js} +1 -1
  32. package/dist/CheckBox/{CheckBox-GtT43IQ8.js → CheckBox-nBm0u6zX.js} +1 -1
  33. package/dist/CheckBox/index.js +4 -3
  34. package/dist/ColorPicker/{ColorPicker-Hjs4Vp5a.js → ColorPicker-CL57cSDG.js} +7 -6
  35. package/dist/ColorPicker/index.js +8 -7
  36. package/dist/ConfigProvider/index.js +3 -2
  37. package/dist/DatePicker/{DatePicker-C_ssCNGN.js → DatePicker-C0XbZmrZ.js} +7 -7
  38. package/dist/DatePicker/{DatePickerPanel-DNDw-H39.js → DatePickerPanel-BEn16cat.js} +6 -5
  39. package/dist/DatePicker/index.js +9 -8
  40. package/dist/DatePicker/style/index.js +2 -1
  41. package/dist/DatePicker/{style-BwmM26RP.js → style-CNtPPsZp.js} +1 -1
  42. package/dist/DropDown/{DropDown-DYhDwsNm.js → DropDown-yDH9V_9Y.js} +8 -8
  43. package/dist/DropDown/index.js +12 -10
  44. package/dist/DropDown/style/index.js +2 -1
  45. package/dist/DropDown/{style-BSgosymi.js → style-Fdp-U4md.js} +1 -1
  46. package/dist/Editor/{Buttons-D1fP8aYo.js → Buttons-BivKInBV.js} +147 -127
  47. package/dist/Editor/ToolbarPlugin/Buttons/index.js +19 -17
  48. package/dist/Editor/constants/index.js +1 -0
  49. package/dist/Editor/index.js +286 -174
  50. package/dist/Gantt/GanttChart/index.js +19 -17
  51. package/dist/Gantt/{GanttChart-VoKzDvu-.js → GanttChart-CDw1IQ4F.js} +9 -9
  52. package/dist/Gantt/GanttTable/index.js +12 -10
  53. package/dist/Gantt/{GanttTable-l-pMVjWe.js → GanttTable-xbXD_PWI.js} +5 -5
  54. package/dist/Gantt/GanttToolBar/index.js +15 -13
  55. package/dist/Gantt/{GanttToolBar-Bm_4cVHF.js → GanttToolBar-BTeTsR6Z.js} +4 -4
  56. package/dist/Gantt/{collapseKeys-_ShTXPKt.js → collapseKeys-B4SOVHjd.js} +2 -2
  57. package/dist/Gantt/index.js +27 -24
  58. package/dist/Gantt/{theme-CiMD9Y6i.js → theme-DLNvgM9X.js} +1 -1
  59. package/dist/Gantt/{timelineViewConfig-CLIpppp0.js → timelineViewConfig-9HArvbmb.js} +1 -1
  60. package/dist/Gantt/utils/index.js +6 -5
  61. package/dist/Gantt/utils/theme/index.js +2 -1
  62. package/dist/Icon/index.js +2 -1
  63. package/dist/InputTag/InputTag-hzCCJQ1z.js +144 -0
  64. package/dist/InputTag/index.js +7 -4
  65. package/dist/Loading/Loading-DiywS7ex.js +19 -0
  66. package/dist/Loading/index.js +4 -1
  67. package/dist/Modal/{Modal-GGHNlZv3.js → Modal-LiztSF7x.js} +1 -1
  68. package/dist/Modal/index.js +3 -2
  69. package/dist/NotFoundContent/index.js +2 -1
  70. package/dist/Radio/{Radio-CMAwZdP7.js → Radio-CX9cUqb7.js} +12 -12
  71. package/dist/Radio/index.js +2 -1
  72. package/dist/ScrollBar/{ScrollBar-CnwYQfXM.js → ScrollBar-QhXVe8zd.js} +1 -1
  73. package/dist/ScrollBar/index.js +3 -2
  74. package/dist/Segmented/{Segmented-Ck2ZmfF7.js → Segmented-BDz1hMDT.js} +1 -1
  75. package/dist/Segmented/index.js +2 -1
  76. package/dist/Select/{Select-CwABtVnS.js → Select-D6EK7whJ.js} +202 -201
  77. package/dist/Select/{SelectInputSearch-dfBUnTCY.js → SelectInputSearch-COUzreau.js} +2 -2
  78. package/dist/Select/index.js +15 -14
  79. package/dist/Table/{Table-ByNcMkaT.js → Table-yQXQEk6d.js} +5 -5
  80. package/dist/Table/hooks/index.js +2 -1
  81. package/dist/Table/{hooks-uCDY9dqx.js → hooks-BceUZQQm.js} +1 -1
  82. package/dist/Table/index.js +9 -8
  83. package/dist/Table/{processRowspan-nIGqGyHh.js → processRowspan-B0WELhG2.js} +1 -1
  84. package/dist/Table/style/index.js +2 -1
  85. package/dist/Table/{style-x9xfw6te.js → style-DgiPEsSp.js} +1 -1
  86. package/dist/Table/utils/index.js +2 -1
  87. package/dist/Tabs/Tabs-BiKW70CL.js +398 -0
  88. package/dist/Tabs/index.js +7 -4
  89. package/dist/Tooltip/{Tooltip-DWWWYn1a.js → Tooltip-Ch9lti_7.js} +1 -1
  90. package/dist/Tooltip/index.js +2 -1
  91. package/dist/Tree/index.js +5 -4
  92. package/dist/Tree/utils/index.js +1 -0
  93. package/dist/components/DropDown/interface.d.ts +167 -169
  94. package/dist/components/Editor/LengthBadge.d.ts +6 -0
  95. package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +1 -1
  96. package/dist/components/Editor/ToolbarPlugin/ToolbarPlugin.d.ts +5 -1
  97. package/dist/components/Editor/ToolbarPlugin/context/EditorToolbarThemeContext.d.ts +6 -0
  98. package/dist/components/Editor/ToolbarPlugin/interface.d.ts +30 -32
  99. package/dist/components/Editor/index.d.ts +1 -1
  100. package/dist/components/Editor/interface.d.ts +118 -60
  101. package/dist/components/Editor/plugins/MaxLengthPlugin.d.ts +7 -0
  102. package/dist/components/Editor/utils/resolveEditorToolbarThemeVars.d.ts +5 -0
  103. package/dist/components/Editor/utils/textLength.d.ts +4 -0
  104. package/dist/components/InputTag/interface.d.ts +32 -32
  105. package/dist/components/Radio/interface.d.ts +95 -97
  106. package/dist/components/Tabs/TabSelect/interface.d.ts +23 -25
  107. package/dist/components/Tabs/interface.d.ts +58 -60
  108. package/dist/components/Tree/types/node.d.ts +19 -19
  109. package/dist/components/Tree/types/tree.d.ts +81 -83
  110. package/dist/components/index.d.ts +2 -0
  111. package/dist/index.js +54 -51
  112. package/dist/locale/index.d.ts +1 -1
  113. package/dist/locale/lang/en-US.json.d.ts +177 -166
  114. package/dist/locale/lang/zh-CN.json.d.ts +177 -166
  115. package/dist/locale/lang/zh-TW.json.d.ts +177 -166
  116. package/dist/style.css +1 -1
  117. package/dist/vendors/{ConfigProvider-AQTr7T_c.js → ConfigProvider-DxrZpdIb.js} +23 -1
  118. package/dist/vendors/{LocaleContext-CBcJzvUD.js → LocaleContext-Dcw6C1LX.js} +11 -0
  119. package/dist/vendors/{Tree-DMC_MSw1.js → Tree-DXmVRDn0.js} +10 -9
  120. package/dist/vendors/{useLocale-DZ8XW2VL.js → useLocale-BKZX2_zw.js} +1 -1
  121. package/dist/vendors/version-4HBYLKDL.js +6 -0
  122. package/dist/vite-env.d.ts +13 -10
  123. package/dist/vitest-matchers.d.ts +0 -1
  124. package/package.json +8 -8
  125. package/dist/InputTag/InputTag-25vFChWE.js +0 -143
  126. package/dist/Loading/Loading--cdn92gm.js +0 -15
  127. package/dist/Tabs/Tabs-ZRWBbBdF.js +0 -410
  128. package/dist/components/Amap/AmapMarker/__tests__/AmapMarker.test.d.ts +0 -1
  129. package/dist/components/Amap/AmapMarkerCluster/__tests__/AmapMarkerCluster.test.d.ts +0 -1
  130. package/dist/components/Amap/AmapProvider/__tests__/AmapProvider.test.d.ts +0 -1
  131. package/dist/components/Amap/__tests__/Amap.test.d.ts +0 -1
  132. package/dist/components/Amap/hooks/__tests__/useCurrentLocation.test.d.ts +0 -1
  133. package/dist/components/Calendar/__tests__/Calendar.contract.test.d.ts +0 -1
  134. package/dist/components/Calendar/__tests__/algorithm/monthLayoutAlgorithm.test.d.ts +0 -1
  135. package/dist/components/Calendar/subcomponents/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +0 -1
  136. package/dist/components/Calendar/subcomponents/DayView/__tests__/CalendarDay.dayFilter.test.d.ts +0 -1
  137. package/dist/components/Calendar/subcomponents/EventCard/__tests__/EventCard.tooltip.test.d.ts +0 -1
  138. package/dist/components/Calendar/utils/__tests__/dateUtils.test.d.ts +0 -1
  139. package/dist/components/Calendar/utils/__tests__/eventUtils.contract.test.d.ts +0 -1
  140. package/dist/components/Calendar/utils/__tests__/normalizeData.test.d.ts +0 -1
  141. package/dist/components/Calendar/utils/theme/__tests__/platformTheme.test.d.ts +0 -1
  142. package/dist/components/Calendar/utils/theme/__tests__/resolveCalendarThemeVars.test.d.ts +0 -1
  143. package/dist/components/Calendar/utils/theme/__tests__/resolveScheduleColorVars.test.d.ts +0 -1
  144. package/dist/components/Calendar/utils/theme/__tests__/resolveSubcomponentThemes.test.d.ts +0 -1
  145. package/dist/components/ConfigProvider/__tests__/ConfigProvider.test.d.ts +0 -1
  146. package/dist/components/DatePicker/__tests__/DatePicker.getPopupContainer.test.d.ts +0 -1
  147. package/dist/components/DatePicker/__tests__/DatePicker.triggerActiveClassName.test.d.ts +0 -1
  148. package/dist/components/DatePicker/__tests__/DatePickerPanel.dom.test.d.ts +0 -1
  149. package/dist/components/DatePicker/style/__tests__/resolveDatePickerThemeVars.test.d.ts +0 -1
  150. package/dist/components/DatePicker/utils/__tests__/normalizePickerValue.test.d.ts +0 -1
  151. package/dist/components/DropDown/__tests__/DropDown.test.d.ts +0 -1
  152. package/dist/components/DropDown/style/__tests__/resolveDropDownThemeVars.test.d.ts +0 -1
  153. package/dist/components/Gantt/GanttChart/OffscreenTaskIndicators/__tests__/OffscreenTaskIndicators.test.d.ts +0 -1
  154. package/dist/components/Gantt/GanttChart/hooks/__tests__/timelineFocus.contract.test.d.ts +0 -1
  155. package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttColumnVirtual.test.d.ts +0 -1
  156. package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttDrag.clippedQuarterMonth.test.d.ts +0 -0
  157. package/dist/components/Gantt/GanttChart/hooks/__tests__/useOffscreenIndicators.test.d.ts +0 -1
  158. package/dist/components/Gantt/GanttChart/hooks/__tests__/useTimelineViewportController.test.d.ts +0 -0
  159. package/dist/components/Gantt/GanttChart/utils/__tests__/dateRangeNormalizer.subday.test.d.ts +0 -1
  160. package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.quarterMonth.test.d.ts +0 -1
  161. package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.subday.test.d.ts +0 -1
  162. package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.quarterMonth.test.d.ts +0 -1
  163. package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.subday.test.d.ts +0 -1
  164. package/dist/components/Gantt/GanttChart/utils/__tests__/quarterMonthScale.test.d.ts +0 -1
  165. package/dist/components/Gantt/GanttChart/utils/__tests__/subdayScale.contract.test.d.ts +0 -1
  166. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineMarkers.test.d.ts +0 -1
  167. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineRange.test.d.ts +0 -1
  168. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewConfig.test.d.ts +0 -1
  169. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewportEngine.test.d.ts +0 -1
  170. package/dist/components/Gantt/__tests__/Gantt.contract.test.d.ts +0 -0
  171. package/dist/components/Gantt/__tests__/Gantt.grouped.contract.test.d.ts +0 -0
  172. package/dist/components/Gantt/__tests__/GanttBars.renderWindow.test.d.ts +0 -1
  173. package/dist/components/Gantt/__tests__/GanttChart.contract.test.d.ts +0 -0
  174. package/dist/components/Gantt/__tests__/GanttSummaryBar.tooltip.test.d.ts +0 -1
  175. package/dist/components/Gantt/__tests__/GanttToolBar.test.d.ts +0 -1
  176. package/dist/components/Gantt/__tests__/filterItemsByCollapse.test.d.ts +0 -1
  177. package/dist/components/Gantt/__tests__/interface.contract.types.test.d.ts +0 -1
  178. package/dist/components/Gantt/__tests__/timezoneUtils.test.d.ts +0 -1
  179. package/dist/components/Gantt/__tests__/useBarTooltipHover.test.d.ts +0 -1
  180. package/dist/components/Gantt/__tests__/useGanttHighlight.test.d.ts +0 -1
  181. package/dist/components/Gantt/__tests__/useTaskBarPointer.test.d.ts +0 -1
  182. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttTheme.test.d.ts +0 -1
  183. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttThemeVars.test.d.ts +0 -1
  184. package/dist/components/Gantt/utils/theme/__tests__/resolveTableThemeFromGantt.test.d.ts +0 -1
  185. package/dist/components/ScrollBar/__tests__/ScrollBar.test.d.ts +0 -1
  186. package/dist/components/Select/__tests__/Select.getPopupContainer.test.d.ts +0 -1
  187. package/dist/components/Select/__tests__/Select.optionDisabled.test.d.ts +0 -1
  188. package/dist/components/Table/__tests__/HeaderCell.test.d.ts +0 -1
  189. package/dist/components/Table/__tests__/TableBody.test.d.ts +0 -1
  190. package/dist/components/Table/__tests__/processRowspan.test.d.ts +0 -1
  191. package/dist/components/Table/style/__tests__/resolveTableThemeVars.test.d.ts +0 -1
  192. package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
  193. package/dist/components/Tree/Tree.test.d.ts +0 -1
  194. package/dist/locale/__tests__/locale.test.d.ts +0 -1
  195. /package/dist/Amap/{AmapContext-CFmsMycg.js → AmapContext-D7Njjm5a.js} +0 -0
  196. /package/dist/Amap/{useMarkerInfoWindowController-BvP2jo7K.js → useMarkerInfoWindowController-BQmhR0N7.js} +0 -0
  197. /package/dist/Calendar/{TimeAxis-D7bgZDKs.js → TimeAxis-C9e2BdYs.js} +0 -0
  198. /package/dist/Calendar/{colorUtils-lXNjGoCk.js → colorUtils-CBLTsDX0.js} +0 -0
  199. /package/dist/Calendar/{context-CBJnz0IH.js → context-4tCN5X33.js} +0 -0
  200. /package/dist/Calendar/{layout-BglMom3m.js → layout-Dz-grtu9.js} +0 -0
  201. /package/dist/DatePicker/{ensureDayjsPlugins-CVL-fnAl.js → ensureDayjsPlugins-Cn9Bkjkj.js} +0 -0
  202. /package/dist/DatePicker/{pickerLocale-BeMlfhKu.js → pickerLocale-BRnNjLcv.js} +0 -0
  203. /package/dist/Gantt/{GanttHighlightContext-grda5bhd.js → GanttHighlightContext-ChThr8ia.js} +0 -0
  204. /package/dist/Gantt/{columnResize-DV1tSBx_.js → columnResize-jG0Wy2PC.js} +0 -0
  205. /package/dist/Gantt/{constants-BObDP0h6.js → constants-LIz5jwed.js} +0 -0
  206. /package/dist/Gantt/{highlightTarget-DrP0_NrM.js → highlightTarget-BpkYTonb.js} +0 -0
  207. /package/dist/Icon/{Icon-SQ5tu-yG.js → Icon-BBDcb-yw.js} +0 -0
  208. /package/dist/NotFoundContent/{NotFoundContent-J-TEnljc.js → NotFoundContent-BLmzWNBi.js} +0 -0
  209. /package/dist/ScrollBar/{style-B1NkMGtS.js → style-D26azwz6.js} +0 -0
  210. /package/dist/Table/{constants-CcwjDbe7.js → constants-kRpjsoet.js} +0 -0
  211. /package/dist/vendors/{animations-Mlw78WYo.js → animations-rwUbyoT0.js} +0 -0
  212. /package/dist/vendors/{color-BQYy0Wgy.js → color-D6XBXROa.js} +0 -0
  213. /package/dist/vendors/{cssVars-B8o94Yao.js → cssVars-BYg1matG.js} +0 -0
  214. /package/dist/vendors/{mergeRefs-Bai1cIzv.js → mergeRefs-Bsywq1Vo.js} +0 -0
  215. /package/dist/vendors/{useFloatingOverlay-WbbHmuT-.js → useFloatingOverlay-BApqkHSu.js} +0 -0
  216. /package/dist/vendors/{useFloatingPortal-C8V67X0v.js → useFloatingPortal-CmVJbuRm.js} +0 -0
  217. /package/dist/vendors/{useLatchedPopupPortalRoot-hwf14FJ5.js → useLatchedPopupPortalRoot-4fVhqVT4.js} +0 -0
  218. /package/dist/{components/Amap/AmapCircle/__tests__/AmapCircle.test.d.ts → version.d.ts} +0 -0
@@ -1,170 +1,168 @@
1
1
  import { ReactNode } from 'react';
2
-
3
-
4
- /**
5
- * 浮层偏移量接口
6
- */
7
- export interface OffsetType {
8
- /**
9
- * x 轴偏移量
10
- * @default 0
11
- */
12
- x: number;
13
- /**
14
- * y 轴偏移量
15
- * @default 0
16
- */
17
- y: number;
18
- }
19
-
20
- /**
21
- * 下拉菜单项接口
22
- */
23
- export interface MenuItemType {
24
- /**
25
- * 菜单项的唯一标识
26
- */
27
- key: string;
28
- /**
29
- * 菜单项的显示内容,可以是字符串或 React 节点
30
- */
31
- label: ReactNode;
32
- /**
33
- * 菜单项的图标
34
- */
35
- icon?: ReactNode;
36
- /**
37
- * 是否禁用该菜单项
38
- * @default false
39
- */
40
- disabled?: boolean;
41
-
42
- /**
43
- * 是否是系统字段
44
- * @description 系统字段的颜色会比较突出,和其他字段仅文字样式的不同
45
- */
46
- systemField?: boolean;
47
- /**
48
- * 允许任意额外字段,用于自定义搜索或其他用途
49
- */
50
- [key: string]: any;
51
- }
52
-
53
- /**
54
- * 下拉组件级颜色 token
55
- */
56
- export interface DropDownTheme {
57
- /**
58
- * 浮层背景色
59
- * @default #fff
60
- */
61
- colorBgContainer?: string;
62
- /**
63
- * 菜单项默认文字颜色
64
- * @default #121211
65
- */
66
- colorText?: string;
67
- /**
68
- * 菜单项图标颜色
69
- * @default #6f829e
70
- */
71
- colorIcon?: string;
72
- /**
73
- * 禁用态文字/图标颜色
74
- * @default #999
75
- */
76
- colorTextDisabled?: string;
77
- /**
78
- * 菜单项悬停背景色
79
- * @default #eff0f6
80
- */
81
- itemHoverBg?: string;
82
- /**
83
- * 高亮项背景色
84
- * @default #f0f6ff
85
- */
86
- itemActiveBg?: string;
87
- /**
88
- * 高亮项文字/图标颜色
89
- * @default #0265ff
90
- */
91
- itemActiveColor?: string;
92
- }
93
-
94
- /**
95
- * 下拉组件的属性接口
96
- */
97
- export interface DropDownProps {
98
- /**
99
- * 触发器子元素
100
- */
101
- children: ReactNode;
102
- /**
103
- * 下拉菜单的菜单项列表
104
- */
105
- menus: MenuItemType[];
106
- /**
107
- * 菜单项点击时的回调函数
108
- */
109
- onClick?: (menuItem: MenuItemType) => void;
110
- /**
111
- * 下拉菜单打开/关闭状态变化时的回调函数
112
- */
113
- onOpenChange?: (open: boolean) => void;
114
- /**
115
- * 控制下拉菜单的显示隐藏状态(受控模式)
116
- * @description 当传入此属性时,组件将变为受控模式
117
- */
118
- visible?: boolean;
119
- /**
120
- * 搜索框的占位符文本
121
- * @default '搜索'
122
- */
123
- searchPlaceholder?: string;
124
- /**
125
- * 搜索值变化时的回调函数
126
- */
127
- onSearch?: (searchValue: string) => void;
128
- /**
129
- * 用于搜索的字段名
130
- * @default 'label'
131
- */
132
- searchKey?: string;
133
- /**
134
- * 是否显示搜索框
135
- * @default true
136
- */
137
- showSearch?: boolean;
138
- /**
139
- * 选择菜单项后是否关闭面板
140
- * @default true
141
- */
142
- closeOnSelect?: boolean;
143
- /**
144
- * 浮层偏移量
145
- * @default { x: 0, y: 0 }
146
- */
147
- offset?: OffsetType;
148
- /**
149
- * 自定义下拉菜单的样式
150
- */
151
- style?: React.CSSProperties;
152
-
153
- /**
154
- * 下拉面板浮层的 z-index
155
- */
156
- zIndex?: number;
157
- /**
158
- * 指定下拉浮层渲染的父级 DOM 节点
159
- */
160
- getPopupContainer?: () => HTMLElement;
161
- /**
162
- * 高亮的菜单项 key 数组
163
- * @description 指定哪些菜单项应该被高亮显示
164
- */
165
- activeKey?: string[];
166
- /**
167
- * 组件级颜色 token
168
- */
169
- theme?: DropDownTheme;
170
- }
2
+ /**
3
+ * 浮层偏移量接口
4
+ */
5
+ export interface OffsetType {
6
+ /**
7
+ * x 轴偏移量
8
+ * @default 0
9
+ */
10
+ x: number;
11
+ /**
12
+ * y 轴偏移量
13
+ * @default 0
14
+ */
15
+ y: number;
16
+ }
17
+
18
+ /**
19
+ * 下拉菜单项接口
20
+ */
21
+ export interface MenuItemType {
22
+ /**
23
+ * 菜单项的唯一标识
24
+ */
25
+ key: string;
26
+ /**
27
+ * 菜单项的显示内容,可以是字符串或 React 节点
28
+ */
29
+ label: ReactNode;
30
+ /**
31
+ * 菜单项的图标
32
+ */
33
+ icon?: ReactNode;
34
+ /**
35
+ * 是否禁用该菜单项
36
+ * @default false
37
+ */
38
+ disabled?: boolean;
39
+
40
+ /**
41
+ * 是否是系统字段
42
+ * @description 系统字段的颜色会比较突出,和其他字段仅文字样式的不同
43
+ */
44
+ systemField?: boolean;
45
+ /**
46
+ * 允许任意额外字段,用于自定义搜索或其他用途
47
+ */
48
+ [key: string]: any;
49
+ }
50
+
51
+ /**
52
+ * 下拉组件级颜色 token
53
+ */
54
+ export interface DropDownTheme {
55
+ /**
56
+ * 浮层背景色
57
+ * @default #fff
58
+ */
59
+ colorBgContainer?: string;
60
+ /**
61
+ * 菜单项默认文字颜色
62
+ * @default #121211
63
+ */
64
+ colorText?: string;
65
+ /**
66
+ * 菜单项图标颜色
67
+ * @default #6f829e
68
+ */
69
+ colorIcon?: string;
70
+ /**
71
+ * 禁用态文字/图标颜色
72
+ * @default #999
73
+ */
74
+ colorTextDisabled?: string;
75
+ /**
76
+ * 菜单项悬停背景色
77
+ * @default #eff0f6
78
+ */
79
+ itemHoverBg?: string;
80
+ /**
81
+ * 高亮项背景色
82
+ * @default #f0f6ff
83
+ */
84
+ itemActiveBg?: string;
85
+ /**
86
+ * 高亮项文字/图标颜色
87
+ * @default #0265ff
88
+ */
89
+ itemActiveColor?: string;
90
+ }
91
+
92
+ /**
93
+ * 下拉组件的属性接口
94
+ */
95
+ export interface DropDownProps {
96
+ /**
97
+ * 触发器子元素
98
+ */
99
+ children: ReactNode;
100
+ /**
101
+ * 下拉菜单的菜单项列表
102
+ */
103
+ menus: MenuItemType[];
104
+ /**
105
+ * 菜单项点击时的回调函数
106
+ */
107
+ onClick?: (menuItem: MenuItemType) => void;
108
+ /**
109
+ * 下拉菜单打开/关闭状态变化时的回调函数
110
+ */
111
+ onOpenChange?: (open: boolean) => void;
112
+ /**
113
+ * 控制下拉菜单的显示隐藏状态(受控模式)
114
+ * @description 当传入此属性时,组件将变为受控模式
115
+ */
116
+ visible?: boolean;
117
+ /**
118
+ * 搜索框的占位符文本
119
+ * @default '搜索'
120
+ */
121
+ searchPlaceholder?: string;
122
+ /**
123
+ * 搜索值变化时的回调函数
124
+ */
125
+ onSearch?: (searchValue: string) => void;
126
+ /**
127
+ * 用于搜索的字段名
128
+ * @default 'label'
129
+ */
130
+ searchKey?: string;
131
+ /**
132
+ * 是否显示搜索框
133
+ * @default true
134
+ */
135
+ showSearch?: boolean;
136
+ /**
137
+ * 选择菜单项后是否关闭面板
138
+ * @default true
139
+ */
140
+ closeOnSelect?: boolean;
141
+ /**
142
+ * 浮层偏移量
143
+ * @default { x: 0, y: 0 }
144
+ */
145
+ offset?: OffsetType;
146
+ /**
147
+ * 自定义下拉菜单的样式
148
+ */
149
+ style?: React.CSSProperties;
150
+
151
+ /**
152
+ * 下拉面板浮层的 z-index
153
+ */
154
+ zIndex?: number;
155
+ /**
156
+ * 指定下拉浮层渲染的父级 DOM 节点
157
+ */
158
+ getPopupContainer?: () => HTMLElement;
159
+ /**
160
+ * 高亮的菜单项 key 数组
161
+ * @description 指定哪些菜单项应该被高亮显示
162
+ */
163
+ activeKey?: string[];
164
+ /**
165
+ * 组件级颜色 token
166
+ */
167
+ theme?: DropDownTheme;
168
+ }
@@ -0,0 +1,6 @@
1
+ type LengthBadgeProps = {
2
+ current: number;
3
+ maxLength: number;
4
+ };
5
+ declare const LengthBadge: React.FC<LengthBadgeProps>;
6
+ export default LengthBadge;
@@ -21,7 +21,7 @@ interface ToolbarButtonProps {
21
21
  */
22
22
  active?: boolean;
23
23
  /**
24
- * 大小
24
+ * 大小;未传时使用 toolbar theme.iconSize(默认 14)
25
25
  */
26
26
  size?: number;
27
27
  }
@@ -1,3 +1,7 @@
1
+ import { EditorToolbarTheme } from '../interface';
1
2
  import { ToolbarButtonProps } from './interface.d';
2
- declare const Toolbar: React.FC<ToolbarButtonProps>;
3
+ type ToolbarProps = ToolbarButtonProps & {
4
+ theme?: EditorToolbarTheme;
5
+ };
6
+ declare const Toolbar: React.FC<ToolbarProps>;
3
7
  export default Toolbar;
@@ -0,0 +1,6 @@
1
+ export declare const EditorToolbarThemeProvider: import('react').Provider<{
2
+ iconSize: number;
3
+ }>;
4
+ export declare const useEditorToolbarTheme: () => {
5
+ iconSize: number;
6
+ };
@@ -1,33 +1,31 @@
1
1
  import { ToolbarButtonName } from './Buttons';
2
-
3
-
4
- export interface ToolbarButtonProps {
5
- /**
6
- * @description 根据外部配置传入你想要渲染的 toolbar 按钮
7
- * @description 如果数组为空,则会渲染默认的 toolbar 按钮
8
- */
9
- config?: Array<{
10
- /**
11
- * @description 分组的唯一标识
12
- */
13
- key: string;
14
- /**
15
- * @description 按钮组名称
16
- * @description 自定义按钮名称需要通过 registerToolbarButton 先注册
17
- */
18
- buttons: Array<
19
- | ToolbarButtonName
20
- | {
21
- name: ToolbarButtonName;
22
- /**
23
- * @description 各个 button 组件的 props
24
- */
25
- props?: Record<string, any>;
26
- }
27
- >;
28
- }>;
29
- /**
30
- * @description 自定义样式
31
- */
32
- style?: React.CSSProperties;
33
- }
2
+ export interface ToolbarButtonProps {
3
+ /**
4
+ * @description 根据外部配置传入你想要渲染的 toolbar 按钮
5
+ * @description 如果数组为空,则会渲染默认的 toolbar 按钮
6
+ */
7
+ config?: Array<{
8
+ /**
9
+ * @description 分组的唯一标识
10
+ */
11
+ key: string;
12
+ /**
13
+ * @description 按钮组名称
14
+ * @description 自定义按钮名称需要通过 registerToolbarButton 先注册
15
+ */
16
+ buttons: Array<
17
+ | ToolbarButtonName
18
+ | {
19
+ name: ToolbarButtonName;
20
+ /**
21
+ * @description 各个 button 组件的 props
22
+ */
23
+ props?: Record<string, any>;
24
+ }
25
+ >;
26
+ }>;
27
+ /**
28
+ * @description 自定义样式
29
+ */
30
+ style?: React.CSSProperties;
31
+ }
@@ -1,5 +1,5 @@
1
1
  export { Editor as default } from './Editor';
2
- export type { EditorProps } from './interface';
2
+ export type { EditorProps, EditorTheme, EditorToolbarTheme } from './interface';
3
3
  export { registerToolbarButton, unregisterToolbarButton, listRegisteredToolbarButtons, } from './ToolbarPlugin/Buttons';
4
4
  export type { ToolbarButtonName } from './ToolbarPlugin/Buttons';
5
5
  export { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
@@ -1,62 +1,120 @@
1
1
  import { EditorState } from 'lexical';
2
2
  import { ToolbarButtonProps } from './ToolbarPlugin/interface.d';
3
-
4
-
5
- export type EditorProps = {
6
- /**
7
- * 编辑器容器高度
8
- */
9
- height?: number;
10
- /**
11
- * 编辑器内容变化回调
12
- */
13
- onChange: (
14
- { text, html }: { text: string; html: string | null },
15
- editorState: EditorState
16
- ) => void;
17
-
18
- toolbar?: {
19
- /**
20
- * toolbar 配置
21
- */
22
- config?: ToolbarButtonProps['config'];
23
-
24
- style?: React.CSSProperties;
25
- };
26
-
27
- /**
28
- * 编辑器受控内容
29
- */
30
- value?: string | null;
31
-
32
- /**
33
- * @description 占位符文本
34
- * @todo 待实现
35
- */
36
- placeholder?: string;
37
-
38
- /**
39
- * @description 是否自动聚焦,默认为 false
40
- */
41
- autoFocus?: boolean;
42
- /**
43
- * @description 是否禁用
44
- * @todo 待实现
45
- */
46
- disabled?: boolean;
47
- /**
48
- * @description 错误处理回调
49
- * @todo 待实现
50
- */
51
- onError?: (error: Error) => void;
52
-
53
- /**
54
- * @description 图片上传配置
55
- * @todo 待实现
56
- */
57
- imageUpload?: {
58
- maxSize?: number; // 最大文件大小
59
- accept?: string[]; // 支持的文件类型
60
- customUpload?: (file: File) => Promise<string>; // 自定义上传函数
61
- };
62
- };
3
+ /** Editor 工具栏 Design Token(挂在 theme.toolbar,避免与后续 content 等命名空间冲突) */
4
+ export interface EditorToolbarTheme {
5
+ /** 工具栏背景 @default #fafafa */
6
+ bg?: string;
7
+ /** 工具栏底部分割线 @default #e0e0e0 */
8
+ borderColor?: string;
9
+ /** 工具栏内边距 @default 5px 6px */
10
+ padding?: string;
11
+ /**
12
+ * 工具栏容器 flex gap。
13
+ * 现状无 gap;未传时不写变量,保持与现状一致。
14
+ */
15
+ gap?: string | number;
16
+ /** 组内按钮间距 @default 6px */
17
+ groupGap?: string | number;
18
+ /** 组分隔线颜色 @default #e0e0e0 */
19
+ dividerColor?: string;
20
+ /** 组分隔线高度 @default 20px */
21
+ dividerSize?: string | number;
22
+ /** 组分隔线水平外边距 @default 5px */
23
+ dividerMargin?: string | number;
24
+ /** 按钮默认图标/文字色 @default #666 */
25
+ colorIcon?: string;
26
+ /** hover 背景 @default #e0e0e0 */
27
+ itemHoverBg?: string;
28
+ /** hover 前景 @default #121211 */
29
+ itemHoverColor?: string;
30
+ /** active 背景 @default #e0e0e0 */
31
+ itemActiveBg?: string;
32
+ /** active 前景 @default #121211 */
33
+ itemActiveColor?: string;
34
+ /** 按钮内边距 @default 3px */
35
+ itemPadding?: string | number;
36
+ /** 按钮圆角 @default 2px */
37
+ itemBorderRadius?: string | number;
38
+ /** 图标尺寸 @default 14 */
39
+ iconSize?: string | number;
40
+ }
41
+
42
+ export interface EditorTheme {
43
+ toolbar?: EditorToolbarTheme;
44
+ }
45
+
46
+ export type EditorProps = {
47
+ /**
48
+ * 编辑器容器高度
49
+ */
50
+ height?: number;
51
+ /**
52
+ * 编辑器内容变化回调
53
+ */
54
+ onChange: (
55
+ { text, html }: { text: string; html: string | null },
56
+ editorState: EditorState
57
+ ) => void;
58
+
59
+ /**
60
+ * 组件主题(与 Lexical 内部 content theme 无关)
61
+ */
62
+ theme?: EditorTheme;
63
+
64
+ toolbar?: {
65
+ /**
66
+ * toolbar 配置
67
+ */
68
+ config?: ToolbarButtonProps['config'];
69
+
70
+ style?: React.CSSProperties;
71
+ };
72
+
73
+ /**
74
+ * 编辑器受控内容
75
+ */
76
+ value?: string | null;
77
+
78
+ /**
79
+ * 最大字符数(与 onChange.text.length / getTextContent().length 一致)。
80
+ * 仅 `number && > 0` 时生效;未传或无效值不限制。
81
+ * 图片不计字数,链接只计可见文字。
82
+ */
83
+ maxLength?: number;
84
+
85
+ /**
86
+ * 发生超限(键入拦截 / 粘贴截断 / 回填截断)时触发
87
+ */
88
+ onMaxLengthExceed?: () => void;
89
+
90
+ /**
91
+ * @description 占位符文本
92
+ * @todo 待实现
93
+ */
94
+ placeholder?: string;
95
+
96
+ /**
97
+ * @description 是否自动聚焦,默认为 false
98
+ */
99
+ autoFocus?: boolean;
100
+ /**
101
+ * @description 是否禁用
102
+ * @todo 待实现
103
+ */
104
+ disabled?: boolean;
105
+ /**
106
+ * @description 错误处理回调
107
+ * @todo 待实现
108
+ */
109
+ onError?: (error: Error) => void;
110
+
111
+ /**
112
+ * @description 图片上传配置
113
+ * @todo 待实现
114
+ */
115
+ imageUpload?: {
116
+ maxSize?: number; // 最大文件大小
117
+ accept?: string[]; // 支持的文件类型
118
+ customUpload?: (file: File) => Promise<string>; // 自定义上传函数
119
+ };
120
+ };
@@ -0,0 +1,7 @@
1
+ type MaxLengthPluginProps = {
2
+ maxLength: number;
3
+ onMaxLengthExceed?: () => void;
4
+ };
5
+ /** Lexical Playground–style hard limit; restore when already at cap, else trim. */
6
+ export default function MaxLengthPlugin({ maxLength, onMaxLengthExceed, }: MaxLengthPluginProps): null;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ import { EditorToolbarTheme } from '../interface';
2
+ /** 将 EditorToolbarTheme 映射为 CSS 变量(未传 token 不写入)。 */
3
+ export declare const resolveEditorToolbarThemeVars: (theme?: EditorToolbarTheme) => Record<string, string>;
4
+ /** 解析 iconSize 为数值,供 Icon size prop;默认 14(与 BaseButton 现状一致)。 */
5
+ export declare const resolveEditorToolbarIconSize: (iconSize?: string | number) => number;
@@ -0,0 +1,4 @@
1
+ import { LexicalEditor } from 'lexical';
2
+ export declare function isValidMaxLength(maxLength: unknown): maxLength is number;
3
+ /** Trim from document end to `maxLength` (metric = getTextContentSize / onChange.text). */
4
+ export declare function $truncateRootToMaxLength(editor: LexicalEditor, maxLength: number): boolean;