wargerm 0.7.96 → 0.7.98

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,12 @@
1
1
  import React, { MutableRefObject } from 'react';
2
- import { FormInstance } from 'antd';
2
+ import { FormInstance, ModalProps } from 'antd';
3
3
  import { WFormProps } from '../WForm';
4
4
  export interface IFormInstance extends MutableRefObject<FormInstance> {
5
5
  handleSubmit?: () => void;
6
6
  resetFields?: () => void;
7
7
  setFieldsValue?: (record?: Record<string, any>) => void;
8
8
  }
9
- interface IProps extends WFormProps {
9
+ interface Props extends WFormProps {
10
10
  open: boolean;
11
11
  setOpen: (value: any) => void;
12
12
  modalFormOpend?: (value: any) => void;
@@ -19,5 +19,5 @@ interface IProps extends WFormProps {
19
19
  modalFooterSlot?: React.ReactNode;
20
20
  formProps?: Omit<WFormProps, 'columns'>;
21
21
  }
22
- declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
22
+ declare const _default: React.ForwardRefExoticComponent<Props & ModalProps & React.RefAttributes<unknown>>;
23
23
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject } from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { ProTableProps } from '@ant-design/pro-table';
4
- import { ColumnProps, IColumnProps, Isearch } from '../WForm';
4
+ import { GroupColumnType, IColumnProps, Isearch, XOR } from '../WForm';
5
5
  type CustomType = {
6
6
  type: 'custom';
7
7
  title: ReactNode;
@@ -33,8 +33,18 @@ interface ItableBarCustom {
33
33
  interface IoptionColumnConfig extends IColumnProps {
34
34
  showMoreNum?: number;
35
35
  }
36
+ export interface ITableColumnProps extends IColumnProps {
37
+ hideInModalForm?: boolean;
38
+ hiddenInModalForm?: boolean;
39
+ notInitialValueInSearch?: boolean;
40
+ onlyShowInView?: boolean;
41
+ renderColumn?: (column: TableColumnProps, config: Record<string, any>) => TableColumnProps;
42
+ }
43
+ export type TableColumnProps = XOR<ITableColumnProps, GroupColumnType & {
44
+ children: ITableColumnProps[];
45
+ }>;
36
46
  interface ITableCard extends Omit<ProTableProps<Record<string, any>[], Record<string, any>>, 'columns'> {
37
- columns: ColumnProps[];
47
+ columns: TableColumnProps[];
38
48
  modalFormSearch?: Isearch;
39
49
  search?: Isearch;
40
50
  modalConfig?: Record<string, any>;
@@ -45,7 +55,7 @@ interface ITableCard extends Omit<ProTableProps<Record<string, any>[], Record<st
45
55
  filterAction?: (record: Record<string, any>, item: Record<string, any>) => boolean;
46
56
  renderTableBar?: Array<ItableBar | ItableBarCustom>;
47
57
  renderTableBarDeps?: any;
48
- extraColumns?: Array<any>;
58
+ extraColumns?: TableColumnProps[];
49
59
  onFormChange?: (changedValues: Record<string, any>, allValues: Record<string, any>, form: any) => void;
50
60
  noBordered?: boolean;
51
61
  searchTableSlot?: ReactNode;
@@ -26,17 +26,17 @@ export interface IColumnProps extends ColumnType<Record<string, any>> {
26
26
  render?: (text: string, record: Record<string, any>, index: number) => ReactNode;
27
27
  renderFormItem?: (item: any, { formItemProps, fieldProps, ...rest }: any, form: any) => ReactNode;
28
28
  }
29
- type GroupType = {
29
+ export type GroupColumnType = {
30
30
  title?: string;
31
31
  type: 'group';
32
- groupNode?: ReactNode;
32
+ groupNode?: (children: ReactNode) => ReactNode;
33
33
  children: IColumnProps[];
34
34
  };
35
35
  type Without<T, U> = {
36
36
  [P in Exclude<keyof T, keyof U>]?: never;
37
37
  };
38
- type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
39
- export type ColumnProps = XOR<GroupType, IColumnProps>;
38
+ export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
39
+ export type ColumnProps = XOR<GroupColumnType, IColumnProps>;
40
40
  type defaultColConfig = {
41
41
  xs: 24;
42
42
  sm: 24;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.7.96",
4
+ "version": "0.7.98",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",