@etsoo/react 1.4.22 → 1.4.23
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.
|
@@ -13,8 +13,10 @@ export declare namespace DataGridRenderers {
|
|
|
13
13
|
function defaultCellRenderer<T extends Record<string, any>>({ cellProps, data, field, formattedValue, columnIndex, type, renderProps }: GridCellRendererProps<T>): React.ReactNode;
|
|
14
14
|
/**
|
|
15
15
|
* Default footer item renderer
|
|
16
|
-
* @param
|
|
16
|
+
* @param rows Rows
|
|
17
|
+
* @param props Renderer props
|
|
18
|
+
* @param location Renderer location (column index)
|
|
17
19
|
* @returns Component
|
|
18
20
|
*/
|
|
19
|
-
function defaultFooterItemRenderer<T>(_rows: T[], { index, states, checkable }: DataGridExFooterItemRendererProps<T
|
|
21
|
+
function defaultFooterItemRenderer<T>(_rows: T[], { index, states, checkable }: DataGridExFooterItemRendererProps<T>, location?: number): string | undefined;
|
|
20
22
|
}
|
|
@@ -75,18 +75,20 @@ export var DataGridRenderers;
|
|
|
75
75
|
DataGridRenderers.defaultCellRenderer = defaultCellRenderer;
|
|
76
76
|
/**
|
|
77
77
|
* Default footer item renderer
|
|
78
|
-
* @param
|
|
78
|
+
* @param rows Rows
|
|
79
|
+
* @param props Renderer props
|
|
80
|
+
* @param location Renderer location (column index)
|
|
79
81
|
* @returns Component
|
|
80
82
|
*/
|
|
81
|
-
function defaultFooterItemRenderer(_rows, { index, states, checkable }) {
|
|
83
|
+
function defaultFooterItemRenderer(_rows, { index, states, checkable }, location = 1) {
|
|
82
84
|
const { selectedItems, loadedItems, hasNextPage } = states;
|
|
83
|
-
if (checkable && index === 1) {
|
|
85
|
+
if (checkable && index === location + 1) {
|
|
84
86
|
return [
|
|
85
87
|
selectedItems.length,
|
|
86
88
|
loadedItems.toLocaleString() + (hasNextPage ? '+' : '')
|
|
87
89
|
].join(' / ');
|
|
88
90
|
}
|
|
89
|
-
if (!checkable && index ===
|
|
91
|
+
if (!checkable && index === location) {
|
|
90
92
|
return loadedItems.toLocaleString() + (hasNextPage ? '+' : '');
|
|
91
93
|
}
|
|
92
94
|
return undefined;
|
package/lib/mu/SearchBar.js
CHANGED
|
@@ -201,12 +201,12 @@ export function SearchBar(props) {
|
|
|
201
201
|
handleSubmitInstant(true);
|
|
202
202
|
};
|
|
203
203
|
// Submit
|
|
204
|
-
const handleSubmit = () => {
|
|
204
|
+
const handleSubmit = (delay = 480) => {
|
|
205
205
|
if (forms.submitSeed != null) {
|
|
206
206
|
clearTimeout(forms.submitSeed);
|
|
207
207
|
}
|
|
208
208
|
// Delay the change
|
|
209
|
-
forms.submitSeed = window.setTimeout(handleSubmitInstant,
|
|
209
|
+
forms.submitSeed = window.setTimeout(handleSubmitInstant, delay);
|
|
210
210
|
};
|
|
211
211
|
// Submit at once
|
|
212
212
|
const handleSubmitInstant = (reset = false) => {
|
|
@@ -222,7 +222,7 @@ export function SearchBar(props) {
|
|
|
222
222
|
// First loading
|
|
223
223
|
React.useEffect(() => {
|
|
224
224
|
// Delayed way
|
|
225
|
-
handleSubmit();
|
|
225
|
+
handleSubmit(100);
|
|
226
226
|
return () => {
|
|
227
227
|
// Clear the seeds
|
|
228
228
|
if (forms.submitSeed != null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.23",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
52
|
"@emotion/styled": "^11.6.0",
|
|
53
|
-
"@etsoo/appscript": "^1.2.
|
|
53
|
+
"@etsoo/appscript": "^1.2.22",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.0",
|
|
55
55
|
"@etsoo/shared": "^1.1.3",
|
|
56
56
|
"@mui/icons-material": "^5.2.5",
|
|
@@ -112,23 +112,26 @@ export namespace DataGridRenderers {
|
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
114
|
* Default footer item renderer
|
|
115
|
-
* @param
|
|
115
|
+
* @param rows Rows
|
|
116
|
+
* @param props Renderer props
|
|
117
|
+
* @param location Renderer location (column index)
|
|
116
118
|
* @returns Component
|
|
117
119
|
*/
|
|
118
120
|
export function defaultFooterItemRenderer<T>(
|
|
119
121
|
_rows: T[],
|
|
120
|
-
{ index, states, checkable }: DataGridExFooterItemRendererProps<T
|
|
122
|
+
{ index, states, checkable }: DataGridExFooterItemRendererProps<T>,
|
|
123
|
+
location: number = 1
|
|
121
124
|
) {
|
|
122
125
|
const { selectedItems, loadedItems, hasNextPage } = states;
|
|
123
126
|
|
|
124
|
-
if (checkable && index === 1) {
|
|
127
|
+
if (checkable && index === location + 1) {
|
|
125
128
|
return [
|
|
126
129
|
selectedItems.length,
|
|
127
130
|
loadedItems.toLocaleString() + (hasNextPage ? '+' : '')
|
|
128
131
|
].join(' / ');
|
|
129
132
|
}
|
|
130
133
|
|
|
131
|
-
if (!checkable && index ===
|
|
134
|
+
if (!checkable && index === location) {
|
|
132
135
|
return loadedItems.toLocaleString() + (hasNextPage ? '+' : '');
|
|
133
136
|
}
|
|
134
137
|
|
package/src/mu/SearchBar.tsx
CHANGED
|
@@ -271,13 +271,13 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
// Submit
|
|
274
|
-
const handleSubmit = () => {
|
|
274
|
+
const handleSubmit = (delay = 480) => {
|
|
275
275
|
if (forms.submitSeed != null) {
|
|
276
276
|
clearTimeout(forms.submitSeed);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// Delay the change
|
|
280
|
-
forms.submitSeed = window.setTimeout(handleSubmitInstant,
|
|
280
|
+
forms.submitSeed = window.setTimeout(handleSubmitInstant, delay);
|
|
281
281
|
};
|
|
282
282
|
|
|
283
283
|
// Submit at once
|
|
@@ -297,7 +297,7 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
297
297
|
// First loading
|
|
298
298
|
React.useEffect(() => {
|
|
299
299
|
// Delayed way
|
|
300
|
-
handleSubmit();
|
|
300
|
+
handleSubmit(100);
|
|
301
301
|
|
|
302
302
|
return () => {
|
|
303
303
|
// Clear the seeds
|