@atscript/vue-table 0.1.132 → 0.1.133

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.
Files changed (111) hide show
  1. package/dist/as-action-form-dialog.cjs +42 -30
  2. package/dist/as-action-form-dialog.mjs +42 -30
  3. package/dist/{as-action-menu-content-4UfcabUe.mjs → as-action-menu-content-4D7CJNgr.mjs} +1 -1
  4. package/dist/{as-action-menu-content-C5qx9MPE.cjs → as-action-menu-content-DiS37BYK.cjs} +1 -1
  5. package/dist/as-column-menu.d.cts +1 -1
  6. package/dist/as-column-menu.d.mts +1 -1
  7. package/dist/{as-column-menu.vue-DL5N9mKR.d.mts → as-column-menu.vue-CZ8XqHl0.d.cts} +2 -2
  8. package/dist/{as-column-menu.vue-u_DNy3f-.d.cts → as-column-menu.vue-Cuelpv3p.d.mts} +2 -2
  9. package/dist/{as-config-dialog-BehfqIGd.mjs → as-config-dialog-BKsm8OHR.mjs} +30 -22
  10. package/dist/{as-config-dialog-BOYWPYYH.cjs → as-config-dialog-Bt8oP8qg.cjs} +29 -21
  11. package/dist/as-config-dialog.cjs +1 -1
  12. package/dist/as-config-dialog.mjs +1 -1
  13. package/dist/{as-confirm-dialog-bpN4A-KN.mjs → as-confirm-dialog-BV01t7dn.mjs} +12 -9
  14. package/dist/{as-confirm-dialog-UwhDHysk.cjs → as-confirm-dialog-Cw7KErhz.cjs} +12 -9
  15. package/dist/as-confirm-dialog.cjs +1 -1
  16. package/dist/as-confirm-dialog.mjs +1 -1
  17. package/dist/{as-filter-dialog-Dh2Ylthb.cjs → as-filter-dialog-Bxii-mYH.cjs} +31 -23
  18. package/dist/{as-filter-dialog-D1qzq-8b.mjs → as-filter-dialog-Ckrl79kU.mjs} +32 -24
  19. package/dist/as-filter-dialog.cjs +1 -1
  20. package/dist/as-filter-dialog.mjs +1 -1
  21. package/dist/{as-filter-field-DirBmnbb.mjs → as-filter-field-C-IFnj8K.mjs} +4 -4
  22. package/dist/{as-filter-field-DRsDJdpx.cjs → as-filter-field-xBr6TtKo.cjs} +4 -4
  23. package/dist/as-filter-field.cjs +1 -1
  24. package/dist/as-filter-field.mjs +1 -1
  25. package/dist/as-filters-DJEQj7_p.mjs +125 -0
  26. package/dist/as-filters-DuCk8nkk.cjs +130 -0
  27. package/dist/as-filters.cjs +1 -1
  28. package/dist/as-filters.d.cts +1 -1
  29. package/dist/as-filters.d.mts +1 -1
  30. package/dist/as-filters.mjs +1 -1
  31. package/dist/as-filters.vue-BG_ysCkC.d.mts +65 -0
  32. package/dist/as-filters.vue-DcxDnWAU.d.cts +65 -0
  33. package/dist/{as-preset-dialog-CDqCAR7N.mjs → as-preset-dialog-CCIacZ2C.mjs} +70 -20
  34. package/dist/{as-preset-dialog-DpM06jqR.cjs → as-preset-dialog-jZeyXJeJ.cjs} +74 -24
  35. package/dist/as-preset-dialog.cjs +1 -1
  36. package/dist/as-preset-dialog.mjs +1 -1
  37. package/dist/{as-preset-picker-jUS_YDX8.cjs → as-preset-picker-4xXU1KQz.cjs} +45 -21
  38. package/dist/{as-preset-picker-CISaxEZ0.mjs → as-preset-picker-DGSqQl9A.mjs} +39 -15
  39. package/dist/as-preset-picker.cjs +1 -1
  40. package/dist/as-preset-picker.mjs +1 -1
  41. package/dist/{as-row-actions-Bm6Bzyno.cjs → as-row-actions-B_OHWIAt.cjs} +2 -2
  42. package/dist/{as-row-actions-xqJeAdQl.mjs → as-row-actions-pukI1JT7.mjs} +2 -2
  43. package/dist/as-row-actions.cjs +1 -1
  44. package/dist/as-row-actions.mjs +1 -1
  45. package/dist/{as-table-BWUPzjRn.cjs → as-table-BejpMVid.cjs} +22 -4
  46. package/dist/{as-table-CDSG2yED.mjs → as-table-D5_bQ0p5.mjs} +22 -4
  47. package/dist/{as-table-actions-DMxeaczm.mjs → as-table-actions-DKYK_mTO.mjs} +57 -11
  48. package/dist/{as-table-actions-gV4lqqxc.cjs → as-table-actions-qb0gQz2D.cjs} +56 -10
  49. package/dist/as-table-actions.cjs +1 -1
  50. package/dist/as-table-actions.d.cts +1 -1
  51. package/dist/as-table-actions.d.mts +1 -1
  52. package/dist/as-table-actions.mjs +1 -1
  53. package/dist/{as-table-actions.vue-B-cgiCXP.d.cts → as-table-actions.vue-CckRRsL6.d.cts} +2 -2
  54. package/dist/{as-table-actions.vue-ClMa0OD1.d.mts → as-table-actions.vue-DsqauvXR.d.mts} +2 -2
  55. package/dist/{as-table-base-BaTE3VSN.mjs → as-table-base-B0arhJI8.mjs} +141 -46
  56. package/dist/{as-table-base-RG2TEIgV.cjs → as-table-base-Dfw012G5.cjs} +141 -46
  57. package/dist/{as-table-header-cell-CIqlO6Lw.cjs → as-table-header-cell-Bb4ddLmQ.cjs} +1 -1
  58. package/dist/{as-table-header-cell-Bdhl5Lox.mjs → as-table-header-cell-q-c_QklI.mjs} +1 -1
  59. package/dist/as-table-header-cell.cjs +1 -1
  60. package/dist/as-table-header-cell.d.cts +1 -1
  61. package/dist/as-table-header-cell.d.mts +1 -1
  62. package/dist/as-table-header-cell.mjs +1 -1
  63. package/dist/{as-table-header-cell.vue-BCszzxtU.d.mts → as-table-header-cell.vue-BjVOEFqz.d.mts} +1 -1
  64. package/dist/{as-table-header-cell.vue-BzTzfGRo.d.cts → as-table-header-cell.vue-qS1Xfc-U.d.cts} +1 -1
  65. package/dist/{as-table-root-BLReUbRH.mjs → as-table-root-Bpsrp0Vz.mjs} +5 -5
  66. package/dist/{as-table-root-DLJ_3Jf4.cjs → as-table-root-CUDO9ybm.cjs} +5 -5
  67. package/dist/as-table-root.cjs +1 -1
  68. package/dist/as-table-root.d.cts +1 -1
  69. package/dist/as-table-root.d.mts +1 -1
  70. package/dist/as-table-root.mjs +1 -1
  71. package/dist/{as-table-root.vue-QMT93qPk.d.mts → as-table-root.vue-BPU92_Ns.d.mts} +55 -12
  72. package/dist/{as-table-root.vue-D0T3n-Vm.d.cts → as-table-root.vue-szvjZsCn.d.cts} +55 -12
  73. package/dist/{as-table-status-DGTZlpyq.mjs → as-table-status-B9jlzPPV.mjs} +53 -37
  74. package/dist/{as-table-status-Du4WLF4k.cjs → as-table-status-BgDexT2x.cjs} +53 -37
  75. package/dist/as-table.cjs +1 -1
  76. package/dist/as-table.d.cts +1 -1
  77. package/dist/as-table.d.mts +1 -1
  78. package/dist/as-table.mjs +1 -1
  79. package/dist/{as-table.vue-Ds7MEp37.d.cts → as-table.vue-4WhMA8AM.d.mts} +27 -3
  80. package/dist/{as-table.vue-Ce5606ZO.d.mts → as-table.vue-_urybtQj.d.cts} +27 -3
  81. package/dist/{as-window-table-jD_y9yet.cjs → as-window-table-CXq6UuUx.cjs} +98 -19
  82. package/dist/{as-window-table-DWujiUQy.mjs → as-window-table-S1XWpDHQ.mjs} +98 -19
  83. package/dist/as-window-table.cjs +1 -1
  84. package/dist/as-window-table.d.cts +1 -1
  85. package/dist/as-window-table.d.mts +1 -1
  86. package/dist/as-window-table.mjs +1 -1
  87. package/dist/{as-window-table.vue-DfZF1Mux.d.mts → as-window-table.vue-CWsJvOkL.d.mts} +25 -2
  88. package/dist/{as-window-table.vue-Bhf9BK8E.d.cts → as-window-table.vue-h1bdyMv7.d.cts} +25 -2
  89. package/dist/error-message-CglODWl4.cjs +18 -0
  90. package/dist/error-message-hPSAu8Ug.mjs +13 -0
  91. package/dist/index.cjs +61 -29
  92. package/dist/index.d.cts +9 -9
  93. package/dist/index.d.mts +9 -9
  94. package/dist/index.mjs +62 -30
  95. package/dist/{types-CTMxE_zA.d.cts → types-BZ0HssRY.d.cts} +126 -4
  96. package/dist/{types-ByU4O0Yf.d.mts → types-CXz-4dPz.d.mts} +126 -4
  97. package/dist/{use-table-CyFcVtUN.mjs → use-table-Bk-jSxOM.mjs} +26 -11
  98. package/dist/{use-table-nvBq1dZ4.cjs → use-table-CdFFqaEx.cjs} +24 -9
  99. package/dist/{use-table-component-DO_kvKSf.cjs → use-table-component-DlLganVc.cjs} +1 -1
  100. package/dist/{use-table-component-K6xj1obF.mjs → use-table-component-KuzZxAP8.mjs} +1 -1
  101. package/dist/{use-table-nav-bridge-DeGeaQX-.mjs → use-table-nav-bridge-B9SSEajW.mjs} +1 -1
  102. package/dist/{use-table-nav-bridge-uOQUDooh.cjs → use-table-nav-bridge-CVUmTjDr.cjs} +1 -1
  103. package/dist/{use-table-state-Oi2ds4_a.cjs → use-table-state-D6dHOFrA.cjs} +329 -53
  104. package/dist/{use-table-state-BxX3SpeW.mjs → use-table-state-DLJbW753.mjs} +295 -55
  105. package/package.json +9 -9
  106. package/dist/as-filters-DCZTHjf5.cjs +0 -51
  107. package/dist/as-filters-beIud9sF.mjs +0 -46
  108. package/dist/as-filters.vue-DmECMd1v.d.mts +0 -10
  109. package/dist/as-filters.vue-fv-tRL2H.d.cts +0 -10
  110. package/dist/preset-aspect-display-IICxAlVo.mjs +0 -43
  111. package/dist/preset-aspect-display-TWwf6j1B.cjs +0 -72
@@ -1,5 +1,5 @@
1
- const require_use_table_state = require("./use-table-state-Oi2ds4_a.cjs");
2
- const require_as_action_menu_content = require("./as-action-menu-content-C5qx9MPE.cjs");
1
+ const require_use_table_state = require("./use-table-state-D6dHOFrA.cjs");
2
+ const require_as_action_menu_content = require("./as-action-menu-content-DiS37BYK.cjs");
3
3
  let vue = require("vue");
4
4
  let reka_ui = require("reka-ui");
5
5
  //#region src/components/as-table-actions.vue?vue&type=script&setup=true&lang.ts
@@ -8,6 +8,12 @@ const _hoisted_1 = {
8
8
  class: "as-table-actions"
9
9
  };
10
10
  const _hoisted_2 = { class: "as-table-actions-btn-label" };
11
+ const _hoisted_3 = ["aria-label", "aria-busy"];
12
+ const _hoisted_4 = {
13
+ class: "sr-only",
14
+ role: "status",
15
+ "aria-live": "polite"
16
+ };
11
17
  //#endregion
12
18
  //#region src/components/as-table-actions.vue
13
19
  var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -102,6 +108,43 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
102
108
  return require_use_table_state.actionHref(state, action, resolved.value.ids[0]);
103
109
  }
104
110
  const { onTriggerClick, onTriggerAuxClick, openNewTab } = require_use_table_state.createNavigateGestures(state, promptCtx, hrefFor);
111
+ const running = (0, vue.computed)(() => state.actions.invoking.value);
112
+ function isRunning(action) {
113
+ return action !== void 0 && running.value.has(action.name);
114
+ }
115
+ /** Accessible name for a trigger, suffixed while its action is in flight. */
116
+ function triggerLabel(action) {
117
+ const label = require_use_table_state.ariaLabelFor(action);
118
+ return isRunning(action) ? `${label}, running` : label;
119
+ }
120
+ const menuBusy = (0, vue.computed)(() => resolved.value.otherActions.some((a) => isRunning(a)) || resolved.value.trailingRowActions.some((a) => isRunning(a)));
121
+ const liveMessage = (0, vue.ref)("");
122
+ const startedLabels = /* @__PURE__ */ new Map();
123
+ function labelOfName(name) {
124
+ const cached = startedLabels.get(name);
125
+ if (cached !== void 0) return cached;
126
+ for (const bucket of [
127
+ state.actions.table,
128
+ state.actions.row,
129
+ state.actions.rows
130
+ ]) for (const a of bucket) if (a.name === name) return require_use_table_state.ariaLabelFor(a);
131
+ return name;
132
+ }
133
+ (0, vue.watch)(running, (next, prev) => {
134
+ const before = prev ?? /* @__PURE__ */ new Set();
135
+ for (const name of next) {
136
+ if (before.has(name)) continue;
137
+ const label = labelOfName(name);
138
+ startedLabels.set(name, label);
139
+ liveMessage.value = `${label} running`;
140
+ }
141
+ for (const name of before) {
142
+ if (next.has(name)) continue;
143
+ const label = labelOfName(name);
144
+ startedLabels.delete(name);
145
+ liveMessage.value = `${label} ${state.actions.lastResult.value.get(name)?.ok ? "finished" : "failed"}`;
146
+ }
147
+ });
105
148
  return (_ctx, _cache) => {
106
149
  return hasAny.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "default", {
107
150
  defaultAction: resolved.value.defaultAction,
@@ -116,8 +159,9 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
116
159
  type: resolved.value.defaultAsLink ? void 0 : "button",
117
160
  class: (0, vue.normalizeClass)(["as-table-actions-btn", (0, vue.unref)(require_use_table_state.intentClass)("as-table-actions", resolved.value.defaultAction)]),
118
161
  "data-default": "",
119
- "aria-label": (0, vue.unref)(require_use_table_state.ariaLabelFor)(resolved.value.defaultAction),
162
+ "aria-label": triggerLabel(resolved.value.defaultAction),
120
163
  title: (0, vue.unref)(require_use_table_state.ariaLabelFor)(resolved.value.defaultAction),
164
+ "aria-busy": isRunning(resolved.value.defaultAction) ? "true" : void 0,
121
165
  onClick: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(onTriggerClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event)),
122
166
  onAuxclick: _cache[1] || (_cache[1] = ($event) => (0, vue.unref)(onTriggerAuxClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event))
123
167
  }, {
@@ -132,21 +176,23 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
132
176
  "type",
133
177
  "class",
134
178
  "aria-label",
135
- "title"
179
+ "title",
180
+ "aria-busy"
136
181
  ])) : (0, vue.createCommentVNode)("v-if", true), resolved.value.otherActions.length > 0 || resolved.value.trailingRowActions.length > 0 ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(reka_ui.DropdownMenuRoot), {
137
182
  key: 1,
138
183
  modal: false
139
184
  }, {
140
185
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(reka_ui.DropdownMenuTrigger), { "as-child": "" }, {
141
- default: (0, vue.withCtx)(() => [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("button", {
186
+ default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("button", {
142
187
  type: "button",
143
188
  class: "as-table-actions-more",
144
- "aria-label": "More actions",
145
- title: "More actions"
146
- }, [(0, vue.createElementVNode)("span", {
189
+ "aria-label": menuBusy.value ? "More actions, running" : "More actions",
190
+ title: "More actions",
191
+ "aria-busy": menuBusy.value ? "true" : void 0
192
+ }, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", {
147
193
  class: "i-as-menu",
148
194
  "aria-hidden": "true"
149
- })], -1)])]),
195
+ }, null, -1)])], 8, _hoisted_3)]),
150
196
  _: 1
151
197
  }), (0, vue.createVNode)((0, vue.unref)(reka_ui.DropdownMenuPortal), null, {
152
198
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_as_action_menu_content.as_action_menu_content_default, {
@@ -163,7 +209,7 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
163
209
  _: 3
164
210
  })]),
165
211
  _: 3
166
- })) : (0, vue.createCommentVNode)("v-if", true)])])) : (0, vue.createCommentVNode)("v-if", true);
212
+ })) : (0, vue.createCommentVNode)("v-if", true)]), (0, vue.createElementVNode)("span", _hoisted_4, (0, vue.toDisplayString)(liveMessage.value), 1)])) : (0, vue.createCommentVNode)("v-if", true);
167
213
  };
168
214
  }
169
215
  });
@@ -1,2 +1,2 @@
1
- const require_as_table_actions = require("./as-table-actions-gV4lqqxc.cjs");
1
+ const require_as_table_actions = require("./as-table-actions-qb0gQz2D.cjs");
2
2
  module.exports = require_as_table_actions.as_table_actions_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-actions.vue-B-cgiCXP.cjs";
1
+ import { t as _default } from "./as-table-actions.vue-CckRRsL6.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table-actions.vue-ClMa0OD1.mjs";
1
+ import { t as _default } from "./as-table-actions.vue-DsqauvXR.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_table_actions_default } from "./as-table-actions-DMxeaczm.mjs";
1
+ import { t as as_table_actions_default } from "./as-table-actions-DKYK_mTO.mjs";
2
2
  export { as_table_actions_default as default };
@@ -1,4 +1,4 @@
1
- import { h as TVueTableActionInfo } from "./types-CTMxE_zA.cjs";
1
+ import { b as TVueTableActionInfo } from "./types-BZ0HssRY.cjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/as-table-actions.vue.d.ts
@@ -18,7 +18,7 @@ declare var __VLS_1: {
18
18
  defaultAction: TVueTableActionInfo | undefined;
19
19
  otherActions: TVueTableActionInfo[];
20
20
  trailingRowActions: TVueTableActionInfo[];
21
- level: "row" | "table" | "rows";
21
+ level: "row" | "rows" | "table";
22
22
  ids: Record<string, unknown>[];
23
23
  invoke: typeof invokeWith;
24
24
  }, __VLS_12: {
@@ -1,4 +1,4 @@
1
- import { h as TVueTableActionInfo } from "./types-ByU4O0Yf.mjs";
1
+ import { b as TVueTableActionInfo } from "./types-CXz-4dPz.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/as-table-actions.vue.d.ts
@@ -18,7 +18,7 @@ declare var __VLS_1: {
18
18
  defaultAction: TVueTableActionInfo | undefined;
19
19
  otherActions: TVueTableActionInfo[];
20
20
  trailingRowActions: TVueTableActionInfo[];
21
- level: "row" | "table" | "rows";
21
+ level: "row" | "rows" | "table";
22
22
  ids: Record<string, unknown>[];
23
23
  invoke: typeof invokeWith;
24
24
  }, __VLS_12: {
@@ -1,6 +1,6 @@
1
- import { o as useTableContextOptional } from "./use-table-state-BxX3SpeW.mjs";
1
+ import { o as useTableContextOptional, p as onSelectControlKeydown } from "./use-table-state-DLJbW753.mjs";
2
2
  import { t as getCellValue } from "./get-cell-value-C8LLc_Rr.mjs";
3
- import { a as useCellComponents, n as as_table_header_default, o as useCellResolver, r as as_table_colgroup_default, t as as_table_status_default } from "./as-table-status-DGTZlpyq.mjs";
3
+ import { a as useCellComponents, n as as_table_header_default, o as useCellResolver, r as as_table_colgroup_default, t as as_table_status_default } from "./as-table-status-B9jlzPPV.mjs";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, watch, withCtx } from "vue";
5
5
  import { DEFAULT_ROW_HEIGHT_PX, filledFilterCount } from "@atscript/ui-table";
6
6
  import { useParentElement, useResizeObserver } from "@vueuse/core";
@@ -160,6 +160,7 @@ const _hoisted_6 = [
160
160
  "id",
161
161
  "aria-rowindex",
162
162
  "aria-selected",
163
+ "data-selectable",
163
164
  "onClick",
164
165
  "onDblclick"
165
166
  ];
@@ -168,16 +169,24 @@ const _hoisted_7 = {
168
169
  class: "as-td-select",
169
170
  role: "gridcell"
170
171
  };
171
- const _hoisted_8 = {
172
+ const _hoisted_8 = [
173
+ "tabindex",
174
+ "aria-checked",
175
+ "aria-disabled",
176
+ "aria-label",
177
+ "title",
178
+ "onKeydown"
179
+ ];
180
+ const _hoisted_9 = {
172
181
  key: 0,
173
182
  class: "as-table-checkbox-tick",
174
183
  "aria-hidden": "true"
175
184
  };
176
- const _hoisted_9 = {
185
+ const _hoisted_10 = {
177
186
  key: 0,
178
187
  role: "gridcell"
179
188
  };
180
- const _hoisted_10 = {
189
+ const _hoisted_11 = {
181
190
  key: 3,
182
191
  class: "as-td-filler",
183
192
  role: "gridcell"
@@ -289,6 +298,14 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
289
298
  type: Boolean,
290
299
  required: false,
291
300
  default: false
301
+ },
302
+ rowClass: {
303
+ type: Function,
304
+ required: false
305
+ },
306
+ rowAttrs: {
307
+ type: Function,
308
+ required: false
292
309
  }
293
310
  },
294
311
  emits: [
@@ -314,14 +331,69 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
314
331
  const isListbox = computed(() => props.renderMode === "listbox");
315
332
  const isRekaWrapped = computed(() => isCombobox.value || isListbox.value);
316
333
  const hasValue = computed(() => isRekaWrapped.value || props.select !== "none");
334
+ const SELECTABLE = Object.freeze({ ok: true });
335
+ const DEFAULT_ROW_META = Object.freeze({
336
+ selectable: SELECTABLE,
337
+ cls: void 0,
338
+ attrs: void 0
339
+ });
340
+ const rowHooks = computed(() => {
341
+ const rows = props.rows;
342
+ if (!isStandalone.value) return {
343
+ metas: [],
344
+ selectable: rows.length,
345
+ selected: 0
346
+ };
347
+ const gated = !!ctx?.state.rowSelectable.value;
348
+ if (!gated && !props.rowClass && !props.rowAttrs) {
349
+ let selected = 0;
350
+ for (const row of rows) if (isPkSelected(row)) selected++;
351
+ return {
352
+ metas: [],
353
+ selectable: rows.length,
354
+ selected
355
+ };
356
+ }
357
+ let selectable = 0;
358
+ let selected = 0;
359
+ return {
360
+ metas: rows.map((row, index) => {
361
+ const hookCtx = {
362
+ index,
363
+ get selected() {
364
+ return isPkSelected(row);
365
+ }
366
+ };
367
+ const verdict = gated ? ctx.state.isRowSelectable(row, index) : SELECTABLE;
368
+ if (verdict.ok) {
369
+ selectable++;
370
+ if (isPkSelected(row)) selected++;
371
+ }
372
+ return {
373
+ selectable: verdict,
374
+ cls: props.rowClass?.(row, hookCtx),
375
+ attrs: props.rowAttrs?.(row, hookCtx)
376
+ };
377
+ }),
378
+ selectable,
379
+ selected
380
+ };
381
+ });
382
+ function metaFor(index) {
383
+ return rowHooks.value.metas[index] ?? DEFAULT_ROW_META;
384
+ }
385
+ /** Accessible name for a row's selection control, carrying the disabled reason. */
386
+ function selectLabel(verdict) {
387
+ if (verdict.ok) return "Select row";
388
+ return verdict.reason ? `Select row, ${verdict.reason}` : "Select row, not selectable";
389
+ }
317
390
  const hasActiveFilters = computed(() => props.filters ? filledFilterCount(props.filters) > 0 : false);
318
391
  const showSelectAllCheckbox = computed(() => isStandalone.value && props.select === "multi" && !!props.selectedRows);
319
392
  const selectAllState = computed(() => {
320
393
  if (!showSelectAllCheckbox.value) return void 0;
321
- const sel = props.selectedRows ?? [];
322
- if (sel.length === 0) return "none";
323
- if (sel.length === props.rows.length && props.rows.length > 0) return "all";
324
- return "some";
394
+ if ((props.selectedRows ?? []).length === 0) return "none";
395
+ const { selectable, selected } = rowHooks.value;
396
+ return selectable > 0 && selected >= selectable ? "all" : "some";
325
397
  });
326
398
  const emit = __emit;
327
399
  const slots = useSlots();
@@ -360,6 +432,11 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
360
432
  if (!isStandalone.value || !ctx) return;
361
433
  ctx.state.handleNavKey(event, { mode: props.select });
362
434
  }
435
+ /** Space on a row's selection control toggles just that row. */
436
+ function onSelectCellKeydown(event, index) {
437
+ if (!ctx) return;
438
+ onSelectControlKeydown(event, index, props.select, ctx.state);
439
+ }
363
440
  const scrollContainerRef = ref(null);
364
441
  function alignActiveRow(idx) {
365
442
  if (!ctx) return;
@@ -597,50 +674,68 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
597
674
  "aria-activedescendant": ariaActiveDescendant.value,
598
675
  onKeydown: onTbodyKeydown
599
676
  }, {
600
- default: withCtx(({ item, index, spaceBefore }) => [createElementVNode("tr", {
601
- id: rowIdFor(index),
602
- role: "row",
603
- "aria-rowindex": index + 2,
604
- "aria-selected": ariaSelectedFor(item),
605
- class: normalizeClass({ "as-table-row-active": isActiveRow(index) }),
606
- style: normalizeStyle({
607
- height: __props.virtualRowHeight ? `${__props.virtualRowHeight}px` : void 0,
608
- transform: spaceBefore ? `translateY(${spaceBefore}px)` : void 0
609
- }),
610
- onClick: ($event) => onRowClick(item, $event, index),
611
- onDblclick: ($event) => onRowDblClick(item, $event, index)
612
- }, [
613
- hasValue.value ? (openBlock(), createElementBlock("td", _hoisted_7, [createElementVNode("span", { class: normalizeClass(["as-table-checkbox", { "as-table-checkbox-checked": isPkSelected(item) }]) }, [isPkSelected(item) ? (openBlock(), createElementBlock("span", _hoisted_8)) : createCommentVNode("v-if", true)], 2)])) : createCommentVNode("v-if", true),
614
- unref(hasAnyCellBindings) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.columns, (col) => {
615
- return openBlock(), createElementBlock(Fragment, { key: col.path }, [(openBlock(true), createElementBlock(Fragment, null, renderList([unref(cellResolver)(col, item, index)], (bindings) => {
616
- return openBlock(), createElementBlock(Fragment, { key: 0 }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", mergeProps({
617
- key: 0,
618
- role: "gridcell"
619
- }, { ref_for: true }, bindings), [renderSlot(_ctx.$slots, `cell-${col.path}`, {
677
+ default: withCtx(({ item, index, spaceBefore }) => [createCommentVNode("\n `meta` is resolved ONCE per row (the row's hook results + its\n selectability verdict); `v-bind=\"meta.attrs\"` comes FIRST so every\n framework binding after it wins — consumer attrs can decorate a\n row but can never rewrite its id / role / aria / data contract.\n "), (openBlock(true), createElementBlock(Fragment, null, renderList([metaFor(index)], (meta) => {
678
+ return openBlock(), createElementBlock("tr", mergeProps({
679
+ key: 0,
680
+ ref_for: true
681
+ }, meta.attrs, {
682
+ id: rowIdFor(index),
683
+ role: "row",
684
+ "aria-rowindex": index + 2,
685
+ "aria-selected": ariaSelectedFor(item),
686
+ "data-selectable": meta.selectable.ok ? void 0 : "false",
687
+ class: [{ "as-table-row-active": isActiveRow(index) }, meta.cls],
688
+ style: {
689
+ height: __props.virtualRowHeight ? `${__props.virtualRowHeight}px` : void 0,
690
+ transform: spaceBefore ? `translateY(${spaceBefore}px)` : void 0
691
+ },
692
+ onClick: ($event) => onRowClick(item, $event, index),
693
+ onDblclick: ($event) => onRowDblClick(item, $event, index)
694
+ }), [
695
+ hasValue.value ? (openBlock(), createElementBlock("td", _hoisted_7, [createElementVNode("span", {
696
+ class: normalizeClass(["as-table-checkbox", {
697
+ "as-table-checkbox-checked": isPkSelected(item),
698
+ "as-table-checkbox-disabled": !meta.selectable.ok
699
+ }]),
700
+ role: "checkbox",
701
+ tabindex: meta.selectable.ok ? 0 : void 0,
702
+ "aria-checked": isPkSelected(item) ? "true" : "false",
703
+ "aria-disabled": meta.selectable.ok ? void 0 : "true",
704
+ "aria-label": selectLabel(meta.selectable),
705
+ title: meta.selectable.reason,
706
+ onKeydown: ($event) => onSelectCellKeydown($event, index)
707
+ }, [isPkSelected(item) ? (openBlock(), createElementBlock("span", _hoisted_9)) : createCommentVNode("v-if", true)], 42, _hoisted_8)])) : createCommentVNode("v-if", true),
708
+ unref(hasAnyCellBindings) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.columns, (col) => {
709
+ return openBlock(), createElementBlock(Fragment, { key: col.path }, [(openBlock(true), createElementBlock(Fragment, null, renderList([unref(cellResolver)(col, item, index)], (bindings) => {
710
+ return openBlock(), createElementBlock(Fragment, { key: 0 }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", mergeProps({
711
+ key: 0,
712
+ role: "gridcell"
713
+ }, { ref_for: true }, bindings), [renderSlot(_ctx.$slots, `cell-${col.path}`, {
714
+ row: item,
715
+ value: unref(getCellValue)(item, col.path),
716
+ column: col
717
+ })], 16)) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), mergeProps({
718
+ key: 1,
719
+ row: item,
720
+ column: col,
721
+ role: "gridcell"
722
+ }, { ref_for: true }, bindings), null, 16, ["row", "column"]))], 64);
723
+ }), 128))], 64);
724
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(__props.columns, (col) => {
725
+ return openBlock(), createElementBlock(Fragment, { key: col.path }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", _hoisted_10, [renderSlot(_ctx.$slots, `cell-${col.path}`, {
620
726
  row: item,
621
727
  value: unref(getCellValue)(item, col.path),
622
728
  column: col
623
- })], 16)) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), mergeProps({
729
+ })])) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), {
624
730
  key: 1,
625
731
  row: item,
626
732
  column: col,
627
733
  role: "gridcell"
628
- }, { ref_for: true }, bindings), null, 16, ["row", "column"]))], 64);
629
- }), 128))], 64);
630
- }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(__props.columns, (col) => {
631
- return openBlock(), createElementBlock(Fragment, { key: col.path }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", _hoisted_9, [renderSlot(_ctx.$slots, `cell-${col.path}`, {
632
- row: item,
633
- value: unref(getCellValue)(item, col.path),
634
- column: col
635
- })])) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), {
636
- key: 1,
637
- row: item,
638
- column: col,
639
- role: "gridcell"
640
- }, null, 8, ["row", "column"]))], 64);
641
- }), 128)),
642
- __props.stretch ? (openBlock(), createElementBlock("td", _hoisted_10)) : createCommentVNode("v-if", true)
643
- ], 46, _hoisted_6)]),
734
+ }, null, 8, ["row", "column"]))], 64);
735
+ }), 128)),
736
+ __props.stretch ? (openBlock(), createElementBlock("td", _hoisted_11)) : createCommentVNode("v-if", true)
737
+ ], 16, _hoisted_6);
738
+ }), 128))]),
644
739
  _: 3
645
740
  }, 8, [
646
741
  "options",