ados-rcm 1.1.776 → 1.1.777
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/AModule/AComponents/ADatePicker/ADatePicker.d.ts +6 -93
- package/dist/AModule/AComponents/ADatePicker/ADatePickerUtil.d.ts +88 -0
- package/dist/AModule/AComponents/ADatePicker/ADateRangePicker.d.ts +0 -58
- package/dist/AModule/AComponents/AResource/AResource.d.ts +4 -0
- package/dist/AModule/AComponents/ASelect/ASelect.d.ts +6 -0
- package/dist/AModule/AComponents/AToast/AToast.d.ts +18 -0
- package/dist/index.cjs.js +242 -242
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +30476 -29492
- package/package.json +2 -1
|
@@ -1,118 +1,31 @@
|
|
|
1
1
|
import { TUseValues } from '../../AHooks/useValues';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
import { IABaseProps } from '../ABase/ABase';
|
|
3
4
|
import { Resources } from '../AResource/AResource';
|
|
4
5
|
import { EDir12, TActionRef } from '../ATypes/ATypes';
|
|
6
|
+
import { IAWrapProps } from '../AWrap/AWrap';
|
|
5
7
|
export declare const ADatePickerTypes: readonly ["Primary", "Secondary", "Raw"];
|
|
6
8
|
export type TADatePickerTypes = (typeof ADatePickerTypes)[number];
|
|
7
9
|
export interface IADatePickerActions {
|
|
8
|
-
/**
|
|
9
|
-
* close : () => void
|
|
10
|
-
*
|
|
11
|
-
* Description : closes calendar when called
|
|
12
|
-
*/
|
|
13
10
|
close: () => void;
|
|
14
|
-
/**
|
|
15
|
-
* open : () => void
|
|
16
|
-
*
|
|
17
|
-
* Description : opens calendar when called
|
|
18
|
-
*/
|
|
19
11
|
open: () => void;
|
|
20
|
-
/**
|
|
21
|
-
* toggle : () => void
|
|
22
|
-
*
|
|
23
|
-
* Description : toggles calendar(open <> close) when called
|
|
24
|
-
*/
|
|
25
12
|
toggle: () => void;
|
|
26
13
|
}
|
|
27
|
-
export interface IADatePickerProps extends IABaseProps {
|
|
28
|
-
/**
|
|
29
|
-
* LeftAddon? : React.ReactNode
|
|
30
|
-
*
|
|
31
|
-
* Description : LeftAddon of ADatePicker
|
|
32
|
-
*/
|
|
14
|
+
export interface IADatePickerProps extends IABaseProps, IAWrapProps {
|
|
33
15
|
LeftAddon?: React.ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* RightAddon? : React.ReactNode
|
|
36
|
-
*
|
|
37
|
-
* Description : RightAddon of ADatePicker
|
|
38
|
-
*/
|
|
39
16
|
RightAddon?: React.ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* actionRef? : TActionRef<IADatePickerActions>
|
|
42
|
-
*
|
|
43
|
-
* Description : actionRef of ADatePicker
|
|
44
|
-
*/
|
|
45
17
|
actionRef?: TActionRef<IADatePickerActions>;
|
|
46
|
-
|
|
47
|
-
* className? : string
|
|
48
|
-
*
|
|
49
|
-
* Description : className of ADatePicker
|
|
50
|
-
*/
|
|
18
|
+
canTabOpen?: boolean;
|
|
51
19
|
className?: string;
|
|
52
|
-
|
|
53
|
-
* maxDate? : Date = new Date(new Date().getFullYear() + 1, new Date().getMonth(), new Date().getDate())
|
|
54
|
-
*
|
|
55
|
-
* Description : maximum date of ADatePicker. default is a year later from now
|
|
56
|
-
*/
|
|
20
|
+
inputProps?: React.HTMLAttributes<HTMLInputElement>;
|
|
57
21
|
maxDate?: Date;
|
|
58
|
-
/**
|
|
59
|
-
* minDate? : Date = new Date(new Date().getFullYear() - 1, new Date().getMonth(), new Date().getDate())
|
|
60
|
-
*
|
|
61
|
-
* Description : minimum date of ADatePicker. default is a year ago from now
|
|
62
|
-
*/
|
|
63
22
|
minDate?: Date;
|
|
64
|
-
/**
|
|
65
|
-
* noClearButton? : boolean
|
|
66
|
-
*
|
|
67
|
-
* Description : if true, clear button is not shown
|
|
68
|
-
*/
|
|
69
23
|
noClearButton?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* placeholder? : string
|
|
72
|
-
*
|
|
73
|
-
* Description : placeholder of ADatePicker
|
|
74
|
-
*/
|
|
75
24
|
placeholder?: string;
|
|
76
|
-
/**
|
|
77
|
-
* position? : EDir12 = EDir12.SE
|
|
78
|
-
*
|
|
79
|
-
* Description : position of calendar
|
|
80
|
-
*/
|
|
81
25
|
position?: EDir12;
|
|
82
|
-
/**
|
|
83
|
-
* resources? : Partial<typeof Resources.ADatePicker>
|
|
84
|
-
*
|
|
85
|
-
* Description : language resources of ADatePicker
|
|
86
|
-
*/
|
|
87
26
|
resources?: Partial<typeof Resources.ADatePicker>;
|
|
88
|
-
/**
|
|
89
|
-
* type? : TADatePickerTypes = 'Primary'
|
|
90
|
-
*
|
|
91
|
-
* Description : type of ADatePicker
|
|
92
|
-
*/
|
|
93
27
|
type?: TADatePickerTypes;
|
|
94
|
-
/**
|
|
95
|
-
* useDate? : TUseValues<Date | undefined>
|
|
96
|
-
*
|
|
97
|
-
* Description : useDate of ADatePicker
|
|
98
|
-
*/
|
|
99
28
|
useDate?: TUseValues<Date | undefined>;
|
|
29
|
+
yearSize?: number;
|
|
100
30
|
}
|
|
101
|
-
/**
|
|
102
|
-
* AComponent : ADatePicker
|
|
103
|
-
*
|
|
104
|
-
* Description : ADatePicker is a component for selecting single date.
|
|
105
|
-
*
|
|
106
|
-
* Basic Usage :
|
|
107
|
-
*
|
|
108
|
-
* const actionRef = useRef<IADatePickerActions>();
|
|
109
|
-
* const [date, setDate] = useState(new Date());
|
|
110
|
-
*
|
|
111
|
-
* if (case 1)
|
|
112
|
-
* <ADatePicker useDate={[date, setDate]} actionRef={actionRef}/>
|
|
113
|
-
* <AButton onClick={actionRef.current?.open}>Open</AButton>
|
|
114
|
-
* <AButton onClick={actionRef.current?.close}>Close</AButton>
|
|
115
|
-
* <AButton onClick={actionRef.current?.toggle}>Toggle</AButton>
|
|
116
|
-
*
|
|
117
|
-
*/
|
|
118
31
|
export declare const ADatePicker: (props: IADatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Resources } from '../AResource/AResource';
|
|
3
|
+
import { EDir12 } from '../ATypes/ATypes';
|
|
4
|
+
export interface ICalendarPage {
|
|
5
|
+
month: number;
|
|
6
|
+
year: number;
|
|
7
|
+
}
|
|
8
|
+
/** Min/Max 날짜 정규화 */
|
|
9
|
+
export declare function normalizeMinMaxDates(exMinDate?: Date, exMaxDate?: Date): [Date | undefined, Date | undefined];
|
|
10
|
+
/** 초기 페이지 생성 */
|
|
11
|
+
export declare function makeInitialPage(targetDate?: Date, minDate?: Date, maxDate?: Date): ICalendarPage;
|
|
12
|
+
export declare function getMonthsOptions(year: number, minDate?: Date, maxDate?: Date): number[];
|
|
13
|
+
export declare function getYearsOptions(year: number, minDate?: Date, maxDate?: Date, size?: number): number[];
|
|
14
|
+
export declare function moveMonth(currentMonth: number, currentYear: number, delta: number, options?: {
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
minDate?: Date;
|
|
17
|
+
validateMonths?: boolean;
|
|
18
|
+
}): {
|
|
19
|
+
month: number;
|
|
20
|
+
year: number;
|
|
21
|
+
} | null;
|
|
22
|
+
export declare function parseAndNormalizeDateString(str: string | undefined | null, minDate?: Date, maxDate?: Date): Date | null;
|
|
23
|
+
export declare function adjustMonthForYear(newYear: number, currentMonth: number, minDate?: Date, maxDate?: Date): number;
|
|
24
|
+
export interface IDayObject {
|
|
25
|
+
date: Date;
|
|
26
|
+
day: number;
|
|
27
|
+
isCurrentMonth: boolean;
|
|
28
|
+
isDisabled: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* generateCalendarDays
|
|
32
|
+
*
|
|
33
|
+
* dayjs 기반 단일 루프로 달력 일자를 생성합니다.
|
|
34
|
+
* - 이전 달: 첫 주를 채우기 위한 날짜
|
|
35
|
+
* - 현재 달: 1일 ~ 말일
|
|
36
|
+
* - 다음 달: 마지막 주를 토요일까지 채우기 위한 날짜
|
|
37
|
+
*/
|
|
38
|
+
export declare function generateCalendarDays(year: number, month: number, { minDate, maxDate }?: {
|
|
39
|
+
maxDate?: Date;
|
|
40
|
+
minDate?: Date;
|
|
41
|
+
}): IDayObject[];
|
|
42
|
+
interface ICalendarGridProps {
|
|
43
|
+
S: CSSModuleClasses;
|
|
44
|
+
dateRange?: {
|
|
45
|
+
eDate?: Date;
|
|
46
|
+
sDate?: Date;
|
|
47
|
+
};
|
|
48
|
+
days: IDayObject[];
|
|
49
|
+
onDateClick: (date: Date) => void;
|
|
50
|
+
onHover?: (date: Date | null) => void;
|
|
51
|
+
onLeave?: () => void;
|
|
52
|
+
onMouseDown?: (date: Date) => void;
|
|
53
|
+
onMouseUp?: () => void;
|
|
54
|
+
resources: typeof Resources.ADatePicker | typeof Resources.ADateRangePicker;
|
|
55
|
+
selectedDate?: Date;
|
|
56
|
+
}
|
|
57
|
+
export declare const CalendarGrid: React.NamedExoticComponent<ICalendarGridProps>;
|
|
58
|
+
export declare function usePortalKeyboardNavigation(isOpen: boolean, close: () => void, portalRef: React.RefObject<HTMLElement | null>, anchorRef: React.RefObject<HTMLElement | null>): void;
|
|
59
|
+
export interface IPortalRefs {
|
|
60
|
+
anchorRef: React.RefObject<HTMLElement | null>;
|
|
61
|
+
endRef?: React.RefObject<HTMLElement | null>;
|
|
62
|
+
portalRef: React.RefObject<HTMLElement | null>;
|
|
63
|
+
startRef?: React.RefObject<HTMLElement | null>;
|
|
64
|
+
}
|
|
65
|
+
export declare function usePortalManager(refs: IPortalRefs, position: EDir12, isDisabled?: boolean | string, isLoading?: boolean, canTabOpen?: boolean, resetPage?: () => void): {
|
|
66
|
+
isOpen: boolean;
|
|
67
|
+
isTransitioning: boolean;
|
|
68
|
+
setIsTransitioning: React.Dispatch<React.SetStateAction<boolean>>;
|
|
69
|
+
open: () => void;
|
|
70
|
+
close: () => void;
|
|
71
|
+
toggle: () => void;
|
|
72
|
+
calculatePosition: () => void;
|
|
73
|
+
};
|
|
74
|
+
export declare function useOutsideClick(isOpen: boolean, close: () => void, refs: IPortalRefs): void;
|
|
75
|
+
export interface ICalendarHeaderProps {
|
|
76
|
+
S: CSSModuleClasses;
|
|
77
|
+
endRef?: React.RefObject<HTMLDivElement | null>;
|
|
78
|
+
handleYearChange: (year: number) => void;
|
|
79
|
+
maxDate?: Date;
|
|
80
|
+
minDate?: Date;
|
|
81
|
+
page: ICalendarPage;
|
|
82
|
+
resources: typeof Resources.ADatePicker | typeof Resources.ADateRangePicker;
|
|
83
|
+
setPage: (page: ICalendarPage) => void;
|
|
84
|
+
startRef?: React.RefObject<HTMLDivElement | null>;
|
|
85
|
+
yearSize?: number;
|
|
86
|
+
}
|
|
87
|
+
export declare const CalendarHeader: React.MemoExoticComponent<({ page, setPage, handleYearChange, minDate, maxDate, resources, yearSize, startRef, endRef, S }: ICalendarHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
88
|
+
export {};
|
|
@@ -2,70 +2,12 @@ import { TUseValues } from '../../AHooks/useValues';
|
|
|
2
2
|
import { Resources } from '../AResource/AResource';
|
|
3
3
|
import { IADatePickerProps } from './ADatePicker';
|
|
4
4
|
export interface IDateRange {
|
|
5
|
-
/**
|
|
6
|
-
* eDate : Date;
|
|
7
|
-
*
|
|
8
|
-
* Description : end date of IDateRange
|
|
9
|
-
*/
|
|
10
5
|
eDate: Date;
|
|
11
|
-
/**
|
|
12
|
-
* sDate : Date;
|
|
13
|
-
*
|
|
14
|
-
* Description : start date of IDateRange
|
|
15
|
-
*/
|
|
16
6
|
sDate: Date;
|
|
17
7
|
}
|
|
18
8
|
export interface IADateRangePickerProps extends Omit<IADatePickerProps, 'useDate'> {
|
|
19
|
-
/**
|
|
20
|
-
* noDefaultChoices? : boolean;
|
|
21
|
-
*
|
|
22
|
-
* Description : don't use default choices of ADateRangePicker
|
|
23
|
-
*/
|
|
24
9
|
noDefaultChoices?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* resources : Partial<typeof Resources.ADateRangePicker>;
|
|
27
|
-
*
|
|
28
|
-
* Description : resources of ADateRangePicker
|
|
29
|
-
*/
|
|
30
10
|
resources?: Partial<typeof Resources.ADateRangePicker>;
|
|
31
|
-
/**
|
|
32
|
-
* useDateRange : TUseValues<IDateRange | undefined>;
|
|
33
|
-
*
|
|
34
|
-
* Description : useDateRange of ADateRangePicker
|
|
35
|
-
*/
|
|
36
11
|
useDateRange?: TUseValues<IDateRange | undefined>;
|
|
37
|
-
/**
|
|
38
|
-
* yearsOptionSize? : number = 5
|
|
39
|
-
*/
|
|
40
|
-
yearsOptionSize?: number;
|
|
41
12
|
}
|
|
42
|
-
/**
|
|
43
|
-
* AComponent : ADateRangePicker
|
|
44
|
-
*
|
|
45
|
-
* Description : ADateRangePicker is a component for selecting dateRange
|
|
46
|
-
*
|
|
47
|
-
* Basic Usage :
|
|
48
|
-
*
|
|
49
|
-
* const actionRef = useRef<IADatePickerActions>();
|
|
50
|
-
* const [dateRange, setDateRange] = useState<IDateRange>({ sDate: new Date(), eDate: new Date() });
|
|
51
|
-
*
|
|
52
|
-
* if (case 1)
|
|
53
|
-
* <ADateRangePicker useDateRange={[dateRange, setDateRange]} actionRef={actionRef} />
|
|
54
|
-
* <AButton onClick={actionRef.current?.open}>Open</AButton>
|
|
55
|
-
* <AButton onClick={actionRef.current?.close}>Close</AButton>
|
|
56
|
-
* <AButton onClick={actionRef.current?.toggle}>Toggle</AButton>
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
13
|
export declare const ADateRangePicker: (props: IADateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
-
/**
|
|
61
|
-
* getMonthsOptions : (year: number, minDate?: Date, maxDate?: Date) => number[]
|
|
62
|
-
*
|
|
63
|
-
* Description : get months options. returns months for given year that are between minDate and maxDate
|
|
64
|
-
*/
|
|
65
|
-
export declare function getMonthsOptions(year: number, minDate?: Date, maxDate?: Date): number[];
|
|
66
|
-
/**
|
|
67
|
-
* getYearsOptions : (year: number, minDate?: Date, maxDate?: Date, size? : number) => number[]
|
|
68
|
-
*
|
|
69
|
-
* Description : returns max {size} years with the current year in the middle. If minDate and maxDate are provided, the years will be within the range.
|
|
70
|
-
*/
|
|
71
|
-
export declare function getYearsOptions(year: number, minDate?: Date, maxDate?: Date, size?: number): number[];
|
|
@@ -17,6 +17,8 @@ export declare const Resources: {
|
|
|
17
17
|
weekDays: (n: number) => string;
|
|
18
18
|
months: (n: number) => string;
|
|
19
19
|
'Select Date': string;
|
|
20
|
+
'Invalid Date Format': string;
|
|
21
|
+
Clear: string;
|
|
20
22
|
};
|
|
21
23
|
ADateRangePicker: {
|
|
22
24
|
weekDays: (n: number) => string;
|
|
@@ -26,6 +28,8 @@ export declare const Resources: {
|
|
|
26
28
|
'1\uC8FC\uC77C': string;
|
|
27
29
|
'1\uAC1C\uC6D4': string;
|
|
28
30
|
'3\uAC1C\uC6D4': string;
|
|
31
|
+
'Invalid Date Format': string;
|
|
32
|
+
Clear: string;
|
|
29
33
|
};
|
|
30
34
|
AFileBox: {
|
|
31
35
|
'drop file to select': string;
|
|
@@ -80,6 +80,12 @@ export interface IASelectProps<T> extends IABaseProps {
|
|
|
80
80
|
* Description : options of ASelect. CAREFUL null is not rendered as an option.
|
|
81
81
|
*/
|
|
82
82
|
options: readonly T[] | T[];
|
|
83
|
+
/**
|
|
84
|
+
* optionsRef? : React.RefObject<HTMLDivElement | null>
|
|
85
|
+
*
|
|
86
|
+
* Description : optionsRef of ASelect
|
|
87
|
+
*/
|
|
88
|
+
optionsRef?: React.RefObject<HTMLDivElement | null>;
|
|
83
89
|
/**
|
|
84
90
|
* placeholder? : React.ReactNode
|
|
85
91
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AToastLoadProps {
|
|
2
|
+
maxToasts?: number;
|
|
3
|
+
}
|
|
4
|
+
export interface AToastProps {
|
|
5
|
+
dismissOnClick?: boolean;
|
|
6
|
+
node: React.ReactNode;
|
|
7
|
+
offsetX?: number;
|
|
8
|
+
offsetY?: number;
|
|
9
|
+
position?: 'bottom' | 'top' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
10
|
+
remainTime?: number;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
transitionTime?: number;
|
|
13
|
+
type?: 'normal' | 'error';
|
|
14
|
+
}
|
|
15
|
+
export declare const AToastLoad: React.FC<AToastLoadProps>;
|
|
16
|
+
export declare const AToast: {
|
|
17
|
+
Toast: (po: AToastProps) => void;
|
|
18
|
+
};
|