@gisce/react-ooui 1.4.2-rc.0 → 1.4.2
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 +212 -218
- 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 +1 -8
- package/src/hooks/useSearch.ts +0 -1
- package/src/widgets/views/SearchTree.tsx +1 -1
- package/src/widgets/views/Tree.tsx +13 -13
|
@@ -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;KA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AAE;QAAE,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;AA8GF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAqN9C;AAED,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useState } from "react";
|
|
2
|
-
import { Space
|
|
2
|
+
import { Space } from "antd";
|
|
3
3
|
import ChangeViewButton from "./ChangeViewButton";
|
|
4
4
|
import {
|
|
5
5
|
ActionViewContext,
|
|
@@ -151,13 +151,6 @@ 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
|
-
)}
|
|
161
154
|
{treeExpandable ? null : (
|
|
162
155
|
<>
|
|
163
156
|
<SearchBar
|
package/src/hooks/useSearch.ts
CHANGED
|
@@ -293,7 +293,6 @@ 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;
|
|
297
296
|
setSorter?.(newSorter);
|
|
298
297
|
const sortedResults =
|
|
299
298
|
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);
|
|
186
185
|
} finally {
|
|
187
186
|
setIsLoading(false);
|
|
187
|
+
setTreeIsLoading?.(false);
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
|
|
@@ -69,7 +69,7 @@ const many2OneComponentFn = (m2oField: any): React.ReactElement => {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
const textComponentFn = (value: any): React.ReactElement => {
|
|
72
|
-
return <Interweave content={value?.replace(/(?:\r\n|\r|\n)/g, "<br>")} />;
|
|
72
|
+
return <Interweave content={value?.toString().replace(/(?:\r\n|\r|\n)/g, "<br>")} />;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const dateComponentFn = (value: any): React.ReactElement => {
|
|
@@ -118,7 +118,7 @@ const imageComponent = (value: string): React.ReactElement => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const TagComponent = (
|
|
121
|
-
|
|
121
|
+
value: any,
|
|
122
122
|
key: string,
|
|
123
123
|
ooui: any,
|
|
124
124
|
context: any
|
|
@@ -127,12 +127,14 @@ const TagComponent = (
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const SelectionComponent = (
|
|
130
|
-
|
|
130
|
+
value: any,
|
|
131
131
|
key: string,
|
|
132
132
|
ooui: any,
|
|
133
133
|
context: any
|
|
134
134
|
): React.ReactElement => {
|
|
135
|
-
return
|
|
135
|
+
return (
|
|
136
|
+
<>{ooui.selectionValues.get(value)}</>
|
|
137
|
+
);
|
|
136
138
|
};
|
|
137
139
|
|
|
138
140
|
const referenceComponent = (
|
|
@@ -152,12 +154,9 @@ const referenceComponent = (
|
|
|
152
154
|
);
|
|
153
155
|
};
|
|
154
156
|
|
|
155
|
-
const AvatarFn = (
|
|
156
|
-
value
|
|
157
|
-
|
|
158
|
-
ooui: any,
|
|
159
|
-
context: any
|
|
160
|
-
): React.ReactElement => <Avatar ooui={ooui} value={value} />;
|
|
157
|
+
const AvatarFn = (value: any, key:string, ooui: any, context: any): React.ReactElement => (
|
|
158
|
+
<Avatar ooui={ooui} value={value} />
|
|
159
|
+
)
|
|
161
160
|
|
|
162
161
|
function Tree(props: Props): React.ReactElement {
|
|
163
162
|
const {
|
|
@@ -309,7 +308,9 @@ function Tree(props: Props): React.ReactElement {
|
|
|
309
308
|
summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
|
|
310
309
|
});
|
|
311
310
|
|
|
312
|
-
return
|
|
311
|
+
return (
|
|
312
|
+
<div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
|
|
313
|
+
);
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
let dataTable;
|
|
@@ -332,12 +333,11 @@ function Tree(props: Props): React.ReactElement {
|
|
|
332
333
|
) : (
|
|
333
334
|
<div>
|
|
334
335
|
{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={loading}
|
|
341
341
|
loadingComponent={<Spin />}
|
|
342
342
|
onRowStyle={(record: any) => {
|
|
343
343
|
if (colorsForResults![record.id]) {
|