@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,13 +1,13 @@
1
- import { _ as TableNavBridge, c as NavKeyOptions, d as ReactiveTableState, g as TableActionsState, h as TVueTableActionInfo, i as ConfirmOptions, l as PresetConfig, m as TAsTableControls, p as TAsCellTypeComponents, t as ActionResult } from "./types-CTMxE_zA.cjs";
1
+ import { C as TableActionsState, S as TVueTableActionInfo, b as TAsCellTypeComponents, f as ReactiveTableState, i as ConfirmOptions, l as NavKeyOptions, p as RowActionsConfig, t as ActionResult, u as PresetConfig, w as TableNavBridge, x as TAsTableControls } from "./types--ex8BJIO.cjs";
2
2
  import * as vue from "vue";
3
3
  import { AllowedComponentProps, AnchorHTMLAttributes, App, Component as Component$1, ComponentCustomProps, ComponentPublicInstance, ComputedRef, DefineComponent, InjectionKey, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, UnwrapRef, VNode, VNodeProps, WritableComputedRef } from "vue";
4
- import { Client, PageResult, TDbActionInfo } from "@atscript/db-client";
4
+ import { Client, PageResult } from "@atscript/db-client";
5
+ import { FilterExpr, Uniquery } from "@uniqu/core";
5
6
  import * as _atscript_ui0 from "@atscript/ui";
6
7
  import { ClientFactory, ClientFactory as ClientFactory$1, ColumnDef, SortControl, TableDef, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
7
8
  import * as _atscript_ui_table0 from "@atscript/ui-table";
8
- import { AppConfData, AppConfData as AppConfData$1, AsPresetEntryRow, AsPresetEntryRow as AsPresetEntryRow$1, ColumnWidthsMap, FilterCondition, PRESET_ASPECTS, PresetAspect, PresetAspect as PresetAspect$1, PresetCapabilities, PresetCapabilities as PresetCapabilities$1, PresetData, PresetDraft, PresetSnapshot, PresetSnapshot as PresetSnapshot$1, PresetSnapshotWire, QueryOptions, STANDARD_PRESET_ID, SYSTEM_PRESET_PREFIX, SelectionMode, SystemPreset, SystemPreset as SystemPreset$1, SystemPresetInput, SystemPresetInput as SystemPresetInput$1, UrlQuerySync, UrlQuerySync as UrlQuerySync$1, UserConfData, isSystemPresetId, resolveSystemPresets } from "@atscript/ui-table";
9
+ import { AppConfData, AppConfData as AppConfData$1, AsPresetEntryRow, AsPresetEntryRow as AsPresetEntryRow$1, ColumnWidthsMap, CsvOptions, CsvOptions as CsvOptions$1, DisplayColumnDef, DisplayColumnDef as DisplayColumnDef$1, ExportAbortError, ExportScalar, ExportScalar as ExportScalar$1, FilterCondition, PRESET_ASPECTS, PresetAspect, PresetAspect as PresetAspect$1, PresetCapabilities, PresetCapabilities as PresetCapabilities$1, PresetData, PresetDraft, PresetSnapshot, PresetSnapshot as PresetSnapshot$1, PresetSnapshotWire, QueryOptions, STANDARD_PRESET_ID, SYSTEM_PRESET_PREFIX, SelectionMode, SystemPreset, SystemPreset as SystemPreset$1, SystemPresetInput, SystemPresetInput as SystemPresetInput$1, UrlQuerySync, UrlQuerySync as UrlQuerySync$1, UserConfData, isSystemPresetId, resolveSystemPresets } from "@atscript/ui-table";
9
10
  import { TAsTypeComponents } from "@atscript/vue-form";
10
- import { FilterExpr, Uniquery } from "@uniqu/core";
11
11
 
12
12
  //#region src/composables/state/create-selection.d.ts
13
13
  type Row = Record<string, unknown>;
@@ -30,6 +30,14 @@ interface UseLocalDraftOptions {
30
30
  enabled: Ref<boolean> | boolean;
31
31
  /** Persisted-aspect gate — drafts only persist aspects in this set. */
32
32
  availableAspects: readonly PresetAspect[];
33
+ /**
34
+ * Identity the draft is keyed under — pass the signed-in user's id so a
35
+ * shared browser never restores the previous user's draft. Reactive: when
36
+ * it changes, reads and writes move to the new key and the old scope's
37
+ * draft is neither read nor overwritten. Omitted (or `undefined`) keeps
38
+ * the pre-0.1.133 unscoped key. Since 0.1.133.
39
+ */
40
+ scope?: MaybeRefOrGetter<string | undefined>;
33
41
  /** Optional debounce override (default 300ms). */
34
42
  debounceMs?: number;
35
43
  /**
@@ -67,8 +75,9 @@ interface UseLocalDraftReturn {
67
75
  }
68
76
  /**
69
77
  * localStorage overlay manager for table presets. One overlay per
70
- * `(app, tableKey)`; switching presets clears it (caller's responsibility
71
- * — this composable only tracks state, not which preset is active).
78
+ * `(app, scope, tableKey)`; switching presets clears it (caller's
79
+ * responsibility — this composable only tracks state, not which preset is
80
+ * active).
72
81
  */
73
82
  declare function useLocalDraft(opts: UseLocalDraftOptions): UseLocalDraftReturn;
74
83
  //#endregion
@@ -104,6 +113,11 @@ interface UsePresetsReturn {
104
113
  /** False on 401/403 from initial load — UI hides itself. */
105
114
  available: ComputedRef<boolean>;
106
115
  loading: Ref<boolean>;
116
+ /**
117
+ * Load failure from `reload()`, or null. Mutator failures are NOT recorded
118
+ * here — they rethrow, and the table-state slice's
119
+ * `state.preset.lastError` is the single channel UI renders.
120
+ */
107
121
  error: Ref<unknown>;
108
122
  /**
109
123
  * Authoritative current-user id. `capabilities.userId` when caps are
@@ -186,6 +200,16 @@ interface TableContext {
186
200
  formComponents?: Record<string, Component$1>;
187
201
  }
188
202
  type QueryFn = (query: Uniquery, page: number, size: number) => Promise<PageResult<Record<string, unknown>>>;
203
+ /** Per-call overrides for `state.buildQuery()`. Since 0.1.134. */
204
+ interface BuildQueryOptions {
205
+ /**
206
+ * Column paths to project instead of the visible ones. Client-owned
207
+ * (`local`) columns are dropped from the result either way.
208
+ */
209
+ columnPaths?: string[];
210
+ /** Override the `$actions` opt-in (default: whatever the renderer asked for). */
211
+ includeActions?: boolean;
212
+ }
189
213
  /** External refs the consumer wires up via `defineModel` (or otherwise). */
190
214
  interface TableModelRefs {
191
215
  filterFields?: Ref<string[]>;
@@ -212,8 +236,12 @@ interface TableQueryOptions {
212
236
  * meta), regardless of which columns are visible. Additive only.
213
237
  */
214
238
  alwaysSelected?: string[];
215
- /** When true, all triggers (query/queryNext/loadRange) early-return. */
216
- blockQuery?: boolean;
239
+ /**
240
+ * When true, all triggers (query/queryNext/loadRange) early-return. Pass a
241
+ * getter (or a ref) to keep it reactive: when it flips back to `false` the
242
+ * table runs the query it was holding back, once. Since 0.1.133.
243
+ */
244
+ blockQuery?: boolean | (() => boolean);
217
245
  /**
218
246
  * Configured default for the runtime `ignoreSortersWhenSearched` flag
219
247
  * (default `false`). Opt-in for relevance-ranked backends: while the
@@ -225,6 +253,12 @@ interface TableQueryOptions {
225
253
  ignoreSortersWhenSearched?: boolean;
226
254
  /** Auto-query when metadata loads (default: true). */
227
255
  queryOnMount?: boolean;
256
+ /**
257
+ * The query function already returns its rows ordered by every active
258
+ * sorter, so `applyLocalSort` must not re-order the page on top of it. Set
259
+ * by the in-memory (`createStaticTableState`) path. Since 0.1.134.
260
+ */
261
+ preSorted?: boolean;
228
262
  /**
229
263
  * Gate the initial `scheduleQuery("initial")` until this ref flips to
230
264
  * `true`. Used by `<AsTableRoot>` when `v-model:urlQuery` is bound, to
@@ -275,6 +309,8 @@ interface TablePresetOptions {
275
309
  draftHandle?: UseLocalDraftReturn | null;
276
310
  /** App-declared aspect set; default `['columns','filters','filterOps','sorters']`. */
277
311
  availableAspects?: PresetAspect[];
312
+ /** Aspects a system preset owns; intersected with `availableAspects`, default all. */
313
+ systemAspects?: PresetAspect[];
278
314
  /** Static fallback for system presets when no `presetsHandle` is wired. */
279
315
  fallbackSystemPresets?: SystemPreset[];
280
316
  /** Whether localStorage drafts should be hydrated + persisted on bootstrap. */
@@ -297,6 +333,11 @@ interface CreateTableStateOptions {
297
333
  actions?: TableActionsOptions;
298
334
  /** Preset settings. */
299
335
  preset?: TablePresetOptions;
336
+ /**
337
+ * Client-owned columns merged into the server's column list. Captured once
338
+ * at setup — to change the set, re-mount. Since 0.1.134.
339
+ */
340
+ displayColumns?: readonly DisplayColumnDef[];
300
341
  }
301
342
  /** Internal handles returned alongside the public state. */
302
343
  interface TableStateInternals {
@@ -310,8 +351,12 @@ declare function createTableState(opts: CreateTableStateOptions): {
310
351
  internals: TableStateInternals;
311
352
  };
312
353
  interface CreateStaticTableStateOptions {
313
- /** All rows in the dataset. Sorting/searching is applied locally. */
314
- rows: Record<string, unknown>[];
354
+ /**
355
+ * All rows in the dataset. Sorting/searching is applied locally. Pass a
356
+ * getter (or a ref) to keep it reactive — every local "fetch" re-reads it,
357
+ * so replacing the array and calling `state.query()` re-renders the table.
358
+ */
359
+ rows: MaybeRefOrGetter<Record<string, unknown>[]>;
315
360
  /** Columns to render. Used to synthesize a minimal `TableDef`. */
316
361
  columns: ColumnDef[];
317
362
  /** Field paths matched (substring, case-insensitive) by `searchTerm`. */
@@ -320,6 +365,23 @@ interface CreateStaticTableStateOptions {
320
365
  selection?: TableSelectionOptions;
321
366
  /** Default page size (`pagination.itemsPerPage`). */
322
367
  limit?: number;
368
+ /**
369
+ * Sort `rows` in memory from the active sorters (default `true`). Set
370
+ * `false` when `rows` already arrives in the order it should render and the
371
+ * header's sort affordance is purely cosmetic. Since 0.1.134.
372
+ */
373
+ localSort?: boolean;
374
+ /** Client-owned columns merged into `columns`. Since 0.1.134. */
375
+ displayColumns?: readonly DisplayColumnDef[];
376
+ /** External refs from `defineModel` — same contract as `createTableState`. Since 0.1.134. */
377
+ model?: TableModelRefs;
378
+ /** Auto-query once the synthetic definition is in place (default: true). Since 0.1.134. */
379
+ queryOnMount?: boolean;
380
+ /**
381
+ * Action settings. Only the client-free parts apply — there is no client to
382
+ * invoke a server action with. Since 0.1.134.
383
+ */
384
+ actions?: TableActionsOptions;
323
385
  }
324
386
  /**
325
387
  * Build a `ReactiveTableState` backed by an in-memory row list. Used by the
@@ -330,6 +392,8 @@ declare function createStaticTableState(opts: CreateStaticTableStateOptions): {
330
392
  state: ReactiveTableState;
331
393
  internals: TableStateInternals;
332
394
  };
395
+ /** Provide the full table context to the component subtree. */
396
+ declare function provideTableContext(ctx: TableContext): void;
333
397
  /** Inject the full table context (throws if used outside as-table-root). */
334
398
  declare function useTableContext(): TableContext;
335
399
  /**
@@ -420,8 +484,12 @@ interface UseTableOptions {
420
484
  queryFn?: QueryFn;
421
485
  /** Auto-query when metadata loads (default: true). */
422
486
  queryOnMount?: boolean;
423
- /** When true, all triggers (query/queryNext/loadRange) early-return. */
424
- blockQuery?: boolean;
487
+ /**
488
+ * When true, all triggers (query/queryNext/loadRange) early-return. Pass a
489
+ * getter to keep it reactive — the held-back query runs once when it flips
490
+ * back to `false`. Since 0.1.133.
491
+ */
492
+ blockQuery?: boolean | (() => boolean);
425
493
  /** Page-alignment unit for `loadRange` and the `queryNext` extension. */
426
494
  blockSize?: number;
427
495
  /** Debounce window for the topIndex/viewportRowCount watcher. */
@@ -481,6 +549,11 @@ interface UseTableOptions {
481
549
  * `url` and `tableKey` are required.
482
550
  */
483
551
  preset?: PresetConfig;
552
+ /**
553
+ * Client-owned columns merged into the server's column list — see
554
+ * {@link DisplayColumnDef}. Captured once at setup. Since 0.1.134.
555
+ */
556
+ displayColumns?: readonly DisplayColumnDef[];
484
557
  }
485
558
  /**
486
559
  * Main entry composable for table setup.
@@ -489,6 +562,106 @@ interface UseTableOptions {
489
562
  */
490
563
  declare function useTable(url: string, opts?: UseTableOptions): ReactiveTableState;
491
564
  //#endregion
565
+ //#region src/composables/use-table-export.d.ts
566
+ /** Per-cell formatter override. Return `undefined` to fall back to the default. */
567
+ type ExportCellFormatter = (value: unknown, column: ColumnDef, row: Record<string, unknown>) => ExportScalar | undefined;
568
+ interface ExportRowsOptions {
569
+ /**
570
+ * `'visible'` (default) exports the visible columns in their current display
571
+ * order, minus the client-owned ([display](/tables/customization)) ones —
572
+ * nothing on the server backs them, so they would export as an empty column
573
+ * unless a `formatters` entry fills them in. An array of column paths
574
+ * exports exactly those, in that order, display columns included.
575
+ */
576
+ columns?: "visible" | string[];
577
+ /** `'csv'` (default) renders a CSV string; `'rows'` returns scalar arrays. */
578
+ format?: "csv" | "rows";
579
+ /** Rows per request while paging. Default 500. */
580
+ pageSize?: number;
581
+ /** Stop the run between pages; the promise rejects with an `AbortError`. */
582
+ signal?: AbortSignal;
583
+ /** Called after each settled page. `total` is the first page's `count`, when the endpoint reports one. */
584
+ onProgress?: (done: number, total?: number) => void;
585
+ /** Global cell formatter, applied to every column that has no `formatters` entry. */
586
+ formatCell?: ExportCellFormatter;
587
+ /** Per-column formatters keyed by column path. Win over `formatCell`. */
588
+ formatters?: Record<string, ExportCellFormatter>;
589
+ /** File name for `format: 'csv'`. `.csv` is appended when missing. Default `"export.csv"`. */
590
+ filename?: string;
591
+ /**
592
+ * CSV writer settings — `bom`, `escapeFormulas`, `delimiter`. Ignored by
593
+ * `format: 'rows'`.
594
+ */
595
+ csv?: CsvOptions;
596
+ /** Hard ceiling on exported rows. */
597
+ maxRows?: number;
598
+ }
599
+ interface ExportResultBase {
600
+ /** Header labels, in export order. */
601
+ columns: string[];
602
+ /** Column paths, in export order. */
603
+ columnPaths: string[];
604
+ /** How many data rows the run collected. */
605
+ rowCount: number;
606
+ /** Total the endpoint reported for the query, when it reported one. */
607
+ total?: number;
608
+ }
609
+ /** A finished export. `format` discriminates the payload. */
610
+ type ExportResult = (ExportResultBase & {
611
+ format: "csv";
612
+ csv: string;
613
+ filename: string;
614
+ }) | (ExportResultBase & {
615
+ format: "rows";
616
+ rows: ExportScalar[][];
617
+ });
618
+ /** Progress of the run in flight: rows collected so far, and the reported total. */
619
+ interface ExportProgress {
620
+ done: number;
621
+ total?: number;
622
+ }
623
+ interface UseTableExportReturn {
624
+ /**
625
+ * Run an export against the table's CURRENT query. Rejects when a run is
626
+ * already in flight — one handle runs one export at a time.
627
+ */
628
+ exportRows: (opts?: ExportRowsOptions) => Promise<ExportResult>;
629
+ /** `true` while an `exportRows` call is in flight. */
630
+ exporting: ComputedRef<boolean>;
631
+ /** Progress of the in-flight run, or `null` while idle. */
632
+ progress: Ref<ExportProgress | null>;
633
+ }
634
+ /**
635
+ * Export the table's data as it is queried right now.
636
+ *
637
+ * The export snapshots the table's own query at call time — the same filters,
638
+ * sorters, search term, force-filters and `$select` projection the on-screen
639
+ * fetch uses (`state.buildQuery()`), through the same fetch path
640
+ * (`state.fetchPage()`, so a custom `queryFn` is honoured) — then pages
641
+ * through every result instead of one page. The primary key(s) are appended
642
+ * to the sort as a tiebreaker so pages never overlap or skip.
643
+ *
644
+ * Values come out of the same column metadata the cells read: union/enum keys
645
+ * become their labels, dates become ISO strings, arrays join. Override per
646
+ * column with `formatters`, or globally with `formatCell`.
647
+ *
648
+ * ```ts
649
+ * const { exportRows } = useTableExport()
650
+ * downloadExport(await exportRows({ filename: "orders.csv", csv: { bom: true } }))
651
+ * ```
652
+ *
653
+ * Since 0.1.134.
654
+ */
655
+ declare function useTableExport(ctx?: TableContext): UseTableExportReturn;
656
+ /**
657
+ * Hand a finished CSV export to the browser as a file download. Returns
658
+ * `false` without doing anything when there is no DOM (SSR / a worker), so a
659
+ * server render can call it unguarded.
660
+ *
661
+ * Since 0.1.134.
662
+ */
663
+ declare function downloadExport(result: ExportResult): boolean;
664
+ //#endregion
492
665
  //#region src/composables/use-table-nav-bridge.d.ts
493
666
  interface UseTableNavBridgeOptions extends Omit<NavKeyOptions, "mode"> {
494
667
  /**
@@ -1982,6 +2155,14 @@ interface UseTableUrlQueryOptions {
1982
2155
  * navigation-recoverable.
1983
2156
  */
1984
2157
  mode?: "replace" | "push";
2158
+ /**
2159
+ * Namespace for this table's query keys. With `prefix: "t1"` every key the
2160
+ * bridge writes becomes `t1.<key>` (`t1.$skip`, `t1.status`, `t1.total>100`)
2161
+ * and only keys under that prefix are read back or removed. Keys with no
2162
+ * prefix — or another table's prefix — are foreign and preserved untouched,
2163
+ * so two tables can share one route. Since 0.1.133.
2164
+ */
2165
+ prefix?: string;
1985
2166
  }
1986
2167
  /**
1987
2168
  * Bridge `<AsTableRoot v-model:url-query>` to vue-router. Uses **type-only**
@@ -1989,11 +2170,19 @@ interface UseTableUrlQueryOptions {
1989
2170
  * dependency on `vue-router` is added to `@atscript/vue-table`. Consumers
1990
2171
  * pass in their already-resolved `useRoute()` and `useRouter()` instances.
1991
2172
  *
1992
- * Scope: **owns the whole query string**. The getter returns the entire
1993
- * `route.query` serialized; the setter replaces `route.query` wholesale.
1994
- * Apps that need the table to coexist with non-table query params should
1995
- * write their own `computed` instead — that pattern is small and keeps the
1996
- * library's contract crisp.
2173
+ * Scope: the bridge owns **only what the table reads back** (since 0.1.133).
2174
+ * A key is the table's iff `urlQueryStringToState` would consume it — see
2175
+ * `urlQueryConsumesKey` — or the bridge has written it before. Read and
2176
+ * write therefore agree in both directions: a key the parser ignores (a host
2177
+ * flag, an unrecognised `$control`) is never removed, and a key the parser
2178
+ * reads is the bridge's to remove. Every write merges into the current
2179
+ * `route.query`, in place.
2180
+ *
2181
+ * Without a `prefix` the bridge cannot tell a plain `field=value` filter from
2182
+ * a page-owned flag of the same shape, so a plain key that was already in the
2183
+ * URL when the bridge mounted counts as foreign until the bridge writes it
2184
+ * itself. Pass `prefix` when a route carries a host key that could collide
2185
+ * with a column path, or when it carries two tables.
1997
2186
  *
1998
2187
  * @example
1999
2188
  * ```vue
@@ -2001,6 +2190,9 @@ interface UseTableUrlQueryOptions {
2001
2190
  * import { useRoute, useRouter } from 'vue-router';
2002
2191
  * import { useTableUrlQuery } from '@atscript/vue-table';
2003
2192
  * const urlQuery = useTableUrlQuery(useRoute(), useRouter());
2193
+ * // Two tables on one route:
2194
+ * // const left = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'a' });
2195
+ * // const right = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'b' });
2004
2196
  * </script>
2005
2197
  * <template>
2006
2198
  * <AsTableRoot v-model:url-query="urlQuery" url="/db/products" .../>
@@ -2157,25 +2349,48 @@ declare function getCellValue(row: Record<string, unknown>, path: string): unkno
2157
2349
  /** Format a cell value based on column type. */
2158
2350
  declare function formatCellValue(value: unknown, type: string): string;
2159
2351
  //#endregion
2160
- //#region src/composables/state/intent-scope.d.ts
2161
- /**
2162
- * Build the identifier object to forward to `client.action` / `client.remove`.
2163
- *
2164
- * Per `@atscript/db-client` invariant #11, identifier bodies are object-only
2165
- * — never bare scalars, even for single-field PK tables. This helper accepts:
2166
- * - a row-shaped object (default `rowValueFn`) → picks `preferredId` fields;
2167
- * - a scalar value when `preferredId` has exactly one field (consumers that
2168
- * override `rowValueFn` to return the PK scalar) → wraps it.
2169
- *
2170
- * Returns `undefined` when no `preferredId` is declared, the source is
2171
- * `null`/`undefined`, or a scalar can't be paired with a single-field
2172
- * identifier.
2173
- */
2174
- declare function extractIdentifier(source: unknown, preferredId: readonly string[]): Record<string, unknown> | undefined;
2175
- //#endregion
2176
2352
  //#region src/components/as-table-root.vue.d.ts
2177
2353
  type __VLS_Props = {
2178
- /** Table endpoint URL (e.g. "/db/tables/products"). */url: string; /** Factory to create a client from a URL. Falls back to the app-wide default set via `setDefaultClientFactory` (or the built-in `new Client(url)` factory if unset). */
2354
+ /**
2355
+ * Table endpoint URL (e.g. "/db/tables/products"). Omit it — and pass
2356
+ * `:rows` + `:columns` instead — to run the table in local mode over an
2357
+ * already-loaded array.
2358
+ */
2359
+ url?: string;
2360
+ /**
2361
+ * Local mode: render these rows instead of fetching. No client, no
2362
+ * `/meta` request and no metadata cache entry. Reactive — replacing the
2363
+ * array re-runs the local query (search / sort / paging stay live).
2364
+ * Requires `:columns`. Since 0.1.134.
2365
+ */
2366
+ rows?: Record<string, unknown>[];
2367
+ /**
2368
+ * Local mode: the columns to render. Read once at setup. Since 0.1.134.
2369
+ */
2370
+ columns?: ColumnDef[];
2371
+ /**
2372
+ * Local mode: field paths the search term matches (substring,
2373
+ * case-insensitive). Omit to disable search. Since 0.1.134.
2374
+ */
2375
+ searchPaths?: string[];
2376
+ /**
2377
+ * Local mode: sort `rows` in memory from the active sorters (default
2378
+ * `true`). Since 0.1.134.
2379
+ */
2380
+ localSort?: boolean;
2381
+ /**
2382
+ * Client-owned columns merged into the server's column list — labelled,
2383
+ * hideable, reorderable and preset-persisted like any column, but never
2384
+ * part of `$select`, server sorting or filters. Since 0.1.134.
2385
+ */
2386
+ displayColumns?: DisplayColumnDef[];
2387
+ /**
2388
+ * Per-screen policy for the row-actions cell: narrow the server's action
2389
+ * set (`include` / `exclude`), relabel it (`overrides`), and append
2390
+ * app-owned actions (`extra`). The server stays authoritative — an action
2391
+ * a row's `$actions` gated away never appears. Since 0.1.134.
2392
+ */
2393
+ rowActions?: RowActionsConfig; /** Factory to create a client from a URL. Falls back to the app-wide default set via `setDefaultClientFactory` (or the built-in `new Client(url)` factory if unset). */
2179
2394
  clientFactory?: ClientFactory; /** Skin-slot overrides for table chrome — header cells, filter dialog, column menu, etc. Use {@link createDefaultControls} to seed defaults. */
2180
2395
  controls?: TAsTableControls; /** Cell-type → component dispatch map. Use {@link createDefaultCellTypes} to seed defaults. */
2181
2396
  types?: TAsCellTypeComponents; /** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
@@ -2261,10 +2476,10 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
2261
2476
  declare var __VLS_1: {
2262
2477
  tableDef: _atscript_ui0.TableDef | null;
2263
2478
  loadingMetadata: boolean;
2264
- allColumns: _atscript_ui0.ColumnDef[];
2479
+ allColumns: ColumnDef[];
2265
2480
  columnNames: string[];
2266
2481
  columnWidths: ColumnWidthsMap;
2267
- columns: _atscript_ui0.ColumnDef[];
2482
+ columns: ColumnDef[];
2268
2483
  filterFields: string[];
2269
2484
  filters: _atscript_ui_table0.FieldFilters;
2270
2485
  sorters: SortControl[];
@@ -2286,7 +2501,7 @@ declare var __VLS_1: {
2286
2501
  queryNext: () => void;
2287
2502
  resetFilters: () => void;
2288
2503
  showConfigDialog: (tab?: _atscript_ui_table0.ConfigTab) => void;
2289
- openFilterDialog: (column: _atscript_ui0.ColumnDef) => void;
2504
+ openFilterDialog: (column: ColumnDef) => void;
2290
2505
  closeFilterDialog: () => void;
2291
2506
  setFieldFilter: (path: string, conditions: _atscript_ui_table0.FilterCondition[]) => void;
2292
2507
  removeFieldFilter: (path: string) => void;
@@ -2310,9 +2525,11 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
2310
2525
  "update:selectedRows": (value: unknown[]) => any;
2311
2526
  "update:urlQuery": (value: string | undefined) => any;
2312
2527
  } & {
2313
- action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent | undefined) => any;
2314
- "main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
2528
+ "main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
2529
+ action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
2315
2530
  }, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
2531
+ "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
2532
+ onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
2316
2533
  "onUpdate:filterFields"?: ((value: string[]) => any) | undefined;
2317
2534
  "onUpdate:columnNames"?: ((value: string[]) => any) | undefined;
2318
2535
  "onUpdate:columnWidths"?: ((value: ColumnWidthsMap) => any) | undefined;
@@ -2320,9 +2537,8 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
2320
2537
  "onUpdate:ignoreSortersWhenSearched"?: ((value: boolean) => any) | undefined;
2321
2538
  "onUpdate:selectedRows"?: ((value: unknown[]) => any) | undefined;
2322
2539
  "onUpdate:urlQuery"?: ((value: string | undefined) => any) | undefined;
2323
- onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent | undefined) => any) | undefined;
2324
- "onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
2325
2540
  }>, {
2541
+ localSort: boolean;
2326
2542
  queryOnMount: boolean;
2327
2543
  selectionPersistence: SelectionPersistence;
2328
2544
  refreshOnAction: boolean;
@@ -2335,4 +2551,4 @@ type __VLS_WithSlots<T, S> = T & {
2335
2551
  };
2336
2552
  };
2337
2553
  //#endregion
2338
- export { createStaticTableState as $, createDefaultCellTypes as A, useTableActions as B, extractIdentifier as C, CellLocale as D, getColumnWidth as E, useAppPrefs as F, clearTableCache as G, useTableFilter as H, AS_PRESETS_APP as I, useTableSelection as J, useTable as K, injectPresetsApp as L, useTableComponent as M, UseAppPrefsOptions as N, provideCellLocale as O, UseAppPrefsReturn as P, TableStateInternals as Q, UseTableUrlQueryOptions as R, setDefaultClientFactory as S, getCellValue as T, useTableNavBridge as U, useTableSearch as V, UseTableOptions as W, CreateTableStateOptions as X, CreateStaticTableStateOptions as Y, TableContext as Z, UserConfData as _, PRESET_ASPECTS as a, UsePresetsReturn as at, resetDefaultClientFactory as b, PresetData as c, UseLocalDraftOptions as ct, QueryOptions as d, createTableState as et, STANDARD_PRESET_ID as f, UrlQuerySync$1 as g, SystemPresetInput$1 as h, ClientFactory$1 as i, UsePresetsOptions as it, createDefaultControls as j, useCellLocale as k, PresetSnapshot$1 as l, UseLocalDraftReturn as lt, SystemPreset$1 as m, AppConfData$1 as n, useTableContextOptional as nt, PresetAspect$1 as o, usePresets as ot, SYSTEM_PRESET_PREFIX as p, SelectionPersistence as q, AsPresetEntryRow$1 as r, ActivePresetView as rt, PresetCapabilities$1 as s, StorageLike as st, _default as t, useTableContext as tt, PresetSnapshotWire as u, useLocalDraft as ut, getDefaultClientFactory as v, formatCellValue as w, resolveSystemPresets as x, isSystemPresetId as y, useTableUrlQuery as z };
2554
+ export { useTableExport as $, CellLocale as A, injectPresetsApp as B, isSystemPresetId as C, UseLocalDraftReturn as Ct, formatCellValue as D, setDefaultClientFactory as E, useTableComponent as F, useTableFilter as G, useTableUrlQuery as H, UseAppPrefsOptions as I, ExportProgress as J, useTableNavBridge as K, UseAppPrefsReturn as L, useCellLocale as M, createDefaultCellTypes as N, getCellValue as O, createDefaultControls as P, downloadExport as Q, useAppPrefs as R, getDefaultClientFactory as S, UseLocalDraftOptions as St, resolveSystemPresets as T, useTableActions as U, UseTableUrlQueryOptions as V, useTableSearch as W, ExportRowsOptions as X, ExportResult as Y, UseTableExportReturn as Z, SYSTEM_PRESET_PREFIX as _, ActivePresetView as _t, CsvOptions$1 as a, BuildQueryOptions as at, UrlQuerySync$1 as b, usePresets as bt, ExportScalar$1 as c, QueryFn as ct, PresetCapabilities$1 as d, TableStateInternals as dt, UseTableOptions as et, PresetData as f, createStaticTableState as ft, STANDARD_PRESET_ID as g, useTableContextOptional as gt, QueryOptions as h, useTableContext as ht, ClientFactory$1 as i, useTableSelection as it, provideCellLocale as j, getColumnWidth as k, PRESET_ASPECTS as l, TableContext as lt, PresetSnapshotWire as m, provideTableContext as mt, AppConfData$1 as n, useTable as nt, DisplayColumnDef$1 as o, CreateStaticTableStateOptions as ot, PresetSnapshot$1 as p, createTableState as pt, ExportCellFormatter as q, AsPresetEntryRow$1 as r, SelectionPersistence as rt, ExportAbortError as s, CreateTableStateOptions as st, _default as t, clearTableCache as tt, PresetAspect$1 as u, TableModelRefs as ut, SystemPreset$1 as v, UsePresetsOptions as vt, resetDefaultClientFactory as w, useLocalDraft as wt, UserConfData as x, StorageLike as xt, SystemPresetInput$1 as y, UsePresetsReturn as yt, AS_PRESETS_APP as z };
@@ -1,8 +1,8 @@
1
- const require_use_table_state = require("./use-table-state-Oi2ds4_a.cjs");
2
- const require_use_table_component = require("./use-table-component-DO_kvKSf.cjs");
3
- const require_as_table_header_cell = require("./as-table-header-cell-CIqlO6Lw.cjs");
4
- const require_as_row_actions = require("./as-row-actions-Bm6Bzyno.cjs");
5
- const require_as_table_cell_value = require("./as-table-cell-value-D1JkTQt0.cjs");
1
+ const require_use_table_state = require("./use-table-state-mhm-YWnu.cjs");
2
+ const require_use_table_component = require("./use-table-component-DS5NJPzs.cjs");
3
+ const require_as_table_header_cell = require("./as-table-header-cell-Bv6q5iKA.cjs");
4
+ const require_as_row_actions = require("./as-row-actions-CRg8LHGk.cjs");
5
+ const require_as_table_cell_value = require("./as-table-cell-value-BAi5yadc.cjs");
6
6
  let _atscript_ui = require("@atscript/ui");
7
7
  let vue = require("vue");
8
8
  //#region src/composables/use-cell-resolver.ts
@@ -532,6 +532,18 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.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 (0, vue.openBlock)(), (0, vue.createElementBlock)("thead", null, [(0, vue.createElementVNode)("tr", null, [
537
549
  __props.hasSelectColumn ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_1$1, [__props.selectAllState ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
@@ -542,9 +554,11 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.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" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$1)) : __props.selectAllState === "some" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$1)) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_2$1)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true),
559
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("select-all-toggle", __props.selectAllState)),
560
+ onKeydown: onSelectAllKeydown
561
+ }, [__props.selectAllState === "all" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$1)) : __props.selectAllState === "some" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$1)) : (0, vue.createCommentVNode)("v-if", true)], 42, _hoisted_2$1)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true),
548
562
  ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.columns, (col) => {
549
563
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
550
564
  key: col.path,
@@ -557,37 +571,39 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
557
571
  onDragover: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDragOver)($event),
558
572
  onDrop: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDrop)($event),
559
573
  onDragend: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDragEnd)()
560
- }, [!col.fixed ? (0, vue.renderSlot)(_ctx.$slots, `header-${col.path}`, {
561
- key: 0,
562
- column: col
563
- }, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.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
- ]))]) : (0, vue.createCommentVNode)("v-if", true), __props.resizable && !col.fixed ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
581
- key: 1,
582
- class: "as-th-resize-handle",
583
- draggable: "false",
584
- onDragstart: _cache[6] || (_cache[6] = (0, vue.withModifiers)(() => {}, ["prevent", "stop"])),
585
- onPointerdown: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandlePointerDown) && (0, vue.unref)(onResizeHandlePointerDown)(...args), ["stop"])),
586
- onPointermove: _cache[8] || (_cache[8] = (...args) => (0, vue.unref)(onResizeHandlePointerMove) && (0, vue.unref)(onResizeHandlePointerMove)(...args)),
587
- onPointerup: _cache[9] || (_cache[9] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
588
- onPointercancel: _cache[10] || (_cache[10] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
589
- onDblclick: _cache[11] || (_cache[11] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandleDoubleClick) && (0, vue.unref)(onResizeHandleDoubleClick)(...args), ["stop"]))
590
- }, null, 32)) : (0, vue.createCommentVNode)("v-if", true)], 46, _hoisted_5$1);
574
+ }, [
575
+ (0, vue.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
+ (0, vue.renderSlot)(_ctx.$slots, `header-${col.path}`, { column: col }, () => [!col.fixed ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.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
+ ])) : (0, vue.createCommentVNode)("v-if", true)]),
595
+ __props.resizable && !col.fixed ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
596
+ key: 0,
597
+ class: "as-th-resize-handle",
598
+ draggable: "false",
599
+ onDragstart: _cache[6] || (_cache[6] = (0, vue.withModifiers)(() => {}, ["prevent", "stop"])),
600
+ onPointerdown: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandlePointerDown) && (0, vue.unref)(onResizeHandlePointerDown)(...args), ["stop"])),
601
+ onPointermove: _cache[8] || (_cache[8] = (...args) => (0, vue.unref)(onResizeHandlePointerMove) && (0, vue.unref)(onResizeHandlePointerMove)(...args)),
602
+ onPointerup: _cache[9] || (_cache[9] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
603
+ onPointercancel: _cache[10] || (_cache[10] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
604
+ onDblclick: _cache[11] || (_cache[11] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandleDoubleClick) && (0, vue.unref)(onResizeHandleDoubleClick)(...args), ["stop"]))
605
+ }, null, 32)) : (0, vue.createCommentVNode)("v-if", true)
606
+ ], 46, _hoisted_5$1);
591
607
  }), 128)),
592
608
  __props.withFiller ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_6$1)) : (0, vue.createCommentVNode)("v-if", true)
593
609
  ])]);