@stonecrop/utilities 0.2.64 → 0.2.66
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/composables/keyboard.js +9 -0
- package/dist/index.js +1 -1
- package/dist/src/composables/keyboard.d.ts +9 -0
- package/dist/src/composables/keyboard.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/{utilities/src → src}/tsdoc-metadata.json +1 -1
- package/dist/src/types/index.d.ts +8 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/utilities.d.ts +54 -8
- package/dist/utilities.js.map +1 -1
- package/dist/utilities.tsbuildinfo +1 -1
- package/dist/utilities.umd.cjs.map +1 -1
- package/package.json +6 -6
- package/src/composables/keyboard.ts +9 -0
- package/src/index.ts +2 -2
- package/src/types/index.ts +8 -0
|
@@ -192,6 +192,10 @@ const eventKeyMap = {
|
|
|
192
192
|
ArrowLeft: 'left',
|
|
193
193
|
ArrowRight: 'right',
|
|
194
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* Default keypress handlers for keyboard navigation
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
195
199
|
export const defaultKeypressHandlers = {
|
|
196
200
|
'keydown.up': (event) => {
|
|
197
201
|
const $upCell = getUpCell(event);
|
|
@@ -320,6 +324,11 @@ export const defaultKeypressHandlers = {
|
|
|
320
324
|
}
|
|
321
325
|
},
|
|
322
326
|
};
|
|
327
|
+
/**
|
|
328
|
+
* Keyboard navigation composable
|
|
329
|
+
* @param options - Keyboard navigation options
|
|
330
|
+
* @public
|
|
331
|
+
*/
|
|
323
332
|
export function useKeyboardNav(options) {
|
|
324
333
|
const getParentElement = (option) => {
|
|
325
334
|
let $parent = null;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { KeyboardNavigationOptions, KeypressHandlers } from '@/types';
|
|
2
|
+
/**
|
|
3
|
+
* Default keypress handlers for keyboard navigation
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
2
6
|
export declare const defaultKeypressHandlers: KeypressHandlers;
|
|
7
|
+
/**
|
|
8
|
+
* Keyboard navigation composable
|
|
9
|
+
* @param options - Keyboard navigation options
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
3
12
|
export declare function useKeyboardNav(options: KeyboardNavigationOptions[]): void;
|
|
4
13
|
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/composables/keyboard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAuM1E,eAAO,MAAM,uBAAuB,EAAE,gBA6HrC,CAAA;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,QA2IlE"}
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/composables/keyboard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAuM1E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBA6HrC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,yBAAyB,EAAE,QA2IlE"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
|
-
import { defaultKeypressHandlers, useKeyboardNav } from '
|
|
3
|
-
export type { KeypressHandlers, KeyboardNavigationOptions } from '
|
|
2
|
+
import { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard';
|
|
3
|
+
export type { KeypressHandlers, KeyboardNavigationOptions } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Install all utility components
|
|
6
6
|
* @param app - Vue app instance
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Key press handlers
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
2
6
|
export type KeypressHandlers = {
|
|
3
7
|
[key: string]: (ev: KeyboardEvent) => any;
|
|
4
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Keyboard navigation options
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
5
13
|
export type KeyboardNavigationOptions = {
|
|
6
14
|
parent?: string | HTMLElement | Ref<HTMLElement>;
|
|
7
15
|
selectors?: string | HTMLElement | HTMLElement[] | ComponentPublicInstance[] | Ref<HTMLElement> | Ref<HTMLElement[]> | Ref<ComponentPublicInstance[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,aAAa,KAAK,GAAG,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,CAAA;IAChD,SAAS,CAAC,EACP,MAAM,GACN,WAAW,GACX,WAAW,EAAE,GACb,uBAAuB,EAAE,GACzB,GAAG,CAAC,WAAW,CAAC,GAChB,GAAG,CAAC,WAAW,EAAE,CAAC,GAClB,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAA;IACjC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC3B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,aAAa,KAAK,GAAG,CAAA;CACzC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,CAAA;IAChD,SAAS,CAAC,EACP,MAAM,GACN,WAAW,GACX,WAAW,EAAE,GACb,uBAAuB,EAAE,GACzB,GAAG,CAAC,WAAW,CAAC,GAChB,GAAG,CAAC,WAAW,EAAE,CAAC,GAClB,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAA;IACjC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC3B,CAAA"}
|
package/dist/utilities.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { KeypressHandlers } from '@/types';
|
|
5
|
-
import { useKeyboardNav } from '@/composables/keyboard';
|
|
2
|
+
import { ComponentPublicInstance } from 'vue';
|
|
3
|
+
import { Ref } from 'vue';
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Default keypress handlers for keyboard navigation
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare const defaultKeypressHandlers: KeypressHandlers_2;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Install all utility components
|
|
@@ -13,10 +15,54 @@ export { defaultKeypressHandlers }
|
|
|
13
15
|
*/
|
|
14
16
|
export declare function install(app: App): void;
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Keyboard navigation options
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare type KeyboardNavigationOptions = {
|
|
23
|
+
parent?: string | HTMLElement | Ref<HTMLElement>;
|
|
24
|
+
selectors?: string | HTMLElement | HTMLElement[] | ComponentPublicInstance[] | Ref<HTMLElement> | Ref<HTMLElement[]> | Ref<ComponentPublicInstance[]>;
|
|
25
|
+
handlers?: KeypressHandlers;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Keyboard navigation options
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
declare type KeyboardNavigationOptions_2 = {
|
|
33
|
+
parent?: string | HTMLElement | Ref<HTMLElement>
|
|
34
|
+
selectors?:
|
|
35
|
+
| string
|
|
36
|
+
| HTMLElement
|
|
37
|
+
| HTMLElement[]
|
|
38
|
+
| ComponentPublicInstance[]
|
|
39
|
+
| Ref<HTMLElement>
|
|
40
|
+
| Ref<HTMLElement[]>
|
|
41
|
+
| Ref<ComponentPublicInstance[]>
|
|
42
|
+
handlers?: KeypressHandlers_2
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Key press handlers
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare type KeypressHandlers = {
|
|
50
|
+
[key: string]: (ev: KeyboardEvent) => any;
|
|
51
|
+
};
|
|
17
52
|
|
|
18
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Key press handlers
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
declare type KeypressHandlers_2 = {
|
|
58
|
+
[key: string]: (ev: KeyboardEvent) => any
|
|
59
|
+
}
|
|
19
60
|
|
|
20
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Keyboard navigation composable
|
|
63
|
+
* @param options - Keyboard navigation options
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export declare function useKeyboardNav(options: KeyboardNavigationOptions_2[]): void;
|
|
21
67
|
|
|
22
68
|
export { }
|