@12-apps/ui 6.92.0 → 6.92.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.
- 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 +13 -7
- 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-W2KOP27S.js → chunk-3I5PHWKQ.js} +2 -2
- package/dist/{chunk-3OHZAZEE.js → chunk-3WYEENUH.js} +9 -4
- package/dist/chunk-3WYEENUH.js.map +1 -0
- package/dist/{chunk-R4LCPPKA.js → chunk-CNUO2BRV.js} +2 -2
- package/dist/{chunk-MZAYIG2I.js → chunk-D2JQF2WC.js} +66 -16
- package/dist/chunk-D2JQF2WC.js.map +1 -0
- package/dist/{chunk-HS662RLW.js → chunk-DWH4TQXK.js} +4 -3
- package/dist/chunk-DWH4TQXK.js.map +1 -0
- 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-X3GD3TFI.js → chunk-KQDBOZQE.js} +3 -3
- package/dist/{chunk-AI7XWBNG.js → chunk-QE4KYG5I.js} +3 -3
- package/dist/chunk-WLDP7C4K.js +44 -0
- package/dist/chunk-WLDP7C4K.js.map +1 -0
- package/dist/data-display/DataViews.js +11 -11
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts +80 -0
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-filters.d.ts.map +1 -1
- 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-more-fields.tsx +90 -14
- package/src/components/data-display/DataViews/data-views-more-filters.tsx +2 -2
- 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-HS662RLW.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-MZAYIG2I.js.map +0 -1
- /package/dist/{chunk-W2KOP27S.js.map → chunk-3I5PHWKQ.js.map} +0 -0
- /package/dist/{chunk-R4LCPPKA.js.map → chunk-CNUO2BRV.js.map} +0 -0
- /package/dist/{chunk-CKQOYPH3.js.map → chunk-FYUNROLW.js.map} +0 -0
- /package/dist/{chunk-X3GD3TFI.js.map → chunk-KQDBOZQE.js.map} +0 -0
- /package/dist/{chunk-AI7XWBNG.js.map → chunk-QE4KYG5I.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-more-filters.tsx"],"sourcesContent":["\"use client\";\n\nimport KeyboardArrowDownRoundedIcon from \"@mui/icons-material/KeyboardArrowDownRounded\";\n// A FUNNEL, not the tune sliders this used to share with \"Exibir\". The two\n// sit a few px apart on the same bar and do unrelated things — one narrows\n// WHICH rows you see, the other changes HOW they are shown — and with one\n// glyph between them the bar offered the operator no way to tell which was\n// which. On a phone, where both are icon-only, they were indistinguishable.\nimport FilterAltRoundedIcon from \"@mui/icons-material/FilterAltRounded\";\nimport Popover from \"@mui/material/Popover/index.js\";\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport useMediaQuery from \"@mui/material/useMediaQuery/index.js\";\n\n\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\nimport { Button } from \"../../form/Button\";\nimport { Box } from \"../../../mui/Box\";\nimport { Text } from \"../../typography/Text\";\n\nimport { fieldClearing, MORE_SPACING, MoreGroup, MoreQuick, type MoreFieldProps } from \"./data-views-more-fields\";\nimport { useStillAnchor } from \"./data-views-still-anchor\";\nimport type { OverflowField } from \"./data-views-overflow\";\nimport { rem, remPx, sxRem } from \"../../../tokens/relative\";\n\n/**\n * \"MAIS\" — the filter overflow: its trigger, its panel and its footer. What\n * goes INSIDE it is `data-views-more-fields`.\n *\n * It holds the fields that had no room on the toolbar. An applied filter is\n * ranked ahead of an idle one for the visible slots but is NOT exempt (see\n * `useFilterOverflow`), so an applied filter can be in here — on a phone, most\n * of them are. That is why the trigger changes tone and counts the applied\n * ones: a filter you cannot see is a filter you forget you set, and the badge\n * is what stops that.\n */\n\ninterface MoreFiltersProps<T extends Record<string, unknown>> extends MoreFieldProps {\n fields: OverflowField<T>[];\n}\n\n/**\n * The trigger, badged with how many fields had no room on the bar — and told\n * apart when some of them are APPLIED.\n *\n * An applied filter can land in here now (it is ranked first, not exempt), so\n * this button is the only thing on screen still saying it exists. A neutral\n * badge reading \"3\" would make \"three filters you have not used\" and \"three\n * filters narrowing this list\" look identical, which is the whole failure the\n * old exemption was written to avoid. So an overflow holding applied filters\n * takes the applied tone and counts them in its own badge.\n */\nfunction MoreTrigger({\n count,\n appliedCount,\n compact,\n onOpen,\n testIdPrefix,\n}: {\n count: number;\n appliedCount: number;\n /** Icon only — the same rung that strips Exibir/Exportar. */\n compact: boolean;\n onOpen: (anchor: HTMLElement) => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n const applied = appliedCount > 0;\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n color=\"neutral\"\n onClick={(event) => onOpen(event.currentTarget as HTMLElement)}\n dataTestId={`${testIdPrefix}-more-filters`}\n aria-label={\n applied\n ? copy.filters.moreFiltersApplied(count, appliedCount)\n : copy.filters.moreFilters(count)\n }\n >\n <Box\n component=\"span\"\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 0.5,\n color: applied ? \"primary.main\" : undefined,\n }}\n >\n <FilterAltRoundedIcon fontSize=\"small\" />\n {!compact && (\n <Box component=\"span\" sx={{ display: { xs: \"none\", sm: \"inline\" } }}>\n {copy.filters.moreTriggerLabel}\n </Box>\n )}\n <Box\n component=\"span\"\n data-testid={`${testIdPrefix}-more-badge`}\n sx={{\n px: 0.75,\n borderRadius: 5,\n bgcolor: applied ? \"primary.main\" : \"action.selected\",\n color: applied ? \"primary.contrastText\" : undefined,\n fontSize: sxRem(11),\n fontWeight: applied ? 700 : undefined,\n }}\n >\n {applied ? appliedCount : count}\n </Box>\n {!compact && <KeyboardArrowDownRoundedIcon fontSize=\"small\" />}\n </Box>\n </Button>\n );\n}\n\n/** The panel's heading: what these are, and why they are in here. */\nfunction MoreHeading(): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 1,\n px: 1.5,\n py: 1,\n borderBottom: 1,\n borderColor: \"divider\",\n }}\n >\n <Text variant=\"caption\" as=\"span\">\n <Box component=\"span\" sx={{ textTransform: \"uppercase\", letterSpacing: sxRem(0.5), color: \"text.disabled\" }}>\n {copy.filters.moreHeading}\n </Box>\n </Text>\n <Text variant=\"caption\" as=\"span\">\n <Box component=\"span\" sx={{ ml: \"auto\", color: \"text.disabled\" }}>\n {copy.filters.overflowNote}\n </Box>\n </Text>\n </Box>\n );\n}\n\n/**\n * The panel's own way back to the unfiltered list.\n *\n * The bar's \"Limpar\" is the primary one, but it is a control like any other\n * and the ladder can take its label — and on the narrowest rungs this panel is\n * where most of the fields ended up anyway. Clearing everything from inside it\n * saves closing it to reach a button three pixels wide.\n */\nfunction MoreFooter({\n onClearAll,\n testIdPrefix,\n reserved = false,\n}: {\n onClearAll: () => void;\n testIdPrefix: string;\n /**\n * Hold the footer's height with nothing in it. A panel holding a day range\n * keeps the row while nothing is applied, so the first tap on its calendar\n * does not grow the panel by a row and move its top under the finger\n * (FUT-4144 UI review).\n */\n reserved?: boolean;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n return (\n <Box\n aria-hidden={reserved || undefined}\n // Held, the row is blank — no rule over it either, or it reads as an\n // empty bordered row.\n sx={{ px: 1.5, py: 1, borderTop: 1, borderColor: reserved ? \"transparent\" : \"divider\", visibility: reserved ? \"hidden\" : undefined }}\n >\n <Box\n component=\"button\"\n type=\"button\"\n onClick={reserved ? undefined : onClearAll}\n tabIndex={reserved ? -1 : undefined}\n data-testid={reserved ? undefined : `${testIdPrefix}-more-clear-all`}\n sx={{\n width: \"100%\",\n border: 0,\n p: 0,\n bgcolor: \"transparent\",\n cursor: \"pointer\",\n font: \"inherit\",\n fontSize: sxRem(13),\n textAlign: \"left\",\n color: \"primary.main\",\n \"&:hover\": { textDecoration: \"underline\" },\n }}\n >\n {copy.filters.clearAll}\n </Box>\n </Box>\n );\n}\n\n/** The panel's body: a shed quick chip as a toggle row, anything else as a labelled group. */\nfunction MoreFields<T extends Record<string, unknown>>({\n fields,\n ...rest\n}: MoreFiltersProps<T>): React.JSX.Element {\n return (\n <>\n {fields.map((field) =>\n field.quick ? (\n <MoreQuick key={field.id} quick={field.quick} {...rest} />\n ) : (\n <MoreGroup key={field.id} field={field} {...rest} />\n ),\n )}\n </>\n );\n}\n\n/**\n * The panel is a column: heading, the fields' scroller, footer. Its height is\n * the screen's, not a fixed 320px — at 390×844 that cap scrolled a day range's\n * month caption and weekday row out of view after the first tap, and a typed\n * day's refusal out of sight of its box (FUT-4144 UI review). MUI moves the\n * panel up when it is taller than the room under its trigger.\n */\nconst COLUMN_SX = { display: \"flex\", flexDirection: \"column\" } as const;\n\n/**\n * 320, not 300: inside 12px of padding a day range's month then has the 280px\n * its seven 40px columns need and its month/year caption one row (FUT-4144).\n */\nconst PAPER_SX = (theme: Theme) => ({\n ...COLUMN_SX,\n width: rem(theme, 320),\n maxWidth: `calc(100vw - ${rem(theme, 32)})`,\n});\n\n/**\n * Below `sm` the panel takes the screen's width less 8px each side, so a day\n * range's calendar gets the 280px its seven 40px columns need (it had 264 at\n * 320 and 276 at 390, so every day was a 34-36px target).\n */\nconst PHONE_PAPER_SX = (theme: Theme) => ({\n ...COLUMN_SX,\n width: `calc(100vw - ${rem(theme, 16)})`,\n maxWidth: `calc(100vw - ${rem(theme, 16)})`,\n maxHeight: `calc(100% - ${rem(theme, 16)})`,\n});\n\n/** Props of {@link MoreFilters}. */\ninterface MoreFiltersPanelProps<T extends Record<string, unknown>> extends MoreFiltersProps<T> {\n /** Changes on every clear-all; the fields here are keyed on it (FUT-4144). */\n clearKey?: number;\n /** Icon only — the same rung that strips Exibir/Exportar. */\n compact?: boolean;\n /** Clears every filter, not just the ones in here. */\n onClearAll: () => void;\n /** Whether anything is applied anywhere — the footer is pointless otherwise. */\n anyApplied: boolean;\n /**\n * So the shell can FREEZE the measured split while this panel is open.\n *\n * Applying a filter in here makes its field active, and an active field\n * takes an inline slot first — so the field being edited was promoted OUT of\n * this panel mid-keystroke, taking the focused input with it. Typing \"12\"\n * got as far as \"1\" and then had nowhere to go.\n */\n onOpenChange?: (open: boolean) => void;\n}\n\n/** The overflow trigger + panel. Renders nothing when everything fits. */\nexport function MoreFilters<T extends Record<string, unknown>>({\n fields,\n onOpenChange,\n onClearAll,\n anyApplied,\n compact = false,\n clearKey,\n ...rest\n}: MoreFiltersPanelProps<T>): React.JSX.Element | null {\n const still = useStillAnchor();\n const theme = useTheme();\n const phone = useMediaQuery(theme.breakpoints.down(\"sm\"));\n if (fields.length === 0) return null;\n const holdsDayRange = fields.some((field) => field.range?.kind === \"day\");\n return (\n <>\n <MoreTrigger\n count={fields.length}\n appliedCount={\n fields.filter(\n (field) =>\n fieldClearing({\n field,\n pills: rest.pills,\n ranges: rest.ranges,\n onTogglePill: rest.onTogglePill,\n onChangeRange: rest.onChangeRange,\n }).applied,\n ).length\n }\n compact={compact}\n onOpen={(element) => {\n still.open(element);\n onOpenChange?.(true);\n }}\n testIdPrefix={rest.testIdPrefix}\n />\n <Popover\n {...still.popoverProps}\n onClose={() => {\n still.close();\n onOpenChange?.(false);\n }}\n // Below `sm`, 8px from the screen's edges instead of 16.\n marginThreshold={phone ? remPx(theme, 8) : undefined}\n slotProps={{ paper: { ref: still.paperRef, sx: phone ? PHONE_PAPER_SX : PAPER_SX } }}\n >\n <Box data-testid={`${rest.testIdPrefix}-more-panel`} sx={{ ...COLUMN_SX, flex: \"1 1 auto\", minHeight: 0 }}>\n <MoreHeading />\n {/* overflowX hidden, not auto: this panel is a fixed width and its\n contents are told to shrink into it. A horizontal scrollbar here\n means something refused to, which is a bug to fix rather than a\n scrollbar to live with. */}\n <Box sx={{ flex: \"1 1 auto\", minHeight: 0, overflowY: \"auto\", overflowX: \"hidden\", px: { xs: 1, sm: 1.5 }, pb: { xs: 1, sm: 1.5 }, pt: MORE_SPACING.aboveFirst, minWidth: 0 }}>\n <MoreFields key={clearKey} fields={fields} {...rest} />\n </Box>\n {(anyApplied || holdsDayRange) && (\n <MoreFooter onClearAll={onClearAll} testIdPrefix={rest.testIdPrefix} reserved={!anyApplied} />\n )}\n </Box>\n </Popover>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,kCAAkC;AAMzC,OAAO,0BAA0B;AACjC,OAAO,aAAa;AACpB,SAAS,gBAA4B;AACrC,OAAO,mBAAmB;AAqEpB,SA8HF,UArHI,KATF;AA7BN,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOsB;AACpB,QAAM,OAAO,iBAAiB;AAC9B,QAAM,UAAU,eAAe;AAC/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,SAAS,CAAC,UAAU,OAAO,MAAM,aAA4B;AAAA,MAC7D,YAAY,GAAG,YAAY;AAAA,MAC3B,cACE,UACI,KAAK,QAAQ,mBAAmB,OAAO,YAAY,IACnD,KAAK,QAAQ,YAAY,KAAK;AAAA,MAGpC;AAAA,QAACA;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAI;AAAA,YACF,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,KAAK;AAAA,YACL,OAAO,UAAU,iBAAiB;AAAA,UACpC;AAAA,UAEA;AAAA,gCAAC,wBAAqB,UAAS,SAAQ;AAAA,YACtC,CAAC,WACA,oBAACA,UAAA,EAAI,WAAU,QAAO,IAAI,EAAE,SAAS,EAAE,IAAI,QAAQ,IAAI,SAAS,EAAE,GAC/D,eAAK,QAAQ,kBAChB;AAAA,YAEF;AAAA,cAACA;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,eAAa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E,GAC1K,8BAAC,cAA0B,QAAiB,GAAG,QAA9B,QAAoC,GACvD;AAAA,WACE,cAAc,kBACd,oBAAC,cAAW,YAAwB,cAAc,KAAK,cAAc,UAAU,CAAC,YAAY;AAAA,WAEhG;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["default"]}
|
|
@@ -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,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,UACpB,OAAO,MAAM;AAAA,UACb,UAAU,CAAC,QAAQ,YAAY,EAAE,GAAG,OAAO,IAAI,CAAC;AAAA,UAChD,QAAQ,GAAG,MAAM;AAAA,UACjB,MAAM;AAAA;AAAA,QAND,OAAO,GAAG;AAAA,MAOjB,GACF;AAAA,MACA,oBAAC,aAAU,MAAM,OAAO,SACtB;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA,OAAO,KAAK,QAAQ;AAAA,UACpB,OAAO,MAAM;AAAA,UACb,UAAU,CAAC,QAAQ,YAAY,EAAE,GAAG,OAAO,IAAI,CAAC;AAAA,UAChD,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
|
|
@@ -71,13 +71,90 @@ function openingMonth(value, months) {
|
|
|
71
71
|
const anchor = end ?? /* @__PURE__ */ new Date();
|
|
72
72
|
return new Date(anchor.getFullYear(), anchor.getMonth() - (months > 1 ? 1 : 0), 1);
|
|
73
73
|
}
|
|
74
|
+
function HintLine({
|
|
75
|
+
text,
|
|
76
|
+
isWindow,
|
|
77
|
+
canClear,
|
|
78
|
+
onClear,
|
|
79
|
+
testId
|
|
80
|
+
}) {
|
|
81
|
+
const clear = useDataViewsCopy().filters.clear;
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
83
|
+
Box,
|
|
84
|
+
{
|
|
85
|
+
"data-testid": `${testId}-calendar-line`,
|
|
86
|
+
sx: {
|
|
87
|
+
display: "flex",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
justifyContent: "space-between",
|
|
90
|
+
gap: 2,
|
|
91
|
+
mt: { xs: 0.25, sm: 1 },
|
|
92
|
+
minHeight: canClear ? sxRem(40) : void 0,
|
|
93
|
+
fontSize: sxRem(12),
|
|
94
|
+
lineHeight: 1.5
|
|
95
|
+
},
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
Typography,
|
|
99
|
+
{
|
|
100
|
+
component: "p",
|
|
101
|
+
"aria-live": "polite",
|
|
102
|
+
"data-testid": `${testId}-calendar-hint`,
|
|
103
|
+
title: text,
|
|
104
|
+
noWrap: true,
|
|
105
|
+
sx: { m: 0, minWidth: 0, font: "inherit", color: isWindow ? "text.primary" : "text.secondary" },
|
|
106
|
+
children: text
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
onClear && /* @__PURE__ */ jsx(
|
|
110
|
+
Box,
|
|
111
|
+
{
|
|
112
|
+
component: "button",
|
|
113
|
+
type: "button",
|
|
114
|
+
onClick: (event) => onClear(event.detail === 0),
|
|
115
|
+
"data-testid": `${testId}-clear`,
|
|
116
|
+
sx: {
|
|
117
|
+
flexShrink: 0,
|
|
118
|
+
display: "inline-flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
minHeight: sxRem(40),
|
|
121
|
+
border: 0,
|
|
122
|
+
bgcolor: "transparent",
|
|
123
|
+
cursor: "pointer",
|
|
124
|
+
font: "inherit",
|
|
125
|
+
fontWeight: 600,
|
|
126
|
+
color: "primary.main",
|
|
127
|
+
px: 1,
|
|
128
|
+
py: 0,
|
|
129
|
+
// Its text lines up with the boxes' right edge; the side padding
|
|
130
|
+
// reaches into the popover's own.
|
|
131
|
+
mr: -1,
|
|
132
|
+
borderRadius: 1,
|
|
133
|
+
"&:hover": { bgcolor: "action.hover" },
|
|
134
|
+
// The theme's focus ring for a keyboard, none for a tap.
|
|
135
|
+
"&:focus": { outline: "none" },
|
|
136
|
+
"&:focus-visible": {
|
|
137
|
+
outline: (theme) => `${rem(theme, 2)} solid`,
|
|
138
|
+
outlineColor: "primary.main",
|
|
139
|
+
outlineOffset: sxRem(1)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
children: clear
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
74
149
|
function DayRangeCalendar({
|
|
75
150
|
fieldLabel,
|
|
76
151
|
value,
|
|
77
152
|
onChange,
|
|
78
153
|
months,
|
|
79
154
|
viewKey,
|
|
80
|
-
testId
|
|
155
|
+
testId,
|
|
156
|
+
summary,
|
|
157
|
+
onClear
|
|
81
158
|
}) {
|
|
82
159
|
const copy = useDataViewsCopy().filters.dayCalendar ?? EN_US_DATA_VIEWS_COPY.filters.dayCalendar;
|
|
83
160
|
const range = rangeOf(value);
|
|
@@ -103,13 +180,13 @@ function DayRangeCalendar({
|
|
|
103
180
|
viewKey
|
|
104
181
|
),
|
|
105
182
|
/* @__PURE__ */ jsx(
|
|
106
|
-
|
|
183
|
+
HintLine,
|
|
107
184
|
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
185
|
+
text: waitingForEnd ? copy.pickEnd : summary ?? copy.pickStart,
|
|
186
|
+
isWindow: !waitingForEnd && summary !== void 0,
|
|
187
|
+
canClear: onClear !== void 0,
|
|
188
|
+
onClear: summary === void 0 ? void 0 : onClear,
|
|
189
|
+
testId
|
|
113
190
|
}
|
|
114
191
|
)
|
|
115
192
|
] });
|
|
@@ -119,4 +196,4 @@ export {
|
|
|
119
196
|
rangeFromCalendar,
|
|
120
197
|
DayRangeCalendar
|
|
121
198
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-HRES2S3Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-range-calendar.tsx"],"sourcesContent":["'use client';\n\n/**\n * The range calendar under a day filter's `De`/`Até` boxes (FUT-4144).\n *\n * The owner picked it ALWAYS OPEN (option B of the prototype): a period is\n * three taps — open the filter, the first day, the last day — against five for\n * a calendar button in each box and four for a link to a separate sheet. It\n * sits BELOW the boxes, with no button of its own, so the typed path is not one\n * keystroke longer than it was.\n *\n * The boxes and the calendar are two views of ONE range: a tap writes the\n * boxes, a typed day moves and repaints the calendar, an impossible typed day\n * (which writes nothing) leaves it alone, and \"Limpar\" empties both.\n *\n * It is `Calendar` in `selectionMode=\"range\"`, the same one `DateRangePicker`\n * mounts — not a second calendar. Its own rule picks the period: the first tap\n * starts it, the second closes it, and a second tap BEFORE the first swaps the\n * two, so the boxes never show a period backwards.\n */\nimport Box from '@mui/material/Box/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport React from 'react';\n\nimport { EN_US_DATA_VIEWS_COPY } from '../../../en-US.data-display';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport { rem, sxRem } from '../../../tokens/relative';\nimport { Calendar, type DateRange } from '../../form/Calendar';\nimport { toDayString, toLocalDay } from '../../form/DateRangePicker/DateRangePicker.dates';\nimport type { DataViewsDayCalendarCopy } from './data-views-copy';\nimport { useDataViewsCopy } from './data-views-copy-context';\nimport type { RangeValue } from './data-views-types';\n\nconst CALENDAR_CLASS = 'data-views-range-calendar';\n\n/**\n * `Calendar` draws its own `Paper` with 24px of padding and a shadow. Inside\n * the filter's popover that reads as a card inside a card, so the inner frame\n * is flattened through the class hook the component offers for this — the\n * same thing `DateRangePicker` does.\n */\nconst ROOT_SX = (theme: Theme) => ({\n mt: { xs: 1, sm: 1.5 },\n // Below `sm` the caption and the weekday row give up their bottom margins,\n // so the whole popover fits a 320×568 screen under its pill (FUT-4144).\n '& :has(> * > [data-testid=\"calendar-month-select\"])': { mb: { xs: 0.5, sm: 2 } },\n '& :has(> [role=\"columnheader\"])': { mb: { xs: 0, sm: 1 } },\n '& [role=\"columnheader\"]': { height: { xs: rem(theme, 24), sm: rem(theme, 32) } },\n // The days carry no column gap of their own (`Calendar`, FUT-4162), so the\n // seven columns are what a day's 40px target is carved from below `sm`; the\n // range band and its round endpoints are the Calendar's, untouched here.\n // The month/year caption on ONE row at 320: the selectors give up the slack\n // around their text before the arrows are pushed onto a second row.\n '& [data-testid=\"calendar-month-select\"], & [data-testid=\"calendar-year-select\"]': { px: 0.5, minWidth: 0 },\n [`& .${CALENDAR_CLASS}`]: {\n p: 0,\n boxShadow: 'none',\n backgroundColor: 'transparent',\n backgroundImage: 'none',\n // A tapped day already rings itself; the whole grid framed in the primary\n // colour after every tap is noise in a popover. The frame stays for the\n // keyboard reaching the grid itself.\n '&:focus-within': { outline: 'none' },\n '&:focus-visible': {\n outline: (theme: Theme) => `${rem(theme, 2)} solid`,\n outlineColor: 'primary.main',\n outlineOffset: sxRem(2),\n },\n },\n});\n\n/** The two ends of a range, as `Calendar` reads them. */\nfunction rangeOf(value: RangeValue): DateRange {\n return {\n start: toLocalDay(typeof value.min === 'string' ? value.min : null),\n end: toLocalDay(typeof value.max === 'string' ? value.max : null),\n };\n}\n\n/**\n * What a tap on the calendar makes of the range.\n *\n * `Calendar` reports the period it holds after the tap: a fresh start (`end`\n * null) or a closed one, already in order. The one case it cannot see is a\n * range with only `Até` — typed, or left by a saved view — where its first tap\n * would drop that `Até`. A first day on or before it keeps it, so \"até 15/10\"\n * plus one tap on the 3rd is 03/10–15/10, as the prototype does.\n */\nexport function rangeFromCalendar(previous: RangeValue, picked: DateRange): RangeValue {\n const min = dayOf(picked.start);\n const max = dayOf(picked.end) ?? keptEnd(previous, min);\n return { ...(min ? { min } : {}), ...(max ? { max } : {}) };\n}\n\nconst dayOf = (date: Date | null | undefined): string | undefined => (date ? toDayString(date) : undefined);\n\n/** The `Até` of a range that has ONLY one, when the new first day is on or before it. */\nfunction keptEnd(previous: RangeValue, min: string | undefined): string | undefined {\n if (previous.min != null || typeof previous.max !== 'string') return undefined;\n return min && min <= previous.max ? previous.max : undefined;\n}\n\n/**\n * The month the calendar opens on while `De` is empty. With `De` set it opens\n * on De's month, which `Calendar` does by itself.\n *\n * With two months the current month sits on the RIGHT (setembro | outubro), so\n * the days a filter usually asks about — the ones just past — are on screen;\n * with only `Até` set, its month takes that place.\n */\nfunction openingMonth(value: RangeValue, months: number): Date | undefined {\n const end = toLocalDay(typeof value.max === 'string' ? value.max : null);\n const anchor = end ?? new Date();\n return new Date(anchor.getFullYear(), anchor.getMonth() - (months > 1 ? 1 : 0), 1);\n}\n\n/**\n * The line under the calendar: the next step (\"Toque no primeiro e no último\n * dia.\" / \"Agora toque no último dia.\") or, once a period is applied, the\n * window, with \"Limpar\" at its end.\n *\n * ONE line whose words change, never a row held empty for later (FUT-4144\n * follow-up): #932 kept an invisible summary row under the hint so the first\n * tap would not grow the popover, and at 1280 that was 59px of white.\n *\n * Where the line can hold \"Limpar\" (the pill's popover) it is always as tall as\n * its 40px target, so it keeps one height with the button and without it, and\n * the popover does not move. Where it cannot (a panel, whose header has\n * \"Limpar\") it stays a plain line of text: no row reserved for a button that\n * never comes. The text keeps to one line, cut with an ellipsis and whole in\n * its title, so a long label never grows the line on the closing tap. The target\n * is its own box, not padding pushed out with a negative margin: that version\n * ran under the calendar's last week, which took its top 10px at 320 (FUT-4144\n * UI review). The window is said in the primary ink, the steps in the\n * secondary one, so the result does not read as one more instruction.\n */\nfunction HintLine({\n text,\n isWindow,\n canClear,\n onClear,\n testId,\n}: {\n text: string;\n /** `text` is the applied window, not a step. */\n isWindow: boolean;\n /** The line can hold \"Limpar\" at all — fixed per surface, not per state. */\n canClear: boolean;\n /** Shown now: \"Limpar\" empties the range; `fromKeyboard` is a click with `detail` 0 (Enter or Space). */\n onClear: ((fromKeyboard: boolean) => void) | undefined;\n testId: string;\n}): React.JSX.Element {\n const clear = useDataViewsCopy().filters.clear;\n return (\n <Box\n data-testid={`${testId}-calendar-line`}\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 2,\n mt: { xs: 0.25, sm: 1 },\n minHeight: canClear ? sxRem(40) : undefined,\n fontSize: sxRem(12),\n lineHeight: 1.5,\n }}\n >\n <Typography\n component=\"p\"\n aria-live=\"polite\"\n data-testid={`${testId}-calendar-hint`}\n title={text}\n noWrap\n sx={{ m: 0, minWidth: 0, font: 'inherit', color: isWindow ? 'text.primary' : 'text.secondary' }}\n >\n {text}\n </Typography>\n {onClear && (\n <Box\n component=\"button\"\n type=\"button\"\n onClick={(event) => onClear(event.detail === 0)}\n data-testid={`${testId}-clear`}\n sx={{\n flexShrink: 0,\n display: 'inline-flex',\n alignItems: 'center',\n minHeight: sxRem(40),\n border: 0,\n bgcolor: 'transparent',\n cursor: 'pointer',\n font: 'inherit',\n fontWeight: 600,\n color: 'primary.main',\n px: 1,\n py: 0,\n // Its text lines up with the boxes' right edge; the side padding\n // reaches into the popover's own.\n mr: -1,\n borderRadius: 1,\n '&:hover': { bgcolor: 'action.hover' },\n // The theme's focus ring for a keyboard, none for a tap.\n '&:focus': { outline: 'none' },\n '&:focus-visible': {\n outline: (theme: Theme) => `${rem(theme, 2)} solid`,\n outlineColor: 'primary.main',\n outlineOffset: sxRem(1),\n },\n }}\n >\n {clear}\n </Box>\n )}\n </Box>\n );\n}\n\n/** Props of {@link DayRangeCalendar}. */\nexport interface DayRangeCalendarProps {\n /** The filter's own label (\"Data\"), which names the calendar. */\n fieldLabel: string;\n value: RangeValue;\n /** Called with the range a tap leaves; never for a typed day. */\n onChange: (range: RangeValue) => void;\n /**\n * Months side by side. Two read as a period at a glance where there is room;\n * one, with the month/year selectors, where there is not.\n */\n months: 1 | 2;\n /**\n * Changes when the range moved from OUTSIDE the calendar (typed, a preset,\n * \"Limpar\"), so the calendar re-opens on it. Never for its own taps: a\n * calendar that jumped under the finger picking in it would be unusable.\n */\n viewKey: string;\n testId: string;\n /**\n * The applied window in words (\"Data: 01/10–15/10\"), said on the hint's own\n * line with \"Limpar\" at its end. Set by the pill, whose popover has no other\n * place for them; a panel says them in its own header and leaves this unset.\n */\n summary?: string;\n /**\n * Empties the range: the line's \"Limpar\", shown while `summary` is set. Set\n * only where the line may hold it; the line reserves its 40px only then.\n * `fromKeyboard` is true when it was pressed from the keyboard.\n */\n onClear?: (fromKeyboard: boolean) => void;\n}\n\nexport function DayRangeCalendar({\n fieldLabel,\n value,\n onChange,\n months,\n viewKey,\n testId,\n summary,\n onClear,\n}: DayRangeCalendarProps): React.JSX.Element {\n const copy: DataViewsDayCalendarCopy =\n useDataViewsCopy().filters.dayCalendar ?? (EN_US_DATA_VIEWS_COPY.filters.dayCalendar as DataViewsDayCalendarCopy);\n const range = rangeOf(value);\n const pick = (picked: DateRange) => onChange(rangeFromCalendar(value, picked));\n const waitingForEnd = Boolean(range.start && !range.end);\n\n return (\n <Box sx={ROOT_SX} data-testid={`${testId}-calendar`}>\n <Calendar\n key={viewKey}\n ariaLabel={copy.label(fieldLabel)}\n className={CALENDAR_CLASS}\n selectionMode=\"range\"\n locale={copy.locale}\n labels={copy.caption}\n // Sunday first, as a pt-BR calendar reads (`D S T Q Q S S`) and as the\n // presets' \"Esta semana\" counts.\n firstDayOfWeek={0}\n numberOfMonths={months}\n // Side by side, a day of the next month in this one is the same day\n // twice; one month alone keeps them, muted, as a six-week frame.\n showOutsideDays={months === 1}\n captionLayout={months > 1 ? 'arrows' : 'selectors'}\n defaultMonth={openingMonth(value, months)}\n range={range}\n // The intermediate callback does the work: the other fires only on the\n // tap that CLOSES a period, so the first tap would write nothing.\n onIntermediateRangeChange={pick}\n />\n <HintLine\n text={waitingForEnd ? copy.pickEnd : (summary ?? copy.pickStart)}\n isWindow={!waitingForEnd && summary !== undefined}\n canClear={onClear !== undefined}\n onClear={summary === undefined ? undefined : onClear}\n testId={testId}\n />\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,OAAO,SAAS;AAChB,OAAO,gBAAgB;AAqInB,SAaE,KAbF;AAzHJ,IAAM,iBAAiB;AAQvB,IAAM,UAAU,CAAC,WAAkB;AAAA,EACjC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI;AAAA;AAAA;AAAA,EAGrB,uDAAuD,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,EAAE;AAAA,EAChF,mCAAmC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE;AAAA,EAC1D,2BAA2B,EAAE,QAAQ,EAAE,IAAI,IAAI,OAAO,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhF,mFAAmF,EAAE,IAAI,KAAK,UAAU,EAAE;AAAA,EAC1G,CAAC,MAAM,cAAc,EAAE,GAAG;AAAA,IACxB,GAAG;AAAA,IACH,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,iBAAiB;AAAA;AAAA;AAAA;AAAA,IAIjB,kBAAkB,EAAE,SAAS,OAAO;AAAA,IACpC,mBAAmB;AAAA,MACjB,SAAS,CAACA,WAAiB,GAAG,IAAIA,QAAO,CAAC,CAAC;AAAA,MAC3C,cAAc;AAAA,MACd,eAAe,MAAM,CAAC;AAAA,IACxB;AAAA,EACF;AACF;AAGA,SAAS,QAAQ,OAA8B;AAC7C,SAAO;AAAA,IAC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3B,QAAM,OAAO,CAAC,WAAsB,SAAS,kBAAkB,OAAO,MAAM,CAAC;AAC7E,QAAM,gBAAgB,QAAQ,MAAM,SAAS,CAAC,MAAM,GAAG;AAEvD,SACE,qBAAC,OAAI,IAAI,SAAS,eAAa,GAAG,MAAM,aACtC;AAAA;AAAA,MAAC;AAAA;AAAA,QAEC,WAAW,KAAK,MAAM,UAAU;AAAA,QAChC,WAAW;AAAA,QACX,eAAc;AAAA,QACd,QAAQ,KAAK;AAAA,QACb,QAAQ,KAAK;AAAA,QAGb,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAGhB,iBAAiB,WAAW;AAAA,QAC5B,eAAe,SAAS,IAAI,WAAW;AAAA,QACvC,cAAc,aAAa,OAAO,MAAM;AAAA,QACxC;AAAA,QAGA,2BAA2B;AAAA;AAAA,MAlBtB;AAAA,IAmBP;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,gBAAgB,KAAK,UAAW,WAAW,KAAK;AAAA,QACtD,UAAU,CAAC,iBAAiB,YAAY;AAAA,QACxC,UAAU,YAAY;AAAA,QACtB,SAAS,YAAY,SAAY,SAAY;AAAA,QAC7C;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["theme"]}
|
|
@@ -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-QE4KYG5I.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-KQDBOZQE.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-T7OIVPCO.js";
|
|
6
6
|
import {
|
|
7
7
|
MoreFilters
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DWH4TQXK.js";
|
|
9
9
|
import {
|
|
10
10
|
PillControl
|
|
11
11
|
} from "./chunk-AJ6KFHEE.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-KYUEO2IO.js";
|
|
15
15
|
import {
|
|
16
16
|
RangePill
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3WYEENUH.js";
|
|
18
18
|
import {
|
|
19
19
|
QuickChip
|
|
20
20
|
} from "./chunk-AT6UKTH4.js";
|
|
@@ -251,4 +251,4 @@ function FilterSlots({
|
|
|
251
251
|
export {
|
|
252
252
|
InlineFilterControls
|
|
253
253
|
};
|
|
254
|
-
//# sourceMappingURL=chunk-
|
|
254
|
+
//# sourceMappingURL=chunk-QE4KYG5I.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRangeSet,
|
|
3
|
+
rangeChipLabel
|
|
4
|
+
} from "./chunk-GCZJH4XL.js";
|
|
5
|
+
import {
|
|
6
|
+
useDataViewsCopy
|
|
7
|
+
} from "./chunk-KHG57NAE.js";
|
|
8
|
+
import {
|
|
9
|
+
sxRem
|
|
10
|
+
} from "./chunk-YKCAJ2TN.js";
|
|
11
|
+
|
|
12
|
+
// src/components/data-display/DataViews/data-views-range-summary.tsx
|
|
13
|
+
import Box from "@mui/material/Box/index.js";
|
|
14
|
+
import Button from "@mui/material/Button/index.js";
|
|
15
|
+
import Typography from "@mui/material/Typography/index.js";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function RangeSummary({
|
|
18
|
+
field,
|
|
19
|
+
value,
|
|
20
|
+
onClear,
|
|
21
|
+
testId
|
|
22
|
+
}) {
|
|
23
|
+
const copy = useDataViewsCopy();
|
|
24
|
+
if (field.kind === "day" || !isRangeSet(value)) return null;
|
|
25
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, mt: { xs: 0.5, sm: 1.5 } }, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", sx: { fontSize: sxRem(12), color: "text.secondary" }, children: rangeChipLabel(field, value) }),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
Button,
|
|
29
|
+
{
|
|
30
|
+
variant: "text",
|
|
31
|
+
size: "small",
|
|
32
|
+
onClick: onClear,
|
|
33
|
+
"data-testid": `${testId}-clear`,
|
|
34
|
+
sx: { textTransform: "none" },
|
|
35
|
+
children: copy.filters.clear
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
RangeSummary
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=chunk-WLDP7C4K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-range-summary.tsx"],"sourcesContent":["'use client';\n\nimport Box from '@mui/material/Box/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport React from 'react';\n\nimport { useDataViewsCopy } from './data-views-copy-context';\nimport { isRangeSet, rangeChipLabel } from './data-views-range-values';\nimport type { RangeFieldConfig, RangeValue } from './data-views-types';\nimport { sxRem } from '../../../tokens/relative';\n\n/**\n * The applied window in words, and \"Limpar\", under a NUMBER range's boxes.\n *\n * An inverted window is not an error the merchant must fix before the list\n * responds — it simply matches nothing, and saying so beats an empty grid with\n * no explanation (FUT-668).\n *\n * A DAY range says these on its calendar's hint line instead (FUT-4144): a row\n * of its own, held empty until the first tap so the popover would not grow,\n * left 59px of white under the hint at 1280.\n */\nexport function RangeSummary<T extends Record<string, unknown>>({\n field,\n value,\n onClear,\n testId,\n}: {\n field: RangeFieldConfig<T>;\n value: RangeValue;\n onClear: () => void;\n testId: string;\n}): React.JSX.Element | null {\n const copy = useDataViewsCopy();\n if (field.kind === 'day' || !isRangeSet(value)) return null;\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 2, mt: { xs: 0.5, sm: 1.5 } }}>\n <Typography component=\"span\" sx={{ fontSize: sxRem(12), color: 'text.secondary' }}>\n {rangeChipLabel(field, value)}\n </Typography>\n <Button\n variant=\"text\"\n size=\"small\"\n onClick={onClear}\n data-testid={`${testId}-clear`}\n sx={{ textTransform: 'none' }}\n >\n {copy.filters.clear}\n </Button>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAEA,OAAO,SAAS;AAChB,OAAO,YAAY;AACnB,OAAO,gBAAgB;AAiCnB,SACE,KADF;AAdG,SAAS,aAAgD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAK6B;AAC3B,QAAM,OAAO,iBAAiB;AAC9B,MAAI,MAAM,SAAS,SAAS,CAAC,WAAW,KAAK,EAAG,QAAO;AACvD,SACE,qBAAC,OAAI,IAAI,EAAE,SAAS,QAAQ,YAAY,UAAU,gBAAgB,iBAAiB,KAAK,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI,EAAE,GAClH;AAAA,wBAAC,cAAW,WAAU,QAAO,IAAI,EAAE,UAAU,MAAM,EAAE,GAAG,OAAO,iBAAiB,GAC7E,yBAAe,OAAO,KAAK,GAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,SAAS;AAAA,QACT,eAAa,GAAG,MAAM;AAAA,QACtB,IAAI,EAAE,eAAe,OAAO;AAAA,QAE3B,eAAK,QAAQ;AAAA;AAAA,IAChB;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataViewsTableBase
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3I5PHWKQ.js";
|
|
4
4
|
import "../chunk-YNVTUQ5B.js";
|
|
5
5
|
import {
|
|
6
6
|
DataViewsGrid
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-CNUO2BRV.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseListCard
|
|
10
10
|
} from "../chunk-IWSTMVCA.js";
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
useDragItem
|
|
24
24
|
} from "../chunk-K4EKTMTC.js";
|
|
25
25
|
import "../chunk-ZOLAYP2D.js";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-KQDBOZQE.js";
|
|
27
|
+
import "../chunk-FYUNROLW.js";
|
|
28
28
|
import "../chunk-MKVDHR3B.js";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-QE4KYG5I.js";
|
|
30
30
|
import "../chunk-T7OIVPCO.js";
|
|
31
31
|
import "../chunk-X3AFXHY5.js";
|
|
32
32
|
import "../chunk-XNAI7QGU.js";
|
|
@@ -36,19 +36,19 @@ import {
|
|
|
36
36
|
import "../chunk-4ZQQUICR.js";
|
|
37
37
|
import "../chunk-XZFTRGRW.js";
|
|
38
38
|
import "../chunk-WWH674WU.js";
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-DWH4TQXK.js";
|
|
40
|
+
import "../chunk-D2JQF2WC.js";
|
|
41
41
|
import "../chunk-AJ6KFHEE.js";
|
|
42
42
|
import "../chunk-KYUEO2IO.js";
|
|
43
43
|
import "../chunk-GZOW6HNN.js";
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-3WYEENUH.js";
|
|
45
|
+
import "../chunk-WLDP7C4K.js";
|
|
46
|
+
import "../chunk-FC7UCFFA.js";
|
|
47
47
|
import "../chunk-LZNUBQ5I.js";
|
|
48
48
|
import "../chunk-2FKWKLSC.js";
|
|
49
49
|
import "../chunk-YOPMXGHY.js";
|
|
50
50
|
import "../chunk-CBOB5AV6.js";
|
|
51
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-HRES2S3Q.js";
|
|
52
52
|
import "../chunk-AT6UKTH4.js";
|
|
53
53
|
import "../chunk-5YDS6HO3.js";
|
|
54
54
|
import "../chunk-OY437NRJ.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Theme } from "@mui/material/styles/index.js";
|
|
1
2
|
import type { OverflowField } from "./data-views-overflow";
|
|
2
3
|
import type { QuickFilterConfig, RangeValue } from "./data-views-types";
|
|
3
4
|
/** What each field's control needs, minus the panel's own chrome. */
|
|
@@ -28,6 +29,85 @@ export declare function fieldClearing<T extends Record<string, unknown>>({ field
|
|
|
28
29
|
export declare function MoreQuick({ quick, pills, onToggleQuick, testIdPrefix, }: {
|
|
29
30
|
quick: QuickFilterConfig;
|
|
30
31
|
} & Pick<MoreFieldProps, "pills" | "onToggleQuick" | "testIdPrefix">): React.JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* The "Mais" panel's vertical rhythm, in the theme's spacing units: the unit
|
|
34
|
+
* the header "Limpar"'s phone target reaches into (FUT-4144). The target is
|
|
35
|
+
* the button's 18px of text plus `reachUp` and `reachDown`, 40px at the
|
|
36
|
+
* default type scale, and it may never reach further than the gap that is
|
|
37
|
+
* there: under the group or quick chip above it (or the scroller's own top
|
|
38
|
+
* inset, for the first group) and under its own header. Sideways it reaches
|
|
39
|
+
* into the header row's empty gap and the scroller's padding, so a 37px
|
|
40
|
+
* "Limpar" is 41px wide.
|
|
41
|
+
*/
|
|
42
|
+
export declare const MORE_SPACING: {
|
|
43
|
+
/** Under a group. */
|
|
44
|
+
readonly underGroup: 1.5;
|
|
45
|
+
/** Under a shed quick chip, below `sm` (8px from `sm` up, as before). */
|
|
46
|
+
readonly underQuick: 1.5;
|
|
47
|
+
/**
|
|
48
|
+
* The scroller's top inset (`data-views-more-filters.tsx`), at every width:
|
|
49
|
+
* the first group's overlay reaches into it. Not part of a responsive `p`,
|
|
50
|
+
* whose `xs` value is emitted as a media query and would win over it.
|
|
51
|
+
*/
|
|
52
|
+
readonly aboveFirst: 1.5;
|
|
53
|
+
/** Under a group's header, below `sm`, applied or not, so nothing moves on apply. */
|
|
54
|
+
readonly underHeader: 1.25;
|
|
55
|
+
/** Under a group's header from `sm` up, as it always was. */
|
|
56
|
+
readonly underHeaderFromSm: 0.5;
|
|
57
|
+
readonly reachUp: 1.5;
|
|
58
|
+
readonly reachDown: 1.25;
|
|
59
|
+
readonly reachSide: 0.25;
|
|
60
|
+
};
|
|
61
|
+
/** A group's header row: the field's name, and "Limpar" while it is applied. */
|
|
62
|
+
export declare const moreHeaderSx: (theme: Theme) => {
|
|
63
|
+
[x: string]: string | number | {
|
|
64
|
+
mb: 0.5;
|
|
65
|
+
};
|
|
66
|
+
display: string;
|
|
67
|
+
alignItems: string;
|
|
68
|
+
gap: number;
|
|
69
|
+
mb: 1.25;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* "Limpar" is 12px text, a 37×18 button: on a phone that was the whole target
|
|
73
|
+
* (FUT-4144, measured in the admin at 320–900). Below `sm` an overlay makes it
|
|
74
|
+
* at least 40×40 without moving the text, reaching only into gaps
|
|
75
|
+
* {@link MORE_SPACING} guarantees, in the same unit, so it grows and shrinks
|
|
76
|
+
* with them and covers nothing else. From `sm` up there is no overlay and the
|
|
77
|
+
* button is exactly as it was.
|
|
78
|
+
*/
|
|
79
|
+
export declare const clearTargetSx: (theme: Theme) => {
|
|
80
|
+
[x: string]: "relative" | {
|
|
81
|
+
position: "static";
|
|
82
|
+
content?: undefined;
|
|
83
|
+
top?: undefined;
|
|
84
|
+
bottom?: undefined;
|
|
85
|
+
left?: undefined;
|
|
86
|
+
right?: undefined;
|
|
87
|
+
} | {
|
|
88
|
+
[x: string]: string | {
|
|
89
|
+
display: string;
|
|
90
|
+
};
|
|
91
|
+
content: string;
|
|
92
|
+
position: "absolute";
|
|
93
|
+
top: string;
|
|
94
|
+
bottom: string;
|
|
95
|
+
left: string;
|
|
96
|
+
right: string;
|
|
97
|
+
};
|
|
98
|
+
position: "relative";
|
|
99
|
+
"&::before": {
|
|
100
|
+
[x: string]: string | {
|
|
101
|
+
display: string;
|
|
102
|
+
};
|
|
103
|
+
content: string;
|
|
104
|
+
position: "absolute";
|
|
105
|
+
top: string;
|
|
106
|
+
bottom: string;
|
|
107
|
+
left: string;
|
|
108
|
+
right: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
31
111
|
/** One labelled group in the panel: the field's name, then its control. */
|
|
32
112
|
export declare function MoreGroup<T extends Record<string, unknown>>({ field, pills, ranges, onTogglePill, onChangeRange, testIdPrefix, }: {
|
|
33
113
|
field: OverflowField<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-views-more-fields.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-more-fields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-views-more-fields.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-more-fields.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAM3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASxE,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,YAAY,EA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;;;;;;CAYxC,CAAC;AAEH,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC3D,KAAK,EACL,KAAK,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,GACb,EAAE;IACD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;CACzB,GAAG,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2DrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-views-more-filters.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-more-filters.tsx"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"data-views-more-filters.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-more-filters.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAqD,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAElH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;;;;;;;;GAUG;AAEH,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,cAAc;IAClF,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5B;AAmND,oCAAoC;AACpC,UAAU,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IAC5F,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC7D,MAAM,EACN,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAe,EACf,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAuDrD"}
|
|
@@ -24,12 +24,17 @@ interface RangeBoundsProps<T extends Record<string, unknown>> {
|
|
|
24
24
|
* its content and keeps the boxes' own width.
|
|
25
25
|
*/
|
|
26
26
|
fillRow?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Say the applied window, and its "Limpar", on the day calendar's hint line.
|
|
29
|
+
* The pill's popover sets it; a panel has them in its own header.
|
|
30
|
+
*/
|
|
31
|
+
summaryOnHint?: boolean;
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
29
34
|
* The `De`/`Até` pair for a range — shared by the pill's popover and the
|
|
30
35
|
* slide-in panel's day fields, so the two surfaces cannot drift on what a bound
|
|
31
36
|
* accepts or how it clears.
|
|
32
37
|
*/
|
|
33
|
-
export declare function RangeBounds<T extends Record<string, unknown>>({ field, value, onChange, testId, calendarMonths, showCalendar, fillRow, }: RangeBoundsProps<T>): React.JSX.Element;
|
|
38
|
+
export declare function RangeBounds<T extends Record<string, unknown>>({ field, value, onChange, testId, calendarMonths, showCalendar, fillRow, summaryOnHint, }: RangeBoundsProps<T>): React.JSX.Element;
|
|
34
39
|
export {};
|
|
35
40
|
//# sourceMappingURL=data-views-range-bounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-views-range-bounds.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-range-bounds.tsx"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"data-views-range-bounds.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-range-bounds.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiJvE,oCAAoC;AACpC,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC7D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAkB,EAClB,YAAmB,EACnB,OAAe,EACf,aAAqB,GACtB,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkEzC"}
|