@astral/ui 1.16.2 → 1.17.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/ActionCell/ActionCell.js +19 -39
- package/ActionCell/styles.js +5 -7
- package/Alert/Alert.js +11 -22
- package/Alert/styles.js +17 -20
- package/Autocomplete/Autocomplete.js +23 -34
- package/BackdropStack/hooks/useBackdropStackToggle/useBackdropStackToggle.js +11 -12
- package/BackdropStack/services/BackdropStackManager/BackdropStackManager.js +17 -19
- package/Badge/Badge.js +5 -16
- package/Badge/styled.d.ts +2 -16
- package/Badge/styled.js +26 -31
- package/Button/Button.js +10 -21
- package/Button/styles.js +16 -22
- package/ButtonBase/ButtonBase.js +7 -18
- package/ButtonBase/styles.d.ts +3 -3
- package/ButtonBase/styles.js +68 -73
- package/Checkbox/Checkbox.js +6 -17
- package/Checkbox/icons.js +8 -19
- package/Checkbox/styled.js +47 -32
- package/Chevron/Chevron.js +3 -14
- package/Chevron/styles.js +11 -18
- package/CircularProgress/CircularProgress.js +7 -18
- package/CircularProgress/CircularProgressStory.js +4 -4
- package/CircularProgress/CircularProgressStoryTemplate.js +4 -15
- package/Collapse/Collapse.js +1 -1
- package/ConfigProvider/ConfigProvider.js +7 -19
- package/ContentState/ContentState.d.ts +1 -1
- package/ContentState/ContentState.js +12 -24
- package/ContentState/styles.js +8 -7
- package/DashboardLayout/DashboardLayout.js +7 -7
- package/DashboardLayout/DashboardLayoutStory.js +5 -16
- package/DashboardLayout/DashboardLayoutStoryTemplate.js +4 -15
- package/DashboardLayout/Header/Header.js +9 -20
- package/DashboardLayout/Header/styles.js +17 -20
- package/DashboardLayout/Main/Main.js +5 -17
- package/DashboardLayout/Main/styled.js +7 -7
- package/DashboardLayout/Sidebar/Sidebar.js +13 -24
- package/DashboardLayout/Sidebar/SidebarNav/SidebarNav.js +5 -16
- package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/SidebarToggleButton.js +7 -18
- package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/styles.js +13 -11
- package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggler.js +8 -19
- package/DashboardLayout/Sidebar/SidebarToggler/styled.js +11 -12
- package/DashboardLayout/Sidebar/styles.js +16 -24
- package/DashboardLayout/styles.js +11 -9
- package/DataGrid/DataGrid.js +25 -50
- package/DataGrid/DataGridBody/DataGridBody.d.ts +2 -2
- package/DataGrid/DataGridBody/DataGridBody.js +19 -31
- package/DataGrid/DataGridBody/styles.js +9 -13
- package/DataGrid/DataGridCell/DataGridCell.d.ts +2 -2
- package/DataGrid/DataGridCell/DataGridCell.js +7 -19
- package/DataGrid/DataGridHead/DataGridHead.d.ts +2 -2
- package/DataGrid/DataGridHead/DataGridHead.js +15 -28
- package/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +9 -21
- package/DataGrid/DataGridHeadColumn/styles.js +23 -23
- package/DataGrid/DataGridLoader/DataGridLoader.js +3 -4
- package/DataGrid/DataGridLoader/styles.js +22 -15
- package/DataGrid/DataGridNoData/DataGridNoData.js +5 -17
- package/DataGrid/DataGridNoData/styles.js +29 -17
- package/DataGrid/styles.js +12 -13
- package/DataGrid/types.d.ts +1 -1
- package/DataGridPagination/DataGridPagination.js +11 -22
- package/DataGridPagination/styles.js +11 -15
- package/DatePicker/DatePicker.js +22 -33
- package/DatePicker/DatePickerDay/DatePickerDay.js +4 -15
- package/DatePicker/DatePickerDay/styled.js +6 -8
- package/DatePicker/DatePickerHeader/DatePickerHeader.js +12 -23
- package/DatePicker/DatePickerHeader/styled.js +10 -9
- package/DatePicker/styled.js +94 -70
- package/DatePickerProvider/DatePickerProvider.js +4 -4
- package/Description/Description.js +5 -6
- package/Description/Name/Name.js +5 -16
- package/Description/Value/Value.js +6 -17
- package/Description/styles.js +14 -13
- package/Dialog/Dialog.js +8 -19
- package/DialogActions/DialogActions.js +6 -17
- package/DialogTitle/DialogTitle.js +8 -19
- package/Divider/Divider.js +1 -1
- package/DropdownButton/DropdownButton.js +11 -22
- package/ErrorBoundary/ErrorBoundary.js +19 -48
- package/Fab/Fab.js +7 -18
- package/Fab/styles.js +33 -37
- package/Fade/Fade.js +1 -1
- package/FormControlLabel/FormControlLabel.js +4 -15
- package/FormControlLabel/styled.js +10 -11
- package/FormHelperText/FormHelperText.js +6 -6
- package/FormHelperText/styled.js +16 -18
- package/GlobalStyles/GlobalStyles.js +12 -25
- package/Grid/Grid.js +5 -16
- package/Grid/styled.js +5 -11
- package/Grow/Grow.js +1 -1
- package/IconButton/IconButton.js +6 -17
- package/IconButton/styles.js +15 -21
- package/IconDropdownButton/IconDropdownButton.js +10 -21
- package/List/List.js +4 -15
- package/ListItem/ListItem.js +4 -15
- package/ListItem/styles.js +19 -32
- package/ListItemAvatar/ListItemAvatar.js +1 -1
- package/ListItemButton/ListItemButton.js +5 -16
- package/ListItemIcon/ListItemIcon.js +5 -16
- package/ListItemIcon/styled.js +5 -11
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
- package/ListItemText/ListItemText.js +4 -15
- package/ListSubheader/ListSubheader.js +1 -1
- package/LocalizationProvider/LocalizationProvider.js +6 -18
- package/MaskField/MaskField.js +12 -23
- package/Menu/Menu.js +1 -1
- package/MenuGroup/MenuGroup.js +7 -18
- package/MenuGroup/stories/Icons.js +8 -19
- package/MenuGroup/stories/styled.js +12 -17
- package/MenuGroup/styled.js +14 -21
- package/MenuItem/MenuItem.js +5 -16
- package/MenuItem/styled.js +5 -11
- package/MenuList/MenuList.js +5 -16
- package/MenuList/styled.js +10 -17
- package/NavMenu/NavMenu.js +7 -18
- package/NavMenu/NavMenuItem/NavMenuItem.js +13 -25
- package/NavMenu/NavMenuItem/NavMenuItemButton/NavMenuItemButton.js +8 -19
- package/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +29 -30
- package/NavMenu/NavMenuItem/NavMenuItemList/NavMenuItemList.js +8 -19
- package/Notification/Notification.js +6 -37
- package/Notification/NotificationContainer/NotificationContainer.js +7 -18
- package/Notification/NotificationContainer/styled.js +16 -7
- package/Notification/NotificationTemplate/NotificationTemplate.js +10 -22
- package/Notification/NotificationTemplate/styled.js +51 -51
- package/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +2 -2
- package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +3 -3
- package/Notification/constants/notificationVariant.js +7 -18
- package/Notification/constants/positions.js +1 -1
- package/Notification/styled.js +18 -27
- package/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +5 -6
- package/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +2 -13
- package/OverflowTypography/OverflowTypography.js +13 -22
- package/OverflowTypography/hooks/useOverflowed/useOverflowed.js +13 -16
- package/OverflowTypography/styles.js +14 -12
- package/Pagination/Pagination.js +4 -15
- package/Placeholder/Placeholder.d.ts +9 -1
- package/Placeholder/Placeholder.js +4 -16
- package/Placeholder/styles.js +70 -76
- package/Product/Product.js +6 -17
- package/Profile/Profile.js +10 -21
- package/Profile/styled.js +32 -36
- package/Radio/Icon.js +6 -17
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +7 -18
- package/Radio/styled.js +43 -32
- package/Select/Select.js +16 -26
- package/Select/styled.js +36 -31
- package/SideDialog/SideDialog.js +6 -17
- package/SideDialog/styled.js +8 -8
- package/Slide/Slide.js +1 -1
- package/SwipeableDrawer/SwipeableDrawer.js +5 -16
- package/SwipeableDrawer/styles.js +73 -78
- package/Tab/Tab.js +1 -1
- package/Table/Table.js +5 -16
- package/Table/TableBody/TableBody.js +1 -1
- package/Table/TableCell/TableCell.js +1 -1
- package/Table/TableContainer/TableContainer.js +1 -1
- package/Table/TableFooter/TableFooter.js +1 -1
- package/Table/TableHead/TableHead.js +1 -1
- package/Table/TableRow/TableRow.js +1 -1
- package/Table/TableSortLabel/TableSortLabel.js +1 -1
- package/Tabs/Tabs.js +1 -1
- package/Tag/Tag.js +7 -18
- package/Tag/styled.js +84 -60
- package/TextArea/TextArea.js +6 -17
- package/TextField/TextField.js +11 -22
- package/ThemeProvider/ThemeProvider.js +7 -18
- package/Tooltip/Tooltip.js +7 -18
- package/Tooltip/styled.js +43 -58
- package/Typography/Typography.js +8 -19
- package/Zoom/Zoom.js +1 -1
- package/esm/ActionCell/ActionCell.js +11 -31
- package/esm/ActionCell/styles.js +4 -6
- package/esm/Alert/Alert.js +4 -15
- package/esm/Alert/styles.js +15 -18
- package/esm/Autocomplete/Autocomplete.js +12 -23
- package/esm/Autocomplete/constants.js +1 -1
- package/esm/BackdropStack/hooks/useBackdropStackToggle/useBackdropStackToggle.js +8 -9
- package/esm/BackdropStack/services/BackdropStackManager/BackdropStackManager.js +17 -19
- package/esm/Badge/Badge.js +3 -14
- package/esm/Badge/styled.d.ts +2 -16
- package/esm/Badge/styled.js +25 -30
- package/esm/Button/Button.js +4 -15
- package/esm/Button/styles.js +13 -19
- package/esm/ButtonBase/ButtonBase.js +3 -14
- package/esm/ButtonBase/styles.d.ts +3 -3
- package/esm/ButtonBase/styles.js +66 -71
- package/esm/Checkbox/Checkbox.js +3 -14
- package/esm/Checkbox/icons.js +6 -17
- package/esm/Checkbox/styled.js +45 -30
- package/esm/Chevron/Chevron.js +1 -12
- package/esm/Chevron/styles.js +10 -17
- package/esm/CircularProgress/CircularProgress.js +4 -15
- package/esm/CircularProgress/CircularProgressStory.js +2 -2
- package/esm/CircularProgress/CircularProgressStoryTemplate.js +2 -13
- package/esm/ConfigProvider/ConfigProvider.js +5 -17
- package/esm/ContentState/ContentState.d.ts +1 -1
- package/esm/ContentState/ContentState.js +6 -18
- package/esm/ContentState/styles.js +7 -6
- package/esm/DashboardLayout/DashboardLayout.js +2 -2
- package/esm/DashboardLayout/DashboardLayoutStory.js +3 -14
- package/esm/DashboardLayout/DashboardLayoutStoryTemplate.js +2 -13
- package/esm/DashboardLayout/Header/Header.js +4 -15
- package/esm/DashboardLayout/Header/styles.js +16 -19
- package/esm/DashboardLayout/Main/Main.js +2 -14
- package/esm/DashboardLayout/Main/styled.js +6 -6
- package/esm/DashboardLayout/Sidebar/Sidebar.js +6 -17
- package/esm/DashboardLayout/Sidebar/SidebarNav/SidebarNav.js +3 -14
- package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/SidebarToggleButton.js +3 -14
- package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/styles.js +11 -9
- package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggler.js +4 -15
- package/esm/DashboardLayout/Sidebar/SidebarToggler/styled.js +9 -10
- package/esm/DashboardLayout/Sidebar/styles.js +15 -23
- package/esm/DashboardLayout/styles.js +10 -8
- package/esm/DataGrid/DataGrid.js +17 -42
- package/esm/DataGrid/DataGridBody/DataGridBody.d.ts +2 -2
- package/esm/DataGrid/DataGridBody/DataGridBody.js +13 -25
- package/esm/DataGrid/DataGridBody/styles.js +8 -12
- package/esm/DataGrid/DataGridCell/DataGridCell.d.ts +2 -2
- package/esm/DataGrid/DataGridCell/DataGridCell.js +3 -15
- package/esm/DataGrid/DataGridHead/DataGridHead.d.ts +2 -2
- package/esm/DataGrid/DataGridHead/DataGridHead.js +8 -21
- package/esm/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +4 -16
- package/esm/DataGrid/DataGridHeadColumn/styles.js +21 -21
- package/esm/DataGrid/DataGridLoader/DataGridLoader.js +1 -2
- package/esm/DataGrid/DataGridLoader/styles.js +19 -12
- package/esm/DataGrid/DataGridNoData/DataGridNoData.js +3 -15
- package/esm/DataGrid/DataGridNoData/styles.js +27 -15
- package/esm/DataGrid/styles.js +11 -12
- package/esm/DataGrid/types.d.ts +1 -1
- package/esm/DataGridPagination/DataGridPagination.js +7 -18
- package/esm/DataGridPagination/styles.js +9 -13
- package/esm/DatePicker/DatePicker.js +11 -22
- package/esm/DatePicker/DatePickerDay/DatePickerDay.js +2 -13
- package/esm/DatePicker/DatePickerDay/styled.js +4 -6
- package/esm/DatePicker/DatePickerHeader/DatePickerHeader.js +5 -16
- package/esm/DatePicker/DatePickerHeader/styled.js +8 -7
- package/esm/DatePicker/styled.js +93 -69
- package/esm/DatePickerProvider/DatePickerProvider.js +2 -2
- package/esm/Description/Description.js +1 -2
- package/esm/Description/Name/Name.js +3 -14
- package/esm/Description/Value/Value.js +4 -15
- package/esm/Description/styles.js +13 -12
- package/esm/Dialog/Dialog.js +5 -16
- package/esm/DialogActions/DialogActions.js +3 -14
- package/esm/DialogTitle/DialogTitle.js +4 -15
- package/esm/DropdownButton/DropdownButton.js +4 -15
- package/esm/ErrorBoundary/ErrorBoundary.js +14 -43
- package/esm/Fab/Fab.js +3 -14
- package/esm/Fab/styles.js +31 -35
- package/esm/FormControlLabel/FormControlLabel.js +2 -13
- package/esm/FormControlLabel/styled.js +8 -9
- package/esm/FormHelperText/FormHelperText.js +3 -3
- package/esm/FormHelperText/styled.js +14 -16
- package/esm/GlobalStyles/GlobalStyles.js +8 -21
- package/esm/Grid/Grid.js +3 -14
- package/esm/Grid/styled.js +3 -9
- package/esm/IconButton/IconButton.js +3 -14
- package/esm/IconButton/styles.js +14 -20
- package/esm/IconDropdownButton/IconDropdownButton.js +4 -15
- package/esm/List/List.js +2 -13
- package/esm/ListItem/ListItem.js +2 -13
- package/esm/ListItem/styles.js +17 -30
- package/esm/ListItemButton/ListItemButton.js +2 -13
- package/esm/ListItemIcon/ListItemIcon.js +2 -13
- package/esm/ListItemIcon/styled.js +3 -9
- package/esm/ListItemText/ListItemText.js +2 -13
- package/esm/LocalizationProvider/LocalizationProvider.js +2 -14
- package/esm/MaskField/MaskField.js +9 -20
- package/esm/MenuGroup/MenuGroup.js +4 -15
- package/esm/MenuGroup/stories/Icons.js +7 -18
- package/esm/MenuGroup/stories/styled.js +9 -14
- package/esm/MenuGroup/styled.js +12 -19
- package/esm/MenuItem/MenuItem.js +3 -14
- package/esm/MenuItem/styled.js +3 -9
- package/esm/MenuList/MenuList.js +3 -14
- package/esm/MenuList/styled.js +8 -15
- package/esm/NavMenu/NavMenu.js +3 -14
- package/esm/NavMenu/NavMenuItem/NavMenuItem.js +8 -20
- package/esm/NavMenu/NavMenuItem/NavMenuItemButton/NavMenuItemButton.js +3 -14
- package/esm/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +25 -26
- package/esm/NavMenu/NavMenuItem/NavMenuItemList/NavMenuItemList.js +4 -15
- package/esm/Notification/Notification.js +5 -36
- package/esm/Notification/NotificationContainer/NotificationContainer.js +2 -13
- package/esm/Notification/NotificationContainer/styled.js +15 -6
- package/esm/Notification/NotificationTemplate/NotificationTemplate.js +6 -18
- package/esm/Notification/NotificationTemplate/styled.js +48 -48
- package/esm/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +2 -2
- package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +3 -3
- package/esm/Notification/constants/defaultNotificationProps.js +1 -1
- package/esm/Notification/constants/notificationVariant.js +5 -16
- package/esm/Notification/constants/positions.js +1 -1
- package/esm/Notification/styled.js +20 -29
- package/esm/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +2 -3
- package/esm/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +2 -13
- package/esm/OverflowTypography/OverflowTypography.js +9 -18
- package/esm/OverflowTypography/hooks/useOverflowed/useOverflowed.js +11 -14
- package/esm/OverflowTypography/styles.js +13 -11
- package/esm/Pagination/Pagination.js +2 -13
- package/esm/Placeholder/Placeholder.d.ts +9 -1
- package/esm/Placeholder/Placeholder.js +2 -14
- package/esm/Placeholder/styles.js +68 -74
- package/esm/Product/Product.js +3 -14
- package/esm/Profile/Profile.js +4 -15
- package/esm/Profile/styled.js +30 -34
- package/esm/Radio/Icon.js +4 -15
- package/esm/Radio/Radio.d.ts +1 -1
- package/esm/Radio/Radio.js +3 -14
- package/esm/Radio/styled.js +41 -30
- package/esm/Select/Select.js +8 -18
- package/esm/Select/styled.js +34 -29
- package/esm/SideDialog/SideDialog.js +3 -14
- package/esm/SideDialog/styled.js +6 -6
- package/esm/SwipeableDrawer/SwipeableDrawer.js +3 -14
- package/esm/SwipeableDrawer/styles.js +71 -76
- package/esm/Table/Table.js +3 -14
- package/esm/Tag/Tag.js +3 -14
- package/esm/Tag/styled.js +82 -58
- package/esm/TextArea/TextArea.js +3 -14
- package/esm/TextField/TextField.js +7 -18
- package/esm/ThemeProvider/ThemeProvider.js +3 -14
- package/esm/Tooltip/Tooltip.js +3 -14
- package/esm/Tooltip/styled.js +39 -54
- package/esm/Typography/Typography.js +4 -15
- package/esm/hooks/useMenu.js +7 -8
- package/esm/theme/baseTheme/baseTheme.js +7 -7
- package/esm/theme/baseTheme/baseTheme.test.js +12 -12
- package/esm/theme/breakpoints.js +1 -1
- package/esm/theme/components/MuiAlert.js +7 -12
- package/esm/theme/components/MuiAutocomplete.js +13 -20
- package/esm/theme/components/MuiButton.js +42 -43
- package/esm/theme/components/MuiButtonBase.js +1 -1
- package/esm/theme/components/MuiCircularProgress.js +3 -4
- package/esm/theme/components/MuiDialog.js +3 -5
- package/esm/theme/components/MuiDialogActions.js +2 -3
- package/esm/theme/components/MuiDialogContent.js +2 -3
- package/esm/theme/components/MuiDialogTitle.js +2 -3
- package/esm/theme/components/MuiFormHelperText.js +2 -3
- package/esm/theme/components/MuiFormLabel.js +2 -2
- package/esm/theme/components/MuiInputBase.js +2 -3
- package/esm/theme/components/MuiInputLabel.js +2 -3
- package/esm/theme/components/MuiListItemButton.js +2 -3
- package/esm/theme/components/MuiListItemText.js +2 -2
- package/esm/theme/components/MuiLoadingButton.js +10 -12
- package/esm/theme/components/MuiMenu.js +3 -5
- package/esm/theme/components/MuiMenuItem.js +2 -3
- package/esm/theme/components/MuiOutlinedInput.js +7 -12
- package/esm/theme/components/MuiPaginationItem.js +5 -7
- package/esm/theme/components/MuiTab.js +2 -3
- package/esm/theme/components/MuiTableCell.js +2 -2
- package/esm/theme/components/MuiTableHead.js +3 -4
- package/esm/theme/components/MuiTableRow.js +2 -3
- package/esm/theme/components/MuiTabs.js +3 -4
- package/esm/theme/components/MuiTypography.js +1 -1
- package/esm/theme/components/components.js +64 -35
- package/esm/theme/constants.js +1 -1
- package/esm/theme/elevation.js +1 -1
- package/esm/theme/hooks/useTheme/index.js +1 -1
- package/esm/theme/palette/brandPalette.js +16 -17
- package/esm/theme/palette/palette.js +3 -15
- package/esm/theme/shape.js +1 -1
- package/esm/theme/typography.js +4 -5
- package/hooks/useMenu.js +8 -9
- package/package.json +14 -14
- package/theme/baseTheme/baseTheme.js +14 -14
- package/theme/baseTheme/baseTheme.test.js +14 -14
- package/theme/components/MuiAlert.js +6 -11
- package/theme/components/MuiAutocomplete.js +13 -20
- package/theme/components/MuiButton.js +43 -44
- package/theme/components/MuiCircularProgress.js +2 -3
- package/theme/components/MuiDialog.js +2 -4
- package/theme/components/MuiDialogActions.js +1 -2
- package/theme/components/MuiDialogContent.js +1 -2
- package/theme/components/MuiDialogTitle.js +1 -2
- package/theme/components/MuiFormHelperText.js +1 -2
- package/theme/components/MuiFormLabel.js +1 -1
- package/theme/components/MuiInputBase.js +1 -2
- package/theme/components/MuiInputLabel.js +1 -2
- package/theme/components/MuiListItemButton.js +1 -2
- package/theme/components/MuiListItemText.js +1 -1
- package/theme/components/MuiLoadingButton.js +12 -14
- package/theme/components/MuiMenu.js +2 -4
- package/theme/components/MuiMenuItem.js +1 -2
- package/theme/components/MuiOutlinedInput.js +6 -11
- package/theme/components/MuiPaginationItem.js +4 -6
- package/theme/components/MuiTab.js +1 -2
- package/theme/components/MuiTableCell.js +1 -1
- package/theme/components/MuiTableHead.js +2 -3
- package/theme/components/MuiTableRow.js +1 -2
- package/theme/components/MuiTabs.js +2 -3
- package/theme/components/components.js +64 -35
- package/theme/hooks/useTheme/index.js +2 -2
- package/theme/palette/brandPalette.js +17 -18
- package/theme/palette/palette.js +5 -17
- package/theme/typography.js +3 -4
- package/docs/Case/Case.d.ts +0 -8
- package/docs/Case/Case.js +0 -31
- package/docs/Case/index.d.ts +0 -1
- package/docs/Case/index.js +0 -17
- package/docs/Case/styles.d.ts +0 -5
- package/docs/Case/styles.js +0 -16
- package/docs/ExampleTemplate/ExampleTemplate.d.ts +0 -13
- package/docs/ExampleTemplate/ExampleTemplate.js +0 -26
- package/docs/ExampleTemplate/index.d.ts +0 -1
- package/docs/ExampleTemplate/index.js +0 -17
- package/docs/ExampleTemplate/styles.d.ts +0 -9
- package/docs/ExampleTemplate/styles.js +0 -13
- package/docs/index.d.ts +0 -2
- package/docs/index.js +0 -18
- package/esm/docs/Case/Case.d.ts +0 -8
- package/esm/docs/Case/Case.js +0 -27
- package/esm/docs/Case/index.d.ts +0 -1
- package/esm/docs/Case/index.js +0 -1
- package/esm/docs/Case/styles.d.ts +0 -5
- package/esm/docs/Case/styles.js +0 -13
- package/esm/docs/ExampleTemplate/ExampleTemplate.d.ts +0 -13
- package/esm/docs/ExampleTemplate/ExampleTemplate.js +0 -22
- package/esm/docs/ExampleTemplate/index.d.ts +0 -1
- package/esm/docs/ExampleTemplate/index.js +0 -1
- package/esm/docs/ExampleTemplate/styles.d.ts +0 -9
- package/esm/docs/ExampleTemplate/styles.js +0 -10
- package/esm/docs/index.d.ts +0 -2
- package/esm/docs/index.js +0 -2
package/DataGrid/DataGrid.js
CHANGED
|
@@ -1,73 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.DataGrid = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function DataGrid(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var handleSelectAllRows = function (event) {
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const Table_1 = require("../Table");
|
|
10
|
+
const DataGridHead_1 = require("./DataGridHead");
|
|
11
|
+
const DataGridBody_1 = require("./DataGridBody");
|
|
12
|
+
const DataGridLoader_1 = __importDefault(require("./DataGridLoader/DataGridLoader"));
|
|
13
|
+
const DataGridNoData_1 = require("./DataGridNoData");
|
|
14
|
+
const styles_1 = require("./styles");
|
|
15
|
+
function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, minDisplayRows = 10, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, }) {
|
|
16
|
+
const selectable = Boolean(onSelectRow);
|
|
17
|
+
const handleSelectAllRows = (event) => {
|
|
39
18
|
if (!onSelectRow) {
|
|
40
19
|
return;
|
|
41
20
|
}
|
|
42
21
|
if (event.target.checked) {
|
|
43
|
-
|
|
22
|
+
const mergedSelectedRows = [...selectedRows, ...rows];
|
|
44
23
|
return onSelectRow(mergedSelectedRows);
|
|
45
24
|
}
|
|
46
|
-
|
|
25
|
+
const filteredRows = selectedRows.filter((selectedRow) => !rows.find((row) => row[keyId] === selectedRow[keyId]));
|
|
47
26
|
onSelectRow(filteredRows);
|
|
48
27
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return onSelectRow(selectedRows.filter(function (selectedRow) { return selectedRow[keyId] !== row[keyId]; }));
|
|
58
|
-
};
|
|
28
|
+
const handleSelectRow = (0, react_1.useCallback)((row) => (event) => {
|
|
29
|
+
if (!onSelectRow) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (event.target.checked) {
|
|
33
|
+
return onSelectRow([...selectedRows, row]);
|
|
34
|
+
}
|
|
35
|
+
return onSelectRow(selectedRows.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
|
|
59
36
|
}, [selectedRows, onSelectRow, keyId]);
|
|
60
|
-
|
|
61
|
-
return rows.filter(
|
|
62
|
-
return !selectedRows.find(function (selectedRow) { return selectedRow[keyId] === row[keyId]; });
|
|
63
|
-
}).length;
|
|
37
|
+
const uncheckedRowsCount = (0, react_1.useMemo)(() => {
|
|
38
|
+
return rows.filter((row) => !selectedRows.find((selectedRow) => selectedRow[keyId] === row[keyId])).length;
|
|
64
39
|
}, [rows, selectedRows, keyId]);
|
|
65
|
-
|
|
40
|
+
const renderedPlaceholder = (0, react_1.useCallback)(() => {
|
|
66
41
|
if (!loading) {
|
|
67
42
|
return noDataPlaceholder || (0, jsx_runtime_1.jsx)(DataGridNoData_1.DataGridNoData, {});
|
|
68
43
|
}
|
|
69
44
|
return null;
|
|
70
45
|
}, [noDataPlaceholder, loading]);
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.DataGridContainer, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledTableContainer,
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.DataGridContainer, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledTableContainer, Object.assign({ maxHeight: maxHeight }, { children: [(0, jsx_runtime_1.jsxs)(Table_1.Table, Object.assign({ stickyHeader: true }, { children: [(0, jsx_runtime_1.jsx)(DataGridHead_1.DataGridHead, { onSort: onSort, rowsCount: rows.length, uncheckedRowsCount: uncheckedRowsCount, onSelectAllRows: handleSelectAllRows, selectable: selectable, sorting: sorting, columns: columns }), (0, jsx_runtime_1.jsx)(DataGridBody_1.DataGridBody, { keyId: keyId, selectedRows: selectedRows, minDisplayRows: minDisplayRows, onRowClick: onRowClick, onSelectRow: handleSelectRow, selectable: selectable, rows: rows, columns: columns, emptyCellValue: emptyCellValue, noDataPlaceholder: renderedPlaceholder() })] })), (0, jsx_runtime_1.jsx)(DataGridLoader_1.default, { loading: loading })] })), rows.length ? Footer : null] }));
|
|
72
47
|
}
|
|
73
48
|
exports.DataGrid = DataGrid;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent, ReactNode } from 'react';
|
|
2
2
|
import { DataGridColumns, DataGridRow } from '../types';
|
|
3
|
-
export declare type DataGridBodyProps<Data> = {
|
|
3
|
+
export declare type DataGridBodyProps<Data extends object> = {
|
|
4
4
|
columns: DataGridColumns<Data>[];
|
|
5
5
|
keyId: keyof DataGridRow;
|
|
6
6
|
onRowClick?: (row: Data) => void;
|
|
@@ -12,4 +12,4 @@ export declare type DataGridBodyProps<Data> = {
|
|
|
12
12
|
emptyCellValue?: ReactNode;
|
|
13
13
|
noDataPlaceholder?: ReactNode;
|
|
14
14
|
};
|
|
15
|
-
export declare function DataGridBody<Data>({ rows, columns, selectable, onRowClick, onSelectRow, selectedRows, minDisplayRows, keyId, emptyCellValue, noDataPlaceholder, }: DataGridBodyProps<Data>): JSX.Element;
|
|
15
|
+
export declare function DataGridBody<Data extends object>({ rows, columns, selectable, onRowClick, onSelectRow, selectedRows, minDisplayRows, keyId, emptyCellValue, noDataPlaceholder, }: DataGridBodyProps<Data>): JSX.Element;
|
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DataGridBody = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function DataGridBody(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var cellId = "".concat(rowId, "-").concat(index);
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Table_1 = require("../../Table");
|
|
7
|
+
const DataGridCell_1 = require("../DataGridCell");
|
|
8
|
+
const Checkbox_1 = require("../../Checkbox");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
function DataGridBody({ rows, columns, selectable, onRowClick, onSelectRow, selectedRows = [], minDisplayRows, keyId, emptyCellValue, noDataPlaceholder, }) {
|
|
11
|
+
const renderCells = (0, react_1.useCallback)((row, rowId) => {
|
|
12
|
+
return columns.map((cell, index) => {
|
|
13
|
+
const cellId = `${rowId}-${index}`;
|
|
26
14
|
return ((0, jsx_runtime_1.jsx)(DataGridCell_1.DataGridCell, { row: row, cell: cell, emptyCellValue: emptyCellValue }, cellId));
|
|
27
15
|
});
|
|
28
16
|
}, [columns]);
|
|
29
|
-
|
|
17
|
+
const handleRowClick = (row) => () => {
|
|
30
18
|
if (onRowClick) {
|
|
31
19
|
onRowClick(row);
|
|
32
20
|
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return rows.map(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Boolean(selectedRows.find(
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(Table_1.TableRow,
|
|
21
|
+
};
|
|
22
|
+
const renderedRows = (0, react_1.useMemo)(() => {
|
|
23
|
+
return rows.map((row) => {
|
|
24
|
+
const rowId = row[keyId];
|
|
25
|
+
const checked = selectable &&
|
|
26
|
+
Boolean(selectedRows.find((selectedRow) => selectedRow[keyId] === rowId));
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.TableRow, Object.assign({ hover: Boolean(onRowClick), onClick: handleRowClick(row) }, { children: [selectable && ((0, jsx_runtime_1.jsx)(Table_1.TableCell, Object.assign({ padding: "checkbox", onClick: (event) => event.stopPropagation() }, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: checked, onChange: onSelectRow(row) }) }))), renderCells(row, rowId)] }), rowId));
|
|
40
28
|
});
|
|
41
29
|
}, [rows, keyId, selectable, selectedRows, onSelectRow, onRowClick, columns]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTableBody,
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTableBody, Object.assign({ empty: !rows.length, minDisplayRows: minDisplayRows }, { children: rows.length ? renderedRows : noDataPlaceholder })));
|
|
43
31
|
}
|
|
44
32
|
exports.DataGridBody = DataGridBody;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.StyledTableBody = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const styles_1 = require("../../styles");
|
|
5
|
+
const Table_1 = require("../../Table");
|
|
6
|
+
const TABLE_ROW_HEIGHT = 44;
|
|
11
7
|
exports.StyledTableBody = (0, styles_1.styled)(Table_1.TableBody, {
|
|
12
|
-
shouldForwardProp:
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
|
|
8
|
+
shouldForwardProp: (prop) => prop !== 'empty' && prop !== 'minDisplayRows',
|
|
9
|
+
}) `
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
height: ${({ empty, minDisplayRows }) => empty ? `${TABLE_ROW_HEIGHT * minDisplayRows}px` : 'auto'};
|
|
13
|
+
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DataGridColumns } from '../types';
|
|
3
|
-
export declare type CellProps<Data> = {
|
|
3
|
+
export declare type CellProps<Data extends object> = {
|
|
4
4
|
row: Data;
|
|
5
5
|
cell: DataGridColumns<Data>;
|
|
6
6
|
emptyCellValue?: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare function DataGridCell<Data>({ row, cell: { field, renderCell, format, align }, emptyCellValue, }: CellProps<Data>): JSX.Element;
|
|
8
|
+
export declare function DataGridCell<Data extends object>({ row, cell: { field, renderCell, format, align }, emptyCellValue, }: CellProps<Data>): JSX.Element;
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DataGridCell = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function DataGridCell(
|
|
20
|
-
|
|
21
|
-
var formattedValue = (0, react_1.useMemo)(function () {
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Table_1 = require("../../Table");
|
|
7
|
+
const Typography_1 = require("../../Typography");
|
|
8
|
+
function DataGridCell({ row, cell: { field, renderCell, format, align = 'left' }, emptyCellValue = '-', }) {
|
|
9
|
+
const formattedValue = (0, react_1.useMemo)(() => {
|
|
22
10
|
if (format) {
|
|
23
11
|
return format(row);
|
|
24
12
|
}
|
|
@@ -27,6 +15,6 @@ function DataGridCell(_a) {
|
|
|
27
15
|
}
|
|
28
16
|
return emptyCellValue;
|
|
29
17
|
}, [field, format, row, emptyCellValue]);
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(Table_1.TableCell,
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.TableCell, Object.assign({ align: align }, { children: [renderCell && renderCell(row), !renderCell && ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue }) }))] })));
|
|
31
19
|
}
|
|
32
20
|
exports.DataGridCell = DataGridCell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { DataGridColumns, DataGridRow, DataGridSort } from '../types';
|
|
3
|
-
export declare type DataGridHeadProps<Data = DataGridRow, SortField extends keyof Data = keyof Data> = {
|
|
3
|
+
export declare type DataGridHeadProps<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data> = {
|
|
4
4
|
columns: DataGridColumns<Data>[];
|
|
5
5
|
selectable: boolean;
|
|
6
6
|
onSelectAllRows: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -9,4 +9,4 @@ export declare type DataGridHeadProps<Data = DataGridRow, SortField extends keyo
|
|
|
9
9
|
uncheckedRowsCount: number;
|
|
10
10
|
rowsCount: number;
|
|
11
11
|
};
|
|
12
|
-
export declare function DataGridHead<Data, SortField extends keyof Data>({ columns, selectable, onSelectAllRows, rowsCount, onSort, sorting, uncheckedRowsCount, }: DataGridHeadProps<Data, SortField>): JSX.Element;
|
|
12
|
+
export declare function DataGridHead<Data extends object, SortField extends keyof Data>({ columns, selectable, onSelectAllRows, rowsCount, onSort, sorting, uncheckedRowsCount, }: DataGridHeadProps<Data, SortField>): JSX.Element;
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DataGridHead = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function DataGridHead(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var handleSort = (0, react_1.useCallback)(function (field) {
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const TableHead_1 = require("../../Table/TableHead");
|
|
7
|
+
const Table_1 = require("../../Table");
|
|
8
|
+
const Checkbox_1 = require("../../Checkbox");
|
|
9
|
+
const constants_1 = require("../constants");
|
|
10
|
+
const DataGridHeadColumn_1 = require("../DataGridHeadColumn");
|
|
11
|
+
function DataGridHead({ columns, selectable, onSelectAllRows, rowsCount, onSort, sorting, uncheckedRowsCount, }) {
|
|
12
|
+
const checked = (0, react_1.useMemo)(() => !Boolean(uncheckedRowsCount) && rowsCount > 0, [uncheckedRowsCount, rowsCount]);
|
|
13
|
+
const indeterminate = (0, react_1.useMemo)(() => uncheckedRowsCount > 0 && uncheckedRowsCount < rowsCount, [uncheckedRowsCount, rowsCount]);
|
|
14
|
+
const handleSort = (0, react_1.useCallback)((field) => {
|
|
27
15
|
if (!onSort) {
|
|
28
16
|
return;
|
|
29
17
|
}
|
|
30
|
-
|
|
18
|
+
const isCurrentField = (sorting === null || sorting === void 0 ? void 0 : sorting.fieldId) === field;
|
|
31
19
|
// если для выбранного столбца текущая сортировка ASC - меняем на DESC
|
|
32
20
|
if (isCurrentField && sorting.sort === constants_1.SortStates.ASC) {
|
|
33
21
|
return onSort({ fieldId: field, sort: constants_1.SortStates.DESC });
|
|
@@ -39,12 +27,11 @@ function DataGridHead(_a) {
|
|
|
39
27
|
// если для выбранного столбца нет сортировки - добавляем сортировку ASC
|
|
40
28
|
onSort({ fieldId: field, sort: constants_1.SortStates.ASC });
|
|
41
29
|
}, [sorting, onSort]);
|
|
42
|
-
|
|
43
|
-
return columns.map(
|
|
44
|
-
var field = _a.field, label = _a.label, sortable = _a.sortable, align = _a.align, width = _a.width;
|
|
30
|
+
const renderColumns = (0, react_1.useMemo)(() => {
|
|
31
|
+
return columns.map(({ field, label, sortable, align, width }) => {
|
|
45
32
|
return ((0, jsx_runtime_1.jsx)(DataGridHeadColumn_1.DataGridHeadColumn, { sorting: sorting, field: field, onSort: handleSort, label: label, sortable: sortable, align: align, width: width }, label));
|
|
46
33
|
});
|
|
47
34
|
}, [columns, handleSort, sorting]);
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(TableHead_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(Table_1.TableRow, { children: [selectable && ((0, jsx_runtime_1.jsx)(Table_1.TableCell,
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(TableHead_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(Table_1.TableRow, { children: [selectable && ((0, jsx_runtime_1.jsx)(Table_1.TableCell, Object.assign({ padding: "checkbox" }, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: checked, indeterminate: indeterminate, onChange: onSelectAllRows }) }))), renderColumns] }) }));
|
|
49
36
|
}
|
|
50
37
|
exports.DataGridHead = DataGridHead;
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DataGridHeadColumn = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function DataGridHeadColumn(
|
|
21
|
-
|
|
22
|
-
var sortIcon = (0, react_1.useMemo)(function () {
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const icons_1 = require("@astral/icons");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
8
|
+
const styles_1 = require("./styles");
|
|
9
|
+
function DataGridHeadColumn({ onSort, field, sortable, align, label, sorting, width, }) {
|
|
10
|
+
const sortIcon = (0, react_1.useMemo)(() => {
|
|
23
11
|
if (!sortable) {
|
|
24
12
|
return null;
|
|
25
13
|
}
|
|
@@ -35,11 +23,11 @@ function DataGridHeadColumn(_a) {
|
|
|
35
23
|
return (0, jsx_runtime_1.jsx)(icons_1.SortFillSm, {});
|
|
36
24
|
}
|
|
37
25
|
}, [sorting, sortable, field]);
|
|
38
|
-
|
|
26
|
+
const handleSortClick = () => {
|
|
39
27
|
if (field && sortable) {
|
|
40
28
|
onSort(field);
|
|
41
29
|
}
|
|
42
30
|
};
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTableCell,
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTableCell, Object.assign({ onClick: handleSortClick, align: align, width: width, sortable: sortable }, { children: (0, jsx_runtime_1.jsxs)(styles_1.TableCellTitle, Object.assign({ variant: "pointer" }, { children: [label, sortIcon] })) })));
|
|
44
32
|
}
|
|
45
33
|
exports.DataGridHeadColumn = DataGridHeadColumn;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.TableCellTitle = exports.StyledTableCell = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const styles_1 = require("../../styles");
|
|
5
|
+
const Table_1 = require("../../Table");
|
|
6
|
+
const Typography_1 = require("../../Typography");
|
|
11
7
|
exports.StyledTableCell = (0, styles_1.styled)(Table_1.TableCell, {
|
|
12
|
-
shouldForwardProp:
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
shouldForwardProp: (prop) => prop !== 'width' && prop !== 'sortable',
|
|
9
|
+
}) `
|
|
10
|
+
width: ${({ width = 'auto' }) => width};
|
|
11
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
12
|
+
|
|
13
|
+
color: ${({ theme }) => theme.palette.grey[700]};
|
|
14
|
+
|
|
15
|
+
cursor: ${({ sortable }) => (sortable ? 'pointer' : 'initial')};
|
|
16
|
+
|
|
17
|
+
user-select: none;
|
|
18
|
+
`;
|
|
19
|
+
exports.TableCellTitle = (0, styles_1.styled)(Typography_1.Typography) `
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
|
|
23
|
+
> svg {
|
|
24
|
+
width: 16px;
|
|
25
|
+
height: 16px;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _b = _a.loading, loading = _b === void 0 ? false : _b;
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const styles_1 = require("./styles");
|
|
5
|
+
const DataGridLoader = ({ loading = false }) => {
|
|
7
6
|
return ((0, jsx_runtime_1.jsxs)(styles_1.LoaderWrapper, { children: [loading && (0, jsx_runtime_1.jsx)(styles_1.Backdrop, {}), loading ? (0, jsx_runtime_1.jsx)(styles_1.StyledLinearProgress, {}) : (0, jsx_runtime_1.jsx)(styles_1.StyledDivider, {})] }));
|
|
8
7
|
};
|
|
9
8
|
exports.default = DataGridLoader;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.StyledLinearProgress = exports.LoaderWrapper = exports.StyledDivider = exports.Backdrop = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.Backdrop = styles_1.styled.div
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const Divider_1 = require("../../Divider");
|
|
6
|
+
const styles_1 = require("../../styles");
|
|
7
|
+
exports.Backdrop = styles_1.styled.div `
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
|
|
14
|
+
background-color: ${({ theme }) => theme.palette.grey['100']};
|
|
15
|
+
opacity: 0.6;
|
|
16
|
+
`;
|
|
17
|
+
exports.StyledDivider = (0, styles_1.styled)(Divider_1.Divider) `
|
|
18
|
+
border-width: 1px;
|
|
19
|
+
`;
|
|
20
|
+
exports.LoaderWrapper = styles_1.styled.div `
|
|
21
|
+
height: 2px;
|
|
22
|
+
`;
|
|
23
|
+
exports.StyledLinearProgress = (0, styles_1.styled)(material_1.LinearProgress) `
|
|
24
|
+
height: 2px;
|
|
25
|
+
`;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DataGridNoData = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataWrapper, { children: (0, jsx_runtime_1.jsxs)(styles_1.DataGridNoDataFigure, { children: [(0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataIcon, __assign({ noDataIconWidth: noDataIconWidth }, { children: noDataIcon })), (0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataFigcaption, __assign({ component: "figcaption", variant: "h4" }, { children: title }))] }) }));
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("./styles");
|
|
6
|
+
const BaseNoDataIcon = () => ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ viewBox: "0 0 124 124", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("path", { fill: "#EBEEF1", stroke: "#B7C2CE", d: "M106.5 62a43.5 43.5 0 1 1-87 0 43.5 43.5 0 0 1 87 0Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "m48.3 74 22.5-44.7a5.3 5.3 0 0 1 7-2.3l23.7 12a5 5 0 0 1 2.7 3l4.7 14.8c.4 1.3.3 2.7-.3 4L91 95.4a5.3 5.3 0 0 1-7.1 2.3L50.6 81a5.3 5.3 0 0 1-2.3-7Zm.9.4 22.5-44.6c1-2.1 3.6-3 5.7-1.9l23.7 12c.7.3 1.2.8 1.6 1.4l-3.3 6.5a5.3 5.3 0 0 0 2.4 7l6.3 3.3c0 .7 0 1.5-.4 2.2L90.2 95a4.4 4.4 0 0 1-5.8 1.8L51.1 80.1c-2.1-1-3-3.6-2-5.7Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "#fff", d: "M71.7 29.8 49.2 74.4c-1 2-.2 4.7 1.9 5.7L84.4 97c2.1 1.1 4.7.3 5.8-1.8l17.5-34.8c.3-.7.5-1.5.4-2.2l-6.3-3.2a5.3 5.3 0 0 1-2.4-7l3.3-6.6c-.4-.6-1-1.1-1.6-1.4L77.4 28c-2.1-1-4.7-.2-5.7 1.9Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M77 33.9c.1-.4.6-.5 1-.3l17.5 8.8a.7.7 0 0 1-.6 1.3l-17.6-8.9a.7.7 0 0 1-.3-1Zm-2.4 4.6c.2-.3.6-.5 1-.3l6.1 3.1a.7.7 0 0 1-.6 1.3l-6.2-3.1a.7.7 0 0 1-.3-1Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { stroke: "#B7C2CE", strokeLinecap: "round", strokeWidth: "2.1", d: "m57.1 74 5.6 2.8m4.6 2.3 2.4 1.2" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M67.8 50.5a2.6 2.6 0 0 1 3.5-1.1l25.5 12.8c1.3.6 1.8 2.2 1.1 3.5l-7.5 15a2.6 2.6 0 0 1-3.6 1.2L61.4 69a2.6 2.6 0 0 1-1.2-3.5l7.6-15Zm3-.3 25.5 12.9c.8.4 1.2 1.4.7 2.2l-1 2.3-28.5-14.3 1.2-2.3c.4-.8 1.4-1.2 2.2-.8Zm-3.7 4-1.8 3.5L93.6 72l1.9-3.6L67 54.1Zm26.1 18.7L64.8 58.6 62.6 63l28.3 14.3 2.3-4.4Zm-2.6 5.3h-.2L62.2 63.8l-1 2c-.5.9-.2 1.8.6 2.3L87.3 81c.8.4 1.8 0 2.2-.7l1-2.1Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "#fff", d: "M41.1 30.7c.7-.3 1.4-.5 2.1-.5l3.7 6.3a5.3 5.3 0 0 0 7.2 2l6.1-3.7c.7.4 1.2 1 1.6 1.6l19.5 33.7c1.2 2 .5 4.7-1.6 5.9L47.4 94.6c-2 1.2-4.7.5-5.9-1.5l-25-43.3c-1.1-2-.4-4.6 1.6-5.8l23-13.3Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M61.2 34.3c-.5-.4-1-.7-1.7-.8l-14.8-4.1a5.3 5.3 0 0 0-4 .5L17.6 43a5.3 5.3 0 0 0-2 7.2l25 43.3a5.3 5.3 0 0 0 7.2 2l32.3-18.8a5.3 5.3 0 0 0 2-7.2L62.7 36c-.4-.6-.9-1.2-1.5-1.6Zm-18-4.1c-.7 0-1.4.2-2 .5L18.1 44a4.3 4.3 0 0 0-1.6 5.8l25 43.3c1.1 2 3.7 2.7 5.8 1.5L79.7 76c2-1.2 2.8-3.8 1.6-5.9L61.8 36.4c-.4-.7-.9-1.2-1.6-1.6l-6.1 3.6a5.3 5.3 0 0 1-7.2-2l-3.7-6.2Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M23 47.8c-.2-.4-.2-1 .2-1.1l17-9.9c.4-.2.8 0 1.1.5.3.4.2 1-.1 1.1l-17 9.9c-.4.2-1 0-1.2-.5Zm2.6 4.5c-.2-.4-.2-1 .2-1.1l6-3.5c.3-.2.8 0 1 .5.3.4.2 1-.1 1.2l-6 3.4c-.3.2-.8 0-1-.5ZM45 87.2c-.2-.2-.1-.5.1-.6l6.4-3.7a.5.5 0 0 1 .5.8l-6.4 3.7c-.2.1-.5 0-.7-.2Zm9.8-5.7c-.1-.2 0-.5.2-.6l3.3-2c.2 0 .5 0 .6.2.1.3 0 .6-.2.7l-3.3 1.9c-.2.1-.5 0-.6-.2Zm-23-17.1a2.6 2.6 0 0 1 1-3.6l26.4-15.2c1.3-.8 2.9-.3 3.6 1L71.2 61c.7 1.2.3 2.8-1 3.6L43.8 79.9c-1.3.8-2.9.3-3.6-1l-8.4-14.5Zm1.5-2.7 26.4-15.3c.8-.4 1.8-.1 2.2.6l8.4 14.6c.5.8.2 1.8-.6 2.2L43.3 79.1c-.8.4-1.8.2-2.2-.6l-1.2-2 29.3-17-.5-.8-29.3 16.9-2.5-4.3 29.3-16.9-.5-.9-29.3 17-2-3.5 29.3-17-.5-.8-29.3 17-1.2-2.3c-.5-.7-.2-1.7.6-2.2Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "#fff", d: "M34.7 30.1v64.1c0 3 2.4 5.4 5.4 5.4h45.4c3 0 5.4-2.4 5.4-5.4v-50c0-.6-.1-1.2-.3-1.7h-9.2A6.4 6.4 0 0 1 75 36V25.4c-.8-.4-1.8-.7-2.7-.7H40c-3 0-5.4 2.4-5.4 5.4Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M75 24.3c-.9-.4-1.8-.6-2.7-.6H40a6.4 6.4 0 0 0-6.4 6.4v64.1c0 3.6 2.9 6.4 6.4 6.4h45.4c3.5 0 6.4-2.8 6.4-6.4v-50a6.4 6.4 0 0 0-1.8-4.4l-13-14a6.4 6.4 0 0 0-2-1.5Zm-40.3 70V30c0-3 2.4-5.4 5.4-5.4h32.2c1 0 1.9.3 2.7.7V36c0 3.5 2.9 6.4 6.4 6.4h9.2c.2.5.3 1 .3 1.7v50c0 3-2.4 5.4-5.4 5.4H40c-3 0-5.4-2.4-5.4-5.4Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "#B7C2CE", fillRule: "evenodd", d: "M43 34c0-.5.5-1 1-1h20.7c.5 0 1 .5 1 1s-.5 1-1 1H44a1 1 0 0 1-1-1Zm0 3.8c0-.5.5-1 1-1h7.6c.5 0 .9.5.9 1s-.4 1-.9 1H44a1 1 0 0 1-1-1Zm-.8 52c0-.2.1-.4.4-.4H52c.3 0 .5.2.5.4 0 .3-.2.5-.5.5h-9.4c-.3 0-.4-.2-.4-.5Zm14 0c0-.2.2-.4.5-.4h4.7c.3 0 .5.2.5.4 0 .3-.2.5-.5.5h-4.7c-.3 0-.5-.2-.5-.5Zm-15-34.9c0-1.2 1-2.1 2.1-2.1h39c1.1 0 2 1 2 2v24a2 2 0 0 1-2 2.1h-39a2 2 0 0 1-2-2v-24Zm2.1-1.1h39c.6 0 1 .5 1 1v4.6h-41V55c0-.6.4-1.1 1-1.1Zm-1 20.6v4.4c0 .6.4 1.1 1 1.1h39c.6 0 1-.5 1-1v-4.5h-41Zm41-1h-41V67h41v6.6Zm0-13.1V66h-41v-5.7h41Z", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("circle", { cx: "19.8", cy: "35.9", r: "2", fill: "#F0F4F7" }), (0, jsx_runtime_1.jsx)("circle", { cx: "101.2", cy: "28.3", r: "2.7", fill: "#F0F4F7" }), (0, jsx_runtime_1.jsx)("circle", { cx: "29.5", cy: "98.4", r: "1.9", fill: "#DDE2E8" }), (0, jsx_runtime_1.jsx)("circle", { cx: "24.3", cy: "29.7", r: "1.3", fill: "#DDE2E8" }), (0, jsx_runtime_1.jsx)("circle", { cx: "96.7", cy: "23.1", r: "1.3", fill: "#DDE2E8" }), (0, jsx_runtime_1.jsx)("circle", { cx: "103.9", cy: "86.3", r: "1.3", fill: "#EBEEF1" })] })));
|
|
7
|
+
const DataGridNoData = ({ title = 'Нет данных', noDataIcon = BaseNoDataIcon(), noDataIconWidth = 250, }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataWrapper, { children: (0, jsx_runtime_1.jsxs)(styles_1.DataGridNoDataFigure, { children: [(0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataIcon, Object.assign({ noDataIconWidth: noDataIconWidth }, { children: noDataIcon })), (0, jsx_runtime_1.jsx)(styles_1.DataGridNoDataFigcaption, Object.assign({ component: "figcaption", variant: "h4" }, { children: title }))] }) }));
|
|
21
9
|
};
|
|
22
10
|
exports.DataGridNoData = DataGridNoData;
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.DataGridNoDataFigcaption = exports.DataGridNoDataIcon = exports.DataGridNoDataFigure = exports.DataGridNoDataWrapper = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.DataGridNoDataWrapper = styles_1.styled.tr
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const Typography_1 = require("../../Typography");
|
|
5
|
+
const styles_1 = require("../../styles");
|
|
6
|
+
exports.DataGridNoDataWrapper = styles_1.styled.tr `
|
|
7
|
+
position: sticky;
|
|
8
|
+
top: 50%;
|
|
9
|
+
left: 50%;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
|
|
15
|
+
transform: translate(-50%, -50%);
|
|
16
|
+
`;
|
|
17
|
+
exports.DataGridNoDataFigure = styles_1.styled.figure `
|
|
18
|
+
position: absolute;
|
|
19
|
+
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
`;
|
|
24
|
+
exports.DataGridNoDataIcon = styles_1.styled.div `
|
|
25
|
+
svg {
|
|
26
|
+
width: ${({ noDataIconWidth }) => `${noDataIconWidth}px`};
|
|
27
|
+
height: auto;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
exports.DataGridNoDataFigcaption = (0, styles_1.styled)(Typography_1.Typography) `
|
|
31
|
+
color: ${({ theme }) => theme.palette.grey[600]};
|
|
32
|
+
`;
|