@getlupa/client 1.9.1 → 1.9.3

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.
@@ -9499,9 +9499,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9499
9499
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9500
9500
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
9501
9501
  };
9502
- const showPanelTitle = (queryKey) => {
9503
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9504
- return (panel == null ? void 0 : panel.count) > 0;
9502
+ const showPanelTitle = (panel) => {
9503
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
9504
+ const panelCounts2 = panelItemCounts.value.find((v) => {
9505
+ var _a;
9506
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
9507
+ });
9508
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
9509
+ }
9510
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
9511
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
9505
9512
  };
9506
9513
  const canShowPanel = (panel) => {
9507
9514
  var _a, _b, _c;
@@ -9537,7 +9544,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9537
9544
  "data-cy": "lupa-panel-" + panel.type + "-index"
9538
9545
  }, [
9539
9546
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9540
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9547
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9541
9548
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9542
9549
  key: 2,
9543
9550
  panel,
@@ -14690,6 +14697,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14690
14697
  },
14691
14698
  setup(__props) {
14692
14699
  const props = __props;
14700
+ const searchResultStore = useSearchResultStore();
14701
+ const { hasResults } = storeToRefs(searchResultStore);
14693
14702
  const description = computed(() => {
14694
14703
  var _a, _b;
14695
14704
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -14699,7 +14708,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14699
14708
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
14700
14709
  });
14701
14710
  return (_ctx, _cache) => {
14702
- return overviewVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14711
+ return overviewVisible.value && unref(hasResults) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14703
14712
  createBaseVNode("div", {
14704
14713
  class: "lupa-category-description",
14705
14714
  innerHTML: description.value
@@ -9499,9 +9499,16 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9499
9499
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9500
9500
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
9501
9501
  };
9502
- const showPanelTitle = (queryKey) => {
9503
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9504
- return (panel == null ? void 0 : panel.count) > 0;
9502
+ const showPanelTitle = (panel) => {
9503
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
9504
+ const panelCounts2 = panelItemCounts.value.find((v) => {
9505
+ var _a;
9506
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
9507
+ });
9508
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
9509
+ }
9510
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
9511
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
9505
9512
  };
9506
9513
  const canShowPanel = (panel) => {
9507
9514
  var _a, _b, _c;
@@ -9537,7 +9544,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9537
9544
  "data-cy": "lupa-panel-" + panel.type + "-index"
9538
9545
  }, [
9539
9546
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9540
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9547
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9541
9548
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9542
9549
  key: 2,
9543
9550
  panel,
@@ -14690,6 +14697,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14690
14697
  },
14691
14698
  setup(__props) {
14692
14699
  const props = __props;
14700
+ const searchResultStore = useSearchResultStore();
14701
+ const { hasResults } = storeToRefs(searchResultStore);
14693
14702
  const description = computed(() => {
14694
14703
  var _a, _b;
14695
14704
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -14699,7 +14708,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14699
14708
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
14700
14709
  });
14701
14710
  return (_ctx, _cache) => {
14702
- return overviewVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14711
+ return overviewVisible.value && unref(hasResults) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14703
14712
  createBaseVNode("div", {
14704
14713
  class: "lupa-category-description",
14705
14714
  innerHTML: description.value
@@ -9497,9 +9497,16 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9497
9497
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9498
9498
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
9499
9499
  };
9500
- const showPanelTitle = (queryKey) => {
9501
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9502
- return (panel == null ? void 0 : panel.count) > 0;
9500
+ const showPanelTitle = (panel) => {
9501
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
9502
+ const panelCounts2 = panelItemCounts.value.find((v) => {
9503
+ var _a;
9504
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
9505
+ });
9506
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
9507
+ }
9508
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
9509
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
9503
9510
  };
9504
9511
  const canShowPanel = (panel) => {
9505
9512
  var _a, _b, _c;
@@ -9535,7 +9542,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9535
9542
  "data-cy": "lupa-panel-" + panel.type + "-index"
9536
9543
  }, [
9537
9544
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9538
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9545
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9539
9546
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9540
9547
  key: 2,
9541
9548
  panel,
@@ -14688,6 +14695,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14688
14695
  },
14689
14696
  setup(__props) {
14690
14697
  const props = __props;
14698
+ const searchResultStore = useSearchResultStore();
14699
+ const { hasResults } = storeToRefs(searchResultStore);
14691
14700
  const description = computed(() => {
14692
14701
  var _a, _b;
14693
14702
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -14697,7 +14706,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14697
14706
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
14698
14707
  });
14699
14708
  return (_ctx, _cache) => {
14700
- return overviewVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14709
+ return overviewVisible.value && unref(hasResults) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14701
14710
  createBaseVNode("div", {
14702
14711
  class: "lupa-category-description",
14703
14712
  innerHTML: description.value
@@ -9501,9 +9501,16 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9501
9501
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9502
9502
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
9503
9503
  };
9504
- const showPanelTitle = (queryKey) => {
9505
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
9506
- return (panel == null ? void 0 : panel.count) > 0;
9504
+ const showPanelTitle = (panel) => {
9505
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
9506
+ const panelCounts2 = panelItemCounts.value.find((v) => {
9507
+ var _a;
9508
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
9509
+ });
9510
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
9511
+ }
9512
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
9513
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
9507
9514
  };
9508
9515
  const canShowPanel = (panel) => {
9509
9516
  var _a, _b, _c;
@@ -9539,7 +9546,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9539
9546
  "data-cy": "lupa-panel-" + panel.type + "-index"
9540
9547
  }, [
9541
9548
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9542
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9549
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$o, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
9543
9550
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9544
9551
  key: 2,
9545
9552
  panel,
@@ -14692,6 +14699,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14692
14699
  },
14693
14700
  setup(__props) {
14694
14701
  const props = __props;
14702
+ const searchResultStore = useSearchResultStore();
14703
+ const { hasResults } = storeToRefs(searchResultStore);
14695
14704
  const description = computed(() => {
14696
14705
  var _a, _b;
14697
14706
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -14701,7 +14710,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14701
14710
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
14702
14711
  });
14703
14712
  return (_ctx, _cache) => {
14704
- return overviewVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14713
+ return overviewVisible.value && unref(hasResults) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
14705
14714
  createBaseVNode("div", {
14706
14715
  class: "lupa-category-description",
14707
14716
  innerHTML: description.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.9.1",
23
+ "@getlupa/vue": "0.9.3",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",