doui-react 1.0.0 → 2.0.0

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 (157) hide show
  1. package/es/api/component/common.d.ts +2 -2
  2. package/es/api/component/common.js +3 -0
  3. package/es/api/component/global-style.d.ts +0 -1
  4. package/es/api/component/global-style.js +2 -3
  5. package/es/api/component/react-dom.js +9 -21
  6. package/es/api/component/validate-input.js +3 -5
  7. package/es/button/component/index.js +9 -10
  8. package/es/button/type/index.d.ts +3 -7
  9. package/es/checkbox/type/index.d.ts +1 -1
  10. package/es/date-picker/component/index.js +13 -17
  11. package/es/date-picker/type/index.d.ts +5 -14
  12. package/es/form/component/constant.js +2 -2
  13. package/es/form/component/form-item-map.d.ts +1 -1
  14. package/es/form/component/form-item.js +1 -3
  15. package/es/form/component/form-list.d.ts +2 -2
  16. package/es/form/component/utils.d.ts +33 -23
  17. package/es/form/component/utils.js +4 -4
  18. package/es/form/style/form-item.d.ts +1 -1
  19. package/es/form/style/form-item.js +4 -11
  20. package/es/form/style/index.js +2 -2
  21. package/es/form/type/form-item.d.ts +6 -6
  22. package/es/form/type/form-list.d.ts +2 -2
  23. package/es/form/type/index.d.ts +3 -3
  24. package/es/grid/component/pagination.d.ts +72 -15
  25. package/es/icon/hook/index.d.ts +195 -190
  26. package/es/input/component/index.js +1 -1
  27. package/es/input/component/number.d.ts +1 -1
  28. package/es/input/component/number.js +8 -30
  29. package/es/input/component/utils.d.ts +3 -2
  30. package/es/input/component/utils.js +40 -5
  31. package/es/input/type/index.d.ts +8 -3
  32. package/es/modal-prompt/component/index.js +3 -1
  33. package/es/modal-prompt/component/utils.js +2 -1
  34. package/es/modal-prompt/type/index.d.ts +2 -2
  35. package/es/open-modal/component/footer.d.ts +1 -1
  36. package/es/open-modal/component/footer.js +2 -4
  37. package/es/open-modal/component/modal.js +14 -6
  38. package/es/open-modal/component/utils.js +2 -6
  39. package/es/open-modal/hook/use-modal.js +1 -1
  40. package/es/open-modal/style/index.js +1 -2
  41. package/es/open-modal/style/wrap.js +1 -1
  42. package/es/open-modal/type/index.d.ts +2 -2
  43. package/es/radio/component/abstract-box.d.ts +84 -112
  44. package/es/radio/component/abstract-box.js +1 -5
  45. package/es/radio/component/use-radio.d.ts +7 -5
  46. package/es/radio/type/index.d.ts +2 -2
  47. package/es/select/component/use-select.js +5 -8
  48. package/es/select/component/utils.d.ts +1 -2
  49. package/es/select/type/index.d.ts +1 -1
  50. package/es/stack/style/index.d.ts +2 -1
  51. package/es/switch/type/index.d.ts +2 -2
  52. package/es/table/component/action-button.js +0 -1
  53. package/es/table/component/filter.d.ts +1 -1
  54. package/es/table/component/filter.js +1 -1
  55. package/es/table/component/sort.d.ts +1 -1
  56. package/es/table/component/time.js +2 -2
  57. package/es/table/component/utils.d.ts +3 -77
  58. package/es/table/component/utils.js +1 -3
  59. package/es/table/hook/search.d.ts +1 -1
  60. package/es/table/hook/search.js +8 -6
  61. package/es/table/type/action.d.ts +2 -7
  62. package/es/table/type/column.d.ts +3 -3
  63. package/es/tabs/component/utils.d.ts +7 -7
  64. package/es/tabs/type/index.d.ts +1 -1
  65. package/es/text/component/index.js +15 -16
  66. package/es/text/component/use-text.d.ts +3 -2
  67. package/es/text/component/use-text.js +12 -19
  68. package/es/text/component/utils.d.ts +1 -1
  69. package/es/text/style/index.js +1 -1
  70. package/es/text/type/index.d.ts +2 -2
  71. package/es/tooltip/component/index.d.ts +31 -21
  72. package/es/tooltip/component/index.js +6 -2
  73. package/es/tooltip/type/index.d.ts +1 -1
  74. package/es/tree/component/index.d.ts +1 -1
  75. package/es/tree/style/index.js +1 -1
  76. package/es/tree-select/component/use-tree-select.js +4 -4
  77. package/es/tree-select/style/index.js +1 -1
  78. package/es/virtual-list/type/index.d.ts +1 -1
  79. package/lib/api/component/common.d.ts +2 -2
  80. package/lib/api/component/common.js +3 -0
  81. package/lib/api/component/global-style.d.ts +0 -1
  82. package/lib/api/component/global-style.js +3 -4
  83. package/lib/api/component/react-dom.js +9 -21
  84. package/lib/api/component/validate-input.js +3 -5
  85. package/lib/button/component/index.js +9 -10
  86. package/lib/button/type/index.d.ts +3 -7
  87. package/lib/checkbox/type/index.d.ts +1 -1
  88. package/lib/date-picker/component/index.js +13 -17
  89. package/lib/date-picker/type/index.d.ts +5 -14
  90. package/lib/form/component/constant.js +2 -2
  91. package/lib/form/component/form-item-map.d.ts +1 -1
  92. package/lib/form/component/form-item.js +1 -3
  93. package/lib/form/component/form-list.d.ts +2 -2
  94. package/lib/form/component/utils.d.ts +32 -22
  95. package/lib/form/component/utils.js +4 -4
  96. package/lib/form/style/form-item.d.ts +1 -1
  97. package/lib/form/style/form-item.js +4 -11
  98. package/lib/form/style/index.js +1 -1
  99. package/lib/form/type/form-item.d.ts +6 -6
  100. package/lib/form/type/form-list.d.ts +2 -2
  101. package/lib/form/type/index.d.ts +3 -3
  102. package/lib/grid/component/pagination.d.ts +72 -15
  103. package/lib/icon/hook/index.d.ts +195 -190
  104. package/lib/input/component/index.js +1 -1
  105. package/lib/input/component/number.d.ts +1 -1
  106. package/lib/input/component/number.js +7 -28
  107. package/lib/input/component/utils.d.ts +3 -2
  108. package/lib/input/component/utils.js +41 -6
  109. package/lib/input/type/index.d.ts +8 -3
  110. package/lib/modal-prompt/component/index.js +3 -1
  111. package/lib/modal-prompt/component/utils.js +2 -1
  112. package/lib/modal-prompt/type/index.d.ts +2 -2
  113. package/lib/open-modal/component/footer.d.ts +1 -1
  114. package/lib/open-modal/component/footer.js +2 -4
  115. package/lib/open-modal/component/modal.js +12 -4
  116. package/lib/open-modal/component/utils.js +2 -6
  117. package/lib/open-modal/hook/use-modal.js +1 -1
  118. package/lib/open-modal/style/index.js +1 -2
  119. package/lib/open-modal/style/wrap.js +1 -1
  120. package/lib/open-modal/type/index.d.ts +2 -2
  121. package/lib/radio/component/abstract-box.d.ts +86 -114
  122. package/lib/radio/component/abstract-box.js +1 -5
  123. package/lib/radio/component/use-radio.d.ts +7 -5
  124. package/lib/radio/type/index.d.ts +2 -2
  125. package/lib/select/component/use-select.js +5 -8
  126. package/lib/select/component/utils.d.ts +1 -2
  127. package/lib/select/type/index.d.ts +1 -1
  128. package/lib/stack/style/index.d.ts +2 -1
  129. package/lib/switch/type/index.d.ts +2 -2
  130. package/lib/table/component/action-button.js +0 -1
  131. package/lib/table/component/filter.d.ts +1 -1
  132. package/lib/table/component/filter.js +1 -1
  133. package/lib/table/component/sort.d.ts +1 -1
  134. package/lib/table/component/time.js +2 -2
  135. package/lib/table/component/utils.d.ts +3 -77
  136. package/lib/table/component/utils.js +1 -3
  137. package/lib/table/hook/search.d.ts +1 -1
  138. package/lib/table/hook/search.js +8 -6
  139. package/lib/table/type/action.d.ts +2 -7
  140. package/lib/table/type/column.d.ts +3 -3
  141. package/lib/tabs/component/utils.d.ts +7 -7
  142. package/lib/tabs/type/index.d.ts +1 -1
  143. package/lib/text/component/index.js +15 -16
  144. package/lib/text/component/use-text.d.ts +3 -2
  145. package/lib/text/component/use-text.js +11 -18
  146. package/lib/text/component/utils.d.ts +1 -1
  147. package/lib/text/style/index.js +1 -1
  148. package/lib/text/type/index.d.ts +2 -2
  149. package/lib/tooltip/component/index.d.ts +30 -20
  150. package/lib/tooltip/component/index.js +6 -2
  151. package/lib/tooltip/type/index.d.ts +1 -1
  152. package/lib/tree/component/index.d.ts +1 -1
  153. package/lib/tree/style/index.js +1 -1
  154. package/lib/tree-select/component/use-tree-select.js +4 -4
  155. package/lib/tree-select/style/index.js +1 -1
  156. package/lib/virtual-list/type/index.d.ts +1 -1
  157. package/package.json +10 -13
@@ -2,9 +2,9 @@ import { BaseComponentProps, BaseFlexProps } from "../../api";
2
2
  import { BaseSelectProps } from "../../select";
3
3
  import { TextProps } from "../../text";
4
4
  import { RadioGroupProps } from 'antd';
5
- import { CheckboxProps as AntdCheckboxProps } from 'antd/lib/checkbox/Checkbox';
5
+ import { CheckboxProps as AntdCheckboxProps } from 'antd/es/checkbox/Checkbox';
6
6
  import { ReactNode } from 'react';
7
- export interface BaseBoxProps extends Omit<AntdCheckboxProps, 'onChange'>, TextProps, BaseComponentProps {
7
+ export interface BaseBoxProps extends Omit<AntdCheckboxProps, 'onChange' | 'onBlur' | 'onFocus'>, Omit<TextProps, 'onBlur' | 'onFocus'>, BaseComponentProps {
8
8
  children?: ReactNode;
9
9
  text?: ReactNode;
10
10
  /**
@@ -57,10 +57,7 @@ function renderMaxTag(omittedValues) {
57
57
  return _jsxs(Text, {
58
58
  autoShowTooltip: false,
59
59
  tooltip: {
60
- title: tooltip,
61
- align: {
62
- offset: [0, 0]
63
- }
60
+ title: tooltip
64
61
  },
65
62
  children: ["+", omittedValues.length, "..."]
66
63
  });
@@ -80,7 +77,7 @@ export function useSelect(_ref3) {
80
77
  _ref3$showSearch = _ref3.showSearch,
81
78
  showSearch = _ref3$showSearch === void 0 ? true : _ref3$showSearch,
82
79
  _ref3$placeholder = _ref3.placeholder,
83
- placeholder = _ref3$placeholder === void 0 ? 'Select' : _ref3$placeholder,
80
+ placeholder = _ref3$placeholder === void 0 ? '请选择' : _ref3$placeholder,
84
81
  renderDropdown = _ref3.renderDropdown,
85
82
  originalSearch = _ref3.search,
86
83
  restProps = _objectWithoutProperties(_ref3, _excluded);
@@ -103,7 +100,7 @@ export function useSelect(_ref3) {
103
100
  })),
104
101
  displayOptions = _useSelectOptions.displayOptions,
105
102
  restSelectProps = _objectWithoutProperties(_useSelectOptions, _excluded2);
106
- function onDropdownVisibleChange(open) {
103
+ function onOpenChange(open) {
107
104
  setOpen(open);
108
105
  setSearch('');
109
106
  }
@@ -123,7 +120,7 @@ export function useSelect(_ref3) {
123
120
  optionFilterProp: 'originLabel',
124
121
  optionLabelProp: 'originLabel',
125
122
  getPopupContainer: getPopupContainer,
126
- dropdownRender: customRenderDropdown,
123
+ popupRender: customRenderDropdown,
127
124
  maxTagPlaceholder: renderMaxTag
128
125
  }, getComponentProps(restSelectProps)), {}, {
129
126
  placeholder: placeholder,
@@ -131,6 +128,6 @@ export function useSelect(_ref3) {
131
128
  loading: loading,
132
129
  options: displayOptions,
133
130
  onSearch: showSearch ? setSearch : undefined,
134
- onDropdownVisibleChange: onDropdownVisibleChange
131
+ onOpenChange: onOpenChange
135
132
  });
136
133
  }
@@ -1,11 +1,10 @@
1
1
  import { FormValues } from "../../form";
2
2
  import { BaseSelectProps, SelectOptions } from "..";
3
- import { DependencyList } from 'react';
4
3
  export declare function generateOptions({ options, sort, ...rest }: BaseSelectProps): any[];
5
4
  export declare function getOptionsValue(options?: SelectOptions): (string | number)[];
6
5
  interface DependenciesProps {
7
6
  values?: FormValues;
8
- deps?: DependencyList;
7
+ deps?: string[];
9
8
  search: string;
10
9
  isFunctionOptions: boolean;
11
10
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseComponentProps, FunctionReturn } from "../../api";
2
2
  import { UseFetchOptions } from "../../hooks";
3
3
  import { TextProps } from "../../text";
4
- import { SelectProps as AntdSelectProps } from 'antd/lib/select';
4
+ import { SelectProps as AntdSelectProps } from 'antd/es/select';
5
5
  import { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
6
6
  import { ReactNode } from 'react';
7
7
  /**
@@ -12,7 +12,8 @@ export declare const alignMap: {
12
12
  between: string;
13
13
  };
14
14
  export declare function getAlign(align: HStackProps['align']): string;
15
- export declare function getWidthAndFlex({ width, style, flex }: Partial<HStackProps>): import("@emotion/react").SerializedStyles;
15
+ type WidthFlexStyle = Pick<HStackProps, 'width' | 'style' | 'flex'>;
16
+ export declare function getWidthAndFlex({ width, style, flex }: WidthFlexStyle): import("@emotion/react").SerializedStyles;
16
17
  declare const style: {
17
18
  hStack: (props: Partial<HStackProps>) => import("@emotion/react").SerializedStyles;
18
19
  vStack: (props: Partial<VStackProps>) => import("@emotion/react").SerializedStyles;
@@ -1,6 +1,6 @@
1
1
  import { BaseComponentProps, FunctionReturn } from "../../api";
2
- import { SwitchProps as AntdSwitchProps } from 'antd/lib/switch';
3
- import { EllipsisConfig } from 'antd/lib/typography/Base';
2
+ import { SwitchProps as AntdSwitchProps } from 'antd/es/switch';
3
+ import { EllipsisConfig } from 'antd/es/typography/Base';
4
4
  export interface SwitchProps extends AntdSwitchProps, BaseComponentProps {
5
5
  /**
6
6
  * @description 提示信息
@@ -17,7 +17,6 @@ function generateAction(action, params) {
17
17
  disabled: executeFunction(action.disabled, params),
18
18
  tooltip: executeFunction(action.tooltip, params),
19
19
  confirm: executeFunction(action.confirm, params),
20
- confirmMessage: executeFunction(action.confirmMessage, params),
21
20
  onClick: function onClick() {
22
21
  var _action$onClick;
23
22
  return (_action$onClick = action.onClick) === null || _action$onClick === void 0 ? void 0 : _action$onClick.call(action, params);
@@ -1,3 +1,3 @@
1
1
  import { Column } from "..";
2
- import { ColumnType } from 'antd/lib/table';
2
+ import type { ColumnType } from 'antd/es/table';
3
3
  export declare function getFilterColumn(column: Column): ColumnType<any>;
@@ -29,7 +29,7 @@ function generateFilters(_ref) {
29
29
  return filter;
30
30
  }
31
31
  return {
32
- text: filter,
32
+ text: "".concat(filter),
33
33
  value: filter
34
34
  };
35
35
  });
@@ -1,6 +1,6 @@
1
1
  import { Column } from '../type';
2
2
  export declare function getSortColumn({ dataIndex, sort }: Column): {
3
- sorter: import("antd/lib/table/interface").CompareFn<any>;
3
+ sorter: import("antd/es/table/interface").CompareFn<any>;
4
4
  } | {
5
5
  sorter: (a: any, b: any) => any;
6
6
  };
@@ -1,4 +1,4 @@
1
- import moment from 'moment-timezone';
1
+ import dayjs from 'dayjs';
2
2
  import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
3
3
  var defaultFormat = 'YYYY-MM-DD hh:mm:ss A';
4
4
  export function Time(_ref) {
@@ -7,6 +7,6 @@ export function Time(_ref) {
7
7
  var timeFormat = column.timeFormat;
8
8
  var format = timeFormat || defaultFormat;
9
9
  return _jsx(_Fragment, {
10
- children: moment(+children).format(format)
10
+ children: dayjs(+children).format(format)
11
11
  });
12
12
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { FormInstance, FormProps } from "../../form";
3
- import { TableRowSelection } from 'antd/lib/table/interface';
2
+ import type { ColumnType } from 'antd/es/table';
3
+ import type { TableRowSelection } from 'antd/es/table/interface';
4
4
  import { Column, DataSource, GetSearchColumn, TableContext, TableProps } from '../type';
5
5
  import { Actions } from './actions';
6
6
  import { Editor } from './editor';
@@ -19,81 +19,7 @@ export declare const componentMap: {
19
19
  editor: typeof Editor;
20
20
  default: (props: any) => any;
21
21
  };
22
- export declare function generateColumns({ columns, getSearchColumn }: GenerateColumnsProps): {
23
- render: (current: any, record: Record<string, any>, index: number) => import("react").ReactNode;
24
- dataIndex?: string | undefined;
25
- type?: "link" | "time" | "switch" | "actions" | "selection" | "editor" | undefined;
26
- width?: string | number | undefined;
27
- minWidth?: string | number | undefined;
28
- maxWidth?: string | number | undefined;
29
- rows?: number | undefined;
30
- timeFormat?: string | undefined;
31
- disabled?: boolean | ((props: import("../type").CommonProps) => boolean) | undefined;
32
- tooltip?: import("react").ReactNode | ((props: import("../type").CommonProps) => import("react").ReactNode);
33
- onClick?(props: import("../type").CommonProps): any;
34
- search?: boolean | string[] | ((props: import("../type").CustomFilterProps) => boolean) | undefined;
35
- placeholder?: string | undefined;
36
- sort?: boolean | import("antd/lib/table/interface").CompareFn<any> | {
37
- compare?: import("antd/lib/table/interface").CompareFn<any> | undefined;
38
- multiple?: number | undefined;
39
- } | undefined;
40
- filters?: (boolean | import("react").Key | import("antd/lib/table/interface").ColumnFilterItem)[] | undefined;
41
- filterBy?: string[] | ((props: import("../type").CustomFilterProps) => boolean) | undefined;
42
- actions?: import("../type").ActionProps[] | ((props: import("../type").CommonProps) => import("../type").ActionProps[]) | undefined;
43
- editorProps?: import("../../form").FormItemProps | ((props: import("../type").CommonProps) => import("../../form").FormItemProps) | undefined;
44
- title?: import("antd/lib/table/interface").ColumnTitle<any>;
45
- key?: import("react").Key | undefined;
46
- className?: string | undefined;
47
- fixed?: import("rc-table/lib/interface").FixedType | undefined;
48
- align?: import("rc-table/lib/interface").AlignType | undefined;
49
- colSpan?: number | undefined;
50
- rowSpan?: number | undefined;
51
- responsive?: import("antd/lib/_util/responsiveObserve").Breakpoint[] | undefined;
52
- shouldCellUpdate?: ((record: any, prevRecord: any) => boolean) | undefined;
53
- onCell?: import("rc-table/lib/interface").GetComponentProps<any> | undefined;
54
- onCellClick?: ((record: any, e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
55
- onHeaderCell?: import("rc-table/lib/interface").GetComponentProps<import("rc-table/lib/interface").ColumnType<any> | import("rc-table/lib/interface").ColumnGroupType<any>> | undefined;
56
- sorter?: boolean | import("antd/lib/table/interface").CompareFn<any> | {
57
- compare?: import("antd/lib/table/interface").CompareFn<any> | undefined;
58
- multiple?: number | undefined;
59
- } | undefined;
60
- sortOrder?: import("antd/lib/table/interface").SortOrder | undefined;
61
- defaultSortOrder?: import("antd/lib/table/interface").SortOrder | undefined;
62
- sortDirections?: import("antd/lib/table/interface").SortOrder[] | undefined;
63
- showSorterTooltip?: boolean | import("antd").TooltipProps | undefined;
64
- filtered?: boolean | undefined;
65
- filterDropdown?: import("react").ReactNode | ((props: import("antd/lib/table/interface").FilterDropdownProps) => import("react").ReactNode);
66
- filterMultiple?: boolean | undefined;
67
- filteredValue?: import("antd/lib/table/interface").FilterValue | null | undefined;
68
- defaultFilteredValue?: import("antd/lib/table/interface").FilterValue | null | undefined;
69
- filterIcon?: import("react").ReactNode | ((filtered: boolean) => import("react").ReactNode);
70
- filterMode?: "menu" | "tree" | undefined;
71
- filterSearch?: import("antd/lib/table/interface").FilterSearchType<import("antd/lib/table/interface").ColumnFilterItem> | undefined;
72
- onFilter?: ((value: boolean | import("react").Key, record: any) => boolean) | undefined;
73
- filterDropdownVisible?: boolean | undefined;
74
- filterDropdownOpen?: boolean | undefined;
75
- onFilterDropdownVisibleChange?: ((visible: boolean) => void) | undefined;
76
- onFilterDropdownOpenChange?: ((open: boolean) => void) | undefined;
77
- filterResetToDefaultFilteredValue?: boolean | undefined;
78
- columnWidth?: string | number | undefined;
79
- onChange?: ((selectedRowKeys: import("react").Key[], selectedRows: any[], info: {
80
- type: import("antd/lib/table/interface").RowSelectMethod;
81
- }) => void) | undefined;
82
- onSelect?: import("antd/lib/table/interface").SelectionSelectFn<any> | undefined;
83
- preserveSelectedRowKeys?: boolean | undefined;
84
- selectedRowKeys?: import("react").Key[] | undefined;
85
- defaultSelectedRowKeys?: import("react").Key[] | undefined;
86
- getCheckboxProps?: ((record: any) => Partial<Omit<import("antd").CheckboxProps, "defaultChecked" | "checked">>) | undefined;
87
- onSelectMultiple?: ((selected: boolean, selectedRows: any[], changeRows: any[]) => void) | undefined;
88
- onSelectAll?: ((selected: boolean, selectedRows: any[], changeRows: any[]) => void) | undefined;
89
- onSelectInvert?: ((selectedRowKeys: import("react").Key[]) => void) | undefined;
90
- onSelectNone?: (() => void) | undefined;
91
- selections?: boolean | import("antd/lib/table/hooks/useSelection").INTERNAL_SELECTION_ITEM[] | undefined;
92
- hideSelectAll?: boolean | undefined;
93
- columnTitle?: import("react").ReactNode;
94
- checkStrictly?: boolean | undefined;
95
- renderCell?: ((value: boolean, record: any, index: number, originNode: import("react").ReactNode) => import("react").ReactNode | import("rc-table/lib/interface").RenderedCell<any>) | undefined;
96
- }[];
22
+ export declare function generateColumns({ columns, getSearchColumn }: GenerateColumnsProps): ColumnType<any>[];
97
23
  interface RowSelectionProps {
98
24
  rowKey: string;
99
25
  columns: Column[];
@@ -28,9 +28,7 @@ export var componentMap = {
28
28
  export function generateColumns(_ref) {
29
29
  var columns = _ref.columns,
30
30
  getSearchColumn = _ref.getSearchColumn;
31
- return _.filter(columns, function (column) {
32
- return column.width !== 0;
33
- }).map(function (column) {
31
+ return _.map(columns, function (column) {
34
32
  var newColumn = _.clone(column);
35
33
  var search = newColumn.search,
36
34
  sort = newColumn.sort,
@@ -1,4 +1,4 @@
1
- import { ColumnType } from 'antd/lib/table';
1
+ import type { ColumnType } from 'antd/es/table';
2
2
  import { Column } from '../type';
3
3
  export declare function useSearchColumn(): {
4
4
  getSearchColumn: ({ dataIndex, ...rest }: Column) => ColumnType<any>;
@@ -94,12 +94,14 @@ function getSearchableColumn(column) {
94
94
  }
95
95
  return filter.apply(void 0, [column].concat(args));
96
96
  },
97
- onFilterDropdownOpenChange: function onFilterDropdownOpenChange(visible) {
98
- if (visible) {
99
- setTimeout(function () {
100
- var _currentInput;
101
- return (_currentInput = currentInput) === null || _currentInput === void 0 ? void 0 : _currentInput.focus();
102
- }, 30);
97
+ filterDropdownProps: {
98
+ onOpenChange: function onOpenChange(visible) {
99
+ if (visible) {
100
+ setTimeout(function () {
101
+ var _currentInput;
102
+ return (_currentInput = currentInput) === null || _currentInput === void 0 ? void 0 : _currentInput.focus();
103
+ }, 30);
104
+ }
103
105
  }
104
106
  },
105
107
  render: function render(text) {
@@ -3,7 +3,7 @@ import { ButtonProps } from "../../button";
3
3
  import { FormListActionProps, FormListProps } from "../../form";
4
4
  import { TableContext } from "..";
5
5
  import { ReactNode } from 'react';
6
- type ButtonType = Omit<ButtonProps & Partial<FormListActionProps> & Pick<FormListProps, 'focusFirstOnAdd'>, 'icon' | 'show' | 'disabled' | 'tooltip' | 'confirm' | 'confirmMessage' | 'onClick'>;
6
+ type ButtonType = Omit<ButtonProps & Partial<FormListActionProps> & Pick<FormListProps, 'focusFirstOnAdd'>, 'icon' | 'show' | 'disabled' | 'tooltip' | 'confirm' | 'onClick'>;
7
7
  export interface ActionProps extends ButtonType {
8
8
  /**
9
9
  * @description 图标
@@ -33,12 +33,7 @@ export interface ActionProps extends ButtonType {
33
33
  * @default false
34
34
  * @link TableContext: #tablecontext
35
35
  */
36
- confirm?: boolean | ((props: TableContext) => boolean);
37
- /**
38
- * @description 确认信息
39
- * @link TableContext: #tablecontext
40
- */
41
- confirmMessage?: ReactNode | ((props: TableContext) => ReactNode);
36
+ confirm?: ButtonProps['confirm'] | ((props: TableContext) => ButtonProps['confirm']);
42
37
  /**
43
38
  * @description 点击回调
44
39
  * @link TableContext: #tablecontext
@@ -2,10 +2,10 @@ import { FunctionReturn } from "../../api";
2
2
  import { FormItemProps } from "../../form";
3
3
  import { ActionProps, CommonProps } from "..";
4
4
  import { componentMap } from "../component/utils";
5
- import { ColumnType } from 'antd/lib/table';
6
- import { ColumnFilterItem, TableRowSelection } from 'antd/lib/table/interface';
5
+ import type { ColumnType } from 'antd/es/table';
6
+ import type { ColumnFilterItem, TableRowSelection } from 'antd/es/table/interface';
7
7
  import React, { ReactNode } from 'react';
8
- type UnionColumnType = Omit<ColumnType<any>, 'ellipsis' | 'filters'> & Omit<TableRowSelection<any>, 'type'>;
8
+ type UnionColumnType = Omit<ColumnType<any>, 'ellipsis' | 'filters' | 'minWidth' | 'maxWidth'> & Omit<TableRowSelection<any>, 'type'>;
9
9
  export interface Column extends UnionColumnType {
10
10
  /**
11
11
  * @description 字段名
@@ -7,18 +7,18 @@ export declare function generateTabItems({ items }: TabsProps): {
7
7
  label: import("@emotion/react/jsx-runtime").JSX.Element;
8
8
  key: string;
9
9
  style?: import("react").CSSProperties | undefined;
10
- children?: import("react").ReactNode;
11
10
  className?: string | undefined;
12
11
  id?: string | undefined;
12
+ children?: import("react").ReactNode;
13
13
  icon?: import("react").ReactNode;
14
- prefixCls?: string | undefined;
15
- disabled?: boolean | undefined;
16
- animated?: boolean | undefined;
17
- destroyInactiveTabPane?: boolean | undefined;
18
- forceRender?: boolean | undefined;
19
14
  closable?: boolean | undefined;
20
15
  closeIcon?: import("react").ReactNode;
21
- tabKey?: string | undefined;
22
16
  active?: boolean | undefined;
17
+ disabled?: boolean | undefined;
18
+ prefixCls?: string | undefined;
19
+ forceRender?: boolean | undefined;
20
+ destroyInactiveTabPane?: boolean | undefined;
21
+ animated?: boolean | undefined;
22
+ tabKey?: string | undefined;
23
23
  }[];
24
24
  export {};
@@ -1,6 +1,6 @@
1
1
  import { SelectOption } from "../../select";
2
2
  import { TabsProps as AntdTabsProps } from 'antd';
3
- import { TabsType } from 'antd/lib/tabs';
3
+ import { TabsType } from 'antd/es/tabs';
4
4
  import { Tab } from 'rc-tabs/lib/interface';
5
5
  export interface TabProps extends Tab, Omit<SelectOption, 'label'> {
6
6
  }
@@ -4,6 +4,7 @@ var _excluded = ["children", "tooltip", "rows", "autoShowTooltip"];
4
4
  import { generateTooltip } from "./..";
5
5
  import { getTooltipProps } from "../../tooltip";
6
6
  import { Tooltip, Typography } from 'antd';
7
+ import ResizeObserver from 'rc-resize-observer';
7
8
  import style from "../style";
8
9
  import { useText } from "./use-text";
9
10
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
@@ -16,12 +17,11 @@ export function Text(_ref) {
16
17
  _ref$autoShowTooltip = _ref.autoShowTooltip,
17
18
  autoShowTooltip = _ref$autoShowTooltip === void 0 ? true : _ref$autoShowTooltip,
18
19
  props = _objectWithoutProperties(_ref, _excluded);
19
- var _useText = useText({
20
- children: children
21
- }),
22
- key = _useText.key;
20
+ var _useText = useText(),
21
+ key = _useText.key,
22
+ onResize = _useText.onResize;
23
23
  if (tooltip === false || !rows) {
24
- return _jsx("div", _objectSpread(_objectSpread({
24
+ return _jsx("span", _objectSpread(_objectSpread({
25
25
  css: style.wordBreak
26
26
  }, props), {}, {
27
27
  children: children
@@ -29,19 +29,18 @@ export function Text(_ref) {
29
29
  }
30
30
  var ellipsis = {
31
31
  rows: rows,
32
- tooltip: getTooltipProps(_objectSpread({
33
- align: {
34
- offset: [0, 5]
35
- }
36
- }, generateTooltip(tooltip !== null && tooltip !== void 0 ? tooltip : children)))
32
+ tooltip: getTooltipProps(_objectSpread({}, generateTooltip(tooltip !== null && tooltip !== void 0 ? tooltip : children)))
37
33
  };
38
34
  if (autoShowTooltip) {
39
- return _jsx(Paragraph, _objectSpread(_objectSpread({
40
- css: style.wrapper
41
- }, props), {}, {
42
- ellipsis: ellipsis,
43
- children: children
44
- }), key);
35
+ return _jsx(ResizeObserver, {
36
+ onResize: onResize,
37
+ children: _jsx(Paragraph, _objectSpread(_objectSpread({
38
+ css: style.wrapper
39
+ }, props), {}, {
40
+ ellipsis: ellipsis,
41
+ children: children
42
+ }), key)
43
+ });
45
44
  }
46
45
  return _jsx(Tooltip, _objectSpread(_objectSpread({}, ellipsis.tooltip), {}, {
47
46
  children: _jsx(Paragraph, _objectSpread(_objectSpread({
@@ -1,4 +1,5 @@
1
- import { TextProps } from "..";
2
- export declare function useText({ children }: TextProps): {
1
+ import { SizeInfo } from 'rc-resize-observer';
2
+ export declare function useText(): {
3
3
  key: number;
4
+ onResize: (size: SizeInfo) => void | undefined;
4
5
  };
@@ -1,24 +1,17 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { useDebounce, useWindowResize } from "../../hooks";
3
- import { useState } from 'react';
4
- import { useUpdateEffect } from 'react-use';
5
- export function useText(_ref) {
6
- var children = _ref.children;
7
- var _useState = useState(0),
8
- _useState2 = _slicedToArray(_useState, 2),
9
- key = _useState2[0],
10
- setKey = _useState2[1];
11
- var reset = useDebounce(setKey, 150);
12
- useWindowResize(function (_ref2) {
13
- var width = _ref2.width;
14
- return reset(width);
2
+ import { useDebounce, useSafeState } from "../../hooks";
3
+ export function useText() {
4
+ var _useSafeState = useSafeState(0),
5
+ _useSafeState2 = _slicedToArray(_useSafeState, 2),
6
+ key = _useSafeState2[0],
7
+ setKey = _useSafeState2[1];
8
+ var reset = useDebounce(setKey, 150, {
9
+ leading: false
15
10
  });
16
-
17
- // 修复某些场景下,tooltip 会自动显示的问题
18
- useUpdateEffect(function () {
19
- reset(Date.now());
20
- }, [children]);
21
11
  return {
22
- key: key
12
+ key: key,
13
+ onResize: function onResize(size) {
14
+ return reset(size.width);
15
+ }
23
16
  };
24
17
  }
@@ -1,3 +1,3 @@
1
1
  import { TextProps } from "..";
2
- import type { TooltipProps } from 'antd/lib/tooltip';
2
+ import { TooltipProps } from "../../tooltip";
3
3
  export declare function generateTooltip(tooltip: TextProps['tooltip']): TooltipProps;
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
2
2
  var _templateObject, _templateObject2;
3
3
  import { css } from '@emotion/react';
4
4
  var style = {
5
- wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-typography {\n color: inherit;\n margin-bottom: 0;\n max-width: 100%;\n }\n "]))),
5
+ wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-typography {\n font-size: inherit;\n color: inherit;\n margin-bottom: 0;\n max-width: 100%;\n }\n "]))),
6
6
  wordBreak: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-wrap: break-word;\n word-break: break-word;\n "])))
7
7
  };
8
8
  export default style;
@@ -1,5 +1,5 @@
1
- import { EllipsisConfig } from 'antd/lib/typography/Base';
2
- import type { TypographyProps } from 'antd/lib/typography/Typography';
1
+ import { EllipsisConfig } from 'antd/es/typography/Base';
2
+ import type { TypographyProps } from 'antd/es/typography/Typography';
3
3
  export interface TextProps extends Omit<TypographyProps<any>, 'onChange'> {
4
4
  /**
5
5
  * @description 最多显示的行数,设置为 `0` 时,不显示省略号
@@ -4,45 +4,55 @@ import { TooltipProps } from "..";
4
4
  export declare const tooltipOverlayClassName: string;
5
5
  export declare function getTooltipProps(props: TooltipProps): {
6
6
  color?: string | undefined;
7
- title?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
8
- overlay?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
7
+ title?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
8
+ overlay?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
9
+ styles?: Partial<Record<"body" | "root", import("react").CSSProperties>> | undefined;
10
+ classNames: Partial<Record<"body" | "root", string>>;
9
11
  style?: import("react").CSSProperties | undefined;
10
12
  className?: string | undefined;
11
- placement?: import("antd/lib/tooltip").TooltipPlacement | undefined;
12
- builtinPlacements?: import("rc-trigger").BuildInPlacements | undefined;
13
+ rootClassName?: string | undefined;
14
+ placement?: import("antd/es/tooltip").TooltipPlacement | undefined;
15
+ builtinPlacements?: import("@rc-component/trigger").BuildInPlacements | undefined;
13
16
  openClassName?: string | undefined;
14
- arrowPointAtCenter: boolean;
15
- autoAdjustOverflow?: boolean | import("antd/lib/tooltip").AdjustOverflow | undefined;
17
+ arrowPointAtCenter?: boolean | undefined;
18
+ arrow: boolean | {
19
+ arrowPointAtCenter?: boolean | undefined;
20
+ pointAtCenter?: boolean | undefined;
21
+ };
22
+ autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
16
23
  getPopupContainer: typeof getPopupContainer;
17
24
  children?: import("react").ReactNode;
18
- visible?: boolean | undefined;
25
+ destroyTooltipOnHide?: boolean | {
26
+ keepParent?: boolean | undefined;
27
+ } | undefined;
28
+ destroyOnHidden?: boolean | undefined;
19
29
  open?: boolean | undefined;
20
- defaultVisible?: boolean | undefined;
21
30
  defaultOpen?: boolean | undefined;
22
- onVisibleChange?: ((visible: boolean) => void) | undefined;
23
31
  onOpenChange?: ((visible: boolean) => void) | undefined;
24
- afterVisibleChange?: ((visible: boolean) => void) | undefined;
25
32
  afterOpenChange?: ((visible: boolean) => void) | undefined;
33
+ visible?: boolean | undefined;
34
+ defaultVisible?: boolean | undefined;
35
+ onVisibleChange?: ((visible: boolean) => void) | undefined;
36
+ afterVisibleChange?: ((visible: boolean) => void) | undefined;
26
37
  zIndex?: number | undefined;
27
38
  animation?: string | undefined;
28
39
  motion?: import("rc-motion").CSSMotionProps | undefined;
29
40
  id?: string | undefined;
30
- onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
31
- trigger?: string | string[] | undefined;
32
- transitionName?: string | undefined;
33
- overlayStyle?: import("react").CSSProperties | undefined;
34
- overlayClassName: string;
35
41
  prefixCls?: string | undefined;
42
+ transitionName?: string | undefined;
36
43
  mouseEnterDelay?: number | undefined;
37
44
  mouseLeaveDelay?: number | undefined;
45
+ onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
46
+ overlayClassName?: string | undefined;
47
+ align?: import("@rc-component/trigger").AlignType | undefined;
48
+ overlayStyle?: import("react").CSSProperties | undefined;
49
+ trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
50
+ popupVisible?: boolean | undefined;
51
+ forceRender?: boolean | undefined;
52
+ fresh?: boolean | undefined;
38
53
  getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
39
- destroyTooltipOnHide?: boolean | {
40
- keepParent?: boolean | undefined;
41
- } | undefined;
42
- align?: import("rc-trigger/lib/interface").AlignType | undefined;
43
- showArrow?: boolean | undefined;
54
+ showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
44
55
  arrowContent?: import("react").ReactNode;
45
- popupVisible?: boolean | undefined;
46
56
  overlayInnerStyle?: import("react").CSSProperties | undefined;
47
57
  };
48
58
  export declare function Tooltip(props: TooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -8,8 +8,12 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
8
8
  export var tooltipOverlayClassName = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --tooltip-background-color: #02334a;\n\n .ant-tooltip-inner {\n border-radius: 8px;\n white-space: pre-wrap;\n line-height: 1.3;\n background-color: var(--tooltip-background-color);\n }\n\n .ant-tooltip-arrow-content {\n --antd-arrow-background-color: var(--tooltip-background-color);\n }\n"])));
9
9
  export function getTooltipProps(props) {
10
10
  return _objectSpread({
11
- overlayClassName: tooltipOverlayClassName,
12
- arrowPointAtCenter: true,
11
+ classNames: {
12
+ root: tooltipOverlayClassName
13
+ },
14
+ arrow: {
15
+ pointAtCenter: true
16
+ },
13
17
  getPopupContainer: getPopupContainer
14
18
  }, props);
15
19
  }
@@ -1,4 +1,4 @@
1
- import { TooltipPropsWithOverlay } from 'antd/lib/tooltip';
1
+ import { TooltipPropsWithOverlay } from 'antd/es/tooltip';
2
2
  export interface TooltipProps extends TooltipPropsWithOverlay {
3
3
  /**
4
4
  * @description 背景颜色
@@ -1,2 +1,2 @@
1
- import { TreeProps } from '../type';
1
+ import { TreeProps } from "..";
2
2
  export declare function Tree(props: TreeProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -2,6 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
2
2
  var _templateObject;
3
3
  import { css } from '@emotion/react';
4
4
  var style = {
5
- wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n\n .ant-select-tree,\n .ant-tree-select-dropdown {\n background: unset;\n box-shadow: unset;\n }\n\n .ant-select-selector,\n .ant-select-arrow {\n opacity: 0 !important;\n height: 0 !important;\n border: none !important;\n padding: 0 !important;\n overflow: hidden !important;\n\n ~ div {\n position: unset !important;\n }\n }\n\n .ant-tree-select-dropdown {\n position: unset !important;\n width: 100% !important;\n min-width: unset !important;\n padding: 0;\n }\n "])))
5
+ wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n\n .ant-select-tree,\n .ant-tree-select-dropdown {\n background: unset;\n box-shadow: unset;\n }\n\n .ant-select-selector,\n .ant-select-arrow {\n display: none !important;\n\n ~ div {\n position: unset !important;\n }\n }\n\n .ant-tree-select-dropdown {\n position: unset !important;\n width: 100% !important;\n min-width: unset !important;\n padding: 0;\n }\n "])))
6
6
  };
7
7
  export default style;