@loadsmart/miranda-wc 1.49.0 → 1.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/keyboard-support/index.d.ts +2 -0
- package/dist/controllers/keyboard-support/index.d.ts.map +1 -0
- package/dist/controllers/keyboard-support/keyboard-support.controller.d.ts +55 -0
- package/dist/controllers/keyboard-support/keyboard-support.controller.d.ts.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controllers/keyboard-support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yBAAyB,EACzB,cAAc,GACd,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { LitElement, ReactiveControllerHost, ReactiveController } from 'lit';
|
|
2
|
+
export type KeyboardSupportControllerHost = ReactiveControllerHost & LitElement;
|
|
3
|
+
export type Shortcut = {
|
|
4
|
+
/**
|
|
5
|
+
* key identifier for the pressed key
|
|
6
|
+
*/
|
|
7
|
+
key: string;
|
|
8
|
+
/**
|
|
9
|
+
* is the meta (Command for Mac, Windows for MS Windows) key pressed?
|
|
10
|
+
*/
|
|
11
|
+
meta?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* is the shift key pressed?
|
|
14
|
+
*/
|
|
15
|
+
shift?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* is the ctrl key pressed?
|
|
18
|
+
*/
|
|
19
|
+
ctrl?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* is the alt key pressed?
|
|
22
|
+
*/
|
|
23
|
+
alt?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ShortcutHandler = (event: KeyboardEvent) => void;
|
|
26
|
+
export type Keymap = {
|
|
27
|
+
shortcut: Shortcut | Shortcut[];
|
|
28
|
+
handler: ShortcutHandler;
|
|
29
|
+
};
|
|
30
|
+
export type KeyboardSupportControllerOptions = {
|
|
31
|
+
getEventTarget: (host: KeyboardSupportControllerHost) => HTMLElement;
|
|
32
|
+
};
|
|
33
|
+
export declare function getShortcutKey(shortcut: Shortcut): string;
|
|
34
|
+
/**
|
|
35
|
+
* Enable a component to implement behavior based on shortcuts.
|
|
36
|
+
*/
|
|
37
|
+
export declare class KeyboardSupportController implements ReactiveController {
|
|
38
|
+
#private;
|
|
39
|
+
host: KeyboardSupportControllerHost;
|
|
40
|
+
keymap: Map<string, ShortcutHandler>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the element to which the keyboard event listener should be attached.
|
|
43
|
+
* This can be useful when you want to prevent [retargetting](https://lit.dev/docs/components/events/#shadowdom), which
|
|
44
|
+
* happens for events fired from the component's shadow DOM.
|
|
45
|
+
*
|
|
46
|
+
* By default, the target element will be the `host` element.
|
|
47
|
+
*
|
|
48
|
+
* @see {@link https://lit.dev/docs/components/events/#adding-event-listeners-to-the-component-or-its-shadow-root Lit, Adding event listeners to the component or its shadow root}
|
|
49
|
+
*/
|
|
50
|
+
getEventTarget: KeyboardSupportControllerOptions['getEventTarget'];
|
|
51
|
+
constructor(host: KeyboardSupportControllerHost, keymap: Keymap | Keymap[], options?: KeyboardSupportControllerOptions | null);
|
|
52
|
+
hostConnected(): Promise<void>;
|
|
53
|
+
hostDisconnected(): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=keyboard-support.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-support.controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/keyboard-support/keyboard-support.controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,KAAK,CAAC;AAGb,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,GAAG,UAAU,CAAC;AAEhF,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE7D,MAAM,MAAM,MAAM,GAAG;IACpB,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAChC,OAAO,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC9C,cAAc,EAAE,CAAC,IAAI,EAAE,6BAA6B,KAAK,WAAW,CAAC;CACrE,CAAC;AAEF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAUzD;AAED;;GAEG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;;IACnE,IAAI,EAAE,6BAA6B,CAAC;IAEpC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAa;IAEjD;;;;;;;;OAQG;IACH,cAAc,EAAE,gCAAgC,CAAC,gBAAgB,CAAC,CAAC;gBAGlE,IAAI,EAAE,6BAA6B,EACnC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EACzB,OAAO,CAAC,EAAE,gCAAgC,GAAG,IAAI;IAgB5C,aAAa;IAInB,gBAAgB;CAwBhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loadsmart/miranda-wc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.50.1",
|
|
4
4
|
"description": "Miranda Web Components component library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
"@storybook/theming": "^7.0.26",
|
|
36
36
|
"@storybook/web-components": "^7.0.26",
|
|
37
37
|
"@storybook/web-components-webpack5": "^7.0.26",
|
|
38
|
-
"@testing-library/cypress": "^
|
|
39
|
-
"cypress": "^
|
|
38
|
+
"@testing-library/cypress": "^10.0.1",
|
|
39
|
+
"cypress": "^13.2.0",
|
|
40
|
+
"cypress-plugin-tab": "^1.0.5",
|
|
40
41
|
"ts-lit-plugin": "^1.2.1"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|