@getlupa/vue 0.9.1 → 0.9.2

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,
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/vue",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "main": "dist/lupaSearch.mjs",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/src/index.d.ts",