@usereactify/search 5.28.0-beta.0 → 5.29.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [5.29.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.28.0...release-v5.29.0) (2023-08-16)
6
+
7
+
8
+ ### Features
9
+
10
+ * add loading field to useResults ([3441e12](https://bitbucket.org/usereactify/reactify-search-ui/commit/3441e128198720b0eb27ca332b5e3b98af21d2fb))
11
+
12
+ ## [5.28.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/release-v5.27.1...release-v5.28.0) (2023-08-16)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * add parent doc count into nested aggs ([c324cf8](https://bitbucket.org/usereactify/reactify-search-ui/commit/c324cf831842dcb16a9a89d1a0b7ef962f45afa0))
18
+
5
19
  ## [5.28.0-beta.0](https://bitbucket.org/usereactify/reactify-search-ui/compare/beta-v5.12.0-beta.0...beta-v5.28.0-beta.0) (2023-08-15)
6
20
 
7
21
 
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usereactify/search",
3
3
  "description": "React UI library for Reactify Search",
4
- "version": "5.28.0-beta.0",
4
+ "version": "5.29.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -2,6 +2,8 @@ import React from "react";
2
2
  import { ReactivesearchResultProps } from "../types";
3
3
  /** This hook must never be used to render results */
4
4
  export declare const useResults: () => {
5
+ /** Equals true until first load has completed */
6
+ loading: boolean;
5
7
  /** All of the current results */
6
8
  results: ReactivesearchResultProps["data"];
7
9
  /** Function for setting the current results */
@@ -1,14 +1,24 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.useResults = void 0;
7
+ const react_1 = __importDefault(require("react"));
4
8
  const hooks_1 = require("../hooks");
5
9
  const utility_1 = require("../utility");
6
10
  /** This hook must never be used to render results */
7
11
  const useResults = () => {
12
+ var _a;
8
13
  const { results } = (0, hooks_1.useReactifySearchContext)();
14
+ const loading = react_1.default.useMemo(() => {
15
+ var _a;
16
+ return typeof ((_a = results.resultStats) === null || _a === void 0 ? void 0 : _a.numberOfResults) === "undefined";
17
+ }, [(_a = results.resultStats) === null || _a === void 0 ? void 0 : _a.numberOfResults]);
9
18
  utility_1.debug.hook("useResults", "results", results.results);
10
19
  utility_1.debug.hook("useResults", "resultStats", results.resultStats);
11
20
  return {
21
+ loading: loading,
12
22
  results: results.results,
13
23
  setResults: results.setResults,
14
24
  resultStats: results.resultStats,
@@ -1 +1 @@
1
- {"version":3,"file":"useResults.js","sourceRoot":"","sources":["../../../src/hooks/useResults.ts"],"names":[],"mappings":";;;AAGA,oCAAoD;AACpD,wCAAmC;AAEnC,qDAAqD;AAC9C,MAAM,UAAU,GAAG,GAaxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,eAAK,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,eAAK,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,UAAU,cAyBrB","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchResultProps } from \"../types\";\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\n\n/** This hook must never be used to render results */\nexport const useResults = (): {\n /** All of the current results */\n results: ReactivesearchResultProps[\"data\"];\n /** Function for setting the current results */\n setResults: React.Dispatch<\n React.SetStateAction<ReactivesearchResultProps[\"data\"]>\n >;\n /** All of the current result stats */\n resultStats?: ReactivesearchResultProps[\"resultStats\"];\n /** Function for setting the current result stats */\n setResultStats: React.Dispatch<\n React.SetStateAction<ReactivesearchResultProps[\"resultStats\"] | undefined>\n >;\n} => {\n const { results } = useReactifySearchContext();\n\n debug.hook(\"useResults\", \"results\", results.results);\n debug.hook(\"useResults\", \"resultStats\", results.resultStats);\n\n return {\n results: results.results,\n setResults: results.setResults,\n resultStats: results.resultStats,\n setResultStats: results.setResultStats,\n };\n};\n"]}
1
+ {"version":3,"file":"useResults.js","sourceRoot":"","sources":["../../../src/hooks/useResults.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,oCAAoD;AACpD,wCAAmC;AAEnC,qDAAqD;AAC9C,MAAM,UAAU,GAAG,GAexB,EAAE;;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gCAAwB,GAAE,CAAC;IAE/C,MAAM,OAAO,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QACjC,OAAO,OAAO,CAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,eAAe,CAAA,KAAK,WAAW,CAAC;IACrE,CAAC,EAAE,CAAC,MAAA,OAAO,CAAC,WAAW,0CAAE,eAAe,CAAC,CAAC,CAAC;IAE3C,eAAK,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,eAAK,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;AACJ,CAAC,CAAC;AAhCW,QAAA,UAAU,cAgCrB","sourcesContent":["import React from \"react\";\n\nimport { ReactivesearchResultProps } from \"../types\";\nimport { useReactifySearchContext } from \"../hooks\";\nimport { debug } from \"../utility\";\n\n/** This hook must never be used to render results */\nexport const useResults = (): {\n /** Equals true until first load has completed */\n loading: boolean;\n /** All of the current results */\n results: ReactivesearchResultProps[\"data\"];\n /** Function for setting the current results */\n setResults: React.Dispatch<\n React.SetStateAction<ReactivesearchResultProps[\"data\"]>\n >;\n /** All of the current result stats */\n resultStats?: ReactivesearchResultProps[\"resultStats\"];\n /** Function for setting the current result stats */\n setResultStats: React.Dispatch<\n React.SetStateAction<ReactivesearchResultProps[\"resultStats\"] | undefined>\n >;\n} => {\n const { results } = useReactifySearchContext();\n\n const loading = React.useMemo(() => {\n return typeof results.resultStats?.numberOfResults === \"undefined\";\n }, [results.resultStats?.numberOfResults]);\n\n debug.hook(\"useResults\", \"results\", results.results);\n debug.hook(\"useResults\", \"resultStats\", results.resultStats);\n\n return {\n loading: loading,\n results: results.results,\n setResults: results.setResults,\n resultStats: results.resultStats,\n setResultStats: results.setResultStats,\n };\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usereactify/search",
3
3
  "description": "React UI library for Reactify Search",
4
- "version": "5.28.0-beta.0",
4
+ "version": "5.29.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",