@react-md/core 6.5.2 → 7.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/app-bar/AppBar.d.ts +3 -2
- package/dist/app-bar/AppBar.js +3 -4
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +3 -1
- package/dist/app-bar/AppBarTitle.js +3 -4
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/autocomplete/AutocompleteChip.d.ts +2 -1
- package/dist/autocomplete/AutocompleteChip.js +3 -4
- package/dist/autocomplete/AutocompleteChip.js.map +1 -1
- package/dist/autocomplete/types.d.ts +1 -0
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/autocomplete/utils.d.ts +4 -4
- package/dist/autocomplete/utils.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +3 -2
- package/dist/avatar/Avatar.js +3 -4
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/badge/Badge.d.ts +3 -2
- package/dist/badge/Badge.js +3 -4
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.d.ts +3 -2
- package/dist/box/Box.js +3 -4
- package/dist/box/Box.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +3 -2
- package/dist/button/AsyncButton.js +3 -4
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +3 -2
- package/dist/button/Button.js +3 -4
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +5 -3
- package/dist/button/ButtonUnstyled.js +3 -4
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.d.ts +3 -2
- package/dist/button/FloatingActionButton.js +3 -4
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.d.ts +3 -2
- package/dist/button/TooltippedButton.js +3 -4
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/card/Card.d.ts +3 -2
- package/dist/card/Card.js +3 -4
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +3 -2
- package/dist/card/CardContent.js +3 -4
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +3 -1
- package/dist/card/CardFooter.js +3 -4
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +3 -2
- package/dist/card/CardHeader.js +3 -4
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +3 -1
- package/dist/card/CardSubtitle.js +3 -4
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +3 -1
- package/dist/card/CardTitle.js +3 -4
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +3 -2
- package/dist/card/ClickableCard.js +3 -4
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/chip/Chip.d.ts +4 -2
- package/dist/chip/Chip.js +4 -4
- package/dist/chip/Chip.js.map +1 -1
- package/dist/datetime/NativeDateField.d.ts +3 -1
- package/dist/datetime/NativeDateField.js +3 -4
- package/dist/datetime/NativeDateField.js.map +1 -1
- package/dist/datetime/NativeTimeField.d.ts +3 -1
- package/dist/datetime/NativeTimeField.js +3 -4
- package/dist/datetime/NativeTimeField.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +3 -2
- package/dist/dialog/Dialog.js +4 -4
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.d.ts +3 -2
- package/dist/dialog/DialogContainer.js +3 -4
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.d.ts +3 -2
- package/dist/dialog/DialogContent.js +3 -4
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.d.ts +3 -2
- package/dist/dialog/DialogFooter.js +3 -4
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.d.ts +3 -1
- package/dist/dialog/DialogHeader.js +3 -4
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +3 -1
- package/dist/dialog/DialogTitle.js +3 -4
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +4 -3
- package/dist/dialog/FixedDialog.js +4 -4
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/divider/Divider.d.ts +3 -2
- package/dist/divider/Divider.js +3 -4
- package/dist/divider/Divider.js.map +1 -1
- package/dist/draggable/useDraggable.d.ts +3 -3
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.d.ts +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.d.ts +3 -2
- package/dist/expansion-panel/ExpansionList.js +3 -4
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +3 -2
- package/dist/expansion-panel/ExpansionPanel.js +3 -4
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -2
- package/dist/expansion-panel/ExpansionPanelHeader.js +3 -4
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/files/FileInput.d.ts +3 -2
- package/dist/files/FileInput.js +3 -4
- package/dist/files/FileInput.js.map +1 -1
- package/dist/focus/useFocusContainer.d.ts +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/form/Checkbox.d.ts +2 -1
- package/dist/form/Checkbox.js +4 -4
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +3 -2
- package/dist/form/Fieldset.js +3 -4
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/Form.d.ts +3 -2
- package/dist/form/Form.js +3 -4
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.d.ts +8 -2
- package/dist/form/FormMessage.js +3 -4
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +5 -4
- package/dist/form/FormMessageContainer.js +3 -4
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +3 -2
- package/dist/form/FormMessageCounter.js +3 -4
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.d.ts +3 -2
- package/dist/form/InputToggle.js +3 -4
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.d.ts +3 -2
- package/dist/form/InputToggleIcon.js +3 -4
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.d.ts +2 -1
- package/dist/form/Label.js +3 -4
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +3 -1
- package/dist/form/Legend.js +3 -4
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +3 -2
- package/dist/form/NativeSelect.js +3 -4
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.d.ts +3 -2
- package/dist/form/OptGroup.js +3 -4
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.d.ts +3 -2
- package/dist/form/Option.js +4 -4
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.d.ts +2 -2
- package/dist/form/Password.js +3 -4
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +2 -1
- package/dist/form/Radio.js +4 -4
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.d.ts +3 -2
- package/dist/form/ResizingTextAreaWrapper.js +3 -4
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/SliderContainer.d.ts +3 -2
- package/dist/form/SliderContainer.js +3 -4
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +3 -2
- package/dist/form/SliderThumb.js +4 -4
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.d.ts +3 -2
- package/dist/form/SliderTrack.js +3 -4
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/Switch.d.ts +3 -2
- package/dist/form/Switch.js +3 -4
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +3 -2
- package/dist/form/SwitchTrack.js +3 -4
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.d.ts +3 -2
- package/dist/form/TextArea.js +3 -4
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +3 -2
- package/dist/form/TextField.js +3 -4
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.d.ts +2 -1
- package/dist/form/TextFieldAddon.js +3 -4
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/TextFieldContainer.d.ts +3 -2
- package/dist/form/TextFieldContainer.js +3 -4
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/types.d.ts +11 -5
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCombobox.d.ts +6 -6
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useFormReset.d.ts +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useTextField.d.ts +4 -4
- package/dist/form/useTextField.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.d.ts +5 -5
- package/dist/hoverMode/useHoverModeProvider.js +1 -1
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +3 -2
- package/dist/icon/FontIcon.js +3 -4
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +3 -2
- package/dist/icon/IconRotator.js +4 -4
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +3 -2
- package/dist/icon/MaterialIcon.js +3 -4
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +3 -2
- package/dist/icon/MaterialSymbol.js +3 -4
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +3 -2
- package/dist/icon/SVGIcon.js +3 -4
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +3 -1
- package/dist/layout/LayoutAppBar.js +3 -4
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.d.ts +3 -2
- package/dist/layout/LayoutNav.js +3 -4
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +4 -2
- package/dist/layout/LayoutWindowSplitter.js +4 -4
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.d.ts +4 -3
- package/dist/layout/Main.js +3 -4
- package/dist/layout/Main.js.map +1 -1
- package/dist/link/Link.d.ts +10 -2
- package/dist/link/Link.js +4 -4
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +3 -2
- package/dist/link/SkipToMainContent.js +4 -4
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/list/List.d.ts +3 -2
- package/dist/list/List.js +3 -4
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +3 -2
- package/dist/list/ListItem.js +3 -4
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +3 -2
- package/dist/list/ListItemLink.js +3 -4
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListItemText.d.ts +3 -2
- package/dist/list/ListItemText.js +3 -4
- package/dist/list/ListItemText.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +3 -2
- package/dist/list/ListSubheader.js +3 -4
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +4 -2
- package/dist/menu/Menu.js +5 -4
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +3 -1
- package/dist/menu/MenuBar.js +3 -4
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +2 -1
- package/dist/menu/MenuButton.js +3 -4
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +3 -1
- package/dist/menu/MenuItem.js +3 -4
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.d.ts +2 -1
- package/dist/menu/MenuItemButton.js +4 -4
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCheckbox.d.ts +2 -1
- package/dist/menu/MenuItemCheckbox.js +4 -4
- package/dist/menu/MenuItemCheckbox.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.d.ts +3 -2
- package/dist/menu/MenuItemCircularProgress.js +3 -4
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemFileInput.d.ts +2 -2
- package/dist/menu/MenuItemFileInput.js +3 -4
- package/dist/menu/MenuItemFileInput.js.map +1 -1
- package/dist/menu/MenuItemGroup.d.ts +3 -3
- package/dist/menu/MenuItemGroup.js +4 -4
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemInputToggle.d.ts +3 -2
- package/dist/menu/MenuItemInputToggle.js +3 -4
- package/dist/menu/MenuItemInputToggle.js.map +1 -1
- package/dist/menu/MenuItemRadio.d.ts +3 -1
- package/dist/menu/MenuItemRadio.js +4 -4
- package/dist/menu/MenuItemRadio.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +3 -2
- package/dist/menu/MenuItemSeparator.js +3 -4
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuItemSwitch.d.ts +2 -1
- package/dist/menu/MenuItemSwitch.js +4 -4
- package/dist/menu/MenuItemSwitch.js.map +1 -1
- package/dist/menu/MenuItemTextField.d.ts +2 -2
- package/dist/menu/MenuItemTextField.js +3 -4
- package/dist/menu/MenuItemTextField.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.d.ts +3 -3
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.d.ts +4 -4
- package/dist/menu/MenuWidget.js +4 -4
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +4 -4
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +5 -5
- package/dist/movement/types.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +2 -2
- package/dist/navigation/CollapsibleNavGroup.js +3 -4
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/NavGroup.d.ts +3 -2
- package/dist/navigation/NavGroup.js +3 -4
- package/dist/navigation/NavGroup.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +3 -2
- package/dist/navigation/NavItem.js +3 -4
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.d.ts +2 -2
- package/dist/navigation/NavItemButton.js +3 -4
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.d.ts +3 -2
- package/dist/navigation/NavItemLink.js +4 -4
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +2 -1
- package/dist/navigation/NavSubheader.js +3 -4
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.d.ts +1 -1
- package/dist/navigation/Navigation.js +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/types.d.ts +5 -2
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.js +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +3 -2
- package/dist/overlay/Overlay.js +3 -4
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/positioning/useFixedPositioning.d.ts +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +2 -2
- package/dist/progress/CircularProgress.js +4 -4
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +2 -2
- package/dist/progress/LinearProgress.js +4 -4
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/types.d.ts +2 -0
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItem.d.ts +3 -2
- package/dist/responsive-item/ResponsiveItem.js +3 -4
- package/dist/responsive-item/ResponsiveItem.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +3 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +3 -2
- package/dist/segmented-button/SegmentedButton.js +3 -4
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +4 -3
- package/dist/segmented-button/SegmentedButtonContainer.js +4 -5
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +2 -1
- package/dist/sheet/Sheet.js +3 -4
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +3 -2
- package/dist/snackbar/Snackbar.js +3 -4
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +3 -2
- package/dist/snackbar/Toast.js +4 -4
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +2 -1
- package/dist/snackbar/ToastActionButton.js +3 -4
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +2 -1
- package/dist/snackbar/ToastCloseButton.js +3 -4
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.d.ts +3 -2
- package/dist/snackbar/ToastContent.js +4 -4
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/spinbutton/SpinButton.d.ts +4 -3
- package/dist/spinbutton/SpinButton.js +3 -4
- package/dist/spinbutton/SpinButton.js.map +1 -1
- package/dist/spinbutton/types.d.ts +1 -1
- package/dist/spinbutton/types.js.map +1 -1
- package/dist/table/StickyTableSection.d.ts +3 -2
- package/dist/table/StickyTableSection.js +3 -4
- package/dist/table/StickyTableSection.js.map +1 -1
- package/dist/table/Table.d.ts +3 -2
- package/dist/table/Table.js +4 -4
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.d.ts +3 -2
- package/dist/table/TableBody.js +4 -4
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.d.ts +3 -2
- package/dist/table/TableCell.js +3 -4
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +3 -2
- package/dist/table/TableCellContent.js +3 -4
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +3 -2
- package/dist/table/TableCheckbox.js +3 -4
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainer.d.ts +5 -3
- package/dist/table/TableContainer.js +4 -4
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableContainerProvider.d.ts +1 -1
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.d.ts +3 -2
- package/dist/table/TableFooter.js +4 -5
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +3 -2
- package/dist/table/TableHeader.js +4 -5
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +3 -2
- package/dist/table/TableRadio.js +3 -4
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.d.ts +3 -2
- package/dist/table/TableRow.js +3 -4
- package/dist/table/TableRow.js.map +1 -1
- package/dist/tabs/SimpleTabPanel.d.ts +3 -2
- package/dist/tabs/SimpleTabPanel.js +3 -4
- package/dist/tabs/SimpleTabPanel.js.map +1 -1
- package/dist/tabs/SimpleTabPanels.d.ts +3 -2
- package/dist/tabs/SimpleTabPanels.js +3 -4
- package/dist/tabs/SimpleTabPanels.js.map +1 -1
- package/dist/tabs/TabList.d.ts +3 -2
- package/dist/tabs/TabList.js +4 -4
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.d.ts +3 -2
- package/dist/tabs/TabListScrollButton.js +4 -4
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +2 -2
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/theme/useCSSVariables.d.ts +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +3 -2
- package/dist/tooltip/Tooltip.js +3 -4
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +3 -3
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.d.ts +3 -2
- package/dist/transition/SkeletonPlaceholder.js +3 -4
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.d.ts +3 -2
- package/dist/transition/Slide.js +3 -4
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +3 -2
- package/dist/transition/SlideContainer.js +3 -4
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/tree/TreeGroup.d.ts +2 -2
- package/dist/tree/TreeGroup.js +3 -4
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeProvider.d.ts +2 -3
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/useTreeMovement.d.ts +6 -7
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/types.d.ts +1 -15
- package/dist/types.js.map +1 -1
- package/dist/typography/Mark.d.ts +3 -2
- package/dist/typography/Mark.js +3 -4
- package/dist/typography/Mark.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +3 -2
- package/dist/typography/SrOnly.js +3 -4
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +3 -2
- package/dist/typography/TextContainer.js +3 -4
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +3 -2
- package/dist/typography/Typography.js +3 -4
- package/dist/typography/Typography.js.map +1 -1
- package/dist/useAsyncFunction.d.ts +3 -2
- package/dist/useAsyncFunction.js.map +1 -1
- package/dist/useDebouncedFunction.js +1 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.js +1 -1
- package/dist/useDropzone.js.map +1 -1
- package/dist/useEnsuredRef.d.ts +3 -3
- package/dist/useEnsuredRef.js +1 -1
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useThrottledFunction.js +3 -3
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useUnmounted.d.ts +2 -2
- package/dist/useUnmounted.js.map +1 -1
- package/dist/utils/applyRef.d.ts +1 -1
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +3 -2
- package/dist/window-splitter/WindowSplitter.js +3 -4
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/package.json +9 -9
- package/src/app-bar/AppBar.tsx +54 -54
- package/src/app-bar/AppBarTitle.tsx +29 -27
- package/src/autocomplete/AutocompleteChip.tsx +4 -6
- package/src/autocomplete/types.ts +2 -0
- package/src/autocomplete/utils.ts +4 -4
- package/src/avatar/Avatar.tsx +47 -45
- package/src/badge/Badge.tsx +17 -11
- package/src/box/Box.tsx +51 -50
- package/src/button/AsyncButton.tsx +125 -119
- package/src/button/Button.tsx +74 -73
- package/src/button/ButtonUnstyled.tsx +9 -9
- package/src/button/FloatingActionButton.tsx +9 -7
- package/src/button/TooltippedButton.tsx +6 -6
- package/src/card/Card.tsx +36 -35
- package/src/card/CardContent.tsx +31 -28
- package/src/card/CardFooter.tsx +22 -16
- package/src/card/CardHeader.tsx +36 -30
- package/src/card/CardSubtitle.tsx +8 -6
- package/src/card/CardTitle.tsx +26 -25
- package/src/card/ClickableCard.tsx +57 -54
- package/src/chip/Chip.tsx +122 -120
- package/src/datetime/NativeDateField.tsx +7 -7
- package/src/datetime/NativeTimeField.tsx +7 -7
- package/src/dialog/Dialog.tsx +156 -150
- package/src/dialog/DialogContainer.tsx +35 -29
- package/src/dialog/DialogContent.tsx +26 -19
- package/src/dialog/DialogFooter.tsx +22 -19
- package/src/dialog/DialogHeader.tsx +24 -23
- package/src/dialog/DialogTitle.tsx +27 -26
- package/src/dialog/FixedDialog.tsx +70 -69
- package/src/divider/Divider.tsx +32 -26
- package/src/draggable/useDraggable.ts +3 -6
- package/src/draggable/utils.ts +1 -1
- package/src/expansion-panel/ExpansionList.tsx +24 -19
- package/src/expansion-panel/ExpansionPanel.tsx +11 -6
- package/src/expansion-panel/ExpansionPanelHeader.tsx +9 -6
- package/src/files/FileInput.tsx +79 -79
- package/src/focus/useFocusContainer.ts +1 -1
- package/src/form/Checkbox.tsx +6 -6
- package/src/form/Fieldset.tsx +33 -28
- package/src/form/Form.tsx +26 -25
- package/src/form/FormMessage.tsx +13 -7
- package/src/form/FormMessageContainer.tsx +12 -9
- package/src/form/FormMessageCounter.tsx +8 -7
- package/src/form/InputToggle.tsx +105 -107
- package/src/form/InputToggleIcon.tsx +12 -6
- package/src/form/Label.tsx +40 -41
- package/src/form/Legend.tsx +44 -43
- package/src/form/NativeSelect.tsx +116 -114
- package/src/form/OptGroup.tsx +15 -15
- package/src/form/Option.tsx +123 -122
- package/src/form/Password.tsx +66 -67
- package/src/form/Radio.tsx +6 -6
- package/src/form/ResizingTextAreaWrapper.tsx +7 -6
- package/src/form/SliderContainer.tsx +35 -29
- package/src/form/SliderThumb.tsx +8 -6
- package/src/form/SliderTrack.tsx +80 -80
- package/src/form/Switch.tsx +80 -79
- package/src/form/SwitchTrack.tsx +35 -34
- package/src/form/TextArea.tsx +167 -165
- package/src/form/TextField.tsx +106 -104
- package/src/form/TextFieldAddon.tsx +33 -32
- package/src/form/TextFieldContainer.tsx +8 -6
- package/src/form/sliderUtils.ts +1 -1
- package/src/form/types.ts +15 -5
- package/src/form/useCombobox.ts +6 -10
- package/src/form/useFormReset.ts +1 -1
- package/src/form/useTextField.ts +4 -4
- package/src/hoverMode/useHoverMode.ts +1 -1
- package/src/hoverMode/useHoverModeProvider.ts +13 -8
- package/src/icon/FontIcon.tsx +32 -30
- package/src/icon/IconRotator.tsx +30 -28
- package/src/icon/MaterialIcon.tsx +36 -30
- package/src/icon/MaterialSymbol.tsx +50 -44
- package/src/icon/SVGIcon.tsx +47 -41
- package/src/layout/LayoutAppBar.tsx +23 -28
- package/src/layout/LayoutNav.tsx +68 -62
- package/src/layout/LayoutWindowSplitter.tsx +9 -7
- package/src/layout/Main.tsx +30 -29
- package/src/link/Link.tsx +16 -11
- package/src/link/SkipToMainContent.tsx +6 -6
- package/src/list/List.tsx +31 -29
- package/src/list/ListItem.tsx +126 -125
- package/src/list/ListItemLink.tsx +128 -126
- package/src/list/ListItemText.tsx +42 -37
- package/src/list/ListSubheader.tsx +27 -26
- package/src/menu/DropdownMenu.tsx +2 -2
- package/src/menu/Menu.tsx +327 -326
- package/src/menu/MenuBar.tsx +51 -50
- package/src/menu/MenuButton.tsx +69 -70
- package/src/menu/MenuItem.tsx +37 -37
- package/src/menu/MenuItemButton.tsx +132 -133
- package/src/menu/MenuItemCheckbox.tsx +6 -7
- package/src/menu/MenuItemCircularProgress.tsx +13 -6
- package/src/menu/MenuItemFileInput.tsx +4 -6
- package/src/menu/MenuItemGroup.tsx +18 -18
- package/src/menu/MenuItemInputToggle.tsx +8 -6
- package/src/menu/MenuItemRadio.tsx +6 -6
- package/src/menu/MenuItemSeparator.tsx +7 -7
- package/src/menu/MenuItemSwitch.tsx +6 -6
- package/src/menu/MenuItemTextField.tsx +5 -7
- package/src/menu/MenuVisibilityProvider.tsx +3 -2
- package/src/menu/MenuWidget.tsx +123 -119
- package/src/menu/useContextMenu.ts +7 -4
- package/src/movement/types.ts +5 -9
- package/src/navigation/CollapsibleNavGroup.tsx +10 -6
- package/src/navigation/NavGroup.tsx +18 -19
- package/src/navigation/NavItem.tsx +16 -11
- package/src/navigation/NavItemButton.tsx +69 -66
- package/src/navigation/NavItemLink.tsx +102 -100
- package/src/navigation/NavSubheader.tsx +14 -16
- package/src/navigation/Navigation.tsx +1 -1
- package/src/navigation/types.ts +13 -4
- package/src/navigation/useActiveHeadingId.ts +1 -1
- package/src/overlay/Overlay.tsx +66 -65
- package/src/positioning/useFixedPositioning.ts +1 -1
- package/src/progress/CircularProgress.tsx +6 -6
- package/src/progress/LinearProgress.tsx +6 -6
- package/src/progress/types.ts +4 -0
- package/src/responsive-item/ResponsiveItem.tsx +29 -28
- package/src/responsive-item/ResponsiveItemOverlay.tsx +9 -8
- package/src/segmented-button/SegmentedButton.tsx +11 -6
- package/src/segmented-button/SegmentedButtonContainer.tsx +14 -8
- package/src/sheet/Sheet.tsx +42 -43
- package/src/snackbar/Snackbar.tsx +44 -38
- package/src/snackbar/Toast.tsx +110 -109
- package/src/snackbar/ToastActionButton.tsx +6 -6
- package/src/snackbar/ToastCloseButton.tsx +4 -6
- package/src/snackbar/ToastContent.tsx +56 -49
- package/src/spinbutton/SpinButton.tsx +9 -8
- package/src/spinbutton/types.ts +1 -1
- package/src/table/StickyTableSection.tsx +8 -6
- package/src/table/Table.tsx +47 -41
- package/src/table/TableBody.tsx +46 -42
- package/src/table/TableCell.tsx +83 -81
- package/src/table/TableCellContent.tsx +11 -6
- package/src/table/TableCheckbox.tsx +6 -6
- package/src/table/TableContainer.tsx +31 -26
- package/src/table/TableContainerProvider.ts +1 -1
- package/src/table/TableFooter.tsx +7 -12
- package/src/table/TableHeader.tsx +15 -9
- package/src/table/TableRadio.tsx +59 -58
- package/src/table/TableRow.tsx +34 -33
- package/src/tabs/SimpleTabPanel.tsx +18 -13
- package/src/tabs/SimpleTabPanels.tsx +11 -7
- package/src/tabs/TabList.tsx +106 -105
- package/src/tabs/TabListScrollButton.tsx +9 -6
- package/src/tabs/useTabList.ts +2 -2
- package/src/theme/useCSSVariables.ts +1 -1
- package/src/tooltip/Tooltip.tsx +61 -61
- package/src/tooltip/useTooltip.ts +2 -3
- package/src/transition/SkeletonPlaceholder.tsx +8 -6
- package/src/transition/Slide.tsx +54 -48
- package/src/transition/SlideContainer.tsx +16 -16
- package/src/tree/TreeGroup.tsx +54 -55
- package/src/tree/TreeProvider.tsx +2 -2
- package/src/tree/useTreeMovement.ts +6 -6
- package/src/types.ts +1 -16
- package/src/typography/Mark.tsx +16 -11
- package/src/typography/SrOnly.tsx +41 -35
- package/src/typography/TextContainer.tsx +12 -12
- package/src/typography/Typography.tsx +42 -41
- package/src/useAsyncFunction.ts +3 -3
- package/src/useDebouncedFunction.ts +1 -1
- package/src/useDropzone.ts +1 -1
- package/src/useEnsuredRef.ts +3 -3
- package/src/useThrottledFunction.ts +3 -3
- package/src/useUnmounted.ts +2 -4
- package/src/utils/applyRef.ts +2 -2
- package/src/window-splitter/WindowSplitter.tsx +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/spinbutton/types.ts"],"sourcesContent":["import {\n type AriaAttributes,\n type FocusEvent,\n type FormEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type Ref,\n type RefObject,\n} from \"react\";\n\nimport { type FormComponentStates } from \"../form/types.js\";\nimport { type MinMaxRange, type UseStateInitializer } from \"../types.js\";\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonEventHandlers<E extends HTMLElement = HTMLDivElement> =\n Pick<\n HTMLAttributes<E>,\n \"onInput\" | \"onClick\" | \"onFocus\" | \"onBlur\" | \"onKeyDown\"\n >;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonAriaAttributes = Pick<\n AriaAttributes,\n | \"aria-required\"\n | \"aria-invalid\"\n | \"aria-readonly\"\n | \"aria-disabled\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuenow\"\n | \"aria-valuetext\"\n>;\n\n/**\n * This is a way to map a single character to a value within a spinbutton and\n * was mostly added to support time inputs. The main example is:\n *\n * @example Day Period Mapping\n * ```ts\n * const AM_PM: SpinButtonCharacterValueMap = {\n * a: 0,\n * p: 1,\n * };\n * ```\n *\n * **If the mapping is provided, all other input events are ignored**.\n *\n * @since 6.4.0\n */\nexport type SpinButtonCharacterValueMap = Readonly<Record<string, number>>;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonValue = number | null;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonGetValueText = (\n value: SpinButtonValue\n) => string | undefined;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonChangeEvent<E extends HTMLElement = HTMLDivElement> =\n | FormEvent<E>\n | KeyboardEvent<E>\n | FocusEvent<E>;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonChangeReason =\n | \"change\"\n | \"type\"\n | \"typed-to-completion\"\n | \"cleared\";\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonChangeEventOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n event: SpinButtonChangeEvent<E>;\n value: SpinButtonValue;\n reason: SpinButtonChangeReason;\n}\n\n/**\n * This callback will be fired whenever the spinbutton value has changed.\n *\n * The `reason` will be \"typed-to-completion\"` when:\n * - the `value` is not `null` and:\n * - the user uses the `ArrowUp`, `ArrowDown`, `Home`, `End`, `PageUp`, or\n * `PageDown` keys to change the value\n * - the user has typed the max amount of digits based on the `max` value\n *\n * Examples with: `min=0` and `max=12`\n * - `1` -> (1, false)\n * - `Tab` or blur (1, true)\n * - `1` -> (11, true)\n * - `0` - (1, false)\n * - `Tab` or blur (0, true)\n * - `3` (3, true)\n * - `3` -> (3, true)\n * - there are no more characters that could have been typed\n *\n *\n * @since 6.4.0\n */\nexport type SpinButtonValueChange<E extends HTMLElement = HTMLDivElement> = (\n options: SpinButtonChangeEventOptions<E>\n) => void;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonUnknownValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value?: SpinButtonValue;\n defaultValue?: UseStateInitializer<SpinButtonValue>;\n onValueChange?: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonControlledValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value: SpinButtonValue;\n defaultValue?: never;\n onValueChange: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonUncontrolledValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value?: never;\n defaultValue?: UseStateInitializer<SpinButtonValue>;\n onValueChange?: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonValueOptions<E extends HTMLElement = HTMLDivElement> =\n | SpinButtonControlledValueOptions<E>\n | SpinButtonUncontrolledValueOptions<E>;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonDigitRangeOptions {\n /**\n * This is the minimum number of digits that should be shown in the spin\n * button as the user is typing. If the current value is less than this\n * value, the {@link placeholderChar} will be used as a `padStart` value.\n *\n * @example Get Text Content Example\n * ```ts\n * const textContent1 = getTextContent({\n * value: null,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent1 === \"HH\"\n *\n * const textContent2 = getTextContent({\n * value: 3,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent2 === \"03\"\n *\n * const textContent3 = getTextContent({\n * value: 12,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent3 === \"12\"\n * ```\n *\n * @example Year Example\n * ```ts\n * const textContent1 = getTextContent({\n * value: null,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent1 === \"YYYY\"\n *\n * const textContent2 = getTextContent({\n * value: 2,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent2 === \"0002\"\n *\n * const textContent3 = getTextContent({\n * value: 200,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent3 === \"0200\"\n *\n * const textContent4 = getTextContent({\n * value: 2025,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent4 === \"2025\"\n * ```\n *\n * @see {@link SpinButtonTextPlaceholderOptions.placeholderChar}\n * @defaultValue `fallback?.length ?? getNumberOfDigits(min)`\n */\n minDigits?: number;\n\n /**\n * This is the maximum number of digits that should be shown in the spin\n * button as the user is typing and is used to determine if the user has\n * `\"typed-to-completion\"`.\n *\n * @example Year Example\n * ```tsx\n * // this _could_ also be 9999\n * const max = undefined;\n * const maxDigits = 4;\n *\n * // if the current value is `null` and the user types `2`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 2,\n * });\n *\n * // if the current value is `2` and the user types `0`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 20,\n * });\n *\n * // if the current value is `20` and the user types `2`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 202,\n * });\n *\n * // if the current value is `202` and the user types `5`:\n * onValueChange({\n * event,\n * reason: \"typed-to-completion\",\n * nextValue: 2025,\n * });\n * ```\n *\n * @defaultValue `getNumberOfDigits(max)`\n */\n maxDigits?: number;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonRangeOptions\n extends Partial<MinMaxRange>, SpinButtonDigitRangeOptions {}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonTextPlaceholderOptions extends SpinButtonRangeOptions {\n /**\n * An optional fallback value to display when the spin button's value is\n * `null`. For example: if the spin button is used to set the specific hour\n * in a time field, set the fallback to `\"HH\"` to show that until the user\n * has typed a value.\n */\n fallback?: string;\n\n /**\n * This is the character to use to fill the remaining number of digits to\n * display in the spin button.\n *\n * @see {@link minDigits}\n * @defaultValue `\"0\"`\n */\n placeholderChar?: string;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface GetSpinButtonTextContentOptions extends SpinButtonTextPlaceholderOptions {\n /**\n * The current value in the spin button to convert to text. **This will be\n * called with numbers outside of the allowed range**.\n */\n value: SpinButtonValue;\n}\n\n/**\n * @since 6.4.0\n */\nexport type GetSpinButtonTextContent = (\n options: GetSpinButtonTextContentOptions\n) => string;\n\n/**\n * @since 6.4.0\n */\nexport type GetSpinButtonValueText = (\n value: SpinButtonValue\n) => string | undefined;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonFormStates extends Omit<\n FormComponentStates,\n \"active\"\n> {\n required?: boolean;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonOptions<E extends HTMLElement = HTMLDivElement>\n extends\n SpinButtonEventHandlers<E>,\n SpinButtonUnknownValueOptions<E>,\n SpinButtonFormStates,\n SpinButtonTextPlaceholderOptions {\n /**\n * @defaultValue `\"spinbutton-\" + useId()`\n */\n id?: string;\n ref?: Ref<E>;\n form?: string;\n\n /**\n * The default value to use when the increment or decrement action is fired\n * from the spinbutton through keyboard events before a value has been set.\n * So when the increment action is fired, this will be\n * `defaultKeyboardValue + 1`.\n *\n * @defaultValue `min ?? max ?? 0`\n */\n defaultKeyboardValue?: UseStateInitializer<number>;\n\n /**\n * NOTE: This isn't actually supported yet\n *\n * @defaultValue `1`\n */\n step?: number;\n\n /** @see {@link SpinButtonCharacterValueMap} */\n mappings?: SpinButtonCharacterValueMap;\n\n /**\n * Used to provide an `aria-valuenow` string for a specific value in the\n * `SpinButton`.\n *\n * @defaultValue `(value) => value === null ? \"No value selected\" : undefined`\n */\n getValueText?: GetSpinButtonValueText;\n\n getTextContent?: GetSpinButtonTextContent;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface ProvidedSpinButtonProps<E extends HTMLElement = HTMLDivElement>\n extends Required<SpinButtonEventHandlers<E>>, SpinButtonAriaAttributes {\n id: string;\n ref: Ref<E>;\n role: \"spinbutton\";\n inputMode: \"numeric\";\n spellCheck: boolean;\n autoCapitalize: \"none\";\n autoCorrect: \"off\";\n tabIndex: number | undefined;\n contentEditable: boolean | undefined;\n suppressContentEditableWarning: boolean;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonImplementation<\n E extends HTMLElement = HTMLDivElement,\n> {\n value: SpinButtonValue;\n setValue: (value: SpinButtonValue) => void;\n spinButtonRef: RefObject<E>;\n spinButtonProps: Readonly<ProvidedSpinButtonProps<E>>;\n}\n"],"names":[],"mappings":"AAkZA;;CAEC,GACD,WAOC"}
|
|
1
|
+
{"version":3,"sources":["../../src/spinbutton/types.ts"],"sourcesContent":["import {\n type AriaAttributes,\n type FocusEvent,\n type FormEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type Ref,\n type RefObject,\n} from \"react\";\n\nimport { type FormComponentStates } from \"../form/types.js\";\nimport { type MinMaxRange, type UseStateInitializer } from \"../types.js\";\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonEventHandlers<E extends HTMLElement = HTMLDivElement> =\n Pick<\n HTMLAttributes<E>,\n \"onInput\" | \"onClick\" | \"onFocus\" | \"onBlur\" | \"onKeyDown\"\n >;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonAriaAttributes = Pick<\n AriaAttributes,\n | \"aria-required\"\n | \"aria-invalid\"\n | \"aria-readonly\"\n | \"aria-disabled\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuenow\"\n | \"aria-valuetext\"\n>;\n\n/**\n * This is a way to map a single character to a value within a spinbutton and\n * was mostly added to support time inputs. The main example is:\n *\n * @example Day Period Mapping\n * ```ts\n * const AM_PM: SpinButtonCharacterValueMap = {\n * a: 0,\n * p: 1,\n * };\n * ```\n *\n * **If the mapping is provided, all other input events are ignored**.\n *\n * @since 6.4.0\n */\nexport type SpinButtonCharacterValueMap = Readonly<Record<string, number>>;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonValue = number | null;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonGetValueText = (\n value: SpinButtonValue\n) => string | undefined;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonChangeEvent<E extends HTMLElement = HTMLDivElement> =\n | FormEvent<E>\n | KeyboardEvent<E>\n | FocusEvent<E>;\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonChangeReason =\n | \"change\"\n | \"type\"\n | \"typed-to-completion\"\n | \"cleared\";\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonChangeEventOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n event: SpinButtonChangeEvent<E>;\n value: SpinButtonValue;\n reason: SpinButtonChangeReason;\n}\n\n/**\n * This callback will be fired whenever the spinbutton value has changed.\n *\n * The `reason` will be \"typed-to-completion\"` when:\n * - the `value` is not `null` and:\n * - the user uses the `ArrowUp`, `ArrowDown`, `Home`, `End`, `PageUp`, or\n * `PageDown` keys to change the value\n * - the user has typed the max amount of digits based on the `max` value\n *\n * Examples with: `min=0` and `max=12`\n * - `1` -> (1, false)\n * - `Tab` or blur (1, true)\n * - `1` -> (11, true)\n * - `0` - (1, false)\n * - `Tab` or blur (0, true)\n * - `3` (3, true)\n * - `3` -> (3, true)\n * - there are no more characters that could have been typed\n *\n *\n * @since 6.4.0\n */\nexport type SpinButtonValueChange<E extends HTMLElement = HTMLDivElement> = (\n options: SpinButtonChangeEventOptions<E>\n) => void;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonUnknownValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value?: SpinButtonValue;\n defaultValue?: UseStateInitializer<SpinButtonValue>;\n onValueChange?: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonControlledValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value: SpinButtonValue;\n defaultValue?: never;\n onValueChange: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonUncontrolledValueOptions<\n E extends HTMLElement = HTMLDivElement,\n> {\n value?: never;\n defaultValue?: UseStateInitializer<SpinButtonValue>;\n onValueChange?: SpinButtonValueChange<E>;\n}\n\n/**\n * @since 6.4.0\n */\nexport type SpinButtonValueOptions<E extends HTMLElement = HTMLDivElement> =\n | SpinButtonControlledValueOptions<E>\n | SpinButtonUncontrolledValueOptions<E>;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonDigitRangeOptions {\n /**\n * This is the minimum number of digits that should be shown in the spin\n * button as the user is typing. If the current value is less than this\n * value, the {@link placeholderChar} will be used as a `padStart` value.\n *\n * @example Get Text Content Example\n * ```ts\n * const textContent1 = getTextContent({\n * value: null,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent1 === \"HH\"\n *\n * const textContent2 = getTextContent({\n * value: 3,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent2 === \"03\"\n *\n * const textContent3 = getTextContent({\n * value: 12,\n * fallback: \"HH\",\n * placeholderChar: \"0\",\n * });\n * // ^ textContent3 === \"12\"\n * ```\n *\n * @example Year Example\n * ```ts\n * const textContent1 = getTextContent({\n * value: null,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent1 === \"YYYY\"\n *\n * const textContent2 = getTextContent({\n * value: 2,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent2 === \"0002\"\n *\n * const textContent3 = getTextContent({\n * value: 200,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent3 === \"0200\"\n *\n * const textContent4 = getTextContent({\n * value: 2025,\n * fallback: \"YYYY\",\n * minDigits: 4,\n * });\n * // ^ textContent4 === \"2025\"\n * ```\n *\n * @see {@link SpinButtonTextPlaceholderOptions.placeholderChar}\n * @defaultValue `fallback?.length ?? getNumberOfDigits(min)`\n */\n minDigits?: number;\n\n /**\n * This is the maximum number of digits that should be shown in the spin\n * button as the user is typing and is used to determine if the user has\n * `\"typed-to-completion\"`.\n *\n * @example Year Example\n * ```tsx\n * // this _could_ also be 9999\n * const max = undefined;\n * const maxDigits = 4;\n *\n * // if the current value is `null` and the user types `2`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 2,\n * });\n *\n * // if the current value is `2` and the user types `0`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 20,\n * });\n *\n * // if the current value is `20` and the user types `2`\n * onValueChange({\n * event,\n * reason: \"change\",\n * nextValue: 202,\n * });\n *\n * // if the current value is `202` and the user types `5`:\n * onValueChange({\n * event,\n * reason: \"typed-to-completion\",\n * nextValue: 2025,\n * });\n * ```\n *\n * @defaultValue `getNumberOfDigits(max)`\n */\n maxDigits?: number;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonRangeOptions\n extends Partial<MinMaxRange>, SpinButtonDigitRangeOptions {}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonTextPlaceholderOptions extends SpinButtonRangeOptions {\n /**\n * An optional fallback value to display when the spin button's value is\n * `null`. For example: if the spin button is used to set the specific hour\n * in a time field, set the fallback to `\"HH\"` to show that until the user\n * has typed a value.\n */\n fallback?: string;\n\n /**\n * This is the character to use to fill the remaining number of digits to\n * display in the spin button.\n *\n * @see {@link minDigits}\n * @defaultValue `\"0\"`\n */\n placeholderChar?: string;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface GetSpinButtonTextContentOptions extends SpinButtonTextPlaceholderOptions {\n /**\n * The current value in the spin button to convert to text. **This will be\n * called with numbers outside of the allowed range**.\n */\n value: SpinButtonValue;\n}\n\n/**\n * @since 6.4.0\n */\nexport type GetSpinButtonTextContent = (\n options: GetSpinButtonTextContentOptions\n) => string;\n\n/**\n * @since 6.4.0\n */\nexport type GetSpinButtonValueText = (\n value: SpinButtonValue\n) => string | undefined;\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonFormStates extends Omit<\n FormComponentStates,\n \"active\"\n> {\n required?: boolean;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonOptions<E extends HTMLElement = HTMLDivElement>\n extends\n SpinButtonEventHandlers<E>,\n SpinButtonUnknownValueOptions<E>,\n SpinButtonFormStates,\n SpinButtonTextPlaceholderOptions {\n /**\n * @defaultValue `\"spinbutton-\" + useId()`\n */\n id?: string;\n ref?: Ref<E>;\n form?: string;\n\n /**\n * The default value to use when the increment or decrement action is fired\n * from the spinbutton through keyboard events before a value has been set.\n * So when the increment action is fired, this will be\n * `defaultKeyboardValue + 1`.\n *\n * @defaultValue `min ?? max ?? 0`\n */\n defaultKeyboardValue?: UseStateInitializer<number>;\n\n /**\n * NOTE: This isn't actually supported yet\n *\n * @defaultValue `1`\n */\n step?: number;\n\n /** @see {@link SpinButtonCharacterValueMap} */\n mappings?: SpinButtonCharacterValueMap;\n\n /**\n * Used to provide an `aria-valuenow` string for a specific value in the\n * `SpinButton`.\n *\n * @defaultValue `(value) => value === null ? \"No value selected\" : undefined`\n */\n getValueText?: GetSpinButtonValueText;\n\n getTextContent?: GetSpinButtonTextContent;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface ProvidedSpinButtonProps<E extends HTMLElement = HTMLDivElement>\n extends Required<SpinButtonEventHandlers<E>>, SpinButtonAriaAttributes {\n id: string;\n ref: Ref<E>;\n role: \"spinbutton\";\n inputMode: \"numeric\";\n spellCheck: boolean;\n autoCapitalize: \"none\";\n autoCorrect: \"off\";\n tabIndex: number | undefined;\n contentEditable: boolean | undefined;\n suppressContentEditableWarning: boolean;\n}\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonImplementation<\n E extends HTMLElement = HTMLDivElement,\n> {\n value: SpinButtonValue;\n setValue: (value: SpinButtonValue) => void;\n spinButtonRef: RefObject<E | null>;\n spinButtonProps: Readonly<ProvidedSpinButtonProps<E>>;\n}\n"],"names":[],"mappings":"AAkZA;;CAEC,GACD,WAOC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type TableSectionConfiguration, type TableStickySectionConfiguration } from "./types.js";
|
|
3
3
|
/** @since 6.0.0 */
|
|
4
4
|
export interface StickyTableSectionProps extends HTMLAttributes<HTMLTableSectionElement>, TableStickySectionConfiguration, TableSectionConfiguration {
|
|
5
|
+
ref?: Ref<HTMLTableSectionElement>;
|
|
5
6
|
type: "header" | "footer";
|
|
6
7
|
/**
|
|
7
8
|
* An optional className to use when the sticky section is covering other rows
|
|
@@ -22,4 +23,4 @@ export interface StickyTableSectionProps extends HTMLAttributes<HTMLTableSection
|
|
|
22
23
|
* @see {@link https://react-md.dev/components/table#sticky-tables | Sticky Table Demos}
|
|
23
24
|
* @since 6.0.0
|
|
24
25
|
*/
|
|
25
|
-
export declare
|
|
26
|
+
export declare function StickyTableSection(props: StickyTableSectionProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { TableConfigProvider } from "./TableConfigurationProvider.js";
|
|
5
4
|
import { tableFooter } from "./tableFooterStyles.js";
|
|
6
5
|
import { tableHeader } from "./tableHeaderStyles.js";
|
|
@@ -16,8 +15,8 @@ import { useTableSectionConfig } from "./useTableSectionConfig.js";
|
|
|
16
15
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
17
16
|
* @see {@link https://react-md.dev/components/table#sticky-tables | Sticky Table Demos}
|
|
18
17
|
* @since 6.0.0
|
|
19
|
-
*/ export
|
|
20
|
-
const { type, className, hoverable, lineWrap, children, stickyOptions, isStickyActive, disableStickyStyles = false, stickyActiveClassName, ...remaining } = props;
|
|
18
|
+
*/ export function StickyTableSection(props) {
|
|
19
|
+
const { ref, type, className, hoverable, lineWrap, children, stickyOptions, isStickyActive, disableStickyStyles = false, stickyActiveClassName, ...remaining } = props;
|
|
21
20
|
const isHeader = type === "header";
|
|
22
21
|
const Section = isHeader ? "thead" : "tfoot";
|
|
23
22
|
const styles = isHeader ? tableHeader : tableFooter;
|
|
@@ -53,6 +52,6 @@ import { useTableSectionConfig } from "./useTableSectionConfig.js";
|
|
|
53
52
|
isHeader && tbody
|
|
54
53
|
]
|
|
55
54
|
});
|
|
56
|
-
}
|
|
55
|
+
}
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=StickyTableSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/StickyTableSection.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/table/StickyTableSection.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { TableConfigProvider } from \"./TableConfigurationProvider.js\";\nimport { tableFooter } from \"./tableFooterStyles.js\";\nimport { tableHeader } from \"./tableHeaderStyles.js\";\nimport {\n type TableSectionConfiguration,\n type TableStickySectionConfiguration,\n} from \"./types.js\";\nimport { useStickyTableSection } from \"./useStickyTableSection.js\";\nimport { useTableSectionConfig } from \"./useTableSectionConfig.js\";\n\n/** @since 6.0.0 */\nexport interface StickyTableSectionProps\n extends\n HTMLAttributes<HTMLTableSectionElement>,\n TableStickySectionConfiguration,\n TableSectionConfiguration {\n ref?: Ref<HTMLTableSectionElement>;\n\n type: \"header\" | \"footer\";\n\n /**\n * An optional className to use when the sticky section is covering other rows\n * (`active`). When this is defined, the default\n * `rmd-thead--sticky-active`/`rmd-tfoot--sticky-active` will no longer be\n * applied.\n */\n stickyActiveClassName?: string;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to render a sticky `<thead>`/`<tfoot>` that\n * dynamically applies styles whenever the `<thead>`/`<tfoot>` are covering\n * content in the table.\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n * @see {@link https://react-md.dev/components/table#sticky-tables | Sticky Table Demos}\n * @since 6.0.0\n */\nexport function StickyTableSection(\n props: StickyTableSectionProps\n): ReactElement {\n const {\n ref,\n type,\n className,\n hoverable,\n lineWrap,\n children,\n stickyOptions,\n isStickyActive,\n disableStickyStyles = false,\n stickyActiveClassName,\n ...remaining\n } = props;\n\n const isHeader = type === \"header\";\n const Section = isHeader ? \"thead\" : \"tfoot\";\n const styles = isHeader ? tableHeader : tableFooter;\n const { tbody, sectionRef, stickyActive } = useStickyTableSection({\n ref,\n type,\n stickyOptions,\n isStickyActive,\n disableStickyStyles,\n stickyActiveClassName,\n });\n const config = useTableSectionConfig({\n type,\n lineWrap,\n hoverable,\n });\n\n return (\n <TableConfigProvider value={config}>\n {!isHeader && tbody}\n <Section\n {...remaining}\n ref={sectionRef}\n className={styles({\n className,\n dense: config.dense,\n sticky: true,\n stickyActive,\n stickyActiveClassName,\n })}\n >\n {children}\n </Section>\n {isHeader && tbody}\n </TableConfigProvider>\n );\n}\n"],"names":["TableConfigProvider","tableFooter","tableHeader","useStickyTableSection","useTableSectionConfig","StickyTableSection","props","ref","type","className","hoverable","lineWrap","children","stickyOptions","isStickyActive","disableStickyStyles","stickyActiveClassName","remaining","isHeader","Section","styles","tbody","sectionRef","stickyActive","config","value","dense","sticky"],"mappings":"AAAA;;AAIA,SAASA,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,WAAW,QAAQ,yBAAyB;AAKrD,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASC,qBAAqB,QAAQ,6BAA6B;AAqBnE;;;;;;;;;;CAUC,GACD,OAAO,SAASC,mBACdC,KAA8B;IAE9B,MAAM,EACJC,GAAG,EACHC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,sBAAsB,KAAK,EAC3BC,qBAAqB,EACrB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,WAAWV,SAAS;IAC1B,MAAMW,UAAUD,WAAW,UAAU;IACrC,MAAME,SAASF,WAAWhB,cAAcD;IACxC,MAAM,EAAEoB,KAAK,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGpB,sBAAsB;QAChEI;QACAC;QACAK;QACAC;QACAC;QACAC;IACF;IACA,MAAMQ,SAASpB,sBAAsB;QACnCI;QACAG;QACAD;IACF;IAEA,qBACE,MAACV;QAAoByB,OAAOD;;YACzB,CAACN,YAAYG;0BACd,KAACF;gBACE,GAAGF,SAAS;gBACbV,KAAKe;gBACLb,WAAWW,OAAO;oBAChBX;oBACAiB,OAAOF,OAAOE,KAAK;oBACnBC,QAAQ;oBACRJ;oBACAP;gBACF;0BAECJ;;YAEFM,YAAYG;;;AAGnB"}
|
package/dist/table/Table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TableHTMLAttributes } from "react";
|
|
1
|
+
import { type ReactElement, type Ref, type TableHTMLAttributes } from "react";
|
|
2
2
|
import { type TableConfiguration } from "./types.js";
|
|
3
3
|
declare module "react" {
|
|
4
4
|
interface CSSProperties {
|
|
@@ -20,6 +20,7 @@ declare module "react" {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export interface TableProps extends TableHTMLAttributes<HTMLTableElement>, TableConfiguration {
|
|
23
|
+
ref?: Ref<HTMLTableElement>;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* **Client Component**
|
|
@@ -70,4 +71,4 @@ export interface TableProps extends TableHTMLAttributes<HTMLTableElement>, Table
|
|
|
70
71
|
*
|
|
71
72
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
72
73
|
*/
|
|
73
|
-
export declare
|
|
74
|
+
export declare function Table(props: TableProps): ReactElement;
|
package/dist/table/Table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { TableConfigProvider } from "./TableConfigurationProvider.js";
|
|
5
5
|
import { table } from "./tableStyles.js";
|
|
6
6
|
/**
|
|
@@ -51,8 +51,8 @@ import { table } from "./tableStyles.js";
|
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
54
|
-
*/ export
|
|
55
|
-
const { className, children, dense = false, hAlign = "left", vAlign = "middle", lineWrap = false, fullWidth = false, disableHover = false, disableBorders = false, ...remaining } = props;
|
|
54
|
+
*/ export function Table(props) {
|
|
55
|
+
const { ref, className, children, dense = false, hAlign = "left", vAlign = "middle", lineWrap = false, fullWidth = false, disableHover = false, disableBorders = false, ...remaining } = props;
|
|
56
56
|
const configuration = useMemo(()=>({
|
|
57
57
|
dense,
|
|
58
58
|
header: false,
|
|
@@ -82,6 +82,6 @@ import { table } from "./tableStyles.js";
|
|
|
82
82
|
children: children
|
|
83
83
|
})
|
|
84
84
|
});
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
|
|
87
87
|
//# sourceMappingURL=Table.js.map
|
package/dist/table/Table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/Table.tsx"],"sourcesContent":["\"use client\";\n\nimport { type TableHTMLAttributes
|
|
1
|
+
{"version":3,"sources":["../../src/table/Table.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type Ref,\n type TableHTMLAttributes,\n useMemo,\n} from \"react\";\n\nimport { TableConfigProvider } from \"./TableConfigurationProvider.js\";\nimport { table } from \"./tableStyles.js\";\nimport { type TableConfigContext, type TableConfiguration } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-table-background-color\"?: string;\n \"--rmd-table-border-size\"?: string | number;\n \"--rmd-table-border-color\"?: string;\n \"--rmd-table-header-background-color\"?: string;\n \"--rmd-table-cell-color\"?: string;\n \"--rmd-table-cell-height\"?: string | number;\n \"--rmd-table-cell-horizontal-padding\"?: string | number;\n \"--rmd-table-cell-vertical-padding\"?: string | number;\n \"--rmd-table-header-cell-height\"?: string | number;\n \"--rmd-table-hover-color\"?: string;\n \"--rmd-table-selected-color\"?: string;\n \"--rmd-table-sticky-cell\"?: string | number;\n \"--rmd-table-sticky-header\"?: string | number;\n \"--rmd-table-sticky-footer\"?: string | number;\n \"--rmd-table-sticky-background-color\"?: string;\n }\n}\n\nexport interface TableProps\n extends TableHTMLAttributes<HTMLTableElement>, TableConfiguration {\n ref?: Ref<HTMLTableElement>;\n}\n\n/**\n * **Client Component**\n *\n * @example Responsive Example\n * ```tsx\n * import { Table } from \"@react-md/core/table/Table\";\n * import { TableBody } from \"@react-md/core/table/TableBody\";\n * import { TableCell } from \"@react-md/core/table/TableCell\";\n * import { TableContainer } from \"@react-md/core/table/TableContainer\";\n * import { TableHeader } from \"@react-md/core/table/TableHeader\";\n * import { TableRow } from \"@react-md/core/table/TableRow\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCell>Header 1</TableCell>\n * <TableCell>Header 2</TableCell>\n * <TableCell>Header 3</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Row 1 Cell 1</TableCell>\n * <TableCell>Row 1 Cell 2</TableCell>\n * <TableCell>Row 1 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 2 Cell 1</TableCell>\n * <TableCell>Row 2 Cell 2</TableCell>\n * <TableCell>Row 2 Cell 3</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell>Row 3 Cell 1</TableCell>\n * <TableCell>Row 3 Cell 2</TableCell>\n * <TableCell>Row 3 Cell 3</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n */\nexport function Table(props: TableProps): ReactElement {\n const {\n ref,\n className,\n children,\n dense = false,\n hAlign = \"left\",\n vAlign = \"middle\",\n lineWrap = false,\n fullWidth = false,\n disableHover = false,\n disableBorders = false,\n ...remaining\n } = props;\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n dense,\n header: false,\n hAlign,\n vAlign,\n lineWrap,\n disableHover,\n disableBorders,\n }),\n [dense, hAlign, vAlign, lineWrap, disableHover, disableBorders]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <table\n {...remaining}\n ref={ref}\n className={table({ dense, fullWidth, className })}\n >\n {children}\n </table>\n </TableConfigProvider>\n );\n}\n"],"names":["useMemo","TableConfigProvider","table","Table","props","ref","className","children","dense","hAlign","vAlign","lineWrap","fullWidth","disableHover","disableBorders","remaining","configuration","header","value"],"mappings":"AAAA;;AAEA,SAIEA,OAAO,QACF,QAAQ;AAEf,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,KAAK,QAAQ,mBAAmB;AA4BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDC,GACD,OAAO,SAASC,MAAMC,KAAiB;IACrC,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,QAAQ,EACRC,QAAQ,KAAK,EACbC,SAAS,MAAM,EACfC,SAAS,QAAQ,EACjBC,WAAW,KAAK,EAChBC,YAAY,KAAK,EACjBC,eAAe,KAAK,EACpBC,iBAAiB,KAAK,EACtB,GAAGC,WACJ,GAAGX;IAEJ,MAAMY,gBAAgBhB,QACpB,IAAO,CAAA;YACLQ;YACAS,QAAQ;YACRR;YACAC;YACAC;YACAE;YACAC;QACF,CAAA,GACA;QAACN;QAAOC;QAAQC;QAAQC;QAAUE;QAAcC;KAAe;IAGjE,qBACE,KAACb;QAAoBiB,OAAOF;kBAC1B,cAAA,KAACd;YACE,GAAGa,SAAS;YACbV,KAAKA;YACLC,WAAWJ,MAAM;gBAAEM;gBAAOI;gBAAWN;YAAU;sBAE9CC;;;AAIT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type TableConfig } from "./types.js";
|
|
3
3
|
export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement>, Omit<TableConfig, "header"> {
|
|
4
|
+
ref?: Ref<HTMLTableSectionElement>;
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* **Client Component**
|
|
@@ -10,4 +11,4 @@ export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement>,
|
|
|
10
11
|
*
|
|
11
12
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
12
13
|
*/
|
|
13
|
-
export declare
|
|
14
|
+
export declare function TableBody(props: TableBodyProps): ReactElement;
|
package/dist/table/TableBody.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cnb } from "cnbuilder";
|
|
4
|
-
import {
|
|
4
|
+
import { useMemo } from "react";
|
|
5
5
|
import { TableConfigProvider, useTableConfig } from "./TableConfigurationProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* **Client Component**
|
|
@@ -10,8 +10,8 @@ import { TableConfigProvider, useTableConfig } from "./TableConfigurationProvide
|
|
|
10
10
|
* `TableCell` components with additional styling behavior.
|
|
11
11
|
*
|
|
12
12
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
13
|
-
*/ export
|
|
14
|
-
const { className, children, hAlign: propHAlign, vAlign: propVAlign, lineWrap: propLineWrap, disableHover: propDisableHover, disableBorders: propDisableBorders, ...remaining } = props;
|
|
13
|
+
*/ export function TableBody(props) {
|
|
14
|
+
const { ref, className, children, hAlign: propHAlign, vAlign: propVAlign, lineWrap: propLineWrap, disableHover: propDisableHover, disableBorders: propDisableBorders, ...remaining } = props;
|
|
15
15
|
// update the table configuration with the custom overrides for the `<thead>`
|
|
16
16
|
const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } = useTableConfig({
|
|
17
17
|
hAlign: propHAlign,
|
|
@@ -45,6 +45,6 @@ import { TableConfigProvider, useTableConfig } from "./TableConfigurationProvide
|
|
|
45
45
|
children: children
|
|
46
46
|
})
|
|
47
47
|
});
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
|
|
50
50
|
//# sourceMappingURL=TableBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/TableBody.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/table/TableBody.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n useMemo,\n} from \"react\";\n\nimport {\n TableConfigProvider,\n useTableConfig,\n} from \"./TableConfigurationProvider.js\";\nimport { type TableConfig, type TableConfigContext } from \"./types.js\";\n\nexport interface TableBodyProps\n extends HTMLAttributes<HTMLTableSectionElement>, Omit<TableConfig, \"header\"> {\n ref?: Ref<HTMLTableSectionElement>;\n}\n\n/**\n * **Client Component**\n *\n * Creates a `<tbody>` element that also allows for overriding all the child\n * `TableCell` components with additional styling behavior.\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n */\nexport function TableBody(props: TableBodyProps): ReactElement {\n const {\n ref,\n className,\n children,\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n ...remaining\n } = props;\n\n // update the table configuration with the custom overrides for the `<thead>`\n const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } =\n useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propLineWrap,\n disableHover: propDisableHover,\n disableBorders: propDisableBorders,\n });\n\n const configuration = useMemo<TableConfigContext>(\n () => ({\n header: false,\n dense,\n hAlign,\n vAlign,\n lineWrap,\n disableBorders,\n disableHover,\n }),\n [dense, hAlign, vAlign, lineWrap, disableBorders, disableHover]\n );\n\n return (\n <TableConfigProvider value={configuration}>\n <tbody {...remaining} ref={ref} className={cnb(\"rmd-tbody\", className)}>\n {children}\n </tbody>\n </TableConfigProvider>\n );\n}\n"],"names":["cnb","useMemo","TableConfigProvider","useTableConfig","TableBody","props","ref","className","children","hAlign","propHAlign","vAlign","propVAlign","lineWrap","propLineWrap","disableHover","propDisableHover","disableBorders","propDisableBorders","remaining","dense","configuration","header","value","tbody"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAIEC,OAAO,QACF,QAAQ;AAEf,SACEC,mBAAmB,EACnBC,cAAc,QACT,kCAAkC;AAQzC;;;;;;;CAOC,GACD,OAAO,SAASC,UAAUC,KAAqB;IAC7C,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,QAAQ,EACRC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,UAAUC,YAAY,EACtBC,cAAcC,gBAAgB,EAC9BC,gBAAgBC,kBAAkB,EAClC,GAAGC,WACJ,GAAGd;IAEJ,6EAA6E;IAC7E,MAAM,EAAEe,KAAK,EAAEX,MAAM,EAAEE,MAAM,EAAEE,QAAQ,EAAEE,YAAY,EAAEE,cAAc,EAAE,GACrEd,eAAe;QACbM,QAAQC;QACRC,QAAQC;QACRC,UAAUC;QACVC,cAAcC;QACdC,gBAAgBC;IAClB;IAEF,MAAMG,gBAAgBpB,QACpB,IAAO,CAAA;YACLqB,QAAQ;YACRF;YACAX;YACAE;YACAE;YACAI;YACAF;QACF,CAAA,GACA;QAACK;QAAOX;QAAQE;QAAQE;QAAUI;QAAgBF;KAAa;IAGjE,qBACE,KAACb;QAAoBqB,OAAOF;kBAC1B,cAAA,KAACG;YAAO,GAAGL,SAAS;YAAEb,KAAKA;YAAKC,WAAWP,IAAI,aAAaO;sBACzDC;;;AAIT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type ReactNode, type TdHTMLAttributes, type ThHTMLAttributes } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type ReactNode, type Ref, type TdHTMLAttributes, type ThHTMLAttributes } from "react";
|
|
2
2
|
import { type PropsWithRef } from "../types.js";
|
|
3
3
|
import { type TableCellContentsIconRotatorProps } from "./TableCellContent.js";
|
|
4
4
|
import { type SortOrder, type TableCellConfig } from "./types.js";
|
|
@@ -44,6 +44,7 @@ export interface TableCellOptions extends TableCellConfig {
|
|
|
44
44
|
* @since 6.0.0 Removed `disablePadding` in favor of `padding`.
|
|
45
45
|
*/
|
|
46
46
|
export interface TableCellProps extends TableCellAttributes, TableCellOptions {
|
|
47
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
47
48
|
/**
|
|
48
49
|
* If you want to apply a sort icon for a header cell, set this prop to either
|
|
49
50
|
* `"ascending"` or `"descending"`. When you change the sort order, this prop
|
|
@@ -179,4 +180,4 @@ export interface TableCellProps extends TableCellAttributes, TableCellOptions {
|
|
|
179
180
|
*
|
|
180
181
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
181
182
|
*/
|
|
182
|
-
export declare
|
|
183
|
+
export declare function TableCell(props: TableCellProps): ReactElement;
|
package/dist/table/TableCell.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { getIcon } from "../icon/config.js";
|
|
5
4
|
import { TableCellContent } from "./TableCellContent.js";
|
|
6
5
|
import { useTableConfig } from "./TableConfigurationProvider.js";
|
|
@@ -18,8 +17,8 @@ import { tableCell } from "./tableCellStyles.js";
|
|
|
18
17
|
* readers.
|
|
19
18
|
*
|
|
20
19
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
21
|
-
*/ export
|
|
22
|
-
const { "aria-sort": sortOrder, className, grow = false, scope: propScope, hAlign: propHAlign, vAlign: propVAlign, header: propHeader, lineWrap: propDisableLineWrap, inputToggle, children, beforeChildren, afterChildren, sticky, sortIcon: propSortIcon, sortIconAfter = false, sortIconRotated, iconRotatorProps, padding = "horizontal", contentProps, ...remaining } = props;
|
|
20
|
+
*/ export function TableCell(props) {
|
|
21
|
+
const { ref, "aria-sort": sortOrder, className, grow = false, scope: propScope, hAlign: propHAlign, vAlign: propVAlign, header: propHeader, lineWrap: propDisableLineWrap, inputToggle, children, beforeChildren, afterChildren, sticky, sortIcon: propSortIcon, sortIconAfter = false, sortIconRotated, iconRotatorProps, padding = "horizontal", contentProps, ...remaining } = props;
|
|
23
22
|
const sortIcon = getIcon("sort", propSortIcon);
|
|
24
23
|
// Note: unlike the other usages of `useTableConfig`, the `propHeader`
|
|
25
24
|
// is not provided. This is so that `TableCheckbox` components can still
|
|
@@ -68,6 +67,6 @@ import { tableCell } from "./tableCellStyles.js";
|
|
|
68
67
|
afterChildren
|
|
69
68
|
]
|
|
70
69
|
});
|
|
71
|
-
}
|
|
70
|
+
}
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=TableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/TableCell.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type ReactNode,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport {\n TableCellContent,\n type TableCellContentsIconRotatorProps,\n} from \"./TableCellContent.js\";\nimport { useTableConfig } from \"./TableConfigurationProvider.js\";\nimport { tableCell } from \"./tableCellStyles.js\";\nimport { type SortOrder, type TableCellConfig } from \"./types.js\";\n\nexport type TableCellAttributes = Omit<\n | TdHTMLAttributes<HTMLTableCellElement>\n | ThHTMLAttributes<HTMLTableCellElement>,\n \"scope\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface TableCellOptions extends TableCellConfig {\n /**\n * This is a bit of a \"weird\" prop since all it does is apply `width: 100%` to\n * this cell. This will make this specific cell fill the remaining width of\n * the table (if there is any). If no cells have this prop enabled and the\n * `fullWidth` table configuration is enabled, all cells will have an\n * equal-sized width.\n *\n * @defaultValue `false`\n */\n grow?: boolean;\n\n /**\n * This prop is only valid when the `header` prop is enabled or the\n * `TableCell` is a child of the `TableHeader` component. This will generally\n * be used with a value of `\"row\"` if you have table headers that are at the\n * start of each row instead of at the top of the table.\n *\n * @defaultValue `\"col\"`\n */\n scope?: \"row\" | \"col\" | \"rowgroup\" | \"colgroup\";\n\n /**\n *\n * @defaultValue `false`\n * @since 6.0.0 This prop is only a boolean.\n */\n sticky?: boolean;\n\n /**\n * @internal\n * @defaultValue `false`\n */\n inputToggle?: boolean;\n}\n\n/**\n * @since 6.0.0 Removed the `colSpan=\"100%\"` support since `colSpan`\n * really only supports numbers.\n * @since 6.0.0 Removed `disablePadding` in favor of `padding`.\n */\nexport interface TableCellProps extends TableCellAttributes, TableCellOptions {\n /**\n * If you want to apply a sort icon for a header cell, set this prop to either\n * `\"ascending\"` or `\"descending\"`. When you change the sort order, this prop\n * should change as well which will cause the sort icon to rotate. The default\n * behavior is to have the icon facing upwards and not-rotated when\n * `\"ascending\"`, otherwise it will rotate downwards when `\"descending\"`.\n *\n * If this prop is set to `\"none\"`, the cell will render the clickable button\n * in the children, just without the sort icon. This is so that the sort\n * behavior can still be toggled for keyboard users and will be tab-focusable.\n *\n * @see {@link beforeChildren}\n * @see {@link afterChildren}\n */\n \"aria-sort\"?: SortOrder;\n\n /**\n * An optional sort icon to use. This will be defaulted to the configured sort\n * icon from the `@react-md/core` package. If you do not want the default\n * implementation for the sort icon behavior from `react-md`, you can set this\n * prop to `null`.\n */\n sortIcon?: ReactNode;\n\n /**\n * Boolean if the sort icon should appear after the children in the cell\n * instead of before.\n */\n sortIconAfter?: boolean;\n\n /**\n * Boolean if the sort icon should be rotated instead of the default\n * direction. When this is `undefined`, it will only be `true` when the\n * `\"aria-sort\"` prop is set to `\"descending\"`. If this is not `undefined`,\n * its boolean value will always be used.\n */\n sortIconRotated?: boolean;\n\n /**\n * @defaultValue `\"horizontal\"`\n */\n padding?: \"horizontal\" | \"vertical\" | \"none\";\n\n /**\n * This can be used to apply styling or any other props to the\n * `UnstyledButton` that surrounds the `children` when the `\"aria-sort\"` prop\n * has been provided.\n *\n * @since 6.0.0\n */\n contentProps?: PropsWithRef<ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Any additional props to pass to the `IconRotator` when the `aria-sort` prop\n * has been provided.\n *\n * @since 6.0.0\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @see {@link afterChildren} for an example.\n * @since 6.0.0\n */\n beforeChildren?: ReactNode;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Dialog } from \"@react-md/core/dialog/Dialog\";\n * import { TableCell } from \"@react-md/core/table/TableCell\";\n * import { type SortOrder } from \"@react-md/core/table/types\";\n * import MoreVertIcon from \"@react-md/material-icons/MoreVertIcon\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * interface Props {\n * setSort(sort: string): void;\n * sortKey: string;\n * sortOrder: SortOrder;\n * }\n *\n * function Example({ sortKey, sortOrder, setSort }: Props): ReactElement {\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <>\n * <TableCell\n * aria-sort={sortKey === \"example\" ? sortOrder : \"none\"}\n * onClick={() => setSort(\"example\")}\n * afterChildren={\n * <Button\n * aria-label=\"Options\"\n * buttonType=\"icon\"\n * onClick={() => {\n * setVisible(true)\n * }}\n * >\n * <MoreVertIcon />\n * </Button>\n * }\n * >\n * Example content\n * </TableCell>\n * <Dialog\n * aria-label=\"Options\"\n * visible={visible}\n * onRequestClose={() => setVisible(false)}\n * >\n * Pretend Content...\n * </Dialog>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\n afterChildren?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Creates a `<th>` or `<td>` cell with sensible styled defaults. You can create\n * a `<th>` element by enabling the `header` prop OR having a `TableCell` as a\n * child of the `TableHeader` component.\n *\n * Note: If you have a checkbox/radio column in the `TableHeader` without any\n * labels, you will need to manually set the `header={false}` prop for that cell\n * since it is invalid to have a `<th>` without any readable content for screen\n * readers.\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n */\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n function TableCell(props, ref) {\n const {\n \"aria-sort\": sortOrder,\n className,\n grow = false,\n scope: propScope,\n hAlign: propHAlign,\n vAlign: propVAlign,\n header: propHeader,\n lineWrap: propDisableLineWrap,\n inputToggle,\n children,\n beforeChildren,\n afterChildren,\n sticky,\n sortIcon: propSortIcon,\n sortIconAfter = false,\n sortIconRotated,\n iconRotatorProps,\n padding = \"horizontal\",\n contentProps,\n ...remaining\n } = props;\n\n const sortIcon = getIcon(\"sort\", propSortIcon);\n\n // Note: unlike the other usages of `useTableConfig`, the `propHeader`\n // is not provided. This is so that `TableCheckbox` components can still\n // be a sticky header without being rendered as a `<th>`. This also makes\n // it so the scope can be defaulted to `col` or `row` automatically.\n const {\n header: inheritedHeader,\n hAlign,\n vAlign,\n lineWrap,\n } = useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propDisableLineWrap,\n });\n const header = propHeader ?? inheritedHeader;\n\n let scope = propScope;\n if (!scope && header) {\n scope = !inheritedHeader && propHeader ? \"row\" : \"col\";\n }\n\n const Component = header ? \"th\" : \"td\";\n return (\n <Component\n {...remaining}\n ref={ref}\n aria-sort={sortOrder === \"none\" ? undefined : sortOrder}\n className={tableCell({\n className,\n grow,\n header,\n sticky,\n inputToggle,\n hAlign,\n vAlign,\n lineWrap: !sortOrder && lineWrap,\n padding: sortIcon && sortOrder ? \"none\" : padding,\n isInTableHeader: inheritedHeader,\n })}\n scope={scope}\n >\n {beforeChildren}\n <TableCellContent\n {...contentProps}\n icon={sortIcon}\n iconAfter={sortIconAfter}\n iconRotatorProps={iconRotatorProps}\n sortOrder={sortOrder}\n hAlign={hAlign}\n rotated={sortIconRotated}\n >\n {children}\n </TableCellContent>\n {afterChildren}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","getIcon","TableCellContent","useTableConfig","tableCell","TableCell","props","ref","sortOrder","className","grow","scope","propScope","hAlign","propHAlign","vAlign","propVAlign","header","propHeader","lineWrap","propDisableLineWrap","inputToggle","children","beforeChildren","afterChildren","sticky","sortIcon","propSortIcon","sortIconAfter","sortIconRotated","iconRotatorProps","padding","contentProps","remaining","inheritedHeader","Component","aria-sort","undefined","isInTableHeader","icon","iconAfter","rotated"],"mappings":"AAAA;;AAEA,SAKEA,UAAU,QACL,QAAQ;AAEf,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SACEC,gBAAgB,QAEX,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,SAAS,QAAQ,uBAAuB;AAwLjD;;;;;;;;;;;;;CAaC,GACD,OAAO,MAAMC,0BAAYL,WACvB,SAASK,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJ,aAAaC,SAAS,EACtBC,SAAS,EACTC,OAAO,KAAK,EACZC,OAAOC,SAAS,EAChBC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,UAAUC,mBAAmB,EAC7BC,WAAW,EACXC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,UAAUC,YAAY,EACtBC,gBAAgB,KAAK,EACrBC,eAAe,EACfC,gBAAgB,EAChBC,UAAU,YAAY,EACtBC,YAAY,EACZ,GAAGC,WACJ,GAAG3B;IAEJ,MAAMoB,WAAWzB,QAAQ,QAAQ0B;IAEjC,sEAAsE;IACtE,wEAAwE;IACxE,yEAAyE;IACzE,oEAAoE;IACpE,MAAM,EACJV,QAAQiB,eAAe,EACvBrB,MAAM,EACNE,MAAM,EACNI,QAAQ,EACT,GAAGhB,eAAe;QACjBU,QAAQC;QACRC,QAAQC;QACRG,UAAUC;IACZ;IACA,MAAMH,SAASC,cAAcgB;IAE7B,IAAIvB,QAAQC;IACZ,IAAI,CAACD,SAASM,QAAQ;QACpBN,QAAQ,CAACuB,mBAAmBhB,aAAa,QAAQ;IACnD;IAEA,MAAMiB,YAAYlB,SAAS,OAAO;IAClC,qBACE,MAACkB;QACE,GAAGF,SAAS;QACb1B,KAAKA;QACL6B,aAAW5B,cAAc,SAAS6B,YAAY7B;QAC9CC,WAAWL,UAAU;YACnBK;YACAC;YACAO;YACAQ;YACAJ;YACAR;YACAE;YACAI,UAAU,CAACX,aAAaW;YACxBY,SAASL,YAAYlB,YAAY,SAASuB;YAC1CO,iBAAiBJ;QACnB;QACAvB,OAAOA;;YAENY;0BACD,KAACrB;gBACE,GAAG8B,YAAY;gBAChBO,MAAMb;gBACNc,WAAWZ;gBACXE,kBAAkBA;gBAClBtB,WAAWA;gBACXK,QAAQA;gBACR4B,SAASZ;0BAERP;;YAEFE;;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/table/TableCell.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\n\nimport { getIcon } from \"../icon/config.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport {\n TableCellContent,\n type TableCellContentsIconRotatorProps,\n} from \"./TableCellContent.js\";\nimport { useTableConfig } from \"./TableConfigurationProvider.js\";\nimport { tableCell } from \"./tableCellStyles.js\";\nimport { type SortOrder, type TableCellConfig } from \"./types.js\";\n\nexport type TableCellAttributes = Omit<\n | TdHTMLAttributes<HTMLTableCellElement>\n | ThHTMLAttributes<HTMLTableCellElement>,\n \"scope\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface TableCellOptions extends TableCellConfig {\n /**\n * This is a bit of a \"weird\" prop since all it does is apply `width: 100%` to\n * this cell. This will make this specific cell fill the remaining width of\n * the table (if there is any). If no cells have this prop enabled and the\n * `fullWidth` table configuration is enabled, all cells will have an\n * equal-sized width.\n *\n * @defaultValue `false`\n */\n grow?: boolean;\n\n /**\n * This prop is only valid when the `header` prop is enabled or the\n * `TableCell` is a child of the `TableHeader` component. This will generally\n * be used with a value of `\"row\"` if you have table headers that are at the\n * start of each row instead of at the top of the table.\n *\n * @defaultValue `\"col\"`\n */\n scope?: \"row\" | \"col\" | \"rowgroup\" | \"colgroup\";\n\n /**\n *\n * @defaultValue `false`\n * @since 6.0.0 This prop is only a boolean.\n */\n sticky?: boolean;\n\n /**\n * @internal\n * @defaultValue `false`\n */\n inputToggle?: boolean;\n}\n\n/**\n * @since 6.0.0 Removed the `colSpan=\"100%\"` support since `colSpan`\n * really only supports numbers.\n * @since 6.0.0 Removed `disablePadding` in favor of `padding`.\n */\nexport interface TableCellProps extends TableCellAttributes, TableCellOptions {\n ref?: Ref<HTMLTableCellElement>;\n\n /**\n * If you want to apply a sort icon for a header cell, set this prop to either\n * `\"ascending\"` or `\"descending\"`. When you change the sort order, this prop\n * should change as well which will cause the sort icon to rotate. The default\n * behavior is to have the icon facing upwards and not-rotated when\n * `\"ascending\"`, otherwise it will rotate downwards when `\"descending\"`.\n *\n * If this prop is set to `\"none\"`, the cell will render the clickable button\n * in the children, just without the sort icon. This is so that the sort\n * behavior can still be toggled for keyboard users and will be tab-focusable.\n *\n * @see {@link beforeChildren}\n * @see {@link afterChildren}\n */\n \"aria-sort\"?: SortOrder;\n\n /**\n * An optional sort icon to use. This will be defaulted to the configured sort\n * icon from the `@react-md/core` package. If you do not want the default\n * implementation for the sort icon behavior from `react-md`, you can set this\n * prop to `null`.\n */\n sortIcon?: ReactNode;\n\n /**\n * Boolean if the sort icon should appear after the children in the cell\n * instead of before.\n */\n sortIconAfter?: boolean;\n\n /**\n * Boolean if the sort icon should be rotated instead of the default\n * direction. When this is `undefined`, it will only be `true` when the\n * `\"aria-sort\"` prop is set to `\"descending\"`. If this is not `undefined`,\n * its boolean value will always be used.\n */\n sortIconRotated?: boolean;\n\n /**\n * @defaultValue `\"horizontal\"`\n */\n padding?: \"horizontal\" | \"vertical\" | \"none\";\n\n /**\n * This can be used to apply styling or any other props to the\n * `UnstyledButton` that surrounds the `children` when the `\"aria-sort\"` prop\n * has been provided.\n *\n * @since 6.0.0\n */\n contentProps?: PropsWithRef<ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Any additional props to pass to the `IconRotator` when the `aria-sort` prop\n * has been provided.\n *\n * @since 6.0.0\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @see {@link afterChildren} for an example.\n * @since 6.0.0\n */\n beforeChildren?: ReactNode;\n\n /**\n * Since providing an `aria-sort` prop will wrap the `children` in an\n * `UnstyledButton`, you can use this prop to render another button within the\n * table cell before the main `children`.\n *\n * @example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Dialog } from \"@react-md/core/dialog/Dialog\";\n * import { TableCell } from \"@react-md/core/table/TableCell\";\n * import { type SortOrder } from \"@react-md/core/table/types\";\n * import MoreVertIcon from \"@react-md/material-icons/MoreVertIcon\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * interface Props {\n * setSort(sort: string): void;\n * sortKey: string;\n * sortOrder: SortOrder;\n * }\n *\n * function Example({ sortKey, sortOrder, setSort }: Props): ReactElement {\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <>\n * <TableCell\n * aria-sort={sortKey === \"example\" ? sortOrder : \"none\"}\n * onClick={() => setSort(\"example\")}\n * afterChildren={\n * <Button\n * aria-label=\"Options\"\n * buttonType=\"icon\"\n * onClick={() => {\n * setVisible(true)\n * }}\n * >\n * <MoreVertIcon />\n * </Button>\n * }\n * >\n * Example content\n * </TableCell>\n * <Dialog\n * aria-label=\"Options\"\n * visible={visible}\n * onRequestClose={() => setVisible(false)}\n * >\n * Pretend Content...\n * </Dialog>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\n afterChildren?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * Creates a `<th>` or `<td>` cell with sensible styled defaults. You can create\n * a `<th>` element by enabling the `header` prop OR having a `TableCell` as a\n * child of the `TableHeader` component.\n *\n * Note: If you have a checkbox/radio column in the `TableHeader` without any\n * labels, you will need to manually set the `header={false}` prop for that cell\n * since it is invalid to have a `<th>` without any readable content for screen\n * readers.\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n */\nexport function TableCell(props: TableCellProps): ReactElement {\n const {\n ref,\n \"aria-sort\": sortOrder,\n className,\n grow = false,\n scope: propScope,\n hAlign: propHAlign,\n vAlign: propVAlign,\n header: propHeader,\n lineWrap: propDisableLineWrap,\n inputToggle,\n children,\n beforeChildren,\n afterChildren,\n sticky,\n sortIcon: propSortIcon,\n sortIconAfter = false,\n sortIconRotated,\n iconRotatorProps,\n padding = \"horizontal\",\n contentProps,\n ...remaining\n } = props;\n\n const sortIcon = getIcon(\"sort\", propSortIcon);\n\n // Note: unlike the other usages of `useTableConfig`, the `propHeader`\n // is not provided. This is so that `TableCheckbox` components can still\n // be a sticky header without being rendered as a `<th>`. This also makes\n // it so the scope can be defaulted to `col` or `row` automatically.\n const {\n header: inheritedHeader,\n hAlign,\n vAlign,\n lineWrap,\n } = useTableConfig({\n hAlign: propHAlign,\n vAlign: propVAlign,\n lineWrap: propDisableLineWrap,\n });\n const header = propHeader ?? inheritedHeader;\n\n let scope = propScope;\n if (!scope && header) {\n scope = !inheritedHeader && propHeader ? \"row\" : \"col\";\n }\n\n const Component = header ? \"th\" : \"td\";\n return (\n <Component\n {...remaining}\n ref={ref}\n aria-sort={sortOrder === \"none\" ? undefined : sortOrder}\n className={tableCell({\n className,\n grow,\n header,\n sticky,\n inputToggle,\n hAlign,\n vAlign,\n lineWrap: !sortOrder && lineWrap,\n padding: sortIcon && sortOrder ? \"none\" : padding,\n isInTableHeader: inheritedHeader,\n })}\n scope={scope}\n >\n {beforeChildren}\n <TableCellContent\n {...contentProps}\n icon={sortIcon}\n iconAfter={sortIconAfter}\n iconRotatorProps={iconRotatorProps}\n sortOrder={sortOrder}\n hAlign={hAlign}\n rotated={sortIconRotated}\n >\n {children}\n </TableCellContent>\n {afterChildren}\n </Component>\n );\n}\n"],"names":["getIcon","TableCellContent","useTableConfig","tableCell","TableCell","props","ref","sortOrder","className","grow","scope","propScope","hAlign","propHAlign","vAlign","propVAlign","header","propHeader","lineWrap","propDisableLineWrap","inputToggle","children","beforeChildren","afterChildren","sticky","sortIcon","propSortIcon","sortIconAfter","sortIconRotated","iconRotatorProps","padding","contentProps","remaining","inheritedHeader","Component","aria-sort","undefined","isInTableHeader","icon","iconAfter","rotated"],"mappings":"AAAA;;AAWA,SAASA,OAAO,QAAQ,oBAAoB;AAE5C,SACEC,gBAAgB,QAEX,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,SAAS,QAAQ,uBAAuB;AA0LjD;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,UAAUC,KAAqB;IAC7C,MAAM,EACJC,GAAG,EACH,aAAaC,SAAS,EACtBC,SAAS,EACTC,OAAO,KAAK,EACZC,OAAOC,SAAS,EAChBC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,QAAQC,UAAU,EAClBC,UAAUC,mBAAmB,EAC7BC,WAAW,EACXC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,UAAUC,YAAY,EACtBC,gBAAgB,KAAK,EACrBC,eAAe,EACfC,gBAAgB,EAChBC,UAAU,YAAY,EACtBC,YAAY,EACZ,GAAGC,WACJ,GAAG3B;IAEJ,MAAMoB,WAAWzB,QAAQ,QAAQ0B;IAEjC,sEAAsE;IACtE,wEAAwE;IACxE,yEAAyE;IACzE,oEAAoE;IACpE,MAAM,EACJV,QAAQiB,eAAe,EACvBrB,MAAM,EACNE,MAAM,EACNI,QAAQ,EACT,GAAGhB,eAAe;QACjBU,QAAQC;QACRC,QAAQC;QACRG,UAAUC;IACZ;IACA,MAAMH,SAASC,cAAcgB;IAE7B,IAAIvB,QAAQC;IACZ,IAAI,CAACD,SAASM,QAAQ;QACpBN,QAAQ,CAACuB,mBAAmBhB,aAAa,QAAQ;IACnD;IAEA,MAAMiB,YAAYlB,SAAS,OAAO;IAClC,qBACE,MAACkB;QACE,GAAGF,SAAS;QACb1B,KAAKA;QACL6B,aAAW5B,cAAc,SAAS6B,YAAY7B;QAC9CC,WAAWL,UAAU;YACnBK;YACAC;YACAO;YACAQ;YACAJ;YACAR;YACAE;YACAI,UAAU,CAACX,aAAaW;YACxBY,SAASL,YAAYlB,YAAY,SAASuB;YAC1CO,iBAAiBJ;QACnB;QACAvB,OAAOA;;YAENY;0BACD,KAACrB;gBACE,GAAG8B,YAAY;gBAChBO,MAAMb;gBACNc,WAAWZ;gBACXE,kBAAkBA;gBAClBtB,WAAWA;gBACXK,QAAQA;gBACR4B,SAASZ;0BAERP;;YAEFE;;;AAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type IconRotatorProps } from "../icon/IconRotator.js";
|
|
3
3
|
import { type SortOrder, type TableCellHorizontalAlignment } from "./types.js";
|
|
4
4
|
/**
|
|
@@ -11,6 +11,7 @@ export type TableCellContentsIconRotatorProps = Omit<IconRotatorProps, "children
|
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
13
|
export interface TableCellContentProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
|
+
ref?: Ref<HTMLButtonElement>;
|
|
14
15
|
/**
|
|
15
16
|
* The current sort order for this cell. Setting this to `null` will prevent
|
|
16
17
|
* the button from being rendered.
|
|
@@ -44,4 +45,4 @@ export interface TableCellContentProps extends ButtonHTMLAttributes<HTMLButtonEl
|
|
|
44
45
|
*
|
|
45
46
|
* @internal
|
|
46
47
|
*/
|
|
47
|
-
export declare
|
|
48
|
+
export declare function TableCellContent(props: TableCellContentProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cnb } from "cnbuilder";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { ButtonUnstyled } from "../button/ButtonUnstyled.js";
|
|
5
4
|
import { IconRotator } from "../icon/IconRotator.js";
|
|
6
5
|
import { bem } from "../utils/bem.js";
|
|
@@ -12,8 +11,8 @@ const styles = bem("rmd-table-cell");
|
|
|
12
11
|
* with sort behavior within headers.
|
|
13
12
|
*
|
|
14
13
|
* @internal
|
|
15
|
-
*/ export
|
|
16
|
-
const { icon: propIcon, style, className, sortOrder, children, rotated: propRotated, hAlign = "left", iconAfter, iconRotatorProps, ...remaining } = props;
|
|
14
|
+
*/ export function TableCellContent(props) {
|
|
15
|
+
const { ref, icon: propIcon, style, className, sortOrder, children, rotated: propRotated, hAlign = "left", iconAfter, iconRotatorProps, ...remaining } = props;
|
|
17
16
|
if (!sortOrder || propIcon === null) {
|
|
18
17
|
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
19
18
|
children: children
|
|
@@ -41,6 +40,6 @@ const styles = bem("rmd-table-cell");
|
|
|
41
40
|
iconAfter && icon
|
|
42
41
|
]
|
|
43
42
|
});
|
|
44
|
-
}
|
|
43
|
+
}
|
|
45
44
|
|
|
46
45
|
//# sourceMappingURL=TableCellContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/TableCellContent.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/table/TableCellContent.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { ButtonUnstyled } from \"../button/ButtonUnstyled.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { type SortOrder, type TableCellHorizontalAlignment } from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport type TableCellContentsIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @since 6.0.0 Extends the `ButtonHTMLAttributes` so the extra props\n * can be passed to the `ButtonUnstyled`\n * @internal\n */\nexport interface TableCellContentProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * The current sort order for this cell. Setting this to `null` will prevent\n * the button from being rendered.\n */\n sortOrder?: SortOrder;\n\n /**\n * This should normally be the `getIcon(\"sort\")`\n */\n icon?: ReactNode;\n\n /** @defaultValue `false` */\n iconAfter?: boolean;\n\n /**\n * Boolean if the icon should be rotated.\n */\n rotated?: boolean;\n\n /**\n * Any additional props to pass to the `IconRotator`.\n */\n iconRotatorProps?: TableCellContentsIconRotatorProps;\n\n /**\n * @since 4.0.3\n * @see {@link TableCellHorizontalAlignment}\n */\n hAlign?: TableCellHorizontalAlignment;\n}\n\nconst styles = bem(\"rmd-table-cell\");\n\n/**\n * This is mostly an internal component since it is automatically used within\n * the `TableCell` component but this will conditionally wrap the `children`\n * within an `UnstyledButton` to make a clickable cell. This is really to help\n * with sort behavior within headers.\n *\n * @internal\n */\nexport function TableCellContent(props: TableCellContentProps): ReactElement {\n const {\n ref,\n icon: propIcon,\n style,\n className,\n sortOrder,\n children,\n rotated: propRotated,\n hAlign = \"left\",\n iconAfter,\n iconRotatorProps,\n ...remaining\n } = props;\n if (!sortOrder || propIcon === null) {\n return <>{children}</>;\n }\n\n let icon: ReactNode = null;\n if (sortOrder !== \"none\") {\n const rotated = propRotated ?? sortOrder === \"descending\";\n\n icon = (\n <IconRotator {...iconRotatorProps} rotated={rotated}>\n {propIcon}\n </IconRotator>\n );\n }\n\n return (\n <ButtonUnstyled\n {...remaining}\n ref={ref}\n style={style}\n className={cnb(\n styles(\"content\", {\n [hAlign]: hAlign !== \"left\",\n }),\n className\n )}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </ButtonUnstyled>\n );\n}\n"],"names":["cnb","ButtonUnstyled","IconRotator","bem","styles","TableCellContent","props","ref","icon","propIcon","style","className","sortOrder","children","rotated","propRotated","hAlign","iconAfter","iconRotatorProps","remaining"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAQhC,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAA+B,yBAAyB;AAC5E,SAASC,GAAG,QAAQ,kBAAkB;AAkDtC,MAAMC,SAASD,IAAI;AAEnB;;;;;;;CAOC,GACD,OAAO,SAASE,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,GAAG,EACHC,MAAMC,QAAQ,EACdC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,SAASC,WAAW,EACpBC,SAAS,MAAM,EACfC,SAAS,EACTC,gBAAgB,EAChB,GAAGC,WACJ,GAAGb;IACJ,IAAI,CAACM,aAAaH,aAAa,MAAM;QACnC,qBAAO;sBAAGI;;IACZ;IAEA,IAAIL,OAAkB;IACtB,IAAII,cAAc,QAAQ;QACxB,MAAME,UAAUC,eAAeH,cAAc;QAE7CJ,qBACE,KAACN;YAAa,GAAGgB,gBAAgB;YAAEJ,SAASA;sBACzCL;;IAGP;IAEA,qBACE,MAACR;QACE,GAAGkB,SAAS;QACbZ,KAAKA;QACLG,OAAOA;QACPC,WAAWX,IACTI,OAAO,WAAW;YAChB,CAACY,OAAO,EAAEA,WAAW;QACvB,IACAL;;YAGD,CAACM,aAAaT;YACdK;YACAI,aAAaT;;;AAGpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TdHTMLAttributes } from "react";
|
|
1
|
+
import { type ReactElement, type Ref, type TdHTMLAttributes } from "react";
|
|
2
2
|
import { type CheckboxProps } from "../form/InputToggle.js";
|
|
3
3
|
import { type PropsWithRef } from "../types.js";
|
|
4
4
|
/**
|
|
@@ -18,6 +18,7 @@ export type TableCheckboxSupportedCheckboxProps = Pick<CheckboxProps, "name" | "
|
|
|
18
18
|
* `"Toggle Row Selection"` to `"Select Row"`.
|
|
19
19
|
*/
|
|
20
20
|
export interface TableCheckboxProps extends TableCheckboxTdHTMLAttributes, TableCheckboxSupportedCheckboxProps {
|
|
21
|
+
ref?: Ref<HTMLTableCellElement>;
|
|
21
22
|
/**
|
|
22
23
|
* @defaultValue `!props["aria-labelledby"] ? "Select Row" : undefined`
|
|
23
24
|
*/
|
|
@@ -113,4 +114,4 @@ export interface TableCheckboxProps extends TableCheckboxTdHTMLAttributes, Table
|
|
|
113
114
|
* @since 6.0.0 The default `aria-label` was changed from
|
|
114
115
|
* `"Toggle Row Selection"` to `"Select Row"`.
|
|
115
116
|
*/
|
|
116
|
-
export declare
|
|
117
|
+
export declare function TableCheckbox(props: TableCheckboxProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { Checkbox } from "../form/Checkbox.js";
|
|
5
4
|
import { TableCell } from "./TableCell.js";
|
|
6
5
|
const noop = ()=>{
|
|
@@ -77,8 +76,8 @@ const noop = ()=>{
|
|
|
77
76
|
* @since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.
|
|
78
77
|
* @since 6.0.0 The default `aria-label` was changed from
|
|
79
78
|
* `"Toggle Row Selection"` to `"Select Row"`.
|
|
80
|
-
*/ export
|
|
81
|
-
const { "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = !ariaLabelledBy ? "Select Row" : undefined, "aria-controls": ariaControls, name, icon, iconProps, iconStyle, iconClassName, checkedIcon, indeterminateIcon, value, checked, onChange, defaultChecked, indeterminate, checkboxProps, onClick = noop, ...remaining } = props;
|
|
79
|
+
*/ export function TableCheckbox(props) {
|
|
80
|
+
const { ref, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = !ariaLabelledBy ? "Select Row" : undefined, "aria-controls": ariaControls, name, icon, iconProps, iconStyle, iconClassName, checkedIcon, indeterminateIcon, value, checked, onChange, defaultChecked, indeterminate, checkboxProps, onClick = noop, ...remaining } = props;
|
|
82
81
|
return /*#__PURE__*/ _jsx(TableCell, {
|
|
83
82
|
...remaining,
|
|
84
83
|
ref: ref,
|
|
@@ -107,6 +106,6 @@ const noop = ()=>{
|
|
|
107
106
|
...checkboxProps
|
|
108
107
|
})
|
|
109
108
|
});
|
|
110
|
-
}
|
|
109
|
+
}
|
|
111
110
|
|
|
112
111
|
//# sourceMappingURL=TableCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/TableCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { type
|
|
1
|
+
{"version":3,"sources":["../../src/table/TableCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, type Ref, type TdHTMLAttributes } from \"react\";\n\nimport { Checkbox } from \"../form/Checkbox.js\";\nimport { type CheckboxProps } from \"../form/InputToggle.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { TableCell } from \"./TableCell.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type TableCheckboxTdHTMLAttributes = Omit<\n TdHTMLAttributes<HTMLTableCellElement>,\n \"aria-sort\" | \"scope\" | \"onChange\"\n>;\n\n/**\n * @since 6.0.0\n */\nexport type TableCheckboxSupportedCheckboxProps = Pick<\n CheckboxProps,\n | \"name\"\n | \"value\"\n | \"icon\"\n | \"iconStyle\"\n | \"iconClassName\"\n | \"iconProps\"\n | \"checkedIcon\"\n | \"indeterminateIcon\"\n | \"checked\"\n | \"onChange\"\n | \"defaultChecked\"\n | \"indeterminate\"\n | \"aria-controls\"\n>;\n\n/**\n * @since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * @since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * @since 6.0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport interface TableCheckboxProps\n extends TableCheckboxTdHTMLAttributes, TableCheckboxSupportedCheckboxProps {\n ref?: Ref<HTMLTableCellElement>;\n\n /**\n * @defaultValue `!props[\"aria-labelledby\"] ? \"Select Row\" : undefined`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `false` */\n sticky?: boolean;\n\n /**\n * This allows you to override any props for the checkbox that are not\n * configurable as top-level props.\n *\n * @example Simple Example\n * ```tsx\n * checkboxProps={{\n * id: \"some-custom-id\",\n * ref: checkboxRef,\n * }}\n * ```\n *\n * @see {@link TableCheckboxSupportedCheckboxProps}\n * @since 6.0.0\n */\n checkboxProps?: PropsWithRef<CheckboxProps>;\n}\n\n/**\n * **Client Component**\n * The `TableCheckbox` is used to render a `Checkbox` within a `TableCell` by applying\n * some minimal styles.\n *\n * @example Simple Example\n * ```tsx\n * import { useCheckboxGroup } from \"@react-md/core/form/useCheckboxGroup\";\n * import { Table } from \"@react-md/core/table/Table\";\n * import { TableBody } from \"@react-md/core/table/TableBody\";\n * import { TableCell } from \"@react-md/core/table/TableCell\";\n * import { TableCheckbox } from \"@react-md/core/table/TableCheckbox\";\n * import { TableContainer } from \"@react-md/core/table/TableContainer\";\n * import { TableHeader } from \"@react-md/core/table/TableHeader\";\n * import { TableRow } from \"@react-md/core/table/TableRow\";\n * import { type ReactElement } from \"react\";\n *\n * const rows = [\n * { name: \"Frozen Yogurt\", type: \"Ice Cream\" },\n * { name: \"Ice cream sandwich\", type: \"Ice Cream\" },\n * { name: \"Eclair\", type: \"Pastry\" },\n * // ...other content\n * ] as const;\n *\n * function Example(): ReactElement {\n * const { getCheckboxProps, getIndeterminateProps } = useCheckboxGroup({\n * values: rows.map(({ name }) => name),\n * name: \"selected\",\n * });\n * return (\n * <TableContainer>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableCheckbox {...getIndeterminateProps()} />\n * <TableCell>Name</TableCell>\n * <TableCell>Type</TableCell>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * {rows.map(({ name, type }) => {\n * const checkboxProps = getCheckboxProps(name);\n * const { checked, onChange } = checkboxProps;\n *\n * return (\n * <TableRow\n * key={name}\n * onClick={onChange}\n * clickable\n * selected={checked}\n * >\n * <TableCheckbox {...checkboxProps} />\n * <TableCell>{name}</TableCell>\n * <TableCell hAlign=\"right\">{type}</TableCell>\n * </TableRow>\n * );\n * })}\n * </TableBody>\n * </Table>\n * </TableContainer>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n * @since 6.0.0 The `id` prop is no longer required since the checkbox's id\n * will automatically be generated as `\"checkbox\" + useId()`. Use the {@link checkboxProps}\n * to set an `id` manually for the checkbox.\n * @since 6.0.0 The `cellId` prop was removed. Use the `id` prop instead.\n * @since 6.0.0 The default `aria-label` was changed from\n * `\"Toggle Row Selection\"` to `\"Select Row\"`.\n */\nexport function TableCheckbox(props: TableCheckboxProps): ReactElement {\n const {\n ref,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = !ariaLabelledBy ? \"Select Row\" : undefined,\n \"aria-controls\": ariaControls,\n name,\n icon,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n indeterminateIcon,\n value,\n checked,\n onChange,\n defaultChecked,\n indeterminate,\n checkboxProps,\n onClick = noop,\n ...remaining\n } = props;\n\n return (\n <TableCell\n {...remaining}\n ref={ref}\n header={false}\n inputToggle\n onClick={(event) => {\n event.stopPropagation();\n onClick(event);\n }}\n >\n <Checkbox\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-controls={ariaControls}\n name={name}\n icon={icon}\n iconProps={iconProps}\n iconStyle={iconStyle}\n iconClassName={iconClassName}\n checkedIcon={checkedIcon}\n indeterminateIcon={indeterminateIcon}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n onChange={onChange}\n indeterminate={indeterminate}\n {...checkboxProps}\n />\n </TableCell>\n );\n}\n"],"names":["Checkbox","TableCell","noop","TableCheckbox","props","ref","ariaLabelledBy","ariaLabel","undefined","ariaControls","name","icon","iconProps","iconStyle","iconClassName","checkedIcon","indeterminateIcon","value","checked","onChange","defaultChecked","indeterminate","checkboxProps","onClick","remaining","header","inputToggle","event","stopPropagation","aria-label","aria-labelledby","aria-controls"],"mappings":"AAAA;;AAIA,SAASA,QAAQ,QAAQ,sBAAsB;AAG/C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAMC,OAAO;AACX,aAAa;AACf;AAoEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EACJC,GAAG,EACH,mBAAmBC,cAAc,EACjC,cAAcC,YAAY,CAACD,iBAAiB,eAAeE,SAAS,EACpE,iBAAiBC,YAAY,EAC7BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,iBAAiB,EACjBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,cAAc,EACdC,aAAa,EACbC,aAAa,EACbC,UAAUrB,IAAI,EACd,GAAGsB,WACJ,GAAGpB;IAEJ,qBACE,KAACH;QACE,GAAGuB,SAAS;QACbnB,KAAKA;QACLoB,QAAQ;QACRC,WAAW;QACXH,SAAS,CAACI;YACRA,MAAMC,eAAe;YACrBL,QAAQI;QACV;kBAEA,cAAA,KAAC3B;YACC6B,cAAYtB;YACZuB,mBAAiBxB;YACjByB,iBAAetB;YACfC,MAAMA;YACNC,MAAMA;YACNC,WAAWA;YACXC,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,mBAAmBA;YACnBC,OAAOA;YACPC,SAASA;YACTE,gBAAgBA;YAChBD,UAAUA;YACVE,eAAeA;YACd,GAAGC,aAAa;;;AAIzB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
2
|
-
export
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
|
+
export interface TableContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
}
|
|
3
5
|
/**
|
|
4
6
|
* **Client Component**
|
|
5
7
|
*
|
|
@@ -10,4 +12,4 @@ export type TableContainerProps = HTMLAttributes<HTMLDivElement>;
|
|
|
10
12
|
*
|
|
11
13
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
12
14
|
*/
|
|
13
|
-
export declare
|
|
15
|
+
export declare function TableContainer(props: TableContainerProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { useEnsuredRef } from "../useEnsuredRef.js";
|
|
5
5
|
import { TableContainerProvider } from "./TableContainerProvider.js";
|
|
6
6
|
import { tableContainer } from "./tableContainerStyles.js";
|
|
@@ -13,8 +13,8 @@ import { tableContainer } from "./tableContainerStyles.js";
|
|
|
13
13
|
* parent element of the table.
|
|
14
14
|
*
|
|
15
15
|
* @see {@link https://react-md.dev/components/table | Table Demos}
|
|
16
|
-
*/ export
|
|
17
|
-
const { className, children, ...remaining } = props;
|
|
16
|
+
*/ export function TableContainer(props) {
|
|
17
|
+
const { ref, className, children, ...remaining } = props;
|
|
18
18
|
const [nodeRef, refCallback] = useEnsuredRef(ref);
|
|
19
19
|
const value = useMemo(()=>({
|
|
20
20
|
exists: true,
|
|
@@ -33,6 +33,6 @@ import { tableContainer } from "./tableContainerStyles.js";
|
|
|
33
33
|
children: children
|
|
34
34
|
})
|
|
35
35
|
});
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
|
|
38
38
|
//# sourceMappingURL=TableContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/table/TableContainer.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/table/TableContainer.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n useMemo,\n} from \"react\";\n\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport {\n type TableContainerContext,\n TableContainerProvider,\n} from \"./TableContainerProvider.js\";\nimport { tableContainer } from \"./tableContainerStyles.js\";\n\nexport interface TableContainerProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * **Client Component**\n *\n * An extremely \"useful\" component that should be used with the `Table`\n * component if you want to make a responsive table within the page. If you\n * don't want to use this component, you can just apply `overflow: auto` to a\n * parent element of the table.\n *\n * @see {@link https://react-md.dev/components/table | Table Demos}\n */\nexport function TableContainer(props: TableContainerProps): ReactElement {\n const { ref, className, children, ...remaining } = props;\n const [nodeRef, refCallback] = useEnsuredRef(ref);\n\n const value = useMemo<TableContainerContext>(\n () => ({\n exists: true,\n containerRef: nodeRef,\n }),\n [nodeRef]\n );\n\n return (\n <TableContainerProvider value={value}>\n <div\n {...remaining}\n ref={refCallback}\n className={tableContainer({ className })}\n >\n {children}\n </div>\n </TableContainerProvider>\n );\n}\n"],"names":["useMemo","useEnsuredRef","TableContainerProvider","tableContainer","TableContainer","props","ref","className","children","remaining","nodeRef","refCallback","value","exists","containerRef","div"],"mappings":"AAAA;;AAEA,SAIEA,OAAO,QACF,QAAQ;AAEf,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAEEC,sBAAsB,QACjB,8BAA8B;AACrC,SAASC,cAAc,QAAQ,4BAA4B;AAM3D;;;;;;;;;CASC,GACD,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,GAAG,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IACnD,MAAM,CAACK,SAASC,YAAY,GAAGV,cAAcK;IAE7C,MAAMM,QAAQZ,QACZ,IAAO,CAAA;YACLa,QAAQ;YACRC,cAAcJ;QAChB,CAAA,GACA;QAACA;KAAQ;IAGX,qBACE,KAACR;QAAuBU,OAAOA;kBAC7B,cAAA,KAACG;YACE,GAAGN,SAAS;YACbH,KAAKK;YACLJ,WAAWJ,eAAe;gBAAEI;YAAU;sBAErCC;;;AAIT"}
|