|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
import { CustomTooltip } from '@remix-ui/helper' |
|
|
|
|
import React, { useContext, useEffect, useRef, useState } from 'react' |
|
|
|
|
import { SearchContext } from '../context/context' |
|
|
|
|
|
|
|
|
@ -42,48 +43,66 @@ export const Find = () => { |
|
|
|
|
onKeyUp={handleKeypress} |
|
|
|
|
></input> |
|
|
|
|
<div className="search_plugin_controls"> |
|
|
|
|
<div |
|
|
|
|
data-id="search_case_sensitive" |
|
|
|
|
title="Match Case" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-case-sensitive ${ |
|
|
|
|
state.casesensitive ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Match Case" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleCaseSensitive() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
<div |
|
|
|
|
data-id="search_whole_word" |
|
|
|
|
title="Match Whole Word" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-whole-word ${ |
|
|
|
|
state.matchWord ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Match Whole Word" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleMatchWholeWord() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
<div |
|
|
|
|
data-id="search_use_regex" |
|
|
|
|
title="Use Regular Expression" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-regex ${ |
|
|
|
|
state.useRegExp ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Use Regular Expression" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleUseRegex() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
<CustomTooltip |
|
|
|
|
tooltipText="Match Case" |
|
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
|
tooltipId="searchCaseSensitiveTooltip" |
|
|
|
|
placement="top-start" |
|
|
|
|
> |
|
|
|
|
<div |
|
|
|
|
data-id="search_case_sensitive" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-case-sensitive ${ |
|
|
|
|
state.casesensitive ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Match Case" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleCaseSensitive() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip |
|
|
|
|
tooltipText="Match Whole Word" |
|
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
|
tooltipId="searchWholeWordTooltip" |
|
|
|
|
placement="top-start" |
|
|
|
|
> |
|
|
|
|
<div |
|
|
|
|
data-id="search_whole_word" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-whole-word ${ |
|
|
|
|
state.matchWord ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Match Whole Word" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleMatchWholeWord() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip |
|
|
|
|
tooltipText="Use Regular Expression" |
|
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
|
tooltipId="useRegularExpressionTooltip" |
|
|
|
|
placement="bottom-start" |
|
|
|
|
> |
|
|
|
|
<div |
|
|
|
|
data-id="search_use_regex" |
|
|
|
|
className={`monaco-custom-checkbox codicon codicon-regex ${ |
|
|
|
|
state.useRegExp ? 'checked' : '' |
|
|
|
|
}`}
|
|
|
|
|
role="checkbox" |
|
|
|
|
aria-checked="false" |
|
|
|
|
aria-label="Use Regular Expression" |
|
|
|
|
aria-disabled="false" |
|
|
|
|
onClick={() => { |
|
|
|
|
toggleUseRegex() |
|
|
|
|
}} |
|
|
|
|
></div> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|