@fluid-topics/ft-search-input 1.1.59 → 1.1.61
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.
|
@@ -10,11 +10,13 @@ export declare class FtSearchInput extends FtSearchInput_base implements FtSearc
|
|
|
10
10
|
private liveQuery;
|
|
11
11
|
private suggestResults?;
|
|
12
12
|
private forceCloseSuggestion;
|
|
13
|
+
private placeholder;
|
|
13
14
|
private input;
|
|
14
15
|
private suggestion;
|
|
15
16
|
protected render(): import("lit").TemplateResult<1>;
|
|
16
17
|
private onSearchBarKeyDown;
|
|
17
18
|
private onSearchBarKeyUp;
|
|
19
|
+
private onInput;
|
|
18
20
|
private launchSearch;
|
|
19
21
|
private onSuggestionSelected;
|
|
20
22
|
}
|
package/build/ft-search-input.js
CHANGED
|
@@ -10,7 +10,7 @@ import { styles } from "./ft-search-input.styles";
|
|
|
10
10
|
import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
|
|
11
11
|
import { withI18n } from "@fluid-topics/ft-i18n";
|
|
12
12
|
import { searchInputContext } from "./SearchInputMessages";
|
|
13
|
-
import { query, state } from "lit/decorators.js";
|
|
13
|
+
import { property, query, state } from "lit/decorators.js";
|
|
14
14
|
import { classMap } from "lit/directives/class-map.js";
|
|
15
15
|
import { FtSearchInputSuggestion } from "./ft-search-input-suggestion";
|
|
16
16
|
import { FtButton } from "@fluid-topics/ft-button";
|
|
@@ -20,6 +20,7 @@ class FtSearchInput extends withI18n(FtSearchComponent) {
|
|
|
20
20
|
super();
|
|
21
21
|
this.liveQuery = "";
|
|
22
22
|
this.forceCloseSuggestion = false;
|
|
23
|
+
this.placeholder = searchInputContext.messages.placeholder();
|
|
23
24
|
this.addI18nContext(searchInputContext);
|
|
24
25
|
}
|
|
25
26
|
render() {
|
|
@@ -36,8 +37,9 @@ class FtSearchInput extends withI18n(FtSearchComponent) {
|
|
|
36
37
|
<input class="ft-search-input--input ft-typography--body2"
|
|
37
38
|
part="input"
|
|
38
39
|
type="text"
|
|
39
|
-
placeholder="${
|
|
40
|
+
placeholder="${this.placeholder}"
|
|
40
41
|
.value="${this.liveQuery}"
|
|
42
|
+
@input=${(e) => this.onInput(e)}
|
|
41
43
|
@keydown=${(e) => this.onSearchBarKeyDown(e)}
|
|
42
44
|
@keyup=${(e) => this.onSearchBarKeyUp(e)}>
|
|
43
45
|
</div>
|
|
@@ -81,20 +83,22 @@ class FtSearchInput extends withI18n(FtSearchComponent) {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
onSearchBarKeyUp(e) {
|
|
84
|
-
var _a;
|
|
85
|
-
if (e.key === "Backspace") {
|
|
86
|
-
e.stopPropagation();
|
|
87
|
-
}
|
|
88
86
|
switch (e.key) {
|
|
87
|
+
case "Backspace":
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
break;
|
|
89
90
|
case "Enter":
|
|
90
91
|
this.launchSearch(this.input.value);
|
|
91
92
|
break;
|
|
92
93
|
default:
|
|
93
|
-
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.setLiveQuery(this.input.value);
|
|
94
|
-
this.forceCloseSuggestion = false;
|
|
95
94
|
break;
|
|
96
95
|
}
|
|
97
96
|
}
|
|
97
|
+
onInput(e) {
|
|
98
|
+
var _a;
|
|
99
|
+
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.setLiveQuery(this.input.value);
|
|
100
|
+
this.forceCloseSuggestion = false;
|
|
101
|
+
}
|
|
98
102
|
launchSearch(query) {
|
|
99
103
|
var _a;
|
|
100
104
|
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.setQuery(query);
|
|
@@ -125,6 +129,9 @@ __decorate([
|
|
|
125
129
|
__decorate([
|
|
126
130
|
state()
|
|
127
131
|
], FtSearchInput.prototype, "forceCloseSuggestion", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ type: String })
|
|
134
|
+
], FtSearchInput.prototype, "placeholder", void 0);
|
|
128
135
|
__decorate([
|
|
129
136
|
query(".ft-search-input--input")
|
|
130
137
|
], FtSearchInput.prototype, "input", void 0);
|
|
@@ -545,7 +545,7 @@ const Ko=Symbol.for(""),Ao=t=>{if(t?.r===Ko)return t?._$litStatic$},Do=t=>({_$li
|
|
|
545
545
|
</div>
|
|
546
546
|
</div>
|
|
547
547
|
</div>
|
|
548
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}async show(t){this.visible=!0,null!=t&&await this.hideDebounce.run((()=>{this.hide()}),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",async function(t,o,e){return Me(t,o,{platform:{...Pe,getOffsetParent:t=>Pe.getOffsetParent(t,Ge)},middleware:[(r={crossAxis:!0},void 0===r&&(r={}),{name:"shift",options:r,async fn(t){const{x:o,y:e,placement:i}=t,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=oe(r,t),s={x:o,y:e},p=await fe(t,c),f=ae(ee(i)),d=ie(f);let h=s[d],u=s[f];if(n){const t="y"===d?"bottom":"right";h=te(h+p["y"===d?"top":"left"],h,h-p[t])}if(a){const t="y"===f?"bottom":"right";u=te(u+p["y"===f?"top":"left"],u,u-p[t])}const g=l.fn({...t,[d]:h,[f]:u});return{...g,data:{x:g.x-o,y:g.y-e}}}}),he({allowedPlacements:[e]})]});var r}(this.slottedElement,this.tooltip,this.position).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}qe.elementDefinitions={"ft-typography":Po},qe.styles=Go,Ve([r.property()],qe.prototype,"text",void 0),Ve([r.property({type:Boolean})],qe.prototype,"manual",void 0),Ve([r.property({type:Boolean})],qe.prototype,"inline",void 0),Ve([r.property({type:Number})],qe.prototype,"delay",void 0),Ve([r.property()],qe.prototype,"position",void 0),Ve([r.queryAssignedNodes()],qe.prototype,"slotNodes",void 0),Ve([r.query(".ft-tooltip--container")],qe.prototype,"container",void 0),Ve([r.query(".ft-tooltip")],qe.prototype,"tooltip",void 0),Ve([r.query(".ft-tooltip--content")],qe.prototype,"tooltipContent",void 0),Ve([r.state()],qe.prototype,"visible",void 0),Ve([r.eventOptions({passive:!0})],qe.prototype,"onTouch",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onHover",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onOut",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onClick",null),o.customElement("ft-tooltip")(qe),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.CHART_BAR_NORMALIZED="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE="",t.OCTAGON_XMARK="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK="",t.CLONE="",t.CLONE_LINK_SIMPLE="",t.CONSUMER="",t.HOURGLASS_HALF="",t.CLOCK_THREE="",t.CALENDAR_DAY="",t.COMPUTER_MOUSE_MAGNIFYING_GLASS="",t.WAND_MAGIC_SPARKLES=""}(_e||(_e={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Ye||(Ye={}));const Xe=new Map([...["abw"].map((t=>[t,Ye.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Ye.AUDIO])),...["avi"].map((t=>[t,Ye.AVI])),...["chm","xhs"].map((t=>[t,Ye.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Ye.CODE])),...["csv"].map((t=>[t,Ye.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ye.DITA])),...["epub"].map((t=>[t,Ye.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ye.EXCEL])),...["flac"].map((t=>[t,Ye.FLAC])),...["gif"].map((t=>[t,Ye.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ye.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ye.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf","ico"].map((t=>[t,Ye.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ye.JPEG])),...["json"].map((t=>[t,Ye.JSON])),...["m4a","m4p"].map((t=>[t,Ye.M4A])),...["mov","qt"].map((t=>[t,Ye.MOV])),...["mp3"].map((t=>[t,Ye.MP3])),...["mp4","m4v"].map((t=>[t,Ye.MP4])),...["ogg","oga"].map((t=>[t,Ye.OGG])),...["pdf","ps"].map((t=>[t,Ye.PDF])),...["png"].map((t=>[t,Ye.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ye.POWERPOINT])),...["rar"].map((t=>[t,Ye.RAR])),...["stp"].map((t=>[t,Ye.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ye.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Ye.VIDEO])),...["wav"].map((t=>[t,Ye.WAV])),...["wma"].map((t=>[t,Ye.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ye.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ye.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ye.YAML])),...["zip"].map((t=>[t,Ye.ZIP]))]),Je=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var Qe;Ye.ABW,Ye.AUDIO,Ye.AVI,Ye.CHM,Ye.CODE,Ye.CSV,Ye.DITA,Ye.EPUB,Ye.EXCEL,Ye.FLAC,Ye.GIF,Ye.GZIP,Ye.HTML,Ye.IMAGE,Ye.JPEG,Ye.JSON,Ye.M4A,Ye.MOV,Ye.MP3,Ye.MP4,Ye.OGG,Ye.PDF,Ye.PNG,Ye.POWERPOINT,Ye.RAR,Ye.STP,Ye.TEXT,Ye.UNKNOWN,Ye.VIDEO,Ye.WAV,Ye.WMA,Ye.WORD,Ye.XML,Ye.YAML,Ye.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Qe||(Qe={}));var tr=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class or extends o.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(Qe).includes(this.variant)?this.variant:Qe.fluid_topics,o=t!==Qe.material||!!this.value;return e.html`
|
|
548
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}async show(t){this.visible=!0,null!=t&&await this.hideDebounce.run((()=>{this.hide()}),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",async function(t,o,e){return Me(t,o,{platform:{...Pe,getOffsetParent:t=>Pe.getOffsetParent(t,Ge)},middleware:[(r={crossAxis:!0},void 0===r&&(r={}),{name:"shift",options:r,async fn(t){const{x:o,y:e,placement:i}=t,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=oe(r,t),s={x:o,y:e},p=await fe(t,c),f=ae(ee(i)),d=ie(f);let h=s[d],u=s[f];if(n){const t="y"===d?"bottom":"right";h=te(h+p["y"===d?"top":"left"],h,h-p[t])}if(a){const t="y"===f?"bottom":"right";u=te(u+p["y"===f?"top":"left"],u,u-p[t])}const g=l.fn({...t,[d]:h,[f]:u});return{...g,data:{x:g.x-o,y:g.y-e}}}}),he({allowedPlacements:[e]})]});var r}(this.slottedElement,this.tooltip,this.position).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}qe.elementDefinitions={"ft-typography":Po},qe.styles=Go,Ve([r.property()],qe.prototype,"text",void 0),Ve([r.property({type:Boolean})],qe.prototype,"manual",void 0),Ve([r.property({type:Boolean})],qe.prototype,"inline",void 0),Ve([r.property({type:Number})],qe.prototype,"delay",void 0),Ve([r.property()],qe.prototype,"position",void 0),Ve([r.queryAssignedNodes()],qe.prototype,"slotNodes",void 0),Ve([r.query(".ft-tooltip--container")],qe.prototype,"container",void 0),Ve([r.query(".ft-tooltip")],qe.prototype,"tooltip",void 0),Ve([r.query(".ft-tooltip--content")],qe.prototype,"tooltipContent",void 0),Ve([r.state()],qe.prototype,"visible",void 0),Ve([r.eventOptions({passive:!0})],qe.prototype,"onTouch",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onHover",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onOut",null),Ve([r.eventOptions({passive:!0})],qe.prototype,"onClick",null),o.customElement("ft-tooltip")(qe),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.CHART_BAR_NORMALIZED="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE="",t.OCTAGON_XMARK="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK="",t.CLONE="",t.CLONE_LINK_SIMPLE="",t.CONSUMER="",t.HOURGLASS_HALF="",t.CLOCK_THREE="",t.CALENDAR_DAY="",t.COMPUTER_MOUSE_MAGNIFYING_GLASS="",t.WAND_MAGIC_SPARKLES="",t.PAPER_PLANE=""}(_e||(_e={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Ye||(Ye={}));const Xe=new Map([...["abw"].map((t=>[t,Ye.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Ye.AUDIO])),...["avi"].map((t=>[t,Ye.AVI])),...["chm","xhs"].map((t=>[t,Ye.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Ye.CODE])),...["csv"].map((t=>[t,Ye.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ye.DITA])),...["epub"].map((t=>[t,Ye.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ye.EXCEL])),...["flac"].map((t=>[t,Ye.FLAC])),...["gif"].map((t=>[t,Ye.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ye.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ye.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf","ico"].map((t=>[t,Ye.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ye.JPEG])),...["json"].map((t=>[t,Ye.JSON])),...["m4a","m4p"].map((t=>[t,Ye.M4A])),...["mov","qt"].map((t=>[t,Ye.MOV])),...["mp3"].map((t=>[t,Ye.MP3])),...["mp4","m4v"].map((t=>[t,Ye.MP4])),...["ogg","oga"].map((t=>[t,Ye.OGG])),...["pdf","ps"].map((t=>[t,Ye.PDF])),...["png"].map((t=>[t,Ye.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ye.POWERPOINT])),...["rar"].map((t=>[t,Ye.RAR])),...["stp"].map((t=>[t,Ye.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ye.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Ye.VIDEO])),...["wav"].map((t=>[t,Ye.WAV])),...["wma"].map((t=>[t,Ye.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ye.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ye.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ye.YAML])),...["zip"].map((t=>[t,Ye.ZIP]))]),Je=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var Qe;Ye.ABW,Ye.AUDIO,Ye.AVI,Ye.CHM,Ye.CODE,Ye.CSV,Ye.DITA,Ye.EPUB,Ye.EXCEL,Ye.FLAC,Ye.GIF,Ye.GZIP,Ye.HTML,Ye.IMAGE,Ye.JPEG,Ye.JSON,Ye.M4A,Ye.MOV,Ye.MP3,Ye.MP4,Ye.OGG,Ye.PDF,Ye.PNG,Ye.POWERPOINT,Ye.RAR,Ye.STP,Ye.TEXT,Ye.UNKNOWN,Ye.VIDEO,Ye.WAV,Ye.WMA,Ye.WORD,Ye.XML,Ye.YAML,Ye.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Qe||(Qe={}));var tr=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class or extends o.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(Qe).includes(this.variant)?this.variant:Qe.fluid_topics,o=t!==Qe.material||!!this.value;return e.html`
|
|
549
549
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
550
550
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
551
551
|
<slot ?hidden=${o}></slot>
|
|
@@ -950,15 +950,16 @@ const Ko=Symbol.for(""),Ao=t=>{if(t?.r===Ko)return t?._$litStatic$},Do=t=>({_$li
|
|
|
950
950
|
</div>
|
|
951
951
|
`}onSuggestKeyDown(t){var o,e,r,i,n,a;switch(t.key){case"ArrowUp":null===(r=null!==(e=null===(o=this.getFocusedSuggestionElement())||void 0===o?void 0:o.previousElementSibling)&&void 0!==e?e:this.getLastSuggestionElement())||void 0===r||r.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(a=null!==(n=null===(i=this.getFocusedSuggestionElement())||void 0===i?void 0:i.nextElementSibling)&&void 0!==n?n:this.getFirstSuggestionElement())||void 0===a||a.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,o){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,o)}onSuggestSelected(t,o){t.preventDefault(),this.dispatchEvent(new si(o))}getIcon(t){const o="DOCUMENT"===t.type?Qe.file_format:Qe.fluid_topics;let r;switch(t.type){case"MAP":r="BOOK"===t.editorialType?_e.BOOK:_e.ARTICLE;break;case"DOCUMENT":r=function(t,o){var e,r,i,n;t=(null!=t?t:"").toLowerCase(),o=(null!=o?o:"").toLowerCase();const[a,l]=((null!==(e=Je.get(t))&&void 0!==e?e:t)+"/").split("/");return null!==(n=null!==(i=null!==(r=Xe.get(l))&&void 0!==r?r:Xe.get(o))&&void 0!==i?i:Xe.get(a))&&void 0!==n?n:Ye.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":r=_e.TOPICS}return e.html`
|
|
952
952
|
<ft-icon .variant="${o}" .value="${r}" part="suggestion-icon"></ft-icon>
|
|
953
|
-
`}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;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}};pi.elementDefinitions={"ft-ripple":Jt,"ft-typography":Po,"ft-icon":or},pi.styles=[o.wordWrap,li],ci([o.redux()],pi.prototype,"suggestResults",void 0),pi=ci([r.customElement("ft-search-input-suggestion")],pi);var fi=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class di extends(ti(Yr)){constructor(){super(),this.liveQuery="",this.forceCloseSuggestion=!1,this.addI18nContext(ai)}render(){var t,o;let r={"ft-search-input":!0,"ft-search-input--with-suggestions":null!==(o=null===(t=this.suggestResults)||void 0===t?void 0:t.length)&&void 0!==o&&o,"ft-search-input--with-suggestions-closed":this.forceCloseSuggestion};return e.html`
|
|
953
|
+
`}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;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}};pi.elementDefinitions={"ft-ripple":Jt,"ft-typography":Po,"ft-icon":or},pi.styles=[o.wordWrap,li],ci([o.redux()],pi.prototype,"suggestResults",void 0),pi=ci([r.customElement("ft-search-input-suggestion")],pi);var fi=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class di extends(ti(Yr)){constructor(){super(),this.liveQuery="",this.forceCloseSuggestion=!1,this.placeholder=ai.messages.placeholder(),this.addI18nContext(ai)}render(){var t,o;let r={"ft-search-input":!0,"ft-search-input--with-suggestions":null!==(o=null===(t=this.suggestResults)||void 0===t?void 0:t.length)&&void 0!==o&&o,"ft-search-input--with-suggestions-closed":this.forceCloseSuggestion};return e.html`
|
|
954
954
|
<div class="${i.classMap(r)}" @focusout=${()=>this.forceCloseSuggestion=!1}>
|
|
955
955
|
<div class="ft-search-input--input-container" part="input-container" tabindex="-1">
|
|
956
956
|
<div class="ft-search-input--input-outline" part="input-outline">
|
|
957
957
|
<input class="ft-search-input--input ft-typography--body2"
|
|
958
958
|
part="input"
|
|
959
959
|
type="text"
|
|
960
|
-
placeholder="${
|
|
960
|
+
placeholder="${this.placeholder}"
|
|
961
961
|
.value="${this.liveQuery}"
|
|
962
|
+
@input=${t=>this.onInput(t)}
|
|
962
963
|
@keydown=${t=>this.onSearchBarKeyDown(t)}
|
|
963
964
|
@keyup=${t=>this.onSearchBarKeyUp(t)}>
|
|
964
965
|
</div>
|
|
@@ -987,4 +988,4 @@ const Ko=Symbol.for(""),Ao=t=>{if(t?.r===Ko)return t?._$litStatic$},Do=t=>({_$li
|
|
|
987
988
|
></ft-button>
|
|
988
989
|
</div>
|
|
989
990
|
</div>
|
|
990
|
-
`}onSearchBarKeyDown(t){switch(t.key){case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestion.focusFirstSuggestion();break;case"Backspace":t.stopPropagation()}}onSearchBarKeyUp(t){
|
|
991
|
+
`}onSearchBarKeyDown(t){switch(t.key){case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestion.focusFirstSuggestion();break;case"Backspace":t.stopPropagation()}}onSearchBarKeyUp(t){switch(t.key){case"Backspace":t.stopPropagation();break;case"Enter":this.launchSearch(this.input.value)}}onInput(t){var o;null===(o=this.stateManager)||void 0===o||o.setLiveQuery(this.input.value),this.forceCloseSuggestion=!1}launchSearch(t){var o;null===(o=this.stateManager)||void 0===o||o.setQuery(t),this.forceCloseSuggestion=!0,this.dispatchEvent(new CustomEvent("change"))}onSuggestionSelected(t){this.launchSearch(t.detail)}}di.elementDefinitions={"ft-search-input-suggestion":pi,"ft-button":ar},di.styles=[kt,fr],fi([o.redux()],di.prototype,"request",void 0),fi([o.redux()],di.prototype,"liveQuery",void 0),fi([o.redux()],di.prototype,"suggestResults",void 0),fi([r.state()],di.prototype,"forceCloseSuggestion",void 0),fi([r.property({type:String})],di.prototype,"placeholder",void 0),fi([r.query(".ft-search-input--input")],di.prototype,"input",void 0),fi([r.query("ft-search-input-suggestion")],di.prototype,"suggestion",void 0),o.customElement("ft-search-input")(di),t.FtSearchInput=di,t.FtSearchInputCssVariables=pr,t.styles=fr}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
|