ados-rcm 1.0.8 → 1.0.10
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 +122 -4
- 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,29 +1,131 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { EDir12, TActionRef, TIdx } from '../ATypes/ATypes';
|
|
3
|
-
import {
|
|
3
|
+
import { TCanCallback } from '../../AUtils/cbF';
|
|
4
4
|
export interface IAFloatMenuActions {
|
|
5
|
+
/**
|
|
6
|
+
* open : () => void
|
|
7
|
+
* <br/>Description : open AFloatMenu
|
|
8
|
+
*/
|
|
5
9
|
open: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* close : () => void
|
|
12
|
+
* <br/>Description : close AFloatMenu
|
|
13
|
+
*/
|
|
6
14
|
close: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* toggle : () => void
|
|
17
|
+
* <br/>Description : toggle AFloatMenu
|
|
18
|
+
*/
|
|
7
19
|
toggle: () => void;
|
|
8
20
|
}
|
|
9
21
|
export interface IAFloatMenuContentProps {
|
|
22
|
+
/**
|
|
23
|
+
* defKey : TIdx
|
|
24
|
+
* <br/>Description : defKey of AFloatMenu
|
|
25
|
+
*/
|
|
10
26
|
defKey: TIdx;
|
|
27
|
+
/**
|
|
28
|
+
* def : IAFloatMenuDef
|
|
29
|
+
* <br/>Description : def of AFloatMenu
|
|
30
|
+
*/
|
|
11
31
|
def: IAFloatMenuDef;
|
|
12
32
|
}
|
|
13
33
|
export interface IAFloatMenuDef {
|
|
34
|
+
/**
|
|
35
|
+
* noDisplay? : boolean
|
|
36
|
+
* <br/>Description : decides whether to display the menu or not
|
|
37
|
+
*/
|
|
14
38
|
noDisplay?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* isDisabled? : boolean
|
|
41
|
+
* <br/>Description : decides whether the menu is disabled or not
|
|
42
|
+
*/
|
|
15
43
|
isDisabled?: boolean;
|
|
16
|
-
|
|
44
|
+
/**
|
|
45
|
+
* content? : TCanCallback<IAFloatMenuContentProps, React.ReactNode>
|
|
46
|
+
* <br/>Description : content of AFloatMenu
|
|
47
|
+
*/
|
|
48
|
+
content?: TCanCallback<IAFloatMenuContentProps, React.ReactNode>;
|
|
17
49
|
}
|
|
18
50
|
export type TAFloatMenuDefs = {
|
|
19
51
|
[key in TIdx]: IAFloatMenuDef;
|
|
20
|
-
} & {
|
|
21
|
-
defaultDef?: IAFloatMenuDef;
|
|
22
52
|
};
|
|
23
53
|
export interface IAFloatMenuProps {
|
|
54
|
+
/**
|
|
55
|
+
* defs : TAFloatMenuDefs
|
|
56
|
+
* <br/>Description : defs of AFloatMenu
|
|
57
|
+
* <br/>Basic Usage :
|
|
58
|
+
* <br/>(1)const defs = {
|
|
59
|
+
* 'testDefKey' : {
|
|
60
|
+
* content : ({defKey, def}) => <div>{defKey}</div>,
|
|
61
|
+
* },
|
|
62
|
+
* 'testDefKey2' : {}
|
|
63
|
+
* }
|
|
64
|
+
* return <AFloatMenu defs={defs}/>
|
|
65
|
+
*/
|
|
24
66
|
defs: TAFloatMenuDefs;
|
|
67
|
+
/**
|
|
68
|
+
* defaultDef? : IAFloatMenuDef
|
|
69
|
+
* <br/>Description : defaultDef of AFloatMenu. it will affect all defs.
|
|
70
|
+
* <br/>Basic Usage :
|
|
71
|
+
* <br/>(1)const defs = {
|
|
72
|
+
* 'testDefKey' : {
|
|
73
|
+
* content : ({defKey, def}) => <div>{defKey}</div>,
|
|
74
|
+
* },
|
|
75
|
+
* 'testDefKey2' : {}
|
|
76
|
+
* }
|
|
77
|
+
* const defaultDef = {
|
|
78
|
+
* content : ({defKey, def}) => <div>I am test defaultDef!</div>,
|
|
79
|
+
* }
|
|
80
|
+
* return <AFloatMenu defs={defs} defaultDef={defaultDef}/> // testDefKey2 will render 'I am test defaultDef!'
|
|
81
|
+
*/
|
|
82
|
+
defaultDef?: IAFloatMenuDef;
|
|
83
|
+
/**
|
|
84
|
+
* anchorRef : React.RefObject<HTMLElement>
|
|
85
|
+
* <br/>Description : anchorRef of AFloatMenu
|
|
86
|
+
* <br/>Basic Usage :
|
|
87
|
+
* <br/>(1)const anchorRef = useRef<HTMLDivElement>(null);
|
|
88
|
+
* return <>
|
|
89
|
+
* <div ref={anchorRef}>I am anchor</div>
|
|
90
|
+
* <AFloatMenu anchorRef={anchorRef}/>
|
|
91
|
+
* </>
|
|
92
|
+
*/
|
|
25
93
|
anchorRef: React.RefObject<HTMLElement>;
|
|
94
|
+
/**
|
|
95
|
+
* position? : EDir12
|
|
96
|
+
* <br/>Description : position of AFloatMenu based on anchorRef
|
|
97
|
+
* <br/>Basic Usage :
|
|
98
|
+
* <br/>(1)<AFloatMenu position={EDir12.W}/>
|
|
99
|
+
*/
|
|
26
100
|
position?: EDir12;
|
|
101
|
+
/**
|
|
102
|
+
* actionRef? : TActionRef<IAFloatMenuActions>
|
|
103
|
+
* <br/>Description : actionRef of AFloatMenu
|
|
104
|
+
* <br/>Basic Usage :
|
|
105
|
+
* <br/>(1)const actionRef = useRef<IAFloatMenuActions>();
|
|
106
|
+
* return <AFloatMenu actionRef={actionRef}/>
|
|
107
|
+
*/
|
|
27
108
|
actionRef?: TActionRef<IAFloatMenuActions>;
|
|
28
109
|
}
|
|
29
|
-
|
|
110
|
+
/**
|
|
111
|
+
* AComponent : AFloatMenu
|
|
112
|
+
* <br/>Description : AFloatMenu is a floating component with menues to click.
|
|
113
|
+
* <br/>Basic Usage :
|
|
114
|
+
* <br/>(1)const defs = {
|
|
115
|
+
* 'testDefKey' : {
|
|
116
|
+
* content : ({defKey, def}) => <div>{defKey}</div>,
|
|
117
|
+
* },
|
|
118
|
+
* 'testDefKey2' : {}
|
|
119
|
+
* }
|
|
120
|
+
* const defaultDef = {
|
|
121
|
+
* content : ({defKey, def}) => <div>I am test defaultDef!</div>,
|
|
122
|
+
* }
|
|
123
|
+
* const anchorRef = useRef<HTMLDivElement>(null);
|
|
124
|
+
* return (
|
|
125
|
+
* <>
|
|
126
|
+
* <div ref={anchorRef}>I am anchor</div>
|
|
127
|
+
* <AFloatMenu defs={defs} defaultDef={defaultDef} anchorRef={anchorRef}/>
|
|
128
|
+
* </>
|
|
129
|
+
* )
|
|
130
|
+
*/
|
|
131
|
+
export declare const AFloatMenu: ({ defs: extDefs, defaultDef: extDefaultDef, anchorRef, actionRef, position, }: IAFloatMenuProps) => import("react").ReactPortal | null;
|
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
import { IABaseProps } from '../ABase/ABase';
|
|
2
|
+
/**
|
|
3
|
+
* AComponent : AFrame : RowFrame
|
|
4
|
+
* <br/>Description : RowFrame is a frame component that is displayed as a row and aligned center.
|
|
5
|
+
* <br/>Basic Usage :
|
|
6
|
+
* <br/>(1)<RowFrame>
|
|
7
|
+
* Items
|
|
8
|
+
* <div>Item1</div>
|
|
9
|
+
* <AICon icon="Alert"/>
|
|
10
|
+
* </RowFrame>
|
|
11
|
+
*/
|
|
2
12
|
export declare const RowFrame: (props: IABaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const ColFrame: (props: IABaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
13
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Description :
|
|
7
|
-
*
|
|
14
|
+
* AComponent : AFrame : ColFrame
|
|
15
|
+
* <br/>Description : ColFrame is a frame component that is displayed as a column and aligned center.
|
|
16
|
+
* <br/>Basic Usage :
|
|
17
|
+
* <br/>(1)<ColFrame>
|
|
18
|
+
* Items
|
|
19
|
+
* <div>Item1</div>
|
|
20
|
+
* <AICon icon="Alert"/>
|
|
21
|
+
* </ColFrame>
|
|
8
22
|
*/
|
|
23
|
+
export declare const ColFrame: (props: IABaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
24
|
interface IOverflowFrameProps extends IABaseProps {
|
|
25
|
+
/**
|
|
26
|
+
* noOverflowTooltip? : boolean
|
|
27
|
+
* <br/>Description : decides whether to display tooltip when overflowed or not
|
|
28
|
+
* <br/>Basic Usage :
|
|
29
|
+
* <br/>(1)<OverflowFrame noOverflowTooltip>
|
|
30
|
+
* Long TextTextTextTextTextTextTextTextTextText
|
|
31
|
+
* </OverflowFrame>
|
|
32
|
+
*/
|
|
10
33
|
noOverflowTooltip?: boolean;
|
|
11
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* AComponent : AFrame : OverflowFrame
|
|
37
|
+
* <br/>Description : OverflowFrame is a frame component that is text-ellipsis and shows tooltips when overflowed.
|
|
38
|
+
* <br/>Basic Usage :
|
|
39
|
+
* <br/>(1)<OverflowFrame>
|
|
40
|
+
* Long TextTextTextTextTextTextTextTextTextText
|
|
41
|
+
* </OverflowFrame>
|
|
42
|
+
*/
|
|
12
43
|
export declare const OverflowFrame: ({ tooltip: extTooltip, children, abaseRef, className, noOverflowTooltip, ...props }: IOverflowFrameProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
44
|
export {};
|
|
@@ -1 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AComponent : AGrow
|
|
3
|
+
* <br/>Description : AGrow is a frame component that grows flexibly.
|
|
4
|
+
* <br/>Basic Usage :
|
|
5
|
+
* <br/>(1)<div style={{display: 'flex', flexGrow: 1}}>
|
|
6
|
+
* Left Item
|
|
7
|
+
* <AGrow/>
|
|
8
|
+
* Right Item
|
|
9
|
+
* </div>
|
|
10
|
+
*/
|
|
1
11
|
export declare const AGrow: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,17 +4,21 @@ export interface IASVGProps extends React.SVGProps<SVGSVGElement> {
|
|
|
4
4
|
}
|
|
5
5
|
export type TIcons = keyof typeof AIcons;
|
|
6
6
|
export interface IAIconProps extends IASVGProps {
|
|
7
|
+
/**
|
|
8
|
+
* icon : TIcons
|
|
9
|
+
* <br/>Description : icon to render
|
|
10
|
+
* <br/>Basic Usage :
|
|
11
|
+
* <br/>(1)<AIcon icon="Alert"/>
|
|
12
|
+
*/
|
|
7
13
|
icon: TIcons;
|
|
8
|
-
isDisabled?: boolean;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Notice 3 : larger images should be handled as images, not icons.
|
|
16
|
+
* AComponent : AIcon
|
|
17
|
+
* <br/>Description : AIcon is an icon component that can render icons.
|
|
18
|
+
* <br/>Basic Usage :
|
|
19
|
+
* <br/>(1)<AIcon icon="Alert"/>
|
|
16
20
|
*/
|
|
17
|
-
export declare const AIcon: ({ icon, svgRef,
|
|
21
|
+
export declare const AIcon: ({ icon, svgRef, ...rest }: IAIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
22
|
export declare const AIcons: Readonly<{
|
|
19
23
|
ArrowDown: (props?: IASVGProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
24
|
ArrowUp: (props?: IASVGProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,115 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IAWrapProps } from '../AWrap/AWrap';
|
|
3
|
-
import { IABaseProps } from '../ABase/ABase';
|
|
4
2
|
import { TUseValues } from '../../AHooks/useValues';
|
|
3
|
+
import { IABaseProps } from '../ABase/ABase';
|
|
4
|
+
import { IAWrapProps } from '../AWrap/AWrap';
|
|
5
5
|
export type TInputType = 'Primary' | 'Secondary' | 'Error';
|
|
6
6
|
export interface IAInputProps extends IABaseProps, IAWrapProps {
|
|
7
|
+
/**
|
|
8
|
+
* onEnterPress? : (value: string) => void
|
|
9
|
+
* <br/>Description : onEnterPress of AInput
|
|
10
|
+
* <br/>Basic Usage :
|
|
11
|
+
* <br/>(1)<AInput onEnterPress={value => console.log(value)}/>
|
|
12
|
+
*/
|
|
7
13
|
onEnterPress?: (value: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* type? : TInputType = 'Primary'
|
|
16
|
+
* <br/>Description : type of AInput
|
|
17
|
+
* <br/>Basic Usage :
|
|
18
|
+
* <br/>(1)<AInput type="Secondary"/>
|
|
19
|
+
*/
|
|
8
20
|
type?: TInputType;
|
|
21
|
+
/**
|
|
22
|
+
* inputRef? : React.RefObject<HTMLInputElement>
|
|
23
|
+
* <br/>Description : inputRef of AInput
|
|
24
|
+
* <br/>Basic Usage :
|
|
25
|
+
* <br/>(1)const inputRef = useRef<HTMLInputElement>(null);
|
|
26
|
+
* <AInput inputRef={inputRef}/>
|
|
27
|
+
*/
|
|
9
28
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
29
|
+
/**
|
|
30
|
+
* useValue? : TUseValues<string>
|
|
31
|
+
* <br/>Description : useValue of AInput
|
|
32
|
+
* <br/>Basic Usage :
|
|
33
|
+
* <br/>(1)const [value, setValue] = useState<string>('');
|
|
34
|
+
* <AInput useValue={[value, setValue]}/>
|
|
35
|
+
*/
|
|
10
36
|
useValue?: TUseValues<string>;
|
|
37
|
+
/**
|
|
38
|
+
* isReadonly? : boolean
|
|
39
|
+
* <br/>Description : decides whether the input is readonly or not
|
|
40
|
+
* <br/>Basic Usage :
|
|
41
|
+
* <br/>(1)<AInput isReadonly/>
|
|
42
|
+
*/
|
|
11
43
|
isReadonly?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* placeholder? : string
|
|
46
|
+
* <br/>Description : placeholder of AInput
|
|
47
|
+
* <br/>Basic Usage :
|
|
48
|
+
* <br/>(1)<AInput placeholder="Placeholder"/>
|
|
49
|
+
*/
|
|
12
50
|
placeholder?: string;
|
|
51
|
+
/**
|
|
52
|
+
* maxLength? : number
|
|
53
|
+
* <br/>Description : maxLength of AInput
|
|
54
|
+
* <br/>Basic Usage :
|
|
55
|
+
* <br/>(1)<AInput maxLength={10}/>
|
|
56
|
+
*/
|
|
13
57
|
maxLength?: number;
|
|
58
|
+
/**
|
|
59
|
+
* tabIndex? : number
|
|
60
|
+
* <br/>Description : tabIndex of AInput
|
|
61
|
+
* <br/>Basic Usage :
|
|
62
|
+
* <br/>(1)<AInput tabIndex={1}/>
|
|
63
|
+
*/
|
|
14
64
|
tabIndex?: number;
|
|
65
|
+
/**
|
|
66
|
+
* autoFocus? : boolean
|
|
67
|
+
* <br/>Description : decides whether the input is focused or not
|
|
68
|
+
* <br/>Basic Usage :
|
|
69
|
+
* <br/>(1)<AInput autoFocus/>
|
|
70
|
+
*/
|
|
15
71
|
autoFocus?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* isPassword? : boolean
|
|
74
|
+
* <br/>Description : decides whether the input is password or not. if true, values will be masked.
|
|
75
|
+
* <br/>Basic Usage :
|
|
76
|
+
* <br/>(1)<AInput isPassword/>
|
|
77
|
+
*/
|
|
16
78
|
isPassword?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* autoComplete? : string = 'off'
|
|
81
|
+
* <br/>Description : autoComplete of AInput
|
|
82
|
+
* <br/>Basic Usage :
|
|
83
|
+
* <br/>(1)<AInput autoComplete="on"/>
|
|
84
|
+
*/
|
|
17
85
|
autoComplete?: string;
|
|
86
|
+
/**
|
|
87
|
+
* LeftAddon? : React.ReactNode
|
|
88
|
+
* <br/>Description : LeftAddon of AInput
|
|
89
|
+
* <br/>Basic Usage :
|
|
90
|
+
* <br/>(1)<AInput LeftAddon={<AICon icon="Search"/>}/>
|
|
91
|
+
*/
|
|
18
92
|
LeftAddon?: React.ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* RightAddon? : React.ReactNode
|
|
95
|
+
* <br/>Description : RightAddon of AInput
|
|
96
|
+
* <br/>Basic Usage :
|
|
97
|
+
* <br/>(1)<AInput RightAddon={<AICon icon="Search"/>}/>
|
|
98
|
+
*/
|
|
19
99
|
RightAddon?: React.ReactNode;
|
|
100
|
+
/**
|
|
101
|
+
* inputProps? : React.InputHTMLAttributes<HTMLInputElement>
|
|
102
|
+
* <br/>Description : inputProps of AInput
|
|
103
|
+
* <br/>Basic Usage :
|
|
104
|
+
* <br/>(1)<AInput inputProps={{onFocus: () => console.log('focus')}}/>
|
|
105
|
+
*/
|
|
20
106
|
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
21
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* AComponent : AInput
|
|
110
|
+
* <br/>Description : AInput is an input component. it has AWrap and ABase inside, so be careful with the styles. I recommend checking out the element hierarchy first.
|
|
111
|
+
* <br/>Basic Usage :
|
|
112
|
+
* <br/>(1)const [value, setValue] = useState<string>('');
|
|
113
|
+
* return <AInput useValue={[value, setValue]}/>
|
|
114
|
+
*/
|
|
22
115
|
export declare const AInput: ({ onEnterPress, type, inputRef, useValue, isReadonly, placeholder, maxLength, tabIndex, autoFocus, isPassword, autoComplete, LeftAddon, RightAddon, inputProps, wrapProps, helperText, label, wrapType, ...abaseProps }: IAInputProps) => React.ReactNode;
|
|
@@ -10,28 +10,81 @@
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import { TCanCallback } from '../../AUtils/cbF';
|
|
13
14
|
import { IObject } from '../../AUtils/objF';
|
|
14
|
-
import { TIdx } from '../ATypes/ATypes';
|
|
15
15
|
import { IABaseProps } from '../ABase/ABase';
|
|
16
|
-
import {
|
|
16
|
+
import { TIdx } from '../ATypes/ATypes';
|
|
17
17
|
export interface IAListViewContentProps<T extends IObject> {
|
|
18
|
+
/**
|
|
19
|
+
* defKey : TIdx
|
|
20
|
+
* <br/>Description : defKey of AListView
|
|
21
|
+
*/
|
|
18
22
|
defKey: TIdx;
|
|
23
|
+
/**
|
|
24
|
+
* item : T
|
|
25
|
+
* <br/>Description : item of AListView
|
|
26
|
+
*/
|
|
19
27
|
item: T;
|
|
28
|
+
/**
|
|
29
|
+
* def : IAListViewDef<T>
|
|
30
|
+
* <br/>Description : def of AListView
|
|
31
|
+
*/
|
|
20
32
|
def: IAListViewDef<T>;
|
|
21
33
|
}
|
|
22
34
|
export interface IAListViewDef<T extends IObject> {
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
/**
|
|
36
|
+
* label? : TCanCallback<IAListViewContentProps<T>, React.ReactNode>
|
|
37
|
+
* <br/>Description : label of AListView
|
|
38
|
+
*/
|
|
39
|
+
label?: TCanCallback<IAListViewContentProps<T>, React.ReactNode>;
|
|
40
|
+
/**
|
|
41
|
+
* content? : TCanCallback<IAListViewContentProps<T>, React.ReactNode>
|
|
42
|
+
* <br/>Description : content of AListView
|
|
43
|
+
*/
|
|
44
|
+
content?: TCanCallback<IAListViewContentProps<T>, React.ReactNode>;
|
|
25
45
|
}
|
|
26
46
|
export type TAListViewDefs<T extends IObject> = {
|
|
27
47
|
[key in Exclude<keyof T, symbol>]: IAListViewDef<T>;
|
|
28
48
|
} & {
|
|
29
49
|
[key in TIdx]?: IAListViewDef<T>;
|
|
30
|
-
} & {
|
|
31
|
-
defaultDef?: IAListViewDef<T>;
|
|
32
50
|
};
|
|
33
51
|
export interface IAListViewProps<T extends IObject> extends IABaseProps {
|
|
52
|
+
/**
|
|
53
|
+
* defs : TAListViewDefs<T>
|
|
54
|
+
* <br/>Description : defs of AListView
|
|
55
|
+
* <br/>Basic Usage :
|
|
56
|
+
* const defs = {
|
|
57
|
+
* 'Name': {label: ({item}) => item.name},
|
|
58
|
+
* 'Age': {content: ({item}) => item.age},
|
|
59
|
+
* }
|
|
60
|
+
* <AListView defs={defs} item={{name: 'John', age: 20}}/>
|
|
61
|
+
*/
|
|
34
62
|
defs: TAListViewDefs<T>;
|
|
63
|
+
/**
|
|
64
|
+
* defaultDef? : IAListViewDef<T>
|
|
65
|
+
* <br/>Description : defaultDef of AListView. it affects no all defs, and can be overridden by each def.
|
|
66
|
+
* <br/>Basic Usage :
|
|
67
|
+
* <br/>(1)const defaultDef = {label: ({defKey}) => defKey};
|
|
68
|
+
* <AListView defs={{'Name': {content: ({item}) => item.name}}} defaultDef={defaultDef}/>
|
|
69
|
+
*/
|
|
70
|
+
defaultDef?: IAListViewDef<T>;
|
|
71
|
+
/**
|
|
72
|
+
* item : T
|
|
73
|
+
* <br/>Description : item of AListView
|
|
74
|
+
* <br/>Basic Usage :
|
|
75
|
+
* <br/>(1)<AListView defs={{'Name': {content: ({item}) => item.name}}} item={{name: 'John'}}/>
|
|
76
|
+
*/
|
|
35
77
|
item: T;
|
|
36
78
|
}
|
|
37
|
-
|
|
79
|
+
/**
|
|
80
|
+
* AComponent : AListView
|
|
81
|
+
* <br/>Description : AListView is a list view component that can show the key:values of items
|
|
82
|
+
* <br/>Basic Usage :
|
|
83
|
+
* <br/>(1)const defs = {
|
|
84
|
+
* 'Name': {label: ({item}) => item.name},
|
|
85
|
+
* 'Age': {content: ({item}) => item.age},
|
|
86
|
+
* }
|
|
87
|
+
* const item = {name: 'John', age: 20};
|
|
88
|
+
* return <AListView defs={defs} item={item}/>
|
|
89
|
+
*/
|
|
90
|
+
export declare const AListView: <T extends IObject>({ defs: extDefs, defaultDef: extDefaultDef, item, ...abaseProps }: IAListViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,37 +1,134 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ASelect
|
|
3
|
-
*
|
|
4
|
-
* Notice 1 : useSelect is considered as T[], so you should pass T[] to useSelect even if isSelectMulti is false.
|
|
5
|
-
*/
|
|
6
1
|
import React from 'react';
|
|
2
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
7
3
|
import { IABaseProps } from '../ABase/ABase';
|
|
8
4
|
import { IAWrapProps } from '../AWrap/AWrap';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export interface IASelectSelectedRendererProps<TItem, TGivenSelected, TSelected = TGivenSelected extends Array<TItem> ? TItem[] : null | TItem> {
|
|
6
|
+
/**
|
|
7
|
+
* OptionRenderer : (props: IASelectOptionRendererProps<T>) => React.ReactNode
|
|
8
|
+
* <br/>Description : OptionRenderer of ASelect
|
|
9
|
+
*/
|
|
10
|
+
OptionRenderer: (props: IASelectOptionRendererProps<TItem>) => React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* selected : T[]
|
|
13
|
+
* <br/>Description : selected items of ASelect
|
|
14
|
+
*/
|
|
15
|
+
selected: TSelected;
|
|
16
|
+
/**
|
|
17
|
+
* placeholder : React.ReactNode
|
|
18
|
+
* <br/>Description : placeholder of ASelect
|
|
19
|
+
*/
|
|
13
20
|
placeholder?: React.ReactNode;
|
|
14
21
|
}
|
|
15
|
-
export interface
|
|
16
|
-
|
|
22
|
+
export interface IASelectOptionRendererProps<TItem> {
|
|
23
|
+
/**
|
|
24
|
+
* option : T
|
|
25
|
+
* <br/>Description : option of ASelect
|
|
26
|
+
*/
|
|
27
|
+
option: TItem;
|
|
17
28
|
}
|
|
18
|
-
export interface IASelectProps<
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
export interface IASelectProps<TItem, TGivenSelected, TSelected = TGivenSelected extends Array<TItem> ? TItem[] : null | TItem> extends IABaseProps, IAWrapProps {
|
|
30
|
+
/**
|
|
31
|
+
* options : T[]
|
|
32
|
+
* <br/>Description : options of ASelect
|
|
33
|
+
* <br/>Basic Usage :
|
|
34
|
+
* <br/>(1)const options = ['Option1', 'Option2', 'Option3'];
|
|
35
|
+
* <ASelect options={options}/>
|
|
36
|
+
*/
|
|
37
|
+
options: TItem[];
|
|
38
|
+
/**
|
|
39
|
+
* useSelect? : TUseValues<T[]>
|
|
40
|
+
* <br/>Description : useSelect of ASelect
|
|
41
|
+
* <br/>Basic Usage :
|
|
42
|
+
* <br/>(1)const [selected, setSelected] = useState<T[]>([]);
|
|
43
|
+
* <ASelect options={options} useSelect={[selected, setSelected]}/>
|
|
44
|
+
*/
|
|
45
|
+
useSelect?: TUseValues<TSelected>;
|
|
46
|
+
/**
|
|
47
|
+
* type? : 'Primary' | 'Secondary' = 'Primary'
|
|
48
|
+
* <br/>Description : type of ASelect
|
|
49
|
+
* <br/>Basic Usage :
|
|
50
|
+
* <br/>(1)<ASelect type="Secondary"/>
|
|
51
|
+
*/
|
|
21
52
|
type?: 'Primary' | 'Secondary';
|
|
53
|
+
/**
|
|
54
|
+
* placeholder? : React.ReactNode
|
|
55
|
+
* <br/>Description : placeholder of ASelect. it is shown when no option is selected
|
|
56
|
+
* <br/>Basic Usage :
|
|
57
|
+
* <br/>(1)<ASelect placeholder="Select"/>
|
|
58
|
+
*/
|
|
22
59
|
placeholder?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* isSelectMulti? : boolean = false
|
|
62
|
+
* <br/>Description : isSelectMulti of ASelect. if it is true, multiple options can be selected
|
|
63
|
+
* <br/>Basic Usage :
|
|
64
|
+
* <br/>(1)<ASelect isSelectMulti/>
|
|
65
|
+
*/
|
|
23
66
|
isSelectMulti?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* onClose? : () => void
|
|
69
|
+
* <br/>Description : onClose of ASelect
|
|
70
|
+
* <br/>Basic Usage :
|
|
71
|
+
* <br/>(1)<ASelect onClose={() => console.log('closed')}/>
|
|
72
|
+
*/
|
|
24
73
|
onClose?: () => void;
|
|
25
|
-
|
|
26
|
-
|
|
74
|
+
/**
|
|
75
|
+
* SelectedRenderer? : (props: IASelectSelectedRendererProps<T>) => React.ReactNode = DefaultSelectedRenderer
|
|
76
|
+
* <br/>Description : Renderer of Selected Options of ASelect
|
|
77
|
+
* <br/>Basic Usage :
|
|
78
|
+
* <br/>(1)<ASelect SelectedRenderer={({selected, placeholder}) => selected ? selected : placeholder}/>
|
|
79
|
+
*/
|
|
80
|
+
SelectedRenderer?: (props: IASelectSelectedRendererProps<TItem, TGivenSelected, TSelected>) => React.ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* OptionRenderer? : (props: IASelectOptionRendererProps<T>) => React.ReactNode = DefaultOptionRenderer
|
|
83
|
+
* <br/>Description : Renderer of Options of ASelect
|
|
84
|
+
* <br/>Basic Usage :
|
|
85
|
+
* <br/>(1)<ASelect OptionRenderer={({option}) => <div>{option}</div>}/>
|
|
86
|
+
*/
|
|
87
|
+
OptionRenderer?: (props: IASelectOptionRendererProps<TItem>) => React.ReactNode;
|
|
88
|
+
/**
|
|
89
|
+
* minShowRows? : number = 2
|
|
90
|
+
* <br/>Description : minShowRows of ASelect
|
|
91
|
+
* <br/>Basic Usage :
|
|
92
|
+
* <br/>(1)<ASelect minShowRows={2}/>
|
|
93
|
+
*/
|
|
27
94
|
minShowRows?: number;
|
|
95
|
+
/**
|
|
96
|
+
* maxShowRows? : number = 6
|
|
97
|
+
* <br/>Description : maxShowRows of ASelect. scrollbar will appear when overflow
|
|
98
|
+
* <br/>Basic Usage :
|
|
99
|
+
* <br/>(1)<ASelect maxShowRows={6}/>
|
|
100
|
+
*/
|
|
28
101
|
maxShowRows?: number;
|
|
102
|
+
/**
|
|
103
|
+
* arrowProps? : React.HTMLProps<HTMLDivElement>
|
|
104
|
+
* <br/>Description : divProps for Arrow of ASelect
|
|
105
|
+
* <br/>Basic Usage :
|
|
106
|
+
* <br/>(1)<ASelect arrowProps={{style: {color: 'red'}}}/>
|
|
107
|
+
*/
|
|
29
108
|
arrowProps?: React.HTMLProps<HTMLDivElement>;
|
|
30
109
|
}
|
|
31
110
|
/**
|
|
32
|
-
* ASelect
|
|
33
|
-
*
|
|
34
|
-
*
|
|
111
|
+
* AComponent : ASelect
|
|
112
|
+
* <br/>Description : ASelect is a select component. give options and useSelect to select an option.
|
|
113
|
+
* <br/>Basic Usage :
|
|
114
|
+
* <br/>(1)const options = ['Option1', 'Option2', 'Option3'];
|
|
115
|
+
* const [selected, setSelected] = useState<string | null>(null);
|
|
116
|
+
* return <ASelect options={options} useSelect={[selected, setSelected]}/>
|
|
117
|
+
*
|
|
118
|
+
* <br/>(2)const options = ['Option1', 'Option2', 'Option3'];
|
|
119
|
+
* const [selected, setSelected] = useState<string[]>([]);
|
|
120
|
+
* return <ASelect options={options} useSelect={[selected, setSelected]} isSelectMulti/>
|
|
121
|
+
*
|
|
122
|
+
* <br/>(3)const options = [{idx : 1, name : 'option1'}, {idx : 2, name : 'option2'}, {idx : 3, name : 'option3'}];
|
|
123
|
+
* const [selected, setSelected] = useState<{idx : number, name : string}[]>([]);
|
|
124
|
+
* const OptionRenderer = ({option}) => <div>{option.name}</div>;
|
|
125
|
+
* return <ASelect options={options} useSelect={[selected, setSelected]} OptionRenderer={OptionRenderer}/>
|
|
126
|
+
*
|
|
127
|
+
* <br/>(4)const options = [{idx : 1, name : 'option1'}, {idx : 2, name : 'option2'}, {idx : 3, name : 'option3'}];
|
|
128
|
+
* const [selected, setSelected] = useState<{idx : number, name : string}[]>([]);
|
|
129
|
+
* const OptionRenderer = ({option}) => <div>{option.name}</div>;
|
|
130
|
+
* const SelectedRenderer = ({selected, placeholder}) => selected.length > 0 ? string.join(selected.map(e => e.name), ', ') : placeholder;
|
|
131
|
+
* return <ASelect options={options} useSelect={[selected, setSelected]} OptionRenderer={OptionRenderer} SelectedRenderer={SelectedRenderer}/>
|
|
35
132
|
*/
|
|
36
|
-
export declare const ASelect: <
|
|
37
|
-
export declare const DefaultOptionRenderer: <T>({ option }:
|
|
133
|
+
export declare const ASelect: <TItem, TGivenSelected, TSelected = TGivenSelected extends TItem[] ? TItem[] : TItem | null>({ options, useSelect, type, placeholder, isSelectMulti, onClose, SelectedRenderer, OptionRenderer, minShowRows, maxShowRows, arrowProps, wrapProps, helperText, label, ...abaseProps }: IASelectProps<TItem, TGivenSelected, TSelected>) => React.ReactNode;
|
|
134
|
+
export declare const DefaultOptionRenderer: <T>({ option }: IASelectOptionRendererProps<T>) => React.ReactNode;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
interface IASpaceProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* h? : number | string
|
|
5
|
+
* <br/>Description : height of ASpace
|
|
6
|
+
* <br/>Basic Usage :
|
|
7
|
+
* <br/>(1)<ASpace h={10}/>
|
|
8
|
+
*/
|
|
3
9
|
h?: number | string;
|
|
10
|
+
/**
|
|
11
|
+
* w? : number | string
|
|
12
|
+
* <br/>Description : width of ASpace
|
|
13
|
+
* <br/>Basic Usage :
|
|
14
|
+
* <br/>(1)<ASpace w={10}/>
|
|
15
|
+
*/
|
|
4
16
|
w?: number | string;
|
|
5
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* AComponent : ASpace
|
|
20
|
+
* <br/>Description : ASpace is a component to make spaces.
|
|
21
|
+
* <br/>Basic Usage :
|
|
22
|
+
* <br/>(1)<ASpace h={10}/>
|
|
23
|
+
*
|
|
24
|
+
* <br/>(2)<ASpace w={10}/>
|
|
25
|
+
*
|
|
26
|
+
* <br/>(3)<ASpace h={10} w={10}/>
|
|
27
|
+
*/
|
|
6
28
|
export declare const ASpace: ({ h, w, ...divProps }: IASpaceProps) => React.ReactNode;
|
|
7
29
|
export {};
|