@fluid-topics/ft-search-input 1.1.106 → 1.1.107

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.
@@ -30,7 +30,7 @@ class FtSearchInput extends withI18n(FtSearchComponent) {
30
30
  "ft-search-input--with-suggestions-closed": this.forceCloseSuggestion,
31
31
  };
32
32
  return html `
33
- <div class="${classMap(classes)}" @focusout=${() => this.forceCloseSuggestion = false}>
33
+ <div class="${classMap(classes)}" @focusout=${() => this.forceCloseSuggestion = false} role="search">
34
34
  <div class="ft-search-input--input-container" part="input-container" tabindex="-1">
35
35
  <div class="ft-search-input--input-outline" part="input-outline">
36
36
  <input class="ft-search-input--input ft-typography--body2"
@@ -972,7 +972,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
972
972
  `}onSuggestKeyDown(t){var o,n,i,a,s,l;switch(t.key){case"ArrowUp":(i=(n=(o=this.getFocusedSuggestionElement())===null||o===void 0?void 0:o.previousElementSibling)!==null&&n!==void 0?n:this.getLastSuggestionElement())===null||i===void 0||i.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":(l=(s=(a=this.getFocusedSuggestionElement())===null||a===void 0?void 0:a.nextElementSibling)!==null&&s!==void 0?s:this.getFirstSuggestionElement())===null||l===void 0||l.focus(),t.preventDefault(),t.stopPropagation();break}}onSuggestKeyUp(t,o){(t.key==="Enter"||t.key===" ")&&this.onSuggestSelected(t,o)}onSuggestSelected(t,o){t.preventDefault(),this.dispatchEvent(new wn(o))}getIcon(t){let o=t.type==="DOCUMENT"?be.file_format:be.fluid_topics,n;switch(t.type){case"MAP":n=t.editorialType==="BOOK"?Xe.BOOK:Xe.ARTICLE;break;case"DOCUMENT":n=Pa(t.mimeType,t.filenameExtension);break;case"TOPIC":n=Xe.TOPICS;break}return fo.html`
973
973
  <ft-icon .variant="${o}" .value="${n}" part="suggestion-icon"></ft-icon>
974
974
  `}getFocusedSuggestionElement(){return this.shadowRoot.querySelector(".ft-search-input-suggestion--suggestion:focus-within")}getLastSuggestionElement(){let t=this.shadowRoot.querySelectorAll(".ft-search-input-suggestion--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.shadowRoot.querySelector(".ft-search-input-suggestion--suggestion")}focusFirstSuggestion(){var t;(t=this.getFirstSuggestionElement())===null||t===void 0||t.focus()}};vt.elementDefinitions={"ft-ripple":F,"ft-typography":ye,"ft-icon":he};vt.styles=[ho.wordWrap,dc];hc([(0,ho.redux)()],vt.prototype,"suggestResults",void 0);vt=hc([(0,mc.customElement)("ft-search-input-suggestion")],vt);var jt=function(e,t,o,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(i<3?s(a):i>3?s(t,o,a):s(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},Ce=class extends so(Gt){constructor(){super(),this.liveQuery="",this.forceCloseSuggestion=!1,this.addI18nContext(yr)}render(){var t,o;let n={"ft-search-input":!0,"ft-search-input--with-suggestions":(o=(t=this.suggestResults)===null||t===void 0?void 0:t.length)!==null&&o!==void 0?o:!1,"ft-search-input--with-suggestions-closed":this.forceCloseSuggestion};return An.html`
975
- <div class="${(0,gc.classMap)(n)}" @focusout=${()=>this.forceCloseSuggestion=!1}>
975
+ <div class="${(0,gc.classMap)(n)}" @focusout=${()=>this.forceCloseSuggestion=!1} role="search">
976
976
  <div class="ft-search-input--input-container" part="input-container" tabindex="-1">
977
977
  <div class="ft-search-input--input-outline" part="input-outline">
978
978
  <input class="ft-search-input--input ft-typography--body2"
@@ -1017,7 +1017,7 @@ Also for action icons.`,u.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
1017
1017
  `}onSuggestKeyDown(e){var r,n,i,a,s,c;switch(e.key){case"ArrowUp":(i=(n=(r=this.getFocusedSuggestionElement())===null||r===void 0?void 0:r.previousElementSibling)!==null&&n!==void 0?n:this.getLastSuggestionElement())===null||i===void 0||i.focus(),e.preventDefault(),e.stopPropagation();break;case"ArrowDown":(c=(s=(a=this.getFocusedSuggestionElement())===null||a===void 0?void 0:a.nextElementSibling)!==null&&s!==void 0?s:this.getFirstSuggestionElement())===null||c===void 0||c.focus(),e.preventDefault(),e.stopPropagation();break}}onSuggestKeyUp(e,r){(e.key==="Enter"||e.key===" ")&&this.onSuggestSelected(e,r)}onSuggestSelected(e,r){e.preventDefault(),this.dispatchEvent(new $a(r))}getIcon(e){let r=e.type==="DOCUMENT"?Oe.file_format:Oe.fluid_topics,n;switch(e.type){case"MAP":n=e.editorialType==="BOOK"?ht.BOOK:ht.ARTICLE;break;case"DOCUMENT":n=fl(e.mimeType,e.filenameExtension);break;case"TOPIC":n=ht.TOPICS;break}return G`
1018
1018
  <ft-icon .variant="${r}" .value="${n}" part="suggestion-icon"></ft-icon>
1019
1019
  `}getFocusedSuggestionElement(){return this.shadowRoot.querySelector(".ft-search-input-suggestion--suggestion:focus-within")}getLastSuggestionElement(){let e=this.shadowRoot.querySelectorAll(".ft-search-input-suggestion--suggestion");return e.length>0?e[e.length-1]:null}getFirstSuggestionElement(){return this.shadowRoot.querySelector(".ft-search-input-suggestion--suggestion")}focusFirstSuggestion(){var e;(e=this.getFirstSuggestionElement())===null||e===void 0||e.focus()}};Ft.elementDefinitions={"ft-ripple":Y,"ft-typography":Se,"ft-icon":ye};Ft.styles=[Pi,Bl];Fl([De()],Ft.prototype,"suggestResults",void 0);Ft=Fl([mn("ft-search-input-suggestion")],Ft);var hr=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ce=class extends Xo(fr){constructor(){super(),this.liveQuery="",this.forceCloseSuggestion=!1,this.addI18nContext(Kr)}render(){var e,r;let n={"ft-search-input":!0,"ft-search-input--with-suggestions":(r=(e=this.suggestResults)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:!1,"ft-search-input--with-suggestions-closed":this.forceCloseSuggestion};return G`
1020
- <div class="${_t(n)}" @focusout=${()=>this.forceCloseSuggestion=!1}>
1020
+ <div class="${_t(n)}" @focusout=${()=>this.forceCloseSuggestion=!1} role="search">
1021
1021
  <div class="ft-search-input--input-container" part="input-container" tabindex="-1">
1022
1022
  <div class="ft-search-input--input-outline" part="input-outline">
1023
1023
  <input class="ft-search-input--input ft-typography--body2"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-input",
3
- "version": "1.1.106",
3
+ "version": "1.1.107",
4
4
  "description": "Search bar input for integrated search component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,17 +19,17 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-button": "1.1.106",
23
- "@fluid-topics/ft-i18n": "1.1.106",
24
- "@fluid-topics/ft-icon": "1.1.106",
25
- "@fluid-topics/ft-ripple": "1.1.106",
26
- "@fluid-topics/ft-search-context": "1.1.106",
27
- "@fluid-topics/ft-typography": "1.1.106",
28
- "@fluid-topics/ft-wc-utils": "1.1.106",
22
+ "@fluid-topics/ft-button": "1.1.107",
23
+ "@fluid-topics/ft-i18n": "1.1.107",
24
+ "@fluid-topics/ft-icon": "1.1.107",
25
+ "@fluid-topics/ft-ripple": "1.1.107",
26
+ "@fluid-topics/ft-search-context": "1.1.107",
27
+ "@fluid-topics/ft-typography": "1.1.107",
28
+ "@fluid-topics/ft-wc-utils": "1.1.107",
29
29
  "lit": "3.1.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@fluid-topics/public-api": "1.0.75"
33
33
  },
34
- "gitHead": "b03c232485cbcc99f64a7ad3aa2da39a0fa9f9ba"
34
+ "gitHead": "8dd7bc8f7eb8c278b8d3ac319694daa86f9ac9af"
35
35
  }