@getlupa/vue 0.9.1 → 0.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.
@@ -4855,9 +4855,16 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4855
4855
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
4856
4856
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
4857
4857
  };
4858
- const showPanelTitle = (queryKey) => {
4859
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
4860
- return (panel == null ? void 0 : panel.count) > 0;
4858
+ const showPanelTitle = (panel) => {
4859
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
4860
+ const panelCounts2 = panelItemCounts.value.find((v) => {
4861
+ var _a;
4862
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
4863
+ });
4864
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
4865
+ }
4866
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
4867
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
4861
4868
  };
4862
4869
  const canShowPanel = (panel) => {
4863
4870
  var _a, _b, _c;
@@ -4893,7 +4900,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4893
4900
  "data-cy": "lupa-panel-" + panel.type + "-index"
4894
4901
  }, [
4895
4902
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$v, vue.toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : vue.createCommentVNode("", true),
4896
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$o, vue.toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : vue.createCommentVNode("", true),
4903
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$o, vue.toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : vue.createCommentVNode("", true),
4897
4904
  panel.queryKey && canShowPanel(panel) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getComponent(panel.type)), {
4898
4905
  key: 2,
4899
4906
  panel,
@@ -10062,6 +10069,8 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
10062
10069
  },
10063
10070
  setup(__props) {
10064
10071
  const props = __props;
10072
+ const searchResultStore = useSearchResultStore();
10073
+ const { hasResults } = storeToRefs(searchResultStore);
10065
10074
  const description = vue.computed(() => {
10066
10075
  var _a, _b;
10067
10076
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -10071,7 +10080,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
10071
10080
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
10072
10081
  });
10073
10082
  return (_ctx, _cache) => {
10074
- return overviewVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
10083
+ return overviewVisible.value && vue.unref(hasResults) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
10075
10084
  vue.createElementVNode("div", {
10076
10085
  class: "lupa-category-description",
10077
10086
  innerHTML: description.value
@@ -4853,9 +4853,16 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4853
4853
  const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
4854
4854
  return (panel == null ? void 0 : panel.count) > 0 && (panel == null ? void 0 : panel.input.length) < 1;
4855
4855
  };
4856
- const showPanelTitle = (queryKey) => {
4857
- const panel = panelItemCounts.value.find((v) => v.queryKey === queryKey);
4858
- return (panel == null ? void 0 : panel.count) > 0;
4856
+ const showPanelTitle = (panel) => {
4857
+ if (panel.type === SearchBoxPanelType.RELATED_SOURCE) {
4858
+ const panelCounts2 = panelItemCounts.value.find((v) => {
4859
+ var _a;
4860
+ return v.queryKey === ((_a = panel.sourceIds) == null ? void 0 : _a.queryKey);
4861
+ });
4862
+ return (panelCounts2 == null ? void 0 : panelCounts2.count) > 0 && canShowPanel(panel);
4863
+ }
4864
+ const panelCounts = panelItemCounts.value.find((v) => v.queryKey === panel.queryKey);
4865
+ return (panelCounts == null ? void 0 : panelCounts.count) > 0;
4859
4866
  };
4860
4867
  const canShowPanel = (panel) => {
4861
4868
  var _a, _b, _c;
@@ -4891,7 +4898,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
4891
4898
  "data-cy": "lupa-panel-" + panel.type + "-index"
4892
4899
  }, [
4893
4900
  ((_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),
4894
- ((_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),
4901
+ ((_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),
4895
4902
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
4896
4903
  key: 2,
4897
4904
  panel,
@@ -10060,6 +10067,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
10060
10067
  },
10061
10068
  setup(__props) {
10062
10069
  const props = __props;
10070
+ const searchResultStore = useSearchResultStore();
10071
+ const { hasResults } = storeToRefs(searchResultStore);
10063
10072
  const description = computed(() => {
10064
10073
  var _a, _b;
10065
10074
  return (_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description;
@@ -10069,7 +10078,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
10069
10078
  return Boolean((_b = (_a = props.options.categories) == null ? void 0 : _a.current) == null ? void 0 : _b.description);
10070
10079
  });
10071
10080
  return (_ctx, _cache) => {
10072
- return overviewVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
10081
+ return overviewVisible.value && unref(hasResults) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
10073
10082
  createElementVNode("div", {
10074
10083
  class: "lupa-category-description",
10075
10084
  innerHTML: description.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "main": "dist/lupaSearch.mjs",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",