@12-apps/ui 6.92.0 → 6.92.1
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.
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +10 -10
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-range-bounds.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-range-calendar.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-range-summary.js +1 -1
- package/dist/{chunk-3OHZAZEE.js → chunk-3WYEENUH.js} +9 -4
- package/dist/chunk-3WYEENUH.js.map +1 -0
- package/dist/{chunk-X3GD3TFI.js → chunk-BXZMV6QC.js} +3 -3
- package/dist/{chunk-FORAVDJF.js → chunk-FC7UCFFA.js} +35 -7
- package/dist/chunk-FC7UCFFA.js.map +1 -0
- package/dist/{chunk-CKQOYPH3.js → chunk-FYUNROLW.js} +2 -2
- package/dist/{chunk-MICX23P4.js → chunk-HRES2S3Q.js} +85 -8
- package/dist/chunk-HRES2S3Q.js.map +1 -0
- package/dist/{chunk-AI7XWBNG.js → chunk-IEUVP6UV.js} +3 -3
- package/dist/{chunk-R4LCPPKA.js → chunk-OCGPOACB.js} +2 -2
- package/dist/{chunk-HS662RLW.js → chunk-RZWU2KYP.js} +2 -2
- package/dist/{chunk-MZAYIG2I.js → chunk-VCJ72ODU.js} +2 -2
- package/dist/chunk-WLDP7C4K.js +44 -0
- package/dist/chunk-WLDP7C4K.js.map +1 -0
- package/dist/{chunk-W2KOP27S.js → chunk-ZVHHFLYY.js} +2 -2
- package/dist/data-display/DataViews.js +11 -11
- package/dist/types/components/data-display/DataViews/data-views-range-bounds.d.ts +6 -1
- package/dist/types/components/data-display/DataViews/data-views-range-bounds.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-calendar.d.ts +13 -1
- package/dist/types/components/data-display/DataViews/data-views-range-calendar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-pill.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-range-summary.d.ts +4 -5
- package/dist/types/components/data-display/DataViews/data-views-range-summary.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +8 -4
- package/src/components/data-display/DataViews/data-views-range-bounds.tsx +57 -3
- package/src/components/data-display/DataViews/data-views-range-calendar.tsx +122 -8
- package/src/components/data-display/DataViews/data-views-range-pill.tsx +5 -0
- package/src/components/data-display/DataViews/data-views-range-summary.tsx +9 -22
- package/dist/chunk-3OHZAZEE.js.map +0 -1
- package/dist/chunk-FORAVDJF.js.map +0 -1
- package/dist/chunk-J2AVWIMM.js +0 -60
- package/dist/chunk-J2AVWIMM.js.map +0 -1
- package/dist/chunk-MICX23P4.js.map +0 -1
- /package/dist/{chunk-X3GD3TFI.js.map → chunk-BXZMV6QC.js.map} +0 -0
- /package/dist/{chunk-CKQOYPH3.js.map → chunk-FYUNROLW.js.map} +0 -0
- /package/dist/{chunk-AI7XWBNG.js.map → chunk-IEUVP6UV.js.map} +0 -0
- /package/dist/{chunk-R4LCPPKA.js.map → chunk-OCGPOACB.js.map} +0 -0
- /package/dist/{chunk-HS662RLW.js.map → chunk-RZWU2KYP.js.map} +0 -0
- /package/dist/{chunk-MZAYIG2I.js.map → chunk-VCJ72ODU.js.map} +0 -0
- /package/dist/{chunk-W2KOP27S.js.map → chunk-ZVHHFLYY.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataViewsGrid
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
6
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-OCGPOACB.js";
|
|
5
|
+
import "../../../../chunk-BXZMV6QC.js";
|
|
6
|
+
import "../../../../chunk-FYUNROLW.js";
|
|
7
7
|
import "../../../../chunk-MKVDHR3B.js";
|
|
8
|
-
import "../../../../chunk-
|
|
8
|
+
import "../../../../chunk-IEUVP6UV.js";
|
|
9
9
|
import "../../../../chunk-T7OIVPCO.js";
|
|
10
10
|
import "../../../../chunk-X3AFXHY5.js";
|
|
11
11
|
import "../../../../chunk-XNAI7QGU.js";
|
|
@@ -13,19 +13,19 @@ import "../../../../chunk-7TCOYCD7.js";
|
|
|
13
13
|
import "../../../../chunk-4ZQQUICR.js";
|
|
14
14
|
import "../../../../chunk-XZFTRGRW.js";
|
|
15
15
|
import "../../../../chunk-WWH674WU.js";
|
|
16
|
-
import "../../../../chunk-
|
|
17
|
-
import "../../../../chunk-
|
|
16
|
+
import "../../../../chunk-RZWU2KYP.js";
|
|
17
|
+
import "../../../../chunk-VCJ72ODU.js";
|
|
18
18
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
19
19
|
import "../../../../chunk-KYUEO2IO.js";
|
|
20
20
|
import "../../../../chunk-GZOW6HNN.js";
|
|
21
|
-
import "../../../../chunk-
|
|
22
|
-
import "../../../../chunk-
|
|
23
|
-
import "../../../../chunk-
|
|
21
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
22
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
23
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
24
24
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
25
25
|
import "../../../../chunk-2FKWKLSC.js";
|
|
26
26
|
import "../../../../chunk-YOPMXGHY.js";
|
|
27
27
|
import "../../../../chunk-CBOB5AV6.js";
|
|
28
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
29
29
|
import "../../../../chunk-AT6UKTH4.js";
|
|
30
30
|
import "../../../../chunk-5YDS6HO3.js";
|
|
31
31
|
import "../../../../chunk-OY437NRJ.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataViewsTableBase
|
|
4
|
-
} from "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-ZVHHFLYY.js";
|
|
5
5
|
import "../../../../chunk-YNVTUQ5B.js";
|
|
6
|
-
import "../../../../chunk-
|
|
6
|
+
import "../../../../chunk-OCGPOACB.js";
|
|
7
7
|
import "../../../../chunk-ZOLAYP2D.js";
|
|
8
|
-
import "../../../../chunk-
|
|
9
|
-
import "../../../../chunk-
|
|
8
|
+
import "../../../../chunk-BXZMV6QC.js";
|
|
9
|
+
import "../../../../chunk-FYUNROLW.js";
|
|
10
10
|
import "../../../../chunk-MKVDHR3B.js";
|
|
11
|
-
import "../../../../chunk-
|
|
11
|
+
import "../../../../chunk-IEUVP6UV.js";
|
|
12
12
|
import "../../../../chunk-T7OIVPCO.js";
|
|
13
13
|
import "../../../../chunk-X3AFXHY5.js";
|
|
14
14
|
import "../../../../chunk-XNAI7QGU.js";
|
|
@@ -16,19 +16,19 @@ import "../../../../chunk-7TCOYCD7.js";
|
|
|
16
16
|
import "../../../../chunk-4ZQQUICR.js";
|
|
17
17
|
import "../../../../chunk-XZFTRGRW.js";
|
|
18
18
|
import "../../../../chunk-WWH674WU.js";
|
|
19
|
-
import "../../../../chunk-
|
|
20
|
-
import "../../../../chunk-
|
|
19
|
+
import "../../../../chunk-RZWU2KYP.js";
|
|
20
|
+
import "../../../../chunk-VCJ72ODU.js";
|
|
21
21
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
22
22
|
import "../../../../chunk-KYUEO2IO.js";
|
|
23
23
|
import "../../../../chunk-GZOW6HNN.js";
|
|
24
|
-
import "../../../../chunk-
|
|
25
|
-
import "../../../../chunk-
|
|
26
|
-
import "../../../../chunk-
|
|
24
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
25
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
26
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
27
27
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
28
28
|
import "../../../../chunk-2FKWKLSC.js";
|
|
29
29
|
import "../../../../chunk-YOPMXGHY.js";
|
|
30
30
|
import "../../../../chunk-CBOB5AV6.js";
|
|
31
|
-
import "../../../../chunk-
|
|
31
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
32
32
|
import "../../../../chunk-AT6UKTH4.js";
|
|
33
33
|
import "../../../../chunk-5YDS6HO3.js";
|
|
34
34
|
import "../../../../chunk-OY437NRJ.js";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FilterDialog,
|
|
4
4
|
GridFilterPanel
|
|
5
|
-
} from "../../../../chunk-
|
|
5
|
+
} from "../../../../chunk-FYUNROLW.js";
|
|
6
6
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
7
|
-
import "../../../../chunk-
|
|
8
|
-
import "../../../../chunk-
|
|
9
|
-
import "../../../../chunk-
|
|
7
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
8
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
9
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
10
10
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
11
11
|
import "../../../../chunk-2FKWKLSC.js";
|
|
12
12
|
import "../../../../chunk-YOPMXGHY.js";
|
|
13
13
|
import "../../../../chunk-CBOB5AV6.js";
|
|
14
|
-
import "../../../../chunk-
|
|
14
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
15
15
|
import "../../../../chunk-GCZJH4XL.js";
|
|
16
16
|
import "../../../../chunk-7CUZTWKW.js";
|
|
17
17
|
import "../../../../chunk-KHG57NAE.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
GridShell
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-BXZMV6QC.js";
|
|
5
|
+
import "../../../../chunk-FYUNROLW.js";
|
|
6
6
|
import "../../../../chunk-MKVDHR3B.js";
|
|
7
|
-
import "../../../../chunk-
|
|
7
|
+
import "../../../../chunk-IEUVP6UV.js";
|
|
8
8
|
import "../../../../chunk-T7OIVPCO.js";
|
|
9
9
|
import "../../../../chunk-X3AFXHY5.js";
|
|
10
10
|
import "../../../../chunk-XNAI7QGU.js";
|
|
@@ -12,19 +12,19 @@ import "../../../../chunk-7TCOYCD7.js";
|
|
|
12
12
|
import "../../../../chunk-4ZQQUICR.js";
|
|
13
13
|
import "../../../../chunk-XZFTRGRW.js";
|
|
14
14
|
import "../../../../chunk-WWH674WU.js";
|
|
15
|
-
import "../../../../chunk-
|
|
16
|
-
import "../../../../chunk-
|
|
15
|
+
import "../../../../chunk-RZWU2KYP.js";
|
|
16
|
+
import "../../../../chunk-VCJ72ODU.js";
|
|
17
17
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
18
18
|
import "../../../../chunk-KYUEO2IO.js";
|
|
19
19
|
import "../../../../chunk-GZOW6HNN.js";
|
|
20
|
-
import "../../../../chunk-
|
|
21
|
-
import "../../../../chunk-
|
|
22
|
-
import "../../../../chunk-
|
|
20
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
21
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
22
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
23
23
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
24
24
|
import "../../../../chunk-2FKWKLSC.js";
|
|
25
25
|
import "../../../../chunk-YOPMXGHY.js";
|
|
26
26
|
import "../../../../chunk-CBOB5AV6.js";
|
|
27
|
-
import "../../../../chunk-
|
|
27
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
28
28
|
import "../../../../chunk-AT6UKTH4.js";
|
|
29
29
|
import "../../../../chunk-5YDS6HO3.js";
|
|
30
30
|
import "../../../../chunk-OY437NRJ.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
InlineFilterControls
|
|
4
|
-
} from "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-IEUVP6UV.js";
|
|
5
5
|
import "../../../../chunk-T7OIVPCO.js";
|
|
6
6
|
import "../../../../chunk-WWH674WU.js";
|
|
7
|
-
import "../../../../chunk-
|
|
8
|
-
import "../../../../chunk-
|
|
7
|
+
import "../../../../chunk-RZWU2KYP.js";
|
|
8
|
+
import "../../../../chunk-VCJ72ODU.js";
|
|
9
9
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
10
10
|
import "../../../../chunk-KYUEO2IO.js";
|
|
11
11
|
import "../../../../chunk-GZOW6HNN.js";
|
|
12
|
-
import "../../../../chunk-
|
|
13
|
-
import "../../../../chunk-
|
|
14
|
-
import "../../../../chunk-
|
|
12
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
13
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
14
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
15
15
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
16
16
|
import "../../../../chunk-2FKWKLSC.js";
|
|
17
17
|
import "../../../../chunk-YOPMXGHY.js";
|
|
18
18
|
import "../../../../chunk-CBOB5AV6.js";
|
|
19
|
-
import "../../../../chunk-
|
|
19
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
20
20
|
import "../../../../chunk-AT6UKTH4.js";
|
|
21
21
|
import "../../../../chunk-ACBHZG3Z.js";
|
|
22
22
|
import "../../../../chunk-GCZJH4XL.js";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
MoreGroup,
|
|
4
4
|
MoreQuick,
|
|
5
5
|
fieldClearing
|
|
6
|
-
} from "../../../../chunk-
|
|
6
|
+
} from "../../../../chunk-VCJ72ODU.js";
|
|
7
7
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
8
8
|
import "../../../../chunk-KYUEO2IO.js";
|
|
9
9
|
import "../../../../chunk-GZOW6HNN.js";
|
|
10
|
-
import "../../../../chunk-
|
|
11
|
-
import "../../../../chunk-
|
|
12
|
-
import "../../../../chunk-
|
|
10
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
11
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
12
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
13
13
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
14
14
|
import "../../../../chunk-2FKWKLSC.js";
|
|
15
15
|
import "../../../../chunk-YOPMXGHY.js";
|
|
16
16
|
import "../../../../chunk-CBOB5AV6.js";
|
|
17
|
-
import "../../../../chunk-
|
|
17
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
18
18
|
import "../../../../chunk-AT6UKTH4.js";
|
|
19
19
|
import "../../../../chunk-GCZJH4XL.js";
|
|
20
20
|
import "../../../../chunk-7CUZTWKW.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MoreFilters
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-RZWU2KYP.js";
|
|
5
|
+
import "../../../../chunk-VCJ72ODU.js";
|
|
6
6
|
import "../../../../chunk-AJ6KFHEE.js";
|
|
7
7
|
import "../../../../chunk-KYUEO2IO.js";
|
|
8
8
|
import "../../../../chunk-GZOW6HNN.js";
|
|
9
|
-
import "../../../../chunk-
|
|
10
|
-
import "../../../../chunk-
|
|
11
|
-
import "../../../../chunk-
|
|
9
|
+
import "../../../../chunk-3WYEENUH.js";
|
|
10
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
11
|
+
import "../../../../chunk-FC7UCFFA.js";
|
|
12
12
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
13
13
|
import "../../../../chunk-2FKWKLSC.js";
|
|
14
14
|
import "../../../../chunk-YOPMXGHY.js";
|
|
15
15
|
import "../../../../chunk-CBOB5AV6.js";
|
|
16
|
-
import "../../../../chunk-
|
|
16
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
17
17
|
import "../../../../chunk-AT6UKTH4.js";
|
|
18
18
|
import "../../../../chunk-GCZJH4XL.js";
|
|
19
19
|
import "../../../../chunk-7CUZTWKW.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
RangeBounds
|
|
4
|
-
} from "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-FC7UCFFA.js";
|
|
5
5
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
6
6
|
import "../../../../chunk-2FKWKLSC.js";
|
|
7
7
|
import "../../../../chunk-YOPMXGHY.js";
|
|
8
8
|
import "../../../../chunk-CBOB5AV6.js";
|
|
9
|
-
import "../../../../chunk-
|
|
9
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
10
10
|
import "../../../../chunk-GCZJH4XL.js";
|
|
11
11
|
import "../../../../chunk-KHG57NAE.js";
|
|
12
12
|
import "../../../../chunk-L6YTVXGN.js";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PanelRangeField,
|
|
4
4
|
RangePill
|
|
5
|
-
} from "../../../../chunk-
|
|
6
|
-
import "../../../../chunk-
|
|
5
|
+
} from "../../../../chunk-3WYEENUH.js";
|
|
6
|
+
import "../../../../chunk-WLDP7C4K.js";
|
|
7
7
|
import {
|
|
8
8
|
RangeBounds
|
|
9
|
-
} from "../../../../chunk-
|
|
9
|
+
} from "../../../../chunk-FC7UCFFA.js";
|
|
10
10
|
import "../../../../chunk-LZNUBQ5I.js";
|
|
11
11
|
import "../../../../chunk-2FKWKLSC.js";
|
|
12
12
|
import "../../../../chunk-YOPMXGHY.js";
|
|
13
13
|
import "../../../../chunk-CBOB5AV6.js";
|
|
14
|
-
import "../../../../chunk-
|
|
14
|
+
import "../../../../chunk-HRES2S3Q.js";
|
|
15
15
|
import "../../../../chunk-GCZJH4XL.js";
|
|
16
16
|
import "../../../../chunk-7CUZTWKW.js";
|
|
17
17
|
import "../../../../chunk-KHG57NAE.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RangeSummary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WLDP7C4K.js";
|
|
4
4
|
import {
|
|
5
5
|
RangeBounds
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FC7UCFFA.js";
|
|
7
7
|
import {
|
|
8
8
|
RangePresets
|
|
9
9
|
} from "./chunk-LZNUBQ5I.js";
|
|
@@ -137,6 +137,10 @@ var DAY_PAPER_SX = (theme) => ({
|
|
|
137
137
|
// 280px seven 40px day columns need: at 320 it had 256 and every day was a
|
|
138
138
|
// 33px target (FUT-4144 UI review).
|
|
139
139
|
maxWidth: { xs: `calc(100% - ${rem(theme, 16)})`, sm: `calc(100% - ${rem(theme, 32)})` },
|
|
140
|
+
// And as tall as those same margins allow: MUI's default keeps 16px off the
|
|
141
|
+
// top and bottom, so a refused day's message at 320×568 made the popover
|
|
142
|
+
// 1px taller than its cap and it scrolled (FUT-4144 code review).
|
|
143
|
+
maxHeight: { xs: `calc(100% - ${rem(theme, 16)})`, sm: `calc(100% - ${rem(theme, 32)})` },
|
|
140
144
|
p: { xs: 1, sm: 2 }
|
|
141
145
|
});
|
|
142
146
|
function RangePill({
|
|
@@ -184,7 +188,8 @@ function RangePill({
|
|
|
184
188
|
value,
|
|
185
189
|
onChange,
|
|
186
190
|
testId,
|
|
187
|
-
calendarMonths
|
|
191
|
+
calendarMonths,
|
|
192
|
+
summaryOnHint: true
|
|
188
193
|
}
|
|
189
194
|
),
|
|
190
195
|
/* @__PURE__ */ jsx(RangeSummary, { field, value, onClear: () => onChange({}), testId })
|
|
@@ -235,4 +240,4 @@ export {
|
|
|
235
240
|
RangePill,
|
|
236
241
|
PanelRangeField
|
|
237
242
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
243
|
+
//# sourceMappingURL=chunk-3WYEENUH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-range-pill.tsx"],"sourcesContent":["'use client';\n\n/**\n * A range filter as a PILL in the inline filter bar — the same affordance the\n * multi-select facets use, so \"Data\" and \"Valor\" sit in the filter row beside\n * \"Pagamento\"/\"Situação\"/\"Método\" instead of floating above the grid.\n *\n * Before this the inline bar rendered pills only, and `rangeFields` had a\n * surface on the slide-in panel alone — which `inlineFilters` REPLACES on a wide\n * screen. So a range filter was invisible on exactly the screens that use it,\n * and a page wanting one had to hang its own inputs outside the grid, outside\n * `DataViewState`, and outside the grid's \"Limpar filtros\" (FUT-668).\n */\nimport CloseIcon from '@mui/icons-material/Close';\nimport ChevronDownIcon from '@mui/icons-material/KeyboardArrowDown';\nimport Box from '@mui/material/Box/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport Popover from '@mui/material/Popover/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport useMediaQuery from '@mui/material/useMediaQuery/index.js';\nimport { useTheme, type Theme } from '@mui/material/styles/index.js';\nimport React, { useContext } from 'react';\n\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\nimport { TableFilter } from '../../layout/TableFilter';\nimport { TableFilterContext } from '../../layout/TableFilter/TableFilterContext';\nimport { RangePresets } from './data-views-preset-chips';\nimport { RangeBounds } from './data-views-range-bounds';\nimport { RangeSummary } from './data-views-range-summary';\nimport { useStillAnchor } from './data-views-still-anchor';\nimport { presetsFor } from './data-views-range-presets';\nimport {\n isRangeInverted,\n isRangeSet,\n numericRange,\n rangeChipLabel,\n} from './data-views-range-values';\nimport type { RangeFieldConfig, RangeValue } from './data-views-types';\nimport { fieldRadiusPx } from '../../../tokens/field-radius';\nimport { fieldHeight } from '../../../tokens/field-height';\nimport { fieldEdge } from '../../../tokens/field-edge';\nimport { rem, remPx, sxRem } from '../../../tokens/relative';\n\n// Re-exported: the pair moved to its own file, and its importers keep their path.\nexport { RangeBounds };\n\n/**\n * The pill + its popover. Bounds commit on change (the list is server-driven, so\n * each edit is a query) and the popover stays open, which is what lets a\n * merchant set \"de\" and then \"até\" without re-opening it.\n */\n/** An applied range clears from the pill itself — re-opening to empty two fields is three gestures for one intent. */\nfunction ClearAffordance({\n label,\n onClear,\n testId,\n}: {\n label: string;\n onClear: () => void;\n testId: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n const clear = (event: React.SyntheticEvent): void => {\n event.stopPropagation();\n onClear();\n };\n return (\n <Box\n component=\"span\"\n role=\"button\"\n tabIndex={0}\n aria-label={copy.filters.clearRange(label)}\n data-testid={testId}\n onClick={clear}\n onKeyDown={(event: React.KeyboardEvent) => {\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n clear(event);\n }}\n sx={{ display: 'inline-flex', borderRadius: 999, p: 0.125, '&:hover': { bgcolor: 'action.selected' } }}\n >\n <CloseIcon sx={{ fontSize: sxRem(14) }} />\n </Box>\n );\n}\n\n/** The pill button: its label carries the applied window, and its tone the state. */\nfunction RangeTrigger<T extends Record<string, unknown>>({\n field,\n value,\n onChange,\n onOpen,\n open,\n testId,\n}: {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onChange: (range: RangeValue) => void;\n onOpen: (anchor: HTMLElement) => void;\n open: boolean;\n testId: string;\n}): React.JSX.Element {\n const active = isRangeSet(value);\n const inverted = isRangeInverted(value);\n // An INVERTED window gets its own tone rather than the ordinary \"applied\"\n // one: it is applied, and it matches nothing, and those are different states.\n // At rest the pill draws the one field border (`fieldEdge`).\n const tone = inverted ? 'error.main' : active ? 'primary.main' : null;\n return (\n <Button\n variant=\"outlined\"\n color=\"inherit\"\n size=\"small\"\n data-testid={testId}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={(event) => onOpen(event.currentTarget)}\n // ✕ FIRST, chevron LAST — the same shape as every other pill. It used to\n // replace the chevron at the end, so a range pill and a multi-select pill\n // put the clear in different places, and an applied range lost the\n // affordance that says it opens.\n startIcon={\n active ? (\n <ClearAffordance label={field.label} onClear={() => onChange({})} testId={`${testId}-clear-inline`} />\n ) : undefined\n }\n endIcon={<ChevronDownIcon sx={{ fontSize: sxRem(16) }} />}\n sx={{\n borderRadius: fieldRadiusPx,\n height: fieldHeight,\n px: 1.5,\n maxWidth: sxRem(280),\n color: inverted ? 'error.main' : 'text.primary',\n fontWeight: 600,\n fontSize: sxRem(13),\n textTransform: 'none',\n whiteSpace: 'nowrap',\n borderColor: (theme) => tone ?? fieldEdge(theme),\n bgcolor: active ? 'action.selected' : 'background.paper',\n '&:hover': {\n borderColor: active ? tone : 'text.primary',\n bgcolor: active ? 'action.selected' : 'action.hover',\n },\n }}\n >\n {/* The applied bounds, in the label — a pill reading only \"Valor\" hides\n the very thing that is narrowing the list. */}\n <Box component=\"span\" sx={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>\n {active ? rangeChipLabel(field, value) : field.label}\n </Box>\n </Button>\n );\n}\n\n/**\n * How many months the pill's calendar shows: two from the theme's `md` up,\n * where the popover has the ~670px they take; one below it.\n *\n * A media query, not an `sx` breakpoint, because it decides what to RENDER —\n * CSS cannot un-render a second month. `up('md')` so that where nothing can be\n * measured (a test, the server) the answer is the one month that always fits.\n */\nfunction useCalendarMonths(): 1 | 2 {\n const theme = useTheme();\n return useMediaQuery(theme.breakpoints.up('md')) ? 2 : 1;\n}\n\n/**\n * The day popover's width. Below `sm` it takes the screen's (less the\n * popover's own 16px margins, which its `maxWidth` already keeps), so the boxes\n * and the month share it instead of leaving a strip of grid beside a narrow\n * card. From `sm` to `md` it holds one month, and sized to its content the\n * preset row alone stretched it to ~515px with the month hugging the left and\n * a band of nothing beside it; 400 keeps the month and the boxes one width.\n * From `md` its content — two months — sets it.\n */\nconst DAY_PAPER_SX = (theme: Theme) => ({\n width: { xs: '100%', sm: rem(theme, 400), md: 'auto' },\n // Below `sm` 8px from each edge and 8px of padding, so the month gets the\n // 280px seven 40px day columns need: at 320 it had 256 and every day was a\n // 33px target (FUT-4144 UI review).\n maxWidth: { xs: `calc(100% - ${rem(theme, 16)})`, sm: `calc(100% - ${rem(theme, 32)})` },\n // And as tall as those same margins allow: MUI's default keeps 16px off the\n // top and bottom, so a refused day's message at 320×568 made the popover\n // 1px taller than its cap and it scrolled (FUT-4144 code review).\n maxHeight: { xs: `calc(100% - ${rem(theme, 16)})`, sm: `calc(100% - ${rem(theme, 32)})` },\n p: { xs: 1, sm: 2 },\n});\n\n\nexport function RangePill<T extends Record<string, unknown>>({\n field,\n value,\n onChange,\n onOpenChange,\n testIdPrefix,\n}: {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onChange: (range: RangeValue) => void;\n /** So a measured toolbar can hold still while this is open. */\n onOpenChange?: (open: boolean) => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n const still = useStillAnchor();\n const testId = `${testIdPrefix}-range-${field.id}`;\n const calendarMonths = useCalendarMonths();\n const theme = useTheme();\n const phone = useMediaQuery(theme.breakpoints.down('sm'));\n return (\n <>\n <RangeTrigger\n field={field}\n value={value}\n onChange={onChange}\n onOpen={(element) => {\n still.open(element);\n onOpenChange?.(true);\n }}\n open={Boolean(still.anchor)}\n testId={testId}\n />\n <Popover\n {...still.popoverProps}\n onClose={() => {\n still.close();\n onOpenChange?.(false);\n }}\n // Below `sm` a day popover keeps 8px from the screen's edges instead of 16.\n marginThreshold={field.kind === 'day' && phone ? remPx(theme, 8) : undefined}\n slotProps={{ paper: { ref: still.paperRef, sx: [{ p: 2, mt: 0.5 }, field.kind === 'day' && DAY_PAPER_SX] } }}\n >\n <RangeBounds\n field={field}\n value={value}\n onChange={onChange}\n testId={testId}\n calendarMonths={calendarMonths}\n summaryOnHint\n />\n <RangeSummary field={field} value={value} onClear={() => onChange({})} testId={testId} />\n </Popover>\n </>\n );\n}\n\n\n/**\n * One range on the SLIDE-IN panel (and the narrow-screen modal): the numeric\n * control the panel already had, or — for a day range, which that control cannot\n * express — the same `De`/`Até` pair the pill's popover uses.\n */\nexport function PanelRangeField<T extends Record<string, unknown>>({\n field,\n value,\n onChange,\n testId,\n}: {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onChange: (range: RangeValue) => void;\n testId: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n // The slide-in panel stays mounted while closed; its calendar does not.\n // Outside a `TableFilter` (the \"Mais\" sheet, a test) the pair is on screen.\n const panel = useContext(TableFilterContext);\n if (field.kind === \"day\") {\n return (\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1 }}>\n <Typography component=\"span\" sx={{ fontSize: sxRem(12), fontWeight: 500, color: \"text.secondary\" }}>\n {field.label}\n </Typography>\n <RangeBounds\n field={field}\n value={value}\n onChange={onChange}\n testId={testId}\n showCalendar={panel ? panel.open : true}\n />\n </Box>\n );\n }\n return (\n <Box sx={{ display: \"flex\", flexDirection: \"column\", gap: 1 }}>\n <TableFilter.RangeField\n label={field.label}\n unit={field.unit}\n value={numericRange(value)}\n onChange={(range) => onChange(range)}\n testId={testId}\n />\n {/* Below the numeric control here, unlike the pill's popover: this one\n renders its own label, and chips above it would separate the label\n from the field it names. */}\n <RangePresets presets={presetsFor(field, copy)} value={value} onChange={onChange} testId={testId} />\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,OAAO,eAAe;AACtB,OAAO,qBAAqB;AAC5B,OAAO,SAAS;AAChB,OAAO,YAAY;AACnB,OAAO,aAAa;AACpB,OAAO,gBAAgB;AACvB,OAAO,mBAAmB;AAC1B,SAAS,gBAA4B;AACrC,SAAgB,kBAAkB;AA4D5B,SAiIF,UAjIE,KA6IA,YA7IA;AA7BN,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,GAIsB;AACpB,QAAM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A;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAc,QAAQ,MAAM,OAAO;AAAA;AAAA,MACrC;AAAA,OACF;AAAA,EAEJ;AACA,SACE,qBAAC,OAAI,IAAI,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,EAAE,GAC1D;AAAA;AAAA,MAAC,YAAY;AAAA,MAAZ;AAAA,QACC,OAAO,MAAM;AAAA,QACb,MAAM,MAAM;AAAA,QACZ,OAAO,aAAa,KAAK;AAAA,QACzB,UAAU,CAAC,UAAU,SAAS,KAAK;AAAA,QACnC;AAAA;AAAA,IACF;AAAA,IAIA,oBAAC,gBAAa,SAAS,WAAW,OAAO,IAAI,GAAG,OAAc,UAAoB,QAAgB;AAAA,KACpG;AAEJ;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FilterDialog,
|
|
3
3
|
GridFilterPanel
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FYUNROLW.js";
|
|
5
5
|
import {
|
|
6
6
|
ShellEmpty
|
|
7
7
|
} from "./chunk-MKVDHR3B.js";
|
|
8
8
|
import {
|
|
9
9
|
InlineFilterControls
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IEUVP6UV.js";
|
|
11
11
|
import {
|
|
12
12
|
GridHeaderRow
|
|
13
13
|
} from "./chunk-X3AFXHY5.js";
|
|
@@ -252,4 +252,4 @@ function GridShell(props) {
|
|
|
252
252
|
export {
|
|
253
253
|
GridShell
|
|
254
254
|
};
|
|
255
|
-
//# sourceMappingURL=chunk-
|
|
255
|
+
//# sourceMappingURL=chunk-BXZMV6QC.js.map
|
|
@@ -12,9 +12,11 @@ import {
|
|
|
12
12
|
} from "./chunk-CBOB5AV6.js";
|
|
13
13
|
import {
|
|
14
14
|
DayRangeCalendar
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HRES2S3Q.js";
|
|
16
16
|
import {
|
|
17
|
-
isRangeInverted
|
|
17
|
+
isRangeInverted,
|
|
18
|
+
isRangeSet,
|
|
19
|
+
rangeChipLabel
|
|
18
20
|
} from "./chunk-GCZJH4XL.js";
|
|
19
21
|
import {
|
|
20
22
|
useDataViewsCopy
|
|
@@ -29,7 +31,7 @@ import {
|
|
|
29
31
|
// src/components/data-display/DataViews/data-views-range-bounds.tsx
|
|
30
32
|
import Box from "@mui/material/Box/index.js";
|
|
31
33
|
import Typography from "@mui/material/Typography/index.js";
|
|
32
|
-
import { useState } from "react";
|
|
34
|
+
import { useEffect, useRef, useState } from "react";
|
|
33
35
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
34
36
|
function BoundField({
|
|
35
37
|
field,
|
|
@@ -66,6 +68,28 @@ function BoundField({
|
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
70
|
}
|
|
71
|
+
function useFocusDeAfterClear(key, testId) {
|
|
72
|
+
const rootRef = useRef(null);
|
|
73
|
+
const pending = useRef(false);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!pending.current) return;
|
|
76
|
+
pending.current = false;
|
|
77
|
+
rootRef.current?.querySelector(`[data-testid="${testId}-min"]`)?.focus();
|
|
78
|
+
}, [key, testId]);
|
|
79
|
+
return {
|
|
80
|
+
rootRef,
|
|
81
|
+
clearToDe: (clear, fromKeyboard) => {
|
|
82
|
+
pending.current = fromKeyboard;
|
|
83
|
+
clear();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function hintLineProps(field, value, clear) {
|
|
88
|
+
return { summary: appliedWindow(field, value), onClear: clear };
|
|
89
|
+
}
|
|
90
|
+
function appliedWindow(field, value) {
|
|
91
|
+
return isRangeSet(value) ? rangeChipLabel(field, value) : void 0;
|
|
92
|
+
}
|
|
69
93
|
function BoundCell({ grow, children }) {
|
|
70
94
|
if (!grow) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
71
95
|
return /* @__PURE__ */ jsx(Box, { sx: { flex: "1 1 0", minWidth: 0 }, children });
|
|
@@ -105,17 +129,20 @@ function RangeBounds({
|
|
|
105
129
|
testId,
|
|
106
130
|
calendarMonths = 1,
|
|
107
131
|
showCalendar = true,
|
|
108
|
-
fillRow = false
|
|
132
|
+
fillRow = false,
|
|
133
|
+
summaryOnHint = false
|
|
109
134
|
}) {
|
|
110
135
|
const copy = useDataViewsCopy();
|
|
111
136
|
const { key, emitted } = useOutsideResetKey(value);
|
|
137
|
+
const { rootRef, clearToDe } = useFocusDeAfterClear(key, testId);
|
|
138
|
+
const hintLine = summaryOnHint ? hintLineProps(field, value, (fromKeyboard) => clearToDe(() => onChange({}), fromKeyboard)) : {};
|
|
112
139
|
const [typed, setTyped] = useState(0);
|
|
113
140
|
const typedChange = (range) => {
|
|
114
141
|
setTyped((n) => n + 1);
|
|
115
142
|
onChange(emitted(range));
|
|
116
143
|
};
|
|
117
144
|
const day = field.kind === "day";
|
|
118
|
-
return /* @__PURE__ */ jsxs(Box, { "data-testid": `${testId}-panel`, children: [
|
|
145
|
+
return /* @__PURE__ */ jsxs(Box, { ref: rootRef, "data-testid": `${testId}-panel`, children: [
|
|
119
146
|
/* @__PURE__ */ jsx(Box, { sx: { "&:not(:empty)": { mb: { xs: 1, sm: 1.5 } } }, children: /* @__PURE__ */ jsx(RangePresets, { presets: presetsFor(field, copy), value, onChange, testId }) }),
|
|
120
147
|
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "flex-start", gap: 1.5 }, children: [
|
|
121
148
|
/* @__PURE__ */ jsx(BoundCell, { grow: day || fillRow, children: /* @__PURE__ */ jsx(
|
|
@@ -152,7 +179,8 @@ function RangeBounds({
|
|
|
152
179
|
onChange: (range) => onChange(emitted(range)),
|
|
153
180
|
months: calendarMonths,
|
|
154
181
|
viewKey: `${key}-${typed}`,
|
|
155
|
-
testId
|
|
182
|
+
testId,
|
|
183
|
+
...hintLine
|
|
156
184
|
}
|
|
157
185
|
)
|
|
158
186
|
] });
|
|
@@ -161,4 +189,4 @@ function RangeBounds({
|
|
|
161
189
|
export {
|
|
162
190
|
RangeBounds
|
|
163
191
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
192
|
+
//# sourceMappingURL=chunk-FC7UCFFA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-range-bounds.tsx"],"sourcesContent":["'use client';\n\n/**\n * The `De`/`Até` pair of a range filter, its preset chips, the line under it\n * and — for a day range — the calendar under that (FUT-4144). Shared by the\n * pill's popover, the slide-in panel and the \"Mais\" sheet, so the three cannot\n * drift on what a bound accepts or how it clears.\n */\nimport Box from '@mui/material/Box/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useDataViewsCopy } from './data-views-copy-context';\nimport { DayBoundInput } from './data-views-day-input';\nimport { NumberBoundInput } from './data-views-number-input';\nimport { RangePresets } from './data-views-preset-chips';\nimport { DayRangeCalendar } from './data-views-range-calendar';\nimport { presetsFor } from './data-views-range-presets';\nimport { useOutsideResetKey } from './data-views-range-reset';\nimport { isRangeInverted, isRangeSet, rangeChipLabel } from './data-views-range-values';\nimport type { RangeFieldConfig, RangeValue } from './data-views-types';\nimport { sxRem } from '../../../tokens/relative';\n\n/**\n * One end of the range. A day keeps its `AAAA-MM-DD` string verbatim (the form\n * both the field and the backend speak) and is typed through the masked\n * `dd/mm/aaaa` field rather than a native date input — see\n * {@link DayBoundInput} for why. A number parses, and an unparseable/blank\n * entry CLEARS the bound rather than writing `NaN`.\n */\nfunction BoundField<T extends Record<string, unknown>>({\n field,\n label,\n value,\n onChange,\n testId,\n fill,\n}: {\n field: RangeFieldConfig<T>;\n label: string;\n value: number | string | undefined;\n onChange: (bound: number | string | undefined) => void;\n testId: string;\n /** A number box takes its cell's width; a day box always does. */\n fill: boolean;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n if (field.kind === 'day') {\n return (\n <DayBoundInput\n fill\n mask={copy.filters.dayMask}\n invalidMessage={copy.filters.dayInvalid}\n label={label}\n value={value == null ? undefined : String(value)}\n onChange={onChange}\n testId={testId}\n />\n );\n }\n return (\n <NumberBoundInput\n fill={fill}\n label={label}\n value={value}\n unit={field.unit}\n onChange={onChange}\n testId={testId}\n />\n );\n}\n\n\n/**\n * After the line's \"Limpar\" pressed from the keyboard, focus goes to the\n * cleared \"De\" — the next thing to type — instead of falling to the page with\n * the button that held it. A tap leaves focus alone: focusing \"De\" there would\n * open the phone's keyboard over the calendar the next tap is for.\n * The boxes remount on a clear, so focus waits for the reset key to move.\n */\nfunction useFocusDeAfterClear(\n key: number,\n testId: string,\n): { rootRef: React.RefObject<HTMLDivElement | null>; clearToDe: (clear: () => void, fromKeyboard: boolean) => void } {\n const rootRef = useRef<HTMLDivElement>(null);\n const pending = useRef(false);\n useEffect(() => {\n if (!pending.current) return;\n pending.current = false;\n rootRef.current?.querySelector<HTMLInputElement>(`[data-testid=\"${testId}-min\"]`)?.focus();\n }, [key, testId]);\n return {\n rootRef,\n clearToDe: (clear, fromKeyboard) => {\n pending.current = fromKeyboard;\n clear();\n },\n };\n}\n\n/**\n * The window and \"Limpar\" for the hint line, where the host asks for them.\n * `clear` goes straight to the host, not through `emitted`: it is an outside\n * write, so the boxes and the calendar re-open on the empty range.\n */\nfunction hintLineProps<T extends Record<string, unknown>>(\n field: RangeFieldConfig<T>,\n value: RangeValue,\n clear: (fromKeyboard: boolean) => void,\n): { summary: string | undefined; onClear: (fromKeyboard: boolean) => void } {\n return { summary: appliedWindow(field, value), onClear: clear };\n}\n\n/** The applied window in words (\"Data: 01/10–15/10\"), or nothing while none is. */\nfunction appliedWindow<T extends Record<string, unknown>>(field: RangeFieldConfig<T>, value: RangeValue): string | undefined {\n return isRangeSet(value) ? rangeChipLabel(field, value) : undefined;\n}\n\n/** One box of the pair: an equal share of the row for a day, as it was for a number. */\nfunction BoundCell({ grow, children }: { grow: boolean; children: React.ReactNode }): React.JSX.Element {\n if (!grow) return <>{children}</>;\n return <Box sx={{ flex: '1 1 0', minWidth: 0 }}>{children}</Box>;\n}\n\n/**\n * The line under the pair: why an inverted window matches nothing, or — for a\n * day range — that BOTH days are in the result. Saying so is FUT-668's other\n * half: the bounds compare as ISO strings precisely so `até` keeps its whole\n * day, and nothing on screen would otherwise tell the merchant that.\n */\nfunction RangeNote({\n day,\n inverted,\n testId,\n}: {\n day: boolean;\n inverted: boolean;\n testId: string;\n}): React.JSX.Element | null {\n const copy = useDataViewsCopy();\n if (inverted) {\n return (\n <Typography\n component=\"p\"\n data-testid={`${testId}-inverted`}\n sx={{ mt: 0.75, fontSize: sxRem(12), color: 'error.main' }}\n >\n {copy.filters.rangeInvalid}\n </Typography>\n );\n }\n if (!day) return null;\n return (\n <Typography\n component=\"p\"\n data-testid={`${testId}-inclusive`}\n // `text.secondary`, not `disabled`: the note is read, and disabled grey\n // at 12px is 2.68:1 (FUT-4144 UI review).\n sx={{ mt: { xs: 0.25, sm: 0.75 }, fontSize: sxRem(12), color: 'text.secondary' }}\n >\n {copy.filters.rangeInclusiveNote}\n </Typography>\n );\n}\n\n/** Props of {@link RangeBounds}. */\ninterface RangeBoundsProps<T extends Record<string, unknown>> {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onChange: (range: RangeValue) => void;\n testId: string;\n /**\n * Months the day calendar shows side by side (FUT-4144). Two where the\n * popover has the room; one, with the month/year selectors, on a phone and\n * in the panels.\n */\n calendarMonths?: 1 | 2;\n /**\n * Whether the day calendar is mounted. A host that keeps the pair mounted\n * while hidden (the slide-in panel) passes its open state, so a closed panel\n * holds no calendar of its own.\n */\n showCalendar?: boolean;\n /**\n * A NUMBER pair splits the row equally too, as a day pair always does. Set\n * by the panels, whose width is the row's; the pill's popover sizes itself to\n * its content and keeps the boxes' own width.\n */\n fillRow?: boolean;\n /**\n * Say the applied window, and its \"Limpar\", on the day calendar's hint line.\n * The pill's popover sets it; a panel has them in its own header.\n */\n summaryOnHint?: boolean;\n}\n\n/**\n * The `De`/`Até` pair for a range — shared by the pill's popover and the\n * slide-in panel's day fields, so the two surfaces cannot drift on what a bound\n * accepts or how it clears.\n */\nexport function RangeBounds<T extends Record<string, unknown>>({\n field,\n value,\n onChange,\n testId,\n calendarMonths = 1,\n showCalendar = true,\n fillRow = false,\n summaryOnHint = false,\n}: RangeBoundsProps<T>): React.JSX.Element {\n const copy = useDataViewsCopy();\n const { key, emitted } = useOutsideResetKey(value);\n const { rootRef, clearToDe } = useFocusDeAfterClear(key, testId);\n const hintLine = summaryOnHint ? hintLineProps(field, value, (fromKeyboard) => clearToDe(() => onChange({}), fromKeyboard)) : {};\n // Moves the calendar to a TYPED day. A typed write is the fields' own, so\n // the outside key above does not see it; a tap on the calendar moves\n // neither, which is what keeps it still under the finger.\n const [typed, setTyped] = useState(0);\n const typedChange = (range: RangeValue) => {\n setTyped((n) => n + 1);\n onChange(emitted(range));\n };\n const day = field.kind === 'day';\n return (\n <Box ref={rootRef} data-testid={`${testId}-panel`}>\n {/* Above the inputs, not below: the presets are the answer for most\n merchants, and the two date pickers are the escape hatch. */}\n <Box sx={{ '&:not(:empty)': { mb: { xs: 1, sm: 1.5 } } }}>\n <RangePresets presets={presetsFor(field, copy)} value={value} onChange={onChange} testId={testId} />\n </Box>\n {/* Top-aligned: a day that does not exist grows ITS field by a message\n line, and centring would push the other box half a line down. The two\n boxes are one height, so with no message this is the same row. */}\n <Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 1.5 }}>\n {/* A day pair shares the row equally, so it spans the calendar under\n it; a number pair keeps its own widths. */}\n <BoundCell grow={day || fillRow}>\n <BoundField\n key={`min-${key}`}\n field={field}\n label={copy.filters.rangeStart}\n value={value.min}\n onChange={(min) => typedChange({ ...value, min })}\n testId={`${testId}-min`}\n fill={fillRow}\n />\n </BoundCell>\n <BoundCell grow={day || fillRow}>\n <BoundField\n key={`max-${key}`}\n field={field}\n label={copy.filters.rangeEnd}\n value={value.max}\n onChange={(max) => typedChange({ ...value, max })}\n testId={`${testId}-max`}\n fill={fillRow}\n />\n </BoundCell>\n </Box>\n <RangeNote day={day} inverted={isRangeInverted(value)} testId={testId} />\n {/* Under the boxes and the note, with no button to reach it: the typed\n path stays as short as it was, and a period is two taps (FUT-4144). */}\n {day && showCalendar && (\n <DayRangeCalendar\n fieldLabel={field.label}\n value={value}\n onChange={(range) => onChange(emitted(range))}\n months={calendarMonths}\n viewKey={`${key}-${typed}`}\n testId={testId}\n {...hintLine}\n />\n )}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,OAAO,SAAS;AAChB,OAAO,gBAAgB;AACvB,SAAgB,WAAW,QAAQ,gBAAgB;AAuC7C,SAuEc,UAvEd,KAyLA,YAzLA;AAnBN,SAAS,WAA8C;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQsB;AACpB,QAAM,OAAO,iBAAiB;AAC9B,MAAI,MAAM,SAAS,OAAO;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAI;AAAA,QACJ,MAAM,KAAK,QAAQ;AAAA,QACnB,gBAAgB,KAAK,QAAQ;AAAA,QAC7B;AAAA,QACA,OAAO,SAAS,OAAO,SAAY,OAAO,KAAK;AAAA,QAC/C;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,MAAM;AAAA,MACZ;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAUA,SAAS,qBACP,KACA,QACoH;AACpH,QAAM,UAAU,OAAuB,IAAI;AAC3C,QAAM,UAAU,OAAO,KAAK;AAC5B,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ,QAAS;AACtB,YAAQ,UAAU;AAClB,YAAQ,SAAS,cAAgC,iBAAiB,MAAM,QAAQ,GAAG,MAAM;AAAA,EAC3F,GAAG,CAAC,KAAK,MAAM,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ChD,QAAQ,GAAG,MAAM;AAAA,UACjB,MAAM;AAAA;AAAA,QAND,OAAO,GAAG;AAAA,MAOjB,GACF;AAAA,OACF;AAAA,IACA,oBAAC,aAAU,KAAU,UAAU,gBAAgB,KAAK,GAAG,QAAgB;AAAA,IAGtE,OAAO,gBACN;AAAA,MAAC;AAAA;AAAA,QACC,YAAY,MAAM;AAAA,QAClB;AAAA,QACA,UAAU,CAAC,UAAU,SAAS,QAAQ,KAAK,CAAC;AAAA,QAC5C,QAAQ;AAAA,QACR,SAAS,GAAG,GAAG,IAAI,KAAK;AAAA,QACxB;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-AJ6KFHEE.js";
|
|
4
4
|
import {
|
|
5
5
|
PanelRangeField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3WYEENUH.js";
|
|
7
7
|
import {
|
|
8
8
|
useDataViewsCopy
|
|
9
9
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
GridFilterPanel,
|
|
158
158
|
FilterDialog
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-FYUNROLW.js.map
|