@fluid-topics/ft-search-bar 0.1.17 → 0.2.1
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.d.ts +2 -2
- package/build/ft-search-bar.inline-styles.js +2459 -0
- package/build/ft-search-bar.js +12 -20
- package/build/ft-search-bar.light.js +1207 -1299
- package/build/ft-search-bar.min.js +1242 -1335
- package/build/index.d.ts +2 -0
- package/build/index.js +5 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +4 -0
- package/package.json +15 -16
package/build/ft-search-bar.js
CHANGED
|
@@ -8,7 +8,7 @@ import { html, nothing } from "lit";
|
|
|
8
8
|
import { property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { repeat } from "lit/directives/repeat.js";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
-
import {
|
|
11
|
+
import { Debouncer, FtLitElement, jsonProperty, ParametrizedLabelResolver } from "@fluid-topics/ft-wc-utils";
|
|
12
12
|
import { FtSizeCategory, FtSizeWatcher } from "@fluid-topics/ft-size-watcher";
|
|
13
13
|
import { FtTypography, FtTypographyBody2 } from "@fluid-topics/ft-typography";
|
|
14
14
|
import { facetToFilter, getBreadcrumbFromValue, getLabelFromValue, getSelectedValues, selectedValues, serializeRequest } from "./converters";
|
|
@@ -20,7 +20,6 @@ import { FtChip } from "@fluid-topics/ft-chip";
|
|
|
20
20
|
import { FtSelect, FtSelectOption } from "@fluid-topics/ft-select";
|
|
21
21
|
import { FtSnapScroll } from "@fluid-topics/ft-snap-scroll";
|
|
22
22
|
import { FtTooltip } from "@fluid-topics/ft-tooltip";
|
|
23
|
-
import { Icon } from "@material/mwc-icon";
|
|
24
23
|
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
25
24
|
import { flatDeep } from "@fluid-topics/ft-filter/build/utils";
|
|
26
25
|
import { facetsCss, searchBarCss, selectedFiltersCss, suggestionsCss } from "./ft-search-bar.css";
|
|
@@ -53,7 +52,7 @@ export class SearchStateChangeEvent extends CustomEvent {
|
|
|
53
52
|
super("change", { detail: request });
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
|
|
55
|
+
export class FtSearchBar extends FtLitElement {
|
|
57
56
|
constructor() {
|
|
58
57
|
super(...arguments);
|
|
59
58
|
this.dense = false;
|
|
@@ -91,15 +90,6 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
91
90
|
&& a.filters.length === b.filters.length
|
|
92
91
|
&& a.filters.every(fa => b.filters.some(fb => this.compareFilters(fa, fb)));
|
|
93
92
|
}
|
|
94
|
-
getStyles() {
|
|
95
|
-
return [
|
|
96
|
-
FtTypographyBody2,
|
|
97
|
-
searchBarCss,
|
|
98
|
-
facetsCss,
|
|
99
|
-
selectedFiltersCss,
|
|
100
|
-
suggestionsCss
|
|
101
|
-
];
|
|
102
|
-
}
|
|
103
93
|
get recentSearchesStorageKey() {
|
|
104
94
|
return this.baseUrl + ":ft:recent-search-queries";
|
|
105
95
|
}
|
|
@@ -151,7 +141,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
151
141
|
this.mobileMenuOpen = false;
|
|
152
142
|
this.displayFacets = false;
|
|
153
143
|
}
|
|
154
|
-
|
|
144
|
+
render() {
|
|
155
145
|
const rootClasses = {
|
|
156
146
|
"ft-search-bar--container": true,
|
|
157
147
|
"ft-search-bar--dense": !this.isMobile && this.dense,
|
|
@@ -516,7 +506,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
516
506
|
@keyup=${(e) => this.onSuggestKeyUp(e, query)}
|
|
517
507
|
@click=${(e) => this.onSuggestClick(e, query)}>
|
|
518
508
|
<ft-ripple></ft-ripple>
|
|
519
|
-
<
|
|
509
|
+
<ft-icon variant="material" part="suggestion-icon">history</ft-icon>
|
|
520
510
|
<ft-typography variant="body1">${query}</ft-typography>
|
|
521
511
|
<ft-button icon="close"
|
|
522
512
|
round
|
|
@@ -808,7 +798,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
808
798
|
break;
|
|
809
799
|
}
|
|
810
800
|
}
|
|
811
|
-
}
|
|
801
|
+
}
|
|
812
802
|
FtSearchBar.elementDefinitions = {
|
|
813
803
|
"ft-accordion": FtAccordion,
|
|
814
804
|
"ft-accordion-item": FtAccordionItem,
|
|
@@ -824,8 +814,14 @@ FtSearchBar.elementDefinitions = {
|
|
|
824
814
|
"ft-snap-scroll": FtSnapScroll,
|
|
825
815
|
"ft-tooltip": FtTooltip,
|
|
826
816
|
"ft-typography": FtTypography,
|
|
827
|
-
"mwc-icon": Icon,
|
|
828
817
|
};
|
|
818
|
+
FtSearchBar.styles = [
|
|
819
|
+
FtTypographyBody2,
|
|
820
|
+
searchBarCss,
|
|
821
|
+
facetsCss,
|
|
822
|
+
selectedFiltersCss,
|
|
823
|
+
suggestionsCss
|
|
824
|
+
];
|
|
829
825
|
__decorate([
|
|
830
826
|
property({ type: Boolean })
|
|
831
827
|
], FtSearchBar.prototype, "dense", void 0);
|
|
@@ -916,8 +912,4 @@ __decorate([
|
|
|
916
912
|
__decorate([
|
|
917
913
|
state()
|
|
918
914
|
], FtSearchBar.prototype, "api", void 0);
|
|
919
|
-
FtSearchBar = __decorate([
|
|
920
|
-
customElement("ft-search-bar")
|
|
921
|
-
], FtSearchBar);
|
|
922
|
-
export { FtSearchBar };
|
|
923
915
|
//# sourceMappingURL=ft-search-bar.js.map
|