@12-apps/ui 6.41.0 → 6.41.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 (73) hide show
  1. package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +8 -8
  2. package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +9 -9
  3. package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +1 -1
  4. package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +2 -2
  5. package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +7 -7
  6. package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +4 -4
  7. package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +24 -1
  8. package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +23 -2
  9. package/dist/_internal/components/data-display/DataViews/data-views-overflow.js +1 -1
  10. package/dist/_internal/components/form/Autocomplete/Autocomplete.js +2 -2
  11. package/dist/_internal/components/form/Autocomplete/useAutocomplete.js +1 -1
  12. package/dist/_internal/components/form/index.js +2 -2
  13. package/dist/_internal/components/index.js +2 -2
  14. package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +4 -4
  15. package/dist/_internal/components/layout/SettingsLayout/SettingsPanel.js +3 -3
  16. package/dist/_internal/components/layout/SettingsLayout/SettingsSectionChips.js +2 -2
  17. package/dist/_internal/components/layout/SettingsLayout/SettingsSectionChips.scroll.js +7 -1
  18. package/dist/{chunk-ODW2D5PN.js → chunk-6QYKZMEE.js} +5 -2
  19. package/dist/{chunk-ODW2D5PN.js.map → chunk-6QYKZMEE.js.map} +1 -1
  20. package/dist/{chunk-Y2UXX5IQ.js → chunk-BKZERHNC.js} +2 -2
  21. package/dist/{chunk-M4P7NS2L.js → chunk-BR2T72JI.js} +23 -15
  22. package/dist/chunk-BR2T72JI.js.map +1 -0
  23. package/dist/{chunk-UGPRBJWB.js → chunk-DH77PLFF.js} +5 -5
  24. package/dist/chunk-GT2RCOHM.js +184 -0
  25. package/dist/chunk-GT2RCOHM.js.map +1 -0
  26. package/dist/{chunk-EIII4QU4.js → chunk-HFVYWHJT.js} +4 -4
  27. package/dist/{chunk-VEEG4UXZ.js → chunk-IUD6N52Q.js} +2 -2
  28. package/dist/{chunk-RZ2VZ7SL.js → chunk-JMEPGXJG.js} +2 -2
  29. package/dist/{chunk-J6KLT7HP.js → chunk-MEBQKYH4.js} +2 -2
  30. package/dist/{chunk-XVZG52CM.js → chunk-NOLSQK4J.js} +23 -25
  31. package/dist/chunk-NOLSQK4J.js.map +1 -0
  32. package/dist/{chunk-VWJEM2ER.js → chunk-NPPJ3IJP.js} +2 -2
  33. package/dist/chunk-NPPJ3IJP.js.map +1 -0
  34. package/dist/{chunk-CKHFYTIX.js → chunk-TBMGYQJF.js} +15 -5
  35. package/dist/chunk-TBMGYQJF.js.map +1 -0
  36. package/dist/{chunk-TCNTIGMY.js → chunk-TDXEO2UI.js} +2 -2
  37. package/dist/{chunk-FTQBVZ7V.js → chunk-TJ3334AJ.js} +2 -2
  38. package/dist/{chunk-VOJBLBXE.js → chunk-UT73NGRS.js} +2 -2
  39. package/dist/data-display/DataViews.js +9 -9
  40. package/dist/form/Autocomplete.js +2 -2
  41. package/dist/layout/SettingsLayout.js +4 -4
  42. package/dist/types/components/data-display/DataViews/data-views-category-pill.d.ts +6 -1
  43. package/dist/types/components/data-display/DataViews/data-views-category-pill.d.ts.map +1 -1
  44. package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts +0 -11
  45. package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts.map +1 -1
  46. package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts.map +1 -1
  47. package/dist/types/components/form/Autocomplete/useAutocomplete.d.ts +9 -0
  48. package/dist/types/components/form/Autocomplete/useAutocomplete.d.ts.map +1 -1
  49. package/dist/types/components/layout/SettingsLayout/SettingsSectionChips.d.ts.map +1 -1
  50. package/dist/types/components/layout/SettingsLayout/SettingsSectionChips.scroll.d.ts +20 -2
  51. package/dist/types/components/layout/SettingsLayout/SettingsSectionChips.scroll.d.ts.map +1 -1
  52. package/package.json +1 -1
  53. package/src/components/data-display/DataViews/data-views-category-pill.tsx +6 -1
  54. package/src/components/data-display/DataViews/data-views-more-fields.tsx +43 -37
  55. package/src/components/data-display/DataViews/data-views-overflow.ts +12 -1
  56. package/src/components/form/Autocomplete/useAutocomplete.ts +46 -16
  57. package/src/components/layout/SettingsLayout/SettingsSectionChips.scroll.ts +212 -28
  58. package/src/components/layout/SettingsLayout/SettingsSectionChips.tsx +24 -4
  59. package/dist/chunk-CKHFYTIX.js.map +0 -1
  60. package/dist/chunk-M4P7NS2L.js.map +0 -1
  61. package/dist/chunk-SLJAQA2X.js +0 -82
  62. package/dist/chunk-SLJAQA2X.js.map +0 -1
  63. package/dist/chunk-VWJEM2ER.js.map +0 -1
  64. package/dist/chunk-XVZG52CM.js.map +0 -1
  65. /package/dist/{chunk-Y2UXX5IQ.js.map → chunk-BKZERHNC.js.map} +0 -0
  66. /package/dist/{chunk-UGPRBJWB.js.map → chunk-DH77PLFF.js.map} +0 -0
  67. /package/dist/{chunk-EIII4QU4.js.map → chunk-HFVYWHJT.js.map} +0 -0
  68. /package/dist/{chunk-VEEG4UXZ.js.map → chunk-IUD6N52Q.js.map} +0 -0
  69. /package/dist/{chunk-RZ2VZ7SL.js.map → chunk-JMEPGXJG.js.map} +0 -0
  70. /package/dist/{chunk-J6KLT7HP.js.map → chunk-MEBQKYH4.js.map} +0 -0
  71. /package/dist/{chunk-TCNTIGMY.js.map → chunk-TDXEO2UI.js.map} +0 -0
  72. /package/dist/{chunk-FTQBVZ7V.js.map → chunk-TJ3334AJ.js.map} +0 -0
  73. /package/dist/{chunk-VOJBLBXE.js.map → chunk-UT73NGRS.js.map} +0 -0
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  import {
3
3
  DataViewsGrid
4
- } from "../../../../chunk-VOJBLBXE.js";
5
- import "../../../../chunk-EIII4QU4.js";
6
- import "../../../../chunk-Y2UXX5IQ.js";
4
+ } from "../../../../chunk-UT73NGRS.js";
5
+ import "../../../../chunk-HFVYWHJT.js";
6
+ import "../../../../chunk-BKZERHNC.js";
7
7
  import "../../../../chunk-3UEZ6NUI.js";
8
- import "../../../../chunk-UGPRBJWB.js";
8
+ import "../../../../chunk-DH77PLFF.js";
9
9
  import "../../../../chunk-BM4KKGL7.js";
10
- import "../../../../chunk-VWJEM2ER.js";
11
10
  import "../../../../chunk-KW3H5FUS.js";
12
11
  import "../../../../chunk-LODMNSLR.js";
13
12
  import "../../../../chunk-4XHVGUOM.js";
14
13
  import "../../../../chunk-BA6Z52QN.js";
15
- import "../../../../chunk-ODW2D5PN.js";
14
+ import "../../../../chunk-6QYKZMEE.js";
16
15
  import "../../../../chunk-DNT5PZLF.js";
17
- import "../../../../chunk-FTQBVZ7V.js";
18
- import "../../../../chunk-XVZG52CM.js";
16
+ import "../../../../chunk-TJ3334AJ.js";
17
+ import "../../../../chunk-NOLSQK4J.js";
18
+ import "../../../../chunk-NPPJ3IJP.js";
19
19
  import "../../../../chunk-4UVFPORR.js";
20
20
  import "../../../../chunk-6N2EDWMG.js";
21
21
  import "../../../../chunk-O5UGAL2V.js";
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  import {
3
3
  DataViewsTableBase
4
- } from "../../../../chunk-J6KLT7HP.js";
5
- import "../../../../chunk-VOJBLBXE.js";
4
+ } from "../../../../chunk-MEBQKYH4.js";
5
+ import "../../../../chunk-UT73NGRS.js";
6
6
  import "../../../../chunk-DH5UJD2I.js";
7
7
  import "../../../../chunk-ZOLAYP2D.js";
8
- import "../../../../chunk-EIII4QU4.js";
9
- import "../../../../chunk-Y2UXX5IQ.js";
8
+ import "../../../../chunk-HFVYWHJT.js";
9
+ import "../../../../chunk-BKZERHNC.js";
10
10
  import "../../../../chunk-3UEZ6NUI.js";
11
- import "../../../../chunk-UGPRBJWB.js";
11
+ import "../../../../chunk-DH77PLFF.js";
12
12
  import "../../../../chunk-BM4KKGL7.js";
13
- import "../../../../chunk-VWJEM2ER.js";
14
13
  import "../../../../chunk-KW3H5FUS.js";
15
14
  import "../../../../chunk-LODMNSLR.js";
16
15
  import "../../../../chunk-4XHVGUOM.js";
17
16
  import "../../../../chunk-BA6Z52QN.js";
18
- import "../../../../chunk-ODW2D5PN.js";
17
+ import "../../../../chunk-6QYKZMEE.js";
19
18
  import "../../../../chunk-DNT5PZLF.js";
20
- import "../../../../chunk-FTQBVZ7V.js";
21
- import "../../../../chunk-XVZG52CM.js";
19
+ import "../../../../chunk-TJ3334AJ.js";
20
+ import "../../../../chunk-NOLSQK4J.js";
21
+ import "../../../../chunk-NPPJ3IJP.js";
22
22
  import "../../../../chunk-4UVFPORR.js";
23
23
  import "../../../../chunk-6N2EDWMG.js";
24
24
  import "../../../../chunk-O5UGAL2V.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  PillControl,
4
4
  emitPillDiff
5
- } from "../../../../chunk-VWJEM2ER.js";
5
+ } from "../../../../chunk-NPPJ3IJP.js";
6
6
  import "../../../../chunk-KHG57NAE.js";
7
7
  import "../../../../chunk-MOLQGQEQ.js";
8
8
  import "../../../../chunk-SNBAMWI5.js";
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  FilterDialog,
4
4
  GridFilterPanel
5
- } from "../../../../chunk-Y2UXX5IQ.js";
6
- import "../../../../chunk-VWJEM2ER.js";
5
+ } from "../../../../chunk-BKZERHNC.js";
6
+ import "../../../../chunk-NPPJ3IJP.js";
7
7
  import "../../../../chunk-44USLRMT.js";
8
8
  import "../../../../chunk-7D7CJRL7.js";
9
9
  import "../../../../chunk-YRUX7XMQ.js";
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import {
3
3
  GridShell
4
- } from "../../../../chunk-EIII4QU4.js";
5
- import "../../../../chunk-Y2UXX5IQ.js";
4
+ } from "../../../../chunk-HFVYWHJT.js";
5
+ import "../../../../chunk-BKZERHNC.js";
6
6
  import "../../../../chunk-3UEZ6NUI.js";
7
- import "../../../../chunk-UGPRBJWB.js";
7
+ import "../../../../chunk-DH77PLFF.js";
8
8
  import "../../../../chunk-BM4KKGL7.js";
9
- import "../../../../chunk-VWJEM2ER.js";
10
9
  import "../../../../chunk-KW3H5FUS.js";
11
10
  import "../../../../chunk-LODMNSLR.js";
12
11
  import "../../../../chunk-4XHVGUOM.js";
13
12
  import "../../../../chunk-BA6Z52QN.js";
14
- import "../../../../chunk-ODW2D5PN.js";
13
+ import "../../../../chunk-6QYKZMEE.js";
15
14
  import "../../../../chunk-DNT5PZLF.js";
16
- import "../../../../chunk-FTQBVZ7V.js";
17
- import "../../../../chunk-XVZG52CM.js";
15
+ import "../../../../chunk-TJ3334AJ.js";
16
+ import "../../../../chunk-NOLSQK4J.js";
17
+ import "../../../../chunk-NPPJ3IJP.js";
18
18
  import "../../../../chunk-4UVFPORR.js";
19
19
  import "../../../../chunk-6N2EDWMG.js";
20
20
  import "../../../../chunk-O5UGAL2V.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  InlineFilterControls
4
- } from "../../../../chunk-UGPRBJWB.js";
4
+ } from "../../../../chunk-DH77PLFF.js";
5
5
  import "../../../../chunk-BM4KKGL7.js";
6
- import "../../../../chunk-VWJEM2ER.js";
7
- import "../../../../chunk-FTQBVZ7V.js";
8
- import "../../../../chunk-XVZG52CM.js";
6
+ import "../../../../chunk-TJ3334AJ.js";
7
+ import "../../../../chunk-NOLSQK4J.js";
8
+ import "../../../../chunk-NPPJ3IJP.js";
9
9
  import "../../../../chunk-4UVFPORR.js";
10
10
  import "../../../../chunk-44USLRMT.js";
11
11
  import "../../../../chunk-7D7CJRL7.js";
@@ -2,7 +2,8 @@
2
2
  import {
3
3
  MoreGroup,
4
4
  fieldClearing
5
- } from "../../../../chunk-XVZG52CM.js";
5
+ } from "../../../../chunk-NOLSQK4J.js";
6
+ import "../../../../chunk-NPPJ3IJP.js";
6
7
  import "../../../../chunk-44USLRMT.js";
7
8
  import "../../../../chunk-7D7CJRL7.js";
8
9
  import "../../../../chunk-YRUX7XMQ.js";
@@ -22,6 +23,25 @@ import "../../../../chunk-GE2CCITY.js";
22
23
  import "../../../../chunk-3XS37SQT.js";
23
24
  import "../../../../chunk-2LKWJV65.js";
24
25
  import "../../../../chunk-FDMQ7H22.js";
26
+ import "../../../../chunk-N5ZWC6CB.js";
27
+ import "../../../../chunk-ALOUJ3CE.js";
28
+ import "../../../../chunk-GPHURU2K.js";
29
+ import "../../../../chunk-S4IXC2V3.js";
30
+ import "../../../../chunk-7KKMZJFT.js";
31
+ import "../../../../chunk-NCB4GBRL.js";
32
+ import "../../../../chunk-PGGYZU7Q.js";
33
+ import "../../../../chunk-QYY37ECA.js";
34
+ import "../../../../chunk-TPVSHO75.js";
35
+ import "../../../../chunk-CMFJQH6A.js";
36
+ import "../../../../chunk-DMNZD3Q7.js";
37
+ import "../../../../chunk-Z6T5SXST.js";
38
+ import "../../../../chunk-RZVUY2MO.js";
39
+ import "../../../../chunk-USJPZ5Q7.js";
40
+ import "../../../../chunk-XHHR6G35.js";
41
+ import "../../../../chunk-R2AZOWEZ.js";
42
+ import "../../../../chunk-PN4HVM43.js";
43
+ import "../../../../chunk-C3UKR3NT.js";
44
+ import "../../../../chunk-D6KL74KI.js";
25
45
  import "../../../../chunk-6DPAWXZ3.js";
26
46
  import "../../../../chunk-VUHLNYAE.js";
27
47
  import "../../../../chunk-MKLIMY3D.js";
@@ -38,8 +58,11 @@ import "../../../../chunk-AG66JBNH.js";
38
58
  import "../../../../chunk-FZXKH2ZT.js";
39
59
  import "../../../../chunk-26X4CZVR.js";
40
60
  import "../../../../chunk-O6MJWHU5.js";
61
+ import "../../../../chunk-FQ6UW7IY.js";
41
62
  import "../../../../chunk-6JAIFIPW.js";
63
+ import "../../../../chunk-N3GAFIXG.js";
42
64
  import "../../../../chunk-YKCAJ2TN.js";
65
+ import "../../../../chunk-MFU4Y25U.js";
43
66
  import "../../../../chunk-PZ5AY32C.js";
44
67
  export {
45
68
  MoreGroup,
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  MoreFilters
4
- } from "../../../../chunk-FTQBVZ7V.js";
5
- import "../../../../chunk-XVZG52CM.js";
4
+ } from "../../../../chunk-TJ3334AJ.js";
5
+ import "../../../../chunk-NOLSQK4J.js";
6
+ import "../../../../chunk-NPPJ3IJP.js";
6
7
  import "../../../../chunk-44USLRMT.js";
7
8
  import "../../../../chunk-7D7CJRL7.js";
8
9
  import "../../../../chunk-YRUX7XMQ.js";
@@ -22,6 +23,25 @@ import "../../../../chunk-GE2CCITY.js";
22
23
  import "../../../../chunk-3XS37SQT.js";
23
24
  import "../../../../chunk-2LKWJV65.js";
24
25
  import "../../../../chunk-FDMQ7H22.js";
26
+ import "../../../../chunk-N5ZWC6CB.js";
27
+ import "../../../../chunk-ALOUJ3CE.js";
28
+ import "../../../../chunk-GPHURU2K.js";
29
+ import "../../../../chunk-S4IXC2V3.js";
30
+ import "../../../../chunk-7KKMZJFT.js";
31
+ import "../../../../chunk-NCB4GBRL.js";
32
+ import "../../../../chunk-PGGYZU7Q.js";
33
+ import "../../../../chunk-QYY37ECA.js";
34
+ import "../../../../chunk-TPVSHO75.js";
35
+ import "../../../../chunk-CMFJQH6A.js";
36
+ import "../../../../chunk-DMNZD3Q7.js";
37
+ import "../../../../chunk-Z6T5SXST.js";
38
+ import "../../../../chunk-RZVUY2MO.js";
39
+ import "../../../../chunk-USJPZ5Q7.js";
40
+ import "../../../../chunk-XHHR6G35.js";
41
+ import "../../../../chunk-R2AZOWEZ.js";
42
+ import "../../../../chunk-PN4HVM43.js";
43
+ import "../../../../chunk-C3UKR3NT.js";
44
+ import "../../../../chunk-D6KL74KI.js";
25
45
  import "../../../../chunk-6DPAWXZ3.js";
26
46
  import "../../../../chunk-VUHLNYAE.js";
27
47
  import "../../../../chunk-BA4RHQ3B.js";
@@ -47,6 +67,7 @@ import "../../../../chunk-FQ6UW7IY.js";
47
67
  import "../../../../chunk-6JAIFIPW.js";
48
68
  import "../../../../chunk-N3GAFIXG.js";
49
69
  import "../../../../chunk-YKCAJ2TN.js";
70
+ import "../../../../chunk-MFU4Y25U.js";
50
71
  import "../../../../chunk-PZ5AY32C.js";
51
72
  export {
52
73
  MoreFilters
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  toOverflowFields,
4
4
  useFilterOverflow
5
- } from "../../../../chunk-ODW2D5PN.js";
5
+ } from "../../../../chunk-6QYKZMEE.js";
6
6
  import "../../../../chunk-DNT5PZLF.js";
7
7
  import "../../../../chunk-NCS2TBIP.js";
8
8
  import "../../../../chunk-Y4KKS6WL.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Autocomplete,
3
3
  Autocomplete_default
4
- } from "../../../../chunk-VEEG4UXZ.js";
5
- import "../../../../chunk-M4P7NS2L.js";
4
+ } from "../../../../chunk-IUD6N52Q.js";
5
+ import "../../../../chunk-BR2T72JI.js";
6
6
  import "../../../../chunk-PELRSZFU.js";
7
7
  import "../../../../chunk-XBLFK2FL.js";
8
8
  import "../../../../chunk-JXS56EW5.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useAutocomplete
3
- } from "../../../../chunk-M4P7NS2L.js";
3
+ } from "../../../../chunk-BR2T72JI.js";
4
4
  import "../../../../chunk-PELRSZFU.js";
5
5
  import "../../../../chunk-JXS56EW5.js";
6
6
  import "../../../../chunk-PZ5AY32C.js";
@@ -146,8 +146,8 @@ import "../../../chunk-JE5GEWTG.js";
146
146
  import "../../../chunk-2LXHUGYB.js";
147
147
  import {
148
148
  Autocomplete
149
- } from "../../../chunk-VEEG4UXZ.js";
150
- import "../../../chunk-M4P7NS2L.js";
149
+ } from "../../../chunk-IUD6N52Q.js";
150
+ import "../../../chunk-BR2T72JI.js";
151
151
  import "../../../chunk-PELRSZFU.js";
152
152
  import "../../../chunk-XBLFK2FL.js";
153
153
  import "../../../chunk-JXS56EW5.js";
@@ -373,8 +373,8 @@ import "../../chunk-JE5GEWTG.js";
373
373
  import "../../chunk-2LXHUGYB.js";
374
374
  import {
375
375
  Autocomplete
376
- } from "../../chunk-VEEG4UXZ.js";
377
- import "../../chunk-M4P7NS2L.js";
376
+ } from "../../chunk-IUD6N52Q.js";
377
+ import "../../chunk-BR2T72JI.js";
378
378
  import "../../chunk-PELRSZFU.js";
379
379
  import "../../chunk-XBLFK2FL.js";
380
380
  import "../../chunk-JXS56EW5.js";
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  SettingsLayout
4
- } from "../../../../chunk-RZ2VZ7SL.js";
4
+ } from "../../../../chunk-JMEPGXJG.js";
5
5
  import "../../../../chunk-TNYKM4UU.js";
6
6
  import "../../../../chunk-V5EWCJBT.js";
7
7
  import "../../../../chunk-BXC6GRLE.js";
8
- import "../../../../chunk-TCNTIGMY.js";
8
+ import "../../../../chunk-TDXEO2UI.js";
9
9
  import "../../../../chunk-6KEXHOIF.js";
10
- import "../../../../chunk-CKHFYTIX.js";
10
+ import "../../../../chunk-TBMGYQJF.js";
11
11
  import "../../../../chunk-DBFRCTI5.js";
12
12
  import "../../../../chunk-NYFNF7I5.js";
13
- import "../../../../chunk-SLJAQA2X.js";
13
+ import "../../../../chunk-GT2RCOHM.js";
14
14
  import "../../../../chunk-HPK33ACY.js";
15
15
  import "../../../../chunk-YKCAJ2TN.js";
16
16
  import "../../../../chunk-PZ5AY32C.js";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  SettingsPanel
4
- } from "../../../../chunk-TCNTIGMY.js";
4
+ } from "../../../../chunk-TDXEO2UI.js";
5
5
  import "../../../../chunk-6KEXHOIF.js";
6
- import "../../../../chunk-CKHFYTIX.js";
6
+ import "../../../../chunk-TBMGYQJF.js";
7
7
  import "../../../../chunk-DBFRCTI5.js";
8
8
  import "../../../../chunk-NYFNF7I5.js";
9
- import "../../../../chunk-SLJAQA2X.js";
9
+ import "../../../../chunk-GT2RCOHM.js";
10
10
  import "../../../../chunk-YKCAJ2TN.js";
11
11
  import "../../../../chunk-PZ5AY32C.js";
12
12
  export {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  SettingsSectionChips
4
- } from "../../../../chunk-CKHFYTIX.js";
4
+ } from "../../../../chunk-TBMGYQJF.js";
5
5
  import "../../../../chunk-DBFRCTI5.js";
6
6
  import "../../../../chunk-NYFNF7I5.js";
7
- import "../../../../chunk-SLJAQA2X.js";
7
+ import "../../../../chunk-GT2RCOHM.js";
8
8
  import "../../../../chunk-YKCAJ2TN.js";
9
9
  import "../../../../chunk-PZ5AY32C.js";
10
10
  export {
@@ -1,8 +1,14 @@
1
1
  import {
2
+ isRtlStrip,
3
+ physicalScrollLeft,
4
+ toRawScrollLeft,
2
5
  watchVisitorScroll
3
- } from "../../../../chunk-SLJAQA2X.js";
6
+ } from "../../../../chunk-GT2RCOHM.js";
4
7
  import "../../../../chunk-PZ5AY32C.js";
5
8
  export {
9
+ isRtlStrip,
10
+ physicalScrollLeft,
11
+ toRawScrollLeft,
6
12
  watchVisitorScroll
7
13
  };
8
14
  //# sourceMappingURL=SettingsSectionChips.scroll.js.map
@@ -104,11 +104,14 @@ function useFilterOverflow(all, pills, ranges, frozen = false, hasExport = true)
104
104
  if (cache.current === null || !frozen && cache.current.signature !== signature) {
105
105
  cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };
106
106
  }
107
- return { ...cache.current.split, barRef };
107
+ const { split } = cache.current;
108
+ const current = new Map(all.map((field) => [field.id, field]));
109
+ const fresh = (fields) => fields.map((field) => current.get(field.id) ?? field);
110
+ return { ...split, inline: fresh(split.inline), overflow: fresh(split.overflow), barRef };
108
111
  }
109
112
 
110
113
  export {
111
114
  toOverflowFields,
112
115
  useFilterOverflow
113
116
  };
114
- //# sourceMappingURL=chunk-ODW2D5PN.js.map
117
+ //# sourceMappingURL=chunk-6QYKZMEE.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/data-display/DataViews/data-views-overflow.ts"],"sourcesContent":["\"use client\";\n\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport { useRef } from \"react\";\n\nimport { remPx } from \"../../../tokens/relative\";\nimport { splitToFit, useMeasuredWidth } from \"../../utility/Overflow\";\nimport {\n estimateWidth,\n furnitureCost,\n isRangeSet,\n pillText,\n pricesFor,\n RESERVED,\n rightClusterCost,\n type Prices,\n} from \"./data-views-overflow-costs\";\nimport type { FilterFieldConfig, RangeFieldConfig, RangeValue } from \"./data-views-types\";\n\n/**\n * PROGRESSIVE COLLAPSE — which filter controls fit on the toolbar, measured.\n *\n * Two rules, and both come from watching the all-or-nothing version fail:\n *\n * 1. Controls shed ONE AT A TIME into an overflow, never all at once. With four\n * filters and room for three, hiding all four throws away the room that was\n * there.\n * 2. An APPLIED filter is ranked first, not exempt. Applied controls take the\n * visible slots ahead of idle ones, and go into \"Mais\" like anything else\n * when even those slots run out. Exempting them outright — the earlier rule\n * — meant four applied filters on a phone claimed more width than the row\n * had, and the bar painted past its own edge: the pills were reachable only\n * by scrolling the toolbar sideways. Hiding one is safe because \"Mais\" says\n * how many applied filters are behind it; scrolling one off-screen says\n * nothing at all.\n *\n * It MEASURES rather than picking a breakpoint, which is what\n * `FILTERS-CONTRACT.md` asks for: pages declare different numbers of filters\n * with different label lengths, and the same page collapses at a different\n * width in another language. A shared breakpoint is wrong for at least one\n * table by construction.\n *\n * Collapsing is presentation only — nothing here emits a query, drops a filter\n * or changes a rendered row.\n */\n\n/** A filter control on the bar: a multi-select pill or a min/max range. */\nexport interface OverflowField<T extends Record<string, unknown>> {\n id: string;\n label: string;\n /** Which control it is — the caller renders the right one. */\n group: \"pill\" | \"range\";\n pill?: FilterFieldConfig<T>;\n range?: RangeFieldConfig<T>;\n}\n\n/** What the caller renders inline, and what goes behind \"Mais\". */\nexport interface OverflowSplit<T extends Record<string, unknown>> {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /**\n * Step 2 — Exibir/Exportar drop their text labels and become icons.\n * Cheap: both keep their icon, their tooltip and their position.\n */\n compactControls: boolean;\n /**\n * Step 5, and the LAST resort — the \"N de N\" counter is dropped.\n *\n * Only once every control has already collapsed and the row STILL does not\n * fit, which on a six-filter table is below about 400px. The counter goes\n * last because it is the only thing left that reports rather than does: an\n * operator can act without knowing the total, but not without the search.\n */\n counterHidden: boolean;\n /**\n * Step 4 — the search collapses to a magnifier that expands on click.\n * The most expensive step, so it is taken last: the search is the one\n * control on the bar that cannot be guessed from an icon's position.\n */\n searchCollapsed: boolean;\n /**\n * Step 6, below even the counter — \"Limpar\" leaves the bar.\n *\n * The one control here with a second home: the overflow panel's footer\n * carries \"Limpar todos os filtros\". So it goes before the search icon or\n * \"Mais\", neither of which has anywhere else to be.\n */\n clearAllHidden: boolean;\n /**\n * Expanding the magnifier must take the whole cluster, filters and all.\n *\n * Only on the rungs where what is left over would be too narrow to read —\n * on a large phone the box simply shrinks and the filters stay, which is why\n * this is its own answer rather than `searchCollapsed` reused.\n */\n searchTakeover: boolean;\n /** Attach to the toolbar row being measured. */\n barRef: React.RefObject<HTMLDivElement | null>;\n}\n\n/** Every declared control, pills first, in the order the bar renders them. */\nexport function toOverflowFields<T extends Record<string, unknown>>(\n fields: FilterFieldConfig<T>[],\n rangeFields: RangeFieldConfig<T>[],\n): OverflowField<T>[] {\n return [\n ...fields.map((pill) => ({ id: pill.id, label: pill.label, group: \"pill\" as const, pill })),\n ...rangeFields.map((range) => ({ id: range.id, label: range.label, group: \"range\" as const, range })),\n ];\n}\n\n\n/** Is this control carrying a value the operator set? */\nfunction isActiveField<T extends Record<string, unknown>>(\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): boolean {\n return field.group === \"pill\"\n ? (pills[field.id]?.length ?? 0) > 0\n : isRangeSet(ranges[field.id]);\n}\n\n/** Estimated rendered width of one control at its CURRENT value, in px at `theme`'s scale. */\nfunction fieldWidth<T extends Record<string, unknown>>(\n theme: Theme,\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): number {\n if (field.group === \"pill\") return estimateWidth(theme, pillText(field, pills[field.id] ?? []), 0);\n // A bounded range renders two number inputs (100 design px) beside its label.\n return estimateWidth(theme, field.label, isRangeSet(ranges[field.id]) ? 100 : 0);\n}\n\n/** What one split costs on the bar, so the ladder below can price the next step. */\ntype Split<T extends Record<string, unknown>> = {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /** Width the surviving inline controls occupy, incl. the \"Mais\" button. */\n used: number;\n};\n\n/** Step 1 — shed filter controls into the overflow. Pure. */\nfunction splitFilters<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Search + counter + right cluster + chrome, at the rung being considered. */\n furniture: number,\n /** Is the bar already down to icons? \"Mais\" shrinks with everything else. */\n compact: boolean,\n /** Whose type scale every price is read at — the bar's own. */\n theme: Theme,\n): Split<T> {\n const active = all.filter((field) => isActiveField(field, pills, ranges));\n const idle = all.filter((field) => !isActiveField(field, pills, ranges));\n const price = pricesFor(theme);\n const gap = remPx(theme, RESERVED.betweenControls);\n\n // \"Limpar\" rides the end of the cluster whenever anything is applied.\n const clearCost = active.length > 0 ? price.clearAll + gap : 0;\n // APPLIED FIRST, BUT NOT EXEMPT.\n //\n // Applied controls take the visible slots ahead of idle ones — that part was\n // always right. Exempting them from the overflow entirely was not: applying\n // a value LENGTHENS a control (\"Pagamento (1)\"), so on a phone four applied\n // filters claimed more width than the row had and the bar simply painted\n // past its own edge, leaving pills reachable only by scrolling sideways.\n //\n // An applied filter hidden in \"Mais\" is not lost the way it would be if it\n // vanished silently: the trigger goes to the applied tone and says how many\n // are in there (see `MoreTrigger`), which is the same signal the pill itself\n // was carrying. A control you scroll off-screen carries no signal at all.\n //\n // The keep-what-fits loop itself is `splitToFit` (`utility/Overflow`) — the\n // one part of this that is not filter-shaped, and the part a second cluster\n // in the design system would otherwise have had to reimplement.\n const split = splitToFit(all, {\n widthOf: (field) => fieldWidth(theme, field, pills, ranges),\n keyOf: (field) => field.id,\n gap,\n available: width - furniture - clearCost,\n // The overflow button at the width it will actually have, which on a phone\n // is the icon-and-badge one.\n overflowCost: compact ? price.overflowButtonCompact : price.overflowButton,\n priority: [...active, ...idle],\n });\n return { ...split, used: split.used + clearCost };\n}\n\n/**\n * THE DEGRADATION LADDER — cheapest loss first, and each rung taken only if\n * the one before it did not free enough:\n *\n * 1. filter controls move into the \"Mais\" overflow (`splitFilters`)\n * 2. Exibir / Exportar drop their text labels (`compactControls`)\n * 3. the search shrinks toward its minimum (CSS: it is `flex: 1`)\n * 4. the search itself collapses to an icon (`searchCollapsed`)\n *\n * Step 3 needs no flag — the search is a flex child, so it gives up width on\n * its own until it hits `RESERVED.search`. The flags mark the two steps that\n * change what is RENDERED rather than how wide it is.\n *\n * Measured against what is CURRENTLY on the bar, never a breakpoint: a\n * two-filter page and a five-filter page would otherwise collapse at the same\n * width, and only one of them would be right.\n */\nfunction computeSplit<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Does the host render \"Exportar\" beside \"Exibir\"? Half the cluster if not. */\n hasExport: boolean,\n theme: Theme,\n): Omit<OverflowSplit<T>, \"barRef\"> {\n // Unmeasured (SSR, or jsdom without a ResizeObserver) ⇒ degrade nothing.\n if (width === 0) {\n return {\n inline: all,\n overflow: [],\n compactControls: false,\n counterHidden: false,\n searchCollapsed: false,\n clearAllHidden: false,\n searchTakeover: false,\n };\n }\n const price = pricesFor(theme);\n // Pass 1 prices the furniture at its widest — no rung has been taken yet.\n let budget = furnitureCost(price, UNCOLLAPSED, hasExport);\n let split = splitFilters(all, pills, ranges, width, budget, false, theme);\n let flags = ladderFlags(split, width, hasExport, price);\n // RE-SPEND WHAT THE LATER RUNGS FREED.\n //\n // Rungs 2/4/5 turn 200 + 96 + 216 of furniture into 44 + 0 + 140, and until\n // this loop existed nobody handed those ~330px back to the filters: the\n // split was decided once, against the uncollapsed row, so a phone shed every\n // control and then sat with a band of empty bar beside \"Mais 5\".\n //\n // Settles rather than oscillates, and cannot overfill: a cheaper furniture\n // can only give the filters MORE room, more filter width can only push the\n // ladder FURTHER down, and a further rung can only make the furniture\n // cheaper again — so the budget decreases monotonically and the loop exits\n // the moment it stops moving. The bound is a backstop, not the exit.\n for (let pass = 0; pass < 3; pass += 1) {\n const freed = furnitureCost(price, flags, hasExport);\n if (freed >= budget) break;\n budget = freed;\n split = splitFilters(all, pills, ranges, width, budget, flags.compactControls, theme);\n flags = ladderFlags(split, width, hasExport, price);\n }\n return { inline: split.inline, overflow: split.overflow, ...flags };\n}\n\n/** The widest the furniture ever is — every rung still untaken. */\nconst UNCOLLAPSED = { searchCollapsed: false, counterHidden: false, compactControls: false };\n\n/** Rungs 2 and 4-6, priced against what the filters actually took. */\nfunction ladderFlags<T extends Record<string, unknown>>(\n split: Split<T>,\n width: number,\n hasExport: boolean,\n price: Prices,\n): Omit<OverflowSplit<T>, \"barRef\" | \"inline\" | \"overflow\"> {\n const { overflow, used } = split;\n const base = width - used - price.chrome;\n\n // Would the search still make its minimum with the labels on?\n const compactControls = base - price.counter - rightClusterCost(price, hasExport, false) < price.search;\n const rightCost = rightClusterCost(price, hasExport, compactControls);\n // …and with them off?\n const searchCollapsed = base - price.counter - rightCost < price.search;\n // Everything has collapsed and the row STILL overflows. The controls cannot\n // shrink further — they are `flexShrink: 0` precisely so an over-packed row\n // sheds rather than squeezes — so without this last rung they simply paint\n // outside the toolbar, which is what a narrow phone was doing.\n const counterHidden =\n searchCollapsed && base - price.counter - rightCost < price.searchIcon;\n // Step 6 — below even that, \"Limpar\" leaves the bar. It is the ONLY control\n // here with a second home: the overflow panel's footer carries \"Limpar todos\n // os filtros\", so nothing is lost, which is exactly why it goes before the\n // search icon or \"Mais\" (neither of which has anywhere else to be). Guarded\n // on there BEING an overflow, because with no panel the footer does not\n // exist and dropping this would strand the operator.\n const clearAllHidden = counterHidden && overflow.length > 0;\n // What the keyword box would get if the operator expanded the magnifier.\n // `searchCollapsed` is a different question — it asks whether the box fits at\n // its PREFERRED 200px, and is deliberately pessimistic — so reusing it to\n // decide the takeover evicted the filters on screens where the box had plenty\n // of room to simply shrink.\n //\n // Asked with the inline filters SHED, because shedding them is exactly what\n // expanding the box does: the row re-splits and they go behind \"Mais\".\n // Measuring against the resting row instead made a filter argue for its own\n // eviction — now that a large phone keeps one, its width came out of `base`,\n // pushed the box under `usableSearch`, and tipped a row that had ample space\n // to share into a full takeover.\n const overflowButton = compactControls\n ? price.overflowButtonCompact\n : price.overflowButton;\n const shedRoom = width - price.chrome - (overflow.length > 0 ? overflowButton : 0);\n const searchBoxRoom = shedRoom - (counterHidden ? 0 : price.counter) - rightCost;\n // Below this a box is too narrow to read what you typed into it, and shrinking\n // further buys nothing; that is the only point at which taking the whole\n // cluster is worth losing the filters.\n const searchTakeover = searchCollapsed && searchBoxRoom < price.usableSearch;\n\n return { compactControls, counterHidden, searchCollapsed, clearAllHidden, searchTakeover };\n}\n\n/**\n * Split the declared filter controls into what fits and what goes behind\n * \"Mais\", measured against the live toolbar width.\n *\n * Cached on a SIGNATURE rather than by `useMemo` over the inputs: hosts declare\n * their fields inline, so `all` is a fresh array on every render while the\n * configuration is unchanged, and a reference-keyed memo would never hit.\n */\nexport function useFilterOverflow<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n /**\n * A filter control is open — hold the current answer until it closes.\n *\n * Applying a filter changes that control's LABEL (\"Valor\" becomes \"Valor: ≥\n * R$ 1\"), which changes its measured width, which re-runs the whole split\n * while its popover is open on top of it. Measured: setting a minimum moved\n * the trigger 192px left, took the popover with it, and pushed two other\n * controls into a newly-appeared \"Mais 2\" — so reaching for the second bound\n * meant chasing the control across the row. Nobody sets a range that way.\n *\n * Frozen only for the duration: closing re-measures against the new labels,\n * so the row still ends up correct, it just does not rearrange under a hand\n * that is mid-edit.\n */\n frozen = false,\n /** Whether \"Exportar\" is on the bar — see `rightClusterCost`. */\n hasExport = true,\n): OverflowSplit<T> {\n // The measurement is `useMeasuredWidth` (`utility/Overflow`): the same\n // ResizeObserver every collapsing cluster in the design system reads, so\n // there is one loop to get right rather than one per bar. `0` until the\n // first measurement lands (and forever under SSR or jsdom), which\n // `computeSplit` reads as \"degrade nothing\".\n const { ref: barRef, width } = useMeasuredWidth<HTMLDivElement>();\n // The prices follow the theme's type scale, so the answer does too.\n const theme = useTheme();\n const signature = JSON.stringify({\n ids: all.map((field) => field.id),\n pills,\n ranges,\n width,\n hasExport,\n scale: remPx(theme, 1),\n });\n const cache = useRef<{ signature: string; split: ReturnType<typeof computeSplit<T>> } | null>(null);\n if (cache.current === null || (!frozen && cache.current.signature !== signature)) {\n cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };\n }\n return { ...cache.current.split, barRef };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,SAAS,gBAA4B;AACrC,SAAS,cAAc;AAkGhB,SAAS,iBACd,QACA,aACoB;AACpB,SAAO;AAAA,IACL,GAAG,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,OAAO,KAAK,OAAO,OAAO,QAAiB,KAAK,EAAE;AAAA,IAC1F,GAAG,YAAY,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,IAAI,OAAO,MAAM,OAAO,OAAO,SAAkB,MAAM,EAAE;AAAA,EACtG;AACF;AAIA,SAAS,cACP,OACA,OACA,QACS;AACT,SAAO,MAAM,UAAU,UAClB,MAAM,MAAM,EAAE,GAAG,UAAU,KAAK,IACjC,WAAW,OAAO,MAAM,EAAE,CAAC;AACjC;AAGA,SAAS,WACP,OACA,OACA,OACA,QACQ;AACR,MAAI,MAAM,UAAU,OAAQ,QAAO,cAAc,OAAO,SAAS,OAAO,MAAM,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC;AAEjG,SAAO,cAAc,OAAO,MAAM,OAAO,WAAW,OAAO,M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AA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM,OAAO,CAAC;AAAA,EACvB,CAAC;AACD,QAAM,QAAQ,OAAgF,IAAI;AAClG,MAAI,MAAM,YAAY,QAAS,CAAC,UAAU,MAAM,QAAQ,cAAc,WAAY;AAChF,UAAM,UAAU,EAAE,WAAW,OAAO,aAAa,KAAK,OAAO,QAAQ,OAAO,WAAW,KAAK,EAAE;AAAA,EAChG;AACA,SAAO,EAAE,GAAG,MAAM,QAAQ,OAAO,OAAO;AAC1C;","names":[]}
1
+ {"version":3,"sources":["../src/components/data-display/DataViews/data-views-overflow.ts"],"sourcesContent":["\"use client\";\n\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport { useRef } from \"react\";\n\nimport { remPx } from \"../../../tokens/relative\";\nimport { splitToFit, useMeasuredWidth } from \"../../utility/Overflow\";\nimport {\n estimateWidth,\n furnitureCost,\n isRangeSet,\n pillText,\n pricesFor,\n RESERVED,\n rightClusterCost,\n type Prices,\n} from \"./data-views-overflow-costs\";\nimport type { FilterFieldConfig, RangeFieldConfig, RangeValue } from \"./data-views-types\";\n\n/**\n * PROGRESSIVE COLLAPSE — which filter controls fit on the toolbar, measured.\n *\n * Two rules, and both come from watching the all-or-nothing version fail:\n *\n * 1. Controls shed ONE AT A TIME into an overflow, never all at once. With four\n * filters and room for three, hiding all four throws away the room that was\n * there.\n * 2. An APPLIED filter is ranked first, not exempt. Applied controls take the\n * visible slots ahead of idle ones, and go into \"Mais\" like anything else\n * when even those slots run out. Exempting them outright — the earlier rule\n * — meant four applied filters on a phone claimed more width than the row\n * had, and the bar painted past its own edge: the pills were reachable only\n * by scrolling the toolbar sideways. Hiding one is safe because \"Mais\" says\n * how many applied filters are behind it; scrolling one off-screen says\n * nothing at all.\n *\n * It MEASURES rather than picking a breakpoint, which is what\n * `FILTERS-CONTRACT.md` asks for: pages declare different numbers of filters\n * with different label lengths, and the same page collapses at a different\n * width in another language. A shared breakpoint is wrong for at least one\n * table by construction.\n *\n * Collapsing is presentation only — nothing here emits a query, drops a filter\n * or changes a rendered row.\n */\n\n/** A filter control on the bar: a multi-select pill or a min/max range. */\nexport interface OverflowField<T extends Record<string, unknown>> {\n id: string;\n label: string;\n /** Which control it is — the caller renders the right one. */\n group: \"pill\" | \"range\";\n pill?: FilterFieldConfig<T>;\n range?: RangeFieldConfig<T>;\n}\n\n/** What the caller renders inline, and what goes behind \"Mais\". */\nexport interface OverflowSplit<T extends Record<string, unknown>> {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /**\n * Step 2 — Exibir/Exportar drop their text labels and become icons.\n * Cheap: both keep their icon, their tooltip and their position.\n */\n compactControls: boolean;\n /**\n * Step 5, and the LAST resort — the \"N de N\" counter is dropped.\n *\n * Only once every control has already collapsed and the row STILL does not\n * fit, which on a six-filter table is below about 400px. The counter goes\n * last because it is the only thing left that reports rather than does: an\n * operator can act without knowing the total, but not without the search.\n */\n counterHidden: boolean;\n /**\n * Step 4 — the search collapses to a magnifier that expands on click.\n * The most expensive step, so it is taken last: the search is the one\n * control on the bar that cannot be guessed from an icon's position.\n */\n searchCollapsed: boolean;\n /**\n * Step 6, below even the counter — \"Limpar\" leaves the bar.\n *\n * The one control here with a second home: the overflow panel's footer\n * carries \"Limpar todos os filtros\". So it goes before the search icon or\n * \"Mais\", neither of which has anywhere else to be.\n */\n clearAllHidden: boolean;\n /**\n * Expanding the magnifier must take the whole cluster, filters and all.\n *\n * Only on the rungs where what is left over would be too narrow to read —\n * on a large phone the box simply shrinks and the filters stay, which is why\n * this is its own answer rather than `searchCollapsed` reused.\n */\n searchTakeover: boolean;\n /** Attach to the toolbar row being measured. */\n barRef: React.RefObject<HTMLDivElement | null>;\n}\n\n/** Every declared control, pills first, in the order the bar renders them. */\nexport function toOverflowFields<T extends Record<string, unknown>>(\n fields: FilterFieldConfig<T>[],\n rangeFields: RangeFieldConfig<T>[],\n): OverflowField<T>[] {\n return [\n ...fields.map((pill) => ({ id: pill.id, label: pill.label, group: \"pill\" as const, pill })),\n ...rangeFields.map((range) => ({ id: range.id, label: range.label, group: \"range\" as const, range })),\n ];\n}\n\n\n/** Is this control carrying a value the operator set? */\nfunction isActiveField<T extends Record<string, unknown>>(\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): boolean {\n return field.group === \"pill\"\n ? (pills[field.id]?.length ?? 0) > 0\n : isRangeSet(ranges[field.id]);\n}\n\n/** Estimated rendered width of one control at its CURRENT value, in px at `theme`'s scale. */\nfunction fieldWidth<T extends Record<string, unknown>>(\n theme: Theme,\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): number {\n if (field.group === \"pill\") return estimateWidth(theme, pillText(field, pills[field.id] ?? []), 0);\n // A bounded range renders two number inputs (100 design px) beside its label.\n return estimateWidth(theme, field.label, isRangeSet(ranges[field.id]) ? 100 : 0);\n}\n\n/** What one split costs on the bar, so the ladder below can price the next step. */\ntype Split<T extends Record<string, unknown>> = {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /** Width the surviving inline controls occupy, incl. the \"Mais\" button. */\n used: number;\n};\n\n/** Step 1 — shed filter controls into the overflow. Pure. */\nfunction splitFilters<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Search + counter + right cluster + chrome, at the rung being considered. */\n furniture: number,\n /** Is the bar already down to icons? \"Mais\" shrinks with everything else. */\n compact: boolean,\n /** Whose type scale every price is read at — the bar's own. */\n theme: Theme,\n): Split<T> {\n const active = all.filter((field) => isActiveField(field, pills, ranges));\n const idle = all.filter((field) => !isActiveField(field, pills, ranges));\n const price = pricesFor(theme);\n const gap = remPx(theme, RESERVED.betweenControls);\n\n // \"Limpar\" rides the end of the cluster whenever anything is applied.\n const clearCost = active.length > 0 ? price.clearAll + gap : 0;\n // APPLIED FIRST, BUT NOT EXEMPT.\n //\n // Applied controls take the visible slots ahead of idle ones — that part was\n // always right. Exempting them from the overflow entirely was not: applying\n // a value LENGTHENS a control (\"Pagamento (1)\"), so on a phone four applied\n // filters claimed more width than the row had and the bar simply painted\n // past its own edge, leaving pills reachable only by scrolling sideways.\n //\n // An applied filter hidden in \"Mais\" is not lost the way it would be if it\n // vanished silently: the trigger goes to the applied tone and says how many\n // are in there (see `MoreTrigger`), which is the same signal the pill itself\n // was carrying. A control you scroll off-screen carries no signal at all.\n //\n // The keep-what-fits loop itself is `splitToFit` (`utility/Overflow`) — the\n // one part of this that is not filter-shaped, and the part a second cluster\n // in the design system would otherwise have had to reimplement.\n const split = splitToFit(all, {\n widthOf: (field) => fieldWidth(theme, field, pills, ranges),\n keyOf: (field) => field.id,\n gap,\n available: width - furniture - clearCost,\n // The overflow button at the width it will actually have, which on a phone\n // is the icon-and-badge one.\n overflowCost: compact ? price.overflowButtonCompact : price.overflowButton,\n priority: [...active, ...idle],\n });\n return { ...split, used: split.used + clearCost };\n}\n\n/**\n * THE DEGRADATION LADDER — cheapest loss first, and each rung taken only if\n * the one before it did not free enough:\n *\n * 1. filter controls move into the \"Mais\" overflow (`splitFilters`)\n * 2. Exibir / Exportar drop their text labels (`compactControls`)\n * 3. the search shrinks toward its minimum (CSS: it is `flex: 1`)\n * 4. the search itself collapses to an icon (`searchCollapsed`)\n *\n * Step 3 needs no flag — the search is a flex child, so it gives up width on\n * its own until it hits `RESERVED.search`. The flags mark the two steps that\n * change what is RENDERED rather than how wide it is.\n *\n * Measured against what is CURRENTLY on the bar, never a breakpoint: a\n * two-filter page and a five-filter page would otherwise collapse at the same\n * width, and only one of them would be right.\n */\nfunction computeSplit<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Does the host render \"Exportar\" beside \"Exibir\"? Half the cluster if not. */\n hasExport: boolean,\n theme: Theme,\n): Omit<OverflowSplit<T>, \"barRef\"> {\n // Unmeasured (SSR, or jsdom without a ResizeObserver) ⇒ degrade nothing.\n if (width === 0) {\n return {\n inline: all,\n overflow: [],\n compactControls: false,\n counterHidden: false,\n searchCollapsed: false,\n clearAllHidden: false,\n searchTakeover: false,\n };\n }\n const price = pricesFor(theme);\n // Pass 1 prices the furniture at its widest — no rung has been taken yet.\n let budget = furnitureCost(price, UNCOLLAPSED, hasExport);\n let split = splitFilters(all, pills, ranges, width, budget, false, theme);\n let flags = ladderFlags(split, width, hasExport, price);\n // RE-SPEND WHAT THE LATER RUNGS FREED.\n //\n // Rungs 2/4/5 turn 200 + 96 + 216 of furniture into 44 + 0 + 140, and until\n // this loop existed nobody handed those ~330px back to the filters: the\n // split was decided once, against the uncollapsed row, so a phone shed every\n // control and then sat with a band of empty bar beside \"Mais 5\".\n //\n // Settles rather than oscillates, and cannot overfill: a cheaper furniture\n // can only give the filters MORE room, more filter width can only push the\n // ladder FURTHER down, and a further rung can only make the furniture\n // cheaper again — so the budget decreases monotonically and the loop exits\n // the moment it stops moving. The bound is a backstop, not the exit.\n for (let pass = 0; pass < 3; pass += 1) {\n const freed = furnitureCost(price, flags, hasExport);\n if (freed >= budget) break;\n budget = freed;\n split = splitFilters(all, pills, ranges, width, budget, flags.compactControls, theme);\n flags = ladderFlags(split, width, hasExport, price);\n }\n return { inline: split.inline, overflow: split.overflow, ...flags };\n}\n\n/** The widest the furniture ever is — every rung still untaken. */\nconst UNCOLLAPSED = { searchCollapsed: false, counterHidden: false, compactControls: false };\n\n/** Rungs 2 and 4-6, priced against what the filters actually took. */\nfunction ladderFlags<T extends Record<string, unknown>>(\n split: Split<T>,\n width: number,\n hasExport: boolean,\n price: Prices,\n): Omit<OverflowSplit<T>, \"barRef\" | \"inline\" | \"overflow\"> {\n const { overflow, used } = split;\n const base = width - used - price.chrome;\n\n // Would the search still make its minimum with the labels on?\n const compactControls = base - price.counter - rightClusterCost(price, hasExport, false) < price.search;\n const rightCost = rightClusterCost(price, hasExport, compactControls);\n // …and with them off?\n const searchCollapsed = base - price.counter - rightCost < price.search;\n // Everything has collapsed and the row STILL overflows. The controls cannot\n // shrink further — they are `flexShrink: 0` precisely so an over-packed row\n // sheds rather than squeezes — so without this last rung they simply paint\n // outside the toolbar, which is what a narrow phone was doing.\n const counterHidden =\n searchCollapsed && base - price.counter - rightCost < price.searchIcon;\n // Step 6 — below even that, \"Limpar\" leaves the bar. It is the ONLY control\n // here with a second home: the overflow panel's footer carries \"Limpar todos\n // os filtros\", so nothing is lost, which is exactly why it goes before the\n // search icon or \"Mais\" (neither of which has anywhere else to be). Guarded\n // on there BEING an overflow, because with no panel the footer does not\n // exist and dropping this would strand the operator.\n const clearAllHidden = counterHidden && overflow.length > 0;\n // What the keyword box would get if the operator expanded the magnifier.\n // `searchCollapsed` is a different question — it asks whether the box fits at\n // its PREFERRED 200px, and is deliberately pessimistic — so reusing it to\n // decide the takeover evicted the filters on screens where the box had plenty\n // of room to simply shrink.\n //\n // Asked with the inline filters SHED, because shedding them is exactly what\n // expanding the box does: the row re-splits and they go behind \"Mais\".\n // Measuring against the resting row instead made a filter argue for its own\n // eviction — now that a large phone keeps one, its width came out of `base`,\n // pushed the box under `usableSearch`, and tipped a row that had ample space\n // to share into a full takeover.\n const overflowButton = compactControls\n ? price.overflowButtonCompact\n : price.overflowButton;\n const shedRoom = width - price.chrome - (overflow.length > 0 ? overflowButton : 0);\n const searchBoxRoom = shedRoom - (counterHidden ? 0 : price.counter) - rightCost;\n // Below this a box is too narrow to read what you typed into it, and shrinking\n // further buys nothing; that is the only point at which taking the whole\n // cluster is worth losing the filters.\n const searchTakeover = searchCollapsed && searchBoxRoom < price.usableSearch;\n\n return { compactControls, counterHidden, searchCollapsed, clearAllHidden, searchTakeover };\n}\n\n/**\n * Split the declared filter controls into what fits and what goes behind\n * \"Mais\", measured against the live toolbar width.\n *\n * Cached on a SIGNATURE rather than by `useMemo` over the inputs: hosts declare\n * their fields inline, so `all` is a fresh array on every render while the\n * configuration is unchanged, and a reference-keyed memo would never hit.\n */\nexport function useFilterOverflow<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n /**\n * A filter control is open — hold the current answer until it closes.\n *\n * Applying a filter changes that control's LABEL (\"Valor\" becomes \"Valor: ≥\n * R$ 1\"), which changes its measured width, which re-runs the whole split\n * while its popover is open on top of it. Measured: setting a minimum moved\n * the trigger 192px left, took the popover with it, and pushed two other\n * controls into a newly-appeared \"Mais 2\" — so reaching for the second bound\n * meant chasing the control across the row. Nobody sets a range that way.\n *\n * Frozen only for the duration: closing re-measures against the new labels,\n * so the row still ends up correct, it just does not rearrange under a hand\n * that is mid-edit.\n */\n frozen = false,\n /** Whether \"Exportar\" is on the bar — see `rightClusterCost`. */\n hasExport = true,\n): OverflowSplit<T> {\n // The measurement is `useMeasuredWidth` (`utility/Overflow`): the same\n // ResizeObserver every collapsing cluster in the design system reads, so\n // there is one loop to get right rather than one per bar. `0` until the\n // first measurement lands (and forever under SSR or jsdom), which\n // `computeSplit` reads as \"degrade nothing\".\n const { ref: barRef, width } = useMeasuredWidth<HTMLDivElement>();\n // The prices follow the theme's type scale, so the answer does too.\n const theme = useTheme();\n const signature = JSON.stringify({\n ids: all.map((field) => field.id),\n pills,\n ranges,\n width,\n hasExport,\n scale: remPx(theme, 1),\n });\n const cache = useRef<{ signature: string; split: ReturnType<typeof computeSplit<T>> } | null>(null);\n if (cache.current === null || (!frozen && cache.current.signature !== signature)) {\n cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };\n }\n // The cache holds the ARRANGEMENT — which ids sit on the bar, which in \"Mais\"\n // — never the fields themselves. The signature keys on ids, so a field whose\n // options arrive after the first measurement (a category list still loading)\n // does not re-split, and handing back the cached objects served the empty\n // list for good: \"Categoria\" in \"Mais\" rendered a label with no control under\n // it (FUT-2828). Re-reading each field from `all` keeps the slots and the\n // current config.\n const { split } = cache.current;\n const current = new Map(all.map((field) => [field.id, field]));\n const fresh = (fields: OverflowField<T>[]): OverflowField<T>[] =>\n fields.map((field) => current.get(field.id) ?? field);\n return { ...split, inline: fresh(split.inline), overflow: fresh(split.overflow), barRef };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,SAAS,gBAA4B;AACrC,SAAS,cAAc;AAkGhB,SAAS,iBACd,QACA,aACoB;AACpB,SAAO;AAAA,IACL,GAAG,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,OAAO,KAAK,OAAO,OAAO,QAAiB,KAAK,EAAE;AAAA,IAC1F,GAAG,YAAY,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,IAAI,OAAO,MAAM,OAAO,OAAO,SAAkB,MAAM,EAAE;AAAA,EACtG;AACF;AAIA,SAAS,cACP,OACA,OACA,QACS;AACT,SAAO,MAAM,UAAU,UAClB,MAAM,MAAM,EAAE,GAAG,UAAU,KAAK,IACjC,WAAW,OAAO,MAAM,EAAE,CAAC;AACjC;AAGA,SAAS,WACP,OACA,OACA,OACA,QACQ;AACR,MAAI,MAAM,UAAU,OAAQ,QAAO,cAAc,OAAO,SAAS,OAAO,MAAM,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC;AAEjG,SAAO,cAAc,OAAO,MAAM,OAAO,WAAW,OAAO,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC;AACjF;AAWA,SAAS,aACP,KACA,OACA,QACA,OAEA,WAEA,SAEA,OACU;AACV,QAAM,SAAS,IAAI,OAAO,CAAC,UAAU,cAAc,OAAO,OAAO,MAAM,CAAC;AACxE,QAAM,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,cAAc,OAAO,OAAO,MAAM,CAAC;AACvE,QAAM,QAAQ,UAAU,KAAK;AAC7B,QAAM,MAAM,MAAM,OAAO,SAAS,eAAe;AAGjD,QAAM,YAAY,OAAO,SAAS,IAAI,MAAM,WAAW,MAAM;AAiB7D,QAAM,QAAQ,WAAW,KAAK;AAAA,IAC5B,SAAS,CAAC,UAAU,WAAW,OAAO,OAAO,OAAO,MAAM;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AAI,MAAM,EAAE,KAAK,KAAK;AACtD,SAAO,EAAE,GAAG,OAAO,QAAQ,MAAM,MAAM,MAAM,GAAG,UAAU,MAAM,MAAM,QAAQ,GAAG,OAAO;AAC1F;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PillControl
3
- } from "./chunk-VWJEM2ER.js";
3
+ } from "./chunk-NPPJ3IJP.js";
4
4
  import {
5
5
  PanelRangeField
6
6
  } from "./chunk-44USLRMT.js";
@@ -157,4 +157,4 @@ export {
157
157
  GridFilterPanel,
158
158
  FilterDialog
159
159
  };
160
- //# sourceMappingURL=chunk-Y2UXX5IQ.js.map
160
+ //# sourceMappingURL=chunk-BKZERHNC.js.map
@@ -23,6 +23,7 @@ function useAutocompleteState(value, suggestions) {
23
23
  const [isInputFocused, setIsInputFocused] = useState(false);
24
24
  const [justCompletedGhost, setJustCompletedGhost] = useState(false);
25
25
  const [userClosedDropdown, setUserClosedDropdown] = useState(false);
26
+ const userClosedDropdownRef = useRef(false);
26
27
  const inputRef = useRef(null);
27
28
  const listRef = useRef(null);
28
29
  const debounceRef = useRef(void 0);
@@ -45,11 +46,16 @@ function useAutocompleteState(value, suggestions) {
45
46
  setJustCompletedGhost,
46
47
  userClosedDropdown,
47
48
  setUserClosedDropdown,
49
+ userClosedDropdownRef,
48
50
  inputRef,
49
51
  listRef,
50
52
  debounceRef
51
53
  };
52
54
  }
55
+ function setDeliberateClose(s, closed) {
56
+ s.userClosedDropdownRef.current = closed;
57
+ s.setUserClosedDropdown(closed);
58
+ }
53
59
  function useValueSync(value, setInputValue) {
54
60
  useEffect(() => setInputValue(value), [value, setInputValue]);
55
61
  }
@@ -74,17 +80,17 @@ function useGhostFlagReset(justCompletedGhost, setJustCompletedGhost) {
74
80
  return () => clearTimeout(timer);
75
81
  }, [justCompletedGhost, setJustCompletedGhost]);
76
82
  }
77
- function useLoadingOpen(isLoading, inputValue, disabled, userClosedDropdown, setOpen, setActiveIndex) {
83
+ function useLoadingOpen(isLoading, inputValue, disabled, userClosedDropdownRef, setOpen, setActiveIndex) {
78
84
  useEffect(() => {
79
- if (isLoading && inputValue.trim().length > 0 && !disabled && !userClosedDropdown) setOpen(true);
85
+ if (isLoading && inputValue.trim().length > 0 && !disabled && !userClosedDropdownRef.current) setOpen(true);
80
86
  if (disabled) {
81
87
  setOpen(false);
82
88
  setActiveIndex(-1);
83
89
  }
84
- }, [isLoading, inputValue, disabled, userClosedDropdown, setOpen, setActiveIndex]);
90
+ }, [isLoading, inputValue, disabled, userClosedDropdownRef, setOpen, setActiveIndex]);
85
91
  }
86
92
  function maybeAutoOpen(a, hasResults) {
87
- const canAutoOpen = a.inputValue.trim() && a.isInputFocused && !a.composition && !a.justCompletedGhost && !a.userClosedDropdown;
93
+ const canAutoOpen = a.inputValue.trim() && a.isInputFocused && !a.composition && !a.justCompletedGhost && !a.userClosedDropdownRef.current;
88
94
  if (!canAutoOpen) return;
89
95
  a.setOpen(true);
90
96
  if (hasResults && a.activeIndex === -1) a.setActiveIndex(0);
@@ -103,7 +109,8 @@ function useLocalFilter(p, s) {
103
109
  activeIndex,
104
110
  setFilteredSuggestions,
105
111
  setOpen,
106
- setActiveIndex
112
+ setActiveIndex,
113
+ userClosedDropdownRef
107
114
  } = s;
108
115
  useEffect(() => {
109
116
  const suggestions = propSuggestions ?? [];
@@ -114,7 +121,7 @@ function useLocalFilter(p, s) {
114
121
  const filtered = filterSuggestions(suggestions, inputValue, matchMode, getLabel);
115
122
  setFilteredSuggestions(filtered);
116
123
  maybeAutoOpen(
117
- { inputValue, isInputFocused, composition, justCompletedGhost, userClosedDropdown, activeIndex, setOpen, setActiveIndex },
124
+ { inputValue, isInputFocused, composition, justCompletedGhost, userClosedDropdownRef, activeIndex, setOpen, setActiveIndex },
118
125
  filtered.length > 0
119
126
  );
120
127
  }, [
@@ -130,7 +137,8 @@ function useLocalFilter(p, s) {
130
137
  activeIndex,
131
138
  setFilteredSuggestions,
132
139
  setOpen,
133
- setActiveIndex
140
+ setActiveIndex,
141
+ userClosedDropdownRef
134
142
  ]);
135
143
  }
136
144
  function useGhostText(p, s) {
@@ -153,7 +161,7 @@ function commitMultiSelect(item, p, s, onChange) {
153
161
  if (!current.some((sel) => getKey(sel) === getKey(item))) p.onSelectedItemsChange?.([...current, item]);
154
162
  s.setInputValue("");
155
163
  onChange("");
156
- s.setUserClosedDropdown(false);
164
+ setDeliberateClose(s, false);
157
165
  }
158
166
  function commitSingleSelect(item, p, s, onChange) {
159
167
  const label = (p.getLabel ?? defaultGetLabel)(item);
@@ -174,7 +182,7 @@ function runSelectItem(item, p, s, onChange) {
174
182
  s.setActiveIndex(-1);
175
183
  p.onSelect?.(item);
176
184
  s.inputRef.current?.focus();
177
- if (isSingleSelectPick) s.setUserClosedDropdown(true);
185
+ if (isSingleSelectPick) setDeliberateClose(s, true);
178
186
  }
179
187
  function buildKeyContext(p, s, selectItem, onChange) {
180
188
  return {
@@ -192,7 +200,7 @@ function buildKeyContext(p, s, selectItem, onChange) {
192
200
  getSuggestionType: p.getSuggestionType ?? defaultGetSuggestionType,
193
201
  setOpen: s.setOpen,
194
202
  setActiveIndex: s.setActiveIndex,
195
- setUserClosedDropdown: s.setUserClosedDropdown,
203
+ setUserClosedDropdown: (closed) => setDeliberateClose(s, closed),
196
204
  setInputValue: s.setInputValue,
197
205
  setGhost: s.setGhost,
198
206
  setJustCompletedGhost: s.setJustCompletedGhost,
@@ -218,7 +226,7 @@ function useAutocomplete(p) {
218
226
  Boolean(p.isLoading),
219
227
  s.inputValue,
220
228
  Boolean(p.disabled),
221
- s.userClosedDropdown,
229
+ s.userClosedDropdownRef,
222
230
  s.setOpen,
223
231
  s.setActiveIndex
224
232
  );
@@ -243,11 +251,11 @@ function useAutocomplete(p) {
243
251
  s.setInputValue(e.target.value);
244
252
  debouncedOnChange(e.target.value);
245
253
  if (!s.open || s.filteredSuggestions.length === 0) s.setActiveIndex(-1);
246
- s.setUserClosedDropdown(false);
254
+ setDeliberateClose(s, false);
247
255
  },
248
256
  onFocus: () => {
249
257
  s.setIsInputFocused(true);
250
- s.setUserClosedDropdown(false);
258
+ setDeliberateClose(s, false);
251
259
  if (!s.inputValue.trim()) return;
252
260
  s.setOpen(true);
253
261
  if (s.filteredSuggestions.length > 0 && s.activeIndex === -1) s.setActiveIndex(0);
@@ -258,7 +266,7 @@ function useAutocomplete(p) {
258
266
  onClickAway: () => {
259
267
  s.setOpen(false);
260
268
  s.setActiveIndex(-1);
261
- s.setUserClosedDropdown(true);
269
+ setDeliberateClose(s, true);
262
270
  }
263
271
  };
264
272
  }
@@ -266,4 +274,4 @@ function useAutocomplete(p) {
266
274
  export {
267
275
  useAutocomplete
268
276
  };
269
- //# sourceMappingURL=chunk-M4P7NS2L.js.map
277
+ //# sourceMappingURL=chunk-BR2T72JI.js.map