UNPKG

angular-onscreen-material-keyboard

Version:

This package is forked from ngx-material-keyboard with bug fixes and additional features

1,044 lines (1,032 loc) 394 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('@angular/core'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/animations'), require('@angular/material/core'), require('rxjs/operators'), require('@angular/forms'), require('@angular/common'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/input')) : typeof define === 'function' && define.amd ? define('angular-onscreen-material-keyboard', ['exports', 'rxjs', '@angular/core', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/animations', '@angular/material/core', 'rxjs/operators', '@angular/forms', '@angular/common', '@angular/material/button', '@angular/material/icon', '@angular/material/input'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['angular-onscreen-material-keyboard'] = {}, global.rxjs, global.ng.core, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.animations, global.ng.material.core, global.rxjs.operators, global.ng.forms, global.ng.common, global.ng.material.button, global.ng.material.icon, global.ng.material.input)); }(this, (function (exports, rxjs, core$1, a11y, overlay, portal, animations, core, operators, forms, common, button, icon, input) { 'use strict'; /** * Reference to a keyboard dispatched from the keyboard service. */ var MatKeyboardRef = /** @class */ (function () { function MatKeyboardRef(instance, containerInstance, _overlayRef) { var _this = this; this._overlayRef = _overlayRef; /** Subject for notifying the user that the keyboard has closed. */ this._afterClosed = new rxjs.Subject(); /** Subject for notifying the user that the keyboard has opened and appeared. */ this._afterOpened = new rxjs.Subject(); // Sets the readonly instance of the keyboard content component. this.instance = instance; this.containerInstance = containerInstance; // Finish dismiss on exitting containerInstance.onExit.subscribe(function () { return _this._finishDismiss(); }); } /** Dismisses the keyboard. */ MatKeyboardRef.prototype.dismiss = function () { if (!this._afterClosed.closed) { this.containerInstance.exit(); } }; /** Marks the keyboard as opened */ MatKeyboardRef.prototype._open = function () { if (!this._afterOpened.closed) { this._afterOpened.next(); this._afterOpened.complete(); } }; /** Gets an observable that is notified when the keyboard is finished closing. */ MatKeyboardRef.prototype.afterDismissed = function () { return this._afterClosed.asObservable(); }; /** Gets an observable that is notified when the keyboard has opened and appeared. */ MatKeyboardRef.prototype.afterOpened = function () { return this.containerInstance.onEnter; }; /** Cleans up the DOM after closing. */ MatKeyboardRef.prototype._finishDismiss = function () { this._overlayRef.dispose(); this._afterClosed.next(); this._afterClosed.complete(); }; return MatKeyboardRef; }()); // TODO: use real string based enums (available sine typescript 1.4) if (function (KeyboardClassKey) { KeyboardClassKey["Alt"] = "Alt"; KeyboardClassKey["AltGr"] = "AltGraph"; KeyboardClassKey["AltLk"] = "AltLk"; KeyboardClassKey["Bksp"] = "Backspace"; KeyboardClassKey["Caps"] = "CapsLock"; KeyboardClassKey["Enter"] = "Enter"; KeyboardClassKey["Shift"] = "Shift"; KeyboardClassKey["Space"] = " "; KeyboardClassKey["Tab"] = "Tab"; })(exports.KeyboardClassKey || (exports.KeyboardClassKey = {})); var _a; var KEYBOARD_ICONS = (_a = {}, _a[exports.KeyboardClassKey.Bksp] = { name: 'keyboard_backspace' }, _a[exports.KeyboardClassKey.Caps] = { name: 'keyboard_capslock' }, _a[exports.KeyboardClassKey.Enter] = { name: 'keyboard_return' }, _a[exports.KeyboardClassKey.Shift] = { name: 'keyboard_arrow_up' }, _a[exports.KeyboardClassKey.Space] = { name: ' ' }, _a[exports.KeyboardClassKey.Tab] = { name: 'keyboard_tab' }, _a); // this enum index has to be number based because it is used (function (KeyboardModifier) { KeyboardModifier[KeyboardModifier["None"] = 0] = "None"; KeyboardModifier[KeyboardModifier["Shift"] = 1] = "Shift"; KeyboardModifier[KeyboardModifier["Alt"] = 2] = "Alt"; KeyboardModifier[KeyboardModifier["ShiftAlt"] = 3] = "ShiftAlt"; })(exports.KeyboardModifier || (exports.KeyboardModifier = {})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function () { __assign = Object.assign || function __assign(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); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function (o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); }) : (function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(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."); } function __read(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; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i]; return to; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } ; var __setModuleDefault = Object.create ? (function (o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function (o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } (function (KeyboardAnimationState) { KeyboardAnimationState["Void"] = "void"; KeyboardAnimationState["Visible"] = "visible"; KeyboardAnimationState["Hidden"] = "hidden"; })(exports.KeyboardAnimationState || (exports.KeyboardAnimationState = {})); // import { KeyboardAnimationState } from './keyboard-animation-state.enum'; (function (KeyboardAnimationTransition) { KeyboardAnimationTransition["Hide"] = "visible => hidden"; KeyboardAnimationTransition["Show"] = "void => visible"; })(exports.KeyboardAnimationTransition || (exports.KeyboardAnimationTransition = {})); // TODO: we can't use constants from animation.ts here because you can't use // a text interpolation in anything that is analyzed statically with ngc (for AoT compile). var SHOW_ANIMATION = core.AnimationDurations.ENTERING + " " + core.AnimationCurves.DECELERATION_CURVE; var HIDE_ANIMATION = core.AnimationDurations.EXITING + " " + core.AnimationCurves.ACCELERATION_CURVE; /** * Internal component that wraps user-provided keyboard content. * @docs-private */ var MatKeyboardContainerComponent = /** @class */ (function (_super) { __extends(MatKeyboardContainerComponent, _super); function MatKeyboardContainerComponent(_ngZone, _changeDetectorRef) { var _this = _super.call(this) || this; _this._ngZone = _ngZone; _this._changeDetectorRef = _changeDetectorRef; /** Whether the component has been destroyed. */ _this._destroyed = false; /** The state of the keyboard animations. */ _this._animationState = exports.KeyboardAnimationState.Void; /** Subject for notifying that the keyboard has exited from view. */ _this.onExit = new rxjs.Subject(); /** Subject for notifying that the keyboard has finished entering the view. */ _this.onEnter = new rxjs.Subject(); _this.attrRole = 'alert'; return _this; } MatKeyboardContainerComponent.prototype.onMousedown = function (event) { event.preventDefault(); }; /** Attach a component portal as content to this keyboard container. */ MatKeyboardContainerComponent.prototype.attachComponentPortal = function (portal) { if (this._portalOutlet.hasAttached()) { throw Error('Attempting to attach keyboard content after content is already attached'); } return this._portalOutlet.attachComponentPortal(portal); }; // Attach a template portal as content to this keyboard container MatKeyboardContainerComponent.prototype.attachTemplatePortal = function () { throw Error('Not yet implemented'); }; /** Handle end of animations, updating the state of the keyboard. */ MatKeyboardContainerComponent.prototype.onAnimationEnd = function (event) { var fromState = event.fromState, toState = event.toState; if ((toState === exports.KeyboardAnimationState.Void && fromState !== exports.KeyboardAnimationState.Void) || toState.startsWith('hidden')) { this._completeExit(); } if (toState === exports.KeyboardAnimationState.Visible) { // Note: we shouldn't use `this` inside the zone callback, // because it can cause a memory leak. var onEnter_1 = this.onEnter; this._ngZone.run(function () { onEnter_1.next(); onEnter_1.complete(); }); } }; /** Begin animation of keyboard entrance into view. */ MatKeyboardContainerComponent.prototype.enter = function () { if (!this._destroyed) { this._animationState = exports.KeyboardAnimationState.Visible; this._changeDetectorRef.detectChanges(); } }; /** Begin animation of the snack bar exiting from view. */ MatKeyboardContainerComponent.prototype.exit = function () { this._animationState = exports.KeyboardAnimationState.Hidden; return this.onExit; }; /** * Makes sure the exit callbacks have been invoked when the element is destroyed. */ MatKeyboardContainerComponent.prototype.ngOnDestroy = function () { this._destroyed = true; this._completeExit(); }; /** * Waits for the zone to settle before removing the element. Helps prevent * errors where we end up removing an element which is in the middle of an animation. */ MatKeyboardContainerComponent.prototype._completeExit = function () { var _this = this; this._ngZone.onMicrotaskEmpty .asObservable() .pipe(operators.first()) .subscribe(function () { _this.onExit.next(); _this.onExit.complete(); }); }; return MatKeyboardContainerComponent; }(portal.BasePortalOutlet)); MatKeyboardContainerComponent.decorators = [ { type: core$1.Component, args: [{ selector: 'mat-keyboard-container', template: "<ng-template cdkPortalHost></ng-template>\n", changeDetection: core$1.ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, // animations: [ // trigger('state', [ // state('visible', style({transform: 'translateY(0%)'})), // transition('visible => hidden', animate(HIDE_ANIMATION)), // transition('void => visible', animate(SHOW_ANIMATION)), // ]) // ] animations: [ animations.trigger('state', [ animations.state("" + exports.KeyboardAnimationState.Visible, animations.style({ transform: 'translateY(0%)' })), animations.transition("" + exports.KeyboardAnimationTransition.Hide, animations.animate(HIDE_ANIMATION)), animations.transition("" + exports.KeyboardAnimationTransition.Show, animations.animate(SHOW_ANIMATION)) ]) ], styles: [":host{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);border-radius:2px;box-sizing:border-box;display:block;margin:0 auto;max-width:960px;min-width:568px;transform:translateY(100%)}.cdk-high-contrast-active :host,.cdk-high-contrast-active :host :host{border:1px solid}"] },] } ]; MatKeyboardContainerComponent.ctorParameters = function () { return [ { type: core$1.NgZone }, { type: core$1.ChangeDetectorRef } ]; }; MatKeyboardContainerComponent.propDecorators = { _portalOutlet: [{ type: core$1.ViewChild, args: [portal.CdkPortalOutlet, { static: true },] }], _animationState: [{ type: core$1.HostBinding, args: ['@state',] }], attrRole: [{ type: core$1.HostBinding, args: ['attr.role',] }], onMousedown: [{ type: core$1.HostListener, args: ['mousedown', ['$event'],] }], onAnimationEnd: [{ type: core$1.HostListener, args: ['@state.done', ['$event'],] }] }; /* * README from http://www.greywyvern.com/code/javascript/keyboard.js * ------ * * - Lay out each keyboard in rows of sub-arrays. Each sub-array * represents one key. * * - Each sub-array consists of four slots described as follows: * example: ["a", "A", "\u00e1", "\u00c1"] * * a) Normal character * A) Character + Shift/Caps * \u00e1) Character + Alt/AltGr/AltLk * \u00c1) Character + Shift/Caps + Alt/AltGr/AltLk * * You may include sub-arrays which are fewer than four slots. * In these cases, the missing slots will be blanked when the * corresponding modifier key (Shift or AltGr) is pressed. * * - If the second slot of a sub-array matches one of the following * strings: * "Tab", "Caps", "Shift", "Enter", "Bksp", * "Alt" OR "AltGr", "AltLk" * then the function of the key will be the following, * respectively: * - Insert a tab * - Toggle Caps Lock (technically a Shift Lock) * - Next entered character will be the shifted character * - Insert a newline (textarea), or close the keyboard * - Delete the previous character * - Next entered character will be the alternate character * - Toggle Alt/AltGr Lock * * The first slot of this sub-array will be the text to display * on the corresponding key. This allows for easy localisation * of key names. * * - Layout dead keys (diacritic + letter) should be added as * property/value pairs of objects with hash keys equal to the * diacritic. See the "this.VKI_deadkey" object below the layout * definitions. In each property/value pair, the value is what * the diacritic would change the property name to. * * - Note that any characters beyond the normal ASCII set should be * entered in escaped Unicode format. (eg \u00a3 = Pound symbol) * You can find Unicode values for characters here: * http://unicode.org/charts/ * * - To remove a keyboard, just delete it, or comment it out of the * source code. If you decide to remove the US International * keyboard layout, make sure you change the default layout * (this.VKI_kt) above so it references an existing layout. * * CREDITS * ------- * * See http://www.greywyvern.com/code/javascript/keyboard for examples * and usage instructions. * * Version 1.49 - November 8, 2011 * - Don't display language drop-down if only one keyboard available * * See full changelog at: * http://www.greywyvern.com/code/javascript/keyboard.changelog.txt * * Keyboard Credits * - Yiddish (Yidish Lebt) keyboard layout by Simche Taub (jidysz.net) * - Urdu Phonetic keyboard layout by Khalid Malik * - Yiddish keyboard layout by Helmut Wollmersdorfer * - Khmer keyboard layout by Sovann Heng (km-kh.com) * - Dari keyboard layout by Saif Fazel * - Kurdish keyboard layout by Ara Qadir * - Assamese keyboard layout by Kanchan Gogoi * - Bulgarian BDS keyboard layout by Milen Georgiev * - Basic Japanese Hiragana/Katakana keyboard layout by Damjan * - Ukrainian keyboard layout by Dmitry Nikitin * - Macedonian keyboard layout by Damjan Dimitrioski * - Pashto keyboard layout by Ahmad Wali Achakzai (qamosona.com) * - Armenian Eastern and Western keyboard layouts by Hayastan Project (www.hayastan.co.uk) * - Pinyin keyboard layout from a collaboration with Lou Winklemann * - Kazakh keyboard layout by Alex Madyankin * - Danish keyboard layout by Verner Kjærsgaard * - Slovak keyboard layout by Daniel Lara (www.learningslovak.com) * - Belarusian and Serbian Cyrillic keyboard layouts by Evgeniy Titov * - Bulgarian Phonetic keyboard layout by Samuil Gospodinov * - Swedish keyboard layout by Håkan Sandberg * - Romanian keyboard layout by Aurel * - Farsi (Persian) keyboard layout by Kaveh Bakhtiyari (www.bakhtiyari.com) * - Burmese keyboard layout by Cetanapa * - Bosnian/Croatian/Serbian Latin/Slovenian keyboard layout by Miran Zeljko * - Hungarian keyboard layout by Antal Sall 'Hiromacu' * - Arabic keyboard layout by Srinivas Reddy * - Italian and Spanish (Spain) keyboard layouts by dictionarist.com * - Lithuanian and Russian keyboard layouts by Ramunas * - German keyboard layout by QuHno * - French keyboard layout by Hidden Evil * - Polish Programmers layout by moose * - Turkish keyboard layouts by offcu * - Dutch and US Int'l keyboard layouts by jerone * */ var MAT_KEYBOARD_LAYOUTS = new core$1.InjectionToken('keyboard-layouts.config'); var keyboardLayouts = { '\u0627\u0644\u0639\u0631\u0628\u064a\u0629': { 'name': 'Arabic', 'keys': [ [ ['\u0630', '\u0651 '], ['1', '!', '\u00a1', '\u00b9'], ['2', '@', '\u00b2'], ['3', '#', '\u00b3'], ['4', '$', '\u00a4', '\u00a3'], ['5', '%', '\u20ac'], ['6', '^', '\u00bc'], ['7', '&', '\u00bd'], ['8', '*', '\u00be'], ['9', '(', '\u2018'], ['0', ')', '\u2019'], ['-', '_', '\u00a5'], ['=', '+', '\u00d7', '\u00f7'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['\u0636', '\u064e'], ['\u0635', '\u064b'], ['\u062b', '\u064f'], ['\u0642', '\u064c'], ['\u0641', '\u0644'], ['\u063a', '\u0625'], ['\u0639', '\u2018'], ['\u0647', '\u00f7'], ['\u062e', '\u00d7'], ['\u062d', '\u061b'], ['\u062c', '<'], ['\u062f', '>'], ['\\', '|'] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['\u0634', '\u0650'], ['\u0633', '\u064d'], ['\u064a', ']'], ['\u0628', '['], ['\u0644', '\u0644'], ['\u0627', '\u0623'], ['\u062a', '\u0640'], ['\u0646', '\u060c'], ['\u0645', '/'], ['\u0643', ':'], ['\u0637', '"'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['\u0626', '~'], ['\u0621', '\u0652'], ['\u0624', '}'], ['\u0631', '{'], ['\u0644', '\u0644'], ['\u0649', '\u0622'], ['\u0629', '\u2019'], ['\u0648', ','], ['\u0632', '.'], ['\u0638', '\u061f'], [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift] ], [ [exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space], [exports.KeyboardClassKey.Alt, exports.KeyboardClassKey.Alt, exports.KeyboardClassKey.Alt, exports.KeyboardClassKey.Alt] ] ], 'lang': ['ar'] }, '\u0985\u09b8\u09ae\u09c0\u09df\u09be': { 'name': 'Assamese', 'keys': [ [ ['+', '?'], ['\u09E7', '{', '\u09E7'], ['\u09E8', '}', '\u09E8'], ['\u09E9', '\u09CD\u09F0', '\u09E9'], ['\u09EA', '\u09F0\u09CD', '\u09EA'], ['\u09EB', '\u099C\u09CD\u09F0', '\u09EB'], ['\u09EC', '\u0995\u09CD\u09B7', '\u09EC'], ['\u09ED', '\u0995\u09CD\u09F0', '\u09ED'], ['\u09EE', '\u09B6\u09CD\u09F0', '\u09EE'], ['\u09EF', '(', '\u09EF'], ['\u09E6', ')', '\u09E6'], ['-', ''], ['\u09C3', '\u098B', '\u09E2', '\u09E0'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['\u09CC', '\u0994', '\u09D7'], ['\u09C8', '\u0990'], ['\u09BE', '\u0986'], ['\u09C0', '\u0988', '\u09E3', '\u09E1'], ['\u09C2', '\u098A'], ['\u09F1', '\u09AD'], ['\u09B9', '\u0999'], ['\u0997', '\u0998'], ['\u09A6', '\u09A7'], ['\u099C', '\u099D'], ['\u09A1', '\u09A2', '\u09DC', '\u09DD'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['\u09CB', '\u0993', '\u09F4', '\u09F5'], ['\u09C7', '\u098F', '\u09F6', '\u09F7'], ['\u09CD', '\u0985', '\u09F8', '\u09F9'], ['\u09BF', '\u0987', '\u09E2', '\u098C'], ['\u09C1', '\u0989'], ['\u09AA', '\u09AB'], ['\u09F0', '', '\u09F0', '\u09F1'], ['\u0995', '\u0996'], ['\u09A4', '\u09A5'], ['\u099A', '\u099B'], ['\u099F', '\u09A0'], ['\u09BC', '\u099E'] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['\u09CE', '\u0983'], ['\u0982', '\u0981', '\u09FA'], ['\u09AE', '\u09A3'], ['\u09A8', '\u09F7'], ['\u09AC', '"'], ['\u09B2', '\''], ['\u09B8', '\u09B6'], [',', '\u09B7'], ['.', ';'], ['\u09AF', '\u09DF'], [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift] ], [ [exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space], [exports.KeyboardClassKey.AltGr, exports.KeyboardClassKey.AltGr, exports.KeyboardClassKey.AltGr, exports.KeyboardClassKey.AltGr] ] ], 'lang': ['as'] }, '\u0410\u0437\u04d9\u0440\u0431\u0430\u0458\u04b9\u0430\u043d\u04b9\u0430': { 'name': 'Azerbaijani Cyrillic', 'keys': [ [ ['`', '~'], ['1', '!'], ['2', '"'], ['3', '\u2116'], ['4', ';'], ['5', '%'], ['6', ':'], ['7', '?'], ['8', '*'], ['9', '('], ['0', ')'], ['-', '_'], ['=', '+'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['\u0458', '\u0408'], ['\u04AF', '\u04AE'], ['\u0443', '\u0423'], ['\u043A', '\u041A'], ['\u0435', '\u0415'], ['\u043D', '\u041D'], ['\u0433', '\u0413'], ['\u0448', '\u0428'], ['\u04BB', '\u04BA'], ['\u0437', '\u0417'], ['\u0445', '\u0425'], ['\u04B9', '\u04B8'], ['\\', '/'] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['\u0444', '\u0424'], ['\u044B', '\u042B'], ['\u0432', '\u0412'], ['\u0430', '\u0410'], ['\u043F', '\u041F'], ['\u0440', '\u0420'], ['\u043E', '\u041E'], ['\u043B', '\u041B'], ['\u0434', '\u0414'], ['\u0436', '\u0416'], ['\u049D', '\u049C'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['\\', '|'], ['\u04D9', '\u04D8'], ['\u0447', '\u0427'], ['\u0441', '\u0421'], ['\u043C', '\u041C'], ['\u0438', '\u0418'], ['\u0442', '\u0422'], ['\u0493', '\u0492'], ['\u0431', '\u0411'], ['\u04E9', '\u04E8'], ['.', ','], [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift] ], [ [exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space] ] ], 'lang': ['az-CYRL'] }, 'Az\u0259rbaycanca': { 'name': 'Azerbaijani Latin', 'keys': [ [ ['`', '~'], ['1', '!'], ['2', '"'], ['3', '\u2166'], ['4', ';'], ['5', '%'], ['6', ':'], ['7', '?'], ['8', '*'], ['9', '('], ['0', ')'], ['-', '_'], ['=', '+'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['q', 'Q'], ['\u00FC', '\u00DC'], ['e', 'E'], ['r', 'R'], ['t', 'T'], ['y', 'Y'], ['u', 'U'], ['i', '\u0130'], ['o', 'O'], ['p', 'P'], ['\u00F6', '\u00D6'], ['\u011F', '\u011E'], ['\\', '/'] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['a', 'A'], ['s', 'S'], ['d', 'D'], ['f', 'F'], ['g', 'G'], ['h', 'H'], ['j', 'J'], ['k', 'K'], ['l', 'L'], ['\u0131', 'I'], ['\u0259', '\u018F'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['z', 'Z'], ['x', 'X'], ['c', 'C'], ['v', 'V'], ['b', 'B'], ['n', 'N'], ['m', 'M'], ['\u00E7', '\u00C7'], ['\u015F', '\u015E'], ['.', ','], [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift] ], [ [exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space] ] ], 'lang': ['az'] }, '\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f': { 'name': 'Belarusian', 'keys': [ [ ['\u0451', '\u0401'], ['1', '!'], ['2', '"'], ['3', '\u2116'], ['4', ';'], ['5', '%'], ['6', ':'], ['7', '?'], ['8', '*'], ['9', '('], ['0', ')'], ['-', '_'], ['=', '+'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['\u0439', '\u0419'], ['\u0446', '\u0426'], ['\u0443', '\u0423'], ['\u043a', '\u041a'], ['\u0435', '\u0415'], ['\u043d', '\u041d'], ['\u0433', '\u0413'], ['\u0448', '\u0428'], ['\u045e', '\u040e'], ['\u0437', '\u0417'], ['\u0445', '\u0425'], ['\'', '\''], ['\\', '/'] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['\u0444', '\u0424'], ['\u044b', '\u042b'], ['\u0432', '\u0412'], ['\u0430', '\u0410'], ['\u043f', '\u041f'], ['\u0440', '\u0420'], ['\u043e', '\u041e'], ['\u043b', '\u041b'], ['\u0434', '\u0414'], ['\u0436', '\u0416'], ['\u044d', '\u042d'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['/', '|'], ['\u044f', '\u042f'], ['\u0447', '\u0427'], ['\u0441', '\u0421'], ['\u043c', '\u041c'], ['\u0456', '\u0406'], ['\u0442', '\u0422'], ['\u044c', '\u042c'], ['\u0431', '\u0411'], ['\u044e', '\u042e'], ['.', ','], [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift] ], [ [exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space, exports.KeyboardClassKey.Space] ] ], 'lang': ['be'] }, 'Belgische / Belge': { 'name': 'Belgian', 'keys': [ [ ['\u00b2', '\u00b3'], ['&', '1', '|'], ['\u00e9', '2', '@'], ['"', '3', '#'], ['\'', '4'], ['(', '5'], ['\u00a7', '6', '^'], ['\u00e8', '7'], ['!', '8'], ['\u00e7', '9', '{'], ['\u00e0', '0', '}'], [')', '\u00b0'], ['-', '_'], [exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp, exports.KeyboardClassKey.Bksp] ], [ [exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab, exports.KeyboardClassKey.Tab], ['a', 'A'], ['z', 'Z'], ['e', 'E', '\u20ac'], ['r', 'R'], ['t', 'T'], ['y', 'Y'], ['u', 'U'], ['i', 'I'], ['o', 'O'], ['p', 'P'], ['^', '\u00a8', '['], ['$', '*', ']'], ['\u03bc', '\u00a3', '`'] ], [ [exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps, exports.KeyboardClassKey.Caps], ['q', 'Q'], ['s', 'S'], ['d', 'D'], ['f', 'F'], ['g', 'G'], ['h', 'H'], ['j', 'J'], ['k', 'K'], ['l', 'L'], ['m', 'M'], ['\u00f9', '%', '\u00b4'], [exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter, exports.KeyboardClassKey.Enter] ], [ [exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift, exports.KeyboardClassKey.Shift], ['<', '>', '\\'], ['w', 'W'], ['x', 'X'], ['c', 'C'], ['v', 'V'],