cygx-ui 1.0.1

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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -0
  3. package/dist/components/Button/button.d.ts +7 -0
  4. package/dist/components/Button/index.d.ts +2 -0
  5. package/dist/components/Button copy/button.d.ts +27 -0
  6. package/dist/components/Button copy/index.d.ts +2 -0
  7. package/dist/components/Card/card.d.ts +10 -0
  8. package/dist/components/Card/index.d.ts +2 -0
  9. package/dist/components/Container/container.d.ts +9 -0
  10. package/dist/components/Container/index.d.ts +2 -0
  11. package/dist/components/CygxPopover/cygxPopover.d.ts +13 -0
  12. package/dist/components/CygxPopover/index.d.ts +2 -0
  13. package/dist/components/DatePicker/datePicker.d.ts +37 -0
  14. package/dist/components/DatePicker/index.d.ts +2 -0
  15. package/dist/components/Form/form.d.ts +16 -0
  16. package/dist/components/Form/formItem.d.ts +16 -0
  17. package/dist/components/Form/index.d.ts +2 -0
  18. package/dist/components/Form/searchLeft.d.ts +8 -0
  19. package/dist/components/Form/searchRight.d.ts +24 -0
  20. package/dist/components/FormList/FormItem.d.ts +9 -0
  21. package/dist/components/FormList/FormList.d.ts +13 -0
  22. package/dist/components/HoverWindow/hoverWindow.d.ts +12 -0
  23. package/dist/components/HoverWindow/index.d.ts +2 -0
  24. package/dist/components/Input/index.d.ts +2 -0
  25. package/dist/components/Input/input.d.ts +14 -0
  26. package/dist/components/Province/index.d.ts +2 -0
  27. package/dist/components/Province/province.d.ts +20 -0
  28. package/dist/components/QuickQuery/index.d.ts +2 -0
  29. package/dist/components/QuickQuery/quickQuery.d.ts +17 -0
  30. package/dist/components/Select/index.d.ts +8 -0
  31. package/dist/components/Select/option.d.ts +13 -0
  32. package/dist/components/Select/select.d.ts +20 -0
  33. package/dist/components/Table/ResizableTable.d.ts +9 -0
  34. package/dist/components/Table/components/Empty.d.ts +13 -0
  35. package/dist/components/Table/components/row.d.ts +3 -0
  36. package/dist/components/Table/hooks/index.d.ts +7 -0
  37. package/dist/components/Table/hooks/useMoveRow.d.ts +7 -0
  38. package/dist/components/Table/index.d.ts +12 -0
  39. package/dist/components/Table/table.d.ts +73 -0
  40. package/dist/components/Table/tableColumns.d.ts +11 -0
  41. package/dist/components/Table/tableSummary.d.ts +28 -0
  42. package/dist/components/Table/utils/common.d.ts +15 -0
  43. package/dist/hooks/useAuthority.d.ts +2 -0
  44. package/dist/hooks/useClickOutside.d.ts +3 -0
  45. package/dist/hooks/useDebounce.d.ts +2 -0
  46. package/dist/hooks/useRequest.d.ts +11 -0
  47. package/dist/hooks/useWaterMark.d.ts +17 -0
  48. package/dist/index.css +578 -0
  49. package/dist/index.d.ts +24 -0
  50. package/dist/index.es.js +121345 -0
  51. package/dist/index.umd.js +66 -0
  52. package/dist/utils/timeTransForm.d.ts +14 -0
  53. package/package.json +139 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Liu ChenYue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ ## cygxui component library
2
+
3
+ ## 使用 React+typescript+antd 二次封装扩展 antd 组件库
4
+
5
+ 组件库 git 地址:https://github.com/liucy0321/cygxui.git
6
+
7
+ cygxui 是为创远智能公司的系统打造的一套业务流程组件库,使用 React Hooks 和 typescript 二次封装 antd 组件库
8
+ ,贴合业务代码与功能,根据业务自定义扩展组件功能。
9
+
10
+ ### 安装最后已经发布的组件库来试试
11
+
12
+ ```javascript
13
+ npm install cygxui --save
14
+ ```
15
+
16
+ ### 使用
17
+
18
+ ```javascript
19
+ // 加载样式
20
+ import 'cygxui/dist/index.css';
21
+ // 引入组件
22
+ import { Button } from 'cygxui';
23
+ ```
24
+
25
+ ### 一些本地开发命令
26
+
27
+ ```bash
28
+ //启动本地环境
29
+ npm run stroybook
30
+
31
+ //跑单元测试
32
+ npm test
33
+
34
+ //build可发布静态文件
35
+ npm run build
36
+
37
+ //发布到 npm
38
+ npm run publish
39
+ ```
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { ButtonProps } from "antd";
3
+ interface IButtonProps {
4
+ ifAntBtn?: boolean;
5
+ }
6
+ export declare const Button: FC<IButtonProps & ButtonProps>;
7
+ export default Button;
@@ -0,0 +1,2 @@
1
+ import Button from './button';
2
+ export default Button;
@@ -0,0 +1,27 @@
1
+ import React, { FC, ButtonHTMLAttributes, AnchorHTMLAttributes } from "react";
2
+ export type ButtonSize = "lg" | "sm";
3
+ export type ButtonType = "primary" | "default" | "danger" | "link";
4
+ interface BaseButtonProps {
5
+ className?: string;
6
+ /**设置 Button 的禁用 */
7
+ disabled?: boolean;
8
+ /**设置 Button 的尺寸 */
9
+ size?: ButtonSize;
10
+ /**设置 Button 的类型 */
11
+ btnType?: ButtonType;
12
+ children: React.ReactNode;
13
+ href?: string;
14
+ }
15
+ type NativeButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLElement>;
16
+ type AnchorButtonProps = BaseButtonProps & AnchorHTMLAttributes<HTMLElement>;
17
+ export type ButtonProps = Partial<NativeButtonProps & AnchorButtonProps>;
18
+ /**
19
+ * 页面中最常用的的按钮元素,适合于完成特定的交互,支持 HTML button 和 a 链接 的所有属性
20
+ * ### 引用方法
21
+ *
22
+ * ```javascript
23
+ * import { Button } from 'vikingship'
24
+ * ```
25
+ */
26
+ export declare const Button: FC<ButtonProps>;
27
+ export default Button;
@@ -0,0 +1,2 @@
1
+ import Button from './button';
2
+ export default Button;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { CardProps } from "antd";
3
+ interface ICardProps {
4
+ title?: string;
5
+ extraTitle?: any;
6
+ className?: string;
7
+ children?: any;
8
+ }
9
+ export declare const Card: FC<ICardProps & CardProps>;
10
+ export default Card;
@@ -0,0 +1,2 @@
1
+ import Card from "./card";
2
+ export default Card;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ interface IContainerProps {
3
+ loading?: boolean;
4
+ className?: string;
5
+ children?: any;
6
+ noFooter?: boolean;
7
+ }
8
+ export declare const Container: FC<IContainerProps>;
9
+ export default Container;
@@ -0,0 +1,2 @@
1
+ import Container from "./container";
2
+ export default Container;
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { PopoverProps } from 'antd';
3
+ interface IHoverWindowProps {
4
+ className?: string;
5
+ height?: any;
6
+ children?: any;
7
+ width?: number;
8
+ visible: boolean;
9
+ setVisible: any;
10
+ content: any;
11
+ }
12
+ export declare const CygxPopover: FC<IHoverWindowProps & PopoverProps>;
13
+ export default CygxPopover;
@@ -0,0 +1,2 @@
1
+ import CygxPopover from './cygxPopover';
2
+ export default CygxPopover;
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { Dayjs } from "dayjs";
3
+ declare const DatePicker: (<ValueType = Dayjs, IsMultiple extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, ValueType, IsMultiple>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
4
+ displayName?: string | undefined;
5
+ } & {
6
+ displayName?: string | undefined;
7
+ WeekPicker: (<ValueType_1 = Dayjs, IsMultiple_1 extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_1, IsMultiple_1>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
8
+ displayName?: string | undefined;
9
+ };
10
+ MonthPicker: (<ValueType_2 = Dayjs, IsMultiple_2 extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_2, IsMultiple_2>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
11
+ displayName?: string | undefined;
12
+ };
13
+ YearPicker: (<ValueType_3 = Dayjs, IsMultiple_3 extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_3, IsMultiple_3>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
14
+ displayName?: string | undefined;
15
+ };
16
+ RangePicker: import("react").ForwardRefExoticComponent<Omit<import("@rc-component/picker").RangePickerProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "classNames" | "styles"> & {
17
+ locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
18
+ size?: import("antd/es/button").ButtonSize;
19
+ placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
20
+ bordered?: boolean | undefined;
21
+ status?: "" | "warning" | "error" | "success" | "validating" | undefined;
22
+ variant?: "outlined" | "borderless" | "filled" | "underlined" | undefined;
23
+ dropdownClassName?: string | undefined;
24
+ popupClassName?: string | undefined;
25
+ rootClassName?: string | undefined;
26
+ popupStyle?: import("react").CSSProperties | undefined;
27
+ classNames?: import("antd/es/date-picker/generatePicker/interface").DatePickerPickerClassNames<import("@rc-component/picker").RangePickerProps<Dayjs>> | undefined;
28
+ styles?: import("antd/es/date-picker/generatePicker/interface").DatePickerStylesType<import("@rc-component/picker").RangePickerProps<Dayjs>> | undefined;
29
+ } & import("react").RefAttributes<import("@rc-component/picker").PickerRef>>;
30
+ TimePicker: (<ValueType_4 = Dayjs, IsMultiple_4 extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker/interface").GenericTimePickerProps<Dayjs>, "picker">, ValueType_4, IsMultiple_4>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
31
+ displayName?: string | undefined;
32
+ };
33
+ QuarterPicker: (<ValueType_5 = Dayjs, IsMultiple_5 extends boolean = false>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_5, IsMultiple_5>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
34
+ displayName?: string | undefined;
35
+ };
36
+ };
37
+ export default DatePicker;
@@ -0,0 +1,2 @@
1
+ import DatePicker from "./datePicker";
2
+ export default DatePicker;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export declare const validateStowage: (form: any) => any;
3
+ declare function Form(props: any): React.JSX.Element;
4
+ declare namespace Form {
5
+ var Item: React.FC<import("./formItem").IFormItemProps>;
6
+ var SearchLeft: React.FC<import("./searchLeft").ISearchLeftItem>;
7
+ var SearchRight: React.FC<import("./searchRight").ISearchRightItem>;
8
+ var List: React.FC<import("antd/es/form").FormListProps>;
9
+ var ErrorList: React.FC<import("antd/es/form").ErrorListProps>;
10
+ var useForm: typeof import("antd/es/form/Form").useForm;
11
+ var Provider: React.FC<import("antd/lib/form/context").FormProviderProps>;
12
+ var defaultProps: {
13
+ name: string;
14
+ };
15
+ }
16
+ export default Form;
@@ -0,0 +1,16 @@
1
+ import { FC } from "react";
2
+ import { FormItemProps as AntFormItemProps } from "antd";
3
+ interface IFormItem {
4
+ width?: "half" | "quarter" | "threeQuarter" | "all" | "double" | "halfAll" | "normal";
5
+ /**小边框 */
6
+ littleBorder?: boolean;
7
+ /**没有label */
8
+ noLabel?: boolean;
9
+ /**没有边框 */
10
+ noBorder?: boolean;
11
+ /**是否禁用 */
12
+ disabled?: boolean;
13
+ }
14
+ export type IFormItemProps = AntFormItemProps & IFormItem;
15
+ export declare const FormItem: FC<IFormItemProps>;
16
+ export default FormItem;
@@ -0,0 +1,2 @@
1
+ import Form from "./form";
2
+ export default Form;
@@ -0,0 +1,8 @@
1
+ import { ReactNode, FC } from "react";
2
+ export interface ISearchLeftItem {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ style?: any;
6
+ }
7
+ export declare const SearchLeft: FC<ISearchLeftItem>;
8
+ export default SearchLeft;
@@ -0,0 +1,24 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface IOtherBtnProps {
3
+ icon?: ReactNode;
4
+ name?: string;
5
+ onClick?: any;
6
+ }
7
+ export interface ISearchRightItem {
8
+ /**查询回调 */
9
+ onSearchHandle?: any;
10
+ /**重置回调 */
11
+ onResetHandle?: any;
12
+ /**自定义按钮 */
13
+ children?: ReactNode;
14
+ /**按钮禁用权限 */
15
+ disBtnRoutes?: string[];
16
+ /**隐藏默认按钮 */
17
+ showDefBtn?: boolean;
18
+ /**添加的额外btn */
19
+ otherBtn?: IOtherBtnProps[];
20
+ className?: string;
21
+ style?: any;
22
+ }
23
+ export declare const SearchRight: FC<ISearchRightItem>;
24
+ export default SearchRight;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { DescriptionsItemProps as AntDescriptionsItemProps } from "antd/lib/descriptions/Item";
3
+ interface IPropsItem {
4
+ span?: number;
5
+ titleSpan?: number;
6
+ }
7
+ export type IProps = AntDescriptionsItemProps & IPropsItem;
8
+ export declare const FormItem: FC<IProps>;
9
+ export default FormItem;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { DescriptionsProps } from "antd";
3
+ import "../../style.scss";
4
+ /**
5
+ * 表单传入参数类型定义
6
+ */
7
+ interface IDescProps {
8
+ }
9
+ declare function FormList(props: IDescProps & DescriptionsProps): React.JSX.Element;
10
+ declare namespace FormList {
11
+ var FormItem: React.FC<import("./FormItem").IProps>;
12
+ }
13
+ export default FormList;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ interface IHoverWindowProps {
3
+ title?: string;
4
+ className?: string;
5
+ height?: any;
6
+ children?: any;
7
+ width?: number;
8
+ visible: boolean;
9
+ setVisible: any;
10
+ }
11
+ export declare const HoverWindow: FC<IHoverWindowProps>;
12
+ export default HoverWindow;
@@ -0,0 +1,2 @@
1
+ import HoverWindow from "./hoverWindow";
2
+ export default HoverWindow;
@@ -0,0 +1,2 @@
1
+ import Input from './input';
2
+ export default Input;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { InputProps } from "antd";
3
+ interface IProps extends InputProps {
4
+ [propName: string]: any;
5
+ value?: string;
6
+ }
7
+ export declare const Input: {
8
+ ({ value, onChange, onInput, onCompositionStart, onCompositionEnd, className, ...resetProps }: IProps): React.JSX.Element;
9
+ TextArea: React.ForwardRefExoticComponent<import("antd/es/input").TextAreaProps & React.RefAttributes<import("antd/es/input/TextArea").TextAreaRef>>;
10
+ Password: ({ value, onChange, onInput, onCompositionStart, onCompositionEnd, className, ...resetProps }: IProps) => React.JSX.Element;
11
+ Search: ({ value, onChange, onInput, onCompositionStart, onCompositionEnd, className, ...resetProps }: IProps) => React.JSX.Element;
12
+ Group: React.FC<import("antd/es/input").GroupProps>;
13
+ };
14
+ export default Input;
@@ -0,0 +1,2 @@
1
+ import Province from "./province";
2
+ export default Province;
@@ -0,0 +1,20 @@
1
+ import { FC } from 'react';
2
+ import { CascaderProps } from 'antd';
3
+ /**
4
+ * Input 输入框 通过鼠标或键盘输入内容,是最基础的表单域的包装。
5
+ *
6
+ * 默认添加autoComplete="off"和allowClear
7
+ *
8
+ * ~~~js
9
+ * // 这样引用
10
+ * import { Province } from 'cygxui'
11
+ * ~~~
12
+ *
13
+ */
14
+ interface IProvince {
15
+ visible?: boolean;
16
+ callback?: (val: any) => void;
17
+ notDefault?: boolean;
18
+ }
19
+ export declare const Province: FC<IProvince & CascaderProps<any>>;
20
+ export default Province;
@@ -0,0 +1,2 @@
1
+ import QuickQuery from "./quickQuery";
2
+ export default QuickQuery;
@@ -0,0 +1,17 @@
1
+ import { FC } from "react";
2
+ import { DrawerProps } from "antd";
3
+ interface IQuickQueryProps {
4
+ topNode?: any;
5
+ className?: string;
6
+ height?: any;
7
+ children?: any;
8
+ width?: number;
9
+ drawerData?: any;
10
+ onClickByTopNow?: () => void;
11
+ visible?: boolean;
12
+ drawerTitle?: string;
13
+ minHeight?: number;
14
+ hideRight?: boolean;
15
+ }
16
+ export declare const QuickQuery: FC<IQuickQueryProps & DrawerProps>;
17
+ export default QuickQuery;
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { SelectProps } from "./select";
3
+ import { SelectOptionProps } from "./option";
4
+ export type ISelectComponent = FC<SelectProps> & {
5
+ Option: FC<SelectOptionProps>;
6
+ };
7
+ declare const TransSelect: ISelectComponent;
8
+ export default TransSelect;
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode } from "react";
2
+ export interface SelectOptionProps {
3
+ index?: string;
4
+ /** 默认根据此属性值进行筛选,该值不能相同*/
5
+ value: string;
6
+ /** 选项的标签,若不设置则默认与 value 相同*/
7
+ label?: string;
8
+ /** 是否禁用该选项*/
9
+ disabled?: boolean;
10
+ children?: ReactNode;
11
+ }
12
+ export declare const Option: FC<SelectOptionProps>;
13
+ export default Option;
@@ -0,0 +1,20 @@
1
+ import { FC } from 'react';
2
+ import { SelectProps as AntSelectProps } from 'antd';
3
+ export interface ISelectContext {
4
+ onSelect?: (value: string, isSelected?: boolean) => void;
5
+ selectedValues: string[];
6
+ multiple?: boolean;
7
+ }
8
+ export type SelectProps = AntSelectProps;
9
+ /**
10
+ * 下拉选择器。
11
+ * 弹出一个下拉菜单给用户选择操作,用于代替原生的选择器,或者需要一个更优雅的多选器时。
12
+ * ### 引用方法
13
+ *
14
+ * ~~~js
15
+ * import { Select } from 'cygxui'
16
+ * // 然后可以使用 <Select> 和 <Select.Option>
17
+ * ~~~
18
+ */
19
+ export declare const Select: FC<SelectProps>;
20
+ export default Select;
@@ -0,0 +1,9 @@
1
+ import { IProps } from "./table";
2
+ import React from "react";
3
+ /**
4
+ * 可伸缩列
5
+ * @param props
6
+ * @returns
7
+ */
8
+ declare const ResizableTable: (props: IProps<any>) => React.JSX.Element;
9
+ export default ResizableTable;
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps as AntButtonProps } from 'antd';
3
+ export type ButtonProps = AntButtonProps;
4
+ /**
5
+ * 页面中最常用的的按钮元素,适合于完成特定的交互,支持 HTML button 和 a 链接 的所有属性
6
+ * ### 引用方法
7
+ *
8
+ * ```javascript
9
+ * import { Button } from 'cygxui'
10
+ * ```
11
+ */
12
+ export declare const Empty: FC<ButtonProps>;
13
+ export default Empty;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { DraggableBodyRowProps } from "../table";
3
+ export declare const DraggableBodyRow: (props: DraggableBodyRowProps) => React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @desc 自定义hook钩子函数
3
+ * 必须用use开头
4
+ * React hook钩子函数必须在React函数组件或自定义hook钩子函数中调用。
5
+ */
6
+ import useMoveRow from "./useMoveRow";
7
+ export { useMoveRow };
@@ -0,0 +1,7 @@
1
+ declare const useMoveRow: ({ rowKey, parentChildSign, dataSource, onMoveRow }: {
2
+ rowKey: any;
3
+ parentChildSign: any;
4
+ dataSource: any;
5
+ onMoveRow: any;
6
+ }) => (props: any) => void;
7
+ export default useMoveRow;
@@ -0,0 +1,12 @@
1
+ import Table from "./table";
2
+ import { Table as AntTable } from "antd";
3
+ export declare type ITableComponent = typeof Table & {
4
+ SELECTION_ALL: typeof AntTable.SELECTION_ALL;
5
+ SELECTION_INVERT: typeof AntTable.SELECTION_INVERT;
6
+ SELECTION_NONE: typeof AntTable.SELECTION_NONE;
7
+ Column: typeof AntTable.Column;
8
+ ColumnGroup: typeof AntTable.ColumnGroup;
9
+ Summary: typeof AntTable.Summary;
10
+ DiffClassName: string;
11
+ };
12
+ export default Table;
@@ -0,0 +1,73 @@
1
+ import React, { FC } from "react";
2
+ import { TableProps } from "antd";
3
+ import { ColumnType } from "antd/lib/table";
4
+ import type { ISummaryConfig } from "./tableSummary";
5
+ export interface ISelectContext {
6
+ onSelect?: (value: string, isSelected?: boolean) => void;
7
+ selectedValues: string[];
8
+ multiple?: boolean;
9
+ }
10
+ export interface IColumnType<RecordType> extends ColumnType<RecordType> {
11
+ /**是否隐藏该列 */
12
+ hideColumn?: boolean;
13
+ /**是否增加必填title */
14
+ required?: boolean;
15
+ /**数字小数位 */
16
+ toFixedNum?: number;
17
+ /**数字千分位 */
18
+ thousandth?: boolean;
19
+ /**是否层级 */
20
+ ifShowIndent?: boolean;
21
+ }
22
+ export interface IColumnGroupType<RecordType> extends Omit<IColumnType<RecordType>, ""> {
23
+ children: ColumnsType<RecordType>;
24
+ }
25
+ export declare type ColumnsTypeProp<RecordType> = IColumnGroupType<RecordType> | IColumnType<RecordType>;
26
+ export declare type ColumnsType<RecordType> = ColumnsTypeProp<RecordType>[];
27
+ export interface IProps<RecordType> extends Omit<TableProps<RecordType>, "columns"> {
28
+ /**新增行删除行方法 */
29
+ onAddAndDelHandle?: (type: "add" | "del", index: number, record?: any) => void | null;
30
+ /**隐藏新增icon */
31
+ hideAddIcon?: boolean;
32
+ /**隐藏删除icon */
33
+ hideDelIcon?: boolean;
34
+ /**是否显示动态表头配置 */
35
+ columnsRender?: any;
36
+ /**表格刷新 */
37
+ onReload?: () => void;
38
+ /**表格Code */
39
+ tableCode?: string;
40
+ /**是否显示小计或总计 */
41
+ summaryConfig?: ISummaryConfig[];
42
+ /**小计总计固定 */
43
+ summaryFixed?: boolean;
44
+ /**父id标识 */
45
+ parentChildSign?: string[];
46
+ /**表格列拖拽 */
47
+ ifColumnDrag?: boolean;
48
+ /**表格行拖拽 */
49
+ onMoveRow?: (data: any, dragParentIndex?: any, operateType?: string) => void;
50
+ /**表格列编辑事件 */
51
+ onEditableSave?: (record: RecordType, index: number | undefined, dataIndex: string) => void;
52
+ /**表格动态列配置事件 */
53
+ onDynamicChange?: (dynamicColumns: ColumnsType<RecordType>) => void;
54
+ columns?: ColumnsType<RecordType>;
55
+ dataSource?: any[];
56
+ className?: string;
57
+ /**树形层级level名称 */
58
+ indentTitle?: string;
59
+ /**按钮权限 */
60
+ btnAuth?: any;
61
+ /**序号宽度 */
62
+ orderWidth?: number;
63
+ }
64
+ export interface DraggableBodyRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
65
+ index: number;
66
+ record: any;
67
+ data: any;
68
+ moveRow: (opt: any) => void;
69
+ findRow: any;
70
+ parentchildsign?: any;
71
+ }
72
+ export declare const Table: FC<IProps<any>>;
73
+ export default Table;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ export interface IColumnsProps {
3
+ open?: boolean;
4
+ onClose: () => void;
5
+ dynamicData: any;
6
+ setDynamicData: any;
7
+ tableCode?: string;
8
+ onReload?: () => void;
9
+ }
10
+ export declare const TableColumns: FC<IColumnsProps>;
11
+ export default TableColumns;
@@ -0,0 +1,28 @@
1
+ import { FC } from "react";
2
+ import { ColumnsType } from "antd/lib/table";
3
+ export interface ISelectContext {
4
+ onSelect?: (value: string, isSelected?: boolean) => void;
5
+ selectedValues: string[];
6
+ multiple?: boolean;
7
+ }
8
+ export interface IFields {
9
+ toFixedNum?: number;
10
+ key: string;
11
+ value?: string | number;
12
+ fn?: (num: string | number) => any;
13
+ }
14
+ export interface ISummaryConfig {
15
+ type: "average" | "total";
16
+ fields: IFields[];
17
+ title?: string;
18
+ onClickHandle?: any;
19
+ [prop: string]: any;
20
+ }
21
+ export interface ISumTableProps {
22
+ summaryConfig?: ISummaryConfig[];
23
+ columns: ColumnsType<any> | undefined;
24
+ rowSelection: any;
25
+ dataSource: any;
26
+ }
27
+ export declare const TableSummary: FC<ISumTableProps>;
28
+ export default TableSummary;
@@ -0,0 +1,15 @@
1
+ export declare const ItemTypes = "DraggableBodyRow";
2
+ export declare const optionsTyps: {
3
+ didDrop: string;
4
+ hover: string;
5
+ drop: string;
6
+ };
7
+ export declare function clone(data: any): any;
8
+ export declare function isNull(str: any): boolean;
9
+ export declare function thousandth(num: any): any;
10
+ export declare const getParam: (data: any, dragId: any, dropId: any, childSign: any) => any;
11
+ export declare const findFromData: (data: any, id: any, childSign: any) => {
12
+ row: any;
13
+ index: any;
14
+ parentIndex: any;
15
+ };
@@ -0,0 +1,2 @@
1
+ export declare function getToken(): string | null;
2
+ export declare function setToken(val: any): void;
@@ -0,0 +1,3 @@
1
+ import { RefObject } from "react";
2
+ declare function useClickOutside(ref: RefObject<HTMLElement>, handler: Function): void;
3
+ export default useClickOutside;
@@ -0,0 +1,2 @@
1
+ declare function useDebounce(value: any, delay?: number): any;
2
+ export default useDebounce;