@gisce/react-ooui 1.2.8-rc.0 → 1.2.9

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":"Tags.d.ts","sourceRoot":"","sources":["Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAgB,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO7E,aAAK,SAAS,GAAG,WAAW,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,aAAK,cAAc,GAAG,SAAS,GAAG;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,SAAS,sBAQpC,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,cAAc,sBAmI9C,CAAC"}
1
+ {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAgB,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO7E,aAAK,SAAS,GAAG,WAAW,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,aAAK,cAAc,GAAG,SAAS,GAAG;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.2.8-rc.0",
3
+ "version": "1.2.9",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -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
@@ -6,7 +6,7 @@ import { One2manyItem, One2manyValue } from "../base/one2many/One2manyInput";
6
6
  import useDeepCompareEffect from "use-deep-compare-effect";
7
7
  import { FormContext, FormContextType } from "@/context/FormContext";
8
8
  import { Alert, Tag as AntTag, Select } from "antd";
9
- import { colorFromString, transformPlainMany2Ones } from "@/helpers/formHelper";
9
+ import { colorsFromString, transformPlainMany2Ones } from "@/helpers/formHelper";
10
10
  import ConnectionProvider from "@/ConnectionProvider";
11
11
 
12
12
  type TagsProps = WidgetProps & {
@@ -126,11 +126,12 @@ export const TagsInput = (props: TagsInputProps) => {
126
126
  event.preventDefault();
127
127
  event.stopPropagation();
128
128
  };
129
+ const colors = colorsFromString(label);
129
130
  return (
130
131
  <AntTag
131
- color={colorFromString(label)}
132
+ color={colors.backgroundColor}
132
133
  onMouseDown={onPreventMouseDown}
133
- style={{ margin: "5px" }}
134
+ style={{ margin: "5px", color: colors.textColor }}
134
135
  closable={closable}
135
136
  onClose={onClose}
136
137
  >
@@ -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
 
@@ -116,7 +116,7 @@ const imageComponent = (value: string): React.ReactElement => {
116
116
  };
117
117
 
118
118
  const TagComponent = (
119
- value: any,
119
+ value: any,
120
120
  key: string,
121
121
  ooui: any,
122
122
  context: any
@@ -125,12 +125,14 @@ const TagComponent = (
125
125
  };
126
126
 
127
127
  const SelectionComponent = (
128
- value: any,
128
+ value: any,
129
129
  key: string,
130
130
  ooui: any,
131
131
  context: any
132
132
  ): React.ReactElement => {
133
- return <>{ooui.selectionValues.get(value)}</>;
133
+ return (
134
+ <>{ooui.selectionValues.get(value)}</>
135
+ );
134
136
  };
135
137
 
136
138
  const referenceComponent = (
@@ -150,12 +152,9 @@ const referenceComponent = (
150
152
  );
151
153
  };
152
154
 
153
- const AvatarFn = (
154
- value: any,
155
- key: string,
156
- ooui: any,
157
- context: any
158
- ): React.ReactElement => <Avatar ooui={ooui} value={value} />;
155
+ const AvatarFn = (value: any, key:string, ooui: any, context: any): React.ReactElement => (
156
+ <Avatar ooui={ooui} value={value} />
157
+ )
159
158
 
160
159
  function Tree(props: Props): React.ReactElement {
161
160
  const {
@@ -305,7 +304,9 @@ function Tree(props: Props): React.ReactElement {
305
304
  summary.push(`${sumField.label}: ${Math.round(total * 100) / 100}`);
306
305
  });
307
306
 
308
- return <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>;
307
+ return (
308
+ <div className="p-1 pb-0 pl-2 mt-2 ">{summary.join(", ")}</div>
309
+ );
309
310
  }
310
311
 
311
312
  let dataTable;
@@ -328,12 +329,11 @@ function Tree(props: Props): React.ReactElement {
328
329
  ) : (
329
330
  <div>
330
331
  {pagination()}
331
- {loading && <Spin className="pb-4" />}
332
332
  <GisceTable
333
333
  height={adjustedHeight!}
334
334
  columns={dataTable.columns}
335
335
  dataSource={items}
336
- loading={false}
336
+ loading={loading}
337
337
  loadingComponent={<Spin />}
338
338
  onRowStyle={(record: any) => {
339
339
  if (colorsForResults![record.id]) {