@atscript/vue-table 0.1.150 → 0.1.152

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 (123) hide show
  1. package/dist/as-action-form-dialog.cjs +1 -1
  2. package/dist/as-action-form-dialog.mjs +1 -1
  3. package/dist/{as-action-menu-content-BBwL1YZU.mjs → as-action-menu-content-BubYpIBQ.mjs} +1 -1
  4. package/dist/{as-action-menu-content-DAOjkslC.cjs → as-action-menu-content-DYcj5oBL.cjs} +1 -1
  5. package/dist/as-cell-date-CB5L8NZ-.mjs +85 -0
  6. package/dist/as-cell-date-C_ak4iib.cjs +90 -0
  7. package/dist/as-cell-date.cjs +1 -1
  8. package/dist/as-cell-date.d.cts +1 -1
  9. package/dist/as-cell-date.d.mts +1 -1
  10. package/dist/as-cell-date.mjs +1 -1
  11. package/dist/as-cell-date.vue-DwTSTjsj.d.cts +14 -0
  12. package/dist/as-cell-date.vue-Dyq2-vg9.d.mts +14 -0
  13. package/dist/{as-cell-number-D-mSaE_G.mjs → as-cell-number-CXhVesLq.mjs} +12 -23
  14. package/dist/{as-cell-number-C4JMqvqa.cjs → as-cell-number-vsYD5pyO.cjs} +12 -23
  15. package/dist/as-cell-number.cjs +1 -1
  16. package/dist/as-cell-number.mjs +1 -1
  17. package/dist/{as-config-dialog-ZKMnfirD.mjs → as-config-dialog-DW4WfYEi.mjs} +2 -2
  18. package/dist/{as-config-dialog-CnIvMsK0.cjs → as-config-dialog-XSkaW1X0.cjs} +2 -2
  19. package/dist/as-config-dialog.cjs +1 -1
  20. package/dist/as-config-dialog.mjs +1 -1
  21. package/dist/{as-confirm-dialog-cSEHVFBq.cjs → as-confirm-dialog-pcKkl-Qo.cjs} +1 -1
  22. package/dist/{as-confirm-dialog-DMiGquH1.mjs → as-confirm-dialog-rWRl5z4R.mjs} +1 -1
  23. package/dist/as-confirm-dialog.cjs +1 -1
  24. package/dist/as-confirm-dialog.mjs +1 -1
  25. package/dist/{as-filter-dialog-DNFR30fV.mjs → as-filter-dialog-8xvnKXTd.mjs} +10 -10
  26. package/dist/{as-filter-dialog-KjvJdaMg.cjs → as-filter-dialog-Cd16xRfM.cjs} +10 -10
  27. package/dist/as-filter-dialog.cjs +1 -1
  28. package/dist/as-filter-dialog.mjs +1 -1
  29. package/dist/{as-filter-field-BsucQwbm.cjs → as-filter-field-BPPMOZ9M.cjs} +4 -4
  30. package/dist/{as-filter-field-DE6MJMx7.mjs → as-filter-field-DEBQQy_6.mjs} +4 -4
  31. package/dist/as-filter-field.cjs +1 -1
  32. package/dist/as-filter-field.mjs +1 -1
  33. package/dist/{as-filter-input-ChJ8JE6-.cjs → as-filter-input-DZkhoSWO.cjs} +2 -2
  34. package/dist/{as-filter-input-DmOW_jzK.mjs → as-filter-input-DeI85XVZ.mjs} +2 -2
  35. package/dist/as-filter-input.cjs +1 -1
  36. package/dist/as-filter-input.mjs +1 -1
  37. package/dist/{as-filters-CYC_SXaA.cjs → as-filters-C22XxgEx.cjs} +4 -4
  38. package/dist/{as-filters-DErM2bFq.mjs → as-filters-CT1ks7gu.mjs} +4 -4
  39. package/dist/as-filters.cjs +1 -1
  40. package/dist/as-filters.mjs +1 -1
  41. package/dist/{as-preset-dialog-CY5dPfZa.mjs → as-preset-dialog-BXL8yt8O.mjs} +2 -2
  42. package/dist/{as-preset-dialog-tM-jrQgs.cjs → as-preset-dialog-CFvmrXGP.cjs} +2 -2
  43. package/dist/as-preset-dialog.cjs +1 -1
  44. package/dist/as-preset-dialog.mjs +1 -1
  45. package/dist/{as-preset-picker-CjSXtx83.cjs → as-preset-picker-DjV1c6Kh.cjs} +2 -2
  46. package/dist/{as-preset-picker-DkZ7sinz.mjs → as-preset-picker-IVVvFw6r.mjs} +2 -2
  47. package/dist/as-preset-picker.cjs +1 -1
  48. package/dist/as-preset-picker.mjs +1 -1
  49. package/dist/{as-residual-filter-XkXnMQNu.cjs → as-residual-filter-BGz7pSdL.cjs} +2 -2
  50. package/dist/{as-residual-filter-DHfbtTQj.mjs → as-residual-filter-BoeOL9AJ.mjs} +2 -2
  51. package/dist/as-residual-filter.cjs +1 -1
  52. package/dist/as-residual-filter.mjs +1 -1
  53. package/dist/{as-row-actions-BNQ7jrie.mjs → as-row-actions-QN_UFuah.mjs} +2 -2
  54. package/dist/{as-row-actions-q_oMmUz1.cjs → as-row-actions-S_IVb5c2.cjs} +2 -2
  55. package/dist/as-row-actions.cjs +1 -1
  56. package/dist/as-row-actions.mjs +1 -1
  57. package/dist/{as-select-cell-Dc3lArvR.cjs → as-select-cell-BmLF217C.cjs} +5 -5
  58. package/dist/{as-select-cell-DjcPorVb.mjs → as-select-cell-C9T1NHmN.mjs} +5 -5
  59. package/dist/{as-selection-banner-CxPXBztW.cjs → as-selection-banner-CroHk4lr.cjs} +1 -1
  60. package/dist/{as-selection-banner-Ca9DWVdW.mjs → as-selection-banner-DHzfs4v9.mjs} +1 -1
  61. package/dist/{as-table-BIAkCI4g.cjs → as-table-BIKHGH4x.cjs} +5 -3
  62. package/dist/{as-table-Bcz-WOTS.mjs → as-table-DEjvo36o.mjs} +5 -3
  63. package/dist/{as-table-actions-TaI-NeVv.cjs → as-table-actions-CgMktjjD.cjs} +2 -2
  64. package/dist/{as-table-actions-DPq5SrGa.mjs → as-table-actions-m-QLy2Ys.mjs} +2 -2
  65. package/dist/as-table-actions.cjs +1 -1
  66. package/dist/as-table-actions.d.cts +1 -1
  67. package/dist/as-table-actions.d.mts +1 -1
  68. package/dist/as-table-actions.mjs +1 -1
  69. package/dist/{as-table-actions.vue-5yhKxcAo.d.mts → as-table-actions.vue-BMC3nQ5z.d.mts} +1 -1
  70. package/dist/{as-table-actions.vue-cexsRPT4.d.cts → as-table-actions.vue-D8KKwLdM.d.cts} +1 -1
  71. package/dist/{as-table-base-CsK79vYe.mjs → as-table-base-C1B_VVk-.mjs} +314 -96
  72. package/dist/{as-table-base-Dvey_Gie.cjs → as-table-base-D_Hmin8J.cjs} +313 -95
  73. package/dist/as-table-cell-value-BYJd-QRA.mjs +57 -0
  74. package/dist/as-table-cell-value-CGBk-KWx.cjs +68 -0
  75. package/dist/as-table-cell-value.cjs +1 -1
  76. package/dist/as-table-cell-value.mjs +1 -1
  77. package/dist/{as-table-header-cell-ahzAeHXj.mjs → as-table-header-cell-Bg5wAPHv.mjs} +1 -1
  78. package/dist/{as-table-header-cell-DB7Cdskr.cjs → as-table-header-cell-Ch0J_Axe.cjs} +1 -1
  79. package/dist/as-table-header-cell.cjs +1 -1
  80. package/dist/as-table-header-cell.mjs +1 -1
  81. package/dist/{as-table-root-Nsk-9XaH.cjs → as-table-root-BQ5PA2SL.cjs} +5 -5
  82. package/dist/{as-table-root-BnkF5-rh.mjs → as-table-root-BeyqcJUq.mjs} +5 -5
  83. package/dist/as-table-root.cjs +1 -1
  84. package/dist/as-table-root.d.cts +1 -1
  85. package/dist/as-table-root.d.mts +1 -1
  86. package/dist/as-table-root.mjs +1 -1
  87. package/dist/{as-table-root.vue-CupE2b2_.d.cts → as-table-root.vue-Mvmfeg6Y.d.cts} +19 -18
  88. package/dist/{as-table-root.vue-BsDBKgez.d.mts → as-table-root.vue-mhHmNm2I.d.mts} +19 -18
  89. package/dist/as-table.cjs +1 -1
  90. package/dist/as-table.d.cts +1 -1
  91. package/dist/as-table.d.mts +1 -1
  92. package/dist/as-table.mjs +1 -1
  93. package/dist/{as-window-table-ubm2u8_i.cjs → as-window-table-BvUfaBj8.cjs} +7 -8
  94. package/dist/{as-window-table-DjplqWzr.mjs → as-window-table-Cf523h8Q.mjs} +7 -8
  95. package/dist/as-window-table.cjs +1 -1
  96. package/dist/as-window-table.d.cts +1 -1
  97. package/dist/as-window-table.d.mts +1 -1
  98. package/dist/as-window-table.mjs +1 -1
  99. package/dist/index.cjs +23 -23
  100. package/dist/index.d.cts +3 -3
  101. package/dist/index.d.mts +3 -3
  102. package/dist/index.mjs +23 -23
  103. package/dist/{use-cell-locale-BTJZ6UcP.mjs → use-cell-locale-Bye0ANIP.mjs} +11 -0
  104. package/dist/{use-cell-locale-Dv514-Al.cjs → use-cell-locale-Dy5Rf1yp.cjs} +11 -0
  105. package/dist/{use-condition-format-DrgfX6xL.cjs → use-condition-format-Dyb5CVYw.cjs} +1 -1
  106. package/dist/{use-condition-format-5LcuInDy.mjs → use-condition-format-ka5_XiSn.mjs} +1 -1
  107. package/dist/{use-table-C9qI-TL6.cjs → use-table-B3CvWW_y.cjs} +2 -2
  108. package/dist/{use-table-BYNBpLJt.mjs → use-table-CTCYFwrE.mjs} +2 -2
  109. package/dist/{use-table-component-Dy397695.mjs → use-table-component-B9QRSvoR.mjs} +1 -1
  110. package/dist/{use-table-component-CsdvdGJT.cjs → use-table-component-Daap95CE.cjs} +1 -1
  111. package/dist/{use-table-nav-bridge-Gm4ZfOjJ.cjs → use-table-nav-bridge-C43u266u.cjs} +1 -1
  112. package/dist/{use-table-nav-bridge-CJBERyPB.mjs → use-table-nav-bridge-Ch61msQs.mjs} +1 -1
  113. package/dist/{use-table-state-CIoWhwTD.mjs → use-table-state-DzvCmxEx.mjs} +2 -1
  114. package/dist/{use-table-state-BQchKxUr.cjs → use-table-state-zE3BpeA7.cjs} +1 -0
  115. package/package.json +11 -11
  116. package/dist/as-cell-date-DrnhvCr4.cjs +0 -71
  117. package/dist/as-cell-date-dhIM7hWA.mjs +0 -66
  118. package/dist/as-cell-date.vue-BcMgxBfm.d.cts +0 -12
  119. package/dist/as-cell-date.vue-Chs7WTZ9.d.mts +0 -12
  120. package/dist/as-table-cell-value-D-S127gr.mjs +0 -37
  121. package/dist/as-table-cell-value-VWlXc5dA.cjs +0 -42
  122. /package/dist/{error-message-CoUcpWal.cjs → error-message-B9iAuWYx.cjs} +0 -0
  123. /package/dist/{error-message-rziSiSjs.mjs → error-message-D3at_GXQ.mjs} +0 -0
@@ -1,17 +1,18 @@
1
- import { _ as toSelectAllState, o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
1
+ import { _ as toSelectAllState, o as useTableContextOptional } from "./use-table-state-DzvCmxEx.mjs";
2
2
  import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
3
- import { i as as_table_colgroup_default, n as as_table_status_default, o as useCellComponents, r as as_table_header_default, s as useCellResolver, t as as_select_cell_default } from "./as-select-cell-DjcPorVb.mjs";
4
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, watch, withCtx } from "vue";
3
+ import { i as as_table_colgroup_default, n as as_table_status_default, o as useCellComponents, r as as_table_header_default, s as useCellResolver, t as as_select_cell_default } from "./as-select-cell-C9T1NHmN.mjs";
4
+ import { n as displayCellValue, t as as_table_cell_value_default } from "./as-table-cell-value-BYJd-QRA.mjs";
5
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUpdate, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
5
6
  import { DEFAULT_ROW_HEIGHT_PX, filledFilterCount } from "@atscript/ui-table";
6
7
  import { useParentElement, useResizeObserver } from "@vueuse/core";
7
8
  import { ComboboxItem, ComboboxItemIndicator, ListboxItem, ListboxItemIndicator, Primitive } from "reka-ui";
8
9
  import { useVirtualizer } from "@tanstack/vue-virtual";
9
10
  //#region src/components/internal/as-table-virtualizer.vue?vue&type=script&setup=true&lang.ts
10
- const _hoisted_1$1 = {
11
+ const _hoisted_1$2 = {
11
12
  key: 0,
12
13
  "aria-hidden": "true"
13
14
  };
14
- const _hoisted_2$1 = {
15
+ const _hoisted_2$2 = {
15
16
  key: 1,
16
17
  "aria-hidden": "true"
17
18
  };
@@ -116,7 +117,7 @@ var as_table_virtualizer_default = /* @__PURE__ */ defineComponent({
116
117
  _: 3
117
118
  })) : (openBlock(), createBlock(unref(Primitive), { key: 1 }, {
118
119
  default: withCtx(() => [
119
- paddingTop.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_1$1, [createElementVNode("td", { style: normalizeStyle({
120
+ paddingTop.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_1$2, [createElementVNode("td", { style: normalizeStyle({
120
121
  height: `${paddingTop.value}px`,
121
122
  padding: "0",
122
123
  border: "none"
@@ -128,7 +129,7 @@ var as_table_virtualizer_default = /* @__PURE__ */ defineComponent({
128
129
  spaceBefore: void 0
129
130
  }));
130
131
  }), 128)),
131
- paddingBottom.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_2$1, [createElementVNode("td", { style: normalizeStyle({
132
+ paddingBottom.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_2$2, [createElementVNode("td", { style: normalizeStyle({
132
133
  height: `${paddingBottom.value}px`,
133
134
  padding: "0",
134
135
  border: "none"
@@ -140,6 +141,235 @@ var as_table_virtualizer_default = /* @__PURE__ */ defineComponent({
140
141
  }
141
142
  });
142
143
  //#endregion
144
+ //#region src/components/internal/as-table-slot.ts
145
+ /**
146
+ * Renders the slot `name` of a slots object owned by ANOTHER component, with
147
+ * `scope` as its props — `<AsTableRow>` uses it to render `<AsTableBase>`'s
148
+ * cell slots. Unlike a forwarding `<slot>`, it leaves the row's own slots
149
+ * stable, so rows are not force-updated on every parent pass.
150
+ *
151
+ * @internal
152
+ */
153
+ const AsTableSlot = (props) => renderSlot(props.slots, props.name, props.scope);
154
+ AsTableSlot.props = [
155
+ "slots",
156
+ "name",
157
+ "scope"
158
+ ];
159
+ //#endregion
160
+ //#region src/components/internal/as-table-row.vue?vue&type=script&setup=true&lang.ts
161
+ const _hoisted_1$1 = [
162
+ "id",
163
+ "aria-rowindex",
164
+ "aria-selected",
165
+ "data-selectable"
166
+ ];
167
+ const _hoisted_2$1 = {
168
+ key: 0,
169
+ role: "gridcell"
170
+ };
171
+ const _hoisted_3$1 = {
172
+ key: 3,
173
+ class: "as-td-filler",
174
+ role: "gridcell"
175
+ };
176
+ //#endregion
177
+ //#region src/components/internal/as-table-row.vue
178
+ var as_table_row_default = /* @__PURE__ */ defineComponent({
179
+ inheritAttrs: false,
180
+ __name: "as-table-row",
181
+ props: {
182
+ row: {
183
+ type: Object,
184
+ required: true
185
+ },
186
+ index: {
187
+ type: Number,
188
+ required: true
189
+ },
190
+ spaceBefore: {
191
+ type: Number,
192
+ required: false
193
+ },
194
+ selectable: {
195
+ type: Object,
196
+ required: true
197
+ },
198
+ rowClass: {
199
+ type: null,
200
+ required: true
201
+ },
202
+ rowAttrs: {
203
+ type: null,
204
+ required: true
205
+ },
206
+ selected: {
207
+ type: Boolean,
208
+ required: true
209
+ },
210
+ active: {
211
+ type: Boolean,
212
+ required: true
213
+ },
214
+ rowId: {
215
+ type: null,
216
+ required: true
217
+ },
218
+ rowHeight: {
219
+ type: Number,
220
+ required: false
221
+ },
222
+ hasValue: {
223
+ type: Boolean,
224
+ required: true
225
+ },
226
+ select: {
227
+ type: String,
228
+ required: true
229
+ },
230
+ selectOn: {
231
+ type: String,
232
+ required: true
233
+ },
234
+ columns: {
235
+ type: Array,
236
+ required: true
237
+ },
238
+ cellComponents: {
239
+ type: Object,
240
+ required: true
241
+ },
242
+ cellSlotFlags: {
243
+ type: Object,
244
+ required: true
245
+ },
246
+ slots: {
247
+ type: Object,
248
+ required: true
249
+ },
250
+ hasSelectSlot: {
251
+ type: Boolean,
252
+ required: true
253
+ },
254
+ cellResolver: {
255
+ type: Function,
256
+ required: false
257
+ },
258
+ stretch: {
259
+ type: Boolean,
260
+ required: true
261
+ },
262
+ slotRev: {
263
+ type: Number,
264
+ required: true
265
+ },
266
+ onRowClick: {
267
+ type: Function,
268
+ required: true
269
+ },
270
+ onRowDblClick: {
271
+ type: Function,
272
+ required: true
273
+ }
274
+ },
275
+ setup(__props) {
276
+ return (_ctx, _cache) => {
277
+ return openBlock(), createElementBlock(Fragment, null, [createCommentVNode("\n `v-bind=\"rowAttrs\"` comes FIRST so every framework binding after it wins —\n consumer attrs can decorate a row but can never rewrite its id / role /\n aria / data contract.\n "), createElementVNode("tr", mergeProps(__props.rowAttrs, {
278
+ id: __props.rowId,
279
+ role: "row",
280
+ "aria-rowindex": __props.index + 2,
281
+ "aria-selected": __props.select === "none" ? void 0 : __props.selected ? "true" : "false",
282
+ "data-selectable": __props.selectable.ok ? void 0 : "false",
283
+ class: [{ "as-table-row-active": __props.active }, __props.rowClass],
284
+ style: {
285
+ height: __props.rowHeight ? `${__props.rowHeight}px` : void 0,
286
+ transform: __props.spaceBefore ? `translateY(${__props.spaceBefore}px)` : void 0
287
+ },
288
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.onRowClick(__props.row, $event, __props.index)),
289
+ onDblclick: _cache[1] || (_cache[1] = ($event) => __props.onRowDblClick(__props.row, $event, __props.index))
290
+ }), [
291
+ __props.hasValue ? (openBlock(), createBlock(as_select_cell_default, {
292
+ key: 0,
293
+ row: __props.row,
294
+ index: __props.index,
295
+ selected: __props.selected,
296
+ verdict: __props.selectable,
297
+ select: __props.select,
298
+ "select-on": __props.selectOn
299
+ }, createSlots({ _: 2 }, [__props.hasSelectSlot ? {
300
+ name: "default",
301
+ fn: withCtx((scope) => [createVNode(unref(AsTableSlot), {
302
+ slots: __props.slots,
303
+ name: "cell-__select",
304
+ scope
305
+ }, null, 8, ["slots", "scope"])]),
306
+ key: "0"
307
+ } : void 0]), 1032, [
308
+ "row",
309
+ "index",
310
+ "selected",
311
+ "verdict",
312
+ "select",
313
+ "select-on"
314
+ ])) : createCommentVNode("v-if", true),
315
+ __props.cellResolver ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.columns, (col) => {
316
+ return openBlock(), createElementBlock(Fragment, { key: col.path }, [(openBlock(true), createElementBlock(Fragment, null, renderList([__props.cellResolver(col, __props.row, __props.index)], (bindings) => {
317
+ return openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.cellSlotFlags[col.path] ? (openBlock(), createElementBlock("td", mergeProps({
318
+ key: 0,
319
+ role: "gridcell"
320
+ }, { ref_for: true }, bindings), [createVNode(unref(AsTableSlot), {
321
+ slots: __props.slots,
322
+ name: `cell-${col.path}`,
323
+ scope: {
324
+ row: __props.row,
325
+ value: unref(getCellValue)(__props.row, col.path),
326
+ column: col
327
+ }
328
+ }, null, 8, [
329
+ "slots",
330
+ "name",
331
+ "scope"
332
+ ])], 16)) : __props.cellComponents[col.path] === as_table_cell_value_default ? (openBlock(), createElementBlock("td", mergeProps({
333
+ key: 1,
334
+ class: { "as-cell-number": col.type === "number" },
335
+ role: "gridcell"
336
+ }, { ref_for: true }, bindings), toDisplayString(unref(displayCellValue)(__props.row, col)), 17)) : (openBlock(), createBlock(resolveDynamicComponent(__props.cellComponents[col.path]), mergeProps({
337
+ key: 2,
338
+ row: __props.row,
339
+ column: col,
340
+ role: "gridcell"
341
+ }, { ref_for: true }, bindings), null, 16, ["row", "column"]))], 64);
342
+ }), 128))], 64);
343
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(__props.columns, (col) => {
344
+ return openBlock(), createElementBlock(Fragment, { key: col.path }, [__props.cellSlotFlags[col.path] ? (openBlock(), createElementBlock("td", _hoisted_2$1, [createVNode(unref(AsTableSlot), {
345
+ slots: __props.slots,
346
+ name: `cell-${col.path}`,
347
+ scope: {
348
+ row: __props.row,
349
+ value: unref(getCellValue)(__props.row, col.path),
350
+ column: col
351
+ }
352
+ }, null, 8, [
353
+ "slots",
354
+ "name",
355
+ "scope"
356
+ ])])) : __props.cellComponents[col.path] === as_table_cell_value_default ? (openBlock(), createElementBlock("td", {
357
+ key: 1,
358
+ class: normalizeClass({ "as-cell-number": col.type === "number" }),
359
+ role: "gridcell"
360
+ }, toDisplayString(unref(displayCellValue)(__props.row, col)), 3)) : (openBlock(), createBlock(resolveDynamicComponent(__props.cellComponents[col.path]), {
361
+ key: 2,
362
+ row: __props.row,
363
+ column: col,
364
+ role: "gridcell"
365
+ }, null, 8, ["row", "column"]))], 64);
366
+ }), 128)),
367
+ __props.stretch ? (openBlock(), createElementBlock("td", _hoisted_3$1)) : createCommentVNode("v-if", true)
368
+ ], 16, _hoisted_1$1)], 2112);
369
+ };
370
+ }
371
+ });
372
+ //#endregion
143
373
  //#region src/components/internal/as-table-base.vue?vue&type=script&setup=true&lang.ts
144
374
  const _hoisted_1 = [
145
375
  "role",
@@ -156,23 +386,6 @@ const _hoisted_5 = {
156
386
  key: 3,
157
387
  class: "as-td-filler"
158
388
  };
159
- const _hoisted_6 = [
160
- "id",
161
- "aria-rowindex",
162
- "aria-selected",
163
- "data-selectable",
164
- "onClick",
165
- "onDblclick"
166
- ];
167
- const _hoisted_7 = {
168
- key: 0,
169
- role: "gridcell"
170
- };
171
- const _hoisted_8 = {
172
- key: 3,
173
- class: "as-td-filler",
174
- role: "gridcell"
175
- };
176
389
  const SCROLL_TOL = 1.5;
177
390
  //#endregion
178
391
  //#region src/components/internal/as-table-base.vue
@@ -293,6 +506,10 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
293
506
  rowAttrs: {
294
507
  type: Function,
295
508
  required: false
509
+ },
510
+ slotSource: {
511
+ type: Object,
512
+ required: false
296
513
  }
297
514
  },
298
515
  emits: [
@@ -376,7 +593,31 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
376
593
  });
377
594
  const emit = __emit;
378
595
  const slots = useSlots();
596
+ const slotRev = shallowRef(0);
597
+ let slotFns = snapshotSlotFns();
598
+ function snapshotSlotFns() {
599
+ const source = props.slotSource ?? slots;
600
+ const out = /* @__PURE__ */ new Map();
601
+ for (const name in source) if (name.startsWith("cell-")) out.set(name, source[name]);
602
+ return out;
603
+ }
604
+ onBeforeUpdate(() => {
605
+ const next = snapshotSlotFns();
606
+ let same = next.size === slotFns.size;
607
+ if (same) {
608
+ for (const [name, fn] of next) if (slotFns.get(name) !== fn) same = false;
609
+ }
610
+ if (!same) {
611
+ slotFns = next;
612
+ slotRev.value++;
613
+ }
614
+ });
615
+ const hasSelectSlot = computed(() => {
616
+ slotRev.value;
617
+ return !!slots["cell-__select"];
618
+ });
379
619
  const cellSlotFlags = computed(() => {
620
+ slotRev.value;
380
621
  const out = {};
381
622
  for (const c of props.columns) out[c.path] = !!slots[`cell-${c.path}`];
382
623
  return out;
@@ -385,10 +626,6 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
385
626
  if (!ctx || !props.rowValueFn) return false;
386
627
  return ctx.state.isPkSelected(props.rowValueFn(row));
387
628
  }
388
- function ariaSelectedFor(selected) {
389
- if (props.select === "none") return void 0;
390
- return selected ? "true" : "false";
391
- }
392
629
  function onRowClick(row, event, index) {
393
630
  emit("row-click", row, event);
394
631
  if (!isStandalone.value) return;
@@ -653,76 +890,57 @@ var as_table_base_default = /* @__PURE__ */ defineComponent({
653
890
  "aria-activedescendant": ariaActiveDescendant.value,
654
891
  onKeydown: onTbodyKeydown
655
892
  }, {
656
- default: withCtx(({ item, index, spaceBefore }) => [createCommentVNode("\n `meta` (the row's hook results + its selectability verdict) and\n `selected` are resolved ONCE per row; `v-bind=\"meta.attrs\"` comes FIRST so every\n framework binding after it wins — consumer attrs can decorate a\n row but can never rewrite its id / role / aria / data contract.\n "), (openBlock(true), createElementBlock(Fragment, null, renderList([[metaFor(index), isPkSelected(item)]], ([meta, selected]) => {
657
- return openBlock(), createElementBlock("tr", mergeProps({
893
+ default: withCtx(({ item, index, spaceBefore }) => [createCommentVNode("\n `meta` (the row's hook results + its selectability verdict) and\n `selected` are resolved ONCE per row. Each row is its own\n component: a change that touches one row re-renders that row only.\n "), (openBlock(true), createElementBlock(Fragment, null, renderList([[metaFor(index), isPkSelected(item)]], ([meta, selected]) => {
894
+ return openBlock(), createBlock(as_table_row_default, {
658
895
  key: 0,
659
- ref_for: true
660
- }, meta.attrs, {
661
- id: rowIdFor(index),
662
- role: "row",
663
- "aria-rowindex": index + 2,
664
- "aria-selected": ariaSelectedFor(selected),
665
- "data-selectable": meta.selectable.ok ? void 0 : "false",
666
- class: [{ "as-table-row-active": isActiveRow(index) }, meta.cls],
667
- style: {
668
- height: __props.virtualRowHeight ? `${__props.virtualRowHeight}px` : void 0,
669
- transform: spaceBefore ? `translateY(${spaceBefore}px)` : void 0
670
- },
671
- onClick: ($event) => onRowClick(item, $event, index),
672
- onDblclick: ($event) => onRowDblClick(item, $event, index)
673
- }), [
674
- hasValue.value ? (openBlock(), createBlock(as_select_cell_default, {
675
- key: 0,
676
- row: item,
677
- index,
678
- selected,
679
- verdict: meta.selectable,
680
- select: __props.select,
681
- "select-on": __props.selectOn
682
- }, createSlots({ _: 2 }, [unref(slots)["cell-__select"] ? {
683
- name: "default",
684
- fn: withCtx((scope) => [renderSlot(_ctx.$slots, "cell-__select", mergeProps({ ref_for: true }, scope))]),
685
- key: "0"
686
- } : void 0]), 1032, [
687
- "row",
688
- "index",
689
- "selected",
690
- "verdict",
691
- "select",
692
- "select-on"
693
- ])) : createCommentVNode("v-if", true),
694
- unref(hasAnyCellBindings) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.columns, (col) => {
695
- return openBlock(), createElementBlock(Fragment, { key: col.path }, [(openBlock(true), createElementBlock(Fragment, null, renderList([unref(cellResolver)(col, item, index)], (bindings) => {
696
- return openBlock(), createElementBlock(Fragment, { key: 0 }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", mergeProps({
697
- key: 0,
698
- role: "gridcell"
699
- }, { ref_for: true }, bindings), [renderSlot(_ctx.$slots, `cell-${col.path}`, {
700
- row: item,
701
- value: unref(getCellValue)(item, col.path),
702
- column: col
703
- })], 16)) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), mergeProps({
704
- key: 1,
705
- row: item,
706
- column: col,
707
- role: "gridcell"
708
- }, { ref_for: true }, bindings), null, 16, ["row", "column"]))], 64);
709
- }), 128))], 64);
710
- }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(__props.columns, (col) => {
711
- return openBlock(), createElementBlock(Fragment, { key: col.path }, [cellSlotFlags.value[col.path] ? (openBlock(), createElementBlock("td", _hoisted_7, [renderSlot(_ctx.$slots, `cell-${col.path}`, {
712
- row: item,
713
- value: unref(getCellValue)(item, col.path),
714
- column: col
715
- })])) : (openBlock(), createBlock(resolveDynamicComponent(unref(cellComponents)[col.path]), {
716
- key: 1,
717
- row: item,
718
- column: col,
719
- role: "gridcell"
720
- }, null, 8, ["row", "column"]))], 64);
721
- }), 128)),
722
- __props.stretch ? (openBlock(), createElementBlock("td", _hoisted_8)) : createCommentVNode("v-if", true)
723
- ], 16, _hoisted_6);
896
+ row: item,
897
+ index,
898
+ "space-before": spaceBefore,
899
+ selectable: meta.selectable,
900
+ "row-class": meta.cls,
901
+ "row-attrs": meta.attrs,
902
+ selected,
903
+ active: isActiveRow(index),
904
+ "row-id": rowIdFor(index),
905
+ "row-height": __props.virtualRowHeight,
906
+ "has-value": hasValue.value,
907
+ select: __props.select,
908
+ "select-on": __props.selectOn,
909
+ columns: __props.columns,
910
+ "cell-components": unref(cellComponents),
911
+ "cell-slot-flags": cellSlotFlags.value,
912
+ "cell-resolver": unref(hasAnyCellBindings) ? unref(cellResolver) : void 0,
913
+ stretch: __props.stretch,
914
+ slots: unref(slots),
915
+ "has-select-slot": hasSelectSlot.value,
916
+ "slot-rev": slotRev.value,
917
+ "on-row-click": onRowClick,
918
+ "on-row-dbl-click": onRowDblClick
919
+ }, null, 8, [
920
+ "row",
921
+ "index",
922
+ "space-before",
923
+ "selectable",
924
+ "row-class",
925
+ "row-attrs",
926
+ "selected",
927
+ "active",
928
+ "row-id",
929
+ "row-height",
930
+ "has-value",
931
+ "select",
932
+ "select-on",
933
+ "columns",
934
+ "cell-components",
935
+ "cell-slot-flags",
936
+ "cell-resolver",
937
+ "stretch",
938
+ "slots",
939
+ "has-select-slot",
940
+ "slot-rev"
941
+ ]);
724
942
  }), 128))]),
725
- _: 3
943
+ _: 1
726
944
  }, 8, [
727
945
  "options",
728
946
  "estimate-size",