comand-component-library 4.3.28 → 5.0.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/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.js +9587 -9482
- package/dist/styles/demopage-only.css +12 -2
- package/package.json +47 -46
- package/src/ComponentLibrary.vue +2697 -2688
- package/src/assets/data/component-structure.json +1 -1
- package/src/assets/data/form-elements.json +224 -224
- package/src/assets/data/social-networks-page-by-json.json +43 -43
- package/src/assets/styles/component-library-global-styles.scss +296 -295
- package/src/componentSettingsDataAndControls.vue +1 -18
- package/src/components/CmdAccordion.vue +1 -1
- package/src/components/CmdAddressData.vue +6 -1
- package/src/components/CmdAddressDataItem.vue +6 -1
- package/src/components/CmdBasicForm.vue +2 -2
- package/src/components/CmdBox.vue +1103 -1092
- package/src/components/CmdBoxWrapper.vue +7 -1
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdCodeOutput.vue +1 -1
- package/src/components/CmdCookieDisclaimer.vue +480 -480
- package/src/components/CmdFakeSelect.vue +930 -916
- package/src/components/CmdFlexibleScrollContainer.vue +42 -42
- package/src/components/CmdForm.vue +481 -481
- package/src/components/CmdFormElement.vue +1110 -1091
- package/src/components/CmdFormFilters.vue +146 -146
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdHeadline.vue +21 -4
- package/src/components/CmdIcon.vue +8 -2
- package/src/components/CmdImage.vue +14 -16
- package/src/components/CmdImageZoom.vue +9 -8
- package/src/components/CmdInputGroup.vue +436 -435
- package/src/components/CmdLink.vue +1 -1
- package/src/components/CmdList.vue +1 -1
- package/src/components/CmdListOfRequirements.vue +192 -192
- package/src/components/CmdLoginForm.vue +618 -618
- package/src/components/CmdMailToolFilter.vue +217 -217
- package/src/components/CmdMainNavigation.vue +581 -572
- package/src/components/CmdMultistepFormProgressBar.vue +9 -9
- package/src/components/CmdNewsletterSubscription.vue +199 -199
- package/src/components/CmdPagination.vue +4 -2
- package/src/components/CmdParagraph.vue +10 -4
- package/src/components/CmdProgressBar.vue +72 -72
- package/src/components/CmdSiteHeader.vue +382 -389
- package/src/components/CmdSiteSearch.vue +420 -420
- package/src/components/CmdSiteWrapper.vue +12 -5
- package/src/components/CmdSlideshow.vue +519 -519
- package/src/components/CmdSmartSearch.vue +291 -291
- package/src/components/CmdSystemMessage.vue +3 -2
- package/src/components/CmdTable.vue +401 -401
- package/src/components/CmdTabs.vue +262 -262
- package/src/components/CmdTag.vue +1 -1
- package/src/components/CmdTextImageBlock.vue +8 -2
- package/src/components/CmdThumbnailScroller.vue +0 -7
- package/src/components/CmdToggleDarkMode.vue +13 -11
- package/src/components/CmdTooltip.vue +305 -301
- package/src/components/CmdUploadForm.vue +1299 -1305
- package/src/components/CmdWidthLimitationWrapper.vue +1 -1
- package/src/components/EditComponentWrapper.vue +5 -5
- package/src/index.js +5 -0
- package/src/main.js +4 -3
- package/src/utils/template.js +57 -0
- package/src/assets/styles/template.css +0 -1
|
@@ -1,421 +1,421 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- begin CmdBoxSiteSearch ---------------------------------------------------------------------------------------- -->
|
|
3
|
-
<fieldset class="cmd-box-site-search flex-container">
|
|
4
|
-
<!-- begin legend -->
|
|
5
|
-
<legend :class="{hidden : !legend.show, 'align-left': legend.align === 'left'}">{{ legend.text }}</legend>
|
|
6
|
-
<!-- end legend -->
|
|
7
|
-
|
|
8
|
-
<!-- begin CmdHeadline -->
|
|
9
|
-
<CmdHeadline
|
|
10
|
-
v-if="cmdHeadline"
|
|
11
|
-
v-bind="cmdHeadline"
|
|
12
|
-
/>
|
|
13
|
-
<!-- end CmdHeadline -->
|
|
14
|
-
|
|
15
|
-
<!-- begin form-elements -->
|
|
16
|
-
<div class="flex-container align-bottom">
|
|
17
|
-
<!-- begin CmdFormElement for first input -->
|
|
18
|
-
<CmdFormElement
|
|
19
|
-
element="input"
|
|
20
|
-
:type="cmdFormElementInput1.type"
|
|
21
|
-
:show-label="cmdFormElementInput1.showLabel"
|
|
22
|
-
:labelText="cmdFormElementInput1.labelText"
|
|
23
|
-
:placeholder="cmdFormElementInput1.placeholder"
|
|
24
|
-
:required="cmdFormElementInput1.required"
|
|
25
|
-
:showSearchButton="cmdFormElementInput1.showSearchButton"
|
|
26
|
-
v-model="searchValue1"
|
|
27
|
-
/>
|
|
28
|
-
<!-- end CmdFormElement for first input -->
|
|
29
|
-
|
|
30
|
-
<div class="input-wrapper align-bottom">
|
|
31
|
-
<!-- begin CmdFormElement for second input -->
|
|
32
|
-
<CmdFormElement
|
|
33
|
-
v-if="cmdFormElementInput2.show"
|
|
34
|
-
element="input"
|
|
35
|
-
:type="cmdFormElementInput2.type"
|
|
36
|
-
:show-label="cmdFormElementInput2.showLabel"
|
|
37
|
-
:labelText="cmdFormElementInput2.labelText"
|
|
38
|
-
:placeholder="cmdFormElementInput2.placeholder"
|
|
39
|
-
:required="cmdFormElementInput2.required"
|
|
40
|
-
v-model="searchValue2"
|
|
41
|
-
/>
|
|
42
|
-
<!-- end CmdFormElement for second input -->
|
|
43
|
-
|
|
44
|
-
<!-- begin CmdFormElement for radius -->
|
|
45
|
-
<CmdFormElement
|
|
46
|
-
v-if="cmdFormElementRadiusOptions.show"
|
|
47
|
-
element="select"
|
|
48
|
-
class="flex-none"
|
|
49
|
-
v-model="radius"
|
|
50
|
-
v-bind="cmdFormElementRadiusOptions"
|
|
51
|
-
/>
|
|
52
|
-
<!-- end CmdFormElement for radius -->
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<!-- begin CmdFormElement for search-button -->
|
|
56
|
-
<CmdFormElement
|
|
57
|
-
element="button"
|
|
58
|
-
class="stretch-on-small-devices"
|
|
59
|
-
:nativeButton="cmdFormElementSearchButton"
|
|
60
|
-
@click="onSearchButtonClick"
|
|
61
|
-
:disabled="buttonSearchDisabled"
|
|
62
|
-
aria-live="assertive"
|
|
63
|
-
/>
|
|
64
|
-
<!-- end CmdFormElement for search-button -->
|
|
65
|
-
|
|
66
|
-
</div>
|
|
67
|
-
<!-- end form-elements -->
|
|
68
|
-
|
|
69
|
-
<!-- begin filters -->
|
|
70
|
-
<template v-if="useFilters">
|
|
71
|
-
<a class="filter-options" href="#" @click.prevent="showFilters = !showFilters">
|
|
72
|
-
<!-- begin CmdIcon -->
|
|
73
|
-
<CmdIcon
|
|
74
|
-
:iconClass="showFilters ? cmdIcon?.showFilters?.iconClass : cmdIcon?.hideFilters?.iconClass"
|
|
75
|
-
:type="showFilters ? cmdIcon?.showFilters?.iconType : cmdIcon?.hideFilters?.iconType"
|
|
76
|
-
/>
|
|
77
|
-
<!-- end CmdIcon -->
|
|
78
|
-
<span v-if="showFilters">{{ getMessage("site_search.hide_filter_options") }}</span>
|
|
79
|
-
<span v-else>{{ getMessage("site_search.show_filter_options") }}</span>
|
|
80
|
-
</a>
|
|
81
|
-
<transition :name="transitionFilters">
|
|
82
|
-
<div v-if="showFilters && cmdFakeSelect?.selectData.length" class="flex-container flex-none" role="listbox" aria-expanded="true">
|
|
83
|
-
<!-- begin CmdFakeSelect -->
|
|
84
|
-
<CmdFakeSelect
|
|
85
|
-
role="option"
|
|
86
|
-
:selectData="cmdFakeSelect?.selectData"
|
|
87
|
-
v-model="searchFilters"
|
|
88
|
-
:defaultOptionName="cmdFakeSelect?.defaultOptionName"
|
|
89
|
-
:type="cmdFakeSelect?.type"
|
|
90
|
-
:labelText="cmdFakeSelect?.labelText"
|
|
91
|
-
/>
|
|
92
|
-
<!-- end CmdFakeSelect -->
|
|
93
|
-
</div>
|
|
94
|
-
</transition>
|
|
95
|
-
</template>
|
|
96
|
-
<!-- end filters -->
|
|
97
|
-
</fieldset>
|
|
98
|
-
|
|
99
|
-
<!-- begin CmdFormFilters -->
|
|
100
|
-
<CmdFormFilters v-if="useFilters" v-model="searchFilters" :selectedOptionsName="getOptionName"/>
|
|
101
|
-
<!-- end CmdFormFilters -->
|
|
102
|
-
<!-- end CmdBoxSiteSearch ---------------------------------------------------------------------------------------- -->
|
|
103
|
-
</template>
|
|
104
|
-
|
|
105
|
-
<script>
|
|
106
|
-
// import mixins
|
|
107
|
-
import I18n from "../mixins/I18n"
|
|
108
|
-
import DefaultMessageProperties from "../mixins/CmdSiteSearch/DefaultMessageProperties"
|
|
109
|
-
|
|
110
|
-
export default {
|
|
111
|
-
emits: [
|
|
112
|
-
"search",
|
|
113
|
-
"update:modelValueInput1",
|
|
114
|
-
"update:modelValueInput2",
|
|
115
|
-
"update:modelValueRadius",
|
|
116
|
-
"update:modelValueSearchFilters"
|
|
117
|
-
],
|
|
118
|
-
name: "CmdBoxSiteSearch",
|
|
119
|
-
mixins: [I18n, DefaultMessageProperties],
|
|
120
|
-
data() {
|
|
121
|
-
return {
|
|
122
|
-
showFilters: false
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
props: {
|
|
126
|
-
/**
|
|
127
|
-
* define the transition when filters disappear
|
|
128
|
-
*
|
|
129
|
-
* @allowedValues: "none", "fade", "scroll"
|
|
130
|
-
*/
|
|
131
|
-
transitionFilters: {
|
|
132
|
-
type: String,
|
|
133
|
-
default: "fade"
|
|
134
|
-
},
|
|
135
|
-
/**
|
|
136
|
-
* custom modelValue for first input-field
|
|
137
|
-
*/
|
|
138
|
-
modelValueInput1: {
|
|
139
|
-
type: String,
|
|
140
|
-
required: false
|
|
141
|
-
},
|
|
142
|
-
/**
|
|
143
|
-
* custom modelValue for second input-field
|
|
144
|
-
*/
|
|
145
|
-
modelValueInput2: {
|
|
146
|
-
type: String,
|
|
147
|
-
required: false
|
|
148
|
-
},
|
|
149
|
-
/**
|
|
150
|
-
* custom modelValue for radius
|
|
151
|
-
*/
|
|
152
|
-
modelValueRadius: {
|
|
153
|
-
type: [String, Number],
|
|
154
|
-
required: false
|
|
155
|
-
},
|
|
156
|
-
/**
|
|
157
|
-
* custom modelValue for search-filters
|
|
158
|
-
*/
|
|
159
|
-
modelValueSearchFilters: {
|
|
160
|
-
type: Array,
|
|
161
|
-
required: false
|
|
162
|
-
},
|
|
163
|
-
/**
|
|
164
|
-
* toggle use of filters (must be configured)
|
|
165
|
-
*/
|
|
166
|
-
useFilters: {
|
|
167
|
-
type: Boolean,
|
|
168
|
-
default: true
|
|
169
|
-
},
|
|
170
|
-
/**
|
|
171
|
-
* legend for form
|
|
172
|
-
*
|
|
173
|
-
* useFieldset-property must be activated
|
|
174
|
-
*
|
|
175
|
-
* @requiredForAccessiblity: true
|
|
176
|
-
*/
|
|
177
|
-
legend: {
|
|
178
|
-
type: Object,
|
|
179
|
-
default() {
|
|
180
|
-
return {
|
|
181
|
-
show: true,
|
|
182
|
-
align: "left",
|
|
183
|
-
text: "Legend"
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
* send search result from outside to display inside this component
|
|
189
|
-
*/
|
|
190
|
-
results: {
|
|
191
|
-
type: [Function, Number],
|
|
192
|
-
required: false
|
|
193
|
-
},
|
|
194
|
-
/**
|
|
195
|
-
* properties for CmdHeadline-component
|
|
196
|
-
*/
|
|
197
|
-
cmdHeadline: {
|
|
198
|
-
type: Object,
|
|
199
|
-
required: false
|
|
200
|
-
},
|
|
201
|
-
/**
|
|
202
|
-
* properties for CmdFormElement-component first search-field
|
|
203
|
-
*/
|
|
204
|
-
cmdFormElementInput1: {
|
|
205
|
-
type: Object,
|
|
206
|
-
default() {
|
|
207
|
-
return {
|
|
208
|
-
type: "search",
|
|
209
|
-
showLabel: false,
|
|
210
|
-
required: true,
|
|
211
|
-
labelText: "What do you like to search for?",
|
|
212
|
-
placeholder: "What do you like to search for?",
|
|
213
|
-
showSearchButton: false
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* properties for CmdFormElement-component for second search-field
|
|
219
|
-
*/
|
|
220
|
-
cmdFormElementInput2: {
|
|
221
|
-
type: Object,
|
|
222
|
-
default() {
|
|
223
|
-
return {
|
|
224
|
-
show: true,
|
|
225
|
-
type: "text",
|
|
226
|
-
showLabel: false,
|
|
227
|
-
required: true,
|
|
228
|
-
labelText: "Where do you like to search?",
|
|
229
|
-
placeholder: "Enter city, zip, country"
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
/**
|
|
234
|
-
* properties for CmdFormElement-component for radius
|
|
235
|
-
*/
|
|
236
|
-
cmdFormElementRadius: {
|
|
237
|
-
type: Object,
|
|
238
|
-
required: false
|
|
239
|
-
},
|
|
240
|
-
/**
|
|
241
|
-
* properties for CmdFormElement-component for search-button
|
|
242
|
-
*/
|
|
243
|
-
cmdFormElementSearchButton: {
|
|
244
|
-
type: Object,
|
|
245
|
-
default() {
|
|
246
|
-
return {
|
|
247
|
-
icon: {
|
|
248
|
-
show: true,
|
|
249
|
-
position: "before",
|
|
250
|
-
iconClass: "icon-search"
|
|
251
|
-
},
|
|
252
|
-
text: "Search",
|
|
253
|
-
primary: true
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
/**
|
|
258
|
-
* properties for CmdFakeSelect-component for filters
|
|
259
|
-
*/
|
|
260
|
-
cmdFakeSelect: {
|
|
261
|
-
type: Object,
|
|
262
|
-
required: false
|
|
263
|
-
},
|
|
264
|
-
/**
|
|
265
|
-
* properties for CmdIcon-component for filters
|
|
266
|
-
*/
|
|
267
|
-
cmdIcon: {
|
|
268
|
-
type: Object,
|
|
269
|
-
default() {
|
|
270
|
-
return {
|
|
271
|
-
showFilters: {
|
|
272
|
-
iconClass: "icon-chevron-one-stripe-up",
|
|
273
|
-
type: "auto"
|
|
274
|
-
},
|
|
275
|
-
hideFilters: {
|
|
276
|
-
iconClass: "icon-chevron-one-stripe-down",
|
|
277
|
-
type: "auto"
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
computed: {
|
|
284
|
-
cmdFormElementRadiusOptions() {
|
|
285
|
-
return {
|
|
286
|
-
show: true,
|
|
287
|
-
showLabel: false,
|
|
288
|
-
required: false,
|
|
289
|
-
labelText: "Radius",
|
|
290
|
-
selectOptions: [
|
|
291
|
-
{
|
|
292
|
-
text: "None",
|
|
293
|
-
value: 0
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
text: "5 Km",
|
|
297
|
-
value: 5
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
text: "10 Km",
|
|
301
|
-
value: 10
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
text: "15 Km",
|
|
305
|
-
value: 15
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
text: "50 Km",
|
|
309
|
-
value: 50
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
text: "100 Km",
|
|
313
|
-
value: 100
|
|
314
|
-
}
|
|
315
|
-
],
|
|
316
|
-
...this.cmdFormElementRadius
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
searchValue1: {
|
|
320
|
-
get() {
|
|
321
|
-
return this.modelValueInput1
|
|
322
|
-
},
|
|
323
|
-
set(value) {
|
|
324
|
-
this.$emit("update:modelValueInput1", value)
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
searchValue2: {
|
|
328
|
-
get() {
|
|
329
|
-
return this.modelValueInput2
|
|
330
|
-
},
|
|
331
|
-
set(value) {
|
|
332
|
-
this.$emit("update:modelValueInput2", value)
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
radius: {
|
|
336
|
-
get() {
|
|
337
|
-
return this.modelValueRadius
|
|
338
|
-
},
|
|
339
|
-
set(value) {
|
|
340
|
-
this.$emit("update:modelValueRadius", value)
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
searchFilters: {
|
|
344
|
-
get() {
|
|
345
|
-
return this.modelValueSearchFilters
|
|
346
|
-
},
|
|
347
|
-
set(value) {
|
|
348
|
-
this.$emit("update:modelValueSearchFilters", value)
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
buttonSearchDisabled() {
|
|
352
|
-
const validInput1 = !this.cmdFormElementInput1.required || this.searchValue1.trim()
|
|
353
|
-
const validInput2 = !this.cmdFormElementInput2.show || !this.cmdFormElementInput2.required || this.searchValue2.trim()
|
|
354
|
-
const validInputRadius = !this.cmdFormElementRadiusOptions.show || !this.cmdFormElementRadiusOptions.required || this.radius
|
|
355
|
-
|
|
356
|
-
return !(validInput1 && validInput2 && validInputRadius)
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
methods: {
|
|
360
|
-
onSearchButtonClick() {
|
|
361
|
-
this.$emit("search", {
|
|
362
|
-
searchValue1: this.searchValue1,
|
|
363
|
-
searchValue2: this.searchValue2,
|
|
364
|
-
searchFilters: this.searchFilters,
|
|
365
|
-
radius: this.radius
|
|
366
|
-
})
|
|
367
|
-
},
|
|
368
|
-
getOptionName(option) {
|
|
369
|
-
for (let i = 0; i < this.cmdFakeSelect.selectData.length; i++) {
|
|
370
|
-
if (option === this.cmdFakeSelect.selectData[i].value) {
|
|
371
|
-
return this.cmdFakeSelect.selectData[i].text
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
return null
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
watch: {
|
|
378
|
-
cmdFormElementRadius: {
|
|
379
|
-
handler() {
|
|
380
|
-
if (this.cmdFormElementRadiusOptions?.selectOptions && this.cmdFormElementRadiusOptions?.selectOptions.length && this.modelValueRadius == null) {
|
|
381
|
-
this.radius = this.cmdFormElementRadiusOptions.selectOptions[0].value
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
immediate: true,
|
|
385
|
-
deep: true
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
</script>
|
|
390
|
-
|
|
391
|
-
<style lang="scss">
|
|
392
|
-
/* begin cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
|
393
|
-
@import '../assets/styles/variables';
|
|
394
|
-
.cmd-box-site-search {
|
|
395
|
-
flex-wrap: nowrap;
|
|
396
|
-
|
|
397
|
-
> a.filter-options {
|
|
398
|
-
display: table;
|
|
399
|
-
align-self: flex-start;
|
|
400
|
-
|
|
401
|
-
[class*='icon'] {
|
|
402
|
-
font-size: var(--icon-size-small);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
button {
|
|
407
|
-
align-self: flex-end;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
@media only screen and (max-width: $small-max-width) {
|
|
412
|
-
.cmd-box-site-search {
|
|
413
|
-
flex-wrap: nowrap;
|
|
414
|
-
|
|
415
|
-
> a.filter-options {
|
|
416
|
-
align-self: center;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
/* end cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
|
1
|
+
<template>
|
|
2
|
+
<!-- begin CmdBoxSiteSearch ---------------------------------------------------------------------------------------- -->
|
|
3
|
+
<fieldset class="cmd-box-site-search flex-container">
|
|
4
|
+
<!-- begin legend -->
|
|
5
|
+
<legend :class="{'visually-hidden' : !legend.show, 'align-left': legend.align === 'left'}">{{ legend.text }}</legend>
|
|
6
|
+
<!-- end legend -->
|
|
7
|
+
|
|
8
|
+
<!-- begin CmdHeadline -->
|
|
9
|
+
<CmdHeadline
|
|
10
|
+
v-if="cmdHeadline"
|
|
11
|
+
v-bind="cmdHeadline"
|
|
12
|
+
/>
|
|
13
|
+
<!-- end CmdHeadline -->
|
|
14
|
+
|
|
15
|
+
<!-- begin form-elements -->
|
|
16
|
+
<div class="flex-container align-bottom">
|
|
17
|
+
<!-- begin CmdFormElement for first input -->
|
|
18
|
+
<CmdFormElement
|
|
19
|
+
element="input"
|
|
20
|
+
:type="cmdFormElementInput1.type"
|
|
21
|
+
:show-label="cmdFormElementInput1.showLabel"
|
|
22
|
+
:labelText="cmdFormElementInput1.labelText"
|
|
23
|
+
:placeholder="cmdFormElementInput1.placeholder"
|
|
24
|
+
:required="cmdFormElementInput1.required"
|
|
25
|
+
:showSearchButton="cmdFormElementInput1.showSearchButton"
|
|
26
|
+
v-model="searchValue1"
|
|
27
|
+
/>
|
|
28
|
+
<!-- end CmdFormElement for first input -->
|
|
29
|
+
|
|
30
|
+
<div class="input-wrapper align-bottom">
|
|
31
|
+
<!-- begin CmdFormElement for second input -->
|
|
32
|
+
<CmdFormElement
|
|
33
|
+
v-if="cmdFormElementInput2.show"
|
|
34
|
+
element="input"
|
|
35
|
+
:type="cmdFormElementInput2.type"
|
|
36
|
+
:show-label="cmdFormElementInput2.showLabel"
|
|
37
|
+
:labelText="cmdFormElementInput2.labelText"
|
|
38
|
+
:placeholder="cmdFormElementInput2.placeholder"
|
|
39
|
+
:required="cmdFormElementInput2.required"
|
|
40
|
+
v-model="searchValue2"
|
|
41
|
+
/>
|
|
42
|
+
<!-- end CmdFormElement for second input -->
|
|
43
|
+
|
|
44
|
+
<!-- begin CmdFormElement for radius -->
|
|
45
|
+
<CmdFormElement
|
|
46
|
+
v-if="cmdFormElementRadiusOptions.show"
|
|
47
|
+
element="select"
|
|
48
|
+
class="flex-none"
|
|
49
|
+
v-model="radius"
|
|
50
|
+
v-bind="cmdFormElementRadiusOptions"
|
|
51
|
+
/>
|
|
52
|
+
<!-- end CmdFormElement for radius -->
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<!-- begin CmdFormElement for search-button -->
|
|
56
|
+
<CmdFormElement
|
|
57
|
+
element="button"
|
|
58
|
+
class="stretch-on-small-devices"
|
|
59
|
+
:nativeButton="cmdFormElementSearchButton"
|
|
60
|
+
@click="onSearchButtonClick"
|
|
61
|
+
:disabled="buttonSearchDisabled"
|
|
62
|
+
aria-live="assertive"
|
|
63
|
+
/>
|
|
64
|
+
<!-- end CmdFormElement for search-button -->
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<!-- end form-elements -->
|
|
68
|
+
|
|
69
|
+
<!-- begin filters -->
|
|
70
|
+
<template v-if="useFilters">
|
|
71
|
+
<a class="filter-options" href="#" @click.prevent="showFilters = !showFilters">
|
|
72
|
+
<!-- begin CmdIcon -->
|
|
73
|
+
<CmdIcon
|
|
74
|
+
:iconClass="showFilters ? cmdIcon?.showFilters?.iconClass : cmdIcon?.hideFilters?.iconClass"
|
|
75
|
+
:type="showFilters ? cmdIcon?.showFilters?.iconType : cmdIcon?.hideFilters?.iconType"
|
|
76
|
+
/>
|
|
77
|
+
<!-- end CmdIcon -->
|
|
78
|
+
<span v-if="showFilters">{{ getMessage("site_search.hide_filter_options") }}</span>
|
|
79
|
+
<span v-else>{{ getMessage("site_search.show_filter_options") }}</span>
|
|
80
|
+
</a>
|
|
81
|
+
<transition :name="transitionFilters">
|
|
82
|
+
<div v-if="showFilters && cmdFakeSelect?.selectData.length" class="flex-container flex-none" role="listbox" aria-expanded="true">
|
|
83
|
+
<!-- begin CmdFakeSelect -->
|
|
84
|
+
<CmdFakeSelect
|
|
85
|
+
role="option"
|
|
86
|
+
:selectData="cmdFakeSelect?.selectData"
|
|
87
|
+
v-model="searchFilters"
|
|
88
|
+
:defaultOptionName="cmdFakeSelect?.defaultOptionName"
|
|
89
|
+
:type="cmdFakeSelect?.type"
|
|
90
|
+
:labelText="cmdFakeSelect?.labelText"
|
|
91
|
+
/>
|
|
92
|
+
<!-- end CmdFakeSelect -->
|
|
93
|
+
</div>
|
|
94
|
+
</transition>
|
|
95
|
+
</template>
|
|
96
|
+
<!-- end filters -->
|
|
97
|
+
</fieldset>
|
|
98
|
+
|
|
99
|
+
<!-- begin CmdFormFilters -->
|
|
100
|
+
<CmdFormFilters v-if="useFilters" v-model="searchFilters" :selectedOptionsName="getOptionName"/>
|
|
101
|
+
<!-- end CmdFormFilters -->
|
|
102
|
+
<!-- end CmdBoxSiteSearch ---------------------------------------------------------------------------------------- -->
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script>
|
|
106
|
+
// import mixins
|
|
107
|
+
import I18n from "../mixins/I18n"
|
|
108
|
+
import DefaultMessageProperties from "../mixins/CmdSiteSearch/DefaultMessageProperties"
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
emits: [
|
|
112
|
+
"search",
|
|
113
|
+
"update:modelValueInput1",
|
|
114
|
+
"update:modelValueInput2",
|
|
115
|
+
"update:modelValueRadius",
|
|
116
|
+
"update:modelValueSearchFilters"
|
|
117
|
+
],
|
|
118
|
+
name: "CmdBoxSiteSearch",
|
|
119
|
+
mixins: [I18n, DefaultMessageProperties],
|
|
120
|
+
data() {
|
|
121
|
+
return {
|
|
122
|
+
showFilters: false
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
props: {
|
|
126
|
+
/**
|
|
127
|
+
* define the transition when filters disappear
|
|
128
|
+
*
|
|
129
|
+
* @allowedValues: "none", "fade", "scroll"
|
|
130
|
+
*/
|
|
131
|
+
transitionFilters: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: "fade"
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* custom modelValue for first input-field
|
|
137
|
+
*/
|
|
138
|
+
modelValueInput1: {
|
|
139
|
+
type: String,
|
|
140
|
+
required: false
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* custom modelValue for second input-field
|
|
144
|
+
*/
|
|
145
|
+
modelValueInput2: {
|
|
146
|
+
type: String,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* custom modelValue for radius
|
|
151
|
+
*/
|
|
152
|
+
modelValueRadius: {
|
|
153
|
+
type: [String, Number],
|
|
154
|
+
required: false
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* custom modelValue for search-filters
|
|
158
|
+
*/
|
|
159
|
+
modelValueSearchFilters: {
|
|
160
|
+
type: Array,
|
|
161
|
+
required: false
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* toggle use of filters (must be configured)
|
|
165
|
+
*/
|
|
166
|
+
useFilters: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: true
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* legend for form
|
|
172
|
+
*
|
|
173
|
+
* useFieldset-property must be activated
|
|
174
|
+
*
|
|
175
|
+
* @requiredForAccessiblity: true
|
|
176
|
+
*/
|
|
177
|
+
legend: {
|
|
178
|
+
type: Object,
|
|
179
|
+
default() {
|
|
180
|
+
return {
|
|
181
|
+
show: true,
|
|
182
|
+
align: "left",
|
|
183
|
+
text: "Legend"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* send search result from outside to display inside this component
|
|
189
|
+
*/
|
|
190
|
+
results: {
|
|
191
|
+
type: [Function, Number],
|
|
192
|
+
required: false
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* properties for CmdHeadline-component
|
|
196
|
+
*/
|
|
197
|
+
cmdHeadline: {
|
|
198
|
+
type: Object,
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* properties for CmdFormElement-component first search-field
|
|
203
|
+
*/
|
|
204
|
+
cmdFormElementInput1: {
|
|
205
|
+
type: Object,
|
|
206
|
+
default() {
|
|
207
|
+
return {
|
|
208
|
+
type: "search",
|
|
209
|
+
showLabel: false,
|
|
210
|
+
required: true,
|
|
211
|
+
labelText: "What do you like to search for?",
|
|
212
|
+
placeholder: "What do you like to search for?",
|
|
213
|
+
showSearchButton: false
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* properties for CmdFormElement-component for second search-field
|
|
219
|
+
*/
|
|
220
|
+
cmdFormElementInput2: {
|
|
221
|
+
type: Object,
|
|
222
|
+
default() {
|
|
223
|
+
return {
|
|
224
|
+
show: true,
|
|
225
|
+
type: "text",
|
|
226
|
+
showLabel: false,
|
|
227
|
+
required: true,
|
|
228
|
+
labelText: "Where do you like to search?",
|
|
229
|
+
placeholder: "Enter city, zip, country"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* properties for CmdFormElement-component for radius
|
|
235
|
+
*/
|
|
236
|
+
cmdFormElementRadius: {
|
|
237
|
+
type: Object,
|
|
238
|
+
required: false
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* properties for CmdFormElement-component for search-button
|
|
242
|
+
*/
|
|
243
|
+
cmdFormElementSearchButton: {
|
|
244
|
+
type: Object,
|
|
245
|
+
default() {
|
|
246
|
+
return {
|
|
247
|
+
icon: {
|
|
248
|
+
show: true,
|
|
249
|
+
position: "before",
|
|
250
|
+
iconClass: "icon-search"
|
|
251
|
+
},
|
|
252
|
+
text: "Search",
|
|
253
|
+
primary: true
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
/**
|
|
258
|
+
* properties for CmdFakeSelect-component for filters
|
|
259
|
+
*/
|
|
260
|
+
cmdFakeSelect: {
|
|
261
|
+
type: Object,
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* properties for CmdIcon-component for filters
|
|
266
|
+
*/
|
|
267
|
+
cmdIcon: {
|
|
268
|
+
type: Object,
|
|
269
|
+
default() {
|
|
270
|
+
return {
|
|
271
|
+
showFilters: {
|
|
272
|
+
iconClass: "icon-chevron-one-stripe-up",
|
|
273
|
+
type: "auto"
|
|
274
|
+
},
|
|
275
|
+
hideFilters: {
|
|
276
|
+
iconClass: "icon-chevron-one-stripe-down",
|
|
277
|
+
type: "auto"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
computed: {
|
|
284
|
+
cmdFormElementRadiusOptions() {
|
|
285
|
+
return {
|
|
286
|
+
show: true,
|
|
287
|
+
showLabel: false,
|
|
288
|
+
required: false,
|
|
289
|
+
labelText: "Radius",
|
|
290
|
+
selectOptions: [
|
|
291
|
+
{
|
|
292
|
+
text: "None",
|
|
293
|
+
value: 0
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
text: "5 Km",
|
|
297
|
+
value: 5
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
text: "10 Km",
|
|
301
|
+
value: 10
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
text: "15 Km",
|
|
305
|
+
value: 15
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
text: "50 Km",
|
|
309
|
+
value: 50
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
text: "100 Km",
|
|
313
|
+
value: 100
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
...this.cmdFormElementRadius
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
searchValue1: {
|
|
320
|
+
get() {
|
|
321
|
+
return this.modelValueInput1
|
|
322
|
+
},
|
|
323
|
+
set(value) {
|
|
324
|
+
this.$emit("update:modelValueInput1", value)
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
searchValue2: {
|
|
328
|
+
get() {
|
|
329
|
+
return this.modelValueInput2
|
|
330
|
+
},
|
|
331
|
+
set(value) {
|
|
332
|
+
this.$emit("update:modelValueInput2", value)
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
radius: {
|
|
336
|
+
get() {
|
|
337
|
+
return this.modelValueRadius
|
|
338
|
+
},
|
|
339
|
+
set(value) {
|
|
340
|
+
this.$emit("update:modelValueRadius", value)
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
searchFilters: {
|
|
344
|
+
get() {
|
|
345
|
+
return this.modelValueSearchFilters
|
|
346
|
+
},
|
|
347
|
+
set(value) {
|
|
348
|
+
this.$emit("update:modelValueSearchFilters", value)
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
buttonSearchDisabled() {
|
|
352
|
+
const validInput1 = !this.cmdFormElementInput1.required || this.searchValue1.trim()
|
|
353
|
+
const validInput2 = !this.cmdFormElementInput2.show || !this.cmdFormElementInput2.required || this.searchValue2.trim()
|
|
354
|
+
const validInputRadius = !this.cmdFormElementRadiusOptions.show || !this.cmdFormElementRadiusOptions.required || this.radius
|
|
355
|
+
|
|
356
|
+
return !(validInput1 && validInput2 && validInputRadius)
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
methods: {
|
|
360
|
+
onSearchButtonClick() {
|
|
361
|
+
this.$emit("search", {
|
|
362
|
+
searchValue1: this.searchValue1,
|
|
363
|
+
searchValue2: this.searchValue2,
|
|
364
|
+
searchFilters: this.searchFilters,
|
|
365
|
+
radius: this.radius
|
|
366
|
+
})
|
|
367
|
+
},
|
|
368
|
+
getOptionName(option) {
|
|
369
|
+
for (let i = 0; i < this.cmdFakeSelect.selectData.length; i++) {
|
|
370
|
+
if (option === this.cmdFakeSelect.selectData[i].value) {
|
|
371
|
+
return this.cmdFakeSelect.selectData[i].text
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return null
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
watch: {
|
|
378
|
+
cmdFormElementRadius: {
|
|
379
|
+
handler() {
|
|
380
|
+
if (this.cmdFormElementRadiusOptions?.selectOptions && this.cmdFormElementRadiusOptions?.selectOptions.length && this.modelValueRadius == null) {
|
|
381
|
+
this.radius = this.cmdFormElementRadiusOptions.selectOptions[0].value
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
immediate: true,
|
|
385
|
+
deep: true
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
</script>
|
|
390
|
+
|
|
391
|
+
<style lang="scss">
|
|
392
|
+
/* begin cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
|
393
|
+
@import '../assets/styles/variables';
|
|
394
|
+
.cmd-box-site-search {
|
|
395
|
+
flex-wrap: nowrap;
|
|
396
|
+
|
|
397
|
+
> a.filter-options {
|
|
398
|
+
display: table;
|
|
399
|
+
align-self: flex-start;
|
|
400
|
+
|
|
401
|
+
[class*='icon'] {
|
|
402
|
+
font-size: var(--icon-size-small);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
button {
|
|
407
|
+
align-self: flex-end;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
@media only screen and (max-width: $small-max-width) {
|
|
412
|
+
.cmd-box-site-search {
|
|
413
|
+
flex-wrap: nowrap;
|
|
414
|
+
|
|
415
|
+
> a.filter-options {
|
|
416
|
+
align-self: center;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/* end cmd-box-site-search ---------------------------------------------------------------------------------------- */
|
|
421
421
|
</style>
|