@fluid-topics/ft-search-input 2.2.46 → 2.2.47

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.
@@ -20,6 +20,7 @@ export declare class FtSearchInput extends FtSearchInput_base implements FtSearc
20
20
  selectedSuggestOptionRemove: boolean;
21
21
  launchSearchPath?: string;
22
22
  placeholder?: I18nAttributeValue;
23
+ ariaLabelI18n?: I18nAttributeValue;
23
24
  useCustomSearchPath: boolean;
24
25
  triggerSearchOnClear: boolean;
25
26
  focusOnDisplay: boolean;
@@ -45,7 +45,8 @@ export class FtSearchInput extends withI18n(FtSearchComponent) {
45
45
  this.addI18nContext(searchInputContext);
46
46
  }
47
47
  render() {
48
- var _a;
48
+ var _a, _b;
49
+ var _c, _d, _e;
49
50
  const hasSuggestions = this.suggestions.optionsCount() > 0;
50
51
  const classes = {
51
52
  "ft-search-input": true,
@@ -56,6 +57,7 @@ export class FtSearchInput extends withI18n(FtSearchComponent) {
56
57
  const searchPage = this.useCustomSearchPath ? this.launchSearchPath : undefined;
57
58
  const launchSearchUrl = SearchPlaceConverterProvider.get().serializeToCurrentPageIfPossible(liveRequest, searchPage);
58
59
  const displaySuggestions = !this.forceCloseSuggestion && this.displaySuggestListbox && hasSuggestions;
60
+ const placeholder = (_c = (_a = this.placeholder) === null || _a === void 0 ? void 0 : _a.message) !== null && _c !== void 0 ? _c : searchInputContext.messages.placeholder();
59
61
  return html `
60
62
  <div class="${classMap(classes)}" @focusout=${() => this.forceCloseSuggestion = false} role="search">
61
63
  <div class="ft-search-input--input-container" part="input-container" tabindex="-1">
@@ -63,13 +65,14 @@ export class FtSearchInput extends withI18n(FtSearchComponent) {
63
65
  <input class="ft-search-input--input ft-typography--body2"
64
66
  part="input"
65
67
  type="search"
66
- placeholder="${this.placeholder ? this.placeholder.message : searchInputContext.messages.placeholder()}"
68
+ placeholder="${placeholder}"
67
69
  .value=${this.liveQuery}
68
70
  role="combobox"
71
+ aria-label="${(_d = (_b = this.ariaLabelI18n) === null || _b === void 0 ? void 0 : _b.message) !== null && _d !== void 0 ? _d : placeholder}"
69
72
  aria-autocomplete="list"
70
73
  aria-controls="${this.suggestions.listboxId}"
71
- aria-expanded="${this.displaySuggestListbox}"
72
- aria-activedescendant="${(_a = this.suggestions.activeElementId) !== null && _a !== void 0 ? _a : nothing}"
74
+ aria-expanded="${displaySuggestions}"
75
+ aria-activedescendant="${(_e = this.suggestions.activeElementId) !== null && _e !== void 0 ? _e : nothing}"
73
76
  @input=${this.onInput}
74
77
  @click=${this.onClick}
75
78
  @focus=${this.onFocus}
@@ -275,6 +278,9 @@ __decorate([
275
278
  __decorate([
276
279
  i18nAttribute()
277
280
  ], FtSearchInput.prototype, "placeholder", void 0);
281
+ __decorate([
282
+ i18nAttribute()
283
+ ], FtSearchInput.prototype, "ariaLabelI18n", void 0);
278
284
  __decorate([
279
285
  property({ type: Boolean })
280
286
  ], FtSearchInput.prototype, "useCustomSearchPath", void 0);