@12-apps/ui 6.39.10 → 6.39.12
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/DataViewsTableBase.js +4 -4
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +3 -3
- package/dist/_internal/components/data-display/HoverCard/HoverCard.hooks.js +1 -1
- package/dist/_internal/components/data-display/HoverCard/HoverCard.js +2 -2
- package/dist/_internal/components/data-display/index.js +2 -2
- package/dist/_internal/components/form/CepField/CepField.js +2 -2
- package/dist/_internal/components/form/Input/Input.js +1 -1
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.hooks.js +1 -1
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/_internal/components/form/index.js +4 -4
- package/dist/_internal/components/form/total-form/Fields/CepField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/TextField.js +2 -2
- package/dist/_internal/components/form/total-form/Fields/index.js +5 -5
- package/dist/_internal/components/index.js +6 -6
- package/dist/{chunk-F6D6HXZU.js → chunk-7X7ZHJHM.js} +2 -2
- package/dist/{chunk-DAHYLPK7.js → chunk-CMV6BRQ3.js} +13 -4
- package/dist/chunk-CMV6BRQ3.js.map +1 -0
- package/dist/{chunk-774B27QA.js → chunk-EUACQR6N.js} +4 -3
- package/dist/chunk-EUACQR6N.js.map +1 -0
- package/dist/{chunk-YS67XMOP.js → chunk-I5ZVCY2N.js} +3 -3
- package/dist/{chunk-A5B7B4HT.js → chunk-INMKA5SF.js} +2 -2
- package/dist/{chunk-VJG7NMGL.js → chunk-IYF246UA.js} +2 -2
- package/dist/{chunk-VURQZBFH.js → chunk-JRJCBDGN.js} +16 -3
- package/dist/chunk-JRJCBDGN.js.map +1 -0
- package/dist/{chunk-7EM4THID.js → chunk-RTEY5COP.js} +2 -2
- package/dist/{chunk-2XX45PC5.js → chunk-TGXCG62P.js} +2 -2
- package/dist/{chunk-SXYIXCUB.js → chunk-VNWZWQF3.js} +41 -23
- package/dist/chunk-VNWZWQF3.js.map +1 -0
- package/dist/{chunk-SSS64KYB.js → chunk-Z43N7ASP.js} +2 -2
- package/dist/{chunk-6MFMLQ72.js → chunk-ZNDDILNQ.js} +2 -2
- package/dist/data-display/DataViews.js +4 -4
- package/dist/data-display/HoverCard.js +2 -2
- package/dist/form/CepField.js +2 -2
- package/dist/form/Input.js +1 -1
- package/dist/form/RichTextEditor.js +2 -2
- package/dist/form/total-form.js +5 -5
- package/dist/types/components/data-display/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/types/components/data-display/HoverCard/HoverCard.hooks.d.ts +1 -0
- package/dist/types/components/data-display/HoverCard/HoverCard.hooks.d.ts.map +1 -1
- package/dist/types/components/form/Input/Input.d.ts.map +1 -1
- package/dist/types/components/form/RichTextEditor/RichTextEditor.hooks.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/HoverCard/HoverCard.hooks.ts +80 -25
- package/src/components/data-display/HoverCard/HoverCard.md +1 -0
- package/src/components/data-display/HoverCard/HoverCard.tsx +11 -2
- package/src/components/form/Input/Input.tsx +40 -1
- package/src/components/form/RichTextEditor/RichTextEditor.hooks.ts +20 -3
- package/dist/chunk-774B27QA.js.map +0 -1
- package/dist/chunk-DAHYLPK7.js.map +0 -1
- package/dist/chunk-SXYIXCUB.js.map +0 -1
- package/dist/chunk-VURQZBFH.js.map +0 -1
- /package/dist/{chunk-F6D6HXZU.js.map → chunk-7X7ZHJHM.js.map} +0 -0
- /package/dist/{chunk-YS67XMOP.js.map → chunk-I5ZVCY2N.js.map} +0 -0
- /package/dist/{chunk-A5B7B4HT.js.map → chunk-INMKA5SF.js.map} +0 -0
- /package/dist/{chunk-VJG7NMGL.js.map → chunk-IYF246UA.js.map} +0 -0
- /package/dist/{chunk-7EM4THID.js.map → chunk-RTEY5COP.js.map} +0 -0
- /package/dist/{chunk-2XX45PC5.js.map → chunk-TGXCG62P.js.map} +0 -0
- /package/dist/{chunk-SSS64KYB.js.map → chunk-Z43N7ASP.js.map} +0 -0
- /package/dist/{chunk-6MFMLQ72.js.map → chunk-ZNDDILNQ.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataViewsTableBase
|
|
4
|
-
} from "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-ZNDDILNQ.js";
|
|
5
5
|
import "../../../../chunk-3333KCAW.js";
|
|
6
6
|
import "../../../../chunk-5WT4YWXC.js";
|
|
7
7
|
import "../../../../chunk-ZOLAYP2D.js";
|
|
@@ -40,8 +40,8 @@ import "../../../../chunk-YLGY3D52.js";
|
|
|
40
40
|
import "../../../../chunk-S6JHTEV4.js";
|
|
41
41
|
import "../../../../chunk-XZJM6EPC.js";
|
|
42
42
|
import "../../../../chunk-M4KVKQRN.js";
|
|
43
|
-
import "../../../../chunk-
|
|
44
|
-
import "../../../../chunk-
|
|
43
|
+
import "../../../../chunk-INMKA5SF.js";
|
|
44
|
+
import "../../../../chunk-IYF246UA.js";
|
|
45
45
|
import "../../../../chunk-ECIHOZPK.js";
|
|
46
46
|
import "../../../../chunk-5M4TYFR3.js";
|
|
47
47
|
import "../../../../chunk-HR7YTBR7.js";
|
|
@@ -108,7 +108,7 @@ import "../../../../chunk-LXT3X33C.js";
|
|
|
108
108
|
import "../../../../chunk-DMNZD3Q7.js";
|
|
109
109
|
import "../../../../chunk-JC22FNFA.js";
|
|
110
110
|
import "../../../../chunk-QYKDY4EI.js";
|
|
111
|
-
import "../../../../chunk-
|
|
111
|
+
import "../../../../chunk-JRJCBDGN.js";
|
|
112
112
|
import "../../../../chunk-SL6454K7.js";
|
|
113
113
|
import "../../../../chunk-THMT3G3L.js";
|
|
114
114
|
import "../../../../chunk-RNIU447I.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SaveViewModal
|
|
4
|
-
} from "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-IYF246UA.js";
|
|
5
5
|
import "../../../../chunk-5M4TYFR3.js";
|
|
6
6
|
import "../../../../chunk-B7CNP5HW.js";
|
|
7
7
|
import "../../../../chunk-KHG57NAE.js";
|
|
@@ -13,7 +13,7 @@ import "../../../../chunk-RIEV4VXF.js";
|
|
|
13
13
|
import "../../../../chunk-TNBJ4DK4.js";
|
|
14
14
|
import "../../../../chunk-SZS7VZJN.js";
|
|
15
15
|
import "../../../../chunk-QYKDY4EI.js";
|
|
16
|
-
import "../../../../chunk-
|
|
16
|
+
import "../../../../chunk-JRJCBDGN.js";
|
|
17
17
|
import "../../../../chunk-SL6454K7.js";
|
|
18
18
|
import "../../../../chunk-THMT3G3L.js";
|
|
19
19
|
import "../../../../chunk-RNIU447I.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
ViewDialogs,
|
|
4
4
|
ViewMutationErrorAlert,
|
|
5
5
|
ViewsMenuSlot
|
|
6
|
-
} from "../../../../chunk-
|
|
7
|
-
import "../../../../chunk-
|
|
6
|
+
} from "../../../../chunk-INMKA5SF.js";
|
|
7
|
+
import "../../../../chunk-IYF246UA.js";
|
|
8
8
|
import "../../../../chunk-ECIHOZPK.js";
|
|
9
9
|
import "../../../../chunk-5M4TYFR3.js";
|
|
10
10
|
import "../../../../chunk-B7CNP5HW.js";
|
|
@@ -26,7 +26,7 @@ import "../../../../chunk-RIEV4VXF.js";
|
|
|
26
26
|
import "../../../../chunk-TNBJ4DK4.js";
|
|
27
27
|
import "../../../../chunk-SZS7VZJN.js";
|
|
28
28
|
import "../../../../chunk-QYKDY4EI.js";
|
|
29
|
-
import "../../../../chunk-
|
|
29
|
+
import "../../../../chunk-JRJCBDGN.js";
|
|
30
30
|
import "../../../../chunk-SL6454K7.js";
|
|
31
31
|
import "../../../../chunk-THMT3G3L.js";
|
|
32
32
|
import "../../../../chunk-RNIU447I.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HoverCard
|
|
3
|
-
} from "../../../../chunk-
|
|
3
|
+
} from "../../../../chunk-CMV6BRQ3.js";
|
|
4
4
|
import "../../../../chunk-BSYPPO2I.js";
|
|
5
|
-
import "../../../../chunk-
|
|
5
|
+
import "../../../../chunk-VNWZWQF3.js";
|
|
6
6
|
import "../../../../chunk-NRIV2CQ2.js";
|
|
7
7
|
import "../../../../chunk-ZHV7TCAC.js";
|
|
8
8
|
import "../../../../chunk-HPK33ACY.js";
|
|
@@ -77,9 +77,9 @@ import {
|
|
|
77
77
|
import "../../../chunk-6OS4AKWT.js";
|
|
78
78
|
import {
|
|
79
79
|
HoverCard
|
|
80
|
-
} from "../../../chunk-
|
|
80
|
+
} from "../../../chunk-CMV6BRQ3.js";
|
|
81
81
|
import "../../../chunk-BSYPPO2I.js";
|
|
82
|
-
import "../../../chunk-
|
|
82
|
+
import "../../../chunk-VNWZWQF3.js";
|
|
83
83
|
import "../../../chunk-NRIV2CQ2.js";
|
|
84
84
|
import "../../../chunk-ZHV7TCAC.js";
|
|
85
85
|
import "../../../chunk-TAF3YYMK.js";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CepField,
|
|
4
4
|
CepField_default
|
|
5
|
-
} from "../../../../chunk-
|
|
5
|
+
} from "../../../../chunk-7X7ZHJHM.js";
|
|
6
6
|
import "../../../../chunk-QYKDY4EI.js";
|
|
7
|
-
import "../../../../chunk-
|
|
7
|
+
import "../../../../chunk-JRJCBDGN.js";
|
|
8
8
|
import "../../../../chunk-SL6454K7.js";
|
|
9
9
|
import "../../../../chunk-THMT3G3L.js";
|
|
10
10
|
import "../../../../chunk-RNIU447I.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextEditor,
|
|
3
3
|
RichTextEditor_default
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-RTEY5COP.js";
|
|
5
|
+
import "../../../../chunk-EUACQR6N.js";
|
|
6
6
|
import "../../../../chunk-UZOG6HNN.js";
|
|
7
7
|
import "../../../../chunk-33LAPBYB.js";
|
|
8
8
|
import "../../../../chunk-WVZBYTIK.js";
|
|
@@ -8,8 +8,8 @@ import "../../../chunk-A5UYPUS2.js";
|
|
|
8
8
|
import "../../../chunk-WMY276HD.js";
|
|
9
9
|
import {
|
|
10
10
|
RichTextEditor
|
|
11
|
-
} from "../../../chunk-
|
|
12
|
-
import "../../../chunk-
|
|
11
|
+
} from "../../../chunk-RTEY5COP.js";
|
|
12
|
+
import "../../../chunk-EUACQR6N.js";
|
|
13
13
|
import "../../../chunk-UZOG6HNN.js";
|
|
14
14
|
import "../../../chunk-33LAPBYB.js";
|
|
15
15
|
import "../../../chunk-WVZBYTIK.js";
|
|
@@ -159,7 +159,7 @@ import "../../../chunk-TERT6TIS.js";
|
|
|
159
159
|
import "../../../chunk-6XLMTOJ3.js";
|
|
160
160
|
import {
|
|
161
161
|
CepField
|
|
162
|
-
} from "../../../chunk-
|
|
162
|
+
} from "../../../chunk-7X7ZHJHM.js";
|
|
163
163
|
import "../../../chunk-PGM5RRQO.js";
|
|
164
164
|
import {
|
|
165
165
|
Slider
|
|
@@ -185,7 +185,7 @@ import "../../../chunk-GY4NBSCN.js";
|
|
|
185
185
|
import "../../../chunk-QYKDY4EI.js";
|
|
186
186
|
import {
|
|
187
187
|
Input
|
|
188
|
-
} from "../../../chunk-
|
|
188
|
+
} from "../../../chunk-JRJCBDGN.js";
|
|
189
189
|
import "../../../chunk-SL6454K7.js";
|
|
190
190
|
import "../../../chunk-THMT3G3L.js";
|
|
191
191
|
import "../../../chunk-RNIU447I.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
CepField
|
|
4
|
-
} from "../../../../../chunk-
|
|
4
|
+
} from "../../../../../chunk-TGXCG62P.js";
|
|
5
5
|
import "../../../../../chunk-4XK6JQ4D.js";
|
|
6
6
|
import "../../../../../chunk-6XLMTOJ3.js";
|
|
7
|
-
import "../../../../../chunk-
|
|
7
|
+
import "../../../../../chunk-7X7ZHJHM.js";
|
|
8
8
|
import "../../../../../chunk-QYKDY4EI.js";
|
|
9
|
-
import "../../../../../chunk-
|
|
9
|
+
import "../../../../../chunk-JRJCBDGN.js";
|
|
10
10
|
import "../../../../../chunk-SL6454K7.js";
|
|
11
11
|
import "../../../../../chunk-THMT3G3L.js";
|
|
12
12
|
import "../../../../../chunk-RNIU447I.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
TextField
|
|
4
|
-
} from "../../../../../chunk-
|
|
4
|
+
} from "../../../../../chunk-Z43N7ASP.js";
|
|
5
5
|
import "../../../../../chunk-4XK6JQ4D.js";
|
|
6
6
|
import "../../../../../chunk-QYKDY4EI.js";
|
|
7
|
-
import "../../../../../chunk-
|
|
7
|
+
import "../../../../../chunk-JRJCBDGN.js";
|
|
8
8
|
import "../../../../../chunk-SL6454K7.js";
|
|
9
9
|
import "../../../../../chunk-THMT3G3L.js";
|
|
10
10
|
import "../../../../../chunk-RNIU447I.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import "../../../../../chunk-
|
|
1
|
+
import "../../../../../chunk-I5ZVCY2N.js";
|
|
2
2
|
import {
|
|
3
3
|
ToggleField
|
|
4
4
|
} from "../../../../../chunk-FNG33MKA.js";
|
|
5
5
|
import {
|
|
6
6
|
TextField
|
|
7
|
-
} from "../../../../../chunk-
|
|
7
|
+
} from "../../../../../chunk-Z43N7ASP.js";
|
|
8
8
|
import {
|
|
9
9
|
SelectField
|
|
10
10
|
} from "../../../../../chunk-PWZHCBG3.js";
|
|
11
11
|
import {
|
|
12
12
|
CepField
|
|
13
|
-
} from "../../../../../chunk-
|
|
13
|
+
} from "../../../../../chunk-TGXCG62P.js";
|
|
14
14
|
import {
|
|
15
15
|
CategoryField
|
|
16
16
|
} from "../../../../../chunk-T6EKPFKZ.js";
|
|
@@ -21,7 +21,7 @@ import "../../../../../chunk-WYXNFH5Y.js";
|
|
|
21
21
|
import "../../../../../chunk-ONMSTW4B.js";
|
|
22
22
|
import "../../../../../chunk-W5TI46QN.js";
|
|
23
23
|
import "../../../../../chunk-6XLMTOJ3.js";
|
|
24
|
-
import "../../../../../chunk-
|
|
24
|
+
import "../../../../../chunk-7X7ZHJHM.js";
|
|
25
25
|
import "../../../../../chunk-N5ZWC6CB.js";
|
|
26
26
|
import "../../../../../chunk-BKASAYQL.js";
|
|
27
27
|
import "../../../../../chunk-2JNHWKQK.js";
|
|
@@ -40,7 +40,7 @@ import "../../../../../chunk-LXT3X33C.js";
|
|
|
40
40
|
import "../../../../../chunk-DMNZD3Q7.js";
|
|
41
41
|
import "../../../../../chunk-JC22FNFA.js";
|
|
42
42
|
import "../../../../../chunk-QYKDY4EI.js";
|
|
43
|
-
import "../../../../../chunk-
|
|
43
|
+
import "../../../../../chunk-JRJCBDGN.js";
|
|
44
44
|
import "../../../../../chunk-SL6454K7.js";
|
|
45
45
|
import "../../../../../chunk-THMT3G3L.js";
|
|
46
46
|
import "../../../../../chunk-RNIU447I.js";
|
|
@@ -196,8 +196,8 @@ import "../../chunk-YBVKLJAL.js";
|
|
|
196
196
|
import "../../chunk-WMY276HD.js";
|
|
197
197
|
import {
|
|
198
198
|
RichTextEditor
|
|
199
|
-
} from "../../chunk-
|
|
200
|
-
import "../../chunk-
|
|
199
|
+
} from "../../chunk-RTEY5COP.js";
|
|
200
|
+
import "../../chunk-EUACQR6N.js";
|
|
201
201
|
import "../../chunk-UZOG6HNN.js";
|
|
202
202
|
import "../../chunk-33LAPBYB.js";
|
|
203
203
|
import "../../chunk-WVZBYTIK.js";
|
|
@@ -365,7 +365,7 @@ import "../../chunk-TERT6TIS.js";
|
|
|
365
365
|
import "../../chunk-6XLMTOJ3.js";
|
|
366
366
|
import {
|
|
367
367
|
CepField
|
|
368
|
-
} from "../../chunk-
|
|
368
|
+
} from "../../chunk-7X7ZHJHM.js";
|
|
369
369
|
import "../../chunk-UCYU56FO.js";
|
|
370
370
|
import "../../chunk-SJXSWVJG.js";
|
|
371
371
|
import "../../chunk-A4TYNHBR.js";
|
|
@@ -463,9 +463,9 @@ import {
|
|
|
463
463
|
import "../../chunk-6OS4AKWT.js";
|
|
464
464
|
import {
|
|
465
465
|
HoverCard
|
|
466
|
-
} from "../../chunk-
|
|
466
|
+
} from "../../chunk-CMV6BRQ3.js";
|
|
467
467
|
import "../../chunk-BSYPPO2I.js";
|
|
468
|
-
import "../../chunk-
|
|
468
|
+
import "../../chunk-VNWZWQF3.js";
|
|
469
469
|
import "../../chunk-NRIV2CQ2.js";
|
|
470
470
|
import "../../chunk-ZHV7TCAC.js";
|
|
471
471
|
import "../../chunk-TAF3YYMK.js";
|
|
@@ -591,7 +591,7 @@ import "../../chunk-GY4NBSCN.js";
|
|
|
591
591
|
import "../../chunk-QYKDY4EI.js";
|
|
592
592
|
import {
|
|
593
593
|
Input
|
|
594
|
-
} from "../../chunk-
|
|
594
|
+
} from "../../chunk-JRJCBDGN.js";
|
|
595
595
|
import "../../chunk-SL6454K7.js";
|
|
596
596
|
import "../../chunk-THMT3G3L.js";
|
|
597
597
|
import "../../chunk-RNIU447I.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Input
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JRJCBDGN.js";
|
|
4
4
|
import {
|
|
5
5
|
FormControl,
|
|
6
6
|
FormLabel,
|
|
@@ -122,4 +122,4 @@ export {
|
|
|
122
122
|
CepField,
|
|
123
123
|
CepField_default
|
|
124
124
|
};
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
125
|
+
//# sourceMappingURL=chunk-7X7ZHJHM.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-BSYPPO2I.js";
|
|
8
8
|
import {
|
|
9
9
|
useHoverCard
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VNWZWQF3.js";
|
|
11
11
|
import {
|
|
12
12
|
HoverCardContent
|
|
13
13
|
} from "./chunk-NRIV2CQ2.js";
|
|
@@ -35,6 +35,15 @@ var StyledCard = styled(Card, {
|
|
|
35
35
|
var StyledPopover = styled(Popover, {
|
|
36
36
|
shouldForwardProp: (prop) => prop !== "customAnimation"
|
|
37
37
|
})(({ customAnimation }) => ({
|
|
38
|
+
// Only the card takes the pointer (its paper sets `pointer-events: auto`).
|
|
39
|
+
// MUI's popover root and its invisible backdrop cover the whole viewport, so
|
|
40
|
+
// while a card was open the pointer was "on the card" wherever it went: the
|
|
41
|
+
// backdrop's mouseover reached the card's onMouseEnter and cancelled the
|
|
42
|
+
// close the trigger's mouseleave had just scheduled. A card left by moving
|
|
43
|
+
// the mouse away stayed open, and the page's next click hit the backdrop
|
|
44
|
+
// instead of its target (FUT-2619). The backdrop was also the only
|
|
45
|
+
// click-away; `useClickAway` in the hooks replaces it.
|
|
46
|
+
pointerEvents: "none",
|
|
38
47
|
// The popover only positions; StyledCard draws the surface.
|
|
39
48
|
"& .MuiPopover-paper": {
|
|
40
49
|
backgroundColor: "transparent",
|
|
@@ -93,7 +102,7 @@ var HoverCard = React.forwardRef((props, ref) => {
|
|
|
93
102
|
dataTestId,
|
|
94
103
|
...rest
|
|
95
104
|
} = withDefaults(props, DEFAULTS);
|
|
96
|
-
const { anchorEl, isOpen, handleClose, triggerHandlers, cardHandlers } = useHoverCard({
|
|
105
|
+
const { anchorEl, isOpen, handleClose, triggerHandlers, cardHandlers, contentRef } = useHoverCard({
|
|
97
106
|
disabled,
|
|
98
107
|
touchEnabled,
|
|
99
108
|
enterDelay,
|
|
@@ -126,7 +135,7 @@ var HoverCard = React.forwardRef((props, ref) => {
|
|
|
126
135
|
customAnimation: animation,
|
|
127
136
|
slotProps: { paper: { style: { pointerEvents: "auto" } } },
|
|
128
137
|
...rest,
|
|
129
|
-
children: /* @__PURE__ */ jsxs(Box, { sx: { position: "relative" }, children: [
|
|
138
|
+
children: /* @__PURE__ */ jsxs(Box, { ref: contentRef, sx: { position: "relative" }, children: [
|
|
130
139
|
showArrow && /* @__PURE__ */ jsx(ArrowContainer, { placement, offset }),
|
|
131
140
|
/* @__PURE__ */ jsx(
|
|
132
141
|
StyledCard,
|
|
@@ -163,4 +172,4 @@ HoverCard.displayName = "HoverCard";
|
|
|
163
172
|
export {
|
|
164
173
|
HoverCard
|
|
165
174
|
};
|
|
166
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-CMV6BRQ3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/HoverCard/HoverCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport Card from '@mui/material/Card/index.js';\nimport CardContent from '@mui/material/CardContent/index.js';\nimport Popover from '@mui/material/Popover/index.js';\nimport { styled, type Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { rem } from '../../../tokens/relative';\nimport { withDefaults } from '../../../utils/withDefaults';\n\nimport { HoverCardContent } from './HoverCard.content';\nimport { useHoverCard } from './HoverCard.hooks';\nimport { arrowSx, cardSx, getAnchorOrigin, getTransformOrigin, sideOf } from './HoverCard.styles';\nimport type { CardStyleFlags } from './HoverCard.styles';\nimport type { HoverCardAnimation, HoverCardPlacement, HoverCardProps } from './HoverCard.types';\n\nconst ArrowContainer = styled('div')<{ placement: HoverCardPlacement; offset?: number }>(\n ({ theme, placement }) => ({ ...arrowSx(theme, placement) }),\n);\n\nconst StyledCard = styled(Card, {\n shouldForwardProp: (prop) =>\n !['customVariant', 'glow', 'pulse', 'animation'].includes(prop as string),\n})<CardStyleFlags>(({ theme, ...flags }) => ({ ...cardSx(theme, flags) }));\n\nconst StyledPopover = styled(Popover, {\n shouldForwardProp: (prop) => prop !== 'customAnimation',\n})<{ customAnimation?: HoverCardAnimation }>(({ customAnimation }) => ({\n // Only the card takes the pointer (its paper sets `pointer-events: auto`).\n // MUI's popover root and its invisible backdrop cover the whole viewport, so\n // while a card was open the pointer was \"on the card\" wherever it went: the\n // backdrop's mouseover reached the card's onMouseEnter and cancelled the\n // close the trigger's mouseleave had just scheduled. A card left by moving\n // the mouse away stayed open, and the page's next click hit the backdrop\n // instead of its target (FUT-2619). The backdrop was also the only\n // click-away; `useClickAway` in the hooks replaces it.\n pointerEvents: 'none',\n // The popover only positions; StyledCard draws the surface.\n '& .MuiPopover-paper': {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n overflow: 'visible',\n ...(customAnimation === 'scale' && { transformOrigin: 'center' }),\n },\n}));\n\nconst DEFAULTS = {\n variant: 'default',\n glow: false,\n pulse: false,\n placement: 'bottom',\n showArrow: false,\n animation: 'fade',\n enterDelay: 700,\n exitDelay: 0,\n loading: false,\n touchEnabled: true,\n disabled: false,\n} satisfies Partial<HoverCardProps>;\n\ntype ResolvedProps = HoverCardProps & Required<Pick<HoverCardProps, keyof typeof DEFAULTS>>;\n\n/** Padding is the variant's own: detailed roomier, minimal tighter. */\nconst CONTENT_PADDING: Record<string, number> = { detailed: 3, minimal: 1.5 };\n\n/**\n * The card is nudged off the anchor on whichever side it sits — `offset` design\n * px (8 unless the caller says otherwise), through the theme's type scale.\n */\nconst offsetMargin = (theme: Theme, placement: HoverCardPlacement, offset: number | undefined) => {\n const side = sideOf(placement);\n const key = ({ top: 'mt', bottom: 'mb', left: 'ml', right: 'mr' } as const)[side];\n return { [key]: rem(theme, offset ?? 8) };\n};\n\n/**\n * The card's cap: 400 design px unless the caller says otherwise. `sx` has always\n * read a number of 1 or less as a fraction of the parent, and that stays so.\n */\nconst capOf = (theme: Theme, maxWidth: number | undefined): string => {\n const cap = maxWidth ?? 400;\n return cap <= 1 && cap !== 0 ? `${cap * 100}%` : rem(theme, cap);\n};\n\nexport const HoverCard = React.forwardRef<HTMLDivElement, HoverCardProps>((props, ref) => {\n const {\n variant, glow, pulse, title, description, avatar, trigger, placement, showArrow,\n animation, enterDelay, exitDelay, maxWidth, loading, loadingComponent, loadingText, touchEnabled,\n offset, disabled, onOpen, onClose, children, dataTestId,\n ...rest\n } = withDefaults(props, DEFAULTS) as ResolvedProps;\n\n const { anchorEl, isOpen, handleClose, triggerHandlers, cardHandlers, contentRef } = useHoverCard({\n disabled,\n touchEnabled,\n enterDelay,\n exitDelay,\n onOpen,\n onClose,\n });\n\n const triggerProps = {\n ...triggerHandlers,\n style: { cursor: disabled ? 'default' : 'pointer' },\n 'data-testid': dataTestId ? `${dataTestId}-trigger` : 'hover-card-trigger',\n };\n\n const triggerElement = trigger ? (\n React.cloneElement(trigger, triggerProps)\n ) : (\n <span {...triggerProps} style={{ display: 'inline-block', ...triggerProps.style }}>\n {children}\n </span>\n );\n\n const padding = CONTENT_PADDING[variant] ?? 2;\n\n return (\n <>\n {triggerElement}\n <StyledPopover\n ref={ref}\n open={isOpen && !disabled}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={getAnchorOrigin(placement)}\n transformOrigin={getTransformOrigin(placement)}\n {...cardHandlers}\n disableAutoFocus\n disableEnforceFocus\n disableRestoreFocus\n customAnimation={animation}\n slotProps={{ paper: { style: { pointerEvents: 'auto' } } }}\n {...rest}\n >\n <Box ref={contentRef} sx={{ position: 'relative' }}>\n {showArrow && <ArrowContainer placement={placement} offset={offset} />}\n <StyledCard\n customVariant={variant}\n glow={glow}\n pulse={pulse}\n animation={animation}\n data-testid={dataTestId || 'hover-card-content'}\n sx={(theme) => ({ maxWidth: capOf(theme, maxWidth), ...offsetMargin(theme, placement, offset) })}\n >\n <CardContent sx={{ p: padding, '&:last-child': { pb: padding } }}>\n <HoverCardContent\n loadingText={loadingText} variant={variant} title={title}\n description={description}\n avatar={avatar}\n loading={loading}\n loadingComponent={loadingComponent}\n dataTestId={dataTestId}\n >\n {children}\n </HoverCardContent>\n </CardContent>\n </StyledCard>\n </Box>\n </StyledPopover>\n </>\n );\n});\n\nHo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,QACA,MAAM,UAAU,CAAC;AAAA,QACjB;AAAA,QACA,SAAS;AAAA,QACT,cAAc,gBAAgB,SAAS;AAAA,QACvC,iBAAiB,mBAAmB,SAAS;AAAA,QAC5C,GAAG;AAAA,QACJ,kBAAgB;AAAA,QAChB,qBAAmB;AAAA,QACnB,qBAAmB;AAAA,QACnB,iBAAiB;AAAA,QACjB,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,OAAO,EAAE,EAAE;AAAA,QACxD,GAAG;AAAA,QAEJ,+BAAC,OAAI,KAAK,YAAY,IAAI,EAAE,UAAU,WAAW,GAC9C;AAAA,uBAAa,oBAAC,kBAAe,WAAsB,QAAgB;AAAA,UACpE;AAAA,YAAC;AAAA;AAAA,cACC,eAAe;AAAA,cACf;AAAA,cACA;AAAA,cACA;AAAA,cACA,eAAa,cAAc;AAAA,cAC3B,IAAI,CAAC,WAAW,EAAE,UAAU,MAAM,OAAO,QAAQ,GAAG,GAAG,aAAa,OAAO,WAAW,MAAM,EAAE;AAAA,cAE9F,8BAAC,eAAY,IAAI,EAAE,GAAG,SAAS,gBAAgB,EAAE,IAAI,QAAQ,EAAE,GAC7D;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBAA0B;AAAA,kBAAkB;AAAA,kBAC5C;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBAEC;AAAA;AAAA,cACH,GACF;AAAA;AAAA,UACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ,CAAC;AAED,UAAU,cAAc;","names":[]}
|
|
@@ -34,6 +34,7 @@ var SANITIZE_CONFIG = {
|
|
|
34
34
|
ALLOW_DATA_ATTR: false,
|
|
35
35
|
KEEP_CONTENT: true
|
|
36
36
|
};
|
|
37
|
+
var sanitize = (html) => DOMPurify.sanitize(html, SANITIZE_CONFIG);
|
|
37
38
|
var textLengthOf = (html) => {
|
|
38
39
|
const probe = document.createElement("div");
|
|
39
40
|
probe.innerHTML = html;
|
|
@@ -50,7 +51,7 @@ var useEditorContent = ({
|
|
|
50
51
|
if (!editorRef.current) return;
|
|
51
52
|
const newContent = editorRef.current.innerHTML;
|
|
52
53
|
if (maxLength && (editorRef.current.textContent || "").length > maxLength) {
|
|
53
|
-
editorRef.current.innerHTML = content;
|
|
54
|
+
editorRef.current.innerHTML = sanitize(content);
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
57
|
setContent(newContent);
|
|
@@ -106,7 +107,7 @@ var useRichTextEditor = ({
|
|
|
106
107
|
},
|
|
107
108
|
[disabled, readOnly, handleContentChange]
|
|
108
109
|
);
|
|
109
|
-
const sanitizedContent =
|
|
110
|
+
const sanitizedContent = sanitize(content);
|
|
110
111
|
useEffect(() => {
|
|
111
112
|
if (editorRef.current && editorRef.current.innerHTML !== sanitizedContent) {
|
|
112
113
|
editorRef.current.innerHTML = sanitizedContent;
|
|
@@ -126,4 +127,4 @@ var useRichTextEditor = ({
|
|
|
126
127
|
export {
|
|
127
128
|
useRichTextEditor
|
|
128
129
|
};
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-EUACQR6N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/form/RichTextEditor/RichTextEditor.hooks.ts"],"sourcesContent":["import DOMPurify from 'dompurify';\nimport type React from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { applyFormatToRange } from './RichTextEditor.format';\n\n// Deliberately narrow: anything not listed is stripped, and no data-* attributes\n// survive, so pasted markup cannot smuggle in behaviour.\nconst SANITIZE_CONFIG = {\n ALLOWED_TAGS: [\n 'p', 'br', 'strong', 'em', 'u', 's', 'a', 'img', 'ul', 'ol', 'li',\n 'blockquote', 'pre', 'code', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'div',\n ],\n ALLOWED_ATTR: ['href', 'src', 'alt', 'target', 'rel', 'style', 'class'],\n ALLOW_DATA_ATTR: false,\n KEEP_CONTENT: true,\n};\n\n// The one way editor html reaches the DOM. Both writes (the render-path effect\n// and the over-limit restore) use it, so they cannot drift to different configs.\nconst sanitize = (html: string): string => DOMPurify.sanitize(html, SANITIZE_CONFIG);\n\n// INVARIANT: only ever pass SANITISED html here. Assigning innerHTML to a\n// detached element still fetches `<img src>` and fires its `onerror`, so raw\n// markup would execute. Its one caller passes `sanitizedContent`.\nconst textLengthOf = (html: string): number => {\n const probe = document.createElement('div');\n probe.innerHTML = html;\n return probe.textContent?.length || 0;\n};\n\n// The editable content and the limit that guards it.\nconst useEditorContent = ({\n editorRef,\n value,\n onChange,\n maxLength,\n}: {\n editorRef: React.RefObject<HTMLDivElement | null>;\n value?: string;\n onChange?: (value: string) => void;\n maxLength?: number;\n}) => {\n // `content` holds UNSANITISED html: the caller's raw `value` (read once, at\n // mount) until the first accepted input, and the editor's raw live innerHTML\n // after it. Every write of it to the DOM must go through `sanitize` below.\n // INVARIANT: if syncing a later `value` is ever added, the new value reaches\n // the DOM through the same sanitiser, never by a direct innerHTML write.\n const [content, setContent] = useState(value ?? '');\n\n const handleContentChange = useCallback(() => {\n if (!editorRef.current) return;\n\n const newContent = editorRef.current.innerHTML;\n\n // Over the limit, put the last accepted content back rather than truncating\n // mid-markup. `content` may be the caller's raw `value`, so the restore is\n // sanitised exactly as the render path is: writing it raw ran an `onerror`\n // handler carried in `value` (FUT-2685).\n if (maxLength && (editorRef.current.textContent || '').length > maxLength) {\n editorRef.current.innerHTML = sanitize(content);\n return;\n }\n\n // Emitting the live DOM is safe only because nothing but `sanitize()` ever\n // writes it: the editor renders empty and the effect below fills it. Give\n // the first render its own markup and this must emit `sanitize(newContent)`.\n setContent(newContent);\n onChange?.(newContent);\n }, [maxLength, onChange, content, editorRef]);\n\n return { content, handleContentChange };\n};\n\nconst useFocusState = ({ onFocus, onBlur }: { onFocus?: () => void; onBlur?: () => void }) => {\n const [isFocused, setIsFocused] = useState(false);\n\n const handleFocus = useCallback(() => {\n setIsFocused(true);\n onFocus?.();\n }, [onFocus]);\n\n const handleBlur = useCallback(() => {\n setIsFocused(false);\n onBlur?.();\n }, [onBlur]);\n\n return { isFocused, handleFocus, handleBlur };\n};\n\nexport const useRichTextEditor = ({\n value,\n onChange,\n onFocus,\n onBlur,\n disabled,\n readOnly,\n maxLength,\n}: {\n value?: string;\n onChange?: (value: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n disabled?: boolean;\n readOnly?: boolean;\n maxLength?: number;\n}) => {\n const editorRef = useRef<HTMLDivElement>(null);\n const { content, handleContentChange } = useEditorContent({\n editorRef,\n value,\n onChange,\n maxLength,\n });\n const { isFocused, handleFocus, handleBlur } = useFocusState({ onFocus, onBlur });\n\n const applyFormat = useCallback(\n (formatType: string, formatValue?: string) => {\n if (disabled || readOnly || !editorRef.current) return;\n\n const selection = window.getSelection();\n // Nothing selected: give the editor focus so the next keystroke lands.\n if (!selection || selection.rangeCount === 0) {\n editorRef.current.focus();\n return;\n }\n\n applyFormatToRange({\n formatType,\n value: formatValue,\n range: selection.getRangeAt(0),\n editor: editorRef.current,\n });\n\n handleContentChange();\n editorRef.current.focus();\n },\n [disabled, readOnly, handleContentChange],\n );\n\n const sanitizedContent = sanitize(content);\n\n // Reflect the sanitized result back when it differs from what is on screen.\n useEffect(() => {\n if (editorRef.current && editorRef.current.innerHTML !== sanitizedContent) {\n editorRef.current.innerHTML = sanitizedContent;\n }\n }, [sanitizedContent]);\n\n return {\n editorRef,\n isFocused,\n characterCount: textLengthOf(sanitizedContent),\n handleContentChange,\n handleFocus,\n handleBlur,\n applyFormat,\n };\n};\n"],"mappings":";;;;;AAAA,OAAO,eAAe;AAEtB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAMzD,IAAM,kBAAkB;AAAA,EACtB,cAAc;AAAA,IACZ;AAAA,IAAK;AAAA,IAAM;AAAA,IAAU;AAAA,IAAM;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAO;AAAA,IAAM;AAAA,IAAM;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
6
|
+
} from "./chunk-Z43N7ASP.js";
|
|
7
7
|
import {
|
|
8
8
|
SelectField
|
|
9
9
|
} from "./chunk-PWZHCBG3.js";
|
|
10
10
|
import {
|
|
11
11
|
CepField
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TGXCG62P.js";
|
|
13
13
|
import {
|
|
14
14
|
CategoryField
|
|
15
15
|
} from "./chunk-T6EKPFKZ.js";
|
|
@@ -30,4 +30,4 @@ __export(Fields_exports, {
|
|
|
30
30
|
export {
|
|
31
31
|
Fields_exports
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-I5ZVCY2N.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SaveViewModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IYF246UA.js";
|
|
4
4
|
import {
|
|
5
5
|
ManageViewsDialog
|
|
6
6
|
} from "./chunk-ECIHOZPK.js";
|
|
@@ -121,4 +121,4 @@ export {
|
|
|
121
121
|
ViewsMenuSlot,
|
|
122
122
|
ViewDialogs
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-INMKA5SF.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-ZGCPDA3F.js";
|
|
13
13
|
import {
|
|
14
14
|
Input
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JRJCBDGN.js";
|
|
16
16
|
import {
|
|
17
17
|
Dialog,
|
|
18
18
|
DialogContent
|
|
@@ -268,4 +268,4 @@ function SaveViewModal({
|
|
|
268
268
|
export {
|
|
269
269
|
SaveViewModal
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-IYF246UA.js.map
|
|
@@ -64,6 +64,14 @@ var interactionProps = (loading, onClick, disabled) => ({
|
|
|
64
64
|
disabled: loading || disabled,
|
|
65
65
|
onClick: loading ? void 0 : onClick
|
|
66
66
|
});
|
|
67
|
+
function inputAriaOf(a) {
|
|
68
|
+
const describedBy = [a.helperText ? `${a.id}-helper-text` : void 0, a.describedBy].filter(Boolean).join(" ");
|
|
69
|
+
return {
|
|
70
|
+
...a.label === void 0 ? {} : { "aria-label": a.label },
|
|
71
|
+
...a.describedBy === void 0 ? {} : { "aria-describedby": describedBy },
|
|
72
|
+
...a.busy === void 0 ? {} : { "aria-busy": a.busy }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
67
75
|
var Input = React.forwardRef(
|
|
68
76
|
({
|
|
69
77
|
variant = "outlined",
|
|
@@ -82,9 +90,13 @@ var Input = React.forwardRef(
|
|
|
82
90
|
onFocus,
|
|
83
91
|
onBlur,
|
|
84
92
|
"aria-label": ariaLabel,
|
|
93
|
+
"aria-describedby": ariaDescribedBy,
|
|
94
|
+
"aria-busy": ariaBusy,
|
|
85
95
|
...rest
|
|
86
96
|
}, ref) => {
|
|
87
97
|
const { testId: dataTestId, rest: props } = splitTestId(rest);
|
|
98
|
+
const generatedId = React.useId();
|
|
99
|
+
const id = props.id ?? generatedId;
|
|
88
100
|
return /* @__PURE__ */ jsx(
|
|
89
101
|
StyledTextField,
|
|
90
102
|
{
|
|
@@ -105,14 +117,15 @@ var Input = React.forwardRef(
|
|
|
105
117
|
onBlur,
|
|
106
118
|
inputProps: {
|
|
107
119
|
"data-testid": dataTestId,
|
|
108
|
-
...
|
|
120
|
+
...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy })
|
|
109
121
|
},
|
|
110
122
|
InputProps: {
|
|
111
123
|
startAdornment: startAdornment && /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: startAdornment }),
|
|
112
124
|
endAdornment: /* @__PURE__ */ jsx(EndAdornment, { loading, endAdornment })
|
|
113
125
|
},
|
|
114
126
|
...SIZE_MAP[size],
|
|
115
|
-
...props
|
|
127
|
+
...props,
|
|
128
|
+
id
|
|
116
129
|
}
|
|
117
130
|
);
|
|
118
131
|
}
|
|
@@ -122,4 +135,4 @@ Input.displayName = "Input";
|
|
|
122
135
|
export {
|
|
123
136
|
Input
|
|
124
137
|
};
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-JRJCBDGN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/form/Input/Input.tsx"],"sourcesContent":["import CircularProgress from '@mui/material/CircularProgress/index.js';\nimport InputAdornment from '@mui/material/InputAdornment/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { INPUT_LOADING } from './Input.metrics';\nimport { TextFieldSlim } from './text-field-slim';\n\nimport {\n filledStyles,\n floatingLabelStyles,\n glowStyles,\n inputBaseStyles,\n inputRadiusStyles,\n muiVariantFor,\n outlinedStyles,\n pulseStyles,\n SIZE_MAP,\n} from './Input.styles';\nimport type { InputProps } from './Input.types';\nimport { splitTestId } from '../../../platform/test-id';\nimport { fieldControlStyles } from '../../../tokens/field-height';\nimport { rem } from '../../../tokens/relative';\nimport type { SizeValue } from '../../../tokens/vocabulary';\n\n/**\n * `TextFieldSlim`, not `TextField` — see `text-field-slim.tsx`. MUI's own\n * `TextField` imports `Select` unconditionally, and through it `Menu`,\n * `Popover`, `Modal` and seven more component modules, so every screen with one\n * text box shipped a dropdown it can never render. Same composition, same DOM,\n * same prop routing; the select branch is the only thing missing.\n */\nconst StyledTextField = styled(TextFieldSlim, {\n shouldForwardProp: (prop) =>\n !['customVariant', 'fieldSize', 'floating', 'glow', 'pulse', 'loading'].includes(prop as string),\n})<{\n customVariant?: InputProps['variant'];\n fieldSize: SizeValue;\n floating?: boolean;\n glow?: boolean;\n pulse?: boolean;\n loading?: boolean;\n}>(({ theme, customVariant, fieldSize, floating, glow, pulse, loading }) => ({\n position: 'relative',\n // The theme's field height for this size (outlined family, one line).\n ...fieldControlStyles(theme, fieldSize),\n opacity: loading ? INPUT_LOADING.opacity : 1,\n\n ...(glow ? glowStyles(theme) : {}),\n ...(pulse ? pulseStyles(theme, fieldSize) : {}),\n ...(floating ? floatingLabelStyles(theme) : {}),\n\n '& .MuiInputBase-root': {\n transition: 'all 0.3s ease',\n ...inputRadiusStyles(theme, customVariant),\n ...inputBaseStyles(theme, customVariant),\n },\n\n '& .MuiOutlinedInput-root': outlinedStyles(theme),\n '& .MuiFilledInput-root': filledStyles(theme),\n}));\n\n/** Only one adornment shows at a time: the spinner replaces the caller's while loading. */\nconst EndAdornment: React.FC<{ loading: boolean; endAdornment?: React.ReactNode }> = ({\n loading,\n endAdornment,\n}) => {\n const theme = useTheme();\n if (loading) {\n return (\n <InputAdornment position=\"end\">\n <CircularProgress size={rem(theme, INPUT_LOADING.spinnerSize)} />\n </InputAdornment>\n );\n }\n\n if (!endAdornment) return null;\n\n return <InputAdornment position=\"end\">{endAdornment}</InputAdornment>;\n};\n\n/** While loading the field is inert: no clicks, and disabled to assistive tech. */\nconst interactionProps = (\n loading: boolean,\n onClick: InputProps['onClick'],\n disabled?: boolean,\n) => ({\n disabled: loading || disabled,\n onClick: loading ? undefined : onClick,\n});\n\n/**\n * The ARIA that describes the field has to sit on the `<input>`: the text\n * field puts every attribute it does not recognise on its root `FormControl`,\n * a `<div>` with no role, where a screen reader never reads it.\n *\n * `aria-label` has ridden `inputProps` since FUT-755. `aria-describedby` and\n * `aria-busy` fell through to the div until FUT-2619, so CepField's input\n * pointed at nothing while its lookup status lived in a live region beside it.\n *\n * `inputProps` are spread onto the `<input>` AFTER the `aria-describedby` MUI\n * writes for helper text, so a caller's ids REPLACE the helper text's: MUI's\n * `TextField` on its own keeps only one of the two. This joins both, helper\n * text first. The helper id is MUI's `<id>-helper-text` (the parity test pins\n * that spelling), which is why the field's id is fixed here rather than left\n * to the text field.\n */\nfunction inputAriaOf(a: {\n id: string;\n helperText: React.ReactNode;\n label?: string;\n describedBy?: string;\n busy?: InputProps['aria-busy'];\n}): Record<string, unknown> {\n const describedBy = [a.helperText ? `${a.id}-helper-text` : undefined, a.describedBy]\n .filter(Boolean)\n .join(' ');\n return {\n ...(a.label === undefined ? {} : { 'aria-label': a.label }),\n ...(a.describedBy === undefined ? {} : { 'aria-describedby': describedBy }),\n ...(a.busy === undefined ? {} : { 'aria-busy': a.busy }),\n };\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n variant = 'outlined',\n size = 'md',\n label,\n error,\n helperText,\n startAdornment,\n endAdornment,\n fullWidth = true,\n floating = false,\n glow = false,\n pulse = false,\n loading = false,\n onClick,\n onFocus,\n onBlur,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-busy': ariaBusy,\n ...rest\n },\n ref,\n ) => {\n const { testId: dataTestId, rest: props } = splitTestId(rest);\n const generatedId = React.useId();\n const id = props.id ?? generatedId;\n return (\n <StyledTextField\n ref={ref}\n variant={muiVariantFor(variant)}\n customVariant={variant}\n fieldSize={size}\n floating={floating}\n glow={glow}\n pulse={pulse}\n loading={loading}\n label={label}\n error={error}\n helperText={helperText}\n fullWidth={fullWidth}\n {...interactionProps(loading, onClick, props.disabled)}\n onFocus={onFocus}\n onBlur={onBlur}\n /*\n * `aria-label` has to ride `inputProps` to reach the `<input>` (FUT-755).\n * Spread with the rest it lands on the FormControl DIV that the text\n * field renders as its root, which carries no role — so the field kept\n * no accessible name, and a source grep saying \"this input is labelled\"\n * disagreed with the DOM. The reports search box and the block-title\n * inputs were both named in source and anonymous to a screen reader.\n * `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.\n */\n inputProps={{\n 'data-testid': dataTestId,\n ...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),\n }}\n InputProps={{\n startAdornment: startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n ),\n endAdornment: <EndAdornment loading={loading} endAdornment={endAdornment} />,\n }}\n {...S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AO,WAAW,aAAa,iBAAiB,MAAM,SAAS,CAAC;AAAA,QACnG;AAAA,QACA,YAAY;AAAA,UACV,gBAAgB,kBACd,oBAAC,kBAAe,UAAS,SAAS,0BAAe;AAAA,UAEnD,cAAc,oBAAC,gBAAa,SAAkB,cAA4B;AAAA,QAC5E;AAAA,QACC,GAAG,SAAS,IAAI;AAAA,QAChB,GAAG;AAAA,QACJ;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,MAAM,cAAc;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRichTextEditor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EUACQR6N.js";
|
|
4
4
|
import {
|
|
5
5
|
RichTextEditorToolbar
|
|
6
6
|
} from "./chunk-WVZBYTIK.js";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
RichTextEditor,
|
|
175
175
|
RichTextEditor_default
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-RTEY5COP.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4XK6JQ4D.js";
|
|
4
4
|
import {
|
|
5
5
|
CepField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7X7ZHJHM.js";
|
|
7
7
|
|
|
8
8
|
// src/components/form/total-form/Fields/CepField.tsx
|
|
9
9
|
import { useCallback, useMemo, useRef } from "react";
|
|
@@ -80,4 +80,4 @@ function CepField2({
|
|
|
80
80
|
export {
|
|
81
81
|
CepField2 as CepField
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-TGXCG62P.js.map
|