mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-02-21 00:23:02 +08:00
Build update
This commit is contained in:
parent
a4bf6d8bad
commit
1113a88d08
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
*
|
||||
* simple-keyboard v3.4.75
|
||||
* simple-keyboard v3.4.76
|
||||
* https://github.com/hodgef/simple-keyboard
|
||||
*
|
||||
* Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
build/interfaces.d.ts
vendored
6
build/interfaces.d.ts
vendored
@ -189,9 +189,13 @@ export interface KeyboardOptions {
|
||||
[key: string]: string[];
|
||||
};
|
||||
/**
|
||||
* Determine size of layout candidate list
|
||||
* Determines size of layout candidate list
|
||||
*/
|
||||
layoutCandidatesPageSize?: number;
|
||||
/**
|
||||
* Determines whether layout candidate match should be case sensitive.
|
||||
*/
|
||||
layoutCandidatesCaseSensitiveMatch?: boolean;
|
||||
/**
|
||||
* Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).
|
||||
*/
|
||||
|
@ -316,7 +316,10 @@ class SimpleKeyboard {
|
||||
getInputCandidates(
|
||||
input: string
|
||||
): { candidateKey: string; candidateValue: string } | Record<string, never> {
|
||||
const { layoutCandidates: layoutCandidatesObj, layoutCandidatesCaseSensitiveMatch } = this.options;
|
||||
const {
|
||||
layoutCandidates: layoutCandidatesObj,
|
||||
layoutCandidatesCaseSensitiveMatch,
|
||||
} = this.options;
|
||||
|
||||
if (!layoutCandidatesObj || typeof layoutCandidatesObj !== "object") {
|
||||
return {};
|
||||
@ -326,7 +329,10 @@ class SimpleKeyboard {
|
||||
(layoutCandidate: string) => {
|
||||
const inputSubstr =
|
||||
input.substring(0, this.getCaretPositionEnd() || 0) || input;
|
||||
const regexp = new RegExp(`${layoutCandidate}$`, layoutCandidatesCaseSensitiveMatch ? "g" : "gi");
|
||||
const regexp = new RegExp(
|
||||
`${layoutCandidate}$`,
|
||||
layoutCandidatesCaseSensitiveMatch ? "g" : "gi"
|
||||
);
|
||||
const matches = [...inputSubstr.matchAll(regexp)];
|
||||
return !!matches.length;
|
||||
}
|
||||
@ -378,7 +384,10 @@ class SimpleKeyboard {
|
||||
currentInput.substring(0, initialCaretPosition || 0) ||
|
||||
currentInput;
|
||||
|
||||
const regexp = new RegExp(`${candidateKey}$`, layoutCandidatesCaseSensitiveMatch ? "g" : "gi");
|
||||
const regexp = new RegExp(
|
||||
`${candidateKey}$`,
|
||||
layoutCandidatesCaseSensitiveMatch ? "g" : "gi"
|
||||
);
|
||||
const newInputSubstr = inputSubstr.replace(
|
||||
regexp,
|
||||
normalizedCandidate
|
||||
|
Loading…
Reference in New Issue
Block a user