sapp-common-package-test-final 1.0.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 +30 -0
- package/dist/components/SAPPCalendar/DailyCalendar/DailyCalendar.d.ts +16 -0
- package/dist/components/SAPPCalendar/DailyCalendar/DailyCell.d.ts +12 -0
- package/dist/components/SAPPCalendar/DailyCalendar/DailyEvent.d.ts +9 -0
- package/dist/components/SAPPCalendar/FilterCalendar/FilterCalendar.d.ts +8 -0
- package/dist/components/SAPPCalendar/HeaderCalendar/HeaderCalendar.d.ts +13 -0
- package/dist/components/SAPPCalendar/HeaderCalendar/LMSHeaderCalendar.d.ts +15 -0
- package/dist/components/SAPPCalendar/MonthlyCalendar/MonthlyCalendar.d.ts +17 -0
- package/dist/components/SAPPCalendar/MonthlyCalendar/MonthlyCell.d.ts +13 -0
- package/dist/components/SAPPCalendar/MonthlyCalendar/MonthlyEvent.d.ts +9 -0
- package/dist/components/SAPPCalendar/SAPPCalendar.d.ts +17 -0
- package/dist/components/SAPPCalendar/WeeklyCalendar/WeeklyCalendar.d.ts +16 -0
- package/dist/components/SAPPCalendar/WeeklyCalendar/WeeklyCell.d.ts +12 -0
- package/dist/components/SAPPCalendar/WeeklyCalendar/WeeklyEvent.d.ts +9 -0
- package/dist/components/SAPPCalendar/common/Button.d.ts +11 -0
- package/dist/components/SAPPCalendar/common/CustomTooltip.d.ts +9 -0
- package/dist/components/SAPPCalendar/common/Icon.d.ts +9 -0
- package/dist/components/SAPPCalendar/common/SelectBox.d.ts +15 -0
- package/dist/components/SAPPCalendar/common/form/HookFormCheckbox.d.ts +3 -0
- package/dist/components/SAPPCalendar/filter/index.d.ts +8 -0
- package/dist/components/SAPPCalendar/filter-calendar/index.d.ts +8 -0
- package/dist/constants/index.d.ts +22 -0
- package/dist/hooks/useEffectAfterMounted.d.ts +1 -0
- package/dist/icons/index.d.ts +16 -0
- package/dist/index.css +997 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1188 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +1184 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/types/index.d.ts +48 -0
- package/dist/utils/index.d.ts +9 -0
- package/package.json +72 -0
package/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# sapp-common-package
|
2
|
+
|
3
|
+
> Made with create-react-library
|
4
|
+
|
5
|
+
[](https://www.npmjs.com/package/sapp-common-package) [](https://standardjs.com)
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
```bash
|
10
|
+
npm install --save sapp-common-package
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
```tsx
|
16
|
+
import React, { Component } from 'react'
|
17
|
+
|
18
|
+
import MyComponent from 'sapp-common-package'
|
19
|
+
import 'sapp-common-package/dist/index.css'
|
20
|
+
|
21
|
+
class Example extends Component {
|
22
|
+
render() {
|
23
|
+
return <MyComponent />
|
24
|
+
}
|
25
|
+
}
|
26
|
+
```
|
27
|
+
|
28
|
+
## License
|
29
|
+
|
30
|
+
MIT © [](https://github.com/)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent, INorm } from '../../../types';
|
4
|
+
interface IWeeklyCalendarProps {
|
5
|
+
startDate: Dayjs;
|
6
|
+
endDate: Dayjs;
|
7
|
+
events: IEvent[];
|
8
|
+
norms: INorm[];
|
9
|
+
showWeeklyNorm: boolean;
|
10
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
11
|
+
onOpenCreate: (date: Date) => void;
|
12
|
+
onEventDetail?: (event: IEvent) => void;
|
13
|
+
loading?: boolean;
|
14
|
+
}
|
15
|
+
declare const DailyCalendar: ({ startDate, endDate, events, onOpenDetail, onOpenCreate, onEventDetail, loading }: IWeeklyCalendarProps) => React.JSX.Element;
|
16
|
+
export default DailyCalendar;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent } from '../../../types';
|
4
|
+
interface IWeeklyCellProps {
|
5
|
+
events: IEvent[];
|
6
|
+
date: Dayjs;
|
7
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
8
|
+
onOpenCreate: (date: Date) => void;
|
9
|
+
onEventDetail?: (event: IEvent) => void;
|
10
|
+
}
|
11
|
+
declare const DailyCell: ({ events, date, onOpenDetail, onOpenCreate, onEventDetail }: IWeeklyCellProps) => React.JSX.Element;
|
12
|
+
export default DailyCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEvent } from '../../../types';
|
3
|
+
interface IWeeklyEventProps {
|
4
|
+
event: IEvent;
|
5
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
6
|
+
onEventDetail?: (event: IEvent) => void;
|
7
|
+
}
|
8
|
+
declare const DailyEvent: ({ event, onOpenDetail, onEventDetail }: IWeeklyEventProps) => React.JSX.Element;
|
9
|
+
export default DailyEvent;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
2
|
+
import { IFilter } from '../../../types';
|
3
|
+
interface IProps {
|
4
|
+
filter: IFilter;
|
5
|
+
setFilter: Dispatch<SetStateAction<IFilter>>;
|
6
|
+
}
|
7
|
+
declare const FilterCalendar: ({ filter, setFilter }: IProps) => React.JSX.Element;
|
8
|
+
export default FilterCalendar;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
3
|
+
import { CalendarMode } from '../../../types';
|
4
|
+
interface IHeaderCalendarProps {
|
5
|
+
title?: string;
|
6
|
+
showTeacherName?: boolean;
|
7
|
+
currentDate: Dayjs;
|
8
|
+
setCurrentDate: Dispatch<SetStateAction<Dayjs>>;
|
9
|
+
calendarMode: CalendarMode;
|
10
|
+
setCalendarMode: Dispatch<SetStateAction<CalendarMode>>;
|
11
|
+
}
|
12
|
+
declare const HeaderCalendar: ({ title, showTeacherName, currentDate, setCurrentDate, calendarMode, setCalendarMode }: IHeaderCalendarProps) => React.JSX.Element;
|
13
|
+
export default HeaderCalendar;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
3
|
+
import { CalendarMode, IFilter } from '../../../types';
|
4
|
+
interface IHeaderCalendarProps {
|
5
|
+
title?: string;
|
6
|
+
showTeacherName?: boolean;
|
7
|
+
currentDate: Dayjs;
|
8
|
+
setCurrentDate: Dispatch<SetStateAction<Dayjs>>;
|
9
|
+
calendarMode: CalendarMode;
|
10
|
+
setCalendarMode: Dispatch<SetStateAction<CalendarMode>>;
|
11
|
+
toggleTurnOnFilter: () => void;
|
12
|
+
filter: IFilter;
|
13
|
+
}
|
14
|
+
declare const LMSHeaderCalendar: ({ title, showTeacherName, currentDate, setCurrentDate, calendarMode, setCalendarMode, toggleTurnOnFilter, filter }: IHeaderCalendarProps) => React.JSX.Element;
|
15
|
+
export default LMSHeaderCalendar;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent, INorm } from '../../../types';
|
4
|
+
interface IMonthlyCalendarProps {
|
5
|
+
currentDate: Dayjs;
|
6
|
+
startDate: Dayjs;
|
7
|
+
endDate: Dayjs;
|
8
|
+
events: IEvent[];
|
9
|
+
norms: INorm[];
|
10
|
+
showWeeklyNorm: boolean;
|
11
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
12
|
+
onOpenCreate: (date: Date) => void;
|
13
|
+
onEventDetail?: (event: IEvent) => void;
|
14
|
+
loading?: boolean;
|
15
|
+
}
|
16
|
+
declare const MonthlyCalendar: ({ currentDate, startDate, endDate, events, norms, showWeeklyNorm, onOpenDetail, onOpenCreate, onEventDetail, loading }: IMonthlyCalendarProps) => React.JSX.Element;
|
17
|
+
export default MonthlyCalendar;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent } from '../../../types';
|
4
|
+
interface IMonthlyCellProps {
|
5
|
+
events: IEvent[];
|
6
|
+
date: Dayjs;
|
7
|
+
currentDate: Dayjs;
|
8
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
9
|
+
onOpenCreate: (date: Date) => void;
|
10
|
+
onEventDetail?: (event: IEvent) => void;
|
11
|
+
}
|
12
|
+
declare const MonthlyCell: ({ currentDate, events, date, onOpenDetail, onOpenCreate, onEventDetail }: IMonthlyCellProps) => React.JSX.Element;
|
13
|
+
export default MonthlyCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEvent } from '../../../types';
|
3
|
+
interface IMonthlyEventProps {
|
4
|
+
event: IEvent;
|
5
|
+
isSameMonth: boolean;
|
6
|
+
onEventDetail?: (event: IEvent) => void;
|
7
|
+
}
|
8
|
+
declare const MonthlyEvent: ({ event, isSameMonth, onEventDetail }: IMonthlyEventProps) => React.JSX.Element;
|
9
|
+
export default MonthlyEvent;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEvent, INorm } from '../../types';
|
3
|
+
interface IAntdCalendarProps {
|
4
|
+
events: IEvent[];
|
5
|
+
norms?: INorm[];
|
6
|
+
teacherName?: string;
|
7
|
+
showTeacherName?: boolean;
|
8
|
+
showWeeklyNorm?: boolean;
|
9
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
10
|
+
onOpenCreate: (date: Date) => void;
|
11
|
+
onRefetchAPI: (startDate: Date, endDate: Date) => Promise<void>;
|
12
|
+
onEventDetail?: (event: IEvent) => void;
|
13
|
+
loading?: boolean;
|
14
|
+
type?: 'normal' | 'filter';
|
15
|
+
}
|
16
|
+
declare const SAPPCalendar: ({ teacherName, events, norms, showTeacherName, showWeeklyNorm, onOpenDetail, onOpenCreate, onRefetchAPI, onEventDetail, loading, type }: IAntdCalendarProps) => React.JSX.Element;
|
17
|
+
export default SAPPCalendar;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent, INorm } from '../../../types';
|
4
|
+
interface IWeeklyCalendarProps {
|
5
|
+
startDate: Dayjs;
|
6
|
+
endDate: Dayjs;
|
7
|
+
events: IEvent[];
|
8
|
+
norms: INorm[];
|
9
|
+
showWeeklyNorm: boolean;
|
10
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
11
|
+
onOpenCreate: (date: Date) => void;
|
12
|
+
onEventDetail?: (event: IEvent) => void;
|
13
|
+
loading?: boolean;
|
14
|
+
}
|
15
|
+
declare const WeeklyCalendar: ({ startDate, endDate, events, norms, showWeeklyNorm, onOpenDetail, onOpenCreate, onEventDetail, loading }: IWeeklyCalendarProps) => React.JSX.Element;
|
16
|
+
export default WeeklyCalendar;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React from 'react';
|
3
|
+
import { IEvent } from '../../../types';
|
4
|
+
interface IWeeklyCellProps {
|
5
|
+
events: IEvent[];
|
6
|
+
date: Dayjs;
|
7
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
8
|
+
onOpenCreate: (date: Date) => void;
|
9
|
+
onEventDetail?: (event: IEvent) => void;
|
10
|
+
}
|
11
|
+
declare const WeeklyCell: ({ events, date, onOpenDetail, onOpenCreate, onEventDetail }: IWeeklyCellProps) => React.JSX.Element;
|
12
|
+
export default WeeklyCell;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEvent } from '../../../types';
|
3
|
+
interface IWeeklyEventProps {
|
4
|
+
event: IEvent;
|
5
|
+
onOpenDetail: (date: Date, events: IEvent[]) => void;
|
6
|
+
onEventDetail?: (event: IEvent) => void;
|
7
|
+
}
|
8
|
+
declare const WeeklyEvent: ({ event, onOpenDetail, onEventDetail }: IWeeklyEventProps) => React.JSX.Element;
|
9
|
+
export default WeeklyEvent;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ButtonColor, ButtonType } from '../../../types';
|
3
|
+
interface IButtonProps {
|
4
|
+
type?: ButtonType;
|
5
|
+
color?: ButtonColor;
|
6
|
+
hoverColor?: ButtonColor;
|
7
|
+
onClick?: () => void;
|
8
|
+
children: any;
|
9
|
+
}
|
10
|
+
declare const Button: ({ type, color, onClick, children }: IButtonProps) => React.JSX.Element;
|
11
|
+
export default Button;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { TooltipPlacement } from 'antd/es/tooltip';
|
2
|
+
import React from 'react';
|
3
|
+
interface ICustomTooltipProps {
|
4
|
+
title: React.ReactNode;
|
5
|
+
children: React.ReactNode;
|
6
|
+
placement?: TooltipPlacement;
|
7
|
+
}
|
8
|
+
declare const CustomTooltip: ({ title, children, placement }: ICustomTooltipProps) => React.JSX.Element;
|
9
|
+
export default CustomTooltip;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import '../SAPPCalendar.tailwind.css';
|
3
|
+
interface IProps {
|
4
|
+
value: string | number;
|
5
|
+
options: {
|
6
|
+
value: string;
|
7
|
+
label: string;
|
8
|
+
}[];
|
9
|
+
defaultValue?: string;
|
10
|
+
className?: string;
|
11
|
+
disabled?: boolean;
|
12
|
+
onChange?: (e: string | number) => void;
|
13
|
+
}
|
14
|
+
declare const SelectBox: React.FC<IProps>;
|
15
|
+
export default SelectBox;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
2
|
+
import { IFilter } from '../../../types';
|
3
|
+
interface IProps {
|
4
|
+
filter: IFilter;
|
5
|
+
setFilter: Dispatch<SetStateAction<IFilter>>;
|
6
|
+
}
|
7
|
+
declare const FilterCalendar: ({ filter, setFilter }: IProps) => React.JSX.Element;
|
8
|
+
export default FilterCalendar;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
2
|
+
import { IFilter } from '../../../types';
|
3
|
+
interface IProps {
|
4
|
+
filter: IFilter;
|
5
|
+
setFilter: Dispatch<SetStateAction<IFilter>>;
|
6
|
+
}
|
7
|
+
declare const FilterCalendar: ({ filter, setFilter }: IProps) => React.JSX.Element;
|
8
|
+
export default FilterCalendar;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export declare const HOURS_PER_DAY = 24;
|
2
|
+
export declare const MINUTES_PER_HOUR = 60;
|
3
|
+
export declare const TIME_FORMAT = "HH:mm";
|
4
|
+
export declare enum DAYS_OF_WEEK {
|
5
|
+
Monday = "Monday",
|
6
|
+
Tuesday = "Tuesday",
|
7
|
+
Wednesday = "Wednesday",
|
8
|
+
Thursday = "Thursday",
|
9
|
+
Friday = "Friday",
|
10
|
+
Saturday = "Saturday",
|
11
|
+
Sunday = "Sunday"
|
12
|
+
}
|
13
|
+
export declare enum EVENT_TYPES {
|
14
|
+
TEACHING = "TEACHING",
|
15
|
+
BUSY = "BUSY",
|
16
|
+
TIME_OFF = "TIME_OFF",
|
17
|
+
OTHER = "OTHER"
|
18
|
+
}
|
19
|
+
export declare const FORMAT_DATE_CARLENDA: {
|
20
|
+
MONTH_AND_WEEK: string;
|
21
|
+
DATE: string;
|
22
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const useEffectAfterMounted: (callback: () => void, dependencies: any[]) => void;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare const Left: () => React.JSX.Element;
|
3
|
+
export declare const Right: () => React.JSX.Element;
|
4
|
+
export declare const Book: () => React.JSX.Element;
|
5
|
+
export declare const CalendarDelete: () => React.JSX.Element;
|
6
|
+
export declare const CalendarAccept: () => React.JSX.Element;
|
7
|
+
export declare const Star: () => React.JSX.Element;
|
8
|
+
export declare const LeftArrowIcon: () => React.JSX.Element;
|
9
|
+
export declare const RightArrowIcon: () => React.JSX.Element;
|
10
|
+
export declare const FilterIcon: () => React.JSX.Element;
|
11
|
+
export declare const TagIcon: () => React.JSX.Element;
|
12
|
+
export declare const EducationIcon: () => React.JSX.Element;
|
13
|
+
export declare const BookIcon: () => React.JSX.Element;
|
14
|
+
export declare const GoldStarIcon: () => React.JSX.Element;
|
15
|
+
export declare const EyeIcon: () => React.JSX.Element;
|
16
|
+
export declare const HiddenEyeIcon: () => React.JSX.Element;
|