Socket
Socket
Sign inDemoInstall

@mamba/keyboard

Package Overview
Dependencies
5
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.6.0 to 9.7.0

9

CHANGELOG.md

@@ -6,2 +6,11 @@ # Change Log

## [9.7.0](https://github.com/stone-payments/pos-mamba-sdk/compare/v9.6.0...v9.7.0) (2023-06-09)
### Bug Fixes
* 🐛 fix keyboard main field ([8f835de](https://github.com/stone-payments/pos-mamba-sdk/commit/8f835dee12f0c8448bb90e80a92de9085190f3f1))
## [9.6.0](https://github.com/stone-payments/pos-mamba-sdk/compare/v9.5.1...v9.6.0) (2023-06-09)

@@ -8,0 +17,0 @@

165

lib/common/CursorWorker.js

@@ -0,1 +1,26 @@

var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
import { KeyboardVisibility, } from '../types';

@@ -8,9 +33,11 @@ import { greddyBraces } from './regExps';

*/
class CursorWorker {
var CursorWorker = /** @class */ (function () {
/**
* Creates an instance of the CursorWorker
*/
constructor({ getOptions, keyboardInstance }) {
this.getCursorPositionStart = () => this.cursorPositionStart;
this.getCursorPositionEnd = () => this.cursorPositionEnd;
function CursorWorker(_a) {
var getOptions = _a.getOptions, keyboardInstance = _a.keyboardInstance;
var _this = this;
this.getCursorPositionStart = function () { return _this.cursorPositionStart; };
this.getCursorPositionEnd = function () { return _this.cursorPositionEnd; };
/**

@@ -36,6 +63,9 @@ * Control flag for events setup

*/
updateCursorPos(length, minus = false, moveCursor = false, customTarget = undefined) {
const newCursorPos = this.updateCursorPosAction(length, minus);
CursorWorker.prototype.updateCursorPos = function (length, minus, moveCursor, customTarget) {
if (minus === void 0) { minus = false; }
if (moveCursor === void 0) { moveCursor = false; }
if (customTarget === void 0) { customTarget = undefined; }
var newCursorPos = this.updateCursorPosAction(length, minus);
this.setCursorPosition(newCursorPos, newCursorPos, moveCursor, customTarget);
}
};
/**

@@ -47,4 +77,5 @@ * Action method of updateCursorPos

*/
updateCursorPosAction(length, minus = false) {
let cursorPositionStart = this.getCursorPositionStart();
CursorWorker.prototype.updateCursorPosAction = function (length, minus) {
if (minus === void 0) { minus = false; }
var cursorPositionStart = this.getCursorPositionStart();
if (cursorPositionStart != null) {

@@ -60,3 +91,3 @@ if (minus) {

return cursorPositionStart;
}
};
/**

@@ -71,4 +102,7 @@ * Adds a string to the input at a given position

*/
addStringAt(source, str, positionStart = source.length, positionEnd = source.length, moveCursor = false) {
let output;
CursorWorker.prototype.addStringAt = function (source, str, positionStart, positionEnd, moveCursor) {
if (positionStart === void 0) { positionStart = source.length; }
if (positionEnd === void 0) { positionEnd = source.length; }
if (moveCursor === void 0) { moveCursor = false; }
var output;
if (!positionStart && positionStart !== 0) {

@@ -90,3 +124,3 @@ output = source + str;

return output;
}
};
/**

@@ -99,7 +133,10 @@ * Removes an amount of characters before a given position

*/
removeAt(source, position = source.length, positionEnd = source.length, moveCursor = false) {
CursorWorker.prototype.removeAt = function (source, position, positionEnd, moveCursor) {
if (position === void 0) { position = source.length; }
if (positionEnd === void 0) { positionEnd = source.length; }
if (moveCursor === void 0) { moveCursor = false; }
if (position === 0 && positionEnd === 0) {
return source;
}
let output;
var output;
if (position === positionEnd) {

@@ -124,3 +161,3 @@ if (position && position >= 0) {

return output;
}
};
/**

@@ -132,7 +169,10 @@ * Removes an amount of characters after a given position

*/
removeForwardsAt(source, position = source.length, positionEnd = source.length, moveCursor = false) {
CursorWorker.prototype.removeForwardsAt = function (source, position, positionEnd, moveCursor) {
if (position === void 0) { position = source.length; }
if (positionEnd === void 0) { positionEnd = source.length; }
if (moveCursor === void 0) { moveCursor = false; }
if (!(source === null || source === void 0 ? void 0 : source.length) || position === null) {
return source;
}
let output;
var output;
if (position === positionEnd) {

@@ -148,3 +188,3 @@ output = source.substr(0, position) + source.substr(position + 1);

return output;
}
};
/**

@@ -155,13 +195,13 @@ * Gets the current value of maxLengthReached

*/
isMaxLengthReached() {
CursorWorker.prototype.isMaxLengthReached = function () {
return this.maxLengthReached;
}
};
/**
* Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered
*/
cursorEventHandler(event) {
CursorWorker.prototype.cursorEventHandler = function (event) {
var _a;
if (!this)
return;
const options = this.getOptions();
var options = this.getOptions();
if (this.keyboardInstance.isRenderAllowed !== true)

@@ -176,4 +216,4 @@ return;

}
const target = document.activeElement || event.target;
const isKeyboard = target === this.keyboardInstance.keyboardDOM ||
var target = document.activeElement || event.target;
var isKeyboard = target === this.keyboardInstance.keyboardDOM ||
(target && this.keyboardInstance.keyboardDOM.contains(target));

@@ -194,3 +234,3 @@ if (target instanceof HTMLInputElement &&

target.selectionEnd = this.lastCursorPositionEnd;
console.log(`Try to deal a discrepancy of keyup behavior that reset target input cursor to the end of it on POS old browser\n-> target.lastCursorPositionStart = ${this.lastCursorPositionStart}`);
console.log("Try to deal a discrepancy of keyup behavior that reset target input cursor to the end of it on POS old browser\n-> target.lastCursorPositionStart = ".concat(this.lastCursorPositionStart));
}

@@ -200,3 +240,3 @@ }

if (options.debug) {
console.log('Cursor at: ', this.getCursorPositionStart(), this.getCursorPositionEnd(), event && target.tagName.toLowerCase(), `(${this.keyboardInstance.keyboardDOMClass})`);
console.log('Cursor at: ', this.getCursorPositionStart(), this.getCursorPositionEnd(), event && target.tagName.toLowerCase(), "(".concat(this.keyboardInstance.keyboardDOMClass, ")"));
}

@@ -215,3 +255,3 @@ this.cursorInputTarget = target;

if (options.debug) {
console.log(`Cursor position reset due to "${event === null || event === void 0 ? void 0 : event.type}" event`, event);
console.log("Cursor position reset due to \"".concat(event === null || event === void 0 ? void 0 : event.type, "\" event"), event);
}

@@ -226,3 +266,3 @@ this.cursorInputTarget = undefined;

}
}
};
// Accessible methods

@@ -232,8 +272,8 @@ /**

*/
setupCursorEventsControl() {
const options = this.getOptions();
CursorWorker.prototype.setupCursorEventsControl = function () {
var options = this.getOptions();
if (!document || options.readonly === true || this.setuped)
return;
if (options.debug) {
console.log(`Cursor handling started (${this.keyboardInstance.keyboardDOMClass})`);
console.log("Cursor handling started (".concat(this.keyboardInstance.keyboardDOMClass, ")"));
}

@@ -248,7 +288,7 @@ /**

this.setuped = true;
}
};
/**
* Remove cursor worker controls events
*/
ceaseCursorEventsControl() {
CursorWorker.prototype.ceaseCursorEventsControl = function () {
if (!this.setuped)

@@ -261,3 +301,3 @@ return;

this.setuped = false;
}
};
/**

@@ -271,4 +311,7 @@ * Changes the internal cursor position

*/
setCursorPosition(position, endPosition = position, moveCursor = false, customTarget = undefined) {
const options = this.getOptions();
CursorWorker.prototype.setCursorPosition = function (position, endPosition, moveCursor, customTarget) {
if (endPosition === void 0) { endPosition = position; }
if (moveCursor === void 0) { moveCursor = false; }
if (customTarget === void 0) { customTarget = undefined; }
var options = this.getOptions();
this.cursorPositionStart = position;

@@ -278,5 +321,5 @@ this.cursorPositionEnd = endPosition;

this.lastCursorPositionEnd = endPosition;
const input = customTarget || this.cursorInputTarget || options.input;
var input = customTarget || this.cursorInputTarget || options.input;
if (options.debug) {
console.log(`Set cursor positons to ${position} start, ${endPosition} end.`);
console.log("Set cursor positons to ".concat(position, " start, ").concat(endPosition, " end."));
}

@@ -289,3 +332,3 @@ /**

}
}
};
/**

@@ -297,6 +340,6 @@ * Determines whether the max length has been reached when maxLength option are set.

*/
handleMaxLength(keyboardInput, updatedInput) {
const options = this.getOptions();
const { maxLength } = options;
const condition = updatedInput.length - 1 >= maxLength;
CursorWorker.prototype.handleMaxLength = function (keyboardInput, updatedInput) {
var options = this.getOptions();
var maxLength = options.maxLength;
var condition = updatedInput.length - 1 >= maxLength;
/**

@@ -315,3 +358,3 @@ * If pressing this button won't add more characters

return condition;
}
};
/**

@@ -324,4 +367,4 @@ * Filters numeric output to handle formatted inputs

*/
shouldFilterNumericValue(value) {
const options = this.getOptions();
CursorWorker.prototype.shouldFilterNumericValue = function (value) {
var options = this.getOptions();
if (options.filtersNumbersOnly === true) {

@@ -331,3 +374,3 @@ value = value.replace(/\D/g, '');

return value;
}
};
/**

@@ -343,14 +386,15 @@ * Returns the updated input resulting from clicking a given button

*/
getUpdatedInput(button, input, moveCursor = false) {
const cursorPos = this.cursorPositionStart;
const cursorPosEnd = this.cursorPositionEnd || cursorPos;
const commonParams = [cursorPos, cursorPosEnd, moveCursor];
let output = input;
CursorWorker.prototype.getUpdatedInput = function (button, input, moveCursor) {
if (moveCursor === void 0) { moveCursor = false; }
var cursorPos = this.cursorPositionStart;
var cursorPosEnd = this.cursorPositionEnd || cursorPos;
var commonParams = [cursorPos, cursorPosEnd, moveCursor];
var output = input;
switch (button) {
case '{space}':
output = this.addStringAt(output, ' ', ...commonParams);
output = this.addStringAt.apply(this, __spreadArray([output, ' '], __read(commonParams), false));
break;
case '{backspace}':
if (output.length > 0 && this.keyboardInstance.generalKeyboard.backspaceEnabled === true) {
output = this.removeAt(output, ...commonParams);
output = this.removeAt.apply(this, __spreadArray([output], __read(commonParams), false));
}

@@ -360,7 +404,7 @@ break;

if (output.length > 0)
output = this.removeForwardsAt(output, ...commonParams);
output = this.removeForwardsAt.apply(this, __spreadArray([output], __read(commonParams), false));
break;
case '{':
case '}':
output = this.addStringAt(output, button, ...commonParams);
output = this.addStringAt.apply(this, __spreadArray([output, button], __read(commonParams), false));
break;

@@ -372,3 +416,3 @@ default:

if (!greddyBraces.test(button)) {
output = this.addStringAt(output, button, ...commonParams);
output = this.addStringAt.apply(this, __spreadArray([output, button], __read(commonParams), false));
}

@@ -378,5 +422,6 @@ output = this.shouldFilterNumericValue(output);

return output;
}
}
};
return CursorWorker;
}());
export default CursorWorker;
//# sourceMappingURL=CursorWorker.js.map

@@ -1,4 +0,4 @@

const anyBraces = /\{|\}/g;
const greddyBraces = /^\{.+\}$/;
var anyBraces = /\{|\}/g;
var greddyBraces = /^\{.+\}$/;
export { anyBraces, greddyBraces };
//# sourceMappingURL=regExps.js.map

@@ -6,4 +6,5 @@ import { createKeyboardElement, ClassNames } from '../helpers';

*/
class SuggestionBox {
constructor({ getOptions, keyboardInstance, onSelect }) {
var SuggestionBox = /** @class */ (function () {
function SuggestionBox(_a) {
var getOptions = _a.getOptions, keyboardInstance = _a.keyboardInstance, onSelect = _a.onSelect;
this.keyboardInstance = keyboardInstance;

@@ -17,15 +18,16 @@ this.getOptions = getOptions;

*/
destroy() {
SuggestionBox.prototype.destroy = function () {
this.reset();
}
reset() {
};
SuggestionBox.prototype.reset = function () {
this.clearBox();
this.candidate = undefined;
}
resetIfExist() {
};
SuggestionBox.prototype.resetIfExist = function () {
var _this = this;
if (this.suggestionDOMElement) {
// Postpone the reset after all event of cursor worker dispatch.
setTimeout(() => this.reset());
setTimeout(function () { return _this.reset(); });
}
}
};
/**

@@ -36,3 +38,3 @@ * Shows or hides suggestion box on button click.

*/
shouldUpdateOrCease(keyCandidate) {
SuggestionBox.prototype.shouldUpdateOrCease = function (keyCandidate) {
if (!keyCandidate) {

@@ -42,4 +44,4 @@ this.reset();

}
const { layoutSuggestions } = this.getOptions();
const suggestionFound = (layoutSuggestions || DEFAULT_SUGGESTIONS)[keyCandidate];
var layoutSuggestions = this.getOptions().layoutSuggestions;
var suggestionFound = (layoutSuggestions || DEFAULT_SUGGESTIONS)[keyCandidate];
if (suggestionFound) {

@@ -53,9 +55,9 @@ this.candidate = keyCandidate;

return !!suggestionFound;
}
};
/**
* Remove keyboard suggestion box
*/
clearBox() {
SuggestionBox.prototype.clearBox = function () {
if (this.suggestionDOMElement) {
const { parentNode } = this.suggestionDOMElement;
var parentNode = this.suggestionDOMElement.parentNode;
if (parentNode)

@@ -65,9 +67,10 @@ parentNode.removeChild(this.suggestionDOMElement);

}
}
};
/**
* Renders or update the keyboard suggestions box
*/
render(suggestionList) {
SuggestionBox.prototype.render = function (suggestionList) {
var _this = this;
if (this.keyboardInstance.options.debug) {
console.log(`Start suggestion render with ${suggestionList}`);
console.log("Start suggestion render with ".concat(suggestionList));
}

@@ -77,7 +80,7 @@ // Remove last suggestion box, if any

this.suggestionDOMElement = createKeyboardElement(ClassNames.suggestionBox);
const suggestionTable = createKeyboardElement(undefined, 'table');
const suggestionRow = createKeyboardElement(undefined, 'tr');
suggestionList.forEach((suggestionValue) => {
const suggestionCell = createKeyboardElement(undefined, 'td');
const suggestionButton = createKeyboardElement([
var suggestionTable = createKeyboardElement(undefined, 'table');
var suggestionRow = createKeyboardElement(undefined, 'tr');
suggestionList.forEach(function (suggestionValue) {
var suggestionCell = createKeyboardElement(undefined, 'td');
var suggestionButton = createKeyboardElement([
ClassNames.buttonPrefix,

@@ -87,6 +90,6 @@ ClassNames.suggestionBoxButton,

suggestionButton.textContent = suggestionValue;
suggestionButton.onclick = (e) => {
if (typeof this.candidate === 'string') {
this.onSelect(suggestionValue, this.candidate, e);
this.reset();
suggestionButton.onclick = function (e) {
if (typeof _this.candidate === 'string') {
_this.onSelect(suggestionValue, _this.candidate, e);
_this.reset();
}

@@ -105,5 +108,6 @@ };

this.keyboardInstance.keyboardDOM.insertBefore(this.suggestionDOMElement, this.keyboardInstance.keyboardDOM.firstChild);
}
}
};
return SuggestionBox;
}());
export default SuggestionBox;
//# sourceMappingURL=SuggestionBox.js.map
import { KEYBOARD } from '@mamba/core';
import KEY_TABLE_MAP from '../mappings/keyTableMap';
import KEY_TABLE_LIST from '../mappings/keyTableMapList';
const { KEY_MAP, KEY_CODE_LIST } = KEYBOARD;
var KEY_MAP = KEYBOARD.KEY_MAP, KEY_CODE_LIST = KEYBOARD.KEY_CODE_LIST;
/**
* General methods to map and handle keys, and change keyboard mode
*/
class UIGeneralKeyboard {
constructor() {
var UIGeneralKeyboard = /** @class */ (function () {
function UIGeneralKeyboard() {
/**

@@ -23,6 +23,6 @@ * Define if backspace button should be enabled

*/
static hasKeyboardInstance() {
UIGeneralKeyboard.hasKeyboardInstance = function () {
return Boolean(window.MambaKeyboardInstance && window.MambaKeyboardInstance.instance);
}
static checkInstanceIsValid() {
};
UIGeneralKeyboard.checkInstanceIsValid = function () {
if (!UIGeneralKeyboard.hasKeyboardInstance()) {

@@ -33,3 +33,3 @@ throw new Error('Cant call the method of null Keyboard instance. You should start a Keyboard instance to use its methods');

return true;
}
};
/**

@@ -39,6 +39,10 @@ * Keyboard method wrapper to validate Keyboard instance if something happens to it (eg. destroyed)

*/
static bindWrapper(method) {
UIGeneralKeyboard.bindWrapper = function (method) {
if (typeof method !== 'function')
return;
return (...args) => {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (UIGeneralKeyboard.checkInstanceIsValid()) {

@@ -48,15 +52,15 @@ method.apply(window.MambaKeyboardInstance.instance, args);

};
}
};
/**
* Internal control for virtual keyboard when Sets the kernel keyboard to enter numbers only.
*/
setKeyboardAsNumeric() {
UIGeneralKeyboard.prototype.setKeyboardAsNumeric = function () {
this.alphanumericEnabled = false;
}
};
/**
* Internal control for virtual keyboard when Sets the kernek keyboard to type alphanumeric characters.
*/
setKeyboardAsAlphanumeric() {
UIGeneralKeyboard.prototype.setKeyboardAsAlphanumeric = function () {
this.alphanumericEnabled = true;
}
};
/**

@@ -70,7 +74,7 @@ * Find the key code of given list and key map

*/
getMappedKeyCode(list, map, keyName) {
UIGeneralKeyboard.prototype.getMappedKeyCode = function (list, map, keyName) {
if (!Array.isArray(list))
return null;
const found = list.find((code) => {
const maped = map[code];
var found = list.find(function (code) {
var maped = map[code];
if (Array.isArray(maped))

@@ -83,3 +87,3 @@ return maped.indexOf(keyName) !== -1;

return found || null;
}
};
/**

@@ -92,4 +96,4 @@ * Find the key name of given list and map for an KeyboardEvent

*/
getEventMappedKeyName(keyCode, modifiers) {
const found = KEY_TABLE_MAP[keyCode];
UIGeneralKeyboard.prototype.getEventMappedKeyName = function (keyCode, modifiers) {
var found = KEY_TABLE_MAP[keyCode];
if (!found)

@@ -104,3 +108,3 @@ return null;

return found || null;
}
};
/**

@@ -111,8 +115,8 @@ * Get the key code relative to a specific key name compatible with POS

*/
getKeyCode(keyName) {
UIGeneralKeyboard.prototype.getKeyCode = function (keyName) {
if (typeof keyName !== 'string')
return null;
const code = this.getMappedKeyCode(KEY_CODE_LIST, KEY_MAP, keyName);
var code = this.getMappedKeyCode(KEY_CODE_LIST, KEY_MAP, keyName);
return code ? Number.parseInt(code, 10) : null;
}
};
/**

@@ -124,6 +128,7 @@ * Get UTF key code relative to a specific key name compatible with POS

*/
getTableKeyCode(keyName, inferCharCode = false) {
UIGeneralKeyboard.prototype.getTableKeyCode = function (keyName, inferCharCode) {
if (inferCharCode === void 0) { inferCharCode = false; }
if (typeof keyName !== 'string')
return null;
let code = this.getMappedKeyCode(KEY_TABLE_LIST, KEY_TABLE_MAP, keyName);
var code = this.getMappedKeyCode(KEY_TABLE_LIST, KEY_TABLE_MAP, keyName);
/**

@@ -136,3 +141,3 @@ * Some key cannot be mapped from POS table, try find it on utf table

return code;
}
};
/**

@@ -143,6 +148,6 @@ * Get the key name relative to a specific key code

*/
getKeyName(keyCode) {
UIGeneralKeyboard.prototype.getKeyName = function (keyCode) {
if (typeof keyCode === 'undefined')
return keyCode;
const key = KEY_MAP[keyCode];
var key = KEY_MAP[keyCode];
if (key) {

@@ -152,3 +157,3 @@ return String(KEY_MAP[keyCode]);

return undefined;
}
};
/**

@@ -164,8 +169,8 @@ * Get the mamba normalized key code from user input event

*/
parseEventKeyCode(event) {
const keyCode = typeof event.keyCode === 'number' && event.keyCode !== 0
UIGeneralKeyboard.prototype.parseEventKeyCode = function (event) {
var keyCode = typeof event.keyCode === 'number' && event.keyCode !== 0
? event.keyCode
: event.charCode || event.which || event.code;
return keyCode;
}
};
/**

@@ -176,6 +181,6 @@ * Get the mamba normalized key name from user input event

*/
parseEventKeyName(event) {
const code = this.parseEventKeyCode(event);
UIGeneralKeyboard.prototype.parseEventKeyName = function (event) {
var code = this.parseEventKeyCode(event);
return this.getKeyName(code);
}
};
/**

@@ -186,4 +191,4 @@ * Gets the normalized key code and name according to the POS key map through a keyboard input event.

*/
parseEventKeys(event) {
const code = this.parseEventKeyCode(event);
UIGeneralKeyboard.prototype.parseEventKeys = function (event) {
var code = this.parseEventKeyCode(event);
if (event.shiftKey) {

@@ -193,3 +198,3 @@ return [code, this.getEventMappedKeyName(code, { shiftKey: event.shiftKey })];

return [code, this.getKeyName(code)];
}
};
/**

@@ -200,5 +205,5 @@ * Check if a certain key is a numeric key

*/
isNumericKey(keyCode) {
UIGeneralKeyboard.prototype.isNumericKey = function (keyCode) {
return !Number.isNaN(parseFloat(KEY_MAP[keyCode]));
}
};
/**

@@ -209,5 +214,5 @@ * Check if a certain key is key that have an functionality

*/
isFunctionKey(keyCode) {
UIGeneralKeyboard.prototype.isFunctionKey = function (keyCode) {
return !this.isNumericKey(keyCode);
}
};
/**

@@ -219,5 +224,5 @@ * Check if a certain key is an action key

*/
isActionKey(keyCode) {
UIGeneralKeyboard.prototype.isActionKey = function (keyCode) {
return this.isFunctionKey(keyCode);
}
};
/**

@@ -227,22 +232,23 @@ * Return if the backspace button is enabled

*/
isBackspaceEnabled() {
UIGeneralKeyboard.prototype.isBackspaceEnabled = function () {
return this.backspaceEnabled;
}
};
/**
* Switch OFF backspace key
*/
disableBackspace() {
UIGeneralKeyboard.prototype.disableBackspace = function () {
this.backspaceEnabled = false;
}
};
/**
* Switch ON backspace key
*/
enableBackspace() {
UIGeneralKeyboard.prototype.enableBackspace = function () {
this.backspaceEnabled = true;
}
}
};
return UIGeneralKeyboard;
}());
export { UIGeneralKeyboard };
// This is necessary to not duplicate the wrappers code and not create another class instance in order to they stay synchronized with backend config on embeded POS application.
const GeneralKeyboard = new UIGeneralKeyboard();
var GeneralKeyboard = new UIGeneralKeyboard();
export default GeneralKeyboard;
//# sourceMappingURL=GeneralKeyboard.js.map

@@ -12,7 +12,9 @@ import { KEYBOARD } from '@mamba/core';

*/
class PhysicalKeyboard {
var PhysicalKeyboard = /** @class */ (function () {
/**
* Creates an instance of the PhysicalKeyboard service
*/
constructor({ getOptions, keyboardInstance }) {
function PhysicalKeyboard(_a) {
var getOptions = _a.getOptions, keyboardInstance = _a.keyboardInstance;
var _this = this;
this.dispatchingEvent = false;

@@ -32,5 +34,5 @@ this.getOptions = getOptions;

/** Compute first interation. We need wait svelte render the active element, again... */
setTimeout(() => {
this.handleFocusIn(document.activeElement);
this.shouldOnFocusUpdateCursorPosition(document.activeElement);
setTimeout(function () {
_this.handleFocusIn(document.activeElement);
_this.shouldOnFocusUpdateCursorPosition(document.activeElement);
});

@@ -43,8 +45,9 @@ }

*/
onFocusUpdateCursorPosition(event) {
const { target } = event;
setTimeout(() => {
this.shouldOnFocusUpdateCursorPosition(target);
PhysicalKeyboard.prototype.onFocusUpdateCursorPosition = function (event) {
var _this = this;
var target = event.target;
setTimeout(function () {
_this.shouldOnFocusUpdateCursorPosition(target);
}, 1);
}
};
/**

@@ -54,13 +57,13 @@ * Try update cursor worker cursor position when a supposed input element gets its focus

*/
shouldOnFocusUpdateCursorPosition(element) {
PhysicalKeyboard.prototype.shouldOnFocusUpdateCursorPosition = function (element) {
var _a;
// Set cursor worker cursor position of the early input focus cursor positions.
if (element && isProperInput(element)) {
const input = element;
var input = element;
(_a = this.keyboardInstance.cursorWorker) === null || _a === void 0 ? void 0 : _a.setCursorPosition(input.selectionStart, input.selectionEnd, false, input);
if (this.getOptions().debug) {
console.log(`Updating cursor position for the new focus element with ${input.selectionStart} ${input.selectionEnd}`);
console.log("Updating cursor position for the new focus element with ".concat(input.selectionStart, " ").concat(input.selectionEnd));
}
}
}
};
/**

@@ -70,5 +73,5 @@ * Handle document global focus in target

*/
handleDocumentFocusIn(event) {
PhysicalKeyboard.prototype.handleDocumentFocusIn = function (event) {
this.handleFocusIn(document.activeElement || event.target || undefined, event);
}
};
/**

@@ -80,9 +83,11 @@ * Handles any focus element

*/
handleFocusIn(target, e) {
PhysicalKeyboard.prototype.handleFocusIn = function (target, e) {
if (!__POS__ && e) {
let avoidExternals = false;
var avoidExternals = false;
try {
const path = e.composedPath();
var path = e.composedPath();
/** We need avoid other inputs on the simulator page, like panel inputs */
avoidExternals = !path.some((id) => id.className && id.className.includes('mamba-app'));
avoidExternals = !path.some(function (id) {
return id.className && id.className.includes('mamba-app');
});
}

@@ -99,3 +104,3 @@ catch (_) {

if (target && isProperInput(target)) {
const input = target;
var input = target;
/**

@@ -126,3 +131,3 @@ * Set keyboard visibility

}
}
};
/**

@@ -132,8 +137,8 @@ * Update virtual value from real one.

*/
updateVirtualInputfromDOMValue(input) {
PhysicalKeyboard.prototype.updateVirtualInputfromDOMValue = function (input) {
if (this.dispatchingEvent)
return;
const options = this.getOptions();
var options = this.getOptions();
if (this.keyboardInstance.getInput() !== input.value && !options.input) {
const { value } = input;
var value = input.value;
/**

@@ -144,3 +149,3 @@ * Get and set value from input component...

}
}
};
/**

@@ -151,3 +156,3 @@ * Handles input on blur

*/
handleDOMInputTargetBlur(e) {
PhysicalKeyboard.prototype.handleDOMInputTargetBlur = function (e) {
if (this.dispatchingEvent)

@@ -157,11 +162,11 @@ return;

if (e && e.target && isProperInput(e.target)) {
const input = e.target;
var input = e.target;
this.updateVirtualInputfromDOMValue(input);
this.removeDOMInputEventListeners();
}
}
};
/**
* Remove input target event listeners.
*/
removeDOMInputEventListeners() {
PhysicalKeyboard.prototype.removeDOMInputEventListeners = function () {
if (!this.focusedDOMInput)

@@ -183,3 +188,3 @@ return;

this.focusedDOMInput = null;
}
};
/**

@@ -190,3 +195,4 @@ * Add input target event listeners

*/
addDOMInputEventListeners(input) {
PhysicalKeyboard.prototype.addDOMInputEventListeners = function (input) {
var _this = this;
/**

@@ -205,6 +211,6 @@ * If already has last focused input, do not add listener again

*/
setTimeout(() => {
setTimeout(function () {
try {
// The `input.instance` have only on @mamba/input components
this.svelteListener = input.instance.on('destroy', this.removeDOMInputEventListeners);
_this.svelteListener = input.instance.on('destroy', _this.removeDOMInputEventListeners);
}

@@ -215,16 +221,16 @@ catch (_) {

});
}
};
/**
* Clear input listeners for keyboard route reset.
*/
clearInputListeners() {
PhysicalKeyboard.prototype.clearInputListeners = function () {
this.removeDOMInputEventListeners();
}
};
/**
* Remove any input listeners, for life-cycle destroy
*/
destroy() {
PhysicalKeyboard.prototype.destroy = function () {
this.clearInputListeners();
document.removeEventListener('focusin', this.handleDocumentFocusIn, true);
}
};
/**

@@ -234,4 +240,4 @@ * Handle event target input focus

*/
handleDOMInputFocus(e) {
const options = this.getOptions();
PhysicalKeyboard.prototype.handleDOMInputFocus = function (e) {
var options = this.getOptions();
if (

@@ -244,10 +250,10 @@ // if keyboard need lock cursor

isProperInput(e.target)) {
const input = e.target;
var input = e.target;
/**
* Move cursor to final
*/
const endPosition = input.value.length;
var endPosition = input.value.length;
this.keyboardInstance.cursorWorker.setCursorPosition(endPosition, endPosition, true);
}
}
};
/**

@@ -257,15 +263,16 @@ * Update keyboard virtual input if DOM input changed directly

*/
handleDOMInputChange(event) {
setTimeout(() => {
const target = event.target || undefined;
PhysicalKeyboard.prototype.handleDOMInputChange = function (event) {
var _this = this;
setTimeout(function () {
var target = event.target || undefined;
if (target && isProperInput(target)) {
const input = target;
this.updateVirtualInputfromDOMValue(input);
var input = target;
_this.updateVirtualInputfromDOMValue(input);
}
});
}
};
/**
* Handles beep sound
*/
static handleBeepSound(options) {
PhysicalKeyboard.handleBeepSound = function (options) {
try {

@@ -277,3 +284,3 @@ window.$System.beep(options.beepTone || PhysicalKeyboard.beepTone, options.beepTime || PhysicalKeyboard.beepTime);

}
}
};
/**

@@ -288,7 +295,7 @@ * Force define some event properties

*/
defineProperty(obj, prop, value) {
PhysicalKeyboard.prototype.defineProperty = function (obj, prop, value) {
try {
Object.defineProperty(obj, prop, {
configurable: true,
get() {
get: function () {
if (prop === 'code') {

@@ -304,3 +311,3 @@ return Number.parseInt(value, 10);

}
}
};
/**

@@ -316,7 +323,7 @@ * Creates synthetic key event

*/
createSyntheticKeyEvent(eventType, code, keyName) {
PhysicalKeyboard.prototype.createSyntheticKeyEvent = function (eventType, code, keyName) {
/**
* Create Keyboard event using old API compatible with POS Browser version
*/
const event = document.createEvent('KeyboardEvent');
var event = document.createEvent('KeyboardEvent');
/**

@@ -330,3 +337,3 @@ * Hack event properties

*/
let shiftModifier;
var shiftModifier;
try {

@@ -343,3 +350,3 @@ shiftModifier = keyMapTable[code].indexOf(keyName) > 0;

return event;
}
};
/**

@@ -352,4 +359,4 @@ * Dispatch keyboard event to custom input or active document element

*/
dispatchSyntheticKeybaordEvent(button, buttonType, allowPass, e) {
const options = this.getOptions();
PhysicalKeyboard.prototype.dispatchSyntheticKeybaordEvent = function (button, buttonType, allowPass, e) {
var options = this.getOptions();
if (e) {

@@ -362,3 +369,3 @@ /**

}
const targetElement = document.activeElement || this.focusedDOMInput;
var targetElement = document.activeElement || this.focusedDOMInput;
/**

@@ -372,3 +379,3 @@ * Our target element can be undefined on both sides, or not a valid element

/** Determine if target element is focused */
const isElementFocused = document.activeElement
var isElementFocused = document.activeElement
? document.activeElement.contains(targetElement)

@@ -381,6 +388,6 @@ : false;

button = button.replace(anyBraces, '');
button = `${button[0].toUpperCase()}${button.slice(1)}`;
button = "".concat(button[0].toUpperCase()).concat(button.slice(1));
}
/** Get the alpha code of a key of keyboard */
const keyCode = Number(this.keyboardInstance.generalKeyboard.getTableKeyCode(button, buttonType === ButtonType.Standard));
var keyCode = Number(this.keyboardInstance.generalKeyboard.getTableKeyCode(button, buttonType === ButtonType.Standard));
this.dispatchingEvent = true;

@@ -391,3 +398,3 @@ /**

if (isElementFocused && keyCode !== KEYBOARD.ENTER) {
const input = this.keyboardInstance.getInput();
var input = this.keyboardInstance.getInput();
/**

@@ -403,3 +410,3 @@ * Check if the computed element is a different element than `input`, so we update using innerText

*/
const targetDOMInput = targetElement;
var targetDOMInput = targetElement;
targetDOMInput.value = input;

@@ -418,3 +425,3 @@ if (!options.lockCursor) {

if (options.debug) {
console.log(`\u001b[1;31mCannot map "${button}" key name to its code\u001b[0m`);
console.log("\u001B[1;31mCannot map \"".concat(button, "\" key name to its code\u001B[0m"));
}

@@ -438,13 +445,14 @@ return;

// Compact key event log
console.log(`\x1B[36mKeyEvent ${JSON.stringify({
console.log("\u001B[36mKeyEvent ".concat(JSON.stringify({
eventType: ['keydown', 'keypress', 'input', 'keyup'],
code: keyCode,
key: button,
})}\x1B[0m`);
}), "\u001B[0m"));
}
}
}
PhysicalKeyboard.beepTone = 'TONE3';
PhysicalKeyboard.beepTime = 90;
};
PhysicalKeyboard.beepTone = 'TONE3';
PhysicalKeyboard.beepTime = 90;
return PhysicalKeyboard;
}());
export default PhysicalKeyboard;
//# sourceMappingURL=PhysicalKeyboard.js.map
/* eslint-disable no-restricted-syntax */
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
/**

@@ -6,10 +17,21 @@ * Bind all methods in a given class. Useful for register and destroy listeners

export function bindMethods(myClass, instance) {
// eslint-disable-next-line no-unused-vars
for (const myMethod of Object.getOwnPropertyNames(myClass.prototype)) {
const excludeMethod = myMethod === 'constructor' || myMethod === 'bindMethods';
if (!excludeMethod) {
instance[myMethod] = instance[myMethod].bind(instance);
var e_1, _a;
try {
// eslint-disable-next-line no-unused-vars
for (var _b = __values(Object.getOwnPropertyNames(myClass.prototype)), _c = _b.next(); !_c.done; _c = _b.next()) {
var myMethod = _c.value;
var excludeMethod = myMethod === 'constructor' || myMethod === 'bindMethods';
if (!excludeMethod) {
instance[myMethod] = instance[myMethod].bind(instance);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
//# sourceMappingURL=bindMethods.js.map

@@ -1,20 +0,20 @@

const prefix = 'mb';
const keyBoardPrefix = `${prefix}-keyboard`;
const variationPrefix = `${prefix}-variation`;
const rowsPrefix = `${prefix}-rows`;
const columnsPrefix = `${prefix}-columns`;
const rowPrefix = `${prefix}-row`;
const columnPrefix = `${prefix}-column`;
const cellPrefix = `${prefix}-cell`;
const layoutPrefix = `${prefix}-layout`;
const layoutNamePrefix = `${layoutPrefix}-name`;
const buttonPrefix = `${prefix}-button`;
const activeButtonClassDefault = `${prefix}-active`;
const hiddenKeyboardClassDefault = `${keyBoardPrefix}-hidden`;
const disabledKeyboardClassDefault = `${keyBoardPrefix}-disabled`;
const themePrefix = `${keyBoardPrefix}-theme`;
const themeDefault = `${themePrefix}-default`;
const suggestionBox = `${prefix}-suggestions`;
const suggestionBoxButton = `${suggestionBox}-button`;
var prefix = 'mb';
var keyBoardPrefix = "".concat(prefix, "-keyboard");
var variationPrefix = "".concat(prefix, "-variation");
var rowsPrefix = "".concat(prefix, "-rows");
var columnsPrefix = "".concat(prefix, "-columns");
var rowPrefix = "".concat(prefix, "-row");
var columnPrefix = "".concat(prefix, "-column");
var cellPrefix = "".concat(prefix, "-cell");
var layoutPrefix = "".concat(prefix, "-layout");
var layoutNamePrefix = "".concat(layoutPrefix, "-name");
var buttonPrefix = "".concat(prefix, "-button");
var activeButtonClassDefault = "".concat(prefix, "-active");
var hiddenKeyboardClassDefault = "".concat(keyBoardPrefix, "-hidden");
var disabledKeyboardClassDefault = "".concat(keyBoardPrefix, "-disabled");
var themePrefix = "".concat(keyBoardPrefix, "-theme");
var themeDefault = "".concat(themePrefix, "-default");
var suggestionBox = "".concat(prefix, "-suggestions");
var suggestionBoxButton = "".concat(suggestionBox, "-button");
export { prefix, keyBoardPrefix, variationPrefix, rowsPrefix, rowPrefix, columnsPrefix, columnPrefix, cellPrefix, layoutPrefix, layoutNamePrefix, buttonPrefix, activeButtonClassDefault, hiddenKeyboardClassDefault, disabledKeyboardClassDefault, themePrefix, themeDefault, suggestionBox, suggestionBoxButton, };
//# sourceMappingURL=classNames.js.map

@@ -7,4 +7,5 @@ /**

*/
export function createKeyboardElement(className, type = 'div') {
const elm = document.createElement(type);
export function createKeyboardElement(className, type) {
if (type === void 0) { type = 'div'; }
var elm = document.createElement(type);
if (className) {

@@ -11,0 +12,0 @@ elm.className += Array.isArray(className) ? className.join(' ') : className;

@@ -12,10 +12,10 @@ import { getButtonType } from './getButtonType';

export function getButtonClass(button) {
const buttonType = getButtonType(button);
let buttonNormalized = '';
var buttonType = getButtonType(button);
var buttonNormalized = '';
if (buttonType !== ButtonType.Standard) {
const buttonWithoutBraces = button.replace(anyBraces, '');
buttonNormalized = ` ${buttonPrefix}-${buttonWithoutBraces}`;
var buttonWithoutBraces = button.replace(anyBraces, '');
buttonNormalized = " ".concat(buttonPrefix, "-").concat(buttonWithoutBraces);
}
return `${prefix}-${buttonType}${buttonNormalized}`;
return "".concat(prefix, "-").concat(buttonType).concat(buttonNormalized);
}
//# sourceMappingURL=getButtonClass.js.map

@@ -0,1 +1,12 @@

var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { getDefaultLabels } from './getDefaultLabels';

@@ -10,5 +21,5 @@ /**

export function getButtonLabelsName(button, labels) {
labels = Object.assign(Object.assign({}, getDefaultLabels()), labels);
labels = __assign(__assign({}, getDefaultLabels()), labels);
return labels[button] || button;
}
//# sourceMappingURL=getButtonLabelsName.js.map
/* eslint-disable prefer-destructuring */
/* eslint-disable camelcase */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
import { merge, kebabCase } from 'lodash';

@@ -17,3 +64,3 @@ import PhysicalKeyboard from './controllers/PhysicalKeyboard';

*/
class Keyboard {
var Keyboard = /** @class */ (function () {
/**

@@ -24,3 +71,4 @@ * Creates an instance of MambaKeyboard

*/
constructor(elementOrOptions, keyboardOptions) {
function Keyboard(elementOrOptions, keyboardOptions) {
var _this = this;
this.activeButtonClass = ClassNames.activeButtonClassDefault;

@@ -49,6 +97,6 @@ this.hiddenKeyboardClass = ClassNames.hiddenKeyboardClassDefault;

*/
this.handleParams = (elementOrOptions, keyboardOptions) => {
let keyboardDOM = null;
let keyboardDOMClass;
let options = keyboardOptions;
this.handleParams = function (elementOrOptions, keyboardOptions) {
var keyboardDOM = null;
var keyboardDOMClass;
var options = keyboardOptions;
/**

@@ -76,3 +124,3 @@ * If first parameter is an HTMLDivElement

*/
keyboardDOM = createKeyboardElement(`${ClassNames.keyBoardPrefix}-generic-wrapper`);
keyboardDOM = createKeyboardElement("".concat(ClassNames.keyBoardPrefix, "-generic-wrapper"));
keyboardDOMClass = keyboardDOM.className;

@@ -84,3 +132,3 @@ options = elementOrOptions;

if (__SIMULATOR__) {
const simulatorWindow = document.querySelector('#apps-container > div:first-child');
var simulatorWindow = document.querySelector('#apps-container > div:first-child');
if (!simulatorWindow)

@@ -94,3 +142,3 @@ throw new Error('SIMULATOR_POS_SCREEN_NOT_FOUND');

*/
const appRoot = document.getElementById('app-root');
var appRoot = document.getElementById('app-root');
if (!appRoot) {

@@ -106,15 +154,15 @@ console.log('app-root not found');

*/
this.parseOptionsUpdated(options);
_this.parseOptionsUpdated(options);
/**
* Update initial sound enabled state
*/
this.updateSoundEnabledState(options);
_this.updateSoundEnabledState(options);
/** Prevent mistouch lose input focus */
keyboardDOM.onmousedown = (event) => {
keyboardDOM.onmousedown = function (event) {
event.preventDefault();
};
return {
keyboardDOMClass,
keyboardDOM,
options,
keyboardDOMClass: keyboardDOMClass,
keyboardDOM: keyboardDOM,
options: options,
};

@@ -126,9 +174,13 @@ };

*/
this.getOptions = () => this.options;
this.getOptions = function () { return _this.options; };
/**
* getKeyboardClassString
*/
this.getKeyboardClassString = (...baseDOMClasses) => {
let { themeVariation: variation } = this.options;
const getVariationClass = (value) => `${ClassNames.variationPrefix}--${value}`;
this.getKeyboardClassString = function () {
var baseDOMClasses = [];
for (var _i = 0; _i < arguments.length; _i++) {
baseDOMClasses[_i] = arguments[_i];
}
var variation = _this.options.themeVariation;
var getVariationClass = function (value) { return "".concat(ClassNames.variationPrefix, "--").concat(value); };
/**

@@ -138,3 +190,3 @@ * Determine the theme variation, string or `KeyboardThemeVariation`

if (typeof variation === 'string') {
const fromType = KeyboardThemeVariation[variation];
var fromType = KeyboardThemeVariation[variation];
if (fromType) {

@@ -150,10 +202,9 @@ variation = fromType;

}
const keyboardClasses = [
var keyboardClasses = __spreadArray([
ClassNames.keyBoardPrefix,
this.keyboardDOMClass,
this.options.debug && 'debug',
this.options.disabled && this.disabledKeyboardClass,
variation && getVariationClass(variation),
...baseDOMClasses,
].filter(Boolean);
_this.keyboardDOMClass,
_this.options.debug && 'debug',
_this.options.disabled && _this.disabledKeyboardClass,
variation && getVariationClass(variation)
], __read(baseDOMClasses), false).filter(Boolean);
return keyboardClasses.join(' ');

@@ -168,3 +219,3 @@ };

this.generalKeyboard = GeneralKeyboard;
const { keyboardDOMClass, keyboardDOM, options = {}, } = this.handleParams(elementOrOptions, keyboardOptions);
var _a = this.handleParams(elementOrOptions, keyboardOptions), keyboardDOMClass = _a.keyboardDOMClass, keyboardDOM = _a.keyboardDOM, _b = _a.options, options = _b === void 0 ? {} : _b;
/**

@@ -197,3 +248,3 @@ * Initializing CursorWorker

if (this.options.debug) {
console.log(`Initial keyboard options: `, this.options);
console.log("Initial keyboard options: ", this.options);
}

@@ -203,3 +254,3 @@ /**

*/
this.initialOptions = Object.assign({}, this.options);
this.initialOptions = __assign({}, this.options);
/**

@@ -252,3 +303,3 @@ * Mamba virtual keyboard uses a non-persistent virtual input to keep track of the entered string (the variable `keyboard.input`).

*/
const { autoRender = false } = this.options;
var _c = this.options.autoRender, autoRender = _c === void 0 ? false : _c;
if (this.keyboardDOM) {

@@ -260,3 +311,3 @@ if (this.isRenderAllowed && (autoRender || this.options.keepVisible)) {

else {
console.warn(`".${keyboardDOMClass}" was not found in the DOM.`);
console.warn("\".".concat(keyboardDOMClass, "\" was not found in the DOM."));
throw new Error('KEYBOARD_DOM_ERROR');

@@ -271,3 +322,4 @@ }

*/
parseOptionsUpdated(options, changed = []) {
Keyboard.prototype.parseOptionsUpdated = function (options, changed) {
if (changed === void 0) { changed = []; }
if (!options)

@@ -319,3 +371,3 @@ return;

if (options.input) {
const pattern = options.input.getAttribute('pattern');
var pattern = options.input.getAttribute('pattern');
if (pattern) {

@@ -326,3 +378,3 @@ options.inputPattern = new RegExp(pattern);

}
}
};
/**

@@ -334,6 +386,7 @@ * Define keyboard type and its properties

*/
parseKeyboardTypeOptions(keyboardOptions) {
Keyboard.prototype.parseKeyboardTypeOptions = function (keyboardOptions) {
var _this = this;
if (!keyboardOptions || typeof keyboardOptions !== 'object')
return undefined;
const keyboardType = keyboardOptions.keyboardType ||
var keyboardType = keyboardOptions.keyboardType ||
(this.options && this.options.keyboardType) ||

@@ -359,4 +412,4 @@ KeyboardType.Default;

*/
const enableLayoutSuggestionsDefault = (this.options && this.options.enableLayoutSuggestionsDefault) || true;
const { enableLayoutSuggestions = enableLayoutSuggestionsDefault } = keyboardOptions;
var enableLayoutSuggestionsDefault = (this.options && this.options.enableLayoutSuggestionsDefault) || true;
var _a = keyboardOptions.enableLayoutSuggestions, enableLayoutSuggestions = _a === void 0 ? enableLayoutSuggestionsDefault : _a;
if ((keyboardType !== KeyboardType.Default && this.suggestionsBox) ||

@@ -374,4 +427,4 @@ (this.suggestionsBox && !enableLayoutSuggestions)) {

keyboardInstance: this,
onSelect: (button, candidate, e) => {
this.handleButtonClicked(button, e, candidate);
onSelect: function (button, candidate, e) {
_this.handleButtonClicked(button, e, candidate);
},

@@ -384,3 +437,3 @@ });

try {
const keyboardSelected = keyboardTypesMap[keyboardType]();
var keyboardSelected = keyboardTypesMap[keyboardType]();
/**

@@ -395,9 +448,9 @@ * Handle keyboard function key event of not custom keyboard type, for layout changes out-of-box

}
return Object.assign({}, keyboardSelected);
return __assign({}, keyboardSelected);
}
catch (e) {
console.log(`the given keyboard ${keyboardType} not found. The valid values are Default, Math, Numeric, Phone or Custom`);
console.log("the given keyboard ".concat(keyboardType, " not found. The valid values are Default, Math, Numeric, Phone or Custom"));
throw new Error('KEYBOARD_TYPE_NOT_FOUND');
}
}
};
/**

@@ -410,4 +463,5 @@ * ! Methods

*/
setOptions(options = {}) {
const changedOptions = this.changedOptions(options);
Keyboard.prototype.setOptions = function (options) {
if (options === void 0) { options = {}; }
var changedOptions = this.changedOptions(options);
/**

@@ -449,9 +503,9 @@ * Parse some options that need be checked first.

}
}
};
/**
* Update sound enabled state from user config
*/
updateSoundEnabledState(options) {
Keyboard.prototype.updateSoundEnabledState = function (options) {
try {
const { soundEnabled } = options || this.options;
var soundEnabled = (options || this.options).soundEnabled;
if (soundEnabled === false)

@@ -466,9 +520,9 @@ return;

}
}
};
/**
* Handles dataset of HTML input and parse its options
*/
handleDOMInputDataset() {
const input = document.activeElement;
const isInput = isProperInput(input);
Keyboard.prototype.handleDOMInputDataset = function () {
var input = document.activeElement;
var isInput = isProperInput(input);
if (isInput &&

@@ -478,3 +532,3 @@ 'keyboardOptions' in input.dataset &&

try {
const keyboardOptions = JSON.parse(input.dataset.keyboardOptions);
var keyboardOptions = JSON.parse(input.dataset.keyboardOptions);
if (keyboardOptions) {

@@ -485,34 +539,38 @@ this.setOptions(keyboardOptions);

catch (e) {
console.warn(`Invalid 'data-keyboard-options' declared on <input>. Must be JSON compatible. ${e}`);
console.warn("Invalid 'data-keyboard-options' declared on <input>. Must be JSON compatible. ".concat(e));
}
}
}
/**
* Controls keyboard visibility, to handle effects
*/
set visibility(value) {
const allowed = this.isRenderAllowed;
if (this.options.debug) {
if (value === KeyboardVisibility.Visible && !allowed) {
console.info(`Set visibility to "${value}" has no effect with renderCondition \`false\``);
}
}
if (!allowed)
return;
if (value === KeyboardVisibility.Hidden && this.options.keepVisible === true) {
};
Object.defineProperty(Keyboard.prototype, "visibility", {
get: function () {
return this.keyboardVisible;
},
/**
* Controls keyboard visibility, to handle effects
*/
set: function (value) {
var allowed = this.isRenderAllowed;
if (this.options.debug) {
console.log(`Cannot set keyboard visibility to ${value} while keepVisible property is "true"`);
if (value === KeyboardVisibility.Visible && !allowed) {
console.info("Set visibility to \"".concat(value, "\" has no effect with renderCondition `false`"));
}
}
value = KeyboardVisibility.Visible;
}
this.handleDOMInputDataset();
this.handleKeyboardVisibility(value);
}
get visibility() {
return this.keyboardVisible;
}
if (!allowed)
return;
if (value === KeyboardVisibility.Hidden && this.options.keepVisible === true) {
if (this.options.debug) {
console.log("Cannot set keyboard visibility to ".concat(value, " while keepVisible property is \"true\""));
}
value = KeyboardVisibility.Visible;
}
this.handleDOMInputDataset();
this.handleKeyboardVisibility(value);
},
enumerable: false,
configurable: true
});
/**
* Clear the keyboard’s input.
*/
clearInput() {
Keyboard.prototype.clearInput = function () {
this.input.default = '';

@@ -523,8 +581,8 @@ /**

this.cursorWorker.setCursorPosition(0);
}
};
/**
* Gets the keyboard’s input (You can also get it from the onChange prop).
*/
getInput() {
const value = this.input.default;
Keyboard.prototype.getInput = function () {
var value = this.input.default;
if (typeof this.options.lastValue === 'string' && value.length <= 1) {

@@ -534,3 +592,3 @@ return this.options.lastValue;

return this.input.default;
}
};
/**

@@ -540,3 +598,3 @@ * Sets the keyboard’s input.

*/
setInput(input) {
Keyboard.prototype.setInput = function (input) {
this.input.default = this.cursorWorker.shouldFilterNumericValue(input);

@@ -548,3 +606,3 @@ if (this.options.debug) {

}
}
};
/**

@@ -554,5 +612,5 @@ * Replaces the input object (`keyboard.input`)

*/
replaceInput(keyboardInput) {
Keyboard.prototype.replaceInput = function (keyboardInput) {
this.input = keyboardInput;
}
};
/**

@@ -562,5 +620,5 @@ * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.

*/
getButtonElement(button) {
let output;
const buttonArr = this.buttonElements[button];
Keyboard.prototype.getButtonElement = function (button) {
var output;
var buttonArr = this.buttonElements[button];
if (buttonArr) {

@@ -575,8 +633,8 @@ if (buttonArr.length > 1) {

return output;
}
};
/**
* This handles the "inputPattern" option by checking if the provided inputPattern passes.
*/
inputPatternIsValid(inputVal) {
const { inputPattern } = this.options;
Keyboard.prototype.inputPatternIsValid = function (inputVal) {
var inputPattern = this.options.inputPattern;
/**

@@ -586,5 +644,5 @@ * Check if input pattern is global or targeted to individual inputs

if (inputPattern instanceof RegExp && inputVal) {
const didInputMatch = inputPattern.test(inputVal);
var didInputMatch = inputPattern.test(inputVal);
if (this.options.debug) {
console.log(`"${inputVal}" with inputPattern ("${inputPattern}"): ${didInputMatch ? 'passed' : 'did not pass!'}`);
console.log("\"".concat(inputVal, "\" with inputPattern (\"").concat(inputPattern, "\"): ").concat(didInputMatch ? 'passed' : 'did not pass!'));
}

@@ -597,10 +655,10 @@ return didInputMatch;

return true;
}
};
/**
* Returns if the current input is valid within current pattern option.
*/
currentInputPatternIsValid() {
const insputStr = this.getInput();
Keyboard.prototype.currentInputPatternIsValid = function () {
var insputStr = this.getInput();
return this.inputPatternIsValid(insputStr);
}
};
/**

@@ -610,63 +668,66 @@ * Change the keyboard type.

*/
setKeyboardType(type) {
Keyboard.prototype.setKeyboardType = function (type) {
var _this = this;
// update after route change
setTimeout(() => {
this.setOptions({
setTimeout(function () {
_this.setOptions({
keyboardType: type,
});
});
}
};
/**
* Set keyboard as default type.
*/
setKeyboardAsDefaultType() {
Keyboard.prototype.setKeyboardAsDefaultType = function () {
this.setOptions({
keyboardType: KeyboardType.Default,
});
}
};
/**
* Set keyboard as math type.
*/
setKeyboardAsMathType() {
Keyboard.prototype.setKeyboardAsMathType = function () {
this.setOptions({
keyboardType: KeyboardType.Math,
});
}
};
/**
* Set keyboard as numeric type.
*/
setKeyboardAsNumericType() {
Keyboard.prototype.setKeyboardAsNumericType = function () {
this.setOptions({
keyboardType: KeyboardType.Numeric,
});
}
};
/**
* Set keyboard as phone type.
*/
setKeyboardAsPhoneType() {
Keyboard.prototype.setKeyboardAsPhoneType = function () {
this.setOptions({
keyboardType: KeyboardType.Phone,
});
}
};
/**
* Set keyboard as custom type.
*/
setKeyboardAsCustomType(options = {}) {
Keyboard.prototype.setKeyboardAsCustomType = function (options) {
if (options === void 0) { options = {}; }
if (this.options.debug) {
console.log(`keyboard.setKeyboardAsCustomType() called`);
console.log("keyboard.setKeyboardAsCustomType() called");
}
this.setOptions(Object.assign({ keyboardType: KeyboardType.Custom }, options));
}
this.setOptions(__assign({ keyboardType: KeyboardType.Custom }, options));
};
/**
* Shows keyboard and mount it if already not.
*/
show() {
Keyboard.prototype.show = function () {
var _this = this;
if (this.options.debug) {
console.log(`keyboard.show() called`);
console.log("keyboard.show() called");
}
setTimeout(() => {
this.render();
this.handleKeyboardVisibility(KeyboardVisibility.Visible);
setTimeout(function () {
_this.render();
_this.handleKeyboardVisibility(KeyboardVisibility.Visible);
});
}
};
/**

@@ -676,18 +737,19 @@ * Hides keyboard.

*/
hide() {
Keyboard.prototype.hide = function () {
var _this = this;
if (this.options.debug) {
console.log(`keyboard.hide() called`);
console.log("keyboard.hide() called");
}
setTimeout(() => {
this.handleKeyboardVisibility(KeyboardVisibility.Hidden);
setTimeout(function () {
_this.handleKeyboardVisibility(KeyboardVisibility.Hidden);
});
}
};
/**
* Resets keyboard properties.
*/
resetOptions() {
Keyboard.prototype.resetOptions = function () {
if (this.options.debug) {
console.log(`keyboard.resetOptions() called`);
console.log("keyboard.resetOptions() called");
}
this.options = Object.assign({}, this.initialOptions);
this.options = __assign({}, this.initialOptions);
/**

@@ -710,23 +772,23 @@ * Reset cursor positions

this.setInput('');
}
};
/**
* Removes all keyboard rows and set visibility to hidden.
*/
unmount() {
Keyboard.prototype.unmount = function () {
if (this.options.debug) {
console.log(`keyboard.unmount() called`);
console.log("keyboard.unmount() called");
}
this.handleKeyboardVisibility(KeyboardVisibility.Hidden);
this.clearRows();
}
};
/**
* Resets keyboard properties and keyboard elements.
*/
reset() {
Keyboard.prototype.reset = function () {
if (this.options.debug) {
console.log(`keyboard.reset() called`);
console.log("keyboard.reset() called");
}
this.resetOptions();
this.clearRows();
}
};
/**

@@ -736,6 +798,7 @@ * Destroy keyboard, remove listeners and DOM elements.

*/
destroy() {
Keyboard.prototype.destroy = function () {
var _this = this;
var _a;
if (this.options.debug) {
console.log(`keyboard.destroy() called`);
console.log("keyboard.destroy() called");
}

@@ -769,4 +832,4 @@ if (this.options.debug) {

this.keyboardDOM.onmousedown = null;
const layoutDirection = this.options.layoutDirection || this.defaultLayoutDirection;
const rowDOM = this.keyboardRowsDOM.querySelector(layoutDirection === LayoutDirection.Vertical
var layoutDirection = this.options.layoutDirection || this.defaultLayoutDirection;
var rowDOM = this.keyboardRowsDOM.querySelector(layoutDirection === LayoutDirection.Vertical
? ClassNames.columnPrefix

@@ -784,3 +847,3 @@ : ClassNames.rowPrefix);

*/
const removeButton = (buttonElement) => {
var removeButton_1 = function (buttonElement) {
var _a;

@@ -797,3 +860,5 @@ if (buttonElement) {

*/
Object.keys(this.buttonElements).forEach((buttonName) => this.buttonElements[buttonName].forEach(removeButton));
Object.keys(this.buttonElements).forEach(function (buttonName) {
return _this.buttonElements[buttonName].forEach(removeButton_1);
});
this.keyboardDOM.innerHTML = '';

@@ -813,3 +878,3 @@ (_a = this.keyboardDOM.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.keyboardDOM);

this.initialized = false;
}
};
/**

@@ -822,6 +887,7 @@ * Bind public methods to the window.$Keyboard wrapper.

*/
static bindToDriver(driver, instance) {
Keyboard.bindToDriver = function (driver, instance) {
var e_1, _a;
if (!driver || instance.driverBinded)
return;
const accessibleMethods = [
var accessibleMethods = [
'setKeyboardType',

@@ -850,10 +916,20 @@ 'setOptions',

];
// eslint-disable-next-line no-restricted-syntax
for (const method of Object.getOwnPropertyNames(Keyboard.prototype)) {
if (accessibleMethods.includes(method)) {
driver[method] = UIGeneralKeyboard.bindWrapper(instance[method].bind(instance));
try {
// eslint-disable-next-line no-restricted-syntax
for (var _b = __values(Object.getOwnPropertyNames(Keyboard.prototype)), _c = _b.next(); !_c.done; _c = _b.next()) {
var method = _c.value;
if (accessibleMethods.includes(method)) {
driver[method] = UIGeneralKeyboard.bindWrapper(instance[method].bind(instance));
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
instance.driverBinded = true;
}
};
/**

@@ -866,5 +942,8 @@ * ! Internal methods

*/
changedOptions(newOptions) {
return Object.keys(newOptions).filter((optionName) => JSON.stringify(newOptions[optionName]) !== JSON.stringify(this.options[optionName]));
}
Keyboard.prototype.changedOptions = function (newOptions) {
var _this = this;
return Object.keys(newOptions).filter(function (optionName) {
return JSON.stringify(newOptions[optionName]) !== JSON.stringify(_this.options[optionName]);
});
};
/**

@@ -876,3 +955,3 @@ * Handles clicks made to keyboard buttons.

*/
handleButtonClicked(button, e, suggestionCandidate) {
Keyboard.prototype.handleButtonClicked = function (button, e, suggestionCandidate) {
var _a, _b;

@@ -883,3 +962,3 @@ if (this.isRenderAllowed !== true)

return;
const focusedInput = document.activeElement;
var focusedInput = document.activeElement;
/**

@@ -890,3 +969,3 @@ * Ignoring placeholder buttons

return;
let buttonOutput = button;
var buttonOutput = button;
/**

@@ -906,22 +985,22 @@ * Converts button from configured {@link KeyboardOptions.outputs} option if any

*/
const buttonType = getButtonType(button);
var buttonType = getButtonType(button);
/**
* Calculating new input
*/
let updatedInput;
var updatedInput;
/**
* Determine if we have a suggestion button here
*/
const isSuggestion = typeof suggestionCandidate === 'string';
var isSuggestion = typeof suggestionCandidate === 'string';
// For suggestion button entry, we need do a lot of processing to handle character replacement
if (isSuggestion) {
const currentInput = this.getInput();
const initialCaretPosition = ((_a = this.cursorWorker) === null || _a === void 0 ? void 0 : _a.getCursorPositionEnd()) || 0;
const inputSubstr = currentInput.substring(0, initialCaretPosition || 0) || currentInput;
const cleanButton = suggestionCandidate.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
const regexp = new RegExp(`${cleanButton}$`, 'g');
const newInputSubstr = inputSubstr.replace(regexp, button);
const newInput = currentInput.replace(inputSubstr, newInputSubstr);
const caretPositionDiff = newInputSubstr.length - inputSubstr.length;
let newCaretPosition = (initialCaretPosition || currentInput.length) + caretPositionDiff;
var currentInput = this.getInput();
var initialCaretPosition = ((_a = this.cursorWorker) === null || _a === void 0 ? void 0 : _a.getCursorPositionEnd()) || 0;
var inputSubstr = currentInput.substring(0, initialCaretPosition || 0) || currentInput;
var cleanButton = suggestionCandidate.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
var regexp = new RegExp("".concat(cleanButton, "$"), 'g');
var newInputSubstr = inputSubstr.replace(regexp, button);
var newInput = currentInput.replace(inputSubstr, newInputSubstr);
var caretPositionDiff = newInputSubstr.length - inputSubstr.length;
var newCaretPosition = (initialCaretPosition || currentInput.length) + caretPositionDiff;
if (newCaretPosition < 0)

@@ -953,3 +1032,3 @@ newCaretPosition = 0;

*/
const isValidInputPattern = this.inputPatternIsValid(updatedInput);
var isValidInputPattern = this.inputPatternIsValid(updatedInput);
if (buttonType !== ButtonType.Function && !isValidInputPattern)

@@ -1008,3 +1087,3 @@ return;

if (this.options.debug) {
console.log('Cursor at: ', this.cursorWorker.getCursorPositionStart(), this.cursorWorker.getCursorPositionEnd(), `(${this.keyboardDOMClass})`, `New input value: "${updatedInput}"`);
console.log('Cursor at: ', this.cursorWorker.getCursorPositionStart(), this.cursorWorker.getCursorPositionEnd(), "(".concat(this.keyboardDOMClass, ")"), "New input value: \"".concat(updatedInput, "\""));
}

@@ -1022,9 +1101,9 @@ /**

if (this.options.debug) {
console.log('Key pressed:', { button, buttonOutput });
console.log('Key pressed:', { button: button, buttonOutput: buttonOutput });
}
}
};
/**
* Handles key dispatcher
*/
shouldDispatchSyntheticKeyEvent(button, buttonOutput, buttonType, isValidInputPattern, e) {
Keyboard.prototype.shouldDispatchSyntheticKeyEvent = function (button, buttonOutput, buttonType, isValidInputPattern, e) {
if (this.isRenderAllowed !== true)

@@ -1034,3 +1113,3 @@ return;

return;
const allowKeyPass = Array.isArray(this.options.allowKeySyntheticEvent) &&
var allowKeyPass = Array.isArray(this.options.allowKeySyntheticEvent) &&
this.options.allowKeySyntheticEvent.includes(button);

@@ -1056,23 +1135,24 @@ /**

}
}
};
/**
* Handles key active class
*/
handleActiveButton(e) {
Keyboard.prototype.handleActiveButton = function (e) {
var _this = this;
if (e) {
const target = e.target;
var target_1 = e.target;
/**
* Add active class
*/
if (target)
target.classList.add(this.activeButtonClass);
if (target_1)
target_1.classList.add(this.activeButtonClass);
/**
* Remove active class after configured time
*/
window.setTimeout(() => {
if (e && target)
target.classList.remove(this.activeButtonClass);
window.setTimeout(function () {
if (e && target_1)
target_1.classList.remove(_this.activeButtonClass);
}, this.activeTime);
}
}
};
/**

@@ -1082,3 +1162,4 @@ * Handles keyboard visibility class

*/
handleKeyboardVisibility(visibility = KeyboardVisibility.Visible) {
Keyboard.prototype.handleKeyboardVisibility = function (visibility) {
if (visibility === void 0) { visibility = KeyboardVisibility.Visible; }
if (!this.isRenderAllowed)

@@ -1112,7 +1193,7 @@ return;

}
}
};
/**
* Handles button mousedown
*/
handleButtonMouseDown(button, e) {
Keyboard.prototype.handleButtonMouseDown = function (button, e) {
if (e) {

@@ -1124,3 +1205,3 @@ /**

}
}
};
/**

@@ -1130,5 +1211,5 @@ * Remove all keyboard rows to reset keyboard elements.

*/
clearRows() {
Keyboard.prototype.clearRows = function () {
if (this.keyboardRowsDOM) {
const { parentNode } = this.keyboardRowsDOM;
var parentNode = this.keyboardRowsDOM.parentNode;
if (parentNode)

@@ -1140,9 +1221,9 @@ parentNode.removeChild(this.keyboardRowsDOM);

this.exist = false;
}
};
/**
* Executes the callback function once virtual keyboard is rendered for the first time (on initialization).
*/
onInit() {
Keyboard.prototype.onInit = function () {
if (this.options.debug) {
console.log(`${this.keyboardDOMClass} Initialized`);
console.log("".concat(this.keyboardDOMClass, " Initialized"));
}

@@ -1155,41 +1236,46 @@ /**

this.options.onInit(this);
}
};
/**
* Executes the callback function before a virtual keyboard render.
*/
beforeFirstRender() {
Keyboard.prototype.beforeFirstRender = function () {
if (typeof this.options.beforeFirstRender === 'function')
this.options.beforeFirstRender(this);
}
};
/**
* Executes the callback function before a virtual keyboard render.
*/
beforeRender() {
Keyboard.prototype.beforeRender = function () {
if (typeof this.options.beforeRender === 'function')
this.options.beforeRender(this);
}
};
/**
* Executes the callback function every time virtual keyboard is rendered (e.g: when you change layouts).
*/
onRender() {
Keyboard.prototype.onRender = function () {
if (typeof this.options.onRender === 'function')
this.options.onRender(this);
}
};
Object.defineProperty(Keyboard.prototype, "isRenderAllowed", {
/**
* Parse render condition
* @returns If keyboard can work or not
*/
get: function () {
if (typeof this.options.renderCondition === 'function') {
return Boolean(this.options.renderCondition());
}
if (typeof this.options.renderCondition === 'undefined') {
return true;
}
return Boolean(this.options.renderCondition);
},
enumerable: false,
configurable: true
});
/**
* Parse render condition
* @returns If keyboard can work or not
*/
get isRenderAllowed() {
if (typeof this.options.renderCondition === 'function') {
return Boolean(this.options.renderCondition());
}
if (typeof this.options.renderCondition === 'undefined') {
return true;
}
return Boolean(this.options.renderCondition);
}
/**
* Update keyboard view
*/
shouldUpdateKeyboardView() {
Keyboard.prototype.shouldUpdateKeyboardView = function () {
var _this = this;
if (!this.keyboardDOM)

@@ -1201,24 +1287,25 @@ return;

// Wait next tick, for svelte render component
this.updateId = window.setTimeout(() => {
this.updateId = window.setTimeout(function () {
/**
* Change keyboard positon to handle mamba <Button /> sticky at the bottom
*/
const bottomButton = document.querySelector('.button.at-bottom');
var bottomButton = document.querySelector('.button.at-bottom');
if (bottomButton) {
this.keyboardDOM.style.marginBottom = `${bottomButton.offsetHeight}px`;
_this.keyboardDOM.style.marginBottom = "".concat(bottomButton.offsetHeight, "px");
}
else {
this.keyboardDOM.style.marginBottom = '';
_this.keyboardDOM.style.marginBottom = '';
}
}, 10);
}
};
/**
* Debounce keyboard rendering
*/
render() {
Keyboard.prototype.render = function () {
var _this = this;
window.clearTimeout(this.renderDebounceId);
this.renderDebounceId = window.setTimeout(() => {
this.trueRender();
this.renderDebounceId = window.setTimeout(function () {
_this.trueRender();
}, this.renderDebounceTime);
}
};
/**

@@ -1230,3 +1317,4 @@ * True renders or update the keyboard buttons

*/
trueRender() {
Keyboard.prototype.trueRender = function () {
var _this = this;
/**

@@ -1251,3 +1339,3 @@ * Clear keyboard

if (this.options.debug) {
console.log(`Rendering/Updating keyboard`);
console.log("Rendering/Updating keyboard");
}

@@ -1265,11 +1353,11 @@ /**

this.beforeRender();
const layout = this.options.layout;
var layout = this.options.layout;
if (!layout) {
console.warn(`"layout" was not found in the options.`);
console.warn("\"layout\" was not found in the options.");
throw new Error('LAYOUT_NOT_FOUND_ERROR');
}
const layoutDirection = this.options.layoutDirection || this.defaultLayoutDirection;
const layoutName = this.options.layoutName || this.defaultLayoutAndName;
const layoutClass = `${ClassNames.layoutNamePrefix}-${layoutName}`;
const layoutDirectionClass = `${ClassNames.layoutPrefix}-${layoutDirection}`;
var layoutDirection = this.options.layoutDirection || this.defaultLayoutDirection;
var layoutName = this.options.layoutName || this.defaultLayoutAndName;
var layoutClass = "".concat(ClassNames.layoutNamePrefix, "-").concat(layoutName);
var layoutDirectionClass = "".concat(ClassNames.layoutPrefix, "-").concat(layoutDirection);
/**

@@ -1289,3 +1377,3 @@ * Adding themeClass, layoutClass to keyboardDOM

if (!layout[layoutName]) {
console.error(`Layout name "${layoutName}" not found in ${JSON.stringify(layout)}`);
console.error("Layout name \"".concat(layoutName, "\" not found in ").concat(JSON.stringify(layout)));
throw new Error('LAYOUT_NAME_NOT_FOUND_ERROR');

@@ -1296,10 +1384,12 @@ }

*/
layout[layoutName].forEach((row, rIndex) => {
let rowArray = row.trim().split(' ');
layout[layoutName].forEach(function (row, rIndex) {
var rowArray = row.trim().split(' ');
/**
* Enforce excludeFromLayout
*/
if (this.options.excludeFromLayout && this.options.excludeFromLayout[layoutName]) {
rowArray = rowArray.filter((buttonName) => this.options.excludeFromLayout &&
!this.options.excludeFromLayout[layoutName].includes(buttonName));
if (_this.options.excludeFromLayout && _this.options.excludeFromLayout[layoutName]) {
rowArray = rowArray.filter(function (buttonName) {
return _this.options.excludeFromLayout &&
!_this.options.excludeFromLayout[layoutName].includes(buttonName);
});
}

@@ -1309,7 +1399,7 @@ /**

*/
const rowDOM = createKeyboardElement(layoutDirection === LayoutDirection.Vertical
var rowDOM = createKeyboardElement(layoutDirection === LayoutDirection.Vertical
? ClassNames.columnPrefix
: ClassNames.rowPrefix);
/** Prevent mistouch lose input focus */
rowDOM.onmousedown = (event) => {
rowDOM.onmousedown = function (event) {
event.preventDefault();

@@ -1320,20 +1410,20 @@ };

*/
rowArray.forEach((button, bIndex) => {
rowArray.forEach(function (button, bIndex) {
/**
* Processing button options
*/
const buttonClass = getButtonClass(button);
const buttonLabelsName = getButtonLabelsName(button, this.options.labels);
var buttonClass = getButtonClass(button);
var buttonLabelsName = getButtonLabelsName(button, _this.options.labels);
/**
* Creating button
*/
const buttonDOM = createKeyboardElement(`${ClassNames.buttonPrefix} ${buttonClass}`);
var buttonDOM = createKeyboardElement("".concat(ClassNames.buttonPrefix, " ").concat(buttonClass));
/**
* Handle mouse events
*/
buttonDOM.onclick = (e) => {
this.handleButtonClicked(button, e);
buttonDOM.onclick = function (e) {
_this.handleButtonClicked(button, e);
};
buttonDOM.onmousedown = (e) => {
this.handleButtonMouseDown(button, e);
buttonDOM.onmousedown = function (e) {
_this.handleButtonMouseDown(button, e);
};

@@ -1343,7 +1433,7 @@ /**

*/
buttonDOM.setAttribute(`data-${ClassNames.prefix}-key`, button);
buttonDOM.setAttribute("data-".concat(ClassNames.prefix, "-key"), button);
/**
* Adding button label to button
*/
const buttonSpanDOM = createKeyboardElement(undefined, 'span');
var buttonSpanDOM = createKeyboardElement(undefined, 'span');
buttonSpanDOM.innerHTML = buttonLabelsName;

@@ -1354,5 +1444,5 @@ buttonDOM.appendChild(buttonSpanDOM);

*/
if (!this.buttonElements[button])
this.buttonElements[button] = [];
this.buttonElements[button].push(buttonDOM);
if (!_this.buttonElements[button])
_this.buttonElements[button] = [];
_this.buttonElements[button].push(buttonDOM);
/**

@@ -1362,3 +1452,3 @@ * Creating button cell for fixed layout

if (layoutDirection === LayoutDirection.Fixed) {
const buttonDOMCell = createKeyboardElement(`${ClassNames.cellPrefix}`);
var buttonDOMCell = createKeyboardElement("".concat(ClassNames.cellPrefix));
buttonDOMCell.appendChild(buttonDOM);

@@ -1380,3 +1470,3 @@ /**

*/
this.keyboardRowsDOM.appendChild(rowDOM);
_this.keyboardRowsDOM.appendChild(rowDOM);
});

@@ -1405,5 +1495,6 @@ /**

}
}
}
};
return Keyboard;
}());
export default Keyboard;
//# sourceMappingURL=Keyboard.js.map

@@ -0,5 +1,6 @@

var _a;
import { KeyboardType, LayoutDirection } from '../types';
import { themeDefault } from '../helpers/classNames';
import { $default, keyDefault, $alt, keyAlt, keyAltback, $shift, keyShift, $symbols, keySymbols, keyEnter, keyBackspace, keySpace, } from '../mappings/keyFunction';
const keyboard = {
var keyboard = {
layoutName: 'default',

@@ -13,4 +14,4 @@ keyboardType: KeyboardType.Default,

'a s d f g h j k l',
`${keyShift} z x c v b n m ${keyBackspace}`,
`${keyAlt} ${keySpace} ${keyEnter}`,
"".concat(keyShift, " z x c v b n m ").concat(keyBackspace),
"".concat(keyAlt, " ").concat(keySpace, " ").concat(keyEnter),
],

@@ -20,4 +21,4 @@ shift: [

'A S D F G H J K L',
`${keyShift} Z X C V B N M ${keyBackspace}`,
`${keyAlt} ${keySpace} ${keyEnter}`,
"".concat(keyShift, " Z X C V B N M ").concat(keyBackspace),
"".concat(keyAlt, " ").concat(keySpace, " ").concat(keyEnter),
],

@@ -27,4 +28,4 @@ alt: [

'- / : ; ( ) $ & @ "',
`${keySymbols} . , ? ! ' ${keyBackspace}`,
`${keyDefault} ${keySpace} ${keyEnter}`,
"".concat(keySymbols, " . , ? ! ' ").concat(keyBackspace),
"".concat(keyDefault, " ").concat(keySpace, " ").concat(keyEnter),
],

@@ -34,9 +35,9 @@ symbols: [

'_ \\ / | ~ < > • `',
`${keyAltback} . , ? ! ' ${keyBackspace}`,
`${keyDefault} ${keySpace} ${keyEnter}`,
"".concat(keyAltback, " . , ? ! ' ").concat(keyBackspace),
"".concat(keyDefault, " ").concat(keySpace, " ").concat(keyEnter),
],
},
internalOnFunctionKeyPress: (button, instance, e) => {
const currentLayout = instance.options.layoutName;
let layoutName;
internalOnFunctionKeyPress: function (button, instance, e) {
var currentLayout = instance.options.layoutName;
var layoutName;
switch (button) {

@@ -59,11 +60,11 @@ case keyShift:

instance.setOptions({
layoutName,
layoutName: layoutName,
});
}
},
labels: {
[keyEnter]: ' ',
},
labels: (_a = {},
_a[keyEnter] = ' ',
_a),
};
export default keyboard;
//# sourceMappingURL=default.js.map

@@ -0,10 +1,11 @@

var _a;
import { KeyboardType } from '../types';
import { Default, Numeric, Phone, Math } from './index';
const keyboardTypesMap = {
[KeyboardType.Default]: () => Default,
[KeyboardType.Numeric]: () => Numeric,
[KeyboardType.Phone]: () => Phone,
[KeyboardType.Math]: () => Math,
};
var keyboardTypesMap = (_a = {},
_a[KeyboardType.Default] = function () { return Default; },
_a[KeyboardType.Numeric] = function () { return Numeric; },
_a[KeyboardType.Phone] = function () { return Phone; },
_a[KeyboardType.Math] = function () { return Math; },
_a);
export default keyboardTypesMap;
//# sourceMappingURL=keyboardTypesMap.js.map

@@ -0,38 +1,50 @@

var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var _a, _b, _c;
import { KeyboardType, LayoutDirection } from '../types';
import { themePrefix } from '../helpers/classNames';
import { keyCheck, keyBackspace } from '../mappings/keyFunction';
const division = '{÷}';
const multiply = '{×}';
const minus = '{−}';
const plus = '{+}';
const equal = '{=}';
const percentage = '{%}';
const clear = '{clear}';
const decimal = '{.}';
const outputsDefault = {
[division]: '/',
[multiply]: '*',
[minus]: '-',
[plus]: '+',
[equal]: '=',
[percentage]: '%',
[decimal]: '.',
[keyBackspace]: '<',
};
const keyboard = {
var division = '{÷}';
var multiply = '{×}';
var minus = '{−}';
var plus = '{+}';
var equal = '{=}';
var percentage = '{%}';
var clear = '{clear}';
var decimal = '{.}';
var outputsDefault = (_a = {},
_a[division] = '/',
_a[multiply] = '*',
_a[minus] = '-',
_a[plus] = '+',
_a[equal] = '=',
_a[percentage] = '%',
_a[decimal] = '.',
_a[keyBackspace] = '<',
_a);
var keyboard = {
layoutName: 'math',
keyboardType: KeyboardType.Math,
layoutDirection: LayoutDirection.Fixed,
theme: `${themePrefix}-math`,
theme: "".concat(themePrefix, "-math"),
layout: {
math: [
`${clear} ${keyBackspace} ${percentage} ${division}`,
`1 2 3 ${multiply}`,
`4 5 6 ${plus}`,
`7 8 9 ${minus}`,
`${decimal} 0 ${equal} ${keyCheck}`,
"".concat(clear, " ").concat(keyBackspace, " ").concat(percentage, " ").concat(division),
"1 2 3 ".concat(multiply),
"4 5 6 ".concat(plus),
"7 8 9 ".concat(minus),
"".concat(decimal, " 0 ").concat(equal, " ").concat(keyCheck),
],
},
labels: Object.assign(Object.assign({}, outputsDefault), { [keyCheck]: ' ', [keyBackspace]: ' ', [clear]: 'C' }),
outputs: Object.assign(Object.assign({}, outputsDefault), { [keyCheck]: 'check', [clear]: 'AC' }),
labels: __assign(__assign({}, outputsDefault), (_b = {}, _b[keyCheck] = ' ', _b[keyBackspace] = ' ', _b[clear] = 'C', _b)),
outputs: __assign(__assign({}, outputsDefault), (_c = {}, _c[keyCheck] = 'check', _c[clear] = 'AC', _c)),
allowKeySyntheticEvent: [division, multiply, minus, plus, equal, decimal, clear, percentage],

@@ -39,0 +51,0 @@ };

@@ -0,21 +1,22 @@

var _a, _b;
import { KeyboardType, LayoutDirection } from '../types';
import { themePrefix } from '../helpers/classNames';
import { keyCheck, keyBackspace } from '../mappings/keyFunction';
const keyboard = {
var keyboard = {
layoutName: 'numeric',
keyboardType: KeyboardType.Numeric,
layoutDirection: LayoutDirection.Fixed,
theme: `${themePrefix}-numeric`,
theme: "".concat(themePrefix, "-numeric"),
layout: {
numeric: [`1 2 3`, '4 5 6', `7 8 9`, `${keyBackspace} 0 ${keyCheck}`],
numeric: ["1 2 3", '4 5 6', "7 8 9", "".concat(keyBackspace, " 0 ").concat(keyCheck)],
},
labels: {
[keyCheck]: ' ',
[keyBackspace]: ' ',
},
outputs: {
[keyCheck]: 'enter',
},
labels: (_a = {},
_a[keyCheck] = ' ',
_a[keyBackspace] = ' ',
_a),
outputs: (_b = {},
_b[keyCheck] = 'enter',
_b),
};
export default keyboard;
//# sourceMappingURL=Numeric.js.map

@@ -0,17 +1,18 @@

var _a;
import { KeyboardType, LayoutDirection } from '../types';
import { themeDefault, themePrefix } from '../helpers/classNames';
import { keyBackspace, keyEnter } from '../mappings/keyFunction';
const keyboard = {
var keyboard = {
layoutName: 'phone',
keyboardType: KeyboardType.Phone,
layoutDirection: LayoutDirection.Fixed,
theme: `${themeDefault} ${themePrefix}-phone`,
theme: "".concat(themeDefault, " ").concat(themePrefix, "-phone"),
layout: {
phone: ['1 2 3', '4 5 6', '7 8 9 ', `${keyBackspace} 0 ${keyEnter}`],
phone: ['1 2 3', '4 5 6', '7 8 9 ', "".concat(keyBackspace, " 0 ").concat(keyEnter)],
},
labels: {
[keyEnter]: ' ',
},
labels: (_a = {},
_a[keyEnter] = ' ',
_a),
};
export default keyboard;
//# sourceMappingURL=Phone.js.map

@@ -7,50 +7,50 @@ /**

*/
const $default = 'default';
const keyDefault = `{${$default}}`;
var $default = 'default';
var keyDefault = "{".concat($default, "}");
/**
* The "{alt}" key layoutName
*/
const $alt = 'alt';
const keyAlt = `{${$alt}}`;
var $alt = 'alt';
var keyAlt = "{".concat($alt, "}");
/**
* The "{altback}" key and layoutName
*/
const $altback = 'altback';
const keyAltback = `{${$altback}}`;
var $altback = 'altback';
var keyAltback = "{".concat($altback, "}");
/**
* The "{shift}" key and layoutName
*/
const $shift = 'shift';
const keyShift = `{${$shift}}`;
var $shift = 'shift';
var keyShift = "{".concat($shift, "}");
/**
* The "{symbols}" key and layoutName
*/
const $symbols = 'symbols';
const keySymbols = `{${$symbols}}`;
var $symbols = 'symbols';
var keySymbols = "{".concat($symbols, "}");
/**
* The "{enter}" key and layoutName
*/
const $enter = 'enter';
const keyEnter = `{${$enter}}`;
var $enter = 'enter';
var keyEnter = "{".concat($enter, "}");
/**
* The "{check}" key and layoutName
*/
const $check = 'check';
const keyCheck = `{${$check}}`;
var $check = 'check';
var keyCheck = "{".concat($check, "}");
/**
* The "{backspace}" key and layoutName
*/
const $backspace = 'backspace';
const keyBackspace = `{${$backspace}}`;
var $backspace = 'backspace';
var keyBackspace = "{".concat($backspace, "}");
/**
* The "{delete}" key and layoutName
*/
const $delete = 'delete';
const keyDelete = `{${$delete}}`;
var $delete = 'delete';
var keyDelete = "{".concat($delete, "}");
/**
* The "{space}" key and layoutName
*/
const $space = 'space';
const keySpace = `{${$space}}`;
var $space = 'space';
var keySpace = "{".concat($space, "}");
export { $default, keyDefault, $alt, keyAlt, $altback, keyAltback, $shift, keyShift, $symbols, keySymbols, $enter, keyEnter, $backspace, keyBackspace, $delete, keyDelete, $space, keySpace, $check, keyCheck, };
//# sourceMappingURL=keyFunction.js.map

@@ -0,1 +1,12 @@

var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { KEYBOARD } from '@mamba/core';

@@ -9,5 +20,5 @@ /**

// Any other key non-listed here must avoid input change for POS environment
export default Object.freeze(Object.assign(Object.assign({}, KEYBOARD.KEY_MAP), { 8: 'Backspace', 48: ['0', ')'], 49: ['1', '!'], 50: ['2', '@'], 51: ['3', '#'], 52: ['4', '$'], 53: ['5', '%'], 54: ['6', '^'], 55: ['7', '&'], 56: ['8', '*'], 57: ['9', '('], 65: ['a', 'A'], 66: ['b', 'B'], 67: ['c', 'C'], 68: ['d', 'D'], 69: ['e', 'E'], 70: ['f', 'F'], 71: ['g', 'G'], 72: ['h', 'H'], 73: ['i', 'I'], 74: ['j', 'J'], 75: ['k', 'K'], 76: ['l', 'L'], 77: ['m', 'M'], 78: ['n', 'N'], 79: ['o', 'O'], 80: ['p', 'P'], 81: ['q', 'Q'], 82: ['r', 'R'], 83: ['s', 'S'], 84: ['t', 'T'], 85: ['u', 'U'], 86: ['v', 'V'], 87: ['w', 'W'], 88: ['x', 'X'], 89: ['y', 'Y'], 90: ['z', 'Z'], 186: [';', ':'], 187: ['=', '+'], 188: [',', '<'], 189: ['-', '_'], 190: ['.', '>'], 191: ['/', '?'], 192: ['`', '~'], 219: ['[', '{'], 220: ['\\', '|'], 221: [']', '}'], 222: [`'`, `"`],
export default Object.freeze(__assign(__assign({}, KEYBOARD.KEY_MAP), { 8: 'Backspace', 48: ['0', ')'], 49: ['1', '!'], 50: ['2', '@'], 51: ['3', '#'], 52: ['4', '$'], 53: ['5', '%'], 54: ['6', '^'], 55: ['7', '&'], 56: ['8', '*'], 57: ['9', '('], 65: ['a', 'A'], 66: ['b', 'B'], 67: ['c', 'C'], 68: ['d', 'D'], 69: ['e', 'E'], 70: ['f', 'F'], 71: ['g', 'G'], 72: ['h', 'H'], 73: ['i', 'I'], 74: ['j', 'J'], 75: ['k', 'K'], 76: ['l', 'L'], 77: ['m', 'M'], 78: ['n', 'N'], 79: ['o', 'O'], 80: ['p', 'P'], 81: ['q', 'Q'], 82: ['r', 'R'], 83: ['s', 'S'], 84: ['t', 'T'], 85: ['u', 'U'], 86: ['v', 'V'], 87: ['w', 'W'], 88: ['x', 'X'], 89: ['y', 'Y'], 90: ['z', 'Z'], 186: [';', ':'], 187: ['=', '+'], 188: [',', '<'], 189: ['-', '_'], 190: ['.', '>'], 191: ['/', '?'], 192: ['`', '~'], 219: ['[', '{'], 220: ['\\', '|'], 221: [']', '}'], 222: ["'", "\""],
// Numpad and math key codes
96: 'Numpad0', 97: 'Numpad1', 98: 'Numpad2', 99: 'Numpad3', 100: 'Numpad4', 101: 'Numpad5', 102: 'Numpad6', 103: 'Numpad7', 104: 'Numpad8', 105: 'Numpad9', 106: '×', 109: '−', 107: '+', 110: '.', 111: '÷' }));
//# sourceMappingURL=keyTableMap.js.map
{
"name": "@mamba/keyboard",
"version": "9.6.0",
"main": "lib/index.js",
"types": "types/index.d.ts",
"svelte": "Keyboard.html",
"version": "9.7.0",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"description": "POS physical keyboard handler and virtual ones",

@@ -36,5 +35,5 @@ "author": "Stone Payments - Mamba Team",

"dependencies": {
"@mamba/core": "^9.6.0",
"@mamba/input": "^9.6.0",
"@mamba/utils": "^9.6.0",
"@mamba/core": "^9.7.0",
"@mamba/input": "^9.7.0",
"@mamba/utils": "^9.7.0",
"@types/lodash": "^4.14.182",

@@ -46,3 +45,3 @@ "lodash": "^4.17.21"

},
"gitHead": "6c7650728443258b4d454de4aa1e5f92c3ab5fef"
"gitHead": "8e792735bdd6b7a0677eb1a2f68734c8a4608f07"
}

@@ -1,3 +0,3 @@

declare type AnyParsedKeyValue = number | string | undefined;
declare type ParsedEventInfo = [AnyParsedKeyValue, AnyParsedKeyValue | null];
type AnyParsedKeyValue = number | string | undefined;
type ParsedEventInfo = [AnyParsedKeyValue, AnyParsedKeyValue | null];
interface KeyEventSupportedModifier {

@@ -4,0 +4,0 @@ shiftKey: boolean;

import { KeyboardType, KeyboardTypesPredefinedOptions } from '../types';
declare type NoCustomKeyboardType = Exclude<KeyboardType, KeyboardType.Custom>;
type NoCustomKeyboardType = Exclude<KeyboardType, KeyboardType.Custom>;
declare const keyboardTypesMap: Record<NoCustomKeyboardType, () => KeyboardTypesPredefinedOptions>;
export default keyboardTypesMap;

@@ -5,3 +5,3 @@ import type Keyboard from './Keyboard';

}
export declare type KeyboardButtonTheme = {
export type KeyboardButtonTheme = {
class: string;

@@ -13,6 +13,6 @@ buttons: string;

}
export declare type CursorPosition = number | null;
export declare type KeyboardElement = HTMLDivElement | HTMLButtonElement | HTMLSpanElement;
export declare type KeyboardInputOption = HTMLInputElement | HTMLDivElement | HTMLElement | undefined;
export declare type KeyboardHandlerEvent = KeyboardEvent | MouseEvent | PointerEvent | UIEvent | Event;
export type CursorPosition = number | null;
export type KeyboardElement = HTMLDivElement | HTMLButtonElement | HTMLSpanElement;
export type KeyboardInputOption = HTMLInputElement | HTMLDivElement | HTMLElement | undefined;
export type KeyboardHandlerEvent = KeyboardEvent | MouseEvent | PointerEvent | UIEvent | Event;
export interface KeyboardButtonElements {

@@ -88,3 +88,3 @@ [key: string]: KeyboardElement[];

}
declare type FunctionKeyPressCallback = (button: string, instance: Keyboard, e?: KeyboardHandlerEvent) => void;
type FunctionKeyPressCallback = (button: string, instance: Keyboard, e?: KeyboardHandlerEvent) => void;
/**

@@ -369,4 +369,4 @@ * KeyboardTypeEvents

}
declare type LabelsOptionType = Pick<KeyboardOptions, 'labels' | 'outputs' | 'layoutSuggestions' | 'enableLayoutSuggestions' | 'allowKeySyntheticEvent'>;
export declare type KeyboardTypesPredefinedOptions = Readonly<(NonNullable<Required<KeyboardTypeOptions>> & LabelsOptionType) & PrefabKeyboardEvents>;
type LabelsOptionType = Pick<KeyboardOptions, 'labels' | 'outputs' | 'layoutSuggestions' | 'enableLayoutSuggestions' | 'allowKeySyntheticEvent'>;
export type KeyboardTypesPredefinedOptions = Readonly<(NonNullable<Required<KeyboardTypeOptions>> & LabelsOptionType) & PrefabKeyboardEvents>;
export interface KeyboardControllerParams {

@@ -376,5 +376,5 @@ getOptions: () => KeyboardOptions;

}
export declare type onSuggestionSelect = (button: string, candidate: string, e?: KeyboardHandlerEvent) => void;
export declare type CursorWorkerParams = KeyboardControllerParams;
export declare type PhysicalKeyboardParams = KeyboardControllerParams;
export type onSuggestionSelect = (button: string, candidate: string, e?: KeyboardHandlerEvent) => void;
export type CursorWorkerParams = KeyboardControllerParams;
export type PhysicalKeyboardParams = KeyboardControllerParams;
export interface SuggestionBoxParams extends KeyboardControllerParams {

@@ -381,0 +381,0 @@ onSelect: onSuggestionSelect;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc