@gisce/react-ooui 1.4.5 → 1.4.6
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/dist/actionbar/TreeActionBar.d.ts.map +1 -1
- package/dist/hooks/useSearch.d.ts.map +1 -1
- package/dist/react-ooui.es.js +217 -211
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +9 -9
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/actionbar/TreeActionBar.tsx +8 -1
- package/src/hooks/useSearch.ts +1 -0
- package/src/widgets/views/SearchTree.tsx +1 -1
- package/src/widgets/views/Tree.tsx +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["Tree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,QAAQ,EAAU,MAAM,SAAS,CAAC;AAwB3C,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CA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AAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,wBAAwB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA+GF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAoN9C;AAED,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useState } from "react";
|
|
2
|
-
import { Space } from "antd";
|
|
2
|
+
import { Space, Spin } from "antd";
|
|
3
3
|
import ChangeViewButton from "./ChangeViewButton";
|
|
4
4
|
import {
|
|
5
5
|
ActionViewContext,
|
|
@@ -151,6 +151,13 @@ function TreeActionBar(props: Props) {
|
|
|
151
151
|
|
|
152
152
|
return (
|
|
153
153
|
<Space wrap={true}>
|
|
154
|
+
{treeIsLoading && (
|
|
155
|
+
<>
|
|
156
|
+
<Spin />
|
|
157
|
+
{separator()}
|
|
158
|
+
{separator()}
|
|
159
|
+
</>
|
|
160
|
+
)}
|
|
154
161
|
{treeExpandable ? null : (
|
|
155
162
|
<>
|
|
156
163
|
<SearchBar
|
package/src/hooks/useSearch.ts
CHANGED
|
@@ -293,6 +293,7 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
293
293
|
|
|
294
294
|
const changeSort = useCallback(
|
|
295
295
|
(newSorter: any) => {
|
|
296
|
+
if (JSON.stringify(newSorter) === JSON.stringify(sorter)) return;
|
|
296
297
|
setSorter?.(newSorter);
|
|
297
298
|
const sortedResults =
|
|
298
299
|
newSorter !== undefined
|
|
@@ -182,9 +182,9 @@ function SearchTree(props: Props, ref: any) {
|
|
|
182
182
|
setInitialFetchDone(true);
|
|
183
183
|
} catch (error) {
|
|
184
184
|
setInitialError(error);
|
|
185
|
+
setTreeIsLoading?.(false);
|
|
185
186
|
} finally {
|
|
186
187
|
setIsLoading(false);
|
|
187
|
-
setTreeIsLoading?.(false);
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
|
|
@@ -118,7 +118,7 @@ const imageComponent = (value: string): React.ReactElement => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const TagComponent = (
|
|
121
|
-
value: any,
|
|
121
|
+
value: any,
|
|
122
122
|
key: string,
|
|
123
123
|
ooui: any,
|
|
124
124
|
context: any
|
|
@@ -127,14 +127,12 @@ value: any,
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const SelectionComponent = (
|
|
130
|
-
value: any,
|
|
130
|
+
value: any,
|
|
131
131
|
key: string,
|
|
132
132
|
ooui: any,
|
|
133
133
|
context: any
|
|
134
134
|
): React.ReactElement => {
|
|
135
|
-
return (
|
|
136
|
-
<>{ooui.selectionValues.get(value)}</>
|
|
137
|
-
);
|
|
135
|
+
return <>{ooui.selectionValues.get(value)}</>;
|
|
138
136
|
};
|
|
139
137
|
|
|
140
138
|
const referenceComponent = (
|
|
@@ -154,9 +152,12 @@ const referenceComponent = (
|
|
|
154
152
|
);
|
|
155
153
|
};
|
|
156
154
|
|
|
157
|
-
const AvatarFn = (
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
const AvatarFn = (
|
|
156
|
+
value: any,
|
|
157
|
+
key: string,
|
|
158
|
+
ooui: any,
|
|
159
|
+
context: any
|
|
160
|
+
): React.ReactElement => <Avatar ooui={ooui} value={value} />;
|
|
160
161
|
|
|
161
162
|
function Tree(props: Props): React.ReactElement {
|
|
162
163
|
const {
|
|
@@ -308,9 +309,7 @@ function Tree(props: Props): React.ReactElement {
|
|
|
308
309
|
summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
|
|
309
310
|
});
|
|
310
311
|
|
|
311
|
-
return (
|
|
312
|
-
<div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
|
|
313
|
-
);
|
|
312
|
+
return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
|
|
314
313
|
}
|
|
315
314
|
|
|
316
315
|
let dataTable;
|
|
@@ -333,11 +332,12 @@ function Tree(props: Props): React.ReactElement {
|
|
|
333
332
|
) : (
|
|
334
333
|
<div>
|
|
335
334
|
{pagination()}
|
|
335
|
+
{loading && <Spin className="pb-4" />}
|
|
336
336
|
<GisceTable
|
|
337
337
|
height={adjustedHeight!}
|
|
338
338
|
columns={dataTable.columns}
|
|
339
339
|
dataSource={items}
|
|
340
|
-
loading={
|
|
340
|
+
loading={false}
|
|
341
341
|
loadingComponent={<Spin />}
|
|
342
342
|
onRowStyle={(record: any) => {
|
|
343
343
|
if (colorsForResults![record.id]) {
|