@atscript/vue-table 0.1.138 → 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 (147) 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-SRkxrvo_.d.mts → as-column-menu.vue-Cul3eIz_.d.cts} +2 -2
  32. package/dist/{as-column-menu.vue-CgvDp7JK.d.cts → as-column-menu.vue-Dw2m8ZqD.d.mts} +2 -2
  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-CW8-zoag.cjs → as-filter-dialog-B6_NvvlM.cjs} +14 -14
  42. package/dist/{as-filter-dialog-Dis7tkN_.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-BKoxTudl.mjs → as-filter-field-3DJh_ICs.mjs} +5 -6
  46. package/dist/{as-filter-field-bVIXoH3j.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-Dx8WkGiA.cjs → as-filters-CHLPYHNP.cjs} +3 -3
  52. package/dist/{as-filters-CxVy00LQ.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-C49h8PpE.d.cts → as-row-actions.vue-DxXodLGq.d.mts} +1 -1
  70. package/dist/{as-row-actions.vue-BCgHsU18.d.mts → as-row-actions.vue-WRrzvdbJ.d.cts} +1 -1
  71. package/dist/{as-table-QoXP-NZr.cjs → as-table-CVD1zLva.cjs} +3 -3
  72. package/dist/{as-table-BAoJ60tx.mjs → as-table-D5mMZKKg.mjs} +3 -3
  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-BTGQnFH_.d.mts → as-table-actions.vue-CPVhj2ZC.d.mts} +1 -1
  80. package/dist/{as-table-actions.vue-oxyikRAt.d.cts → as-table-actions.vue-DB3LW-eI.d.cts} +1 -1
  81. package/dist/{as-table-base-DA5T7x_K.mjs → as-table-base-CEpvNFBd.mjs} +2 -2
  82. package/dist/{as-table-base-wPJuru7P.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-BjgxfKhi.d.cts → as-table-header-cell.vue-BDhs3PNi.d.mts} +2 -2
  94. package/dist/{as-table-header-cell.vue-zGeuzm3w.d.mts → as-table-header-cell.vue-DFaRLZZA.d.cts} +2 -2
  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-DnOHVQtA.d.mts → as-table-root.vue-Bza3D5F1.d.mts} +20 -3
  102. package/dist/{as-table-root.vue-Dze91qga.d.cts → as-table-root.vue-D5Xyux8I.d.cts} +20 -3
  103. package/dist/{as-table-status-B2O3hLGg.cjs → as-table-status-B-MjDXNZ.cjs} +5 -5
  104. package/dist/{as-table-status-aebsG7bR.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-emq84QmP.d.mts → as-table.vue-BuZGgKuM.d.cts} +2 -2
  110. package/dist/{as-table.vue-BSKifGzD.d.cts → as-table.vue-CPfERNtx.d.mts} +2 -2
  111. package/dist/{as-window-table-DS30wumm.cjs → as-window-table-BfSud7yB.cjs} +3 -3
  112. package/dist/{as-window-table-ByTXS8yA.mjs → as-window-table-CjYMF0aX.mjs} +3 -3
  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-DJNJ-6dd.d.cts → as-window-table.vue-3egLvwAy.d.mts} +1 -1
  118. package/dist/{as-window-table.vue-DUJgZDXy.d.mts → as-window-table.vue-BIjQuSie.d.cts} +1 -1
  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-CsgAGRfG.d.mts → types-B6N5NDx_.d.cts} +21 -10
  124. package/dist/{types-DvWLY5zQ.d.cts → types-CgdpcJdd.d.mts} +21 -10
  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-r47WDxEh.cjs → use-table-column-handlers-Do0Z-R9D.cjs} +1 -1
  128. package/dist/{use-table-column-handlers-DGn4ZW9j.mjs → use-table-column-handlers-eKHCfUm_.mjs} +1 -1
  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/{as-cell-json-popover-vty5vMjW.cjs → as-cell-json-popover-BM2QLgfk.cjs} +0 -0
  137. /package/dist/{as-cell-json-popover-CH5bAcLE.mjs → as-cell-json-popover-Dkdv5Y9E.mjs} +0 -0
  138. /package/dist/{as-filter-input-C8KmOus8.mjs → as-filter-input-BM23TNeh.mjs} +0 -0
  139. /package/dist/{as-filter-input-DUqpkTkg.cjs → as-filter-input-DJu2k9gO.cjs} +0 -0
  140. /package/dist/{error-message-CfKpn_5w.cjs → error-message-CglODWl4.cjs} +0 -0
  141. /package/dist/{error-message-gNEXnnbb.mjs → error-message-hPSAu8Ug.mjs} +0 -0
  142. /package/dist/{format-cell-Bx7wNc4X.mjs → format-cell-D1Ziv96Q.mjs} +0 -0
  143. /package/dist/{format-cell-DaxV6WIJ.cjs → format-cell-vCNTh4WZ.cjs} +0 -0
  144. /package/dist/{use-cell-locale-caG2Fzpc.cjs → use-cell-locale-BGBRQB7s.cjs} +0 -0
  145. /package/dist/{use-cell-locale-CxQOQsns.mjs → use-cell-locale-MQXoONh5.mjs} +0 -0
  146. /package/dist/{use-seed-on-open-DSh4XFyp.mjs → use-seed-on-open-DO3A1kIb.mjs} +0 -0
  147. /package/dist/{use-seed-on-open-9TSm1Vbv.cjs → use-seed-on-open-Dg9I89fU.cjs} +0 -0
@@ -1,8 +1,8 @@
1
+ import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
1
2
  import { Component, ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
3
+ import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
2
4
  import { ClientError, PageResult, TDbActionInfo, TDbActionProcessor, TDbDeleteResult } from "@atscript/db-client";
3
5
  import { Uniquery } from "@uniqu/core";
4
- import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
5
- import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
6
6
 
7
7
  //#region src/composables/state/intent-scope.d.ts
8
8
  interface ActionBuckets {
@@ -413,7 +413,10 @@ type TAsCellTypeComponents = {
413
413
  * @since 0.1.137
414
414
  */
415
415
  interface ApplyUrlQueryOptions {
416
- /** `"merge"` (default) keeps them, `"replace"` clears them. */
416
+ /**
417
+ * Overrides what the URL itself decides (see `applyUrlQuery`): `"merge"`
418
+ * falls back to the table's starting values, `"replace"` clears them.
419
+ */
417
420
  mode?: "merge" | "replace";
418
421
  }
419
422
  /**
@@ -668,13 +671,21 @@ interface ReactiveTableState extends TableStateMethods {
668
671
  * bridge's own emissions. Does NOT call `query()` — root watchers refetch in
669
672
  * reaction to the writes.
670
673
  *
671
- * `mode` decides what happens to filters and sorters the URL does NOT
672
- * mention (search and pagination always take the URL's value):
673
- * - `"merge"` (default) — they survive. This is mount-time deep-link
674
- * hydration, where the URL overlays a preset baseline it must not wipe.
675
- * - `"replace"` (since 0.1.137) — they are cleared, within whatever the
676
- * `urlQuerySync` gates actually serialize. This is history navigation,
677
- * where the URL is a complete snapshot of the synced aspects.
674
+ * The URL decides what happens to filters and sorters it does NOT mention,
675
+ * within whatever the `urlQuerySync` gates serialize (search and pagination
676
+ * always take the URL's value; columns and other presentation state are
677
+ * never touched):
678
+ * - A URL carrying the `$snapshot` marker (`URL_SNAPSHOT_KEY` — every URL
679
+ * the table writes) replaces: they are cleared, an empty `$sort`
680
+ * included, so a reload or a shared link reproduces the table exactly.
681
+ * - Any other URL (an app deep link) merges: they fall back to the table's
682
+ * boot baseline — the owned filters and sorters it had before the first
683
+ * URL was applied (preset, persisted drafts, props). Every merge starts
684
+ * from that baseline, not from the current state, so Back to a deep link
685
+ * restores it as first opened. A preset switched to later does not move
686
+ * the baseline.
687
+ *
688
+ * `opts.mode` overrides the marker either way. Since 0.1.139.
678
689
  */
679
690
  applyUrlQuery: (urlString: string, opts?: ApplyUrlQueryOptions) => void;
680
691
  /**
@@ -1,4 +1,4 @@
1
- import { n as createTableState, r as provideTableContext, s as DEFAULT_AVAILABLE_ASPECTS } from "./use-table-state-CqU1N4Q9.mjs";
1
+ import { c as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-BEwXQayO.mjs";
2
2
  import { n as useTableSelection } from "./use-table-selection-ULbKT2xW.mjs";
3
3
  import { createTableDef, getMetaEntry, resetMetaCache } from "@atscript/ui";
4
4
  import { computed, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
@@ -434,7 +434,8 @@ function useTable(url, opts) {
434
434
  ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
435
435
  urlQueryReady: opts?.urlQueryReady,
436
436
  onUrlQueryChange: opts?.onUrlQueryChange,
437
- urlQuerySync: opts?.urlQuerySync
437
+ urlQuerySync: opts?.urlQuerySync,
438
+ onUnsupportedFilter: opts?.onUnsupportedFilter
438
439
  },
439
440
  window: {
440
441
  blockSize: opts?.blockSize,
@@ -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
  const require_use_table_selection = require("./use-table-selection-DtCV3rhu.cjs");
3
3
  let _atscript_ui = require("@atscript/ui");
4
4
  let vue = require("vue");
@@ -434,7 +434,8 @@ function useTable(url, opts) {
434
434
  ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
435
435
  urlQueryReady: opts?.urlQueryReady,
436
436
  onUrlQueryChange: opts?.onUrlQueryChange,
437
- urlQuerySync: opts?.urlQuerySync
437
+ urlQuerySync: opts?.urlQuerySync,
438
+ onUnsupportedFilter: opts?.onUnsupportedFilter
438
439
  },
439
440
  window: {
440
441
  blockSize: opts?.blockSize,
@@ -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
  let vue = require("vue");
3
3
  let _atscript_ui_table = require("@atscript/ui-table");
4
4
  //#region src/composables/use-row-actions-column.ts
@@ -1,4 +1,4 @@
1
- import { D as ROW_ACTIONS_TYPE, E as ROW_ACTIONS_PATH } from "./use-table-state-CqU1N4Q9.mjs";
1
+ import { D as ROW_ACTIONS_PATH, O as ROW_ACTIONS_TYPE } from "./use-table-state-BEwXQayO.mjs";
2
2
  import { computed, watch } from "vue";
3
3
  import { reorderColumnNames } from "@atscript/ui-table";
4
4
  //#region src/composables/use-row-actions-column.ts
@@ -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.138",
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.138",
166
- "@atscript/ui-table": "^0.1.138",
167
- "@atscript/vue-form": "^0.1.138"
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",