@flatbiz/antd 4.0.16 → 4.0.18
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/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/index.d.ts +96 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -125,15 +125,47 @@ export declare const CascaderWrapper: import("react").ForwardRefExoticComponent<
|
|
|
125
125
|
onChange?: ((value?: string | number, selectedList?: TPlainObject[]) => void) | undefined;
|
|
126
126
|
requestMessageConfig?: RequestStatusRenderProps["messageConfig"];
|
|
127
127
|
} & import("react").RefAttributes<CascaderWrapperRefApi>>;
|
|
128
|
-
export type ConfigProviderWrapperProps = Omit<ConfigProviderProps, "locale"> & {
|
|
129
|
-
locale?: "en" | "zh-cn";
|
|
130
|
-
};
|
|
131
|
-
export declare const ConfigProviderWrapper: (props: ConfigProviderWrapperProps) => JSX.Element;
|
|
132
128
|
export interface CommonPropsWithChildren<S extends TPlainObject = TPlainObject> {
|
|
133
129
|
className?: string;
|
|
134
130
|
style?: CSSProperties & Partial<S>;
|
|
135
131
|
children?: ReactNode | undefined;
|
|
136
132
|
}
|
|
133
|
+
export type CheckListItemValue = string | number;
|
|
134
|
+
export type CheckListValue = CheckListItemValue[] | CheckListItemValue | undefined;
|
|
135
|
+
export type CheckListSelectedValue<T extends "multi" | "radio"> = T extends "multi" ? CheckListItemValue[] : CheckListItemValue;
|
|
136
|
+
export type CheckListProps<T extends "multi" | "radio"> = {
|
|
137
|
+
multiple?: boolean;
|
|
138
|
+
onChange?: (value: CheckListSelectedValue<T>, operateValue: CheckListItemValue) => void;
|
|
139
|
+
onPreChange?: (value: CheckListItemValue) => Promise<void>;
|
|
140
|
+
value?: CheckListSelectedValue<T>;
|
|
141
|
+
defaultValue?: CheckListSelectedValue<T>;
|
|
142
|
+
beforeExtra?: ReactNode;
|
|
143
|
+
afterExtra?: ReactNode;
|
|
144
|
+
stopPropagation?: boolean;
|
|
145
|
+
required?: boolean;
|
|
146
|
+
} & CommonPropsWithChildren;
|
|
147
|
+
export declare const CheckList: <T extends "radio" | "multi">(props: CheckListProps<T>) => JSX.Element;
|
|
148
|
+
export type CheckListItemContentProps = {
|
|
149
|
+
checked?: boolean;
|
|
150
|
+
disabled?: boolean;
|
|
151
|
+
onClick?: (event: any) => void;
|
|
152
|
+
className?: string;
|
|
153
|
+
readonly?: boolean;
|
|
154
|
+
style?: CSSProperties;
|
|
155
|
+
};
|
|
156
|
+
export type CheckListItemProps = {
|
|
157
|
+
value: CheckListItemValue;
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
readonly?: boolean;
|
|
160
|
+
children: (data: CheckListItemContentProps) => ReactElement;
|
|
161
|
+
className?: string;
|
|
162
|
+
style?: CSSProperties;
|
|
163
|
+
};
|
|
164
|
+
export declare const CheckListItem: (props: CheckListItemProps) => ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
165
|
+
export type ConfigProviderWrapperProps = Omit<ConfigProviderProps, "locale"> & {
|
|
166
|
+
locale?: "en" | "zh-cn";
|
|
167
|
+
};
|
|
168
|
+
export declare const ConfigProviderWrapper: (props: ConfigProviderWrapperProps) => JSX.Element;
|
|
137
169
|
export type CssHoverProps = {
|
|
138
170
|
children: ReactElement;
|
|
139
171
|
} & Pick<CommonPropsWithChildren<{
|
|
@@ -506,8 +538,17 @@ export type EasyTableProps = {
|
|
|
506
538
|
/** 初始化是否请求,默认值:true */
|
|
507
539
|
initRequest?: boolean;
|
|
508
540
|
};
|
|
541
|
+
/**
|
|
542
|
+
* 对 查询条件+表格数据 进行深度封装,内置数据交互处理
|
|
543
|
+
* ```
|
|
544
|
+
* 1. 需要获取查询条件、主动发起请求等可通过ref操作
|
|
545
|
+
* 2. 可通过属性 initRequest 设置初始化是否请求数据
|
|
546
|
+
* 3. 可通过属性 fieldNames 来设置自定义变量,默认值为:list、total、pageNo、pageSize
|
|
547
|
+
* ```
|
|
548
|
+
*/
|
|
509
549
|
export declare const EasyTable: import("react").ForwardRefExoticComponent<EasyTableProps & import("react").RefAttributes<EasyTableRefApi>>;
|
|
510
550
|
export type FormColProps = {
|
|
551
|
+
span?: number;
|
|
511
552
|
/** 屏幕 < 576px */
|
|
512
553
|
xs?: number;
|
|
513
554
|
/** 屏幕 ≥ 576px */
|
|
@@ -527,7 +568,8 @@ export type FormColProps = {
|
|
|
527
568
|
/**
|
|
528
569
|
* 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
|
|
529
570
|
*```
|
|
530
|
-
*
|
|
571
|
+
* 1. 设置 span 栅格占位格数,不考虑响应式
|
|
572
|
+
* 2. grid 自定义响应式网格布局
|
|
531
573
|
* xs: 屏幕 < 576px
|
|
532
574
|
* sm: 屏幕 ≥ 576px
|
|
533
575
|
* md: 屏幕 ≥ 768px
|
|
@@ -535,8 +577,6 @@ export type FormColProps = {
|
|
|
535
577
|
* xl: 屏幕 ≥ 1200px
|
|
536
578
|
* xxl: 屏幕 ≥ 1600px
|
|
537
579
|
* ```
|
|
538
|
-
*
|
|
539
|
-
* @returns
|
|
540
580
|
*/
|
|
541
581
|
export declare const FormCol: {
|
|
542
582
|
(props: FormColProps): JSX.Element;
|
|
@@ -587,11 +627,48 @@ export type EasyTableFilterProps = {
|
|
|
587
627
|
text?: string;
|
|
588
628
|
};
|
|
589
629
|
};
|
|
630
|
+
/**
|
|
631
|
+
* 过滤条件
|
|
632
|
+
* @param props
|
|
633
|
+
* @returns
|
|
634
|
+
*
|
|
635
|
+
*```
|
|
636
|
+
*1. 用法1
|
|
637
|
+
* -- 默认网格布局 规则:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }
|
|
638
|
+
* <EasyTableFilter>
|
|
639
|
+
* <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
640
|
+
* </EasyTableFilter>
|
|
641
|
+
*
|
|
642
|
+
* -- 自定义网格布局 使用 FormCol组件包装 Form.Item
|
|
643
|
+
* <EasyTableFilter>
|
|
644
|
+
* <FormCol span={12}><Form.Item name="field1" label="条件1">xxx</Form.Item></FormCol>
|
|
645
|
+
* </EasyTableFilter>
|
|
646
|
+
*
|
|
647
|
+
* -- children 可为 function
|
|
648
|
+
* <EasyTableFilter>
|
|
649
|
+
* {(form) => {
|
|
650
|
+
* return <Form.Item name="field1" label="条件1">xxx</Form.Item>
|
|
651
|
+
* }}
|
|
652
|
+
* </EasyTableFilter>
|
|
653
|
+
*2. 用户2(自定义布局)
|
|
654
|
+
* EasyTableFilter设置 isPure = true,FormItem无布局规则
|
|
655
|
+
*3. EasyTableFilter中内置了 Form 标签,当children为函数时,可获取form实例
|
|
656
|
+
*4. 默认布局下,可通过设置 filterOperate 设置操作按钮
|
|
657
|
+
*```
|
|
658
|
+
*/
|
|
590
659
|
export declare const EasyTableFilter: (props: EasyTableFilterProps) => JSX.Element;
|
|
591
|
-
export type EasyTableTableProps = Omit<TableProps<TAny>, "dataSource" | "loading" | "
|
|
660
|
+
export type EasyTableTableProps = Omit<TableProps<TAny>, "dataSource" | "loading" | "rowKey"> & {
|
|
592
661
|
children?: ReactElement;
|
|
593
|
-
|
|
662
|
+
/** 表格行 key 的取值,可以是字符串或一个函数 */
|
|
663
|
+
rowKey: string | ((record: TPlainObject, index?: number) => React.Key);
|
|
594
664
|
};
|
|
665
|
+
/**
|
|
666
|
+
* 表格渲染
|
|
667
|
+
* @param props
|
|
668
|
+
* ```
|
|
669
|
+
* 1. 继承了 TableProps 可设置antd table功能
|
|
670
|
+
* ```
|
|
671
|
+
*/
|
|
595
672
|
export declare const EasyTableTable: (props: EasyTableTableProps) => JSX.Element;
|
|
596
673
|
export type SelectorWrapperValue = string | number | Array<string | number> | TPlainObject<string | number> | Array<TPlainObject<string | number>>;
|
|
597
674
|
export type SelectorServiceConfig = {
|
|
@@ -995,6 +1072,16 @@ export type GapProps = {
|
|
|
995
1072
|
* @returns
|
|
996
1073
|
*/
|
|
997
1074
|
export declare const Gap: (props: GapProps) => JSX.Element;
|
|
1075
|
+
export declare const useArrayChange: <T>(dataList: T[], forceUpdate?: boolean) => readonly [
|
|
1076
|
+
T[],
|
|
1077
|
+
{
|
|
1078
|
+
add: (dataItem: T | T[], isUnshift?: boolean) => void;
|
|
1079
|
+
update: (index: number, dataItem: T) => void;
|
|
1080
|
+
delete: (index: number) => T[];
|
|
1081
|
+
resetList: (dataList: T[]) => void;
|
|
1082
|
+
getList: () => T[];
|
|
1083
|
+
}
|
|
1084
|
+
];
|
|
998
1085
|
export declare const useEffectCustom: (fn: EffectCallback, deps: DependencyList) => void;
|
|
999
1086
|
export declare const useEffectCustomAsync: (fn: () => Promise<void>, deps: DependencyList) => void;
|
|
1000
1087
|
export type ShouldUpdateFunc<T> = (prev: T | undefined, next: T) => boolean;
|