@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.
Files changed (87) hide show
  1. package/README.md +26 -0
  2. package/dist/components/BaseIcon/index.d.ts +13 -0
  3. package/dist/components/Button/index.d.ts +16 -0
  4. package/dist/components/ButtonGroup/index.d.ts +5 -0
  5. package/dist/components/ErrorBoundary/index.d.ts +7 -0
  6. package/dist/components/FailedLoad/index.d.ts +9 -0
  7. package/dist/components/Form/index.d.ts +154 -0
  8. package/dist/components/FormError/index.d.ts +29 -0
  9. package/dist/components/HoverableIcon/index.d.ts +10 -0
  10. package/dist/components/Icon/index.d.ts +39 -0
  11. package/dist/components/InputInteger/index.d.ts +12 -0
  12. package/dist/components/KitStoreProvider/index.d.ts +8 -0
  13. package/dist/components/Loading/index.d.ts +3 -0
  14. package/dist/components/Metric/MetricActions.d.ts +9 -0
  15. package/dist/components/Metric/MetricLegend.d.ts +16 -0
  16. package/dist/components/Metric/Pointer.d.ts +6 -0
  17. package/dist/components/Metric/RenderChart.d.ts +41 -0
  18. package/dist/components/Metric/TooltipFormatter.d.ts +10 -0
  19. package/dist/components/Metric/index.d.ts +29 -0
  20. package/dist/components/Metric/metric.d.ts +43 -0
  21. package/dist/components/Metric/styled.d.ts +18 -0
  22. package/dist/components/Metric/type.d.ts +39 -0
  23. package/dist/components/Modal/index.d.ts +4 -0
  24. package/dist/components/Modal2/Error.d.ts +14 -0
  25. package/dist/components/Modal2/InitializedModal.d.ts +4 -0
  26. package/dist/components/Modal2/Modal.d.ts +9 -0
  27. package/dist/components/Modal2/WizardModal.d.ts +4 -0
  28. package/dist/components/Modal2/index.d.ts +10 -0
  29. package/dist/components/ModalStack/index.d.ts +3 -0
  30. package/dist/components/Overflow/index.d.ts +14 -0
  31. package/dist/components/Pagination/index.d.ts +4 -0
  32. package/dist/components/Radio/index.d.ts +8 -0
  33. package/dist/components/Steps/index.d.ts +4 -0
  34. package/dist/components/Styled/index.d.ts +72 -0
  35. package/dist/components/Switch/index.d.ts +4 -0
  36. package/dist/components/Table/CustomizeColumn.d.ts +13 -0
  37. package/dist/components/Table/HeaderCell.d.ts +25 -0
  38. package/dist/components/Table/PendingTable.d.ts +3 -0
  39. package/dist/components/Table/SearchWidget.d.ts +20 -0
  40. package/dist/components/Table/SidebarTable.d.ts +7 -0
  41. package/dist/components/Table/TableSelection.d.ts +27 -0
  42. package/dist/components/Table/TableWidget.d.ts +50 -0
  43. package/dist/components/Table/common.d.ts +33 -0
  44. package/dist/components/Table/customize-column.d.ts +3 -0
  45. package/dist/components/Table/index.d.ts +20 -0
  46. package/dist/components/Tooltip/index.d.ts +4 -0
  47. package/dist/components/TowerTable/TableEmpty.d.ts +7 -0
  48. package/dist/components/TowerTable/TablePagination.d.ts +9 -0
  49. package/dist/components/TowerTable/WrapperComponent.d.ts +7 -0
  50. package/dist/components/TowerTable/index.d.ts +42 -0
  51. package/dist/components/Truncate/index.d.ts +12 -0
  52. package/dist/components/Typo/index.d.ts +70 -0
  53. package/dist/components/antd.d.ts +27 -0
  54. package/dist/components/images/images-type.d.ts +1 -0
  55. package/dist/components/images/index.d.ts +1123 -0
  56. package/dist/components/index.d.ts +35 -0
  57. package/dist/esm/index.js +9347 -0
  58. package/dist/esm/stats1.html +6177 -0
  59. package/dist/hooks/index.d.ts +10 -0
  60. package/dist/hooks/useElementResize.d.ts +2 -0
  61. package/dist/hooks/useElementsSize.d.ts +8 -0
  62. package/dist/hooks/useHistory.d.ts +2 -0
  63. package/dist/hooks/useLocalStorage.d.ts +61 -0
  64. package/dist/hooks/useMatchMediaQueries.d.ts +10 -0
  65. package/dist/hooks/useSearch.d.ts +12 -0
  66. package/dist/hooks/utils.d.ts +3 -0
  67. package/dist/index.d.ts +9 -0
  68. package/dist/spec/base.d.ts +478 -0
  69. package/dist/spec/emptyImpl.d.ts +3 -0
  70. package/dist/spec/index.d.ts +2 -0
  71. package/dist/spec/type.d.ts +35 -0
  72. package/dist/store/chart.d.ts +40 -0
  73. package/dist/store/index.d.ts +31 -0
  74. package/dist/store/modal.d.ts +55 -0
  75. package/dist/store/table.d.ts +54 -0
  76. package/dist/style.css +4407 -0
  77. package/dist/umd/index.js +10644 -0
  78. package/dist/umd/stats1.html +6177 -0
  79. package/dist/utils/constants.d.ts +15 -0
  80. package/dist/utils/dom.d.ts +6 -0
  81. package/dist/utils/formatValue.d.ts +2 -0
  82. package/dist/utils/history.d.ts +1 -0
  83. package/dist/utils/icon.d.ts +2 -0
  84. package/dist/utils/index.d.ts +7 -0
  85. package/dist/utils/router.d.ts +34 -0
  86. package/dist/utils/types.d.ts +84 -0
  87. package/package.json +66 -0
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ ## Usage
2
+
3
+ ```tsx
4
+ import { antdKit } from "@cloudtower/eagle";
5
+ import { KitStoreProvider, kitContext } from "@cloudtower/eagle";
6
+ import { initParrotI18n } from "@cloudtower/eagle";
7
+
8
+ import "@cloudtower/eagle/dist/style.css";
9
+
10
+ initParrotI18n();
11
+
12
+ ReactDOM.render(
13
+ <React.StrictMode>
14
+ <KitStoreProvider>
15
+ <kitContext.Provider value={antdKit}>
16
+ <App />
17
+ </kitContext.Provider>
18
+ </KitStoreProvider>
19
+ </React.StrictMode>,
20
+ document.getElementById("root") as HTMLElement
21
+ );
22
+ ```
23
+
24
+ ## Debug
25
+
26
+ ## Contribute
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export interface IBaseIconProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ className?: string;
4
+ alt?: string;
5
+ width?: number;
6
+ height?: number | "auto";
7
+ cursor?: "pointer" | string;
8
+ prefixNode?: React.ReactNode;
9
+ suffixIconSrc?: string;
10
+ src: string;
11
+ }
12
+ declare const BaseIcon: React.ForwardRefExoticComponent<IBaseIconProps & React.RefAttributes<HTMLSpanElement>>;
13
+ export default BaseIcon;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ declare const Button: React.ForwardRefExoticComponent<{
3
+ prefixIcon?: JSX.Element | import("..").ImagesType | undefined;
4
+ hoverPrefixIcon?: JSX.Element | import("..").ImagesType | undefined;
5
+ suffixIcon?: JSX.Element | import("..").ImagesType | undefined;
6
+ hoverSuffixIcon?: JSX.Element | import("..").ImagesType | undefined;
7
+ type?: "link" | "text" | "ghost" | "default" | "primary" | "dashed" | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet" | undefined;
8
+ } & Omit<Partial<{
9
+ href: string;
10
+ target?: string | undefined;
11
+ onClick?: React.MouseEventHandler<HTMLElement> | undefined;
12
+ } & import("antd/lib/button/button").BaseButtonProps & import("antd/lib/_util/type").Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
13
+ htmlType?: "button" | "reset" | "submit" | undefined;
14
+ onClick?: React.MouseEventHandler<HTMLElement> | undefined;
15
+ } & import("antd/lib/_util/type").Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "type"> & React.RefAttributes<HTMLButtonElement>>;
16
+ export default Button;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { ButtonGroupType } from "../../spec";
3
+ export declare const ButtonStyle: import("@linaria/core").LinariaClassName;
4
+ declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupType & React.RefAttributes<HTMLDivElement>>;
5
+ export default ButtonGroup;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { WithTranslation } from "react-i18next";
3
+ declare const _default: React.ComponentType<Omit<{
4
+ t: any;
5
+ tReady: boolean;
6
+ }, keyof WithTranslation<N, undefined>> & import("react-i18next").WithTranslationProps>;
7
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ declare const FailedLoad: React.FC<{
3
+ error: Error | string;
4
+ refetch: () => Promise<unknown>;
5
+ refetchText?: string;
6
+ className?: string;
7
+ title?: string;
8
+ }>;
9
+ export default FailedLoad;
@@ -0,0 +1,154 @@
1
+ import { FormApi, FormState, FormSubscription, MutableState, SubmissionErrors, Tools } from "@smartx/final-form";
2
+ import { FieldMetaState, FieldRenderProps, FormProps, FormRenderProps, UseFormStateParams } from "@smartx/react-final-form";
3
+ import { FieldArrayRenderProps } from "@smartx/react-final-form-arrays";
4
+ import { ColProps } from "antd/lib/col";
5
+ import React, { Component, ReactElement, ReactNode } from "react";
6
+ import { Kit } from "../../spec";
7
+ export declare const FormLayoutContext: React.Context<Form1LayoutProps>;
8
+ declare type FormItemLayout = {
9
+ label?: ColProps;
10
+ control?: ColProps;
11
+ };
12
+ export declare type LayoutProps = {
13
+ compact?: boolean;
14
+ formItem?: FormItemLayout;
15
+ };
16
+ export declare const DEFAULT_LAYOUT: {
17
+ formItem: Required<FormItemLayout>;
18
+ };
19
+ declare type SetValuesMutator = ([mutate]: [(prevValues: Readonly<any>) => any], state: MutableState<any>) => void;
20
+ export declare const setValuesMutator: SetValuesMutator;
21
+ export declare const arrayMutators: {
22
+ replace: ([name, value]: [string, any[]], state: MutableState<any>, { changeValue }: Tools<any>) => void;
23
+ insert: import("@smartx/final-form").Mutator<any>;
24
+ concat: import("@smartx/final-form").Mutator<any>;
25
+ move: import("@smartx/final-form").Mutator<any>;
26
+ pop: import("@smartx/final-form").Mutator<any>;
27
+ push: import("@smartx/final-form").Mutator<any>;
28
+ removeBatch: import("@smartx/final-form").Mutator<any>;
29
+ remove: import("@smartx/final-form").Mutator<any>;
30
+ shift: import("@smartx/final-form").Mutator<any>;
31
+ swap: import("@smartx/final-form").Mutator<any>;
32
+ update: import("@smartx/final-form").Mutator<any>;
33
+ unshift: import("@smartx/final-form").Mutator<any>;
34
+ };
35
+ export declare type UseFormApi<T> = FormApi<T> & {
36
+ setValues: (callback: (prev: Readonly<T>) => T) => void;
37
+ };
38
+ export declare type BaseFormProps<T, V, O = {}> = {
39
+ initialValues?: T;
40
+ keepDirtyOnReinitialize?: boolean;
41
+ onSubmit: (values: T, form: FormApi<T>, callback?: (errors?: SubmissionErrors) => void) => SubmissionErrors | Promise<SubmissionErrors | undefined> | undefined | void;
42
+ subscription?: FormSubscription;
43
+ validation?: V;
44
+ onChanges?: O;
45
+ render: (props: Omit<FormRenderProps<T>, "form"> & {
46
+ form: UseFormApi<T>;
47
+ }) => ReactElement;
48
+ layout?: LayoutProps;
49
+ debug?: FormProps["debug"];
50
+ };
51
+ export declare type FormContextType<Validators = {}, OnChanges = {}> = {
52
+ layout: LayoutProps;
53
+ kit: Kit;
54
+ validators: Validators;
55
+ onChanges: OnChanges;
56
+ };
57
+ declare type BaseFieldState<T> = FieldMetaState<T> & {
58
+ value: T;
59
+ name: string;
60
+ };
61
+ export declare type FieldProps<T> = {
62
+ defaultValue?: T;
63
+ initialValue?: T;
64
+ format?: (value: T, name: string) => any;
65
+ parse?: (value: any, name: string) => T;
66
+ label?: ((props: BaseFieldState<T>) => ReactElement | null) | ReactNode;
67
+ error?: ((props: BaseFieldState<T>) => ReactElement | null) | ReactNode;
68
+ extra?: ((props: BaseFieldState<T>) => ReactElement | null) | ReactNode;
69
+ render?: ((props: FieldRenderProps<T>) => ReactElement | null) | ReactNode;
70
+ className?: string;
71
+ autoFocus?: boolean;
72
+ layout?: {
73
+ label?: ColProps;
74
+ control?: ColProps;
75
+ };
76
+ index?: number | number[];
77
+ };
78
+ export declare type FieldOnChange<T, FV> = (args: {
79
+ name?: string;
80
+ value: T | undefined;
81
+ setValues: UseFormApi<FV>["setValues"];
82
+ }) => void;
83
+ export declare type FieldListenerProps<T, FV> = {
84
+ name: string;
85
+ onChange: FieldOnChange<T, FV>;
86
+ };
87
+ export declare class BaseField<T, FV, P extends FieldProps<T> = FieldProps<T>> extends Component<P> {
88
+ path: string;
89
+ form: string;
90
+ defaultRender?: FieldProps<T>["render"];
91
+ render(): JSX.Element | null;
92
+ }
93
+ export declare type FieldArrayRenderPropsFields<T> = FieldArrayRenderProps<T, HTMLElement>["fields"] & {
94
+ replace: (value: T[]) => void;
95
+ };
96
+ export declare type FieldArrayRender<T> = (props: {
97
+ fields: FieldArrayRenderPropsFields<T>;
98
+ meta: FieldArrayRenderProps<T, HTMLElement>["meta"];
99
+ }) => ReactElement | null;
100
+ declare type BaseFieldArrayState<T> = FieldArrayRenderProps<T, HTMLElement>["meta"] & {
101
+ value?: T[];
102
+ };
103
+ export declare type FieldArrayProps<T> = {
104
+ defaultValue?: T[];
105
+ initialValue?: T[];
106
+ format?: (value: T[], name: string) => any;
107
+ parse?: (value: any, name: string) => T[];
108
+ label?: ((props: BaseFieldArrayState<T>) => ReactElement | null) | ReactNode;
109
+ error?: ((props: BaseFieldArrayState<T>) => ReactElement | null) | ReactNode;
110
+ extra?: FieldArrayRender<T> | ReactNode;
111
+ render?: FieldArrayRender<T> | ReactNode;
112
+ className?: string;
113
+ autoFocus?: boolean;
114
+ layout?: {
115
+ label?: ColProps;
116
+ control?: ColProps;
117
+ };
118
+ index?: number | number[];
119
+ };
120
+ export declare class BaseFieldArray<T, FV, P extends FieldArrayProps<T> = FieldArrayProps<T>> extends Component<P> {
121
+ path: string;
122
+ form: string;
123
+ render(): JSX.Element | null;
124
+ }
125
+ export declare function useEnterToSubmit(handleSubmit: FormRenderProps["handleSubmit"]): void;
126
+ export declare function useMemoInitialValues<T>(initialValues: T, keepDirtyOnReinitialize: boolean | undefined): T;
127
+ declare type FormItemProps = {
128
+ autoFocus?: boolean;
129
+ className: string;
130
+ children: ReactNode;
131
+ };
132
+ export declare function FormItem({ autoFocus, ...props }: FormItemProps): JSX.Element;
133
+ export declare type FormSpyComponent<T> = (props: UseFormStateParams<T> & {
134
+ children: ReactElement | null | ((props: FormState<T> & {
135
+ form: UseFormApi<T>;
136
+ }) => ReactElement | null);
137
+ }) => ReactElement;
138
+ declare type Form1FormLayout = "general" | "compact";
139
+ declare type Form1LabelAlign = "left" | "right";
140
+ declare type Form1LayoutProps = {
141
+ layout?: Form1FormLayout;
142
+ labelCol?: ColProps;
143
+ wrapperCol?: ColProps;
144
+ labelAlign?: Form1LabelAlign;
145
+ };
146
+ export declare const InfoField: (props: {
147
+ label?: ReactNode;
148
+ children: ReactNode;
149
+ className?: string | undefined;
150
+ layoutProps?: Form1LayoutProps | undefined;
151
+ }) => JSX.Element;
152
+ export declare type OnSubmit<T> = (values: T, form: FormApi<T>, callback?: (errors?: SubmissionErrors) => void) => SubmissionErrors | Promise<SubmissionErrors | undefined> | undefined | void;
153
+ export declare const usePreventSubmitOnModalClose: <T>(onSubmit: OnSubmit<T>) => OnSubmit<T>;
154
+ export {};
@@ -0,0 +1,29 @@
1
+ import { SubmissionErrors, ValidationErrors } from "@smartx/final-form";
2
+ import { FieldRenderProps } from "@smartx/react-final-form";
3
+ import React, { ReactElement } from "react";
4
+ export declare const FormError: import("@linaria/react").StyledMeta & React.FunctionComponent<React.ClassAttributes<HTMLSpanElement> & React.HTMLAttributes<HTMLSpanElement> & Record<never, unknown> & {
5
+ as?: React.ElementType<any> | undefined;
6
+ }>;
7
+ export declare function deepGetErrorKey(value: string | object): string | undefined;
8
+ export declare const findFirstError: (fields: string[], errors?: ValidationErrors | SubmissionErrors) => ValidationErrors | undefined;
9
+ export declare const SubmitError: React.FC<{
10
+ className?: string;
11
+ fallback?: unknown;
12
+ analyzeFallbackError(fallback: unknown): {
13
+ msg: string;
14
+ originalMsg: string;
15
+ } | null;
16
+ }>;
17
+ export declare const V2AnalyzedError: React.FC<{
18
+ className?: string;
19
+ fallback?: unknown;
20
+ analyzeFallbackError(fallback: unknown): {
21
+ msg: string;
22
+ originalMsg: string;
23
+ } | null;
24
+ }>;
25
+ declare const FieldError: <T>(props: {
26
+ name: string;
27
+ children?: (props: FieldRenderProps<T>) => ReactElement;
28
+ }) => ReactElement | null;
29
+ export default FieldError;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ImagesType } from "../images/images-type";
3
+ interface IProps {
4
+ className?: string;
5
+ hover: boolean;
6
+ icon: ImagesType | JSX.Element | null | undefined;
7
+ hoverIcon: ImagesType | JSX.Element | null | undefined;
8
+ }
9
+ declare const HoverableIcon: (props: IProps) => JSX.Element | null;
10
+ export default HoverableIcon;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { ImagesType } from "../images/images-type";
3
+ export declare type IconProps = React.HTMLAttributes<HTMLSpanElement> & {
4
+ type: ImagesType;
5
+ active?: boolean;
6
+ hoverType?: ImagesType;
7
+ activeType?: ImagesType;
8
+ className?: string;
9
+ alt?: string;
10
+ iconWidth?: number;
11
+ iconHeight?: number | "auto";
12
+ cursor?: "pointer" | string;
13
+ isRotate?: boolean;
14
+ prefix?: React.ReactNode;
15
+ suffixType?: {
16
+ type: ImagesType;
17
+ hoverType?: ImagesType;
18
+ activeType?: ImagesType;
19
+ };
20
+ };
21
+ declare const Icon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
22
+ type: ImagesType;
23
+ active?: boolean | undefined;
24
+ hoverType?: ImagesType | undefined;
25
+ activeType?: ImagesType | undefined;
26
+ className?: string | undefined;
27
+ alt?: string | undefined;
28
+ iconWidth?: number | undefined;
29
+ iconHeight?: number | "auto" | undefined;
30
+ cursor?: string | undefined;
31
+ isRotate?: boolean | undefined;
32
+ prefix?: React.ReactNode;
33
+ suffixType?: {
34
+ type: ImagesType;
35
+ hoverType?: ImagesType | undefined;
36
+ activeType?: ImagesType | undefined;
37
+ } | undefined;
38
+ } & React.RefAttributes<HTMLSpanElement>>;
39
+ export default Icon;
@@ -0,0 +1,12 @@
1
+ import { InputNumberProps } from "antd/lib/input-number";
2
+ import React from "react";
3
+ import { AdditionOptions } from "../../spec";
4
+ export declare const AntdIntStyled: import("@linaria/react").StyledMeta & React.FunctionComponent<{
5
+ controls: boolean;
6
+ suffix?: string | undefined;
7
+ prefix?: string | undefined;
8
+ } & InputNumberProps & React.RefAttributes<unknown> & {
9
+ as?: React.ElementType<any> | undefined;
10
+ }>;
11
+ declare const InputInteger: React.FC<InputNumberProps & AdditionOptions>;
12
+ export default InputInteger;
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from "react";
2
+ import { Actions, KitRootState } from "../../store";
3
+ interface IProps {
4
+ }
5
+ declare const KitStoreProvider: (props: PropsWithChildren<IProps>) => JSX.Element;
6
+ export default KitStoreProvider;
7
+ export declare const useKitDispatch: () => import("redux").Dispatch<Actions>;
8
+ export declare const useKitSelector: <Selected extends unknown>(selector: (state: KitRootState) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Loading: React.FC;
3
+ export default Loading;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ declare const MetricActions: React.FC<{
3
+ info: {
4
+ current: string;
5
+ max: string;
6
+ };
7
+ dropdown?: React.ReactNode;
8
+ }>;
9
+ export default MetricActions;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { ILegend, IMetricData, IMetricStream } from "./type";
3
+ export declare const ColorBlock: React.FC<{
4
+ background?: string;
5
+ }>;
6
+ export declare type GetDeselectedValueWithSuffix = (type: string | undefined, data: IMetricData, metricName: string, sample_stream?: IMetricStream) => string;
7
+ export interface IMetricLegendProps {
8
+ streams: IMetricStream[];
9
+ metricName: string;
10
+ deselected: string[];
11
+ onClick: (id: string) => void;
12
+ legends: ILegend[];
13
+ }
14
+ declare const MetricLegend: (props: IMetricLegendProps) => JSX.Element;
15
+ export declare const LegendComponent: React.FC<ILegend>;
16
+ export default MetricLegend;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ declare const Pointer: React.FC<{
3
+ metricWidth: number | undefined;
4
+ uuid: string;
5
+ }>;
6
+ export default Pointer;
@@ -0,0 +1,41 @@
1
+ import React from "react";
2
+ import { TooltipProps } from "recharts";
3
+ import { NameType, Payload, ValueType } from "recharts/types/component/DefaultTooltipContent";
4
+ import { AxisDomain } from "recharts/types/util/types";
5
+ import { GraphType, IMetric } from "./type";
6
+ export interface IChartProps<TValue extends ValueType = string, TName extends NameType = number> {
7
+ metricName: string;
8
+ yAxisAlign?: "left" | "right";
9
+ showXAxis?: boolean;
10
+ showLegend?: boolean;
11
+ syncId: string;
12
+ height: number;
13
+ type: GraphType;
14
+ mode?: "simple" | "legend" | "single";
15
+ averageLine?: boolean;
16
+ dropdown?: React.ReactNode;
17
+ onLabelsChange?: (labels: string[]) => void;
18
+ metric: IMetric;
19
+ yAxisProps?: {
20
+ domain?: AxisDomain;
21
+ ticks?: (string | number)[];
22
+ tickFormatter?: (value: any, index: number) => string;
23
+ };
24
+ xAxisProps?: {
25
+ domain?: AxisDomain;
26
+ ticks?: (string | number)[];
27
+ tickFormatter?: (value: any, index: number) => string;
28
+ };
29
+ actionsProps?: {
30
+ show?: boolean;
31
+ info: {
32
+ current: string;
33
+ max: string;
34
+ };
35
+ };
36
+ tooltipProps: TooltipProps<TValue, TName> & {
37
+ format?: (payload: Payload<number, string>) => string;
38
+ };
39
+ }
40
+ declare const RenderChart: (props: IChartProps) => JSX.Element;
41
+ export default RenderChart;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { TooltipProps } from "recharts";
3
+ import { Payload } from "recharts/types/component/DefaultTooltipContent";
4
+ import { ILegend } from "./type";
5
+ declare const TooltipFormatter: React.FC<TooltipProps<number, string> & {
6
+ deselected: string[];
7
+ legends: ILegend[];
8
+ format: (payload: Payload<number, string>) => string;
9
+ }>;
10
+ export default TooltipFormatter;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { IChartProps } from "./RenderChart";
3
+ import { TimeUnit } from "./type";
4
+ export declare type MetricProps = {
5
+ height?: number;
6
+ showPointer?: boolean;
7
+ yAxisAlign?: "left" | "right";
8
+ showXaxis?: boolean;
9
+ showLegend?: boolean;
10
+ timeSpan?: {
11
+ span: number;
12
+ unit: TimeUnit;
13
+ } | string;
14
+ chartProps: Omit<IChartProps, "uuid">;
15
+ };
16
+ declare const Metric: (props: MetricProps) => JSX.Element;
17
+ export default Metric;
18
+ export * from "./metric";
19
+ export * from "./MetricActions";
20
+ export { default as MetricActions } from "./MetricActions";
21
+ export * from "./MetricLegend";
22
+ export { default as MetricLegend } from "./MetricLegend";
23
+ export * from "./Pointer";
24
+ export { default as Pointer } from "./Pointer";
25
+ export * from "./RenderChart";
26
+ export { default as RenderChart } from "./RenderChart";
27
+ export * from "./TooltipFormatter";
28
+ export { default as TooltipFormatter } from "./TooltipFormatter";
29
+ export * from "./type";
@@ -0,0 +1,43 @@
1
+ import { DateRange, IDataPoint, IMetric } from "./type";
2
+ export declare function filterPointsByDateRange(points: IDataPoint[], dateRange: DateRange): IDataPoint[];
3
+ export declare const parseRange: (range: string) => {
4
+ span: number;
5
+ unit: "h" | "d";
6
+ };
7
+ export declare const xaxisCal: (lastTime: number, dateRange: DateRange) => number[];
8
+ export declare const tickFormatter: (tick: number, dateRange: DateRange) => string;
9
+ export declare function getXAxisDomain(dateRange: DateRange, xaxisLastTime?: number): [number, number];
10
+ export declare const getMs: (dateRange: DateRange) => number;
11
+ export declare const getStep: (dateRange: DateRange) => number;
12
+ export declare const filterDataOverlapping: <Data extends {
13
+ t: number;
14
+ v?: number | undefined;
15
+ } = {
16
+ t: number;
17
+ v?: number | undefined;
18
+ }>(data: Data[], startTimestamp: number, length: number, step: number, tolerance: number) => (Data | {
19
+ t: number;
20
+ v: number;
21
+ })[];
22
+ export declare type MetricRefType = {
23
+ exportCSV: (filename: string) => void;
24
+ getCSVFileData: (filename?: string) => {
25
+ data: string;
26
+ filename: string;
27
+ filetype: string;
28
+ };
29
+ };
30
+ export declare const convertDataStruct: (streams: IDataPoint[][]) => IDataPoint[];
31
+ export declare const filterOverlappingMetric: (metric: IMetric, dateRange: DateRange) => {
32
+ sample_streams: {
33
+ points: (IDataPoint | {
34
+ t: number;
35
+ v: number;
36
+ })[];
37
+ legend: import("./type").ILegend;
38
+ step: number;
39
+ tolerance: number;
40
+ }[];
41
+ unit: string;
42
+ dropped: boolean;
43
+ };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export declare const MetricPlaceholderWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
3
+ as?: import("react").ElementType<any> | undefined;
4
+ }>;
5
+ export declare const MetricLegendTabStyle: import("@linaria/core").LinariaClassName;
6
+ export declare const LegendStyle: import("@linaria/core").LinariaClassName;
7
+ export declare const LegendItemStyle: import("@linaria/core").LinariaClassName;
8
+ export declare const ColorBlockStyle: import("@linaria/core").LinariaClassName;
9
+ export declare const ExtraResource: import("@linaria/core").LinariaClassName;
10
+ export declare const MetricWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }>;
13
+ export declare const TooltipWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
14
+ as?: import("react").ElementType<any> | undefined;
15
+ }>;
16
+ export declare const TooltipColumn: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
17
+ as?: import("react").ElementType<any> | undefined;
18
+ }>;
@@ -0,0 +1,39 @@
1
+ import { Dayjs } from "dayjs";
2
+ export interface IMetricData {
3
+ id: string;
4
+ }
5
+ export interface IDataPoint {
6
+ t: number;
7
+ v?: number;
8
+ [key: DataPointValueKey]: number | undefined;
9
+ }
10
+ declare type DataPointValueKey = `v${number}`;
11
+ export interface ILegend {
12
+ id: string;
13
+ name: string;
14
+ color?: string;
15
+ fill?: string;
16
+ stroke?: boolean;
17
+ }
18
+ export interface IMetricStream {
19
+ points: IDataPoint[];
20
+ legend: ILegend;
21
+ step: number;
22
+ tolerance: number;
23
+ }
24
+ export interface IMetric {
25
+ sample_streams: IMetricStream[];
26
+ unit: string;
27
+ dropped: boolean;
28
+ }
29
+ export declare enum TimeUnit {
30
+ Day = "DAY",
31
+ Hour = "HOUR",
32
+ Month = "MONTH"
33
+ }
34
+ export declare enum GraphType {
35
+ Area = "AREA",
36
+ Stack = "STACK"
37
+ }
38
+ export declare type DateRange = [Dayjs, Dayjs];
39
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ModalProps } from "../../spec";
3
+ declare const Modal: React.FC<ModalProps>;
4
+ export default Modal;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ interface ModalErrorType {
3
+ error: Error | string | React.ReactNode;
4
+ analyzeFallbackError: (fallback: unknown) => {
5
+ msg: string;
6
+ originalMsg: string;
7
+ } | null;
8
+ }
9
+ export declare const ModalContentError: React.FC<ModalErrorType>;
10
+ interface ModalFooterErrorType extends ModalErrorType {
11
+ className?: string;
12
+ }
13
+ export declare const ModalFooterError: React.FC<ModalFooterErrorType>;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { InitializedModalType } from "../../spec";
3
+ declare const InitializedModal: React.FC<InitializedModalType>;
4
+ export default InitializedModal;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { Modal2Props } from "../../spec";
3
+ declare const Modal: React.FC<Modal2Props & {
4
+ analyzeFallbackError: (fallback: unknown) => {
5
+ msg: string;
6
+ originalMsg: string;
7
+ } | null;
8
+ }>;
9
+ export default Modal;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { WizardModalType } from "../../spec";
3
+ declare const WizardModal: React.FC<WizardModalType>;
4
+ export default WizardModal;
@@ -0,0 +1,10 @@
1
+ import { Modal2Type } from "../../spec";
2
+ import InitializedModal from "./InitializedModal";
3
+ import WizardModal from "./WizardModal";
4
+ declare const Modal: Modal2Type;
5
+ export default Modal;
6
+ export { InitializedModal, Modal, WizardModal };
7
+ export * from "./Error";
8
+ export * from "./InitializedModal";
9
+ export * from "./Modal";
10
+ export * from "./WizardModal";
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ModalStack: React.FC;
3
+ export default ModalStack;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ declare const Overflow: React.FC<{
3
+ overflow: React.ReactNode;
4
+ offset?: number;
5
+ depend?: string;
6
+ }>;
7
+ export declare const ExtraOverflow: React.FC<{
8
+ extraEl: (sliceEnd: number) => React.ReactNode;
9
+ els: React.ReactNode[];
10
+ className?: string;
11
+ deps?: unknown[];
12
+ reverse?: boolean;
13
+ }>;
14
+ export default Overflow;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { PaginationProps } from "../../spec";
3
+ declare const Pagination: React.FC<PaginationProps>;
4
+ export default Pagination;