mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-06-25 00:00:20 +08:00
Build update
This commit is contained in:
+1
-1
@@ -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.
|
||||
|
||||
+2
-2
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
Vendored
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user