@francofantomius/material-components 1.1.0 → 1.1.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/CHANGELOG.md +10 -0
- package/dist/chunks/{search-bar-TXnqJ-gd.js → search-bar-fUD0qU2P.js} +22 -4
- package/dist/chunks/search-bar-fUD0qU2P.js.map +1 -0
- package/dist/components/search-bar/search-bar.css.d.ts.map +1 -1
- package/dist/components/search-bar/search-bar.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/search-bar-TXnqJ-gd.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.1] - 2026-08-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Search Bar (`md-search-bar`, `md-search`)**: Hidden native browser clear and cancel buttons (`::-webkit-search-cancel-button`, `::-ms-clear`) to prevent duplicate clear icons on Chromium and WebKit browsers.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- **Documentation**: Vertically and horizontally centered the search bar within the top header bar and improved active docked transition positioning.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
8
18
|
## [1.1.0] - 2026-08-22
|
|
9
19
|
|
|
10
20
|
### Added
|
|
@@ -2,7 +2,7 @@ import { t as o } from "./decorate-DXuynaiA.js";
|
|
|
2
2
|
import { t as p } from "./form-associated-Cty_ZaS9.js";
|
|
3
3
|
import "./icon-DrNqcNEL.js";
|
|
4
4
|
import { css as m, html as l, nothing as r } from "lit";
|
|
5
|
-
import { customElement as
|
|
5
|
+
import { customElement as u, property as a, query as x, state as f } from "lit/decorators.js";
|
|
6
6
|
var y = m`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
@@ -113,6 +113,24 @@ var y = m`
|
|
|
113
113
|
padding: 0 4px;
|
|
114
114
|
margin: 0;
|
|
115
115
|
box-sizing: border-box;
|
|
116
|
+
-webkit-appearance: none;
|
|
117
|
+
appearance: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
input::-webkit-search-decoration,
|
|
121
|
+
input::-webkit-search-cancel-button,
|
|
122
|
+
input::-webkit-search-results-button,
|
|
123
|
+
input::-webkit-search-results-decoration {
|
|
124
|
+
-webkit-appearance: none;
|
|
125
|
+
appearance: none;
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
input::-ms-clear,
|
|
130
|
+
input::-ms-reveal {
|
|
131
|
+
display: none;
|
|
132
|
+
width: 0;
|
|
133
|
+
height: 0;
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
input::placeholder {
|
|
@@ -686,13 +704,13 @@ o([a({
|
|
|
686
704
|
})], i.prototype, "autoDeactivateOnSelect", void 0);
|
|
687
705
|
o([f()], i.prototype, "highlightedIndex", void 0);
|
|
688
706
|
o([x("input")], i.prototype, "inputElement", void 0);
|
|
689
|
-
i = o([
|
|
707
|
+
i = o([u("md-search-bar")], i);
|
|
690
708
|
var g = class extends i {
|
|
691
709
|
};
|
|
692
|
-
g = o([
|
|
710
|
+
g = o([u("md-search")], g);
|
|
693
711
|
export {
|
|
694
712
|
i as n,
|
|
695
713
|
g as t
|
|
696
714
|
};
|
|
697
715
|
|
|
698
|
-
//# sourceMappingURL=search-bar-
|
|
716
|
+
//# sourceMappingURL=search-bar-fUD0qU2P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bar-fUD0qU2P.js","names":[],"sources":["../../src/components/search-bar/search-bar.css.ts","../../src/components/search-bar/search-bar.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const searchBarStyles = css`\n :host {\n display: block;\n box-sizing: border-box;\n position: relative;\n width: 100%;\n max-width: var(--md-search-bar-max-width, 100%);\n font-family: var(--md-sys-typescale-font-family, inherit);\n color: var(--md-sys-color-on-surface, #1D1B20);\n vertical-align: middle;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.38;\n }\n\n .scrim {\n display: none;\n }\n\n /* Scrim when active in docked mode to catch outside clicks */\n :host([active]) .scrim {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 40;\n background: transparent;\n }\n\n .search-container {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n border-radius: var(--md-sys-shape-corner-full, 28px);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),\n border-radius 200ms cubic-bezier(0.2, 0, 0, 1),\n background-color 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n .search-bar-header {\n display: flex;\n align-items: center;\n min-height: 56px;\n height: 56px;\n padding: 0 8px 0 16px;\n box-sizing: border-box;\n gap: 8px;\n }\n\n .leading-slot, .trailing-slot {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border: none;\n background: transparent;\n border-radius: 50%;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n cursor: pointer;\n padding: 0;\n outline: none;\n position: relative;\n transition: background-color 150ms ease;\n }\n\n .icon-btn:hover {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .icon-btn:focus-visible {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .input-wrapper {\n display: flex;\n flex: 1;\n min-width: 0;\n align-items: center;\n position: relative;\n }\n\n input {\n width: 100%;\n border: none;\n background: transparent;\n outline: none;\n font-family: inherit;\n font-size: var(--md-sys-typescale-body-large-size, 16px);\n line-height: var(--md-sys-typescale-body-large-line-height, 24px);\n color: var(--md-sys-color-on-surface, #1D1B20);\n padding: 0 4px;\n margin: 0;\n box-sizing: border-box;\n -webkit-appearance: none;\n appearance: none;\n }\n\n input::-webkit-search-decoration,\n input::-webkit-search-cancel-button,\n input::-webkit-search-results-button,\n input::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n display: none;\n }\n\n input::-ms-clear,\n input::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n input::placeholder {\n color: var(--md-sys-color-on-surface-variant, #49454F);\n opacity: 0.8;\n }\n\n /* Active Docked Mode */\n :host([active]) .search-container {\n z-index: 50;\n border-radius: var(--md-sys-shape-corner-extra-large, 28px 28px 16px 16px);\n box-shadow: var(--md-sys-elevation-level3, 0px 4px 8px 3px rgba(0, 0, 0, 0.15));\n }\n\n /* Divider when active */\n .divider {\n display: none;\n height: 1px;\n background-color: var(--md-sys-color-outline-variant, #CAC4D0);\n margin: 0 16px;\n }\n\n :host([active]) .divider {\n display: block;\n }\n\n /* Suggestions / Content Container */\n .suggestions-container {\n display: none;\n flex-direction: column;\n max-height: 360px;\n overflow-y: auto;\n padding: 8px 0;\n box-sizing: border-box;\n }\n\n :host([active]) .suggestions-container {\n display: flex;\n }\n\n .suggestion-item {\n display: flex;\n align-items: center;\n min-height: 48px;\n padding: 0 16px;\n gap: 16px;\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n user-select: none;\n color: var(--md-sys-color-on-surface, #1D1B20);\n transition: background-color 150ms ease;\n }\n\n .suggestion-item:hover,\n .suggestion-item.highlighted {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .suggestion-item.selected {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .suggestion-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n flex-shrink: 0;\n }\n\n .suggestion-text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n overflow: hidden;\n }\n\n .suggestion-label {\n font-size: var(--md-sys-typescale-body-large-size, 16px);\n line-height: 20px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .suggestion-supporting {\n font-size: var(--md-sys-typescale-body-medium-size, 14px);\n line-height: 16px;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-top: 2px;\n }\n\n .suggestion-trailing {\n font-size: var(--md-sys-typescale-body-medium-size, 14px);\n color: var(--md-sys-color-on-surface-variant, #49454F);\n flex-shrink: 0;\n }\n\n .search-trigger-container {\n display: none;\n }\n\n /* Responsive Fullscreen / Mobile Collapsed Mode */\n @media (max-width: 768px) {\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])),\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) {\n display: inline-flex;\n width: auto;\n max-width: none;\n vertical-align: middle;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border-radius: 50%;\n box-shadow: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n transition: background-color 200ms ease, box-shadow 200ms ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing {\n height: 48px;\n padding: 0 4px;\n gap: 2px;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n border-radius: var(--md-sys-shape-corner-full, 28px);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing:hover,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing:hover {\n box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0, 0, 0, 0.15));\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container:focus-visible,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container:focus-visible {\n outline: 2px solid var(--md-sys-color-primary, #6750A4);\n outline-offset: 2px;\n }\n\n .trigger-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n border-radius: 50%;\n border: none;\n background: transparent;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n cursor: pointer;\n padding: 0;\n margin: 0;\n outline: none;\n position: relative;\n transition: background-color 150ms ease, color 150ms ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n .trigger-btn:hover {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .trigger-btn:focus-visible {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .trigger-divider {\n width: 1px;\n height: 22px;\n background-color: var(--md-sys-color-outline-variant, #CAC4D0);\n margin: 0 2px;\n flex-shrink: 0;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-container,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-container {\n display: none;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .scrim,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .scrim {\n display: none;\n }\n\n :host([responsive][active]),\n :host([collapse-on-mobile][active]) {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n margin: 0;\n padding: 0;\n z-index: 99999;\n }\n\n :host([responsive][active]) .search-trigger-container,\n :host([collapse-on-mobile][active]) .search-trigger-container {\n display: none;\n }\n\n :host([responsive][active]) .scrim,\n :host([collapse-on-mobile][active]) .scrim {\n display: none;\n }\n\n :host([responsive][active]) .search-container,\n :host([collapse-on-mobile][active]) .search-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n border-radius: 0;\n box-shadow: none;\n z-index: 99999;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n }\n\n :host([responsive][active]) .suggestions-container,\n :host([collapse-on-mobile][active]) .suggestions-container {\n flex: 1;\n max-height: calc(100vh - 57px);\n max-height: calc(100dvh - 57px);\n }\n }\n\n /* Forced Fullscreen attribute */\n :host([fullscreen][active]) {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n z-index: 99999;\n }\n\n :host([fullscreen][active]) .search-trigger-container {\n display: none;\n }\n\n :host([fullscreen][active]) .scrim {\n display: none;\n }\n\n :host([fullscreen][active]) .search-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n border-radius: 0;\n box-shadow: none;\n z-index: 99999;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n }\n\n :host([fullscreen][active]) .suggestions-container {\n flex: 1;\n max-height: calc(100vh - 57px);\n max-height: calc(100dvh - 57px);\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { MdFormAssociatedElement } from '../../internal/form-associated.js';\nimport '../icon/icon.js';\nimport { searchBarStyles } from './search-bar.css.js';\n\nexport interface SearchSuggestion {\n id?: string;\n label: string;\n value?: string;\n supportingText?: string;\n trailingSupportingText?: string;\n icon?: string;\n [key: string]: unknown;\n}\n\n@customElement('md-search-bar')\nexport class MdSearchBar extends MdFormAssociatedElement {\n static override styles = [MdFormAssociatedElement.styles, searchBarStyles];\n\n @property({ type: String })\n value = '';\n\n @property({ type: String })\n placeholder = 'Search';\n\n @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Array })\n suggestions: Array<string | SearchSuggestion> = [];\n\n @property({ type: String, attribute: 'leading-icon' })\n leadingIcon = 'search';\n\n @property({ type: String, attribute: 'active-leading-icon' })\n activeLeadingIcon = 'arrow_back';\n\n @property({ type: String, attribute: 'trailing-icon' })\n trailingIcon = '';\n\n @property({ type: Boolean, attribute: 'show-back-button' })\n showBackButton = true;\n\n @property({ type: Boolean, attribute: 'show-clear-button' })\n showClearButton = true;\n\n @property({ type: Boolean, reflect: true })\n responsive = true;\n\n @property({ type: Boolean, attribute: 'collapse-on-mobile', reflect: true })\n collapseOnMobile = true;\n\n @property({ type: Boolean, reflect: true })\n fullscreen = false;\n\n @property({ type: Boolean, attribute: 'auto-deactivate-on-select' })\n autoDeactivateOnSelect = true;\n\n @state()\n private highlightedIndex = -1;\n\n @query('input')\n private inputElement?: HTMLInputElement;\n\n override connectedCallback() {\n super.connectedCallback();\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.toggleAttribute('active', this.active);\n this.toggleAttribute('collapse-on-mobile', this.collapseOnMobile);\n }\n\n override willUpdate(changedProperties: Map<string, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('value')) {\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n }\n if (changedProperties.has('active')) {\n this.toggleAttribute('active', this.active);\n if (!this.active) {\n this.highlightedIndex = -1;\n }\n }\n if (changedProperties.has('collapseOnMobile')) {\n this.toggleAttribute('collapse-on-mobile', this.collapseOnMobile);\n }\n }\n\n override formResetCallback() {\n this.value = '';\n this.setFormValue(null);\n this.toggleAttribute('has-value', false);\n this.highlightedIndex = -1;\n }\n\n /**\n * Focuses the search input field.\n */\n override focus() {\n this.inputElement?.focus();\n }\n\n /**\n * Opens / activates the search view.\n */\n show() {\n if (!this.active) {\n this.active = true;\n this.emitEvent('active-change', { active: true });\n }\n this.updateComplete.then(() => {\n this.inputElement?.focus();\n });\n }\n\n /**\n * Alias for show()\n */\n open() {\n this.show();\n }\n\n /**\n * Closes / deactivates the search view.\n */\n close() {\n if (this.active) {\n this.active = false;\n this.highlightedIndex = -1;\n this.emitEvent('active-change', { active: false });\n }\n }\n\n /**\n * Alias for close()\n */\n collapse() {\n this.close();\n }\n\n /**\n * Toggles the active state of the search bar.\n */\n toggle() {\n if (this.active) {\n this.close();\n } else {\n this.show();\n }\n }\n\n /**\n * Clears the current search input.\n */\n clear() {\n this.value = '';\n this.setFormValue('');\n this.toggleAttribute('has-value', false);\n this.highlightedIndex = -1;\n this.emitEvent('input', { value: '' });\n this.emitEvent('clear');\n this.inputElement?.focus();\n }\n\n private handleFocus = () => {\n if (!this.active) {\n this.active = true;\n this.emitEvent('active-change', { active: true });\n }\n };\n\n private handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.value = target.value;\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.highlightedIndex = -1;\n this.emitEvent('input', { value: this.value });\n };\n\n private handleChange = () => {\n this.emitEvent('change', { value: this.value });\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const count = this.suggestions.length;\n\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n this.inputElement?.blur();\n return;\n }\n\n if (event.key === 'ArrowDown') {\n if (!this.active) {\n this.show();\n return;\n }\n if (count > 0) {\n event.preventDefault();\n this.highlightedIndex = (this.highlightedIndex + 1) % count;\n }\n return;\n }\n\n if (event.key === 'ArrowUp') {\n if (count > 0 && this.active) {\n event.preventDefault();\n this.highlightedIndex = this.highlightedIndex <= 0 ? count - 1 : this.highlightedIndex - 1;\n }\n return;\n }\n\n if (event.key === 'Enter') {\n if (this.active && this.highlightedIndex >= 0 && this.highlightedIndex < count) {\n const item = this.suggestions[this.highlightedIndex];\n if (item !== undefined) {\n event.preventDefault();\n this.selectSuggestion(item, this.highlightedIndex);\n }\n } else {\n this.emitEvent('search', { value: this.value });\n }\n }\n };\n\n private handleTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.show();\n };\n\n private handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.show();\n }\n };\n\n private handleTrailingTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n const allowed = this.emitEvent('trailing-icon-click', { icon: this.trailingIcon });\n if (allowed) {\n this.show();\n }\n };\n\n private handleBackClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.close();\n };\n\n private handleScrimClick = () => {\n this.close();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clear();\n };\n\n private selectSuggestion(suggestion: string | SearchSuggestion, index: number) {\n const label = typeof suggestion === 'string' ? suggestion : suggestion.label;\n const value = typeof suggestion === 'string' ? suggestion : (suggestion.value ?? suggestion.label);\n\n this.value = value;\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.emitEvent('suggestion-select', { suggestion, label, value, index });\n this.emitEvent('search', { value: this.value, suggestion });\n\n if (this.autoDeactivateOnSelect) {\n this.close();\n }\n }\n\n private renderSuggestionItem(suggestion: string | SearchSuggestion, index: number) {\n const isString = typeof suggestion === 'string';\n const label = isString ? suggestion : suggestion.label;\n const supportingText = !isString ? suggestion.supportingText : undefined;\n const trailingSupportingText = !isString ? suggestion.trailingSupportingText : undefined;\n const iconName = !isString && suggestion.icon ? suggestion.icon : 'history';\n const isHighlighted = this.highlightedIndex === index;\n\n return html`\n <div\n class=\"suggestion-item ${isHighlighted ? 'highlighted' : ''}\"\n role=\"option\"\n aria-selected=${isHighlighted ? 'true' : 'false'}\n @click=${() => this.selectSuggestion(suggestion, index)}\n >\n <span class=\"suggestion-icon\">\n <md-icon name=${iconName}></md-icon>\n </span>\n <div class=\"suggestion-text\">\n <span class=\"suggestion-label\">${label}</span>\n ${supportingText ? html`<span class=\"suggestion-supporting\">${supportingText}</span>` : nothing}\n </div>\n ${trailingSupportingText ? html`<span class=\"suggestion-trailing\">${trailingSupportingText}</span>` : nothing}\n </div>\n `;\n }\n\n override render() {\n const showBack = this.active && this.showBackButton;\n const hasTrailing = Boolean(this.trailingIcon);\n\n return html`\n <div\n class=\"search-trigger-container ${hasTrailing ? 'has-trailing' : ''}\"\n role=\"button\"\n tabindex=\"0\"\n aria-label=${this.placeholder || 'Search'}\n title=${this.placeholder || 'Search'}\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n >\n <button\n class=\"trigger-btn\"\n type=\"button\"\n aria-label=${this.placeholder || 'Search'}\n title=${this.placeholder || 'Search'}\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n >\n <md-icon name=${this.leadingIcon || 'search'}></md-icon>\n </button>\n\n ${hasTrailing\n ? html`\n <div class=\"trigger-divider\" aria-hidden=\"true\"></div>\n <button\n class=\"trigger-btn trigger-trailing-btn\"\n type=\"button\"\n aria-label=${this.trailingIcon}\n title=${this.trailingIcon}\n ?disabled=${this.disabled}\n @click=${this.handleTrailingTriggerClick}\n >\n <md-icon name=${this.trailingIcon}></md-icon>\n </button>\n `\n : nothing}\n </div>\n\n <div class=\"scrim\" @click=${this.handleScrimClick}></div>\n\n <div class=\"search-container\" role=\"search\">\n <div class=\"search-bar-header\">\n <span class=\"leading-slot\">\n <slot name=\"leading-icon\">\n ${showBack\n ? html`\n <button\n class=\"icon-btn\"\n type=\"button\"\n aria-label=\"Back\"\n @click=${this.handleBackClick}\n >\n <md-icon name=${this.activeLeadingIcon}></md-icon>\n </button>\n `\n : html`\n <span class=\"icon-btn\" style=\"cursor: default;\">\n <md-icon name=${this.leadingIcon}></md-icon>\n </span>\n `}\n </slot>\n </span>\n\n <div class=\"input-wrapper\">\n <input\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=${this.active ? 'true' : 'false'}\n aria-label=${this.placeholder}\n placeholder=${this.placeholder}\n .value=${this.value}\n ?disabled=${this.disabled}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @click=${this.handleFocus}\n />\n </div>\n\n <span class=\"trailing-slot\">\n ${this.showClearButton && this.value\n ? html`\n <button\n class=\"icon-btn clear-btn\"\n type=\"button\"\n aria-label=\"Clear search\"\n @click=${this.handleClearClick}\n >\n <md-icon name=\"close\"></md-icon>\n </button>\n `\n : nothing}\n\n <slot name=\"trailing-icon\">\n ${this.trailingIcon\n ? html`\n <span class=\"icon-btn\" style=\"cursor: default;\">\n <md-icon name=${this.trailingIcon}></md-icon>\n </span>\n `\n : nothing}\n </slot>\n </span>\n </div>\n\n <div class=\"divider\"></div>\n\n <div class=\"suggestions-container\" role=\"listbox\" aria-label=\"Suggestions\">\n <slot name=\"suggestions\">\n ${this.suggestions.map((item, idx) => this.renderSuggestionItem(item, idx))}\n </slot>\n <div class=\"extra-content\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\n@customElement('md-search')\nexport class MdSearch extends MdSearchBar {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-search-bar': MdSearchBar;\n 'md-search': MdSearch;\n }\n}\n"],"mappings":";;;;;AAEA,IAAa,IAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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1E,EAAA,CAAA,EAAS;AAAA,EAAE,MAAM;AAAA,EAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,MAAA;AAGzC,EAAA,CAAA,EAAS;AAAA,EAAE,MAAM;AAAA,EAAS,WAAW;AAA4B,CAAC,CAAA,GAAA,EAAA,WAAA,0BAAA,MAAA;AAGlE,EAAA,CAAA,EAAM,CAAA,GAAA,EAAA,WAAA,oBAAA,MAAA;AAGN,EAAA,CAAA,EAAM,OAAO,CAAA,GAAA,EAAA,WAAA,gBAAA,MAAA;AA9Cf,IAAA,EAAA,CAAA,EAAc,eAAe,CAAA,GAAA,CAAA;AAiavB,IAAM,IAAN,cAAuB,EAAY;AAAC;AAD1C,IAAA,EAAA,CAAA,EAAc,WAAW,CAAA,GAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.css.d.ts","sourceRoot":"","sources":["../../../src/components/search-bar/search-bar.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"search-bar.css.d.ts","sourceRoot":"","sources":["../../../src/components/search-bar/search-bar.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,yBA0a3B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import { MdNavBar as Ca, MdNavigationBar as va } from "./components/navigation-b
|
|
|
31
31
|
import { n as Pa, t as ka } from "./chunks/navigation-rail-item-6pdhNHJK.js";
|
|
32
32
|
import { MdNavRail as Ra, MdNavigationRail as wa } from "./components/navigation-rail/navigation-rail.js";
|
|
33
33
|
import { a as Fa, c as La, i as Ha, l as xa, n as Ea, o as Va, r as Ga, s as _a, t as Wa, u as Ya } from "./chunks/table-CqHnneAj.js";
|
|
34
|
-
import { n as qa, t as za } from "./chunks/search-bar-
|
|
34
|
+
import { n as qa, t as za } from "./chunks/search-bar-fUD0qU2P.js";
|
|
35
35
|
import { n as Ka, t as Oa } from "./chunks/code-C5UFBkCh.js";
|
|
36
36
|
import { i as Ua, n as Xa, r as Za, t as $a } from "./chunks/player-C4ydiIpr.js";
|
|
37
37
|
import { a as oo, i as ro, n as to, o as mo, r as eo, t as io } from "./chunks/app-drawer-Du1ePzxZ.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar-TXnqJ-gd.js","names":[],"sources":["../../src/components/search-bar/search-bar.css.ts","../../src/components/search-bar/search-bar.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const searchBarStyles = css`\n :host {\n display: block;\n box-sizing: border-box;\n position: relative;\n width: 100%;\n max-width: var(--md-search-bar-max-width, 100%);\n font-family: var(--md-sys-typescale-font-family, inherit);\n color: var(--md-sys-color-on-surface, #1D1B20);\n vertical-align: middle;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.38;\n }\n\n .scrim {\n display: none;\n }\n\n /* Scrim when active in docked mode to catch outside clicks */\n :host([active]) .scrim {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 40;\n background: transparent;\n }\n\n .search-container {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n border-radius: var(--md-sys-shape-corner-full, 28px);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),\n border-radius 200ms cubic-bezier(0.2, 0, 0, 1),\n background-color 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n .search-bar-header {\n display: flex;\n align-items: center;\n min-height: 56px;\n height: 56px;\n padding: 0 8px 0 16px;\n box-sizing: border-box;\n gap: 8px;\n }\n\n .leading-slot, .trailing-slot {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border: none;\n background: transparent;\n border-radius: 50%;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n cursor: pointer;\n padding: 0;\n outline: none;\n position: relative;\n transition: background-color 150ms ease;\n }\n\n .icon-btn:hover {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .icon-btn:focus-visible {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .input-wrapper {\n display: flex;\n flex: 1;\n min-width: 0;\n align-items: center;\n position: relative;\n }\n\n input {\n width: 100%;\n border: none;\n background: transparent;\n outline: none;\n font-family: inherit;\n font-size: var(--md-sys-typescale-body-large-size, 16px);\n line-height: var(--md-sys-typescale-body-large-line-height, 24px);\n color: var(--md-sys-color-on-surface, #1D1B20);\n padding: 0 4px;\n margin: 0;\n box-sizing: border-box;\n }\n\n input::placeholder {\n color: var(--md-sys-color-on-surface-variant, #49454F);\n opacity: 0.8;\n }\n\n /* Active Docked Mode */\n :host([active]) .search-container {\n z-index: 50;\n border-radius: var(--md-sys-shape-corner-extra-large, 28px 28px 16px 16px);\n box-shadow: var(--md-sys-elevation-level3, 0px 4px 8px 3px rgba(0, 0, 0, 0.15));\n }\n\n /* Divider when active */\n .divider {\n display: none;\n height: 1px;\n background-color: var(--md-sys-color-outline-variant, #CAC4D0);\n margin: 0 16px;\n }\n\n :host([active]) .divider {\n display: block;\n }\n\n /* Suggestions / Content Container */\n .suggestions-container {\n display: none;\n flex-direction: column;\n max-height: 360px;\n overflow-y: auto;\n padding: 8px 0;\n box-sizing: border-box;\n }\n\n :host([active]) .suggestions-container {\n display: flex;\n }\n\n .suggestion-item {\n display: flex;\n align-items: center;\n min-height: 48px;\n padding: 0 16px;\n gap: 16px;\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n user-select: none;\n color: var(--md-sys-color-on-surface, #1D1B20);\n transition: background-color 150ms ease;\n }\n\n .suggestion-item:hover,\n .suggestion-item.highlighted {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .suggestion-item.selected {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .suggestion-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n flex-shrink: 0;\n }\n\n .suggestion-text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n overflow: hidden;\n }\n\n .suggestion-label {\n font-size: var(--md-sys-typescale-body-large-size, 16px);\n line-height: 20px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .suggestion-supporting {\n font-size: var(--md-sys-typescale-body-medium-size, 14px);\n line-height: 16px;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-top: 2px;\n }\n\n .suggestion-trailing {\n font-size: var(--md-sys-typescale-body-medium-size, 14px);\n color: var(--md-sys-color-on-surface-variant, #49454F);\n flex-shrink: 0;\n }\n\n .search-trigger-container {\n display: none;\n }\n\n /* Responsive Fullscreen / Mobile Collapsed Mode */\n @media (max-width: 768px) {\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])),\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) {\n display: inline-flex;\n width: auto;\n max-width: none;\n vertical-align: middle;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border-radius: 50%;\n box-shadow: none;\n cursor: pointer;\n user-select: none;\n outline: none;\n transition: background-color 200ms ease, box-shadow 200ms ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing {\n height: 48px;\n padding: 0 4px;\n gap: 2px;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n border-radius: var(--md-sys-shape-corner-full, 28px);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing:hover,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container.has-trailing:hover {\n box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0, 0, 0, 0.15));\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container:focus-visible,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-trigger-container:focus-visible {\n outline: 2px solid var(--md-sys-color-primary, #6750A4);\n outline-offset: 2px;\n }\n\n .trigger-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n border-radius: 50%;\n border: none;\n background: transparent;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n cursor: pointer;\n padding: 0;\n margin: 0;\n outline: none;\n position: relative;\n transition: background-color 150ms ease, color 150ms ease;\n -webkit-tap-highlight-color: transparent;\n }\n\n .trigger-btn:hover {\n background-color: rgba(73, 69, 79, 0.08);\n }\n\n .trigger-btn:focus-visible {\n background-color: rgba(73, 69, 79, 0.12);\n }\n\n .trigger-divider {\n width: 1px;\n height: 22px;\n background-color: var(--md-sys-color-outline-variant, #CAC4D0);\n margin: 0 2px;\n flex-shrink: 0;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .search-container,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .search-container {\n display: none;\n }\n\n :host([responsive]:not([active]):not([collapse-on-mobile=\"false\"])) .scrim,\n :host([collapse-on-mobile]:not([active]):not([collapse-on-mobile=\"false\"])) .scrim {\n display: none;\n }\n\n :host([responsive][active]),\n :host([collapse-on-mobile][active]) {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n margin: 0;\n padding: 0;\n z-index: 99999;\n }\n\n :host([responsive][active]) .search-trigger-container,\n :host([collapse-on-mobile][active]) .search-trigger-container {\n display: none;\n }\n\n :host([responsive][active]) .scrim,\n :host([collapse-on-mobile][active]) .scrim {\n display: none;\n }\n\n :host([responsive][active]) .search-container,\n :host([collapse-on-mobile][active]) .search-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n border-radius: 0;\n box-shadow: none;\n z-index: 99999;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n }\n\n :host([responsive][active]) .suggestions-container,\n :host([collapse-on-mobile][active]) .suggestions-container {\n flex: 1;\n max-height: calc(100vh - 57px);\n max-height: calc(100dvh - 57px);\n }\n }\n\n /* Forced Fullscreen attribute */\n :host([fullscreen][active]) {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n z-index: 99999;\n }\n\n :host([fullscreen][active]) .search-trigger-container {\n display: none;\n }\n\n :host([fullscreen][active]) .scrim {\n display: none;\n }\n\n :host([fullscreen][active]) .search-container {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n max-width: 100vw;\n border-radius: 0;\n box-shadow: none;\n z-index: 99999;\n background-color: var(--md-search-bar-container-color, var(--md-sys-color-surface-container-high, #ECE6F0));\n }\n\n :host([fullscreen][active]) .suggestions-container {\n flex: 1;\n max-height: calc(100vh - 57px);\n max-height: calc(100dvh - 57px);\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { MdFormAssociatedElement } from '../../internal/form-associated.js';\nimport '../icon/icon.js';\nimport { searchBarStyles } from './search-bar.css.js';\n\nexport interface SearchSuggestion {\n id?: string;\n label: string;\n value?: string;\n supportingText?: string;\n trailingSupportingText?: string;\n icon?: string;\n [key: string]: unknown;\n}\n\n@customElement('md-search-bar')\nexport class MdSearchBar extends MdFormAssociatedElement {\n static override styles = [MdFormAssociatedElement.styles, searchBarStyles];\n\n @property({ type: String })\n value = '';\n\n @property({ type: String })\n placeholder = 'Search';\n\n @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Array })\n suggestions: Array<string | SearchSuggestion> = [];\n\n @property({ type: String, attribute: 'leading-icon' })\n leadingIcon = 'search';\n\n @property({ type: String, attribute: 'active-leading-icon' })\n activeLeadingIcon = 'arrow_back';\n\n @property({ type: String, attribute: 'trailing-icon' })\n trailingIcon = '';\n\n @property({ type: Boolean, attribute: 'show-back-button' })\n showBackButton = true;\n\n @property({ type: Boolean, attribute: 'show-clear-button' })\n showClearButton = true;\n\n @property({ type: Boolean, reflect: true })\n responsive = true;\n\n @property({ type: Boolean, attribute: 'collapse-on-mobile', reflect: true })\n collapseOnMobile = true;\n\n @property({ type: Boolean, reflect: true })\n fullscreen = false;\n\n @property({ type: Boolean, attribute: 'auto-deactivate-on-select' })\n autoDeactivateOnSelect = true;\n\n @state()\n private highlightedIndex = -1;\n\n @query('input')\n private inputElement?: HTMLInputElement;\n\n override connectedCallback() {\n super.connectedCallback();\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.toggleAttribute('active', this.active);\n this.toggleAttribute('collapse-on-mobile', this.collapseOnMobile);\n }\n\n override willUpdate(changedProperties: Map<string, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('value')) {\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n }\n if (changedProperties.has('active')) {\n this.toggleAttribute('active', this.active);\n if (!this.active) {\n this.highlightedIndex = -1;\n }\n }\n if (changedProperties.has('collapseOnMobile')) {\n this.toggleAttribute('collapse-on-mobile', this.collapseOnMobile);\n }\n }\n\n override formResetCallback() {\n this.value = '';\n this.setFormValue(null);\n this.toggleAttribute('has-value', false);\n this.highlightedIndex = -1;\n }\n\n /**\n * Focuses the search input field.\n */\n override focus() {\n this.inputElement?.focus();\n }\n\n /**\n * Opens / activates the search view.\n */\n show() {\n if (!this.active) {\n this.active = true;\n this.emitEvent('active-change', { active: true });\n }\n this.updateComplete.then(() => {\n this.inputElement?.focus();\n });\n }\n\n /**\n * Alias for show()\n */\n open() {\n this.show();\n }\n\n /**\n * Closes / deactivates the search view.\n */\n close() {\n if (this.active) {\n this.active = false;\n this.highlightedIndex = -1;\n this.emitEvent('active-change', { active: false });\n }\n }\n\n /**\n * Alias for close()\n */\n collapse() {\n this.close();\n }\n\n /**\n * Toggles the active state of the search bar.\n */\n toggle() {\n if (this.active) {\n this.close();\n } else {\n this.show();\n }\n }\n\n /**\n * Clears the current search input.\n */\n clear() {\n this.value = '';\n this.setFormValue('');\n this.toggleAttribute('has-value', false);\n this.highlightedIndex = -1;\n this.emitEvent('input', { value: '' });\n this.emitEvent('clear');\n this.inputElement?.focus();\n }\n\n private handleFocus = () => {\n if (!this.active) {\n this.active = true;\n this.emitEvent('active-change', { active: true });\n }\n };\n\n private handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.value = target.value;\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.highlightedIndex = -1;\n this.emitEvent('input', { value: this.value });\n };\n\n private handleChange = () => {\n this.emitEvent('change', { value: this.value });\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const count = this.suggestions.length;\n\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n this.inputElement?.blur();\n return;\n }\n\n if (event.key === 'ArrowDown') {\n if (!this.active) {\n this.show();\n return;\n }\n if (count > 0) {\n event.preventDefault();\n this.highlightedIndex = (this.highlightedIndex + 1) % count;\n }\n return;\n }\n\n if (event.key === 'ArrowUp') {\n if (count > 0 && this.active) {\n event.preventDefault();\n this.highlightedIndex = this.highlightedIndex <= 0 ? count - 1 : this.highlightedIndex - 1;\n }\n return;\n }\n\n if (event.key === 'Enter') {\n if (this.active && this.highlightedIndex >= 0 && this.highlightedIndex < count) {\n const item = this.suggestions[this.highlightedIndex];\n if (item !== undefined) {\n event.preventDefault();\n this.selectSuggestion(item, this.highlightedIndex);\n }\n } else {\n this.emitEvent('search', { value: this.value });\n }\n }\n };\n\n private handleTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.show();\n };\n\n private handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.show();\n }\n };\n\n private handleTrailingTriggerClick = (event: MouseEvent) => {\n event.stopPropagation();\n const allowed = this.emitEvent('trailing-icon-click', { icon: this.trailingIcon });\n if (allowed) {\n this.show();\n }\n };\n\n private handleBackClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.close();\n };\n\n private handleScrimClick = () => {\n this.close();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clear();\n };\n\n private selectSuggestion(suggestion: string | SearchSuggestion, index: number) {\n const label = typeof suggestion === 'string' ? suggestion : suggestion.label;\n const value = typeof suggestion === 'string' ? suggestion : (suggestion.value ?? suggestion.label);\n\n this.value = value;\n this.setFormValue(this.value);\n this.toggleAttribute('has-value', Boolean(this.value));\n this.emitEvent('suggestion-select', { suggestion, label, value, index });\n this.emitEvent('search', { value: this.value, suggestion });\n\n if (this.autoDeactivateOnSelect) {\n this.close();\n }\n }\n\n private renderSuggestionItem(suggestion: string | SearchSuggestion, index: number) {\n const isString = typeof suggestion === 'string';\n const label = isString ? suggestion : suggestion.label;\n const supportingText = !isString ? suggestion.supportingText : undefined;\n const trailingSupportingText = !isString ? suggestion.trailingSupportingText : undefined;\n const iconName = !isString && suggestion.icon ? suggestion.icon : 'history';\n const isHighlighted = this.highlightedIndex === index;\n\n return html`\n <div\n class=\"suggestion-item ${isHighlighted ? 'highlighted' : ''}\"\n role=\"option\"\n aria-selected=${isHighlighted ? 'true' : 'false'}\n @click=${() => this.selectSuggestion(suggestion, index)}\n >\n <span class=\"suggestion-icon\">\n <md-icon name=${iconName}></md-icon>\n </span>\n <div class=\"suggestion-text\">\n <span class=\"suggestion-label\">${label}</span>\n ${supportingText ? html`<span class=\"suggestion-supporting\">${supportingText}</span>` : nothing}\n </div>\n ${trailingSupportingText ? html`<span class=\"suggestion-trailing\">${trailingSupportingText}</span>` : nothing}\n </div>\n `;\n }\n\n override render() {\n const showBack = this.active && this.showBackButton;\n const hasTrailing = Boolean(this.trailingIcon);\n\n return html`\n <div\n class=\"search-trigger-container ${hasTrailing ? 'has-trailing' : ''}\"\n role=\"button\"\n tabindex=\"0\"\n aria-label=${this.placeholder || 'Search'}\n title=${this.placeholder || 'Search'}\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n >\n <button\n class=\"trigger-btn\"\n type=\"button\"\n aria-label=${this.placeholder || 'Search'}\n title=${this.placeholder || 'Search'}\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n >\n <md-icon name=${this.leadingIcon || 'search'}></md-icon>\n </button>\n\n ${hasTrailing\n ? html`\n <div class=\"trigger-divider\" aria-hidden=\"true\"></div>\n <button\n class=\"trigger-btn trigger-trailing-btn\"\n type=\"button\"\n aria-label=${this.trailingIcon}\n title=${this.trailingIcon}\n ?disabled=${this.disabled}\n @click=${this.handleTrailingTriggerClick}\n >\n <md-icon name=${this.trailingIcon}></md-icon>\n </button>\n `\n : nothing}\n </div>\n\n <div class=\"scrim\" @click=${this.handleScrimClick}></div>\n\n <div class=\"search-container\" role=\"search\">\n <div class=\"search-bar-header\">\n <span class=\"leading-slot\">\n <slot name=\"leading-icon\">\n ${showBack\n ? html`\n <button\n class=\"icon-btn\"\n type=\"button\"\n aria-label=\"Back\"\n @click=${this.handleBackClick}\n >\n <md-icon name=${this.activeLeadingIcon}></md-icon>\n </button>\n `\n : html`\n <span class=\"icon-btn\" style=\"cursor: default;\">\n <md-icon name=${this.leadingIcon}></md-icon>\n </span>\n `}\n </slot>\n </span>\n\n <div class=\"input-wrapper\">\n <input\n type=\"search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=${this.active ? 'true' : 'false'}\n aria-label=${this.placeholder}\n placeholder=${this.placeholder}\n .value=${this.value}\n ?disabled=${this.disabled}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @click=${this.handleFocus}\n />\n </div>\n\n <span class=\"trailing-slot\">\n ${this.showClearButton && this.value\n ? html`\n <button\n class=\"icon-btn clear-btn\"\n type=\"button\"\n aria-label=\"Clear search\"\n @click=${this.handleClearClick}\n >\n <md-icon name=\"close\"></md-icon>\n </button>\n `\n : nothing}\n\n <slot name=\"trailing-icon\">\n ${this.trailingIcon\n ? html`\n <span class=\"icon-btn\" style=\"cursor: default;\">\n <md-icon name=${this.trailingIcon}></md-icon>\n </span>\n `\n : nothing}\n </slot>\n </span>\n </div>\n\n <div class=\"divider\"></div>\n\n <div class=\"suggestions-container\" role=\"listbox\" aria-label=\"Suggestions\">\n <slot name=\"suggestions\">\n ${this.suggestions.map((item, idx) => this.renderSuggestionItem(item, idx))}\n </slot>\n <div class=\"extra-content\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n}\n\n@customElement('md-search')\nexport class MdSearch extends MdSearchBar {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-search-bar': MdSearchBar;\n 'md-search': MdSearch;\n }\n}\n"],"mappings":";;;;;AAEA,IAAa,IAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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