@fluid-topics/ft-search-bar 0.1.6 → 0.1.7
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/build/ft-search-bar.css.d.ts +24 -0
- package/build/ft-search-bar.css.js +384 -0
- package/build/ft-search-bar.d.ts +29 -29
- package/build/ft-search-bar.js +321 -558
- package/build/ft-search-bar.light.js +2400 -0
- package/build/ft-search-bar.min.js +1610 -59
- package/package.json +13 -13
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FtCssVariable } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
export declare const FtSearchBarCssVariables: {
|
|
3
|
+
height: FtCssVariable;
|
|
4
|
+
borderRadius: FtCssVariable;
|
|
5
|
+
mobileOpenPosition: FtCssVariable;
|
|
6
|
+
mobileOpenTop: FtCssVariable;
|
|
7
|
+
mobileOpenBottom: FtCssVariable;
|
|
8
|
+
mobileOpenLeft: FtCssVariable;
|
|
9
|
+
mobileOpenRight: FtCssVariable;
|
|
10
|
+
floatingZIndex: FtCssVariable;
|
|
11
|
+
colorSurface: FtCssVariable;
|
|
12
|
+
colorOnSurface: FtCssVariable;
|
|
13
|
+
colorOnSurfaceMedium: FtCssVariable;
|
|
14
|
+
colorOutline: FtCssVariable;
|
|
15
|
+
colorPrimary: FtCssVariable;
|
|
16
|
+
elevation02: FtCssVariable;
|
|
17
|
+
buttonColor: FtCssVariable;
|
|
18
|
+
buttonRippleColor: FtCssVariable;
|
|
19
|
+
};
|
|
20
|
+
export declare const searchBarCss: import("lit").CSSResult;
|
|
21
|
+
export declare const facetsCss: import("lit").CSSResult;
|
|
22
|
+
export declare const selectedFiltersCss: import("lit").CSSResult;
|
|
23
|
+
export declare const suggestionsCss: import("lit").CSSResult;
|
|
24
|
+
//# sourceMappingURL=ft-search-bar.css.d.ts.map
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { designSystemVariables, FtCssVariable, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
import { FtButtonCssVariables } from "@fluid-topics/ft-button";
|
|
4
|
+
import { FtInputLabelCssVariables } from "@fluid-topics/ft-input-label";
|
|
5
|
+
import { FtSelectCssVariables } from "@fluid-topics/ft-select";
|
|
6
|
+
import { FtSnapScrollCssVariables } from "@fluid-topics/ft-snap-scroll";
|
|
7
|
+
import { FtChipCssVariables } from "@fluid-topics/ft-chip";
|
|
8
|
+
export const FtSearchBarCssVariables = {
|
|
9
|
+
height: FtCssVariable.create("--ft-search-bar-height", "SIZE", "38px"),
|
|
10
|
+
borderRadius: FtCssVariable.extend("--ft-search-bar-border-radius", designSystemVariables.borderRadiusS),
|
|
11
|
+
mobileOpenPosition: FtCssVariable.create("--ft-search-bar-mobile-open-position", "POSITION", "fixed"),
|
|
12
|
+
mobileOpenTop: FtCssVariable.create("--ft-search-bar-mobile-open-top", "SIZE", "0"),
|
|
13
|
+
mobileOpenBottom: FtCssVariable.create("--ft-search-bar-mobile-open-bottom", "SIZE", "0"),
|
|
14
|
+
mobileOpenLeft: FtCssVariable.create("--ft-search-bar-mobile-open-left", "SIZE", "0"),
|
|
15
|
+
mobileOpenRight: FtCssVariable.create("--ft-search-bar-mobile-open-right", "SIZE", "0"),
|
|
16
|
+
floatingZIndex: FtCssVariable.create("--ft-search-bar-floating-components-z-index", "NUMBER", "2"),
|
|
17
|
+
colorSurface: FtCssVariable.external(designSystemVariables.colorSurface, "Design system"),
|
|
18
|
+
colorOnSurface: FtCssVariable.external(designSystemVariables.colorOnSurface, "Design system"),
|
|
19
|
+
colorOnSurfaceMedium: FtCssVariable.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
|
|
20
|
+
colorOutline: FtCssVariable.external(designSystemVariables.colorOutline, "Design system"),
|
|
21
|
+
colorPrimary: FtCssVariable.external(designSystemVariables.colorPrimary, "Design system"),
|
|
22
|
+
elevation02: FtCssVariable.external(designSystemVariables.elevation02, "Design system"),
|
|
23
|
+
buttonColor: FtCssVariable.external(FtButtonCssVariables.color, "Button"),
|
|
24
|
+
buttonRippleColor: FtCssVariable.external(FtButtonCssVariables.rippleColor, "Button"),
|
|
25
|
+
};
|
|
26
|
+
//language=css
|
|
27
|
+
export const searchBarCss = css `
|
|
28
|
+
* {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ft-search-bar--container {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
color: ${FtSearchBarCssVariables.colorOnSurface};
|
|
37
|
+
background: ${FtSearchBarCssVariables.colorSurface};
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ft-search-bar--mobile-menu-open {
|
|
42
|
+
position: ${FtSearchBarCssVariables.mobileOpenPosition};
|
|
43
|
+
top: ${FtSearchBarCssVariables.mobileOpenTop};
|
|
44
|
+
bottom: ${FtSearchBarCssVariables.mobileOpenBottom};
|
|
45
|
+
left: ${FtSearchBarCssVariables.mobileOpenLeft};
|
|
46
|
+
right: ${FtSearchBarCssVariables.mobileOpenRight};
|
|
47
|
+
z-index: ${FtSearchBarCssVariables.floatingZIndex};
|
|
48
|
+
padding: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ft-search-bar {
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
position: relative;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
align-items: center;
|
|
57
|
+
height: ${FtSearchBarCssVariables.height};
|
|
58
|
+
|
|
59
|
+
background: ${FtSearchBarCssVariables.colorSurface};
|
|
60
|
+
border: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
61
|
+
border-radius: ${FtSearchBarCssVariables.borderRadius};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ft-search-bar--floating-panel-open .ft-search-bar {
|
|
65
|
+
border-radius: ${FtSearchBarCssVariables.borderRadius} ${FtSearchBarCssVariables.borderRadius} 0 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ft-search-bar--input-container {
|
|
69
|
+
flex-grow: 1;
|
|
70
|
+
flex-shrink: 1;
|
|
71
|
+
position: relative;
|
|
72
|
+
height: calc(100% - 2px);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ft-search-bar--input-outline {
|
|
76
|
+
flex-grow: 1;
|
|
77
|
+
flex-shrink: 1;
|
|
78
|
+
height: 100%;
|
|
79
|
+
width: 100%;
|
|
80
|
+
align-self: stretch;
|
|
81
|
+
display: grid;
|
|
82
|
+
padding: 0 8px;
|
|
83
|
+
border-radius: ${FtSearchBarCssVariables.borderRadius};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ft-search-bar--dense .ft-search-bar--input-outline {
|
|
87
|
+
grid-template-columns: auto minmax(200px, 1fr);
|
|
88
|
+
gap: 8px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ft-search-bar--input-container:focus-within .ft-search-bar--input-outline {
|
|
92
|
+
outline: 2px solid ${FtSearchBarCssVariables.colorPrimary};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ft-search-bar--input {
|
|
96
|
+
height: 100%;
|
|
97
|
+
flex-grow: 1;
|
|
98
|
+
border: none;
|
|
99
|
+
background-color: transparent;
|
|
100
|
+
outline: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ft-search-bar--desktop .ft-search-bar--input {
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
min-width: 250px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ft-search-bar > ft-button {
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ft-search-bar--left-action {
|
|
113
|
+
${setVariable(FtButtonCssVariables.borderRadius, css `calc(${FtSearchBarCssVariables.borderRadius} - 1px) 0 0 calc(${FtSearchBarCssVariables.borderRadius} - 1px)`)};
|
|
114
|
+
border-right: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
115
|
+
height: 100%;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ft-search-bar--left-action::part(button) {
|
|
119
|
+
height : 100%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ft-search-bar--floating-panel-open .ft-search-bar--left-action {
|
|
123
|
+
${setVariable(FtButtonCssVariables.borderRadius, css `calc(${FtSearchBarCssVariables.borderRadius} - 1px) 0 0 0`)};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ft-search-bar--launch-search,
|
|
127
|
+
.ft-search-bar--clear-query {
|
|
128
|
+
margin: 0 4px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ft-search-bar--separator {
|
|
132
|
+
height: 20px;
|
|
133
|
+
border-right: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale {
|
|
137
|
+
${setVariable(FtInputLabelCssVariables.borderColor, "transparent")};
|
|
138
|
+
${setVariable(FtInputLabelCssVariables.borderRadiusS, css `calc(${FtSearchBarCssVariables.borderRadius} - 1px)`)};
|
|
139
|
+
${setVariable(FtSelectCssVariables.selectedOptionColor, FtSearchBarCssVariables.buttonColor)};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale,
|
|
143
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale::part(container),
|
|
144
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale::part(main-panel) {
|
|
145
|
+
height: 100%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale::part(options) {
|
|
149
|
+
top: calc(100% + 1px);
|
|
150
|
+
right: unset;
|
|
151
|
+
width: max-content;
|
|
152
|
+
min-width: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ft-search-bar--left-action.ft-search-bar--content-locale::part(selected-value) {
|
|
156
|
+
border-radius: calc(${FtSearchBarCssVariables.borderRadius} - 1px) 0 0 calc(${FtSearchBarCssVariables.borderRadius} - 1px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
`;
|
|
160
|
+
//language=css
|
|
161
|
+
export const facetsCss = css `
|
|
162
|
+
.ft-search-bar--floating-panel .ft-search-bar--presets {
|
|
163
|
+
margin-right: auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ft-search-bar--floating-panel .ft-search-bar--presets {
|
|
167
|
+
min-width: 250px;
|
|
168
|
+
${setVariable(FtSelectCssVariables.optionsZIndex, "2")};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ft-search-bar--floating-panel {
|
|
172
|
+
padding: 16px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ft-search-bar--floating-panel-open .ft-search-bar--floating-panel {
|
|
176
|
+
display: block;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ft-search-bar--desktop .ft-search-bar--facets-actions {
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: flex-end;
|
|
183
|
+
gap: 8px;
|
|
184
|
+
padding: 0 10px;
|
|
185
|
+
margin-bottom: 16px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ft-search-bar--mobile .ft-search-bar--facets-actions {
|
|
189
|
+
flex-shrink: 0;
|
|
190
|
+
flex-grow: 0;
|
|
191
|
+
display: flex;
|
|
192
|
+
gap: 16px;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: space-evenly;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ft-search-bar--mobile .ft-search-bar--facets-actions > * {
|
|
198
|
+
flex-grow: 1;
|
|
199
|
+
flex-basis: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.ft-search-bar--content-locale::part(clear-button) {
|
|
203
|
+
display: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.ft-search-bar--floating-panel .ft-search-bar--filters-container {
|
|
207
|
+
display: block;
|
|
208
|
+
height: 350px;
|
|
209
|
+
--ft-snap-scroll-gap: 16px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.ft-search-bar--floating-panel ft-filter {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-grow: 0;
|
|
215
|
+
max-height: 100%;
|
|
216
|
+
max-width: 250px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ft-search-bar--hierarchical-filter {
|
|
220
|
+
width: 250px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.ft-search-bar--mobile .ft-search-bar--filters-container {
|
|
224
|
+
flex-grow: 1;
|
|
225
|
+
flex-shrink: 1;
|
|
226
|
+
overflow-y: auto;
|
|
227
|
+
margin: 0 -16px;
|
|
228
|
+
padding: 0 16px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.ft-search-bar--mobile .ft-search-bar--filters-container ft-filter {
|
|
232
|
+
display: flex;
|
|
233
|
+
max-height: 60vh;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ft-search-bar--mobile ft-filter::part(container) {
|
|
237
|
+
flex-grow: 1;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.ft-search-bar--filter-label {
|
|
241
|
+
display: flex;
|
|
242
|
+
justify-content: space-between;
|
|
243
|
+
align-items: baseline;
|
|
244
|
+
gap: 8px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.ft-search-bar--filter-label > * {
|
|
248
|
+
white-space: nowrap;
|
|
249
|
+
overflow: hidden;
|
|
250
|
+
text-overflow: ellipsis;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.ft-search-bar--filter-label > :first-child {
|
|
254
|
+
flex-shrink: 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.ft-search-bar--filter-label > :last-child {
|
|
258
|
+
flex-shrink: 1;
|
|
259
|
+
color: ${FtSearchBarCssVariables.colorOnSurfaceMedium};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
ft-accordion-item::part(toggle) {
|
|
263
|
+
margin-left: -16px;
|
|
264
|
+
margin-right: -16px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
ft-accordion-item::part(label) {
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
ft-accordion-item::part(content) {
|
|
272
|
+
padding-left: 0;
|
|
273
|
+
padding-right: 0;
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
//language=css
|
|
277
|
+
export const selectedFiltersCss = css `
|
|
278
|
+
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
279
|
+
flex-shrink: 0;
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: row;
|
|
282
|
+
flex-wrap: wrap;
|
|
283
|
+
gap: 8px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
${setVariable(FtSnapScrollCssVariables.gap, "4px")};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
292
|
+
align-items: center;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
296
|
+
${setVariable(FtChipCssVariables.iconSize, "17px")};
|
|
297
|
+
${setVariable(FtChipCssVariables.fontSize, "12px")};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.ft-search-bar--selected-filters * {
|
|
301
|
+
max-width: 100%;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.ft-search-bar--selected-filters ft-chip {
|
|
305
|
+
flex-grow: 0;
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
//language=css
|
|
309
|
+
export const suggestionsCss = css `
|
|
310
|
+
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
311
|
+
flex-grow: 1;
|
|
312
|
+
flex-shrink: 1;
|
|
313
|
+
overflow-y: auto;
|
|
314
|
+
height: 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
318
|
+
border-top: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
322
|
+
height: initial;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.ft-search-bar--floating-panel,
|
|
326
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
327
|
+
position: absolute;
|
|
328
|
+
z-index: var(--ft-search-bar-floating-components-z-index, 1);
|
|
329
|
+
top: 100%;
|
|
330
|
+
left: -1px;
|
|
331
|
+
right: -1px;
|
|
332
|
+
display: none;
|
|
333
|
+
background: ${FtSearchBarCssVariables.colorSurface};
|
|
334
|
+
border: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
335
|
+
border-radius: 0 0 ${FtSearchBarCssVariables.borderRadius} ${FtSearchBarCssVariables.borderRadius};
|
|
336
|
+
box-shadow: ${FtSearchBarCssVariables.elevation02};
|
|
337
|
+
outline: none;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
341
|
+
top: calc(100% + 2px);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.ft-search-bar--input-container:focus-within .ft-search-bar--suggestions-not-empty {
|
|
345
|
+
display: block;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.ft-search-bar--no-suggestions {
|
|
349
|
+
text-align: center;
|
|
350
|
+
padding: 8px;
|
|
351
|
+
color: ${FtSearchBarCssVariables.colorOnSurface};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.ft-search-bar--suggestion {
|
|
355
|
+
text-decoration: none;
|
|
356
|
+
position: relative;
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: center;
|
|
359
|
+
padding: 8px;
|
|
360
|
+
gap: 8px;
|
|
361
|
+
cursor: pointer;
|
|
362
|
+
color: ${FtSearchBarCssVariables.colorOnSurface};
|
|
363
|
+
min-height: 52px;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.ft-search-bar--desktop .ft-search-bar--suggestion {
|
|
367
|
+
min-height: 44px;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.ft-search-bar--suggestion:focus {
|
|
371
|
+
outline: none;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
375
|
+
border-top: 1px solid ${FtSearchBarCssVariables.colorOutline};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.ft-search-bar--suggestion ft-typography {
|
|
379
|
+
display: block;
|
|
380
|
+
flex-grow: 1;
|
|
381
|
+
flex-shrink: 1;
|
|
382
|
+
}
|
|
383
|
+
`;
|
|
384
|
+
//# sourceMappingURL=ft-search-bar.css.js.map
|
package/build/ft-search-bar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
|
-
import { ElementDefinitionsMap,
|
|
3
|
-
import { FluidTopicsApi, FtSearchRequest, FtSuggestRequest } from "@fluid-topics/public-api";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElement, ParametrizedLabels } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FluidTopicsApi, FtSearchFacetConf, FtSearchRequest, FtSuggestRequest } from "@fluid-topics/public-api";
|
|
4
4
|
declare global {
|
|
5
5
|
interface Window {
|
|
6
6
|
fluidtopics?: {
|
|
@@ -11,8 +11,6 @@ declare global {
|
|
|
11
11
|
export interface FtSearchBarLabels extends ParametrizedLabels {
|
|
12
12
|
clearFilters?: string;
|
|
13
13
|
filtersButton?: string;
|
|
14
|
-
oneFilterEnabled?: string;
|
|
15
|
-
nFiltersEnabled?: string;
|
|
16
14
|
inputPlaceHolder?: string;
|
|
17
15
|
filterInputPlaceHolder?: string;
|
|
18
16
|
clearInputButton?: string;
|
|
@@ -21,10 +19,15 @@ export interface FtSearchBarLabels extends ParametrizedLabels {
|
|
|
21
19
|
searchButton?: string;
|
|
22
20
|
noSuggestions?: string;
|
|
23
21
|
contentLocaleSelector?: string;
|
|
22
|
+
presetsSelector?: string;
|
|
24
23
|
removeRecentSearch?: string;
|
|
25
24
|
back?: string;
|
|
26
25
|
}
|
|
27
26
|
export declare const DEFAULT_LABELS: FtSearchBarLabels;
|
|
27
|
+
declare type RelevantFtSearchRequest = Pick<FtSearchRequest, "contentLocale" | "filters"> & Partial<FtSearchRequest>;
|
|
28
|
+
export interface FtSearchPreset extends RelevantFtSearchRequest {
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
28
31
|
export interface FtSearchBarProperties {
|
|
29
32
|
labels?: FtSearchBarLabels;
|
|
30
33
|
baseUrl: string;
|
|
@@ -32,25 +35,11 @@ export interface FtSearchBarProperties {
|
|
|
32
35
|
contentLocale?: string;
|
|
33
36
|
uiLocale?: string;
|
|
34
37
|
displayedFilters?: Array<string>;
|
|
38
|
+
presets?: Array<FtSearchPreset>;
|
|
39
|
+
selectedPreset?: string;
|
|
40
|
+
dense: boolean;
|
|
35
41
|
}
|
|
36
|
-
export
|
|
37
|
-
height: FtCssVariable;
|
|
38
|
-
borderRadius: FtCssVariable;
|
|
39
|
-
mobileOpenPosition: FtCssVariable;
|
|
40
|
-
mobileOpenTop: FtCssVariable;
|
|
41
|
-
mobileOpenBottom: FtCssVariable;
|
|
42
|
-
mobileOpenLeft: FtCssVariable;
|
|
43
|
-
mobileOpenRight: FtCssVariable;
|
|
44
|
-
floatingZIndex: FtCssVariable;
|
|
45
|
-
colorSurface: FtCssVariable;
|
|
46
|
-
colorOnSurface: FtCssVariable;
|
|
47
|
-
colorOnSurfaceMedium: FtCssVariable;
|
|
48
|
-
colorOutline: FtCssVariable;
|
|
49
|
-
colorPrimary: FtCssVariable;
|
|
50
|
-
elevation02: FtCssVariable;
|
|
51
|
-
buttonColor: FtCssVariable;
|
|
52
|
-
buttonRippleColor: FtCssVariable;
|
|
53
|
-
};
|
|
42
|
+
export { FtSearchBarCssVariables } from "./ft-search-bar.css";
|
|
54
43
|
export declare class LaunchSearchEvent extends CustomEvent<FtSearchRequest> {
|
|
55
44
|
constructor(request: FtSearchRequest);
|
|
56
45
|
}
|
|
@@ -60,6 +49,7 @@ export declare class SearchStateChangeEvent extends CustomEvent<FtSearchRequest>
|
|
|
60
49
|
export declare class FtSearchBar extends FtLitElement implements FtSearchBarProperties {
|
|
61
50
|
static elementDefinitions: ElementDefinitionsMap;
|
|
62
51
|
protected getStyles(): import("lit").CSSResult[];
|
|
52
|
+
dense: boolean;
|
|
63
53
|
baseUrl: string;
|
|
64
54
|
apiIntegrationIdentifier: string;
|
|
65
55
|
contentLocale?: string;
|
|
@@ -68,12 +58,15 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
|
|
|
68
58
|
labels: FtSearchBarLabels;
|
|
69
59
|
private labelResolver;
|
|
70
60
|
displayedFilters: Array<string>;
|
|
61
|
+
presets: Array<FtSearchPreset>;
|
|
62
|
+
selectedPreset?: string;
|
|
71
63
|
searchRequestSerializer: (request: FtSearchRequest) => string;
|
|
72
64
|
private searchFilters;
|
|
73
65
|
private sizeCategory;
|
|
74
66
|
private displayFacets;
|
|
75
67
|
private mobileMenuOpen;
|
|
76
68
|
private facets;
|
|
69
|
+
private knownFacetLabels;
|
|
77
70
|
private container?;
|
|
78
71
|
private filtersOpener?;
|
|
79
72
|
private floatingContainer?;
|
|
@@ -92,24 +85,28 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
|
|
|
92
85
|
private get recentSearchesStorageKey();
|
|
93
86
|
private api?;
|
|
94
87
|
get request(): FtSearchRequest;
|
|
88
|
+
get facetsRequest(): Array<FtSearchFacetConf>;
|
|
95
89
|
get suggestRequest(): FtSuggestRequest;
|
|
90
|
+
private get isMobile();
|
|
96
91
|
private get hasFacets();
|
|
92
|
+
private get hasPresets();
|
|
97
93
|
private get hasLocaleSelector();
|
|
98
94
|
focus(): void;
|
|
99
95
|
clear(): void;
|
|
100
96
|
protected getTemplate(): import("lit-html").TemplateResult<1>;
|
|
101
|
-
private renderDesktopSearchBar;
|
|
102
|
-
private renderSearchBarLeftAction;
|
|
103
|
-
private renderDesktopSearchBarButtons;
|
|
104
97
|
private renderMobileSearchBar;
|
|
105
98
|
private renderMobileSearchBarButtons;
|
|
106
|
-
private renderMobileFacetsActions;
|
|
107
99
|
private renderMobileFacets;
|
|
108
|
-
private
|
|
109
|
-
private
|
|
110
|
-
private
|
|
100
|
+
private contentLocalesAsFilterOptions;
|
|
101
|
+
private renderDesktopSearchBar;
|
|
102
|
+
private renderSearchBarLeftAction;
|
|
103
|
+
private renderDesktopSearchBarButtons;
|
|
104
|
+
private renderFacetsActions;
|
|
111
105
|
private renderDesktopFacets;
|
|
112
106
|
private renderSelectedFacets;
|
|
107
|
+
private renderSuggestions;
|
|
108
|
+
private getIcon;
|
|
109
|
+
private openMobileFilters;
|
|
113
110
|
protected firstUpdated(props: PropertyValues): Promise<void>;
|
|
114
111
|
protected update(props: PropertyValues): void;
|
|
115
112
|
protected contentAvailableCallback(props: PropertyValues): void;
|
|
@@ -133,6 +130,9 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
|
|
|
133
130
|
private updateSize;
|
|
134
131
|
private getLocaleLabel;
|
|
135
132
|
private setFilter;
|
|
133
|
+
private compareFilters;
|
|
134
|
+
private compareRequests;
|
|
135
|
+
private setFiltersFromPreset;
|
|
136
136
|
private clearFilters;
|
|
137
137
|
private removeRecentSearch;
|
|
138
138
|
private onSuggestKeyDown;
|