funda-ui 4.7.345 → 4.7.445
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.
- package/CascadingSelect/index.css +2 -1
- package/CascadingSelectE2E/index.css +2 -1
- package/Table/index.js +16 -1
- package/lib/cjs/Table/index.js +16 -1
- package/lib/css/CascadingSelect/index.css +2 -1
- package/lib/css/CascadingSelectE2E/index.css +2 -1
- package/lib/esm/CascadingSelect/index.scss +2 -1
- package/lib/esm/CascadingSelectE2E/index.scss +2 -1
- package/lib/esm/Table/Table.tsx +1 -0
- package/lib/esm/Table/TableCell.tsx +0 -1
- package/lib/esm/Table/utils/SortSprite.tsx +3 -0
- package/lib/esm/Table/utils/hooks/useTableSort.tsx +16 -1
- package/package.json +1 -1
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
}
|
|
175
175
|
.casc-select__items-wrapper .casc-select__items-col-searchbox input {
|
|
176
176
|
border: 1px solid var(--casc-select-searchbox-border-color);
|
|
177
|
-
border-radius: 0.
|
|
177
|
+
border-radius: 0.15rem;
|
|
178
|
+
width: 100%;
|
|
178
179
|
background: transparent;
|
|
179
180
|
font-size: 0.75rem;
|
|
180
181
|
}
|
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
}
|
|
175
175
|
.casc-select-e2e__items-wrapper .casc-select-e2e__items-col-searchbox input {
|
|
176
176
|
border: 1px solid var(--casc-select-e2e-searchbox-border-color);
|
|
177
|
-
border-radius: 0.
|
|
177
|
+
border-radius: 0.15rem;
|
|
178
|
+
width: 100%;
|
|
178
179
|
background: transparent;
|
|
179
180
|
font-size: 0.75rem;
|
|
180
181
|
}
|
package/Table/index.js
CHANGED
|
@@ -2087,6 +2087,8 @@ function useTableSort(_ref, deps) {
|
|
|
2087
2087
|
data = _ref.data,
|
|
2088
2088
|
spyElement = _ref.spyElement,
|
|
2089
2089
|
fieldType = _ref.fieldType,
|
|
2090
|
+
_ref$isReverse = _ref.isReverse,
|
|
2091
|
+
isReverse = _ref$isReverse === void 0 ? false : _ref$isReverse,
|
|
2090
2092
|
onColSort = _ref.onColSort,
|
|
2091
2093
|
onClick = _ref.onClick;
|
|
2092
2094
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
@@ -2125,7 +2127,17 @@ function useTableSort(_ref, deps) {
|
|
|
2125
2127
|
node.classList.add('newsort');
|
|
2126
2128
|
});
|
|
2127
2129
|
setInverse(!inverse);
|
|
2128
|
-
|
|
2130
|
+
|
|
2131
|
+
// result
|
|
2132
|
+
if (filterType == 'text') {
|
|
2133
|
+
return isReverse ? txt1.localeCompare(txt2, 'zh-CN', {
|
|
2134
|
+
sensitivity: 'base'
|
|
2135
|
+
}) : txt2.localeCompare(txt1, 'zh-CN', {
|
|
2136
|
+
sensitivity: 'base'
|
|
2137
|
+
});
|
|
2138
|
+
} else {
|
|
2139
|
+
return isReverse ? txt1 < txt2 ? -1 : txt1 > txt2 ? 1 : 0 : txt2 < txt1 ? -1 : txt2 > txt1 ? 1 : 0;
|
|
2140
|
+
}
|
|
2129
2141
|
};
|
|
2130
2142
|
targetComparator.sort(sortBy);
|
|
2131
2143
|
|
|
@@ -2177,6 +2189,8 @@ var SortSprite = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
2177
2189
|
var fieldType = props.fieldType,
|
|
2178
2190
|
className = props.className,
|
|
2179
2191
|
icon = props.icon,
|
|
2192
|
+
_props$isReverse = props.isReverse,
|
|
2193
|
+
isReverse = _props$isReverse === void 0 ? false : _props$isReverse,
|
|
2180
2194
|
onClick = props.onClick;
|
|
2181
2195
|
var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(TableContext),
|
|
2182
2196
|
originData = _useContext.originData,
|
|
@@ -2191,6 +2205,7 @@ var SortSprite = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
2191
2205
|
spyElement: rootRef.current,
|
|
2192
2206
|
fieldType: fieldType,
|
|
2193
2207
|
onColSort: onColSort,
|
|
2208
|
+
isReverse: isReverse,
|
|
2194
2209
|
onClick: onClick
|
|
2195
2210
|
}, [rootRef]),
|
|
2196
2211
|
handleSortList = _useTableSort.handleSortList;
|
package/lib/cjs/Table/index.js
CHANGED
|
@@ -2087,6 +2087,8 @@ function useTableSort(_ref, deps) {
|
|
|
2087
2087
|
data = _ref.data,
|
|
2088
2088
|
spyElement = _ref.spyElement,
|
|
2089
2089
|
fieldType = _ref.fieldType,
|
|
2090
|
+
_ref$isReverse = _ref.isReverse,
|
|
2091
|
+
isReverse = _ref$isReverse === void 0 ? false : _ref$isReverse,
|
|
2090
2092
|
onColSort = _ref.onColSort,
|
|
2091
2093
|
onClick = _ref.onClick;
|
|
2092
2094
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
@@ -2125,7 +2127,17 @@ function useTableSort(_ref, deps) {
|
|
|
2125
2127
|
node.classList.add('newsort');
|
|
2126
2128
|
});
|
|
2127
2129
|
setInverse(!inverse);
|
|
2128
|
-
|
|
2130
|
+
|
|
2131
|
+
// result
|
|
2132
|
+
if (filterType == 'text') {
|
|
2133
|
+
return isReverse ? txt1.localeCompare(txt2, 'zh-CN', {
|
|
2134
|
+
sensitivity: 'base'
|
|
2135
|
+
}) : txt2.localeCompare(txt1, 'zh-CN', {
|
|
2136
|
+
sensitivity: 'base'
|
|
2137
|
+
});
|
|
2138
|
+
} else {
|
|
2139
|
+
return isReverse ? txt1 < txt2 ? -1 : txt1 > txt2 ? 1 : 0 : txt2 < txt1 ? -1 : txt2 > txt1 ? 1 : 0;
|
|
2140
|
+
}
|
|
2129
2141
|
};
|
|
2130
2142
|
targetComparator.sort(sortBy);
|
|
2131
2143
|
|
|
@@ -2177,6 +2189,8 @@ var SortSprite = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
2177
2189
|
var fieldType = props.fieldType,
|
|
2178
2190
|
className = props.className,
|
|
2179
2191
|
icon = props.icon,
|
|
2192
|
+
_props$isReverse = props.isReverse,
|
|
2193
|
+
isReverse = _props$isReverse === void 0 ? false : _props$isReverse,
|
|
2180
2194
|
onClick = props.onClick;
|
|
2181
2195
|
var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(TableContext),
|
|
2182
2196
|
originData = _useContext.originData,
|
|
@@ -2191,6 +2205,7 @@ var SortSprite = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_re
|
|
|
2191
2205
|
spyElement: rootRef.current,
|
|
2192
2206
|
fieldType: fieldType,
|
|
2193
2207
|
onColSort: onColSort,
|
|
2208
|
+
isReverse: isReverse,
|
|
2194
2209
|
onClick: onClick
|
|
2195
2210
|
}, [rootRef]),
|
|
2196
2211
|
handleSortList = _useTableSort.handleSortList;
|
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
}
|
|
175
175
|
.casc-select__items-wrapper .casc-select__items-col-searchbox input {
|
|
176
176
|
border: 1px solid var(--casc-select-searchbox-border-color);
|
|
177
|
-
border-radius: 0.
|
|
177
|
+
border-radius: 0.15rem;
|
|
178
|
+
width: 100%;
|
|
178
179
|
background: transparent;
|
|
179
180
|
font-size: 0.75rem;
|
|
180
181
|
}
|
|
@@ -174,7 +174,8 @@
|
|
|
174
174
|
}
|
|
175
175
|
.casc-select-e2e__items-wrapper .casc-select-e2e__items-col-searchbox input {
|
|
176
176
|
border: 1px solid var(--casc-select-e2e-searchbox-border-color);
|
|
177
|
-
border-radius: 0.
|
|
177
|
+
border-radius: 0.15rem;
|
|
178
|
+
width: 100%;
|
|
178
179
|
background: transparent;
|
|
179
180
|
font-size: 0.75rem;
|
|
180
181
|
}
|
|
@@ -239,7 +239,8 @@
|
|
|
239
239
|
.casc-select-e2e__items-col-searchbox {
|
|
240
240
|
input {
|
|
241
241
|
border: 1px solid var(--casc-select-e2e-searchbox-border-color);
|
|
242
|
-
border-radius: 0.
|
|
242
|
+
border-radius: 0.15rem;
|
|
243
|
+
width: 100%;
|
|
243
244
|
background: transparent;
|
|
244
245
|
font-size: 0.75rem;
|
|
245
246
|
}
|
package/lib/esm/Table/Table.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import useComId from 'funda-utils/dist/cjs/useComId';
|
|
|
5
5
|
import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
import { TableProvider } from './TableContext';
|
|
9
10
|
import useTableResponsive from './utils/hooks/useTableResponsive';
|
|
10
11
|
import useTableDraggable from './utils/hooks/useTableDraggable';
|
|
@@ -7,6 +7,7 @@ export type SortSpriteProps = {
|
|
|
7
7
|
fieldType: 'text' | 'number' | 'date';
|
|
8
8
|
className?: string;
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
|
+
isReverse?: boolean;
|
|
10
11
|
onClick?: (e: any) => void;
|
|
11
12
|
};
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ const SortSprite = forwardRef((props: SortSpriteProps, externalRef: any) => {
|
|
|
16
17
|
fieldType,
|
|
17
18
|
className,
|
|
18
19
|
icon,
|
|
20
|
+
isReverse = false,
|
|
19
21
|
onClick
|
|
20
22
|
} = props;
|
|
21
23
|
|
|
@@ -34,6 +36,7 @@ const SortSprite = forwardRef((props: SortSpriteProps, externalRef: any) => {
|
|
|
34
36
|
spyElement: rootRef.current,
|
|
35
37
|
fieldType: fieldType,
|
|
36
38
|
onColSort: onColSort,
|
|
39
|
+
isReverse: isReverse,
|
|
37
40
|
onClick: onClick
|
|
38
41
|
}, [rootRef]);
|
|
39
42
|
|
|
@@ -30,6 +30,7 @@ export interface UseTableSortProps {
|
|
|
30
30
|
data?: any[];
|
|
31
31
|
spyElement?: any;
|
|
32
32
|
fieldType: 'text' | 'number' | 'date';
|
|
33
|
+
isReverse?: boolean;
|
|
33
34
|
onColSort?: (fetchData: any) => void;
|
|
34
35
|
onClick?: (e: any) => void;
|
|
35
36
|
}
|
|
@@ -39,6 +40,7 @@ function useTableSort({
|
|
|
39
40
|
data,
|
|
40
41
|
spyElement,
|
|
41
42
|
fieldType,
|
|
43
|
+
isReverse = false,
|
|
42
44
|
onColSort,
|
|
43
45
|
onClick
|
|
44
46
|
}: UseTableSortProps, deps: any[]) {
|
|
@@ -79,14 +81,27 @@ function useTableSort({
|
|
|
79
81
|
txt2 = new Date(txt2);
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
|
|
82
85
|
//add filter class
|
|
83
86
|
allRows(spyElement).forEach((node: any) => {
|
|
84
87
|
node.classList.add('newsort');
|
|
85
88
|
});
|
|
86
89
|
|
|
90
|
+
|
|
87
91
|
setInverse(!inverse);
|
|
88
92
|
|
|
89
|
-
|
|
93
|
+
|
|
94
|
+
// result
|
|
95
|
+
if (filterType == 'text') {
|
|
96
|
+
return isReverse
|
|
97
|
+
? txt1.localeCompare(txt2, 'zh-CN', { sensitivity: 'base' })
|
|
98
|
+
: txt2.localeCompare(txt1, 'zh-CN', { sensitivity: 'base' });
|
|
99
|
+
} else {
|
|
100
|
+
return isReverse
|
|
101
|
+
? (txt1 < txt2 ? -1 : txt1 > txt2 ? 1 : 0)
|
|
102
|
+
: (txt2 < txt1 ? -1 : txt2 > txt1 ? 1 : 0);
|
|
103
|
+
}
|
|
104
|
+
|
|
90
105
|
}
|
|
91
106
|
|
|
92
107
|
targetComparator.sort(sortBy);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "4.7.
|
|
5
|
+
"version": "4.7.445",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|