@pisell/materials 6.11.65 → 6.11.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
- package/es/components/pisellReservationScheduleBand/index.d.ts +2 -0
- package/es/components/pisellReservationScheduleBand/types.d.ts +61 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +11 -3
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
- package/es/components/pisellTimeNavigator/components/ScaleLayer.d.ts +40 -0
- package/es/components/pisellTimeNavigator/components/ScaleLayer.js +37 -6
- package/es/components/pisellTimeNavigator/components/index.d.ts +5 -0
- package/es/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +37 -0
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.js +49 -25
- package/es/components/pisellTimeNavigator/index.d.ts +5 -0
- package/es/components/pisellTimeNavigator/utils/index.d.ts +65 -0
- package/es/components/pisellTimeNavigator/utils/index.js +66 -6
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
- package/lib/components/pisellReservationScheduleBand/index.d.ts +2 -0
- package/lib/components/pisellReservationScheduleBand/types.d.ts +61 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +6 -2
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
- package/lib/components/pisellTimeNavigator/components/ScaleLayer.d.ts +40 -0
- package/lib/components/pisellTimeNavigator/components/ScaleLayer.js +32 -4
- package/lib/components/pisellTimeNavigator/components/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +37 -0
- package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.js +27 -15
- package/lib/components/pisellTimeNavigator/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/utils/index.d.ts +65 -0
- package/lib/components/pisellTimeNavigator/utils/index.js +32 -4
- package/package.json +3 -3
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +0 -59
- package/es/components/pisellFloorMapLayout/appearance/floorMapAppearance.d.ts +0 -15
- package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +0 -57
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +0 -26
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +0 -5
- package/es/components/pisellFloorMapLayout/types.d.ts +0 -666
- package/es/components/pisellRecordBoard/index.d.ts +0 -51
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
- package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -73
- package/es/components/pisellRecordBoard/shellFrame/Calendar/hooks/useBookingCalendarDayOverlayLayout.d.ts +0 -18
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarBlockPanel.d.ts +0 -26
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -14
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarSelectionUtils.d.ts +0 -7
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +0 -21
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -49
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/day/useBookingCalendarDayHourRemaining.d.ts +0 -10
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/day/useBookingCalendarDaySelection.d.ts +0 -11
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/resource/useBookingCalendarResourceCellToggle.d.ts +0 -3
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/resource/useBookingCalendarResourceDayHeaderRemaining.d.ts +0 -8
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/useBookingCalendarGoToDayFromCell.d.ts +0 -3
- package/es/components/pisellRecordBoard/types.d.ts +0 -835
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +0 -10
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +0 -59
- package/lib/components/pisellFloorMapLayout/appearance/floorMapAppearance.d.ts +0 -15
- package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +0 -57
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +0 -26
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +0 -5
- package/lib/components/pisellFloorMapLayout/types.d.ts +0 -666
- package/lib/components/pisellRecordBoard/index.d.ts +0 -51
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -73
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/hooks/useBookingCalendarDayOverlayLayout.d.ts +0 -18
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarBlockPanel.d.ts +0 -26
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -14
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarSelectionUtils.d.ts +0 -7
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +0 -21
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -49
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/day/useBookingCalendarDayHourRemaining.d.ts +0 -10
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/day/useBookingCalendarDaySelection.d.ts +0 -11
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/resource/useBookingCalendarResourceCellToggle.d.ts +0 -3
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/resource/useBookingCalendarResourceDayHeaderRemaining.d.ts +0 -8
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/useBookingCalendarGoToDayFromCell.d.ts +0 -3
- package/lib/components/pisellRecordBoard/types.d.ts +0 -835
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +0 -10
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PisellReservationScheduleBandProps } from './types';
|
|
3
|
+
import './PisellReservationScheduleBand.less';
|
|
4
|
+
/**
|
|
5
|
+
* 预约顶栏组合:营业日切换 + 锚定到选中日的时间导航轴
|
|
6
|
+
*/
|
|
7
|
+
export declare function PisellReservationScheduleBand(props: PisellReservationScheduleBandProps): React.JSX.Element;
|
|
8
|
+
export declare namespace PisellReservationScheduleBand {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellReservationScheduleBand } from './PisellReservationScheduleBand';
|
|
3
|
+
/**
|
|
4
|
+
* PisellReservationScheduleBand:营业日条 + 横向时间轴顶栏组合,统一 value `{ date, at }`。
|
|
5
|
+
* 详见组件目录下 docs/PisellReservationScheduleBand.md。
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof PisellReservationScheduleBand>;
|
|
8
|
+
export default meta;
|
|
9
|
+
declare type Story = StoryObj<typeof PisellReservationScheduleBand>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const CustomTimeNavigator: Story;
|
|
12
|
+
export declare const ScheduleMinMax: Story;
|
|
13
|
+
export declare const Controlled: Story;
|
|
14
|
+
export declare const InitialPastDay: Story;
|
|
15
|
+
/** 日程行左右插槽:左标题 + 中间 PisellReservationSchedule + 右操作区(整条顶栏暗色背景需在业务外层自行包一层,避免压住下方时间轴) */
|
|
16
|
+
export declare const WithScheduleSlots: Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
import type { PisellTimeNavigatorProps } from '../pisellTimeNavigator/types';
|
|
4
|
+
import type { PisellReservationScheduleProps } from '../pisellReservationSchedule/types';
|
|
5
|
+
/** 组合值:日历日 + 该日上的时刻(与 PisellTimeNavigator 对齐) */
|
|
6
|
+
export interface ReservationScheduleBandValue {
|
|
7
|
+
date: Dayjs;
|
|
8
|
+
at: Dayjs;
|
|
9
|
+
}
|
|
10
|
+
export declare type TimeNavigatorPassthroughProps = Omit<PisellTimeNavigatorProps, 'value' | 'onChange' | 'defaultValue'>;
|
|
11
|
+
/**
|
|
12
|
+
* PisellReservationScheduleBand:营业日条 + 横向时间轴
|
|
13
|
+
*/
|
|
14
|
+
export interface PisellReservationScheduleBandProps {
|
|
15
|
+
/**
|
|
16
|
+
* 受控:选中日 + 轴上时刻
|
|
17
|
+
*/
|
|
18
|
+
value?: ReservationScheduleBandValue;
|
|
19
|
+
/**
|
|
20
|
+
* 日历日或时刻任一变化时触发
|
|
21
|
+
*/
|
|
22
|
+
onChange?: (next: ReservationScheduleBandValue) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 非受控初始值(可只传部分字段)
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: Partial<ReservationScheduleBandValue>;
|
|
27
|
+
/**
|
|
28
|
+
* 透传给 PisellReservationSchedule(如 minDate / maxDate)
|
|
29
|
+
*/
|
|
30
|
+
scheduleProps?: Omit<PisellReservationScheduleProps, 'value' | 'onChange' | 'defaultValue'>;
|
|
31
|
+
/**
|
|
32
|
+
* 透传给 PisellTimeNavigator(不含 value/onChange/referenceDate)
|
|
33
|
+
*/
|
|
34
|
+
timeNavigatorProps?: TimeNavigatorPassthroughProps;
|
|
35
|
+
/**
|
|
36
|
+
* 顶栏日程行:PisellReservationSchedule 左侧自定义内容(如标题)
|
|
37
|
+
*/
|
|
38
|
+
scheduleStartSlot?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* 顶栏日程行:PisellReservationSchedule 右侧自定义内容(如状态、主按钮)
|
|
41
|
+
*/
|
|
42
|
+
scheduleEndSlot?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* 顶栏日程行:紧挨在选日组件之后(如「跟随当前」),与中间列同一 flex 区
|
|
45
|
+
*/
|
|
46
|
+
scheduleAfterDateSlot?: ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* 为 true 时隐藏下方时间导航轴(如日历视图仅需要选日/选周/选月)
|
|
49
|
+
*/
|
|
50
|
+
hideTimeNavigator?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 为 true 时在整个日程带上叠加载层(如切换营业日后拉预约列表期间)
|
|
53
|
+
*/
|
|
54
|
+
dataLoading?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 加载层内文案,由业务侧 {@link locales.getText} 等注入
|
|
57
|
+
*/
|
|
58
|
+
dataLoadingTip?: ReactNode;
|
|
59
|
+
className?: string;
|
|
60
|
+
style?: CSSProperties;
|
|
61
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PisellTimeNavigatorProps } from './types';
|
|
3
|
+
import './PisellTimeNavigator.less';
|
|
4
|
+
/**
|
|
5
|
+
* PisellTimeNavigator:可拖动的时间导航轴,时间范围内浏览、选择、控制
|
|
6
|
+
*/
|
|
7
|
+
export declare function PisellTimeNavigator(props: PisellTimeNavigatorProps): React.JSX.Element;
|
|
8
|
+
export declare namespace PisellTimeNavigator {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
@@ -200,7 +200,12 @@ export function PisellTimeNavigator(props) {
|
|
|
200
200
|
var span = Math.max(1, maxV - minV);
|
|
201
201
|
var h = DENSITY_LAYER_HEIGHT;
|
|
202
202
|
var points = slice.map(function (v, i) {
|
|
203
|
-
|
|
203
|
+
/**
|
|
204
|
+
* 用 `timeToOffset(ticks[i])` 而非 `i * cellSize + cellSize/2` 取 x:
|
|
205
|
+
* head/tail partial 格存在时,每格宽度不再等于 `cellSize`,按索引等比相乘会跑偏。
|
|
206
|
+
* `timeToOffset` 始终随时间线性映射(含两端 dotOffsetPx 留白),与刻度层视觉对齐。
|
|
207
|
+
*/
|
|
208
|
+
var x = axis.timeToOffset(axis.ticks[i]);
|
|
204
209
|
/** 映射到 [0,1]:最低值贴底,最高值接近顶部,基本吃满密度层高度 */
|
|
205
210
|
var t = (v - minV) / span;
|
|
206
211
|
var y = h - 1 - t * (h - 3);
|
|
@@ -228,7 +233,7 @@ export function PisellTimeNavigator(props) {
|
|
|
228
233
|
h: h,
|
|
229
234
|
w: axis.totalLengthPx
|
|
230
235
|
};
|
|
231
|
-
}, [isHorizontal, resolvedDensity, axis.ticks, axis.totalLengthPx, cellSizePx]);
|
|
236
|
+
}, [isHorizontal, resolvedDensity, axis.ticks, axis.timeToOffset, axis.totalLengthPx, cellSizePx]);
|
|
232
237
|
var isControlled = valueProp !== undefined;
|
|
233
238
|
var _useState5 = useState(function () {
|
|
234
239
|
var v = valueProp !== null && valueProp !== void 0 ? valueProp : defaultValue;
|
|
@@ -848,7 +853,10 @@ export function PisellTimeNavigator(props) {
|
|
|
848
853
|
timeFormat: timeFormat,
|
|
849
854
|
locale: locale,
|
|
850
855
|
style: scaleStyle,
|
|
851
|
-
horizontalCellSizePx: isHorizontal ? cellSizePx : undefined
|
|
856
|
+
horizontalCellSizePx: isHorizontal ? cellSizePx : undefined,
|
|
857
|
+
cellWidthsPx: isHorizontal ? axis.cellWidthsPx : undefined,
|
|
858
|
+
leadingPaddingPx: isHorizontal ? dotOffsetPx : undefined,
|
|
859
|
+
trailingPaddingPx: isHorizontal ? dotOffsetPx : undefined
|
|
852
860
|
}), isHorizontal && currentTimeOffsetPx != null && currentTimeOffsetPx >= 0 && /*#__PURE__*/React.createElement("span", {
|
|
853
861
|
className: "pisell-time-navigator-current-time-bubble",
|
|
854
862
|
style: {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellTimeNavigator } from './PisellTimeNavigator';
|
|
3
|
+
/**
|
|
4
|
+
* PisellTimeNavigator 组件 Storybook
|
|
5
|
+
* 时间导航轴:时间范围内浏览、选择、控制
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof PisellTimeNavigator>;
|
|
8
|
+
export default meta;
|
|
9
|
+
declare type Story = StoryObj<typeof PisellTimeNavigator>;
|
|
10
|
+
/**
|
|
11
|
+
* 默认:横向、轴动、显示 Now
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/** 默认 - 竖向 */
|
|
15
|
+
export declare const DefaultVertical: Story;
|
|
16
|
+
/**
|
|
17
|
+
* 受控 + 默认 12:00
|
|
18
|
+
*/
|
|
19
|
+
export declare const Controlled: Story;
|
|
20
|
+
/** 受控 - 竖向 */
|
|
21
|
+
export declare const ControlledVertical: Story;
|
|
22
|
+
/**
|
|
23
|
+
* 非受控 + 默认 14:30
|
|
24
|
+
*/
|
|
25
|
+
export declare const Uncontrolled: Story;
|
|
26
|
+
/** 非受控 - 竖向 */
|
|
27
|
+
export declare const UncontrolledVertical: Story;
|
|
28
|
+
/**
|
|
29
|
+
* 竖向
|
|
30
|
+
*/
|
|
31
|
+
export declare const Vertical: Story;
|
|
32
|
+
/**
|
|
33
|
+
* 指针动模式(cursor-moves)
|
|
34
|
+
*/
|
|
35
|
+
export declare const CursorMoves: Story;
|
|
36
|
+
/** 指针动模式 - 竖向 */
|
|
37
|
+
export declare const CursorMovesVertical: Story;
|
|
38
|
+
/**
|
|
39
|
+
* 营业时间高亮 10:00–22:00
|
|
40
|
+
*/
|
|
41
|
+
export declare const BusinessHours: Story;
|
|
42
|
+
/** 营业时间高亮 - 竖向 */
|
|
43
|
+
export declare const BusinessHoursVertical: Story;
|
|
44
|
+
/**
|
|
45
|
+
* 自定义时间范围 08:00–20:00
|
|
46
|
+
*/
|
|
47
|
+
export declare const CustomRange: Story;
|
|
48
|
+
/** 自定义时间范围 - 竖向 */
|
|
49
|
+
export declare const CustomRangeVertical: Story;
|
|
50
|
+
/**
|
|
51
|
+
* 步长 30 分钟
|
|
52
|
+
*/
|
|
53
|
+
export declare const Step30: Story;
|
|
54
|
+
/** 步长 30 分钟 - 竖向 */
|
|
55
|
+
export declare const Step30Vertical: Story;
|
|
56
|
+
/**
|
|
57
|
+
* 惯性滚动开启
|
|
58
|
+
*/
|
|
59
|
+
export declare const Inertia: Story;
|
|
60
|
+
/** 惯性滚动 - 竖向 */
|
|
61
|
+
export declare const InertiaVertical: Story;
|
|
62
|
+
/**
|
|
63
|
+
* 吸附到整点(松手后自动吸附到 0/15/30/45 分刻度)
|
|
64
|
+
*/
|
|
65
|
+
export declare const SnapToStep: Story;
|
|
66
|
+
/** 吸附到整点 - 竖向 */
|
|
67
|
+
export declare const SnapToStepVertical: Story;
|
|
68
|
+
/**
|
|
69
|
+
* 隐藏 Now 按钮
|
|
70
|
+
*/
|
|
71
|
+
export declare const NoNowButton: Story;
|
|
72
|
+
/** 隐藏 Now 按钮 - 竖向 */
|
|
73
|
+
export declare const NoNowButtonVertical: Story;
|
|
74
|
+
/**
|
|
75
|
+
* 实时模式(仅演示,实际会跟随系统时间)
|
|
76
|
+
*/
|
|
77
|
+
export declare const Realtime: Story;
|
|
78
|
+
/** 实时模式 - 竖向 */
|
|
79
|
+
export declare const RealtimeVertical: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
export interface ScaleLayerProps {
|
|
4
|
+
orientation: 'horizontal' | 'vertical';
|
|
5
|
+
ticks: Dayjs[];
|
|
6
|
+
stepMinutes: number;
|
|
7
|
+
majorStepMinutes: number;
|
|
8
|
+
timeFormat: string;
|
|
9
|
+
locale?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 横向每格宽度(px),须与 useTimeAxis 的 cellSizePx 一致;
|
|
14
|
+
* 不传时样式表默认 82(axis-moves);cursor-moves 压缩比例时必传
|
|
15
|
+
*/
|
|
16
|
+
horizontalCellSizePx?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 每个 tick 对应「格」的实际宽度(px)。范围起止不在 step 网格上时,首尾会出现宽度
|
|
19
|
+
* 小于 `horizontalCellSizePx` 的 head/tail 格;中间仍保持整步宽。
|
|
20
|
+
* 不传时退化为「全部按 horizontalCellSizePx 等宽」。
|
|
21
|
+
*/
|
|
22
|
+
cellWidthsPx?: number[];
|
|
23
|
+
/**
|
|
24
|
+
* 横向时,整体两端各留出 `cellSize/2` 的居中留白(与 `useTimeAxis.dotOffsetPx` 一致),
|
|
25
|
+
* 使 rangeStart / rangeEnd 的实际像素位置落在头格 / 尾格的左 / 右边沿,
|
|
26
|
+
* 与拖拽光标的 `timeToOffset` 像素对齐。
|
|
27
|
+
*/
|
|
28
|
+
leadingPaddingPx?: number;
|
|
29
|
+
trailingPaddingPx?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 刻度层:渲染时间刻度与标签
|
|
33
|
+
* - 横向:整点数字 + 小圆点;当 range 起止不在 step 网格上时,首尾两个格按时间比例**变窄**
|
|
34
|
+
* (宽度 = `widthMinutes / step × cellSize`),中间格保持整步宽并落在整点 / 半点等对齐位置上。
|
|
35
|
+
* - 竖向:整点数字 + 分割线。
|
|
36
|
+
*
|
|
37
|
+
* 标签仅在「整点」(`tick.minute() === 0` 且秒为 0)时显示数字;非整点格只渲染圆点 / 分割线,
|
|
38
|
+
* 配合变窄的 head/tail 让起止时刻在视觉上自然衔接到第一个 / 最后一个整点。
|
|
39
|
+
*/
|
|
40
|
+
export declare function ScaleLayer({ orientation, ticks, stepMinutes, majorStepMinutes, timeFormat, locale, style, className, horizontalCellSizePx, cellWidthsPx, leadingPaddingPx, trailingPaddingPx, }: ScaleLayerProps): React.JSX.Element;
|
|
@@ -8,7 +8,12 @@ import React from 'react';
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
/**
|
|
10
10
|
* 刻度层:渲染时间刻度与标签
|
|
11
|
-
* 横向:整点数字 +
|
|
11
|
+
* - 横向:整点数字 + 小圆点;当 range 起止不在 step 网格上时,首尾两个格按时间比例**变窄**
|
|
12
|
+
* (宽度 = `widthMinutes / step × cellSize`),中间格保持整步宽并落在整点 / 半点等对齐位置上。
|
|
13
|
+
* - 竖向:整点数字 + 分割线。
|
|
14
|
+
*
|
|
15
|
+
* 标签仅在「整点」(`tick.minute() === 0` 且秒为 0)时显示数字;非整点格只渲染圆点 / 分割线,
|
|
16
|
+
* 配合变窄的 head/tail 让起止时刻在视觉上自然衔接到第一个 / 最后一个整点。
|
|
12
17
|
*/
|
|
13
18
|
export function ScaleLayer(_ref) {
|
|
14
19
|
var orientation = _ref.orientation,
|
|
@@ -19,17 +24,35 @@ export function ScaleLayer(_ref) {
|
|
|
19
24
|
locale = _ref.locale,
|
|
20
25
|
style = _ref.style,
|
|
21
26
|
className = _ref.className,
|
|
22
|
-
horizontalCellSizePx = _ref.horizontalCellSizePx
|
|
27
|
+
horizontalCellSizePx = _ref.horizontalCellSizePx,
|
|
28
|
+
cellWidthsPx = _ref.cellWidthsPx,
|
|
29
|
+
leadingPaddingPx = _ref.leadingPaddingPx,
|
|
30
|
+
trailingPaddingPx = _ref.trailingPaddingPx;
|
|
23
31
|
var isHorizontal = orientation === 'horizontal';
|
|
24
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
33
|
className: classNames('pisell-time-navigator-scale', "pisell-time-navigator-scale--".concat(orientation), className),
|
|
26
34
|
style: style
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
}, isHorizontal && leadingPaddingPx != null && leadingPaddingPx > 0 && /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
"aria-hidden": true,
|
|
37
|
+
style: {
|
|
38
|
+
width: leadingPaddingPx,
|
|
39
|
+
minWidth: leadingPaddingPx,
|
|
40
|
+
maxWidth: leadingPaddingPx,
|
|
41
|
+
flex: '0 0 auto'
|
|
42
|
+
}
|
|
43
|
+
}), ticks.map(function (tick, i) {
|
|
44
|
+
var isMajor = tick.minute() === 0 && tick.second() === 0;
|
|
45
|
+
/**
|
|
46
|
+
* 横向整点只展示小时(如 `16`);竖向 / 非整点(理论不会进 isMajor 分支)走 timeFormat。
|
|
47
|
+
*/
|
|
30
48
|
var label = isHorizontal && isMajor ? locale ? tick.locale(locale).format('H') : tick.format('H') : locale ? tick.locale(locale).format(timeFormat) : tick.format(timeFormat);
|
|
31
49
|
if (isHorizontal) {
|
|
32
|
-
var
|
|
50
|
+
var baseCw = horizontalCellSizePx != null && horizontalCellSizePx > 0 ? horizontalCellSizePx : undefined;
|
|
51
|
+
/**
|
|
52
|
+
* 优先用调用方传入的 `cellWidthsPx[i]`(首尾 partial 格宽 < 整步),
|
|
53
|
+
* 退化为 baseCw(CSS 默认 54)以兼容旧调用路径。
|
|
54
|
+
*/
|
|
55
|
+
var cw = cellWidthsPx != null && cellWidthsPx[i] != null ? cellWidthsPx[i] : baseCw;
|
|
33
56
|
var compactPad = cw != null ? cw < 36 ? 2 : cw < 52 ? 6 : 10 : undefined;
|
|
34
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
58
|
key: i,
|
|
@@ -69,5 +92,13 @@ export function ScaleLayer(_ref) {
|
|
|
69
92
|
}), isMajor && /*#__PURE__*/React.createElement("span", {
|
|
70
93
|
className: "pisell-time-navigator-scale-label"
|
|
71
94
|
}, label));
|
|
95
|
+
}), isHorizontal && trailingPaddingPx != null && trailingPaddingPx > 0 && /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
"aria-hidden": true,
|
|
97
|
+
style: {
|
|
98
|
+
width: trailingPaddingPx,
|
|
99
|
+
minWidth: trailingPaddingPx,
|
|
100
|
+
maxWidth: trailingPaddingPx,
|
|
101
|
+
flex: '0 0 auto'
|
|
102
|
+
}
|
|
72
103
|
}));
|
|
73
104
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useTimeAxis } from './useTimeAxis';
|
|
2
|
+
export type { UseTimeAxisOptions, TimeAxisState } from './useTimeAxis';
|
|
3
|
+
export { useRealtime } from './useRealtime';
|
|
4
|
+
export { useDragInertia } from './useDragInertia';
|
|
5
|
+
export type { UseDragInertiaOptions } from './useDragInertia';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeRangeOption } from '../types';
|
|
3
|
+
export interface UseTimeAxisOptions {
|
|
4
|
+
range?: TimeRangeOption;
|
|
5
|
+
stepMinutes: number;
|
|
6
|
+
referenceDate: Dayjs;
|
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
|
8
|
+
/** 横向时每格宽度(px),竖向时每格高度(px) */
|
|
9
|
+
cellSizePx: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TimeAxisState {
|
|
12
|
+
rangeStart: Dayjs;
|
|
13
|
+
rangeEnd: Dayjs;
|
|
14
|
+
/** 每格起点时间序列(含 head / tail,对齐到 step 网格) */
|
|
15
|
+
ticks: Dayjs[];
|
|
16
|
+
/** 与 `ticks` 一一对应的格宽(px);head / tail 可 < cellSizePx,中间格 = cellSizePx */
|
|
17
|
+
cellWidthsPx: number[];
|
|
18
|
+
/** 时间转主轴偏移(px) */
|
|
19
|
+
timeToOffset: (t: Dayjs) => number;
|
|
20
|
+
/** 主轴偏移(px)转时间(最近刻度,用于刻度对齐) */
|
|
21
|
+
offsetToTime: (offset: number) => Dayjs | null;
|
|
22
|
+
/** 主轴偏移(px)转时间(连续插值,用于拖动时按分钟步长显示) */
|
|
23
|
+
offsetToTimeContinuous: (offset: number) => Dayjs | null;
|
|
24
|
+
/** 主轴总长度(px) */
|
|
25
|
+
totalLengthPx: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 时间轴刻度与时间↔像素换算。
|
|
29
|
+
*
|
|
30
|
+
* 格子拆分策略见 {@link getAxisCells}:当 `range.start` / `range.end` 不在 `stepMinutes` 网格上时,
|
|
31
|
+
* 首尾出现宽度按时间比例缩小的 head/tail 格,中间格保持 step 整步并落在网格整点上。
|
|
32
|
+
*
|
|
33
|
+
* 时间→像素仍是线性映射 `dotOffsetPx + (t - rangeStart) / step × cellSize`,与 head/tail 是否存在无关:
|
|
34
|
+
* `dotOffsetPx`(横向 = `cellSize/2`,竖向 = 0)为 rangeStart 在轴内的像素位置;轴两端各保留 `dotOffsetPx`
|
|
35
|
+
* 留白以居中 rangeStart / rangeEnd。
|
|
36
|
+
*/
|
|
37
|
+
export declare function useTimeAxis(options: UseTimeAxisOptions): TimeAxisState;
|
|
@@ -5,9 +5,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { getAxisCells, getRangeBounds } from "../utils";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 时间轴刻度与时间↔像素换算。
|
|
11
|
+
*
|
|
12
|
+
* 格子拆分策略见 {@link getAxisCells}:当 `range.start` / `range.end` 不在 `stepMinutes` 网格上时,
|
|
13
|
+
* 首尾出现宽度按时间比例缩小的 head/tail 格,中间格保持 step 整步并落在网格整点上。
|
|
14
|
+
*
|
|
15
|
+
* 时间→像素仍是线性映射 `dotOffsetPx + (t - rangeStart) / step × cellSize`,与 head/tail 是否存在无关:
|
|
16
|
+
* `dotOffsetPx`(横向 = `cellSize/2`,竖向 = 0)为 rangeStart 在轴内的像素位置;轴两端各保留 `dotOffsetPx`
|
|
17
|
+
* 留白以居中 rangeStart / rangeEnd。
|
|
11
18
|
*/
|
|
12
19
|
export function useTimeAxis(options) {
|
|
13
20
|
var range = options.range,
|
|
@@ -20,44 +27,60 @@ export function useTimeAxis(options) {
|
|
|
20
27
|
_getRangeBounds2 = _slicedToArray(_getRangeBounds, 2),
|
|
21
28
|
rangeStart = _getRangeBounds2[0],
|
|
22
29
|
rangeEnd = _getRangeBounds2[1];
|
|
23
|
-
var
|
|
30
|
+
var safeStep = Math.max(1, stepMinutes);
|
|
31
|
+
var cells = getAxisCells(rangeStart, rangeEnd, safeStep);
|
|
32
|
+
var ticks = cells.map(function (c) {
|
|
33
|
+
return c.start;
|
|
34
|
+
});
|
|
35
|
+
var cellWidthsPx = cells.map(function (c) {
|
|
36
|
+
return c.widthMinutes / safeStep * cellSizePx;
|
|
37
|
+
});
|
|
38
|
+
var cellsTotalPx = cellWidthsPx.reduce(function (s, w) {
|
|
39
|
+
return s + w;
|
|
40
|
+
}, 0);
|
|
24
41
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
42
|
+
* 横向:每格中心为「时间下面的点」,dotOffsetPx = cellSizePx/2,rangeStart / rangeEnd
|
|
43
|
+
* 在轴上分别留 cellSize/2 留白以便居中。
|
|
44
|
+
* 竖向:对齐整点上面的粗线(格顶),dotOffsetPx = 0,无两端留白。
|
|
27
45
|
*/
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var needTailCell = orientation === 'horizontal' && lastTick != null && rangeEnd.isAfter(lastTick);
|
|
31
|
-
/** 竖向:范围结束恰在最后刻度时(如 08:00–20:00 的 20:00)不保留最后一格高度,与横向自定义范围一致 */
|
|
32
|
-
var noTailVertical = orientation === 'vertical' && lastTick != null && !rangeEnd.isAfter(lastTick);
|
|
33
|
-
var effectiveTicks = noTailVertical && ticks.length > 0 ? ticks.slice(0, -1) : ticks;
|
|
34
|
-
var rawTotalPx = orientation === 'vertical' ? effectiveTicks.length * cellSizePx : (ticks.length + (needTailCell ? 1 : 0)) * cellSizePx;
|
|
46
|
+
var dotOffsetPx = orientation === 'vertical' ? 0 : cellSizePx / 2;
|
|
47
|
+
var rawTotalPx = orientation === 'horizontal' ? cellsTotalPx + cellSizePx : cellsTotalPx;
|
|
35
48
|
/** 防止异常 range/step 导致轴长爆炸(如竖向出现 33M 高度),上限约 2 天 15 分钟步进 */
|
|
36
49
|
var totalLengthPx = Math.min(rawTotalPx, 500000);
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
* 竖向:对齐整点上面的粗线(格顶),dotOffsetPx = 0。
|
|
40
|
-
*/
|
|
41
|
-
var dotOffsetPx = orientation === 'vertical' ? 0 : cellSizePx / 2;
|
|
42
|
-
/** 最大偏移:竖向为最后一格顶;横向有尾格时为最后一格中心延伸,无尾格时为最后一格中心 */
|
|
43
|
-
var maxOffsetPx = orientation === 'vertical' ? totalLengthPx : dotOffsetPx + (needTailCell ? ticks.length : Math.max(0, ticks.length - 1)) * cellSizePx;
|
|
50
|
+
/** rangeEnd 在轴上的像素位置;横向 = dotOffsetPx + cellsTotalPx,竖向 = cellsTotalPx */
|
|
51
|
+
var maxOffsetPx = orientation === 'vertical' ? cellsTotalPx : dotOffsetPx + cellsTotalPx;
|
|
44
52
|
var timeToOffset = function timeToOffset(t) {
|
|
45
53
|
var diffMs = t.diff(rangeStart);
|
|
46
54
|
var diffMin = diffMs / (60 * 1000);
|
|
47
|
-
var index = diffMin /
|
|
55
|
+
var index = diffMin / safeStep;
|
|
48
56
|
var px = dotOffsetPx + index * cellSizePx;
|
|
49
57
|
return Math.max(dotOffsetPx, Math.min(px, maxOffsetPx));
|
|
50
58
|
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 吸附到最近的「格起点」:
|
|
62
|
+
* head/tail 长度可能小于 step 整步,传统的「按 cellSize 等分四舍五入」无法直接定位 tick;
|
|
63
|
+
* 这里按 ticks 实际像素位置线性扫描求最近邻,ticks 数组通常 ≤ ~200,开销可忽略。
|
|
64
|
+
*/
|
|
51
65
|
var offsetToTime = function offsetToTime(offset) {
|
|
52
|
-
|
|
53
|
-
var
|
|
54
|
-
|
|
66
|
+
if (ticks.length === 0) return null;
|
|
67
|
+
var bestIdx = 0;
|
|
68
|
+
var bestDist = Infinity;
|
|
69
|
+
for (var i = 0; i < ticks.length; i += 1) {
|
|
70
|
+
var px = timeToOffset(ticks[i]);
|
|
71
|
+
var d = Math.abs(px - offset);
|
|
72
|
+
if (d < bestDist) {
|
|
73
|
+
bestDist = d;
|
|
74
|
+
bestIdx = i;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return ticks[bestIdx];
|
|
55
78
|
};
|
|
56
79
|
|
|
57
80
|
/** 偏移对应连续时间;横向以格点为中心,竖向以格顶为基准 */
|
|
58
81
|
var offsetToTimeContinuous = function offsetToTimeContinuous(offset) {
|
|
59
82
|
var index = (offset - dotOffsetPx) / cellSizePx;
|
|
60
|
-
var minutesFromStart = index *
|
|
83
|
+
var minutesFromStart = index * safeStep;
|
|
61
84
|
var t = rangeStart.add(minutesFromStart, 'minute');
|
|
62
85
|
if (t.isBefore(rangeStart)) return rangeStart;
|
|
63
86
|
if (t.isAfter(rangeEnd)) return rangeEnd;
|
|
@@ -66,7 +89,8 @@ export function useTimeAxis(options) {
|
|
|
66
89
|
return {
|
|
67
90
|
rangeStart: rangeStart,
|
|
68
91
|
rangeEnd: rangeEnd,
|
|
69
|
-
ticks:
|
|
92
|
+
ticks: ticks,
|
|
93
|
+
cellWidthsPx: cellWidthsPx,
|
|
70
94
|
timeToOffset: timeToOffset,
|
|
71
95
|
offsetToTime: offsetToTime,
|
|
72
96
|
offsetToTimeContinuous: offsetToTimeContinuous,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PisellTimeNavigator } from './PisellTimeNavigator';
|
|
2
|
+
export { getHorizontalAxisSlotCount, getRangeBounds, buildCalendarHourSlotsFromRange, buildCalendarTimelineSlotStartsFromRange, DEFAULT_CALENDAR_SLOT_STEP_MINUTES, } from './utils';
|
|
3
|
+
export type { PisellTimeNavigatorProps, TimeNavigatorValue, TimeRangeOption, CursorMode, TimeNavigatorOrientation, } from './types';
|
|
4
|
+
/** 多语言文案(en / zh-CN / zh-HK / ja / pt),使用前请在应用内通过 locales.init(pisellTimeNavigatorLocales, lang) 合并 */
|
|
5
|
+
export { default as pisellTimeNavigatorLocales } from './locales';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeNavigatorValue, TimeRangeOption } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 解析 value 为 Dayjs,无效则返回 null。
|
|
5
|
+
* 支持 dayjs 可解析的日期时间;纯时间字符串(如 '12:00'、'14:30')会基于 reference 的日期解析。
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseValue(value: TimeNavigatorValue, reference?: Dayjs): Dayjs | null;
|
|
8
|
+
/** 日历时间轴默认步长(分钟),与历史「整点列」一致 */
|
|
9
|
+
export declare const DEFAULT_CALENDAR_SLOT_STEP_MINUTES = 60;
|
|
10
|
+
/**
|
|
11
|
+
* 按营业日 {@link TimeRangeOption} 在锚定自然日零点展开,生成日视图时间轴「列左边界」:
|
|
12
|
+
* 值为相对 `reference.startOf('day')` 的**浮点小时**(可 ≥24,表示次日时刻),步长为 `slotStepMinutes`。
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildCalendarTimelineSlotStartsFromRange(range: TimeRangeOption | undefined, anchorDate: Date | Dayjs, slotStepMinutes?: number): number[];
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated 语义上等价于 {@link buildCalendarTimelineSlotStartsFromRange}(..., 60);保留兼容导出。
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildCalendarHourSlotsFromRange(range: TimeRangeOption | undefined, anchorDate: Date | Dayjs): number[];
|
|
19
|
+
/**
|
|
20
|
+
* 将 range 转为 [startDayjs, endDayjs](reference 为营业锚定日的 0 点)
|
|
21
|
+
* - 同日内:如 08:00–22:00
|
|
22
|
+
* - 跨日营业:结束钟面早于或等于开始(如 02:01–次日 02:00)时,end 解析为 reference 的次日同一时刻
|
|
23
|
+
*/
|
|
24
|
+
export declare function getRangeBounds(range: TimeRangeOption | undefined, reference: Dayjs): [Dayjs, Dayjs];
|
|
25
|
+
/**
|
|
26
|
+
* 将时间吸附到 step 分钟刻度(0、15、30、45 等):四舍五入到最近刻度。
|
|
27
|
+
*/
|
|
28
|
+
export declare function snapToStepMinutes(t: Dayjs, stepMinutes: number): Dayjs;
|
|
29
|
+
/**
|
|
30
|
+
* 判断时间是否落在任一禁用区间内(按绝对时间与区间 [start,end) 比较)
|
|
31
|
+
* 注:与主时间轴同 reference 的跨日 range 一致时需传入同一营业锚定日解析出的区间。
|
|
32
|
+
*/
|
|
33
|
+
export declare function isInDisabledRanges(t: Dayjs, disabledRanges: TimeRangeOption[] | undefined): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 在 [rangeStart, rangeEnd] 内按 stepMinutes 生成等步刻度时间列表(Dayjs)。
|
|
36
|
+
*
|
|
37
|
+
* @deprecated 仅用于不需要「头/尾 partial 格」的场景;时间轴渲染请用 {@link getAxisCells}。
|
|
38
|
+
*/
|
|
39
|
+
export declare function getTicks(rangeStart: Dayjs, rangeEnd: Dayjs, stepMinutes: number): Dayjs[];
|
|
40
|
+
/**
|
|
41
|
+
* 时间轴上一格的描述:起始时间 + 跨度(分钟)。
|
|
42
|
+
* - 中间格:跨度 = `stepMinutes`,起点对齐到 step 网格(如 15 分钟一格时落在 `:00/:15/:30/:45`);
|
|
43
|
+
* - head 格:当 `rangeStart` 不在网格上时存在,起点 = `rangeStart`,跨度 < step;
|
|
44
|
+
* - tail 格:当 `rangeEnd` 不在网格上时存在,起点 = 最后一个对齐点,跨度 < step。
|
|
45
|
+
*/
|
|
46
|
+
export interface AxisCell {
|
|
47
|
+
start: Dayjs;
|
|
48
|
+
widthMinutes: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 把 [`rangeStart`, `rangeEnd`] 切成「对齐到 step 网格」的格子序列:
|
|
52
|
+
*
|
|
53
|
+
* 1. 找到第一个 ≥ `rangeStart` 且分钟为 `stepMinutes` 整数倍的对齐点;
|
|
54
|
+
* 2. 若对齐点严格大于 `rangeStart`,先放一格 head(`rangeStart` → 对齐点),跨度 < step;
|
|
55
|
+
* 3. 中间按 step 步进,每格起点都落在网格上;
|
|
56
|
+
* 4. 若 `rangeEnd` 落在两个对齐点之间,最后多出一格 tail(最后对齐点 → `rangeEnd`),跨度 < step。
|
|
57
|
+
*
|
|
58
|
+
* `rangeStart` / `rangeEnd` 都恰落在网格上时退化为完全等步格。
|
|
59
|
+
*/
|
|
60
|
+
export declare function getAxisCells(rangeStart: Dayjs, rangeEnd: Dayjs, stepMinutes: number): AxisCell[];
|
|
61
|
+
/**
|
|
62
|
+
* 横向时间轴「格」数量,与 useTimeAxis 中 cells 算法一致。
|
|
63
|
+
* 用于 cursor-moves 模式下计算压缩后的每格像素宽度。
|
|
64
|
+
*/
|
|
65
|
+
export declare function getHorizontalAxisSlotCount(range: TimeRangeOption | undefined, referenceDate: Dayjs, stepMinutes: number): number;
|