ados-rcm 1.0.8 → 1.0.9
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/ABase/ABase.d.ts +51 -16
- package/dist/AModule/AComponents/AButton/AButton.d.ts +15 -1
- package/dist/AModule/AComponents/AButton/AIconButton.d.ts +21 -7
- package/dist/AModule/AComponents/ACheckBox/ACheckBox.d.ts +18 -4
- package/dist/AModule/AComponents/AClock/AClock.d.ts +64 -0
- package/dist/AModule/AComponents/ADatePicker/ADatePicker.d.ts +92 -0
- package/dist/AModule/AComponents/ADatePicker/ADateRangePicker.d.ts +36 -13
- package/dist/AModule/AComponents/ADialog/ADialog.d.ts +133 -12
- package/dist/AModule/AComponents/AFileBox/AFileBox.d.ts +30 -0
- package/dist/AModule/AComponents/AFloatMenu/AFloatMenu.d.ts +107 -5
- package/dist/AModule/AComponents/AFrames/AFrames.d.ts +35 -4
- package/dist/AModule/AComponents/AGrow/AGrow.d.ts +10 -0
- package/dist/AModule/AComponents/AIcon/AIcon.d.ts +11 -7
- package/dist/AModule/AComponents/AInput/AInput.d.ts +95 -2
- package/dist/AModule/AComponents/AListView/AListView.d.ts +60 -7
- package/dist/AModule/AComponents/ASelect/ASelect.d.ts +118 -21
- package/dist/AModule/AComponents/ASpace/ASpace.d.ts +22 -0
- package/dist/AModule/AComponents/AStepper/AStepper.d.ts +64 -5
- package/dist/AModule/AComponents/ASwitch/ASwitch.d.ts +17 -0
- package/dist/AModule/AComponents/ATab/ATab.d.ts +62 -0
- package/dist/AModule/AComponents/ATable/ATable.d.ts +545 -18
- package/dist/AModule/AComponents/ATable/ATableBody.d.ts +2 -2
- package/dist/AModule/AComponents/AText/AText.d.ts +24 -0
- package/dist/AModule/AComponents/ATextArea/ATextArea.d.ts +77 -1
- package/dist/AModule/AComponents/ATooltip/ATooltip.d.ts +29 -2
- package/dist/AModule/AComponents/ATree/ATree.d.ts +121 -3
- package/dist/AModule/AComponents/ATypes/ATypes.d.ts +10 -4
- package/dist/AModule/AComponents/AWrap/AWrap.d.ts +28 -2
- package/dist/AModule/AUtils/cbF.d.ts +3 -3
- package/dist/index.cjs.js +15 -41
- package/dist/index.es.js +4377 -7995
- package/package.json +1 -1
|
@@ -1,28 +1,63 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ABase
|
|
3
|
-
* div that can be disabled, loading, and have tooltip
|
|
4
|
-
*
|
|
5
|
-
* Notice :
|
|
6
|
-
* 1. z-index of tooltip is 1000
|
|
7
|
-
* 2. z-index of dimming is 100, and UseDimming.UseDimming.Dimmer.z-index is 0
|
|
8
|
-
* 3.
|
|
9
|
-
*
|
|
10
|
-
* Todo :
|
|
11
|
-
* 1. Dimmer and Spinner are rendered when they are not visible.
|
|
12
|
-
*
|
|
13
|
-
* Used Color Variables
|
|
14
|
-
* --ABase_Dimming
|
|
15
|
-
*/
|
|
16
1
|
/// <reference types="react" />
|
|
17
2
|
export interface IABaseProps extends React.HTMLAttributes<HTMLElement> {
|
|
18
3
|
className?: string;
|
|
19
4
|
style?: React.CSSProperties;
|
|
20
5
|
children?: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* abaseRef? : React.RefObject<HTMLDivElement>
|
|
8
|
+
* Description : ref of ABase *
|
|
9
|
+
* Basic Usage :
|
|
10
|
+
* (1) const ref = useRef<HtmlDivElement>();
|
|
11
|
+
* <ABase abaseRef={ref}/>
|
|
12
|
+
*/
|
|
21
13
|
abaseRef?: React.RefObject<HTMLDivElement>;
|
|
14
|
+
/**
|
|
15
|
+
* isDisabled? : any
|
|
16
|
+
* Description : if truthy, dimming is applied. if isLoading is true, spinner is dimmed as well.
|
|
17
|
+
* Basic Usage :
|
|
18
|
+
* (1) <ABase isDisabled/>
|
|
19
|
+
*/
|
|
22
20
|
isDisabled?: any;
|
|
21
|
+
/**
|
|
22
|
+
* isLoading? : any
|
|
23
|
+
* Description : if truthy, dimming and spinner are applied.
|
|
24
|
+
* Basic Usage :
|
|
25
|
+
* (1) <ABase isLoading/>
|
|
26
|
+
*/
|
|
23
27
|
isLoading?: any;
|
|
28
|
+
/**
|
|
29
|
+
* tooltip? : React.ReactNode
|
|
30
|
+
* Description : tooltip. if tooltip is truthy, tooltip is shown.
|
|
31
|
+
* Basic Usage :
|
|
32
|
+
* (1) <ABase tooltip="tooltip text"/>
|
|
33
|
+
* (2) <ABase tooltip={<div>tooltip text</div>}/>
|
|
34
|
+
*/
|
|
24
35
|
tooltip?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* tooltipDistance? : number = 10
|
|
38
|
+
* Description : distance in pixels between tooltip and target.
|
|
39
|
+
* Basic Usage :
|
|
40
|
+
* (1) <ABase tooltipDistance={10}/>
|
|
41
|
+
*/
|
|
25
42
|
tooltipDistance?: number;
|
|
43
|
+
/**
|
|
44
|
+
* tooltipDelay? : number
|
|
45
|
+
* Description : delay in seconds of tooltip after mouse enter.
|
|
46
|
+
* Basic Usage :
|
|
47
|
+
* (1) <ABase tooltipDelay={100}/>
|
|
48
|
+
*/
|
|
26
49
|
tooltipDelay?: number;
|
|
27
50
|
}
|
|
28
|
-
|
|
51
|
+
/**
|
|
52
|
+
* AComponent : ABase
|
|
53
|
+
* Description : ABase is a base component(like div) that can have isDisabled, isLoading and tooltip.
|
|
54
|
+
* Basic Usage :
|
|
55
|
+
* (1) return <ABase>{children}</ABase>
|
|
56
|
+
*
|
|
57
|
+
* (2) return <ABase isDisabled>{children}</ABase>
|
|
58
|
+
*
|
|
59
|
+
* (3) return <ABase isLoading>{children}</ABase>
|
|
60
|
+
*
|
|
61
|
+
* (4) return <ABase tooltip="tooltip text">{children}</ABase>
|
|
62
|
+
*/
|
|
63
|
+
export declare const ABase: (props: IABaseProps) => React.ReactNode;
|
|
@@ -2,6 +2,20 @@ import { IABaseProps } from '../ABase/ABase';
|
|
|
2
2
|
import { IAWrapProps } from '../AWrap/AWrap';
|
|
3
3
|
export type TAButtonType = 'Primary' | 'Secondary' | 'Undefined';
|
|
4
4
|
export interface IAButtonProps extends IABaseProps, IAWrapProps {
|
|
5
|
+
/**
|
|
6
|
+
* type? : TAButtonType = 'Primary'
|
|
7
|
+
* Description : type of IAButton
|
|
8
|
+
* Basic Usage :
|
|
9
|
+
* (1) <AButton type="Secondary"/>
|
|
10
|
+
*/
|
|
5
11
|
type?: TAButtonType;
|
|
6
12
|
}
|
|
7
|
-
|
|
13
|
+
/**
|
|
14
|
+
* AComponent : AButton
|
|
15
|
+
* Description : AButton is a button component.
|
|
16
|
+
* Basic Usage :
|
|
17
|
+
* (1) <AButton onClick={onClick}>Click Me</AButton>
|
|
18
|
+
*
|
|
19
|
+
* (2) <AButton type="Secondary" onClick={onClick} isDisabled={isDisabled} tooltip={isDisabled && 'Button Disabled'}>Click Me</AButton>
|
|
20
|
+
*/
|
|
21
|
+
export declare const AButton: (props: IAButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { IABaseProps } from '../ABase/ABase';
|
|
2
2
|
import { TIcons } from '../AIcon/AIcon';
|
|
3
|
-
interface IAIconButtonProps {
|
|
3
|
+
interface IAIconButtonProps extends IABaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* icon : TIcons
|
|
6
|
+
* Description : icon of AIconButton
|
|
7
|
+
* Basic Usage :
|
|
8
|
+
* (1) <AIconButton icon="Alert"/>
|
|
9
|
+
*/
|
|
4
10
|
icon: TIcons;
|
|
11
|
+
/**
|
|
12
|
+
* size? : 'Small' | 'Medium' | 'Large' = 'Medium'
|
|
13
|
+
* Description : size of AIconButton
|
|
14
|
+
* Basic Usage :
|
|
15
|
+
* (1) <AIconButton icon="Alert" size="Small"/>
|
|
16
|
+
*/
|
|
5
17
|
size?: 'Small' | 'Medium' | 'Large';
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
isDisabled?: boolean;
|
|
8
|
-
isLoading?: boolean;
|
|
9
|
-
tooltip?: React.ReactNode;
|
|
10
18
|
}
|
|
11
|
-
|
|
19
|
+
/**
|
|
20
|
+
* AComponent : AIconButton
|
|
21
|
+
* Description : AIconButton is a button component with an Icon.
|
|
22
|
+
* Basic Usage :
|
|
23
|
+
* (1) <AIconButton icon="Alert" size="Small" onClick={onClick}/>
|
|
24
|
+
*/
|
|
25
|
+
export declare const AIconButton: (props: IAIconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
26
|
export {};
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { TUseValues } from '../../AHooks/useValues';
|
|
2
2
|
import { IABaseProps } from '../ABase/ABase';
|
|
3
3
|
export interface IACheckBoxProps extends IABaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* useCheck? : TUseValues<any>
|
|
6
|
+
* Description : [useCheck, setUseCheck] = useValues of ACheckBox. if useCheck is truthy, ACheckBox is checked.
|
|
7
|
+
* Basic Usage :
|
|
8
|
+
* (1) const [useCheck, setUseCheck] = useState(false);
|
|
9
|
+
* <ACheckBox useCheck={[useCheck, setUseCheck]}/>
|
|
10
|
+
*/
|
|
4
11
|
useCheck?: TUseValues<any>;
|
|
12
|
+
/**
|
|
13
|
+
* isIndeterminate? : boolean
|
|
14
|
+
* Description : if true, ACheckBox is indeterminate. priority is higher than useCheck.
|
|
15
|
+
* Basic Usage :
|
|
16
|
+
* (1) <ACheckBox isIndeterminate/>
|
|
17
|
+
*/
|
|
5
18
|
isIndeterminate?: boolean;
|
|
6
19
|
}
|
|
7
20
|
/**
|
|
8
|
-
* ACheckBox
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
21
|
+
* AComponent : ACheckBox
|
|
22
|
+
* Description : ACheckBox is a checkbox component.
|
|
23
|
+
* Basic Usage :
|
|
24
|
+
* (1) const [useCheck, setUseCheck] = useState(false);
|
|
25
|
+
* <ACheckBox useCheck={[useCheck, setUseCheck]} onClick={onClick} isDisabled={isDisabled} tooltip={isDisabled && 'CheckBox Disabled'} />
|
|
12
26
|
*/
|
|
13
27
|
export declare const ACheckBox: ({ useCheck, isIndeterminate, ...abaseProps }: IACheckBoxProps) => React.ReactNode;
|
|
@@ -3,15 +3,79 @@ import React from 'react';
|
|
|
3
3
|
import { IABaseProps } from '../ABase/ABase';
|
|
4
4
|
import { TActionRef } from '../ATypes/ATypes';
|
|
5
5
|
export interface IAClockActions {
|
|
6
|
+
/**
|
|
7
|
+
* start : () => void
|
|
8
|
+
* Description : start clock running
|
|
9
|
+
*/
|
|
6
10
|
start: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* stop : () => void
|
|
13
|
+
* Description : stop clock running
|
|
14
|
+
*/
|
|
7
15
|
stop: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* reset : () => void
|
|
18
|
+
* Description : set clock's tick to maxTicks and stop clock running
|
|
19
|
+
*/
|
|
8
20
|
reset: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* setTicks : (ticks: number) => void
|
|
23
|
+
* Description : set clock's tick to specified number
|
|
24
|
+
*/
|
|
9
25
|
setTicks: (ticks: number) => void;
|
|
10
26
|
}
|
|
11
27
|
export interface IAClockProps extends IAWrapProps, IABaseProps {
|
|
28
|
+
/**
|
|
29
|
+
* maxTicks? : number = 300
|
|
30
|
+
* Description : maxTicks of AClock
|
|
31
|
+
* Basic Usage :
|
|
32
|
+
* (1) <AClock maxTicks={180}/>
|
|
33
|
+
*/
|
|
12
34
|
maxTicks?: number;
|
|
35
|
+
/**
|
|
36
|
+
* interval? : number = 1000
|
|
37
|
+
* Description : interval in milliseconds of AClock
|
|
38
|
+
* Basic Usage :
|
|
39
|
+
* (1) <AClock interval={500}/>
|
|
40
|
+
*/
|
|
13
41
|
interval?: number;
|
|
42
|
+
/**
|
|
43
|
+
* onFinish? : () => void
|
|
44
|
+
* Description : onFinish of AClock
|
|
45
|
+
* Basic Usage :
|
|
46
|
+
* (1) <AClock onFinish={onFinish}/>
|
|
47
|
+
*/
|
|
14
48
|
onFinish?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* actionRef? : TActionRef<IAClockActions>
|
|
51
|
+
* Description : actionRef of AClock
|
|
52
|
+
* Basic Usage :
|
|
53
|
+
* (1) const actionRef = useRef<IAClockActions>();
|
|
54
|
+
* <AClock actionRef={ref}/>
|
|
55
|
+
*/
|
|
15
56
|
actionRef?: TActionRef<IAClockActions>;
|
|
16
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* AComponent : AClock
|
|
60
|
+
* Description : AClock is a clock component.
|
|
61
|
+
* Basic Usage :
|
|
62
|
+
* (1) const actionRef = useRef<IAClockActions>();
|
|
63
|
+
* const onStartClick = () => {
|
|
64
|
+
* actionRef.current?.start();
|
|
65
|
+
* }
|
|
66
|
+
* const onStopClick = () => {
|
|
67
|
+
* actionRef.current?.stop();
|
|
68
|
+
* }
|
|
69
|
+
* const onResetClick = () => {
|
|
70
|
+
* actionRef.current?.reset();
|
|
71
|
+
* }
|
|
72
|
+
* return (
|
|
73
|
+
* <div>
|
|
74
|
+
* <AClock onFinish={onFinish} actionRef={ref}/>
|
|
75
|
+
* <AButton onClick={onStartClick}>Start</AButton>
|
|
76
|
+
* <AButton onClick={onStopClick}>Stop</AButton>
|
|
77
|
+
* <AButton onClick={onResetClick}>Reset</AButton>
|
|
78
|
+
* </div>
|
|
79
|
+
* )
|
|
80
|
+
*/
|
|
17
81
|
export declare const AClock: ({ maxTicks, interval, onFinish, actionRef, wrapProps, helperText, label, ...abaseProps }: IAClockProps) => React.ReactNode;
|
|
@@ -3,19 +3,111 @@ import { TUseValues } from '../../AHooks/useValues';
|
|
|
3
3
|
import { EDir12, TActionRef } from '../ATypes/ATypes';
|
|
4
4
|
import { Resources } from '../AResource/AResource';
|
|
5
5
|
export interface IADatePickerActions {
|
|
6
|
+
/**
|
|
7
|
+
* open : () => void
|
|
8
|
+
* Description : opens calendar when called
|
|
9
|
+
*/
|
|
6
10
|
open: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* close : () => void
|
|
13
|
+
* Description : closes calendar when called
|
|
14
|
+
*/
|
|
7
15
|
close: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* toggle : () => void
|
|
18
|
+
* Description : toggles calendar(open <> close) when called
|
|
19
|
+
*/
|
|
8
20
|
toggle: () => void;
|
|
9
21
|
}
|
|
10
22
|
export interface IADatePickerProps {
|
|
23
|
+
/**
|
|
24
|
+
* className? : string
|
|
25
|
+
* Description : className of ADatePicker
|
|
26
|
+
* Basic Usage :
|
|
27
|
+
* (1) <ADatePicker className="className"/>
|
|
28
|
+
*/
|
|
11
29
|
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* useDate? : TUseValues<Date>
|
|
32
|
+
* Description : useDate of ADatePicker
|
|
33
|
+
* Basic Usage :
|
|
34
|
+
* (1) const [date, setDate] = useState(new Date());
|
|
35
|
+
* <ADatePicker useDate={[date, setDate]}/>
|
|
36
|
+
* (2) const [date, setDate] = useState(new Date());
|
|
37
|
+
* const onDateChange = (newDate: Date) => {
|
|
38
|
+
* setDate(newDate);
|
|
39
|
+
* }
|
|
40
|
+
* <ADatePicker useDate={[date, onDateChange]}/>
|
|
41
|
+
*/
|
|
12
42
|
useDate?: TUseValues<Date>;
|
|
43
|
+
/**
|
|
44
|
+
* position? : EDir12 = EDir12.SE
|
|
45
|
+
* Description : position of calendar
|
|
46
|
+
* Basic Usage :
|
|
47
|
+
* (1) <ADatePicker position={EDir12.E}/>
|
|
48
|
+
*/
|
|
13
49
|
position?: EDir12;
|
|
50
|
+
/**
|
|
51
|
+
* actionRef? : TActionRef<IADatePickerActions>
|
|
52
|
+
* Description : actionRef of ADatePicker
|
|
53
|
+
* Basic Usage :
|
|
54
|
+
* (1) const actionRef = useRef<IADatePickerActions>();
|
|
55
|
+
* return (
|
|
56
|
+
* <>
|
|
57
|
+
* <ADatePicker actionRef={ref}/>
|
|
58
|
+
* <AButton onClick={() => ref.current?.open()}>Open</AButton>
|
|
59
|
+
* <AButton onClick={() => ref.current?.close()}>Close</AButton>
|
|
60
|
+
* </>
|
|
61
|
+
*/
|
|
14
62
|
actionRef?: TActionRef<IADatePickerActions>;
|
|
63
|
+
/**
|
|
64
|
+
* minDate? : Date = new Date(new Date().getFullYear() - 1, new Date().getMonth(), new Date().getDate())
|
|
65
|
+
* Description : minimum date of ADatePicker. default is a year ago from now
|
|
66
|
+
* Basic Usage :
|
|
67
|
+
* (1) <ADatePicker minDate={new Date(2021, 0, 1)}/>
|
|
68
|
+
*/
|
|
15
69
|
minDate?: Date;
|
|
70
|
+
/**
|
|
71
|
+
* maxDate? : Date = new Date(new Date().getFullYear() + 1, new Date().getMonth(), new Date().getDate())
|
|
72
|
+
* Description : maximum date of ADatePicker. default is a year later from now
|
|
73
|
+
* Basic Usage :
|
|
74
|
+
* (1) <ADatePicker maxDate={new Date(2022, 0, 1)}/>
|
|
75
|
+
*/
|
|
16
76
|
maxDate?: Date;
|
|
77
|
+
/**
|
|
78
|
+
* resources? : Partial<typeof Resources.ADatePicker>
|
|
79
|
+
* Description : language resources of ADatePicker
|
|
80
|
+
* Basic Usage :
|
|
81
|
+
* (1) <ADatePicker resources={{months: (x) => 'current month :' + x}}/>
|
|
82
|
+
*/
|
|
17
83
|
resources?: Partial<typeof Resources.ADatePicker>;
|
|
84
|
+
/**
|
|
85
|
+
* LeftAddon? : React.ReactNode
|
|
86
|
+
* Description : LeftAddon of ADatePicker
|
|
87
|
+
* Basic Usage :
|
|
88
|
+
* (1) <ADatePicker LeftAddon={<AIcon icon="Alert"/>}/>
|
|
89
|
+
*/
|
|
18
90
|
LeftAddon?: React.ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* RightAddon? : React.ReactNode
|
|
93
|
+
* Description : RightAddon of ADatePicker
|
|
94
|
+
* Basic Usage :
|
|
95
|
+
* (1) <ADatePicker RightAddon={<AIcon icon="Alert"/>}/>
|
|
96
|
+
*/
|
|
19
97
|
RightAddon?: React.ReactNode;
|
|
20
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* AComponent : ADatePicker
|
|
101
|
+
* Description : ADatePicker is a component for selecting single date.
|
|
102
|
+
* Basic Usage :
|
|
103
|
+
* (1) const actionRef = useRef<IADatePickerActions>();
|
|
104
|
+
* const [date, setDate] = useState(new Date());
|
|
105
|
+
* return (
|
|
106
|
+
* <>
|
|
107
|
+
* <ADatePicker useDate={[date, setDate]} actionRef={actionRef}/>
|
|
108
|
+
* <AButton onClick={() => actionRef.current?.open()}>Open</AButton>
|
|
109
|
+
* <AButton onClick={() => actionRef.current?.close()}>Close</AButton>
|
|
110
|
+
* </>
|
|
111
|
+
* )
|
|
112
|
+
*/
|
|
21
113
|
export declare const ADatePicker: ({ className, useDate, actionRef, position, minDate: exMinDate, maxDate: exMaxDate, resources: extResources, LeftAddon, RightAddon, }: IADatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TUseValues } from '../../AHooks/useValues';
|
|
3
|
-
import {
|
|
4
|
-
import { IADatePickerActions } from './ADatePicker';
|
|
5
|
-
import { Resources } from '../AResource/AResource';
|
|
2
|
+
import { IADatePickerProps } from './ADatePicker';
|
|
6
3
|
export interface IDateRange {
|
|
4
|
+
/**
|
|
5
|
+
* sDate : Date;
|
|
6
|
+
* Description : start date of IDateRange
|
|
7
|
+
*/
|
|
7
8
|
sDate: Date;
|
|
9
|
+
/**
|
|
10
|
+
* eDate : Date;
|
|
11
|
+
* Description : end date of IDateRange
|
|
12
|
+
*/
|
|
8
13
|
eDate: Date;
|
|
9
14
|
}
|
|
10
|
-
export interface IADateRangePickerProps {
|
|
11
|
-
|
|
15
|
+
export interface IADateRangePickerProps extends Omit<IADatePickerProps, 'useDate'> {
|
|
16
|
+
/**
|
|
17
|
+
* useDateRange : TUseValues<IDateRange>;
|
|
18
|
+
* Description : useDateRange of ADateRangePicker
|
|
19
|
+
* Basic Usage :
|
|
20
|
+
* (1) const [useDateRange, setUseDateRange] = useState<IDateRange>({ sDate: new Date(), eDate: new Date() });
|
|
21
|
+
* return <ADateRangePicker useDateRange={[useDateRange, setUseDateRange]} />
|
|
22
|
+
* (2) const useDateRange = useValues<IDateRange>({ sDate: new Date(), eDate: new Date() });
|
|
23
|
+
* const onDateRangeChange = (newDateRange: IDateRange) => {
|
|
24
|
+
* setUseDateRange(newDateRange);
|
|
25
|
+
* };
|
|
26
|
+
* return <ADateRangePicker useDateRange={[useDateRange, onDateRangeChange]} />
|
|
27
|
+
*/
|
|
12
28
|
useDateRange?: TUseValues<IDateRange>;
|
|
13
|
-
position?: EDir12;
|
|
14
|
-
actionRef?: TActionRef<IADatePickerActions>;
|
|
15
|
-
minDate?: Date;
|
|
16
|
-
maxDate?: Date;
|
|
17
|
-
resources?: Partial<typeof Resources.ADatePicker>;
|
|
18
|
-
LeftAddon?: React.ReactNode;
|
|
19
|
-
RightAddon?: React.ReactNode;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* AComponent : ADateRangePicker
|
|
32
|
+
* Description : ADateRangePicker is a component for selecting dateRange
|
|
33
|
+
* Basic Usage :
|
|
34
|
+
* (1) const actionRef = useRef<IADatePickerActions>();
|
|
35
|
+
* const [dateRange, setDateRange] = useState<IDateRange>({ sDate: new Date(), eDate: new Date() });
|
|
36
|
+
* return (
|
|
37
|
+
* <>
|
|
38
|
+
* <ADateRangePicker useDateRange={[dateRange, setDateRange]} actionRef={actionRef} />
|
|
39
|
+
* <AButton onClick={() => actionRef.current?.open()}>Open</AButton>
|
|
40
|
+
* <AButton onClick={() => actionRef.current?.close()}>Close</AButton>
|
|
41
|
+
* </>
|
|
42
|
+
* )
|
|
43
|
+
*/
|
|
21
44
|
export declare const ADateRangePicker: ({ className, useDateRange, actionRef, position, minDate: exMinDate, maxDate: exMaxDate, resources: extResources, LeftAddon, RightAddon, }: IADateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,151 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Resources } from '../AResource/AResource';
|
|
3
|
-
import { TActionRef } from '../ATypes/ATypes';
|
|
3
|
+
import { IAEventCallers, TActionRef } from '../ATypes/ATypes';
|
|
4
|
+
/**
|
|
5
|
+
* onOk와 ok의 네이밍 차이 : 해당 function이 Action임을 정의하는 기준을 고찰.
|
|
6
|
+
* onAction은 callback으로 action이 수행될 때 호출된다. 따라서 기본적으로 onAction을 호출하는 곳은 action 한 곳 뿐이다.
|
|
7
|
+
* 이와 다르게 action은 여러 곳에서 해당 action을 수행하고 싶을 때 호출할 수 있다. 만약 한 곳에서만 action을 호출하는 상황이라면 onAction을 사용하도록 한다.
|
|
8
|
+
*/
|
|
4
9
|
export interface IADialogActions {
|
|
10
|
+
/**
|
|
11
|
+
* open : () => void
|
|
12
|
+
* Description : open dialog
|
|
13
|
+
*/
|
|
5
14
|
open: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* close : () => void
|
|
17
|
+
* Description : close dialog
|
|
18
|
+
*/
|
|
6
19
|
close: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* toggle : () => void
|
|
22
|
+
* Description : toggle dialog
|
|
23
|
+
*/
|
|
7
24
|
toggle: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* ok : () => void
|
|
27
|
+
* Description : run ok of the dialog
|
|
28
|
+
*/
|
|
8
29
|
ok: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* cancel : () => void
|
|
32
|
+
* Description : run cancel of the dialog
|
|
33
|
+
*/
|
|
9
34
|
cancel: () => void;
|
|
10
35
|
}
|
|
11
36
|
export type TADialogTypes = 'okCancel' | 'cancelOk' | 'ok' | 'cancel' | 'none';
|
|
12
|
-
export interface IADialogEventCallers {
|
|
13
|
-
preventClose: () => void;
|
|
14
|
-
}
|
|
15
37
|
export interface IADialogProps {
|
|
38
|
+
/**
|
|
39
|
+
* type? : TADialogTypes = 'okCancel'
|
|
40
|
+
* Description : type of dialog. decides the type of action buttons
|
|
41
|
+
* Basic Usage :
|
|
42
|
+
* (1) <ADialog type='cancelOk'/>
|
|
43
|
+
*/
|
|
16
44
|
type?: TADialogTypes;
|
|
45
|
+
/**
|
|
46
|
+
* title? : React.ReactNode
|
|
47
|
+
* Description : title of the dialog
|
|
48
|
+
* Basic Usage :
|
|
49
|
+
* (1) <ADialog title='Title'/>
|
|
50
|
+
*/
|
|
17
51
|
title?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* actionRef? : TActionRef<IADialogActions>
|
|
54
|
+
* Description : actionRef of the dialog
|
|
55
|
+
* Basic Usage :
|
|
56
|
+
* (1) const actionRef = useRef<IADialogActions>();
|
|
57
|
+
* return <ADialog actionRef={ref}/>
|
|
58
|
+
*/
|
|
18
59
|
actionRef?: TActionRef<IADialogActions>;
|
|
60
|
+
/**
|
|
61
|
+
* children? : React.ReactNode
|
|
62
|
+
* Description : children of the dialog
|
|
63
|
+
* Basic Usage :
|
|
64
|
+
* (1) <ADialog>children</ADialog>
|
|
65
|
+
*/
|
|
19
66
|
children?: React.ReactNode;
|
|
20
|
-
|
|
21
|
-
|
|
67
|
+
/**
|
|
68
|
+
* onOk : (e: IAEventCallers) => void;
|
|
69
|
+
* Description : onOk of the dialog. it closes the dialog by default
|
|
70
|
+
* Basic Usage :
|
|
71
|
+
* (1) <ADialog onOk={onOk}/>
|
|
72
|
+
* (2) <ADialog onOk={(e) => e.preventDefault()}/>
|
|
73
|
+
*/
|
|
74
|
+
onOk?: (e: IAEventCallers) => void;
|
|
75
|
+
/**
|
|
76
|
+
* onCancel : (e: IAEventCallers) => void;
|
|
77
|
+
* Description : onCancel of the dialog. it closes the dialog by default
|
|
78
|
+
* Basic Usage :
|
|
79
|
+
* (1) <ADialog onCancel={onCancel}/>
|
|
80
|
+
* (2) <ADialog onCancel={(e) => e.preventDefault()}/>
|
|
81
|
+
*/
|
|
82
|
+
onCancel?: (e: IAEventCallers) => void;
|
|
83
|
+
/**
|
|
84
|
+
* onEnterPress : (e: IAEventCallers) => void;
|
|
85
|
+
* Description : onEnterPress of the dialog. it runs ok by default
|
|
86
|
+
* Basic Usage :
|
|
87
|
+
* (1) <ADialog onEnterPress={onEnterPress}/>
|
|
88
|
+
* (2) <ADialog onEnterPress={(e) => e.preventDefault()}/>
|
|
89
|
+
*/
|
|
90
|
+
onEnterPress?: (e: IAEventCallers) => void;
|
|
91
|
+
/**
|
|
92
|
+
* onEscPress : (e: IAEventCallers) => void;
|
|
93
|
+
* Description : onEscPress of the dialog. it runs cancel by default
|
|
94
|
+
* Basic Usage :
|
|
95
|
+
* (1) <ADialog onEscPress={onEscPress}/>
|
|
96
|
+
* (2) <ADialog onEscPress={(e) => e.preventDefault()}/>
|
|
97
|
+
*/
|
|
98
|
+
onEscPress?: (e: IAEventCallers) => void;
|
|
99
|
+
/**
|
|
100
|
+
* onSpacePress : (e: IAEventCallers) => void;
|
|
101
|
+
* Description : onSpacePress of the dialog. it runs ok by default
|
|
102
|
+
* Basic Usage :
|
|
103
|
+
* (1) <ADialog onSpacePress={onSpacePress}/>
|
|
104
|
+
* (2) <ADialog onSpacePress={(e) => e.preventDefault()}/>
|
|
105
|
+
*/
|
|
106
|
+
onSpacePress?: (e: IAEventCallers) => void;
|
|
107
|
+
/**
|
|
108
|
+
* onPaperClick : (e: IAEventCallers) => void;
|
|
109
|
+
* Description : onPaperClick of the dialog. it runs cancel by default
|
|
110
|
+
* Basic Usage :
|
|
111
|
+
* (1) <ADialog onPaperClick={onPaperClick}/>
|
|
112
|
+
* (2) <ADialog onPaperClick={(e) => e.preventDefault()}/>
|
|
113
|
+
*/
|
|
114
|
+
onPaperClick?: (e: IAEventCallers) => void;
|
|
115
|
+
/**
|
|
116
|
+
* noDim? : boolean = false
|
|
117
|
+
* Description : decides whether the dialog has dim or not
|
|
118
|
+
* Basic Usage :
|
|
119
|
+
* (1) <ADialog noDim/>
|
|
120
|
+
*/
|
|
22
121
|
noDim?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
122
|
+
/**
|
|
123
|
+
* resources? : Partial<typeof Resources.ADialog>
|
|
124
|
+
* Description : language resources of the dialog
|
|
125
|
+
* Basic Usage :
|
|
126
|
+
* (1) <ADialog resources={{ ok: "I'm ok", cancel: "I'm Cancel" }}/>
|
|
127
|
+
*/
|
|
28
128
|
resources?: Partial<typeof Resources.ADialog>;
|
|
29
129
|
}
|
|
30
|
-
|
|
130
|
+
/**
|
|
131
|
+
* AComponent : ADialog
|
|
132
|
+
* Description : ADialog is a dialog component.
|
|
133
|
+
* Basic Usage :
|
|
134
|
+
* (1) const actionRef = useRef<IADialogActions>();
|
|
135
|
+
* const onOk = () => {
|
|
136
|
+
* console.log('ok');
|
|
137
|
+
* }
|
|
138
|
+
* const onCancel = () => {
|
|
139
|
+
* console.log('cancel');
|
|
140
|
+
* }
|
|
141
|
+
* return (
|
|
142
|
+
* <div>
|
|
143
|
+
* <ADialog actionRef={actionRef} title='Dialog Title onOk={onOk} onCancel={onCancel}>
|
|
144
|
+
* <div>Content</div>
|
|
145
|
+
* </ADialog>
|
|
146
|
+
* <AButton onClick={actionRef.current?.open}>Open</AButton>
|
|
147
|
+
* <AButton onClick={actionRef.current?.close}>Close</AButton>
|
|
148
|
+
* </div>
|
|
149
|
+
* )
|
|
150
|
+
*/
|
|
151
|
+
export declare const ADialog: ({ type, title, actionRef, children, onOk: extOnOk, onCancel: extOnCancel, onEnterPress: extOnEnterPress, onEscPress: extOnEscPress, onSpacePress: extOnSpacePress, onPaperClick: extOnPaperClick, noDim, resources: extResources, }: IADialogProps) => import("react").ReactPortal | null;
|
|
@@ -3,11 +3,41 @@ import { TUseValues } from '../../AHooks/useValues';
|
|
|
3
3
|
import { IABaseProps } from '../ABase/ABase';
|
|
4
4
|
import { Resources } from '../AResource/AResource';
|
|
5
5
|
export interface IFileRendererProps {
|
|
6
|
+
/**
|
|
7
|
+
* file : File
|
|
8
|
+
* Description : file to render
|
|
9
|
+
*/
|
|
6
10
|
file: File;
|
|
7
11
|
}
|
|
8
12
|
export interface IAFileBoxProps extends IABaseProps {
|
|
13
|
+
/**
|
|
14
|
+
* useFile : TUseValues<File | null>
|
|
15
|
+
* Description : useFile of AFileBox
|
|
16
|
+
* Basic Usage :
|
|
17
|
+
* (1) const [file, setFile] = useState<File | null>(null);
|
|
18
|
+
* <AFileBox useFile={[file, setFile]}/>
|
|
19
|
+
*/
|
|
9
20
|
useFile: TUseValues<File | null>;
|
|
21
|
+
/**
|
|
22
|
+
* FileRenderer? : (props: IFileRendererProps) => React.ReactNode
|
|
23
|
+
* Description : FileRenderer of AFileBox
|
|
24
|
+
* Basic Usage :
|
|
25
|
+
* (1) <AFileBox FileRenderer={file => <div>{file.name}</div>}/>
|
|
26
|
+
*/
|
|
10
27
|
FileRenderer?: (props: IFileRendererProps) => React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* resources? : typeof Resources.AFileBox
|
|
30
|
+
* Description : resources of AFileBox
|
|
31
|
+
* Basic Usage :
|
|
32
|
+
* (1) <AFileBox resources={{'or Drag & Drop': 'or Drag the File and Drop it here'}}/>
|
|
33
|
+
*/
|
|
11
34
|
resources?: typeof Resources.AFileBox;
|
|
12
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* AComponent : AFileBox
|
|
38
|
+
* Description : AFileBox is a file box component that can select a file.
|
|
39
|
+
* Basic Usage :
|
|
40
|
+
* (1) const [file, setFile] = useState<File | null>(null);
|
|
41
|
+
* return <AFileBox useFile={[file, setFile]}/>
|
|
42
|
+
*/
|
|
13
43
|
export declare const AFileBox: ({ useFile, FileRenderer, resources: extResources, ...props }: IAFileBoxProps) => import("react/jsx-runtime").JSX.Element;
|