@baishuyun/ui-mobile 0.3.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/README.md +44 -0
- package/dist/Calendar/Calendar-6ibIyMx0.js +1606 -0
- package/dist/Calendar/index.js +4 -0
- package/dist/ConfigProvider/ConfigProvider-E792q6ny.js +99 -0
- package/dist/ConfigProvider/index.js +4 -0
- package/dist/Gantt/Gantt-DLmqZPAQ.js +8 -0
- package/dist/Gantt/index.js +3 -0
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/Calendar/CalendarDay/AllDayEvents/AllDayEvents.d.ts +8 -0
- package/dist/components/Calendar/CalendarDay/AllDayEvents/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarDay/CalendarDay.d.ts +2 -0
- package/dist/components/Calendar/CalendarDay/DayViewBody/DayViewBody.d.ts +8 -0
- package/dist/components/Calendar/CalendarDay/DayViewBody/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarDay/DayViewHeader/DayViewHeader.d.ts +11 -0
- package/dist/components/Calendar/CalendarDay/DayViewHeader/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarDay/WeekCarousel/WeekCarousel.d.ts +8 -0
- package/dist/components/Calendar/CalendarDay/WeekCarousel/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarDay/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarHeader/CalendarHeader.d.ts +2 -0
- package/dist/components/Calendar/CalendarHeader/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/CalendarMonth.d.ts +2 -0
- package/dist/components/Calendar/CalendarMonth/DayCell/DayCell.d.ts +9 -0
- package/dist/components/Calendar/CalendarMonth/DayCell/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/MonthCarousel/MonthCarousel.d.ts +10 -0
- package/dist/components/Calendar/CalendarMonth/MonthCarousel/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/MonthSlide/MonthSlide.d.ts +12 -0
- package/dist/components/Calendar/CalendarMonth/MonthSlide/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/WeekEventLayer/WeekEventLayer.d.ts +9 -0
- package/dist/components/Calendar/CalendarMonth/WeekEventLayer/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/WeekRow/WeekRow.d.ts +15 -0
- package/dist/components/Calendar/CalendarMonth/WeekRow/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/WeekdayHeader/WeekdayHeader.d.ts +2 -0
- package/dist/components/Calendar/CalendarMonth/WeekdayHeader/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarMonth/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarThreeDay/CalendarThreeDay.d.ts +2 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayAllDayEvents/ThreeDayAllDayEvents.d.ts +9 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayAllDayEvents/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayBody/ThreeDayBody.d.ts +8 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayBody/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayCarousel.context.d.ts +23 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayHeader/ThreeDayHeader.d.ts +2 -0
- package/dist/components/Calendar/CalendarThreeDay/ThreeDayHeader/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarThreeDay/index.d.ts +1 -0
- package/dist/components/Calendar/EventCard/EventCard.d.ts +16 -0
- package/dist/components/Calendar/EventCard/index.d.ts +2 -0
- package/dist/components/Calendar/constants.d.ts +55 -0
- package/dist/components/Calendar/context/CalendarContext.d.ts +32 -0
- package/dist/components/Calendar/hooks/index.d.ts +8 -0
- package/dist/components/Calendar/hooks/useCellHeight.d.ts +6 -0
- package/dist/components/Calendar/hooks/useMonthCarousel.d.ts +19 -0
- package/dist/components/Calendar/hooks/useMonthDates.d.ts +4 -0
- package/dist/components/Calendar/hooks/useMonthEventLayout.d.ts +16 -0
- package/dist/components/Calendar/hooks/useThreeDayCarousel.d.ts +30 -0
- package/dist/components/Calendar/hooks/useWeekCarousel.d.ts +19 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/interface.d.ts +31 -0
- package/dist/components/Calendar/utils/colorUtils.d.ts +9 -0
- package/dist/components/Calendar/utils/cx.d.ts +2 -0
- package/dist/components/Calendar/utils/dateUtils.d.ts +29 -0
- package/dist/components/Calendar/utils/dayLayoutAlgorithm.d.ts +33 -0
- package/dist/components/Calendar/utils/ensureDayjsPlugins.d.ts +2 -0
- package/dist/components/Calendar/utils/index.d.ts +9 -0
- package/dist/components/Calendar/utils/monthLayoutAlgorithm.d.ts +56 -0
- package/dist/components/Calendar/utils/normalizeData.d.ts +4 -0
- package/dist/components/Calendar/utils/threeDaysAlgorithm.d.ts +18 -0
- package/dist/components/Calendar/utils/timeUtils.d.ts +10 -0
- package/dist/components/ConfigProvider/ConfigProvider.d.ts +3 -0
- package/dist/components/ConfigProvider/context.d.ts +6 -0
- package/dist/components/ConfigProvider/index.d.ts +5 -0
- package/dist/components/Gantt/Gantt.d.ts +3 -0
- package/dist/components/Gantt/index.d.ts +2 -0
- package/dist/components/Gantt/interface.d.ts +5 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/hooks/useLocale.d.ts +11 -0
- package/dist/index.js +6 -0
- package/dist/locale/context/LocaleContext.d.ts +7 -0
- package/dist/locale/formatLocaleMessage.d.ts +2 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/lang/en-US.json.d.ts +46 -0
- package/dist/locale/lang/zh-CN.json.d.ts +46 -0
- package/dist/locale/lang/zh-TW.json.d.ts +46 -0
- package/dist/locale/lookup.d.ts +2 -0
- package/dist/style.css +2 -0
- package/dist/vendors/useLocale-BbUDQCzl.js +57 -0
- package/dist/vendors/version-BVySNITW.js +6 -0
- package/dist/version.d.ts +1 -0
- package/dist/vite-env.d.ts +13 -0
- package/package.json +77 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
/** 获取指定日期所在周的 7 个日期(周一~周日,isoWeek) */
|
|
3
|
+
export declare function getWeekDates(date: Date | Dayjs): Dayjs[];
|
|
4
|
+
/** 月视图起止日期范围 */
|
|
5
|
+
export declare const getMonthViewRange: (date: Date) => {
|
|
6
|
+
start: Dayjs;
|
|
7
|
+
end: Dayjs;
|
|
8
|
+
};
|
|
9
|
+
/** 月历全部日期(含前后月填充),固定 42 天(6 周 × 7 天) */
|
|
10
|
+
export declare function getMonthCalendarDates(monthDate: Dayjs): Dayjs[];
|
|
11
|
+
export declare function groupDatesByWeek(dates: Dayjs[]): Dayjs[][];
|
|
12
|
+
export declare function isToday(date: Dayjs, timeZone?: string): boolean;
|
|
13
|
+
export declare function isCurrentMonth(date: Dayjs, monthDate: Dayjs): boolean;
|
|
14
|
+
/** 全天事件:开始日期 !== 结束日期 */
|
|
15
|
+
export declare function isAllDayEvent(event: {
|
|
16
|
+
startTime: Dayjs | string | Date;
|
|
17
|
+
endTime: Dayjs | string | Date;
|
|
18
|
+
}): boolean;
|
|
19
|
+
export declare function eventCoversDate(event: {
|
|
20
|
+
startTime: Dayjs | string | Date;
|
|
21
|
+
endTime: Dayjs | string | Date;
|
|
22
|
+
}, targetDate: Dayjs): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 过滤某天覆盖的事件(与月布局算法一致:结束为 0 点整视为前一天结束)
|
|
25
|
+
*/
|
|
26
|
+
export declare function filterEventsForDay<T extends {
|
|
27
|
+
startTime: Dayjs | string | Date;
|
|
28
|
+
endTime: Dayjs | string | Date;
|
|
29
|
+
}>(events: T[], selectedDate: Dayjs): T[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
export interface DayLayoutEvent {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
startTime: Dayjs | string | Date;
|
|
6
|
+
endTime: Dayjs | string | Date;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface LayoutEvent {
|
|
10
|
+
event: DayLayoutEvent;
|
|
11
|
+
top: number;
|
|
12
|
+
height: number;
|
|
13
|
+
left: number;
|
|
14
|
+
width: number;
|
|
15
|
+
isPercent: boolean;
|
|
16
|
+
column: number;
|
|
17
|
+
totalColumns: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const groupIntoClusters: (events: DayLayoutEvent[]) => DayLayoutEvent[][];
|
|
20
|
+
export declare const assignColumns: (cluster: DayLayoutEvent[]) => Map<string, number>;
|
|
21
|
+
export declare const calculateExpansion: (event: DayLayoutEvent, column: number, totalColumns: number, cluster: DayLayoutEvent[], columnMap: Map<string, number>) => number;
|
|
22
|
+
export declare const calculateHorizontalLayout: (cluster: DayLayoutEvent[], columnMap: Map<string, number>) => Map<string, {
|
|
23
|
+
left: number;
|
|
24
|
+
width: number;
|
|
25
|
+
isPercent: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const calculateLayout: (events: DayLayoutEvent[], zoomConfig: {
|
|
28
|
+
interval: number;
|
|
29
|
+
rowHeight: number;
|
|
30
|
+
}) => {
|
|
31
|
+
timedEvents: LayoutEvent[];
|
|
32
|
+
allDayEvents: DayLayoutEvent[];
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { cx } from './cx';
|
|
2
|
+
export { getColorScheme, resolveScheduleColorVars } from './colorUtils';
|
|
3
|
+
export { ensureDayjsPlugins } from './ensureDayjsPlugins';
|
|
4
|
+
export { parseCalendarTime, getCurrentTimeInTZ, getTimeZoneLabel, isTodayInTZ } from './timeUtils';
|
|
5
|
+
export { normalizeEvents } from './normalizeData';
|
|
6
|
+
export { getWeekDates, getMonthViewRange, getMonthCalendarDates, groupDatesByWeek, isToday, isCurrentMonth, isAllDayEvent, eventCoversDate, filterEventsForDay, } from './dateUtils';
|
|
7
|
+
export * from './monthLayoutAlgorithm';
|
|
8
|
+
export * from './dayLayoutAlgorithm';
|
|
9
|
+
export * from './threeDaysAlgorithm';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
export interface SegmentPosition {
|
|
3
|
+
top: number;
|
|
4
|
+
height: number;
|
|
5
|
+
left: string;
|
|
6
|
+
width: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MonthGridEvent<T = {
|
|
9
|
+
id: string;
|
|
10
|
+
}> {
|
|
11
|
+
event: T;
|
|
12
|
+
startDayIndex: number;
|
|
13
|
+
endDayIndex: number;
|
|
14
|
+
span: number;
|
|
15
|
+
originalStartDayIndex: number;
|
|
16
|
+
}
|
|
17
|
+
export interface EventSegmentData<T = {
|
|
18
|
+
id: string;
|
|
19
|
+
}> {
|
|
20
|
+
event: T;
|
|
21
|
+
weekIndex: number;
|
|
22
|
+
startCol: number;
|
|
23
|
+
endCol: number;
|
|
24
|
+
row: number;
|
|
25
|
+
isStart: boolean;
|
|
26
|
+
isEnd: boolean;
|
|
27
|
+
isWeekStart: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface MonthEventRowsResult<T = {
|
|
30
|
+
id: string;
|
|
31
|
+
}> {
|
|
32
|
+
weekLayouts: EventSegmentData<T>[][];
|
|
33
|
+
eventRowMap: Map<string, number>;
|
|
34
|
+
gridEvents: MonthGridEvent<T>[];
|
|
35
|
+
}
|
|
36
|
+
export declare function calculateSegmentPosition(segment: {
|
|
37
|
+
startCol: number;
|
|
38
|
+
endCol: number;
|
|
39
|
+
row: number;
|
|
40
|
+
}): SegmentPosition;
|
|
41
|
+
export declare function assignGlobalRows<T extends {
|
|
42
|
+
id: string;
|
|
43
|
+
startTime: Dayjs | string | Date;
|
|
44
|
+
endTime: Dayjs | string | Date;
|
|
45
|
+
}>(events: T[], gridStart: Dayjs, dayCount: number): Map<string, number>;
|
|
46
|
+
export declare function computeVisibility<T extends {
|
|
47
|
+
id: string;
|
|
48
|
+
startTime: Dayjs | string | Date;
|
|
49
|
+
endTime: Dayjs | string | Date;
|
|
50
|
+
}>(eventRowMap: Map<string, number>, events: T[], gridStart: Dayjs, dayCount: number, maxVisibleRows: number): Set<string>;
|
|
51
|
+
export declare function assignMonthEventRows<T extends {
|
|
52
|
+
id: string;
|
|
53
|
+
startTime: Dayjs | string | Date;
|
|
54
|
+
endTime: Dayjs | string | Date;
|
|
55
|
+
}>(events: T[], gridStart: Dayjs, weekCount?: number): MonthEventRowsResult<T>;
|
|
56
|
+
export declare function computeWeekHiddenCounts(weekSegments: EventSegmentData[], hiddenScheduleIds: Set<string>, maxVisibleRows: number): number[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
interface GridEventInput {
|
|
3
|
+
id: string;
|
|
4
|
+
startTime: Dayjs | string | Date;
|
|
5
|
+
endTime: Dayjs | string | Date;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
interface GridEvent<T extends GridEventInput = GridEventInput> {
|
|
9
|
+
event: T;
|
|
10
|
+
startCol: number;
|
|
11
|
+
endCol: number;
|
|
12
|
+
span: number;
|
|
13
|
+
startTimestamp: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function assignAllDayRowsUnbounded<T extends GridEventInput>(events: T[], baseDate: Dayjs): Array<GridEvent<T> & {
|
|
16
|
+
row: number;
|
|
17
|
+
}>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
export type CalendarTimeInput = number | string | Date | Dayjs;
|
|
3
|
+
/**
|
|
4
|
+
* 按 IANA 时区解析日历时间。
|
|
5
|
+
* number/Date 视为绝对时间戳;string 由 dayjs 解析后再 .tz。
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseCalendarTime: (value: CalendarTimeInput | null | undefined, timeZone?: string) => Dayjs;
|
|
8
|
+
export declare const getCurrentTimeInTZ: (timeZone?: string) => Dayjs;
|
|
9
|
+
export declare const getTimeZoneLabel: (timeZone?: string) => string;
|
|
10
|
+
export declare const isTodayInTZ: (date: Dayjs | Date, timeZone?: string) => boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ConfigProvider, default } from './ConfigProvider';
|
|
2
|
+
export { useLocale } from '../../hooks/useLocale';
|
|
3
|
+
export type { LocaleKeys } from '../../hooks/useLocale';
|
|
4
|
+
export type { ConfigProviderProps } from './context';
|
|
5
|
+
export type { Locale } from '../../locale';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Gantt } from './Gantt';
|
|
2
|
+
export type { GanttProps } from './Gantt';
|
|
3
|
+
export { default as Calendar } from './Calendar';
|
|
4
|
+
export type { CalendarProps, CalendarEvent, CalendarViewMode, NormalizedCalendarEvent, } from './Calendar';
|
|
5
|
+
export { ConfigProvider, useLocale } from './ConfigProvider';
|
|
6
|
+
export type { ConfigProviderProps, LocaleKeys, Locale } from './ConfigProvider';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as zhCN } from '../locale/lang/zh-CN.json';
|
|
2
|
+
import { LocaleParams } from '../locale/formatLocaleMessage';
|
|
3
|
+
import { Locale } from '../locale';
|
|
4
|
+
type FlattenObjectKeys<T, K extends keyof T = keyof T> = K extends string ? T[K] extends object ? `${K}.${FlattenObjectKeys<T[K]>}` : `${K}` : never;
|
|
5
|
+
export type LocaleKeys = FlattenObjectKeys<typeof zhCN>;
|
|
6
|
+
interface ILocaleContext {
|
|
7
|
+
locale: Locale;
|
|
8
|
+
t: (key: LocaleKeys, params?: LocaleParams) => string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useLocale: () => ILocaleContext;
|
|
11
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./vendors/version-BVySNITW.js";
|
|
2
|
+
import { t as e } from "./Gantt/Gantt-DLmqZPAQ.js";
|
|
3
|
+
import { t } from "./Calendar/Calendar-6ibIyMx0.js";
|
|
4
|
+
import { t as n } from "./vendors/useLocale-BbUDQCzl.js";
|
|
5
|
+
import { t as r } from "./ConfigProvider/ConfigProvider-E792q6ny.js";
|
|
6
|
+
export { t as Calendar, r as ConfigProvider, e as Gantt, n as useLocale };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LocaleKeys } from '../../hooks/useLocale';
|
|
2
|
+
import { Locale } from '../index';
|
|
3
|
+
import { LocaleParams } from '../formatLocaleMessage';
|
|
4
|
+
export declare const LocaleContext: import('react').Context<{
|
|
5
|
+
locale: Locale;
|
|
6
|
+
t: (key: LocaleKeys, params?: LocaleParams) => string;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"calendar": {
|
|
3
|
+
"today": "Today",
|
|
4
|
+
"viewDay": "Day",
|
|
5
|
+
"viewThreeDay": "3-Day",
|
|
6
|
+
"viewMonth": "Month",
|
|
7
|
+
"yearMonth": "{monthShort} {year}",
|
|
8
|
+
"monthShort": {
|
|
9
|
+
"1": "Jan",
|
|
10
|
+
"2": "Feb",
|
|
11
|
+
"3": "Mar",
|
|
12
|
+
"4": "Apr",
|
|
13
|
+
"5": "May",
|
|
14
|
+
"6": "Jun",
|
|
15
|
+
"7": "Jul",
|
|
16
|
+
"8": "Aug",
|
|
17
|
+
"9": "Sep",
|
|
18
|
+
"10": "Oct",
|
|
19
|
+
"11": "Nov",
|
|
20
|
+
"12": "Dec"
|
|
21
|
+
},
|
|
22
|
+
"weekday": {
|
|
23
|
+
"1": "Mon",
|
|
24
|
+
"2": "Tue",
|
|
25
|
+
"3": "Wed",
|
|
26
|
+
"4": "Thu",
|
|
27
|
+
"5": "Fri",
|
|
28
|
+
"6": "Sat",
|
|
29
|
+
"7": "Sun"
|
|
30
|
+
},
|
|
31
|
+
"weekdayPrefixed": {
|
|
32
|
+
"1": "Mon",
|
|
33
|
+
"2": "Tue",
|
|
34
|
+
"3": "Wed",
|
|
35
|
+
"4": "Thu",
|
|
36
|
+
"5": "Fri",
|
|
37
|
+
"6": "Sat",
|
|
38
|
+
"7": "Sun"
|
|
39
|
+
},
|
|
40
|
+
"collapse": "Show less",
|
|
41
|
+
"moreRecords": "{count} more"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"calendar": {
|
|
3
|
+
"today": "今天",
|
|
4
|
+
"viewDay": "日",
|
|
5
|
+
"viewThreeDay": "三日",
|
|
6
|
+
"viewMonth": "月",
|
|
7
|
+
"yearMonth": "{year}年{monthShort}",
|
|
8
|
+
"monthShort": {
|
|
9
|
+
"1": "1月",
|
|
10
|
+
"2": "2月",
|
|
11
|
+
"3": "3月",
|
|
12
|
+
"4": "4月",
|
|
13
|
+
"5": "5月",
|
|
14
|
+
"6": "6月",
|
|
15
|
+
"7": "7月",
|
|
16
|
+
"8": "8月",
|
|
17
|
+
"9": "9月",
|
|
18
|
+
"10": "10月",
|
|
19
|
+
"11": "11月",
|
|
20
|
+
"12": "12月"
|
|
21
|
+
},
|
|
22
|
+
"weekday": {
|
|
23
|
+
"1": "一",
|
|
24
|
+
"2": "二",
|
|
25
|
+
"3": "三",
|
|
26
|
+
"4": "四",
|
|
27
|
+
"5": "五",
|
|
28
|
+
"6": "六",
|
|
29
|
+
"7": "日"
|
|
30
|
+
},
|
|
31
|
+
"weekdayPrefixed": {
|
|
32
|
+
"1": "周一",
|
|
33
|
+
"2": "周二",
|
|
34
|
+
"3": "周三",
|
|
35
|
+
"4": "周四",
|
|
36
|
+
"5": "周五",
|
|
37
|
+
"6": "周六",
|
|
38
|
+
"7": "周日"
|
|
39
|
+
},
|
|
40
|
+
"collapse": "收起",
|
|
41
|
+
"moreRecords": "还有{count}条记录"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"calendar": {
|
|
3
|
+
"today": "今天",
|
|
4
|
+
"viewDay": "日",
|
|
5
|
+
"viewThreeDay": "三天",
|
|
6
|
+
"viewMonth": "月",
|
|
7
|
+
"yearMonth": "{year}年{monthShort}",
|
|
8
|
+
"monthShort": {
|
|
9
|
+
"1": "1月",
|
|
10
|
+
"2": "2月",
|
|
11
|
+
"3": "3月",
|
|
12
|
+
"4": "4月",
|
|
13
|
+
"5": "5月",
|
|
14
|
+
"6": "6月",
|
|
15
|
+
"7": "7月",
|
|
16
|
+
"8": "8月",
|
|
17
|
+
"9": "9月",
|
|
18
|
+
"10": "10月",
|
|
19
|
+
"11": "11月",
|
|
20
|
+
"12": "12月"
|
|
21
|
+
},
|
|
22
|
+
"weekday": {
|
|
23
|
+
"1": "一",
|
|
24
|
+
"2": "二",
|
|
25
|
+
"3": "三",
|
|
26
|
+
"4": "四",
|
|
27
|
+
"5": "五",
|
|
28
|
+
"6": "六",
|
|
29
|
+
"7": "日"
|
|
30
|
+
},
|
|
31
|
+
"weekdayPrefixed": {
|
|
32
|
+
"1": "週一",
|
|
33
|
+
"2": "週二",
|
|
34
|
+
"3": "週三",
|
|
35
|
+
"4": "週四",
|
|
36
|
+
"5": "週五",
|
|
37
|
+
"6": "週六",
|
|
38
|
+
"7": "週日"
|
|
39
|
+
},
|
|
40
|
+
"collapse": "收合",
|
|
41
|
+
"moreRecords": "還有 {count} 筆"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
|
|
46
|
+
export default _default;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
._bsy-mobile-calendar_12jhk_1{box-sizing:border-box;color:#121111;background:#fff;flex-direction:column;width:100%;min-width:0;height:100%;min-height:320px;font-size:14px;line-height:1.5;display:flex;overflow:hidden}._bsy-mobile-calendar__body_12jhk_15{flex:1;min-height:0;overflow:hidden}._bsy-mobile-calendar-header_r7swj_1{flex-shrink:0;justify-content:space-between;align-items:center;gap:8px;min-width:0;height:44px;padding:0 10px;font-size:14px;display:flex}._bsy-mobile-calendar-header__left_r7swj_12{align-items:center;gap:10px;min-width:0;display:flex}._bsy-mobile-calendar-header__year-month_r7swj_18{color:#121211;font-size:16px;font-weight:700}._bsy-mobile-calendar-header__today_r7swj_23{color:#666;cursor:pointer;background:0 0;border:none;align-items:center;padding:0 10px;display:flex}._bsy-mobile-calendar-segmented_r7swj_33{background:#f2f3f5;border-radius:6px;padding:2px;display:inline-flex}._bsy-mobile-calendar-segmented__item_r7swj_39{color:#666;cursor:pointer;background:0 0;border:none;border-radius:4px;min-width:40px;height:28px;padding:0 10px;font-size:13px}._bsy-mobile-calendar-segmented__item--active_r7swj_50{color:#121111;background:#fff;font-weight:500;box-shadow:0 1px 2px #0000000f}._bsy-mobile-calendar-month_lsyxr_1{flex-direction:column;height:100%;display:flex}._bsy-mobile-calendar-weekday-header_lsyxr_7{flex-shrink:0;height:34px;padding-bottom:10px;display:flex}._bsy-mobile-calendar-weekday-header__item_lsyxr_13{color:#121111;flex:1;padding-left:10px;font-size:14px;line-height:24px}._bsy-mobile-calendar-carousel_lsyxr_21{touch-action:pan-y;flex:1;position:relative;overflow:hidden}._bsy-mobile-calendar-month-slide_lsyxr_28{flex-direction:column;width:100%;height:100%;display:flex}._bsy-mobile-calendar-week-row_lsyxr_35{flex:1;min-height:48px;position:relative}._bsy-mobile-calendar-week-row__cells_lsyxr_40{height:100%;display:flex}._bsy-mobile-calendar-day-cell_lsyxr_45{flex-direction:column;flex:1;display:flex;position:relative}._bsy-mobile-calendar-day-cell__header_lsyxr_51{justify-content:flex-start;align-items:center;height:24px;padding-left:10px;display:flex;position:relative}._bsy-mobile-calendar-day-cell__body_lsyxr_59{flex:1;overflow:auto}._bsy-mobile-calendar-day-cell__text_lsyxr_63{color:#121111;border-radius:50%;width:24px;height:24px;font-size:14px;font-weight:700;line-height:24px}._bsy-mobile-calendar-day-cell__text--today_lsyxr_72{color:#fff;text-align:center;background-color:#0265ff;font-weight:500}._bsy-mobile-calendar-day-cell__text--other_lsyxr_78{color:#999}._bsy-mobile-calendar-day-cell__badge_lsyxr_81{color:#666;background-color:#eff0f6;border-radius:4px;justify-content:center;align-items:center;min-width:22px;height:14px;margin-left:4px;padding:0 2px;font-size:10px;display:flex;position:absolute;right:0}._bsy-mobile-calendar-week-events_lsyxr_97{pointer-events:none;position:absolute;inset:0}._bsy-mobile-calendar-week-events_lsyxr_97>*{pointer-events:auto}._bsy-mobile-calendar-week-events__segment_lsyxr_108{position:absolute}._bsy-mobile-calendar-event-card_r9n00_1{border-left:2px solid var(--bsy-mobile-calendar-color,#005eef);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;box-sizing:border-box;color:#121111;background-color:var(--bsy-mobile-calendar-bg,#eff5ff);padding-left:4px;padding-right:4px;font-size:12px;overflow:hidden}._bsy-mobile-calendar-event-card_r9n00_1:active{background-color:var(--bsy-mobile-calendar-hover,#d9e8ff)}._bsy-mobile-calendar-event-card--timed_r9n00_17{white-space:normal;text-overflow:clip;border-left-width:3px;border-radius:4px;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding-top:2px;padding-bottom:2px;line-height:normal;display:flex}._bsy-mobile-calendar-event-card--start_r9n00_30{border-top-left-radius:2px;border-bottom-left-radius:2px}._bsy-mobile-calendar-event-card--end_r9n00_34{border-top-right-radius:2px;border-bottom-right-radius:2px}._bsy-mobile-calendar-event-card--continue_r9n00_38{border-left:none;padding-left:4px}._bsy-mobile-calendar-event-card__timed-body_r9n00_42{max-width:100%;overflow:hidden}._bsy-mobile-calendar-event-card__title_r9n00_46{text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:12px;line-height:16px;overflow:hidden}._bsy-mobile-calendar-event-card__time_r9n00_42{color:#666;text-overflow:ellipsis;white-space:nowrap;width:100%;font-size:11px;line-height:14px;overflow:hidden}._bsy-mobile-calendar-day_12vkp_1{flex-direction:column;height:100%;display:flex;overflow:hidden}._bsy-mobile-calendar-day__header-wrap_12vkp_7{flex-shrink:0;box-shadow:0 4px 4px #0000000f}._bsy-mobile-calendar-day__header_12vkp_7{height:78px;display:flex}._bsy-mobile-calendar-day__tz_12vkp_15{color:#999;flex-shrink:0;justify-content:center;align-items:flex-end;width:56px;padding-bottom:18px;font-size:12px;display:flex}._bsy-mobile-calendar-day__body_12vkp_25{flex:1;overflow:hidden auto}._bsy-mobile-calendar-day__time-grid_12vkp_30{display:flex;position:relative}._bsy-mobile-calendar-day__time-col_12vkp_34{flex-shrink:0;width:56px;position:relative}._bsy-mobile-calendar-day__time-label_12vkp_39{color:#999;text-align:center;width:100%;font-size:12px;position:absolute;transform:translateY(-50%)}._bsy-mobile-calendar-day__content-col_12vkp_47{border-left:1px solid #e0e0e0;flex:1;position:relative}._bsy-mobile-calendar-day__hour-cell_12vkp_52{border-top:1px solid #e0e0e0;height:60px;position:relative}._bsy-mobile-calendar-day__timed-layer_12vkp_57{pointer-events:none;z-index:2;position:absolute;inset:20px 0 0}._bsy-mobile-calendar-day__timed-layer_12vkp_57>*{pointer-events:auto}._bsy-mobile-calendar-day__timed-item_12vkp_69{box-sizing:border-box;padding-right:2px;position:absolute}._bsy-mobile-calendar-week-carousel_12vkp_75{touch-action:pan-y;flex:1;overflow:hidden}._bsy-mobile-calendar-week-slide_12vkp_81{flex-direction:column;flex-shrink:0;display:flex}._bsy-mobile-calendar-week-slide__weekdays_12vkp_86{align-items:center;height:34px;display:flex}._bsy-mobile-calendar-week-slide__dates_12vkp_91{align-items:center;display:flex}._bsy-mobile-calendar-week-slide__weekday_12vkp_86{color:#666;flex:1;justify-content:center;align-items:center;font-size:14px;display:flex}._bsy-mobile-calendar-week-slide__weekday--weekend_12vkp_103{color:#121111}._bsy-mobile-calendar-week-slide__weekday--today_12vkp_106{color:#0265ff}._bsy-mobile-calendar-week-slide__weekday--future_12vkp_109{color:#121111}._bsy-mobile-calendar-week-slide__date-item_12vkp_112{flex:1;justify-content:center;align-items:center;display:flex}._bsy-mobile-calendar-week-slide__date-circle_12vkp_118{border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;font-size:16px;font-weight:700;display:flex}._bsy-mobile-calendar-week-slide__date-circle--today_12vkp_128{color:#fff;background-color:#0265ff}._bsy-mobile-calendar-week-slide__date-circle--today-idle_12vkp_132{color:#0265ff;background-color:#0000}._bsy-mobile-calendar-week-slide__date-circle--past_12vkp_136{color:#666}._bsy-mobile-calendar-week-slide__date-circle--future_12vkp_139{color:#121111}._bsy-mobile-calendar-week-slide__date-circle--selected_12vkp_142{background-color:#eff0f6}._bsy-mobile-calendar-now-line_12vkp_146{z-index:3;pointer-events:none;background-color:#f24848;height:1px;position:absolute;left:0;right:0}._bsy-mobile-calendar-now-dot_12vkp_156{background-color:#f24848;border-radius:50%;width:6px;height:6px;position:absolute;top:-2.5px;left:-3px}._bsy-mobile-calendar-allday_12vkp_166{transition:height .3s ease-in-out;overflow:hidden}._bsy-mobile-calendar-allday__content_12vkp_170{background-color:#fff;flex-direction:column;gap:4px;padding:6px 10px 6px 60px;display:flex}._bsy-mobile-calendar-allday__list_12vkp_177{gap:4px;display:grid}._bsy-mobile-calendar-allday__expand_12vkp_181{color:#666;cursor:pointer;align-items:center;gap:6px;padding:4px 0;font-size:12px;display:flex}._bsy-mobile-calendar-threeday_bnwsm_1{flex-direction:column;height:100%;display:flex;overflow:hidden}._bsy-mobile-calendar-threeday__header-wrap_bnwsm_7{flex-shrink:0;box-shadow:0 4px 4px #0000000f}._bsy-mobile-calendar-threeday__header_bnwsm_7{height:68px;display:flex}._bsy-mobile-calendar-threeday__tz_bnwsm_15{flex-direction:column;flex-shrink:0;width:56px;display:flex}._bsy-mobile-calendar-threeday__tz-empty_bnwsm_21{height:34px}._bsy-mobile-calendar-threeday__tz-label_bnwsm_24{color:#999;justify-content:center;align-items:center;height:34px;font-size:12px;display:flex}._bsy-mobile-calendar-threeday__dates_bnwsm_32{touch-action:pan-y;flex:1;position:relative;overflow:hidden}._bsy-mobile-calendar-threeday__dates-track_bnwsm_38{will-change:transform;height:100%;display:flex}._bsy-mobile-calendar-threeday__date-col_bnwsm_43{flex-direction:column;flex-shrink:0;align-items:flex-start;padding-left:10px;display:flex}._bsy-mobile-calendar-threeday__weekday_bnwsm_50{color:#121111;font-size:14px;line-height:34px}._bsy-mobile-calendar-threeday__weekday--weekend_bnwsm_55{color:#030303}._bsy-mobile-calendar-threeday__weekday--today_bnwsm_58{color:#0265ff}._bsy-mobile-calendar-threeday__weekday--past_bnwsm_61{color:#666}._bsy-mobile-calendar-threeday__date-num_bnwsm_64{color:#666;font-size:18px;font-weight:700;line-height:34px;display:flex}._bsy-mobile-calendar-threeday__date-num--today_bnwsm_71{color:#0265ff}._bsy-mobile-calendar-threeday__date-num--past_bnwsm_74{color:#666}._bsy-mobile-calendar-threeday__date-num--future_bnwsm_77{color:#121111}._bsy-mobile-calendar-threeday__allday_bnwsm_80{min-height:0;padding-left:56px;transition:height .4s cubic-bezier(.25,.8,.25,1);display:flex;position:relative;overflow:hidden}._bsy-mobile-calendar-threeday__allday-area_bnwsm_88{touch-action:pan-y;flex:1;position:relative;overflow:hidden}._bsy-mobile-calendar-threeday__allday-track_bnwsm_94{will-change:transform;display:flex;position:relative}._bsy-mobile-calendar-threeday__allday-card_bnwsm_99{box-sizing:border-box;height:22px;transition:none;position:absolute;top:4px;overflow:hidden}._bsy-mobile-calendar-threeday__expand-btn_bnwsm_107{color:#666;box-sizing:border-box;cursor:pointer;align-items:center;gap:4px;height:22px;font-size:12px;display:flex;position:absolute}._bsy-mobile-calendar-threeday__collapse_bnwsm_118{cursor:pointer;z-index:2;justify-content:center;align-items:center;width:56px;height:26px;display:flex;position:absolute;bottom:10px;left:0}._bsy-mobile-calendar-threeday__body_bnwsm_130{flex:1;overflow:hidden auto}._bsy-mobile-calendar-threeday__body-content_bnwsm_135{display:flex;position:relative}._bsy-mobile-calendar-threeday__body-time_bnwsm_139{flex-shrink:0;width:56px;position:relative}._bsy-mobile-calendar-threeday__body-time_bnwsm_139:after{content:"";background-color:#e0e0e0;width:1px;position:absolute;top:0;bottom:0;right:0}._bsy-mobile-calendar-threeday__time-label_bnwsm_153{color:#999;text-align:center;width:100%;font-size:12px;position:absolute;transform:translateY(-50%)}._bsy-mobile-calendar-threeday__grid_bnwsm_161{touch-action:pan-y;flex:1;padding:0 4px;position:relative;overflow:hidden}._bsy-mobile-calendar-threeday__grid-track_bnwsm_168{will-change:transform;height:1460px;display:flex}._bsy-mobile-calendar-threeday__day-col_bnwsm_173{flex-shrink:0;position:relative}._bsy-mobile-calendar-threeday__hour-cell_bnwsm_177{border-top:1px solid #e0e0e0;height:60px;position:relative}._bsy-mobile-calendar-threeday__timed-layer_bnwsm_182{pointer-events:none;z-index:2;position:absolute;inset:20px 0 0;overflow:hidden}._bsy-mobile-calendar-threeday__timed-layer_bnwsm_182>*{pointer-events:auto}._bsy-mobile-calendar-threeday__timed-item_bnwsm_195{box-sizing:border-box;padding-right:2px;position:absolute}._bsy-mobile-calendar-threeday__now-line_bnwsm_200{z-index:3;pointer-events:none;background-color:#f24848;height:1px;position:absolute;left:3px;right:3px}._bsy-mobile-calendar-threeday__now-dot_bnwsm_209{background-color:#f24848;border-radius:50%;width:6px;height:6px;position:absolute;top:-2.5px;left:0}._bsy-mobile-gantt_cgvph_1{box-sizing:border-box;color:#1f2329;background:#f7f8fa;border:1px dashed #c8c9cc;border-radius:8px;min-height:120px;padding:16px;font-size:14px;line-height:1.5}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "react";
|
|
2
|
+
var n = { calendar: {
|
|
3
|
+
today: "今天",
|
|
4
|
+
viewDay: "日",
|
|
5
|
+
viewThreeDay: "三日",
|
|
6
|
+
viewMonth: "月",
|
|
7
|
+
yearMonth: "{year}年{monthShort}",
|
|
8
|
+
monthShort: {
|
|
9
|
+
1: "1月",
|
|
10
|
+
2: "2月",
|
|
11
|
+
3: "3月",
|
|
12
|
+
4: "4月",
|
|
13
|
+
5: "5月",
|
|
14
|
+
6: "6月",
|
|
15
|
+
7: "7月",
|
|
16
|
+
8: "8月",
|
|
17
|
+
9: "9月",
|
|
18
|
+
10: "10月",
|
|
19
|
+
11: "11月",
|
|
20
|
+
12: "12月"
|
|
21
|
+
},
|
|
22
|
+
weekday: {
|
|
23
|
+
1: "一",
|
|
24
|
+
2: "二",
|
|
25
|
+
3: "三",
|
|
26
|
+
4: "四",
|
|
27
|
+
5: "五",
|
|
28
|
+
6: "六",
|
|
29
|
+
7: "日"
|
|
30
|
+
},
|
|
31
|
+
weekdayPrefixed: {
|
|
32
|
+
1: "周一",
|
|
33
|
+
2: "周二",
|
|
34
|
+
3: "周三",
|
|
35
|
+
4: "周四",
|
|
36
|
+
5: "周五",
|
|
37
|
+
6: "周六",
|
|
38
|
+
7: "周日"
|
|
39
|
+
},
|
|
40
|
+
collapse: "收起",
|
|
41
|
+
moreRecords: "还有{count}条记录"
|
|
42
|
+
} }, r = (e, t) => t ? e.replace(/\{\{(\w+)\}\}|\{(\w+)\}/g, (e, n, r) => {
|
|
43
|
+
let i = t[n || r];
|
|
44
|
+
return i === void 0 ? e : String(i);
|
|
45
|
+
}) : e, i = (e, t, n) => {
|
|
46
|
+
let i = t.split("."), a = e;
|
|
47
|
+
for (let e of i) {
|
|
48
|
+
if (!a || typeof a != "object" || !(e in a)) return console.warn(`[ConfigProvider] Cannot find translation for key: ${t}`), t;
|
|
49
|
+
a = a[e];
|
|
50
|
+
}
|
|
51
|
+
return typeof a == "string" ? r(a, n) : t;
|
|
52
|
+
}, a = e({
|
|
53
|
+
locale: "zh-CN",
|
|
54
|
+
t: (e, t) => i(n, e, t)
|
|
55
|
+
}), o = () => t(a);
|
|
56
|
+
//#endregion
|
|
57
|
+
export { n as i, a as n, i as r, o as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare const __BSY_PKG_NAME__: string;
|
|
4
|
+
declare const __BSY_PKG_VERSION__: string;
|
|
5
|
+
|
|
6
|
+
interface Window {
|
|
7
|
+
__BSY_UI__?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module '*.module.scss' {
|
|
11
|
+
const classes: { readonly [key: string]: string };
|
|
12
|
+
export default classes;
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@baishuyun/ui-mobile",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "百数云 H5 / Mobile UI 组件库",
|
|
6
|
+
"author": "bsy-fe team",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/components/index.d.ts",
|
|
11
|
+
"style": "dist/style.css",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://gitlab.baishuyun.com/bsy/bsy-ui-monorepo"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://gitlab.baishuyun.com/bsy/bsy-ui-monorepo",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"types": "./dist/components/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./style.css": "./dist/style.css",
|
|
26
|
+
"./*": {
|
|
27
|
+
"import": "./dist/*/index.js",
|
|
28
|
+
"types": "./dist/components/*/index.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react",
|
|
37
|
+
"mobile",
|
|
38
|
+
"h5",
|
|
39
|
+
"components",
|
|
40
|
+
"bsy"
|
|
41
|
+
],
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"ahooks": ">=3.7.0",
|
|
44
|
+
"dayjs": ">=1.11.0",
|
|
45
|
+
"react": ">=18.3.0",
|
|
46
|
+
"react-dom": ">=18.3.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@tanstack/react-virtual": "^3.14.3"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^24.3.0",
|
|
53
|
+
"@types/react": "^18.3.1",
|
|
54
|
+
"@types/react-dom": "^18.3.0",
|
|
55
|
+
"@vitejs/plugin-react": "^6.0.0",
|
|
56
|
+
"ahooks": "^3.8.5",
|
|
57
|
+
"dayjs": "^1.11.13",
|
|
58
|
+
"glob": "^11.0.3",
|
|
59
|
+
"react": "^18.3.1",
|
|
60
|
+
"react-dom": "^18.3.1",
|
|
61
|
+
"sass": "^1.89.2",
|
|
62
|
+
"vite": "^8.0.0",
|
|
63
|
+
"vite-plugin-dts": "^4.5.3"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "vite build",
|
|
67
|
+
"build:debug": "vite build --mode debug",
|
|
68
|
+
"build:watch": "vite build --watch --mode debug",
|
|
69
|
+
"dev": "vite build --watch --mode debug",
|
|
70
|
+
"test": "vitest run --passWithNoTests",
|
|
71
|
+
"test:watch": "vitest --passWithNoTests",
|
|
72
|
+
"type-check": "tsc --noEmit",
|
|
73
|
+
"lint": "oxlint .",
|
|
74
|
+
"lint:fix": "oxlint . --fix",
|
|
75
|
+
"clean": "rm -rf dist"
|
|
76
|
+
}
|
|
77
|
+
}
|