@museumwnf/viewer-layout 3.70.0 → 3.71.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/README.md +40 -27
- package/dist/{Theme-DmcJnG3h.js → Theme-DvCv48p7.js} +119 -123
- package/dist/TimelineResultsView-Bn4rC_Se.js +614 -0
- package/dist/dxa.js +509 -489
- package/dist/minisite.js +837 -735
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +1 -1
- package/package.json +6 -4
- package/src/minisite/testing.js +281 -0
- package/src/styles/dxa-exhibition.css +14 -1
- package/src/styles/dxa-gallery.css +9 -3
- package/dist/TimelineResultsView-BF3VoCs_.js +0 -686
|
@@ -1,686 +0,0 @@
|
|
|
1
|
-
import { d as e, l as t, u as n } from "./PartnerMap-DdyMLtgH.js";
|
|
2
|
-
import { a as r, i, n as a, o, r as s, t as c } from "./TimelineEventList-CIkKxyQu.js";
|
|
3
|
-
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, guardReactiveProps as v, mergeProps as y, normalizeClass as b, normalizeProps as x, openBlock as S, reactive as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, withCtx as A } from "vue";
|
|
4
|
-
import { dateRange as j, entityRef as M, eventDateLabel as N, groupByCountry as P, partnerHierarchy as ee, partnerView as F, renderBlock as I, renderInline as te, renderPlain as L, sortChronological as R, useDataPackage as z, useFacets as B, useI18n as ne, useListQuery as re, usePagination as V, useTimelineEvents as ie } from "@museumwnf/viewer-core";
|
|
5
|
-
import { useRouter as H } from "vue-router";
|
|
6
|
-
// src/views/CatalogueResultsView.vue
|
|
7
|
-
var ae = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "mwnf-catalogue__title"
|
|
10
|
-
}, oe = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "mwnf-facet"
|
|
13
|
-
}, U = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "mwnf-facet__label"
|
|
16
|
-
}, se = [
|
|
17
|
-
"value",
|
|
18
|
-
"placeholder",
|
|
19
|
-
"onInput"
|
|
20
|
-
], ce = {
|
|
21
|
-
key: 1,
|
|
22
|
-
class: "mwnf-facet"
|
|
23
|
-
}, W = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "mwnf-facet__label"
|
|
26
|
-
}, le = [
|
|
27
|
-
"value",
|
|
28
|
-
"placeholder",
|
|
29
|
-
"onInput"
|
|
30
|
-
], ue = {
|
|
31
|
-
key: 2,
|
|
32
|
-
class: "mwnf-facet mwnf-facet--checkbox"
|
|
33
|
-
}, de = ["checked", "onChange"], G = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "mwnf-facet__label"
|
|
36
|
-
}, K = { class: "mwnf-catalogue__body" }, fe = { class: "mwnf-catalogue__results" }, pe = {
|
|
37
|
-
key: 0,
|
|
38
|
-
class: "mwnf-catalogue__aside"
|
|
39
|
-
}, q = {
|
|
40
|
-
__name: "CatalogueResultsView",
|
|
41
|
-
props: {
|
|
42
|
-
spec: {
|
|
43
|
-
type: Object,
|
|
44
|
-
required: !0
|
|
45
|
-
},
|
|
46
|
-
entity: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ""
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
setup(e) {
|
|
52
|
-
let a = e, { t: c, locale: y } = ne(), C = z(), w = a.spec.entity ?? a.entity, N = u(() => a.spec), P = M(w);
|
|
53
|
-
w && C.loadTranslations(w, "en");
|
|
54
|
-
let ee = u(() => N.value.keys ?? [...Object.keys(N.value.facets ?? {}), ...F()]);
|
|
55
|
-
function F() {
|
|
56
|
-
let e = N.value.dates;
|
|
57
|
-
return e ? [e.begin ?? "begin", e.end ?? "end"] : [];
|
|
58
|
-
}
|
|
59
|
-
let { filters: I, page: ie, active: H, apply: q, reset: me, goToPage: he } = re({ keys: ee.value }), J = {
|
|
60
|
-
t: c,
|
|
61
|
-
locale: y,
|
|
62
|
-
tr: (e, t) => C.tr(e, t, y.value, "en"),
|
|
63
|
-
renderInline: te,
|
|
64
|
-
renderPlain: L
|
|
65
|
-
};
|
|
66
|
-
function Y(e, t) {
|
|
67
|
-
if (typeof t.values == "function") return [t.values(e)].flat();
|
|
68
|
-
let n = e?.[t.field];
|
|
69
|
-
return Array.isArray(n) ? n : [n];
|
|
70
|
-
}
|
|
71
|
-
let X = u(() => {
|
|
72
|
-
let e = N.value, t = P.value ?? [];
|
|
73
|
-
e.scope && (t = t.filter((t) => e.scope(t, I, J)));
|
|
74
|
-
for (let [n, r] of Object.entries(e.facets ?? {})) {
|
|
75
|
-
let e = I[n];
|
|
76
|
-
e && (t = t.filter((t) => Y(t, r).map(String).includes(String(e))));
|
|
77
|
-
}
|
|
78
|
-
e.match && (t = t.filter((t) => e.match(t, I, J))), e.narrow && (t = e.narrow(t, I, J)), e.dates && (t = j(t, {
|
|
79
|
-
begin: I[e.dates.begin ?? "begin"],
|
|
80
|
-
end: I[e.dates.end ?? "end"],
|
|
81
|
-
mode: e.dates.mode ?? "overlap",
|
|
82
|
-
fields: e.dates.fields
|
|
83
|
-
}));
|
|
84
|
-
let n = e.sort ?? "chronological";
|
|
85
|
-
return typeof n == "function" ? n(t) : n === "chronological" ? R(t) : n && typeof n == "object" ? R(t, n) : t;
|
|
86
|
-
}), ge = u(() => N.value.facetScope === "matching" ? X.value : P.value ?? []), Z = B(ge, () => N.value.facets ?? {}), Q = V(X, {
|
|
87
|
-
page: ie,
|
|
88
|
-
size: () => N.value.pageSize ?? 20
|
|
89
|
-
}), _e = u(() => N.value.recordRoute ?? (a.entity ? `${a.entity}-detail` : "item"));
|
|
90
|
-
function ve(e) {
|
|
91
|
-
let t = J.tr(w, e.id).name ?? e.internal_name ?? e.id;
|
|
92
|
-
return {
|
|
93
|
-
id: e.id,
|
|
94
|
-
image: e.images?.[0]?.url ?? "",
|
|
95
|
-
imageAlt: L(String(t)),
|
|
96
|
-
name: te(String(t)),
|
|
97
|
-
meta: [],
|
|
98
|
-
badge: e.type ?? "",
|
|
99
|
-
to: {
|
|
100
|
-
name: _e.value,
|
|
101
|
-
params: { id: e.id }
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
let ye = u(() => Q.value.rows.map((e) => (N.value.record ?? ve)(e, J))), $ = u(() => ({
|
|
106
|
-
filters: I,
|
|
107
|
-
active: H.value,
|
|
108
|
-
apply: q,
|
|
109
|
-
reset: me,
|
|
110
|
-
goToPage: he,
|
|
111
|
-
matching: X.value,
|
|
112
|
-
pageInfo: Q.value,
|
|
113
|
-
options: Z.value
|
|
114
|
-
})), be = u(() => {
|
|
115
|
-
let e = N.value;
|
|
116
|
-
return e.summary ? e.summary({
|
|
117
|
-
...$.value,
|
|
118
|
-
t: c,
|
|
119
|
-
total: (P.value ?? []).length
|
|
120
|
-
}) : [{
|
|
121
|
-
label: c(e.summaryLabel ?? "catalogue.results.itemsFound"),
|
|
122
|
-
count: Q.value.total
|
|
123
|
-
}];
|
|
124
|
-
}), xe = u(() => N.value.filterMode ?? "apply"), Se = u(() => N.value.controls ?? []), Ce = u(() => Se.value.length > 0 || !!N.value.panel);
|
|
125
|
-
function we(e, t) {
|
|
126
|
-
xe.value === "immediate" ? q({ [e]: t }) : I[e] = t;
|
|
127
|
-
}
|
|
128
|
-
let Te = u(() => c(N.value.empty ?? "catalogue.results.noResultsFilter")), Ee = u(() => N.value.variant === "grid"), De = u(() => ({
|
|
129
|
-
window: 5,
|
|
130
|
-
jump: !1,
|
|
131
|
-
ends: !0,
|
|
132
|
-
...N.value.pagination ?? {}
|
|
133
|
-
}));
|
|
134
|
-
return (e, a) => (S(), p("section", { class: b(["mwnf-catalogue", { "mwnf-catalogue--boxed": N.value.boxed }]) }, [
|
|
135
|
-
E(e.$slots, "before", x(v($.value))),
|
|
136
|
-
N.value.title ? (S(), p("h1", ae, O(k(c)(N.value.title)), 1)) : f("", !0),
|
|
137
|
-
Ce.value || e.$slots.filters ? (S(), d(i, {
|
|
138
|
-
key: 1,
|
|
139
|
-
class: "mwnf-catalogue__filters",
|
|
140
|
-
mode: xe.value,
|
|
141
|
-
title: N.value.filterTitle ? k(c)(N.value.filterTitle) : "",
|
|
142
|
-
"reset-label": N.value.resetLabel ? k(c)(N.value.resetLabel) : "",
|
|
143
|
-
onApply: a[2] ||= (e) => k(q)(),
|
|
144
|
-
onReset: a[3] ||= (e) => k(me)()
|
|
145
|
-
}, {
|
|
146
|
-
default: A(() => [(S(!0), p(l, null, T(Se.value, (e) => (S(), p(l, { key: e.key }, [e.type === "year" ? (S(), p("label", oe, [e.label ? (S(), p("span", U, O(k(c)(e.label)), 1)) : f("", !0), m("input", {
|
|
147
|
-
type: "number",
|
|
148
|
-
class: "mwnf-facet__select",
|
|
149
|
-
value: k(I)[e.key],
|
|
150
|
-
placeholder: e.placeholder ? k(c)(e.placeholder) : "",
|
|
151
|
-
onInput: (t) => k(I)[e.key] = t.target.value,
|
|
152
|
-
onChange: a[0] ||= (e) => xe.value === "immediate" ? k(q)() : null
|
|
153
|
-
}, null, 40, se)])) : e.type === "query" ? (S(), p("label", ce, [e.label ? (S(), p("span", W, O(k(c)(e.label)), 1)) : f("", !0), m("input", {
|
|
154
|
-
type: "text",
|
|
155
|
-
class: "mwnf-facet__select",
|
|
156
|
-
value: k(I)[e.key],
|
|
157
|
-
placeholder: e.placeholder ? k(c)(e.placeholder) : "",
|
|
158
|
-
onInput: (t) => k(I)[e.key] = t.target.value,
|
|
159
|
-
onChange: a[1] ||= (e) => xe.value === "immediate" ? k(q)() : null
|
|
160
|
-
}, null, 40, le)])) : e.type === "checkbox" ? (S(), p("label", ue, [m("input", {
|
|
161
|
-
type: "checkbox",
|
|
162
|
-
class: "mwnf-facet__checkbox",
|
|
163
|
-
checked: k(I)[e.key] === "1",
|
|
164
|
-
onChange: (t) => we(e.key, t.target.checked ? "1" : "")
|
|
165
|
-
}, null, 40, de), e.label ? (S(), p("span", G, O(k(c)(e.label)), 1)) : f("", !0)])) : (S(), d(r, {
|
|
166
|
-
key: 3,
|
|
167
|
-
"model-value": k(I)[e.key],
|
|
168
|
-
label: e.label ? k(c)(e.label) : "",
|
|
169
|
-
options: k(Z)[e.key] ?? [],
|
|
170
|
-
placeholder: e.placeholder ? k(c)(e.placeholder) : "",
|
|
171
|
-
"any-label": e.anyLabel ? k(c)(e.anyLabel) : "",
|
|
172
|
-
"hide-empty": !!e.hideEmpty,
|
|
173
|
-
"onUpdate:modelValue": (t) => we(e.key, t)
|
|
174
|
-
}, null, 8, [
|
|
175
|
-
"model-value",
|
|
176
|
-
"label",
|
|
177
|
-
"options",
|
|
178
|
-
"placeholder",
|
|
179
|
-
"any-label",
|
|
180
|
-
"hide-empty",
|
|
181
|
-
"onUpdate:modelValue"
|
|
182
|
-
]))], 64))), 128)), E(e.$slots, "filters", x(v($.value)))]),
|
|
183
|
-
_: 3
|
|
184
|
-
}, 8, [
|
|
185
|
-
"mode",
|
|
186
|
-
"title",
|
|
187
|
-
"reset-label"
|
|
188
|
-
])) : f("", !0),
|
|
189
|
-
_(s, { parts: be.value }, h({ _: 2 }, [e.$slots.actions ? {
|
|
190
|
-
name: "actions",
|
|
191
|
-
fn: A(() => [E(e.$slots, "actions", x(v($.value)))]),
|
|
192
|
-
key: "0"
|
|
193
|
-
} : void 0]), 1032, ["parts"]),
|
|
194
|
-
m("div", K, [m("div", fe, [E(e.$slots, "records", x(v({
|
|
195
|
-
...$.value,
|
|
196
|
-
rows: ye.value,
|
|
197
|
-
empty: Te.value
|
|
198
|
-
})), () => [(S(), d(D(Ee.value ? t : n), {
|
|
199
|
-
records: ye.value,
|
|
200
|
-
"action-label": N.value.actionLabel ? k(c)(N.value.actionLabel) : ""
|
|
201
|
-
}, {
|
|
202
|
-
empty: A(() => [E(e.$slots, "empty", x(v($.value)), () => [g(O(Te.value), 1)])]),
|
|
203
|
-
_: 3
|
|
204
|
-
}, 8, ["records", "action-label"]))]), E(e.$slots, "pagination", x(v($.value)), () => [e.$slots.pagination ? f("", !0) : (S(), d(o, {
|
|
205
|
-
key: 0,
|
|
206
|
-
"page-info": k(Q),
|
|
207
|
-
window: De.value.window,
|
|
208
|
-
jump: De.value.jump,
|
|
209
|
-
ends: De.value.ends,
|
|
210
|
-
onNavigate: k(he)
|
|
211
|
-
}, null, 8, [
|
|
212
|
-
"page-info",
|
|
213
|
-
"window",
|
|
214
|
-
"jump",
|
|
215
|
-
"ends",
|
|
216
|
-
"onNavigate"
|
|
217
|
-
]))])]), e.$slots.aside ? (S(), p("aside", pe, [E(e.$slots, "aside", x(v($.value)))])) : f("", !0)]),
|
|
218
|
-
E(e.$slots, "after", x(v($.value)))
|
|
219
|
-
], 2));
|
|
220
|
-
}
|
|
221
|
-
}, me = { class: "mwnf-partner-list" }, he = {
|
|
222
|
-
key: 0,
|
|
223
|
-
class: "mwnf-partner-list__title"
|
|
224
|
-
}, J = {
|
|
225
|
-
key: 1,
|
|
226
|
-
class: "mwnf-partner-list__count"
|
|
227
|
-
}, Y = {
|
|
228
|
-
key: 2,
|
|
229
|
-
class: "mwnf-partner-list__toggle"
|
|
230
|
-
}, X = {
|
|
231
|
-
key: 3,
|
|
232
|
-
class: "mwnf-partner-list__groups"
|
|
233
|
-
}, ge = {
|
|
234
|
-
key: 0,
|
|
235
|
-
class: "mwnf-partner-list__group-title"
|
|
236
|
-
}, Z = { class: "mwnf-partner-list__tier" }, Q = { class: "mwnf-partner-list__row" }, _e = {
|
|
237
|
-
key: 0,
|
|
238
|
-
class: "mwnf-partner-list__children"
|
|
239
|
-
}, ve = {
|
|
240
|
-
key: 0,
|
|
241
|
-
class: "mwnf-partner-list__tier mwnf-partner-list__tier--associated"
|
|
242
|
-
}, ye = { class: "mwnf-partner-list__tier-label" }, $ = {
|
|
243
|
-
key: 4,
|
|
244
|
-
class: "mwnf-partner-list__empty"
|
|
245
|
-
}, be = {
|
|
246
|
-
__name: "PartnerListView",
|
|
247
|
-
props: { spec: {
|
|
248
|
-
type: Object,
|
|
249
|
-
required: !0
|
|
250
|
-
} },
|
|
251
|
-
setup(e) {
|
|
252
|
-
let t = e, { t: n, locale: r } = ne(), i = z(), o = u(() => t.spec), s = u(() => o.value.entity ?? "partners"), c = M(s.value);
|
|
253
|
-
s.value && i.loadTranslations(s.value, "en");
|
|
254
|
-
let h = {
|
|
255
|
-
t: n,
|
|
256
|
-
locale: r,
|
|
257
|
-
tr: (e) => i.tr(s.value, e, r.value, "en"),
|
|
258
|
-
renderInline: te,
|
|
259
|
-
renderPlain: L
|
|
260
|
-
}, { filters: g, apply: b } = re({
|
|
261
|
-
keys: ["order"],
|
|
262
|
-
page: !1
|
|
263
|
-
}), C = u(() => g.order === "desc" ? "desc" : "asc");
|
|
264
|
-
function w() {
|
|
265
|
-
b({ order: C.value === "asc" ? "desc" : "asc" });
|
|
266
|
-
}
|
|
267
|
-
let k = u(() => {
|
|
268
|
-
let e = o.value, t = c.value ?? [];
|
|
269
|
-
return e.scope ? t.filter((t) => e.scope(t, h)) : t;
|
|
270
|
-
}), j = u(() => o.value.route);
|
|
271
|
-
function N(e) {
|
|
272
|
-
let t = j.value;
|
|
273
|
-
return t ? typeof t == "function" ? t(e, h) : {
|
|
274
|
-
name: t,
|
|
275
|
-
params: { id: e.id }
|
|
276
|
-
} : null;
|
|
277
|
-
}
|
|
278
|
-
function I(e) {
|
|
279
|
-
let t = o.value.objectsRoute;
|
|
280
|
-
return F(e, h.tr(e.id), {
|
|
281
|
-
route: N,
|
|
282
|
-
objectsRoute: t ? (e) => t(e, h) : null
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
function R(e, t) {
|
|
286
|
-
let n = t.name ?? "";
|
|
287
|
-
return {
|
|
288
|
-
...F(e, {}, {}),
|
|
289
|
-
name: n,
|
|
290
|
-
plainName: V(n),
|
|
291
|
-
city: t.city ?? "",
|
|
292
|
-
location: t.city ?? "",
|
|
293
|
-
logos: t.logo ? [{
|
|
294
|
-
url: t.logo,
|
|
295
|
-
alt: V(n),
|
|
296
|
-
type: ""
|
|
297
|
-
}] : [],
|
|
298
|
-
itemCount: t.count ?? 0,
|
|
299
|
-
route: t.route ?? null
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function B(e) {
|
|
303
|
-
if (o.value.record) {
|
|
304
|
-
let t = o.value.record(e, h);
|
|
305
|
-
return {
|
|
306
|
-
partner: e,
|
|
307
|
-
row: t,
|
|
308
|
-
view: R(e, t)
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
let t = I(e);
|
|
312
|
-
return {
|
|
313
|
-
partner: e,
|
|
314
|
-
row: {
|
|
315
|
-
name: t.name,
|
|
316
|
-
city: t.city,
|
|
317
|
-
logo: t.logos[0]?.url ?? "",
|
|
318
|
-
count: t.itemCount,
|
|
319
|
-
route: t.route
|
|
320
|
-
},
|
|
321
|
-
view: t
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
function V(e) {
|
|
325
|
-
return String(e ?? "").replace(/<[^>]*>/g, "");
|
|
326
|
-
}
|
|
327
|
-
let ie = u(() => o.value.nested ? ee(k.value) : null), H = u(() => {
|
|
328
|
-
let e = o.value, t = e.group?.tier ?? !1, n = (e.group?.order ?? "country") === "name", r = n ? k.value.map((e) => ({
|
|
329
|
-
...e,
|
|
330
|
-
country_id: "\0"
|
|
331
|
-
})) : k.value, i = P(r, {
|
|
332
|
-
label: n ? () => "" : (t) => e.label ? e.label(t, h) : t,
|
|
333
|
-
tier: t,
|
|
334
|
-
order: C.value
|
|
335
|
-
}), a = e.tiebreak ?? (() => ""), s = (e, t) => V(e.row.name).localeCompare(V(t.row.name)) || String(a(e.partner)).localeCompare(String(a(t.partner)));
|
|
336
|
-
return i.map((t) => {
|
|
337
|
-
let r = t.main.map(B).sort(s), i = t.associated.map(B).sort(s);
|
|
338
|
-
if (n && C.value === "desc" && (r.reverse(), i.reverse()), e.nested && ie.value) {
|
|
339
|
-
let e = new Set(i.map((e) => e.partner.id));
|
|
340
|
-
r = r.map((t) => {
|
|
341
|
-
let n = ie.value.children(t.partner.id).filter((t) => e.has(t.id));
|
|
342
|
-
for (let t of n) e.delete(t.id);
|
|
343
|
-
return {
|
|
344
|
-
...t,
|
|
345
|
-
children: n.map(B)
|
|
346
|
-
};
|
|
347
|
-
}), i = i.filter((t) => e.has(t.partner.id));
|
|
348
|
-
}
|
|
349
|
-
return {
|
|
350
|
-
country: t.country,
|
|
351
|
-
label: t.label,
|
|
352
|
-
main: r,
|
|
353
|
-
associated: i
|
|
354
|
-
};
|
|
355
|
-
});
|
|
356
|
-
}), ae = u(() => H.value.some((e) => e.main.length > 0 || e.associated.length > 0)), oe = u(() => n(o.value.associatedLabel ?? "partner.list.associated")), U = u(() => ({
|
|
357
|
-
objectsLabel: o.value.objectsLabel ?? "partner.item.objectsInSite",
|
|
358
|
-
emptyLabel: o.value.emptyLabel ?? "",
|
|
359
|
-
show: { actions: !!o.value.actions }
|
|
360
|
-
})), se = u(() => n(o.value.foundLabel ?? "partner.list.partnersFound")), ce = u(() => n(o.value.sortAscendingLabel ?? "partner.list.sortAscending")), W = u(() => n(o.value.sortDescendingLabel ?? "partner.list.sortDescending")), le = u(() => n(o.value.empty ?? "catalogue.results.noResults")), ue = u(() => o.value.title ? n(o.value.title) : ""), de = u(() => H.value.reduce((e, t) => e + t.main.length + t.associated.length, 0)), G = u(() => o.value.variant ?? "accordion"), K = u(() => ({
|
|
361
|
-
t: n,
|
|
362
|
-
locale: r,
|
|
363
|
-
groups: H.value,
|
|
364
|
-
orderDir: C.value,
|
|
365
|
-
toggleOrder: w
|
|
366
|
-
}));
|
|
367
|
-
return (e, t) => (S(), p("section", me, [
|
|
368
|
-
ue.value ? (S(), p("h1", he, O(ue.value), 1)) : f("", !0),
|
|
369
|
-
o.value.count ? (S(), p("div", J, O(se.value) + ": " + O(de.value), 1)) : f("", !0),
|
|
370
|
-
E(e.$slots, "before", x(v(K.value))),
|
|
371
|
-
o.value.orderToggle ? (S(), p("div", Y, [m("button", {
|
|
372
|
-
type: "button",
|
|
373
|
-
class: "mwnf-partner-list__toggle-button",
|
|
374
|
-
onClick: w
|
|
375
|
-
}, O(C.value === "asc" ? W.value : ce.value), 1)])) : f("", !0),
|
|
376
|
-
ae.value ? (S(), p("div", X, [(S(!0), p(l, null, T(H.value, (t) => (S(), d(D(G.value === "accordion" ? "details" : "section"), y({
|
|
377
|
-
key: t.country ?? "",
|
|
378
|
-
class: "mwnf-partner-list__group"
|
|
379
|
-
}, { ref_for: !0 }, G.value === "accordion" ? { open: !0 } : {}), {
|
|
380
|
-
default: A(() => [
|
|
381
|
-
(S(), d(D(G.value === "accordion" ? "summary" : "div"), { class: "mwnf-partner-list__group-heading" }, {
|
|
382
|
-
default: A(() => [E(e.$slots, "group-heading", y({ group: t }, { ref_for: !0 }, K.value), () => [t.label ? (S(), p("h2", ge, O(t.label), 1)) : f("", !0)])]),
|
|
383
|
-
_: 2
|
|
384
|
-
}, 1024)),
|
|
385
|
-
m("div", Z, [(S(!0), p(l, null, T(t.main, (n) => (S(), p("div", {
|
|
386
|
-
key: n.partner.id,
|
|
387
|
-
class: "mwnf-partner-list__row-block"
|
|
388
|
-
}, [m("div", Q, [E(e.$slots, "row", y({
|
|
389
|
-
group: t,
|
|
390
|
-
partner: n.partner,
|
|
391
|
-
row: n.row,
|
|
392
|
-
view: n.view
|
|
393
|
-
}, { ref_for: !0 }, K.value), () => [_(a, y({
|
|
394
|
-
variant: "line",
|
|
395
|
-
partner: n.view
|
|
396
|
-
}, { ref_for: !0 }, U.value), null, 16, ["partner"])])]), n.children?.length ? (S(), p("div", _e, [(S(!0), p(l, null, T(n.children, (n) => (S(), p("div", {
|
|
397
|
-
key: n.partner.id,
|
|
398
|
-
class: "mwnf-partner-list__row mwnf-partner-list__row--child"
|
|
399
|
-
}, [E(e.$slots, "row", y({
|
|
400
|
-
group: t,
|
|
401
|
-
partner: n.partner,
|
|
402
|
-
row: n.row,
|
|
403
|
-
view: n.view
|
|
404
|
-
}, { ref_for: !0 }, K.value), () => [_(a, y({
|
|
405
|
-
variant: "line",
|
|
406
|
-
partner: n.view
|
|
407
|
-
}, { ref_for: !0 }, U.value), null, 16, ["partner"])])]))), 128))])) : f("", !0)]))), 128))]),
|
|
408
|
-
t.associated.length ? (S(), p("div", ve, [m("p", ye, O(oe.value), 1), (S(!0), p(l, null, T(t.associated, (n) => (S(), p("div", {
|
|
409
|
-
key: n.partner.id,
|
|
410
|
-
class: "mwnf-partner-list__row"
|
|
411
|
-
}, [E(e.$slots, "row", y({
|
|
412
|
-
group: t,
|
|
413
|
-
partner: n.partner,
|
|
414
|
-
row: n.row,
|
|
415
|
-
view: n.view
|
|
416
|
-
}, { ref_for: !0 }, K.value), () => [_(a, y({
|
|
417
|
-
variant: "line",
|
|
418
|
-
partner: n.view
|
|
419
|
-
}, { ref_for: !0 }, U.value), null, 16, ["partner"])])]))), 128))])) : f("", !0)
|
|
420
|
-
]),
|
|
421
|
-
_: 2
|
|
422
|
-
}, 1040))), 128))])) : (S(), p("p", $, O(le.value), 1)),
|
|
423
|
-
E(e.$slots, "after", x(v(K.value)))
|
|
424
|
-
]));
|
|
425
|
-
}
|
|
426
|
-
}, xe = { class: "mwnf-timeline" }, Se = {
|
|
427
|
-
key: 0,
|
|
428
|
-
class: "mwnf-timeline__title"
|
|
429
|
-
}, Ce = {
|
|
430
|
-
key: 3,
|
|
431
|
-
class: "mwnf-facet"
|
|
432
|
-
}, we = { class: "mwnf-facet__label" }, Te = [
|
|
433
|
-
"value",
|
|
434
|
-
"placeholder",
|
|
435
|
-
"onInput"
|
|
436
|
-
], Ee = {
|
|
437
|
-
key: 3,
|
|
438
|
-
class: "mwnf-timeline__error"
|
|
439
|
-
}, De = {
|
|
440
|
-
__name: "TimelineResultsView",
|
|
441
|
-
props: { spec: {
|
|
442
|
-
type: Object,
|
|
443
|
-
required: !0
|
|
444
|
-
} },
|
|
445
|
-
setup(t) {
|
|
446
|
-
let n = t, { t: a } = ne(), h = H(), b = u(() => n.spec), D = u(() => !!b.value.entrance), j = ie({
|
|
447
|
-
scope: n.spec.scope ?? "country",
|
|
448
|
-
countryLabel: n.spec.countryLabel,
|
|
449
|
-
countryIdForCode: n.spec.countryIdForCode,
|
|
450
|
-
tr: n.spec.tr,
|
|
451
|
-
timelinesEntity: n.spec.timelinesEntity,
|
|
452
|
-
eventsEntity: n.spec.eventsEntity
|
|
453
|
-
}), M = u(() => b.value.controls ?? []), P = u(() => b.value.keys ?? M.value.map((e) => e.key)), ee = (e) => M.value.some((t) => t.key === e), F = u(() => ({
|
|
454
|
-
t: a,
|
|
455
|
-
tr: n.spec.tr,
|
|
456
|
-
years: {
|
|
457
|
-
min: ce.value[0],
|
|
458
|
-
max: ce.value[1]
|
|
459
|
-
}
|
|
460
|
-
})), L = C(Object.fromEntries(P.value.map((e) => [e, ""]))), R = w(""), z = D.value ? null : re({ keys: P.value }), B = D.value ? L : z.filters;
|
|
461
|
-
function ae(e) {
|
|
462
|
-
if (ee("collection") && e !== "" && e != null) return e === "pc" ? null : e;
|
|
463
|
-
}
|
|
464
|
-
function oe() {
|
|
465
|
-
for (let e of P.value) L[e] = "";
|
|
466
|
-
R.value = "";
|
|
467
|
-
}
|
|
468
|
-
function U() {
|
|
469
|
-
R.value = "";
|
|
470
|
-
let e = !!B.begin && !!B.end;
|
|
471
|
-
if (e && Number(B.begin) >= Number(B.end)) {
|
|
472
|
-
R.value = a(b.value.errorPeriod ?? "timeline.form.errorPeriod");
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
if (!B.country && !e) {
|
|
476
|
-
R.value = a(b.value.errorSelect ?? "timeline.form.errorSelect");
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
let t = {};
|
|
480
|
-
for (let e of P.value) B[e] && (t[e] = B[e]);
|
|
481
|
-
h.push({
|
|
482
|
-
name: b.value.route,
|
|
483
|
-
query: t
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
let se = u(() => {
|
|
487
|
-
if (D.value) return [];
|
|
488
|
-
let e = B;
|
|
489
|
-
return j.findEvents({
|
|
490
|
-
country: e.country || void 0,
|
|
491
|
-
collection: ae(e.collection),
|
|
492
|
-
begin: e.begin,
|
|
493
|
-
end: e.end
|
|
494
|
-
});
|
|
495
|
-
}), ce = u(() => {
|
|
496
|
-
let e = j.findEvents({
|
|
497
|
-
country: void 0,
|
|
498
|
-
collection: void 0
|
|
499
|
-
}), t = (e) => Number.isFinite(e) && e !== 0, n = e.map((e) => e.year_from).filter(t), r = e.map((e) => t(e.year_to) ? e.year_to : e.year_from).filter(t);
|
|
500
|
-
return n.length ? [Math.min(...n), Math.max(...r)] : [null, null];
|
|
501
|
-
}), W = V(se, {
|
|
502
|
-
page: () => z ? z.page.value : 1,
|
|
503
|
-
size: () => b.value.pageSize ?? 15
|
|
504
|
-
}), le = (e) => a(b.value.eraWords?.[e] ?? e);
|
|
505
|
-
function ue(e) {
|
|
506
|
-
let t = b.value.countryLabel && e.country_id ? b.value.countryLabel(e.country_id) : "";
|
|
507
|
-
return {
|
|
508
|
-
id: e.id,
|
|
509
|
-
date: N(e, e.text, le),
|
|
510
|
-
caption: t ? te(String(t)) : "",
|
|
511
|
-
description: e.text?.description ? I(String(e.text.description), { breaks: !0 }) : ""
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
let de = u(() => W.value.rows.map((e) => (b.value.event ?? ue)(e, F.value))), G = u(() => (j.countries.value ?? []).map((e) => ({
|
|
515
|
-
value: e.value,
|
|
516
|
-
label: e.value === "all" ? a("timeline.form.allCountries") : e.label
|
|
517
|
-
}))), K = u(() => b.value.collections?.(F.value) ?? []), fe = u(() => {
|
|
518
|
-
let e = {};
|
|
519
|
-
for (let t of M.value) (t.key === "begin" || t.key === "end") && t.options && (typeof t.options == "function" ? e[t.key] = t.options(F.value) : e[t.key] = t.options);
|
|
520
|
-
return e;
|
|
521
|
-
}), pe = u(() => ({
|
|
522
|
-
filters: B,
|
|
523
|
-
active: P.value.some((e) => B[e]),
|
|
524
|
-
apply: D.value ? U : (e) => z.apply(e),
|
|
525
|
-
reset: D.value ? oe : z.reset,
|
|
526
|
-
goToPage: D.value ? () => {} : z.goToPage,
|
|
527
|
-
events: se.value,
|
|
528
|
-
rows: de.value,
|
|
529
|
-
pageInfo: W.value,
|
|
530
|
-
countries: G.value,
|
|
531
|
-
collections: K.value,
|
|
532
|
-
t: a,
|
|
533
|
-
tr: b.value.tr
|
|
534
|
-
})), q = u(() => {
|
|
535
|
-
let e = b.value.gallery;
|
|
536
|
-
return !e || D.value ? null : !e.items || e.items(pe.value);
|
|
537
|
-
}), me = u(() => {
|
|
538
|
-
let e = q.value;
|
|
539
|
-
return e == null ? !1 : Array.isArray(e) ? e.length > 0 : !!e;
|
|
540
|
-
}), he = u(() => {
|
|
541
|
-
let e = q.value;
|
|
542
|
-
return Array.isArray(e) ? e.length : typeof e == "number" ? e : null;
|
|
543
|
-
}), J = u(() => {
|
|
544
|
-
if (!me.value) return null;
|
|
545
|
-
let e = {};
|
|
546
|
-
for (let t of P.value) B[t] && (e[t] = B[t]);
|
|
547
|
-
return {
|
|
548
|
-
to: {
|
|
549
|
-
name: b.value.gallery.route,
|
|
550
|
-
query: e
|
|
551
|
-
},
|
|
552
|
-
count: he.value,
|
|
553
|
-
label: a(b.value.gallery.label ?? "timeline.nav.seeGallery")
|
|
554
|
-
};
|
|
555
|
-
}), Y = u(() => ({
|
|
556
|
-
...pe.value,
|
|
557
|
-
gallery: J.value
|
|
558
|
-
})), X = u(() => b.value.summary ? b.value.summary(Y.value) : [{
|
|
559
|
-
label: a(b.value.summaryLabel ?? "timeline.results.eventsFound"),
|
|
560
|
-
count: W.value.total
|
|
561
|
-
}]), ge = u(() => a(b.value.empty ?? "timeline.results.noResults")), Z = u(() => ({
|
|
562
|
-
window: 5,
|
|
563
|
-
jump: !1,
|
|
564
|
-
ends: !0,
|
|
565
|
-
...b.value.pagination ?? {}
|
|
566
|
-
}));
|
|
567
|
-
function Q(e, t) {
|
|
568
|
-
return e.label ? a(e.label) : t ? a(t) : "";
|
|
569
|
-
}
|
|
570
|
-
return (t, n) => (S(), p("section", xe, [
|
|
571
|
-
E(t.$slots, "before", x(v(Y.value))),
|
|
572
|
-
b.value.title ? (S(), p("h1", Se, O(k(a)(b.value.title)), 1)) : f("", !0),
|
|
573
|
-
t.$slots.form ? E(t.$slots, "form", y(D.value ? {} : Y.value, {
|
|
574
|
-
filters: k(B),
|
|
575
|
-
countries: G.value,
|
|
576
|
-
options: fe.value,
|
|
577
|
-
go: (e) => k(h).push({
|
|
578
|
-
name: b.value.route,
|
|
579
|
-
query: e
|
|
580
|
-
}),
|
|
581
|
-
t: k(a)
|
|
582
|
-
}), void 0, void 0, 1) : (S(), d(i, {
|
|
583
|
-
key: 2,
|
|
584
|
-
class: "mwnf-timeline__filters",
|
|
585
|
-
title: b.value.filterTitle ? k(a)(b.value.filterTitle) : "",
|
|
586
|
-
"apply-label": D.value ? k(a)(b.value.submitLabel ?? "core.action.search") : b.value.applyLabel ? k(a)(b.value.applyLabel) : "",
|
|
587
|
-
"reset-label": b.value.resetLabel ? k(a)(b.value.resetLabel) : "",
|
|
588
|
-
onApply: n[2] ||= (e) => D.value ? U() : k(z).apply(),
|
|
589
|
-
onReset: n[3] ||= (e) => D.value ? oe() : k(z).reset()
|
|
590
|
-
}, {
|
|
591
|
-
default: A(() => [(S(!0), p(l, null, T(M.value, (e) => (S(), p(l, { key: e.key }, [e.key === "country" ? (S(), d(r, {
|
|
592
|
-
key: 0,
|
|
593
|
-
"model-value": k(B).country,
|
|
594
|
-
label: Q(e, "catalogue.facet.country"),
|
|
595
|
-
options: G.value,
|
|
596
|
-
placeholder: e.placeholder ? k(a)(e.placeholder) : k(a)("catalogue.facet.selectCountry"),
|
|
597
|
-
"any-label": e.anyLabel ? k(a)(e.anyLabel) : "",
|
|
598
|
-
"hide-empty": !!e.hideEmpty,
|
|
599
|
-
"onUpdate:modelValue": n[0] ||= (e) => k(B).country = e
|
|
600
|
-
}, null, 8, [
|
|
601
|
-
"model-value",
|
|
602
|
-
"label",
|
|
603
|
-
"options",
|
|
604
|
-
"placeholder",
|
|
605
|
-
"any-label",
|
|
606
|
-
"hide-empty"
|
|
607
|
-
])) : e.key === "collection" ? (S(), d(r, {
|
|
608
|
-
key: 1,
|
|
609
|
-
"model-value": k(B).collection,
|
|
610
|
-
label: Q(e),
|
|
611
|
-
options: K.value,
|
|
612
|
-
placeholder: e.placeholder ? k(a)(e.placeholder) : "",
|
|
613
|
-
"any-label": e.anyLabel ? k(a)(e.anyLabel) : "",
|
|
614
|
-
"hide-empty": !!e.hideEmpty,
|
|
615
|
-
"onUpdate:modelValue": n[1] ||= (e) => k(B).collection = e
|
|
616
|
-
}, null, 8, [
|
|
617
|
-
"model-value",
|
|
618
|
-
"label",
|
|
619
|
-
"options",
|
|
620
|
-
"placeholder",
|
|
621
|
-
"any-label",
|
|
622
|
-
"hide-empty"
|
|
623
|
-
])) : (e.key === "begin" || e.key === "end") && fe.value[e.key] ? (S(), d(r, {
|
|
624
|
-
key: 2,
|
|
625
|
-
"model-value": k(B)[e.key],
|
|
626
|
-
label: Q(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate"),
|
|
627
|
-
options: fe.value[e.key],
|
|
628
|
-
placeholder: e.placeholder ? k(a)(e.placeholder) : k(a)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
629
|
-
"any-label": e.anyLabel ? k(a)(e.anyLabel) : "",
|
|
630
|
-
"hide-empty": !!e.hideEmpty,
|
|
631
|
-
"onUpdate:modelValue": (t) => k(B)[e.key] = t
|
|
632
|
-
}, null, 8, [
|
|
633
|
-
"model-value",
|
|
634
|
-
"label",
|
|
635
|
-
"options",
|
|
636
|
-
"placeholder",
|
|
637
|
-
"any-label",
|
|
638
|
-
"hide-empty",
|
|
639
|
-
"onUpdate:modelValue"
|
|
640
|
-
])) : (S(), p("label", Ce, [m("span", we, O(Q(e, e.key === "begin" ? "catalogue.facet.startDate" : "catalogue.facet.endDate")), 1), m("input", {
|
|
641
|
-
type: "number",
|
|
642
|
-
class: "mwnf-facet__select",
|
|
643
|
-
value: k(B)[e.key],
|
|
644
|
-
placeholder: e.placeholder ? k(a)(e.placeholder) : k(a)(e.key === "begin" ? "timeline.form.fromYearHint" : "timeline.form.toYearHint"),
|
|
645
|
-
onInput: (t) => k(B)[e.key] = t.target.value
|
|
646
|
-
}, null, 40, Te)]))], 64))), 128))]),
|
|
647
|
-
_: 1
|
|
648
|
-
}, 8, [
|
|
649
|
-
"title",
|
|
650
|
-
"apply-label",
|
|
651
|
-
"reset-label"
|
|
652
|
-
])),
|
|
653
|
-
D.value && R.value ? (S(), p("p", Ee, O(R.value), 1)) : f("", !0),
|
|
654
|
-
D.value ? f("", !0) : (S(), p(l, { key: 4 }, [
|
|
655
|
-
E(t.$slots, "summary", x(v(Y.value)), () => [_(s, { parts: X.value }, null, 8, ["parts"])]),
|
|
656
|
-
E(t.$slots, "gallery", x(v(Y.value)), () => [J.value && !t.$slots.gallery ? (S(), d(e, {
|
|
657
|
-
key: 0,
|
|
658
|
-
class: "mwnf-timeline__gallery",
|
|
659
|
-
to: J.value.to
|
|
660
|
-
}, {
|
|
661
|
-
default: A(() => [E(t.$slots, "cross-link", x(v(Y.value)), () => [g(O(J.value.label), 1), J.value.count == null ? f("", !0) : (S(), p(l, { key: 0 }, [g(" (" + O(J.value.count) + ")", 1)], 64))])]),
|
|
662
|
-
_: 3
|
|
663
|
-
}, 8, ["to"])) : f("", !0)]),
|
|
664
|
-
E(t.$slots, "event", x(v(Y.value)), () => [_(c, { events: de.value }, {
|
|
665
|
-
empty: A(() => [E(t.$slots, "empty", x(v(Y.value)), () => [g(O(ge.value), 1)])]),
|
|
666
|
-
_: 3
|
|
667
|
-
}, 8, ["events"])]),
|
|
668
|
-
E(t.$slots, "pagination", x(v(Y.value)), () => [_(o, {
|
|
669
|
-
"page-info": k(W),
|
|
670
|
-
window: Z.value.window,
|
|
671
|
-
jump: Z.value.jump,
|
|
672
|
-
ends: Z.value.ends,
|
|
673
|
-
onNavigate: k(z).goToPage
|
|
674
|
-
}, null, 8, [
|
|
675
|
-
"page-info",
|
|
676
|
-
"window",
|
|
677
|
-
"jump",
|
|
678
|
-
"ends",
|
|
679
|
-
"onNavigate"
|
|
680
|
-
])])
|
|
681
|
-
], 64)),
|
|
682
|
-
E(t.$slots, "after", x(v(Y.value)))
|
|
683
|
-
]));
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
export { be as n, q as r, De as t };
|