wargerm 0.7.95 → 0.7.96

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,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, Isearch } from '../WForm';
4
+ import { ColumnProps, IColumnProps, Isearch } from '../WForm';
5
5
  type CustomType = {
6
6
  type: 'custom';
7
7
  title: ReactNode;
@@ -30,7 +30,7 @@ interface ItableBarCustom {
30
30
  key: string;
31
31
  actionMethod?: (values: Record<string, any>, done: () => void) => Promise<any>;
32
32
  }
33
- interface IoptionColumnConfig extends ColumnProps {
33
+ interface IoptionColumnConfig extends IColumnProps {
34
34
  showMoreNum?: number;
35
35
  }
36
36
  interface ITableCard extends Omit<ProTableProps<Record<string, any>[], Record<string, any>>, 'columns'> {
@@ -1,19 +1,19 @@
1
1
  import React, { MutableRefObject } from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { FormInstance, FormProps } from 'antd';
4
- export interface ColumnProps {
4
+ import { ColumnType } from 'antd/es/table';
5
+ export interface IColumnProps extends ColumnType<Record<string, any>> {
5
6
  title: string;
6
7
  dataIndex: string;
7
8
  key?: string | number;
8
9
  width?: number;
9
- ellipsis?: Boolean;
10
10
  showTitle?: Boolean;
11
11
  hideInSearch?: boolean;
12
12
  search?: {
13
13
  transform?: (value: any) => Record<string, any>;
14
14
  transformSetForm?: (value: any) => Record<string, any>;
15
15
  };
16
- valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'cascader' | 'upload';
16
+ valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'tree' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'cascader' | 'upload';
17
17
  valueEnum?: Record<string, any>;
18
18
  options?: Record<string, any>[];
19
19
  useFirstIteminitialValue?: boolean;
@@ -26,6 +26,17 @@ export interface ColumnProps {
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 = {
30
+ title?: string;
31
+ type: 'group';
32
+ groupNode?: ReactNode;
33
+ children: IColumnProps[];
34
+ };
35
+ type Without<T, U> = {
36
+ [P in Exclude<keyof T, keyof U>]?: never;
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>;
29
40
  type defaultColConfig = {
30
41
  xs: 24;
31
42
  sm: 24;
package/dist/index.esm.js CHANGED
@@ -3669,7 +3669,8 @@ var WForm = function WForm(props, ref) {
3669
3669
  var _c$children;
3670
3670
  c.children = (_c$children = c.children) === null || _c$children === void 0 ? void 0 : _c$children.filter(function (itm) {
3671
3671
  if (disabledHideInSearch) return true;
3672
- if (itm.hideInSearch || itm.disabledHideInSearch) {
3672
+ // if (itm.hideInSearch || itm.disabledHideInSearch) {
3673
+ if (itm.hideInSearch) {
3673
3674
  return false;
3674
3675
  }
3675
3676
  return true;
@@ -3684,7 +3685,7 @@ var WForm = function WForm(props, ref) {
3684
3685
  var _c$children2;
3685
3686
  c.children = (_c$children2 = c.children) === null || _c$children2 === void 0 ? void 0 : _c$children2.filter(function (itm) {
3686
3687
  if (disabledHideInSearch) return true;
3687
- if (itm.hideInSearch || itm.disabledHideInSearch) {
3688
+ if (itm.hideInSearch) {
3688
3689
  return false;
3689
3690
  }
3690
3691
  return true;
package/dist/index.js CHANGED
@@ -3712,7 +3712,8 @@ var WForm = function WForm(props, ref) {
3712
3712
  var _c$children;
3713
3713
  c.children = (_c$children = c.children) === null || _c$children === void 0 ? void 0 : _c$children.filter(function (itm) {
3714
3714
  if (disabledHideInSearch) return true;
3715
- if (itm.hideInSearch || itm.disabledHideInSearch) {
3715
+ // if (itm.hideInSearch || itm.disabledHideInSearch) {
3716
+ if (itm.hideInSearch) {
3716
3717
  return false;
3717
3718
  }
3718
3719
  return true;
@@ -3727,7 +3728,7 @@ var WForm = function WForm(props, ref) {
3727
3728
  var _c$children2;
3728
3729
  c.children = (_c$children2 = c.children) === null || _c$children2 === void 0 ? void 0 : _c$children2.filter(function (itm) {
3729
3730
  if (disabledHideInSearch) return true;
3730
- if (itm.hideInSearch || itm.disabledHideInSearch) {
3731
+ if (itm.hideInSearch) {
3731
3732
  return false;
3732
3733
  }
3733
3734
  return true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.7.95",
4
+ "version": "0.7.96",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",