@dbcdk/react-components 0.0.106 → 0.0.108
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/card/Card.module.css +2 -0
- package/dist/components/circle/Circle.cjs +7 -1
- package/dist/components/circle/Circle.d.ts +2 -1
- package/dist/components/circle/Circle.js +7 -1
- package/dist/components/forms/input/Input.cjs +2 -1
- package/dist/components/forms/input/Input.js +2 -1
- package/dist/components/forms/text-area/Textarea.cjs +2 -0
- package/dist/components/forms/text-area/Textarea.js +2 -0
- package/dist/components/grid/Grid.cjs +15 -2
- package/dist/components/grid/Grid.d.ts +7 -1
- package/dist/components/grid/Grid.js +15 -2
- package/dist/components/grid/Grid.module.css +9 -0
- package/dist/components/headline/Headline.cjs +1 -1
- package/dist/components/headline/Headline.js +1 -1
- package/dist/components/headline/Headline.module.css +3 -1
- package/dist/components/metric-tile/MetricTile.cjs +26 -0
- package/dist/components/metric-tile/MetricTile.d.ts +13 -0
- package/dist/components/metric-tile/MetricTile.js +20 -0
- package/dist/components/metric-tile/MetricTile.module.css +95 -0
- package/dist/components/pagination/Pagination.cjs +3 -2
- package/dist/components/pagination/Pagination.d.ts +2 -1
- package/dist/components/pagination/Pagination.js +3 -2
- package/dist/components/stack/Stack.cjs +10 -1
- package/dist/components/stack/Stack.d.ts +2 -0
- package/dist/components/stack/Stack.js +10 -1
- package/dist/components/stack/Stack.module.css +16 -0
- package/dist/components/table/Table.cjs +5 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +5 -1
- package/dist/components/table/Table.module.css +54 -17
- package/dist/components/table/Table.types.d.ts +2 -0
- package/dist/components/table/TanstackTable.cjs +11 -1
- package/dist/components/table/TanstackTable.js +11 -1
- package/dist/components/table/tanstackTable.utils.cjs +9 -2
- package/dist/components/table/tanstackTable.utils.js +9 -2
- package/dist/index.cjs +7 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var Tooltip = require('../../components/overlay/tooltip/Tooltip');
|
|
4
5
|
var styles = require('./Circle.module.css');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -10,12 +11,13 @@ var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
|
10
11
|
function Circle({
|
|
11
12
|
severity,
|
|
12
13
|
children,
|
|
14
|
+
tooltip,
|
|
13
15
|
glow,
|
|
14
16
|
muted,
|
|
15
17
|
pulse,
|
|
16
18
|
size = "sm"
|
|
17
19
|
}) {
|
|
18
|
-
|
|
20
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.container, "data-size": size, children: [
|
|
19
21
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20
22
|
"span",
|
|
21
23
|
{
|
|
@@ -28,6 +30,10 @@ function Circle({
|
|
|
28
30
|
),
|
|
29
31
|
children
|
|
30
32
|
] });
|
|
33
|
+
if (tooltip) {
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: tooltip, children: inner });
|
|
35
|
+
}
|
|
36
|
+
return inner;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
exports.Circle = Circle;
|
|
@@ -4,10 +4,11 @@ type CircleSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
|
4
4
|
interface CircleProps {
|
|
5
5
|
severity: Severity;
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
tooltip?: ReactNode;
|
|
7
8
|
glow?: boolean;
|
|
8
9
|
muted?: boolean;
|
|
9
10
|
pulse?: boolean;
|
|
10
11
|
size?: CircleSize;
|
|
11
12
|
}
|
|
12
|
-
export declare function Circle({ severity, children, glow, muted, pulse, size, }: CircleProps): JSX.Element;
|
|
13
|
+
export declare function Circle({ severity, children, tooltip, glow, muted, pulse, size, }: CircleProps): JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Tooltip } from '../../components/overlay/tooltip/Tooltip';
|
|
2
3
|
import styles from './Circle.module.css';
|
|
3
4
|
|
|
4
5
|
function Circle({
|
|
5
6
|
severity,
|
|
6
7
|
children,
|
|
8
|
+
tooltip,
|
|
7
9
|
glow,
|
|
8
10
|
muted,
|
|
9
11
|
pulse,
|
|
10
12
|
size = "sm"
|
|
11
13
|
}) {
|
|
12
|
-
|
|
14
|
+
const inner = /* @__PURE__ */ jsxs("span", { className: styles.container, "data-size": size, children: [
|
|
13
15
|
/* @__PURE__ */ jsx(
|
|
14
16
|
"span",
|
|
15
17
|
{
|
|
@@ -22,6 +24,10 @@ function Circle({
|
|
|
22
24
|
),
|
|
23
25
|
children
|
|
24
26
|
] });
|
|
27
|
+
if (tooltip) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: tooltip, children: inner });
|
|
29
|
+
}
|
|
30
|
+
return inner;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export { Circle };
|
|
@@ -24,6 +24,7 @@ function mergeRefs(...refs) {
|
|
|
24
24
|
}
|
|
25
25
|
const Input = react.forwardRef(function Input2({
|
|
26
26
|
label,
|
|
27
|
+
labelAction,
|
|
27
28
|
error,
|
|
28
29
|
helpText,
|
|
29
30
|
orientation = "vertical",
|
|
@@ -90,7 +91,7 @@ const Input = react.forwardRef(function Input2({
|
|
|
90
91
|
InputContainer.InputContainer,
|
|
91
92
|
{
|
|
92
93
|
label,
|
|
93
|
-
labelAction
|
|
94
|
+
labelAction,
|
|
94
95
|
htmlFor: inputId,
|
|
95
96
|
fullWidth,
|
|
96
97
|
error,
|
|
@@ -18,6 +18,7 @@ function mergeRefs(...refs) {
|
|
|
18
18
|
}
|
|
19
19
|
const Input = forwardRef(function Input2({
|
|
20
20
|
label,
|
|
21
|
+
labelAction,
|
|
21
22
|
error,
|
|
22
23
|
helpText,
|
|
23
24
|
orientation = "vertical",
|
|
@@ -84,7 +85,7 @@ const Input = forwardRef(function Input2({
|
|
|
84
85
|
InputContainer,
|
|
85
86
|
{
|
|
86
87
|
label,
|
|
87
|
-
labelAction
|
|
88
|
+
labelAction,
|
|
88
89
|
htmlFor: inputId,
|
|
89
90
|
fullWidth,
|
|
90
91
|
error,
|
|
@@ -32,6 +32,7 @@ const Textarea = function Textarea2({
|
|
|
32
32
|
labelWidth = "160px",
|
|
33
33
|
fullWidth = false,
|
|
34
34
|
required,
|
|
35
|
+
labelAction,
|
|
35
36
|
// Native textarea props
|
|
36
37
|
className,
|
|
37
38
|
...rest
|
|
@@ -101,6 +102,7 @@ const Textarea = function Textarea2({
|
|
|
101
102
|
labelWidth,
|
|
102
103
|
fullWidth,
|
|
103
104
|
required,
|
|
105
|
+
labelAction,
|
|
104
106
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
107
|
"div",
|
|
106
108
|
{
|
|
@@ -26,6 +26,7 @@ const Textarea = function Textarea2({
|
|
|
26
26
|
labelWidth = "160px",
|
|
27
27
|
fullWidth = false,
|
|
28
28
|
required,
|
|
29
|
+
labelAction,
|
|
29
30
|
// Native textarea props
|
|
30
31
|
className,
|
|
31
32
|
...rest
|
|
@@ -95,6 +96,7 @@ const Textarea = function Textarea2({
|
|
|
95
96
|
labelWidth,
|
|
96
97
|
fullWidth,
|
|
97
98
|
required,
|
|
99
|
+
labelAction,
|
|
98
100
|
children: /* @__PURE__ */ jsx(
|
|
99
101
|
"div",
|
|
100
102
|
{
|
|
@@ -15,12 +15,25 @@ const GAP_TOKEN = {
|
|
|
15
15
|
lg: "var(--spacing-lg)",
|
|
16
16
|
xl: "var(--spacing-xl)"
|
|
17
17
|
};
|
|
18
|
-
function Grid({
|
|
18
|
+
function Grid({
|
|
19
|
+
children,
|
|
20
|
+
gap = "md",
|
|
21
|
+
equalHeight = false,
|
|
22
|
+
maxWidth,
|
|
23
|
+
className,
|
|
24
|
+
style
|
|
25
|
+
}) {
|
|
19
26
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
27
|
"div",
|
|
21
28
|
{
|
|
22
29
|
className: [styles__default.default.grid, equalHeight && styles__default.default.equalHeight, className].filter(Boolean).join(" "),
|
|
23
|
-
style: {
|
|
30
|
+
style: {
|
|
31
|
+
gap: GAP_TOKEN[gap],
|
|
32
|
+
...(maxWidth == null ? void 0 : maxWidth.base) != null ? { "--max-width-base": maxWidth.base } : {},
|
|
33
|
+
...(maxWidth == null ? void 0 : maxWidth.md) != null ? { "--max-width-md": maxWidth.md } : {},
|
|
34
|
+
...(maxWidth == null ? void 0 : maxWidth.lg) != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
35
|
+
...style
|
|
36
|
+
},
|
|
24
37
|
children
|
|
25
38
|
}
|
|
26
39
|
);
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export type GridGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface GridMaxWidth {
|
|
4
|
+
base?: string;
|
|
5
|
+
md?: string;
|
|
6
|
+
lg?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface GridProps {
|
|
4
9
|
children?: ReactNode;
|
|
5
10
|
gap?: GridGap;
|
|
6
11
|
/** Stretch direct children so cards/items in the same row get equal height */
|
|
7
12
|
equalHeight?: boolean;
|
|
13
|
+
maxWidth?: GridMaxWidth;
|
|
8
14
|
className?: string;
|
|
9
15
|
style?: CSSProperties;
|
|
10
16
|
}
|
|
11
|
-
export declare function Grid({ children, gap, equalHeight, className, style }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Grid({ children, gap, equalHeight, maxWidth, className, style, }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
12
18
|
export interface GridItemProps {
|
|
13
19
|
children?: ReactNode;
|
|
14
20
|
/** Default span: <768px */
|
|
@@ -9,12 +9,25 @@ const GAP_TOKEN = {
|
|
|
9
9
|
lg: "var(--spacing-lg)",
|
|
10
10
|
xl: "var(--spacing-xl)"
|
|
11
11
|
};
|
|
12
|
-
function Grid({
|
|
12
|
+
function Grid({
|
|
13
|
+
children,
|
|
14
|
+
gap = "md",
|
|
15
|
+
equalHeight = false,
|
|
16
|
+
maxWidth,
|
|
17
|
+
className,
|
|
18
|
+
style
|
|
19
|
+
}) {
|
|
13
20
|
return /* @__PURE__ */ jsx(
|
|
14
21
|
"div",
|
|
15
22
|
{
|
|
16
23
|
className: [styles.grid, equalHeight && styles.equalHeight, className].filter(Boolean).join(" "),
|
|
17
|
-
style: {
|
|
24
|
+
style: {
|
|
25
|
+
gap: GAP_TOKEN[gap],
|
|
26
|
+
...(maxWidth == null ? void 0 : maxWidth.base) != null ? { "--max-width-base": maxWidth.base } : {},
|
|
27
|
+
...(maxWidth == null ? void 0 : maxWidth.md) != null ? { "--max-width-md": maxWidth.md } : {},
|
|
28
|
+
...(maxWidth == null ? void 0 : maxWidth.lg) != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
29
|
+
...style
|
|
30
|
+
},
|
|
18
31
|
children
|
|
19
32
|
}
|
|
20
33
|
);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
4
4
|
align-items: start;
|
|
5
|
+
max-width: var(--max-width-base);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.equalHeight {
|
|
@@ -23,12 +24,20 @@
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
@media (min-width: 768px) {
|
|
27
|
+
.grid {
|
|
28
|
+
max-width: var(--max-width-md, var(--max-width-base));
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
.item {
|
|
27
32
|
grid-column: span var(--span-md, var(--span-base, 12));
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
@media (min-width: 1200px) {
|
|
37
|
+
.grid {
|
|
38
|
+
max-width: var(--max-width-lg, var(--max-width-md, var(--max-width-base)));
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
.item {
|
|
33
42
|
grid-column: span var(--span-lg, var(--span-md, var(--span-base, 12)));
|
|
34
43
|
}
|
|
@@ -45,7 +45,7 @@ function Headline({
|
|
|
45
45
|
},
|
|
46
46
|
className: headlineClassName,
|
|
47
47
|
children: [
|
|
48
|
-
icon || severity$1 && !marker ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { customIcon: icon, severity: severity$1 }) }) : null,
|
|
48
|
+
icon || severity$1 && !marker ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { customIcon: icon, severity: icon ? void 0 : severity$1 }) }) : null,
|
|
49
49
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: textClassName, children })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
@@ -39,7 +39,7 @@ function Headline({
|
|
|
39
39
|
},
|
|
40
40
|
className: headlineClassName,
|
|
41
41
|
children: [
|
|
42
|
-
icon || severity && !marker ? /* @__PURE__ */ jsx("span", { className: styles.icon, children: /* @__PURE__ */ jsx(Icon, { customIcon: icon, severity }) }) : null,
|
|
42
|
+
icon || severity && !marker ? /* @__PURE__ */ jsx("span", { className: styles.icon, children: /* @__PURE__ */ jsx(Icon, { customIcon: icon, severity: icon ? void 0 : severity }) }) : null,
|
|
43
43
|
/* @__PURE__ */ jsx("span", { className: textClassName, children })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.headlineContainer {
|
|
2
2
|
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
3
4
|
align-items: flex-start;
|
|
4
5
|
gap: var(--spacing-lg);
|
|
5
6
|
max-width: 100%;
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
.headline {
|
|
26
27
|
position: relative;
|
|
27
28
|
display: inline-flex;
|
|
29
|
+
flex: 1 1 auto;
|
|
28
30
|
align-items: center;
|
|
29
31
|
gap: var(--spacing-xs);
|
|
30
32
|
margin-block: var(--spacing-xs);
|
|
@@ -131,7 +133,7 @@
|
|
|
131
133
|
|
|
132
134
|
.addition {
|
|
133
135
|
display: flex;
|
|
134
|
-
flex:
|
|
136
|
+
flex: 0 0 auto;
|
|
135
137
|
min-width: 0;
|
|
136
138
|
align-items: center;
|
|
137
139
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var client = require('../../client');
|
|
5
|
+
var styles = require('./MetricTile.module.css');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
10
|
+
|
|
11
|
+
function MetricTile({
|
|
12
|
+
severity,
|
|
13
|
+
label,
|
|
14
|
+
value,
|
|
15
|
+
tooltip,
|
|
16
|
+
size = "md",
|
|
17
|
+
width
|
|
18
|
+
}) {
|
|
19
|
+
const style = width != null ? { width: typeof width === "number" ? `${width}px` : width } : void 0;
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(client.Tooltip, { content: tooltip, placement: "bottom", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.tile, "data-severity": severity, "data-size": size, style, children: [
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.label, children: label }),
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.value, children: value })
|
|
23
|
+
] }) });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.MetricTile = MetricTile;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode, JSX } from 'react';
|
|
2
|
+
import { Severity } from '../../constants/severity.types';
|
|
3
|
+
type MetricTileSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
interface MetricTileProps {
|
|
5
|
+
severity: Severity;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
tooltip?: ReactNode;
|
|
9
|
+
size?: MetricTileSize;
|
|
10
|
+
width?: number | string;
|
|
11
|
+
}
|
|
12
|
+
export declare function MetricTile({ severity, label, value, tooltip, size, width, }: MetricTileProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Tooltip } from '../../client';
|
|
3
|
+
import styles from './MetricTile.module.css';
|
|
4
|
+
|
|
5
|
+
function MetricTile({
|
|
6
|
+
severity,
|
|
7
|
+
label,
|
|
8
|
+
value,
|
|
9
|
+
tooltip,
|
|
10
|
+
size = "md",
|
|
11
|
+
width
|
|
12
|
+
}) {
|
|
13
|
+
const style = width != null ? { width: typeof width === "number" ? `${width}px` : width } : void 0;
|
|
14
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: tooltip, placement: "bottom", children: /* @__PURE__ */ jsxs("span", { className: styles.tile, "data-severity": severity, "data-size": size, style, children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: styles.label, children: label }),
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: styles.value, children: value })
|
|
17
|
+
] }) });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { MetricTile };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.tile {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
gap: var(--spacing-2xs);
|
|
7
|
+
padding: var(--spacing-sm) var(--spacing-md);
|
|
8
|
+
min-width: 72px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
border-radius: var(--border-radius-md);
|
|
12
|
+
font-family: var(--font-family);
|
|
13
|
+
cursor: default;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tile[data-size='sm'] {
|
|
17
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
18
|
+
min-width: 56px;
|
|
19
|
+
border-radius: var(--border-radius-sm);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tile[data-size='lg'] {
|
|
23
|
+
padding: var(--spacing-md) var(--spacing-lg);
|
|
24
|
+
min-width: 96px;
|
|
25
|
+
border-radius: var(--border-radius-lg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tile[data-severity='success'] {
|
|
29
|
+
background-color: var(--color-status-success-bg);
|
|
30
|
+
color: var(--color-status-success-fg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tile[data-severity='error'] {
|
|
34
|
+
background-color: var(--color-status-error-bg);
|
|
35
|
+
color: var(--color-status-error-fg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.tile[data-severity='warning'] {
|
|
39
|
+
background-color: var(--color-status-warning-bg);
|
|
40
|
+
color: var(--color-status-warning-fg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tile[data-severity='info'] {
|
|
44
|
+
background-color: var(--color-status-info-bg);
|
|
45
|
+
color: var(--color-status-info-fg);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.tile[data-severity='neutral'] {
|
|
49
|
+
background-color: var(--color-bg-toolbar);
|
|
50
|
+
color: var(--color-fg-default);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tile[data-severity='brand'] {
|
|
54
|
+
background-color: var(--color-brand);
|
|
55
|
+
color: var(--color-fg-on-brand);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.label {
|
|
59
|
+
font-size: var(--font-size-xs);
|
|
60
|
+
font-weight: var(--font-weight-medium);
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
63
|
+
line-height: 1;
|
|
64
|
+
opacity: 0.85;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.value {
|
|
72
|
+
font-size: var(--font-size-lg);
|
|
73
|
+
font-weight: var(--font-weight-bold);
|
|
74
|
+
line-height: 1;
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.tile[data-size='sm'] .label {
|
|
82
|
+
font-size: var(--font-size-sm);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tile[data-size='sm'] .value {
|
|
86
|
+
font-size: var(--font-size-sm);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tile[data-size='lg'] .label {
|
|
90
|
+
font-size: var(--font-size-sm);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.tile[data-size='lg'] .value {
|
|
94
|
+
font-size: var(--font-size-xl);
|
|
95
|
+
}
|
|
@@ -22,7 +22,8 @@ function Pagination({
|
|
|
22
22
|
onPageChange,
|
|
23
23
|
pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,
|
|
24
24
|
showFirstLast = true,
|
|
25
|
-
showGoToPage = true
|
|
25
|
+
showGoToPage = true,
|
|
26
|
+
showPageSize = true
|
|
26
27
|
}) {
|
|
27
28
|
const popoverRef = react.useRef(null);
|
|
28
29
|
const pageSizeRef = react.useRef(null);
|
|
@@ -131,7 +132,7 @@ function Pagination({
|
|
|
131
132
|
) }, page)) })
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
135
|
+
showPageSize && /* @__PURE__ */ jsxRuntime.jsx(
|
|
135
136
|
Popover.Popover,
|
|
136
137
|
{
|
|
137
138
|
ref: pageSizeRef,
|
|
@@ -15,6 +15,7 @@ interface PaginationProps {
|
|
|
15
15
|
pageSizeOptions?: number[];
|
|
16
16
|
showFirstLast?: boolean;
|
|
17
17
|
showGoToPage?: boolean;
|
|
18
|
+
showPageSize?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, showFirstLast, showGoToPage, }: PaginationProps): ReactNode;
|
|
20
|
+
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, showFirstLast, showGoToPage, showPageSize, }: PaginationProps): ReactNode;
|
|
20
21
|
export {};
|
|
@@ -16,7 +16,8 @@ function Pagination({
|
|
|
16
16
|
onPageChange,
|
|
17
17
|
pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,
|
|
18
18
|
showFirstLast = true,
|
|
19
|
-
showGoToPage = true
|
|
19
|
+
showGoToPage = true,
|
|
20
|
+
showPageSize = true
|
|
20
21
|
}) {
|
|
21
22
|
const popoverRef = useRef(null);
|
|
22
23
|
const pageSizeRef = useRef(null);
|
|
@@ -125,7 +126,7 @@ function Pagination({
|
|
|
125
126
|
) }, page)) })
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
/* @__PURE__ */ jsx(
|
|
129
|
+
showPageSize && /* @__PURE__ */ jsx(
|
|
129
130
|
Popover,
|
|
130
131
|
{
|
|
131
132
|
ref: pageSizeRef,
|
|
@@ -22,10 +22,18 @@ const Stack = react.forwardRef(function Stack2({
|
|
|
22
22
|
mobileAlign,
|
|
23
23
|
mobileJustify,
|
|
24
24
|
mobileWrap = false,
|
|
25
|
+
maxWidth,
|
|
25
26
|
className,
|
|
27
|
+
style,
|
|
26
28
|
...rest
|
|
27
29
|
}, ref) {
|
|
28
30
|
const Tag = as != null ? as : "div";
|
|
31
|
+
const resolvedStyle = maxWidth != null ? {
|
|
32
|
+
...maxWidth.base != null ? { "--max-width-base": maxWidth.base } : {},
|
|
33
|
+
...maxWidth.md != null ? { "--max-width-md": maxWidth.md } : {},
|
|
34
|
+
...maxWidth.lg != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
35
|
+
...style
|
|
36
|
+
} : style;
|
|
29
37
|
const classes = [
|
|
30
38
|
"dbc-flex",
|
|
31
39
|
direction === "column" ? "dbc-flex-column" : void 0,
|
|
@@ -39,9 +47,10 @@ const Stack = react.forwardRef(function Stack2({
|
|
|
39
47
|
mobileAlign ? styles__default.default[`mobileAlign${mobileAlign.charAt(0).toUpperCase()}${mobileAlign.slice(1)}`] : void 0,
|
|
40
48
|
mobileJustify ? styles__default.default[`mobileJustify${mobileJustify.charAt(0).toUpperCase()}${mobileJustify.slice(1)}`] : void 0,
|
|
41
49
|
mobileWrap ? styles__default.default.mobileWrap : void 0,
|
|
50
|
+
maxWidth != null ? styles__default.default.maxWidth : void 0,
|
|
42
51
|
className
|
|
43
52
|
].filter(Boolean).join(" ");
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { ref, className: classes, ...rest });
|
|
53
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { ref, className: classes, style: resolvedStyle, ...rest });
|
|
45
54
|
});
|
|
46
55
|
|
|
47
56
|
exports.Stack = Stack;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ElementType } from 'react';
|
|
2
|
+
import type { GridMaxWidth } from '../../components/grid/Grid';
|
|
2
3
|
type GapSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
3
4
|
type StackDirection = 'row' | 'column';
|
|
4
5
|
type StackAlign = 'start' | 'center' | 'end';
|
|
@@ -15,6 +16,7 @@ type StackOwnProps = {
|
|
|
15
16
|
mobileAlign?: StackAlign;
|
|
16
17
|
mobileJustify?: StackJustify;
|
|
17
18
|
mobileWrap?: boolean;
|
|
19
|
+
maxWidth?: GridMaxWidth;
|
|
18
20
|
};
|
|
19
21
|
export type StackProps<C extends ElementType = 'div'> = StackOwnProps & {
|
|
20
22
|
as?: C;
|
|
@@ -16,10 +16,18 @@ const Stack = forwardRef(function Stack2({
|
|
|
16
16
|
mobileAlign,
|
|
17
17
|
mobileJustify,
|
|
18
18
|
mobileWrap = false,
|
|
19
|
+
maxWidth,
|
|
19
20
|
className,
|
|
21
|
+
style,
|
|
20
22
|
...rest
|
|
21
23
|
}, ref) {
|
|
22
24
|
const Tag = as != null ? as : "div";
|
|
25
|
+
const resolvedStyle = maxWidth != null ? {
|
|
26
|
+
...maxWidth.base != null ? { "--max-width-base": maxWidth.base } : {},
|
|
27
|
+
...maxWidth.md != null ? { "--max-width-md": maxWidth.md } : {},
|
|
28
|
+
...maxWidth.lg != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
29
|
+
...style
|
|
30
|
+
} : style;
|
|
23
31
|
const classes = [
|
|
24
32
|
"dbc-flex",
|
|
25
33
|
direction === "column" ? "dbc-flex-column" : void 0,
|
|
@@ -33,9 +41,10 @@ const Stack = forwardRef(function Stack2({
|
|
|
33
41
|
mobileAlign ? styles[`mobileAlign${mobileAlign.charAt(0).toUpperCase()}${mobileAlign.slice(1)}`] : void 0,
|
|
34
42
|
mobileJustify ? styles[`mobileJustify${mobileJustify.charAt(0).toUpperCase()}${mobileJustify.slice(1)}`] : void 0,
|
|
35
43
|
mobileWrap ? styles.mobileWrap : void 0,
|
|
44
|
+
maxWidth != null ? styles.maxWidth : void 0,
|
|
36
45
|
className
|
|
37
46
|
].filter(Boolean).join(" ");
|
|
38
|
-
return /* @__PURE__ */ jsx(Tag, { ref, className: classes, ...rest });
|
|
47
|
+
return /* @__PURE__ */ jsx(Tag, { ref, className: classes, style: resolvedStyle, ...rest });
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
export { Stack };
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.maxWidth {
|
|
2
|
+
max-width: var(--max-width-base);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media (min-width: 768px) {
|
|
6
|
+
.maxWidth {
|
|
7
|
+
max-width: var(--max-width-md, var(--max-width-base));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 1200px) {
|
|
12
|
+
.maxWidth {
|
|
13
|
+
max-width: var(--max-width-lg, var(--max-width-md, var(--max-width-base)));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
@media (max-width: 767px) {
|
|
2
18
|
.mobileDirectionRow {
|
|
3
19
|
flex-direction: row;
|
|
@@ -46,6 +46,8 @@ function Table({
|
|
|
46
46
|
totalItemsCount,
|
|
47
47
|
paginationPlacement = "bottom",
|
|
48
48
|
showFirstLast = false,
|
|
49
|
+
showGoToPage,
|
|
50
|
+
showPageSize,
|
|
49
51
|
pageSizeOptions,
|
|
50
52
|
getRowSeverity,
|
|
51
53
|
onRowClick,
|
|
@@ -116,6 +118,8 @@ function Table({
|
|
|
116
118
|
skip,
|
|
117
119
|
onPageChange: handlePageChange,
|
|
118
120
|
showFirstLast,
|
|
121
|
+
showGoToPage,
|
|
122
|
+
showPageSize,
|
|
119
123
|
pageSizeOptions
|
|
120
124
|
}
|
|
121
125
|
)
|
|
@@ -199,7 +203,7 @@ function Table({
|
|
|
199
203
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
200
204
|
"div",
|
|
201
205
|
{
|
|
202
|
-
className: "dbc-flex dbc-flex-column dbc-gap-md",
|
|
206
|
+
className: "dbc-flex dbc-flex-column dbc-gap-md dbc-flex-grow",
|
|
203
207
|
style: {
|
|
204
208
|
flexFlow: paginationPlacement === "top" ? "column-reverse" : "column",
|
|
205
209
|
position: "relative"
|
|
@@ -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, striped, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, pageSizeOptions, getRowSeverity, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
|
|
3
|
+
export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode, striped, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, showGoToPage, showPageSize, pageSizeOptions, getRowSeverity, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
|
|
4
4
|
export type { ColumnItem } from './Table.types';
|
|
@@ -40,6 +40,8 @@ function Table({
|
|
|
40
40
|
totalItemsCount,
|
|
41
41
|
paginationPlacement = "bottom",
|
|
42
42
|
showFirstLast = false,
|
|
43
|
+
showGoToPage,
|
|
44
|
+
showPageSize,
|
|
43
45
|
pageSizeOptions,
|
|
44
46
|
getRowSeverity,
|
|
45
47
|
onRowClick,
|
|
@@ -110,6 +112,8 @@ function Table({
|
|
|
110
112
|
skip,
|
|
111
113
|
onPageChange: handlePageChange,
|
|
112
114
|
showFirstLast,
|
|
115
|
+
showGoToPage,
|
|
116
|
+
showPageSize,
|
|
113
117
|
pageSizeOptions
|
|
114
118
|
}
|
|
115
119
|
)
|
|
@@ -193,7 +197,7 @@ function Table({
|
|
|
193
197
|
return /* @__PURE__ */ jsxs(
|
|
194
198
|
"div",
|
|
195
199
|
{
|
|
196
|
-
className: "dbc-flex dbc-flex-column dbc-gap-md",
|
|
200
|
+
className: "dbc-flex dbc-flex-column dbc-gap-md dbc-flex-grow",
|
|
197
201
|
style: {
|
|
198
202
|
flexFlow: paginationPlacement === "top" ? "column-reverse" : "column",
|
|
199
203
|
position: "relative"
|
|
@@ -46,6 +46,19 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.tableRoot {
|
|
49
|
+
--table-component-header-bg: var(--table-header-bg);
|
|
50
|
+
--table-component-header-fg: var(--table-header-fg);
|
|
51
|
+
--table-component-header-border: var(--table-border-header);
|
|
52
|
+
--table-component-header-font-weight: var(--font-weight-medium);
|
|
53
|
+
--table-component-row-bg: var(--table-row-bg);
|
|
54
|
+
--table-component-row-bg-alt: var(--table-row-bg-alt);
|
|
55
|
+
--table-component-row-bg-hover: var(--table-row-bg-hover);
|
|
56
|
+
--table-component-row-bg-selected: var(--table-row-bg-selected);
|
|
57
|
+
--table-component-row-bg-selected-hover: var(--table-row-bg-selected-hover);
|
|
58
|
+
--table-component-cell-fg: var(--table-cell-fg);
|
|
59
|
+
--table-component-cell-border: var(--table-border-subtle);
|
|
60
|
+
--table-component-divider: var(--table-divider);
|
|
61
|
+
|
|
49
62
|
display: flex;
|
|
50
63
|
flex-direction: column;
|
|
51
64
|
flex: 1 1 auto;
|
|
@@ -55,6 +68,31 @@
|
|
|
55
68
|
max-inline-size: 100%;
|
|
56
69
|
}
|
|
57
70
|
|
|
71
|
+
.primary {
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.embedded {
|
|
75
|
+
--table-component-header-bg: transparent;
|
|
76
|
+
--table-component-header-fg: var(--color-fg-subtle);
|
|
77
|
+
--table-component-header-border: transparent;
|
|
78
|
+
--table-component-header-font-weight: var(--font-weight-default);
|
|
79
|
+
--table-component-row-bg: transparent;
|
|
80
|
+
--table-component-row-bg-alt: color-mix(
|
|
81
|
+
in srgb,
|
|
82
|
+
var(--color-bg-contextual-subtle) 55%,
|
|
83
|
+
transparent
|
|
84
|
+
);
|
|
85
|
+
--table-component-row-bg-hover: var(--color-bg-contextual-subtle);
|
|
86
|
+
--table-component-row-bg-selected: color-mix(in srgb, var(--color-bg-selected) 55%, transparent);
|
|
87
|
+
--table-component-row-bg-selected-hover: color-mix(
|
|
88
|
+
in srgb,
|
|
89
|
+
var(--color-bg-selected-hover) 60%,
|
|
90
|
+
transparent
|
|
91
|
+
);
|
|
92
|
+
--table-component-cell-border: color-mix(in srgb, var(--table-border-subtle) 65%, transparent);
|
|
93
|
+
--table-component-divider: color-mix(in srgb, var(--table-divider) 75%, transparent);
|
|
94
|
+
}
|
|
95
|
+
|
|
58
96
|
.measuringLayout {
|
|
59
97
|
visibility: hidden;
|
|
60
98
|
}
|
|
@@ -64,20 +102,19 @@
|
|
|
64
102
|
min-block-size: 0;
|
|
65
103
|
min-inline-size: 0;
|
|
66
104
|
overflow: auto;
|
|
67
|
-
background: var(--table-row-bg);
|
|
105
|
+
background: var(--table-component-row-bg);
|
|
68
106
|
-webkit-overflow-scrolling: touch;
|
|
69
107
|
}
|
|
70
108
|
|
|
71
109
|
.tableElement {
|
|
72
110
|
inline-size: 100%;
|
|
73
|
-
min-inline-size: 100%;
|
|
74
111
|
border-collapse: separate;
|
|
75
112
|
border-spacing: 0;
|
|
76
113
|
table-layout: fixed;
|
|
77
114
|
font-family: var(--font-family);
|
|
78
115
|
font-size: var(--font-size-sm);
|
|
79
|
-
color: var(--table-cell-fg);
|
|
80
|
-
background: var(--table-row-bg);
|
|
116
|
+
color: var(--table-component-cell-fg);
|
|
117
|
+
background: var(--table-component-row-bg);
|
|
81
118
|
}
|
|
82
119
|
|
|
83
120
|
.header {
|
|
@@ -102,7 +139,7 @@
|
|
|
102
139
|
}
|
|
103
140
|
|
|
104
141
|
.body .row:first-child .cell {
|
|
105
|
-
border-block-start: var(--spacing-xs) solid var(--table-row-bg);
|
|
142
|
+
border-block-start: var(--spacing-xs) solid var(--table-component-row-bg);
|
|
106
143
|
}
|
|
107
144
|
|
|
108
145
|
.headerCell,
|
|
@@ -116,15 +153,15 @@
|
|
|
116
153
|
|
|
117
154
|
.headerCell {
|
|
118
155
|
vertical-align: middle;
|
|
119
|
-
background-color: var(--table-header-bg);
|
|
120
|
-
border-block-end: 1px solid var(--table-
|
|
156
|
+
background-color: var(--table-component-header-bg);
|
|
157
|
+
border-block-end: 1px solid var(--table-component-header-border);
|
|
121
158
|
padding-block: var(--spacing-xxs);
|
|
122
159
|
padding-inline: var(--spacing-sm);
|
|
123
160
|
font-size: var(--font-size-xs);
|
|
124
|
-
font-weight: var(--font-weight
|
|
161
|
+
font-weight: var(--table-component-header-font-weight);
|
|
125
162
|
letter-spacing: var(--letter-spacing-wide);
|
|
126
163
|
text-transform: uppercase;
|
|
127
|
-
color: var(--table-header-fg);
|
|
164
|
+
color: var(--table-component-header-fg);
|
|
128
165
|
white-space: nowrap;
|
|
129
166
|
}
|
|
130
167
|
|
|
@@ -137,8 +174,8 @@
|
|
|
137
174
|
.cell {
|
|
138
175
|
padding-block: 6px;
|
|
139
176
|
padding-inline: var(--spacing-sm);
|
|
140
|
-
border-block-end: 1px solid var(--table-border
|
|
141
|
-
background: var(--table-row-bg);
|
|
177
|
+
border-block-end: 1px solid var(--table-component-cell-border);
|
|
178
|
+
background: var(--table-component-row-bg);
|
|
142
179
|
overflow: hidden;
|
|
143
180
|
line-height: 20px;
|
|
144
181
|
}
|
|
@@ -242,19 +279,19 @@
|
|
|
242
279
|
}
|
|
243
280
|
|
|
244
281
|
.row:hover > .cell {
|
|
245
|
-
background-color: var(--table-row-bg-hover);
|
|
282
|
+
background-color: var(--table-component-row-bg-hover);
|
|
246
283
|
}
|
|
247
284
|
|
|
248
285
|
.selectedRow > .cell {
|
|
249
|
-
background-color: var(--table-row-bg-selected);
|
|
286
|
+
background-color: var(--table-component-row-bg-selected);
|
|
250
287
|
}
|
|
251
288
|
|
|
252
289
|
.selectedRow:hover > .cell {
|
|
253
|
-
background-color: var(--table-row-bg-selected-hover);
|
|
290
|
+
background-color: var(--table-component-row-bg-selected-hover);
|
|
254
291
|
}
|
|
255
292
|
|
|
256
293
|
.striped > .row:nth-child(even):not(.selectedRow):not(:hover) > .cell {
|
|
257
|
-
background-color: var(--table-row-bg-alt);
|
|
294
|
+
background-color: var(--table-component-row-bg-alt);
|
|
258
295
|
}
|
|
259
296
|
|
|
260
297
|
.row:focus-within > .cell {
|
|
@@ -520,7 +557,7 @@
|
|
|
520
557
|
top: 8px;
|
|
521
558
|
bottom: 8px;
|
|
522
559
|
width: 1px;
|
|
523
|
-
background: var(--table-divider);
|
|
560
|
+
background: var(--table-component-divider);
|
|
524
561
|
}
|
|
525
562
|
|
|
526
563
|
.dividerRight::after {
|
|
@@ -530,5 +567,5 @@
|
|
|
530
567
|
top: 8px;
|
|
531
568
|
bottom: 8px;
|
|
532
569
|
width: 1px;
|
|
533
|
-
background: var(--table-divider);
|
|
570
|
+
background: var(--table-component-divider);
|
|
534
571
|
}
|
|
@@ -56,6 +56,8 @@ export type TableProps<T extends Record<string, any>> = Omit<HTMLAttributes<HTML
|
|
|
56
56
|
totalItemsCount?: number;
|
|
57
57
|
paginationPlacement?: 'top' | 'bottom';
|
|
58
58
|
showFirstLast?: boolean;
|
|
59
|
+
showGoToPage?: boolean;
|
|
60
|
+
showPageSize?: boolean;
|
|
59
61
|
pageSizeOptions?: number[];
|
|
60
62
|
getRowSeverity?: (row: T) => Severity | undefined;
|
|
61
63
|
onRowClick?: (row: T) => void;
|
|
@@ -97,7 +97,17 @@ function TanstackTable(props) {
|
|
|
97
97
|
window.addEventListener("resize", updateWidth);
|
|
98
98
|
return () => window.removeEventListener("resize", updateWidth);
|
|
99
99
|
}
|
|
100
|
-
const observer = new ResizeObserver(() =>
|
|
100
|
+
const observer = new ResizeObserver((entries) => {
|
|
101
|
+
var _a, _b, _c;
|
|
102
|
+
const entry = entries[0];
|
|
103
|
+
if (!entry) {
|
|
104
|
+
updateWidth();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const contentWidth = (_c = (_b = (_a = entry.contentBoxSize) == null ? void 0 : _a[0]) == null ? void 0 : _b.inlineSize) != null ? _c : entry.contentRect.width;
|
|
108
|
+
const next = Math.floor(contentWidth);
|
|
109
|
+
setAvailableWidth(next > 0 ? next : void 0);
|
|
110
|
+
});
|
|
101
111
|
observer.observe(el);
|
|
102
112
|
return () => observer.disconnect();
|
|
103
113
|
}, []);
|
|
@@ -72,7 +72,17 @@ function TanstackTable(props) {
|
|
|
72
72
|
window.addEventListener("resize", updateWidth);
|
|
73
73
|
return () => window.removeEventListener("resize", updateWidth);
|
|
74
74
|
}
|
|
75
|
-
const observer = new ResizeObserver(() =>
|
|
75
|
+
const observer = new ResizeObserver((entries) => {
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
const entry = entries[0];
|
|
78
|
+
if (!entry) {
|
|
79
|
+
updateWidth();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const contentWidth = (_c = (_b = (_a = entry.contentBoxSize) == null ? void 0 : _a[0]) == null ? void 0 : _b.inlineSize) != null ? _c : entry.contentRect.width;
|
|
83
|
+
const next = Math.floor(contentWidth);
|
|
84
|
+
setAvailableWidth(next > 0 ? next : void 0);
|
|
85
|
+
});
|
|
76
86
|
observer.observe(el);
|
|
77
87
|
return () => observer.disconnect();
|
|
78
88
|
}, []);
|
|
@@ -148,9 +148,16 @@ function buildDistributedColumnWidths(args) {
|
|
|
148
148
|
active = nextActive;
|
|
149
149
|
}
|
|
150
150
|
const floatTrackTotal = tracks.reduce((sum, track) => sum + track.width, 0);
|
|
151
|
-
const
|
|
151
|
+
const maxTrackWidth = availableWidth - selectionWidth;
|
|
152
|
+
const targetTrackWidth = Math.min(
|
|
153
|
+
floatTrackTotal <= maxTrackWidth ? Math.floor(floatTrackTotal) : Math.ceil(floatTrackTotal),
|
|
154
|
+
maxTrackWidth
|
|
155
|
+
);
|
|
152
156
|
const widths = toIntegerTrackWidths(tracks, targetTrackWidth);
|
|
153
|
-
const totalWidth =
|
|
157
|
+
const totalWidth = Math.min(
|
|
158
|
+
selectionWidth + Object.values(widths).reduce((sum, width) => sum + width, 0),
|
|
159
|
+
availableWidth
|
|
160
|
+
);
|
|
154
161
|
return {
|
|
155
162
|
selectionWidth: hasSelection ? table_utils.SELECTION_COLUMN_PX : void 0,
|
|
156
163
|
widths,
|
|
@@ -146,9 +146,16 @@ function buildDistributedColumnWidths(args) {
|
|
|
146
146
|
active = nextActive;
|
|
147
147
|
}
|
|
148
148
|
const floatTrackTotal = tracks.reduce((sum, track) => sum + track.width, 0);
|
|
149
|
-
const
|
|
149
|
+
const maxTrackWidth = availableWidth - selectionWidth;
|
|
150
|
+
const targetTrackWidth = Math.min(
|
|
151
|
+
floatTrackTotal <= maxTrackWidth ? Math.floor(floatTrackTotal) : Math.ceil(floatTrackTotal),
|
|
152
|
+
maxTrackWidth
|
|
153
|
+
);
|
|
150
154
|
const widths = toIntegerTrackWidths(tracks, targetTrackWidth);
|
|
151
|
-
const totalWidth =
|
|
155
|
+
const totalWidth = Math.min(
|
|
156
|
+
selectionWidth + Object.values(widths).reduce((sum, width) => sum + width, 0),
|
|
157
|
+
availableWidth
|
|
158
|
+
);
|
|
152
159
|
return {
|
|
153
160
|
selectionWidth: hasSelection ? SELECTION_COLUMN_PX : void 0,
|
|
154
161
|
widths,
|
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var FadeOverlay = require('./components/overlay/fade-overlay/FadeOverlay');
|
|
|
24
24
|
var InputContainer = require('./components/forms/input-container/InputContainer');
|
|
25
25
|
var Divider = require('./components/divider/Divider');
|
|
26
26
|
var Grid = require('./components/grid/Grid');
|
|
27
|
+
var MetricTile = require('./components/metric-tile/MetricTile');
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
|
|
@@ -171,3 +172,9 @@ Object.keys(Grid).forEach(function (k) {
|
|
|
171
172
|
get: function () { return Grid[k]; }
|
|
172
173
|
});
|
|
173
174
|
});
|
|
175
|
+
Object.keys(MetricTile).forEach(function (k) {
|
|
176
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function () { return MetricTile[k]; }
|
|
179
|
+
});
|
|
180
|
+
});
|
package/dist/index.css
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
@import './components/media-card/MediaCard.module.css';
|
|
39
39
|
@import './components/menu/Menu.module.css';
|
|
40
40
|
@import './components/meta-bar/MetaBar.module.css';
|
|
41
|
+
@import './components/metric-tile/MetricTile.module.css';
|
|
41
42
|
@import './components/nav-bar/NavBar.module.css';
|
|
42
43
|
@import './components/overlay/fade-overlay/FadeOverlay.module.css';
|
|
43
44
|
@import './components/overlay/modal/Modal.module.css';
|
package/dist/index.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export * from './components/overlay/fade-overlay/FadeOverlay';
|
|
|
22
22
|
export * from './components/forms/input-container/InputContainer';
|
|
23
23
|
export * from './components/divider/Divider';
|
|
24
24
|
export * from './components/grid/Grid';
|
|
25
|
+
export * from './components/metric-tile/MetricTile';
|
package/dist/index.js
CHANGED
|
@@ -22,3 +22,4 @@ export * from './components/overlay/fade-overlay/FadeOverlay';
|
|
|
22
22
|
export * from './components/forms/input-container/InputContainer';
|
|
23
23
|
export * from './components/divider/Divider';
|
|
24
24
|
export * from './components/grid/Grid';
|
|
25
|
+
export * from './components/metric-tile/MetricTile';
|