@gisce/react-ooui 1.2.10-rc.0 → 1.2.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAWvD,OAAO,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAkB1C,aAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC;AAQF,aAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4nB/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAWvD,OAAO,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAkB1C,aAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC;AAQF,aAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6nB/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -21,6 +21,7 @@ declare type Props = {
21
21
  childField?: string;
22
22
  rootTree?: boolean;
23
23
  context?: any;
24
+ readonly?: boolean;
24
25
  };
25
26
  declare function Tree(props: Props): React.ReactElement;
26
27
  export default Tree;
@@ -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,CAA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,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;AA8GF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA8M9C;AAED,eAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.2.10-rc.0",
3
+ "version": "1.2.10",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -35,7 +35,7 @@
35
35
  "@gisce/fiber-diagram": "^1.1.0-rc.3",
36
36
  "@gisce/ooui": "^0.21.0",
37
37
  "@gisce/react-formiga-components": "^1.0.9-rc.21",
38
- "@gisce/react-formiga-table": "^0.5.0",
38
+ "@gisce/react-formiga-table": "^0.6.0",
39
39
  "@monaco-editor/react": "^4.4.5",
40
40
  "@tabler/icons-react": "^2.11.0",
41
41
  "antd": "^5.5.2",
@@ -1,5 +1,5 @@
1
1
  import React, { useContext, useState } from "react";
2
- import { Space, Spin } from "antd";
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
@@ -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
@@ -627,6 +627,7 @@ const One2manyInput: React.FC<One2manyInputProps> = (
627
627
  onChangeSort={setSorter}
628
628
  context={{ ...getContext?.(), ...context }}
629
629
  colorsForResults={colorsForResults}
630
+ readonly={readOnly}
630
631
  />
631
632
  );
632
633
  }
@@ -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
 
@@ -46,6 +46,7 @@ type Props = {
46
46
  childField?: string;
47
47
  rootTree?: boolean;
48
48
  context?: any;
49
+ readonly?: boolean;
49
50
  };
50
51
 
51
52
  const booleanComponentFn = (value: boolean): React.ReactElement => {
@@ -116,7 +117,7 @@ const imageComponent = (value: string): React.ReactElement => {
116
117
  };
117
118
 
118
119
  const TagComponent = (
119
- value: any,
120
+ value: any,
120
121
  key: string,
121
122
  ooui: any,
122
123
  context: any
@@ -125,12 +126,14 @@ const TagComponent = (
125
126
  };
126
127
 
127
128
  const SelectionComponent = (
128
- value: any,
129
+ value: any,
129
130
  key: string,
130
131
  ooui: any,
131
132
  context: any
132
133
  ): React.ReactElement => {
133
- return <>{ooui.selectionValues.get(value)}</>;
134
+ return (
135
+ <>{ooui.selectionValues.get(value)}</>
136
+ );
134
137
  };
135
138
 
136
139
  const referenceComponent = (
@@ -150,12 +153,9 @@ const referenceComponent = (
150
153
  );
151
154
  };
152
155
 
153
- const AvatarFn = (
154
- value: any,
155
- key: string,
156
- ooui: any,
157
- context: any
158
- ): React.ReactElement => <Avatar ooui={ooui} value={value} />;
156
+ const AvatarFn = (value: any, key:string, ooui: any, context: any): React.ReactElement => (
157
+ <Avatar ooui={ooui} value={value} />
158
+ )
159
159
 
160
160
  function Tree(props: Props): React.ReactElement {
161
161
  const {
@@ -177,6 +177,7 @@ function Tree(props: Props): React.ReactElement {
177
177
  childField,
178
178
  rootTree = false,
179
179
  context,
180
+ readonly,
180
181
  } = props;
181
182
 
182
183
  const [items, setItems] = useState<Array<any>>([]);
@@ -305,7 +306,9 @@ function Tree(props: Props): React.ReactElement {
305
306
  summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
306
307
  });
307
308
 
308
- return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
309
+ return (
310
+ <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
311
+ );
309
312
  }
310
313
 
311
314
  let dataTable;
@@ -328,12 +331,11 @@ function Tree(props: Props): React.ReactElement {
328
331
  ) : (
329
332
  <div>
330
333
  {pagination()}
331
- {loading && <Spin className="pb-4" />}
332
334
  <GisceTable
333
335
  height={adjustedHeight!}
334
336
  columns={dataTable.columns}
335
337
  dataSource={items}
336
- loading={false}
338
+ loading={loading}
337
339
  loadingComponent={<Spin />}
338
340
  onRowStyle={(record: any) => {
339
341
  if (colorsForResults![record.id]) {
@@ -345,6 +347,7 @@ function Tree(props: Props): React.ReactElement {
345
347
  onRowSelectionChange={rowSelection?.onChange}
346
348
  onChangeSort={onChangeSort}
347
349
  sorter={sorter}
350
+ readonly={readonly}
348
351
  expandableOpts={
349
352
  onFetchChildrenForRecord
350
353
  ? {