Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7bad85a1fa | |||
e5056a7be3 | |||
989d4d35d2 | |||
c5e75419b3 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.18",
|
||||
"version": "2.0.20",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.18",
|
||||
"version": "2.0.20",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^2.0.3",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.18",
|
||||
"version": "2.0.20",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@designestate/dees-domtools',
|
||||
version: '2.0.20',
|
||||
description: 'tools to simplify complex css structures'
|
||||
}
|
@ -144,6 +144,16 @@ export class Keyboard {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public triggerKeyPress(keysArg: Key[]) {
|
||||
for (const key of keysArg) {
|
||||
this.pressedKeys.add(key);
|
||||
}
|
||||
this.checkMatchingKeyboardSubjects();
|
||||
for (const key of keysArg) {
|
||||
this.pressedKeys.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
public startListening() {
|
||||
this.domNode.addEventListener('keydown', this.handleKeyDown);
|
||||
this.domNode.addEventListener('keyup', this.handleKeyUp);
|
||||
@ -162,13 +172,16 @@ export class Keyboard {
|
||||
|
||||
private handleKeyDown = (event: KeyboardEvent) => {
|
||||
this.pressedKeys.add(event.keyCode);
|
||||
this.checkMatchingKeyboardSubjects(event);
|
||||
};
|
||||
|
||||
private checkMatchingKeyboardSubjects(payloadArg?) {
|
||||
this.mapCombosToHandlers.forEach((subjectArg, keysArg) => {
|
||||
if (this.areAllKeysPressed(keysArg)) {
|
||||
subjectArg.next(event);
|
||||
subjectArg.next(payloadArg);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
private handleKeyUp = (event: KeyboardEvent) => {
|
||||
this.pressedKeys.delete(event.keyCode);
|
||||
|
@ -6,12 +6,11 @@ import { css, unsafeCSS } from 'lit';
|
||||
* changes scrollbar styles to be consistent across OS borders
|
||||
*/
|
||||
export const scrollBarStyles: string = (() => {
|
||||
const returnStyles =
|
||||
navigator.userAgent.indexOf('Mac OS X') === -1
|
||||
? css`
|
||||
const returnStylesOld = navigator.userAgent.indexOf('Mac OS X') === -1 ? css``.cssText : ``;
|
||||
const returnStyles = css`
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
@ -28,8 +27,7 @@ export const scrollBarStyles: string = (() => {
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #777;
|
||||
}
|
||||
`.cssText
|
||||
: ``;
|
||||
`.cssText;
|
||||
return returnStyles;
|
||||
})();
|
||||
|
||||
|
Reference in New Issue
Block a user