hr-design-system-handlebars 1.114.112 → 1.114.113
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/CHANGELOG.md +13 -0
- package/build/handlebars/helpers/handlebar-helpers.js +1 -1
- package/dist/assets/brand/hessenschau/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-bigband/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-fernsehen/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-inforadio/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-rundfunkrat/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr-werbung/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr1/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr2/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr3/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/hr4/conf/locatags.merged.json +5 -1
- package/dist/assets/brand/you-fm/conf/locatags.merged.json +5 -1
- package/dist/assets/index.css +14 -7
- package/dist/views/components/page/search/search_form.hbs +140 -37
- package/dist/views_static/components/page/search/search_form.hbs +140 -37
- package/package.json +1 -1
- package/src/assets/brand/_default/conf/locatags.json +3 -0
- package/src/assets/brand/hessenschau/conf/locatags.json +2 -1
- package/src/assets/brand/hessenschau/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr/conf/locatags.json +2 -1
- package/src/assets/brand/hr/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-bigband/conf/locatags.json +2 -1
- package/src/assets/brand/hr-bigband/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-fernsehen/conf/locatags.json +2 -1
- package/src/assets/brand/hr-fernsehen/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-inforadio/conf/locatags.json +2 -1
- package/src/assets/brand/hr-inforadio/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-rundfunkrat/conf/locatags.json +2 -1
- package/src/assets/brand/hr-rundfunkrat/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-sinfonieorchester/conf/locatags.json +2 -1
- package/src/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr-werbung/conf/locatags.json +2 -1
- package/src/assets/brand/hr-werbung/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr1/conf/locatags.json +2 -1
- package/src/assets/brand/hr1/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr2/conf/locatags.json +2 -1
- package/src/assets/brand/hr2/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr3/conf/locatags.json +2 -1
- package/src/assets/brand/hr3/conf/locatags.merged.json +5 -1
- package/src/assets/brand/hr4/conf/locatags.json +2 -1
- package/src/assets/brand/hr4/conf/locatags.merged.json +5 -1
- package/src/assets/brand/you-fm/conf/locatags.json +2 -1
- package/src/assets/brand/you-fm/conf/locatags.merged.json +5 -1
- package/src/stories/views/components/page/search/search_form.hbs +140 -37
- package/src/stories/views/components/page/search/search_form.stories.js +31 -0
|
@@ -1,40 +1,143 @@
|
|
|
1
1
|
<form id="search_form" method="GET" action="#">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
2
|
+
<div class="relative flex flex-col px-2 pt-6 pb-6 mt-8 mb-8 sm:flex-row sm:px-4 bg-highlight-1 dark:bg-highlight-1-dark sm:pt-6 sm:pb-6 sm:mt-8 article-full-width sm:article-narrow">
|
|
3
|
+
<div class="relative h-12 basis-full width-full " x-data="searchSuggest()">
|
|
4
|
+
<div id="search-content"
|
|
5
|
+
@click.away="active=false; cursorIndex=-1"
|
|
6
|
+
@keydown.arrow-down="moveDownList()"
|
|
7
|
+
@keydown.arrow-up="moveUpList()"
|
|
8
|
+
>
|
|
9
|
+
<input
|
|
10
|
+
@input.debounce="getSuggestionsForInput();cursorIndex=-1"
|
|
11
|
+
@click="active=true"
|
|
12
|
+
name="query"
|
|
13
|
+
x-model="query"
|
|
14
|
+
placeholder='{{loca "search_input_placeholder" }}'
|
|
15
|
+
class="relative w-full h-12 pt-4 pl-4 placeholder-transparent bg-white border-r border-r-gray-mercury placeholder:select-none text-text dark:bg-black dark:text-text-dark autofill:shadow-autofill border-form-highlight dark:form-highlight-dark pr-9 peer border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none"
|
|
16
|
+
type="text"
|
|
17
|
+
id="searchInput--{{nextRandom}}"
|
|
18
|
+
autocomplete="off"
|
|
19
|
+
role="combobox"
|
|
20
|
+
aria-haspopup="listbox"
|
|
21
|
+
aria-autocomplete="list"
|
|
22
|
+
x-effect="$el.setAttribute('aria-expanded', (query.length > 1 && active && suggestions.length > 0))"
|
|
23
|
+
title="{{loca 'search_form_label_searchTerm'}}"
|
|
24
|
+
placeholder="{{loca 'search_form_label_searchTerm'}}"
|
|
25
|
+
|
|
26
|
+
>
|
|
27
|
+
<label for="searchInput--{{getRandom}}"
|
|
28
|
+
class="{{_labelClass}} peer-placeholder-shown:whitespace-nowrap {{> components/forms/components/labelClasses }}">
|
|
29
|
+
{{loca "search_form_label_searchTerm" }}
|
|
30
|
+
</label>
|
|
31
|
+
<div
|
|
32
|
+
class="absolute left-0 w-auto min-w-full z-100 top-11.5"
|
|
33
|
+
x-show="query.length > 1 && active && suggestions.length"
|
|
34
|
+
x-cloak
|
|
35
|
+
x-transition:leave="transition ease-in duration-100"
|
|
36
|
+
x-transition:leave-start="opacity-100"
|
|
37
|
+
x-transition:leave-end="opacity-0"
|
|
38
|
+
>
|
|
39
|
+
<ul
|
|
40
|
+
role="listbox"
|
|
41
|
+
id="suggestionlist--{{getRandom}}"
|
|
42
|
+
aria-label="Suche öffnen"
|
|
43
|
+
x-effect="$el.setAttribute('aria-expanded', query.length > 1 && active && suggestions.length > 0);$el.setAttribute('aria-hidden', !(query.length > 1 && active && suggestions.length > 0))"
|
|
44
|
+
class=" w-full mt-1 lg:mt-0.5 bg-white border rounded divide-y shadow-xl"
|
|
45
|
+
x-ref="list"
|
|
46
|
+
>
|
|
47
|
+
|
|
48
|
+
<template x-for="(suggestion, index) in suggestions" :key="index">
|
|
49
|
+
<li class="first-of-type:border-none">
|
|
50
|
+
<a
|
|
51
|
+
x-bind:active="false"
|
|
52
|
+
x-bind:href="'{{resourceUrl "suche/index.nocache"}}?query=' + suggestion"
|
|
53
|
+
x-bind:class="{'py-1.5 px-2 link-focus-inset text-base flex w-full text-secondary rounded hover:bg-primary hover:text-white': true, 'bg-primary text-white':index==cursorIndex }"
|
|
54
|
+
>
|
|
55
|
+
<span x-text="suggestion"></span>
|
|
56
|
+
</a>
|
|
57
|
+
</li>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
</ul>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<script type="text/javascript">
|
|
64
|
+
|
|
65
|
+
function searchSuggest() {
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
active:true,
|
|
69
|
+
cursorIndex: -1,
|
|
70
|
+
query: "",
|
|
71
|
+
suggestions: [],
|
|
72
|
+
|
|
73
|
+
getSuggestionsForInput() {
|
|
74
|
+
|
|
75
|
+
suggestionDataUrl = '{{resourceUrl "suche/index~suggest.jsp"}}' + '?suggestions=' + this.query;
|
|
76
|
+
|
|
77
|
+
fetch(suggestionDataUrl)
|
|
78
|
+
|
|
79
|
+
.then((res) =>{ return res.text()})
|
|
80
|
+
|
|
81
|
+
.then((data) => {
|
|
82
|
+
data = JSON.parse(data.replace(/"/g, '"'))
|
|
83
|
+
data.solrSuggestions = this.filterStartwith(data.solrSuggestions, this.query)
|
|
84
|
+
this.suggestions= this.filterSortbylength(data.solrSuggestions)
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
filterStartwith(data, query) {
|
|
90
|
+
return data.filter(Suggestion => Suggestion.toLowerCase().startsWith(query.toLowerCase().trim()))
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
filterSortbylength(data) {
|
|
94
|
+
return data.sort((a, b) => a.length - b.length)
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
moveDownList() {
|
|
98
|
+
if (this.suggestions.length > 0 && this.cursorIndex < this.suggestions.length - 1)
|
|
99
|
+
{
|
|
100
|
+
this.cursorIndex++;
|
|
101
|
+
this.query = this.suggestions[this.cursorIndex];
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
moveUpList() {
|
|
106
|
+
if (this.suggestions.length > 0 && this.cursorIndex > 0)
|
|
107
|
+
{
|
|
108
|
+
this.cursorIndex--;
|
|
109
|
+
this.query = this.suggestions[this.cursorIndex];
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
</script>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="relative flex h-12 basis-full width-full">
|
|
120
|
+
<div class="relative h-12 basis-full">
|
|
121
|
+
<select class="relative w-full h-12 pt-4 pl-4 bg-white appearance-none cursor-pointer form-select text-text dark:bg-black dark:text-text-dark pr-9 peer border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none border-form-highlight dark:border-form-highlight-dark" id="select_search" title="" name="all" isFocused="false">
|
|
122
|
+
<option class="text-gray-scorpion dark:text-text-dark" value="false" {{#unless this.searchInAllWebsites}} selected{{/unless}}>{{loca
|
|
123
|
+
"website_name_search_button"}}</option>
|
|
124
|
+
<option class="text-gray-scorpion dark:text-text-dark" value="true" {{#if this.searchInAllWebsites}} selected{{/if}}>{{loca
|
|
125
|
+
"search_select_all"}}</option>
|
|
126
|
+
</select>
|
|
127
|
+
<label for="select_search" class="absolute top-0 truncate transition-transform origin-top-left transform scale-100 translate-x-0 translate-y-3 pointer-events-none left-4 right-11 text-gray-scorpion dark:text-text-dark peer-focus:text-form-highlight peer-focus:dark:text-form-highlight-dark peer-focus:scale-75 peer-focus:translate-y-0 peer-focus:top-px ">
|
|
128
|
+
{{loca "search_form_label_searchType"}}
|
|
129
|
+
</label>
|
|
130
|
+
<div class="absolute bg-white right-0 p-4 py-3 transform border-l peer-focus:border-r peer-focus:border-l-0 pointer-events-none top-1.5 peer-focus:rotate-180">
|
|
131
|
+
{{~> components/base/image/icon _icon="arrow-down" _addClass="sb-icon w-3 h-3 fill-form-highlight dark:fill-form-highlight-dark" ~}}
|
|
38
132
|
</div>
|
|
39
133
|
</div>
|
|
40
|
-
|
|
134
|
+
<div class="relative">
|
|
135
|
+
<button aria-label="{{loca "search_input_aria_submit" }}" type="submit"
|
|
136
|
+
class="inline-flex items-center justify-center order-2 w-12 h-12 border rounded-r cursor-pointer ds-button font-heading text-button-inverted bg-button border-button hover:bg-button--dark hover:border-button--dark active:bg-button--dark active:scale-95 min-w-11">
|
|
137
|
+
{{> components/base/image/icon _icon="suche-ds" _addClass="sb-icon w-7 h-7 fill-white dark:fill-text-dark"}}
|
|
138
|
+
<span class="sr-only">{{loca "search_input_aria_submit" }}</span>
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</form>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const handlebars = require('hrHandlebars')
|
|
2
|
+
const hbsTemplates = []
|
|
3
|
+
hbsTemplates['default'] = handlebars.compile(`
|
|
4
|
+
{{> components/page/search/search_form }}
|
|
5
|
+
`)
|
|
6
|
+
|
|
7
|
+
const Template = (args) => {
|
|
8
|
+
return hbsTemplates['default']({ ...args })
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Komponenten/SearchForm',
|
|
13
|
+
argTypes: {},
|
|
14
|
+
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
|
|
18
|
+
docs: {
|
|
19
|
+
inlineStories: false,
|
|
20
|
+
iframeHeight: 400,
|
|
21
|
+
},
|
|
22
|
+
chromatic: {
|
|
23
|
+
disableSnapshot: false
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const searchForm = {
|
|
29
|
+
render: Template.bind({}),
|
|
30
|
+
name: 'Suchformular',
|
|
31
|
+
}
|