mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Extract find input checkboxes to separate file
This commit is contained in:
@@ -9,12 +9,12 @@ import 'vs/css!./findInput';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IMessage as InputBoxMessage, IInputValidator, InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';
|
||||
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { CaseSensitiveCheckbox, WholeWordsCheckbox, RegexCheckbox } from 'vs/base/browser/ui/findinput/findInputCheckboxes';
|
||||
|
||||
export interface IFindInputOptions {
|
||||
placeholder?: string;
|
||||
@@ -27,9 +27,6 @@ export interface IFindInputOptions {
|
||||
appendRegexLabel?: string;
|
||||
}
|
||||
|
||||
const NLS_REGEX_CHECKBOX_LABEL = nls.localize('regexDescription', "Use Regular Expression");
|
||||
const NLS_WHOLE_WORD_CHECKBOX_LABEL = nls.localize('wordsDescription', "Match Whole Word");
|
||||
const NLS_CASE_SENSITIVE_CHECKBOX_LABEL = nls.localize('caseDescription', "Match Case");
|
||||
const NLS_DEFAULT_LABEL = nls.localize('defaultLabel', "input");
|
||||
|
||||
export class FindInput extends Widget {
|
||||
@@ -42,9 +39,9 @@ export class FindInput extends Widget {
|
||||
private validation: IInputValidator;
|
||||
private label: string;
|
||||
|
||||
private regex: Checkbox;
|
||||
private wholeWords: Checkbox;
|
||||
private caseSensitive: Checkbox;
|
||||
private regex: RegexCheckbox;
|
||||
private wholeWords: WholeWordsCheckbox;
|
||||
private caseSensitive: CaseSensitiveCheckbox;
|
||||
public domNode: HTMLElement;
|
||||
public inputBox: InputBox;
|
||||
|
||||
@@ -200,9 +197,8 @@ export class FindInput extends Widget {
|
||||
}
|
||||
}));
|
||||
|
||||
this.regex = this._register(new Checkbox({
|
||||
actionClassName: 'regex',
|
||||
title: NLS_REGEX_CHECKBOX_LABEL + appendRegexLabel,
|
||||
this.regex = this._register(new RegexCheckbox({
|
||||
appendTitle: appendRegexLabel,
|
||||
isChecked: false,
|
||||
onChange: (viaKeyboard) => {
|
||||
this._onDidOptionChange.fire(viaKeyboard);
|
||||
@@ -213,9 +209,8 @@ export class FindInput extends Widget {
|
||||
this.validate();
|
||||
}
|
||||
}));
|
||||
this.wholeWords = this._register(new Checkbox({
|
||||
actionClassName: 'whole-word',
|
||||
title: NLS_WHOLE_WORD_CHECKBOX_LABEL + appendWholeWordsLabel,
|
||||
this.wholeWords = this._register(new WholeWordsCheckbox({
|
||||
appendTitle: appendWholeWordsLabel,
|
||||
isChecked: false,
|
||||
onChange: (viaKeyboard) => {
|
||||
this._onDidOptionChange.fire(viaKeyboard);
|
||||
@@ -226,9 +221,8 @@ export class FindInput extends Widget {
|
||||
this.validate();
|
||||
}
|
||||
}));
|
||||
this.caseSensitive = this._register(new Checkbox({
|
||||
actionClassName: 'case-sensitive',
|
||||
title: NLS_CASE_SENSITIVE_CHECKBOX_LABEL + appendCaseSensitiveLabel,
|
||||
this.caseSensitive = this._register(new CaseSensitiveCheckbox({
|
||||
appendTitle: appendCaseSensitiveLabel,
|
||||
isChecked: false,
|
||||
onChange: (viaKeyboard) => {
|
||||
this._onDidOptionChange.fire(viaKeyboard);
|
||||
|
||||
Reference in New Issue
Block a user