@12-apps/ui 6.24.3 → 6.24.5
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/CardKit/row-actions-to-menu.js +1 -1
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +5 -5
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +2 -2
- package/dist/_internal/components/index.js +2 -2
- package/dist/_internal/components/layout/ContentToolbar/ContentToolbar.js +1 -1
- package/dist/_internal/components/layout/index.js +1 -1
- package/dist/_internal/components/navigation/AppHeader/AppHeader.identity.js +1 -1
- package/dist/_internal/components/navigation/index.js +1 -1
- package/dist/{chunk-JD4IVP22.js → chunk-4ZV7N5CU.js} +2 -2
- package/dist/{chunk-QX2PLXQA.js → chunk-53PDVLRK.js} +2 -2
- package/dist/{chunk-7GKRZJWI.js → chunk-EMMPNB6D.js} +2 -2
- package/dist/{chunk-TSPHRZ4U.js → chunk-L2E7TY7P.js} +76 -36
- package/dist/chunk-L2E7TY7P.js.map +1 -0
- package/dist/{chunk-NXNNICH7.js → chunk-LWRMKF7D.js} +2 -2
- package/dist/{chunk-W2YNUUVJ.js → chunk-TU6RNZUQ.js} +117 -78
- package/dist/chunk-TU6RNZUQ.js.map +1 -0
- package/dist/{chunk-5MXVT7DO.js → chunk-ZBXG6RVJ.js} +2 -2
- package/dist/chunk-ZBXG6RVJ.js.map +1 -0
- package/dist/{chunk-JPV45AD6.js → chunk-ZXOT3U6U.js} +2 -2
- package/dist/data-display/CardKit.js +1 -1
- package/dist/data-display/DataViews.js +6 -6
- package/dist/layout/ContentToolbar.js +1 -1
- package/dist/navigation/AppHeader.js +1 -1
- package/dist/types/components/data-display/CardKit/row-actions-to-menu.d.ts +18 -2
- package/dist/types/components/data-display/CardKit/row-actions-to-menu.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.d.ts.map +1 -1
- package/dist/types/components/navigation/AppHeader/AppHeader.identity.d.ts +12 -5
- package/dist/types/components/navigation/AppHeader/AppHeader.identity.d.ts.map +1 -1
- package/dist/types/components/navigation/AppHeader/AppHeader.types.d.ts +12 -4
- package/dist/types/components/navigation/AppHeader/AppHeader.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/CardKit/row-actions-to-menu.ts +19 -2
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +43 -0
- package/src/components/layout/ContentToolbar/ContentToolbar.tsx +82 -26
- package/src/components/navigation/AppHeader/AppHeader.identity.tsx +159 -86
- package/src/components/navigation/AppHeader/AppHeader.md +12 -5
- package/src/components/navigation/AppHeader/AppHeader.types.ts +12 -4
- package/dist/chunk-5MXVT7DO.js.map +0 -1
- package/dist/chunk-TSPHRZ4U.js.map +0 -1
- package/dist/chunk-W2YNUUVJ.js.map +0 -1
- /package/dist/{chunk-JD4IVP22.js.map → chunk-4ZV7N5CU.js.map} +0 -0
- /package/dist/{chunk-QX2PLXQA.js.map → chunk-53PDVLRK.js.map} +0 -0
- /package/dist/{chunk-7GKRZJWI.js.map → chunk-EMMPNB6D.js.map} +0 -0
- /package/dist/{chunk-NXNNICH7.js.map → chunk-LWRMKF7D.js.map} +0 -0
- /package/dist/{chunk-JPV45AD6.js.map → chunk-ZXOT3U6U.js.map} +0 -0
|
@@ -68,35 +68,95 @@ var AppHeaderStatus = ({
|
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
AppHeaderStatus.displayName = "AppHeaderStatus";
|
|
71
|
-
var
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
var IdentityTitle = ({ title, size = "md", interactive, disclosed, dataTestId }) => /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.25, minWidth: 0, width: "100%" }, children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Typography,
|
|
74
|
+
{
|
|
75
|
+
component: "span",
|
|
76
|
+
"data-testid": `${dataTestId}-title`,
|
|
77
|
+
sx: { fontSize: TITLE_PX[size], fontWeight: 700, lineHeight: 1.2, ...ONE_LINE },
|
|
78
|
+
children: title
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
interactive && /* @__PURE__ */ jsx(
|
|
82
|
+
KeyboardArrowDown,
|
|
83
|
+
{
|
|
84
|
+
"aria-hidden": true,
|
|
85
|
+
"data-testid": `${dataTestId}-chevron`,
|
|
86
|
+
sx: {
|
|
87
|
+
flex: "0 0 auto",
|
|
88
|
+
fontSize: 20,
|
|
89
|
+
opacity: 0.7,
|
|
90
|
+
transition: "transform 150ms ease",
|
|
91
|
+
transform: disclosed ? "rotate(180deg)" : "none"
|
|
80
92
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
var discloseSx = {
|
|
97
|
+
display: "flex",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
gap: 0.25,
|
|
100
|
+
width: "100%",
|
|
101
|
+
minWidth: 0,
|
|
102
|
+
appearance: "none",
|
|
103
|
+
px: 0.5,
|
|
104
|
+
mx: -0.5,
|
|
105
|
+
py: 0.25,
|
|
106
|
+
my: -0.25,
|
|
107
|
+
border: "none",
|
|
108
|
+
borderRadius: 1.5,
|
|
109
|
+
background: "none",
|
|
110
|
+
color: "inherit",
|
|
111
|
+
font: "inherit",
|
|
112
|
+
textAlign: "left",
|
|
113
|
+
cursor: "pointer",
|
|
114
|
+
// Guarded: on a touch screen an unguarded `:hover` sticks after the tap that
|
|
115
|
+
// opened the panel, so the row stays highlighted behind it.
|
|
116
|
+
"@media (hover: hover)": { "&:hover": { backgroundColor: "action.hover" } },
|
|
117
|
+
"&:focus-visible": { outline: "2px solid", outlineColor: "primary.main", outlineOffset: 2 }
|
|
118
|
+
};
|
|
119
|
+
var IdentityText = ({
|
|
120
|
+
title,
|
|
121
|
+
subtitle,
|
|
122
|
+
status,
|
|
123
|
+
size = "md",
|
|
124
|
+
onDisclose,
|
|
125
|
+
disclosed,
|
|
126
|
+
discloseLabel,
|
|
127
|
+
className,
|
|
128
|
+
dataTestId
|
|
129
|
+
}) => {
|
|
130
|
+
const name = /* @__PURE__ */ jsx(
|
|
131
|
+
IdentityTitle,
|
|
132
|
+
{
|
|
133
|
+
title,
|
|
134
|
+
size,
|
|
135
|
+
interactive: Boolean(onDisclose),
|
|
136
|
+
disclosed,
|
|
137
|
+
dataTestId
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { minWidth: 0, flex: 1, display: "flex", flexDirection: "column", gap: 0.25 }, children: [
|
|
141
|
+
onDisclose ? /* @__PURE__ */ jsx(
|
|
142
|
+
Box,
|
|
84
143
|
{
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
144
|
+
component: "button",
|
|
145
|
+
type: "button",
|
|
146
|
+
className,
|
|
147
|
+
"data-testid": dataTestId,
|
|
148
|
+
onClick: onDisclose,
|
|
149
|
+
"aria-haspopup": "dialog",
|
|
150
|
+
"aria-expanded": disclosed,
|
|
151
|
+
"aria-label": discloseLabel ?? `Detalhes de ${title}`,
|
|
152
|
+
sx: discloseSx,
|
|
153
|
+
children: name
|
|
94
154
|
}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
155
|
+
) : name,
|
|
156
|
+
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", component: "span", sx: ONE_LINE, children: subtitle }),
|
|
157
|
+
status
|
|
158
|
+
] });
|
|
159
|
+
};
|
|
100
160
|
var IdentitySkeleton = ({
|
|
101
161
|
size,
|
|
102
162
|
dataTestId
|
|
@@ -138,59 +198,38 @@ var AppHeaderIdentity = ({
|
|
|
138
198
|
dataTestId = "app-header-identity"
|
|
139
199
|
}) => {
|
|
140
200
|
if (loading) return /* @__PURE__ */ jsx(IdentitySkeleton, { size, dataTestId });
|
|
141
|
-
|
|
142
|
-
mark ?? /* @__PURE__ */ jsx(
|
|
143
|
-
AppHeaderBrand,
|
|
144
|
-
{
|
|
145
|
-
name: title,
|
|
146
|
-
logoUrl,
|
|
147
|
-
seedColor,
|
|
148
|
-
size,
|
|
149
|
-
dataTestId: `${dataTestId}-brand`
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
153
|
-
IdentityText,
|
|
154
|
-
{
|
|
155
|
-
title,
|
|
156
|
-
subtitle,
|
|
157
|
-
status,
|
|
158
|
-
size,
|
|
159
|
-
interactive: Boolean(onDisclose),
|
|
160
|
-
disclosed,
|
|
161
|
-
dataTestId
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
] });
|
|
165
|
-
if (!onDisclose) {
|
|
166
|
-
return /* @__PURE__ */ jsx(Box, { className, "data-testid": dataTestId, sx: rowSx, children: body });
|
|
167
|
-
}
|
|
168
|
-
return /* @__PURE__ */ jsx(
|
|
201
|
+
return /* @__PURE__ */ jsxs(
|
|
169
202
|
Box,
|
|
170
203
|
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
className: onDisclose ? void 0 : className,
|
|
205
|
+
"data-testid": onDisclose ? void 0 : dataTestId,
|
|
206
|
+
sx: rowSx,
|
|
207
|
+
children: [
|
|
208
|
+
mark ?? /* @__PURE__ */ jsx(
|
|
209
|
+
AppHeaderBrand,
|
|
210
|
+
{
|
|
211
|
+
name: title,
|
|
212
|
+
logoUrl,
|
|
213
|
+
seedColor,
|
|
214
|
+
size,
|
|
215
|
+
dataTestId: `${dataTestId}-brand`
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
IdentityText,
|
|
220
|
+
{
|
|
221
|
+
title,
|
|
222
|
+
subtitle,
|
|
223
|
+
status,
|
|
224
|
+
size,
|
|
225
|
+
onDisclose,
|
|
226
|
+
disclosed,
|
|
227
|
+
discloseLabel,
|
|
228
|
+
className,
|
|
229
|
+
dataTestId
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
]
|
|
194
233
|
}
|
|
195
234
|
);
|
|
196
235
|
};
|
|
@@ -200,4 +239,4 @@ export {
|
|
|
200
239
|
AppHeaderStatus,
|
|
201
240
|
AppHeaderIdentity
|
|
202
241
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-TU6RNZUQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/navigation/AppHeader/AppHeader.identity.tsx"],"sourcesContent":["'use client';\n\nimport KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown';\nimport Box from '@mui/material/Box/index.js';\nimport Skeleton from '@mui/material/Skeleton/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { accentFor, type SizeValue } from '../../../tokens/scales';\n\nimport { AppHeaderBrand } from './AppHeader.brand';\nimport type { AppHeaderIdentityProps, AppHeaderStatusProps } from './AppHeader.types';\n\n/** Title type scale, per house size step. */\nconst TITLE_PX: Record<SizeValue, number> = { xs: 14, sm: 15, md: 17, lg: 20, xl: 24 };\n\n/** One line, ellipsised — a long store name must not push the actions off-screen. */\nconst ONE_LINE = {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n} as const;\n\n/**\n * The dotted state line: \"● Aberto agora · Retirada no balcão\".\n *\n * Segments are joined here rather than by the caller because the separator is a\n * presentational choice — a caller that pre-joins its own string can never be\n * restyled, and each segment loses the chance to carry its own markup.\n */\nexport const AppHeaderStatus: React.FC<AppHeaderStatusProps> = ({\n tone,\n items,\n separator = '·',\n className,\n dataTestId = 'app-header-status',\n}) => {\n const theme = useTheme();\n const visible = items.filter((item) => item !== null && item !== undefined && item !== '');\n if (visible.length === 0) return null;\n\n return (\n <Box\n className={className}\n data-testid={dataTestId}\n sx={{ display: 'flex', alignItems: 'center', gap: 0.75, ...ONE_LINE }}\n >\n {tone && (\n <Box\n aria-hidden\n data-testid={`${dataTestId}-dot`}\n sx={{\n width: 8,\n height: 8,\n flex: '0 0 auto',\n borderRadius: '50%',\n backgroundColor: accentFor(theme, tone).main,\n }}\n />\n )}\n <Typography variant=\"body2\" color=\"text.secondary\" component=\"span\" sx={ONE_LINE}>\n {visible.map((item, index) => (\n // Index keys: the segments are positional presentation, and nothing\n // here reorders or is keyed on identity elsewhere.\n <React.Fragment key={index}>\n {index > 0 && (\n <>\n {/* Real spaces, not margin. A screen reader reads `textContent`,\n and a CSS-only gap runs \"Aberto agora\" straight into\n \"Retirada no balcão\" as one word. The glyph itself is\n hidden — it is punctuation, not something to announce. */}\n {' '}\n <Box component=\"span\" aria-hidden>\n {separator}\n </Box>{' '}\n </>\n )}\n {item}\n </React.Fragment>\n ))}\n </Typography>\n </Box>\n );\n};\n\nAppHeaderStatus.displayName = 'AppHeaderStatus';\n\n/** The name and, when the block opens onto something, the chevron beside it. */\nconst IdentityTitle: React.FC<\n Pick<AppHeaderIdentityProps, 'title' | 'size'> & {\n interactive: boolean;\n disclosed: boolean;\n dataTestId: string;\n }\n> = ({ title, size = 'md', interactive, disclosed, dataTestId }) => (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.25, minWidth: 0, width: '100%' }}>\n <Typography\n component=\"span\"\n data-testid={`${dataTestId}-title`}\n sx={{ fontSize: TITLE_PX[size], fontWeight: 700, lineHeight: 1.2, ...ONE_LINE }}\n >\n {title}\n </Typography>\n {interactive && (\n <KeyboardArrowDown\n aria-hidden\n data-testid={`${dataTestId}-chevron`}\n sx={{\n flex: '0 0 auto',\n fontSize: 20,\n opacity: 0.7,\n transition: 'transform 150ms ease',\n transform: disclosed ? 'rotate(180deg)' : 'none',\n }}\n />\n )}\n </Box>\n);\n\n/**\n * The disclosure, wrapping the NAME ROW and nothing else (12-63).\n *\n * The padding is cancelled by an equal negative margin, so the hover and the\n * focus ring bleed outward while the title still starts on the same pixel as\n * the lines under it. A padded button with no offset moves one of the two.\n */\nconst discloseSx = {\n display: 'flex',\n alignItems: 'center',\n gap: 0.25,\n width: '100%',\n minWidth: 0,\n appearance: 'none',\n px: 0.5,\n mx: -0.5,\n py: 0.25,\n my: -0.25,\n border: 'none',\n borderRadius: 1.5,\n background: 'none',\n color: 'inherit',\n font: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n // Guarded: on a touch screen an unguarded `:hover` sticks after the tap that\n // opened the panel, so the row stays highlighted behind it.\n '@media (hover: hover)': { '&:hover': { backgroundColor: 'action.hover' } },\n '&:focus-visible': { outline: '2px solid', outlineColor: 'primary.main', outlineOffset: 2 },\n} as const;\n\n/**\n * The text column: the name row, then the quieter lines under it.\n *\n * ## `subtitle` and `status` are OUTSIDE the disclosure, on purpose (12-63)\n *\n * Both are `ReactNode`, and `AppHeaderStatus.items` is a `ReactNode[]` — so a\n * segment of the state line is free to be a control, and consumers put controls\n * there: a mesa chip, a service-mode picker. While the whole block was one\n * `<button>` those were `<button>`s inside a `<button>`, which is invalid HTML\n * (the content model of `button` excludes interactive content) and, more\n * visibly, means one tap fires two handlers. An adopting storefront opened two\n * popups on every tap of either control because of it, and had already\n * hand-rolled this component at one tier to dodge the nesting — a consumer\n * working around the component is the report.\n *\n * The target stays large. The button is the full-width NAME ROW, which is the\n * thing a reader aims at — what it gives up is the mark beside it, and a mark\n * that opens the panel is not worth a state line that cannot hold a control.\n */\nconst IdentityText: React.FC<\n Pick<\n AppHeaderIdentityProps,\n 'title' | 'subtitle' | 'status' | 'size' | 'discloseLabel' | 'className'\n > & {\n onDisclose: (() => void) | undefined;\n disclosed: boolean;\n dataTestId: string;\n }\n> = ({\n title,\n subtitle,\n status,\n size = 'md',\n onDisclose,\n disclosed,\n discloseLabel,\n className,\n dataTestId,\n}) => {\n const name = (\n <IdentityTitle\n title={title}\n size={size}\n interactive={Boolean(onDisclose)}\n disclosed={disclosed}\n dataTestId={dataTestId}\n />\n );\n return (\n <Box sx={{ minWidth: 0, flex: 1, display: 'flex', flexDirection: 'column', gap: 0.25 }}>\n {onDisclose ? (\n <Box\n component=\"button\"\n type=\"button\"\n className={className}\n data-testid={dataTestId}\n onClick={onDisclose}\n aria-haspopup=\"dialog\"\n aria-expanded={disclosed}\n aria-label={discloseLabel ?? `Detalhes de ${title}`}\n sx={discloseSx}\n >\n {name}\n </Box>\n ) : (\n name\n )}\n {subtitle && (\n <Typography variant=\"body2\" color=\"text.secondary\" component=\"span\" sx={ONE_LINE}>\n {subtitle}\n </Typography>\n )}\n {status}\n </Box>\n );\n};\n\n/** The placeholder held while the identity is still resolving. */\nconst IdentitySkeleton: React.FC<{ size: SizeValue; dataTestId: string }> = ({\n size,\n dataTestId,\n}) => (\n <Box\n data-testid={`${dataTestId}-loading`}\n sx={{ display: 'flex', alignItems: 'center', gap: 1.25, minWidth: 0 }}\n >\n <Skeleton variant=\"rounded\" width={40} height={40} sx={{ flex: '0 0 auto' }} />\n <Box sx={{ minWidth: 0, flex: 1 }}>\n <Skeleton variant=\"text\" width={140} height={TITLE_PX[size] * 1.4} />\n <Skeleton variant=\"text\" width={180} height={16} />\n </Box>\n </Box>\n);\n\n/**\n * The BLOCK's row: the mark, then the text column beside it.\n *\n * Always a `Box` div now — since 12-63 the disclosure is the name row inside\n * the text column ({@link discloseSx}), not this element. `width: '100%'` and\n * `minWidth: 0` stay because the column below still has to ellipsise against\n * something; the argument about a `<button>` sizing to max-content moved to\n * `discloseSx`, which is where the button now is.\n */\nconst rowSx = {\n display: 'flex',\n alignItems: 'center',\n gap: 1.25,\n width: '100%',\n minWidth: 0,\n textAlign: 'left',\n} as const;\n\n/**\n * Mark + title + state line, and — when it can be opened — a name row that is\n * the button.\n *\n * The disclosure used to wrap EVERYTHING, on the argument that the chevron\n * alone is a 20px target next to a 40px mark that does nothing. The target is\n * still not the chevron: the button is the full-width NAME ROW, which is what a\n * reader aims at. What it no longer swallows is the mark beside it and the\n * quieter lines below — because those lines take `ReactNode`s, consumers put\n * CONTROLS in them, and a control inside a button is invalid HTML whose every\n * tap fires two handlers. See {@link IdentityText} (12-63).\n *\n * `className` and `dataTestId` stay on the same elements they always named: the\n * block when it is static, the disclosure when there is one.\n */\nexport const AppHeaderIdentity: React.FC<AppHeaderIdentityProps> = ({\n title,\n subtitle,\n status,\n mark,\n logoUrl,\n seedColor,\n onDisclose,\n disclosed = false,\n discloseLabel,\n loading = false,\n size = 'md',\n className,\n dataTestId = 'app-header-identity',\n}) => {\n if (loading) return <IdentitySkeleton size={size} dataTestId={dataTestId} />;\n\n return (\n <Box\n className={onDisclose ? undefined : className}\n data-testid={onDisclose ? undefined : dataTestId}\n sx={rowSx}\n >\n {mark ?? (\n <AppHeaderBrand\n name={title}\n logoUrl={logoUrl}\n seedColor={seedColor}\n size={size}\n dataTestId={`${dataTestId}-brand`}\n />\n )}\n <IdentityText\n title={title}\n subtitle={subtitle}\n status={status}\n size={size}\n onDisclose={onDisclose}\n disclosed={disclosed}\n discloseLabel={discloseLabel}\n className={className}\n dataTestId={dataTestId}\n />\n </Box>\n );\n};\n\nAppHeaderIdentity.displayName = 'AppHeaderIdentity';\n"],"mappings":";;;;;;;;AAEA,OAAO,uBAAuB;AAC9B,OAAO,SAAS;AAChB,OAAO,cAAc;AACrB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AACzB,OAAO,WAAW;AA2CV,SAkBM,UAlBN,KAkBM,YAlBN;AAnCR,IAAM,WAAsC,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAGrF,IAAM,WAAW;AAAA,EACf,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AASO,IAAM,kBAAkD,CAAC;AAAA,EAC9D;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,aAAa;AACf,MAAM;AACJ,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,MAAM,OAAO,CAAC,SAAS,SAAS,QAAQ,SAAS,UAAa,SAAS,EAAE;AACzF,MAAI,QAAQ,WAAW,EAAG,QAAO;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,IAAI,EAAE,SAAS,QAAQ,YAAY,UAAU,KAAK,MAAM,GAAG,SAAS;AAAA,MAEnE;AAAA,gBACC;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,YACX,eAAa,GAAG,UAAU;AAAA,YAC1B,IAAI;AAAA,cACF,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,MAAM;AAAA,cACN,cAAc;AAAA,cACd,iBAAiB,UAAU,OAAO,IAAI,EAAE;AAAA,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AC,OAAI,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,GAC9B;AAAA,4BAAC,YAAS,SAAQ,QAAO,OAAO,KAAK,QAAQ,SAAS,IAAI,IAAI,KAAK;AAAA,QACnE,oBAAC,YAAS,SAAQ,QAAO,OAAO,KAAK,QAAQ,IAAI;AAAA,SACnD;AAAA;AAAA;AACF;AAYF,IAAM,QAAQ;AAAA,EACZ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AACb;AAiBO,IAAM,oBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA,aAAa;AACf,MAAM;AACJ,MAAI,QAAS,QAAO,oBAAC,oBAAiB,MAAY,YAAwB;AAE1E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,aAAa,SAAY;AAAA,MACpC,eAAa,aAAa,SAAY;AAAA,MACtC,IAAI;AAAA,MAEH;AAAA,gBACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,YAAY,GAAG,UAAU;AAAA;AAAA,QAC3B;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,kBAAkB,cAAc;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/data-display/CardKit/row-actions-to-menu.ts
|
|
2
2
|
function rowActionsToMenuItems(actions, row) {
|
|
3
|
-
return actions.filter((action) => action.isVisible?.(row) ?? true).map((action) => ({
|
|
3
|
+
return actions.filter((action) => action.row !== false).filter((action) => action.isVisible?.(row) ?? true).map((action) => ({
|
|
4
4
|
id: action.id,
|
|
5
5
|
label: action.rowLabel?.(row) ?? action.label,
|
|
6
6
|
color: action.color,
|
|
@@ -11,4 +11,4 @@ function rowActionsToMenuItems(actions, row) {
|
|
|
11
11
|
export {
|
|
12
12
|
rowActionsToMenuItems
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-ZBXG6RVJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/CardKit/row-actions-to-menu.ts"],"sourcesContent":["import type { DropdownMenuItem } from '../../navigation/DropdownMenu';\nimport type { RowAction } from '../DataViews';\n\n/**\n * Adapt a list of {@link RowAction}s into single-row kebab items.\n *\n * Drops the actions that declare `row: false`, applies each survivor's\n * `isVisible` guard, resolves its per-row `rowLabel` override, carries its\n * colour, and fires `onSelect([row])` on click.\n *\n * The point is that ONE definition drives both surfaces. An entity that already\n * declares its per-row actions as `RowAction[]` — because the table's multi-\n * select menu needs them — gets the card's kebab from the same array through\n * `renderRowMenu` / `renderCard`, with no second list to keep in step. Two\n * lists is how a \"Duplicar\" that appears in the table and not on the card\n * happens, and nothing reports it.\n *\n * ## Why `row: false` is filtered HERE\n *\n * `row` and `bulk` are the flags that make one list serve two surfaces, so an\n * adapter that ignores one of them defeats the arrangement it exists to\n * support. This one did, and the result was a per-row \"⋮\" on Produtos offering\n * \"Inativar todos\", \"Destacar todos\" and \"Remover destaque de todos\" beside\n * that row's own \"Inativar\" and \"Remover destaque\" — bulk verbs on a menu whose\n * every other entry means \"this one\", where \"todos\" reads as the whole\n * catalogue and the click actually writes a single row.\n *\n * The bulk half was already honoured (`renderBulkActions` filters `bulk`), so\n * only the kebab leaked. Filtering here fixes it for every surface that builds\n * a kebab from `RowAction[]` — the table row, the grid card and the list card\n * all arrive through this function.\n */\nexport function rowActionsToMenuItems<T extends Record<string, unknown>>(\n actions: RowAction<T>[],\n row: T,\n): DropdownMenuItem[] {\n return actions\n .filter((action) => action.row !== false)\n .filter((action) => action.isVisible?.(row) ?? true)\n .map((action) => ({\n id: action.id,\n label: action.rowLabel?.(row) ?? action.label,\n color: action.color,\n onClick: () => void action.onSelect([row]),\n }));\n}\n"],"mappings":";AAgCO,SAAS,sBACd,SACA,KACoB;AACpB,SAAO,QACJ,OAAO,CAAC,WAAW,OAAO,QAAQ,KAAK,EACvC,OAAO,CAAC,WAAW,OAAO,YAAY,GAAG,KAAK,IAAI,EAClD,IAAI,CAAC,YAAY;AAAA,IAChB,IAAI,OAAO;AAAA,IACX,OAAO,OAAO,WAAW,GAAG,KAAK,OAAO;AAAA,IACxC,OAAO,OAAO;AAAA,IACd,SAAS,MAAM,KAAK,OAAO,SAAS,CAAC,GAAG,CAAC;AAAA,EAC3C,EAAE;AACN;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4X4KM4ZB.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsGrid
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-53PDVLRK.js";
|
|
7
7
|
import {
|
|
8
8
|
viewStateKey
|
|
9
9
|
} from "./chunk-ZOLAYP2D.js";
|
|
@@ -178,4 +178,4 @@ function renderViewDialogs(ctl, fields, columns, views, testIdPrefix, onSaved) {
|
|
|
178
178
|
export {
|
|
179
179
|
DataViewsTableBase
|
|
180
180
|
};
|
|
181
|
-
//# sourceMappingURL=chunk-
|
|
181
|
+
//# sourceMappingURL=chunk-ZXOT3U6U.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "../chunk-JWW2Z3RH.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsTableBase
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-ZXOT3U6U.js";
|
|
7
7
|
import "../chunk-4X4KM4ZB.js";
|
|
8
8
|
import {
|
|
9
9
|
DataViewsGrid
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-53PDVLRK.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseListCard
|
|
13
13
|
} from "../chunk-WR5JFDQ5.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
DropIndicator,
|
|
23
23
|
useDragItem
|
|
24
24
|
} from "../chunk-JCJGJX7V.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-LWRMKF7D.js";
|
|
26
26
|
import "../chunk-BPLFM2GL.js";
|
|
27
27
|
import {
|
|
28
28
|
DataViewsBoard
|
|
@@ -43,7 +43,7 @@ import "../chunk-CBOB5AV6.js";
|
|
|
43
43
|
import "../chunk-HP2ODXNA.js";
|
|
44
44
|
import "../chunk-TQ6FPOPD.js";
|
|
45
45
|
import "../chunk-IAGOUTI6.js";
|
|
46
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-EMMPNB6D.js";
|
|
47
47
|
import "../chunk-KX75HM5U.js";
|
|
48
48
|
import "../chunk-XKV5ZIBG.js";
|
|
49
49
|
import "../chunk-A7Q5AQVD.js";
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
DEFAULT_CELL_WIDTH
|
|
58
58
|
} from "../chunk-6VP2L3DJ.js";
|
|
59
|
-
import "../chunk-
|
|
59
|
+
import "../chunk-4ZV7N5CU.js";
|
|
60
60
|
import "../chunk-SQNW22ZZ.js";
|
|
61
61
|
import "../chunk-7NSX7A5H.js";
|
|
62
62
|
import "../chunk-DW5FRWRQ.js";
|
|
@@ -108,7 +108,7 @@ import "../chunk-7AIL2F5E.js";
|
|
|
108
108
|
import "../chunk-WVML3ENZ.js";
|
|
109
109
|
import "../chunk-IDHZHOZW.js";
|
|
110
110
|
import "../chunk-MOLQGQEQ.js";
|
|
111
|
-
import "../chunk-
|
|
111
|
+
import "../chunk-L2E7TY7P.js";
|
|
112
112
|
import "../chunk-JMVIIKII.js";
|
|
113
113
|
import "../chunk-WXD7MGBT.js";
|
|
114
114
|
import "../chunk-WQFIV5WD.js";
|
|
@@ -3,8 +3,9 @@ import type { RowAction } from '../DataViews';
|
|
|
3
3
|
/**
|
|
4
4
|
* Adapt a list of {@link RowAction}s into single-row kebab items.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Drops the actions that declare `row: false`, applies each survivor's
|
|
7
|
+
* `isVisible` guard, resolves its per-row `rowLabel` override, carries its
|
|
8
|
+
* colour, and fires `onSelect([row])` on click.
|
|
8
9
|
*
|
|
9
10
|
* The point is that ONE definition drives both surfaces. An entity that already
|
|
10
11
|
* declares its per-row actions as `RowAction[]` — because the table's multi-
|
|
@@ -12,6 +13,21 @@ import type { RowAction } from '../DataViews';
|
|
|
12
13
|
* `renderRowMenu` / `renderCard`, with no second list to keep in step. Two
|
|
13
14
|
* lists is how a "Duplicar" that appears in the table and not on the card
|
|
14
15
|
* happens, and nothing reports it.
|
|
16
|
+
*
|
|
17
|
+
* ## Why `row: false` is filtered HERE
|
|
18
|
+
*
|
|
19
|
+
* `row` and `bulk` are the flags that make one list serve two surfaces, so an
|
|
20
|
+
* adapter that ignores one of them defeats the arrangement it exists to
|
|
21
|
+
* support. This one did, and the result was a per-row "⋮" on Produtos offering
|
|
22
|
+
* "Inativar todos", "Destacar todos" and "Remover destaque de todos" beside
|
|
23
|
+
* that row's own "Inativar" and "Remover destaque" — bulk verbs on a menu whose
|
|
24
|
+
* every other entry means "this one", where "todos" reads as the whole
|
|
25
|
+
* catalogue and the click actually writes a single row.
|
|
26
|
+
*
|
|
27
|
+
* The bulk half was already honoured (`renderBulkActions` filters `bulk`), so
|
|
28
|
+
* only the kebab leaked. Filtering here fixes it for every surface that builds
|
|
29
|
+
* a kebab from `RowAction[]` — the table row, the grid card and the list card
|
|
30
|
+
* all arrive through this function.
|
|
15
31
|
*/
|
|
16
32
|
export declare function rowActionsToMenuItems<T extends Record<string, unknown>>(actions: RowAction<T>[], row: T): DropdownMenuItem[];
|
|
17
33
|
//# sourceMappingURL=row-actions-to-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-actions-to-menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/CardKit/row-actions-to-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"row-actions-to-menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/CardKit/row-actions-to-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,EACvB,GAAG,EAAE,CAAC,GACL,gBAAgB,EAAE,CAUpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/ContentToolbar/ContentToolbar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/ContentToolbar/ContentToolbar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA0OlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,eAAe,EACf,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,EACd,SAAiB,EACjB,kBAA0B,EAC1B,cAAc,EACd,aAAa,EACb,YAAY,GACb,EAAE,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkDzC"}
|
|
@@ -9,12 +9,19 @@ import type { AppHeaderIdentityProps, AppHeaderStatusProps } from './AppHeader.t
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const AppHeaderStatus: React.FC<AppHeaderStatusProps>;
|
|
11
11
|
/**
|
|
12
|
-
* Mark + title + state line, and — when it can be opened —
|
|
13
|
-
*
|
|
12
|
+
* Mark + title + state line, and — when it can be opened — a name row that is
|
|
13
|
+
* the button.
|
|
14
14
|
*
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* The disclosure used to wrap EVERYTHING, on the argument that the chevron
|
|
16
|
+
* alone is a 20px target next to a 40px mark that does nothing. The target is
|
|
17
|
+
* still not the chevron: the button is the full-width NAME ROW, which is what a
|
|
18
|
+
* reader aims at. What it no longer swallows is the mark beside it and the
|
|
19
|
+
* quieter lines below — because those lines take `ReactNode`s, consumers put
|
|
20
|
+
* CONTROLS in them, and a control inside a button is invalid HTML whose every
|
|
21
|
+
* tap fires two handlers. See {@link IdentityText} (12-63).
|
|
22
|
+
*
|
|
23
|
+
* `className` and `dataTestId` stay on the same elements they always named: the
|
|
24
|
+
* block when it is static, the disclosure when there is one.
|
|
18
25
|
*/
|
|
19
26
|
export declare const AppHeaderIdentity: React.FC<AppHeaderIdentityProps>;
|
|
20
27
|
//# sourceMappingURL=AppHeader.identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.identity.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/AppHeader/AppHeader.identity.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAatF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqD1D,CAAC;
|
|
1
|
+
{"version":3,"file":"AppHeader.identity.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/AppHeader/AppHeader.identity.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAatF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqD1D,CAAC;AAmLF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6C9D,CAAC"}
|
|
@@ -56,19 +56,27 @@ export interface AppHeaderStatusProps {
|
|
|
56
56
|
* the consumer's own router in the `leading` slot, whereas an `href` prop would
|
|
57
57
|
* have to guess whose link component it is being handed — `to` for one router,
|
|
58
58
|
* `href` for another — and would half-work for everybody. `onDisclose` is the
|
|
59
|
-
* only interaction the block owns: with it the
|
|
60
|
-
* appears, without it the
|
|
59
|
+
* only interaction the block owns: with it the NAME ROW is a button and a
|
|
60
|
+
* chevron appears, without it the row is static text.
|
|
61
|
+
*
|
|
62
|
+
* The button stops at that row (12-63). `status` and `subtitle` render as its
|
|
63
|
+
* SIBLINGS, so a consumer may put controls in the state line — which they do,
|
|
64
|
+
* and which used to nest a `<button>` inside a `<button>`.
|
|
61
65
|
*/
|
|
62
66
|
export interface AppHeaderIdentityProps extends Pick<AppHeaderBrandProps, 'logoUrl' | 'seedColor'> {
|
|
63
67
|
/** The name shown, and the one the mark derives its initials from. */
|
|
64
68
|
title: string;
|
|
65
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* A quieter line under the title — use `status` for the dotted state line.
|
|
71
|
+
*
|
|
72
|
+
* Rendered OUTSIDE the disclosure, like `status`, so it may hold a control.
|
|
73
|
+
*/
|
|
66
74
|
subtitle?: ReactNode;
|
|
67
75
|
/** The state line, usually an {@link AppHeaderStatusProps} element. */
|
|
68
76
|
status?: ReactNode;
|
|
69
77
|
/** Replaces the derived mark entirely (an icon, an `<img>`, nothing). */
|
|
70
78
|
mark?: ReactNode;
|
|
71
|
-
/** Opens the details panel. Renders the
|
|
79
|
+
/** Opens the details panel. Renders the NAME ROW as a button with a chevron. */
|
|
72
80
|
onDisclose?: () => void;
|
|
73
81
|
/** Whether the panel `onDisclose` opens is currently open (`aria-expanded`). */
|
|
74
82
|
disclosed?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/AppHeader/AppHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D,8DAA8D;AAC9D,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oBAAoB;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wBAAwB;IACxB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"AppHeader.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/AppHeader/AppHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D,8DAA8D;AAC9D,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oBAAoB;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wBAAwB;IACxB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CA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,CAAC,EAAE,SAAS,CAAC;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,sBAAsB;IACtB,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,oEAAoE;IACpE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -4,8 +4,9 @@ import type { RowAction } from '../DataViews';
|
|
|
4
4
|
/**
|
|
5
5
|
* Adapt a list of {@link RowAction}s into single-row kebab items.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Drops the actions that declare `row: false`, applies each survivor's
|
|
8
|
+
* `isVisible` guard, resolves its per-row `rowLabel` override, carries its
|
|
9
|
+
* colour, and fires `onSelect([row])` on click.
|
|
9
10
|
*
|
|
10
11
|
* The point is that ONE definition drives both surfaces. An entity that already
|
|
11
12
|
* declares its per-row actions as `RowAction[]` — because the table's multi-
|
|
@@ -13,12 +14,28 @@ import type { RowAction } from '../DataViews';
|
|
|
13
14
|
* `renderRowMenu` / `renderCard`, with no second list to keep in step. Two
|
|
14
15
|
* lists is how a "Duplicar" that appears in the table and not on the card
|
|
15
16
|
* happens, and nothing reports it.
|
|
17
|
+
*
|
|
18
|
+
* ## Why `row: false` is filtered HERE
|
|
19
|
+
*
|
|
20
|
+
* `row` and `bulk` are the flags that make one list serve two surfaces, so an
|
|
21
|
+
* adapter that ignores one of them defeats the arrangement it exists to
|
|
22
|
+
* support. This one did, and the result was a per-row "⋮" on Produtos offering
|
|
23
|
+
* "Inativar todos", "Destacar todos" and "Remover destaque de todos" beside
|
|
24
|
+
* that row's own "Inativar" and "Remover destaque" — bulk verbs on a menu whose
|
|
25
|
+
* every other entry means "this one", where "todos" reads as the whole
|
|
26
|
+
* catalogue and the click actually writes a single row.
|
|
27
|
+
*
|
|
28
|
+
* The bulk half was already honoured (`renderBulkActions` filters `bulk`), so
|
|
29
|
+
* only the kebab leaked. Filtering here fixes it for every surface that builds
|
|
30
|
+
* a kebab from `RowAction[]` — the table row, the grid card and the list card
|
|
31
|
+
* all arrive through this function.
|
|
16
32
|
*/
|
|
17
33
|
export function rowActionsToMenuItems<T extends Record<string, unknown>>(
|
|
18
34
|
actions: RowAction<T>[],
|
|
19
35
|
row: T,
|
|
20
36
|
): DropdownMenuItem[] {
|
|
21
37
|
return actions
|
|
38
|
+
.filter((action) => action.row !== false)
|
|
22
39
|
.filter((action) => action.isVisible?.(row) ?? true)
|
|
23
40
|
.map((action) => ({
|
|
24
41
|
id: action.id,
|
|
@@ -46,6 +46,49 @@ Everything below exists to keep that true. When a change breaks it, the fix is
|
|
|
46
46
|
another rung on the ladder — never a scrollbar, and never letting controls paint
|
|
47
47
|
outside the toolbar.
|
|
48
48
|
|
|
49
|
+
**"One line" is a rule about BROWSING.** Everything in this document describes
|
|
50
|
+
the row an operator reads a list from, and the ladder measures that row. The
|
|
51
|
+
selection row is a different row with different contents and no ladder at all —
|
|
52
|
+
see below.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## The selection row
|
|
57
|
+
|
|
58
|
+
Tick a checkbox and `exclusiveSelection` hands the whole toolbar to the
|
|
59
|
+
selection cluster: the search, the filters, Exibir and Exportar all stand down,
|
|
60
|
+
and what is left is "Limpar filtros", the count, whatever the host puts in
|
|
61
|
+
`selectionExtra`, and the actions menu.
|
|
62
|
+
|
|
63
|
+
That cluster is not on the ladder, and it must not be. The ladder sheds controls
|
|
64
|
+
because each one it sheds has somewhere else to be — a filter into "Mais", a
|
|
65
|
+
label into an icon, "Limpar" into a panel footer. Nothing here does. Dropping
|
|
66
|
+
the count loses the only statement of what is about to be written to; dropping
|
|
67
|
+
"Ações" loses the reason the operator ticked anything.
|
|
68
|
+
|
|
69
|
+
**So below `md` it WRAPS instead**, which is the one thing the browsing row may
|
|
70
|
+
never do:
|
|
71
|
+
|
|
72
|
+
| | small mobile | large mobile | tablet | desktop |
|
|
73
|
+
| --- | --- | --- | --- | --- |
|
|
74
|
+
| checkbox + "Limpar filtros" + count | line 1 | line 1 | line 1 | line 1 |
|
|
75
|
+
| `selectionExtra` + "Ações" | line 2 | line 2 | line 2 | line 1 |
|
|
76
|
+
|
|
77
|
+
The break before `selectionExtra` is deliberate rather than wherever the row ran
|
|
78
|
+
out of room. What follows it is one thought — what the selection IS ("Seleção:
|
|
79
|
+
48 produtos — todas as páginas" and its "Limpar seleção") plus the control that
|
|
80
|
+
acts on it — and a natural wrap split that thought mid-phrase.
|
|
81
|
+
|
|
82
|
+
Before this, the cluster was pinned at content width with every child
|
|
83
|
+
`flex-shrink: 0`. On Produtos with the scope armed that is ~766px of controls,
|
|
84
|
+
so at 320 the row painted 446px past the toolbar's own edge and "Ações" sat
|
|
85
|
+
off-screen behind a sideways scroll of the document. The button the whole
|
|
86
|
+
selection exists to reach was the one you could not see.
|
|
87
|
+
|
|
88
|
+
`ContentToolbar.stories.tsx` → **NarrowSelectionOverflow** is that exact row.
|
|
89
|
+
Open it at 320 and 390; jsdom cannot see this failure, so no unit test can
|
|
90
|
+
guard it.
|
|
91
|
+
|
|
49
92
|
---
|
|
50
93
|
|
|
51
94
|
## The ladder
|