@12-apps/ui 6.13.0 → 6.13.2

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/_internal/components/data-display/Carousel/Carousel.js +2 -2
  2. package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
  3. package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
  4. package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
  5. package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
  6. package/dist/_internal/components/data-display/DataGrid/DataGrid.js +1 -1
  7. package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +21 -20
  8. package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +27 -26
  9. package/dist/_internal/components/data-display/DataViews/base-card.js +2 -2
  10. package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +5 -5
  11. package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +4 -4
  12. package/dist/_internal/components/data-display/DataViews/base-list-card.js +6 -6
  13. package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +4 -4
  14. package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +3 -3
  15. package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +3 -3
  16. package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +5 -5
  17. package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +17 -17
  18. package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +5 -5
  19. package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +2 -2
  20. package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +3 -3
  21. package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +4 -4
  22. package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
  23. package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +3 -3
  24. package/dist/_internal/components/data-display/DataViews/data-views-selection.js +1 -1
  25. package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +6 -6
  26. package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +2 -2
  27. package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +5 -5
  28. package/dist/_internal/components/data-display/DataViews/data-views-types.js +1 -1
  29. package/dist/_internal/components/data-display/DataViews/data-views-writers.js +9 -0
  30. package/dist/_internal/components/data-display/DataViews/data-views-writers.js.map +1 -0
  31. package/dist/_internal/components/data-display/DataViews/list-card-rails.js +3 -3
  32. package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +4 -3
  33. package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
  34. package/dist/_internal/components/data-display/index.js +14 -14
  35. package/dist/_internal/components/index.js +14 -14
  36. package/dist/charts.js +11 -11
  37. package/dist/{chunk-TOUSE63W.js → chunk-2UCJJACD.js} +8 -10
  38. package/dist/chunk-2UCJJACD.js.map +1 -0
  39. package/dist/{chunk-QRKBBOSY.js → chunk-4KSOSI3U.js} +4 -4
  40. package/dist/{chunk-IN642YHK.js → chunk-4VNUOSTQ.js} +2 -2
  41. package/dist/{chunk-XPS7FWZS.js → chunk-4ZEU22L2.js} +4 -4
  42. package/dist/{chunk-NC2AATCC.js → chunk-6PFBYCBU.js} +2 -2
  43. package/dist/{chunk-WXHJG2UU.js → chunk-6U7NA74A.js} +2 -2
  44. package/dist/{chunk-CXA6UNFF.js → chunk-AP3PVR3T.js} +5 -5
  45. package/dist/{chunk-FZHKKLOO.js → chunk-AWTERXCW.js} +2 -2
  46. package/dist/{chunk-XULTDO56.js → chunk-BVGR7OYA.js} +4 -4
  47. package/dist/{chunk-YQJMVUBG.js → chunk-CZPU5TW3.js} +2 -2
  48. package/dist/{chunk-ZQPG57GA.js → chunk-EICVL6GS.js} +2 -2
  49. package/dist/{chunk-P55UFXYW.js → chunk-HGBZZDP6.js} +2 -2
  50. package/dist/{chunk-JHBQZZHT.js → chunk-HNDUCGM3.js} +3 -3
  51. package/dist/{chunk-WIEXYVMU.js → chunk-HR7YTBR7.js} +2 -2
  52. package/dist/{chunk-NPEKJXVV.js → chunk-HRJ27X5B.js} +4 -4
  53. package/dist/{chunk-QEPGWTJT.js → chunk-LHHAYZ55.js} +1 -1
  54. package/dist/chunk-LHHAYZ55.js.map +1 -0
  55. package/dist/chunk-LLZWB32X.js +36 -0
  56. package/dist/chunk-LLZWB32X.js.map +1 -0
  57. package/dist/{chunk-ZHPKFV7Y.js → chunk-N6JGYVRY.js} +2 -2
  58. package/dist/{chunk-E2H7MBPM.js → chunk-OGGHD64H.js} +2 -2
  59. package/dist/{chunk-JPDKRGYI.js → chunk-PDGAFQ6Z.js} +3 -3
  60. package/dist/{chunk-W3UM2KEW.js → chunk-Q4ITS2EP.js} +11 -10
  61. package/dist/chunk-Q4ITS2EP.js.map +1 -0
  62. package/dist/{chunk-XIYPVNEB.js → chunk-QQE2PVLO.js} +3 -3
  63. package/dist/{chunk-GOWBYHYW.js → chunk-R6SBP5M5.js} +4 -4
  64. package/dist/{chunk-XYRS4JOF.js → chunk-RDYBS45D.js} +4 -4
  65. package/dist/{chunk-BMAOQDVY.js → chunk-RRYQG5Y6.js} +4 -4
  66. package/dist/{chunk-WLCVOQCJ.js → chunk-RUO4D4N6.js} +3 -3
  67. package/dist/{chunk-YRFKPRV2.js → chunk-SCGVB7DS.js} +2 -2
  68. package/dist/chunk-U5FOJBLG.js +19 -0
  69. package/dist/chunk-U5FOJBLG.js.map +1 -0
  70. package/dist/{chunk-WKRSVGT6.js → chunk-WXBBWSNU.js} +2 -2
  71. package/dist/{chunk-BZTFPSWT.js → chunk-XEE7PLDR.js} +4 -4
  72. package/dist/{chunk-ZIPCGZA3.js → chunk-ZPIMPOHV.js} +2 -2
  73. package/dist/data-display/CardKit.js +3 -3
  74. package/dist/data-display/Carousel.js +2 -2
  75. package/dist/data-display/Chart.js +11 -11
  76. package/dist/data-display/DataGrid.js +1 -1
  77. package/dist/data-display/DataViews.js +32 -31
  78. package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts.map +1 -1
  79. package/dist/types/components/data-display/DataViews/data-views-selection.d.ts +31 -2
  80. package/dist/types/components/data-display/DataViews/data-views-selection.d.ts.map +1 -1
  81. package/dist/types/components/data-display/DataViews/data-views-types.d.ts +8 -0
  82. package/dist/types/components/data-display/DataViews/data-views-types.d.ts.map +1 -1
  83. package/dist/types/components/data-display/DataViews/data-views-writers.d.ts +20 -0
  84. package/dist/types/components/data-display/DataViews/data-views-writers.d.ts.map +1 -0
  85. package/dist/types/components/data-display/DataViews/use-data-views-state.d.ts +10 -2
  86. package/dist/types/components/data-display/DataViews/use-data-views-state.d.ts.map +1 -1
  87. package/package.json +1 -1
  88. package/src/components/data-display/DataViews/data-views-grid-parts.tsx +2 -1
  89. package/src/components/data-display/DataViews/data-views-selection.ts +61 -6
  90. package/src/components/data-display/DataViews/data-views-types.ts +11 -0
  91. package/src/components/data-display/DataViews/data-views-writers.ts +45 -0
  92. package/src/components/data-display/DataViews/use-data-views-state.ts +15 -12
  93. package/dist/chunk-QEPGWTJT.js.map +0 -1
  94. package/dist/chunk-TOUSE63W.js.map +0 -1
  95. package/dist/chunk-W3UM2KEW.js.map +0 -1
  96. package/dist/chunk-WTOTWP6A.js +0 -27
  97. package/dist/chunk-WTOTWP6A.js.map +0 -1
  98. /package/dist/{chunk-QRKBBOSY.js.map → chunk-4KSOSI3U.js.map} +0 -0
  99. /package/dist/{chunk-IN642YHK.js.map → chunk-4VNUOSTQ.js.map} +0 -0
  100. /package/dist/{chunk-XPS7FWZS.js.map → chunk-4ZEU22L2.js.map} +0 -0
  101. /package/dist/{chunk-NC2AATCC.js.map → chunk-6PFBYCBU.js.map} +0 -0
  102. /package/dist/{chunk-WXHJG2UU.js.map → chunk-6U7NA74A.js.map} +0 -0
  103. /package/dist/{chunk-CXA6UNFF.js.map → chunk-AP3PVR3T.js.map} +0 -0
  104. /package/dist/{chunk-FZHKKLOO.js.map → chunk-AWTERXCW.js.map} +0 -0
  105. /package/dist/{chunk-XULTDO56.js.map → chunk-BVGR7OYA.js.map} +0 -0
  106. /package/dist/{chunk-YQJMVUBG.js.map → chunk-CZPU5TW3.js.map} +0 -0
  107. /package/dist/{chunk-ZQPG57GA.js.map → chunk-EICVL6GS.js.map} +0 -0
  108. /package/dist/{chunk-P55UFXYW.js.map → chunk-HGBZZDP6.js.map} +0 -0
  109. /package/dist/{chunk-JHBQZZHT.js.map → chunk-HNDUCGM3.js.map} +0 -0
  110. /package/dist/{chunk-WIEXYVMU.js.map → chunk-HR7YTBR7.js.map} +0 -0
  111. /package/dist/{chunk-NPEKJXVV.js.map → chunk-HRJ27X5B.js.map} +0 -0
  112. /package/dist/{chunk-ZHPKFV7Y.js.map → chunk-N6JGYVRY.js.map} +0 -0
  113. /package/dist/{chunk-E2H7MBPM.js.map → chunk-OGGHD64H.js.map} +0 -0
  114. /package/dist/{chunk-JPDKRGYI.js.map → chunk-PDGAFQ6Z.js.map} +0 -0
  115. /package/dist/{chunk-XIYPVNEB.js.map → chunk-QQE2PVLO.js.map} +0 -0
  116. /package/dist/{chunk-GOWBYHYW.js.map → chunk-R6SBP5M5.js.map} +0 -0
  117. /package/dist/{chunk-XYRS4JOF.js.map → chunk-RDYBS45D.js.map} +0 -0
  118. /package/dist/{chunk-BMAOQDVY.js.map → chunk-RRYQG5Y6.js.map} +0 -0
  119. /package/dist/{chunk-WLCVOQCJ.js.map → chunk-RUO4D4N6.js.map} +0 -0
  120. /package/dist/{chunk-YRFKPRV2.js.map → chunk-SCGVB7DS.js.map} +0 -0
  121. /package/dist/{chunk-WKRSVGT6.js.map → chunk-WXBBWSNU.js.map} +0 -0
  122. /package/dist/{chunk-BZTFPSWT.js.map → chunk-XEE7PLDR.js.map} +0 -0
  123. /package/dist/{chunk-ZIPCGZA3.js.map → chunk-ZPIMPOHV.js.map} +0 -0
@@ -1,92 +1,93 @@
1
1
  import {
2
2
  DataViewsTableBase
3
- } from "../chunk-BMAOQDVY.js";
3
+ } from "../chunk-RRYQG5Y6.js";
4
4
  import "../chunk-LS42VJAI.js";
5
5
  import {
6
6
  DataViewsGrid
7
- } from "../chunk-JHBQZZHT.js";
7
+ } from "../chunk-HNDUCGM3.js";
8
8
  import {
9
9
  BaseListCard
10
- } from "../chunk-XYRS4JOF.js";
10
+ } from "../chunk-RDYBS45D.js";
11
11
  import "../chunk-UNF65XZW.js";
12
- import "../chunk-QRKBBOSY.js";
13
- import "../chunk-ZQPG57GA.js";
12
+ import "../chunk-4KSOSI3U.js";
13
+ import "../chunk-EICVL6GS.js";
14
14
  import "../chunk-2JCRNWHE.js";
15
15
  import {
16
16
  BaseCard
17
- } from "../chunk-WXHJG2UU.js";
17
+ } from "../chunk-6U7NA74A.js";
18
18
  import "../chunk-MQUU2XZB.js";
19
+ import "../chunk-ZOLAYP2D.js";
19
20
  import {
20
21
  DragContainerProvider,
21
22
  DropIndicator,
22
23
  useDragItem
23
24
  } from "../chunk-JCJGJX7V.js";
24
- import "../chunk-ZOLAYP2D.js";
25
- import "../chunk-W3UM2KEW.js";
26
- import "../chunk-IN642YHK.js";
25
+ import "../chunk-Q4ITS2EP.js";
26
+ import "../chunk-4VNUOSTQ.js";
27
27
  import "../chunk-S7CAXRRP.js";
28
- import "../chunk-WLCVOQCJ.js";
28
+ import "../chunk-RUO4D4N6.js";
29
29
  import "../chunk-5WNQJ5KS.js";
30
30
  import "../chunk-ECIGNYSI.js";
31
- import "../chunk-ZHPKFV7Y.js";
32
- import "../chunk-NC2AATCC.js";
33
- import "../chunk-XIYPVNEB.js";
31
+ import "../chunk-N6JGYVRY.js";
32
+ import "../chunk-6PFBYCBU.js";
33
+ import "../chunk-QQE2PVLO.js";
34
34
  import {
35
35
  DataViewsBoard
36
36
  } from "../chunk-3DQP6OPC.js";
37
- import "../chunk-BZTFPSWT.js";
37
+ import "../chunk-XEE7PLDR.js";
38
+ import "../chunk-FV36LFPX.js";
38
39
  import "../chunk-F4RR4666.js";
39
40
  import "../chunk-CBOB5AV6.js";
40
41
  import "../chunk-VR5HDUBK.js";
41
42
  import "../chunk-TQ6FPOPD.js";
42
43
  import "../chunk-IAGOUTI6.js";
43
- import "../chunk-FV36LFPX.js";
44
+ import "../chunk-AWTERXCW.js";
44
45
  import "../chunk-2I5B5NNT.js";
45
46
  import "../chunk-A7Q5AQVD.js";
46
- import "../chunk-E2H7MBPM.js";
47
+ import "../chunk-OGGHD64H.js";
47
48
  import "../chunk-GCZJH4XL.js";
48
49
  import {
49
50
  DEFAULT_RAILS,
50
51
  ListCardGroup,
51
52
  RAIL_COUNT
52
- } from "../chunk-YQJMVUBG.js";
53
+ } from "../chunk-CZPU5TW3.js";
53
54
  import {
54
55
  DEFAULT_CELL_WIDTH
55
56
  } from "../chunk-6VP2L3DJ.js";
56
- import "../chunk-XPS7FWZS.js";
57
- import "../chunk-U7SO3N42.js";
58
- import "../chunk-UHXNEXOC.js";
59
- import "../chunk-5M4TYFR3.js";
60
- import "../chunk-FZHKKLOO.js";
61
- import "../chunk-WKRSVGT6.js";
57
+ import "../chunk-WXBBWSNU.js";
62
58
  import "../chunk-NQCYVYP3.js";
63
- import "../chunk-P55UFXYW.js";
59
+ import "../chunk-HGBZZDP6.js";
64
60
  import "../chunk-2PPWKCMW.js";
65
- import "../chunk-YRFKPRV2.js";
61
+ import "../chunk-SCGVB7DS.js";
66
62
  import "../chunk-SNR537TI.js";
67
63
  import {
68
64
  cardMinWidthForZoom,
69
65
  cardScaleForZoom
70
- } from "../chunk-ZIPCGZA3.js";
66
+ } from "../chunk-ZPIMPOHV.js";
71
67
  import "../chunk-QTPKACVO.js";
72
- import "../chunk-WIEXYVMU.js";
68
+ import "../chunk-4ZEU22L2.js";
69
+ import "../chunk-UHXNEXOC.js";
70
+ import "../chunk-U7SO3N42.js";
71
+ import "../chunk-5M4TYFR3.js";
72
+ import "../chunk-HR7YTBR7.js";
73
73
  import "../chunk-DZEC6RFM.js";
74
- import "../chunk-TOUSE63W.js";
74
+ import "../chunk-2UCJJACD.js";
75
75
  import "../chunk-4QQVIGRG.js";
76
76
  import "../chunk-YGQX7BNI.js";
77
77
  import "../chunk-IMLIIW77.js";
78
- import "../chunk-WTOTWP6A.js";
78
+ import "../chunk-LLZWB32X.js";
79
79
  import {
80
80
  DataViewsScopeTabs,
81
81
  assertNoScopePillOverlap,
82
82
  resolveScope
83
83
  } from "../chunk-LYKV3C7B.js";
84
+ import "../chunk-U5FOJBLG.js";
84
85
  import "../chunk-5VZPVDUF.js";
85
86
  import {
86
87
  CARD_ASPECT_RATIOS,
87
88
  DATA_VIEWS_LAYOUTS,
88
89
  toSavedViewSummary
89
- } from "../chunk-QEPGWTJT.js";
90
+ } from "../chunk-LHHAYZ55.js";
90
91
  import "../chunk-T4SM36XC.js";
91
92
  import {
92
93
  DataViewsCopyProvider,
@@ -169,8 +170,8 @@ import "../chunk-X5MPHXG5.js";
169
170
  import "../chunk-DLJGBJZW.js";
170
171
  import "../chunk-KZLLTOB2.js";
171
172
  import "../chunk-E5LWJDI3.js";
172
- import "../chunk-5E3XZAED.js";
173
173
  import "../chunk-G3E66C6J.js";
174
+ import "../chunk-5E3XZAED.js";
174
175
  import "../chunk-SNCSGLJ6.js";
175
176
  import "../chunk-TCAB2ERD.js";
176
177
  import "../chunk-NUGT7LMR.js";
@@ -1 +1 @@
1
- {"version":3,"file":"data-views-grid-parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-grid-parts.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;A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C/B,mEAAmE;IACnE,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,yDAAyD;IACzD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,qEAAqE;IACrE,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,8FAA8F;IAC9F,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAiFD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsCxG"}
1
+ {"version":3,"file":"data-views-grid-parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-grid-parts.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,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AAC;IAC/B,mEAAmE;IACnE,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,yDAAyD;IACzD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,qEAAqE;IACrE,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,8FAA8F;IAC9F,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAiFD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsCxG"}
@@ -4,7 +4,7 @@ interface DataViewsSelection<T> {
4
4
  setSelectedIds: (ids: Set<string | number>) => void;
5
5
  /** Add/remove ONE id — what a card's or board card's checkbox calls. */
6
6
  toggleId: (id: string | number) => void;
7
- /** The selected rows, narrowed to what is currently rendered. */
7
+ /** The selected rows, INCLUDING ones the current page no longer renders. */
8
8
  selectedRows: T[];
9
9
  clearSelection: () => void;
10
10
  selectAll: () => void;
@@ -18,7 +18,36 @@ interface DataViewsSelection<T> {
18
18
  * because `toggleId` needs a functional update: two cards toggled in the same
19
19
  * tick would otherwise both read the pre-render set and the second would drop
20
20
  * the first's change.
21
+ *
22
+ * ## A selection has to survive PAGING
23
+ *
24
+ * `selectedIds` always did — nothing clears it when the page changes — but
25
+ * `selectedRows` was `matched.filter(...)`, and in SERVER mode `matched` is one
26
+ * page. So ticking three rows, paging, and ticking two more left the checkboxes
27
+ * claiming five and the bulk action receiving two, silently, with the other
28
+ * three still ticked on a page nobody was looking at.
29
+ *
30
+ * That is the worst shape a bug can have here: the UI and the write disagree,
31
+ * neither says so, and the rows that did not move are exactly the ones out of
32
+ * sight. So a row is REMEMBERED for as long as its id is selected, and
33
+ * `selectedRows` answers from that memory for anything the current page does
34
+ * not hold.
35
+ *
36
+ * **Server mode only** ({@link SelectionOptions.rememberOffPage}), and the
37
+ * distinction is not a hedge. In client mode `matched` is the whole filtered
38
+ * result, so nothing is ever off-page and there is nothing to remember — while
39
+ * narrowing the selection as the FILTER narrows is the behaviour a client-mode
40
+ * grid should keep. Remembering there would mean a bulk action reaching rows
41
+ * the operator has just filtered away.
21
42
  */
22
- export declare function useSelection<T>(matched: T[], getRowId: (row: T) => string | number): DataViewsSelection<T>;
43
+ export interface SelectionOptions {
44
+ /**
45
+ * Keep rows the current page no longer renders.
46
+ *
47
+ * True in server mode, where `matched` is a page rather than the result.
48
+ */
49
+ rememberOffPage?: boolean;
50
+ }
51
+ export declare function useSelection<T>(matched: T[], getRowId: (row: T) => string | number, options?: SelectionOptions): DataViewsSelection<T>;
23
52
  export {};
24
53
  //# sourceMappingURL=data-views-selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-views-selection.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-selection.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,UAAU,kBAAkB,CAAC,CAAC;IAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACpD,wEAAwE;IACxE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,iEAAiE;IACjE,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,CAAC,EAAE,EACZ,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GACpC,kBAAkB,CAAC,CAAC,CAAC,CAoBvB"}
1
+ {"version":3,"file":"data-views-selection.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-selection.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,UAAU,kBAAkB,CAAC,CAAC;IAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACpD,wEAAwE;IACxE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,CAAC,EAAE,EACZ,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,EACrC,OAAO,GAAE,gBAAqB,GAC7B,kBAAkB,CAAC,CAAC,CAAC,CA4CvB"}
@@ -135,6 +135,14 @@ export interface DataViewColumn<T extends Record<string, unknown>> extends GridC
135
135
  */
136
136
  export type DataViewsLayout = "cards" | "list" | "board" | "table";
137
137
  /** The full, serializable state a view captures. */
138
+ /**
139
+ * A view-state patch: the fields to merge, or an updater given the CURRENT
140
+ * state. Use the updater whenever the patch derives from state it also changes
141
+ * — a render-scoped snapshot would let two calls in one tick read the same
142
+ * `prev` and the second overwrite the first, which is exactly what a control
143
+ * emitting one call per changed value does.
144
+ */
145
+ export type DataViewStatePatch = Partial<DataViewState> | ((prev: DataViewState) => Partial<DataViewState>);
138
146
  export interface DataViewState {
139
147
  /** Free text matched across every `searchable` column. */
140
148
  search: string;
@@ -1 +1 @@
1
- {"version":3,"file":"data-views-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAA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MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,gBAAgB,CAEhF;AAED;;;;GAIG;AAEH,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,sFAAsF;AACtF,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACtE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAClF,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACzD;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
1
+ {"version":3,"file":"data-views-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAA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M,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,sFAAsF;AACtF,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACtE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAClF,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACzD;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
@@ -0,0 +1,20 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ import { type DataViewState, type DataViewStatePatch } from "./data-views-types";
3
+ /**
4
+ * The two ways a DataViews state is WRITTEN, spelled once.
5
+ *
6
+ * Both are `setState` with a shape — a whole-state patch, and the one column
7
+ * toggle that has to merge into a list rather than replace a field. They sat
8
+ * inline in `useDataViewsState`, which is permanently at the size gate's
9
+ * ceiling; here they sit next to each other, where the fact that
10
+ * `toggleColumn` is just a `patch` with a merge rule is visible.
11
+ *
12
+ * Extracted for the same reason `useSelection` was: that hook is a COMPOSITION
13
+ * of the pieces below it, and every piece that can be named on its own leaves
14
+ * it reading as what it assembles rather than as how each part works.
15
+ */
16
+ export declare function useStateWriters(setState: Dispatch<SetStateAction<DataViewState>>): {
17
+ patch: (next: DataViewStatePatch) => void;
18
+ toggleColumn: (id: string, visible: boolean) => void;
19
+ };
20
+ //# sourceMappingURL=data-views-writers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-views-writers.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-writers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAcjF;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,GAAG;IAClF,KAAK,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD,CAUA"}
@@ -2,7 +2,7 @@ import { type GridColumn } from "../DataGrid";
2
2
  import { type SortFieldDefinition } from "../../layout/ContentToolbar";
3
3
  import { type HideableColumn } from "./data-views-columns";
4
4
  import { type ScopeConfig } from "./data-views-scopes";
5
- import { type DataViewColumn, type DataViewServer, type DataViewState, type DataViewSyncState, type FilterFieldConfig, type RangeFieldConfig, type DataViewQuery, type RangeValue, type RowAction } from "./data-views-types";
5
+ import { type DataViewColumn, type DataViewServer, type DataViewState, type DataViewStatePatch, type DataViewSyncState, type FilterFieldConfig, type RangeFieldConfig, type DataViewQuery, type RangeValue, type RowAction } from "./data-views-types";
6
6
  export type { HideableColumn };
7
7
  /** Inputs the hook needs to own the view state + derived data. */
8
8
  interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
@@ -46,7 +46,15 @@ interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
46
46
  export interface DataViewsController<T extends Record<string, unknown>> {
47
47
  state: DataViewState;
48
48
  ranges: Record<string, RangeValue>;
49
- patch: (next: Partial<DataViewState>) => void;
49
+ /**
50
+ * Merge a partial into the view state.
51
+ *
52
+ * The UPDATER form is the one to reach for when the patch is derived from
53
+ * state you are also changing — successive calls within one tick each see the
54
+ * previous call's result, where the object form would have every caller build
55
+ * its patch from the same render-scoped snapshot and the last write would win.
56
+ */
57
+ patch: (next: DataViewStatePatch) => void;
50
58
  matched: T[];
51
59
  gridColumns: GridColumn<T>[];
52
60
  /** Columns eligible for the show/hide menu (hideable, with a text header). */
@@ -1 +1 @@
1
- {"version":3,"file":"use-data-views-state.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/use-data-views-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG3F,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,kEAAkE;AAClE,UAAU,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;I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E,IAAI,EACJ,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAW,EACX,YAAY,GACb,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CA4DnD"}
1
+ {"version":3,"file":"use-data-views-state.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/use-data-views-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAI3F,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,kEAAkE;AAClE,UAAU,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC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,EACnE,IAAI,EACJ,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAW,EACX,YAAY,GACb,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CA2DnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/ui",
3
- "version": "6.13.0",
3
+ "version": "6.13.2",
4
4
  "license": "MIT",
5
5
  "packageManager": "pnpm@10.34.5",
6
6
  "type": "module",
@@ -200,8 +200,9 @@ function useGridShellFilters<T extends Record<string, unknown>>({
200
200
  pills: state.pills,
201
201
  ranges: c.ranges,
202
202
  onSearchChange: (value) => c.patch({ search: value }),
203
+ // Updater, never the render's `state` — see {@link DataViewStatePatch}.
203
204
  onTogglePill: (fieldId, value, checked) =>
204
- c.patch({ pills: { ...state.pills, [fieldId]: togglePillValues(state.pills[fieldId], value, checked) } }),
205
+ c.patch(({ pills }) => ({ pills: { ...pills, [fieldId]: togglePillValues(pills[fieldId], value, checked) } })),
205
206
  onChangeRange: (fieldId, range) => c.patch({ ranges: { ...c.ranges, [fieldId]: range } }),
206
207
  onClearField: (fieldId) => c.patch({ pills: { ...state.pills, [fieldId]: [] } }),
207
208
  onClearAll: () => c.patch({ search: "", pills: {}, ranges: {} }),
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { useMemo, useState } from "react";
3
+ import { useMemo, useRef, useState } from "react";
4
4
 
5
5
  /** The multi-select model, identical in every layout (table, cards, board). */
6
6
  interface DataViewsSelection<T> {
@@ -8,7 +8,7 @@ interface DataViewsSelection<T> {
8
8
  setSelectedIds: (ids: Set<string | number>) => void;
9
9
  /** Add/remove ONE id — what a card's or board card's checkbox calls. */
10
10
  toggleId: (id: string | number) => void;
11
- /** The selected rows, narrowed to what is currently rendered. */
11
+ /** The selected rows, INCLUDING ones the current page no longer renders. */
12
12
  selectedRows: T[];
13
13
  clearSelection: () => void;
14
14
  selectAll: () => void;
@@ -23,16 +23,71 @@ interface DataViewsSelection<T> {
23
23
  * because `toggleId` needs a functional update: two cards toggled in the same
24
24
  * tick would otherwise both read the pre-render set and the second would drop
25
25
  * the first's change.
26
+ *
27
+ * ## A selection has to survive PAGING
28
+ *
29
+ * `selectedIds` always did — nothing clears it when the page changes — but
30
+ * `selectedRows` was `matched.filter(...)`, and in SERVER mode `matched` is one
31
+ * page. So ticking three rows, paging, and ticking two more left the checkboxes
32
+ * claiming five and the bulk action receiving two, silently, with the other
33
+ * three still ticked on a page nobody was looking at.
34
+ *
35
+ * That is the worst shape a bug can have here: the UI and the write disagree,
36
+ * neither says so, and the rows that did not move are exactly the ones out of
37
+ * sight. So a row is REMEMBERED for as long as its id is selected, and
38
+ * `selectedRows` answers from that memory for anything the current page does
39
+ * not hold.
40
+ *
41
+ * **Server mode only** ({@link SelectionOptions.rememberOffPage}), and the
42
+ * distinction is not a hedge. In client mode `matched` is the whole filtered
43
+ * result, so nothing is ever off-page and there is nothing to remember — while
44
+ * narrowing the selection as the FILTER narrows is the behaviour a client-mode
45
+ * grid should keep. Remembering there would mean a bulk action reaching rows
46
+ * the operator has just filtered away.
26
47
  */
48
+ export interface SelectionOptions {
49
+ /**
50
+ * Keep rows the current page no longer renders.
51
+ *
52
+ * True in server mode, where `matched` is a page rather than the result.
53
+ */
54
+ rememberOffPage?: boolean;
55
+ }
56
+
27
57
  export function useSelection<T>(
28
58
  matched: T[],
29
59
  getRowId: (row: T) => string | number,
60
+ options: SelectionOptions = {},
30
61
  ): DataViewsSelection<T> {
31
62
  const [selectedIds, setSelectedIds] = useState<Set<string | number>>(new Set());
32
- const selectedRows = useMemo(
33
- () => matched.filter((row) => selectedIds.has(getRowId(row))),
34
- [matched, selectedIds, getRowId],
35
- );
63
+ // Rows seen while selected, so a selection outlives the page that made it.
64
+ // A ref rather than state: it is a CACHE derived from what has been rendered,
65
+ // and holding it in state would re-render on every page load to store rows
66
+ // nothing is waiting for.
67
+ const remembered = useRef(new Map<string | number, T>());
68
+
69
+ const selectedRows = useMemo(() => {
70
+ const onPage = matched.filter((row) => selectedIds.has(getRowId(row)));
71
+ if (!options.rememberOffPage) return onPage;
72
+
73
+ const cache = remembered.current;
74
+ // Refresh from what is on screen NOW: a row edited elsewhere and re-fetched
75
+ // must not be acted on through a stale snapshot from three pages ago.
76
+ for (const row of onPage) cache.set(getRowId(row), row);
77
+ // …and forget anything no longer selected, so the map cannot outgrow the
78
+ // selection it exists to describe.
79
+ for (const id of cache.keys()) if (!selectedIds.has(id)) cache.delete(id);
80
+
81
+ // On-page rows first, in the page's own order — unchanged from before this
82
+ // — then the remembered tail. Appending rather than interleaving keeps the
83
+ // familiar case byte-identical and makes the addition exactly the addition.
84
+ const onPageIds = new Set(onPage.map(getRowId));
85
+ const offPage = [...cache.entries()].flatMap(([id, row]) =>
86
+ onPageIds.has(id) ? [] : [row],
87
+ );
88
+ return [...onPage, ...offPage];
89
+ }, [matched, selectedIds, getRowId, options.rememberOffPage]);
90
+
36
91
  return {
37
92
  selectedIds,
38
93
  setSelectedIds,
@@ -170,6 +170,17 @@ export interface DataViewColumn<T extends Record<string, unknown>> extends GridC
170
170
  export type DataViewsLayout = "cards" | "list" | "board" | "table";
171
171
 
172
172
  /** The full, serializable state a view captures. */
173
+ /**
174
+ * A view-state patch: the fields to merge, or an updater given the CURRENT
175
+ * state. Use the updater whenever the patch derives from state it also changes
176
+ * — a render-scoped snapshot would let two calls in one tick read the same
177
+ * `prev` and the second overwrite the first, which is exactly what a control
178
+ * emitting one call per changed value does.
179
+ */
180
+ export type DataViewStatePatch =
181
+ | Partial<DataViewState>
182
+ | ((prev: DataViewState) => Partial<DataViewState>);
183
+
173
184
  export interface DataViewState {
174
185
  /** Free text matched across every `searchable` column. */
175
186
  search: string;
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ import { type Dispatch, type SetStateAction } from "react";
4
+
5
+ import { type DataViewState, type DataViewStatePatch } from "./data-views-types";
6
+
7
+ /**
8
+ * Add or remove one column id from the visible-columns list.
9
+ *
10
+ * Moved here with its only caller. A visible column is APPENDED rather than
11
+ * restored to its original index, which is what makes re-showing a column put
12
+ * it last — the behaviour the Exibir panel has always had.
13
+ */
14
+ function nextVisibleColumns(current: string[], id: string, visible: boolean): string[] {
15
+ const without = current.filter((colId) => colId !== id);
16
+ return visible ? [...without, id] : without;
17
+ }
18
+
19
+ /**
20
+ * The two ways a DataViews state is WRITTEN, spelled once.
21
+ *
22
+ * Both are `setState` with a shape — a whole-state patch, and the one column
23
+ * toggle that has to merge into a list rather than replace a field. They sat
24
+ * inline in `useDataViewsState`, which is permanently at the size gate's
25
+ * ceiling; here they sit next to each other, where the fact that
26
+ * `toggleColumn` is just a `patch` with a merge rule is visible.
27
+ *
28
+ * Extracted for the same reason `useSelection` was: that hook is a COMPOSITION
29
+ * of the pieces below it, and every piece that can be named on its own leaves
30
+ * it reading as what it assembles rather than as how each part works.
31
+ */
32
+ export function useStateWriters(setState: Dispatch<SetStateAction<DataViewState>>): {
33
+ patch: (next: DataViewStatePatch) => void;
34
+ toggleColumn: (id: string, visible: boolean) => void;
35
+ } {
36
+ return {
37
+ patch: (next) =>
38
+ setState((prev) => ({ ...prev, ...(typeof next === "function" ? next(prev) : next) })),
39
+ toggleColumn: (id, visible) =>
40
+ setState((prev) => ({
41
+ ...prev,
42
+ visibleColumns: nextVisibleColumns(prev.visibleColumns, id, visible),
43
+ })),
44
+ };
45
+ }
@@ -15,11 +15,13 @@ import { computeActiveFilterCount, defaultSortFields } from "./data-views-grid-h
15
15
  import { resolveScope, useScopeConfigChecks, type ScopeConfig } from "./data-views-scopes";
16
16
  import { serverDerived, useServerQuery } from "./data-views-server-query";
17
17
  import { useSelection } from "./data-views-selection";
18
+ import { useStateWriters } from "./data-views-writers";
18
19
  import {
19
20
  emptyViewState,
20
21
  type DataViewColumn,
21
22
  type DataViewServer,
22
23
  type DataViewState,
24
+ type DataViewStatePatch,
23
25
  type DataViewSyncState,
24
26
  type FilterFieldConfig,
25
27
  type RangeFieldConfig,
@@ -73,7 +75,15 @@ interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
73
75
  export interface DataViewsController<T extends Record<string, unknown>> {
74
76
  state: DataViewState;
75
77
  ranges: Record<string, RangeValue>;
76
- patch: (next: Partial<DataViewState>) => void;
78
+ /**
79
+ * Merge a partial into the view state.
80
+ *
81
+ * The UPDATER form is the one to reach for when the patch is derived from
82
+ * state you are also changing — successive calls within one tick each see the
83
+ * previous call's result, where the object form would have every caller build
84
+ * its patch from the same render-scoped snapshot and the last write would win.
85
+ */
86
+ patch: (next: DataViewStatePatch) => void;
77
87
  matched: T[];
78
88
  gridColumns: GridColumn<T>[];
79
89
  /** Columns eligible for the show/hide menu (hideable, with a text header). */
@@ -159,12 +169,6 @@ function useMatchedRows<T extends Record<string, unknown>>(
159
169
  );
160
170
  }
161
171
 
162
- /** Add or remove one column id from the visible-columns list. */
163
- function nextVisibleColumns(current: string[], id: string, visible: boolean): string[] {
164
- const without = current.filter((colId) => colId !== id);
165
- return visible ? [...without, id] : without;
166
- }
167
-
168
172
  /**
169
173
  * Reconcile external state changes and surface every change to the caller:
170
174
  * - `appliedState` (a saved view) fully REPLACES the state — it is columns-
@@ -229,7 +233,7 @@ function seedState(
229
233
  * same reason changing any other part of the query clears it.
230
234
  */
231
235
  function makeSetScope(
232
- patch: (next: Partial<DataViewState>) => void,
236
+ patch: (next: DataViewStatePatch) => void,
233
237
  clearSelection: () => void,
234
238
  ): (id: string) => void {
235
239
  return (id) => {
@@ -327,7 +331,7 @@ export function useDataViewsState<T extends Record<string, unknown>>({
327
331
 
328
332
  useStateSyncEffects(appliedState, syncState, state, onStateChange, setState);
329
333
 
330
- const patch = (next: Partial<DataViewState>): void => setState((prev) => ({ ...prev, ...next }));
334
+ const { patch, toggleColumn } = useStateWriters(setState);
331
335
  const matched = useMatchedRows(server, rows, columns, fields, rangeFields, state);
332
336
  // Resolved at READ time, every render: a stale deep link or a saved view naming
333
337
  // a scope that has since been removed falls back to the first declared scope
@@ -341,9 +345,8 @@ export function useDataViewsState<T extends Record<string, unknown>>({
341
345
  onRowClick,
342
346
  state.order,
343
347
  );
344
- const toggleColumn = (id: string, visible: boolean): void =>
345
- setState((prev) => ({ ...prev, visibleColumns: nextVisibleColumns(prev.visibleColumns, id, visible) }));
346
- const selection = useSelection(matched, getRowId);
348
+ // Server mode is where `matched` is a PAGE — see `useSelection` (FUT-942).
349
+ const selection = useSelection(matched, getRowId, { rememberOffPage: Boolean(server) });
347
350
  const resolvedSortFields = sortFields ?? defaultSortFields(columns);
348
351
 
349
352
  return {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/data-display/DataViews/data-views-types.ts"],"sourcesContent":["import type { GridColumn, GridSort } from \"../DataGrid\";\nimport type { DropdownMenuItem } from \"../../navigation/DropdownMenu\";\n// A re-export does not bring the name into local scope, and the state/query\n// types below are written in terms of it.\nimport type { RangeValue } from \"./data-views-range-types\";\n\n/**\n * Shared types for the reusable admin \"DataViews\" table (FUT-88): a filter bar\n * (search-across-all + typed multi-select pills + column visibility) whose full\n * state — filters + sort + visible columns — a saved view (FUT-89) can capture\n * and restore. Each table declares its own columns + filter fields.\n */\n\n/**\n * A single, reusable row action. ONE definition drives BOTH the per-row \"⋮\"\n * kebab menu and the bulk-actions menu (tabwoah model): `onSelect` receives the\n * affected rows — `[row]` from a kebab, the whole selection from the bulk menu.\n * Single-item-only actions (e.g. \"Editar\") set `bulk: false` so they never\n * appear in the bulk menu.\n */\nexport interface RowAction<T extends Record<string, unknown>> {\n /** Stable id (also the `data-testid` suffix). */\n id: string;\n /** Menu label. In the kebab, `rowLabel` overrides it per row when provided. */\n label: string;\n /** Menu-item colour (e.g. `\"error\"` for destructive). */\n color?: DropdownMenuItem[\"color\"];\n /**\n * Runs on the affected rows: `[row]` from the kebab, all selected from bulk.\n * May be async — the bulk menu awaits it and only clears the selection once it\n * settles (keeping the selection on failure so the user can retry).\n */\n onSelect: (rows: T[]) => void | Promise<void>;\n /** Include in the bulk menu (2+ selected). Defaults to `true`. */\n bulk?: boolean;\n /** Include in the per-row kebab. Defaults to `true`. */\n row?: boolean;\n /** Per-row kebab label (e.g. `row.active ? \"Inativar\" : \"Ativar\"`). */\n rowLabel?: (row: T) => string;\n /**\n * Per-row applicability (e.g. state-machine guards). `false` hides the\n * kebab item for that row; in bulk the action runs only on the passing\n * rows and is dropped when none pass. Defaults to applicable.\n */\n isVisible?: (row: T) => boolean;\n}\n\n/** Selection state handed to a card renderer so it can drive its own checkbox. */\nexport interface DataViewCardSelection {\n selected: boolean;\n onToggleSelect: () => void;\n /**\n * Card SIZE multiplier from the toolbar zoom slider. The grid sizes the card's\n * width to `base × scale`; a card passes this to {@link BaseCard} `scale` so its\n * padding + typography grow by the same factor — the whole card scales together\n * (scale 2 → ~2× size). The proportion (aspect ratio) stays constant.\n */\n scale: number;\n}\n\n/**\n * The fixed proportions a {@link BaseCard} tile can take. The tile keeps this\n * ratio and grows in BOTH width and height as the zoom slider widens its grid\n * track, so a grid of cards stays visually uniform.\n */\nexport type CardAspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"9:16\" | \"3:4\" | \"3:1\";\n\n/** Numeric width/height factor for each {@link CardAspectRatio} (CSS `aspect-ratio`). */\nexport const CARD_ASPECT_RATIOS: Record<CardAspectRatio, number> = {\n \"1:1\": 1,\n \"4:3\": 4 / 3,\n \"16:9\": 16 / 9,\n \"9:16\": 9 / 16,\n \"3:4\": 3 / 4,\n /**\n * The BANNER tile: too short for media, sized for two lines of text.\n *\n * Every other ratio here is picture-shaped, because they were added for cards\n * built around a thumbnail. A card whose subject is a NAME and a NUMBER — a\n * cart, an order, anything triaged rather than browsed — spends most of a 4:3\n * tile on an icon that repeats down the whole grid and says nothing.\n */\n \"3:1\": 3,\n};\n\n/** One selectable value inside a filter pill. */\nexport interface FilterOption {\n value: string;\n label: string;\n /**\n * Parent option's `value`, for a hierarchical field (`control: \"category\"`).\n * Ignored by the flat controls, so one option list serves both.\n */\n parentId?: string | null;\n}\n\n/** A typed, multi-select filter pill's configuration for a table. */\nexport interface FilterFieldConfig<T extends Record<string, unknown>> {\n /** Stable id; also the default row key when no `accessor` is given. */\n id: string;\n label: string;\n options: FilterOption[];\n /**\n * How the field renders in the filter panel. `checkboxes` (default) is best for\n * a few fixed options; `multiselect` is a compact dropdown for long option\n * lists; `category` is the hierarchical picker, for an option set that nests\n * via {@link FilterOption.parentId} — it renders parents as headings and\n * their children as the selectable rows, rather than flattening the tree into\n * one indistinguishable list.\n */\n control?: \"checkboxes\" | \"multiselect\" | \"category\";\n /**\n * Lets a `control: \"category\"` pill select a PARENT category, not just its\n * children. Off by default, which keeps the leaf-only reading: the parent is\n * a heading and its subcategories are the rows you tick.\n *\n * Turn it on where \"the whole category\" is a filter a user would reach for —\n * selecting a parent then selects every subcategory under it, and the chip\n * tray collapses that back to one chip bearing the category's name.\n *\n * A category with NO children is selectable either way: it is itself the\n * leaf, so the flag has nothing to gate there.\n */\n allowParentSelection?: boolean;\n /**\n * Forces this filter to render as a searchable multi-select dropdown with the\n * search box always shown, regardless of how many options are currently\n * loaded. Use it when the option set can grow unbounded (e.g. a filter backed\n * by a relation such as Roles or Categories). Omit it for a closed value set\n * (an enum), which keeps the plain checkbox / \"search only when long\"\n * behavior.\n */\n searchEnabled?: boolean;\n /**\n * Reads the row's value(s) for this field. A row matches the pill when any of\n * its values is selected. Defaults to `String(row[id])`.\n */\n accessor?: (row: T) => string | string[];\n}\n\n/**\n * The range types live in `data-views-range-types` (this file outgrew the\n * size gate); they are re-exported here so `data-views-types` stays the one\n * name every consumer imports the model from.\n */\nexport type {\n DayRangeFieldConfig,\n NumberRangeFieldConfig,\n RangeFieldConfig,\n RangeFieldKind,\n RangePreset,\n RangeValue,\n} from \"./data-views-range-types\";\n\n/** A grid column that can join the search scan and the column-visibility menu. */\nexport interface DataViewColumn<T extends Record<string, unknown>> extends GridColumn<T> {\n /** Included in \"search across all columns\" (needs a resolvable value). */\n searchable?: boolean;\n /** Toggleable in the column-visibility menu. Defaults to true; set false for\n * structural columns (image thumbnail, actions kebab) that must always show. */\n hideable?: boolean;\n}\n\n/**\n * The DataViews layout (view type): the dense \"Tabela\" grid, the \"Grade\" of\n * cards, the \"Lista\" of full-width rows, or the \"Quadro\" board of state columns.\n * Lives with the state types rather than with the toggle because a saved view\n * CAPTURES it — see {@link DataViewState.layout}.\n */\nexport type DataViewsLayout = \"cards\" | \"list\" | \"board\" | \"table\";\n\n/** The full, serializable state a view captures. */\nexport interface DataViewState {\n /** Free text matched across every `searchable` column. */\n search: string;\n /** fieldId → selected option values (empty/absent = no constraint). */\n pills: Record<string, string[]>;\n /** fieldId → selected numeric range (min/max). Absent/empty = no constraint. */\n ranges?: Record<string, RangeValue>;\n sortBy: GridSort[];\n /** Column ids kept visible; a hideable column not listed here is hidden. */\n visibleColumns: string[];\n /**\n * Column ids in READING ORDER. Absent ⇒ the order the table declared them in.\n *\n * Order is view state for the same reason visibility is: reordering columns is\n * an operator deciding what to read FIRST, and a saved view that restored the\n * columns but not their order would restore half a decision. Ids the table no\n * longer declares are ignored at render, and ids missing from a stale list\n * fall in after it — so a column added since the view was saved appears rather\n * than disappearing.\n */\n order?: string[];\n /**\n * The active SCOPE id — the page-level partition the scope tabs select (see\n * `ScopeConfig`). Optional, so a table that declares no scopes is untouched\n * and no view persisted before scopes existed breaks.\n *\n * Stored raw and RESOLVED at read time: the declared scopes change underneath\n * a saved view, and a view naming a scope that has since been removed must\n * fall back at render rather than break.\n */\n scope?: string;\n /**\n * The layout the view was saved in. Optional — absent means \"whatever the user\n * is currently using\", which is the pre-existing behaviour.\n *\n * A LAYOUT FALLBACK IS NOT A LAYOUT CHANGE: a table rendered as stacked rows\n * on a phone still has `\"table\"` stored here, so the view round-trips the\n * stored layout regardless of the device that opened it.\n */\n layout?: DataViewsLayout;\n}\n\n/** A pristine view state showing every given column and no filters/sort. */\nexport function emptyViewState(visibleColumns: string[]): DataViewState {\n return { search: \"\", pills: {}, ranges: {}, sortBy: [], visibleColumns };\n}\n\n/**\n * The URL-driven slice of {@link DataViewState} — the controls a server-mode host\n * mirrors from the address bar (search / pills / ranges / sort), WITHOUT\n * `visibleColumns`. Supplying it re-applies those controls when its reference\n * changes (e.g. browser back/forward or a deep-link on the same route), merging\n * over the current state so a user's show/hide column choices are preserved —\n * unlike `appliedState`, which fully replaces the state to apply a saved view.\n */\nexport type DataViewSyncState = Pick<\n DataViewState,\n \"search\" | \"pills\" | \"ranges\" | \"sortBy\" | \"scope\"\n>;\n\n/**\n * The query a SERVER-mode table emits whenever its filter/sort/page changes\n * (FUT-180). The host translates this into a backend request (see\n * `@12-apps/shared-helpers/search`) — in server mode the grid never filters,\n * sorts, or paginates in the browser; it renders exactly the page the server\n * returned. `page` is 1-based to match the backend contract.\n */\nexport interface DataViewQuery {\n search: string;\n pills: Record<string, string[]>;\n ranges: Record<string, RangeValue>;\n sortBy: GridSort[];\n /**\n * The RESOLVED active scope (see `resolveScope`), when the table declares\n * scopes. The KEY IS ABSENT for a table that declares none — not present-and-\n * undefined — so a host that never opted in sees a byte-identical query.\n *\n * It carries the resolved id, never the stored one: a deep link or a saved\n * view naming a scope the table no longer declares must not put that id on the\n * wire, where the backend would reject it and replace the page with an error.\n */\n scope?: string;\n page: number;\n pageSize: number;\n}\n\n/**\n * Server-mode wiring for a DataViews table. Its PRESENCE flips the table from\n * in-browser filtering/sorting/pagination to backend-driven: the rows handed in\n * are already the current page, `totalCount` is the unpaginated total, and\n * `onQueryChange` fires (search debounced by the host) whenever the user changes\n * a filter, the sort, or the page. This is the ONLY way an admin list should run\n * (see the app-side `DataViewsTable` wrapper, which requires it).\n */\nexport interface DataViewServer {\n /** Total matched rows across all pages (drives the counter + page count). */\n totalCount: number;\n /** Current 1-based page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Fired when the effective query changes; the host re-fetches the page. */\n onQueryChange: (query: DataViewQuery) => void;\n /**\n * Per-scope totals for the scope tabs: `scopeId → count`. THE ONLY PIECE OF\n * THIS CONTRACT THAT CANNOT BE DONE CLIENT-SIDE — a count computed from the\n * loaded page is wrong the moment there is a second page, which is the\n * concrete bug scopes exist to fix.\n *\n * Compute it over search + pills + ranges while IGNORING the active scope.\n * Computed WITH the scope applied, every inactive tab reads zero, which is\n * worse than no counts at all.\n *\n * Omit it and the tabs render with no numbers. Nothing is ever invented from\n * the loaded rows to fill the gap.\n */\n scopeCounts?: Record<string, number>;\n}\n\n/**\n * Coerce an opaque persisted state (a saved view's JSON) into a valid\n * DataViewState, filling any missing part with a sane default. Guards against\n * legacy/older shapes so applying a saved view never renders an empty grid.\n */\nexport function coerceViewState(raw: unknown, allColumnIds: string[]): DataViewState {\n const value = (raw ?? {}) as Partial<DataViewState>;\n return {\n search: typeof value.search === \"string\" ? value.search : \"\",\n pills: asRecord<string[]>(value.pills),\n ranges: asRecord<RangeValue>(value.ranges),\n sortBy: Array.isArray(value.sortBy) ? value.sortBy : [],\n visibleColumns: Array.isArray(value.visibleColumns) ? value.visibleColumns : allColumnIds,\n order: Array.isArray(value.order) ? value.order : undefined,\n // Carried through UNVALIDATED against the declared scopes on purpose: a view\n // written before scopes existed has none (⇒ undefined ⇒ the first declared\n // scope at render), and one naming a since-removed scope keeps its stored id\n // here and falls back at READ time. Resolving here would rewrite the view.\n scope: typeof value.scope === \"string\" ? value.scope : undefined,\n layout: isLayout(value.layout) ? value.layout : undefined,\n };\n}\n\n/** Every layout this build knows how to render — the guard's single source. */\nexport const DATA_VIEWS_LAYOUTS: readonly DataViewsLayout[] = [\"cards\", \"list\", \"board\", \"table\"];\n\n/** Is this a layout this build knows how to render? Guards persisted JSON. */\nfunction isLayout(value: unknown): value is DataViewsLayout {\n return DATA_VIEWS_LAYOUTS.includes(value as DataViewsLayout);\n}\n\n/** A persisted map, or an empty one — persisted JSON can hold anything. */\nfunction asRecord<V>(value: unknown): Record<string, V> {\n return value !== null && typeof value === \"object\" ? (value as Record<string, V>) : {};\n}\n\n/** A saved view as consumed by the DataViews UI (FUT-89), with ownership flag. */\nexport interface SavedViewSummary {\n id: string;\n name: string;\n description: string | null;\n state: DataViewState;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n /** True when the current user owns the view (may edit/delete/pin/share it). */\n isOwner: boolean;\n}\n\n/** A saved-view repository record (opaque `state`), as returned to server pages. */\ninterface SavedViewRecordLike {\n id: string;\n name: string;\n description: string | null;\n state: unknown;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n isOwner: boolean;\n}\n\n/** Map a repository record to the client summary (opaque state → DataViewState). */\nexport function toSavedViewSummary(record: SavedViewRecordLike): SavedViewSummary {\n return { ...record, state: (record.state ?? {}) as DataViewState };\n}\n\n/**\n * Dependency-injection contracts for the framework-agnostic DataViewsTableBase:\n * the host app supplies saved-view persistence + router side-effects so the ui\n * component imports neither a backend (server actions) nor a framework router.\n */\n\n/** A saved view's editable fields, as the host persists them. */\nexport interface DataViewSaveInput {\n name: string;\n description: string;\n state: DataViewState;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n}\n\n/** Result of a persistence call — mirrors the app's `Result` without importing it. */\nexport type DataViewMutationResult = { ok: true } | { ok: false; error: string };\n\n/** Injected saved-view persistence (create/update/delete), wired by the host. */\nexport interface DataViewPersistence {\n create: (input: DataViewSaveInput) => Promise<DataViewMutationResult>;\n update: (id: string, input: DataViewSaveInput) => Promise<DataViewMutationResult>;\n remove: (id: string) => Promise<DataViewMutationResult>;\n}\n\n/** Injected router side-effects: sync the `?view=` param and re-fetch on change. */\nexport interface DataViewRouter {\n syncViewParam: (viewId: string | null) => void;\n refresh: () => void;\n}\n"],"mappings":";AAoEO,IAAM,qBAAsD;AAAA,EACjE,OAAO;AAAA,EACP,OAAO,IAAI;AAAA,EACX,QAAQ,KAAK;AAAA,EACb,QAAQ,IAAI;AAAA,EACZ,OAAO,IAAI;AA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