@featherk/composables 0.6.19 → 0.7.2
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/README.md +7 -38
- package/dist/__tests__/fixtures.d.ts +9 -0
- package/dist/__tests__/withSetupHarness.d.ts +9 -0
- package/dist/date/useMaskedDateInput.test.d.ts +1 -0
- package/dist/featherk-composables.es.js +300 -311
- package/dist/featherk-composables.umd.js +1 -1
- package/dist/grid/index.d.ts +2 -1
- package/dist/{useGridA11y.d.ts → grid/useGridA11y.d.ts} +1 -1
- package/dist/grid/useGridA11y.test.d.ts +1 -0
- package/dist/grid/useGridActiveFilter.d.ts +22 -0
- package/dist/grid/useGridActiveFilter.test.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/range/useMaskedDateRangeInput.test.d.ts +1 -0
- package/dist/time/useMaskedTimeInput.test.d.ts +1 -0
- package/dist/trap/usePopupTrap.test.d.ts +1 -0
- package/docs/grid/useGridActiveFilter.md +108 -0
- package/docs/range/useMaskedDateRangeInput.md +2 -2
- package/docs/trap/usePopupTrap.md +1 -2
- package/package.json +11 -20
- package/dist/useGridFilter.d.ts +0 -7
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Vue 3 composables that improve Kendo UI for Vue behavior and accessibility.
|
|
|
6
6
|
|
|
7
7
|
- **Grid**: `useGridA11y` — Accessible row-level navigation and column menu keyboard support.
|
|
8
8
|
- Guide: [docs/grid/useGridA11y.md](https://github.com/NantHealth/featherk/blob/integration/packages/composables/docs/grid/useGridA11y.md)
|
|
9
|
+
- **Grid**: `useGridActiveFilter` — Reactive header class resolver that marks filtered columns as `"active"`.
|
|
10
|
+
- Guide: [docs/grid/useGridActiveFilter.md](https://github.com/NantHealth/featherk/blob/integration/packages/composables/docs/grid/useGridActiveFilter.md)
|
|
9
11
|
- **Date**: `useMaskedDateInput` — Masked single-date input with steppers and validation.
|
|
10
12
|
- Guide: [docs/date/useMaskedDateInput.md](https://github.com/NantHealth/featherk/blob/integration/packages/composables/docs/date/useMaskedDateInput.md)
|
|
11
13
|
- **Range**: `useMaskedDateRangeInput` — Masked date range input with validation, clamp, and optional popup coordination.
|
|
@@ -23,7 +25,7 @@ Subpath imports (recommended for clarity):
|
|
|
23
25
|
|
|
24
26
|
```ts
|
|
25
27
|
// Grid
|
|
26
|
-
import { useGridA11y } from '@featherk/composables/grid';
|
|
28
|
+
import { useGridA11y, useGridActiveFilter } from '@featherk/composables/grid';
|
|
27
29
|
|
|
28
30
|
// Date input
|
|
29
31
|
import { useMaskedDateInput, type DateChangePayload } from '@featherk/composables/date';
|
|
@@ -42,6 +44,8 @@ Root imports (types are aliased to avoid name collisions):
|
|
|
42
44
|
|
|
43
45
|
```ts
|
|
44
46
|
import {
|
|
47
|
+
useGridA11y,
|
|
48
|
+
useGridActiveFilter,
|
|
45
49
|
useMaskedDateInput,
|
|
46
50
|
type DateChangePayload,
|
|
47
51
|
useMaskedDateRangeInput,
|
|
@@ -52,51 +56,16 @@ import {
|
|
|
52
56
|
} from '@featherk/composables';
|
|
53
57
|
```
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
> useGridA11y currently does not use useFocusTrap composable, but has its own internal method for maintaining focus trap. useGridA11y does not require the @vueuse or focus-trap libraries.
|
|
57
|
-
|
|
58
|
-
**Why this happens:**
|
|
59
|
-
|
|
60
|
-
- If a dependency is imported or required anywhere in the package entry points (even if not used by your code), your bundler or Node will try to resolve it.
|
|
61
|
-
- In index.ts, all composables are exported from a single file, so importing from `@featherk/composables` pulls in all submodules, including those that import `@vueuse/core`, `@vueuse/integrations`, and `focus-trap`.
|
|
62
|
-
|
|
63
|
-
**Workarounds:**
|
|
64
|
-
|
|
65
|
-
1. **Use subpath imports**
|
|
66
|
-
|
|
67
|
-
Import only what you need, e.g.:
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
import { useGridA11y } from '@featherk/composables/grid';
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
This avoids loading the popup/focus-trap code.
|
|
74
|
-
|
|
75
|
-
2. **Install the dependencies**
|
|
76
|
-
If you must use the root import, you need to install all peer dependencies:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm install @vueuse/core @vueuse/integrations focus-trap
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Recommendation:**
|
|
83
|
-
Prefer subpath imports for tree-shaking and to avoid unnecessary dependencies, as described in the README.
|
|
84
|
-
|
|
85
|
-
If you think this should be improved, consider opening an issue or PR to make `focus-trap` and VueUse truly optional by moving their imports inside the `usePopupTrap` function or using dynamic imports.
|
|
59
|
+
`usePopupTrap` depends on VueUse integrations and focus-trap internally. Those runtime packages are shipped as regular dependencies of `@featherk/composables`, so consumers do not need to install them separately.
|
|
86
60
|
|
|
87
61
|
## Peer Dependencies
|
|
88
62
|
|
|
89
63
|
- Required: `vue`
|
|
90
|
-
- Optional (for `usePopupTrap`): `@vueuse/core`, `@vueuse/integrations`, `focus-trap`
|
|
91
64
|
|
|
92
65
|
```bash
|
|
93
66
|
npm install vue
|
|
94
|
-
# If you use usePopupTrap, or any of the date/time based composables
|
|
95
|
-
npm install @vueuse/core @vueuse/integrations focus-trap
|
|
96
67
|
```
|
|
97
68
|
|
|
98
|
-
> Note: VueUse and focus-trap are declared as optional peer dependencies so apps that don’t use `usePopupTrap` aren’t forced to install them. They are present as devDependencies in this repo to enable local type-checking and builds.
|
|
99
|
-
|
|
100
69
|
## Notes
|
|
101
70
|
|
|
102
|
-
- The runtime
|
|
71
|
+
- The runtime files for `useGridA11y` and `useGridActiveFilter` live in `src/grid/`. Both are re-exported from the package root and from `@featherk/composables/grid` — no import path changes are needed by consumers.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type FixtureResult = {
|
|
2
|
+
root: HTMLElement;
|
|
3
|
+
input: HTMLInputElement;
|
|
4
|
+
cleanup: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const createDatePickerFixture: (id: string) => FixtureResult;
|
|
7
|
+
export declare const createTimePickerFixture: (id: string) => FixtureResult;
|
|
8
|
+
export declare const createDateRangeFixture: (id: string) => FixtureResult;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPublicInstance } from "vue";
|
|
2
|
+
import { type VueWrapper } from "@vue/test-utils";
|
|
3
|
+
type SetupFactory<T> = () => T;
|
|
4
|
+
export declare function withSetupHarness<T>(factory: SetupFactory<T>): Promise<{
|
|
5
|
+
api: T;
|
|
6
|
+
wrapper: VueWrapper<ComponentPublicInstance>;
|
|
7
|
+
unmount: () => void;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|