@atscript/vue-table 0.1.137 → 0.1.139

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 (149) 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-CVlExEpl.mjs → as-action-menu-content-D7NIwc9X.mjs} +1 -1
  4. package/dist/{as-action-menu-content-D8f60mY-.cjs → as-action-menu-content-DXuyDZ_X.cjs} +1 -1
  5. package/dist/{as-cell-array-BWHkJX3I.mjs → as-cell-array-Bgc4GYZf.mjs} +1 -1
  6. package/dist/{as-cell-array-D-8Pqlgo.cjs → as-cell-array-CCZ0Ajj9.cjs} +1 -1
  7. package/dist/as-cell-array.cjs +1 -1
  8. package/dist/as-cell-array.mjs +1 -1
  9. package/dist/{as-cell-date-mGlnDeLP.mjs → as-cell-date-B9mu0OOD.mjs} +1 -1
  10. package/dist/{as-cell-date-DviMJEqs.cjs → as-cell-date-RU5JPJhI.cjs} +1 -1
  11. package/dist/as-cell-date.cjs +1 -1
  12. package/dist/as-cell-date.mjs +1 -1
  13. package/dist/{as-cell-json-2I081xnO.mjs → as-cell-json-ByEGYRST.mjs} +1 -1
  14. package/dist/{as-cell-json-CaVB6e7V.cjs → as-cell-json-w5YJxNuF.cjs} +1 -1
  15. package/dist/as-cell-json.cjs +1 -1
  16. package/dist/as-cell-json.mjs +1 -1
  17. package/dist/{as-cell-number-CP2AZI9g.mjs → as-cell-number-CNDT6gfw.mjs} +1 -1
  18. package/dist/{as-cell-number-BnYbxOiG.cjs → as-cell-number-DGJCTXDf.cjs} +1 -1
  19. package/dist/as-cell-number.cjs +1 -1
  20. package/dist/as-cell-number.mjs +1 -1
  21. package/dist/{as-cell-union-NHpDCXty.mjs → as-cell-union-DMnoa7RM.mjs} +2 -2
  22. package/dist/{as-cell-union-BjMP91PS.cjs → as-cell-union-LOGvhPeK.cjs} +2 -2
  23. package/dist/as-cell-union.cjs +1 -1
  24. package/dist/as-cell-union.mjs +1 -1
  25. package/dist/{as-column-menu-BMTS3DO2.mjs → as-column-menu-CBtUfYEE.mjs} +2 -2
  26. package/dist/{as-column-menu-D_8NxujZ.cjs → as-column-menu-ChB7hzmr.cjs} +1 -1
  27. package/dist/as-column-menu.cjs +1 -1
  28. package/dist/as-column-menu.d.cts +1 -1
  29. package/dist/as-column-menu.d.mts +1 -1
  30. package/dist/as-column-menu.mjs +1 -1
  31. package/dist/{as-column-menu.vue-olu6BNEU.d.cts → as-column-menu.vue-Cul3eIz_.d.cts} +1 -1
  32. package/dist/{as-column-menu.vue-DIuEvru6.d.mts → as-column-menu.vue-Dw2m8ZqD.d.mts} +1 -1
  33. package/dist/{as-config-dialog-DHdpmRo9.mjs → as-config-dialog-DrcYlrOh.mjs} +5 -5
  34. package/dist/{as-config-dialog-BrVhIV_e.cjs → as-config-dialog-j_-oUmN7.cjs} +4 -4
  35. package/dist/as-config-dialog.cjs +1 -1
  36. package/dist/as-config-dialog.mjs +1 -1
  37. package/dist/{as-confirm-dialog-iytk-urB.cjs → as-confirm-dialog-CStjIWN0.cjs} +1 -1
  38. package/dist/{as-confirm-dialog-BG5vlbvV.mjs → as-confirm-dialog-Pnt60ALy.mjs} +1 -1
  39. package/dist/as-confirm-dialog.cjs +1 -1
  40. package/dist/as-confirm-dialog.mjs +1 -1
  41. package/dist/{as-filter-dialog-DoynFox2.cjs → as-filter-dialog-B6_NvvlM.cjs} +14 -14
  42. package/dist/{as-filter-dialog-DAvtsH3d.mjs → as-filter-dialog-CUzahpd_.mjs} +15 -15
  43. package/dist/as-filter-dialog.cjs +1 -1
  44. package/dist/as-filter-dialog.mjs +1 -1
  45. package/dist/{as-filter-field-DB5WFT4l.mjs → as-filter-field-3DJh_ICs.mjs} +5 -6
  46. package/dist/{as-filter-field-CBMDjApB.cjs → as-filter-field-DCUMuu0M.cjs} +4 -5
  47. package/dist/as-filter-field.cjs +1 -1
  48. package/dist/as-filter-field.mjs +1 -1
  49. package/dist/as-filter-input.cjs +1 -1
  50. package/dist/as-filter-input.mjs +1 -1
  51. package/dist/{as-filters-CiPv-dKs.cjs → as-filters-CHLPYHNP.cjs} +3 -3
  52. package/dist/{as-filters-DfBH5YH9.mjs → as-filters-D0DWDyiv.mjs} +3 -3
  53. package/dist/as-filters.cjs +1 -1
  54. package/dist/as-filters.mjs +1 -1
  55. package/dist/{as-preset-dialog-C0f_6VxJ.mjs → as-preset-dialog-H98DeOMM.mjs} +3 -3
  56. package/dist/{as-preset-dialog-D8o2ChtM.cjs → as-preset-dialog-RLW0gZDj.cjs} +3 -3
  57. package/dist/as-preset-dialog.cjs +1 -1
  58. package/dist/as-preset-dialog.mjs +1 -1
  59. package/dist/{as-preset-picker-CDItDinB.mjs → as-preset-picker-Cw7LB7o1.mjs} +2 -2
  60. package/dist/{as-preset-picker-DonMQ8Ia.cjs → as-preset-picker-yWXEhWEq.cjs} +2 -2
  61. package/dist/as-preset-picker.cjs +1 -1
  62. package/dist/as-preset-picker.mjs +1 -1
  63. package/dist/{as-row-actions-B8YANdb4.mjs → as-row-actions-BvJWHf3j.mjs} +2 -2
  64. package/dist/{as-row-actions-CAiCfw8d.cjs → as-row-actions-D_TqnP3S.cjs} +2 -2
  65. package/dist/as-row-actions.cjs +1 -1
  66. package/dist/as-row-actions.d.cts +1 -1
  67. package/dist/as-row-actions.d.mts +1 -1
  68. package/dist/as-row-actions.mjs +1 -1
  69. package/dist/{as-row-actions.vue-DZrASzp7.d.mts → as-row-actions.vue-DxXodLGq.d.mts} +1 -1
  70. package/dist/{as-row-actions.vue-Cac2kfwO.d.cts → as-row-actions.vue-WRrzvdbJ.d.cts} +1 -1
  71. package/dist/{as-table-BNfZcSra.cjs → as-table-CVD1zLva.cjs} +8 -34
  72. package/dist/{as-table-DtfWLLlb.mjs → as-table-D5mMZKKg.mjs} +8 -34
  73. package/dist/{as-table-actions-z5xUWtvK.mjs → as-table-actions-C6moFlxt.mjs} +2 -2
  74. package/dist/{as-table-actions-8yf2QIER.cjs → as-table-actions-D91sNgel.cjs} +2 -2
  75. package/dist/as-table-actions.cjs +1 -1
  76. package/dist/as-table-actions.d.cts +1 -1
  77. package/dist/as-table-actions.d.mts +1 -1
  78. package/dist/as-table-actions.mjs +1 -1
  79. package/dist/{as-table-actions.vue-66cjnFZI.d.mts → as-table-actions.vue-CPVhj2ZC.d.mts} +2 -2
  80. package/dist/{as-table-actions.vue-B7ttOxKU.d.cts → as-table-actions.vue-DB3LW-eI.d.cts} +2 -2
  81. package/dist/{as-table-base-D7mO_Zmv.mjs → as-table-base-CEpvNFBd.mjs} +2 -2
  82. package/dist/{as-table-base-CdtyDOra.cjs → as-table-base-CyBOmUK9.cjs} +2 -2
  83. package/dist/{as-table-cell-value-BAi5yadc.cjs → as-table-cell-value-Ct0KnyKc.cjs} +1 -1
  84. package/dist/{as-table-cell-value-BVcfhhCb.mjs → as-table-cell-value-D1eLiQKJ.mjs} +1 -1
  85. package/dist/as-table-cell-value.cjs +1 -1
  86. package/dist/as-table-cell-value.mjs +1 -1
  87. package/dist/{as-table-header-cell-Cl8waY_g.mjs → as-table-header-cell-CUs-sSBm.mjs} +2 -2
  88. package/dist/{as-table-header-cell-CiRLNVJz.cjs → as-table-header-cell-D7pW2sV3.cjs} +2 -2
  89. package/dist/as-table-header-cell.cjs +1 -1
  90. package/dist/as-table-header-cell.d.cts +1 -1
  91. package/dist/as-table-header-cell.d.mts +1 -1
  92. package/dist/as-table-header-cell.mjs +1 -1
  93. package/dist/{as-table-header-cell.vue-DhCxDIn1.d.mts → as-table-header-cell.vue-BDhs3PNi.d.mts} +1 -1
  94. package/dist/{as-table-header-cell.vue-DmncmpeQ.d.cts → as-table-header-cell.vue-DFaRLZZA.d.cts} +1 -1
  95. package/dist/{as-table-root-Bza3ZGJZ.mjs → as-table-root-C61wrFd9.mjs} +15 -29
  96. package/dist/{as-table-root-C6a6iO6M.cjs → as-table-root-C7Tr_9W-.cjs} +16 -30
  97. package/dist/as-table-root.cjs +1 -1
  98. package/dist/as-table-root.d.cts +1 -1
  99. package/dist/as-table-root.d.mts +1 -1
  100. package/dist/as-table-root.mjs +1 -1
  101. package/dist/{as-table-root.vue-zWOmt_ug.d.mts → as-table-root.vue-Bza3D5F1.d.mts} +22 -5
  102. package/dist/{as-table-root.vue-BllmTRXj.d.cts → as-table-root.vue-D5Xyux8I.d.cts} +22 -5
  103. package/dist/{as-table-status-CbKmSKAy.cjs → as-table-status-B-MjDXNZ.cjs} +5 -5
  104. package/dist/{as-table-status-D9YuoBOm.mjs → as-table-status-D08b0cqn.mjs} +5 -5
  105. package/dist/as-table.cjs +1 -1
  106. package/dist/as-table.d.cts +1 -1
  107. package/dist/as-table.d.mts +1 -1
  108. package/dist/as-table.mjs +1 -1
  109. package/dist/{as-table.vue-Cd1Hc5v9.d.mts → as-table.vue-BuZGgKuM.d.cts} +5 -5
  110. package/dist/{as-table.vue-Bzp4UOqz.d.cts → as-table.vue-CPfERNtx.d.mts} +5 -5
  111. package/dist/{as-window-table-OB4B1knU.cjs → as-window-table-BfSud7yB.cjs} +30 -13
  112. package/dist/{as-window-table-D5grrLFG.mjs → as-window-table-CjYMF0aX.mjs} +30 -13
  113. package/dist/as-window-table.cjs +1 -1
  114. package/dist/as-window-table.d.cts +1 -1
  115. package/dist/as-window-table.d.mts +1 -1
  116. package/dist/as-window-table.mjs +1 -1
  117. package/dist/{as-window-table.vue-CcDoghqs.d.mts → as-window-table.vue-3egLvwAy.d.mts} +15 -2
  118. package/dist/{as-window-table.vue-Db--CSWD.d.cts → as-window-table.vue-BIjQuSie.d.cts} +15 -2
  119. package/dist/index.cjs +40 -41
  120. package/dist/index.d.cts +8 -8
  121. package/dist/index.d.mts +8 -8
  122. package/dist/index.mjs +41 -42
  123. package/dist/{types-CuOHiH-S.d.mts → types-B6N5NDx_.d.cts} +27 -11
  124. package/dist/{types-n40LWFm_.d.cts → types-CgdpcJdd.d.mts} +27 -11
  125. package/dist/{use-table-DRN4nlZs.mjs → use-table-DUwUfjSZ.mjs} +3 -2
  126. package/dist/{use-table-JU7BAX4e.cjs → use-table-c4ku22Mx.cjs} +3 -2
  127. package/dist/use-table-column-handlers-Do0Z-R9D.cjs +96 -0
  128. package/dist/use-table-column-handlers-eKHCfUm_.mjs +85 -0
  129. package/dist/{use-table-component-DIWiP_Vs.cjs → use-table-component-DbQDINoa.cjs} +1 -1
  130. package/dist/{use-table-component-VUFlxIk-.mjs → use-table-component-wfU13P3L.mjs} +1 -1
  131. package/dist/{use-table-nav-bridge-BBtXE70x.cjs → use-table-nav-bridge-BLLVGR1r.cjs} +1 -1
  132. package/dist/{use-table-nav-bridge-DT8oU-6r.mjs → use-table-nav-bridge-DRrvQxXq.mjs} +1 -1
  133. package/dist/{use-table-state-CqU1N4Q9.mjs → use-table-state-BEwXQayO.mjs} +53 -7
  134. package/dist/{use-table-state-CoVe_8NI.cjs → use-table-state-Cnxv0w_E.cjs} +57 -5
  135. package/package.json +7 -7
  136. package/dist/use-table-column-handlers-BMrP0WY2.cjs +0 -45
  137. package/dist/use-table-column-handlers-Bx3JERqs.mjs +0 -40
  138. /package/dist/{as-cell-json-popover-vty5vMjW.cjs → as-cell-json-popover-BM2QLgfk.cjs} +0 -0
  139. /package/dist/{as-cell-json-popover-CH5bAcLE.mjs → as-cell-json-popover-Dkdv5Y9E.mjs} +0 -0
  140. /package/dist/{as-filter-input-C8KmOus8.mjs → as-filter-input-BM23TNeh.mjs} +0 -0
  141. /package/dist/{as-filter-input-DUqpkTkg.cjs → as-filter-input-DJu2k9gO.cjs} +0 -0
  142. /package/dist/{error-message-CfKpn_5w.cjs → error-message-CglODWl4.cjs} +0 -0
  143. /package/dist/{error-message-gNEXnnbb.mjs → error-message-hPSAu8Ug.mjs} +0 -0
  144. /package/dist/{format-cell-Bx7wNc4X.mjs → format-cell-D1Ziv96Q.mjs} +0 -0
  145. /package/dist/{format-cell-DaxV6WIJ.cjs → format-cell-vCNTh4WZ.cjs} +0 -0
  146. /package/dist/{use-cell-locale-caG2Fzpc.cjs → use-cell-locale-BGBRQB7s.cjs} +0 -0
  147. /package/dist/{use-cell-locale-CxQOQsns.mjs → use-cell-locale-MQXoONh5.mjs} +0 -0
  148. /package/dist/{use-seed-on-open-DSh4XFyp.mjs → use-seed-on-open-DO3A1kIb.mjs} +0 -0
  149. /package/dist/{use-seed-on-open-9TSm1Vbv.cjs → use-seed-on-open-Dg9I89fU.cjs} +0 -0
@@ -0,0 +1,96 @@
1
+ const require_use_table_state = require("./use-table-state-Cnxv0w_E.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
+ });
@@ -0,0 +1,85 @@
1
+ import { D as ROW_ACTIONS_PATH, O as ROW_ACTIONS_TYPE } from "./use-table-state-BEwXQayO.mjs";
2
+ import { computed, watch } from "vue";
3
+ import { reorderColumnNames } from "@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
+ 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 = computed(() => {
22
+ const acts = state.actions.row;
23
+ return {
24
+ path: ROW_ACTIONS_PATH,
25
+ label: "",
26
+ type: 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 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 = 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
+ export { useRowActionsColumn as n, useTableColumnHandlers as t };
@@ -1,4 +1,4 @@
1
- const require_use_table_state = require("./use-table-state-CoVe_8NI.cjs");
1
+ const require_use_table_state = require("./use-table-state-Cnxv0w_E.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-CqU1N4Q9.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-BEwXQayO.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-CoVe_8NI.cjs");
1
+ const require_use_table_state = require("./use-table-state-Cnxv0w_E.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-CqU1N4Q9.mjs";
1
+ import { o as useTableContextOptional } from "./use-table-state-BEwXQayO.mjs";
2
2
  //#region src/composables/use-table-nav-bridge.ts
3
3
  function isPassthroughKey(event) {
4
4
  const key = event.key;
@@ -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, gateOwns, 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 { DEV, 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. */
@@ -1586,6 +1586,22 @@ function createRequestSlot(cancelValue) {
1586
1586
  release
1587
1587
  };
1588
1588
  }
1589
+ const cloneConditions = (conds) => conds.map((c) => ({
1590
+ type: c.type,
1591
+ value: [...c.value]
1592
+ }));
1593
+ const cloneSorter = (s) => ({
1594
+ field: s.field,
1595
+ direction: s.direction
1596
+ });
1597
+ /**
1598
+ * The report for a restored URL's filter piece when nobody handles it
1599
+ * (`onUnsupportedFilter` / `@unsupported-filter`): a dev-mode warning.
1600
+ */
1601
+ function warnUnsupportedFilter(issue) {
1602
+ if (!DEV) return;
1603
+ console.warn(`[vue-table] URL filter left out (${issue.reason}): ${JSON.stringify(issue.expr)}. Field filters cannot express it, so the table shows more rows than the URL described.`);
1604
+ }
1589
1605
  function createTableState(opts) {
1590
1606
  const client = opts.client;
1591
1607
  const modelOpts = opts.model;
@@ -2111,31 +2127,61 @@ function createTableState(opts) {
2111
2127
  lastEmittedUrl = next;
2112
2128
  queryOpts.onUrlQueryChange(next);
2113
2129
  }
2130
+ const filtersGate = resolveAspectGate(urlQuerySync?.filters);
2131
+ const sortersGate = resolveAspectGate(urlQuerySync?.sorters);
2132
+ let urlBaseline = null;
2133
+ function captureUrlBaseline() {
2134
+ if (urlBaseline) return;
2135
+ const owned = {};
2136
+ for (const path in filters.value) {
2137
+ if (!gateOwns(filtersGate, path)) continue;
2138
+ owned[path] = cloneConditions(filters.value[path]);
2139
+ }
2140
+ urlBaseline = {
2141
+ filters: owned,
2142
+ sorters: sorters.value.filter((s) => gateOwns(sortersGate, s.field)).map(cloneSorter)
2143
+ };
2144
+ }
2145
+ if (queryOpts?.onUrlQueryChange) {
2146
+ const gate = queryOpts.urlQueryReady;
2147
+ if (!gate || gate.value) lastEmittedUrl = serializeStateForUrl();
2148
+ else {
2149
+ const stop = watch(() => gate.value, () => {
2150
+ captureUrlBaseline();
2151
+ lastEmittedUrl = serializeStateForUrl();
2152
+ stop();
2153
+ }, { flush: "sync" });
2154
+ }
2155
+ }
2114
2156
  function applyUrlQuery(urlString, opts) {
2157
+ captureUrlBaseline();
2115
2158
  if (urlsEquivalent(urlString, lastEmittedUrl)) return;
2116
- const replace = opts?.mode === "replace";
2117
2159
  const cols = allColumns.value;
2118
2160
  const parsed = urlQueryStringToState(urlString, {
2119
2161
  knownFields: cols.length > 0 ? cols.map((c) => c.path) : void 0,
2120
2162
  sync: urlQuerySync
2121
2163
  });
2164
+ for (const issue of parsed.unsupported ?? []) (queryOpts?.onUnsupportedFilter ?? warnUnsupportedFilter)(issue);
2165
+ const base = (opts?.mode ? opts.mode === "replace" : parsed.snapshot === true) ? null : urlBaseline;
2122
2166
  const currentItemsPerPage = pagination.value.itemsPerPage;
2123
2167
  const skip = parsed.skip ?? 0;
2124
2168
  const nextPage = skip > 0 && currentItemsPerPage > 0 ? Math.floor(skip / currentItemsPerPage) + 1 : 1;
2125
2169
  const wasQueryDetected = queryDetected;
2126
2170
  hydratingFromUrl = true;
2127
- const filtersGate = resolveAspectGate(urlQuerySync?.filters);
2128
2171
  if (filtersGate !== "none") {
2129
2172
  const next = {};
2130
- for (const path in filters.value) if (!replace || !gateOwns(filtersGate, path)) next[path] = filters.value[path];
2173
+ for (const path in filters.value) if (!gateOwns(filtersGate, path)) next[path] = filters.value[path];
2174
+ else if (base?.filters[path]) next[path] = cloneConditions(base.filters[path]);
2175
+ if (base) for (const path in base.filters) next[path] ??= cloneConditions(base.filters[path]);
2131
2176
  for (const path in parsed.filters) next[path] = parsed.filters[path];
2132
2177
  filters.value = next;
2133
2178
  }
2134
- const sortersGate = resolveAspectGate(urlQuerySync?.sorters);
2135
2179
  let urlSortersChanged = false;
2136
2180
  if (sortersGate !== "none") {
2137
2181
  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];
2182
+ const start = sorters.value.filter((s) => !gateOwns(sortersGate, s.field));
2183
+ if (base) start.push(...base.sorters.map(cloneSorter));
2184
+ const merged = [...start.filter((s) => !urlSortFields.has(s.field)), ...parsed.sorters];
2139
2185
  if (!sortersEqual(sorters.value, merged)) {
2140
2186
  sorters.value = merged;
2141
2187
  urlSortersChanged = true;
@@ -2405,4 +2451,4 @@ function useRegisterMainActionListener(state, listener, enabled) {
2405
2451
  });
2406
2452
  }
2407
2453
  //#endregion
2408
- export { isModClick as C, ROW_ACTIONS_TYPE as D, ROW_ACTIONS_PATH as E, intentToScope as S, triggerAction as T, ariaLabelFor as _, useTableContext as a, extractIdentifier as b, ASPECT_ICONS as c, readPresetLabel as d, INTERACTIVE_SELECTOR as f, applyRowsGate as g, applyRowGate as h, useRegisterMainActionListener as i, ASPECT_LABELS as l, rowActionHref as m, createTableState as n, useTableContextOptional as o, onSelectControlKeydown as p, provideTableContext as r, DEFAULT_AVAILABLE_ASPECTS as s, createStaticTableState as t, ownerNameOf as u, collectIdentifiers as v, isPlainLeftClick as w, intentClass as x, createNavigateGestures as y };
2454
+ export { intentToScope as C, ROW_ACTIONS_PATH as D, triggerAction as E, ROW_ACTIONS_TYPE as O, intentClass as S, isPlainLeftClick as T, applyRowsGate as _, useTableContext as a, createNavigateGestures as b, DEFAULT_AVAILABLE_ASPECTS as c, ownerNameOf as d, readPresetLabel as f, applyRowGate as g, rowActionHref as h, useRegisterMainActionListener as i, ASPECT_ICONS as l, onSelectControlKeydown as m, createTableState as n, useTableContextOptional as o, INTERACTIVE_SELECTOR as p, provideTableContext as r, warnUnsupportedFilter as s, createStaticTableState as t, ASPECT_LABELS as u, ariaLabelFor as v, isModClick as w, extractIdentifier as x, collectIdentifiers as y };
@@ -1586,6 +1586,22 @@ function createRequestSlot(cancelValue) {
1586
1586
  release
1587
1587
  };
1588
1588
  }
1589
+ const cloneConditions = (conds) => conds.map((c) => ({
1590
+ type: c.type,
1591
+ value: [...c.value]
1592
+ }));
1593
+ const cloneSorter = (s) => ({
1594
+ field: s.field,
1595
+ direction: s.direction
1596
+ });
1597
+ /**
1598
+ * The report for a restored URL's filter piece when nobody handles it
1599
+ * (`onUnsupportedFilter` / `@unsupported-filter`): a dev-mode warning.
1600
+ */
1601
+ function warnUnsupportedFilter(issue) {
1602
+ if (!_atscript_ui_table.DEV) return;
1603
+ console.warn(`[vue-table] URL filter left out (${issue.reason}): ${JSON.stringify(issue.expr)}. Field filters cannot express it, so the table shows more rows than the URL described.`);
1604
+ }
1589
1605
  function createTableState(opts) {
1590
1606
  const client = opts.client;
1591
1607
  const modelOpts = opts.model;
@@ -2111,31 +2127,61 @@ function createTableState(opts) {
2111
2127
  lastEmittedUrl = next;
2112
2128
  queryOpts.onUrlQueryChange(next);
2113
2129
  }
2130
+ const filtersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.filters);
2131
+ const sortersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.sorters);
2132
+ let urlBaseline = null;
2133
+ function captureUrlBaseline() {
2134
+ if (urlBaseline) return;
2135
+ const owned = {};
2136
+ for (const path in filters.value) {
2137
+ if (!(0, _atscript_ui_table.gateOwns)(filtersGate, path)) continue;
2138
+ owned[path] = cloneConditions(filters.value[path]);
2139
+ }
2140
+ urlBaseline = {
2141
+ filters: owned,
2142
+ sorters: sorters.value.filter((s) => (0, _atscript_ui_table.gateOwns)(sortersGate, s.field)).map(cloneSorter)
2143
+ };
2144
+ }
2145
+ if (queryOpts?.onUrlQueryChange) {
2146
+ const gate = queryOpts.urlQueryReady;
2147
+ if (!gate || gate.value) lastEmittedUrl = serializeStateForUrl();
2148
+ else {
2149
+ const stop = (0, vue.watch)(() => gate.value, () => {
2150
+ captureUrlBaseline();
2151
+ lastEmittedUrl = serializeStateForUrl();
2152
+ stop();
2153
+ }, { flush: "sync" });
2154
+ }
2155
+ }
2114
2156
  function applyUrlQuery(urlString, opts) {
2157
+ captureUrlBaseline();
2115
2158
  if (urlsEquivalent(urlString, lastEmittedUrl)) return;
2116
- const replace = opts?.mode === "replace";
2117
2159
  const cols = allColumns.value;
2118
2160
  const parsed = (0, _atscript_ui_table.urlQueryStringToState)(urlString, {
2119
2161
  knownFields: cols.length > 0 ? cols.map((c) => c.path) : void 0,
2120
2162
  sync: urlQuerySync
2121
2163
  });
2164
+ for (const issue of parsed.unsupported ?? []) (queryOpts?.onUnsupportedFilter ?? warnUnsupportedFilter)(issue);
2165
+ const base = (opts?.mode ? opts.mode === "replace" : parsed.snapshot === true) ? null : urlBaseline;
2122
2166
  const currentItemsPerPage = pagination.value.itemsPerPage;
2123
2167
  const skip = parsed.skip ?? 0;
2124
2168
  const nextPage = skip > 0 && currentItemsPerPage > 0 ? Math.floor(skip / currentItemsPerPage) + 1 : 1;
2125
2169
  const wasQueryDetected = queryDetected;
2126
2170
  hydratingFromUrl = true;
2127
- const filtersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.filters);
2128
2171
  if (filtersGate !== "none") {
2129
2172
  const next = {};
2130
- for (const path in filters.value) if (!replace || !(0, _atscript_ui_table.gateOwns)(filtersGate, path)) next[path] = filters.value[path];
2173
+ for (const path in filters.value) if (!(0, _atscript_ui_table.gateOwns)(filtersGate, path)) next[path] = filters.value[path];
2174
+ else if (base?.filters[path]) next[path] = cloneConditions(base.filters[path]);
2175
+ if (base) for (const path in base.filters) next[path] ??= cloneConditions(base.filters[path]);
2131
2176
  for (const path in parsed.filters) next[path] = parsed.filters[path];
2132
2177
  filters.value = next;
2133
2178
  }
2134
- const sortersGate = (0, _atscript_ui_table.resolveAspectGate)(urlQuerySync?.sorters);
2135
2179
  let urlSortersChanged = false;
2136
2180
  if (sortersGate !== "none") {
2137
2181
  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];
2182
+ const start = sorters.value.filter((s) => !(0, _atscript_ui_table.gateOwns)(sortersGate, s.field));
2183
+ if (base) start.push(...base.sorters.map(cloneSorter));
2184
+ const merged = [...start.filter((s) => !urlSortFields.has(s.field)), ...parsed.sorters];
2139
2185
  if (!(0, _atscript_ui_table.sortersEqual)(sorters.value, merged)) {
2140
2186
  sorters.value = merged;
2141
2187
  urlSortersChanged = true;
@@ -2567,3 +2613,9 @@ Object.defineProperty(exports, "useTableContextOptional", {
2567
2613
  return useTableContextOptional;
2568
2614
  }
2569
2615
  });
2616
+ Object.defineProperty(exports, "warnUnsupportedFilter", {
2617
+ enumerable: true,
2618
+ get: function() {
2619
+ return warnUnsupportedFilter;
2620
+ }
2621
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-table",
3
- "version": "0.1.137",
3
+ "version": "0.1.139",
4
4
  "description": "Type-driven table components for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -162,15 +162,15 @@
162
162
  "access": "public"
163
163
  },
164
164
  "dependencies": {
165
- "@atscript/ui": "^0.1.137",
166
- "@atscript/ui-table": "^0.1.137",
167
- "@atscript/vue-form": "^0.1.137"
165
+ "@atscript/ui-table": "^0.1.139",
166
+ "@atscript/vue-form": "^0.1.139",
167
+ "@atscript/ui": "^0.1.139"
168
168
  },
169
169
  "devDependencies": {
170
- "@atscript/db-client": "^0.1.131",
170
+ "@atscript/db-client": "^0.1.132",
171
171
  "@atscript/typescript": "^0.1.93",
172
172
  "@tanstack/vue-virtual": "^3.13.26",
173
- "@uniqu/core": "^0.1.8",
173
+ "@uniqu/core": "^0.1.9",
174
174
  "@vitejs/plugin-vue": "^6",
175
175
  "@vue/test-utils": "^2",
176
176
  "@vueuse/core": "^14.3.0",
@@ -183,7 +183,7 @@
183
183
  "vunor": "^0.3.0"
184
184
  },
185
185
  "peerDependencies": {
186
- "@atscript/db-client": "^0.1.131",
186
+ "@atscript/db-client": "^0.1.132",
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 };