@gisce/react-ooui 1.2.7-rc.0 → 1.2.7
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 +322 -328
- 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 +1 -8
- package/src/hooks/useSearch.ts +0 -1
- package/src/widgets/base/Text.tsx +4 -1
- package/src/widgets/views/SearchTree.tsx +1 -1
- package/src/widgets/views/Tree.tsx +13 -15
|
@@ -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,
|
|
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;AA8GF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["Tree.tsx"],"names":[],"mapp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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;CACf,CAAC;AAkHF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA4M9C;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
|
@@ -278,7 +278,6 @@ 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;
|
|
282
281
|
setSorter?.(newSorter);
|
|
283
282
|
const sortedResults =
|
|
284
283
|
newSorter !== undefined
|
|
@@ -38,7 +38,10 @@ const Text = (props: Props) => {
|
|
|
38
38
|
) : (
|
|
39
39
|
<TextArea
|
|
40
40
|
disabled={readOnly || translatable}
|
|
41
|
-
style={{
|
|
41
|
+
style={{
|
|
42
|
+
minHeight: height ? height + "px" : "100%",
|
|
43
|
+
...requiredStyle,
|
|
44
|
+
}}
|
|
42
45
|
rows={4}
|
|
43
46
|
onBlur={elementHasLostFocus}
|
|
44
47
|
/>
|
|
@@ -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);
|
|
185
184
|
} finally {
|
|
186
185
|
setIsLoading(false);
|
|
186
|
+
setTreeIsLoading?.(false);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
|
|
@@ -115,27 +115,27 @@ const imageComponent = (value: string): React.ReactElement => {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
const TagComponent = (
|
|
118
|
-
|
|
118
|
+
value: any,
|
|
119
119
|
key: string,
|
|
120
120
|
ooui: any,
|
|
121
121
|
context: any
|
|
122
122
|
): React.ReactElement => {
|
|
123
123
|
return (
|
|
124
124
|
<>
|
|
125
|
-
{value ? (
|
|
126
|
-
<Tag color={ooui.colors[value]}>{ooui.selectionValues.get(value)}</Tag>
|
|
127
|
-
) : null}
|
|
125
|
+
{value ? <Tag color={ooui.colors[value]}>{ooui.selectionValues.get(value)}</Tag> : null}
|
|
128
126
|
</>
|
|
129
127
|
);
|
|
130
128
|
};
|
|
131
129
|
|
|
132
130
|
const SelectionComponent = (
|
|
133
|
-
|
|
131
|
+
value: any,
|
|
134
132
|
key: string,
|
|
135
133
|
ooui: any,
|
|
136
134
|
context: any
|
|
137
135
|
): React.ReactElement => {
|
|
138
|
-
return
|
|
136
|
+
return (
|
|
137
|
+
<>{ooui.selectionValues.get(value)}</>
|
|
138
|
+
);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
const referenceComponent = (
|
|
@@ -155,12 +155,9 @@ const referenceComponent = (
|
|
|
155
155
|
);
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
const AvatarFn = (
|
|
159
|
-
value
|
|
160
|
-
|
|
161
|
-
ooui: any,
|
|
162
|
-
context: any
|
|
163
|
-
): React.ReactElement => <Avatar ooui={ooui} value={value} />;
|
|
158
|
+
const AvatarFn = (value: any, key:string, ooui: any, context: any): React.ReactElement => (
|
|
159
|
+
<Avatar ooui={ooui} value={value} />
|
|
160
|
+
)
|
|
164
161
|
|
|
165
162
|
function Tree(props: Props): React.ReactElement {
|
|
166
163
|
const {
|
|
@@ -310,7 +307,9 @@ function Tree(props: Props): React.ReactElement {
|
|
|
310
307
|
summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
|
|
311
308
|
});
|
|
312
309
|
|
|
313
|
-
return
|
|
310
|
+
return (
|
|
311
|
+
<div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
|
|
312
|
+
);
|
|
314
313
|
}
|
|
315
314
|
|
|
316
315
|
let dataTable;
|
|
@@ -333,12 +332,11 @@ function Tree(props: Props): React.ReactElement {
|
|
|
333
332
|
) : (
|
|
334
333
|
<div>
|
|
335
334
|
{pagination()}
|
|
336
|
-
{loading && <Spin className="pb-4" />}
|
|
337
335
|
<GisceTable
|
|
338
336
|
height={adjustedHeight!}
|
|
339
337
|
columns={dataTable.columns}
|
|
340
338
|
dataSource={items}
|
|
341
|
-
loading={
|
|
339
|
+
loading={loading}
|
|
342
340
|
loadingComponent={<Spin />}
|
|
343
341
|
onRowStyle={(record: any) => {
|
|
344
342
|
if (colorsForResults![record.id]) {
|