@hsu-react/ui 0.0.9 → 0.0.10

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 (74) hide show
  1. package/es/components/FormItem/ItemContainer/index.d.ts +2 -0
  2. package/es/components/FormItem/ItemContainer/index.js +4 -15
  3. package/es/components/Search/{_components → SearchAdvanced/_components}/AdvancedFiltersDrawer/index.d.ts +3 -3
  4. package/es/components/Search/{_components → SearchAdvanced/_components}/AdvancedFiltersDrawer/index.js +3 -3
  5. package/es/components/Search/SearchAdvanced/index.js +26 -148
  6. package/es/components/Search/SearchCard/index.js +1 -1
  7. package/es/components/Search/{_components → SearchCollapsible/_components}/CollapseToggle/index.js +2 -2
  8. package/es/components/Search/SearchCollapsible/index.js +17 -138
  9. package/es/components/Search/SearchWithFilter/index.js +4 -143
  10. package/es/components/Search/SearchWithMore/index.js +11 -142
  11. package/es/components/Search/_components/FilterDropdown/index.js +5 -6
  12. package/es/components/Search/_components/SearchBase/index.d.ts +32 -0
  13. package/es/components/Search/_components/SearchBase/index.js +185 -0
  14. package/es/components/Search/_hooks/useSearchCommon.js +5 -11
  15. package/es/components/Search/_hooks/useSearchExpand.js +4 -13
  16. package/es/components/Search/_utils/calculateButtonGroupAndColumnWidth.js +3 -10
  17. package/es/components/Search/_utils/calculateVisibleItems.js +4 -5
  18. package/es/components/Search/_utils/index.d.ts +2 -0
  19. package/es/components/Search/_utils/index.js +3 -1
  20. package/es/components/Search/_utils/measureButtonGroupWidth.d.ts +6 -0
  21. package/es/components/Search/_utils/measureButtonGroupWidth.js +18 -0
  22. package/es/components/Search/_utils/shouldDisplayExtraItem.d.ts +11 -0
  23. package/es/components/Search/_utils/shouldDisplayExtraItem.js +13 -0
  24. package/es/components/Search/index.d.ts +4 -0
  25. package/es/components/Search/index.js +6 -133
  26. package/es/components/Table/_hooks/useTableColumns.js +11 -0
  27. package/lib/components/FormItem/ItemContainer/index.d.ts +2 -0
  28. package/lib/components/FormItem/ItemContainer/index.js +2 -5
  29. package/lib/components/Search/{_components → SearchAdvanced/_components}/AdvancedFiltersDrawer/index.d.ts +3 -3
  30. package/lib/components/Search/{_components → SearchAdvanced/_components}/AdvancedFiltersDrawer/index.js +3 -3
  31. package/lib/components/Search/SearchAdvanced/index.js +19 -134
  32. package/lib/components/Search/SearchCard/index.js +1 -1
  33. package/lib/components/Search/{_components → SearchCollapsible/_components}/CollapseToggle/index.js +2 -2
  34. package/lib/components/Search/SearchCollapsible/index.js +12 -124
  35. package/lib/components/Search/SearchWithFilter/index.js +5 -129
  36. package/lib/components/Search/SearchWithMore/index.js +7 -126
  37. package/lib/components/Search/_components/FilterDropdown/index.js +5 -6
  38. package/lib/components/Search/_components/SearchBase/index.d.ts +32 -0
  39. package/lib/components/Search/_components/SearchBase/index.js +169 -0
  40. package/lib/components/Search/_hooks/useSearchCommon.js +4 -6
  41. package/lib/components/Search/_hooks/useSearchExpand.js +2 -13
  42. package/lib/components/Search/_utils/calculateButtonGroupAndColumnWidth.js +2 -10
  43. package/lib/components/Search/_utils/calculateVisibleItems.js +3 -5
  44. package/lib/components/Search/_utils/index.d.ts +2 -0
  45. package/lib/components/Search/_utils/index.js +15 -1
  46. package/lib/components/Search/_utils/measureButtonGroupWidth.d.ts +6 -0
  47. package/lib/components/Search/_utils/measureButtonGroupWidth.js +24 -0
  48. package/lib/components/Search/_utils/shouldDisplayExtraItem.d.ts +11 -0
  49. package/lib/components/Search/_utils/shouldDisplayExtraItem.js +19 -0
  50. package/lib/components/Search/index.d.ts +4 -0
  51. package/lib/components/Search/index.js +8 -119
  52. package/lib/components/Table/_hooks/useTableColumns.js +11 -0
  53. package/package.json +1 -1
  54. package/src/components/FormItem/ItemContainer/index.tsx +4 -7
  55. package/src/components/Search/{_components → SearchAdvanced/_components}/AdvancedFiltersDrawer/index.tsx +6 -6
  56. package/src/components/Search/SearchAdvanced/index.tsx +25 -164
  57. package/src/components/Search/SearchCard/index.tsx +1 -1
  58. package/src/components/Search/{_components → SearchCollapsible/_components}/CollapseToggle/index.tsx +2 -2
  59. package/src/components/Search/SearchCollapsible/index.tsx +13 -162
  60. package/src/components/Search/SearchWithFilter/index.tsx +2 -164
  61. package/src/components/Search/SearchWithMore/index.tsx +9 -161
  62. package/src/components/Search/_components/FilterDropdown/index.tsx +5 -6
  63. package/src/components/Search/_components/SearchBase/index.tsx +224 -0
  64. package/src/components/Search/_hooks/useSearchCommon.ts +10 -13
  65. package/src/components/Search/_hooks/useSearchExpand.ts +3 -13
  66. package/src/components/Search/_utils/calculateButtonGroupAndColumnWidth.ts +2 -10
  67. package/src/components/Search/_utils/calculateVisibleItems.ts +10 -11
  68. package/src/components/Search/_utils/index.ts +2 -0
  69. package/src/components/Search/_utils/measureButtonGroupWidth.ts +23 -0
  70. package/src/components/Search/_utils/shouldDisplayExtraItem.ts +23 -0
  71. package/src/components/Search/index.tsx +7 -153
  72. package/src/components/Table/_hooks/useTableColumns.tsx +17 -0
  73. /package/es/components/Search/{_components → SearchCollapsible/_components}/CollapseToggle/index.d.ts +0 -0
  74. /package/lib/components/Search/{_components → SearchCollapsible/_components}/CollapseToggle/index.d.ts +0 -0
@@ -1,17 +1,10 @@
1
1
  import React from "react";
2
- import { Form as AntdForm } from "antd";
3
- import FormItem from "../../FormItem";
4
- import { CSSProperties } from "react";
5
2
  import classNames from "classnames";
6
3
  import styles from "../index.module.scss";
7
- import { useSearchCommon } from "../_hooks";
4
+ import SearchBase from "../_components/SearchBase";
5
+ import { AdvancedFiltersDrawer } from "./_components/AdvancedFiltersDrawer";
8
6
  import { ChakraButtonProps } from "../../Button";
9
7
  import { DrawerFormProps } from "../../Form/DrawerForm";
10
- import { ButtonGroup } from "../_components/ButtonGroup";
11
- import { SearchButtons } from "../_components/SearchButtons";
12
- import { FilterDropdown } from "../_components/FilterDropdown";
13
- import { ExpandButton } from "../_components/ExpandButton";
14
- import { AdvancedFiltersDrawer } from "../_components/AdvancedFiltersDrawer";
15
8
  import { SearchPropsWithFilter } from "../_types";
16
9
 
17
10
  export interface SearchAdvancedProps extends SearchPropsWithFilter {
@@ -28,168 +21,36 @@ export interface SearchAdvancedProps extends SearchPropsWithFilter {
28
21
  */
29
22
  const SearchAdvanced: React.FC<SearchAdvancedProps> = (props) => {
30
23
  const {
31
- searchItems = [],
32
- moreSearchItems = [],
33
24
  className,
34
- onSearch,
35
- onReset,
36
- externalForm,
37
- hasPermi,
38
- columnNum = 4,
39
- beforeButtonGroup,
40
- affterButtonGroup,
41
- searchData,
42
25
  advancedFiltersProps,
43
26
  setFilter,
44
27
  minLabelWidth,
45
- defaultExpanded = false,
46
- onExpandChange,
47
- autoAdaptWidth = true,
48
- baseWidth,
49
- onValuesChange,
50
- searchDisabled = false,
51
- showAllSearchItems = false,
52
- searchText,
53
- resetText,
54
- onFilterChange,
55
- columnOffsetWidth = 0,
28
+ ...rest
56
29
  } = props;
57
30
 
58
- const [form] = AntdForm.useForm(externalForm);
59
-
60
- const {
61
- containerRef,
62
- buttonGroupRef,
63
- cls,
64
- getLabelWidth,
65
- processedSearchItems,
66
- setSearchItems,
67
- currentSearchItems,
68
- totalColumnNum,
69
- expand,
70
- setExpand,
71
- toggleExpand,
72
- showExpandButton,
73
- onSearchClick,
74
- onResetClick,
75
- shouldRender,
76
- permitted,
77
- } = useSearchCommon({
78
- form,
79
- searchItems,
80
- moreSearchItems,
81
- searchData,
82
- hasPermi,
83
- beforeButtonGroup,
84
- affterButtonGroup,
85
- columnNum,
86
- autoAdaptWidth,
87
- defaultExpanded,
88
- onExpandChange,
89
- showAllSearchItems,
90
- minLabelWidth,
91
- baseWidth,
92
- onSearch,
93
- onReset,
94
- columnOffsetWidth,
95
- });
96
-
97
- if (!shouldRender) {
98
- return null;
99
- }
100
-
101
31
  return (
102
- <>
103
- <div
104
- ref={containerRef}
105
- className={classNames(styles.Search, className, {
106
- [styles.advancedFilters]: true,
107
- })}
108
- style={
109
- {
110
- "--column-number": totalColumnNum,
111
- "--column-offset-width": `${columnOffsetWidth}px`,
112
- } as CSSProperties
113
- }
114
- >
115
- <div
116
- className={classNames(styles.searchOption, styles[expand.toString()])}
117
- >
118
- <AntdForm
119
- form={form}
120
- className={classNames(styles.option, cls)}
121
- onValuesChange={onValuesChange}
122
- >
123
- {permitted &&
124
- currentSearchItems?.map((item) => {
125
- return (
126
- <FormItem
127
- {...item}
128
- key={item.name}
129
- className={classNames(styles.item, item.className, {
130
- [styles.unFill]: item.width !== undefined,
131
- })}
132
- label={undefined}
133
- labelWidth={undefined}
134
- />
135
- );
136
- })}
137
- {(beforeButtonGroup?.length ||
138
- affterButtonGroup?.length ||
139
- permitted) && (
140
- <ButtonGroup
141
- beforeButtonGroup={beforeButtonGroup}
142
- affterButtonGroup={affterButtonGroup}
143
- expandButton={
144
- <ExpandButton
145
- expand={expand}
146
- toggleExpand={toggleExpand}
147
- advancedFilters={true}
148
- showExpandButton={showExpandButton}
149
- showAllSearchItems={
150
- showAllSearchItems || !!moreSearchItems?.length
151
- }
152
- />
153
- }
154
- permitted={permitted}
155
- ref={buttonGroupRef}
156
- >
157
- {currentSearchItems.length > 0 && (
158
- <SearchButtons
159
- onSearch={onSearchClick}
160
- onReset={onResetClick}
161
- searchDisabled={searchDisabled}
162
- searchText={searchText}
163
- resetText={resetText}
164
- />
165
- )}
166
- {setFilter && (
167
- <FilterDropdown
168
- searchItems={processedSearchItems}
169
- originalSearchItems={searchItems}
170
- setSearchItems={setSearchItems}
171
- onFilterChange={onFilterChange}
172
- />
173
- )}
174
- </ButtonGroup>
175
- )}
176
- </AntdForm>
177
- </div>
178
- </div>
179
- {permitted && setExpand && (
180
- <AdvancedFiltersDrawer
181
- expand={expand}
182
- setExpand={setExpand}
183
- searchItems={processedSearchItems}
184
- form={form}
185
- getLabelWidth={getLabelWidth}
186
- minLabelWidth={minLabelWidth}
187
- onSearchClick={onSearchClick}
188
- onResetClick={onResetClick}
189
- advancedFiltersProps={advancedFiltersProps}
190
- />
191
- )}
192
- </>
32
+ <SearchBase
33
+ {...rest}
34
+ minLabelWidth={minLabelWidth}
35
+ advancedFilters
36
+ showFilter={!!setFilter}
37
+ className={classNames(className, styles.advancedFilters)}
38
+ renderOutside={(ctx) =>
39
+ ctx.setExpand && (
40
+ <AdvancedFiltersDrawer
41
+ expand={ctx.expand}
42
+ setExpand={ctx.setExpand}
43
+ searchItems={ctx.processedSearchItems}
44
+ form={ctx.form}
45
+ getLabelWidth={ctx.getLabelWidth}
46
+ minLabelWidth={minLabelWidth}
47
+ onSearchClick={ctx.onSearchClick}
48
+ onResetClick={ctx.onResetClick}
49
+ advancedFiltersProps={advancedFiltersProps}
50
+ />
51
+ )
52
+ }
53
+ />
193
54
  );
194
55
  };
195
56
 
@@ -77,7 +77,7 @@ const SearchCard: React.FC<SearchCardProps> = memo((props) => {
77
77
  style={
78
78
  {
79
79
  "--searchCard-column-gap": `${gap}px`,
80
- " --searchCard-padding-left-right": `${padding}px`,
80
+ "--searchCard-padding-left-right": `${padding}px`,
81
81
  } as CSSProperties
82
82
  }
83
83
  >
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import Icon from "../../../Icon";
2
+ import Icon from "../../../../Icon";
3
3
  import classNames from "classnames";
4
- import styles from "../../index.module.scss";
4
+ import styles from "../../../index.module.scss";
5
5
 
6
6
  interface CollapseToggleProps {
7
7
  collapse: boolean;
@@ -1,16 +1,9 @@
1
- import React from "react";
2
- import { Form as AntdForm } from "antd";
3
- import FormItem from "../../FormItem";
4
- import { CSSProperties, useCallback, useState } from "react";
1
+ import React, { useCallback, useState } from "react";
5
2
  import classNames from "classnames";
6
3
  import styles from "../index.module.scss";
7
- import { useSearchCommon } from "../_hooks";
4
+ import SearchBase from "../_components/SearchBase";
5
+ import { CollapseToggle } from "./_components/CollapseToggle";
8
6
  import { ChakraButtonProps } from "../../Button";
9
- import { ButtonGroup } from "../_components/ButtonGroup";
10
- import { SearchButtons } from "../_components/SearchButtons";
11
- import { FilterDropdown } from "../_components/FilterDropdown";
12
- import { ExpandButton } from "../_components/ExpandButton";
13
- import { CollapseToggle } from "../_components/CollapseToggle";
14
7
  import { SearchPropsWithFilter } from "../_types";
15
8
 
16
9
  export interface SearchCollapsibleProps extends SearchPropsWithFilter {
@@ -27,73 +20,16 @@ export interface SearchCollapsibleProps extends SearchPropsWithFilter {
27
20
  */
28
21
  const SearchCollapsible: React.FC<SearchCollapsibleProps> = (props) => {
29
22
  const {
30
- searchItems = [],
31
- moreSearchItems = [],
32
23
  className,
33
- onSearch,
34
- onReset,
35
- externalForm,
36
- hasPermi,
37
- columnNum = 4,
38
- beforeButtonGroup,
39
- affterButtonGroup,
40
- searchData,
41
- setFilter,
42
- minLabelWidth,
43
24
  defaultExpanded = false,
44
25
  onCollapseToggle,
45
- onExpandChange,
46
- autoAdaptWidth = true,
47
- baseWidth,
48
- onValuesChange,
49
- searchDisabled = false,
50
- showAllSearchItems = false,
51
- searchText,
52
- resetText,
53
- onFilterChange,
54
- columnOffsetWidth = 0,
26
+ setFilter,
27
+ ...rest
55
28
  } = props;
56
29
 
57
- const [form] = AntdForm.useForm(externalForm);
58
30
  // collapse 的语义是反的,所以需要取反 defaultExpanded
59
31
  const [collapse, setCollapse] = useState(!defaultExpanded);
60
32
 
61
- const {
62
- containerRef,
63
- buttonGroupRef,
64
- cls,
65
- getLabelWidth,
66
- processedSearchItems,
67
- setSearchItems,
68
- currentSearchItems,
69
- totalColumnNum,
70
- expand,
71
- toggleExpand,
72
- showExpandButton,
73
- onSearchClick,
74
- onResetClick,
75
- shouldRender,
76
- permitted,
77
- } = useSearchCommon({
78
- form,
79
- searchItems,
80
- moreSearchItems,
81
- searchData,
82
- hasPermi,
83
- beforeButtonGroup,
84
- affterButtonGroup,
85
- columnNum,
86
- autoAdaptWidth,
87
- defaultExpanded,
88
- onExpandChange,
89
- showAllSearchItems,
90
- minLabelWidth,
91
- baseWidth,
92
- onSearch,
93
- onReset,
94
- columnOffsetWidth,
95
- });
96
-
97
33
  // 处理折叠切换
98
34
  const handleCollapseToggle = useCallback(() => {
99
35
  setCollapse((prev) => {
@@ -103,103 +39,18 @@ const SearchCollapsible: React.FC<SearchCollapsibleProps> = (props) => {
103
39
  });
104
40
  }, [onCollapseToggle]);
105
41
 
106
- if (!shouldRender) {
107
- return null;
108
- }
109
-
110
42
  return (
111
- <div
112
- ref={containerRef}
113
- className={classNames(styles.Search, className, {
114
- [styles.collapseExpand]: true,
43
+ <SearchBase
44
+ {...rest}
45
+ defaultExpanded={defaultExpanded}
46
+ showFilter={!!setFilter}
47
+ className={classNames(className, styles.collapseExpand, {
115
48
  [styles.collapse]: collapse,
116
49
  })}
117
- style={
118
- {
119
- "--column-number": totalColumnNum,
120
- "--column-offset-width": `${columnOffsetWidth}px`,
121
- } as CSSProperties
122
- }
123
- >
124
- <div
125
- className={classNames(styles.searchOption, styles[expand.toString()])}
126
- >
127
- <AntdForm
128
- form={form}
129
- className={classNames(styles.option, cls)}
130
- onValuesChange={onValuesChange}
131
- >
132
- {permitted &&
133
- currentSearchItems?.map((item, idx) => {
134
- // 计算同一列的项(用于计算标签宽度)
135
- const visibleCurrentItems = currentSearchItems.filter(
136
- (i) => i.visible !== false
137
- );
138
- const columnIndex = idx % totalColumnNum;
139
- const sameColumnItems = visibleCurrentItems.filter(
140
- (_, _idx) => _idx % totalColumnNum === columnIndex
141
- );
142
-
143
- return (
144
- <FormItem
145
- {...item}
146
- key={item.name}
147
- className={classNames(styles.item, item.className, {
148
- [styles.unFill]: item.width !== undefined,
149
- })}
150
- labelWidth={
151
- item.width !== undefined
152
- ? undefined
153
- : getLabelWidth(sameColumnItems, undefined, minLabelWidth)
154
- }
155
- />
156
- );
157
- })}
158
- {(beforeButtonGroup?.length ||
159
- affterButtonGroup?.length ||
160
- permitted) && (
161
- <ButtonGroup
162
- beforeButtonGroup={beforeButtonGroup}
163
- affterButtonGroup={affterButtonGroup}
164
- expandButton={
165
- <ExpandButton
166
- expand={expand}
167
- toggleExpand={toggleExpand}
168
- advancedFilters={false}
169
- showExpandButton={showExpandButton}
170
- showAllSearchItems={
171
- showAllSearchItems || !!moreSearchItems?.length
172
- }
173
- />
174
- }
175
- permitted={permitted}
176
- ref={buttonGroupRef}
177
- >
178
- {currentSearchItems.length > 0 && (
179
- <SearchButtons
180
- onSearch={onSearchClick}
181
- onReset={onResetClick}
182
- searchDisabled={searchDisabled}
183
- searchText={searchText}
184
- resetText={resetText}
185
- />
186
- )}
187
- {setFilter && (
188
- <FilterDropdown
189
- searchItems={processedSearchItems}
190
- originalSearchItems={searchItems}
191
- setSearchItems={setSearchItems}
192
- onFilterChange={onFilterChange}
193
- />
194
- )}
195
- </ButtonGroup>
196
- )}
197
- </AntdForm>
198
- </div>
199
- {permitted && (
50
+ afterForm={
200
51
  <CollapseToggle collapse={collapse} onToggle={handleCollapseToggle} />
201
- )}
202
- </div>
52
+ }
53
+ />
203
54
  );
204
55
  };
205
56
 
@@ -1,15 +1,6 @@
1
1
  import React from "react";
2
- import { Form as AntdForm } from "antd";
3
- import FormItem from "../../FormItem";
4
- import { CSSProperties } from "react";
5
- import classNames from "classnames";
6
- import styles from "../index.module.scss";
7
- import { useSearchCommon } from "../_hooks";
2
+ import SearchBase from "../_components/SearchBase";
8
3
  import { ChakraButtonProps } from "../../Button";
9
- import { ButtonGroup } from "../_components/ButtonGroup";
10
- import { SearchButtons } from "../_components/SearchButtons";
11
- import { FilterDropdown } from "../_components/FilterDropdown";
12
- import { ExpandButton } from "../_components/ExpandButton";
13
4
  import { SearchPropsWithFilter } from "../_types";
14
5
 
15
6
  export interface SearchWithFilterProps extends SearchPropsWithFilter {
@@ -24,160 +15,7 @@ export interface SearchWithFilterProps extends SearchPropsWithFilter {
24
15
  * - 提供更灵活的搜索体验
25
16
  */
26
17
  const SearchWithFilter: React.FC<SearchWithFilterProps> = (props) => {
27
- const {
28
- searchItems = [],
29
- moreSearchItems = [],
30
- className,
31
- onSearch,
32
- onReset,
33
- externalForm,
34
- hasPermi,
35
- columnNum = 4,
36
- beforeButtonGroup,
37
- affterButtonGroup,
38
- searchData,
39
- minLabelWidth,
40
- defaultExpanded = false,
41
- onExpandChange,
42
- autoAdaptWidth = true,
43
- baseWidth,
44
- onValuesChange,
45
- searchDisabled = false,
46
- showAllSearchItems = false,
47
- searchText,
48
- resetText,
49
- onFilterChange,
50
- columnOffsetWidth = 0,
51
- } = props;
52
-
53
- const [form] = AntdForm.useForm(externalForm);
54
-
55
- const {
56
- containerRef,
57
- buttonGroupRef,
58
- cls,
59
- getLabelWidth,
60
- processedSearchItems,
61
- setSearchItems,
62
- currentSearchItems,
63
- totalColumnNum,
64
- expand,
65
- toggleExpand,
66
- showExpandButton,
67
- onSearchClick,
68
- onResetClick,
69
- shouldRender,
70
- permitted,
71
- } = useSearchCommon({
72
- form,
73
- searchItems,
74
- moreSearchItems,
75
- searchData,
76
- hasPermi,
77
- beforeButtonGroup,
78
- affterButtonGroup,
79
- columnNum,
80
- autoAdaptWidth,
81
- defaultExpanded,
82
- onExpandChange,
83
- showAllSearchItems,
84
- minLabelWidth,
85
- baseWidth,
86
- onSearch,
87
- onReset,
88
- columnOffsetWidth,
89
- });
90
-
91
- if (!shouldRender) {
92
- return null;
93
- }
94
-
95
- return (
96
- <div
97
- ref={containerRef}
98
- className={classNames(styles.Search, className)}
99
- style={
100
- {
101
- "--column-number": totalColumnNum,
102
- "--column-offset-width": `${columnOffsetWidth}px`,
103
- } as CSSProperties
104
- }
105
- >
106
- <div
107
- className={classNames(styles.searchOption, styles[expand.toString()])}
108
- >
109
- <AntdForm
110
- form={form}
111
- className={classNames(styles.option, cls)}
112
- onValuesChange={onValuesChange}
113
- >
114
- {permitted &&
115
- currentSearchItems?.map((item, idx) => {
116
- // 计算同一列的项(用于计算标签宽度)
117
- const visibleCurrentItems = currentSearchItems.filter(
118
- (i) => i.visible !== false
119
- );
120
- const columnIndex = idx % totalColumnNum;
121
- const sameColumnItems = visibleCurrentItems.filter(
122
- (_, _idx) => _idx % totalColumnNum === columnIndex
123
- );
124
-
125
- return (
126
- <FormItem
127
- {...item}
128
- key={item.name}
129
- className={classNames(styles.item, item.className, {
130
- [styles.unFill]: item.width !== undefined,
131
- })}
132
- labelWidth={
133
- item.width !== undefined
134
- ? undefined
135
- : getLabelWidth(sameColumnItems, undefined, minLabelWidth)
136
- }
137
- />
138
- );
139
- })}
140
- {(beforeButtonGroup?.length ||
141
- affterButtonGroup?.length ||
142
- permitted) && (
143
- <ButtonGroup
144
- beforeButtonGroup={beforeButtonGroup}
145
- affterButtonGroup={affterButtonGroup}
146
- expandButton={
147
- <ExpandButton
148
- expand={expand}
149
- toggleExpand={toggleExpand}
150
- advancedFilters={false}
151
- showExpandButton={showExpandButton}
152
- showAllSearchItems={
153
- showAllSearchItems || !!moreSearchItems?.length
154
- }
155
- />
156
- }
157
- permitted={permitted}
158
- ref={buttonGroupRef}
159
- >
160
- {currentSearchItems.length > 0 && (
161
- <SearchButtons
162
- onSearch={onSearchClick}
163
- onReset={onResetClick}
164
- searchDisabled={searchDisabled}
165
- searchText={searchText}
166
- resetText={resetText}
167
- />
168
- )}
169
- <FilterDropdown
170
- searchItems={processedSearchItems}
171
- originalSearchItems={searchItems}
172
- setSearchItems={setSearchItems}
173
- onFilterChange={onFilterChange}
174
- />
175
- </ButtonGroup>
176
- )}
177
- </AntdForm>
178
- </div>
179
- </div>
180
- );
18
+ return <SearchBase {...props} showFilter />;
181
19
  };
182
20
 
183
21
  export default SearchWithFilter;