@atscript/vue-table 0.1.136 → 0.1.138

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 (107) 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-qATZy3cu.mjs → as-action-menu-content-CVlExEpl.mjs} +1 -1
  4. package/dist/{as-action-menu-content-D8VzLK9e.cjs → as-action-menu-content-D8f60mY-.cjs} +1 -1
  5. package/dist/as-column-menu.d.cts +1 -1
  6. package/dist/as-column-menu.d.mts +1 -1
  7. package/dist/{as-column-menu.vue-BaIGUOhP.d.mts → as-column-menu.vue-CgvDp7JK.d.cts} +2 -2
  8. package/dist/{as-column-menu.vue-CDlI4-Cz.d.cts → as-column-menu.vue-SRkxrvo_.d.mts} +2 -2
  9. package/dist/{as-config-dialog-CP362FP3.cjs → as-config-dialog-BrVhIV_e.cjs} +2 -2
  10. package/dist/{as-config-dialog-BMQxSqzl.mjs → as-config-dialog-DHdpmRo9.mjs} +2 -2
  11. package/dist/as-config-dialog.cjs +1 -1
  12. package/dist/as-config-dialog.mjs +1 -1
  13. package/dist/{as-confirm-dialog-Dp_njNXz.mjs → as-confirm-dialog-BG5vlbvV.mjs} +1 -1
  14. package/dist/{as-confirm-dialog-D41XaN_P.cjs → as-confirm-dialog-iytk-urB.cjs} +1 -1
  15. package/dist/as-confirm-dialog.cjs +1 -1
  16. package/dist/as-confirm-dialog.mjs +1 -1
  17. package/dist/{as-filter-dialog-BCUqpKPd.cjs → as-filter-dialog-CW8-zoag.cjs} +7 -7
  18. package/dist/{as-filter-dialog-kAXGDwsk.mjs → as-filter-dialog-Dis7tkN_.mjs} +7 -7
  19. package/dist/as-filter-dialog.cjs +1 -1
  20. package/dist/as-filter-dialog.mjs +1 -1
  21. package/dist/{as-filter-field-WnV2axh8.mjs → as-filter-field-BKoxTudl.mjs} +3 -3
  22. package/dist/{as-filter-field-D3jSbSwB.cjs → as-filter-field-bVIXoH3j.cjs} +3 -3
  23. package/dist/as-filter-field.cjs +1 -1
  24. package/dist/as-filter-field.mjs +1 -1
  25. package/dist/{as-filters-Bc44srvA.mjs → as-filters-CxVy00LQ.mjs} +3 -3
  26. package/dist/{as-filters-Dp93OWRS.cjs → as-filters-Dx8WkGiA.cjs} +3 -3
  27. package/dist/as-filters.cjs +1 -1
  28. package/dist/as-filters.mjs +1 -1
  29. package/dist/{as-preset-dialog-Bx4nRuyk.mjs → as-preset-dialog-C0f_6VxJ.mjs} +1 -1
  30. package/dist/{as-preset-dialog-pusPD935.cjs → as-preset-dialog-D8o2ChtM.cjs} +1 -1
  31. package/dist/as-preset-dialog.cjs +1 -1
  32. package/dist/as-preset-dialog.mjs +1 -1
  33. package/dist/{as-preset-picker-BRQdflJz.mjs → as-preset-picker-CDItDinB.mjs} +1 -1
  34. package/dist/{as-preset-picker-nAx3MYl7.cjs → as-preset-picker-DonMQ8Ia.cjs} +1 -1
  35. package/dist/as-preset-picker.cjs +1 -1
  36. package/dist/as-preset-picker.mjs +1 -1
  37. package/dist/{as-row-actions-gxmuZkYI.mjs → as-row-actions-B8YANdb4.mjs} +2 -2
  38. package/dist/{as-row-actions-PD-sFmDs.cjs → as-row-actions-CAiCfw8d.cjs} +2 -2
  39. package/dist/as-row-actions.cjs +1 -1
  40. package/dist/as-row-actions.d.cts +1 -1
  41. package/dist/as-row-actions.d.mts +1 -1
  42. package/dist/as-row-actions.mjs +1 -1
  43. package/dist/{as-row-actions.vue-AXXt5kQS.d.mts → as-row-actions.vue-BCgHsU18.d.mts} +1 -1
  44. package/dist/{as-row-actions.vue-D0MXQoeg.d.cts → as-row-actions.vue-C49h8PpE.d.cts} +1 -1
  45. package/dist/{as-table-BIV1W3O9.mjs → as-table-BAoJ60tx.mjs} +8 -34
  46. package/dist/{as-table-ucLFACn0.cjs → as-table-QoXP-NZr.cjs} +8 -34
  47. package/dist/{as-table-actions-D_PUqMYy.cjs → as-table-actions-8yf2QIER.cjs} +2 -2
  48. package/dist/{as-table-actions-DQ5Nn8Jc.mjs → as-table-actions-z5xUWtvK.mjs} +2 -2
  49. package/dist/as-table-actions.cjs +1 -1
  50. package/dist/as-table-actions.d.cts +1 -1
  51. package/dist/as-table-actions.d.mts +1 -1
  52. package/dist/as-table-actions.mjs +1 -1
  53. package/dist/{as-table-actions.vue-iKw4tsJh.d.cts → as-table-actions.vue-BTGQnFH_.d.mts} +2 -2
  54. package/dist/{as-table-actions.vue-kndyFTyi.d.mts → as-table-actions.vue-oxyikRAt.d.cts} +2 -2
  55. package/dist/{as-table-base-kHOKCI7T.mjs → as-table-base-DA5T7x_K.mjs} +2 -2
  56. package/dist/{as-table-base-M6_12pPq.cjs → as-table-base-wPJuru7P.cjs} +2 -2
  57. package/dist/{as-table-header-cell-Ct_GPLVu.cjs → as-table-header-cell-CiRLNVJz.cjs} +1 -1
  58. package/dist/{as-table-header-cell-CZyy4q1s.mjs → as-table-header-cell-Cl8waY_g.mjs} +1 -1
  59. package/dist/as-table-header-cell.cjs +1 -1
  60. package/dist/as-table-header-cell.d.cts +1 -1
  61. package/dist/as-table-header-cell.d.mts +1 -1
  62. package/dist/as-table-header-cell.mjs +1 -1
  63. package/dist/{as-table-header-cell.vue-BNsOEsof.d.mts → as-table-header-cell.vue-BjgxfKhi.d.cts} +2 -2
  64. package/dist/{as-table-header-cell.vue-DqjorECQ.d.cts → as-table-header-cell.vue-zGeuzm3w.d.mts} +2 -2
  65. package/dist/{as-table-root-DGYw0kPC.mjs → as-table-root-Bza3ZGJZ.mjs} +20 -13
  66. package/dist/{as-table-root-EyN1JHuS.cjs → as-table-root-C6a6iO6M.cjs} +20 -13
  67. package/dist/as-table-root.cjs +1 -1
  68. package/dist/as-table-root.d.cts +1 -1
  69. package/dist/as-table-root.d.mts +1 -1
  70. package/dist/as-table-root.mjs +1 -1
  71. package/dist/{as-table-root.vue-D5RZKczC.d.mts → as-table-root.vue-DnOHVQtA.d.mts} +3 -3
  72. package/dist/{as-table-root.vue-DHmH2h1z.d.cts → as-table-root.vue-Dze91qga.d.cts} +3 -3
  73. package/dist/{as-table-status-DMFZuZfJ.cjs → as-table-status-B2O3hLGg.cjs} +4 -4
  74. package/dist/{as-table-status-CYzRbU71.mjs → as-table-status-aebsG7bR.mjs} +4 -4
  75. package/dist/as-table.cjs +1 -1
  76. package/dist/as-table.d.cts +1 -1
  77. package/dist/as-table.d.mts +1 -1
  78. package/dist/as-table.mjs +1 -1
  79. package/dist/{as-table.vue-CSsa8u47.d.mts → as-table.vue-BSKifGzD.d.cts} +8 -8
  80. package/dist/{as-table.vue-B2yu8GI5.d.cts → as-table.vue-emq84QmP.d.mts} +8 -8
  81. package/dist/{as-window-table-B9Y4Xgwm.mjs → as-window-table-ByTXS8yA.mjs} +30 -13
  82. package/dist/{as-window-table-Bxq7cYW5.cjs → as-window-table-DS30wumm.cjs} +30 -13
  83. package/dist/as-window-table.cjs +1 -1
  84. package/dist/as-window-table.d.cts +1 -1
  85. package/dist/as-window-table.d.mts +1 -1
  86. package/dist/as-window-table.mjs +1 -1
  87. package/dist/{as-window-table.vue-DxNiv9jn.d.mts → as-window-table.vue-DJNJ-6dd.d.cts} +18 -5
  88. package/dist/{as-window-table.vue-CBSeXWnu.d.cts → as-window-table.vue-DUJgZDXy.d.mts} +18 -5
  89. package/dist/index.cjs +17 -17
  90. package/dist/index.d.cts +9 -9
  91. package/dist/index.d.mts +9 -9
  92. package/dist/index.mjs +17 -17
  93. package/dist/{types-CyAmAg10.d.cts → types-CsgAGRfG.d.mts} +29 -8
  94. package/dist/{types-yS6-QFfT.d.mts → types-DvWLY5zQ.d.cts} +29 -8
  95. package/dist/{use-table-BVptAnaS.mjs → use-table-DRN4nlZs.mjs} +1 -1
  96. package/dist/{use-table-Bm2a0g9D.cjs → use-table-JU7BAX4e.cjs} +1 -1
  97. package/dist/use-table-column-handlers-DGn4ZW9j.mjs +85 -0
  98. package/dist/use-table-column-handlers-r47WDxEh.cjs +96 -0
  99. package/dist/{use-table-component-Bpy5mg_P.cjs → use-table-component-DIWiP_Vs.cjs} +1 -1
  100. package/dist/{use-table-component-DYzKgCC4.mjs → use-table-component-VUFlxIk-.mjs} +1 -1
  101. package/dist/{use-table-nav-bridge-qyvyRm6S.cjs → use-table-nav-bridge-BBtXE70x.cjs} +1 -1
  102. package/dist/{use-table-nav-bridge-LCL6vq9F.mjs → use-table-nav-bridge-DT8oU-6r.mjs} +1 -1
  103. package/dist/{use-table-state-jljSQQ8m.cjs → use-table-state-CoVe_8NI.cjs} +6 -5
  104. package/dist/{use-table-state-CwfgWmuk.mjs → use-table-state-CqU1N4Q9.mjs} +7 -6
  105. package/package.json +6 -6
  106. package/dist/use-table-column-handlers-BMrP0WY2.cjs +0 -45
  107. package/dist/use-table-column-handlers-Bx3JERqs.mjs +0 -40
@@ -0,0 +1,96 @@
1
+ const require_use_table_state = require("./use-table-state-CoVe_8NI.cjs");
2
+ let vue = require("vue");
3
+ let _atscript_ui_table = require("@atscript/ui-table");
4
+ //#region src/composables/use-row-actions-column.ts
5
+ /**
6
+ * The synthesised row-actions pseudo-column, shared by `<AsTable>` and
7
+ * `<AsWindowTable>`. Returns the renderer's effective column list — the base
8
+ * columns with a fixed `__actions` column prepended / appended per
9
+ * `placement` — and opts the table into per-row `$actions` while the column
10
+ * is shown.
11
+ */
12
+ function useRowActionsColumn(state, opts) {
13
+ (0, vue.watch)(() => {
14
+ const placement = opts.placement();
15
+ if (!placement) return false;
16
+ if (placement === "merge-select" && opts.select() !== "none") return false;
17
+ return state.actions.cellRow.length > 0;
18
+ }, (on) => {
19
+ state.includeActions.value = on;
20
+ }, { immediate: true });
21
+ const actionsCol = (0, vue.computed)(() => {
22
+ const acts = state.actions.row;
23
+ return {
24
+ path: require_use_table_state.ROW_ACTIONS_PATH,
25
+ label: "",
26
+ type: require_use_table_state.ROW_ACTIONS_TYPE,
27
+ sortable: false,
28
+ filterable: false,
29
+ nullable: false,
30
+ order: 0,
31
+ fixed: true,
32
+ width: acts.length === 1 && !acts[0]?.icon ? "8em" : "4em"
33
+ };
34
+ });
35
+ return (0, vue.computed)(() => {
36
+ const base = opts.columns();
37
+ const placement = opts.placement();
38
+ if (placement === false || placement === void 0) return base;
39
+ if (state.actions.row.length === 0) return base;
40
+ if (placement === "first") return [actionsCol.value, ...base];
41
+ if (placement === "last") return [...base, actionsCol.value];
42
+ if (opts.select() === "none") return [actionsCol.value, ...base];
43
+ return base;
44
+ });
45
+ }
46
+ //#endregion
47
+ //#region src/composables/use-table-column-handlers.ts
48
+ /**
49
+ * Pure pass-through handlers shared between the pagination renderer
50
+ * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
51
+ * and row-mouse handlers stay in their owning components because their
52
+ * semantics diverge meaningfully (window has no "all" state; standalone
53
+ * vs Reka renderModes need different gating).
54
+ */
55
+ function useTableColumnHandlers(state) {
56
+ return {
57
+ onSort(column, direction) {
58
+ state.sorters.value = direction === null ? [] : [{
59
+ field: column.path,
60
+ direction
61
+ }];
62
+ },
63
+ onHide(column) {
64
+ state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
65
+ },
66
+ onFilter(column) {
67
+ state.openFilterDialog(column);
68
+ },
69
+ onFiltersOff(column) {
70
+ state.removeFieldFilter(column.path);
71
+ },
72
+ onResetWidth(column) {
73
+ state.resetColumnWidth(column.path);
74
+ },
75
+ onReorder(fromPath, toPath, position) {
76
+ state.columnNames.value = (0, _atscript_ui_table.reorderColumnNames)(state.columnNames.value, fromPath, toPath, position);
77
+ },
78
+ onClearFilters() {
79
+ state.resetFilters();
80
+ if (state.searchTerm.value) state.searchTerm.value = "";
81
+ }
82
+ };
83
+ }
84
+ //#endregion
85
+ Object.defineProperty(exports, "useRowActionsColumn", {
86
+ enumerable: true,
87
+ get: function() {
88
+ return useRowActionsColumn;
89
+ }
90
+ });
91
+ Object.defineProperty(exports, "useTableColumnHandlers", {
92
+ enumerable: true,
93
+ get: function() {
94
+ return useTableColumnHandlers;
95
+ }
96
+ });
@@ -1,4 +1,4 @@
1
- const require_use_table_state = require("./use-table-state-jljSQQ8m.cjs");
1
+ const require_use_table_state = require("./use-table-state-CoVe_8NI.cjs");
2
2
  //#region src/composables/use-table-component.ts
3
3
  /**
4
4
  * Resolve a single skin-slot component from the injected `controls` map,
@@ -1,4 +1,4 @@
1
- import { o as useTableContextOptional } from "./use-table-state-CwfgWmuk.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-CqU1N4Q9.mjs";
2
2
  //#region src/composables/use-table-component.ts
3
3
  /**
4
4
  * Resolve a single skin-slot component from the injected `controls` map,
@@ -1,4 +1,4 @@
1
- const require_use_table_state = require("./use-table-state-jljSQQ8m.cjs");
1
+ const require_use_table_state = require("./use-table-state-CoVe_8NI.cjs");
2
2
  //#region src/composables/use-table-nav-bridge.ts
3
3
  function isPassthroughKey(event) {
4
4
  const key = event.key;
@@ -1,4 +1,4 @@
1
- import { o as useTableContextOptional } from "./use-table-state-CwfgWmuk.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-CqU1N4Q9.mjs";
2
2
  //#region src/composables/use-table-nav-bridge.ts
3
3
  function isPassthroughKey(event) {
4
4
  const key = event.key;
@@ -2111,8 +2111,9 @@ function createTableState(opts) {
2111
2111
  lastEmittedUrl = next;
2112
2112
  queryOpts.onUrlQueryChange(next);
2113
2113
  }
2114
- function applyUrlQuery(urlString) {
2114
+ function applyUrlQuery(urlString, opts) {
2115
2115
  if (urlsEquivalent(urlString, lastEmittedUrl)) return;
2116
+ const replace = opts?.mode === "replace";
2116
2117
  const cols = allColumns.value;
2117
2118
  const parsed = (0, _atscript_ui_table.urlQueryStringToState)(urlString, {
2118
2119
  knownFields: cols.length > 0 ? cols.map((c) => c.path) : void 0,
@@ -2125,16 +2126,16 @@ function createTableState(opts) {
2125
2126
  hydratingFromUrl = true;
2126
2127
  const filtersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.filters);
2127
2128
  if (filtersGate !== "none") {
2128
- const next = { ...filters.value };
2129
+ const next = {};
2130
+ for (const path in filters.value) if (!replace || !(0, _atscript_ui_table.gateOwns)(filtersGate, path)) next[path] = filters.value[path];
2129
2131
  for (const path in parsed.filters) next[path] = parsed.filters[path];
2130
2132
  filters.value = next;
2131
2133
  }
2132
2134
  const sortersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.sorters);
2133
2135
  let urlSortersChanged = false;
2134
2136
  if (sortersGate !== "none") {
2135
- const urlFields = /* @__PURE__ */ new Set();
2136
- for (const s of parsed.sorters) urlFields.add(s.field);
2137
- const merged = [...sorters.value.filter((s) => !urlFields.has(s.field)), ...parsed.sorters];
2137
+ const urlSortFields = new Set(parsed.sorters.map((s) => s.field));
2138
+ const merged = [...sorters.value.filter((s) => !(replace ? (0, _atscript_ui_table.gateOwns)(sortersGate, s.field) : urlSortFields.has(s.field))), ...parsed.sorters];
2138
2139
  if (!(0, _atscript_ui_table.sortersEqual)(sorters.value, merged)) {
2139
2140
  sorters.value = merged;
2140
2141
  urlSortersChanged = true;
@@ -1,7 +1,7 @@
1
1
  import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
2
2
  import { navigateHrefFor } from "@atscript/ui";
3
3
  import { computed, inject, nextTick, onBeforeUnmount, onScopeDispose, provide, ref, shallowRef, toValue, watch } from "vue";
4
- import { STANDARD_PRESET_ID, blockStartFor, buildTableQuery, cellAsString, debounce, derivePresetAspects, fromWireSnapshot, isDirtyAgainst, isFilled, isSystemPresetId, mergeDisplayColumns, mergeSorters, pageAlignedBlocksFor, planFetch, reconcileColumnWidthDefaults, resolveAspectGate, resolveSystemPresets, rowsToPks, sameColumnSet, sortRowsLocally, sortersEqual, stateToUrlQueryString, togglePk, urlQueryStringToState, walkBackwardAbsorb, walkForwardAbsorb } from "@atscript/ui-table";
4
+ import { STANDARD_PRESET_ID, blockStartFor, buildTableQuery, cellAsString, debounce, derivePresetAspects, fromWireSnapshot, gateOwns, isDirtyAgainst, isFilled, isSystemPresetId, mergeDisplayColumns, mergeSorters, pageAlignedBlocksFor, planFetch, reconcileColumnWidthDefaults, resolveAspectGate, resolveSystemPresets, rowsToPks, sameColumnSet, sortRowsLocally, sortersEqual, stateToUrlQueryString, togglePk, urlQueryStringToState, walkBackwardAbsorb, walkForwardAbsorb } from "@atscript/ui-table";
5
5
  import { formatIdentifier } from "@atscript/db-client";
6
6
  //#region src/types.ts
7
7
  /** UI-side sentinel for the synthesised row-delete processor. */
@@ -2111,8 +2111,9 @@ function createTableState(opts) {
2111
2111
  lastEmittedUrl = next;
2112
2112
  queryOpts.onUrlQueryChange(next);
2113
2113
  }
2114
- function applyUrlQuery(urlString) {
2114
+ function applyUrlQuery(urlString, opts) {
2115
2115
  if (urlsEquivalent(urlString, lastEmittedUrl)) return;
2116
+ const replace = opts?.mode === "replace";
2116
2117
  const cols = allColumns.value;
2117
2118
  const parsed = urlQueryStringToState(urlString, {
2118
2119
  knownFields: cols.length > 0 ? cols.map((c) => c.path) : void 0,
@@ -2125,16 +2126,16 @@ function createTableState(opts) {
2125
2126
  hydratingFromUrl = true;
2126
2127
  const filtersGate = resolveAspectGate(urlQuerySync?.filters);
2127
2128
  if (filtersGate !== "none") {
2128
- const next = { ...filters.value };
2129
+ const next = {};
2130
+ for (const path in filters.value) if (!replace || !gateOwns(filtersGate, path)) next[path] = filters.value[path];
2129
2131
  for (const path in parsed.filters) next[path] = parsed.filters[path];
2130
2132
  filters.value = next;
2131
2133
  }
2132
2134
  const sortersGate = resolveAspectGate(urlQuerySync?.sorters);
2133
2135
  let urlSortersChanged = false;
2134
2136
  if (sortersGate !== "none") {
2135
- const urlFields = /* @__PURE__ */ new Set();
2136
- for (const s of parsed.sorters) urlFields.add(s.field);
2137
- const merged = [...sorters.value.filter((s) => !urlFields.has(s.field)), ...parsed.sorters];
2137
+ const urlSortFields = new Set(parsed.sorters.map((s) => s.field));
2138
+ const merged = [...sorters.value.filter((s) => !(replace ? gateOwns(sortersGate, s.field) : urlSortFields.has(s.field))), ...parsed.sorters];
2138
2139
  if (!sortersEqual(sorters.value, merged)) {
2139
2140
  sorters.value = merged;
2140
2141
  urlSortersChanged = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-table",
3
- "version": "0.1.136",
3
+ "version": "0.1.138",
4
4
  "description": "Type-driven table components for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -162,12 +162,12 @@
162
162
  "access": "public"
163
163
  },
164
164
  "dependencies": {
165
- "@atscript/ui": "^0.1.136",
166
- "@atscript/ui-table": "^0.1.136",
167
- "@atscript/vue-form": "^0.1.136"
165
+ "@atscript/ui": "^0.1.138",
166
+ "@atscript/ui-table": "^0.1.138",
167
+ "@atscript/vue-form": "^0.1.138"
168
168
  },
169
169
  "devDependencies": {
170
- "@atscript/db-client": "^0.1.130",
170
+ "@atscript/db-client": "^0.1.131",
171
171
  "@atscript/typescript": "^0.1.93",
172
172
  "@tanstack/vue-virtual": "^3.13.26",
173
173
  "@uniqu/core": "^0.1.8",
@@ -183,7 +183,7 @@
183
183
  "vunor": "^0.3.0"
184
184
  },
185
185
  "peerDependencies": {
186
- "@atscript/db-client": "^0.1.130",
186
+ "@atscript/db-client": "^0.1.131",
187
187
  "@tanstack/vue-virtual": "^3.13.26",
188
188
  "@vueuse/core": "^14.3.0",
189
189
  "reka-ui": "^2.9.8",
@@ -1,45 +0,0 @@
1
- let _atscript_ui_table = require("@atscript/ui-table");
2
- //#region src/composables/use-table-column-handlers.ts
3
- /**
4
- * Pure pass-through handlers shared between the pagination renderer
5
- * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
6
- * and row-mouse handlers stay in their owning components because their
7
- * semantics diverge meaningfully (window has no "all" state; standalone
8
- * vs Reka renderModes need different gating).
9
- */
10
- function useTableColumnHandlers(state) {
11
- return {
12
- onSort(column, direction) {
13
- state.sorters.value = direction === null ? [] : [{
14
- field: column.path,
15
- direction
16
- }];
17
- },
18
- onHide(column) {
19
- state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
20
- },
21
- onFilter(column) {
22
- state.openFilterDialog(column);
23
- },
24
- onFiltersOff(column) {
25
- state.removeFieldFilter(column.path);
26
- },
27
- onResetWidth(column) {
28
- state.resetColumnWidth(column.path);
29
- },
30
- onReorder(fromPath, toPath, position) {
31
- state.columnNames.value = (0, _atscript_ui_table.reorderColumnNames)(state.columnNames.value, fromPath, toPath, position);
32
- },
33
- onClearFilters() {
34
- state.resetFilters();
35
- if (state.searchTerm.value) state.searchTerm.value = "";
36
- }
37
- };
38
- }
39
- //#endregion
40
- Object.defineProperty(exports, "useTableColumnHandlers", {
41
- enumerable: true,
42
- get: function() {
43
- return useTableColumnHandlers;
44
- }
45
- });
@@ -1,40 +0,0 @@
1
- import { reorderColumnNames } from "@atscript/ui-table";
2
- //#region src/composables/use-table-column-handlers.ts
3
- /**
4
- * Pure pass-through handlers shared between the pagination renderer
5
- * (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
6
- * and row-mouse handlers stay in their owning components because their
7
- * semantics diverge meaningfully (window has no "all" state; standalone
8
- * vs Reka renderModes need different gating).
9
- */
10
- function useTableColumnHandlers(state) {
11
- return {
12
- onSort(column, direction) {
13
- state.sorters.value = direction === null ? [] : [{
14
- field: column.path,
15
- direction
16
- }];
17
- },
18
- onHide(column) {
19
- state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
20
- },
21
- onFilter(column) {
22
- state.openFilterDialog(column);
23
- },
24
- onFiltersOff(column) {
25
- state.removeFieldFilter(column.path);
26
- },
27
- onResetWidth(column) {
28
- state.resetColumnWidth(column.path);
29
- },
30
- onReorder(fromPath, toPath, position) {
31
- state.columnNames.value = reorderColumnNames(state.columnNames.value, fromPath, toPath, position);
32
- },
33
- onClearFilters() {
34
- state.resetFilters();
35
- if (state.searchTerm.value) state.searchTerm.value = "";
36
- }
37
- };
38
- }
39
- //#endregion
40
- export { useTableColumnHandlers as t };