@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.
- package/dist/Amap/AmapProvider/index.js +3 -3
- package/dist/Amap/{AmapProvider-BkJp-sWi.js → AmapProvider-BgGnih_w.js} +1 -1
- package/dist/Amap/index.js +3 -3
- package/dist/Calendar/AllDaySection-DS0Frx1p.js +53 -0
- package/dist/Calendar/Calendar-CAG1Fxlh.js +806 -0
- package/dist/Calendar/CurrentTimeIndicator-DaIywtIA.js +59 -0
- package/dist/Calendar/EventCard-D_VeOVDQ.js +155 -0
- package/dist/Calendar/TimeAxis-gKb8dTwY.js +13 -0
- package/dist/Calendar/TimeGrid-D8Du5vFP.js +47 -0
- package/dist/Calendar/adapters/index.js +2 -0
- package/dist/Calendar/adapters-zYR7CgzD.js +20 -0
- package/dist/Calendar/colorUtils-DcpqM3KR.js +55 -0
- package/dist/Calendar/context/index.js +2 -0
- package/dist/Calendar/context-DNOJ9LW_.js +21 -0
- package/dist/Calendar/index.js +21 -0
- package/dist/Calendar/layout-DvWx_7gn.js +302 -0
- package/dist/Calendar/shared/AllDaySection/index.js +8 -0
- package/dist/Calendar/shared/CurrentTimeIndicator/index.js +5 -0
- package/dist/Calendar/shared/EventCard/index.js +6 -0
- package/dist/Calendar/shared/TimeAxis/index.js +4 -0
- package/dist/Calendar/shared/TimeGrid/index.js +4 -0
- package/dist/Calendar/style/index.js +2 -0
- package/dist/Calendar/style-hCRKx3m1.js +55 -0
- package/dist/Calendar/utils/index.js +114 -0
- package/dist/Calendar/utils/layout/index.js +3 -0
- package/dist/Card/{Card-D__c94yx.js → Card-CRrtIjNT.js} +1 -1
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/{CheckBox-DF201Nxg.js → CheckBox-CkVe5Boq.js} +1 -1
- package/dist/CheckBox/{CheckBox-B04hZKaC.js → CheckBox-DIunYcfS.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/ColorPicker-CKqNqAsK.js +150 -0
- package/dist/ColorPicker/index.js +6 -5
- package/dist/ConfigProvider/index.js +2 -2
- package/dist/DatePicker/DatePicker-BIxiJQ_W.js +91 -0
- package/dist/DatePicker/DatePickerPanel-CsiEGC-1.js +217 -0
- package/dist/DatePicker/ensureDayjsPlugins-DZjJnZgo.js +16 -0
- package/dist/DatePicker/index.js +8 -0
- package/dist/DatePicker/pickerLocale-VqSP_iIm.js +15 -0
- package/dist/DatePicker/style/index.js +2 -0
- package/dist/DatePicker/style-DZaSSoNs.js +15 -0
- package/dist/DropDown/{DropDown-CMKiQDrc.js → DropDown-BR-Tz58r.js} +5 -5
- package/dist/DropDown/index.js +7 -7
- package/dist/Editor/{Buttons-D17RQIEb.js → Buttons-DdZg3jAa.js} +6 -6
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +14 -13
- package/dist/Editor/index.js +14 -13
- package/dist/Icon/{Icon-CTZCSuVg.js → Icon-BQ3Whub2.js} +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-F2Dv-r56.js → InputTag-zP5QdId7.js} +1 -1
- package/dist/InputTag/index.js +2 -2
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/{Modal-CweuD-VO.js → Modal-B5AW5GKt.js} +6 -5
- package/dist/Modal/index.js +2 -2
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/Segmented/Segmented-BTW445jc.js +82 -0
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-D8T0S1_m.js → Select-BGsQ-PVq.js} +14 -15
- package/dist/Select/{SelectInputSearch-Dm3CI_L4.js → SelectInputSearch-CraymTXM.js} +3 -3
- package/dist/Select/index.js +11 -11
- package/dist/Tabs/{Tabs-Cxf7jwys.js → Tabs-CPRNkfMo.js} +4 -4
- package/dist/Tabs/index.js +4 -4
- package/dist/Tooltip/Tooltip-RkD8fs0B.js +169 -0
- package/dist/Tooltip/index.js +2 -0
- package/dist/Tree/index.js +4 -4
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/Calendar/Header/CalendarHeader/CalendarHeader.d.ts +2 -0
- package/dist/components/Calendar/Header/CalendarHeaderLeft/CalendarHeaderLeft.d.ts +2 -0
- package/dist/components/Calendar/Header/DateDisplay/DateDisplay.d.ts +2 -0
- package/dist/components/Calendar/Header/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +1 -0
- package/dist/components/Calendar/Header/NavButton/NavButton.d.ts +6 -0
- package/dist/components/Calendar/Header/TodayButton/TodayButton.d.ts +2 -0
- package/dist/components/Calendar/__tests__/Calendar.contract.test.d.ts +1 -0
- package/dist/components/Calendar/__tests__/algorithm/monthLayoutAlgorithm.test.d.ts +1 -0
- package/dist/components/Calendar/__tests__/helpers/testFormatMessage.d.ts +2 -0
- package/dist/components/Calendar/adapters/__tests__/platformTheme.test.d.ts +1 -0
- package/dist/components/Calendar/adapters/index.d.ts +1 -0
- package/dist/components/Calendar/adapters/platformTheme.d.ts +29 -0
- package/dist/components/Calendar/constants.d.ts +12 -0
- package/dist/components/Calendar/context/CalendarContext.d.ts +29 -0
- package/dist/components/Calendar/context/index.d.ts +2 -0
- package/dist/components/Calendar/context/useCalendarContext.d.ts +3 -0
- package/dist/components/Calendar/index.d.ts +4 -0
- package/dist/components/Calendar/interface.d.ts +62 -0
- package/dist/components/Calendar/internalTypes.d.ts +56 -0
- package/dist/components/Calendar/panels/DayPanel/DayPanel.d.ts +3 -0
- package/dist/components/Calendar/panels/DayPanel/__tests__/CalendarDay.dayFilter.test.d.ts +1 -0
- package/dist/components/Calendar/panels/MonthPanel/MonthCell/MonthCell.d.ts +10 -0
- package/dist/components/Calendar/panels/MonthPanel/MonthCell/MonthCellPopover/MonthCellPopover.d.ts +10 -0
- package/dist/components/Calendar/panels/MonthPanel/MonthHeader/MonthHeader.d.ts +2 -0
- package/dist/components/Calendar/panels/MonthPanel/MonthPanel.d.ts +3 -0
- package/dist/components/Calendar/panels/MonthPanel/WeekEventLayer/MoreButton.d.ts +11 -0
- package/dist/components/Calendar/panels/MonthPanel/WeekEventLayer/WeekEventLayer.d.ts +3 -0
- package/dist/components/Calendar/panels/WeekPanel/WeekAllDaySection/WeekAllDaySection.d.ts +11 -0
- package/dist/components/Calendar/panels/WeekPanel/WeekHeader/WeekHeader.d.ts +6 -0
- package/dist/components/Calendar/panels/WeekPanel/WeekPanel.d.ts +3 -0
- package/dist/components/Calendar/shared/AllDaySection/AllDaySection.d.ts +7 -0
- package/dist/components/Calendar/shared/AllDaySection/index.d.ts +1 -0
- package/dist/components/Calendar/shared/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +10 -0
- package/dist/components/Calendar/shared/CurrentTimeIndicator/__tests__/CurrentTimeIndicator.test.d.ts +1 -0
- package/dist/components/Calendar/shared/CurrentTimeIndicator/index.d.ts +1 -0
- package/dist/components/Calendar/shared/EventCard/EventCard.d.ts +22 -0
- package/dist/components/Calendar/shared/EventCard/__tests__/EventCard.tooltip.test.d.ts +1 -0
- package/dist/components/Calendar/shared/EventCard/index.d.ts +1 -0
- package/dist/components/Calendar/shared/TimeAxis/TimeAxis.d.ts +6 -0
- package/dist/components/Calendar/shared/TimeAxis/index.d.ts +1 -0
- package/dist/components/Calendar/shared/TimeGrid/TimeGrid.d.ts +11 -0
- package/dist/components/Calendar/shared/TimeGrid/index.d.ts +1 -0
- package/dist/components/Calendar/style/__tests__/resolveCalendarThemeVars.test.d.ts +1 -0
- package/dist/components/Calendar/style/__tests__/resolveScheduleColorVars.test.d.ts +1 -0
- package/dist/components/Calendar/style/__tests__/resolveSubcomponentThemes.test.d.ts +1 -0
- package/dist/components/Calendar/style/index.d.ts +5 -0
- package/dist/components/Calendar/style/resolveCalendarThemeVars.d.ts +2 -0
- package/dist/components/Calendar/style/resolveScheduleColorVars.d.ts +3 -0
- package/dist/components/Calendar/style/resolveSubcomponentThemes.d.ts +5 -0
- package/dist/components/Calendar/utils/__tests__/dateUtils.test.d.ts +1 -0
- package/dist/components/Calendar/utils/__tests__/eventUtils.contract.test.d.ts +1 -0
- package/dist/components/Calendar/utils/__tests__/normalizeData.test.d.ts +1 -0
- package/dist/components/Calendar/utils/colorUtils.d.ts +8 -0
- package/dist/components/Calendar/utils/dateUtils.d.ts +25 -0
- package/dist/components/Calendar/utils/eventUtils.d.ts +44 -0
- package/dist/components/Calendar/utils/index.d.ts +7 -0
- package/dist/components/Calendar/utils/layout/dayLayoutAlgorithm.d.ts +31 -0
- package/dist/components/Calendar/utils/layout/index.d.ts +3 -0
- package/dist/components/Calendar/utils/layout/monthLayoutAlgorithm.d.ts +59 -0
- package/dist/components/Calendar/utils/layout/weekLayoutAlgorithm.d.ts +7 -0
- package/dist/components/Calendar/utils/normalizeData.d.ts +7 -0
- package/dist/components/Calendar/utils/timeUtils.d.ts +27 -0
- package/dist/components/Calendar/utils/weekTimedLayout.d.ts +14 -0
- package/dist/components/ColorPicker/useFloatingColorPicker.d.ts +1 -23
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/components/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +17 -0
- package/dist/components/DatePicker/DatePickerPanel/DatePickerPanel.d.ts +9 -0
- package/dist/components/DatePicker/MonthPicker/MonthPicker.d.ts +4 -0
- package/dist/components/DatePicker/TodayFooter/TodayFooter.d.ts +5 -0
- package/dist/components/DatePicker/YearPicker/YearPicker.d.ts +4 -0
- package/dist/components/DatePicker/__tests__/DatePicker.theme.test.d.ts +1 -0
- package/dist/components/DatePicker/__tests__/DatePickerPanel.dom.test.d.ts +1 -0
- package/dist/components/DatePicker/__tests__/DatePickerPanel.styles.test.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/interface.d.ts +37 -0
- package/dist/components/DatePicker/style/__tests__/resolveDatePickerThemeVars.test.d.ts +1 -0
- package/dist/components/DatePicker/style/index.d.ts +1 -0
- package/dist/components/DatePicker/style/resolveDatePickerThemeVars.d.ts +2 -0
- package/dist/components/DatePicker/utils/__tests__/normalizePickerValue.test.d.ts +1 -0
- package/dist/components/DatePicker/utils/chunkArray.d.ts +1 -0
- package/dist/components/DatePicker/utils/ensureDayjsPlugins.d.ts +2 -0
- package/dist/components/DatePicker/utils/formatPickerLabel.d.ts +1 -0
- package/dist/components/DatePicker/utils/normalizePickerValue.d.ts +10 -0
- package/dist/components/DatePicker/utils/pickerConstants.d.ts +8 -0
- package/dist/components/DatePicker/utils/pickerLocale.d.ts +4 -0
- package/dist/components/Segmented/Segmented.type.d.ts +30 -0
- package/dist/components/Segmented/__tests__/Segmented.theme.test.d.ts +1 -0
- package/dist/components/Segmented/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip/Tooltip.type.d.ts +33 -0
- package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/components/Tooltip/context/TooltipFloatingContext.d.ts +2 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/hooks/useFloatingOverlay.d.ts +20 -0
- package/dist/hooks/useLocale.d.ts +4 -2
- package/dist/index.js +39 -23
- package/dist/locale/LocaleContext.d.ts +2 -1
- package/dist/locale/formatLocaleMessage.d.ts +2 -0
- package/dist/locale/lang/en-US.json.d.ts +43 -1
- package/dist/locale/lang/zh-CN.json.d.ts +43 -1
- package/dist/locale/lang/zh-TW.json.d.ts +43 -1
- package/dist/style.css +1 -1
- package/dist/utils/cssVars.d.ts +1 -0
- package/dist/utils/mergeRefs.d.ts +4 -0
- package/dist/vendors/{ConfigProvider-BekyDD3V.js → ConfigProvider-aWr8b3e3.js} +123 -32
- package/dist/vendors/{LocaleContext-Jj_JGgi2.js → LocaleContext-CuXR7Y03.js} +52 -7
- package/dist/vendors/{Tree-Bg2UzLsC.js → Tree-BTQ25Pi7.js} +3 -3
- package/dist/vendors/cssVars-C4BlzyxA.js +6 -0
- package/dist/vendors/useFloatingOverlay-uxlI1G-V.js +26 -0
- package/dist/vendors/{useLocale-Mk0d7wNt.js → useLocale-DvdSwM9e.js} +1 -1
- package/package.json +8 -3
- package/dist/ColorPicker/ColorPicker-nnQIw0_e.js +0 -168
- package/dist/Segmented/Segmented-Byw8j1hQ.js +0 -62
- /package/dist/Loading/{Loading-dsLWSWsE.js → Loading-WjmzBabh.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-DJUQ0_2D.js → NotFoundContent-7xV-zOG2.js} +0 -0
- /package/dist/Radio/{Radio-WNw-VqIS.js → Radio-DkrZHoG1.js} +0 -0
- /package/dist/vendors/{animations-C2i5EijE.js → animations-BmT0HT5q.js} +0 -0
- /package/dist/vendors/{color-CxdZwdYM.js → color-BeQo449h.js} +0 -0
- /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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveDatePickerThemeVars } from './resolveDatePickerThemeVars';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chunkArray: <T>(items: T[], size: number) => T[][];
|
|
@@ -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;
|
|
@@ -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
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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:
|
|
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-
|
|
2
|
-
import "./vendors/LocaleContext-
|
|
3
|
-
import { r as t, t as n } from "./vendors/ConfigProvider-
|
|
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-
|
|
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-
|
|
13
|
-
import { t as d } from "./Modal/Modal-
|
|
14
|
-
import { t as f } from "./ColorPicker/ColorPicker-
|
|
15
|
-
import "./vendors/
|
|
16
|
-
import "./vendors/
|
|
17
|
-
import
|
|
18
|
-
import { t as
|
|
19
|
-
import "./
|
|
20
|
-
import { t as
|
|
21
|
-
import "./
|
|
22
|
-
import { t as
|
|
23
|
-
import
|
|
24
|
-
import { t as v } from "./
|
|
25
|
-
import "./
|
|
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
|
|
28
|
-
import { t as
|
|
29
|
-
import { t as
|
|
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
|
|
32
|
-
|
|
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
|
}>;
|
|
@@ -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
|
|