@cloudtower/eagle 0.22.35 → 0.22.38

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.
@@ -1,12 +1,10 @@
1
- import React, { PropsWithChildren, ReactNode } from "react";
1
+ import React, { PropsWithChildren } from "react";
2
+ import { BatchHelper } from "../components";
2
3
  import { Kit } from "../spec";
3
4
  interface IProps {
4
5
  kit?: Kit;
5
6
  message?: {
6
- batch?: (content: ReactNode) => {
7
- batchKey?: string;
8
- content: ReactNode;
9
- };
7
+ batch?: BatchHelper;
10
8
  };
11
9
  }
12
10
  export declare const kitContext: React.Context<Kit<any, HTMLElement>>;
@@ -4,7 +4,7 @@ declare const Button: React.ForwardRefExoticComponent<{
4
4
  hoverPrefixIcon?: JSX.Element | undefined;
5
5
  suffixIcon?: JSX.Element | undefined;
6
6
  hoverSuffixIcon?: JSX.Element | undefined;
7
- type?: "link" | "text" | "ghost" | "default" | "primary" | "dashed" | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet" | undefined;
7
+ type?: "link" | "text" | "default" | "primary" | "ghost" | "dashed" | "secondary" | "tertiary" | "ordinary" | "ordinary-onTint" | "quiet" | undefined;
8
8
  } & Omit<Partial<{
9
9
  href: string;
10
10
  target?: string | undefined;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { AddRowButtonProps } from "./types";
3
+ declare const AddRowButton: React.FC<AddRowButtonProps>;
4
+ export default AddRowButton;
@@ -1,3 +1,6 @@
1
1
  import React from "react";
2
2
  import { ColumnHeaderCellProps } from "../types";
3
- export declare const AffixColumnHeaderCell: React.FC<ColumnHeaderCellProps>;
3
+ export declare const AffixColumnHeaderCell: React.FC<Omit<ColumnHeaderCellProps, "onChange" | "onBlur"> & {
4
+ onChange: (value: unknown) => void;
5
+ onBlur: () => void;
6
+ }>;
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
2
  import { ColumnBodyCellProps } from "../types";
3
- export declare const CheckboxColumnBodyCell: React.FC<ColumnBodyCellProps>;
3
+ export declare const CheckboxColumnBodyCell: React.FC<Omit<ColumnBodyCellProps, "onChange"> & {
4
+ onChange: (value: unknown) => void;
5
+ }>;
@@ -1,4 +1,10 @@
1
1
  import React from "react";
2
2
  import { ColumnBodyCellProps, ColumnHeaderCellProps } from "../types";
3
- export declare const InputColumnHeaderCell: React.FC<ColumnHeaderCellProps>;
4
- export declare const InputColumnBodyCell: React.FC<ColumnBodyCellProps>;
3
+ export declare const InputColumnHeaderCell: React.FC<Omit<ColumnHeaderCellProps, "onChange" | "onBlur"> & {
4
+ onChange: (value: unknown) => void;
5
+ onBlur: () => void;
6
+ }>;
7
+ export declare const InputColumnBodyCell: React.FC<Omit<ColumnBodyCellProps, "onChange" | "onBlur"> & {
8
+ onChange: (value: unknown) => void;
9
+ onBlur: () => void;
10
+ }>;
@@ -1,15 +1,35 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ColumnHeaderImpls: {
3
3
  text: import("react").FC<import("../types").ColumnHeaderCellProps>;
4
- input: import("react").FC<import("../types").ColumnHeaderCellProps>;
5
- password: import("react").FC<import("../types").ColumnHeaderCellProps>;
6
- affix: import("react").FC<import("../types").ColumnHeaderCellProps>;
4
+ input: import("react").FC<Omit<import("../types").ColumnHeaderCellProps, "onChange" | "onBlur"> & {
5
+ onChange: (value: unknown) => void;
6
+ onBlur: () => void;
7
+ }>;
8
+ password: import("react").FC<Omit<import("../types").ColumnHeaderCellProps, "onChange" | "onBlur"> & {
9
+ onChange: (value: unknown) => void;
10
+ onBlur: () => void;
11
+ }>;
12
+ affix: import("react").FC<Omit<import("../types").ColumnHeaderCellProps, "onChange" | "onBlur"> & {
13
+ onChange: (value: unknown) => void;
14
+ onBlur: () => void;
15
+ }>;
7
16
  checkbox: import("react").FC<import("../types").ColumnHeaderCellProps>;
8
17
  };
9
18
  export declare const ColumnBodyImpls: {
10
19
  text: import("react").FC<import("../types").ColumnBodyCellProps>;
11
- input: import("react").FC<import("../types").ColumnBodyCellProps>;
12
- password: import("react").FC<import("../types").ColumnBodyCellProps>;
13
- affix: import("react").FC<import("../types").ColumnBodyCellProps>;
14
- checkbox: import("react").FC<import("../types").ColumnBodyCellProps>;
20
+ input: import("react").FC<Omit<import("../types").ColumnBodyCellProps, "onChange" | "onBlur"> & {
21
+ onChange: (value: unknown) => void;
22
+ onBlur: () => void;
23
+ }>;
24
+ password: import("react").FC<Omit<import("../types").ColumnBodyCellProps, "onChange" | "onBlur"> & {
25
+ onChange: (value: unknown) => void;
26
+ onBlur: () => void;
27
+ }>;
28
+ affix: import("react").FC<Omit<import("../types").ColumnBodyCellProps, "onChange" | "onBlur"> & {
29
+ onChange: (value: unknown) => void;
30
+ onBlur: () => void;
31
+ }>;
32
+ checkbox: import("react").FC<Omit<import("../types").ColumnBodyCellProps, "onChange"> & {
33
+ onChange: (value: unknown) => void;
34
+ }>;
15
35
  };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TableFormRowsProps } from "./types";
3
+ declare const TableFormBodyRows: React.FC<TableFormRowsProps>;
4
+ export default TableFormBodyRows;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,4 @@
1
1
  import React from "react";
2
- import { ErrorInfo, TableFormColumn } from "./types";
3
- type TableFormProps = {
4
- defaultData: any[];
5
- columns: TableFormColumn[];
6
- rowCount?: number;
7
- errorInfo?: ErrorInfo;
8
- disabled?: boolean;
9
- onHeaderChange?: (data: unknown[]) => void;
10
- onHeaderBlur?: (data: unknown[]) => void;
11
- onBodyChange?: (value: unknown[], path: string) => void;
12
- onBodyBlur?: (value: unknown, path: string) => void;
13
- };
14
- export type TableFormHandle = {
15
- setData: (data: Record<string, any>[]) => void;
16
- };
2
+ import { TableFormHandle, TableFormProps } from "./types";
17
3
  declare const TableForm: React.ForwardRefExoticComponent<TableFormProps & React.RefAttributes<TableFormHandle>>;
18
4
  export default TableForm;
@@ -1,9 +1,17 @@
1
- export declare const BatchInputListBodyItemStyle: import("@linaria/core").LinariaClassName;
2
- export declare const BatchInputListHeaderItemStyle: import("@linaria/core").LinariaClassName;
3
- export declare const BatchInputListBodyCellStyle: import("@linaria/core").LinariaClassName;
4
- export declare const BatchInputListHeaderCellStyle: import("@linaria/core").LinariaClassName;
1
+ /// <reference types="react" />
5
2
  export declare const TitleStyle: import("@linaria/core").LinariaClassName;
6
3
  export declare const SubtitleStyle: import("@linaria/core").LinariaClassName;
7
4
  export declare const BodyCellTextStyle: import("@linaria/core").LinariaClassName;
8
5
  export declare const BodyCellIconStyle: import("@linaria/core").LinariaClassName;
9
- export declare const CheckboxStyle: import("@linaria/core").LinariaClassName;
6
+ export declare const BodyCellTextWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
7
+ as?: import("react").ElementType<any> | undefined;
8
+ }>;
9
+ export declare const TableFormWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
10
+ as?: import("react").ElementType<any> | undefined;
11
+ }>;
12
+ export declare const AddRowButtonWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
13
+ as?: import("react").ElementType<any> | undefined;
14
+ }>;
15
+ export declare const DraggableHandleWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }>;
@@ -1,10 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "src/spec";
1
3
  import { ColumnBodyImpls } from "./Columns";
2
4
  export type ErrorInfo = Record<string, {
3
5
  errorMessage: string;
4
6
  isError: boolean;
5
7
  }>;
8
+ export type CustomizedColumnRenderProps = {
9
+ value?: unknown;
10
+ rowIndex?: number;
11
+ onChange: (value: unknown) => void;
12
+ disabled?: boolean;
13
+ onBlur?: () => void;
14
+ placeholder?: string;
15
+ isHeader: boolean;
16
+ };
6
17
  export type TableFormColumn = {
7
- type: keyof typeof ColumnBodyImpls;
18
+ type?: keyof typeof ColumnBodyImpls;
8
19
  title?: string;
9
20
  key: string;
10
21
  subTitle?: string;
@@ -19,31 +30,87 @@ export type TableFormColumn = {
19
30
  autoIncrease?: boolean;
20
31
  disablePrefix?: boolean;
21
32
  disableSuffix?: boolean;
22
- headerValidator?: (value: any) => string;
23
33
  customData?: any;
34
+ align?: "left" | "right" | "center";
35
+ renderDescription?: (props: RenderRowDescriptionProps) => React.ReactNode;
36
+ render?: (props: CustomizedColumnRenderProps) => React.ReactNode;
37
+ validator?: (params: {
38
+ value: unknown;
39
+ rowIndex?: number;
40
+ rowData?: DataType;
41
+ isHeader?: boolean;
42
+ }) => string | undefined;
24
43
  };
25
44
  export interface ColumnHeaderCellProps {
26
- data: Record<string, any>[];
27
- latestData: Record<string, any>[];
45
+ data: DataType[];
46
+ latestData: DataType[];
28
47
  column: TableFormColumn;
29
48
  disabled?: boolean;
30
- errorInfo: ErrorInfo;
31
- onChange?: (newData: Record<string, any>[], key: string) => void;
49
+ disableBatchFilling?: boolean;
50
+ onChange?: (newData: DataType[], columnKey?: string) => void;
32
51
  onBlur?: (key: string, error?: string) => void;
33
52
  onVisibleChange?: (visible: boolean) => void;
34
53
  }
54
+ export type DataType = {
55
+ [columnKey: string]: any;
56
+ deletable?: boolean;
57
+ };
35
58
  export interface ColumnBodyCellProps {
36
- data: Record<string, any>[];
37
- latestData: Record<string, any>[];
38
- defaultData: Record<string, any>[];
39
- errorInfo: ColumnHeaderCellProps["errorInfo"];
59
+ data: DataType[];
60
+ latestData: DataType[];
40
61
  index: number;
41
62
  column: TableFormColumn;
42
63
  disabled?: boolean;
43
- onChange?: (newData: Record<string, any>[], path: string) => void;
44
- onBlur?: (newData: Record<string, any>[], path: string) => void;
45
- onClear?: (newData: Record<string, any>[], path: string) => void;
64
+ onChange?: (newData: DataType[], rowIndex?: number, columnKey?: string) => void;
65
+ onBlur?: (newData: DataType[], rowIndex?: number, columnKey?: string) => void;
46
66
  customData?: any;
47
67
  placeholderValue?: string;
48
68
  visible?: boolean;
69
+ isRowError?: boolean;
49
70
  }
71
+ export type AddRowButtonProps = {
72
+ config: RowAddConfigurations;
73
+ columns: TableFormColumn[];
74
+ updateData: (data: DataType[]) => void;
75
+ data: DataType[];
76
+ };
77
+ export type RowAddConfigurations = {
78
+ addible: boolean;
79
+ text?: (() => React.ReactNode) | string;
80
+ buttonProps?: ButtonProps;
81
+ maximum?: number;
82
+ className?: string;
83
+ CustomizedButton?: (props: AddRowButtonProps) => React.ReactElement;
84
+ };
85
+ export interface TableFormRowsProps extends Pick<TableFormProps, "columns" | "disabled" | "deletable" | "draggable" | "disableBatchFilling" | "rowSplitType" | "renderRowDescription" | "rowValidator" | "onBodyBlur"> {
86
+ data: DataType[];
87
+ latestData: DataType[];
88
+ updateData: (data: DataType[]) => void;
89
+ passwordVisible: boolean;
90
+ }
91
+ export type RenderRowDescriptionProps = {
92
+ rowIndex: number;
93
+ rowData: DataType;
94
+ latestData?: DataType[];
95
+ };
96
+ export type TableFormProps = {
97
+ defaultData?: DataType[];
98
+ columns: TableFormColumn[];
99
+ disabled?: boolean;
100
+ rowAddConfig?: RowAddConfigurations;
101
+ deletable?: boolean;
102
+ size?: "default" | "large" | "small";
103
+ draggable?: boolean;
104
+ disableBatchFilling?: boolean;
105
+ className?: string;
106
+ rowSplitType?: "border" | "zebraMarking";
107
+ renderRowDescription?: (props: RenderRowDescriptionProps) => React.ReactNode;
108
+ rowValidator?: (rowIndex: number, rowData: DataType) => string | undefined;
109
+ onHeaderChange?: (data: unknown[], columnKey: string) => void;
110
+ onHeaderBlur?: (data: unknown[]) => void;
111
+ onBodyChange?: (value: DataType[], rowIndex?: number, columnKey?: string) => void;
112
+ onBodyBlur?: (value: DataType, rowIndex?: number, columnKey?: string) => void;
113
+ };
114
+ export type TableFormHandle = {
115
+ setData: (data: DataType[]) => void;
116
+ };
@@ -1 +1,4 @@
1
+ import { TableFormColumn } from "./types";
1
2
  export declare function increaseLastNumber(str: string, num: number): string;
3
+ export declare const genEmptyRow: (columns: TableFormColumn[]) => Record<string, any>;
4
+ export declare const moveItemInArray: <T>(array: T[], fromIndex: number, toIndex: number) => T[];
@@ -2,6 +2,10 @@ import { message } from "antd";
2
2
  import { ArgsProps } from "antd/lib/message";
3
3
  import { ReactNode } from "react";
4
4
  export declare function makeUUID(length?: number): string;
5
+ export type BatchHelper = {
6
+ getBatchKey: (content: ReactNode) => string | undefined;
7
+ getBatchContent: (batchKey: string, count: number) => ReactNode;
8
+ };
5
9
  type KeyedArgsProps = ArgsProps & {
6
10
  key: string;
7
11
  };
@@ -11,15 +15,9 @@ export declare class Batcher {
11
15
  private scheduler;
12
16
  private originalMethod;
13
17
  private batchHelper;
14
- constructor(originalMethod: typeof message["success"], batchHelper: (content: ReactNode) => {
15
- batchKey?: string;
16
- content: ReactNode;
17
- });
18
+ constructor(originalMethod: typeof message["success"], batchHelper: BatchHelper);
18
19
  addMessage(originContent: KeyedArgsProps): void;
19
20
  private applyContent;
20
21
  }
21
- export declare function createBatchMessageMethods(batchHelper?: (content: ReactNode) => {
22
- batchKey?: string;
23
- content: ReactNode;
24
- }): typeof message;
22
+ export declare function createBatchMessageMethods(batchHelper?: BatchHelper): typeof message;
25
23
  export {};