@featherk/composables 0.13.2 → 0.13.3

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.
@@ -11,7 +11,7 @@ Composable for accessible Kendo UI for Vue `Popup` + `Menu` action menus. It man
11
11
  1. Add static `aria-haspopup="menu"` and baseline `aria-expanded="false"` to the trigger element in your template. The composable never sets `aria-haspopup` and never removes `aria-expanded`; the consumer owns both as the closed-state baseline.
12
12
  2. Create parent-owned refs for `isOpen`, `triggerRef`, `menuRef`, and an optional keyboard focus target.
13
13
  3. Call `usePopupMenu(...)` with `requestShow`, `requestHide`, and an explicit `triggerMode: "button"` (or `"row"`).
14
- 4. Route Kendo Menu `@select` through `handleMenuSelect(event, onAction)` so your business action runs while the active menu context is still available, before the composable closes the popup.
14
+ 4. Route Kendo Menu `@select` through `handleMenuSelect(event, onAction)` so the composable closes the popup before running your business action synchronously.
15
15
  5. Bind trigger button `@click` and `@keydown` to the composable handlers.
16
16
  6. Bind Popup `@close` and Menu `@keydown.escape` so keyboard and mouse close paths restore focus correctly.
17
17
 
@@ -70,7 +70,7 @@ const menu = usePopupMenu({
70
70
  requestHide: () => (isOpen.value = false),
71
71
  });
72
72
 
73
- // Step 4: act while the active context is available; usePopupMenu closes afterward
73
+ // Step 4: usePopupMenu closes before running the business action synchronously
74
74
  const onSelect = (event: KendoMenuSelectEvent) => {
75
75
  menu.handleMenuSelect(event, (selected) => {
76
76
  // Keep application-specific actions in the consuming component.
@@ -89,7 +89,7 @@ For a virtualized Kendo Grid, use `focusTargetContainerSelector` to restore keyb
89
89
  3. Create trigger and menu refs as component refs (`ComponentPublicInstance`) for Kendo wrappers.
90
90
  4. Call `usePopupMenu(...)` with an explicit `triggerMode: "button"` and map `requestShow`/`requestHide` to row-specific emits.
91
91
  5. Provide `focusTargetContainerSelector` so keyboard close restores focus to the current virtualized row.
92
- 6. Route menu selection through `handleMenuSelect(event, onAction)` so row action logic can use its active state before the popup closes.
92
+ 6. Route menu selection through `handleMenuSelect(event, onAction)` so the popup closes before row action logic runs synchronously.
93
93
 
94
94
  ```ts
95
95
  <script setup lang="ts">
@@ -124,7 +124,7 @@ const menu = usePopupMenu({
124
124
  focusTargetContainerSelector: ".k-table-row[data-grid-row-index]",
125
125
  });
126
126
 
127
- // Step 6: run row-specific business action before usePopupMenu closes
127
+ // Step 6: usePopupMenu closes before running the row-specific business action
128
128
  const onSelect = (event: KendoMenuSelectEvent) => {
129
129
  menu.handleMenuSelect(event, (selected) => {
130
130
  // Row-specific action logic remains here.
@@ -417,7 +417,7 @@ Whenever `anchor` is configured, `usePopupMenu` automatically flips the popup to
417
417
  - Trigger replacement and virtualization are handled by re-resolving the ref. The previous trigger is demoted to `aria-expanded="false"`, not stripped of attributes, so a shared instance can move between many rows (e.g. a grid) without losing each row's `aria-haspopup` baseline. Set `manageMenuTriggerAria` to `false` when the consumer owns `aria-expanded` too.
418
418
  - Opening focuses the first enabled Kendo Menu item after Vue renders it.
419
419
  - Outside clicks close the menu, while the trigger is ignored to prevent a close/reopen race.
420
- - Menu selection runs the optional business callback while the active state is still available, then records modality and closes the popup.
420
+ - Menu selection records modality and requests close before running the optional business callback synchronously. Registry-backed consumers must snapshot business context before calling `handleMenuSelect`; `useActionCellMenu` does this internally.
421
421
  - `Escape` on the trigger or inside the menu uses the keyboard close path.
422
422
  - Keyboard-driven closes focus `resolveFocusTarget()` or `focusTargetRef`, then fall back to the trigger.
423
423
  - Mouse selection closes restore focus to the trigger.
@@ -340,17 +340,19 @@ const handleGridKeydown = (event: KeyboardEvent) => {
340
340
  };
341
341
 
342
342
  const handleRowMenuSelect = (event: KendoMenuSelectEvent) => {
343
+ const record = activeRowRecord.value;
343
344
  rowMenu.handleMenuSelect(event, (selection) => {
344
- if (selection.item && activeRowRecord.value) {
345
- console.log(selection.item.id, activeRowRecord.value);
345
+ if (selection.item && record) {
346
+ console.log(selection.item.id, record);
346
347
  }
347
348
  });
348
349
  };
349
350
 
350
351
  const handleButtonMenuSelect = (event: KendoMenuSelectEvent) => {
352
+ const record = activeButtonRecord.value;
351
353
  buttonMenu.handleMenuSelect(event, (selection) => {
352
- if (selection.item && activeButtonRecord.value) {
353
- console.log(selection.item.id, activeButtonRecord.value);
354
+ if (selection.item && record) {
355
+ console.log(selection.item.id, record);
354
356
  }
355
357
  });
356
358
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featherk/composables",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "main": "dist/featherk-composables.umd.js",
5
5
  "module": "dist/featherk-composables.es.js",
6
6
  "types": "dist/index.d.ts",