henry-search 1.0.4 → 1.0.6
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/HenrySearch.css +1 -1
- package/dist/HenrySearch.js +11312 -10969
- package/dist/HenrySearch.umd.cjs +83 -83
- package/package.json +1 -3
- package/src/components/Search.vue +276 -135
- package/src/components/SearchDetail.vue +27 -23
- package/src/components/SearchHistory.vue +65 -15
- package/src/components/SearchTab.vue +102 -64
- package/src/components/Autocomplete.vue +0 -141
- package/src/components/Calendar.vue +0 -2887
|
@@ -6,7 +6,7 @@ import { ref, onMounted, onUnmounted, computed } from 'vue'
|
|
|
6
6
|
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
performanceId: {
|
|
9
|
-
type:
|
|
9
|
+
type: String,
|
|
10
10
|
required: true
|
|
11
11
|
},
|
|
12
12
|
indexName: {
|
|
@@ -29,11 +29,12 @@ onMounted(() => {
|
|
|
29
29
|
'connectionTimeoutSeconds': 2
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
client.collections(
|
|
32
|
+
client.collections(props.indexName).documents(props.performanceId).retrieve().then(function (results) {
|
|
33
33
|
performance.value = results
|
|
34
34
|
console.log('searchResults', performance.value)
|
|
35
|
-
}).catch(() => {
|
|
36
|
-
|
|
35
|
+
}).catch((e) => {
|
|
36
|
+
console.log(e)
|
|
37
|
+
//document.location = '/404'
|
|
37
38
|
})
|
|
38
39
|
})
|
|
39
40
|
|
|
@@ -94,13 +95,13 @@ onMounted(() => {
|
|
|
94
95
|
<div class="performance__headerData">
|
|
95
96
|
<div><span class="performance__dataTitle">Season:</span><br/><a :href="createURL('season', performance.season)">{{ performance.season }}</a></div>
|
|
96
97
|
<div><span class="performance__dataTitle">Orchestra/Ensemble:</span><br/>
|
|
97
|
-
<span v-for="orch, index in performance.
|
|
98
|
-
<a :href="createURL('
|
|
98
|
+
<span v-for="orch, index in performance.ensembles">
|
|
99
|
+
<a :href="createURL('ensemble', orch)">{{ orch + (index < performance.ensembles.length - 1 ? "; " : "") }}</a>
|
|
99
100
|
</span>
|
|
100
101
|
</div>
|
|
101
102
|
<div><span class="performance__dataTitle">Conductor:</span><br/>
|
|
102
|
-
<span v-for="conductor, index in performance.
|
|
103
|
-
<a :href="createURL('
|
|
103
|
+
<span v-for="conductor, index in performance.conductors">
|
|
104
|
+
<a :href="createURL('conductors', conductor)">{{ conductor + (index < performance.conductors.length - 1 ? ", " : "") }}</a>
|
|
104
105
|
</span>
|
|
105
106
|
</div>
|
|
106
107
|
<div><span class="performance__dataTitle">Event Title:</span><br/>{{ performance.event_title && performance.event_title.length ? performance.event_title : '---' }}</div>
|
|
@@ -114,8 +115,7 @@ onMounted(() => {
|
|
|
114
115
|
</div>
|
|
115
116
|
<h4>Program</h4>
|
|
116
117
|
<div class="performance__grid">
|
|
117
|
-
<template v-for="work, index in performance.
|
|
118
|
-
<!--header-->
|
|
118
|
+
<template v-for="work, index in performance.works">
|
|
119
119
|
<template v-if="index == 0">
|
|
120
120
|
<div class="performance__cell -header -first">Composer</div>
|
|
121
121
|
<div class="performance__cell -header">Works</div>
|
|
@@ -124,37 +124,41 @@ onMounted(() => {
|
|
|
124
124
|
<div class="performance__cell -header">Role</div>
|
|
125
125
|
</template>
|
|
126
126
|
|
|
127
|
-
<div :class="`performance__cell -first ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.
|
|
128
|
-
|
|
127
|
+
<div :class="`performance__cell -first ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.works.length ? '-last' : ''}`">
|
|
128
|
+
<span v-for="composer, index in work.composers">
|
|
129
|
+
<a :href="createURL('works.composers', work.composer)">{{ work.composers + (index < work.composers.length - 1 ? ", " : "") }}</a>
|
|
130
|
+
</span>
|
|
131
|
+
</div>
|
|
132
|
+
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.works.length ? '-last' : ''}`">
|
|
129
133
|
<span class="infoItem">
|
|
130
|
-
<a :href="createURL('
|
|
134
|
+
<a :href="createURL('works.title', work.title)">{{ work.title }}</a><br/>
|
|
131
135
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" v-if="work.has_recording">
|
|
132
136
|
<path d="M9.81086 5L6.92983 7.30483H4.625V10.7621H6.92983L9.81086 13.0669V5Z" stroke="#01ABE6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
133
137
|
<path d="M12.4268 6.99365C12.9669 7.53393 13.2703 8.2666 13.2703 9.03054C13.2703 9.79449 12.9669 10.5272 12.4268 11.0674" stroke="#01ABE6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
134
138
|
</svg>
|
|
135
139
|
</span>
|
|
136
140
|
<span v-if="work.premiere" class="infoItem">Work Premiere:<br/>
|
|
137
|
-
<a :href="createURL('
|
|
141
|
+
<a :href="createURL('works.premiere', work.premier)">{{ work.premiere }}</a>
|
|
138
142
|
</span><br/>
|
|
139
143
|
<span v-if="work.commission" class="infoItem">Commission:<br/>
|
|
140
|
-
<a :href="createURL('
|
|
144
|
+
<a :href="createURL('works.commission', work.commission)">
|
|
141
145
|
{{ work.commission }}
|
|
142
146
|
</a>
|
|
143
147
|
</span><br/>
|
|
144
|
-
<span v-if="work.encore" class="infoItem"><a :href="createURL('
|
|
148
|
+
<span v-if="work.encore" class="infoItem"><a :href="createURL('works.encore', work.encore)">Encore</a></span>
|
|
145
149
|
</div>
|
|
146
|
-
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.
|
|
150
|
+
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.works.length ? '-last' : ''}`">
|
|
147
151
|
<span v-for="c in work.creator" class="infoItem">
|
|
148
|
-
<a :href="createURL('
|
|
152
|
+
<a :href="createURL('works.creator.creator_name', c.creator_name)">{{ c.creator_name }}, {{ c.creator_role }}</a>
|
|
149
153
|
</span>
|
|
150
154
|
</div>
|
|
151
|
-
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.
|
|
152
|
-
<span v-for="a in work.
|
|
155
|
+
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.works.length ? '-last' : ''}`">
|
|
156
|
+
<span v-for="a in work.artists" class="infoItem"><a :href="createURL('works.artists.name', a.name)">{{ a.name }}</a></span>
|
|
153
157
|
</div>
|
|
154
|
-
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.
|
|
155
|
-
<span v-for="a in work.
|
|
158
|
+
<div :class="`performance__cell ${index % 2 == 0 ? '-even' : '-odd'} ${ index + 1 == performance.works.length ? '-last' : ''}`">
|
|
159
|
+
<span v-for="a in work.artists" class="infoItem"><a :href="createURL('works.artists.role', a.role)">{{ a.role }}</a></span>
|
|
156
160
|
</div>
|
|
157
161
|
</template>
|
|
158
|
-
</div>
|
|
162
|
+
</div>
|
|
159
163
|
</div>
|
|
160
164
|
</template>
|
|
@@ -1,27 +1,61 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
performanceIndex: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: "archived_performances"
|
|
7
|
+
},
|
|
8
|
+
artistIndex: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "artists"
|
|
11
|
+
},
|
|
12
|
+
workIndex: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "works"
|
|
15
|
+
}
|
|
12
16
|
})
|
|
13
17
|
|
|
18
|
+
const searchHistory = JSON.parse(sessionStorage.getItem('searchHistory'))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
function filterHistory(indexName) {
|
|
22
|
+
if (searchHistory) {
|
|
23
|
+
return searchHistory.filter((item) => {
|
|
24
|
+
let returnItem = false
|
|
25
|
+
Object.entries(item.uiState).forEach(([k, v]) => {
|
|
26
|
+
if (k == indexName && !returnItem) {
|
|
27
|
+
returnItem = true
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
return returnItem
|
|
31
|
+
})
|
|
32
|
+
} else {
|
|
33
|
+
return null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
14
38
|
function formatItem(state) {
|
|
15
39
|
console.log(state)
|
|
16
40
|
let searchName = state.query ? '"' + state.query + '"' : ""
|
|
17
41
|
if (state.refinementList) {
|
|
18
42
|
Object.entries(state.refinementList).forEach(([k1, v1]) => {
|
|
19
|
-
|
|
43
|
+
console.log("v1", v1)
|
|
44
|
+
if (Array.isArray(v1)) {
|
|
45
|
+
searchName += " " + v1.join(", ")
|
|
46
|
+
} else {
|
|
47
|
+
searchName += " " + v1;
|
|
48
|
+
}
|
|
49
|
+
|
|
20
50
|
})
|
|
21
51
|
}
|
|
22
52
|
if (state.menu) {
|
|
23
53
|
Object.entries(state.menu).forEach(([k1, v1]) => {
|
|
24
|
-
|
|
54
|
+
if (Array.isArray(v1)) {
|
|
55
|
+
searchName += " " + v1.join(", ")
|
|
56
|
+
} else {
|
|
57
|
+
searchName += " " + v1;
|
|
58
|
+
}
|
|
25
59
|
})
|
|
26
60
|
}
|
|
27
61
|
|
|
@@ -32,9 +66,25 @@ function formatItem(state) {
|
|
|
32
66
|
|
|
33
67
|
<template>
|
|
34
68
|
<div class="performance__header"><h2>Search History</h2></div>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
<template v-if="searchHistory">
|
|
70
|
+
<div v-for="item, index in filterHistory(props.performanceIndex)">
|
|
71
|
+
<h6 v-if="index == 0">Performances</h6>
|
|
72
|
+
<a :href="item.link">{{ formatItem(item?.uiState[props.performanceIndex]) }}</a><br/>
|
|
73
|
+
{{ item.date }}
|
|
74
|
+
</div>
|
|
75
|
+
<div v-for="item, index in filterHistory(props.artistIndex)">
|
|
76
|
+
<h6 v-if="index == 0">Artists</h6>
|
|
77
|
+
<a :href="item.link">{{ formatItem(item?.uiState[props.artistIndex]) }}</a><br/>
|
|
78
|
+
{{ item.date }}
|
|
79
|
+
</div>
|
|
80
|
+
<div v-for="item, index in filterHistory(props.workIndex)">
|
|
81
|
+
<h6 v-if="index == 0">Works</h6>
|
|
82
|
+
<a :href="item.link">{{ formatItem(item?.uiState[props.workIndex]) }}</a><br/>
|
|
83
|
+
{{ item.date }}
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<div v-else>
|
|
87
|
+
No current search history
|
|
39
88
|
</div>
|
|
89
|
+
|
|
40
90
|
</template>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
queryByFields: {
|
|
39
39
|
type: String,
|
|
40
|
-
default: "
|
|
40
|
+
default: "works, season, venue, event_types, notes, event_title"
|
|
41
41
|
},
|
|
42
42
|
sortField: {
|
|
43
43
|
type: String,
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
let currentQuery = null
|
|
106
106
|
|
|
107
107
|
function toggleFilters() {
|
|
108
|
-
const wrapper = document.
|
|
109
|
-
const tabContent = document.
|
|
110
|
-
const leftPane = document.
|
|
111
|
-
const toggleOnButton = document.getElementById(`${props.
|
|
108
|
+
const wrapper = document.getElementById(`${props.indexName}_filterRail`)
|
|
109
|
+
const tabContent = document.getElementById(`${props.indexName}_tabs__content`)
|
|
110
|
+
const leftPane = document.getElementById(`${props.indexName}_eventsSearch__results`)
|
|
111
|
+
const toggleOnButton = document.getElementById(`${props.indexName}_filterToggleOn`)
|
|
112
112
|
if (toggleOnButton) {
|
|
113
113
|
toggleOnButton.classList.toggle('closed')
|
|
114
114
|
}
|
|
@@ -134,14 +134,56 @@
|
|
|
134
134
|
workFilters = uiState[props.indexName].refinementList && Object.keys(uiState[props.indexName].refinementList).length !== 0 ? getWorkFilters(uiState[props.indexName].refinementList) : []
|
|
135
135
|
showByWorks = Object.keys(workFilters).length !== 0
|
|
136
136
|
|
|
137
|
+
// update search history
|
|
138
|
+
let searchHistory = sessionStorage.getItem('searchHistory') ? JSON.parse(sessionStorage.getItem('searchHistory')) : []
|
|
139
|
+
// if only pagination, don't add to search history
|
|
140
|
+
if (uiState[props.indexName].page && !uiState[props.indexName].query && !uiState[props.indexName].refinementList && !uiState[props.indexName].menu) {
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
searchHistory = searchHistory.map((item) => {
|
|
144
|
+
// make sure that all queries aren't entered into the history as a user types each letter
|
|
145
|
+
if (uiState[props.indexName].query?.includes(item.query) && uiState[props.indexName].query != item.query) {
|
|
146
|
+
return {
|
|
147
|
+
date: new Date(),
|
|
148
|
+
uiState: uiState,
|
|
149
|
+
query: uiState[props.indexName].query,
|
|
150
|
+
link: document.location.href
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
return item
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
//make sure we're not just adding pagination
|
|
158
|
+
let addState = true
|
|
159
|
+
searchHistory.forEach((item) => {
|
|
160
|
+
if (item.link.replace(/\&page=\d*/, "") == document.location.href.replace(/\&page=\d*/, "")) {
|
|
161
|
+
addState = false
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
if (addState && !(searchHistory.map((a) => a.link)).includes(document.location.href) &&
|
|
168
|
+
document.location.search != '') {
|
|
169
|
+
searchHistory.push({
|
|
170
|
+
date: new Date(),
|
|
171
|
+
uiState: uiState,
|
|
172
|
+
query: uiState[props.indexName].query,
|
|
173
|
+
link: document.location.href
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
//console.log('searchHistory', searchHistory, typeof searchHistory)
|
|
178
|
+
sessionStorage.setItem('searchHistory', JSON.stringify(searchHistory))
|
|
137
179
|
}
|
|
138
180
|
}
|
|
139
181
|
|
|
140
182
|
function getWorkFilters(refinementList) {
|
|
141
183
|
let returnFilters = {}
|
|
142
184
|
Object.entries(refinementList).forEach(([k, v]) => {
|
|
143
|
-
if (k.includes('
|
|
144
|
-
let workAttribute = k.substring(k.indexOf('
|
|
185
|
+
if (k.includes('works')) {
|
|
186
|
+
let workAttribute = k.substring(k.indexOf('works.') + 6, k.length)
|
|
145
187
|
const subFilter = {}
|
|
146
188
|
if (workAttribute.includes('.')) {
|
|
147
189
|
const workSubAttribute = workAttribute.substring(workAttribute.indexOf('.') + 1, workAttribute.length)
|
|
@@ -162,35 +204,7 @@
|
|
|
162
204
|
function onStateChange({ uiState, setUiState }) {
|
|
163
205
|
updateStateRefs(uiState)
|
|
164
206
|
setUiState(uiState)
|
|
165
|
-
console.log('uiState', uiState)
|
|
166
|
-
let searchHistory = sessionStorage.getItem('searchHistory') ? JSON.parse(sessionStorage.getItem('searchHistory')) : []
|
|
167
|
-
searchHistory = searchHistory.map((item) => {
|
|
168
|
-
if (uiState[props.indexName].query.includes(item.query) && uiState[props.indexName].query != item.query) {
|
|
169
|
-
return {
|
|
170
|
-
date: new Date(),
|
|
171
|
-
uiState: uiState,
|
|
172
|
-
query: uiState[props.indexName].query,
|
|
173
|
-
link: document.location.href
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
return item
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
if (!(searchHistory.map((a) => a.link)).includes(document.location.href) &&
|
|
181
|
-
document.location.search != '') {
|
|
182
|
-
searchHistory.push({
|
|
183
|
-
date: new Date(),
|
|
184
|
-
uiState: uiState,
|
|
185
|
-
query: uiState[props.indexName].query,
|
|
186
|
-
link: document.location.href
|
|
187
|
-
})
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
console.log('searchHistory', searchHistory, typeof searchHistory)
|
|
191
|
-
sessionStorage.setItem('searchHistory', JSON.stringify(searchHistory))
|
|
192
|
-
|
|
193
|
-
|
|
207
|
+
//console.log('uiState', uiState)
|
|
194
208
|
}
|
|
195
209
|
|
|
196
210
|
function setView() {
|
|
@@ -215,15 +229,26 @@
|
|
|
215
229
|
|
|
216
230
|
function formatRefinement(refinement) {
|
|
217
231
|
const attributeMap = {
|
|
218
|
-
"
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
232
|
+
"works.composers" : "Composer",
|
|
233
|
+
"works.title" : "Work",
|
|
234
|
+
"conductors" : "Conductor",
|
|
235
|
+
"ensembles" : "Orchestra",
|
|
236
|
+
"works.artists.name" : "Artist",
|
|
223
237
|
"query" : "Keyword",
|
|
238
|
+
'works.artists.role': 'Instrument/Role',
|
|
239
|
+
'season': 'Season',
|
|
240
|
+
'event_title': 'Event Title',
|
|
241
|
+
'event_types': 'Series',
|
|
242
|
+
'venue': 'Venue',
|
|
243
|
+
'works.commission': 'Commission',
|
|
224
244
|
'location.city': 'City',
|
|
225
245
|
'location.country': 'Country',
|
|
226
|
-
'location.state': 'State'
|
|
246
|
+
'location.state': 'State',
|
|
247
|
+
'artist_name': 'Artist',
|
|
248
|
+
'artist_role': 'Instrument/Role',
|
|
249
|
+
'title': 'Work Title',
|
|
250
|
+
'composers': 'Composer',
|
|
251
|
+
'composer': 'Composer'
|
|
227
252
|
}
|
|
228
253
|
if (refinement.attribute == 'performance_date' || refinement.attribute == 'last_performance_date') {
|
|
229
254
|
return 'Date: ' + refinement.label[0] + ' ' + formatDate(refinement.value) + ' ×'
|
|
@@ -264,12 +289,12 @@
|
|
|
264
289
|
}
|
|
265
290
|
|
|
266
291
|
function filterItems(items) {
|
|
267
|
-
if (showByWorks) {
|
|
292
|
+
if (showByWorks && props.indexName == "dev_henry_perfs") {
|
|
268
293
|
let returnItems = items
|
|
269
294
|
let itemIndex = 0
|
|
270
295
|
returnItems.forEach((item) => {
|
|
271
296
|
let shownWorks = []
|
|
272
|
-
item?.
|
|
297
|
+
item?.works.forEach((work) => {
|
|
273
298
|
let workAdded = false
|
|
274
299
|
if (intersect(workFilters, work)?.length) {
|
|
275
300
|
shownWorks.push(work)
|
|
@@ -279,12 +304,14 @@
|
|
|
279
304
|
shownWorks.push(work)
|
|
280
305
|
}
|
|
281
306
|
})
|
|
282
|
-
returnItems[itemIndex].
|
|
307
|
+
returnItems[itemIndex].works = shownWorks
|
|
283
308
|
itemIndex++
|
|
284
309
|
})
|
|
285
310
|
return returnItems
|
|
311
|
+
} else {
|
|
312
|
+
return items
|
|
286
313
|
}
|
|
287
|
-
|
|
314
|
+
|
|
288
315
|
|
|
289
316
|
}
|
|
290
317
|
|
|
@@ -331,7 +358,7 @@
|
|
|
331
358
|
|
|
332
359
|
>
|
|
333
360
|
<!-- :key="sortView" -->
|
|
334
|
-
<div class="tabs__content open">
|
|
361
|
+
<div class="tabs__content open" :id="`${props.indexName}_tabs__content`">
|
|
335
362
|
<!-- Header and Search Section -->
|
|
336
363
|
<div class="eventsSearch__topSection">
|
|
337
364
|
<!-- Search Filters Section -->
|
|
@@ -405,7 +432,7 @@
|
|
|
405
432
|
</div>
|
|
406
433
|
|
|
407
434
|
<!-- View Toggle and Active Filters -->
|
|
408
|
-
<section class="eventsSearch__filterRail">
|
|
435
|
+
<section class="eventsSearch__filterRail" :id="`${props.indexName}_filterRail`">
|
|
409
436
|
|
|
410
437
|
<div class="eventsSearch__filterWrapper">
|
|
411
438
|
<div class="eventsSearch__filterHeader">
|
|
@@ -425,7 +452,7 @@
|
|
|
425
452
|
</div>
|
|
426
453
|
<ais-refinement-list v-for="refinement in mainRefinements" :attribute="refinement.attribute" operator="and">
|
|
427
454
|
<template v-slot="{items, refine, searchForItems}">
|
|
428
|
-
<p-accordion :name="refinement.title" class="accordion"
|
|
455
|
+
<p-accordion :name="refinement.title" class="accordion" :start-open="true">
|
|
429
456
|
<summary class="accordion__summary">
|
|
430
457
|
<h6 class="accordion__heading">{{ refinement.title }}</h6>
|
|
431
458
|
<div class="accordion__iconWrapper">
|
|
@@ -443,23 +470,23 @@
|
|
|
443
470
|
<div class="eventSearch__checkBox">
|
|
444
471
|
<input :class="`checkbox ${item.isRefined ? '-boxChecked' : ''}`" type="checkbox" :id="slugify(refinement.title + ' ' + item.value)" :value="item.value" :checked="item.isRefined" @click="refine(item.value)">
|
|
445
472
|
</div>
|
|
446
|
-
<span>{{ item.value }}</span><span>{{ item.count }}</span>
|
|
473
|
+
<span>{{ item.value }}</span><span class="eventsSearch__refinementCount">{{ item.count }}</span>
|
|
447
474
|
</label>
|
|
448
475
|
</div>
|
|
449
476
|
</div>
|
|
450
477
|
</p-accordion>
|
|
451
|
-
<template v-else><div></div></template>
|
|
478
|
+
<!-- <template v-else><div></div></template> -->
|
|
452
479
|
</template>
|
|
453
480
|
</ais-refinement-list>
|
|
454
|
-
<p-accordion v-if="addlRefinements" :start-open="false" open-text="Fewer Filters" closed-text="More Filters">
|
|
481
|
+
<p-accordion v-if="props.addlRefinements" :start-open="false" open-text="Fewer Filters" closed-text="More Filters">
|
|
455
482
|
<summary class="accordion__summary">
|
|
456
483
|
<h6 class="accordion__heading -thin">More Filters</h6>
|
|
457
484
|
</summary>
|
|
458
485
|
<div class="accordion__content">
|
|
459
|
-
<template v-for="refinement in addlRefinements">
|
|
486
|
+
<template v-for="refinement in props.addlRefinements">
|
|
460
487
|
<ais-refinement-list v-if="refinement.type == 'list'" :attribute="refinement.attribute" operator="and">
|
|
461
488
|
<template v-slot="{items, refine, searchForItems}">
|
|
462
|
-
<p-accordion :name="refinement.title" class="accordion"
|
|
489
|
+
<p-accordion :name="refinement.title" class="accordion" :start-open="false">
|
|
463
490
|
<summary class="accordion__summary">
|
|
464
491
|
<h6 class="accordion__heading">{{ refinement.title }}</h6>
|
|
465
492
|
<div class="accordion__iconWrapper">
|
|
@@ -482,7 +509,7 @@
|
|
|
482
509
|
</div>
|
|
483
510
|
</div>
|
|
484
511
|
</p-accordion>
|
|
485
|
-
<template v-else><div></div></template>
|
|
512
|
+
<!-- <template v-else><div></div></template> -->
|
|
486
513
|
</template>
|
|
487
514
|
</ais-refinement-list>
|
|
488
515
|
<h6 class="accordion__heading" v-if="refinement.type == 'location'">Location</h6>
|
|
@@ -550,13 +577,13 @@
|
|
|
550
577
|
</section>
|
|
551
578
|
|
|
552
579
|
<!-- Search Results Section -->
|
|
553
|
-
<section class="eventsSearch__results">
|
|
580
|
+
<section class="eventsSearch__results" :id="`${props.indexName}_eventsSearch__results`">
|
|
554
581
|
|
|
555
582
|
<ais-hits :key="updateNow" class="eventsSearch__hits" :transform-items="filterItems">
|
|
556
583
|
<template v-slot="{ items }">
|
|
557
584
|
<div class="eventsSearch__resultsHeader">
|
|
558
585
|
<div class="eventsSearch__resultsTitle">
|
|
559
|
-
<svg width="24" height="24" viewBox="0 0 24 24" :id="`${props.
|
|
586
|
+
<svg width="24" height="24" viewBox="0 0 24 24" :id="`${props.indexName}_filterToggleOn`" class="eventsSearch__filterToggleOn" @click="toggleFilters()">
|
|
560
587
|
<rect width="24" height="24" rx="4" fill="#01ABE6"/>
|
|
561
588
|
<path d="M6 7.25H18.8864" stroke="white" stroke-linecap="round"/>
|
|
562
589
|
<path d="M6 12.5681H18.8864" stroke="white" stroke-linecap="round"/>
|
|
@@ -565,7 +592,13 @@
|
|
|
565
592
|
<circle cx="14.8633" cy="12.5" r="1.54545" fill="#01ABE6" stroke="white"/>
|
|
566
593
|
<circle cx="10.7725" cy="7.04545" r="1.54545" fill="#01ABE6" stroke="white"/>
|
|
567
594
|
</svg>
|
|
568
|
-
<h3 v-if="showNumHits">
|
|
595
|
+
<h3 v-if="showNumHits">
|
|
596
|
+
<ais-stats>
|
|
597
|
+
<template v-slot="{ nbHits }">
|
|
598
|
+
{{ nbHits }} {{ nbHits > 1 ? 'Results' : 'Result' }}
|
|
599
|
+
</template>
|
|
600
|
+
</ais-stats>
|
|
601
|
+
</h3>
|
|
569
602
|
<h3 v-else>{{ props.resultsTitle }}</h3>
|
|
570
603
|
|
|
571
604
|
</div>
|
|
@@ -651,10 +684,10 @@
|
|
|
651
684
|
<nav class="eventsSearch__pagination">
|
|
652
685
|
<ais-stats>
|
|
653
686
|
<template v-slot="{ hitsPerPage, nbHits, page }">
|
|
654
|
-
{{ page * hitsPerPage + 1 }} - {{ (((page + 1) * hitsPerPage)
|
|
687
|
+
{{ page * hitsPerPage + 1 }} - {{ (((page + 1) * hitsPerPage)) < nbHits ? (((page + 1) * hitsPerPage)) : nbHits }} of {{ nbHits }} Results
|
|
655
688
|
</template>
|
|
656
689
|
</ais-stats>
|
|
657
|
-
<ais-pagination
|
|
690
|
+
<ais-pagination>
|
|
658
691
|
<template
|
|
659
692
|
v-slot="{
|
|
660
693
|
currentRefinement,
|
|
@@ -666,8 +699,8 @@
|
|
|
666
699
|
createURL
|
|
667
700
|
}"
|
|
668
701
|
>
|
|
669
|
-
<ul v-if="pages.length > 1">
|
|
670
|
-
<li>
|
|
702
|
+
<ul class="eventsSearch__paginationComponent" v-if="pages.length > 1">
|
|
703
|
+
<li v-if="currentRefinement + 1 > 1">
|
|
671
704
|
<a
|
|
672
705
|
:href="createURL(currentRefinement - 1)"
|
|
673
706
|
@click.prevent="refine(currentRefinement - 1)"
|
|
@@ -685,11 +718,16 @@
|
|
|
685
718
|
</a>
|
|
686
719
|
</li>
|
|
687
720
|
<li v-if="pages.length > 5">...</li>
|
|
688
|
-
<li v-if="pages.length > 5">
|
|
689
|
-
|
|
721
|
+
<li v-if="pages.length > 5">
|
|
722
|
+
<a :href="createURL(nbPages)">
|
|
723
|
+
{{ nbPages }}
|
|
724
|
+
</a>
|
|
725
|
+
</li>
|
|
726
|
+
<li v-if="currentRefinement + 1 < nbPages">
|
|
690
727
|
<a
|
|
691
728
|
:href="createURL(currentRefinement + 1)"
|
|
692
729
|
@click.prevent="refine(currentRefinement + 1)"
|
|
730
|
+
:style="{ fontWeight: nbPages === currentRefinement + 1 ? 'bold' : '' }"
|
|
693
731
|
>
|
|
694
732
|
›
|
|
695
733
|
</a>
|