@ringcentral/spring-ui 1.12.0 → 1.13.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/Accordion.js +90 -34
- package/AccordionHeader.js +71 -21
- package/Alert.js +120 -28
- package/Animation.js +2 -46
- package/Announcement.js +46 -35
- package/Autocomplete.js +1011 -583
- package/Avatar.js +134 -73
- package/AvatarGroup.js +50 -7
- package/Backdrop.js +45 -7
- package/Badge.js +77 -15
- package/Block.js +34 -12
- package/BlockHeader.js +57 -15
- package/BottomNavigation.js +181 -65
- package/BottomNavigationItem.js +93 -30
- package/Button.js +160 -24
- package/CallButton.js +53 -31
- package/Checkbox.js +88 -26
- package/Chip.js +126 -26
- package/CircularProgressIndicator.js +80 -8
- package/ClickAwayListener.js +4 -1
- package/ComponentsProps.js +1 -0
- package/DatePicker.js +611 -192
- package/DateUtilsContext.js +43 -25
- package/Dialer.js +564 -253
- package/Dialog.js +99 -45
- package/Divider.js +43 -7
- package/DragHandle.js +32 -6
- package/Drawer.js +117 -19
- package/Dropdown.js +154 -77
- package/EmptyState.js +65 -15
- package/FabButton.js +51 -17
- package/FocusTrap.js +109 -12
- package/FormField.js +108 -12
- package/FormLabel.js +81 -7
- package/Icon.js +1 -8
- package/IconButton.js +142 -26
- package/IconButtonGroup.js +35 -12
- package/InlineEditable.js +98 -44
- package/LinearProgressIndicator.js +73 -24
- package/Link.js +40 -11
- package/List.js +54 -9
- package/ListItem.js +152 -23
- package/ListItemText.js +44 -17
- package/ListNavigation.js +272 -20
- package/Menu.js +139 -23
- package/MenuActions.js +37 -12
- package/MenuDivider.js +34 -8
- package/MenuFooter.js +36 -12
- package/MenuHeader.js +54 -16
- package/MenuItem.js +402 -35
- package/MenuItemText.js +51 -9
- package/MenuList.js +87 -36
- package/Modal.js +345 -16
- package/NestedMenuContext.js +183 -11
- package/Option.js +32 -36
- package/Overlap.js +54 -7
- package/PageHeader.js +62 -24
- package/PickerTextField.js +156 -35
- package/Popover.js +262 -21
- package/Popper.js +112 -62
- package/PopperPaper.js +54 -8
- package/Portal.js +6 -1
- package/Radio.js +65 -21
- package/RadioGroup.js +56 -17
- package/Rating.js +223 -87
- package/Select.js +387 -44
- package/SingleFilter.js +148 -79
- package/Skeleton.js +68 -17
- package/Slider.js +167 -69
- package/Snackbar.js +122 -59
- package/SortableList.js +32 -12
- package/SortableListDndContext.js +69 -22
- package/SortableListItem.js +92 -47
- package/SortableVirtualizedList.js +44 -20
- package/SplitButton.js +124 -89
- package/Squircle.js +4 -7
- package/StatusIndicator.js +51 -9
- package/Step.js +63 -38
- package/StepButton.js +51 -23
- package/StepConnector.js +48 -8
- package/StepContent.js +67 -24
- package/StepIcon.js +90 -9
- package/StepLabel.js +90 -14
- package/Stepper.js +65 -23
- package/SubMenu.js +203 -101
- package/SwipeableDrawer.js +439 -194
- package/Switch.js +70 -23
- package/Tab.js +120 -57
- package/TabContext.js +59 -15
- package/TabPanel.js +40 -13
- package/Table.js +60 -17
- package/TableBody.js +42 -12
- package/TableCell.js +84 -50
- package/TableContainer.js +32 -10
- package/TableFooter.js +38 -10
- package/TableHead.js +49 -15
- package/TablePagination.js +153 -79
- package/TableRow.js +60 -21
- package/Tabs.js +592 -271
- package/Tag.js +51 -16
- package/Text.js +68 -37
- package/TextField.js +209 -31
- package/Textarea.js +51 -42
- package/TimePicker.js +490 -232
- package/Tooltip.js +48 -23
- package/Tray.js +237 -13
- package/TrayMenu.js +62 -43
- package/VirtualizedList.js +205 -107
- package/VirtualizedMenu.js +359 -29
- package/VisuallyHidden.js +29 -6
- package/chunks/1250.js +98 -0
- package/chunks/1294.js +126 -0
- package/chunks/2956.js +18 -0
- package/chunks/4476.js +460 -0
- package/chunks/4491.js +10 -0
- package/chunks/4535.js +364 -0
- package/chunks/5047.js +3 -0
- package/chunks/6335.js +24 -0
- package/chunks/7279.js +10 -0
- package/chunks/8011.js +8 -0
- package/chunks/8307.js +56 -0
- package/chunks/8467.js +8 -0
- package/chunks/8809.js +8 -0
- package/chunks/{RadioGroup.context.js → 9551.js} +12 -6
- package/chunks/987.js +8 -0
- package/index.css +2436 -2261
- package/index.js +245 -195
- package/internal/utils/setRef.d.ts +2 -1
- package/package.json +4 -4
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
- package/src/Button/Button.classes.d.ts +1 -1
- package/src/ComponentsProps.d.ts +111 -110
- package/src/DatePicker/DatePickerDataAttributes.d.ts +11 -0
- package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
- package/src/MenuItem/MenuItem.type.d.ts +1 -0
- package/src/MenuList/MenuListContext.d.ts +2 -3
- package/src/Modal/Modal.type.d.ts +1 -0
- package/src/Popover/Popover.classes.d.ts +1 -1
- package/src/Popover/Popover.internal.d.ts +8 -0
- package/src/Popover/Popover.type.d.ts +1 -0
- package/src/Select/Select.type.d.ts +6 -4
- package/src/Table/Table.type.d.ts +3 -0
- package/src/Table/TableContext.d.ts +3 -0
- package/src/Table/TableRowContext.d.ts +7 -0
- package/src/Table/index.d.ts +1 -0
- package/src/TableCell/TableCell.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.type.d.ts +1 -0
- package/src/TableHead/TableHead.classes.d.ts +1 -1
- package/src/TableHead/TableHead.type.d.ts +1 -0
- package/src/TableRow/TableRow.type.d.ts +2 -0
- package/chunks/AccordionContext.js +0 -6
- package/chunks/Alert.js +0 -48
- package/chunks/AvatarGroup.js +0 -22
- package/chunks/Backdrop.js +0 -18
- package/chunks/Badge.js +0 -32
- package/chunks/BottomNavigationItem.js +0 -36
- package/chunks/Button.js +0 -88
- package/chunks/Chip.js +0 -73
- package/chunks/CircularProgressIndicator.js +0 -36
- package/chunks/Divider.js +0 -19
- package/chunks/DragHandle.js +0 -11
- package/chunks/Drawer.js +0 -33
- package/chunks/ExpandCollapseCaret.js +0 -24
- package/chunks/FormLabel.js +0 -27
- package/chunks/Icon.js +0 -25
- package/chunks/IconButtonLabel.js +0 -68
- package/chunks/List.js +0 -22
- package/chunks/ListItem.js +0 -83
- package/chunks/Menu.js +0 -61
- package/chunks/MenuDivider.js +0 -14
- package/chunks/MenuItemText.js +0 -18
- package/chunks/MenuList.js +0 -47
- package/chunks/Modal.js +0 -211
- package/chunks/Overlap.js +0 -25
- package/chunks/PickerTextField.js +0 -85
- package/chunks/Popover.js +0 -61
- package/chunks/PopperPaper.js +0 -15
- package/chunks/Select.js +0 -225
- package/chunks/ShowHideEye.js +0 -56
- package/chunks/SlideIn.js +0 -20
- package/chunks/SortableArrow.js +0 -73
- package/chunks/Squircle.js +0 -31
- package/chunks/StatusIndicator.js +0 -20
- package/chunks/StepConnector.js +0 -21
- package/chunks/StepIcon.js +0 -43
- package/chunks/StepLabel.js +0 -29
- package/chunks/StepperContext.js +0 -9
- package/chunks/TableContext.js +0 -6
- package/chunks/Tablelvl2Context.js +0 -6
- package/chunks/TabsContext.js +0 -6
- package/chunks/TextField.js +0 -110
- package/chunks/Tooltip.js +0 -217
- package/chunks/VirtualizedMenu.js +0 -162
- package/chunks/VisuallyHidden.js +0 -12
- package/chunks/composeEventHandlers.js +0 -10
- package/chunks/getFade.js +0 -27
- package/chunks/getGrow.js +0 -70
- package/chunks/getSlideIn.js +0 -30
- package/chunks/hasContent.js +0 -3
- package/chunks/useAnimationFrame.js +0 -15
- package/chunks/useFocusTrapStack.js +0 -38
- package/chunks/useHelperTextId.js +0 -24
- package/chunks/useListNavigation.js +0 -199
- package/chunks/useMenuItemSelect.js +0 -282
- package/chunks/useMotionSafeTransition.js +0 -9
- package/chunks/useNestedMenuItem.js +0 -27
- package/chunks/useNestedParentMenu.js +0 -113
- package/chunks/usePrefersReducedMotion.js +0 -36
- package/chunks/useTooltipForceHide.js +0 -27
- package/chunks/useTrayNavigate.js +0 -150
- package/chunks/withTooltip.js +0 -15
package/TableCell.js
CHANGED
|
@@ -1,80 +1,114 @@
|
|
|
1
|
-
import { jsx, jsxs } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useClasses,
|
|
4
|
-
import { useThemeProps } from
|
|
5
|
-
import clsx from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses, useFocusVisible, useHover } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { SortableArrow } from "./chunks/4476.js";
|
|
7
|
+
import { useTableContext } from "./chunks/7279.js";
|
|
8
|
+
import { useTableRowContext } from "./chunks/987.js";
|
|
9
|
+
import { useTablelvl2Context } from "./chunks/8011.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// extracted by css-extract-rspack-plugin
|
|
17
|
+
/* export default */ var TableCell = ({"sui-table-cell-root":"sui-table-cell-root","sui-table-cell-padding-checkbox":"sui-table-cell-padding-checkbox","sui-table-cell-content":"sui-table-cell-content","sui-table-cell-head":"sui-table-cell-head","sui-table-cell-small":"sui-table-cell-small","sui-table-cell-large":"sui-table-cell-large","sui-table-cell-sortable":"sui-table-cell-sortable","sui-table-cell-content-sortable":"sui-table-cell-content-sortable","sui-table-cell-sort-icon":"sui-table-cell-sort-icon","sui-focus-visible":"sui-focus-visible","sui-table-cell-padding-none":"sui-table-cell-padding-none","sui-table-cell-align-left":"sui-table-cell-align-left","sui-table-cell-align-center":"sui-table-cell-align-center","sui-table-cell-align-right":"sui-table-cell-align-right","sui-table-cell-align-justify":"sui-table-cell-align-justify","sui-table-cell-sticky-header-default-bg":"sui-table-cell-sticky-header-default-bg","sui-table-cell-content-padding-checkbox":"sui-table-cell-content-padding-checkbox","sui-table-cell-content-align-center":"sui-table-cell-content-align-center","sui-table-cell-content-align-right":"sui-table-cell-content-align-right","sui-table-cell-content-align-justify":"sui-table-cell-content-align-justify","sui-table-cell-sorted":"sui-table-cell-sorted","sui-table-cell-sort-indicator":"sui-table-cell-sort-indicator","sui-table-cell-sort-icon-sorted":"sui-table-cell-sort-icon-sorted","sui-table-cell-column-divider":"sui-table-cell-column-divider","sui-table-cell-hide-row-divider":"sui-table-cell-hide-row-divider"});
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The component renders a `<th>` element when the parent context is a header
|
|
30
|
+
* or otherwise a `<td>` element.
|
|
31
|
+
*/ const TableCell_TableCell = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
32
|
+
const props = useThemeProps({
|
|
33
|
+
props: inProps,
|
|
34
|
+
name: 'TableCell'
|
|
35
|
+
});
|
|
18
36
|
const { component: componentProp, variant: variantProp, padding = 'normal', align = 'inherit', scope: scopeProp, sortDirection, showSortIndicator = false, initialSortIconDirection = 'asc', classes, className, children, SortIconProps, ...rest } = props;
|
|
19
37
|
const cls = useClasses('table-cell', classes, className);
|
|
20
38
|
const sortable = sortDirection !== undefined;
|
|
21
39
|
const sorted = !!sortDirection;
|
|
22
40
|
const table = useTableContext();
|
|
41
|
+
const tableRow = useTableRowContext();
|
|
23
42
|
const tablelvl2 = useTablelvl2Context();
|
|
43
|
+
const size = tableRow.size ?? table.size;
|
|
24
44
|
const { hover, hoverHandlers } = useHover();
|
|
25
45
|
const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
|
|
26
46
|
let TableCellRoot = 'td';
|
|
27
47
|
if (componentProp) {
|
|
28
48
|
TableCellRoot = componentProp;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
49
|
+
} else {
|
|
31
50
|
TableCellRoot = isHeadCell ? 'th' : 'td';
|
|
32
51
|
}
|
|
33
52
|
const { focusVisible, focusVisibleRef, focusVisibleHandlers } = useFocusVisible();
|
|
34
53
|
let scope = scopeProp;
|
|
54
|
+
// scope is not a valid attribute for <td/> elements.
|
|
55
|
+
// source: https://html.spec.whatwg.org/multipage/tables.html#the-td-element
|
|
35
56
|
if (TableCellRoot === 'td') {
|
|
36
57
|
scope = undefined;
|
|
37
|
-
}
|
|
38
|
-
else if (!scope && isHeadCell) {
|
|
58
|
+
} else if (!scope && isHeadCell) {
|
|
39
59
|
scope = 'col';
|
|
40
60
|
}
|
|
41
|
-
const variant = variantProp ||
|
|
61
|
+
const variant = variantProp || tablelvl2 && tablelvl2.variant;
|
|
62
|
+
const isBodyVariant = variant !== 'head';
|
|
42
63
|
let ariaSort = undefined;
|
|
43
64
|
let sortIcon = null;
|
|
44
|
-
const sortIconDirection = sorted
|
|
45
|
-
|
|
46
|
-
: (showSortIndicator && (hover || focusVisible)) || !showSortIndicator
|
|
47
|
-
? initialSortIconDirection
|
|
48
|
-
: false;
|
|
49
|
-
if (sorted)
|
|
50
|
-
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
65
|
+
const sortIconDirection = sorted ? sortDirection : showSortIndicator && (hover || focusVisible) || !showSortIndicator ? initialSortIconDirection : false;
|
|
66
|
+
if (sorted) ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
51
67
|
if (sortable) {
|
|
52
|
-
sortIcon =
|
|
68
|
+
sortIcon = /*#__PURE__*/ jsx(SortableArrow, {
|
|
69
|
+
direction: sortIconDirection,
|
|
70
|
+
size: "small",
|
|
71
|
+
...SortIconProps,
|
|
72
|
+
className: clsx(cls('sort-icon', sorted && 'sort-icon-sorted', showSortIndicator && 'sort-indicator'), SortIconProps?.className)
|
|
73
|
+
});
|
|
53
74
|
}
|
|
54
75
|
const ContentElement = sortable ? 'button' : 'div';
|
|
55
|
-
const sortableProps = sortable
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
: {}
|
|
63
|
-
return (jsx(TableCellRoot, { className: cls('root', variant, align !== 'inherit' && `align-${align}`, padding !== 'normal' && `padding-${padding}`, {
|
|
76
|
+
const sortableProps = sortable ? {
|
|
77
|
+
ref: focusVisibleRef,
|
|
78
|
+
type: 'button',
|
|
79
|
+
...focusVisibleHandlers,
|
|
80
|
+
...hoverHandlers
|
|
81
|
+
} : {};
|
|
82
|
+
return /*#__PURE__*/ jsx(TableCellRoot, {
|
|
83
|
+
className: cls('root', variant, align !== 'inherit' && `align-${align}`, padding !== 'normal' && `padding-${padding}`, isBodyVariant && size !== 'medium' && size, {
|
|
64
84
|
sortable,
|
|
65
85
|
sorted,
|
|
66
|
-
'sticky-header-default-bg': variant === 'head' &&
|
|
67
|
-
table &&
|
|
68
|
-
table.stickyHeader &&
|
|
69
|
-
tablelvl2?.useDefaultBgColor,
|
|
86
|
+
'sticky-header-default-bg': variant === 'head' && table && table.stickyHeader && tablelvl2?.useDefaultBgColor,
|
|
70
87
|
'column-divider': table.columnDivider,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
'hide-row-divider': isBodyVariant && !table.rowDivider
|
|
89
|
+
}),
|
|
90
|
+
"aria-sort": ariaSort,
|
|
91
|
+
scope: scope,
|
|
92
|
+
...rest,
|
|
93
|
+
ref: ref,
|
|
94
|
+
children: /*#__PURE__*/ jsxs(ContentElement, {
|
|
95
|
+
...sortableProps,
|
|
96
|
+
className: cls('content', padding !== 'normal' && padding !== 'none' && `content-padding-${padding}`, align !== 'inherit' && align !== 'left' && `content-align-${align}`, {
|
|
74
97
|
'content-sortable': sortable,
|
|
75
|
-
focusVisible: sortable && focusVisible
|
|
76
|
-
}),
|
|
98
|
+
focusVisible: sortable && focusVisible
|
|
99
|
+
}),
|
|
100
|
+
children: [
|
|
101
|
+
children,
|
|
102
|
+
sortIcon
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
77
106
|
});
|
|
78
|
-
|
|
107
|
+
TableCell_TableCell.displayName = 'SuiTableCell';
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
79
113
|
|
|
80
|
-
export { TableCell,
|
|
114
|
+
export { TableCell as tableCellStyle, TableCell_TableCell as TableCell };
|
package/TableContainer.js
CHANGED
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import { useThemeProps } from
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
5
|
|
|
6
|
-
var TableContainer$1 = {"sui-table-container":"sui-table-container","sui-table-container-root":"sui-table-container-root","sui-table-container-standard-border":"sui-table-container-standard-border","sui-table-container-rounded-border":"sui-table-container-rounded-border"};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var TableContainer = ({"sui-table-container":"sui-table-container","sui-table-container-root":"sui-table-container-root","sui-table-container-standard-border":"sui-table-container-standard-border","sui-table-container-rounded-border":"sui-table-container-rounded-border"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const TableContainer_TableContainer = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'TableContainer'
|
|
21
|
+
});
|
|
10
22
|
const { component: TableContainerRoot = 'div', classes, className, children, border = 'standard', ...rest } = props;
|
|
11
23
|
const cls = useClasses('table-container', classes, className);
|
|
12
|
-
return
|
|
24
|
+
return /*#__PURE__*/ jsx(TableContainerRoot, {
|
|
25
|
+
className: cls('root', border, `${border}-border`),
|
|
26
|
+
...rest,
|
|
27
|
+
ref: ref,
|
|
28
|
+
children: children
|
|
29
|
+
});
|
|
13
30
|
});
|
|
14
|
-
|
|
31
|
+
TableContainer_TableContainer.displayName = 'SuiTableContainer';
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
15
37
|
|
|
16
|
-
export { TableContainer,
|
|
38
|
+
export { TableContainer as tableContainerStyle, TableContainer_TableContainer as TableContainer };
|
package/TableFooter.js
CHANGED
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { useClasses } from
|
|
3
|
-
import { forwardRef } from
|
|
4
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { useTableContext } from "./chunks/7279.js";
|
|
5
5
|
|
|
6
|
-
var TableFooter$1 = {"sui-table-footer-root":"sui-table-footer-root","sui-table-footer-content":"sui-table-footer-content","sui-table-footer-padding-none":"sui-table-footer-padding-none","sui-table-footer-padding-checkbox":"sui-table-footer-padding-checkbox","sui-table-footer-sticky":"sui-table-footer-sticky"};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// extracted by css-extract-rspack-plugin
|
|
10
|
+
/* export default */ var TableFooter = ({"sui-table-footer-root":"sui-table-footer-root","sui-table-footer-content":"sui-table-footer-content","sui-table-footer-padding-none":"sui-table-footer-padding-none","sui-table-footer-padding-checkbox":"sui-table-footer-padding-checkbox","sui-table-footer-sticky":"sui-table-footer-sticky","sui-table-footer-hide-divider":"sui-table-footer-hide-divider"});
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const TableFooter_TableFooter = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
17
|
+
const { classes, colSpan, children, className, padding = 'normal', divider = true, ...rest } = inProps;
|
|
10
18
|
const cls = useClasses('table-footer', classes, className);
|
|
11
19
|
const table = useTableContext();
|
|
12
|
-
return
|
|
20
|
+
return /*#__PURE__*/ jsx("tfoot", {
|
|
21
|
+
...rest,
|
|
22
|
+
className: cls('root', {
|
|
23
|
+
sticky: table.stickyFooter,
|
|
24
|
+
'hide-divider': !divider
|
|
25
|
+
}),
|
|
26
|
+
ref: ref,
|
|
27
|
+
children: /*#__PURE__*/ jsx("tr", {
|
|
28
|
+
children: /*#__PURE__*/ jsx("td", {
|
|
29
|
+
colSpan: colSpan || 1000,
|
|
30
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
31
|
+
className: cls('content', padding !== 'normal' && `padding-${padding}`),
|
|
32
|
+
children: children
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
13
37
|
});
|
|
14
|
-
|
|
38
|
+
TableFooter_TableFooter.displayName = 'SuiTableFooter';
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
15
43
|
|
|
16
|
-
export { TableFooter,
|
|
44
|
+
export { TableFooter as tableFooterStyles, TableFooter_TableFooter as TableFooter };
|
package/TableHead.js
CHANGED
|
@@ -1,24 +1,58 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { forwardRef, useMemo } from
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import { useThemeProps } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
|
+
import { useTableContext } from "./chunks/7279.js";
|
|
6
|
+
import { Tablelvl2Context } from "./chunks/8011.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// extracted by css-extract-rspack-plugin
|
|
13
|
+
/* export default */ var TableHead = ({"sui-table-head-root":"sui-table-head-root","sui-table-head-background":"sui-table-head-background","sui-table-head-sticky":"sui-table-head-sticky","sui-table-head-hide-divider":"sui-table-head-hide-divider","sui-table-cell-root":"sui-table-cell-root"});
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
7
19
|
|
|
8
|
-
var TableHead$1 = {"sui-table-head-root":"sui-table-head-root","sui-table-head-background":"sui-table-head-background","sui-table-head-sticky":"sui-table-head-sticky"};
|
|
9
20
|
|
|
10
21
|
const defaultComponent = 'thead';
|
|
11
|
-
const
|
|
12
|
-
const props = useThemeProps({
|
|
13
|
-
|
|
22
|
+
const TableHead_TableHead = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
23
|
+
const props = useThemeProps({
|
|
24
|
+
props: inProps,
|
|
25
|
+
name: 'TableHead'
|
|
26
|
+
});
|
|
27
|
+
const { component: TableHeadRoot = defaultComponent, classes, className, children, useDefaultBgColor, divider = true, ...rest } = props;
|
|
14
28
|
const cls = useClasses('table-head', classes, className);
|
|
15
29
|
const table = useTableContext();
|
|
16
|
-
const tablelvl2 = useMemo(()
|
|
17
|
-
|
|
30
|
+
const tablelvl2 = useMemo(()=>({
|
|
31
|
+
variant: 'head',
|
|
32
|
+
useDefaultBgColor
|
|
33
|
+
}), [
|
|
34
|
+
useDefaultBgColor
|
|
35
|
+
]);
|
|
36
|
+
return /*#__PURE__*/ jsx(Tablelvl2Context.Provider, {
|
|
37
|
+
value: tablelvl2,
|
|
38
|
+
children: /*#__PURE__*/ jsx(TableHeadRoot, {
|
|
39
|
+
className: cls('root', {
|
|
18
40
|
background: !useDefaultBgColor,
|
|
19
41
|
sticky: table && table.stickyHeader,
|
|
20
|
-
|
|
42
|
+
'hide-divider': !divider
|
|
43
|
+
}),
|
|
44
|
+
role: TableHeadRoot === defaultComponent ? undefined : 'rowgroup',
|
|
45
|
+
...rest,
|
|
46
|
+
ref: ref,
|
|
47
|
+
children: children
|
|
48
|
+
})
|
|
49
|
+
});
|
|
21
50
|
});
|
|
22
|
-
|
|
51
|
+
TableHead_TableHead.displayName = 'SuiTableHead';
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
23
57
|
|
|
24
|
-
export { TableHead,
|
|
58
|
+
export { TableHead as tableHeadStyle, TableHead_TableHead as TableHead };
|
package/TablePagination.js
CHANGED
|
@@ -1,62 +1,50 @@
|
|
|
1
|
-
import { jsx, jsxs } from
|
|
2
|
-
import { combineProps, useClasses, useEventCallback } from
|
|
3
|
-
import { CaretLeftMd, CaretRightMd } from
|
|
4
|
-
import { useThemeProps } from
|
|
5
|
-
import { forwardRef } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Option } from
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import './chunks/useListNavigation.js';
|
|
36
|
-
import 'tabbable';
|
|
37
|
-
import './ListNavigation.js';
|
|
38
|
-
import './chunks/Menu.js';
|
|
39
|
-
import './chunks/Popover.js';
|
|
40
|
-
import './chunks/getGrow.js';
|
|
41
|
-
import './chunks/ExpandCollapseCaret.js';
|
|
42
|
-
import './chunks/useMotionSafeTransition.js';
|
|
43
|
-
import './chunks/useHelperTextId.js';
|
|
44
|
-
import './chunks/MenuList.js';
|
|
45
|
-
import './chunks/VirtualizedMenu.js';
|
|
46
|
-
|
|
47
|
-
var TablePagination$1 = {"sui-table-pagination-content":"sui-table-pagination-content","sui-table-pagination-selector":"sui-table-pagination-selector","sui-table-pagination-rows-per-page-controls":"sui-table-pagination-rows-per-page-controls","sui-table-pagination-rows-per-page-label":"sui-table-pagination-rows-per-page-label","sui-table-pagination-current-page-controls":"sui-table-pagination-current-page-controls","sui-table-pagination-range-container":"sui-table-pagination-range-container"};
|
|
48
|
-
|
|
49
|
-
const TablePagination = forwardRef((inProps, ref) => {
|
|
50
|
-
const { classes, className, component: Root = 'td', colSpan = 1000, page, variant = 'range', count = -1, rowsPerPage = 10, rowsPerPageLabel = 'Rows per page', rowsPerPageOptions = [10, 25, 50, 100], onRowsPerPageChange, rangeSeparatorLabel = 'of', previousPageButtonProps, nextPageButtonProps, selectorProps, MenuProps, onPageChange, ...rest } = useThemeProps({
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { combineProps, useClasses, useEventCallback } from "@ringcentral/spring-base";
|
|
3
|
+
import { CaretLeftMd, CaretRightMd } from "@ringcentral/spring-icon";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { IconButton as IconButton_IconButton } from "./IconButton.js";
|
|
7
|
+
import { MenuItemText as MenuItemText_MenuItemText } from "./MenuItemText.js";
|
|
8
|
+
import { Option } from "./Option.js";
|
|
9
|
+
import { Select as Select_Select } from "./Select.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// extracted by css-extract-rspack-plugin
|
|
17
|
+
/* export default */ var TablePagination = ({"sui-table-pagination-content":"sui-table-pagination-content","sui-table-pagination-selector":"sui-table-pagination-selector","sui-table-pagination-rows-per-page-controls":"sui-table-pagination-rows-per-page-controls","sui-table-pagination-rows-per-page-label":"sui-table-pagination-rows-per-page-label","sui-table-pagination-current-page-controls":"sui-table-pagination-current-page-controls","sui-table-pagination-range-container":"sui-table-pagination-range-container"});
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const TablePagination_TablePagination = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
29
|
+
const { classes, className, component: Root = 'td', colSpan = 1000, page, variant = 'range', count = -1, rowsPerPage = 10, rowsPerPageLabel = 'Rows per page', rowsPerPageOptions = [
|
|
30
|
+
10,
|
|
31
|
+
25,
|
|
32
|
+
50,
|
|
33
|
+
100
|
|
34
|
+
], onRowsPerPageChange, rangeSeparatorLabel = 'of', previousPageButtonProps, nextPageButtonProps, selectorProps, MenuProps, onPageChange, ...rest } = useThemeProps({
|
|
51
35
|
props: inProps,
|
|
52
|
-
name: 'TablePagination'
|
|
36
|
+
name: 'TablePagination'
|
|
53
37
|
});
|
|
54
38
|
const mergedSelectMenuProps = combineProps({
|
|
55
|
-
PopperProps: {
|
|
56
|
-
|
|
39
|
+
PopperProps: {
|
|
40
|
+
matchAnchorWidth: false
|
|
41
|
+
},
|
|
42
|
+
classes: {
|
|
43
|
+
paper: 'min-w-16'
|
|
44
|
+
}
|
|
57
45
|
}, MenuProps);
|
|
58
46
|
const rootProps = {
|
|
59
|
-
...rest
|
|
47
|
+
...rest
|
|
60
48
|
};
|
|
61
49
|
if (Root === 'td') {
|
|
62
50
|
rootProps.colSpan = colSpan;
|
|
@@ -73,44 +61,130 @@ const TablePagination = forwardRef((inProps, ref) => {
|
|
|
73
61
|
endOfRange = totalPages;
|
|
74
62
|
showRowRange = false;
|
|
75
63
|
total = totalPages;
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
64
|
+
} else {
|
|
78
65
|
endOfRange = page * rowsPerPage + rowsPerPage;
|
|
79
|
-
if (endOfRange > count)
|
|
80
|
-
endOfRange = count;
|
|
66
|
+
if (endOfRange > count) endOfRange = count;
|
|
81
67
|
}
|
|
82
|
-
const handlePreviousPageButtonClick = useEventCallback((e)
|
|
83
|
-
if (!hasPreviousPage)
|
|
84
|
-
return;
|
|
68
|
+
const handlePreviousPageButtonClick = useEventCallback((e)=>{
|
|
69
|
+
if (!hasPreviousPage) return;
|
|
85
70
|
onPageChange?.(e, page - 1);
|
|
86
71
|
});
|
|
87
|
-
const handleNextPageButtonClick = useEventCallback((e)
|
|
88
|
-
if (!hasNextPage)
|
|
89
|
-
return;
|
|
72
|
+
const handleNextPageButtonClick = useEventCallback((e)=>{
|
|
73
|
+
if (!hasNextPage) return;
|
|
90
74
|
onPageChange?.(e, page + 1);
|
|
91
75
|
});
|
|
92
|
-
const handleSelectPageChange = useEventCallback((e)
|
|
76
|
+
const handleSelectPageChange = useEventCallback((e)=>{
|
|
93
77
|
onPageChange?.(e, parseInt(e.target.value, 10));
|
|
94
78
|
});
|
|
95
|
-
const handleRowsPerPageChange = useEventCallback((e, child)
|
|
79
|
+
const handleRowsPerPageChange = useEventCallback((e, child)=>{
|
|
96
80
|
onPageChange?.(e, 0);
|
|
97
81
|
onRowsPerPageChange?.(e, child);
|
|
98
82
|
});
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
84
|
+
className: cls('root'),
|
|
85
|
+
...rootProps,
|
|
86
|
+
ref: ref,
|
|
87
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
88
|
+
className: cls('content'),
|
|
89
|
+
children: [
|
|
90
|
+
variant === 'page-size' && /*#__PURE__*/ jsxs("div", {
|
|
91
|
+
className: cls('rows-per-page-controls'),
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ jsx("span", {
|
|
94
|
+
className: cls('rows-per-page-label'),
|
|
95
|
+
children: rowsPerPageLabel
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsx(Select_Select, {
|
|
98
|
+
value: rowsPerPage,
|
|
99
|
+
variant: "outlined",
|
|
100
|
+
size: "medium",
|
|
101
|
+
classes: {
|
|
102
|
+
selector: cls('selector')
|
|
103
|
+
},
|
|
104
|
+
selectorProps: selectorProps,
|
|
105
|
+
MenuProps: mergedSelectMenuProps,
|
|
106
|
+
onChange: handleRowsPerPageChange,
|
|
107
|
+
children: rowsPerPageOptions?.map((option)=>/*#__PURE__*/ jsx(Option, {
|
|
108
|
+
value: option,
|
|
109
|
+
children: /*#__PURE__*/ jsx(MenuItemText_MenuItemText, {
|
|
110
|
+
children: option
|
|
111
|
+
})
|
|
112
|
+
}, option))
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ jsxs("div", {
|
|
117
|
+
className: cls('range-container'),
|
|
118
|
+
children: [
|
|
119
|
+
variant === 'select-page' && /*#__PURE__*/ jsx(Select_Select, {
|
|
120
|
+
value: page,
|
|
121
|
+
variant: "outlined",
|
|
122
|
+
size: "medium",
|
|
123
|
+
classes: {
|
|
102
124
|
content: 'mr-0.5',
|
|
103
|
-
selector: cls('selector')
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
selector: cls('selector')
|
|
126
|
+
},
|
|
127
|
+
selectorProps: selectorProps,
|
|
128
|
+
MenuProps: mergedSelectMenuProps,
|
|
129
|
+
renderValue: (value)=>value + 1,
|
|
130
|
+
onChange: handleSelectPageChange,
|
|
131
|
+
children: Array(totalPages).fill(totalPages).map((_, i)=>/*#__PURE__*/ jsx(Option, {
|
|
132
|
+
value: i,
|
|
133
|
+
children: /*#__PURE__*/ jsx(MenuItemText_MenuItemText, {
|
|
134
|
+
children: i + 1
|
|
135
|
+
})
|
|
136
|
+
}, i))
|
|
137
|
+
}),
|
|
138
|
+
showRowRange && /*#__PURE__*/ jsx("span", {
|
|
139
|
+
children: `${startOfRange}-${endOfRange}`
|
|
140
|
+
}),
|
|
141
|
+
/*#__PURE__*/ jsx("span", {
|
|
142
|
+
children: rangeSeparatorLabel
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ jsx("span", {
|
|
145
|
+
children: total
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ jsxs("div", {
|
|
150
|
+
className: cls('current-page-controls'),
|
|
151
|
+
children: [
|
|
152
|
+
/*#__PURE__*/ jsx(IconButton_IconButton, {
|
|
153
|
+
shape: "squircle",
|
|
154
|
+
color: "secondary",
|
|
155
|
+
variant: "contained",
|
|
156
|
+
size: "small",
|
|
157
|
+
symbol: CaretLeftMd,
|
|
158
|
+
background: false,
|
|
159
|
+
disabled: !hasPreviousPage,
|
|
160
|
+
...combineProps({
|
|
107
161
|
onClick: handlePreviousPageButtonClick,
|
|
108
|
-
'aria-label': 'Go to previous page'
|
|
109
|
-
}, previousPageButtonProps)
|
|
162
|
+
'aria-label': 'Go to previous page'
|
|
163
|
+
}, previousPageButtonProps)
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ jsx(IconButton_IconButton, {
|
|
166
|
+
shape: "squircle",
|
|
167
|
+
color: "secondary",
|
|
168
|
+
variant: "contained",
|
|
169
|
+
size: "small",
|
|
170
|
+
symbol: CaretRightMd,
|
|
171
|
+
background: false,
|
|
172
|
+
disabled: !hasNextPage,
|
|
173
|
+
...combineProps({
|
|
110
174
|
onClick: handleNextPageButtonClick,
|
|
111
|
-
'aria-label': 'Go to next page'
|
|
112
|
-
}, nextPageButtonProps)
|
|
175
|
+
'aria-label': 'Go to next page'
|
|
176
|
+
}, nextPageButtonProps)
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
})
|
|
182
|
+
});
|
|
113
183
|
});
|
|
114
|
-
|
|
184
|
+
TablePagination_TablePagination.displayName = 'SuiTablePagination';
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
115
189
|
|
|
116
|
-
export { TablePagination,
|
|
190
|
+
export { TablePagination as tablePaginationStyles, TablePagination_TablePagination as TablePagination };
|