@dbcdk/react-components 0.0.158 → 0.0.160
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/components/accordion/components/AccordionRow.cjs +1 -1
- package/dist/components/accordion/components/AccordionRow.js +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +3 -6
- package/dist/components/forms/typeahead/Typeahead.cjs +6 -6
- package/dist/components/forms/typeahead/Typeahead.d.ts +1 -0
- package/dist/components/forms/typeahead/Typeahead.js +6 -6
- package/dist/components/nav-bar/NavBar.cjs +4 -1
- package/dist/components/nav-bar/NavBar.js +4 -1
- package/dist/components/nav-bar/NavBar.module.css +18 -0
- package/dist/components/sidebar/Sidebar.cjs +2 -0
- package/dist/components/sidebar/Sidebar.d.ts +1 -1
- package/dist/components/sidebar/Sidebar.js +2 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +6 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +1 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +6 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +30 -2
- package/dist/components/table/Table.cjs +17 -3
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +18 -4
- package/dist/components/table/Table.module.css +41 -44
- package/dist/components/table/Table.types.d.ts +1 -1
- package/dist/components/table/components/TableBody.cjs +9 -5
- package/dist/components/table/components/TableBody.d.ts +4 -2
- package/dist/components/table/components/TableBody.js +9 -5
- package/dist/components/table/components/TableRow.cjs +39 -18
- package/dist/components/table/components/TableRow.d.ts +4 -1
- package/dist/components/table/components/TableRow.js +40 -19
- package/dist/components/table/components/table-settings/TableSettings.cjs +1 -1
- package/dist/components/table/components/table-settings/TableSettings.js +2 -2
- package/dist/components/table/table.utils.cjs +2 -0
- package/dist/components/table/table.utils.d.ts +1 -0
- package/dist/components/table/table.utils.js +2 -1
- package/dist/hooks/useDeviceSize.cjs +2 -4
- package/dist/hooks/useDeviceSize.js +2 -4
- package/dist/styles/themes/dbc/colors.css +6 -0
- package/dist/styles/themes/filmstriben-budget/theme.css +22 -0
- package/dist/themes/filmstriben-budget.css +3 -0
- package/dist/utils/date/formatDate.cjs +15 -1
- package/dist/utils/date/formatDate.d.ts +9 -1
- package/dist/utils/date/formatDate.js +15 -1
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ function AccordionRow({
|
|
|
57
57
|
renderMode = "lazy"
|
|
58
58
|
}) {
|
|
59
59
|
const isDisabled = !!item.disabled;
|
|
60
|
-
const headlineWeight =
|
|
60
|
+
const headlineWeight = variant === "outlined" ? 400 : 500;
|
|
61
61
|
const buttonId = `${uid}-acc-btn-${index}`;
|
|
62
62
|
const panelId = `${uid}-acc-panel-${index}`;
|
|
63
63
|
const { innerRef, height, onTransitionEnd } = useCollapsibleHeight(isOpen, shouldAnimate);
|
|
@@ -51,7 +51,7 @@ function AccordionRow({
|
|
|
51
51
|
renderMode = "lazy"
|
|
52
52
|
}) {
|
|
53
53
|
const isDisabled = !!item.disabled;
|
|
54
|
-
const headlineWeight =
|
|
54
|
+
const headlineWeight = variant === "outlined" ? 400 : 500;
|
|
55
55
|
const buttonId = `${uid}-acc-btn-${index}`;
|
|
56
56
|
const panelId = `${uid}-acc-panel-${index}`;
|
|
57
57
|
const { innerRef, height, onTransitionEnd } = useCollapsibleHeight(isOpen, shouldAnimate);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
.breadcrumbs ul {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
+
gap: var(--spacing-xs);
|
|
8
9
|
list-style: none;
|
|
9
10
|
margin: 0;
|
|
10
11
|
padding: 0;
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
gap: var(--spacing-xxs);
|
|
18
19
|
padding-block: calc(var(--spacing-xxs) + var(--density));
|
|
19
20
|
padding-inline: 0;
|
|
20
|
-
color: var(--color-fg-
|
|
21
|
+
color: var(--color-fg-muted);
|
|
21
22
|
border-radius: var(--border-radius-sm);
|
|
22
23
|
position: relative;
|
|
23
24
|
transition:
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
|
|
28
29
|
.breadcrumbs li:hover button {
|
|
29
30
|
color: var(--color-fg-default);
|
|
30
|
-
background-color: var(--color-bg-contextual);
|
|
31
31
|
cursor: pointer;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,14 +39,12 @@
|
|
|
39
39
|
|
|
40
40
|
.breadcrumbs li[aria-current='page'] button,
|
|
41
41
|
.breadcrumbs li:last-of-type button {
|
|
42
|
-
background-color: var(--color-bg-contextual) !important;
|
|
43
42
|
font-weight: var(--font-weight-medium);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.separator {
|
|
47
46
|
display: flex;
|
|
48
47
|
align-items: center;
|
|
49
|
-
padding: 0 var(--spacing-xs);
|
|
50
48
|
color: var(--color-fg-subtle);
|
|
51
49
|
font-size: var(--font-size-md);
|
|
52
50
|
}
|
|
@@ -62,8 +60,7 @@
|
|
|
62
60
|
all: unset;
|
|
63
61
|
color: inherit;
|
|
64
62
|
border-radius: var(--border-radius-default);
|
|
65
|
-
|
|
66
|
-
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
63
|
+
padding-block: var(--spacing-xxs);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
.breadcrumbs a:focus-visible,
|
|
@@ -297,7 +297,7 @@ function Typeahead({
|
|
|
297
297
|
if (fittedWidthPx == null) return minWidth != null ? minWidth : "120px";
|
|
298
298
|
return `${fittedWidthPx}px`;
|
|
299
299
|
}, [shouldFitContent, fittedWidthPx, minWidth]);
|
|
300
|
-
const shouldStretchInput = fullWidth || shouldFitContent;
|
|
300
|
+
const shouldStretchInput = !width && (fullWidth || shouldFitContent);
|
|
301
301
|
React.useEffect(() => {
|
|
302
302
|
if (!enableHotkey) return;
|
|
303
303
|
function handleKeyDown2(event) {
|
|
@@ -600,10 +600,10 @@ function Typeahead({
|
|
|
600
600
|
display: "flex",
|
|
601
601
|
flexDirection: "column",
|
|
602
602
|
gap: mode === "multi" && multiSelectedValuesDisplayMode === "below-input" && selectedOptions.length > 0 ? 8 : 0,
|
|
603
|
-
width: fullWidth ? "100%" : shouldFitContent ? measuredRootWidth : void 0,
|
|
604
|
-
flex: fullWidth || shouldFitContent ? "1 1 auto" : void 0,
|
|
605
|
-
minWidth: shouldFitContent ? measuredRootWidth : 0,
|
|
606
|
-
maxWidth: shouldFitContent ? "100%" : void 0
|
|
603
|
+
width: width != null ? width : fullWidth ? "100%" : shouldFitContent ? measuredRootWidth : void 0,
|
|
604
|
+
flex: width ? "0 0 auto" : fullWidth || shouldFitContent ? "1 1 auto" : void 0,
|
|
605
|
+
minWidth: width ? void 0 : shouldFitContent ? measuredRootWidth : 0,
|
|
606
|
+
maxWidth: width ? void 0 : shouldFitContent ? "100%" : void 0
|
|
607
607
|
},
|
|
608
608
|
children: [
|
|
609
609
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -690,7 +690,7 @@ function Typeahead({
|
|
|
690
690
|
placeholder,
|
|
691
691
|
variant,
|
|
692
692
|
inputSize: resolvedInputSize,
|
|
693
|
-
width:
|
|
693
|
+
width: width != null ? width : shouldFitContent ? void 0 : inputProps == null ? void 0 : inputProps.width,
|
|
694
694
|
autoComplete: (_a2 = autoComplete != null ? autoComplete : inputProps == null ? void 0 : inputProps.autoComplete) != null ? _a2 : "off",
|
|
695
695
|
autoCorrect: (_b2 = autoCorrect != null ? autoCorrect : inputProps == null ? void 0 : inputProps.autoCorrect) != null ? _b2 : "off",
|
|
696
696
|
autoCapitalize: (_c = autoCapitalize != null ? autoCapitalize : inputProps == null ? void 0 : inputProps.autoCapitalize) != null ? _c : "none",
|
|
@@ -24,6 +24,7 @@ interface TypeaheadProps<T> {
|
|
|
24
24
|
filterOptions?: (options: TypeaheadOption<T>[], query: string) => TypeaheadOption<T>[];
|
|
25
25
|
inputProps?: Omit<InputProps, 'onChange' | 'value'>;
|
|
26
26
|
inputSize?: InputProps['inputSize'];
|
|
27
|
+
/** Explicit width; takes precedence over `fullWidth` and `fitContent` when set. */
|
|
27
28
|
width?: InputProps['width'];
|
|
28
29
|
minWidth?: string;
|
|
29
30
|
popoverWidth?: string;
|
|
@@ -273,7 +273,7 @@ function Typeahead({
|
|
|
273
273
|
if (fittedWidthPx == null) return minWidth != null ? minWidth : "120px";
|
|
274
274
|
return `${fittedWidthPx}px`;
|
|
275
275
|
}, [shouldFitContent, fittedWidthPx, minWidth]);
|
|
276
|
-
const shouldStretchInput = fullWidth || shouldFitContent;
|
|
276
|
+
const shouldStretchInput = !width && (fullWidth || shouldFitContent);
|
|
277
277
|
useEffect(() => {
|
|
278
278
|
if (!enableHotkey) return;
|
|
279
279
|
function handleKeyDown2(event) {
|
|
@@ -576,10 +576,10 @@ function Typeahead({
|
|
|
576
576
|
display: "flex",
|
|
577
577
|
flexDirection: "column",
|
|
578
578
|
gap: mode === "multi" && multiSelectedValuesDisplayMode === "below-input" && selectedOptions.length > 0 ? 8 : 0,
|
|
579
|
-
width: fullWidth ? "100%" : shouldFitContent ? measuredRootWidth : void 0,
|
|
580
|
-
flex: fullWidth || shouldFitContent ? "1 1 auto" : void 0,
|
|
581
|
-
minWidth: shouldFitContent ? measuredRootWidth : 0,
|
|
582
|
-
maxWidth: shouldFitContent ? "100%" : void 0
|
|
579
|
+
width: width != null ? width : fullWidth ? "100%" : shouldFitContent ? measuredRootWidth : void 0,
|
|
580
|
+
flex: width ? "0 0 auto" : fullWidth || shouldFitContent ? "1 1 auto" : void 0,
|
|
581
|
+
minWidth: width ? void 0 : shouldFitContent ? measuredRootWidth : 0,
|
|
582
|
+
maxWidth: width ? void 0 : shouldFitContent ? "100%" : void 0
|
|
583
583
|
},
|
|
584
584
|
children: [
|
|
585
585
|
/* @__PURE__ */ jsx(
|
|
@@ -666,7 +666,7 @@ function Typeahead({
|
|
|
666
666
|
placeholder,
|
|
667
667
|
variant,
|
|
668
668
|
inputSize: resolvedInputSize,
|
|
669
|
-
width:
|
|
669
|
+
width: width != null ? width : shouldFitContent ? void 0 : inputProps == null ? void 0 : inputProps.width,
|
|
670
670
|
autoComplete: (_a2 = autoComplete != null ? autoComplete : inputProps == null ? void 0 : inputProps.autoComplete) != null ? _a2 : "off",
|
|
671
671
|
autoCorrect: (_b2 = autoCorrect != null ? autoCorrect : inputProps == null ? void 0 : inputProps.autoCorrect) != null ? _b2 : "off",
|
|
672
672
|
autoCapitalize: (_c = autoCapitalize != null ? autoCapitalize : inputProps == null ? void 0 : inputProps.autoCapitalize) != null ? _c : "none",
|
|
@@ -48,7 +48,10 @@ function NavBar({
|
|
|
48
48
|
});
|
|
49
49
|
const productNameContent = productName ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
50
50
|
/* @__PURE__ */ jsxRuntime.jsx(logo.Logo, {}),
|
|
51
|
-
/* @__PURE__ */ jsxRuntime.
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.productNameLabel, children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.productNameSquare }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { disableMargin: true, size: 1, children: productName })
|
|
54
|
+
] })
|
|
52
55
|
] }) : null;
|
|
53
56
|
const productNameNode = (() => {
|
|
54
57
|
if (!productName || !productNameContent) return null;
|
|
@@ -42,7 +42,10 @@ function NavBar({
|
|
|
42
42
|
});
|
|
43
43
|
const productNameContent = productName ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
44
|
/* @__PURE__ */ jsx(Logo, {}),
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ jsxs("span", { className: styles.productNameLabel, children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: styles.productNameSquare }),
|
|
47
|
+
/* @__PURE__ */ jsx(Headline, { disableMargin: true, size: 1, children: productName })
|
|
48
|
+
] })
|
|
46
49
|
] }) : null;
|
|
47
50
|
const productNameNode = (() => {
|
|
48
51
|
if (!productName || !productNameContent) return null;
|
|
@@ -111,6 +111,24 @@
|
|
|
111
111
|
color: inherit;
|
|
112
112
|
text-decoration: none;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
.productNameLabel {
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: var(--spacing-xs);
|
|
119
|
+
color: var(--color-fg-default);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.productNameSquare {
|
|
123
|
+
inline-size: 5px;
|
|
124
|
+
block-size: 5px;
|
|
125
|
+
flex: 0 0 auto;
|
|
126
|
+
background-color: var(--color-logo);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.productNameLabel h1 {
|
|
130
|
+
font-size: var(--font-size-sm);
|
|
131
|
+
}
|
|
114
132
|
.productName svg {
|
|
115
133
|
inline-size: auto;
|
|
116
134
|
block-size: var(--icon-size-md);
|
|
@@ -6,6 +6,7 @@ var SidebarProvider = require('./providers/SidebarProvider');
|
|
|
6
6
|
|
|
7
7
|
function Sidebar({
|
|
8
8
|
items,
|
|
9
|
+
productName,
|
|
9
10
|
productLogo,
|
|
10
11
|
activeLink,
|
|
11
12
|
version,
|
|
@@ -21,6 +22,7 @@ function Sidebar({
|
|
|
21
22
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider.SidebarProvider, { items, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
23
|
SidebarContainer.SidebarContainer,
|
|
23
24
|
{
|
|
25
|
+
productName,
|
|
24
26
|
productLogo,
|
|
25
27
|
activeLink,
|
|
26
28
|
version,
|
|
@@ -19,5 +19,5 @@ interface SidebarProps {
|
|
|
19
19
|
minWidth?: number;
|
|
20
20
|
storageKey?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare function Sidebar({ items, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarProps): JSX.Element;
|
|
22
|
+
export declare function Sidebar({ items, productName, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarProps): JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -4,6 +4,7 @@ import { SidebarProvider } from './providers/SidebarProvider';
|
|
|
4
4
|
|
|
5
5
|
function Sidebar({
|
|
6
6
|
items,
|
|
7
|
+
productName,
|
|
7
8
|
productLogo,
|
|
8
9
|
activeLink,
|
|
9
10
|
version,
|
|
@@ -19,6 +20,7 @@ function Sidebar({
|
|
|
19
20
|
return /* @__PURE__ */ jsx(SidebarProvider, { items, children: /* @__PURE__ */ jsx(
|
|
20
21
|
SidebarContainer,
|
|
21
22
|
{
|
|
23
|
+
productName,
|
|
22
24
|
productLogo,
|
|
23
25
|
activeLink,
|
|
24
26
|
version,
|
|
@@ -6,6 +6,7 @@ var lucideReact = require('lucide-react');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var logo = require('../../../../assets/logo');
|
|
8
8
|
var Button = require('../../../../components/button/Button');
|
|
9
|
+
var Headline = require('../../../../components/headline/Headline');
|
|
9
10
|
var SidebarItems = require('../../../../components/sidebar/components/sidebar-items/SidebarItems');
|
|
10
11
|
var SidenavFiltering = require('../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering');
|
|
11
12
|
var SidebarProvider = require('../../../../components/sidebar/providers/SidebarProvider');
|
|
@@ -43,6 +44,7 @@ function removeStoredWidth(key) {
|
|
|
43
44
|
}
|
|
44
45
|
function SidebarContainer({
|
|
45
46
|
logo: logo$1,
|
|
47
|
+
productName,
|
|
46
48
|
productLogo,
|
|
47
49
|
activeLink,
|
|
48
50
|
version,
|
|
@@ -165,7 +167,10 @@ function SidebarContainer({
|
|
|
165
167
|
style: containerStyle,
|
|
166
168
|
children: [
|
|
167
169
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.header, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.productHeader, children: [
|
|
168
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productLogo, children: productLogo }),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productGroup, children: productLogo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productLogo, children: productLogo }) : productName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.productNameLabel, children: [
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.productNameSquare }),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { disableMargin: true, size: 1, allowWrap: false, children: productName })
|
|
173
|
+
] }) }),
|
|
169
174
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
170
175
|
Button.Button,
|
|
171
176
|
{
|
|
@@ -14,5 +14,5 @@ interface SidebarContainerProps {
|
|
|
14
14
|
minWidth?: number;
|
|
15
15
|
storageKey?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare function SidebarContainer({ logo, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarContainerProps): JSX.Element;
|
|
17
|
+
export declare function SidebarContainer({ logo, productName, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarContainerProps): JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -4,6 +4,7 @@ import { PanelLeftOpen, PanelLeft } from 'lucide-react';
|
|
|
4
4
|
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
5
5
|
import { Logo } from '../../../../assets/logo';
|
|
6
6
|
import { Button } from '../../../../components/button/Button';
|
|
7
|
+
import { Headline } from '../../../../components/headline/Headline';
|
|
7
8
|
import { SidebarItems } from '../../../../components/sidebar/components/sidebar-items/SidebarItems';
|
|
8
9
|
import SidenavFiltering from '../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering';
|
|
9
10
|
import { useSidebar } from '../../../../components/sidebar/providers/SidebarProvider';
|
|
@@ -36,6 +37,7 @@ function removeStoredWidth(key) {
|
|
|
36
37
|
}
|
|
37
38
|
function SidebarContainer({
|
|
38
39
|
logo,
|
|
40
|
+
productName,
|
|
39
41
|
productLogo,
|
|
40
42
|
activeLink,
|
|
41
43
|
version,
|
|
@@ -158,7 +160,10 @@ function SidebarContainer({
|
|
|
158
160
|
style: containerStyle,
|
|
159
161
|
children: [
|
|
160
162
|
/* @__PURE__ */ jsx("div", { className: styles.header, children: /* @__PURE__ */ jsxs("div", { className: styles.productHeader, children: [
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: styles.productLogo, children: productLogo }),
|
|
163
|
+
/* @__PURE__ */ jsx("div", { className: styles.productGroup, children: productLogo ? /* @__PURE__ */ jsx("div", { className: styles.productLogo, children: productLogo }) : productName && /* @__PURE__ */ jsxs("span", { className: styles.productNameLabel, children: [
|
|
164
|
+
/* @__PURE__ */ jsx("span", { className: styles.productNameSquare }),
|
|
165
|
+
/* @__PURE__ */ jsx(Headline, { disableMargin: true, size: 1, allowWrap: false, children: productName })
|
|
166
|
+
] }) }),
|
|
162
167
|
/* @__PURE__ */ jsx(
|
|
163
168
|
Button,
|
|
164
169
|
{
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
flex-grow: 1;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* Product logo + name group */
|
|
68
|
+
.productGroup {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--spacing-xs);
|
|
72
|
+
min-width: 0;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
/* Product logo container */
|
|
68
77
|
.productLogo {
|
|
69
78
|
display: flex;
|
|
@@ -73,6 +82,25 @@
|
|
|
73
82
|
min-width: 0;
|
|
74
83
|
}
|
|
75
84
|
|
|
85
|
+
.productNameLabel {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: var(--spacing-xxs);
|
|
89
|
+
color: var(--color-fg-default);
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.productNameSquare {
|
|
94
|
+
inline-size: 7px;
|
|
95
|
+
block-size: 7px;
|
|
96
|
+
flex: 0 0 auto;
|
|
97
|
+
background-color: var(--color-logo);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.productNameLabel h1 {
|
|
101
|
+
font-size: var(--font-size-md);
|
|
102
|
+
}
|
|
103
|
+
|
|
76
104
|
/* Let wrapper elements such as Next.js <Link> inherit the logo sizing context */
|
|
77
105
|
.productLogo > * {
|
|
78
106
|
display: flex;
|
|
@@ -245,8 +273,8 @@
|
|
|
245
273
|
}
|
|
246
274
|
|
|
247
275
|
/* === Collapsed header behavior ===
|
|
248
|
-
Hide product logo entirely so the collapse button can truly center. */
|
|
249
|
-
.container.collapsed .
|
|
276
|
+
Hide product logo + name entirely so the collapse button can truly center. */
|
|
277
|
+
.container.collapsed .productGroup {
|
|
250
278
|
display: none;
|
|
251
279
|
}
|
|
252
280
|
|
|
@@ -31,7 +31,6 @@ function Table({
|
|
|
31
31
|
variant = "primary",
|
|
32
32
|
size = "md",
|
|
33
33
|
viewMode,
|
|
34
|
-
striped,
|
|
35
34
|
fillViewport = false,
|
|
36
35
|
fillViewportBottomOffset = 16,
|
|
37
36
|
containScrolling = true,
|
|
@@ -53,6 +52,7 @@ function Table({
|
|
|
53
52
|
getRowSeverity,
|
|
54
53
|
getContextMenuItems,
|
|
55
54
|
showContextMenuOnHover = true,
|
|
55
|
+
expandableRows = false,
|
|
56
56
|
onRowClick,
|
|
57
57
|
onRowMouseEnter,
|
|
58
58
|
onRowSelect,
|
|
@@ -67,6 +67,18 @@ function Table({
|
|
|
67
67
|
const tableRootRefWrapper = react.useRef(tableRootRef);
|
|
68
68
|
const hasSelection = Boolean(selectedRows && onRowSelect);
|
|
69
69
|
const hasPagination = Boolean(onPageChange && (loading || data.length > 0));
|
|
70
|
+
const [expandedRows, setExpandedRows] = react.useState(() => /* @__PURE__ */ new Set());
|
|
71
|
+
const handleToggleRowExpand = react.useCallback((rowId) => {
|
|
72
|
+
setExpandedRows((prev) => {
|
|
73
|
+
const next = new Set(prev);
|
|
74
|
+
if (next.has(rowId)) {
|
|
75
|
+
next.delete(rowId);
|
|
76
|
+
} else {
|
|
77
|
+
next.add(rowId);
|
|
78
|
+
}
|
|
79
|
+
return next;
|
|
80
|
+
});
|
|
81
|
+
}, []);
|
|
70
82
|
const paginationOffset = hasPagination ? 72 : 0;
|
|
71
83
|
const { style: viewportFillStyle, maxHeight } = useViewportFill.useViewportFill(internalTableRootRef, {
|
|
72
84
|
bottomOffset: fillViewportBottomOffset + paginationOffset,
|
|
@@ -94,7 +106,6 @@ function Table({
|
|
|
94
106
|
data,
|
|
95
107
|
dataKey,
|
|
96
108
|
columns: visibleColumns,
|
|
97
|
-
striped,
|
|
98
109
|
selectedRows,
|
|
99
110
|
hasSelection,
|
|
100
111
|
selectionMode,
|
|
@@ -103,9 +114,12 @@ function Table({
|
|
|
103
114
|
getRowSeverity,
|
|
104
115
|
getContextMenuItems,
|
|
105
116
|
showContextMenuOnHover,
|
|
117
|
+
expandableRows,
|
|
118
|
+
expandedRows,
|
|
106
119
|
onRowClick,
|
|
107
120
|
onRowMouseEnter,
|
|
108
|
-
onRowSelect
|
|
121
|
+
onRowSelect,
|
|
122
|
+
onToggleRowExpand: handleToggleRowExpand
|
|
109
123
|
}
|
|
110
124
|
);
|
|
111
125
|
const paginationEl = hasPagination ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import type { TableProps } from './Table.types';
|
|
3
|
-
export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode,
|
|
3
|
+
export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, showGoToPage, showPageSize, pageSizeOptions, showHeader, getRowSeverity, getContextMenuItems, showContextMenuOnHover, expandableRows, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
|
|
4
4
|
export type { ColumnItem } from './Table.types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useMemo, useId, useRef, useCallback } from 'react';
|
|
3
|
+
import { useMemo, useId, useRef, useState, useCallback } from 'react';
|
|
4
4
|
import { Pagination } from '../../components/pagination/Pagination';
|
|
5
5
|
import { SkeletonLoader } from '../../components/skeleton-loader/SkeletonLoader';
|
|
6
6
|
import { useViewportFill } from '../../hooks/useViewportFill';
|
|
@@ -25,7 +25,6 @@ function Table({
|
|
|
25
25
|
variant = "primary",
|
|
26
26
|
size = "md",
|
|
27
27
|
viewMode,
|
|
28
|
-
striped,
|
|
29
28
|
fillViewport = false,
|
|
30
29
|
fillViewportBottomOffset = 16,
|
|
31
30
|
containScrolling = true,
|
|
@@ -47,6 +46,7 @@ function Table({
|
|
|
47
46
|
getRowSeverity,
|
|
48
47
|
getContextMenuItems,
|
|
49
48
|
showContextMenuOnHover = true,
|
|
49
|
+
expandableRows = false,
|
|
50
50
|
onRowClick,
|
|
51
51
|
onRowMouseEnter,
|
|
52
52
|
onRowSelect,
|
|
@@ -61,6 +61,18 @@ function Table({
|
|
|
61
61
|
const tableRootRefWrapper = useRef(tableRootRef);
|
|
62
62
|
const hasSelection = Boolean(selectedRows && onRowSelect);
|
|
63
63
|
const hasPagination = Boolean(onPageChange && (loading || data.length > 0));
|
|
64
|
+
const [expandedRows, setExpandedRows] = useState(() => /* @__PURE__ */ new Set());
|
|
65
|
+
const handleToggleRowExpand = useCallback((rowId) => {
|
|
66
|
+
setExpandedRows((prev) => {
|
|
67
|
+
const next = new Set(prev);
|
|
68
|
+
if (next.has(rowId)) {
|
|
69
|
+
next.delete(rowId);
|
|
70
|
+
} else {
|
|
71
|
+
next.add(rowId);
|
|
72
|
+
}
|
|
73
|
+
return next;
|
|
74
|
+
});
|
|
75
|
+
}, []);
|
|
64
76
|
const paginationOffset = hasPagination ? 72 : 0;
|
|
65
77
|
const { style: viewportFillStyle, maxHeight } = useViewportFill(internalTableRootRef, {
|
|
66
78
|
bottomOffset: fillViewportBottomOffset + paginationOffset,
|
|
@@ -88,7 +100,6 @@ function Table({
|
|
|
88
100
|
data,
|
|
89
101
|
dataKey,
|
|
90
102
|
columns: visibleColumns,
|
|
91
|
-
striped,
|
|
92
103
|
selectedRows,
|
|
93
104
|
hasSelection,
|
|
94
105
|
selectionMode,
|
|
@@ -97,9 +108,12 @@ function Table({
|
|
|
97
108
|
getRowSeverity,
|
|
98
109
|
getContextMenuItems,
|
|
99
110
|
showContextMenuOnHover,
|
|
111
|
+
expandableRows,
|
|
112
|
+
expandedRows,
|
|
100
113
|
onRowClick,
|
|
101
114
|
onRowMouseEnter,
|
|
102
|
-
onRowSelect
|
|
115
|
+
onRowSelect,
|
|
116
|
+
onToggleRowExpand: handleToggleRowExpand
|
|
103
117
|
}
|
|
104
118
|
);
|
|
105
119
|
const paginationEl = hasPagination ? /* @__PURE__ */ jsx(
|
|
@@ -50,8 +50,7 @@
|
|
|
50
50
|
--table-component-header-fg: var(--table-header-fg);
|
|
51
51
|
--table-component-header-font-weight: var(--font-weight-medium);
|
|
52
52
|
--table-component-row-bg: var(--table-row-bg);
|
|
53
|
-
--table-component-row-bg-
|
|
54
|
-
--table-component-row-bg-hover: var(--table-row-bg-hover);
|
|
53
|
+
--table-component-row-bg-hover: var(--color-bg-hover-subtle);
|
|
55
54
|
--table-component-row-bg-selected: var(--table-row-bg-selected);
|
|
56
55
|
--table-component-row-bg-selected-hover: var(--table-row-bg-selected-hover);
|
|
57
56
|
--table-component-cell-fg: var(--table-cell-fg);
|
|
@@ -79,11 +78,6 @@
|
|
|
79
78
|
--table-component-header-fg: var(--color-fg-subtle);
|
|
80
79
|
--table-component-header-font-weight: var(--font-weight-default);
|
|
81
80
|
--table-component-row-bg: transparent;
|
|
82
|
-
--table-component-row-bg-alt: color-mix(
|
|
83
|
-
in srgb,
|
|
84
|
-
var(--color-bg-contextual-subtle) 55%,
|
|
85
|
-
transparent
|
|
86
|
-
);
|
|
87
81
|
--table-component-row-bg-hover: var(--color-bg-contextual-subtle);
|
|
88
82
|
--table-component-row-bg-selected: color-mix(in srgb, var(--color-bg-selected) 55%, transparent);
|
|
89
83
|
--table-component-row-bg-selected-hover: color-mix(
|
|
@@ -207,15 +201,9 @@
|
|
|
207
201
|
height: 32px;
|
|
208
202
|
}
|
|
209
203
|
|
|
210
|
-
.sm .contextMenuOverlay {
|
|
211
|
-
min-block-size: 0;
|
|
212
|
-
block-size: min(100%, 32px);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
204
|
.sm .contextMenuTrigger {
|
|
216
205
|
min-block-size: 0;
|
|
217
206
|
block-size: 100%;
|
|
218
|
-
border-radius: 0;
|
|
219
207
|
}
|
|
220
208
|
|
|
221
209
|
.cell[data-vertical-align='top'] {
|
|
@@ -310,10 +298,6 @@
|
|
|
310
298
|
background-color: var(--table-component-row-bg-selected-hover);
|
|
311
299
|
}
|
|
312
300
|
|
|
313
|
-
.striped > .row:nth-child(even):not(.selectedRow):not(:hover) > .cell {
|
|
314
|
-
background-color: var(--table-component-row-bg-alt);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
301
|
.row:focus-within > .cell {
|
|
318
302
|
box-shadow:
|
|
319
303
|
inset 0 2px 0 var(--color-brand),
|
|
@@ -573,29 +557,35 @@
|
|
|
573
557
|
|
|
574
558
|
.contextMenuTrigger {
|
|
575
559
|
color: var(--color-fg-subtle);
|
|
576
|
-
min-inline-size: var(--component-size-
|
|
577
|
-
min-block-size: var(--component-size-
|
|
578
|
-
border-radius:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
.contextMenuAnchorCell {
|
|
582
|
-
overflow: visible;
|
|
560
|
+
min-inline-size: calc(var(--component-size-md) + 4px);
|
|
561
|
+
min-block-size: calc(var(--component-size-md) + 4px);
|
|
562
|
+
border-radius: 999px;
|
|
563
|
+
background-color: transparent;
|
|
564
|
+
position: relative;
|
|
583
565
|
z-index: 1;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
.contextMenuAnchorCell .cellValueEllipsis,
|
|
587
|
-
.contextMenuAnchorCell .cellValueNoEllipsis {
|
|
588
|
-
padding-inline-end: calc(var(--component-size-sm) + var(--spacing-sm));
|
|
566
|
+
overflow: hidden;
|
|
589
567
|
}
|
|
590
568
|
|
|
591
569
|
.contextMenuOverlay {
|
|
592
570
|
position: absolute;
|
|
593
|
-
inset-block:
|
|
594
|
-
inset-inline-end:
|
|
571
|
+
inset-block-start: 50%;
|
|
572
|
+
inset-inline-end: var(--spacing-2xs);
|
|
573
|
+
transform: translateY(-50%);
|
|
595
574
|
display: inline-flex;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
575
|
+
align-items: center;
|
|
576
|
+
justify-content: flex-end;
|
|
577
|
+
inline-size: max-content;
|
|
578
|
+
block-size: auto;
|
|
579
|
+
min-inline-size: 0;
|
|
580
|
+
padding: 0;
|
|
581
|
+
border-radius: var(--border-radius-rounded);
|
|
582
|
+
background-color: transparent;
|
|
583
|
+
z-index: 2;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.contextMenuHoverOnly .contextMenuOverlay {
|
|
587
|
+
opacity: 0;
|
|
588
|
+
pointer-events: none;
|
|
599
589
|
}
|
|
600
590
|
|
|
601
591
|
/*
|
|
@@ -610,11 +600,24 @@
|
|
|
610
600
|
.contextMenuOverlay > div,
|
|
611
601
|
.contextMenuOverlay > div > div {
|
|
612
602
|
align-items: center;
|
|
603
|
+
background-color: transparent;
|
|
604
|
+
overflow: visible;
|
|
605
|
+
border-radius: 999px;
|
|
613
606
|
}
|
|
614
607
|
|
|
615
|
-
.
|
|
616
|
-
|
|
617
|
-
|
|
608
|
+
.actionCell {
|
|
609
|
+
overflow: visible;
|
|
610
|
+
position: relative;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.cellContentWithActions {
|
|
614
|
+
padding-inline-end: calc(var(--component-size-md) + 4px + var(--spacing-sm));
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.contextMenuTrigger:hover,
|
|
618
|
+
.contextMenuTrigger:focus-visible {
|
|
619
|
+
background-color: var(--table-component-row-bg-hover);
|
|
620
|
+
z-index: 2;
|
|
618
621
|
}
|
|
619
622
|
|
|
620
623
|
.contextMenuItemLabel {
|
|
@@ -628,13 +631,7 @@
|
|
|
628
631
|
min-width: 0;
|
|
629
632
|
}
|
|
630
633
|
|
|
631
|
-
.contextMenuHoverOnly .
|
|
632
|
-
opacity: 0;
|
|
633
|
-
pointer-events: none;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
.contextMenuHoverOnly:hover .contextMenuTrigger,
|
|
637
|
-
.contextMenuHoverOnly:focus-within .contextMenuTrigger {
|
|
634
|
+
.contextMenuHoverOnly:hover .contextMenuOverlay {
|
|
638
635
|
opacity: 1;
|
|
639
636
|
pointer-events: auto;
|
|
640
637
|
}
|
|
@@ -56,7 +56,6 @@ export type TableProps<T extends Record<string, any>> = Omit<HTMLAttributes<HTML
|
|
|
56
56
|
variant?: TableVariant;
|
|
57
57
|
size?: 'sm' | 'md';
|
|
58
58
|
viewMode?: ViewMode;
|
|
59
|
-
striped?: boolean;
|
|
60
59
|
fillViewport?: boolean;
|
|
61
60
|
fillViewportBottomOffset?: number;
|
|
62
61
|
containScrolling?: boolean;
|
|
@@ -82,6 +81,7 @@ export type TableProps<T extends Record<string, any>> = Omit<HTMLAttributes<HTML
|
|
|
82
81
|
open: () => void;
|
|
83
82
|
}) => TableContextMenuItem[];
|
|
84
83
|
showContextMenuOnHover?: boolean;
|
|
84
|
+
expandableRows?: boolean;
|
|
85
85
|
onRowClick?: (row: T) => void;
|
|
86
86
|
onRowMouseEnter?: (row: T) => void;
|
|
87
87
|
onRowSelect?: (rowId: number | string, isSelected: boolean) => void;
|