@wonderflow/react-components 5.4.0 → 6.0.0
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/autocomplete/autocomplete.js +2 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +2 -2
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +2 -2
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/dropdown/dropdown.d.ts +28 -0
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.js +13 -8
- package/dist/components/elevator/elevator.d.ts.map +1 -1
- package/dist/components/elevator/elevator.js +2 -2
- package/dist/components/icon/icon.d.ts +6 -4
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +1 -1
- package/dist/components/info-state/info-state.js +1 -1
- package/dist/components/input-group/input-group.d.ts.map +1 -1
- package/dist/components/input-group/input-group.js +4 -4
- package/dist/components/list/list.js +1 -1
- package/dist/components/masonry/masonry.d.ts.map +1 -1
- package/dist/components/masonry/masonry.js +2 -2
- package/dist/components/menu/menu-item/menu-item.js +1 -1
- package/dist/components/menu/menu-item/menu-item.module.css +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/modal/content/modal-content.js +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/selection-controls/checkbox.d.ts.map +1 -1
- package/dist/components/selection-controls/checkbox.js +8 -2
- package/dist/components/selection-controls/selection-controls.module.css +1 -1
- package/dist/components/skeleton/skeleton.d.ts +5 -1
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +4 -6
- package/dist/components/skeleton/skeleton.module.css +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/snackbar/snackbar.js +1 -1
- package/dist/components/stack/stack.d.ts +4 -4
- package/dist/components/stack/stack.d.ts.map +1 -1
- package/dist/components/stack/stack.js +6 -6
- package/dist/components/star-meter/star-meter.js +1 -1
- package/dist/components/tab/tab-item.js +1 -1
- package/dist/components/tab/tab.d.ts.map +1 -1
- package/dist/components/tab/tab.js +2 -3
- package/dist/components/table/index.d.ts +0 -1
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/table-cell/index.d.ts +2 -0
- package/dist/components/table/table-cell/index.d.ts.map +1 -0
- package/dist/components/table/table-cell/index.js +1 -0
- package/dist/components/table/table-cell/table-cell.d.ts +18 -0
- package/dist/components/table/table-cell/table-cell.d.ts.map +1 -0
- package/dist/components/table/table-cell/table-cell.js +29 -0
- package/dist/components/table/table-cell/table-cell.module.css +1 -0
- package/dist/components/table/table-checkbox/index.d.ts +2 -0
- package/dist/components/table/table-checkbox/index.d.ts.map +1 -0
- package/dist/components/table/table-checkbox/index.js +1 -0
- package/dist/components/table/table-checkbox/table-checkbox.d.ts +5 -0
- package/dist/components/table/table-checkbox/table-checkbox.d.ts.map +1 -0
- package/dist/components/table/table-checkbox/table-checkbox.js +4 -0
- package/dist/components/table/table-checkbox/table-checkbox.module.css +1 -0
- package/dist/components/table/table-controls/index.d.ts +2 -0
- package/dist/components/table/table-controls/index.d.ts.map +1 -0
- package/dist/components/table/table-controls/index.js +1 -0
- package/dist/components/table/table-controls/toggle-columns.d.ts +9 -0
- package/dist/components/table/table-controls/toggle-columns.d.ts.map +1 -0
- package/dist/components/table/table-controls/toggle-columns.js +23 -0
- package/dist/components/table/table-expand/index.d.ts +3 -0
- package/dist/components/table/table-expand/index.d.ts.map +1 -0
- package/dist/components/table/table-expand/index.js +1 -0
- package/dist/components/table/table-expand/table-expand.d.ts +7 -0
- package/dist/components/table/table-expand/table-expand.d.ts.map +1 -0
- package/dist/components/table/table-expand/table-expand.js +3 -0
- package/dist/components/table/table-expand/table-expand.module.css +1 -0
- package/dist/components/table/table-header/index.d.ts +3 -0
- package/dist/components/table/table-header/index.d.ts.map +1 -0
- package/dist/components/table/table-header/index.js +1 -0
- package/dist/components/table/table-header/table-header.d.ts +7 -0
- package/dist/components/table/table-header/table-header.d.ts.map +1 -0
- package/dist/components/table/table-header/table-header.js +4 -0
- package/dist/components/table/table-header/table-header.module.css +1 -0
- package/dist/components/table/table-pagination/index.d.ts +3 -0
- package/dist/components/table/table-pagination/index.d.ts.map +1 -0
- package/dist/components/table/table-pagination/index.js +1 -0
- package/dist/components/table/table-pagination/table-pagination.d.ts +13 -0
- package/dist/components/table/table-pagination/table-pagination.d.ts.map +1 -0
- package/dist/components/table/table-pagination/table-pagination.js +11 -0
- package/dist/components/table/table-row/index.d.ts +2 -0
- package/dist/components/table/table-row/index.d.ts.map +1 -0
- package/dist/components/table/table-row/index.js +1 -0
- package/dist/components/table/table-row/table-row.d.ts +5 -0
- package/dist/components/table/table-row/table-row.d.ts.map +1 -0
- package/dist/components/table/table-row/table-row.js +6 -0
- package/dist/components/table/table-row/table-row.module.css +1 -0
- package/dist/components/table/table.d.ts +127 -15
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +114 -15
- package/dist/components/table/table.module.css +1 -1
- package/dist/components/table/types.d.ts +21 -0
- package/dist/components/table/types.d.ts.map +1 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/textfield/textfield.d.ts.map +1 -1
- package/dist/components/textfield/textfield.js +2 -2
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +4 -3
- package/package.json +13 -12
- package/dist/components/table/theme.d.ts +0 -3
- package/dist/components/table/theme.d.ts.map +0 -1
- package/dist/components/table/theme.js +0 -78
|
@@ -3,7 +3,7 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
4
4
|
import styles from './stack.module.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
export const Stack = forwardRef(({ children, className, rowGap, columnGap, as: Wrapper = 'div', inline = false, direction = 'column', wrap = false, fill = true,
|
|
6
|
+
export const Stack = forwardRef(({ children, className, rowGap, columnGap, as: Wrapper = 'div', inline = false, direction = 'column', wrap = false, fill = true, vAlign = 'initial', hAlign = 'initial', hPadding, vPadding, style, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const alignmentTemplate = (prop) => {
|
|
8
8
|
if (prop.includes('start') || prop.includes('end')) {
|
|
9
9
|
return `flex-${prop}`;
|
|
@@ -13,10 +13,10 @@ export const Stack = forwardRef(({ children, className, rowGap, columnGap, as: W
|
|
|
13
13
|
const computedStyle = {
|
|
14
14
|
'--rGap': rowGap ? tkns.space[rowGap] : 0,
|
|
15
15
|
'--cGap': columnGap ? tkns.space[columnGap] : 0,
|
|
16
|
-
'--vAlign':
|
|
17
|
-
'--hAlign':
|
|
18
|
-
'--vPadding':
|
|
19
|
-
'--hPadding':
|
|
16
|
+
'--vAlign': vAlign && alignmentTemplate(vAlign),
|
|
17
|
+
'--hAlign': hAlign && alignmentTemplate(hAlign),
|
|
18
|
+
'--vPadding': vPadding ? tkns.space[vPadding] : 0,
|
|
19
|
+
'--hPadding': hPadding ? tkns.space[hPadding] : 0
|
|
20
20
|
};
|
|
21
|
-
return (_jsx(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, "data-stack-has-padding": Boolean(
|
|
21
|
+
return (_jsx(Wrapper, { ref: forwardedRef, style: { ...computedStyle, ...style }, "data-stack-inline": inline, "data-stack-wrap": wrap, "data-stack-direction": direction, "data-stack-fill": fill, "data-stack-has-padding": Boolean(hPadding || vPadding), className: clsx(styles.Stack, styles.StackWrapper, className), ...otherProps, children: children }, void 0));
|
|
22
22
|
});
|
|
@@ -49,5 +49,5 @@ export const StarMeter = forwardRef(({ className, value = 0, starCount = 5, labe
|
|
|
49
49
|
return _jsx(Icon, { source: "star", weight: "solid", className: styles.Icon, dimension: properties[dimension].iconSize, fill: fillType }, starIndex);
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
return (_jsxs(Stack, { inline: true, direction: "row",
|
|
52
|
+
return (_jsxs(Stack, { inline: true, direction: "row", vAlign: "center", columnGap: 8, className: clsx(styles.StarMeter, className), role: "meter", fill: false, "aria-valuenow": clamp(value, 0, starCount), "aria-valuemin": 0, "aria-valuemax": starCount, "aria-labelledby": seedID('star-meter'), "data-star-meter-dimension": dimension, ref: forwardedRef, ...otherProps, children: [_jsx("svg", { "aria-hidden": "true", className: styles.Gradient, width: "100", height: "50", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("defs", { children: _jsxs("linearGradient", { id: "HalfStar", children: [_jsx("stop", { offset: "0", style: { stopColor: 'var(--star-color)' } }, void 0), _jsx("stop", { offset: "50%", style: { stopColor: 'var(--star-color)' } }, void 0), _jsx("stop", { offset: "50.1%", style: { stopColor: 'var(--star-dimmed-color)' } }, void 0), _jsx("stop", { offset: "100%", style: { stopColor: 'var(--star-dimmed-color)' } }, void 0)] }, void 0) }, void 0) }, void 0), _jsx(Stack, { direction: "row", columnGap: dimension === 'small' ? 2 : 4, children: starType(starCount, value) }, void 0), _jsx(Text, { dimmed: 6, id: seedID('star-meter'), size: properties[dimension].labelSize, weight: "bold", children: !hideLabel && _jsx(_Fragment, { children: label || value.toString() }, void 0) }, void 0)] }, void 0));
|
|
53
53
|
});
|
|
@@ -18,6 +18,6 @@ export const TabItem = forwardRef(({ children, className, icon, ...otherProps },
|
|
|
18
18
|
onClick();
|
|
19
19
|
handleClick();
|
|
20
20
|
}, [handleClick, onClick]);
|
|
21
|
-
return (_jsxs(Stack, { as: "button", direction: "row",
|
|
21
|
+
return (_jsxs(Stack, { as: "button", direction: "row", vAlign: "center", hAlign: "start", fill: false, columnGap: 8, role: "tab", ref: internalRef, className: clsx(styles.TabItem, className), "aria-selected": isActive, onClick: fireClick, onKeyDown: handleKeyDown, onFocus: fireClick, type: "button", tabIndex: isActive ? 0 : -1, ...otherProps, children: [icon && _jsx(Icon, { source: icon, dimension: 16 }, void 0), children] }, void 0));
|
|
22
22
|
});
|
|
23
23
|
TabItem.displayName = 'Tab.Item';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/components/tab/tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/components/tab/tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAIV,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAW,YAAY,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EAAY,aAAa,EAAE,MAAM,aAAa,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAQ1C;;;GAGG;AACH,oBAAY,QAAQ,GAAG,cAAc,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAA;AAED,aAAK,YAAY,GAAG,KAAK,CAAC,yBAAyB,CAAC,QAAQ,CAAC,GAAG;IAC9D,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC;IACtD,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC;IAC5E,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC;CACrD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,GAAG,cAwDE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState, forwardRef, Children, cloneElement } from 'react';
|
|
2
|
+
import { useEffect, useState, forwardRef, Children, cloneElement, isValidElement } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useUIDSeed } from 'react-uid';
|
|
5
5
|
import { TabItem } from './tab-item';
|
|
@@ -12,7 +12,6 @@ import styles from './tab.module.css';
|
|
|
12
12
|
* Component
|
|
13
13
|
*/
|
|
14
14
|
export const Tab = forwardRef(({ children, className, state, onChange, ...otherProps }, forwardedRef) => {
|
|
15
|
-
const renderedChildren = Children.toArray(children).filter(Boolean);
|
|
16
15
|
const innerState = useState(0);
|
|
17
16
|
const tabState = state || innerState;
|
|
18
17
|
const [currentTab] = tabState;
|
|
@@ -22,7 +21,7 @@ export const Tab = forwardRef(({ children, className, state, onChange, ...otherP
|
|
|
22
21
|
onChange(currentTab);
|
|
23
22
|
}
|
|
24
23
|
}, [currentTab, onChange]);
|
|
25
|
-
return (_jsx("div", { ref: forwardedRef, className: clsx(styles.Tab, className), ...otherProps, children: _jsxs(TabsWrapper, { state: tabState, children: [_jsx(TabList, { children: Children.map(
|
|
24
|
+
return (_jsx("div", { ref: forwardedRef, className: clsx(styles.Tab, className), ...otherProps, children: _jsxs(TabsWrapper, { state: tabState, children: [_jsx(TabList, { children: Children.map(children, (child, index) => isValidElement(child) && (_jsx(TabItem, { id: seedID(`tab-item-${index}`), "aria-controls": seedID(`tab-panel-${index}`), icon: child.props.icon, children: child.props.label }, void 0))) }, void 0), Children.map(children, (child, index) => isValidElement(child) && cloneElement(child, {
|
|
26
25
|
id: seedID(`tab-panel-${index}`),
|
|
27
26
|
'aria-labelledby': seedID(`tab-item-${index}`)
|
|
28
27
|
}))] }, void 0) }, void 0));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { Table } from './table';
|
|
2
2
|
export type { TableProps } from './table';
|
|
3
|
-
export type { TableColumn, TableRow, TableStyles, Theme, Themes, ConditionalStyles, ExpanderComponentProps, PaginationComponentProps, PaginationOptions, PaginationServerOptions, ContextMessage, SortOrder } from 'react-data-table-component';
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-cell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableCell } from './table-cell';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Polymorphic } from '../../..';
|
|
2
|
+
import { OptionalColumnTypes } from '../types';
|
|
3
|
+
declare type TableCellProps = PropsWithClass & {
|
|
4
|
+
collapsed?: OptionalColumnTypes['isCollapsed'];
|
|
5
|
+
isSorted?: boolean;
|
|
6
|
+
isSortedDesc?: boolean;
|
|
7
|
+
align?: OptionalColumnTypes['align'];
|
|
8
|
+
padding?: boolean;
|
|
9
|
+
depth?: number;
|
|
10
|
+
isExpander?: boolean;
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
hasSubrows?: boolean;
|
|
13
|
+
width?: string | number;
|
|
14
|
+
};
|
|
15
|
+
declare type PolymorphicCell = Polymorphic.ForwardRefComponent<'td', TableCellProps>;
|
|
16
|
+
export declare const TableCell: PolymorphicCell;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=table-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-cell/table-cell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAQ,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAG9C,aAAK,cAAc,GAAG,cAAc,GAAG;IACrC,SAAS,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,CAAA;AAED,aAAK,eAAe,GAAG,WAAW,CAAC,mBAAmB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AAE7E,eAAO,MAAM,SAAS,iBAgED,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './table-cell.module.css';
|
|
3
|
+
import { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { Icon } from '../../..';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
7
|
+
export const TableCell = forwardRef(({ children, className, collapsed, isSorted, align = 'start', style, isSortedDesc, as: Wrapper = 'td', padding = true, isExpander, expanded, depth = 0, hasSubrows, width, ...otherProps }, forwardedRef) => {
|
|
8
|
+
const colors = [
|
|
9
|
+
'var(--highlight-gray-background)',
|
|
10
|
+
`hsl(${tkns.color.blue[30]})`,
|
|
11
|
+
`hsl(${tkns.color.green[30]})`,
|
|
12
|
+
`hsl(${tkns.color.red[30]})`,
|
|
13
|
+
`hsl(${tkns.color.yellow[20]})`,
|
|
14
|
+
`hsl(${tkns.color.purple[20]})`
|
|
15
|
+
];
|
|
16
|
+
const currentIndex = useMemo(() => (depth - 1) % colors.length, [colors.length, depth]);
|
|
17
|
+
const nextIndex = useMemo(() => depth % colors.length, [colors.length, depth]);
|
|
18
|
+
const dynamicStyle = {
|
|
19
|
+
'--width': typeof width === 'string' ? width : typeof width === 'number' ? `${width}px` : undefined,
|
|
20
|
+
'--text-align': align,
|
|
21
|
+
'--line-current-color': depth ? colors[currentIndex] : undefined,
|
|
22
|
+
'--line-next-color': depth ? colors[nextIndex] : colors[0]
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs(Wrapper, { ref: forwardedRef, className: clsx(styles.TableCell, className), "data-table-cell-collapsed": collapsed, "data-table-cell-padding": padding, "data-table-cell-is-expander": isExpander && (depth > 0 || hasSubrows), "data-table-cell-expanded": expanded, "data-table-cell-has-subrows": hasSubrows, "data-table-cell-fixed": Boolean(width), style: {
|
|
25
|
+
...dynamicStyle,
|
|
26
|
+
...style,
|
|
27
|
+
userSelect: Wrapper === 'td' ? undefined : 'none'
|
|
28
|
+
}, ...otherProps, children: [children, isSorted && (_jsx(Icon, { dimension: 12, className: styles.HeadCellIcon, fill: "var(--highlight-red-foreground)", source: isSortedDesc ? 'bars-sort-down' : 'bars-sort-up' }, void 0))] }, void 0));
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TableCell{--indent-guide-width:24px;font-feature-settings:"tnum";word-wrap:break-word;font-variant-numeric:tabular-nums;line-height:1.2;margin:0;max-width:var(--width);padding:0;position:relative;text-align:start}.TableCell:not(:only-child){text-align:var(--text-align,start)}.TableCell[data-table-cell-fixed=true]{width:var(--width,1%)}.TableCell[data-table-cell-collapsed=true]{width:1e-10%}.TableCell[data-table-cell-padding=true]{padding:.66rem .44rem}.TableCell[data-table-cell-is-expander=true] button{box-shadow:inset 0 0 0 2px var(--line-current-color);z-index:1}.TableCell[data-table-cell-is-expander=true] button:hover{box-shadow:inset 0 0 0 3px var(--line-current-color)}.TableCell[data-table-cell-is-expander=true]:after,.TableCell[data-table-cell-is-expander=true]:before{background:var(--line-current-color);content:"";height:calc(50% + 1px);left:50%;position:absolute;transform:translateX(-50%);width:var(--indent-guide-width)}.TableCell[data-table-cell-is-expander=true]:before{top:-1px}.TableCell[data-table-cell-is-expander=true]:after{bottom:-1px;z-index:0}.TableCell[data-table-cell-is-expander=true][data-table-cell-expanded=true][data-table-cell-has-subrows=true]:after{background:var(--line-next-color)}.HeadCellIcon{margin-inline-start:.44rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableCheckbox } from './table-checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-checkbox/table-checkbox.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,aAAa;;iBAMzB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from '../../..';
|
|
3
|
+
import styles from './table-checkbox.module.css';
|
|
4
|
+
export const TableCheckbox = ({ ...otherProps }) => (_jsx(Checkbox, { className: styles.TableCheckbox, dimension: "small", ...otherProps }, void 0));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TableCheckbox{display:block}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-controls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ToggleColumnsControl } from './toggle-columns';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomColumnInstanceType } from '../types';
|
|
3
|
+
declare type ToggleColumnsControlProps = {
|
|
4
|
+
columns: CustomColumnInstanceType[];
|
|
5
|
+
visibleColumns: CustomColumnInstanceType[];
|
|
6
|
+
};
|
|
7
|
+
export declare const ToggleColumnsControl: ({ columns, visibleColumns }: ToggleColumnsControlProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=toggle-columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-columns.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-controls/toggle-columns.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEnD,aAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,cAAc,EAAE,wBAAwB,EAAE,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,oBAAoB,gCAG9B,yBAAyB,gBAkD3B,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dropdown, Menu, Button } from '../../..';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
export const ToggleColumnsControl = ({ columns, visibleColumns }) => {
|
|
5
|
+
const someVisibleColums = useMemo(() => visibleColumns.length !== 0, [visibleColumns]);
|
|
6
|
+
const filteredColumns = useMemo(() => columns.filter(col => !col.hideFromList), [columns]);
|
|
7
|
+
const handleToggleAll = useCallback(() => {
|
|
8
|
+
/**
|
|
9
|
+
* If there are visible columns (excluding artificial ones),
|
|
10
|
+
* hide them all by calling `toggleHidden(true)` for each column
|
|
11
|
+
*/
|
|
12
|
+
if (someVisibleColums) {
|
|
13
|
+
visibleColumns.forEach((col) => col.toggleHidden(true));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* If there are no visible columns (excluding artificial ones), call
|
|
18
|
+
* toggleHidden(false) for each column
|
|
19
|
+
*/
|
|
20
|
+
filteredColumns.forEach((col) => col.toggleHidden(false));
|
|
21
|
+
}, [someVisibleColums, filteredColumns, visibleColumns]);
|
|
22
|
+
return (_jsx(Dropdown, { placement: "bottom-start", trigger: _jsx(Button, { kind: "secondary", children: "Toggle columns" }, void 0), children: _jsxs(Menu, { children: [_jsx(Menu.ItemCheckbox, { onClick: () => handleToggleAll(), checked: true, icon: visibleColumns.length === 0 ? 'check' : 'minus', children: "Toggle All" }, void 0), columns.filter(col => !col.hideFromList).map((column, i) => (_jsx(Menu.ItemCheckbox, { autoFocus: i === 0, checked: column.isVisible, icon: column.isVisible ? 'check' : undefined, onClick: () => column.toggleHidden(), children: column.render('Header') }, column.id)))] }, void 0) }, void 0));
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-expand/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableExpand } from './table-expand';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export declare type TableExpandProps<T> = {
|
|
3
|
+
data: T;
|
|
4
|
+
component: ComponentType<T>;
|
|
5
|
+
};
|
|
6
|
+
export declare const TableExpand: <T>({ data, component: Component }: TableExpandProps<T>) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=table-expand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-expand.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-expand/table-expand.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,oBAAY,gBAAgB,CAAC,CAAC,IAAI;IAChC,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,WAAW,yEASrB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './table-expand.module.css';
|
|
3
|
+
export const TableExpand = ({ data, component: Component }) => (_jsx("div", { className: styles.TableExpand, children: _jsx("div", { className: styles.ExpandContent, children: Component ? _jsx(Component, { ...data }, void 0) : null }, void 0) }, void 0));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TableExpand{overflow:hidden}.ExpandContent{--fade-from-y:-5px;animation:fade-in .2s;animation-timing-function:cubic-bezier(0,0,.34,1)}@keyframes fade-in{0%{opacity:0;transform:translate(var(--fade-from-x,0),var(--fade-from-y,0))}to{opacity:unset;transform:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableHeader } from './table-header';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Title, Polymorphic } from '../../..';
|
|
2
|
+
import { FC, HTMLAttributes } from 'react';
|
|
3
|
+
export declare type TableHeaderProps = HTMLAttributes<HTMLElement> & {
|
|
4
|
+
title?: string | Polymorphic.IntrinsicElement<typeof Title>;
|
|
5
|
+
};
|
|
6
|
+
export declare const TableHeader: FC<TableHeaderProps>;
|
|
7
|
+
//# sourceMappingURL=table-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-header.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-header/table-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAS,WAAW,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG1C,oBAAY,gBAAgB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,gBAAgB,CAAC,OAAO,KAAK,CAAC,CAAA;CAC5D,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuB5C,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Title, Stack } from '../../..';
|
|
3
|
+
import styles from './table-header.module.css';
|
|
4
|
+
export const TableHeader = ({ children, title, id, ...otherProps }) => (_jsxs(Stack, { direction: "row", columnGap: 32, vAlign: "center", hAlign: "space-between", fill: false, className: styles.TableHeader, ...otherProps, children: [_jsx("div", { children: typeof title === 'string' ? _jsx(Title, { id: id, level: "5", children: title }, void 0) : title }, void 0), _jsx(Stack, { direction: "row", vAlign: "center", columnGap: 8, inline: true, children: children }, void 0)] }, void 0));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TableHeader{min-block-size:3.11rem;position:relative;z-index:3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TablePagination } from './table-pagination';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare type TablePaginationProps = PropsWithClass & {
|
|
3
|
+
clusters?: Array<number>;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
totalItems: number;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
currentPage: number;
|
|
8
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
9
|
+
onPageClick?: (page: number) => void;
|
|
10
|
+
isManual?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const TablePagination: FC<TablePaginationProps>;
|
|
13
|
+
//# sourceMappingURL=table-pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-pagination/table-pagination.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAA;AAGnC,oBAAY,oBAAoB,GAAG,cAAc,GAAG;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAqDpD,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select, Stack, Text, Pagination } from '../../..';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useUIDSeed } from 'react-uid';
|
|
5
|
+
export const TablePagination = ({ children, pageSize, onPageSizeChange, clusters = [5, 10, 20, 30, 50, 100], totalItems, currentPage, isManual, totalPages, onPageClick, ...otherProps }) => {
|
|
6
|
+
const uid = useUIDSeed();
|
|
7
|
+
const computedPageCount = useMemo(() => isManual ? Math.ceil(totalItems / pageSize) : totalPages, [isManual, pageSize, totalItems, totalPages]);
|
|
8
|
+
const computedItemsInPageStart = useMemo(() => (currentPage && pageSize) && currentPage * pageSize, [currentPage, pageSize]);
|
|
9
|
+
const computedItemsInPageEnd = useMemo(() => currentPage * pageSize + pageSize, [currentPage, pageSize]);
|
|
10
|
+
return (_jsxs(Stack, { fill: false, direction: "row", columnGap: 16, vAlign: "center", hAlign: "end", vPadding: 16, ...otherProps, children: [_jsxs(Stack, { direction: "row", columnGap: 4, children: [_jsx(Text, { as: "label", htmlFor: uid('table-i-per-page'), size: 14, children: "Items per page:" }, void 0), _jsx(Select, { value: pageSize, dimension: "small", id: uid('table-i-per-page'), onChange: ({ currentTarget }) => { onPageSizeChange && onPageSizeChange(Number(currentTarget.value)); }, children: clusters.map(cluster => (_jsx("option", { value: cluster, children: cluster }, cluster))) }, void 0)] }, void 0), _jsx(Text, { "aria-hidden": "true", weight: "bold", size: 14, children: `${computedItemsInPageStart + 1}-${computedItemsInPageEnd > totalItems ? totalItems : computedItemsInPageEnd} of ${totalItems}` }, void 0), _jsx(Pagination, { itemsCount: totalItems, itemsPerPage: pageSize, pageCount: computedPageCount, onPageClick: ({ selected }) => onPageClick && onPageClick(selected), renderOnZeroPageCount: () => null, forcePage: currentPage }, void 0)] }, void 0));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableRow } from './table-row';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../../../src/components/table/table-row/table-row.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1B,aAAK,aAAa,GAAG,cAAc,CAAA;AAEnC,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAatC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './table-row.module.css';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
export const TableRow = ({ children, className, ...otherProps }) => {
|
|
5
|
+
return (_jsx("tr", { className: clsx(styles.TableRow, className), ...otherProps, children: children }, void 0));
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TableRow:not([data-table-row-expander=true]){block-size:calc(2.67rem + 1px)}.TableRow+.TableRow{border-top:1px solid transparent}[data-table-stripes=true] .TableRow:nth-child(2n):not([data-table-row-highlight=true],[data-table-row-expander]){background-color:var(--dimmed-0)}[data-table-separators=true] .TableRow+.TableRow{border-color:var(--dimmed-1)}
|
|
@@ -1,26 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Row, IdType, SortingRule } from 'react-table';
|
|
2
|
+
import { TableHeaderProps } from './table-header';
|
|
3
|
+
import { TablePaginationProps } from './table-pagination';
|
|
4
|
+
import { ReactNode, ComponentType } from 'react';
|
|
5
|
+
import { CustomColumnsType, OptionalDataTypes, PaginationType } from './types';
|
|
6
|
+
export declare type TableProps<T extends object> = PropsWithClass & {
|
|
7
|
+
/**
|
|
8
|
+
* Define the columns and headers of the table.
|
|
9
|
+
*/
|
|
10
|
+
columns: CustomColumnsType<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Pass the data structure to the table. Each object key can be used as `accessor` for a column.
|
|
13
|
+
*/
|
|
14
|
+
data: Array<T & OptionalDataTypes<T>>;
|
|
15
|
+
/**
|
|
16
|
+
* Define the default visibility of the columns. This is an array of columns `id`,
|
|
17
|
+
*/
|
|
18
|
+
defaultHiddenColumns?: Array<IdType<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* Show pagination below the table. This is recommended only for tables with a lot of rows.
|
|
21
|
+
*/
|
|
22
|
+
showPagination?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The amount of entries to show for each page.
|
|
25
|
+
*/
|
|
26
|
+
itemsPerPage?: number;
|
|
27
|
+
/**
|
|
28
|
+
* The index of the page that should be set as active when the table is rendered.
|
|
29
|
+
*/
|
|
30
|
+
activePageIndex?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The callback that is called when the active page index and page size change.
|
|
33
|
+
* Passing this property along side `showPagination` will enable manual pagination,
|
|
34
|
+
* disabling the automatic one.
|
|
35
|
+
*/
|
|
36
|
+
onDataUpdate?: ({ pageIndex, pageSize }: PaginationType) => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Set the number of pages to show in the pagination. Used only when doing manual pagination.
|
|
39
|
+
*/
|
|
40
|
+
totalRows?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Set clusters of items to show in a single page. These values are used to
|
|
43
|
+
* compute the select options for the page size dropdown.
|
|
44
|
+
*/
|
|
45
|
+
pageClusters?: TablePaginationProps['clusters'];
|
|
46
|
+
/**
|
|
47
|
+
* Enable row selection. This property will render an additiona column
|
|
48
|
+
* at the start of the table, containing a checkbox.
|
|
49
|
+
*/
|
|
50
|
+
selectableRows?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Callback run when the selected rows change
|
|
53
|
+
*/
|
|
54
|
+
onSelectionChange?(selectedRows?: Row[], selectedRowIds?: Record<IdType<T>, boolean>): void;
|
|
55
|
+
/**
|
|
56
|
+
* If true, disable the automatic column sorting of the table. Turn this on if you want to
|
|
57
|
+
* to control the sorting yourself.
|
|
58
|
+
*/
|
|
59
|
+
isManualSorted?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Callback run when a column is sorted
|
|
62
|
+
*/
|
|
63
|
+
onSortChange?(sorting?: SortingRule<T>[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add an alternate style to the table rows
|
|
66
|
+
*/
|
|
67
|
+
stripes?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Set the loading state of the table. This will sho skeleton loaders instead of the actual data.
|
|
70
|
+
*/
|
|
71
|
+
loading?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Enable horizontal separators between the table rows
|
|
74
|
+
*/
|
|
75
|
+
showSeparators?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Add an accessible title to the table component
|
|
78
|
+
*/
|
|
79
|
+
title?: TableHeaderProps['title'];
|
|
80
|
+
/**
|
|
81
|
+
* Hide the header which includes the title and controls.
|
|
82
|
+
* This option is ignored and set to `true` if `selectableRows` is set to `true`.
|
|
83
|
+
*/
|
|
84
|
+
showHeader?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Hide the table header which includes columns names.
|
|
87
|
+
*/
|
|
88
|
+
showTableHead?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Enable the dropdown to choose the visibility of the column
|
|
91
|
+
*/
|
|
92
|
+
columnsControl?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Pass custom actions to the table header
|
|
95
|
+
*/
|
|
96
|
+
actions?: ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* Set the label for selected items in the table. Default to "Selected items"
|
|
99
|
+
*/
|
|
100
|
+
selectedLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Pass custom components to show when rows are selected.
|
|
103
|
+
*/
|
|
104
|
+
selectedActions?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Set the table height after which the table will scroll.
|
|
107
|
+
*/
|
|
108
|
+
height?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Set the table background color. This must be set if `height` is set because
|
|
111
|
+
* the color is used as background for sticky headers.
|
|
112
|
+
*/
|
|
113
|
+
background?: string;
|
|
5
114
|
/**
|
|
6
115
|
* A react component that add additional content when the row is expanded.
|
|
7
|
-
* By passing this prop, the row will be expandable.
|
|
116
|
+
* By passing this prop, the row will be expandable. If fuction is passed,
|
|
117
|
+
* the function will be called with the `subRow` data and the function must return
|
|
118
|
+
* a component.
|
|
8
119
|
*/
|
|
9
|
-
|
|
10
|
-
data?: T;
|
|
11
|
-
}>;
|
|
120
|
+
expandableRowComponent?: ComponentType<T>;
|
|
12
121
|
/**
|
|
13
|
-
*
|
|
122
|
+
* A react component that add custom actions to rows. If fuction is passed,
|
|
123
|
+
* the function will be called with the row data and the function must return
|
|
124
|
+
* a component.
|
|
14
125
|
*/
|
|
15
|
-
|
|
126
|
+
actionsRowComponent?: ComponentType<Row<T>>;
|
|
16
127
|
/**
|
|
17
|
-
*
|
|
128
|
+
* Custom component/empty state to show when the table has no data or
|
|
129
|
+
* all columns have been toggled off.
|
|
18
130
|
*/
|
|
19
|
-
|
|
131
|
+
emptyComponent?: ReactNode;
|
|
20
132
|
/**
|
|
21
|
-
* Set
|
|
133
|
+
* Set the initial sorted column and order by passing column id and order.
|
|
22
134
|
*/
|
|
23
|
-
|
|
135
|
+
initialSortBy?: Array<SortingRule<T>>;
|
|
24
136
|
};
|
|
25
|
-
export declare const Table: <T>({ className,
|
|
137
|
+
export declare const Table: <T extends object>({ className, style, columns, data, selectableRows, onSelectionChange, stripes, showSeparators, title, actions, selectedActions, selectedLabel, showHeader, showTableHead, columnsControl, defaultHiddenColumns, height, loading, background, expandableRowComponent, actionsRowComponent: ActionsRowComponent, emptyComponent, showPagination, isManualSorted, onDataUpdate, onSortChange, itemsPerPage, totalRows, activePageIndex, pageClusters, initialSortBy, ...otherProps }: TableProps<T>) => JSX.Element;
|
|
26
138
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,GAAG,EAAsB,MAAM,EAAE,WAAW,EAC7C,MAAM,aAAa,CAAA;AAIpB,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAG9D,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAK1E,OAAO,EAA2B,SAAS,EAAsB,aAAa,EAAE,MAAM,OAAO,CAAA;AAE7F,OAAO,EAAsC,iBAAiB,EAAmB,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnI,oBAAY,UAAU,CAAC,CAAC,SAAS,MAAM,IAAI,cAAc,GAAG;IAC1D;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC9B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC;;OAEG;IACH,oBAAoB,CAAC,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACzE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAA;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,iBAAiB,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC3F;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAA;IAC/C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;MAEE;IACF,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC1C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,KAAK,qgBAwUjB,CAAA"}
|