@gisce/react-ooui 1.2.11 → 1.2.12-rc.0
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 +414 -406
- 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/base/Text.d.ts.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/base/Char.tsx +1 -1
- package/src/widgets/base/Text.tsx +3 -2
- package/src/widgets/views/SearchTree.tsx +1 -1
- package/src/widgets/views/Tree.tsx +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAW/C,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,IAAI,UAAW,KAAK,sBAgCzB,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAW/C,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,IAAI,UAAW,KAAK,sBAgCzB,CAAC;AA+GF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree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M,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,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,CA6M9C;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
|
@@ -278,6 +278,7 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
278
278
|
|
|
279
279
|
const changeSort = useCallback(
|
|
280
280
|
(newSorter: any) => {
|
|
281
|
+
if (JSON.stringify(newSorter) === JSON.stringify(sorter)) return;
|
|
281
282
|
setSorter?.(newSorter);
|
|
282
283
|
const sortedResults =
|
|
283
284
|
newSorter !== undefined
|
|
@@ -136,7 +136,7 @@ const TranslatableChar = ({
|
|
|
136
136
|
onChange?.(event.target.value);
|
|
137
137
|
}}
|
|
138
138
|
onBlur={elementHasLostFocus}
|
|
139
|
-
style={{ cursor: "pointer", ...requiredStyle }}
|
|
139
|
+
style={{ cursor: "pointer", pointerEvents: "none", ...requiredStyle }}
|
|
140
140
|
/>
|
|
141
141
|
</div>
|
|
142
142
|
<TranslationModal
|
|
@@ -85,7 +85,7 @@ const TranslatableText = ({
|
|
|
85
85
|
}}
|
|
86
86
|
style={{
|
|
87
87
|
height: height ? height + "px" : "100%",
|
|
88
|
-
...requiredStyle
|
|
88
|
+
...requiredStyle,
|
|
89
89
|
}}
|
|
90
90
|
id={field}
|
|
91
91
|
rows={4}
|
|
@@ -133,7 +133,8 @@ const TranslatableText = ({
|
|
|
133
133
|
style={{
|
|
134
134
|
height: height ? height + "px" : "100%",
|
|
135
135
|
cursor: "pointer",
|
|
136
|
-
|
|
136
|
+
pointerEvents: "none",
|
|
137
|
+
...requiredStyle,
|
|
137
138
|
}}
|
|
138
139
|
id={field}
|
|
139
140
|
disabled={true}
|
|
@@ -181,9 +181,9 @@ function SearchTree(props: Props, ref: any) {
|
|
|
181
181
|
setInitialFetchDone(true);
|
|
182
182
|
} catch (error) {
|
|
183
183
|
setInitialError(error);
|
|
184
|
+
setTreeIsLoading?.(false);
|
|
184
185
|
} finally {
|
|
185
186
|
setIsLoading(false);
|
|
186
|
-
setTreeIsLoading?.(false);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
|
|
@@ -117,7 +117,7 @@ const imageComponent = (value: string): React.ReactElement => {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
const TagComponent = (
|
|
120
|
-
value: any,
|
|
120
|
+
value: any,
|
|
121
121
|
key: string,
|
|
122
122
|
ooui: any,
|
|
123
123
|
context: any
|
|
@@ -126,14 +126,12 @@ value: any,
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
const SelectionComponent = (
|
|
129
|
-
value: any,
|
|
129
|
+
value: any,
|
|
130
130
|
key: string,
|
|
131
131
|
ooui: any,
|
|
132
132
|
context: any
|
|
133
133
|
): React.ReactElement => {
|
|
134
|
-
return (
|
|
135
|
-
<>{ooui.selectionValues.get(value)}</>
|
|
136
|
-
);
|
|
134
|
+
return <>{ooui.selectionValues.get(value)}</>;
|
|
137
135
|
};
|
|
138
136
|
|
|
139
137
|
const referenceComponent = (
|
|
@@ -153,9 +151,12 @@ const referenceComponent = (
|
|
|
153
151
|
);
|
|
154
152
|
};
|
|
155
153
|
|
|
156
|
-
const AvatarFn = (
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
const AvatarFn = (
|
|
155
|
+
value: any,
|
|
156
|
+
key: string,
|
|
157
|
+
ooui: any,
|
|
158
|
+
context: any
|
|
159
|
+
): React.ReactElement => <Avatar ooui={ooui} value={value} />;
|
|
159
160
|
|
|
160
161
|
function Tree(props: Props): React.ReactElement {
|
|
161
162
|
const {
|
|
@@ -306,9 +307,7 @@ function Tree(props: Props): React.ReactElement {
|
|
|
306
307
|
summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
|
|
307
308
|
});
|
|
308
309
|
|
|
309
|
-
return (
|
|
310
|
-
<div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
|
|
311
|
-
);
|
|
310
|
+
return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
|
|
312
311
|
}
|
|
313
312
|
|
|
314
313
|
let dataTable;
|
|
@@ -331,11 +330,12 @@ function Tree(props: Props): React.ReactElement {
|
|
|
331
330
|
) : (
|
|
332
331
|
<div>
|
|
333
332
|
{pagination()}
|
|
333
|
+
{loading && <Spin className="pb-4" />}
|
|
334
334
|
<GisceTable
|
|
335
335
|
height={adjustedHeight!}
|
|
336
336
|
columns={dataTable.columns}
|
|
337
337
|
dataSource={items}
|
|
338
|
-
loading={
|
|
338
|
+
loading={false}
|
|
339
339
|
loadingComponent={<Spin />}
|
|
340
340
|
onRowStyle={(record: any) => {
|
|
341
341
|
if (colorsForResults![record.id]) {
|