|
|
|
@ -370,56 +370,60 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
<Icon icon="sort-asc" onClick={this.handleShowHistoryCommand} color={"#106ba3"} />
|
|
|
|
|
<span className="hint">{this.props.cmdPrompt}</span>
|
|
|
|
|
{
|
|
|
|
|
this.props.keyWordList.map((item, index: number) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<span
|
|
|
|
|
key={index}
|
|
|
|
|
className="hint vice-hint"
|
|
|
|
|
onClick={() => { this.handleCallback(item.key); }}
|
|
|
|
|
>
|
|
|
|
|
[{item.msg}<span>({item.key})</span>]
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
<input
|
|
|
|
|
id={CMD_INPUT_ID}
|
|
|
|
|
disabled={CommandStore.GetInstance().disableInput}
|
|
|
|
|
type="text"
|
|
|
|
|
style={{ flex: 1, minWidth: 0, height: CommandInputHeight, border: "none" }}
|
|
|
|
|
placeholder={this.props.cmdPrompt == "" ? "请输入命令:" : ""}
|
|
|
|
|
autoComplete="off"
|
|
|
|
|
onCompositionStart={() =>
|
|
|
|
|
<div style={{ maxHeight: `calc(80vh - ${topToolBarHeight}px)`, overflowY: "scroll" }}>
|
|
|
|
|
{
|
|
|
|
|
this.isCNInput = true;
|
|
|
|
|
this.props.keyWordList.map((item, index: number) =>
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<span
|
|
|
|
|
key={index}
|
|
|
|
|
className="hint vice-hint"
|
|
|
|
|
onClick={() => { this.handleCallback(item.key); }}
|
|
|
|
|
>
|
|
|
|
|
[{item.msg}<span>({item.key})</span>]
|
|
|
|
|
</span>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Icon icon="sort-asc" onClick={this.handleShowHistoryCommand} color={"#106ba3"} />
|
|
|
|
|
<span className="hint">{this.props.cmdPrompt}</span>
|
|
|
|
|
<input
|
|
|
|
|
id={CMD_INPUT_ID}
|
|
|
|
|
disabled={CommandStore.GetInstance().disableInput}
|
|
|
|
|
type="text"
|
|
|
|
|
style={{ flex: 1, minWidth: 0, height: CommandInputHeight, border: "none" }}
|
|
|
|
|
placeholder={this.props.cmdPrompt == "" ? "请输入命令:" : ""}
|
|
|
|
|
autoComplete="off"
|
|
|
|
|
onCompositionStart={() =>
|
|
|
|
|
{
|
|
|
|
|
this.isCNInput = true;
|
|
|
|
|
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
}}
|
|
|
|
|
onCompositionEnd={(e) =>
|
|
|
|
|
{
|
|
|
|
|
this.isCNInput = false;
|
|
|
|
|
this.handleOnChangeIntelliSense(e.currentTarget.value);
|
|
|
|
|
}}
|
|
|
|
|
onFocus={() =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
}}
|
|
|
|
|
onBlur={() =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().ResetIme();
|
|
|
|
|
}}
|
|
|
|
|
onChange={(e) => { this.handleOnChangeIntelliSense(e.target.value); }}
|
|
|
|
|
ref={el => { this.inputEl = el; }}
|
|
|
|
|
onKeyDown={(e) =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
if (e.ctrlKey || e.altKey || e.shiftKey) e.preventDefault();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
}}
|
|
|
|
|
onCompositionEnd={(e) =>
|
|
|
|
|
{
|
|
|
|
|
this.isCNInput = false;
|
|
|
|
|
this.handleOnChangeIntelliSense(e.currentTarget.value);
|
|
|
|
|
}}
|
|
|
|
|
onFocus={() =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
}}
|
|
|
|
|
onBlur={() =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().ResetIme();
|
|
|
|
|
}}
|
|
|
|
|
onChange={(e) => { this.handleOnChangeIntelliSense(e.target.value); }}
|
|
|
|
|
ref={el => { this.inputEl = el; }}
|
|
|
|
|
onKeyDown={(e) =>
|
|
|
|
|
{
|
|
|
|
|
SwitchServerStore.GetInstance().DisableIme();
|
|
|
|
|
if (e.ctrlKey || e.altKey || e.shiftKey) e.preventDefault();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<ul
|
|
|
|
|
className="history-command"
|
|
|
|
|
style={{ display: this.state.isShowHistory ? "block" : "none" }}
|
|
|
|
|