@visitscotland/component-library 5.16.0 → 5.16.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.
- package/dist/client/manifest.json +21 -18
- package/dist/client/scripts/{49f72f28d28a8aea228b.js → 0138c0c9ddea3182e3ec.js} +1 -1
- package/dist/client/scripts/13f11ddb02a309d7ca52.js +1 -0
- package/dist/client/scripts/26f669c4aa66a8b5242f.js +1 -0
- package/dist/client/scripts/2e638bf18671846cc500.js +1 -0
- package/dist/client/scripts/{905db787182f7e931c00.js → 891ca6d77a816816d620.js} +1 -1
- package/dist/client/scripts/a2e4b319b67673e9af30.js +1 -0
- package/dist/client/scripts/a983e6bbb115c3252875.js +1 -0
- package/dist/components/utils/federated-search/event-search.d.ts +1 -1
- package/dist/components/vs-component-library.js +1 -1
- package/dist/components/vs-component-library.mjs +94 -49
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/package.json +1 -1
- package/dist/client/scripts/2265981c0419fd31e547.js +0 -1
- package/dist/client/scripts/6a8e8fabd2fa07e4709a.js +0 -1
- package/dist/client/scripts/7b75378e25bc74c7aeb0.js +0 -1
- package/dist/client/scripts/da2e15296fabbccab55c.js +0 -1
- /package/dist/client/styles/{7b75378e25bc74c7aeb0.css → 13f11ddb02a309d7ca52.css} +0 -0
- /package/dist/client/styles/{2265981c0419fd31e547.css → 26f669c4aa66a8b5242f.css} +0 -0
- /package/dist/client/styles/{6a8e8fabd2fa07e4709a.css → 2e638bf18671846cc500.css} +0 -0
- /package/dist/client/styles/{da2e15296fabbccab55c.css → a2e4b319b67673e9af30.css} +0 -0
- /package/dist/ssr/styles/{9a83335238cd4a02f82a.css → 6dfac11998b5ada85f1c.css} +0 -0
|
@@ -33922,7 +33922,7 @@ async function eventSearch(e, n, t, a, r, s, o, i) {
|
|
|
33922
33922
|
const l = useFederatedSearchStore();
|
|
33923
33923
|
if (l.eventsApiError = !1, l.cludoError = !1, a === "events" || !a) {
|
|
33924
33924
|
let c = `${e}?query=${n}`;
|
|
33925
|
-
c = t > 1 ? `${c}&page=${t}` : c, c = s !== "" ? `${c}&startDate=${s}` : c, c = o !== "" ? `${c}&endDate=${o}` : c, c = i ? `${c}&sort=${i
|
|
33925
|
+
c = t > 1 ? `${c}&page=${t}` : c, c = s !== "" ? `${c}&startDate=${s}` : c, c = o !== "" ? `${c}&endDate=${o}` : c, c = i ? `${c}&sort=${i}` : c, c = a === "events" ? `${c}&pageSize=12` : `${c}&pageSize=6`, r.forEach((u) => {
|
|
33926
33926
|
c += `&category=${u}`;
|
|
33927
33927
|
});
|
|
33928
33928
|
try {
|
|
@@ -33992,8 +33992,8 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
33992
33992
|
return cludoAutocomplete(l.value, n.value);
|
|
33993
33993
|
}
|
|
33994
33994
|
function E(N) {
|
|
33995
|
-
const O = new URL(window.location);
|
|
33996
|
-
if (l.value ? O.searchParams.set("search-term", l.value) : O.searchParams.delete("search-term"), u.value ? O.searchParams.set("category", encodeURIComponent(u.value)) : O.searchParams.delete("category"), m.value.length > 0 ? O.searchParams.set("sub-category", encodeURIComponent(m.value.join(","))) : O.searchParams.delete("sub-category"), N ? (a.value = 1, O.searchParams.set("page", a.value.toString())) : a.value && a.value > 1 ? O.searchParams.set("page", a.value.toString()) : O.searchParams.delete("page"), v.value ? O.searchParams.set("start-date", v.value) : O.searchParams.delete("start-date"), b.value ? O.searchParams.set("end-date", b.value) : O.searchParams.delete("end-date"), k.value ? O.searchParams.set("sort-by", k.value
|
|
33995
|
+
const O = new URL(window.location.href);
|
|
33996
|
+
if (l.value ? O.searchParams.set("search-term", l.value) : O.searchParams.delete("search-term"), u.value ? O.searchParams.set("category", encodeURIComponent(u.value)) : O.searchParams.delete("category"), m.value.length > 0 ? O.searchParams.set("sub-category", encodeURIComponent(m.value.join(","))) : O.searchParams.delete("sub-category"), N ? (a.value = 1, O.searchParams.set("page", a.value.toString())) : a.value && a.value > 1 ? O.searchParams.set("page", a.value.toString()) : O.searchParams.delete("page"), v.value ? O.searchParams.set("start-date", v.value) : O.searchParams.delete("start-date"), b.value ? O.searchParams.set("end-date", b.value) : O.searchParams.delete("end-date"), k.value ? O.searchParams.set("sort-by", k.value) : O.searchParams.delete("sort-by"), !_.value)
|
|
33997
33997
|
window.history.pushState({}, "", O), S();
|
|
33998
33998
|
else {
|
|
33999
33999
|
const R = `./${C.value}/${O.search}`;
|
|
@@ -34113,12 +34113,12 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34113
34113
|
emits: ["filter-updated"],
|
|
34114
34114
|
setup(e) {
|
|
34115
34115
|
const n = e, t = ref(null);
|
|
34116
|
-
function a(
|
|
34117
|
-
return typeof n.activeFilter == "string" ? n.activeFilter ===
|
|
34116
|
+
function a(l) {
|
|
34117
|
+
return typeof n.activeFilter == "string" ? n.activeFilter === l : n.activeFilter && typeof n.activeFilter == "object" ? n.activeFilter.includes(l) : !1;
|
|
34118
34118
|
}
|
|
34119
|
-
function r(
|
|
34120
|
-
var
|
|
34121
|
-
|
|
34119
|
+
function r(l) {
|
|
34120
|
+
var c, u;
|
|
34121
|
+
l === "left" ? (c = t.value) == null || c.scrollBy(-200, 0) : l === "right" && ((u = t.value) == null || u.scrollBy(200, 0));
|
|
34122
34122
|
}
|
|
34123
34123
|
function s() {
|
|
34124
34124
|
return [
|
|
@@ -34126,18 +34126,60 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34126
34126
|
n.wrap ? "vs-fed-filter__scroll-rail--wrap" : ""
|
|
34127
34127
|
];
|
|
34128
34128
|
}
|
|
34129
|
-
const o = computed$1(() => [...n.filterCategories].sort((
|
|
34130
|
-
const
|
|
34131
|
-
return
|
|
34129
|
+
const o = computed$1(() => [...n.filterCategories].sort((c, u) => {
|
|
34130
|
+
const d = (c.Label || c.Key || "").toLowerCase(), m = (u.Label || u.Key || "").toLowerCase();
|
|
34131
|
+
return d < m ? -1 : d > m ? 1 : 0;
|
|
34132
34132
|
}));
|
|
34133
|
-
|
|
34134
|
-
|
|
34133
|
+
function i(l) {
|
|
34134
|
+
let c;
|
|
34135
|
+
switch (l) {
|
|
34136
|
+
case "accommodation":
|
|
34137
|
+
c = "fa-regular fa-bed";
|
|
34138
|
+
break;
|
|
34139
|
+
case "active-adventure":
|
|
34140
|
+
c = "fa-kit fa-vs-landscape";
|
|
34141
|
+
break;
|
|
34142
|
+
case "city-break":
|
|
34143
|
+
c = "fa-regular fa-city";
|
|
34144
|
+
break;
|
|
34145
|
+
case "culture-history":
|
|
34146
|
+
c = "fa-regular fa-chess-rook";
|
|
34147
|
+
break;
|
|
34148
|
+
case "events":
|
|
34149
|
+
c = "fa-regular fa-calendar-range";
|
|
34150
|
+
break;
|
|
34151
|
+
case "family-friendly":
|
|
34152
|
+
c = "fa-regular fa-family";
|
|
34153
|
+
break;
|
|
34154
|
+
case "food-drink":
|
|
34155
|
+
c = "fa-regular fa-utensils";
|
|
34156
|
+
break;
|
|
34157
|
+
case "nature-outdoors":
|
|
34158
|
+
c = "fa-regular fa-leaf";
|
|
34159
|
+
break;
|
|
34160
|
+
case "tours":
|
|
34161
|
+
c = "fa-regular fa-binoculars";
|
|
34162
|
+
break;
|
|
34163
|
+
case "travel-information":
|
|
34164
|
+
c = "fa-regular fa-circle-info";
|
|
34165
|
+
break;
|
|
34166
|
+
case "wellness":
|
|
34167
|
+
c = "fa-regular fa-spa";
|
|
34168
|
+
break;
|
|
34169
|
+
default:
|
|
34170
|
+
c = null;
|
|
34171
|
+
break;
|
|
34172
|
+
}
|
|
34173
|
+
return c;
|
|
34174
|
+
}
|
|
34175
|
+
return (l, c) => (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
34176
|
+
l.$slots["fed-filter-header"] && l.$slots["fed-filter-header"]() ? (openBlock(), createBlock(VsBody, {
|
|
34135
34177
|
key: 0,
|
|
34136
34178
|
class: "vs-fed-filter__header mb-025 ms-025",
|
|
34137
34179
|
"data-test": "vs-fed-filter__header"
|
|
34138
34180
|
}, {
|
|
34139
34181
|
default: withCtx(() => [
|
|
34140
|
-
renderSlot(
|
|
34182
|
+
renderSlot(l.$slots, "fed-filter-header")
|
|
34141
34183
|
]),
|
|
34142
34184
|
_: 3
|
|
34143
34185
|
})) : createCommentVNode("", !0),
|
|
@@ -34149,7 +34191,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34149
34191
|
"icon-only": "",
|
|
34150
34192
|
class: "vs-fed-filter__scroll-button me-050",
|
|
34151
34193
|
"data-test": "vs-fed-filter__scroll-button--left",
|
|
34152
|
-
onClick:
|
|
34194
|
+
onClick: c[0] || (c[0] = (u) => r("left")),
|
|
34153
34195
|
"aria-label": n.scrollLeftText
|
|
34154
34196
|
}, {
|
|
34155
34197
|
default: withCtx(() => [
|
|
@@ -34163,17 +34205,17 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34163
34205
|
ref_key: "scrollRail",
|
|
34164
34206
|
ref: t
|
|
34165
34207
|
}, [
|
|
34166
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (
|
|
34167
|
-
key:
|
|
34208
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (u, d) => (openBlock(), createBlock(VsButton, {
|
|
34209
|
+
key: d,
|
|
34168
34210
|
class: "vs-fed-filter__category-button",
|
|
34169
|
-
"data-test": `vs-fed-filter__category-button--${
|
|
34170
|
-
icon: n.variant === "primary" ?
|
|
34171
|
-
variant: a(
|
|
34211
|
+
"data-test": `vs-fed-filter__category-button--${u.Key}`,
|
|
34212
|
+
icon: n.variant === "primary" ? i(u.Key) : null,
|
|
34213
|
+
variant: a(u.Key) ? "primary" : "secondary",
|
|
34172
34214
|
size: n.variant === "secondary" ? "sm" : "md",
|
|
34173
|
-
onClick: (
|
|
34215
|
+
onClick: (m) => l.$emit("filter-updated", u)
|
|
34174
34216
|
}, {
|
|
34175
34217
|
default: withCtx(() => [
|
|
34176
|
-
createTextVNode(toDisplayString(
|
|
34218
|
+
createTextVNode(toDisplayString(u.Label || u.Key), 1)
|
|
34177
34219
|
]),
|
|
34178
34220
|
_: 2
|
|
34179
34221
|
}, 1032, ["data-test", "icon", "variant", "size", "onClick"]))), 128))
|
|
@@ -34185,7 +34227,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34185
34227
|
"icon-only": "",
|
|
34186
34228
|
class: "vs-fed-filter__scroll-button ms-050",
|
|
34187
34229
|
"data-test": "vs-fed-filter__scroll-button--right",
|
|
34188
|
-
onClick:
|
|
34230
|
+
onClick: c[1] || (c[1] = (u) => r("right")),
|
|
34189
34231
|
"aria-label": n.scrollRightText
|
|
34190
34232
|
}, {
|
|
34191
34233
|
default: withCtx(() => [
|
|
@@ -34300,7 +34342,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34300
34342
|
engineId: n.cludoEngineId
|
|
34301
34343
|
}, t.isHomePage = n.isHomePage;
|
|
34302
34344
|
const f = window.location.search, p = new URLSearchParams(f);
|
|
34303
|
-
p.has("search-term") && (t.searchTerm = p.get("search-term")), p.has("category") && (t.selectedCategoryKey = decodeURIComponent(p.get("category"))), p.has("sub-category") && decodeURIComponent(p.get("sub-category")).split(",").forEach((_) => t.selectedSubCategoryKey.push(_)), (p.has("search-term") || p.has("category")) && t.getSearchResults();
|
|
34345
|
+
p.has("search-term") && (t.searchTerm = p.get("search-term")), p.has("category") && (t.selectedCategoryKey = decodeURIComponent(p.get("category"))), p.has("sub-category") && decodeURIComponent(p.get("sub-category")).split(",").forEach((_) => t.selectedSubCategoryKey.push(_)), p.has("category") && p.get("category") === "events" && p.has("sort-by") && (t.sortBy = p.get("sort-by")), p.has("start-date") && (t.startDate = p.get("start-date")), p.has("end-date") && (t.endDate = p.get("end-date")), (p.has("search-term") || p.has("category")) && t.getSearchResults();
|
|
34304
34346
|
}), (f, p) => (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
34305
34347
|
createElementVNode("div", _hoisted_2$2, [
|
|
34306
34348
|
createElementVNode("div", _hoisted_3$1, [
|
|
@@ -34383,7 +34425,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34383
34425
|
for: "vs-fed-search-sort__to-date",
|
|
34384
34426
|
class: "vs-fed-search-sort__label",
|
|
34385
34427
|
"data-test": "vs-fed-search-sort__to-date-label"
|
|
34386
|
-
}, _sfc_main$1 =
|
|
34428
|
+
}, _sfc_main$1 = {
|
|
34387
34429
|
__name: "FedSearchSort",
|
|
34388
34430
|
props: {
|
|
34389
34431
|
/**
|
|
@@ -34425,44 +34467,42 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34425
34467
|
"end-date-updated",
|
|
34426
34468
|
"sort-order-updated"
|
|
34427
34469
|
],
|
|
34428
|
-
setup(e
|
|
34429
|
-
const
|
|
34430
|
-
|
|
34431
|
-
t.value = o, r("sort-order-updated", o);
|
|
34432
|
-
}
|
|
34433
|
-
return (o, i) => (openBlock(), createBlock(VsRow, { class: "vs-fed-search-sort" }, {
|
|
34470
|
+
setup(e) {
|
|
34471
|
+
const n = useFederatedSearchStore(), t = e, a = computed$1(() => t.sortOptions.find((r) => r.key === n.sortBy));
|
|
34472
|
+
return (r, s) => (openBlock(), createBlock(VsRow, { class: "vs-fed-search-sort" }, {
|
|
34434
34473
|
default: withCtx(() => [
|
|
34435
|
-
|
|
34474
|
+
t.dateFilterVisible ? (openBlock(), createBlock(VsCol, {
|
|
34436
34475
|
key: 0,
|
|
34437
34476
|
cols: "6",
|
|
34438
34477
|
md: "4"
|
|
34439
34478
|
}, {
|
|
34440
34479
|
default: withCtx(() => [
|
|
34441
|
-
|
|
34480
|
+
t.fromDateLabel ? (openBlock(), createElementBlock("label", _hoisted_1$1, toDisplayString(t.fromDateLabel), 1)) : createCommentVNode("", !0),
|
|
34442
34481
|
createVNode(VsInput, {
|
|
34443
34482
|
"field-name": "vs-fed-search-sort__from-date",
|
|
34444
|
-
value: (/* @__PURE__ */ new Date()).toJSON().slice(0, 10),
|
|
34483
|
+
value: unref(n).startDate || (/* @__PURE__ */ new Date()).toJSON().slice(0, 10),
|
|
34445
34484
|
type: "date",
|
|
34446
34485
|
"auto-complete": !1,
|
|
34447
|
-
onInput:
|
|
34486
|
+
onInput: s[0] || (s[0] = (o) => r.$emit("from-date-updated", o.target.value)),
|
|
34448
34487
|
"data-chromatic": "ignore"
|
|
34449
34488
|
}, null, 8, ["value"])
|
|
34450
34489
|
]),
|
|
34451
34490
|
_: 1
|
|
34452
34491
|
})) : createCommentVNode("", !0),
|
|
34453
|
-
|
|
34492
|
+
t.dateFilterVisible ? (openBlock(), createBlock(VsCol, {
|
|
34454
34493
|
key: 1,
|
|
34455
34494
|
cols: "6",
|
|
34456
34495
|
md: "4"
|
|
34457
34496
|
}, {
|
|
34458
34497
|
default: withCtx(() => [
|
|
34459
|
-
|
|
34498
|
+
t.toDateLabel ? (openBlock(), createElementBlock("label", _hoisted_2$1, toDisplayString(t.toDateLabel), 1)) : createCommentVNode("", !0),
|
|
34460
34499
|
createVNode(VsInput, {
|
|
34461
34500
|
"field-name": "vs-fed-search-sort__to-date",
|
|
34462
34501
|
type: "date",
|
|
34463
34502
|
"auto-complete": !1,
|
|
34464
|
-
onInput:
|
|
34465
|
-
|
|
34503
|
+
onInput: s[1] || (s[1] = (o) => r.$emit("end-date-updated", o.target.value)),
|
|
34504
|
+
value: unref(n).endDate || ""
|
|
34505
|
+
}, null, 8, ["value"])
|
|
34466
34506
|
]),
|
|
34467
34507
|
_: 1
|
|
34468
34508
|
})) : createCommentVNode("", !0),
|
|
@@ -34476,17 +34516,19 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34476
34516
|
variant: "secondary",
|
|
34477
34517
|
id: "vs-fed-search-sort__dropdown",
|
|
34478
34518
|
name: "vs-fed-search-sort__dropdown",
|
|
34479
|
-
text:
|
|
34519
|
+
text: unref(n).sortBy ? `${t.sortLabel}: ${a.value.label}` : t.sortLabel
|
|
34480
34520
|
}, {
|
|
34481
34521
|
default: withCtx(() => [
|
|
34482
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.sortOptions, (
|
|
34483
|
-
key:
|
|
34484
|
-
onClick: (
|
|
34485
|
-
|
|
34486
|
-
|
|
34522
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.sortOptions, (o, i) => (openBlock(), createBlock(VsDropdownItem, {
|
|
34523
|
+
key: i,
|
|
34524
|
+
onClick: (l) => {
|
|
34525
|
+
r.$emit("sort-order-updated", o.key);
|
|
34526
|
+
},
|
|
34527
|
+
active: unref(n).sortBy === o.key,
|
|
34528
|
+
"data-test": `vs-fed-search-sort__dropdown-item--${o.key}`
|
|
34487
34529
|
}, {
|
|
34488
34530
|
default: withCtx(() => [
|
|
34489
|
-
createTextVNode(toDisplayString(
|
|
34531
|
+
createTextVNode(toDisplayString(o.label), 1)
|
|
34490
34532
|
]),
|
|
34491
34533
|
_: 2
|
|
34492
34534
|
}, 1032, ["onClick", "active", "data-test"]))), 128))
|
|
@@ -34500,7 +34542,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34500
34542
|
_: 1
|
|
34501
34543
|
}));
|
|
34502
34544
|
}
|
|
34503
|
-
}
|
|
34545
|
+
}, _hoisted_1 = {
|
|
34504
34546
|
class: "vs-federated-search",
|
|
34505
34547
|
"data-test": "vs-federated-search"
|
|
34506
34548
|
}, _hoisted_2 = { class: "vs-federated-search__container" }, _hoisted_3 = {
|
|
@@ -34713,7 +34755,10 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34713
34755
|
])) : createCommentVNode("", !0),
|
|
34714
34756
|
unref(n).isLoading ? (openBlock(), createBlock(unref(VsLoading), { key: 1 })) : createCommentVNode("", !0),
|
|
34715
34757
|
!unref(n).isLoading && unref(n).results && !unref(n).eventsApiError ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
34716
|
-
createVNode(unref(VsCardGroup), {
|
|
34758
|
+
createVNode(unref(VsCardGroup), {
|
|
34759
|
+
"cards-per-row": 3,
|
|
34760
|
+
class: normalizeClass(unref(n).results && r.value <= 1 ? "mb-300" : null)
|
|
34761
|
+
}, {
|
|
34717
34762
|
default: withCtx(() => [
|
|
34718
34763
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).results, (g) => (openBlock(), createBlock(unref(VsCard), {
|
|
34719
34764
|
key: g.id
|
|
@@ -34819,7 +34864,7 @@ const useFederatedSearchStore = defineStore("federatedSearch", () => {
|
|
|
34819
34864
|
}, 1024))), 128))
|
|
34820
34865
|
]),
|
|
34821
34866
|
_: 1
|
|
34822
|
-
}),
|
|
34867
|
+
}, 8, ["class"]),
|
|
34823
34868
|
unref(n).results && r.value > 1 ? (openBlock(), createBlock(unref(_sfc_main$E), {
|
|
34824
34869
|
key: 0,
|
|
34825
34870
|
class: "vs-federated-search__pagination",
|