@atscript/vue-table 0.1.132 → 0.1.134

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 (163) 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-C5qx9MPE.cjs → as-action-menu-content-C_D_Fepo.cjs} +1 -1
  4. package/dist/{as-action-menu-content-4UfcabUe.mjs → as-action-menu-content-rim8hAO9.mjs} +1 -1
  5. package/dist/{as-cell-array-2qmJ1lT2.mjs → as-cell-array-BWHkJX3I.mjs} +2 -2
  6. package/dist/{as-cell-array-iPeUnk2G.cjs → as-cell-array-D-8Pqlgo.cjs} +2 -2
  7. package/dist/as-cell-array.cjs +1 -1
  8. package/dist/as-cell-array.mjs +1 -1
  9. package/dist/{as-cell-date-DyixWKuS.cjs → as-cell-date-DviMJEqs.cjs} +2 -2
  10. package/dist/{as-cell-date-BwFgi6O0.mjs → as-cell-date-mGlnDeLP.mjs} +2 -2
  11. package/dist/as-cell-date.cjs +1 -1
  12. package/dist/as-cell-date.mjs +1 -1
  13. package/dist/{as-cell-json--95Xq6yq.mjs → as-cell-json-2I081xnO.mjs} +2 -2
  14. package/dist/{as-cell-json-Bvv2P7YV.cjs → as-cell-json-CaVB6e7V.cjs} +2 -2
  15. package/dist/as-cell-json.cjs +1 -1
  16. package/dist/as-cell-json.mjs +1 -1
  17. package/dist/{as-cell-number-DuPMOesI.cjs → as-cell-number-BnYbxOiG.cjs} +2 -2
  18. package/dist/{as-cell-number-DKRaS9pM.mjs → as-cell-number-CP2AZI9g.mjs} +2 -2
  19. package/dist/as-cell-number.cjs +1 -1
  20. package/dist/as-cell-number.mjs +1 -1
  21. package/dist/{as-cell-union-DJNsEKTi.cjs → as-cell-union-BjMP91PS.cjs} +3 -3
  22. package/dist/{as-cell-union-C9FukGqF.mjs → as-cell-union-NHpDCXty.mjs} +3 -3
  23. package/dist/as-cell-union.cjs +1 -1
  24. package/dist/as-cell-union.mjs +1 -1
  25. package/dist/as-column-menu.cjs +1 -1
  26. package/dist/as-column-menu.d.cts +1 -1
  27. package/dist/as-column-menu.d.mts +1 -1
  28. package/dist/as-column-menu.mjs +1 -1
  29. package/dist/{as-column-menu.vue-u_DNy3f-.d.cts → as-column-menu.vue-De7SRhj6.d.cts} +1 -1
  30. package/dist/{as-column-menu.vue-DL5N9mKR.d.mts → as-column-menu.vue-Dg0H1dOd.d.mts} +1 -1
  31. package/dist/{as-config-dialog-BehfqIGd.mjs → as-config-dialog-BUBHiVlf.mjs} +56 -35
  32. package/dist/{as-config-dialog-BOYWPYYH.cjs → as-config-dialog-DvBptYMS.cjs} +55 -34
  33. package/dist/as-config-dialog.cjs +1 -1
  34. package/dist/as-config-dialog.mjs +1 -1
  35. package/dist/{as-confirm-dialog-UwhDHysk.cjs → as-confirm-dialog-ByMfIG0A.cjs} +12 -9
  36. package/dist/{as-confirm-dialog-bpN4A-KN.mjs → as-confirm-dialog-G4ZoL_Xo.mjs} +12 -9
  37. package/dist/as-confirm-dialog.cjs +1 -1
  38. package/dist/as-confirm-dialog.mjs +1 -1
  39. package/dist/{as-filter-dialog-D1qzq-8b.mjs → as-filter-dialog-BJWH8cvc.mjs} +34 -26
  40. package/dist/{as-filter-dialog-Dh2Ylthb.cjs → as-filter-dialog-C2oyT0yt.cjs} +33 -25
  41. package/dist/as-filter-dialog.cjs +1 -1
  42. package/dist/as-filter-dialog.mjs +1 -1
  43. package/dist/{as-filter-field-DirBmnbb.mjs → as-filter-field-B2skq4K0.mjs} +4 -4
  44. package/dist/{as-filter-field-DRsDJdpx.cjs → as-filter-field-DxGfasQj.cjs} +4 -4
  45. package/dist/as-filter-field.cjs +1 -1
  46. package/dist/as-filter-field.mjs +1 -1
  47. package/dist/as-filter-input.cjs +1 -1
  48. package/dist/as-filter-input.mjs +1 -1
  49. package/dist/as-filters-Bhte22La.cjs +130 -0
  50. package/dist/as-filters-DogNVlqr.mjs +125 -0
  51. package/dist/as-filters.cjs +1 -1
  52. package/dist/as-filters.d.cts +1 -1
  53. package/dist/as-filters.d.mts +1 -1
  54. package/dist/as-filters.mjs +1 -1
  55. package/dist/as-filters.vue-BG_ysCkC.d.mts +65 -0
  56. package/dist/as-filters.vue-DcxDnWAU.d.cts +65 -0
  57. package/dist/{as-preset-dialog-CDqCAR7N.mjs → as-preset-dialog-BwHV6Y77.mjs} +71 -21
  58. package/dist/{as-preset-dialog-DpM06jqR.cjs → as-preset-dialog-D2a6nxEX.cjs} +75 -25
  59. package/dist/as-preset-dialog.cjs +1 -1
  60. package/dist/as-preset-dialog.mjs +1 -1
  61. package/dist/{as-preset-picker-CISaxEZ0.mjs → as-preset-picker-B0JnyAPA.mjs} +39 -15
  62. package/dist/{as-preset-picker-jUS_YDX8.cjs → as-preset-picker-DbkmapBx.cjs} +45 -21
  63. package/dist/as-preset-picker.cjs +1 -1
  64. package/dist/as-preset-picker.mjs +1 -1
  65. package/dist/{as-row-actions-xqJeAdQl.mjs → as-row-actions-BkIsJVBm.mjs} +24 -11
  66. package/dist/{as-row-actions-Bm6Bzyno.cjs → as-row-actions-CRg8LHGk.cjs} +24 -11
  67. package/dist/as-row-actions.cjs +1 -1
  68. package/dist/as-row-actions.d.cts +1 -1
  69. package/dist/as-row-actions.d.mts +1 -1
  70. package/dist/as-row-actions.mjs +1 -1
  71. package/dist/{as-row-actions.vue-Bvcc2tUN.d.cts → as-row-actions.vue-VpJsBAJ4.d.mts} +8 -0
  72. package/dist/{as-row-actions.vue-DUSDuoR2.d.mts → as-row-actions.vue-dn_DKcMm.d.cts} +8 -0
  73. package/dist/{as-table-CDSG2yED.mjs → as-table-BEvsX87E.mjs} +26 -8
  74. package/dist/{as-table-actions-DMxeaczm.mjs → as-table-actions-B5upF1bQ.mjs} +69 -18
  75. package/dist/{as-table-actions-gV4lqqxc.cjs → as-table-actions-B6sKd4sl.cjs} +68 -17
  76. package/dist/as-table-actions.cjs +1 -1
  77. package/dist/as-table-actions.d.cts +1 -1
  78. package/dist/as-table-actions.d.mts +1 -1
  79. package/dist/as-table-actions.mjs +1 -1
  80. package/dist/{as-table-actions.vue-B-cgiCXP.d.cts → as-table-actions.vue-CoxhpIlJ.d.mts} +2 -2
  81. package/dist/{as-table-actions.vue-ClMa0OD1.d.mts → as-table-actions.vue-Kic8m28V.d.cts} +2 -2
  82. package/dist/{as-table-base-BaTE3VSN.mjs → as-table-base-BxKBdIdS.mjs} +142 -47
  83. package/dist/{as-table-base-RG2TEIgV.cjs → as-table-base-DLuhKz69.cjs} +142 -47
  84. package/dist/{as-table-cell-value-D1JkTQt0.cjs → as-table-cell-value-BAi5yadc.cjs} +2 -2
  85. package/dist/{as-table-cell-value-CPcFxSOj.mjs → as-table-cell-value-BVcfhhCb.mjs} +2 -2
  86. package/dist/as-table-cell-value.cjs +1 -1
  87. package/dist/as-table-cell-value.mjs +1 -1
  88. package/dist/{as-table-header-cell-CIqlO6Lw.cjs → as-table-header-cell-Bv6q5iKA.cjs} +2 -2
  89. package/dist/{as-table-header-cell-Bdhl5Lox.mjs → as-table-header-cell-Xd3cvnII.mjs} +2 -2
  90. package/dist/as-table-header-cell.cjs +1 -1
  91. package/dist/as-table-header-cell.d.cts +1 -1
  92. package/dist/as-table-header-cell.d.mts +1 -1
  93. package/dist/as-table-header-cell.mjs +1 -1
  94. package/dist/{as-table-header-cell.vue-BCszzxtU.d.mts → as-table-header-cell.vue-AS6u4e6v.d.cts} +2 -2
  95. package/dist/{as-table-header-cell.vue-BzTzfGRo.d.cts → as-table-header-cell.vue-zKOmlzhT.d.mts} +2 -2
  96. package/dist/{as-table-root-BLReUbRH.mjs → as-table-root-C1A6JkwL.mjs} +112 -10
  97. package/dist/{as-table-root-DLJ_3Jf4.cjs → as-table-root-DlYjnZax.cjs} +112 -10
  98. package/dist/as-table-root.cjs +1 -1
  99. package/dist/as-table-root.d.cts +1 -1
  100. package/dist/as-table-root.d.mts +1 -1
  101. package/dist/as-table-root.mjs +1 -1
  102. package/dist/{as-table-root.vue-QMT93qPk.d.mts → as-table-root.vue-CWk9YgpG.d.mts} +257 -41
  103. package/dist/{as-table-root.vue-D0T3n-Vm.d.cts → as-table-root.vue-D94eypcL.d.cts} +258 -42
  104. package/dist/{as-table-status-Du4WLF4k.cjs → as-table-status-B2HPerJT.cjs} +54 -38
  105. package/dist/{as-table-status-DGTZlpyq.mjs → as-table-status-QzlBdSiR.mjs} +54 -38
  106. package/dist/{as-table-BWUPzjRn.cjs → as-table-vJbZyZVx.cjs} +26 -8
  107. package/dist/as-table.cjs +1 -1
  108. package/dist/as-table.d.cts +1 -1
  109. package/dist/as-table.d.mts +1 -1
  110. package/dist/as-table.mjs +1 -1
  111. package/dist/{as-table.vue-Ds7MEp37.d.cts → as-table.vue-BB1vaNL6.d.cts} +28 -4
  112. package/dist/{as-table.vue-Ce5606ZO.d.mts → as-table.vue-BUDFTCpo.d.mts} +28 -4
  113. package/dist/{as-window-table-DWujiUQy.mjs → as-window-table-BH0tDDnr.mjs} +107 -24
  114. package/dist/{as-window-table-jD_y9yet.cjs → as-window-table-Bl_q72WL.cjs} +107 -24
  115. package/dist/as-window-table.cjs +1 -1
  116. package/dist/as-window-table.d.cts +1 -1
  117. package/dist/as-window-table.d.mts +1 -1
  118. package/dist/as-window-table.mjs +1 -1
  119. package/dist/{as-window-table.vue-DfZF1Mux.d.mts → as-window-table.vue-Be2IA0Eb.d.cts} +27 -4
  120. package/dist/{as-window-table.vue-Bhf9BK8E.d.cts → as-window-table.vue-CLqFM2ff.d.mts} +27 -4
  121. package/dist/error-message-CfKpn_5w.cjs +18 -0
  122. package/dist/error-message-gNEXnnbb.mjs +13 -0
  123. package/dist/index.cjs +237 -41
  124. package/dist/index.d.cts +10 -10
  125. package/dist/index.d.mts +10 -10
  126. package/dist/index.mjs +230 -43
  127. package/dist/{types-ByU4O0Yf.d.mts → types--ex8BJIO.d.cts} +263 -5
  128. package/dist/{types-CTMxE_zA.d.cts → types-CBGaTR2Z.d.mts} +263 -5
  129. package/dist/{use-table-CyFcVtUN.mjs → use-table-BFhbfWgY.mjs} +48 -23
  130. package/dist/{use-table-component-K6xj1obF.mjs → use-table-component-CRmLHdqi.mjs} +1 -1
  131. package/dist/{use-table-component-DO_kvKSf.cjs → use-table-component-DS5NJPzs.cjs} +1 -1
  132. package/dist/{use-table-nav-bridge-uOQUDooh.cjs → use-table-nav-bridge-DS14D_rG.cjs} +1 -1
  133. package/dist/{use-table-nav-bridge-DeGeaQX-.mjs → use-table-nav-bridge-DzJN5v9a.mjs} +1 -1
  134. package/dist/{use-table-nvBq1dZ4.cjs → use-table-nvuZdgUd.cjs} +51 -20
  135. package/dist/{use-table-state-BxX3SpeW.mjs → use-table-state-mBXx11aH.mjs} +501 -105
  136. package/dist/{use-table-state-Oi2ds4_a.cjs → use-table-state-mhm-YWnu.cjs} +541 -109
  137. package/package.json +9 -9
  138. package/dist/as-filters-DCZTHjf5.cjs +0 -51
  139. package/dist/as-filters-beIud9sF.mjs +0 -46
  140. package/dist/as-filters.vue-DmECMd1v.d.mts +0 -10
  141. package/dist/as-filters.vue-fv-tRL2H.d.cts +0 -10
  142. package/dist/preset-aspect-display-IICxAlVo.mjs +0 -43
  143. package/dist/preset-aspect-display-TWwf6j1B.cjs +0 -72
  144. /package/dist/{as-cell-json-popover-Dkdv5Y9E.mjs → as-cell-json-popover-CH5bAcLE.mjs} +0 -0
  145. /package/dist/{as-cell-json-popover-BM2QLgfk.cjs → as-cell-json-popover-vty5vMjW.cjs} +0 -0
  146. /package/dist/{as-column-menu-kTIQfLTi.mjs → as-column-menu-BMTS3DO2.mjs} +0 -0
  147. /package/dist/{as-column-menu-fZVbJ9lU.cjs → as-column-menu-D_8NxujZ.cjs} +0 -0
  148. /package/dist/{as-filter-input-BM23TNeh.mjs → as-filter-input-C8KmOus8.mjs} +0 -0
  149. /package/dist/{as-filter-input-DJu2k9gO.cjs → as-filter-input-DUqpkTkg.cjs} +0 -0
  150. /package/dist/{format-cell-D1Ziv96Q.mjs → format-cell-Bx7wNc4X.mjs} +0 -0
  151. /package/dist/{format-cell-vCNTh4WZ.cjs → format-cell-DaxV6WIJ.cjs} +0 -0
  152. /package/dist/{get-cell-value-4rHKP-TG.cjs → get-cell-value-CJT4fk4y.cjs} +0 -0
  153. /package/dist/{get-cell-value-C8LLc_Rr.mjs → get-cell-value-Cb3X8nUn.mjs} +0 -0
  154. /package/dist/{use-cell-locale-MQXoONh5.mjs → use-cell-locale-CxQOQsns.mjs} +0 -0
  155. /package/dist/{use-cell-locale-BGBRQB7s.cjs → use-cell-locale-caG2Fzpc.cjs} +0 -0
  156. /package/dist/{use-has-emit-listener-hhOH8CBI.cjs → use-has-emit-listener-BaGFZDyM.cjs} +0 -0
  157. /package/dist/{use-has-emit-listener-BTMDIv2e.mjs → use-has-emit-listener-DrBbsLHQ.mjs} +0 -0
  158. /package/dist/{use-seed-on-open-Dg9I89fU.cjs → use-seed-on-open-9TSm1Vbv.cjs} +0 -0
  159. /package/dist/{use-seed-on-open-DO3A1kIb.mjs → use-seed-on-open-DSh4XFyp.mjs} +0 -0
  160. /package/dist/{use-table-column-handlers-ehreEzcx.cjs → use-table-column-handlers-BMrP0WY2.cjs} +0 -0
  161. /package/dist/{use-table-column-handlers-CpiiIniD.mjs → use-table-column-handlers-Bx3JERqs.mjs} +0 -0
  162. /package/dist/{use-table-selection-Cmiu1h4S.cjs → use-table-selection-DtCV3rhu.cjs} +0 -0
  163. /package/dist/{use-table-selection-C84z4OZy.mjs → use-table-selection-ULbKT2xW.mjs} +0 -0
@@ -1,8 +1,8 @@
1
- import { o as useTableContextOptional } from "./use-table-state-BxX3SpeW.mjs";
2
- import { t as useTableComponent } from "./use-table-component-K6xj1obF.mjs";
3
- import { t as as_table_header_cell_default } from "./as-table-header-cell-Bdhl5Lox.mjs";
4
- import { t as as_row_actions_default } from "./as-row-actions-xqJeAdQl.mjs";
5
- import { t as as_table_cell_value_default } from "./as-table-cell-value-CPcFxSOj.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-mBXx11aH.mjs";
2
+ import { t as useTableComponent } from "./use-table-component-CRmLHdqi.mjs";
3
+ import { t as as_table_header_cell_default } from "./as-table-header-cell-Xd3cvnII.mjs";
4
+ import { t as as_row_actions_default } from "./as-row-actions-BkIsJVBm.mjs";
5
+ import { t as as_table_cell_value_default } from "./as-table-cell-value-BVcfhhCb.mjs";
6
6
  import { UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_STYLES, UI_TABLE_STYLES, getFieldMeta, parseStaticAttrs, resolveAttrs, resolveFieldProp } from "@atscript/ui";
7
7
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
8
8
  //#region src/composables/use-cell-resolver.ts
@@ -532,6 +532,18 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
532
532
  table.style.tableLayout = origTableLayout;
533
533
  return measured;
534
534
  }
535
+ /**
536
+ * The select-all control is a `role="checkbox"` span, not a `<button>`, so
537
+ * it gets no native key activation: bind Space (checkbox semantics) and
538
+ * Enter (the table's row-activation key) explicitly.
539
+ */
540
+ function onSelectAllKeydown(event) {
541
+ if (event.key !== " " && event.key !== "Enter") return;
542
+ if (!props.selectAllState) return;
543
+ event.preventDefault();
544
+ event.stopPropagation();
545
+ emit("select-all-toggle", props.selectAllState);
546
+ }
535
547
  return (_ctx, _cache) => {
536
548
  return openBlock(), createElementBlock("thead", null, [createElementVNode("tr", null, [
537
549
  __props.hasSelectColumn ? (openBlock(), createElementBlock("th", _hoisted_1$1, [__props.selectAllState ? (openBlock(), createElementBlock("span", {
@@ -542,9 +554,11 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
542
554
  }]),
543
555
  role: "checkbox",
544
556
  tabindex: "0",
557
+ "aria-label": "Select all rows",
545
558
  "aria-checked": __props.selectAllState === "none" ? "false" : __props.selectAllState === "all" ? "true" : "mixed",
546
- onClick: _cache[0] || (_cache[0] = ($event) => emit("select-all-toggle", __props.selectAllState))
547
- }, [__props.selectAllState === "all" ? (openBlock(), createElementBlock("span", _hoisted_3$1)) : __props.selectAllState === "some" ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("v-if", true)], 10, _hoisted_2$1)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
559
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("select-all-toggle", __props.selectAllState)),
560
+ onKeydown: onSelectAllKeydown
561
+ }, [__props.selectAllState === "all" ? (openBlock(), createElementBlock("span", _hoisted_3$1)) : __props.selectAllState === "some" ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("v-if", true)], 42, _hoisted_2$1)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
548
562
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
549
563
  return openBlock(), createElementBlock("th", {
550
564
  key: col.path,
@@ -557,37 +571,39 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
557
571
  onDragover: ($event) => col.fixed ? void 0 : unref(onHeaderDragOver)($event),
558
572
  onDrop: ($event) => col.fixed ? void 0 : unref(onHeaderDrop)($event),
559
573
  onDragend: ($event) => col.fixed ? void 0 : unref(onHeaderDragEnd)()
560
- }, [!col.fixed ? renderSlot(_ctx.$slots, `header-${col.path}`, {
561
- key: 0,
562
- column: col
563
- }, () => [(openBlock(), createBlock(resolveDynamicComponent(unref(HeaderCell)), {
564
- column: col,
565
- "sort-direction": sortMap.value[col.path] ?? null,
566
- filters: __props.filters?.[col.path],
567
- "column-menu": __props.columnMenu,
568
- "width-entry": __props.columnWidths[col.path],
569
- onSort: _cache[1] || (_cache[1] = (c, d) => emit("sort", c, d)),
570
- onHide: _cache[2] || (_cache[2] = (c) => emit("hide", c)),
571
- onFilter: _cache[3] || (_cache[3] = (c) => emit("filter", c)),
572
- onFiltersOff: _cache[4] || (_cache[4] = (c) => emit("filters-off", c)),
573
- onResetWidth: _cache[5] || (_cache[5] = (c) => emit("reset-width", c))
574
- }, null, 40, [
575
- "column",
576
- "sort-direction",
577
- "filters",
578
- "column-menu",
579
- "width-entry"
580
- ]))]) : createCommentVNode("v-if", true), __props.resizable && !col.fixed ? (openBlock(), createElementBlock("div", {
581
- key: 1,
582
- class: "as-th-resize-handle",
583
- draggable: "false",
584
- onDragstart: _cache[6] || (_cache[6] = withModifiers(() => {}, ["prevent", "stop"])),
585
- onPointerdown: _cache[7] || (_cache[7] = withModifiers((...args) => unref(onResizeHandlePointerDown) && unref(onResizeHandlePointerDown)(...args), ["stop"])),
586
- onPointermove: _cache[8] || (_cache[8] = (...args) => unref(onResizeHandlePointerMove) && unref(onResizeHandlePointerMove)(...args)),
587
- onPointerup: _cache[9] || (_cache[9] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
588
- onPointercancel: _cache[10] || (_cache[10] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
589
- onDblclick: _cache[11] || (_cache[11] = withModifiers((...args) => unref(onResizeHandleDoubleClick) && unref(onResizeHandleDoubleClick)(...args), ["stop"]))
590
- }, null, 32)) : createCommentVNode("v-if", true)], 46, _hoisted_5$1);
574
+ }, [
575
+ createCommentVNode(" An explicitly supplied `header-<path>` slot renders for fixed\n (synthesised) columns too; only the DEFAULT header cell is\n suppressed there, so `__actions` keeps its blank gutter unless\n the consumer fills it. Reorder/resize stay disabled regardless. "),
576
+ renderSlot(_ctx.$slots, `header-${col.path}`, { column: col }, () => [!col.fixed ? (openBlock(), createBlock(resolveDynamicComponent(unref(HeaderCell)), {
577
+ key: 0,
578
+ column: col,
579
+ "sort-direction": sortMap.value[col.path] ?? null,
580
+ filters: __props.filters?.[col.path],
581
+ "column-menu": __props.columnMenu,
582
+ "width-entry": __props.columnWidths[col.path],
583
+ onSort: _cache[1] || (_cache[1] = (c, d) => emit("sort", c, d)),
584
+ onHide: _cache[2] || (_cache[2] = (c) => emit("hide", c)),
585
+ onFilter: _cache[3] || (_cache[3] = (c) => emit("filter", c)),
586
+ onFiltersOff: _cache[4] || (_cache[4] = (c) => emit("filters-off", c)),
587
+ onResetWidth: _cache[5] || (_cache[5] = (c) => emit("reset-width", c))
588
+ }, null, 40, [
589
+ "column",
590
+ "sort-direction",
591
+ "filters",
592
+ "column-menu",
593
+ "width-entry"
594
+ ])) : createCommentVNode("v-if", true)]),
595
+ __props.resizable && !col.fixed ? (openBlock(), createElementBlock("div", {
596
+ key: 0,
597
+ class: "as-th-resize-handle",
598
+ draggable: "false",
599
+ onDragstart: _cache[6] || (_cache[6] = withModifiers(() => {}, ["prevent", "stop"])),
600
+ onPointerdown: _cache[7] || (_cache[7] = withModifiers((...args) => unref(onResizeHandlePointerDown) && unref(onResizeHandlePointerDown)(...args), ["stop"])),
601
+ onPointermove: _cache[8] || (_cache[8] = (...args) => unref(onResizeHandlePointerMove) && unref(onResizeHandlePointerMove)(...args)),
602
+ onPointerup: _cache[9] || (_cache[9] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
603
+ onPointercancel: _cache[10] || (_cache[10] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
604
+ onDblclick: _cache[11] || (_cache[11] = withModifiers((...args) => unref(onResizeHandleDoubleClick) && unref(onResizeHandleDoubleClick)(...args), ["stop"]))
605
+ }, null, 32)) : createCommentVNode("v-if", true)
606
+ ], 46, _hoisted_5$1);
591
607
  }), 128)),
592
608
  __props.withFiller ? (openBlock(), createElementBlock("th", _hoisted_6$1)) : createCommentVNode("v-if", true)
593
609
  ])]);
@@ -1,10 +1,9 @@
1
- const require_use_table_state = require("./use-table-state-Oi2ds4_a.cjs");
2
- const require_use_table_selection = require("./use-table-selection-Cmiu1h4S.cjs");
3
- const require_use_has_emit_listener = require("./use-has-emit-listener-hhOH8CBI.cjs");
4
- const require_use_table_column_handlers = require("./use-table-column-handlers-ehreEzcx.cjs");
5
- const require_as_table_base = require("./as-table-base-RG2TEIgV.cjs");
1
+ const require_use_table_state = require("./use-table-state-mhm-YWnu.cjs");
2
+ const require_use_table_selection = require("./use-table-selection-DtCV3rhu.cjs");
3
+ const require_use_has_emit_listener = require("./use-has-emit-listener-BaGFZDyM.cjs");
4
+ const require_use_table_column_handlers = require("./use-table-column-handlers-BMrP0WY2.cjs");
5
+ const require_as_table_base = require("./as-table-base-DLuhKz69.cjs");
6
6
  let vue = require("vue");
7
- let _atscript_ui_table = require("@atscript/ui-table");
8
7
  //#region src/components/as-table.vue?vue&type=script&setup=true&lang.ts
9
8
  const _hoisted_1 = { class: "as-table-outer-wrap" };
10
9
  const _hoisted_2 = {
@@ -76,6 +75,18 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
76
75
  type: Boolean,
77
76
  required: false,
78
77
  default: false
78
+ },
79
+ rowSelectable: {
80
+ type: Function,
81
+ required: false
82
+ },
83
+ rowClass: {
84
+ type: Function,
85
+ required: false
86
+ },
87
+ rowAttrs: {
88
+ type: Function,
89
+ required: false
79
90
  }
80
91
  },
81
92
  emits: [
@@ -90,6 +101,9 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
90
101
  (0, vue.watch)(() => props.rowDelete, (val) => {
91
102
  state.rowDelete.value = val;
92
103
  }, { immediate: true });
104
+ (0, vue.watch)(() => props.rowSelectable, (val) => {
105
+ state.rowSelectable.value = val;
106
+ }, { immediate: true });
93
107
  require_use_table_selection.useSelectModeReset(state, () => props.select);
94
108
  (0, vue.watch)(() => {
95
109
  const placement = props.rowActionsColumn;
@@ -99,7 +113,7 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
99
113
  }, (on) => {
100
114
  state.includeActions.value = on;
101
115
  }, { immediate: true });
102
- const effectiveRows = (0, vue.computed)(() => props.rows ?? state.results.value);
116
+ const effectiveRows = (0, vue.computed)(() => state.applyLocalSort(props.rows ?? state.results.value));
103
117
  const actionsCol = (0, vue.computed)(() => {
104
118
  const acts = state.actions.row;
105
119
  return {
@@ -126,7 +140,7 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
126
140
  require_use_table_state.useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event), require_use_has_emit_listener.useHasEmitListener("onMainAction"));
127
141
  const { onSort, onHide, onFilter, onFiltersOff, onResetWidth, onReorder, onClearFilters } = require_use_table_column_handlers.useTableColumnHandlers(state);
128
142
  function handleSelectAll() {
129
- state.selectedRows.value = (0, _atscript_ui_table.rowsToPks)(effectiveRows.value, state.rowValueFn);
143
+ state.selectAll(effectiveRows.value);
130
144
  }
131
145
  function handleDeselectAll() {
132
146
  state.selectedRows.value = [];
@@ -155,6 +169,8 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
155
169
  resizable: __props.resizable,
156
170
  "column-min-width": __props.columnMinWidth,
157
171
  "column-widths": (0, vue.unref)(state).columnWidths.value,
172
+ "row-class": __props.rowClass,
173
+ "row-attrs": __props.rowAttrs,
158
174
  onSort: (0, vue.unref)(onSort),
159
175
  onHide: (0, vue.unref)(onHide),
160
176
  onFilter: (0, vue.unref)(onFilter),
@@ -193,6 +209,8 @@ var as_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
193
209
  "resizable",
194
210
  "column-min-width",
195
211
  "column-widths",
212
+ "row-class",
213
+ "row-attrs",
196
214
  "onSort",
197
215
  "onHide",
198
216
  "onFilter",
package/dist/as-table.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_table = require("./as-table-BWUPzjRn.cjs");
1
+ const require_as_table = require("./as-table-vJbZyZVx.cjs");
2
2
  module.exports = require_as_table.as_table_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table.vue-Ds7MEp37.cjs";
1
+ import { t as _default } from "./as-table.vue-BB1vaNL6.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-table.vue-Ce5606ZO.mjs";
1
+ import { t as _default } from "./as-table.vue-BUDFTCpo.mjs";
2
2
  export { _default as default };
package/dist/as-table.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as as_table_default } from "./as-table-CDSG2yED.mjs";
1
+ import { t as as_table_default } from "./as-table-BEvsX87E.mjs";
2
2
  export { as_table_default as default };
@@ -1,4 +1,4 @@
1
- import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-CTMxE_zA.cjs";
1
+ import { g as RowDeleteOpt, h as RowClassHook, m as RowAttrsHook, n as ColumnMenuConfig, v as RowSelectableHook } from "./types--ex8BJIO.cjs";
2
2
  import * as vue from "vue";
3
3
  import { ColumnDef } from "@atscript/ui";
4
4
  import { SelectionMode } from "@atscript/ui-table";
@@ -54,26 +54,50 @@ type __VLS_Props = {
54
54
  * (sort/filter/reorder/resize) are unavailable in headless mode.
55
55
  */
56
56
  headless?: boolean;
57
+ /**
58
+ * Per-row selectability. Return `false` — or a string, surfaced as the
59
+ * disabled reason on the row's selection control — to make a row not
60
+ * selectable. Enforced on every path: row click, Space/Enter toggle, and
61
+ * the header select-all (which also stops counting ineligible rows).
62
+ * Since 0.1.133.
63
+ *
64
+ * @example
65
+ * `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
66
+ */
67
+ rowSelectable?: RowSelectableHook;
68
+ /**
69
+ * Extra classes for the row element — string, array, or
70
+ * `{ class: boolean }` map, merged with the framework's own row classes.
71
+ * Since 0.1.133.
72
+ */
73
+ rowClass?: RowClassHook;
74
+ /**
75
+ * Extra attributes for the row element. The framework's own `id`, `role`,
76
+ * `aria-*`, `data-*`, `class` and `style` always win, so a hook can
77
+ * decorate a row but never rewrite its accessibility contract.
78
+ * Since 0.1.133.
79
+ */
80
+ rowAttrs?: RowAttrsHook;
57
81
  };
58
82
  declare var __VLS_21: string, __VLS_22: any, __VLS_24: {};
59
83
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any } & {
60
84
  'query-loading'?: (props: typeof __VLS_24) => any;
61
85
  };
62
86
  declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
63
- "main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
64
87
  "row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
65
88
  "row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
89
+ "main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
66
90
  }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
67
- "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
68
91
  "onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
69
92
  "onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
93
+ "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
70
94
  }>, {
71
- select: SelectionMode;
72
95
  stickyHeader: boolean;
73
96
  virtualOverscan: number;
74
97
  reorderable: boolean;
75
98
  resizable: boolean;
76
99
  columnMinWidth: number;
100
+ select: SelectionMode;
77
101
  rowDelete: boolean | RowDeleteOpt;
78
102
  rowActionsColumn: "first" | "last" | "merge-select" | false;
79
103
  headless: boolean;
@@ -1,4 +1,4 @@
1
- import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-ByU4O0Yf.mjs";
1
+ import { g as RowDeleteOpt, h as RowClassHook, m as RowAttrsHook, n as ColumnMenuConfig, v as RowSelectableHook } from "./types-CBGaTR2Z.mjs";
2
2
  import { ColumnDef } from "@atscript/ui";
3
3
  import * as vue from "vue";
4
4
  import { SelectionMode } from "@atscript/ui-table";
@@ -54,26 +54,50 @@ type __VLS_Props = {
54
54
  * (sort/filter/reorder/resize) are unavailable in headless mode.
55
55
  */
56
56
  headless?: boolean;
57
+ /**
58
+ * Per-row selectability. Return `false` — or a string, surfaced as the
59
+ * disabled reason on the row's selection control — to make a row not
60
+ * selectable. Enforced on every path: row click, Space/Enter toggle, and
61
+ * the header select-all (which also stops counting ineligible rows).
62
+ * Since 0.1.133.
63
+ *
64
+ * @example
65
+ * `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
66
+ */
67
+ rowSelectable?: RowSelectableHook;
68
+ /**
69
+ * Extra classes for the row element — string, array, or
70
+ * `{ class: boolean }` map, merged with the framework's own row classes.
71
+ * Since 0.1.133.
72
+ */
73
+ rowClass?: RowClassHook;
74
+ /**
75
+ * Extra attributes for the row element. The framework's own `id`, `role`,
76
+ * `aria-*`, `data-*`, `class` and `style` always win, so a hook can
77
+ * decorate a row but never rewrite its accessibility contract.
78
+ * Since 0.1.133.
79
+ */
80
+ rowAttrs?: RowAttrsHook;
57
81
  };
58
82
  declare var __VLS_21: string, __VLS_22: any, __VLS_24: {};
59
83
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any } & {
60
84
  'query-loading'?: (props: typeof __VLS_24) => any;
61
85
  };
62
86
  declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
63
- "main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
64
87
  "row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
65
88
  "row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
89
+ "main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
66
90
  }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
67
- "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
68
91
  "onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
69
92
  "onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
93
+ "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
70
94
  }>, {
71
- select: SelectionMode;
72
95
  stickyHeader: boolean;
73
96
  virtualOverscan: number;
74
97
  reorderable: boolean;
75
98
  resizable: boolean;
76
99
  columnMinWidth: number;
100
+ select: SelectionMode;
77
101
  rowDelete: boolean | RowDeleteOpt;
78
102
  rowActionsColumn: "first" | "last" | "merge-select" | false;
79
103
  headless: boolean;
@@ -1,9 +1,9 @@
1
- import { a as useTableContext, i as useRegisterMainActionListener } from "./use-table-state-BxX3SpeW.mjs";
2
- import { t as useSelectModeReset } from "./use-table-selection-C84z4OZy.mjs";
3
- import { t as useHasEmitListener } from "./use-has-emit-listener-BTMDIv2e.mjs";
4
- import { t as getCellValue } from "./get-cell-value-C8LLc_Rr.mjs";
5
- import { a as useCellComponents, i as useRafBatch, 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";
6
- import { t as useTableColumnHandlers } from "./use-table-column-handlers-CpiiIniD.mjs";
1
+ import { a as useTableContext, i as useRegisterMainActionListener, p as onSelectControlKeydown } from "./use-table-state-mBXx11aH.mjs";
2
+ import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
3
+ import { t as useSelectModeReset } from "./use-table-selection-ULbKT2xW.mjs";
4
+ import { t as useHasEmitListener } from "./use-has-emit-listener-DrBbsLHQ.mjs";
5
+ import { a as useCellComponents, i as useRafBatch, 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-QzlBdSiR.mjs";
6
+ import { t as useTableColumnHandlers } from "./use-table-column-handlers-Bx3JERqs.mjs";
7
7
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, watch, withCtx, withModifiers } from "vue";
8
8
  import { DEFAULT_ROW_HEIGHT_PX, clampTopIndex, filledFilterCount } from "@atscript/ui-table";
9
9
  import { useElementSize, useResizeObserver } from "@vueuse/core";
@@ -175,6 +175,7 @@ const _hoisted_2 = ["aria-rowcount", "aria-multiselectable"];
175
175
  const _hoisted_3 = ["aria-activedescendant"];
176
176
  const _hoisted_4 = [
177
177
  "id",
178
+ "data-selectable",
178
179
  "aria-rowindex",
179
180
  "aria-selected",
180
181
  "onClick",
@@ -185,7 +186,14 @@ const _hoisted_5 = {
185
186
  class: "as-td-select",
186
187
  role: "gridcell"
187
188
  };
188
- const _hoisted_6 = ["aria-checked"];
189
+ const _hoisted_6 = [
190
+ "tabindex",
191
+ "aria-label",
192
+ "title",
193
+ "aria-checked",
194
+ "aria-disabled",
195
+ "onKeydown"
196
+ ];
189
197
  const _hoisted_7 = {
190
198
  key: 0,
191
199
  class: "as-table-checkbox-tick",
@@ -241,6 +249,14 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
241
249
  type: Boolean,
242
250
  required: false,
243
251
  default: false
252
+ },
253
+ rowClass: {
254
+ type: Function,
255
+ required: false
256
+ },
257
+ rowAttrs: {
258
+ type: Function,
259
+ required: false
244
260
  }
245
261
  },
246
262
  emits: [
@@ -255,6 +271,10 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
255
271
  const { state } = useTableContext();
256
272
  const { resolve: cellResolver, hasAnyCellBindings } = useCellResolver(() => state.tableDef.value);
257
273
  const cellComponents = useCellComponents(() => state.columns.value);
274
+ const headerColumns = computed(() => state.columns.value.map((c) => c.local && c.sortable ? {
275
+ ...c,
276
+ sortable: false
277
+ } : c));
258
278
  const hasValue = computed(() => props.select !== "none");
259
279
  const hasActiveFilters = computed(() => filledFilterCount(state.filters.value) > 0);
260
280
  const selectAllState = computed(() => {
@@ -267,6 +287,13 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
267
287
  return out;
268
288
  });
269
289
  const rowStyle = computed(() => ({ height: `${props.rowHeight}px` }));
290
+ /** Shared "selectable" verdict — frozen, so a hookless pool allocates nothing. */
291
+ const SELECTABLE = Object.freeze({ ok: true });
292
+ /** Accessible name for a row's selection control, carrying the disabled reason. */
293
+ function selectLabel(verdict) {
294
+ if (verdict.ok) return "Select row";
295
+ return verdict.reason ? `Select row, ${verdict.reason}` : "Select row, not selectable";
296
+ }
270
297
  const visibleSlots = computed(() => {
271
298
  const viewport = state.viewportRowCount.value;
272
299
  if (viewport <= 0) return [];
@@ -276,19 +303,38 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
276
303
  const rowValueFn = state.rowValueFn;
277
304
  const hasSelection = props.select !== "none";
278
305
  const selectedSet = hasSelection ? new Set(state.selectedRows.value) : null;
306
+ const gated = !!state.rowSelectable.value;
307
+ const hasHooks = gated || !!props.rowClass || !!props.rowAttrs;
279
308
  const out = [];
280
309
  for (let s = 0; s < count; s++) {
281
310
  const abs = top + s;
282
311
  const row = state.dataAt(abs);
283
312
  const pk = row === void 0 ? void 0 : rowValueFn(row);
284
313
  const selected = selectedSet !== null && row !== void 0 && selectedSet.has(pk);
314
+ let selectable = SELECTABLE;
315
+ let cls;
316
+ let attrs;
317
+ if (hasHooks && row !== void 0) {
318
+ const hookCtx = {
319
+ index: abs,
320
+ get selected() {
321
+ return selected;
322
+ }
323
+ };
324
+ if (gated) selectable = state.isRowSelectable(row, abs);
325
+ cls = props.rowClass?.(row, hookCtx);
326
+ attrs = props.rowAttrs?.(row, hookCtx);
327
+ }
285
328
  out.push({
286
329
  s,
287
330
  row,
288
331
  pk,
289
332
  errored: row === void 0 && state.errorAt(abs) !== null,
290
333
  selected,
291
- ariaSelected: hasSelection ? selected ? "true" : "false" : void 0
334
+ ariaSelected: hasSelection ? selected ? "true" : "false" : void 0,
335
+ selectable,
336
+ cls,
337
+ attrs
292
338
  });
293
339
  }
294
340
  return out;
@@ -324,6 +370,9 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
324
370
  mode: props.select
325
371
  });
326
372
  }
373
+ function onSelectCellKeydown(event, absIdx) {
374
+ onSelectControlKeydown(event, absIdx, props.select, state);
375
+ }
327
376
  watch([() => state.activeIndex.value, () => state.viewportRowCount.value], ([idx, viewport]) => {
328
377
  if (idx < 0) return;
329
378
  if (viewport <= 0) return;
@@ -362,11 +411,12 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
362
411
  state.requestMainAction(event);
363
412
  }
364
413
  function onSelectAllToggle(headerState) {
365
- if (headerState === "none") {
366
- const pks = [];
367
- for (const row of state.windowCache.value.values()) pks.push(state.rowValueFn(row));
368
- state.selectedRows.value = pks;
369
- } else state.selectedRows.value = [];
414
+ if (headerState !== "none") {
415
+ state.selectedRows.value = [];
416
+ return;
417
+ }
418
+ const entries = [...state.windowCache.value.entries()].toSorted((a, b) => a[0] - b[0]);
419
+ state.selectAll(entries.map((e) => e[1]), (i) => entries[i][0]);
370
420
  }
371
421
  const { onSort, onHide, onFilter, onFiltersOff, onResetWidth, onReorder, onClearFilters } = useTableColumnHandlers(state);
372
422
  const wrapperRef = ref(null);
@@ -431,7 +481,7 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
431
481
  ]),
432
482
  !__props.headless ? (openBlock(), createBlock(as_table_header_default, {
433
483
  key: 0,
434
- columns: unref(state).columns.value,
484
+ columns: headerColumns.value,
435
485
  sorters: unref(state).sorters.value,
436
486
  filters: unref(state).filters.value,
437
487
  "column-menu": __props.columnMenu,
@@ -488,23 +538,37 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
488
538
  onTouchmove: withModifiers(onTouchMove, ["prevent"]),
489
539
  onTouchend: onTouchEnd
490
540
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleSlots.value, (slot) => {
491
- return openBlock(), createElementBlock(Fragment, { key: `slot-${slot.s}` }, [slot.row !== void 0 ? (openBlock(), createElementBlock("tr", {
541
+ return openBlock(), createElementBlock(Fragment, { key: `slot-${slot.s}` }, [createCommentVNode("\n `v-bind=\"slot.attrs\"` comes FIRST so every framework binding\n after it wins — consumer attrs decorate a row, never rewrite its\n id / role / aria / data contract.\n "), slot.row !== void 0 ? (openBlock(), createElementBlock("tr", mergeProps({
492
542
  key: 0,
543
+ ref_for: true
544
+ }, slot.attrs, {
493
545
  id: unref(state).rowId(unref(state).topIndex.value + slot.s),
494
- class: normalizeClass(["as-window-data-row", { "as-table-row-active": unref(state).activeIndex.value === unref(state).topIndex.value + slot.s }]),
546
+ class: [
547
+ "as-window-data-row",
548
+ { "as-table-row-active": unref(state).activeIndex.value === unref(state).topIndex.value + slot.s },
549
+ slot.cls
550
+ ],
551
+ "data-selectable": slot.selectable.ok ? void 0 : "false",
495
552
  role: "row",
496
553
  "aria-rowindex": unref(state).topIndex.value + slot.s + 2,
497
554
  "aria-selected": slot.ariaSelected,
498
- style: normalizeStyle(rowStyle.value),
555
+ style: rowStyle.value,
499
556
  onClick: ($event) => onRowClick(slot.row, $event, unref(state).topIndex.value + slot.s),
500
557
  onDblclick: ($event) => onRowDblClick(slot.row, $event, unref(state).topIndex.value + slot.s)
501
- }, [
558
+ }), [
502
559
  hasValue.value ? (openBlock(), createElementBlock("td", _hoisted_5, [createElementVNode("span", {
503
- class: normalizeClass(["as-table-checkbox", { "as-table-checkbox-checked": slot.selected }]),
560
+ class: normalizeClass(["as-table-checkbox", {
561
+ "as-table-checkbox-checked": slot.selected,
562
+ "as-table-checkbox-disabled": !slot.selectable.ok
563
+ }]),
504
564
  role: "checkbox",
505
- tabindex: "0",
506
- "aria-checked": slot.selected ? "true" : "false"
507
- }, [slot.selected ? (openBlock(), createElementBlock("span", _hoisted_7)) : createCommentVNode("v-if", true)], 10, _hoisted_6)])) : createCommentVNode("v-if", true),
565
+ tabindex: slot.selectable.ok ? 0 : void 0,
566
+ "aria-label": selectLabel(slot.selectable),
567
+ title: slot.selectable.reason,
568
+ "aria-checked": slot.selected ? "true" : "false",
569
+ "aria-disabled": slot.selectable.ok ? void 0 : "true",
570
+ onKeydown: ($event) => onSelectCellKeydown($event, unref(state).topIndex.value + slot.s)
571
+ }, [slot.selected ? (openBlock(), createElementBlock("span", _hoisted_7)) : createCommentVNode("v-if", true)], 42, _hoisted_6)])) : createCommentVNode("v-if", true),
508
572
  unref(hasAnyCellBindings) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(state).columns.value, (col) => {
509
573
  return openBlock(), createElementBlock(Fragment, { key: col.path }, [(openBlock(true), createElementBlock(Fragment, null, renderList([unref(cellResolver)(col, slot.row, unref(state).topIndex.value + slot.s)], (bindings) => {
510
574
  return openBlock(), createElementBlock(Fragment, { key: 0 }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", mergeProps({
@@ -537,7 +601,7 @@ var as_window_table_base_default = /* @__PURE__ */ defineComponent({
537
601
  class: "as-td-filler",
538
602
  role: "gridcell"
539
603
  }, null, -1))
540
- ], 46, _hoisted_4)) : (openBlock(), createBlock(as_window_skeleton_row_default, {
604
+ ], 16, _hoisted_4)) : (openBlock(), createBlock(as_window_skeleton_row_default, {
541
605
  key: 1,
542
606
  columns: unref(state).columns.value,
543
607
  "row-height": __props.rowHeight,
@@ -658,6 +722,18 @@ var as_window_table_default = /* @__PURE__ */ defineComponent({
658
722
  type: Boolean,
659
723
  required: false,
660
724
  default: false
725
+ },
726
+ rowSelectable: {
727
+ type: Function,
728
+ required: false
729
+ },
730
+ rowClass: {
731
+ type: Function,
732
+ required: false
733
+ },
734
+ rowAttrs: {
735
+ type: Function,
736
+ required: false
661
737
  }
662
738
  },
663
739
  emits: [
@@ -673,6 +749,9 @@ var as_window_table_default = /* @__PURE__ */ defineComponent({
673
749
  watch(() => props.rowDelete, (val) => {
674
750
  state.rowDelete.value = val;
675
751
  }, { immediate: true });
752
+ watch(() => props.rowSelectable, (val) => {
753
+ state.rowSelectable.value = val;
754
+ }, { immediate: true });
676
755
  useSelectModeReset(state, () => props.select);
677
756
  useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event), useHasEmitListener("onMainAction"));
678
757
  const containerRef = ref(null);
@@ -709,6 +788,8 @@ var as_window_table_default = /* @__PURE__ */ defineComponent({
709
788
  select: __props.select,
710
789
  headless: __props.headless,
711
790
  "enter-action": __props.enterAction,
791
+ "row-class": __props.rowClass,
792
+ "row-attrs": __props.rowAttrs,
712
793
  onRowClick: _cache[0] || (_cache[0] = (row, ev) => emit("row-click", row, ev)),
713
794
  onRowDblclick: _cache[1] || (_cache[1] = (row, ev) => emit("row-dblclick", row, ev)),
714
795
  onViewportMetricsChange: onMetrics
@@ -726,7 +807,9 @@ var as_window_table_default = /* @__PURE__ */ defineComponent({
726
807
  "column-min-width",
727
808
  "select",
728
809
  "headless",
729
- "enter-action"
810
+ "enter-action",
811
+ "row-class",
812
+ "row-attrs"
730
813
  ]), unref(state).querying.value ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "query-loading", {}, () => [_cache[2] || (_cache[2] = createElementVNode("span", {
731
814
  class: "as-table-query-overlay-icon",
732
815
  "aria-hidden": "true"