@baishuyun/ui-base 6.0.0 → 6.2.0

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 (186) hide show
  1. package/dist/Amap/AmapProvider/index.js +3 -3
  2. package/dist/Amap/{AmapProvider-BkJp-sWi.js → AmapProvider-BgGnih_w.js} +1 -1
  3. package/dist/Amap/index.js +3 -3
  4. package/dist/Calendar/AllDaySection-DS0Frx1p.js +53 -0
  5. package/dist/Calendar/Calendar-CAG1Fxlh.js +806 -0
  6. package/dist/Calendar/CurrentTimeIndicator-DaIywtIA.js +59 -0
  7. package/dist/Calendar/EventCard-D_VeOVDQ.js +155 -0
  8. package/dist/Calendar/TimeAxis-gKb8dTwY.js +13 -0
  9. package/dist/Calendar/TimeGrid-D8Du5vFP.js +47 -0
  10. package/dist/Calendar/adapters/index.js +2 -0
  11. package/dist/Calendar/adapters-zYR7CgzD.js +20 -0
  12. package/dist/Calendar/colorUtils-DcpqM3KR.js +55 -0
  13. package/dist/Calendar/context/index.js +2 -0
  14. package/dist/Calendar/context-DNOJ9LW_.js +21 -0
  15. package/dist/Calendar/index.js +21 -0
  16. package/dist/Calendar/layout-DvWx_7gn.js +302 -0
  17. package/dist/Calendar/shared/AllDaySection/index.js +8 -0
  18. package/dist/Calendar/shared/CurrentTimeIndicator/index.js +5 -0
  19. package/dist/Calendar/shared/EventCard/index.js +6 -0
  20. package/dist/Calendar/shared/TimeAxis/index.js +4 -0
  21. package/dist/Calendar/shared/TimeGrid/index.js +4 -0
  22. package/dist/Calendar/style/index.js +2 -0
  23. package/dist/Calendar/style-hCRKx3m1.js +55 -0
  24. package/dist/Calendar/utils/index.js +114 -0
  25. package/dist/Calendar/utils/layout/index.js +3 -0
  26. package/dist/Card/{Card-D__c94yx.js → Card-CRrtIjNT.js} +1 -1
  27. package/dist/Card/index.js +2 -2
  28. package/dist/CheckBox/{CheckBox-DF201Nxg.js → CheckBox-CkVe5Boq.js} +1 -1
  29. package/dist/CheckBox/{CheckBox-B04hZKaC.js → CheckBox-DIunYcfS.js} +1 -1
  30. package/dist/CheckBox/index.js +3 -3
  31. package/dist/ColorPicker/ColorPicker-CKqNqAsK.js +150 -0
  32. package/dist/ColorPicker/index.js +6 -5
  33. package/dist/ConfigProvider/index.js +2 -2
  34. package/dist/DatePicker/DatePicker-BIxiJQ_W.js +91 -0
  35. package/dist/DatePicker/DatePickerPanel-CsiEGC-1.js +217 -0
  36. package/dist/DatePicker/ensureDayjsPlugins-DZjJnZgo.js +16 -0
  37. package/dist/DatePicker/index.js +8 -0
  38. package/dist/DatePicker/pickerLocale-VqSP_iIm.js +15 -0
  39. package/dist/DatePicker/style/index.js +2 -0
  40. package/dist/DatePicker/style-DZaSSoNs.js +15 -0
  41. package/dist/DropDown/{DropDown-CMKiQDrc.js → DropDown-BR-Tz58r.js} +5 -5
  42. package/dist/DropDown/index.js +7 -7
  43. package/dist/Editor/{Buttons-D17RQIEb.js → Buttons-DdZg3jAa.js} +6 -6
  44. package/dist/Editor/ToolbarPlugin/Buttons/index.js +14 -13
  45. package/dist/Editor/index.js +14 -13
  46. package/dist/Icon/{Icon-CTZCSuVg.js → Icon-BQ3Whub2.js} +1 -1
  47. package/dist/Icon/index.js +1 -1
  48. package/dist/InputTag/{InputTag-F2Dv-r56.js → InputTag-zP5QdId7.js} +1 -1
  49. package/dist/InputTag/index.js +2 -2
  50. package/dist/Loading/index.js +1 -1
  51. package/dist/Modal/{Modal-CweuD-VO.js → Modal-B5AW5GKt.js} +6 -5
  52. package/dist/Modal/index.js +2 -2
  53. package/dist/NotFoundContent/index.js +1 -1
  54. package/dist/Radio/index.js +1 -1
  55. package/dist/Segmented/Segmented-BTW445jc.js +82 -0
  56. package/dist/Segmented/index.js +1 -1
  57. package/dist/Select/{Select-D8T0S1_m.js → Select-BGsQ-PVq.js} +14 -15
  58. package/dist/Select/{SelectInputSearch-Dm3CI_L4.js → SelectInputSearch-CraymTXM.js} +3 -3
  59. package/dist/Select/index.js +11 -11
  60. package/dist/Tabs/{Tabs-Cxf7jwys.js → Tabs-CPRNkfMo.js} +4 -4
  61. package/dist/Tabs/index.js +4 -4
  62. package/dist/Tooltip/Tooltip-RkD8fs0B.js +169 -0
  63. package/dist/Tooltip/index.js +2 -0
  64. package/dist/Tree/index.js +4 -4
  65. package/dist/components/Calendar/Calendar.d.ts +3 -0
  66. package/dist/components/Calendar/Header/CalendarHeader/CalendarHeader.d.ts +2 -0
  67. package/dist/components/Calendar/Header/CalendarHeaderLeft/CalendarHeaderLeft.d.ts +2 -0
  68. package/dist/components/Calendar/Header/DateDisplay/DateDisplay.d.ts +2 -0
  69. package/dist/components/Calendar/Header/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +1 -0
  70. package/dist/components/Calendar/Header/NavButton/NavButton.d.ts +6 -0
  71. package/dist/components/Calendar/Header/TodayButton/TodayButton.d.ts +2 -0
  72. package/dist/components/Calendar/__tests__/Calendar.contract.test.d.ts +1 -0
  73. package/dist/components/Calendar/__tests__/algorithm/monthLayoutAlgorithm.test.d.ts +1 -0
  74. package/dist/components/Calendar/__tests__/helpers/testFormatMessage.d.ts +2 -0
  75. package/dist/components/Calendar/adapters/__tests__/platformTheme.test.d.ts +1 -0
  76. package/dist/components/Calendar/adapters/index.d.ts +1 -0
  77. package/dist/components/Calendar/adapters/platformTheme.d.ts +29 -0
  78. package/dist/components/Calendar/constants.d.ts +12 -0
  79. package/dist/components/Calendar/context/CalendarContext.d.ts +29 -0
  80. package/dist/components/Calendar/context/index.d.ts +2 -0
  81. package/dist/components/Calendar/context/useCalendarContext.d.ts +3 -0
  82. package/dist/components/Calendar/index.d.ts +4 -0
  83. package/dist/components/Calendar/interface.d.ts +62 -0
  84. package/dist/components/Calendar/internalTypes.d.ts +56 -0
  85. package/dist/components/Calendar/panels/DayPanel/DayPanel.d.ts +3 -0
  86. package/dist/components/Calendar/panels/DayPanel/__tests__/CalendarDay.dayFilter.test.d.ts +1 -0
  87. package/dist/components/Calendar/panels/MonthPanel/MonthCell/MonthCell.d.ts +10 -0
  88. package/dist/components/Calendar/panels/MonthPanel/MonthCell/MonthCellPopover/MonthCellPopover.d.ts +10 -0
  89. package/dist/components/Calendar/panels/MonthPanel/MonthHeader/MonthHeader.d.ts +2 -0
  90. package/dist/components/Calendar/panels/MonthPanel/MonthPanel.d.ts +3 -0
  91. package/dist/components/Calendar/panels/MonthPanel/WeekEventLayer/MoreButton.d.ts +11 -0
  92. package/dist/components/Calendar/panels/MonthPanel/WeekEventLayer/WeekEventLayer.d.ts +3 -0
  93. package/dist/components/Calendar/panels/WeekPanel/WeekAllDaySection/WeekAllDaySection.d.ts +11 -0
  94. package/dist/components/Calendar/panels/WeekPanel/WeekHeader/WeekHeader.d.ts +6 -0
  95. package/dist/components/Calendar/panels/WeekPanel/WeekPanel.d.ts +3 -0
  96. package/dist/components/Calendar/shared/AllDaySection/AllDaySection.d.ts +7 -0
  97. package/dist/components/Calendar/shared/AllDaySection/index.d.ts +1 -0
  98. package/dist/components/Calendar/shared/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +10 -0
  99. package/dist/components/Calendar/shared/CurrentTimeIndicator/__tests__/CurrentTimeIndicator.test.d.ts +1 -0
  100. package/dist/components/Calendar/shared/CurrentTimeIndicator/index.d.ts +1 -0
  101. package/dist/components/Calendar/shared/EventCard/EventCard.d.ts +22 -0
  102. package/dist/components/Calendar/shared/EventCard/__tests__/EventCard.tooltip.test.d.ts +1 -0
  103. package/dist/components/Calendar/shared/EventCard/index.d.ts +1 -0
  104. package/dist/components/Calendar/shared/TimeAxis/TimeAxis.d.ts +6 -0
  105. package/dist/components/Calendar/shared/TimeAxis/index.d.ts +1 -0
  106. package/dist/components/Calendar/shared/TimeGrid/TimeGrid.d.ts +11 -0
  107. package/dist/components/Calendar/shared/TimeGrid/index.d.ts +1 -0
  108. package/dist/components/Calendar/style/__tests__/resolveCalendarThemeVars.test.d.ts +1 -0
  109. package/dist/components/Calendar/style/__tests__/resolveScheduleColorVars.test.d.ts +1 -0
  110. package/dist/components/Calendar/style/__tests__/resolveSubcomponentThemes.test.d.ts +1 -0
  111. package/dist/components/Calendar/style/index.d.ts +5 -0
  112. package/dist/components/Calendar/style/resolveCalendarThemeVars.d.ts +2 -0
  113. package/dist/components/Calendar/style/resolveScheduleColorVars.d.ts +3 -0
  114. package/dist/components/Calendar/style/resolveSubcomponentThemes.d.ts +5 -0
  115. package/dist/components/Calendar/utils/__tests__/dateUtils.test.d.ts +1 -0
  116. package/dist/components/Calendar/utils/__tests__/eventUtils.contract.test.d.ts +1 -0
  117. package/dist/components/Calendar/utils/__tests__/normalizeData.test.d.ts +1 -0
  118. package/dist/components/Calendar/utils/colorUtils.d.ts +8 -0
  119. package/dist/components/Calendar/utils/dateUtils.d.ts +25 -0
  120. package/dist/components/Calendar/utils/eventUtils.d.ts +44 -0
  121. package/dist/components/Calendar/utils/index.d.ts +7 -0
  122. package/dist/components/Calendar/utils/layout/dayLayoutAlgorithm.d.ts +31 -0
  123. package/dist/components/Calendar/utils/layout/index.d.ts +3 -0
  124. package/dist/components/Calendar/utils/layout/monthLayoutAlgorithm.d.ts +59 -0
  125. package/dist/components/Calendar/utils/layout/weekLayoutAlgorithm.d.ts +7 -0
  126. package/dist/components/Calendar/utils/normalizeData.d.ts +7 -0
  127. package/dist/components/Calendar/utils/timeUtils.d.ts +27 -0
  128. package/dist/components/Calendar/utils/weekTimedLayout.d.ts +14 -0
  129. package/dist/components/ColorPicker/useFloatingColorPicker.d.ts +1 -23
  130. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +1 -0
  131. package/dist/components/DatePicker/DatePicker.d.ts +3 -0
  132. package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +17 -0
  133. package/dist/components/DatePicker/DatePickerPanel/DatePickerPanel.d.ts +9 -0
  134. package/dist/components/DatePicker/MonthPicker/MonthPicker.d.ts +4 -0
  135. package/dist/components/DatePicker/TodayFooter/TodayFooter.d.ts +5 -0
  136. package/dist/components/DatePicker/YearPicker/YearPicker.d.ts +4 -0
  137. package/dist/components/DatePicker/__tests__/DatePicker.theme.test.d.ts +1 -0
  138. package/dist/components/DatePicker/__tests__/DatePickerPanel.dom.test.d.ts +1 -0
  139. package/dist/components/DatePicker/__tests__/DatePickerPanel.styles.test.d.ts +1 -0
  140. package/dist/components/DatePicker/index.d.ts +2 -0
  141. package/dist/components/DatePicker/interface.d.ts +37 -0
  142. package/dist/components/DatePicker/style/__tests__/resolveDatePickerThemeVars.test.d.ts +1 -0
  143. package/dist/components/DatePicker/style/index.d.ts +1 -0
  144. package/dist/components/DatePicker/style/resolveDatePickerThemeVars.d.ts +2 -0
  145. package/dist/components/DatePicker/utils/__tests__/normalizePickerValue.test.d.ts +1 -0
  146. package/dist/components/DatePicker/utils/chunkArray.d.ts +1 -0
  147. package/dist/components/DatePicker/utils/ensureDayjsPlugins.d.ts +2 -0
  148. package/dist/components/DatePicker/utils/formatPickerLabel.d.ts +1 -0
  149. package/dist/components/DatePicker/utils/normalizePickerValue.d.ts +10 -0
  150. package/dist/components/DatePicker/utils/pickerConstants.d.ts +8 -0
  151. package/dist/components/DatePicker/utils/pickerLocale.d.ts +4 -0
  152. package/dist/components/Segmented/Segmented.type.d.ts +30 -0
  153. package/dist/components/Segmented/__tests__/Segmented.theme.test.d.ts +1 -0
  154. package/dist/components/Segmented/index.d.ts +1 -1
  155. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  156. package/dist/components/Tooltip/Tooltip.type.d.ts +33 -0
  157. package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
  158. package/dist/components/Tooltip/context/TooltipFloatingContext.d.ts +2 -0
  159. package/dist/components/Tooltip/index.d.ts +3 -0
  160. package/dist/components/index.d.ts +8 -0
  161. package/dist/hooks/useFloatingOverlay.d.ts +20 -0
  162. package/dist/hooks/useLocale.d.ts +4 -2
  163. package/dist/index.js +39 -23
  164. package/dist/locale/LocaleContext.d.ts +2 -1
  165. package/dist/locale/formatLocaleMessage.d.ts +2 -0
  166. package/dist/locale/lang/en-US.json.d.ts +43 -1
  167. package/dist/locale/lang/zh-CN.json.d.ts +43 -1
  168. package/dist/locale/lang/zh-TW.json.d.ts +43 -1
  169. package/dist/style.css +1 -1
  170. package/dist/utils/cssVars.d.ts +1 -0
  171. package/dist/utils/mergeRefs.d.ts +4 -0
  172. package/dist/vendors/{ConfigProvider-BekyDD3V.js → ConfigProvider-aWr8b3e3.js} +123 -32
  173. package/dist/vendors/{LocaleContext-Jj_JGgi2.js → LocaleContext-CuXR7Y03.js} +52 -7
  174. package/dist/vendors/{Tree-Bg2UzLsC.js → Tree-BTQ25Pi7.js} +3 -3
  175. package/dist/vendors/cssVars-C4BlzyxA.js +6 -0
  176. package/dist/vendors/useFloatingOverlay-uxlI1G-V.js +26 -0
  177. package/dist/vendors/{useLocale-Mk0d7wNt.js → useLocale-DvdSwM9e.js} +1 -1
  178. package/package.json +8 -3
  179. package/dist/ColorPicker/ColorPicker-nnQIw0_e.js +0 -168
  180. package/dist/Segmented/Segmented-Byw8j1hQ.js +0 -62
  181. /package/dist/Loading/{Loading-dsLWSWsE.js → Loading-WjmzBabh.js} +0 -0
  182. /package/dist/NotFoundContent/{NotFoundContent-DJUQ0_2D.js → NotFoundContent-7xV-zOG2.js} +0 -0
  183. /package/dist/Radio/{Radio-WNw-VqIS.js → Radio-DkrZHoG1.js} +0 -0
  184. /package/dist/vendors/{animations-C2i5EijE.js → animations-BmT0HT5q.js} +0 -0
  185. /package/dist/vendors/{color-CxdZwdYM.js → color-BeQo449h.js} +0 -0
  186. /package/dist/vendors/{useFloatingPortal-CDgiCnbb.js → useFloatingPortal-DsEtsAGW.js} +0 -0
@@ -0,0 +1,17 @@
1
+ export interface DatePickerHeaderProps {
2
+ prefixCls: string;
3
+ yearLabel?: string;
4
+ monthLabel?: string;
5
+ rangeLabel?: string;
6
+ isMonthPanel?: boolean;
7
+ navType: 'month' | 'year' | 'years';
8
+ prevLabel: string;
9
+ nextLabel: string;
10
+ switchToMonthLabel?: string;
11
+ onPrev: () => void;
12
+ onNext: () => void;
13
+ onYearClick?: () => void;
14
+ onMonthClick?: () => void;
15
+ }
16
+ declare const DatePickerHeader: React.FC<DatePickerHeaderProps>;
17
+ export default DatePickerHeader;
@@ -0,0 +1,9 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { PickerType } from '../interface';
3
+ export interface DatePickerPanelProps {
4
+ picker: PickerType;
5
+ value?: Dayjs;
6
+ onChange: (date: Dayjs) => void;
7
+ }
8
+ declare const DatePickerPanel: React.FC<DatePickerPanelProps>;
9
+ export default DatePickerPanel;
@@ -0,0 +1,4 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { SharedPanelProps } from '@rc-component/picker/es/interface';
3
+ declare const MonthPicker: React.FC<SharedPanelProps<Dayjs>>;
4
+ export default MonthPicker;
@@ -0,0 +1,5 @@
1
+ export interface TodayFooterProps {
2
+ onClick: () => void;
3
+ }
4
+ declare const TodayFooter: React.FC<TodayFooterProps>;
5
+ export default TodayFooter;
@@ -0,0 +1,4 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { SharedPanelProps } from '@rc-component/picker/es/interface';
3
+ declare const YearPicker: React.FC<SharedPanelProps<Dayjs>>;
4
+ export default YearPicker;
@@ -0,0 +1,2 @@
1
+ export { default } from './DatePicker';
2
+ export type { DatePickerProps, DatePickerTheme, PickerType } from './interface';
@@ -0,0 +1,37 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { ReactElement } from 'react';
3
+ export type PickerType = 'date' | 'week' | 'month' | 'year';
4
+ export interface DatePickerTheme {
5
+ /** 面板背景色 */
6
+ colorBgContainer?: string;
7
+ /** 主色 / 强调色(today 描边、底部「今天」按钮、选中等) */
8
+ colorPrimary?: string;
9
+ /** 主色 hover 背景(底部「今天」按钮 hover、月/年单元格 hover 等),不传时由 colorPrimary 按 30% 透明度生成 */
10
+ colorPrimaryHover?: string;
11
+ /** 面板头部文字颜色 */
12
+ headerColor?: string;
13
+ /** 面板头部悬浮时的颜色 */
14
+ headerHoverColor?: string;
15
+ /** 普通日期文字颜色 */
16
+ colorText?: string;
17
+ /** 过期日期文字颜色 */
18
+ colorTextTertiary?: string;
19
+ /** 当前选中日期填充色 */
20
+ cellSelectedBg?: string;
21
+ /** 周模式行悬停 / 选中范围背景色 */
22
+ weekRangeBg?: string;
23
+ }
24
+ export interface DatePickerProps {
25
+ /** 选择器类型:date / week / month / year */
26
+ picker?: PickerType;
27
+ /** 当前选中值(受控) */
28
+ value?: Dayjs;
29
+ /** 非受控初始值 */
30
+ defaultValue?: Dayjs;
31
+ /** 选中后的回调 */
32
+ onChange?: (value: Dayjs) => void;
33
+ /** 触发浮层的单个 React 元素 */
34
+ children: ReactElement;
35
+ /** 组件级颜色 token */
36
+ theme?: DatePickerTheme;
37
+ }
@@ -0,0 +1 @@
1
+ export { resolveDatePickerThemeVars } from './resolveDatePickerThemeVars';
@@ -0,0 +1,2 @@
1
+ import { DatePickerTheme } from '../interface';
2
+ export declare const resolveDatePickerThemeVars: (theme?: DatePickerTheme) => Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const chunkArray: <T>(items: T[], size: number) => T[][];
@@ -0,0 +1,2 @@
1
+ /** 幂等注册 DatePicker / Calendar 依赖的 dayjs 插件,与消费方共用同一 dayjs 单例。 */
2
+ export declare const ensureDayjsPlugins: () => void;
@@ -0,0 +1 @@
1
+ export declare const formatPickerLabel: (template: string, values: Record<string, string | number>) => string;
@@ -0,0 +1,10 @@
1
+ import { Dayjs } from 'dayjs';
2
+ import { PickerType } from '../interface';
3
+ /**
4
+ * 将 rc-picker 选中的原始值按 picker 粒度归一化。
5
+ * - date:当天 00:00
6
+ * - week:该周 ISO 周一(与 Calendar isoWeek 一致)
7
+ * - month:该月 1 日
8
+ * - year:该年 1 月 1 日
9
+ */
10
+ export declare const normalizePickerValue: (value: Dayjs, picker: PickerType) => Dayjs;
@@ -0,0 +1,8 @@
1
+ /** rc-picker PickerPanel 的 prefixCls,与 SCSS 中 .bsy-date-picker-* 类名对应 */
2
+ export declare const PREFIX_CLS = "bsy-date-picker";
3
+ /** 年面板每页年份数(5 行 × 4 列) */
4
+ export declare const YEAR_PAGE_SIZE = 20;
5
+ export declare const YEAR_COL_COUNT = 4;
6
+ export declare const MONTH_COL_COUNT = 3;
7
+ export declare const getYearPageBaseYear: (year: number) => number;
8
+ export declare const formatYearPageRange: (baseYear: number) => string;
@@ -0,0 +1,4 @@
1
+ import { Locale } from '../../../locale/index';
2
+ export declare const getPickerLocale: (locale: Locale) => any;
3
+ export declare const DAYJS_LOCALE_MAP: Record<Locale, string>;
4
+ export declare const resolveDayjsLocale: (locale: Locale) => string;
@@ -7,6 +7,28 @@ export type LayoutState = {
7
7
  width: number;
8
8
  left: number;
9
9
  };
10
+ export type SegmentedTheme = {
11
+ /**
12
+ * @description 普通文字颜色
13
+ */
14
+ colorText?: string;
15
+ /**
16
+ * @description 选中项背景色
17
+ */
18
+ itemSelectedBg?: string;
19
+ /**
20
+ * @description 选项悬停背景色
21
+ */
22
+ itemHoverBg?: string;
23
+ /**
24
+ * @description 选项悬停边框色
25
+ */
26
+ itemHoverBorder?: string;
27
+ /**
28
+ * @description 非选中项背景色
29
+ */
30
+ trackBg?: string;
31
+ };
10
32
  export type SegmentedProps<T extends React.Key = string | number> = {
11
33
  /**
12
34
  * @description 将宽度调整为父元素宽度的选项
@@ -28,4 +50,12 @@ export type SegmentedProps<T extends React.Key = string | number> = {
28
50
  * @description 是否禁用
29
51
  */
30
52
  disabled?: boolean;
53
+ /**
54
+ * @description 用户点击切换时是否启用滑块滑动动画;首屏定位始终瞬间完成
55
+ */
56
+ enableAnimation?: boolean;
57
+ /**
58
+ * @description 组件级颜色 token
59
+ */
60
+ theme?: SegmentedTheme;
31
61
  };
@@ -1,2 +1,2 @@
1
1
  export { default } from './Segmented';
2
- export type { SegmentedProps, SegmentedOption } from './Segmented.type';
2
+ export type { SegmentedProps, SegmentedOption, SegmentedTheme } from './Segmented.type';
@@ -0,0 +1,6 @@
1
+ import { TooltipProps } from './Tooltip.type';
2
+ declare const Tooltip: {
3
+ ({ content, children, ...rest }: TooltipProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Tooltip;
@@ -0,0 +1,33 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { Boundary, Placement, UseTransitionStylesProps } from '@floating-ui/react';
3
+ export type TooltipTrigger = 'hover' | 'click';
4
+ export type TooltipWidthMode = 'content' | 'manual' | 'reference';
5
+ export type VirtualReference = {
6
+ getBoundingClientRect: () => DOMRect;
7
+ };
8
+ export type TooltipProps = {
9
+ children: ReactNode;
10
+ /** 浮层内容;为空时仅渲染 children */
11
+ content?: ReactNode;
12
+ trigger?: TooltipTrigger;
13
+ style?: CSSProperties;
14
+ showArrow?: boolean;
15
+ placement?: Placement;
16
+ onClose?: () => void;
17
+ hoverDelay?: number;
18
+ getPopupContainer?: () => HTMLElement | null | undefined;
19
+ /** hover 模式下鼠标移入浮层是否保持打开 */
20
+ moveToFloatingKeepOpen?: boolean;
21
+ widthMode?: TooltipWidthMode;
22
+ width?: number | string;
23
+ minWidth?: number | string;
24
+ maxWidth?: number | string;
25
+ offset?: number;
26
+ fallbackPlacements?: Placement[];
27
+ virtualReference?: VirtualReference | null;
28
+ flipBoundary?: Boundary;
29
+ animated?: boolean;
30
+ animationConfig?: UseTransitionStylesProps;
31
+ visible?: boolean;
32
+ onVisibleChange?: (visible: boolean) => void;
33
+ };
@@ -0,0 +1,2 @@
1
+ /** 浮层 DOM,供 content 内嵌套子浮层挂载,避免移入子层时主 Tooltip 关闭 */
2
+ export declare const TooltipFloatingContext: import('react').Context<HTMLElement | null>;
@@ -0,0 +1,3 @@
1
+ export { default } from './Tooltip';
2
+ export { TooltipFloatingContext } from './context/TooltipFloatingContext';
3
+ export type { TooltipProps, TooltipTrigger, TooltipWidthMode, VirtualReference, } from './Tooltip.type';
@@ -8,6 +8,9 @@ export { default as Card } from './Card';
8
8
  export { default as Modal } from './Modal';
9
9
  export { default as ColorPicker } from './ColorPicker';
10
10
  export { default as Segmented } from './Segmented';
11
+ export type { SegmentedOption, SegmentedProps, SegmentedTheme } from './Segmented';
12
+ export { default as Tooltip, TooltipFloatingContext } from './Tooltip';
13
+ export type { TooltipProps, TooltipTrigger, TooltipWidthMode, VirtualReference } from './Tooltip';
11
14
  export { Select } from './Select';
12
15
  export { Tree } from './Tree';
13
16
  export { default as Checkbox } from './CheckBox';
@@ -18,3 +21,8 @@ export { default as Loading } from './Loading';
18
21
  export { NotFoundContent } from './NotFoundContent';
19
22
  export { default as TabSelect } from './Tabs/TabSelect/TabSelect';
20
23
  export { default as InputTag } from './InputTag';
24
+ export { default as Calendar } from './Calendar';
25
+ export type { CalendarProps, CalendarDataItem, CalendarTimeInput, CalendarMode, CalendarAxis, CalendarTheme, CalendarPanelBgImagePosition, CalendarTooltipConfig, CalendarEventClickHandler, AddClickPayload, PlatformCalendarThemeConfig, } from './Calendar';
26
+ export { resolveCalendarThemeVars, resolvePlatformCalendarTheme } from './Calendar';
27
+ export { default as DatePicker } from './DatePicker';
28
+ export type { DatePickerProps, DatePickerTheme, PickerType } from './DatePicker';
@@ -0,0 +1,20 @@
1
+ import { Placement, ReferenceType } from '@floating-ui/react';
2
+ import { CSSProperties, Dispatch, SetStateAction } from 'react';
3
+ export interface UseFloatingOverlayOptions {
4
+ placement?: Placement;
5
+ /** 浮层与触发器间距,默认 4px */
6
+ offset?: number;
7
+ }
8
+ export interface UseFloatingOverlayReturn {
9
+ isOpen: boolean;
10
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
11
+ refs: {
12
+ setReference: (node: ReferenceType | null) => void;
13
+ setFloating: (node: HTMLElement | null) => void;
14
+ };
15
+ floatingStyles: CSSProperties;
16
+ getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
17
+ getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
18
+ }
19
+ declare const useFloatingOverlay: (options?: UseFloatingOverlayOptions) => UseFloatingOverlayReturn;
20
+ export default useFloatingOverlay;
@@ -1,9 +1,11 @@
1
1
  import { default as zhCN } from '../locale/lang/zh-CN.json';
2
+ import { LocaleParams } from '../locale/formatLocaleMessage';
3
+ import { Locale } from '../locale';
2
4
  type FlattenObjectKeys<T, K extends keyof T = keyof T> = K extends string ? T[K] extends object ? `${K}.${FlattenObjectKeys<T[K]>}` : `${K}` : never;
3
5
  export type LocaleKeys = FlattenObjectKeys<typeof zhCN>;
4
6
  interface ILocaleContext {
5
- locale: string;
6
- t: (key: LocaleKeys) => string;
7
+ locale: Locale;
8
+ t: (key: LocaleKeys, params?: LocaleParams) => string;
7
9
  }
8
10
  /**
9
11
  * 获取当前语言
package/dist/index.js CHANGED
@@ -1,32 +1,48 @@
1
- import { t as e } from "./Icon/Icon-CTZCSuVg.js";
2
- import "./vendors/LocaleContext-Jj_JGgi2.js";
3
- import { r as t, t as n } from "./vendors/ConfigProvider-BekyDD3V.js";
1
+ import { t as e } from "./Icon/Icon-BQ3Whub2.js";
2
+ import "./vendors/LocaleContext-CuXR7Y03.js";
3
+ import { r as t, t as n } from "./vendors/ConfigProvider-aWr8b3e3.js";
4
4
  import "./Amap/AmapContext-JaYk1a3H.js";
5
- import { t as r } from "./Amap/AmapProvider-BkJp-sWi.js";
5
+ import { t as r } from "./Amap/AmapProvider-BgGnih_w.js";
6
6
  import { t as i } from "./Amap/Amap-DL5dLiUm.js";
7
7
  import { n as a, t as o } from "./Amap/hooks-D1m8KgVM.js";
8
8
  import { t as s } from "./Amap/AmapCircle-mh92P2l6.js";
9
9
  import "./Amap/useMarkerInfoWindowController-CRgf2I0Q.js";
10
10
  import { t as c } from "./Amap/AmapMarker-DYW0-8Hd.js";
11
11
  import { t as l } from "./Amap/AmapMarkerCluster-BRVHHMbi.js";
12
- import { t as u } from "./Card/Card-D__c94yx.js";
13
- import { t as d } from "./Modal/Modal-CweuD-VO.js";
14
- import { t as f } from "./ColorPicker/ColorPicker-nnQIw0_e.js";
15
- import "./vendors/useLocale-Mk0d7wNt.js";
16
- import "./vendors/color-CxdZwdYM.js";
17
- import { t as p } from "./Segmented/Segmented-Byw8j1hQ.js";
18
- import { t as m } from "./Select/Select-D8T0S1_m.js";
19
- import "./Select/SelectInputSearch-Dm3CI_L4.js";
20
- import { t as h } from "./vendors/Tree-Bg2UzLsC.js";
21
- import "./CheckBox/CheckBox-DF201Nxg.js";
22
- import { t as g } from "./CheckBox/CheckBox-B04hZKaC.js";
23
- import { t as _ } from "./Radio/Radio-WNw-VqIS.js";
24
- import { t as v } from "./NotFoundContent/NotFoundContent-DJUQ0_2D.js";
25
- import "./vendors/useFloatingPortal-CDgiCnbb.js";
12
+ import { t as u } from "./Card/Card-CRrtIjNT.js";
13
+ import { t as d } from "./Modal/Modal-B5AW5GKt.js";
14
+ import { t as f } from "./ColorPicker/ColorPicker-CKqNqAsK.js";
15
+ import "./vendors/useFloatingOverlay-uxlI1G-V.js";
16
+ import "./vendors/useLocale-DvdSwM9e.js";
17
+ import "./vendors/color-BeQo449h.js";
18
+ import { t as p } from "./Segmented/Segmented-BTW445jc.js";
19
+ import { n as m, t as h } from "./Tooltip/Tooltip-RkD8fs0B.js";
20
+ import { t as g } from "./Select/Select-BGsQ-PVq.js";
21
+ import "./Select/SelectInputSearch-CraymTXM.js";
22
+ import { t as _ } from "./vendors/Tree-BTQ25Pi7.js";
23
+ import "./CheckBox/CheckBox-CkVe5Boq.js";
24
+ import { t as v } from "./CheckBox/CheckBox-DIunYcfS.js";
25
+ import { t as y } from "./Radio/Radio-DkrZHoG1.js";
26
+ import { t as b } from "./NotFoundContent/NotFoundContent-7xV-zOG2.js";
27
+ import "./vendors/useFloatingPortal-DsEtsAGW.js";
26
28
  import "./Tree/index.js";
27
- import { n as y, t as b } from "./Tabs/Tabs-Cxf7jwys.js";
28
- import { t as x } from "./DropDown/DropDown-CMKiQDrc.js";
29
- import { t as S } from "./Loading/Loading-dsLWSWsE.js";
29
+ import { n as x, t as S } from "./Tabs/Tabs-CPRNkfMo.js";
30
+ import { t as C } from "./DropDown/DropDown-BR-Tz58r.js";
31
+ import { t as w } from "./Loading/Loading-WjmzBabh.js";
30
32
  import "./NotFoundContent/index.js";
31
- import { t as C } from "./InputTag/InputTag-F2Dv-r56.js";
32
- export { i as Amap, s as AmapCircle, c as AmapMarker, l as AmapMarkerCluster, r as AmapProvider, u as Card, g as Checkbox, f as ColorPicker, n as ConfigProvider, x as DropDown, e as Icon, C as InputTag, S as Loading, t as LocalTheme, d as Modal, v as NotFoundContent, _ as Ratio, p as Segmented, m as Select, b as TabSelect, y as Tabs, h as Tree, a as useAmap, o as useCurrentLocation };
33
+ import { t as T } from "./InputTag/InputTag-zP5QdId7.js";
34
+ import "./Calendar/context-DNOJ9LW_.js";
35
+ import { t as E } from "./Calendar/Calendar-CAG1Fxlh.js";
36
+ import { t as D } from "./DatePicker/DatePicker-BIxiJQ_W.js";
37
+ import "./DatePicker/ensureDayjsPlugins-DZjJnZgo.js";
38
+ import "./DatePicker/pickerLocale-VqSP_iIm.js";
39
+ import "./DatePicker/style-DZaSSoNs.js";
40
+ import "./Calendar/layout-DvWx_7gn.js";
41
+ import "./Calendar/TimeAxis-gKb8dTwY.js";
42
+ import "./Calendar/TimeGrid-D8Du5vFP.js";
43
+ import "./Calendar/CurrentTimeIndicator-DaIywtIA.js";
44
+ import "./Calendar/EventCard-D_VeOVDQ.js";
45
+ import "./Calendar/AllDaySection-DS0Frx1p.js";
46
+ import { i as O } from "./Calendar/style-hCRKx3m1.js";
47
+ import { t as k } from "./Calendar/adapters-zYR7CgzD.js";
48
+ export { i as Amap, s as AmapCircle, c as AmapMarker, l as AmapMarkerCluster, r as AmapProvider, E as Calendar, u as Card, v as Checkbox, f as ColorPicker, n as ConfigProvider, D as DatePicker, C as DropDown, e as Icon, T as InputTag, w as Loading, t as LocalTheme, d as Modal, b as NotFoundContent, y as Ratio, p as Segmented, g as Select, S as TabSelect, x as Tabs, h as Tooltip, m as TooltipFloatingContext, _ as Tree, O as resolveCalendarThemeVars, k as resolvePlatformCalendarTheme, a as useAmap, o as useCurrentLocation };
@@ -1,9 +1,10 @@
1
1
  import { LocaleKeys } from '../hooks/useLocale';
2
2
  import { Locale } from './index';
3
+ import { LocaleParams } from './formatLocaleMessage';
3
4
  /**
4
5
  * @description 国际化上下文
5
6
  */
6
7
  export declare const LocaleContext: import('react').Context<{
7
8
  locale: Locale;
8
- t: (key: LocaleKeys) => string;
9
+ t: (key: LocaleKeys, params?: LocaleParams) => string;
9
10
  }>;
@@ -0,0 +1,2 @@
1
+ export type LocaleParams = Record<string, string | number>;
2
+ export declare const formatLocaleMessage: (template: string, params?: LocaleParams) => string;
@@ -57,7 +57,49 @@ declare const _default: {
57
57
  },
58
58
  "picture": "Picture",
59
59
  "customColor": "Custom Color",
60
- "addPicture": "Add Picture"
60
+ "addPicture": "Add Picture",
61
+ "datePicker": {
62
+ "today": "Today",
63
+ "yearLabel": "{{year}}",
64
+ "monthLabel": "{{month}}",
65
+ "switchToMonthPanel": "Switch to month panel",
66
+ "prevMonth": "Previous month",
67
+ "nextMonth": "Next month",
68
+ "prevYear": "Previous year",
69
+ "nextYear": "Next year",
70
+ "prevYearsPage": "Previous years",
71
+ "nextYearsPage": "Next years"
72
+ },
73
+ "calendar": {
74
+ "today": "Today",
75
+ "prev": "Previous",
76
+ "next": "Next",
77
+ "yearMonth": "{{year}}-{{month}}",
78
+ "fullDate": "{{year}}-{{month}}-{{day}}",
79
+ "monthDay": "{{month}}-{{day}}",
80
+ "dayOnly": "{{day}}",
81
+ "allDay": "All Day",
82
+ "remainingCount": "{{count}} more",
83
+ "collapse": "Collapse",
84
+ "noEvents": "No events",
85
+ "moreEvents": "{{count}} more records",
86
+ "addRecord": "Add Record",
87
+ "close": "Close",
88
+ "mode": {
89
+ "day": "Day",
90
+ "week": "Week",
91
+ "month": "Month"
92
+ },
93
+ "weekday": {
94
+ "0": "Mon",
95
+ "1": "Tue",
96
+ "2": "Wed",
97
+ "3": "Thu",
98
+ "4": "Fri",
99
+ "5": "Sat",
100
+ "6": "Sun"
101
+ }
102
+ }
61
103
  }
62
104
  ;
63
105
 
@@ -57,7 +57,49 @@ declare const _default: {
57
57
  },
58
58
  "picture": "图片",
59
59
  "addPicture": "添加图片",
60
- "customColor": "自定义颜色"
60
+ "customColor": "自定义颜色",
61
+ "datePicker": {
62
+ "today": "今天",
63
+ "yearLabel": "{{year}}年",
64
+ "monthLabel": "{{month}}月",
65
+ "switchToMonthPanel": "切换到月份面板",
66
+ "prevMonth": "上一月",
67
+ "nextMonth": "下一月",
68
+ "prevYear": "上一年",
69
+ "nextYear": "下一年",
70
+ "prevYearsPage": "上一页年份",
71
+ "nextYearsPage": "下一页年份"
72
+ },
73
+ "calendar": {
74
+ "today": "今天",
75
+ "prev": "上一页",
76
+ "next": "下一页",
77
+ "yearMonth": "{{year}}年{{month}}月",
78
+ "fullDate": "{{year}}年{{month}}月{{day}}日",
79
+ "monthDay": "{{month}}月{{day}}日",
80
+ "dayOnly": "{{day}}日",
81
+ "allDay": "全天",
82
+ "remainingCount": "还剩{{count}}条",
83
+ "collapse": "收起",
84
+ "noEvents": "暂无日程",
85
+ "moreEvents": "还有{{count}}条记录",
86
+ "addRecord": "添加记录",
87
+ "close": "关闭",
88
+ "mode": {
89
+ "day": "日",
90
+ "week": "周",
91
+ "month": "月"
92
+ },
93
+ "weekday": {
94
+ "0": "周一",
95
+ "1": "周二",
96
+ "2": "周三",
97
+ "3": "周四",
98
+ "4": "周五",
99
+ "5": "周六",
100
+ "6": "周日"
101
+ }
102
+ }
61
103
  }
62
104
  ;
63
105
 
@@ -57,7 +57,49 @@ declare const _default: {
57
57
  },
58
58
  "picture": "圖片",
59
59
  "addPicture": "新增圖片",
60
- "customColor": "自訂顏色"
60
+ "customColor": "自訂顏色",
61
+ "datePicker": {
62
+ "today": "今天",
63
+ "yearLabel": "{{year}}年",
64
+ "monthLabel": "{{month}}月",
65
+ "switchToMonthPanel": "切換到月份面板",
66
+ "prevMonth": "上一月",
67
+ "nextMonth": "下一月",
68
+ "prevYear": "上一年",
69
+ "nextYear": "下一年",
70
+ "prevYearsPage": "上一頁年份",
71
+ "nextYearsPage": "下一頁年份"
72
+ },
73
+ "calendar": {
74
+ "today": "今天",
75
+ "prev": "上一頁",
76
+ "next": "下一頁",
77
+ "yearMonth": "{{year}}年{{month}}月",
78
+ "fullDate": "{{year}}年{{month}}月{{day}}日",
79
+ "monthDay": "{{month}}月{{day}}日",
80
+ "dayOnly": "{{day}}日",
81
+ "allDay": "全天",
82
+ "remainingCount": "還剩{{count}}條",
83
+ "collapse": "收起",
84
+ "noEvents": "暫無日程",
85
+ "moreEvents": "還有{{count}}條記錄",
86
+ "addRecord": "添加記錄",
87
+ "close": "關閉",
88
+ "mode": {
89
+ "day": "日",
90
+ "week": "週",
91
+ "month": "月"
92
+ },
93
+ "weekday": {
94
+ "0": "週一",
95
+ "1": "週二",
96
+ "2": "週三",
97
+ "3": "週四",
98
+ "4": "週五",
99
+ "5": "週六",
100
+ "6": "週日"
101
+ }
102
+ }
61
103
  }
62
104
  ;
63
105