title: $:/core/ui/AdvancedSearch/Standard
tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Standard/Caption}}

\procedure lingo-base() $:/language/Search/
\procedure set-next-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="after" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>

\procedure set-previous-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="before" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>

\procedure next-search-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="after" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>

\procedure previous-search-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="before" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>

\procedure cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>

\procedure input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>

\procedure input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$list filter='[<tiddler>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{  [<tiddler>get[text]] }}}/></$list></$list>"><$list filter="[<tiddler>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{  [<tiddler>get[text]] }}}/></$list></$list>

\procedure input-actions()
<%if [<event-code>match[ArrowRight]] :and[<modifier>match[alt-shift]] %>
<<next-search-tab>>
<%elseif [<event-code>match[ArrowLeft]] :and[<modifier>match[alt-shift]] %>
<<previous-search-tab>>
<%elseif [<event-key-descriptor>match[((input-tab-right))]] %>
<<set-next-input-tab>>
<%elseif [<event-key-descriptor>match[((input-tab-left))]] %>
<<set-previous-input-tab>>
<%endif%>
\end

\whitespace trim

<<lingo Standard/Hint>>

<div class="tc-search">
<$keyboard key="((input-tab-right)) ((input-tab-left)) shift-alt-Right shift-alt-Left" actions=<<input-actions>>>
<$transclude $variable="keyboard-driven-input"
	tiddler="$:/temp/advancedsearch/input"
	storeTitle="$:/temp/advancedsearch"
	refreshTitle="$:/temp/advancedsearch/refresh"
	selectionStateTitle="$:/temp/advancedsearch/selected-item"
	type="search"
	tag="input"
	focus={{$:/config/Search/AutoFocus}}
	inputCancelActions=<<cancel-search-actions>>
	inputAcceptActions=<<input-accept-actions>>
	inputAcceptVariantActions=<<input-accept-variant-actions>>
	configTiddlerFilter="[[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
	filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
&#32;
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<<cancel-search-actions>>
{{$:/core/images/close-button}}
</$button>
</$reveal>
</div>

<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list
	filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]"
	emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>"
	variable="listItem">
<$vars
	userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
	configTiddler={{{ [[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}] }}}
	searchListState="$:/temp/advancedsearch/selected-item">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]">
<$list-empty>
<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude mode="block"/></$list>
</$list-empty>
<$transclude $variable="tabs"
	tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
	default={{$:/config/SearchResults/Default}}
	actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<currentTab>>/>"
	explicitState="$:/state/tab/search-results/advancedsearch" />
</$list>
</$vars>
</$list>
</$reveal>
