@stonecrop/utilities 0.2.63 → 0.2.65
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 +7 -7
- package/src/composables/keyboard.ts +9 -0
- package/src/index.ts +2 -2
- package/src/types/index.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/utilities",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.65",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
20
|
"import": {
|
|
21
|
-
"types": "./dist/
|
|
21
|
+
"types": "./dist/src/index.d.ts",
|
|
22
22
|
"default": "./dist/utilities.js"
|
|
23
23
|
},
|
|
24
24
|
"require": "./dist/utilities.umd.cjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
"typings": "./dist/
|
|
27
|
+
"typings": "./dist/src/index.d.ts",
|
|
28
28
|
"files": [
|
|
29
29
|
"dist/*",
|
|
30
30
|
"src/*"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@vueuse/core": "^11.1.0",
|
|
34
|
-
"vue": "^3.5.
|
|
34
|
+
"vue": "^3.5.11"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-documenter": "^7.
|
|
38
|
-
"@rushstack/heft": "^0.
|
|
37
|
+
"@microsoft/api-documenter": "^7.26.2",
|
|
38
|
+
"@rushstack/heft": "^0.68.6",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
40
40
|
"@typescript-eslint/parser": "^7.14.1",
|
|
41
41
|
"@vitejs/plugin-vue": "^5.1.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint": "^8.40.0",
|
|
44
44
|
"eslint-config-prettier": "^8.8.0",
|
|
45
45
|
"eslint-plugin-vue": "^9.11.1",
|
|
46
|
-
"typescript": "^5.
|
|
46
|
+
"typescript": "^5.6.3",
|
|
47
47
|
"vite": "^5.4.5",
|
|
48
48
|
"vue-router": "^4.4.0",
|
|
49
49
|
"stonecrop-rig": "0.2.22"
|
|
@@ -201,6 +201,10 @@ const eventKeyMap = {
|
|
|
201
201
|
ArrowRight: 'right',
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Default keypress handlers for keyboard navigation
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
204
208
|
export const defaultKeypressHandlers: KeypressHandlers = {
|
|
205
209
|
'keydown.up': (event: KeyboardEvent) => {
|
|
206
210
|
const $upCell = getUpCell(event)
|
|
@@ -328,6 +332,11 @@ export const defaultKeypressHandlers: KeypressHandlers = {
|
|
|
328
332
|
},
|
|
329
333
|
}
|
|
330
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Keyboard navigation composable
|
|
337
|
+
* @param options - Keyboard navigation options
|
|
338
|
+
* @public
|
|
339
|
+
*/
|
|
331
340
|
export function useKeyboardNav(options: KeyboardNavigationOptions[]) {
|
|
332
341
|
const getParentElement = (option: KeyboardNavigationOptions) => {
|
|
333
342
|
let $parent: HTMLElement | null = null
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
|
|
3
|
-
import { defaultKeypressHandlers, useKeyboardNav } from '
|
|
4
|
-
export type { KeypressHandlers, KeyboardNavigationOptions } from '
|
|
3
|
+
import { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard'
|
|
4
|
+
export type { KeypressHandlers, KeyboardNavigationOptions } from './types'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Install all utility components
|
package/src/types/index.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { ComponentPublicInstance, Ref } from 'vue'
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Key press handlers
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
3
7
|
export type KeypressHandlers = {
|
|
4
8
|
[key: string]: (ev: KeyboardEvent) => any
|
|
5
9
|
}
|
|
6
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Keyboard navigation options
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
7
15
|
export type KeyboardNavigationOptions = {
|
|
8
16
|
parent?: string | HTMLElement | Ref<HTMLElement>
|
|
9
17
|
selectors?:
|