Search: autocomplete terms add up as labels, all their records exact (Q7)
A chosen suggestion becomes a removable label in the field; the search starts with Enter or the button, so several terms and free text combine. The request sends the whole phrase (titles, model) and the term IDs. Terms are ANDed in the same filter as the countries of Q6; every record of the chosen terms is exact, ordered by the other words then by the model, then close results from the whole catalogue. The message names what makes a result exact (terms, countries as typed). Wider field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -520,9 +520,10 @@ header[role="banner"]{
|
||||
#block-materiosapisearchblock{
|
||||
align-self: flex-end;
|
||||
flex-shrink: 0;
|
||||
// Long enough for a phrase and for the placeholder (F4).
|
||||
width: 30em;
|
||||
max-width: 50%;
|
||||
// Long enough for a phrase and for the placeholder (F4), and for a
|
||||
// few chosen terms as labels next to the text (Q7).
|
||||
width: 40em;
|
||||
max-width: 60%;
|
||||
}
|
||||
// Tablet and mobile: the field on its own line, full width (F5).
|
||||
@include col-mediaquery-max(4){
|
||||
@@ -654,6 +655,32 @@ header[role="banner"]{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
// Terms chosen in the suggestions, as labels in the field (Q7):
|
||||
// the border goes to the whole line, labels then text.
|
||||
&.has-terms{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.2em;
|
||||
border: 1px #BBB solid;
|
||||
border-radius: 14px;
|
||||
padding: 0.15em 0.3em;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
&:focus-within{
|
||||
outline: 2px solid #666;
|
||||
outline-offset: 1px;
|
||||
}
|
||||
#edit-search{
|
||||
flex: 1 1 6em;
|
||||
width: auto;
|
||||
min-width: 6em;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
padding: 0.15em;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button.form-submit{
|
||||
@@ -744,6 +771,37 @@ header[role="banner"]{
|
||||
}
|
||||
|
||||
|
||||
#materio-sapi-search-form ul.search-terms {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.2em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
li {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
padding: 0 0.1em 0 0.5em;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
font-size: 0.85em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.search-term-remove {
|
||||
border: 0;
|
||||
padding: 0 0.3em;
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
font-size: 1.1em;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
&:hover, &:focus-visible {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suggestions of the search field (SearchForm.vue, F7), same look as the
|
||||
// former jQuery UI autocomplete.
|
||||
#materio-sapi-search-form ul.search-suggestions {
|
||||
|
||||
Reference in New Issue
Block a user