@arim-aisdc/public-components 2.3.23 → 2.3.25

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.
@@ -163,7 +163,10 @@ var Filter = function Filter(_ref) {
163
163
  fetchOptions(value);
164
164
  }, 500), [fetchOptions]);
165
165
  useEffect(function () {
166
- if ([FilterType.MultiSelect, FilterType.SingleSelect].includes(filterType)) {
166
+ if ([FilterType.MultiSelect].includes(filterType)) {
167
+ // 打开后自动获取可选值
168
+ fetchOptions(columnFilterValue);
169
+ } else if ([FilterType.SingleSelect].includes(filterType)) {
167
170
  // 打开后自动获取可选值
168
171
  var _ref3 = columnFilterValue || {},
169
172
  optionsParam = _ref3.optionsParam;
@@ -61,11 +61,12 @@ var SingleSelect = function SingleSelect(_ref) {
61
61
  optionsParam = _ref3.optionsParam;
62
62
  setInnerValue(filterValue);
63
63
  setInputSearchValue(optionsParam);
64
- if (!isFrontSearch) {
65
- onSearch(optionsParam);
66
- }
64
+ // if (!isFrontSearch) {
65
+ // onSearch(optionsParam);
66
+ // }
67
67
  }, [value]);
68
68
  var handleInputChange = function handleInputChange(e) {
69
+ isFirstScroll.current = false;
69
70
  var value = e.target.value;
70
71
  setInputSearchValue(value);
71
72
  if (!isFrontSearch) {
@@ -79,7 +80,6 @@ var SingleSelect = function SingleSelect(_ref) {
79
80
  function scrollToSelectedItem() {
80
81
  var selectedElement = document.querySelector(".item[data-id=".concat(value.filterValue, "]"));
81
82
  if (!selectedElement) return;
82
- isFirstScroll.current = false;
83
83
  if (selectedElement) {
84
84
  selectedElement.scrollIntoView({
85
85
  behavior: 'smooth',
@@ -10,18 +10,27 @@
10
10
 
11
11
  .filter-panel-wrapper {
12
12
  position: fixed;
13
- z-index: 9999;
13
+ // z-index: 9999;
14
14
  border-radius: 2px;
15
15
  width: fit-content;
16
+ height: fit-content;
16
17
  box-shadow: 0px 5px 12px 4px rgba(3, 6, 33, 0.15);
17
18
  background: @tableSettingModalBgc;
18
19
  // border: 1px solid #d9d9d9;
19
20
  transform: translateX(-100%);
20
21
  }
21
22
 
23
+ :global {
24
+ .ant-select-dropdown {
25
+ position: relative;
26
+ z-index: 9999;
27
+ }
28
+ }
29
+
22
30
  .single-com-wrapper {
23
31
  padding: 8px 12px;
24
32
  border-radius: 2px;
33
+ position: relative;
25
34
  }
26
35
 
27
36
  .filter-icon-wrapper {
@@ -1,13 +1,13 @@
1
1
  import { TableMaxColumnType } from "../../type";
2
- export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
3
- export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
4
- export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
5
- export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
2
+ export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
3
+ export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
4
+ export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
5
+ export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
6
6
  declare const customSortFns: {
7
- numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
8
- stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
9
- timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
10
- numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
7
+ numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
8
+ stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
9
+ timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
10
+ numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
11
11
  };
12
12
  export default customSortFns;
13
13
  export type SortFnType = keyof typeof customSortFns | undefined;
@@ -125,6 +125,10 @@ export var getFormatFilters = function getFormatFilters(columns, originFilters)
125
125
  // 多选组件
126
126
  formatFilters["".concat(formatKey, "List")] = value;
127
127
  // formatFilters[formatKey] = value;
128
+ } else if (filterType === FilterType.SingleSelect) {
129
+ // 单选组件
130
+ formatFilters[formatKey] = value.filterValue;
131
+ // formatFilters[formatKey] = value;
128
132
  } else {
129
133
  // 其他
130
134
  formatFilters[formatKey] = value;
@@ -195,8 +199,11 @@ export var getFormatFiltersV2 = function getFormatFiltersV2(columns, originFilte
195
199
  // Input组件
196
200
  res.operator = FilterOperator.Contains;
197
201
  res.value = value;
202
+ } else if (filterType === FilterType.SingleSelect) {
203
+ res.operator = FilterOperator.Eq;
204
+ res.value = value.filterValue;
198
205
  } else {
199
- // 其他组件: SingleDate/SingleNumber/SingleSelect
206
+ // 其他组件: SingleDate/SingleNumber
200
207
  res.operator = FilterOperator.Eq;
201
208
  res.value = value;
202
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.23",
3
+ "version": "2.3.25",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",