ados-rcm 1.1.777 → 1.1.779

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.
@@ -1,6 +1,7 @@
1
1
  import { TUseValues } from '../../AHooks/useValues';
2
2
  import { default as React } from 'react';
3
3
  import { IABaseProps } from '../ABase/ABase';
4
+ import { TIconSize } from '../AIcon/AIcon';
4
5
  import { Resources } from '../AResource/AResource';
5
6
  import { EDir12, TActionRef } from '../ATypes/ATypes';
6
7
  import { IAWrapProps } from '../AWrap/AWrap';
@@ -17,6 +18,7 @@ export interface IADatePickerProps extends IABaseProps, IAWrapProps {
17
18
  actionRef?: TActionRef<IADatePickerActions>;
18
19
  canTabOpen?: boolean;
19
20
  className?: string;
21
+ iconSize?: TIconSize;
20
22
  inputProps?: React.HTMLAttributes<HTMLInputElement>;
21
23
  maxDate?: Date;
22
24
  minDate?: Date;
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { Resources } from '../AResource/AResource';
3
3
  import { EDir12 } from '../ATypes/ATypes';
4
+ import { IDateRange } from './ADateRangePicker';
4
5
  export interface ICalendarPage {
5
6
  month: number;
6
7
  year: number;
@@ -21,20 +22,101 @@ export declare function moveMonth(currentMonth: number, currentYear: number, del
21
22
  } | null;
22
23
  export declare function parseAndNormalizeDateString(str: string | undefined | null, minDate?: Date, maxDate?: Date): Date | null;
23
24
  export declare function adjustMonthForYear(newYear: number, currentMonth: number, minDate?: Date, maxDate?: Date): number;
25
+ export declare const formatDate: (date?: Date) => string;
26
+ export declare function sortDateRange(sDate: Date, eDate: Date): {
27
+ eDate: Date;
28
+ sDate: Date;
29
+ };
30
+ export declare function normalizeDateRange(dr: IDateRange): IDateRange;
31
+ export declare function useCalendarLogic(selectedDate: Date | undefined, minDate: Date | undefined, maxDate: Date | undefined): {
32
+ page: ICalendarPage;
33
+ setPage: React.Dispatch<React.SetStateAction<ICalendarPage>>;
34
+ handleYearChange: (newYear: number) => void;
35
+ handleMonthChange: (newMonth: number) => void;
36
+ calendarDays: IDayObject[];
37
+ resetPage: () => void;
38
+ };
39
+ export declare function useLocalDateSync<T extends Date | IDateRange | undefined>(externalDate: T): [T, (date: T) => void];
40
+ export declare function useDateInputSync(localDate: Date | undefined, isOpen?: boolean): readonly [string, React.Dispatch<React.SetStateAction<string>>];
41
+ interface IDateInputHandlersConfig {
42
+ inputValue: string;
43
+ maxDate?: Date;
44
+ minDate?: Date;
45
+ onError?: (message: string) => void;
46
+ setExternalDate?: (date: Date | undefined) => void;
47
+ setInputValue: (value: string) => void;
48
+ setLocalDate: (date: Date | undefined) => void;
49
+ setPage: React.Dispatch<React.SetStateAction<ICalendarPage>>;
50
+ }
51
+ export declare function useDateInputHandlers(config: IDateInputHandlersConfig): {
52
+ hasError: boolean;
53
+ handleStringChange: (val: string) => void;
54
+ handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
55
+ handleBlur: () => void;
56
+ handlePaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
57
+ };
58
+ export declare function useDateRangeInputSync(localDr?: {
59
+ eDate?: Date;
60
+ sDate?: Date;
61
+ }, isOpen?: boolean): {
62
+ readonly startInputValue: string;
63
+ readonly setStartInputValue: React.Dispatch<React.SetStateAction<string>>;
64
+ readonly endInputValue: string;
65
+ readonly setEndInputValue: React.Dispatch<React.SetStateAction<string>>;
66
+ };
67
+ interface IDateRangeInputHandlersConfig {
68
+ calculateDateRange: (newDate: Date, isStart: boolean) => {
69
+ e: Date;
70
+ s: Date;
71
+ };
72
+ endInputValue: string;
73
+ handleEmptyValue: (isStart: boolean) => void;
74
+ localDr?: IDateRange;
75
+ maxDate?: Date;
76
+ minDate?: Date;
77
+ setEndInputValue: (value: string) => void;
78
+ setLocalDr: (dr?: IDateRange) => void;
79
+ setPage: (page: ICalendarPage) => void;
80
+ setStartInputValue: (value: string) => void;
81
+ showDateError: () => void;
82
+ startInputValue: string;
83
+ updateDateRange: (newDr?: IDateRange) => void;
84
+ }
85
+ export declare function calculateDateRangeFromLocal(newDate: Date, isStart: boolean, localDr?: IDateRange): {
86
+ e: Date;
87
+ s: Date;
88
+ };
89
+ export declare function useDateRangeInputHandlers(config: IDateRangeInputHandlersConfig): {
90
+ hasStartError: boolean;
91
+ hasEndError: boolean;
92
+ handleStartStringChange: (val: string) => void;
93
+ handleEndStringChange: (val: string) => void;
94
+ handleStartKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
95
+ handleEndKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
96
+ handleStartBlur: () => void;
97
+ handleEndBlur: () => void;
98
+ handleStartPaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
99
+ handleEndPaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
100
+ applyStartDateString: () => void;
101
+ applyEndDateString: () => void;
102
+ };
103
+ export declare function useDateRangeLogic(dr: IDateRange | undefined, changeDr: (val?: IDateRange) => void, minDate?: Date, maxDate?: Date): {
104
+ page: ICalendarPage;
105
+ setPage: React.Dispatch<React.SetStateAction<ICalendarPage>>;
106
+ calendarDays: IDayObject[];
107
+ handleDateClick: (date: Date) => void;
108
+ resetPage: () => void;
109
+ handleYearChange: (newYear: number) => void;
110
+ handleMonthChange: (newMonth: number) => void;
111
+ };
24
112
  export interface IDayObject {
25
113
  date: Date;
26
114
  day: number;
27
115
  isCurrentMonth: boolean;
28
116
  isDisabled: boolean;
29
117
  }
30
- /**
31
- * generateCalendarDays
32
- *
33
- * dayjs 기반 단일 루프로 달력 일자를 생성합니다.
34
- * - 이전 달: 첫 주를 채우기 위한 날짜
35
- * - 현재 달: 1일 ~ 말일
36
- * - 다음 달: 마지막 주를 토요일까지 채우기 위한 날짜
37
- */
118
+ export declare const isSameDate: (date1?: Date | null, date2?: Date | null) => boolean;
119
+ export declare const isSameRange: (a?: IDateRange, b?: IDateRange) => boolean;
38
120
  export declare function generateCalendarDays(year: number, month: number, { minDate, maxDate }?: {
39
121
  maxDate?: Date;
40
122
  minDate?: Date;
@@ -46,15 +128,22 @@ interface ICalendarGridProps {
46
128
  sDate?: Date;
47
129
  };
48
130
  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;
131
+ onDateClick: (d: Date) => void;
55
132
  selectedDate?: Date;
56
133
  }
57
- export declare const CalendarGrid: React.NamedExoticComponent<ICalendarGridProps>;
134
+ export declare const CalendarGrid: React.MemoExoticComponent<({ days, selectedDate, dateRange, onDateClick, S }: ICalendarGridProps) => import("react/jsx-runtime").JSX.Element>;
135
+ interface ICalendarHeaderProps {
136
+ S: CSSModuleClasses;
137
+ handleMonthChange: (m: number) => void;
138
+ handleYearChange: (y: number) => void;
139
+ maxDate?: Date;
140
+ minDate?: Date;
141
+ page: ICalendarPage;
142
+ resources: typeof Resources.ADatePicker | typeof Resources.ADateRangePicker;
143
+ setPage: (p: ICalendarPage) => void;
144
+ yearSize?: number;
145
+ }
146
+ export declare const CalendarHeader: ({ page, setPage, handleYearChange, handleMonthChange, minDate, maxDate, yearSize, resources, S, }: ICalendarHeaderProps) => import("react/jsx-runtime").JSX.Element;
58
147
  export declare function usePortalKeyboardNavigation(isOpen: boolean, close: () => void, portalRef: React.RefObject<HTMLElement | null>, anchorRef: React.RefObject<HTMLElement | null>): void;
59
148
  export interface IPortalRefs {
60
149
  anchorRef: React.RefObject<HTMLElement | null>;
@@ -71,18 +160,4 @@ export declare function usePortalManager(refs: IPortalRefs, position: EDir12, is
71
160
  toggle: () => void;
72
161
  calculatePosition: () => void;
73
162
  };
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
163
  export {};
@@ -3,10 +3,10 @@ import { TUseValues } from '../../AHooks/useValues';
3
3
  import { TCanCallback } from '../../AUtils/cbF';
4
4
  import { IItem } from '../../AUtils/objF';
5
5
  import { IABaseProps } from '../ABase/ABase';
6
- import { IDateRange } from '../ADatePicker/ADateRangePicker';
7
6
  import { TIcons } from '../AIcon/AIcon';
8
7
  import { Resources } from '../AResource/AResource';
9
8
  import { TActionRef, TIdx, TPromisable } from '../ATypes/ATypes';
9
+ import { IDateRange } from '../ADatePicker/ADatePickerUtil';
10
10
  import { IATableRowProps } from './ATableBody';
11
11
  export interface IATableTHProps<T extends IItem> {
12
12
  /**
@@ -21,10 +21,7 @@ export declare const tableF: {
21
21
  getMultiFilterValues: <T extends IItem, K extends IItem = any>(filteration: TATableFilteration<T, K>) => Partial<K>;
22
22
  getSelectFilterValue: <T extends IItem>(filteration: TATableFilteration<T>) => {
23
23
  selectedKey: string | number | keyof T;
24
- value: undefined;
25
- } | {
26
- selectedKey: string | number | keyof T;
27
- value: string | number | Date | import('../..').IDateRange;
24
+ value: any;
28
25
  } | undefined;
29
26
  };
30
27
  export {};