ados-rcm 1.0.4 → 1.0.6
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 +6 -4
- package/dist/AModule/AComponents/ABase/ABase.d.ts +28 -0
- package/dist/AModule/AComponents/AButton/AButton.d.ts +7 -0
- package/dist/AModule/AComponents/AButton/AIconButton.d.ts +12 -0
- package/dist/AModule/AComponents/ACheckBox/ACheckBox.d.ts +13 -0
- package/dist/AModule/AComponents/AClock/AClock.d.ts +17 -0
- package/dist/AModule/AComponents/ADatePicker/ADatePicker.d.ts +21 -0
- package/dist/AModule/AComponents/ADatePicker/ADateRangePicker.d.ts +21 -0
- package/dist/AModule/AComponents/ADialog/ADialog.d.ts +27 -0
- package/dist/AModule/AComponents/AFileBox/AFileBox.d.ts +13 -0
- package/dist/AModule/AComponents/AFloatMenu/AFloatMenu.d.ts +29 -0
- package/dist/AModule/AComponents/AFrames/AFrames.d.ts +13 -0
- package/dist/AModule/AComponents/AGrow/AGrow.d.ts +1 -0
- package/dist/AModule/AComponents/AIcon/AIcon.d.ts +83 -0
- package/dist/AModule/AComponents/AInput/AInput.d.ts +22 -0
- package/dist/AModule/AComponents/AListView/AListView.d.ts +37 -0
- package/dist/AModule/AComponents/AResource/AResource.d.ts +31 -0
- package/dist/AModule/AComponents/ASelect/ASelect.d.ts +37 -0
- package/dist/AModule/AComponents/ASpace/ASpace.d.ts +7 -0
- package/dist/AModule/AComponents/AStepper/AStepper.d.ts +14 -0
- package/dist/AModule/AComponents/ASwitch/ASwitch.d.ts +7 -0
- package/dist/AModule/AComponents/ATab/ATab.d.ts +14 -0
- package/dist/AModule/AComponents/ATable/ATable.d.ts +155 -0
- package/dist/AModule/AComponents/ATable/ATableBody.d.ts +20 -0
- package/dist/AModule/AComponents/ATable/ATableFilter.d.ts +12 -0
- package/dist/AModule/AComponents/ATable/ATableFooter.d.ts +14 -0
- package/dist/AModule/AComponents/ATable/ATableHeader.d.ts +21 -0
- package/dist/AModule/AComponents/ATest.d.ts +9 -0
- package/dist/AModule/AComponents/AText/AText.d.ts +8 -0
- package/dist/AModule/AComponents/ATextArea/ATextArea.d.ts +21 -0
- package/dist/AModule/AComponents/ATheme/AStyles.d.ts +22 -0
- package/dist/AModule/AComponents/ATheme/ATheme.d.ts +8 -0
- package/dist/AModule/AComponents/ATooltip/ATooltip.d.ts +9 -0
- package/dist/AModule/AComponents/ATree/ATree.d.ts +54 -0
- package/dist/AModule/AComponents/ATree/ATreeItem.d.ts +37 -0
- package/dist/AModule/AComponents/ATree/ATreeSearch.d.ts +11 -0
- package/dist/AModule/AComponents/ATypes/ATypes.d.ts +33 -0
- package/dist/AModule/AComponents/AWrap/AWrap.d.ts +11 -0
- package/dist/AModule/AHooks/useValues.d.ts +12 -0
- package/dist/AModule/ANetwork/APIContext.d.ts +39 -0
- package/dist/AModule/AUtils/bound.d.ts +1 -0
- package/dist/AModule/AUtils/cbF.d.ts +16 -0
- package/dist/AModule/AUtils/classF.d.ts +10 -0
- package/dist/AModule/AUtils/dateF.d.ts +35 -0
- package/dist/AModule/AUtils/objF.d.ts +22 -0
- package/dist/AModule/AUtils/strF.d.ts +3 -0
- package/dist/AModule/AUtils/tableF.d.ts +17 -0
- package/dist/AModule/AUtils/treeF.d.ts +22 -0
- package/dist/index.cjs.js +32 -1092
- package/dist/index.d.ts +38 -1
- package/dist/index.es.js +9426 -71043
- package/package.json +73 -64
- package/dist/CComponents/CButton/CButton.d.ts +0 -20
- package/dist/CComponents/CChart/CChart.d.ts +0 -43
- package/dist/CComponents/CCheckBox/CCheckBox.d.ts +0 -14
- package/dist/CComponents/CContainer/CContainer.d.ts +0 -112
- package/dist/CComponents/CContainer/CContainerContext.d.ts +0 -47
- package/dist/CComponents/CDatePicker/CDatePicker.d.ts +0 -46
- package/dist/CComponents/CDialog/CDialog.d.ts +0 -33
- package/dist/CComponents/CEditor/CEditor.d.ts +0 -32
- package/dist/CComponents/CFileBox/CFileBox.d.ts +0 -14
- package/dist/CComponents/CFloatingMenu/CFloatingMenu.d.ts +0 -25
- package/dist/CComponents/CIcon/icons.d.ts +0 -67
- package/dist/CComponents/CIpRangePicker/CIpRangePicker.d.ts +0 -11
- package/dist/CComponents/CLabeledItem/CLabeledItem.d.ts +0 -10
- package/dist/CComponents/CList/CList.d.ts +0 -10
- package/dist/CComponents/CListView/CListView.d.ts +0 -19
- package/dist/CComponents/CMenu/CMenu.d.ts +0 -18
- package/dist/CComponents/CSelect/CMultiSelect.d.ts +0 -21
- package/dist/CComponents/CSelect/CSelect.d.ts +0 -22
- package/dist/CComponents/CStepper/CStepper.d.ts +0 -28
- package/dist/CComponents/CSwitch/CSwitch.d.ts +0 -15
- package/dist/CComponents/CTable/CTable.d.ts +0 -12
- package/dist/CComponents/CTable/CTableBody.d.ts +0 -34
- package/dist/CComponents/CTable/CTableFilter.d.ts +0 -46
- package/dist/CComponents/CTable/CTableFooter.d.ts +0 -2
- package/dist/CComponents/CTable/CTableHeader.d.ts +0 -4
- package/dist/CComponents/CTable/CTableWidthChanger.d.ts +0 -11
- package/dist/CComponents/CTable/ICTable.d.ts +0 -157
- package/dist/CComponents/CTable/exports.d.ts +0 -3
- package/dist/CComponents/CTabs/CTabs.d.ts +0 -37
- package/dist/CComponents/CText/CPlainText.d.ts +0 -8
- package/dist/CComponents/CText/CStyledText.d.ts +0 -13
- package/dist/CComponents/CTextField/CTextField.d.ts +0 -50
- package/dist/CComponents/CTimer/CTimer.d.ts +0 -9
- package/dist/CComponents/CTree/CTree.d.ts +0 -71
- package/dist/CComponents/CTree/CTreeSearchModule.d.ts +0 -11
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { TCBAble } from '../../AUtils/cbF';
|
|
2
|
+
import { IItem } from '../../AUtils/objF';
|
|
3
|
+
import { TIdx } from '../ATypes/ATypes';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
6
|
+
import { Resources } from '../AResource/AResource';
|
|
7
|
+
export interface IATableTHProps<T extends IItem> {
|
|
8
|
+
defKey: TIdx;
|
|
9
|
+
def: IATableDef<T>;
|
|
10
|
+
}
|
|
11
|
+
export interface IATableTRProps<T extends IItem> {
|
|
12
|
+
item: T;
|
|
13
|
+
}
|
|
14
|
+
export interface IATableTDProps<T extends IItem> extends IATableTHProps<T>, IATableTRProps<T> {
|
|
15
|
+
}
|
|
16
|
+
export interface IATableDef<T extends IItem> {
|
|
17
|
+
width?: TCBAble<IATableTHProps<T>, number>;
|
|
18
|
+
maxWidth?: TCBAble<IATableTHProps<T>, number>;
|
|
19
|
+
minWidth?: TCBAble<IATableTHProps<T>, number>;
|
|
20
|
+
align?: TCBAble<IATableTHProps<T>, React.CSSProperties['justifyContent']>;
|
|
21
|
+
colSpan?: TCBAble<IATableTHProps<T>, number>;
|
|
22
|
+
hContent?: TCBAble<IATableTHProps<T>, React.ReactNode>;
|
|
23
|
+
hColor?: TCBAble<IATableTHProps<T>, React.CSSProperties['color']>;
|
|
24
|
+
hBackgroundColor?: TCBAble<IATableTHProps<T>, React.CSSProperties['backgroundColor']>;
|
|
25
|
+
isSortable?: boolean;
|
|
26
|
+
noResize?: boolean;
|
|
27
|
+
sortF?: (a: T, b: T) => number;
|
|
28
|
+
content?: TCBAble<IATableTDProps<T>, React.ReactNode>;
|
|
29
|
+
asText?: TCBAble<IATableTDProps<T>, string | number>;
|
|
30
|
+
color?: TCBAble<IATableTDProps<T>, React.CSSProperties['color']>;
|
|
31
|
+
backgroundColor?: TCBAble<IATableTDProps<T>, React.CSSProperties['backgroundColor']>;
|
|
32
|
+
}
|
|
33
|
+
export type TATableDefs<T extends IItem> = {
|
|
34
|
+
[key in Exclude<keyof T, symbol>]?: IATableDef<T>;
|
|
35
|
+
} & {
|
|
36
|
+
[key: TIdx]: IATableDef<T>;
|
|
37
|
+
};
|
|
38
|
+
export type TATableFilterType = 'String' | 'Select' | 'Date' | 'DateRange';
|
|
39
|
+
export interface IATableFilterDef<T extends IItem> {
|
|
40
|
+
String: {
|
|
41
|
+
type: 'String';
|
|
42
|
+
defKey?: keyof T | '';
|
|
43
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['String']) => any;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
};
|
|
46
|
+
Select: {
|
|
47
|
+
type: 'Select';
|
|
48
|
+
defKey?: keyof T | '';
|
|
49
|
+
options: (string | number)[];
|
|
50
|
+
placeHolder?: string;
|
|
51
|
+
OptionRenderer?: (option: string | number) => React.ReactNode;
|
|
52
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Select']) => any;
|
|
53
|
+
};
|
|
54
|
+
Date: {
|
|
55
|
+
type: 'Date';
|
|
56
|
+
defKey?: keyof T | '';
|
|
57
|
+
minDate?: Date;
|
|
58
|
+
maxDate?: Date;
|
|
59
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Date']) => any;
|
|
60
|
+
};
|
|
61
|
+
DateRange: {
|
|
62
|
+
type: 'DateRange';
|
|
63
|
+
defKey?: keyof T | '';
|
|
64
|
+
minDate?: Date;
|
|
65
|
+
maxDate?: Date;
|
|
66
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['DateRange']) => any;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export type TATableFilterationDefs<T extends IItem> = {
|
|
70
|
+
type: 'And' | 'Or';
|
|
71
|
+
defs: IATableFilterDef<T>[TATableFilterType][];
|
|
72
|
+
};
|
|
73
|
+
export interface IATableFilter<T extends IItem> {
|
|
74
|
+
String: {
|
|
75
|
+
type: 'String';
|
|
76
|
+
defKey: keyof T | '';
|
|
77
|
+
value: string;
|
|
78
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['String']) => any;
|
|
79
|
+
placeholder?: string;
|
|
80
|
+
};
|
|
81
|
+
Select: {
|
|
82
|
+
type: 'Select';
|
|
83
|
+
defKey: keyof T | '';
|
|
84
|
+
values: (string | number)[];
|
|
85
|
+
options: (string | number)[];
|
|
86
|
+
placeholder?: string;
|
|
87
|
+
OptionRenderer?: (option: string | number) => React.ReactNode;
|
|
88
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Select']) => any;
|
|
89
|
+
};
|
|
90
|
+
Date: {
|
|
91
|
+
type: 'Date';
|
|
92
|
+
defKey: keyof T;
|
|
93
|
+
value: Date;
|
|
94
|
+
minDate?: Date;
|
|
95
|
+
maxDate?: Date;
|
|
96
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Date']) => any;
|
|
97
|
+
};
|
|
98
|
+
DateRange: {
|
|
99
|
+
type: 'DateRange';
|
|
100
|
+
defKey: keyof T | '';
|
|
101
|
+
sDate: Date;
|
|
102
|
+
eDate: Date;
|
|
103
|
+
minDate?: Date;
|
|
104
|
+
maxDate?: Date;
|
|
105
|
+
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['DateRange']) => any;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export type TATableSomeFilter<T extends IItem> = IATableFilter<T>[TATableFilterType];
|
|
109
|
+
export type TATableFilteration<T extends IItem> = {
|
|
110
|
+
type: 'And' | 'Or';
|
|
111
|
+
filters: TATableSomeFilter<T>[];
|
|
112
|
+
};
|
|
113
|
+
export type TATableSortF<T extends IItem> = (a: T, b: T) => number;
|
|
114
|
+
export interface IATableSortation<T extends IItem> {
|
|
115
|
+
defKey?: keyof T;
|
|
116
|
+
isAsc?: boolean;
|
|
117
|
+
sortF?: TATableSortF<T>;
|
|
118
|
+
}
|
|
119
|
+
export interface IATablePagination {
|
|
120
|
+
page: number;
|
|
121
|
+
pageSize: number;
|
|
122
|
+
pageRange: number;
|
|
123
|
+
}
|
|
124
|
+
export interface IATableState<T extends IItem> {
|
|
125
|
+
entireItems?: T[];
|
|
126
|
+
filteration: TATableFilteration<T>;
|
|
127
|
+
pagination: IATablePagination;
|
|
128
|
+
sortation: IATableSortation<T>;
|
|
129
|
+
}
|
|
130
|
+
export interface IATableProps<T extends IItem> {
|
|
131
|
+
defs: TATableDefs<T>;
|
|
132
|
+
defaultDef?: IATableDef<T>;
|
|
133
|
+
rProps?: TCBAble<IATableTRProps<T>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
134
|
+
useSelect?: TUseValues<T[]>;
|
|
135
|
+
isSelectMulti?: boolean;
|
|
136
|
+
selectDisabled?: (item: T) => string | boolean | undefined;
|
|
137
|
+
useCheck?: TUseValues<T[]>;
|
|
138
|
+
checkDisabled?: (item: T) => string | boolean | undefined;
|
|
139
|
+
isLoading?: boolean;
|
|
140
|
+
isDisabled?: boolean;
|
|
141
|
+
title?: React.ReactNode;
|
|
142
|
+
entireItems?: T[];
|
|
143
|
+
onStateChange?: (params: IATableState<T>) => void;
|
|
144
|
+
pagedItems?: T[];
|
|
145
|
+
totalCount?: number;
|
|
146
|
+
filterationDefs?: TATableFilterationDefs<T>;
|
|
147
|
+
useFilteration?: TUseValues<TATableFilteration<T>>;
|
|
148
|
+
toggleFilterationDefs?: TATableFilterationDefs<T>;
|
|
149
|
+
useToggleFilteration?: TUseValues<TATableFilteration<T>>;
|
|
150
|
+
usePagination?: TUseValues<IATablePagination>;
|
|
151
|
+
useSortation?: TUseValues<IATableSortation<T>>;
|
|
152
|
+
TopRightAddon?: React.ReactNode;
|
|
153
|
+
resources?: Partial<typeof Resources.ATable>;
|
|
154
|
+
}
|
|
155
|
+
export declare const ATable: <T extends IItem>({ defs: extDefs, defaultDef: extDefaultDef, rProps, useSelect, isSelectMulti, selectDisabled, useCheck, checkDisabled, isLoading, isDisabled, title, entireItems, onStateChange, pagedItems: extPagedItems, totalCount: extTotalCount, filterationDefs, useFilteration, toggleFilterationDefs, useToggleFilteration, usePagination, useSortation, TopRightAddon, resources: extResources, }: IATableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TCBAble } from '../../AUtils/cbF';
|
|
2
|
+
import { IItem } from '../../AUtils/objF';
|
|
3
|
+
import { IATablePagination, IATableSortation, IATableTRProps, TATableDefs, TATableFilteration } from './ATable';
|
|
4
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
interface IATableBodyProps<T extends IItem> {
|
|
7
|
+
defs: TATableDefs<T>;
|
|
8
|
+
rProps?: TCBAble<IATableTRProps<T>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
9
|
+
useSelect?: TUseValues<T[]>;
|
|
10
|
+
isTableDisabled?: boolean;
|
|
11
|
+
isSelectMulti?: boolean;
|
|
12
|
+
selectDisabled?: (item: T) => string | boolean | undefined;
|
|
13
|
+
appliedFilteration: TATableFilteration<T>;
|
|
14
|
+
useSortation: TUseValues<IATableSortation<T>>;
|
|
15
|
+
pagination: IATablePagination;
|
|
16
|
+
pagedItems: T[];
|
|
17
|
+
}
|
|
18
|
+
export declare const ATableBody: <T extends IItem>({ defs, rProps, useSelect, isTableDisabled, isSelectMulti, selectDisabled, appliedFilteration, useSortation, pagedItems, }: IATableBodyProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const randomHexColor: (alpha?: number) => string;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IItem } from '../../AUtils/objF';
|
|
2
|
+
import { TATableFilteration } from './ATable';
|
|
3
|
+
import { IATableFilterF } from './ATableHeader';
|
|
4
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
5
|
+
import { Resources } from '../AResource/AResource';
|
|
6
|
+
interface IATableFilterProps<T extends IItem> {
|
|
7
|
+
useFilteration: TUseValues<TATableFilteration<T>>;
|
|
8
|
+
filterF: IATableFilterF;
|
|
9
|
+
resources: typeof Resources.ATable;
|
|
10
|
+
}
|
|
11
|
+
export declare const ATableFilter: <T extends IItem>({ useFilteration, filterF, resources }: IATableFilterProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IATablePagination } from './ATable';
|
|
2
|
+
export interface IATableFooterProps {
|
|
3
|
+
pages: number[];
|
|
4
|
+
rangedPages: number[];
|
|
5
|
+
pageF: {
|
|
6
|
+
move: (page: number) => void;
|
|
7
|
+
movePrev: () => void;
|
|
8
|
+
moveNext: () => void;
|
|
9
|
+
moveFirst: () => void;
|
|
10
|
+
moveLast: () => void;
|
|
11
|
+
};
|
|
12
|
+
pagination: IATablePagination;
|
|
13
|
+
}
|
|
14
|
+
export declare const ATableFooter: ({ pages, rangedPages, pageF, pagination }: IATableFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IItem } from '../../AUtils/objF';
|
|
3
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
4
|
+
import { TATableFilteration } from './ATable';
|
|
5
|
+
import { Resources } from '../AResource/AResource';
|
|
6
|
+
export interface IATableFilterF {
|
|
7
|
+
apply: () => void;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface IATableHeaderProps<T extends IItem> {
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
totalCount: number;
|
|
14
|
+
useCheck?: TUseValues<T[]>;
|
|
15
|
+
useFilteration: TUseValues<TATableFilteration<T>>;
|
|
16
|
+
filterF: IATableFilterF;
|
|
17
|
+
TopLeftAddon?: React.ReactNode;
|
|
18
|
+
TopRightAddon?: React.ReactNode;
|
|
19
|
+
resources: typeof Resources.ATable;
|
|
20
|
+
}
|
|
21
|
+
export declare const ATableHeader: <T extends IItem>({ title, totalCount, useCheck, useFilteration, filterF, TopLeftAddon, TopRightAddon, resources, }: IATableHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ATest
|
|
3
|
+
*
|
|
4
|
+
* Warning : this file is only for development and testing purposes.
|
|
5
|
+
* the code uses eval function to test callback functions.
|
|
6
|
+
* NEVER let this code exist in production environment. *
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare const ATest: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IATextProps {
|
|
3
|
+
text?: string;
|
|
4
|
+
styled?: boolean | string;
|
|
5
|
+
style?: 'bold' | React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare const AText: ({ text, styled, style }: IATextProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IAWrapProps } from '../AWrap/AWrap';
|
|
3
|
+
import { IABaseProps } from '../ABase/ABase';
|
|
4
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
5
|
+
export type TTextAreaType = 'Primary' | 'Secondary' | 'Error';
|
|
6
|
+
export interface IATextAreaProps extends IABaseProps, IAWrapProps {
|
|
7
|
+
onEnterPress?: (value: string) => void;
|
|
8
|
+
type?: TTextAreaType;
|
|
9
|
+
textAreaRef?: React.RefObject<HTMLTextAreaElement>;
|
|
10
|
+
useValue?: TUseValues<string>;
|
|
11
|
+
rows?: number;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
14
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
tabIndex?: number;
|
|
18
|
+
autoFocus?: boolean;
|
|
19
|
+
textAreaProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
20
|
+
}
|
|
21
|
+
export declare const ATextArea: ({ onEnterPress, type, textAreaRef, useValue, rows, readonly, placeholder, maxLength, tabIndex, autoFocus, textAreaProps, wrapProps, helperText, label, wrapType, ...abaseProps }: IATextAreaProps) => React.ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TIdx } from '../ATypes/ATypes';
|
|
2
|
+
/**
|
|
3
|
+
* AStyles.tsx
|
|
4
|
+
* style maps for AModule
|
|
5
|
+
*
|
|
6
|
+
* Notice 1 : Naming Convention of Color Variables
|
|
7
|
+
* - Component Styles are named by the following rule
|
|
8
|
+
* - '--ComponentName-[...ClassName]-Property'
|
|
9
|
+
*/
|
|
10
|
+
export interface IStyle {
|
|
11
|
+
[key: TIdx]: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ICustomeStyle extends IStyle {
|
|
14
|
+
'--style': string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Styles: IStyle[];
|
|
17
|
+
export declare const componentStyles: IStyle;
|
|
18
|
+
export declare const AStyles: {
|
|
19
|
+
Default: IStyle;
|
|
20
|
+
Styles: IStyle[];
|
|
21
|
+
OverrideStyle: IStyle;
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { componentStyles } from './AStyles';
|
|
2
|
+
import './ATheme.module.scss';
|
|
3
|
+
export declare const ATheme: {
|
|
4
|
+
Init: (mode?: 'Light' | 'Dark') => void;
|
|
5
|
+
GetColorMode: () => string;
|
|
6
|
+
SetColorMode: (newMode: 'Light' | 'Dark') => void;
|
|
7
|
+
OverrideStyle: (key: keyof typeof componentStyles, value: string) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface IATooltipProps {
|
|
3
|
+
tooltip: React.ReactNode;
|
|
4
|
+
targetRef: RefObject<HTMLElement>;
|
|
5
|
+
delay?: number;
|
|
6
|
+
distance?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const ATooltip: ({ tooltip, targetRef, delay, distance }: IATooltipProps) => import("react").ReactPortal | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ATree
|
|
3
|
+
* Description :
|
|
4
|
+
* - select and check is not different, check is just appeared when showCheckbox is true.
|
|
5
|
+
*
|
|
6
|
+
* Notice 1 : useSelect is considered as T[], so you should pass T[] to useSelect even if isSelectMulti is false.
|
|
7
|
+
* Todo 1 : drag between different parents
|
|
8
|
+
* Todo 2 : maybe adding defs for tree is necessary
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { TIcons } from '../AIcon/AIcon';
|
|
12
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
13
|
+
import { IABaseProps } from '../ABase/ABase';
|
|
14
|
+
import { TActionRef } from '../ATypes/ATypes';
|
|
15
|
+
import { IItem } from '../../AUtils/objF';
|
|
16
|
+
import { IATreeItemProps } from './ATreeItem';
|
|
17
|
+
import { Resources } from '../AResource/AResource';
|
|
18
|
+
export interface IATreeSearchResult<T> {
|
|
19
|
+
keyword: string;
|
|
20
|
+
items: T[];
|
|
21
|
+
item?: T;
|
|
22
|
+
}
|
|
23
|
+
export interface IATreeItem<T> extends IItem {
|
|
24
|
+
children?: T[];
|
|
25
|
+
}
|
|
26
|
+
export interface IATreeAction {
|
|
27
|
+
expandAll: () => void;
|
|
28
|
+
collapseAll: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface IATreeProps<T extends IATreeItem<T>> extends IABaseProps {
|
|
31
|
+
ItemRenderer?: (props: IATreeItemProps<T>) => React.ReactNode;
|
|
32
|
+
useItems?: TUseValues<T[]>;
|
|
33
|
+
useExpand?: TUseValues<T[]>;
|
|
34
|
+
useSelect?: TUseValues<T[]>;
|
|
35
|
+
selectDisabled?: (item: T) => boolean | string | undefined;
|
|
36
|
+
useSearch?: TUseValues<IATreeSearchResult<T> | undefined>;
|
|
37
|
+
showCheckbox?: boolean;
|
|
38
|
+
icons?: {
|
|
39
|
+
noChild?: TIcons;
|
|
40
|
+
collapsed?: TIcons;
|
|
41
|
+
expanded?: TIcons;
|
|
42
|
+
};
|
|
43
|
+
iconWidth?: number;
|
|
44
|
+
isSelectMulti?: boolean;
|
|
45
|
+
noSearch?: boolean;
|
|
46
|
+
enableDrag?: boolean;
|
|
47
|
+
syncSearchSelect?: boolean;
|
|
48
|
+
searchPredicate?: (inputValue: string, item: IATreeItem<T>) => any;
|
|
49
|
+
actionRef?: TActionRef<IATreeAction>;
|
|
50
|
+
HeaderRightAddon?: React.ReactNode;
|
|
51
|
+
RightStickyRenderer?: (props: IATreeItemProps<T>) => React.ReactNode;
|
|
52
|
+
resources?: Partial<typeof Resources.ATree>;
|
|
53
|
+
}
|
|
54
|
+
export declare const ATree: <T extends IATreeItem<T>>({ selectDisabled, ItemRenderer, useItems, useExpand, useSelect, useSearch, showCheckbox, iconWidth, icons, isSelectMulti, noSearch, enableDrag, syncSearchSelect, actionRef, HeaderRightAddon, RightStickyRenderer, resources: extResources, searchPredicate, isDisabled, ...abaseProps }: IATreeProps<T>) => React.ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TIcons } from '../AIcon/AIcon';
|
|
3
|
+
import { TUseValues } from '../../AHooks/useValues';
|
|
4
|
+
import { IATreeItem, IATreeSearchResult } from './ATree';
|
|
5
|
+
import { Resources } from '../AResource/AResource';
|
|
6
|
+
export interface IATreeItemProps<T> {
|
|
7
|
+
item: T;
|
|
8
|
+
selectDisabled?: (item: T) => boolean | string | undefined;
|
|
9
|
+
isParentDisabled?: boolean;
|
|
10
|
+
indents: EIndentState[];
|
|
11
|
+
ItemRenderer: (props: IATreeItemProps<T>) => React.ReactNode;
|
|
12
|
+
useExpand: TUseValues<T[]>;
|
|
13
|
+
useSelect: TUseValues<T[]>;
|
|
14
|
+
useSearch: TUseValues<IATreeSearchResult<T> | undefined>;
|
|
15
|
+
onDragStart?: (item: T) => void;
|
|
16
|
+
onDragOver?: (e: React.DragEvent<HTMLElement>, item: T) => void;
|
|
17
|
+
onDragEnd?: (e: React.DragEvent<HTMLElement>, item: T) => void;
|
|
18
|
+
showCheckbox?: boolean;
|
|
19
|
+
icons?: {
|
|
20
|
+
noChild?: TIcons;
|
|
21
|
+
collapsed?: TIcons;
|
|
22
|
+
expanded?: TIcons;
|
|
23
|
+
};
|
|
24
|
+
iconWidth: number;
|
|
25
|
+
isSelectMulti: boolean;
|
|
26
|
+
enableDrag: boolean;
|
|
27
|
+
isParentCheckHovered: boolean;
|
|
28
|
+
RightStickyRenderer?: (props: IATreeItemProps<T>) => React.ReactNode;
|
|
29
|
+
resources: typeof Resources.ATree;
|
|
30
|
+
}
|
|
31
|
+
declare enum EIndentState {
|
|
32
|
+
Collapsed = "Collapsed",
|
|
33
|
+
Expanded = "Expanded",
|
|
34
|
+
IsLast = "IsLast"
|
|
35
|
+
}
|
|
36
|
+
export declare const ATreeItem: <T extends IATreeItem<T>>({ item, selectDisabled, isParentDisabled, indents, ItemRenderer, useExpand, useSelect, useSearch, onDragStart, onDragOver, onDragEnd, showCheckbox, icons, iconWidth, isSelectMulti, enableDrag, isParentCheckHovered, RightStickyRenderer, resources, }: IATreeItemProps<T>) => React.ReactNode;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IATreeItem, IATreeSearchResult } from './ATree';
|
|
2
|
+
interface IATreeSearchProps<T extends IATreeItem<T>> {
|
|
3
|
+
searchResult: IATreeSearchResult<T> | undefined;
|
|
4
|
+
initSearch: (inputValue: string) => void;
|
|
5
|
+
searchUp: () => void;
|
|
6
|
+
searchDown: () => void;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const ATreeSearch: <T extends IATreeItem<T>>({ searchResult, initSearch, searchUp, searchDown, isDisabled, isLoading, }: IATreeSearchProps<T>) => React.ReactNode;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TPromisable<T> = T | Promise<T>;
|
|
3
|
+
/**
|
|
4
|
+
* getDir12Style
|
|
5
|
+
* Notice 1 : N, S, E, W are available when self is not falsy
|
|
6
|
+
*/
|
|
7
|
+
export declare enum EDir4 {
|
|
8
|
+
N = "North",
|
|
9
|
+
S = "South",
|
|
10
|
+
E = "East",
|
|
11
|
+
W = "West"
|
|
12
|
+
}
|
|
13
|
+
export declare enum EDir12 {
|
|
14
|
+
N = "North",
|
|
15
|
+
NW = "NorthWest",
|
|
16
|
+
NE = "NorthEast",
|
|
17
|
+
S = "South",
|
|
18
|
+
SW = "SouthWest",
|
|
19
|
+
SE = "SouthEast",
|
|
20
|
+
E = "East",
|
|
21
|
+
EN = "EastNorth",
|
|
22
|
+
ES = "EastSouth",
|
|
23
|
+
W = "West",
|
|
24
|
+
WN = "WestNorth",
|
|
25
|
+
WS = "WestSouth"
|
|
26
|
+
}
|
|
27
|
+
export declare function setDir12Style(anchorRef: React.RefObject<HTMLElement>, selfRef: React.RefObject<HTMLElement>, dir: EDir12): void;
|
|
28
|
+
export type TActionRef<T> = React.MutableRefObject<T | null | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* IFable (IFunctionable)
|
|
31
|
+
* it has a returns R, and it can be a function that takes P and returns R
|
|
32
|
+
*/
|
|
33
|
+
export type TIdx = number | string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IAWrapProps {
|
|
3
|
+
wrapProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
4
|
+
helperText?: React.ReactNode | React.ReactNode[];
|
|
5
|
+
wrapType?: 'Default' | 'Error';
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
vspace?: number;
|
|
8
|
+
hspace?: number;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const AWrap: ({ wrapProps, helperText, wrapType, label, children }: IAWrapProps) => React.ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useValues
|
|
3
|
+
* Notice 1 : useValues uses conditional hook. YOU SHOULD NEVER change the conditions. or it will boom
|
|
4
|
+
*
|
|
5
|
+
* 1. use === undefined 이면 useState<T>(defaultValue) (internal value, internal setter)
|
|
6
|
+
* 2. use === [T] 이면 useState<T>(use[0]) (defaultValue)
|
|
7
|
+
* 3. use === [T, undefined] 이면 use (fixed value)
|
|
8
|
+
* 4. use === [T, (newState: T) => void] 이면 use (external value, external setter)
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export type TUseValues<T> = [T] | [T, ((newState: T) => void) | undefined];
|
|
12
|
+
export declare function useValues<T>(use: TUseValues<T> | undefined, defaultValue: T): [T, ((newState: T) => void) | undefined];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const ApiContext: {
|
|
2
|
+
Init: () => void;
|
|
3
|
+
Create: <PO, RO>(context: IApiContextParam) => {
|
|
4
|
+
Call: (params?: {
|
|
5
|
+
po?: PO | undefined;
|
|
6
|
+
onStream?: IOnStream<RO> | undefined;
|
|
7
|
+
onStreamEnd?: IOnStream<RO> | undefined;
|
|
8
|
+
noDefaultHandle?: boolean | number[] | undefined;
|
|
9
|
+
} | undefined) => Promise<{
|
|
10
|
+
errorCode: number;
|
|
11
|
+
message: string;
|
|
12
|
+
data?: RO | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
FetchBaseUrl: () => string;
|
|
16
|
+
useDefaultHandler: (handler: (ro: IApiCallResult<any>, noDefaultHandle: number[] | boolean) => void) => void;
|
|
17
|
+
};
|
|
18
|
+
export interface IApiContextParam {
|
|
19
|
+
url: string;
|
|
20
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
21
|
+
stream?: boolean;
|
|
22
|
+
paramType?: 'query' | 'body' | 'form';
|
|
23
|
+
timeout?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IApiContext<PO, RO> {
|
|
26
|
+
Call: (po?: PO) => Promise<IApiCallResult<RO>>;
|
|
27
|
+
}
|
|
28
|
+
export interface IApiCallResult<RO> {
|
|
29
|
+
errorCode: number;
|
|
30
|
+
message: string;
|
|
31
|
+
data?: RO;
|
|
32
|
+
}
|
|
33
|
+
export interface IApiCallError {
|
|
34
|
+
err_code: number;
|
|
35
|
+
err_msg: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IOnStream<RO> {
|
|
38
|
+
(ro: RO): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function bound(targetValue: number, minValue?: number, maxValue?: number): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer is a callback function for some items.
|
|
3
|
+
* content is a ReactNode | Renderer fomr some items.
|
|
4
|
+
*
|
|
5
|
+
* Notice 1 : R cannot be a function. ICBAble is available when R is not a function.
|
|
6
|
+
*
|
|
7
|
+
* Todo 1 : F as Function is used for typecheck-bypassing. it might make some errors
|
|
8
|
+
*/
|
|
9
|
+
type TExcludeFunction<R> = R extends (...args: any[]) => any ? never : R;
|
|
10
|
+
export type TCB<P, R> = (props: P) => R;
|
|
11
|
+
export type TCBAble<P, R> = TExcludeFunction<R> | TCB<P, TExcludeFunction<R>>;
|
|
12
|
+
declare function getContent<P, R>(F: TCBAble<P, R>, props: P): TExcludeFunction<R>;
|
|
13
|
+
export declare const cbF: {
|
|
14
|
+
getContent: typeof getContent;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type CSSModuleClasses = {
|
|
2
|
+
readonly [key: string]: string;
|
|
3
|
+
};
|
|
4
|
+
declare function clsx(...args: any[]): string;
|
|
5
|
+
declare function sclsx(styles: CSSModuleClasses, ...args: any[]): string;
|
|
6
|
+
export declare const classF: {
|
|
7
|
+
clsx: typeof clsx;
|
|
8
|
+
sclsx: typeof sclsx;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* for form YYYY-MM-DD
|
|
3
|
+
*/
|
|
4
|
+
declare function toString(date: Date): string;
|
|
5
|
+
declare function toDate(str: string): Date | null;
|
|
6
|
+
declare function makeSDate(date: Date): Date;
|
|
7
|
+
declare function makeEDate(date: Date): Date;
|
|
8
|
+
declare function eq(d1: Date, d2: Date): boolean;
|
|
9
|
+
declare function g(d1: Date, d2: Date): boolean;
|
|
10
|
+
declare function ge(d1: Date, d2: Date): boolean;
|
|
11
|
+
declare function l(d1: Date, d2: Date): boolean;
|
|
12
|
+
declare function le(d1: Date, d2: Date): boolean;
|
|
13
|
+
declare function b(s: Date, d: Date, e: Date): boolean;
|
|
14
|
+
declare function be(s: Date, d: Date, e: Date): boolean;
|
|
15
|
+
export declare const dateF: {
|
|
16
|
+
toString: typeof toString;
|
|
17
|
+
toDate: typeof toDate;
|
|
18
|
+
makeSDate: typeof makeSDate;
|
|
19
|
+
makeEDate: typeof makeEDate;
|
|
20
|
+
'===': typeof eq;
|
|
21
|
+
'>': typeof g;
|
|
22
|
+
'>=': typeof ge;
|
|
23
|
+
'<': typeof l;
|
|
24
|
+
'<=': typeof le;
|
|
25
|
+
's<d<e|e<d<s': typeof b;
|
|
26
|
+
's<=d<=e|e<=d<=s': typeof be;
|
|
27
|
+
eq: typeof eq;
|
|
28
|
+
g: typeof g;
|
|
29
|
+
ge: typeof ge;
|
|
30
|
+
l: typeof l;
|
|
31
|
+
le: typeof le;
|
|
32
|
+
b: typeof b;
|
|
33
|
+
be: typeof be;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TIdx } from '../AComponents/ATypes/ATypes';
|
|
3
|
+
export interface IObject {
|
|
4
|
+
[key: TIdx]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface IItem extends IObject {
|
|
7
|
+
idx?: TIdx;
|
|
8
|
+
}
|
|
9
|
+
declare function equal<T extends IItem>(a: T, b: T): boolean;
|
|
10
|
+
export declare const objF: {
|
|
11
|
+
equal: typeof equal;
|
|
12
|
+
parse: <T>(value: string) => T | undefined;
|
|
13
|
+
stringify: (value: any, indent?: number | string) => string;
|
|
14
|
+
keys: <T_1 extends IObject>(obj: T_1) => (keyof T_1)[];
|
|
15
|
+
values: <T_2 extends IObject>(obj: T_2) => T_2[keyof T_2][];
|
|
16
|
+
hasKey: <T_3 extends IObject>(obj: T_3, key: string | number | symbol) => key is keyof T_3;
|
|
17
|
+
map: <T_4 extends IObject, U>(obj: T_4, fn: (keyValue: [keyof T_4, T_4[keyof T_4]], idx: number) => U) => U[];
|
|
18
|
+
some: <T_5 extends IObject>(obj: T_5, fn: (key: keyof T_5, value: T_5[keyof T_5]) => any) => boolean;
|
|
19
|
+
find: <T_6 extends IObject>(obj: T_6, fn: (key: keyof T_6, value: T_6[keyof T_6]) => any) => [string, any] | undefined;
|
|
20
|
+
isReactNode: (value: any) => value is React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IATableFilter, IATableSortation, TATableDefs, TATableFilterType, TATableFilteration } from '../AComponents/ATable/ATable';
|
|
2
|
+
import { IItem } from './objF';
|
|
3
|
+
type TDefaultPredicate = {
|
|
4
|
+
[key in TATableFilterType]: IATableFilter<any>[key]['predicate'];
|
|
5
|
+
};
|
|
6
|
+
export declare const defaultPredicate: TDefaultPredicate;
|
|
7
|
+
export declare const tableF: {
|
|
8
|
+
applyFilteration: <T extends IItem>(items: T[], defs: TATableDefs<T>, filteration: TATableFilteration<T>) => T[];
|
|
9
|
+
applySortation: <T_1 extends IItem>(items: T_1[], defs: TATableDefs<T_1>, sortation: IATableSortation<T_1>) => T_1[];
|
|
10
|
+
applyPagination: <T_2 extends IItem>(items: T_2[], page: number, pageSize: number) => T_2[];
|
|
11
|
+
getPages: (totalCount: number, pageSize: number) => number[];
|
|
12
|
+
getRangedPages: (page: number, totalCount: number, pageSize: number, pageRange: number) => {
|
|
13
|
+
pages: number[];
|
|
14
|
+
rangedPages: number[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TIdx } from '../AComponents/ATypes/ATypes';
|
|
2
|
+
import { IATreeItem } from '../AComponents/ATree/ATree';
|
|
3
|
+
import { IItem } from './objF';
|
|
4
|
+
declare function equal<T extends IItem>(a: T, b: T): boolean;
|
|
5
|
+
declare function find<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => any): T | undefined;
|
|
6
|
+
declare function forEach<T extends IATreeItem<T>>(items: T[] | T, callback: (item: T, idx?: TIdx) => void): void;
|
|
7
|
+
declare function map<T extends IATreeItem<T>, R>(items: T[] | T, callback: (item: T, idx?: TIdx) => R): R[];
|
|
8
|
+
declare function every<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => boolean): boolean;
|
|
9
|
+
declare function filter<T extends IATreeItem<T>>(items: T[] | T, predicate: (item: T, idx?: TIdx) => boolean): T[];
|
|
10
|
+
declare function length<T extends IATreeItem<T>>(items: T[] | T): number;
|
|
11
|
+
declare function replace<T extends IATreeItem<T>>(items: T[] | T, srcItem: T, dstItem: T): T[] | null;
|
|
12
|
+
export declare const treeF: {
|
|
13
|
+
find: typeof find;
|
|
14
|
+
forEach: typeof forEach;
|
|
15
|
+
map: typeof map;
|
|
16
|
+
every: typeof every;
|
|
17
|
+
filter: typeof filter;
|
|
18
|
+
equal: typeof equal;
|
|
19
|
+
length: typeof length;
|
|
20
|
+
replace: typeof replace;
|
|
21
|
+
};
|
|
22
|
+
export {};
|