@cloudtower/eagle 0.17.11
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 +26 -0
- package/dist/components/BaseIcon/index.d.ts +13 -0
- package/dist/components/Button/index.d.ts +16 -0
- package/dist/components/ButtonGroup/index.d.ts +5 -0
- package/dist/components/ErrorBoundary/index.d.ts +7 -0
- package/dist/components/FailedLoad/index.d.ts +9 -0
- package/dist/components/Form/index.d.ts +154 -0
- package/dist/components/FormError/index.d.ts +29 -0
- package/dist/components/HoverableIcon/index.d.ts +10 -0
- package/dist/components/Icon/index.d.ts +39 -0
- package/dist/components/InputInteger/index.d.ts +12 -0
- package/dist/components/KitStoreProvider/index.d.ts +8 -0
- package/dist/components/Loading/index.d.ts +3 -0
- package/dist/components/Metric/MetricActions.d.ts +9 -0
- package/dist/components/Metric/MetricLegend.d.ts +16 -0
- package/dist/components/Metric/Pointer.d.ts +6 -0
- package/dist/components/Metric/RenderChart.d.ts +41 -0
- package/dist/components/Metric/TooltipFormatter.d.ts +10 -0
- package/dist/components/Metric/index.d.ts +29 -0
- package/dist/components/Metric/metric.d.ts +43 -0
- package/dist/components/Metric/styled.d.ts +18 -0
- package/dist/components/Metric/type.d.ts +39 -0
- package/dist/components/Modal/index.d.ts +4 -0
- package/dist/components/Modal2/Error.d.ts +14 -0
- package/dist/components/Modal2/InitializedModal.d.ts +4 -0
- package/dist/components/Modal2/Modal.d.ts +9 -0
- package/dist/components/Modal2/WizardModal.d.ts +4 -0
- package/dist/components/Modal2/index.d.ts +10 -0
- package/dist/components/ModalStack/index.d.ts +3 -0
- package/dist/components/Overflow/index.d.ts +14 -0
- package/dist/components/Pagination/index.d.ts +4 -0
- package/dist/components/Radio/index.d.ts +8 -0
- package/dist/components/Steps/index.d.ts +4 -0
- package/dist/components/Styled/index.d.ts +72 -0
- package/dist/components/Switch/index.d.ts +4 -0
- package/dist/components/Table/CustomizeColumn.d.ts +13 -0
- package/dist/components/Table/HeaderCell.d.ts +25 -0
- package/dist/components/Table/PendingTable.d.ts +3 -0
- package/dist/components/Table/SearchWidget.d.ts +20 -0
- package/dist/components/Table/SidebarTable.d.ts +7 -0
- package/dist/components/Table/TableSelection.d.ts +27 -0
- package/dist/components/Table/TableWidget.d.ts +50 -0
- package/dist/components/Table/common.d.ts +33 -0
- package/dist/components/Table/customize-column.d.ts +3 -0
- package/dist/components/Table/index.d.ts +20 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/TowerTable/TableEmpty.d.ts +7 -0
- package/dist/components/TowerTable/TablePagination.d.ts +9 -0
- package/dist/components/TowerTable/WrapperComponent.d.ts +7 -0
- package/dist/components/TowerTable/index.d.ts +42 -0
- package/dist/components/Truncate/index.d.ts +12 -0
- package/dist/components/Typo/index.d.ts +70 -0
- package/dist/components/antd.d.ts +27 -0
- package/dist/components/images/images-type.d.ts +1 -0
- package/dist/components/images/index.d.ts +1123 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/esm/index.js +9347 -0
- package/dist/esm/stats1.html +6177 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/useElementResize.d.ts +2 -0
- package/dist/hooks/useElementsSize.d.ts +8 -0
- package/dist/hooks/useHistory.d.ts +2 -0
- package/dist/hooks/useLocalStorage.d.ts +61 -0
- package/dist/hooks/useMatchMediaQueries.d.ts +10 -0
- package/dist/hooks/useSearch.d.ts +12 -0
- package/dist/hooks/utils.d.ts +3 -0
- package/dist/index.d.ts +9 -0
- package/dist/spec/base.d.ts +478 -0
- package/dist/spec/emptyImpl.d.ts +3 -0
- package/dist/spec/index.d.ts +2 -0
- package/dist/spec/type.d.ts +35 -0
- package/dist/store/chart.d.ts +40 -0
- package/dist/store/index.d.ts +31 -0
- package/dist/store/modal.d.ts +55 -0
- package/dist/store/table.d.ts +54 -0
- package/dist/style.css +4407 -0
- package/dist/umd/index.js +10644 -0
- package/dist/umd/stats1.html +6177 -0
- package/dist/utils/constants.d.ts +15 -0
- package/dist/utils/dom.d.ts +6 -0
- package/dist/utils/formatValue.d.ts +2 -0
- package/dist/utils/history.d.ts +1 -0
- package/dist/utils/icon.d.ts +2 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/router.d.ts +34 -0
- package/dist/utils/types.d.ts +84 -0
- package/package.json +66 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as useElementResize } from "./useElementResize";
|
|
2
|
+
export { default as useElementsSize } from "./useElementsSize";
|
|
3
|
+
export { default as useHistory } from "./useHistory";
|
|
4
|
+
export { default as useLocalStorage } from "./useLocalStorage";
|
|
5
|
+
export * from "./useLocalStorage";
|
|
6
|
+
export * from "./useMatchMediaQueries";
|
|
7
|
+
export { default as useMatchMediaQueries } from "./useMatchMediaQueries";
|
|
8
|
+
export { default as useSearch } from "./useSearch";
|
|
9
|
+
export * from "./useSearch";
|
|
10
|
+
export * from "./utils";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Serializable, SerializableObject } from "@tower/utils";
|
|
2
|
+
import { UserSource } from "../spec";
|
|
3
|
+
import { GlobalSearchHistory, PastTime } from "../utils";
|
|
4
|
+
declare type SetValue<T> = (obj: T | ((val: T) => T)) => void;
|
|
5
|
+
export declare enum SupportLanguage {
|
|
6
|
+
zh = "zh-CN",
|
|
7
|
+
en = "en-US"
|
|
8
|
+
}
|
|
9
|
+
export declare const dispatchStorageEvent: <T extends Serializable>(key: string, value: T) => void;
|
|
10
|
+
declare type LocalStorageUser = {
|
|
11
|
+
id: string;
|
|
12
|
+
username: string;
|
|
13
|
+
name: string;
|
|
14
|
+
source: UserSource;
|
|
15
|
+
} | undefined;
|
|
16
|
+
export declare type CustomizeColumnType = {
|
|
17
|
+
key: string;
|
|
18
|
+
width?: number;
|
|
19
|
+
display?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare type LocalStorage = {
|
|
22
|
+
topo: {
|
|
23
|
+
datacenter: boolean;
|
|
24
|
+
cluster: boolean;
|
|
25
|
+
host: boolean;
|
|
26
|
+
folder: boolean;
|
|
27
|
+
showCount: boolean;
|
|
28
|
+
hostOrFolderRef: "host" | "folder";
|
|
29
|
+
};
|
|
30
|
+
newTopo: {
|
|
31
|
+
showCount: boolean;
|
|
32
|
+
hostOrFolderRef: "host" | "folder";
|
|
33
|
+
};
|
|
34
|
+
topoExpand: Record<string, boolean>;
|
|
35
|
+
token: string;
|
|
36
|
+
"table-customize-column": Record<string, CustomizeColumnType[]>;
|
|
37
|
+
"test-local-storage": string;
|
|
38
|
+
"search-history": Record<string, SerializableObject[]>;
|
|
39
|
+
"global-search-history": GlobalSearchHistory;
|
|
40
|
+
language: SupportLanguage;
|
|
41
|
+
user: LocalStorageUser;
|
|
42
|
+
"nav-menu": Record<string, string>;
|
|
43
|
+
reporter: Record<string, string[]>;
|
|
44
|
+
"favorite-tabs": Record<string, string[]>;
|
|
45
|
+
"topo-scalable-width": Record<string, number>;
|
|
46
|
+
everoute: boolean;
|
|
47
|
+
backup: boolean;
|
|
48
|
+
alpha: {
|
|
49
|
+
right: string;
|
|
50
|
+
bottom: string;
|
|
51
|
+
};
|
|
52
|
+
"date-range-picker": {
|
|
53
|
+
[key: string]: {
|
|
54
|
+
type: "relative" | "absolute";
|
|
55
|
+
timestamp: number;
|
|
56
|
+
value: PastTime | string[];
|
|
57
|
+
}[] | undefined | null;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export default function useLocalStorage<K extends keyof LocalStorage>(key: K, defaultValue: LocalStorage[K] | (() => LocalStorage[K])): [LocalStorage[K], SetValue<LocalStorage[K]>, () => void];
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Serializable } from "@tower/utils";
|
|
2
|
+
export declare type SearchOperation = {
|
|
3
|
+
pick?: string | string[];
|
|
4
|
+
omit?: string | string[];
|
|
5
|
+
preventRender?: boolean;
|
|
6
|
+
control?: "push" | "replace";
|
|
7
|
+
};
|
|
8
|
+
export declare type SetSearch<T> = (val: T | ((val: T) => T), operation?: SearchOperation) => void;
|
|
9
|
+
declare const useSearch: <T extends Serializable>(key: string, defaultValue: T, option?: {
|
|
10
|
+
preventRender?: boolean;
|
|
11
|
+
}) => [T, SetSearch<T>];
|
|
12
|
+
export default useSearch;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./styles/index.scss";
|
|
2
|
+
export * from "./components";
|
|
3
|
+
export * from "./hooks";
|
|
4
|
+
export * from "./spec";
|
|
5
|
+
export * from "./store";
|
|
6
|
+
export * from "./utils";
|
|
7
|
+
export * from "@cloudtower/parrot";
|
|
8
|
+
export type { DropDownProps } from "antd/lib/dropdown";
|
|
9
|
+
export type { ColumnsType, ColumnType, TableRowSelection, } from "antd/lib/table/interface";
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { FieldRenderProps } from "@smartx/react-final-form";
|
|
2
|
+
import { FieldArrayRenderProps } from "@smartx/react-final-form-arrays";
|
|
3
|
+
import { SerializableObject } from "@tower/utils";
|
|
4
|
+
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
5
|
+
import { AlertProps } from "antd/lib/alert";
|
|
6
|
+
import { AutoCompleteProps } from "antd/lib/auto-complete";
|
|
7
|
+
import { BadgeProps } from "antd/lib/badge";
|
|
8
|
+
import { ButtonProps as AntdButtonProps, ButtonType } from "antd/lib/button";
|
|
9
|
+
import { CheckboxProps } from "antd/lib/checkbox";
|
|
10
|
+
import { DatePickerProps } from "antd/lib/date-picker";
|
|
11
|
+
import { DividerProps as AntdDividerProps } from "antd/lib/divider";
|
|
12
|
+
import { DropDownProps } from "antd/lib/dropdown";
|
|
13
|
+
import { FormProps } from "antd/lib/form";
|
|
14
|
+
import { InputProps } from "antd/lib/input";
|
|
15
|
+
import { TextAreaProps as AntdTextAreaProps } from "antd/lib/input/TextArea";
|
|
16
|
+
import { InputNumberProps } from "antd/lib/input-number";
|
|
17
|
+
import { SiderProps } from "antd/lib/layout";
|
|
18
|
+
import { BasicProps } from "antd/lib/layout/layout";
|
|
19
|
+
import { ListProps } from "antd/lib/list";
|
|
20
|
+
import { ListItemMetaProps, ListItemProps } from "antd/lib/list/Item";
|
|
21
|
+
import { MenuItemGroupProps, MenuProps } from "antd/lib/menu";
|
|
22
|
+
import { MenuItemProps } from "antd/lib/menu/MenuItem";
|
|
23
|
+
import { SubMenuProps } from "antd/lib/menu/SubMenu";
|
|
24
|
+
import { MessageInstance } from "antd/lib/message";
|
|
25
|
+
import { ModalProps as AntdModalProps } from "antd/lib/modal";
|
|
26
|
+
import { PopoverProps } from "antd/lib/popover";
|
|
27
|
+
import { ProgressProps } from "antd/lib/progress";
|
|
28
|
+
import { RadioGroupProps as AntdRadioGroupProps, RadioProps as AntdRadioProps } from "antd/lib/radio";
|
|
29
|
+
import { RadioButtonProps as AntdRadioButtonProps } from "antd/lib/radio/radioButton";
|
|
30
|
+
import { SelectProps as AntdSelectProps } from "antd/lib/select";
|
|
31
|
+
import { SkeletonProps as AntdSkeletonProps } from "antd/lib/skeleton";
|
|
32
|
+
import { StepProps, StepsProps } from "antd/lib/steps";
|
|
33
|
+
import { SwitchProps as AntdSwitchProps } from "antd/lib/switch";
|
|
34
|
+
import { ColumnsType, ColumnType, TableProps as AntdTableProps } from "antd/lib/table";
|
|
35
|
+
import { TableRowSelection } from "antd/lib/table/interface";
|
|
36
|
+
import { TagType } from "antd/lib/tag";
|
|
37
|
+
import { TimePickerProps } from "antd/lib/time-picker";
|
|
38
|
+
import { TooltipProps as AntdTooltipProps } from "antd/lib/tooltip";
|
|
39
|
+
import { TreeProps as AntdTreeProps } from "antd/lib/tree";
|
|
40
|
+
import React, { ReactNode } from "react";
|
|
41
|
+
import { ImagesType } from "..";
|
|
42
|
+
import { Architecture } from "./type";
|
|
43
|
+
declare type BadgeTypeProps = "warning" | "error" | "info";
|
|
44
|
+
declare type Primitive = "Int" | "Float" | "DateTime" | "Enum" | "String" | "Boolean";
|
|
45
|
+
declare type Child = {
|
|
46
|
+
type: Exclude<Primitive, "Enum">;
|
|
47
|
+
} | {
|
|
48
|
+
type: "Enum";
|
|
49
|
+
enumValues: readonly string[];
|
|
50
|
+
};
|
|
51
|
+
interface IdObject {
|
|
52
|
+
id: string;
|
|
53
|
+
}
|
|
54
|
+
interface LooseFieldRenderProps<V, T extends HTMLElement> {
|
|
55
|
+
input: {
|
|
56
|
+
name?: FieldRenderProps<V, T>["input"]["name"];
|
|
57
|
+
value?: FieldRenderProps<V, T>["input"]["value"];
|
|
58
|
+
onBlur?: FieldRenderProps<V, T>["input"]["onBlur"];
|
|
59
|
+
onChange?: (value: string | string[], option: {
|
|
60
|
+
object: V;
|
|
61
|
+
} | Array<{
|
|
62
|
+
object: V;
|
|
63
|
+
}>) => void;
|
|
64
|
+
onFocus?: FieldRenderProps<V, T>["input"]["onFocus"];
|
|
65
|
+
type?: FieldRenderProps<V, T>["input"]["type"];
|
|
66
|
+
checked?: FieldRenderProps<V, T>["input"]["checked"];
|
|
67
|
+
multiple?: FieldRenderProps<V, T>["input"]["multiple"];
|
|
68
|
+
};
|
|
69
|
+
meta?: FieldRenderProps<V, T>["meta"];
|
|
70
|
+
focusIndicator?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface PaginationProps {
|
|
73
|
+
current: number;
|
|
74
|
+
count: number;
|
|
75
|
+
size: number;
|
|
76
|
+
onChange: (page: number) => void;
|
|
77
|
+
onSizeChange?: (size: number) => void;
|
|
78
|
+
simple?: boolean;
|
|
79
|
+
showTotal?: (total: number, range: [number, number]) => string;
|
|
80
|
+
selectorVisible?: boolean;
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
export declare type InputSize = "large" | "middle" | "small";
|
|
84
|
+
export declare type KitSelectProps = {
|
|
85
|
+
defaultValue?: string;
|
|
86
|
+
error?: unknown | React.ReactNode;
|
|
87
|
+
danger?: boolean;
|
|
88
|
+
multiple?: boolean;
|
|
89
|
+
scrollBottomBuffer?: number;
|
|
90
|
+
onScrollBottom?: () => void;
|
|
91
|
+
selectLimit?: number;
|
|
92
|
+
} & AntdSelectProps<string>;
|
|
93
|
+
interface OptionProps {
|
|
94
|
+
value: React.ReactText;
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
key?: string;
|
|
97
|
+
hidden?: boolean;
|
|
98
|
+
label?: string;
|
|
99
|
+
className?: string;
|
|
100
|
+
object?: SerializableObject;
|
|
101
|
+
title?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface RawValue {
|
|
104
|
+
rawValue?: number | null;
|
|
105
|
+
decimals?: number;
|
|
106
|
+
noUnitOnZero?: boolean;
|
|
107
|
+
abbreviate?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export declare type UnitFn = React.FC<RawValue>;
|
|
110
|
+
export declare type SorterOrder = "descend" | "ascend" | undefined;
|
|
111
|
+
declare type Columns<T> = ColumnsType<T>[0];
|
|
112
|
+
export interface RequiredColumnProps<T> extends Omit<Columns<T>, "onHeaderCell" | "onCell" | "title"> {
|
|
113
|
+
key: Exclude<Columns<T>["key"], undefined | number>;
|
|
114
|
+
dataIndex: Exclude<ColumnType<T>["dataIndex"], undefined>;
|
|
115
|
+
sortable?: boolean;
|
|
116
|
+
width?: number;
|
|
117
|
+
onHeaderCell?: (column: ColumnType<T>) => any;
|
|
118
|
+
onCell?: (column: T) => any;
|
|
119
|
+
/**
|
|
120
|
+
* removed params for title function
|
|
121
|
+
* because we need to cast the function in customize column
|
|
122
|
+
* which cannot access the header params
|
|
123
|
+
*/
|
|
124
|
+
title: React.ReactNode | (() => React.ReactNode);
|
|
125
|
+
customizable?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export declare type TableScroll = string | number | boolean;
|
|
128
|
+
export interface TableProps<T extends {
|
|
129
|
+
id: string;
|
|
130
|
+
}> {
|
|
131
|
+
bordered?: boolean;
|
|
132
|
+
loading?: boolean;
|
|
133
|
+
error?: React.ReactNode | string;
|
|
134
|
+
dataSource: T[] | undefined;
|
|
135
|
+
columns: RequiredColumnProps<T>[];
|
|
136
|
+
onSorterChange?: (order: SorterOrder | null, key?: string | number) => void;
|
|
137
|
+
onRowClick?: (record: T, index: number, evt: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
138
|
+
rowClassName?: (record: T, index: number) => string;
|
|
139
|
+
scroll?: {
|
|
140
|
+
x?: number | string | true;
|
|
141
|
+
y?: number | string;
|
|
142
|
+
};
|
|
143
|
+
onResize?: (column: RequiredColumnProps<T>[]) => void;
|
|
144
|
+
resizable?: boolean;
|
|
145
|
+
components?: {
|
|
146
|
+
table?: (props: any) => any;
|
|
147
|
+
header?: {
|
|
148
|
+
wrapper?: (props: any) => any;
|
|
149
|
+
row?: (props: any) => any;
|
|
150
|
+
cell?: (props: any) => any;
|
|
151
|
+
};
|
|
152
|
+
body?: {
|
|
153
|
+
wrapper?: (props: any) => any;
|
|
154
|
+
row?: (props: any) => any;
|
|
155
|
+
cell?: (props: any) => any;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
RowMenu?: React.FC<{
|
|
159
|
+
record: T;
|
|
160
|
+
index: number;
|
|
161
|
+
}>;
|
|
162
|
+
rowSelection?: TableRowSelection<T>;
|
|
163
|
+
empty?: string | React.ReactNode;
|
|
164
|
+
tableLayout?: "fixed" | "auto";
|
|
165
|
+
initLoading?: boolean;
|
|
166
|
+
rowKey?: AntdTableProps<T>["rowKey"];
|
|
167
|
+
wrapper?: React.MutableRefObject<HTMLDivElement | null>;
|
|
168
|
+
pagination?: {
|
|
169
|
+
current: number;
|
|
170
|
+
pageSize: number;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
interface TableComponent {
|
|
174
|
+
<TData extends IdObject>(props: React.PropsWithChildren<TableProps<TData>>, context?: unknown): React.ReactElement | null;
|
|
175
|
+
}
|
|
176
|
+
export interface EnumProps {
|
|
177
|
+
enumValues: readonly (string | {
|
|
178
|
+
value: string;
|
|
179
|
+
text: string;
|
|
180
|
+
})[];
|
|
181
|
+
placeholder?: string;
|
|
182
|
+
emptyLabel?: string;
|
|
183
|
+
size?: InputSize;
|
|
184
|
+
defaultValue?: string;
|
|
185
|
+
multiple?: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface TextAreaProps extends AntdTextAreaProps {
|
|
188
|
+
error?: boolean;
|
|
189
|
+
size?: "large" | "middle" | "small";
|
|
190
|
+
autoSize?: AntdTextAreaProps["autoSize"];
|
|
191
|
+
onFocusChangeHeight?: {
|
|
192
|
+
onFocus: number;
|
|
193
|
+
onBlur: number;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
export interface StringProps {
|
|
197
|
+
placeholder?: string;
|
|
198
|
+
autoComplete?: "on" | "off" | "new-password";
|
|
199
|
+
prefix?: React.ReactNode;
|
|
200
|
+
suffix?: React.ReactNode;
|
|
201
|
+
className?: string;
|
|
202
|
+
size?: InputSize;
|
|
203
|
+
allowClear?: boolean;
|
|
204
|
+
tags?: string[];
|
|
205
|
+
tagsOverflow?: React.ReactNode;
|
|
206
|
+
onTagsAllowClearClick?: (e: React.MouseEvent) => void;
|
|
207
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
208
|
+
maxLength?: number;
|
|
209
|
+
disabled?: boolean;
|
|
210
|
+
}
|
|
211
|
+
export interface IntProps {
|
|
212
|
+
placeholder?: string;
|
|
213
|
+
suffix?: string;
|
|
214
|
+
size?: InputSize;
|
|
215
|
+
onBlur?: (input: FieldBaseProps<number, HTMLInputElement>["input"], event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
216
|
+
}
|
|
217
|
+
export interface FloatProps {
|
|
218
|
+
placeholder?: string;
|
|
219
|
+
suffix?: string;
|
|
220
|
+
size?: InputSize;
|
|
221
|
+
onBlur?: (input: FieldBaseProps<number, HTMLInputElement>["input"], event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
222
|
+
}
|
|
223
|
+
export declare type TooltipProps = AntdTooltipProps & {
|
|
224
|
+
followMouse?: boolean;
|
|
225
|
+
};
|
|
226
|
+
export declare type FieldBaseProps<V, T extends HTMLElement = HTMLElement> = FieldRenderProps<V, T> & {
|
|
227
|
+
disabled?: boolean;
|
|
228
|
+
className?: string;
|
|
229
|
+
};
|
|
230
|
+
export declare type WizardSteps = {
|
|
231
|
+
title: string;
|
|
232
|
+
render: React.ReactNode;
|
|
233
|
+
prevText?: string | React.ReactNode;
|
|
234
|
+
okText?: string | React.ReactNode;
|
|
235
|
+
onOk?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
}[];
|
|
238
|
+
export declare type ModalProps = Omit<AntdModalProps, "okType"> & {
|
|
239
|
+
confirmLoading?: boolean;
|
|
240
|
+
fullscreen?: boolean;
|
|
241
|
+
error?: string | React.ReactNode;
|
|
242
|
+
normal?: boolean;
|
|
243
|
+
children?: React.ReactNode;
|
|
244
|
+
showCancel?: boolean;
|
|
245
|
+
showOk?: boolean;
|
|
246
|
+
wizard?: {
|
|
247
|
+
step: number;
|
|
248
|
+
onStepChange?: (step: number) => void;
|
|
249
|
+
steps: WizardSteps;
|
|
250
|
+
right?: React.ReactNode;
|
|
251
|
+
destroyOtherStep?: boolean;
|
|
252
|
+
disablePrevStep?: boolean;
|
|
253
|
+
} | boolean;
|
|
254
|
+
};
|
|
255
|
+
export declare type Modal2Props = AntdModalProps & {
|
|
256
|
+
/** Set is fullscreen to display modal */
|
|
257
|
+
fullscreen?: boolean;
|
|
258
|
+
/** Set loading type for ok button */
|
|
259
|
+
okLoading?: boolean;
|
|
260
|
+
/** Set disabled type for ok button */
|
|
261
|
+
okDisabled?: boolean;
|
|
262
|
+
/** Set error in footer */
|
|
263
|
+
footerError?: string | React.ReactNode | Error;
|
|
264
|
+
children?: React.ReactNode;
|
|
265
|
+
/** Display cancel button */
|
|
266
|
+
showCancel?: boolean;
|
|
267
|
+
/** Display ok button */
|
|
268
|
+
showOk?: boolean;
|
|
269
|
+
/** Set is a normal modal, width is 460px. If width is set it will fail */
|
|
270
|
+
normal?: boolean;
|
|
271
|
+
size?: "normal" | "medium" | "fullscreen";
|
|
272
|
+
};
|
|
273
|
+
declare type SearchInputProps = Omit<InputProps, "onChange"> & {
|
|
274
|
+
onChange: (value: string) => void;
|
|
275
|
+
debounceWait?: number;
|
|
276
|
+
};
|
|
277
|
+
export declare type DateTimeRangeProps = DatePickerProps;
|
|
278
|
+
export declare type IntFieldProps<V = any, T extends HTMLElement = HTMLElement> = FieldBaseProps<V, T> & IntProps & {
|
|
279
|
+
onChange?: FieldBaseProps<V, T>["input"]["onChange"];
|
|
280
|
+
autoComplete?: "on" | "off";
|
|
281
|
+
maximum?: number;
|
|
282
|
+
minimum?: number;
|
|
283
|
+
supportNegativeValue?: boolean;
|
|
284
|
+
};
|
|
285
|
+
export declare type ButtonGroupType = {
|
|
286
|
+
className?: string;
|
|
287
|
+
size?: SizeType;
|
|
288
|
+
options: Array<Omit<ButtonProps, "shape" | "size" | "icon"> & {
|
|
289
|
+
key: string;
|
|
290
|
+
title?: string;
|
|
291
|
+
hideTitle?: boolean;
|
|
292
|
+
icon?: ImagesType | JSX.Element;
|
|
293
|
+
}>;
|
|
294
|
+
};
|
|
295
|
+
export declare type IntegerFieldProps<V = any, T extends HTMLElement = HTMLElement> = FieldBaseProps<V, T> & InputNumberProps & {
|
|
296
|
+
onChange?: FieldBaseProps<V, T>["input"]["onChange"];
|
|
297
|
+
controls?: boolean;
|
|
298
|
+
suffix?: string;
|
|
299
|
+
prefix?: string;
|
|
300
|
+
size?: InputSize;
|
|
301
|
+
onBlur?: (input: FieldBaseProps<number, HTMLInputElement>["input"], event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
302
|
+
};
|
|
303
|
+
export declare type ButtonProps = {
|
|
304
|
+
prefixIcon?: ImagesType | JSX.Element;
|
|
305
|
+
hoverPrefixIcon?: ImagesType | JSX.Element;
|
|
306
|
+
suffixIcon?: ImagesType | JSX.Element;
|
|
307
|
+
hoverSuffixIcon?: ImagesType | JSX.Element;
|
|
308
|
+
type?: ButtonType | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet";
|
|
309
|
+
} & Omit<AntdButtonProps, "type">;
|
|
310
|
+
export declare type SwitchProps = Omit<AntdSwitchProps, "size"> & {
|
|
311
|
+
size?: "small" | "default" | "large";
|
|
312
|
+
};
|
|
313
|
+
export declare type RadioProps = AntdRadioProps & {
|
|
314
|
+
description?: React.ReactNode;
|
|
315
|
+
compact?: boolean;
|
|
316
|
+
};
|
|
317
|
+
export declare type RadioButtonProps = AntdRadioButtonProps & {
|
|
318
|
+
type?: "input" | "input-number";
|
|
319
|
+
min?: number;
|
|
320
|
+
max?: number;
|
|
321
|
+
precision?: number;
|
|
322
|
+
placeholder?: string;
|
|
323
|
+
initialValue?: string | number;
|
|
324
|
+
onInputChange?: (val: number | string | undefined) => void;
|
|
325
|
+
};
|
|
326
|
+
export declare type IStepsPorps = StepsProps & {
|
|
327
|
+
stepsConfig?: Array<StepProps>;
|
|
328
|
+
containerClassname?: string;
|
|
329
|
+
showStepCount?: boolean;
|
|
330
|
+
};
|
|
331
|
+
declare type ErrorType = string | React.ReactNode | Error;
|
|
332
|
+
export declare type InitializedModalType = Modal2Props & {
|
|
333
|
+
initLoading: boolean;
|
|
334
|
+
initError: ErrorType;
|
|
335
|
+
analyzeFallbackError: (fallback: unknown) => {
|
|
336
|
+
msg: string;
|
|
337
|
+
originalMsg: string;
|
|
338
|
+
} | null;
|
|
339
|
+
};
|
|
340
|
+
export declare type WizardModalType = Modal2Props & {
|
|
341
|
+
step: number;
|
|
342
|
+
onStepChange?: (step: number) => void;
|
|
343
|
+
steps: {
|
|
344
|
+
title: string;
|
|
345
|
+
render: React.ReactNode;
|
|
346
|
+
prevText?: string | React.ReactNode;
|
|
347
|
+
okText?: string | React.ReactNode;
|
|
348
|
+
onOk?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
349
|
+
disabled?: boolean;
|
|
350
|
+
}[];
|
|
351
|
+
right?: React.ReactNode;
|
|
352
|
+
destroyOtherStep?: boolean;
|
|
353
|
+
disablePrevStep?: boolean;
|
|
354
|
+
stepsPosition?: "top" | "side";
|
|
355
|
+
analyzeFallbackError: (fallback: unknown) => {
|
|
356
|
+
msg: string;
|
|
357
|
+
originalMsg: string;
|
|
358
|
+
} | null;
|
|
359
|
+
};
|
|
360
|
+
export interface Modal2Type extends React.FC<Modal2Props> {
|
|
361
|
+
Initialized: React.FC<InitializedModalType>;
|
|
362
|
+
Wizard: React.FC<WizardModalType>;
|
|
363
|
+
}
|
|
364
|
+
export interface Kit<V = any, T extends HTMLElement = HTMLElement> {
|
|
365
|
+
PAGINATION_SELECTOR: string;
|
|
366
|
+
TABLE_WRAPPER_SELECTOR: string;
|
|
367
|
+
THEAD_SELECTOR: string;
|
|
368
|
+
TBODY_SELECTOR: string;
|
|
369
|
+
MODAL_WHITELIST: string[];
|
|
370
|
+
loading: React.FunctionComponent<{
|
|
371
|
+
fullView?: boolean;
|
|
372
|
+
}>;
|
|
373
|
+
error: React.FunctionComponent<{
|
|
374
|
+
error: unknown;
|
|
375
|
+
}>;
|
|
376
|
+
pagination: React.FC<PaginationProps>;
|
|
377
|
+
select: React.FunctionComponent<LooseFieldRenderProps<V, T> & KitSelectProps>;
|
|
378
|
+
option: React.FunctionComponent<OptionProps>;
|
|
379
|
+
table: TableComponent;
|
|
380
|
+
button: React.FC<ButtonProps>;
|
|
381
|
+
modal: React.FC<ModalProps>;
|
|
382
|
+
modal2: React.FC<Modal2Props> & Modal2Type;
|
|
383
|
+
dropdown: React.FC<DropDownProps>;
|
|
384
|
+
switch: React.FC<SwitchProps>;
|
|
385
|
+
tooltip: React.FC<TooltipProps>;
|
|
386
|
+
input: React.FC<InputProps & {
|
|
387
|
+
error?: boolean;
|
|
388
|
+
}>;
|
|
389
|
+
textArea: React.FC<TextAreaProps>;
|
|
390
|
+
checkbox: React.FC<CheckboxProps & {
|
|
391
|
+
description?: ReactNode;
|
|
392
|
+
compact?: boolean;
|
|
393
|
+
}>;
|
|
394
|
+
fields: {
|
|
395
|
+
Int: React.FunctionComponent<IntFieldProps<V, T>>;
|
|
396
|
+
Integer: React.FunctionComponent<IntegerFieldProps<V, T>>;
|
|
397
|
+
Float: React.FunctionComponent<FieldBaseProps<V, T> & FloatProps & {
|
|
398
|
+
onChange?: FieldBaseProps<V, T>["input"]["onChange"];
|
|
399
|
+
autoComplete?: "on" | "off";
|
|
400
|
+
}>;
|
|
401
|
+
DateTime: React.FunctionComponent<FieldBaseProps<V, T>>;
|
|
402
|
+
Enum: React.FunctionComponent<{
|
|
403
|
+
input: Partial<FieldRenderProps<V, T>["input"]>;
|
|
404
|
+
meta: FieldRenderProps<V, T>["meta"];
|
|
405
|
+
disabled?: boolean;
|
|
406
|
+
className?: string;
|
|
407
|
+
dropdownClassName?: string;
|
|
408
|
+
} & EnumProps>;
|
|
409
|
+
String: React.FunctionComponent<FieldBaseProps<V, T> & StringProps>;
|
|
410
|
+
Boolean: React.FunctionComponent<FieldBaseProps<V, T>>;
|
|
411
|
+
TextArea: React.FC<FieldBaseProps<V, T> & TextAreaProps>;
|
|
412
|
+
Array: React.FunctionComponent<FieldArrayRenderProps<V, T> & {
|
|
413
|
+
child: Child;
|
|
414
|
+
}>;
|
|
415
|
+
DateTimeRange: React.FunctionComponent<FieldBaseProps<V, T> & DatePickerProps>;
|
|
416
|
+
TimePicker: React.FunctionComponent<FieldBaseProps<V, T> & TimePickerProps>;
|
|
417
|
+
};
|
|
418
|
+
units: {
|
|
419
|
+
Byte: UnitFn;
|
|
420
|
+
Frequency: UnitFn;
|
|
421
|
+
Percent: UnitFn;
|
|
422
|
+
Speed: UnitFn;
|
|
423
|
+
Second: UnitFn;
|
|
424
|
+
Bps: UnitFn;
|
|
425
|
+
BitPerSecond: UnitFn;
|
|
426
|
+
Bit: UnitFn;
|
|
427
|
+
};
|
|
428
|
+
inputGroup: React.FunctionComponent<{
|
|
429
|
+
compact: boolean;
|
|
430
|
+
}>;
|
|
431
|
+
Empty: React.ReactElement | null;
|
|
432
|
+
alert: React.FunctionComponent<Omit<AlertProps, "type"> & {
|
|
433
|
+
type?: AlertProps["type"] | "normal";
|
|
434
|
+
}>;
|
|
435
|
+
searchInput: React.FC<SearchInputProps>;
|
|
436
|
+
exportButton: React.FC<{
|
|
437
|
+
href?: string;
|
|
438
|
+
}>;
|
|
439
|
+
badge: React.FC<BadgeProps & {
|
|
440
|
+
type?: BadgeTypeProps;
|
|
441
|
+
}>;
|
|
442
|
+
radio: React.FC<RadioProps>;
|
|
443
|
+
radioGroup: React.FC<AntdRadioGroupProps>;
|
|
444
|
+
radioButton: React.FC<RadioButtonProps>;
|
|
445
|
+
tree: React.FC<AntdTreeProps>;
|
|
446
|
+
progress: React.FC<ProgressProps>;
|
|
447
|
+
divider: React.FC<AntdDividerProps>;
|
|
448
|
+
skeleton: React.FC<AntdSkeletonProps>;
|
|
449
|
+
menu: React.ComponentType<MenuProps> & {
|
|
450
|
+
Divider: React.FC<import("rc-menu/lib/Divider").DividerProps>;
|
|
451
|
+
Item: React.ComponentType<MenuItemProps>;
|
|
452
|
+
SubMenu: React.ComponentType<SubMenuProps>;
|
|
453
|
+
ItemGroup: React.ComponentType<MenuItemGroupProps>;
|
|
454
|
+
};
|
|
455
|
+
menuItem: React.ComponentType<MenuItemProps>;
|
|
456
|
+
menuItemGroup: React.ComponentType<MenuItemGroupProps>;
|
|
457
|
+
list: <T>(props: ListProps<T>) => JSX.Element;
|
|
458
|
+
listItem: React.FC<ListItemProps>;
|
|
459
|
+
listItemMeta: React.FC<ListItemMetaProps>;
|
|
460
|
+
layout: React.ComponentType<BasicProps> & {
|
|
461
|
+
Header: React.ComponentType<BasicProps>;
|
|
462
|
+
Footer: React.ComponentType<BasicProps>;
|
|
463
|
+
Content: React.ComponentType<BasicProps>;
|
|
464
|
+
Sider: React.ComponentType<SiderProps>;
|
|
465
|
+
};
|
|
466
|
+
autoComplete: React.ForwardRefExoticComponent<AutoCompleteProps>;
|
|
467
|
+
message: MessageInstance;
|
|
468
|
+
tag: TagType;
|
|
469
|
+
popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<unknown>>;
|
|
470
|
+
arch: React.FC<{
|
|
471
|
+
architecture?: Architecture;
|
|
472
|
+
}>;
|
|
473
|
+
buttonGroup: React.ForwardRefExoticComponent<ButtonGroupType & React.RefAttributes<HTMLDivElement>>;
|
|
474
|
+
steps: React.FC<IStepsPorps>;
|
|
475
|
+
form: React.FC<FormProps>;
|
|
476
|
+
}
|
|
477
|
+
export declare const kitContext: React.Context<Kit<any, HTMLElement>>;
|
|
478
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare type Maybe<T> = T | null | undefined;
|
|
2
|
+
export declare type Scalars = {
|
|
3
|
+
ID: string;
|
|
4
|
+
String: string;
|
|
5
|
+
Boolean: boolean;
|
|
6
|
+
Int: number;
|
|
7
|
+
Float: number;
|
|
8
|
+
DateTime: string;
|
|
9
|
+
[key: string]: string | number | boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare enum Architecture {
|
|
12
|
+
Aarch64 = "AARCH64",
|
|
13
|
+
X86_64 = "X86_64"
|
|
14
|
+
}
|
|
15
|
+
export declare enum UserSource {
|
|
16
|
+
Ldap = "LDAP",
|
|
17
|
+
Local = "LOCAL"
|
|
18
|
+
}
|
|
19
|
+
export declare enum EntityAsyncStatus {
|
|
20
|
+
Creating = "CREATING",
|
|
21
|
+
Deleting = "DELETING",
|
|
22
|
+
Updating = "UPDATING"
|
|
23
|
+
}
|
|
24
|
+
export declare enum TaskStatus {
|
|
25
|
+
Executing = "EXECUTING",
|
|
26
|
+
Failed = "FAILED",
|
|
27
|
+
Paused = "PAUSED",
|
|
28
|
+
Pending = "PENDING",
|
|
29
|
+
Successed = "SUCCESSED"
|
|
30
|
+
}
|
|
31
|
+
export interface AdditionOptions {
|
|
32
|
+
error?: boolean;
|
|
33
|
+
controls?: boolean;
|
|
34
|
+
suffix?: string;
|
|
35
|
+
}
|