@gisce/react-ooui 1.0.8 → 1.0.9-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.0.8",
3
+ "version": "1.0.9-rc.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -23,6 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "scripts": {
26
+ "prerelease": "npm version prerelease --preid rc",
26
27
  "start": "vite build --watch --force",
27
28
  "build:tailwind": "postcss src/tailwind.css -o src/tailwind.generated.css",
28
29
  "build": "vite build",
@@ -0,0 +1 @@
1
+ [{"/Users/marc/development/react-ooui/src/stories/Button.stories.js":"1","/Users/marc/development/react-ooui/src/stories/Char.stories.js":"2","/Users/marc/development/react-ooui/src/stories/Selection.stories.js":"3","/Users/marc/development/react-ooui/src/stories/ManyToOne.stories.js":"4","/Users/marc/development/react-ooui/src/stories/Checkbox.stories.js":"5","/Users/marc/development/react-ooui/src/widgets/Checkbox.tsx":"6","/Users/marc/development/react-ooui/src/widgets/ManyToOne.tsx":"7","/Users/marc/development/react-ooui/src/widgets/Selection.tsx":"8","/Users/marc/development/react-ooui/src/widgets/Button.tsx":"9","/Users/marc/development/react-ooui/src/widgets/Char.tsx":"10","/Users/marc/development/react-ooui/src/index.ts":"11","/Users/marc/development/react-ooui/src/helpers/TreeHelper.ts":"12","/Users/marc/development/react-ooui/src/widgets/Tree.tsx":"13","/Users/marc/development/react-ooui/src/stories/Tree.stories.js":"14"},{"size":721,"mtime":1611223665948,"results":"15","hashOfConfig":"16"},{"size":432,"mtime":1611223665949,"results":"17","hashOfConfig":"16"},{"size":539,"mtime":1611223665952,"results":"18","hashOfConfig":"16"},{"size":599,"mtime":1611223665950,"results":"19","hashOfConfig":"16"},{"size":464,"mtime":1611223665949,"results":"20","hashOfConfig":"16"},{"size":671,"mtime":1611223665953,"results":"21","hashOfConfig":"16"},{"size":1308,"mtime":1611223665954,"results":"22","hashOfConfig":"16"},{"size":706,"mtime":1611223665954,"results":"23","hashOfConfig":"16"},{"size":639,"mtime":1611223665953,"results":"24","hashOfConfig":"16"},{"size":741,"mtime":1611223665953,"results":"25","hashOfConfig":"16"},{"size":385,"mtime":1611227468105,"results":"26","hashOfConfig":"16"},{"size":1966,"mtime":1611306565063,"results":"27","hashOfConfig":"16"},{"size":1681,"mtime":1611227447728,"results":"28","hashOfConfig":"16"},{"size":3152,"mtime":1611308351200,"results":"29","hashOfConfig":"16"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},"i1ix4w",{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"49"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"32"},"/Users/marc/development/react-ooui/src/stories/Button.stories.js",[],[],"/Users/marc/development/react-ooui/src/stories/Char.stories.js",[],"/Users/marc/development/react-ooui/src/stories/Selection.stories.js",[],"/Users/marc/development/react-ooui/src/stories/ManyToOne.stories.js",[],"/Users/marc/development/react-ooui/src/stories/Checkbox.stories.js",[],"/Users/marc/development/react-ooui/src/widgets/Checkbox.tsx",[],"/Users/marc/development/react-ooui/src/widgets/ManyToOne.tsx",[],"/Users/marc/development/react-ooui/src/widgets/Selection.tsx",[],"/Users/marc/development/react-ooui/src/widgets/Button.tsx",[],[],"/Users/marc/development/react-ooui/src/widgets/Char.tsx",[],"/Users/marc/development/react-ooui/src/index.ts",[],"/Users/marc/development/react-ooui/src/helpers/TreeHelper.ts",[],"/Users/marc/development/react-ooui/src/widgets/Tree.tsx",[],"/Users/marc/development/react-ooui/src/stories/Tree.stories.js",[]]
@@ -37,7 +37,7 @@ type FormView = TreeView & {
37
37
  };
38
38
 
39
39
  type SearchResponse = {
40
- totalItems: Promise<number>;
40
+ totalItems: number;
41
41
  results: any[];
42
42
  attrsEvaluated?: any;
43
43
  };
@@ -6,7 +6,9 @@ import Measure from "react-measure";
6
6
  import iconMapper from "@/helpers/iconMapper";
7
7
  import { Alert, Col, Row } from "antd";
8
8
  import { Operator } from "@gisce/ooui";
9
- import { getValueForOperator } from "@gisce/ooui/dist/Graph/processor/graphProcessor";
9
+
10
+ import { graphProcessor } from "@gisce/ooui";
11
+ const { getValueForOperator } = graphProcessor;
10
12
 
11
13
  const fontGrowFactor = 0.7;
12
14
  const minFontSize = 30;
@@ -109,13 +111,12 @@ export const GraphIndicator = (props: GraphInidicatorProps) => {
109
111
  }
110
112
 
111
113
  if (colorCondition) {
112
- const conditionEval = await ConnectionProvider.getHandler().parseCondition(
113
- {
114
+ const conditionEval =
115
+ await ConnectionProvider.getHandler().parseCondition({
114
116
  condition: colorCondition,
115
117
  values: { value: retrievedValue, percent },
116
118
  context,
117
- }
118
- );
119
+ });
119
120
  setColor(conditionEval);
120
121
  }
121
122
 
@@ -90,7 +90,7 @@ function SearchTree(props: Props, ref: any) {
90
90
 
91
91
  const paramsRef = useRef<Array<any>>([]);
92
92
 
93
- const [totalItems, setTotalItems] = useState<number>();
93
+ const [totalItems, setTotalItems] = useState<number>(0);
94
94
  const [resultsInternal, setResultsInternal] = useState<any>([]);
95
95
  const [colorsForResults, setColorsForResults] = useState<any>(undefined);
96
96
 
@@ -278,6 +278,8 @@ function SearchTree(props: Props, ref: any) {
278
278
  context: parentContext,
279
279
  attrs: colors && { colors },
280
280
  });
281
+ setTotalItems(totalItems);
282
+ setActionViewTotalItems?.(totalItems);
281
283
  setColorsForResults(getColorMap(attrsEvaluated));
282
284
 
283
285
  originalResults.current = [...results];
@@ -291,11 +293,6 @@ function SearchTree(props: Props, ref: any) {
291
293
  })
292
294
  : [...originalResults.current];
293
295
 
294
- totalItems.then((value) => {
295
- setTotalItems(value);
296
- setActionViewTotalItems?.(value);
297
- });
298
-
299
296
  setResults(resultsSorted);
300
297
 
301
298
  if (resultsActionView && resultsSorted.length > 0) {
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useEffect, useRef, useState } from "react";
2
2
  import { Pagination, Checkbox, Space, Row, Col, Spin } from "antd";
3
3
  import { getTree, getTableColumns, getTableItems } from "@/helpers/treeHelper";
4
- import { Tree as TreeOoui } from "@gisce/ooui";
4
+ import { One2many, Tree as TreeOoui } from "@gisce/ooui";
5
5
 
6
6
  import { TreeView, Column } from "@/types";
7
7
  import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
@@ -18,7 +18,7 @@ import {
18
18
  import { One2manyValue } from "../base/one2many/One2manyInput";
19
19
 
20
20
  type Props = {
21
- total?: number;
21
+ total: number;
22
22
  limit: number;
23
23
  page?: number;
24
24
  loading: boolean;
@@ -147,7 +147,7 @@ function Tree(props: Props): React.ReactElement {
147
147
 
148
148
  const from = (page - 1) * limit + 1;
149
149
  const to = from - 1 + items.length;
150
- const summary = !total
150
+ const summary = loading
151
151
  ? null
152
152
  : total === 0
153
153
  ? t("no_results")
@@ -161,9 +161,7 @@ function Tree(props: Props): React.ReactElement {
161
161
  return null;
162
162
  }
163
163
 
164
- return loading ? null : !total ? (
165
- <Spin />
166
- ) : (
164
+ return loading ? null : (
167
165
  <Row align="bottom" className="pb-4">
168
166
  <Col span={12}>
169
167
  <Pagination