@comet/admin 8.20.2 → 9.0.0-beta.1
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/lib/ContentOverflow.js +42 -46
- package/lib/DeleteMutation.js +25 -31
- package/lib/EditDialog.js +33 -38
- package/lib/EditDialogApiContext.js +4 -11
- package/lib/FinalForm.d.ts +3 -3
- package/lib/FinalForm.d.ts.map +1 -1
- package/lib/FinalForm.js +44 -52
- package/lib/FinalFormSaveButton.js +11 -17
- package/lib/FinalFormSaveCancelButtonsLegacy.js +19 -25
- package/lib/FinalFormSaveSplitButton.js +22 -28
- package/lib/FormMutation.js +4 -10
- package/lib/Selected.js +17 -23
- package/lib/Selection.js +10 -17
- package/lib/SelectionApi.js +1 -5
- package/lib/SelectionRoute.js +19 -26
- package/lib/alert/Alert.js +26 -31
- package/lib/alert/__stories__/Alert.stories.js +25 -30
- package/lib/apollo/filterByFragment.js +12 -18
- package/lib/apollo/useFocusAwarePolling.js +4 -9
- package/lib/appHeader/AppHeader.js +12 -18
- package/lib/appHeader/button/AppHeaderButton.js +10 -16
- package/lib/appHeader/button/AppHeaderButton.styles.d.ts +1 -3
- package/lib/appHeader/button/AppHeaderButton.styles.d.ts.map +1 -1
- package/lib/appHeader/button/AppHeaderButton.styles.js +12 -18
- package/lib/appHeader/dropdown/AppHeaderDropdown.js +21 -27
- package/lib/appHeader/fillSpace/AppHeaderFillSpace.js +8 -14
- package/lib/appHeader/menuButton/AppHeaderMenuButton.js +15 -21
- package/lib/buildRestMutation.d.ts +3 -3
- package/lib/buildRestMutation.d.ts.map +1 -1
- package/lib/buildRestMutation.js +7 -15
- package/lib/clipboard/readClipboardText.js +4 -10
- package/lib/clipboard/writeClipboardText.js +3 -10
- package/lib/common/ClearInputAdornment.js +14 -20
- package/lib/common/CometLogo.js +9 -15
- package/lib/common/DeleteDialog.js +25 -29
- package/lib/common/Dialog.js +17 -21
- package/lib/common/FieldSet.js +34 -41
- package/lib/common/FillSpace.js +8 -14
- package/lib/common/FullHeightContent.js +12 -18
- package/lib/common/HoverActions.js +18 -24
- package/lib/common/Loading.js +15 -21
- package/lib/common/MainContent.js +17 -24
- package/lib/common/OpenPickerAdornment.js +10 -16
- package/lib/common/ReadOnlyAdornment.js +10 -16
- package/lib/common/Tooltip.d.ts +3 -3
- package/lib/common/Tooltip.d.ts.map +1 -1
- package/lib/common/Tooltip.js +27 -35
- package/lib/common/buttons/Button.js +19 -23
- package/lib/common/buttons/CopyToClipboardButton.js +27 -33
- package/lib/common/buttons/SaveButton.js +13 -19
- package/lib/common/buttons/cancel/CancelButton.js +13 -19
- package/lib/common/buttons/clearinput/ClearInputButton.js +15 -20
- package/lib/common/buttons/delete/DeleteButton.js +13 -19
- package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +4 -10
- package/lib/common/buttons/feedback/FeedbackButton.js +23 -29
- package/lib/common/buttons/helpDialogButton/HelpDialogButton.js +15 -21
- package/lib/common/buttons/helpDialogButton/HelpDialogButton.sc.d.ts +2 -4
- package/lib/common/buttons/helpDialogButton/HelpDialogButton.sc.d.ts.map +1 -1
- package/lib/common/buttons/helpDialogButton/HelpDialogButton.sc.js +6 -12
- package/lib/common/buttons/okay/OkayButton.js +13 -19
- package/lib/common/buttons/split/SplitButton.js +38 -40
- package/lib/common/buttons/split/SplitButtonContext.js +3 -7
- package/lib/common/buttons/split/useSplitButtonContext.js +4 -9
- package/lib/common/toolbar/DataGridToolbar.js +11 -17
- package/lib/common/toolbar/StackToolbar.js +6 -12
- package/lib/common/toolbar/Toolbar.js +28 -34
- package/lib/common/toolbar/ToolbarBreadcrumbs.js +64 -70
- package/lib/common/toolbar/actions/ToolbarActionButton.js +19 -24
- package/lib/common/toolbar/actions/ToolbarActions.js +8 -14
- package/lib/common/toolbar/automatictitleitem/ToolbarAutomaticTitleItem.js +12 -18
- package/lib/common/toolbar/backbutton/ToolbarBackButton.js +22 -28
- package/lib/common/toolbar/fillspace/ToolbarFillSpace.js +8 -14
- package/lib/common/toolbar/item/ToolbarItem.js +8 -14
- package/lib/common/toolbar/titleitem/ToolbarTitleItem.js +11 -17
- package/lib/dataGrid/CrudContextMenu.js +58 -64
- package/lib/dataGrid/CrudMoreActionsMenu.js +46 -54
- package/lib/dataGrid/CrudVisibility.js +26 -32
- package/lib/dataGrid/CrudVisibilityIcon.d.ts +1 -0
- package/lib/dataGrid/CrudVisibilityIcon.d.ts.map +1 -1
- package/lib/dataGrid/CrudVisibilityIcon.js +7 -13
- package/lib/dataGrid/DataGridPanel.js +83 -87
- package/lib/dataGrid/GridCellContent.js +21 -27
- package/lib/dataGrid/GridColDef.js +1 -5
- package/lib/dataGrid/GridColumnsButton.js +14 -20
- package/lib/dataGrid/GridFilterButton.js +17 -23
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagement.js +34 -39
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagement.sc.d.ts +3 -9
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagement.sc.d.ts.map +1 -1
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagement.sc.js +11 -17
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagementListItem.js +21 -27
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagementListItem.styles.d.ts +2 -6
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagementListItem.styles.d.ts.map +1 -1
- package/lib/dataGrid/columnsManagement/DataGridColumnsManagementListItem.styles.js +11 -17
- package/lib/dataGrid/excelExport/applyDefaultStyling.js +1 -7
- package/lib/dataGrid/excelExport/generateExcelFile.js +4 -11
- package/lib/dataGrid/excelExport/useDataGridExcelExport.js +14 -20
- package/lib/dataGrid/gridColumnTypes.js +30 -36
- package/lib/dataGrid/muiGridFilterToGql.d.ts +4 -1
- package/lib/dataGrid/muiGridFilterToGql.d.ts.map +1 -1
- package/lib/dataGrid/muiGridFilterToGql.js +1 -7
- package/lib/dataGrid/muiGridPagingToGql.js +1 -7
- package/lib/dataGrid/muiGridSortToGql.js +1 -7
- package/lib/dataGrid/pagination/DataGridPagination.js +21 -27
- package/lib/dataGrid/pagination/DataGridPagination.styles.d.ts +1 -3
- package/lib/dataGrid/pagination/DataGridPagination.styles.d.ts.map +1 -1
- package/lib/dataGrid/pagination/DataGridPagination.styles.js +5 -11
- package/lib/dataGrid/pagination/paginationActions/DataGridPaginationActions.js +21 -27
- package/lib/dataGrid/pagination/paginationActions/DataGridPaginationActions.styles.d.ts +1 -3
- package/lib/dataGrid/pagination/paginationActions/DataGridPaginationActions.styles.d.ts.map +1 -1
- package/lib/dataGrid/pagination/paginationActions/DataGridPaginationActions.styles.js +7 -13
- package/lib/dataGrid/renderStaticSelectCell.js +1 -7
- package/lib/dataGrid/useBufferedRowCount.js +4 -10
- package/lib/dataGrid/useDataGridRemote.js +3 -9
- package/lib/dataGrid/useDataGridUrlState.js +17 -24
- package/lib/dataGrid/usePersistentColumnState.d.ts +3 -3
- package/lib/dataGrid/usePersistentColumnState.d.ts.map +1 -1
- package/lib/dataGrid/usePersistentColumnState.js +20 -26
- package/lib/dateTime/datePicker/DatePicker.d.ts +8 -8
- package/lib/dateTime/datePicker/DatePicker.d.ts.map +1 -1
- package/lib/dateTime/datePicker/DatePicker.js +31 -37
- package/lib/dateTime/datePicker/__stories__/DatePicker.stories.js +37 -42
- package/lib/dateTime/datePickerField/DatePickerField.d.ts +3 -3
- package/lib/dateTime/datePickerField/DatePickerField.d.ts.map +1 -1
- package/lib/dateTime/datePickerField/DatePickerField.js +6 -12
- package/lib/dateTime/datePickerField/__stories__/DatePickerField.stories.js +32 -37
- package/lib/dateTime/dateRangePicker/DateRangePicker.d.ts +8 -8
- package/lib/dateTime/dateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/lib/dateTime/dateRangePicker/DateRangePicker.js +37 -45
- package/lib/dateTime/dateRangePicker/__stories__/DateRangePicker.stories.js +37 -42
- package/lib/dateTime/dateRangePickerField/DateRangePickerField.d.ts +2 -2
- package/lib/dateTime/dateRangePickerField/DateRangePickerField.d.ts.map +1 -1
- package/lib/dateTime/dateRangePickerField/DateRangePickerField.js +6 -12
- package/lib/dateTime/dateRangePickerField/__stories__/DateRangePickerField.stories.js +32 -37
- package/lib/dateTime/dateTimePicker/DateTimePicker.d.ts +8 -8
- package/lib/dateTime/dateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/lib/dateTime/dateTimePicker/DateTimePicker.js +29 -35
- package/lib/dateTime/dateTimePicker/__stories__/DateTimePicker.stories.js +37 -42
- package/lib/dateTime/dateTimePickerField/DateTimePickerField.d.ts +2 -2
- package/lib/dateTime/dateTimePickerField/DateTimePickerField.d.ts.map +1 -1
- package/lib/dateTime/dateTimePickerField/DateTimePickerField.js +6 -12
- package/lib/dateTime/dateTimePickerField/__stories__/DateTimePickerField.stories.js +32 -37
- package/lib/dateTime/dateTimeRangePicker/DateTimeRangePicker.js +34 -42
- package/lib/dateTime/dateTimeRangePicker/__stories__/DateTimeRangePicker.stories.js +37 -42
- package/lib/dateTime/dateTimeRangePickerField/DateTimeRangePickerField.js +6 -12
- package/lib/dateTime/dateTimeRangePickerField/__stories__/DateTimeRangePickerField.stories.js +32 -37
- package/lib/dateTime/timePicker/TimePicker.d.ts +8 -8
- package/lib/dateTime/timePicker/TimePicker.d.ts.map +1 -1
- package/lib/dateTime/timePicker/TimePicker.js +30 -36
- package/lib/dateTime/timePicker/__stories__/TimePicker.stories.js +37 -42
- package/lib/dateTime/timePickerField/TimePickerField.d.ts +2 -2
- package/lib/dateTime/timePickerField/TimePickerField.d.ts.map +1 -1
- package/lib/dateTime/timePickerField/TimePickerField.js +6 -12
- package/lib/dateTime/timePickerField/__stories__/TimePickerField.stories.js +32 -37
- package/lib/dateTime/utils.js +5 -11
- package/lib/error/errorboundary/ErrorBoundary.js +39 -44
- package/lib/error/errorboundary/RouteWithErrorBoundary.js +8 -13
- package/lib/error/errordialog/ErrorDialog.d.ts.map +1 -1
- package/lib/error/errordialog/ErrorDialog.js +77 -83
- package/lib/error/errordialog/ErrorDialogHandler.js +11 -17
- package/lib/error/errordialog/ErrorScope.js +3 -9
- package/lib/error/errordialog/createErrorDialogApolloLink.js +11 -17
- package/lib/error/errordialog/errorDialogVar.js +2 -8
- package/lib/error/errordialog/useErrorDialog.js +5 -11
- package/lib/fetchProvider/fetch.js +6 -14
- package/lib/fileIcons/Excel.js +5 -12
- package/lib/fileIcons/File.js +5 -12
- package/lib/fileIcons/FileIcon.js +29 -35
- package/lib/fileIcons/Jpg.js +5 -12
- package/lib/fileIcons/Pdf.js +5 -12
- package/lib/fileIcons/Png.js +5 -12
- package/lib/fileIcons/Powerpoint.js +5 -12
- package/lib/fileIcons/Word.js +5 -12
- package/lib/fileIcons/Zip.js +5 -12
- package/lib/form/Autocomplete.d.ts +4 -2
- package/lib/form/Autocomplete.d.ts.map +1 -1
- package/lib/form/Autocomplete.js +25 -27
- package/lib/form/Checkbox.js +4 -11
- package/lib/form/Field.js +17 -23
- package/lib/form/FieldContainer.js +41 -47
- package/lib/form/FinalFormAsyncAutocomplete.js +5 -11
- package/lib/form/FinalFormAsyncSelect.js +5 -11
- package/lib/form/FinalFormContextProvider.js +7 -14
- package/lib/form/FinalFormDebug.js +16 -20
- package/lib/form/FinalFormFileSelect.js +14 -20
- package/lib/form/FinalFormInput.d.ts +1 -2
- package/lib/form/FinalFormInput.d.ts.map +1 -1
- package/lib/form/FinalFormInput.js +30 -30
- package/lib/form/FinalFormNumberInput.d.ts +1 -2
- package/lib/form/FinalFormNumberInput.d.ts.map +1 -1
- package/lib/form/FinalFormNumberInput.js +22 -22
- package/lib/form/FinalFormRangeInput.js +32 -38
- package/lib/form/FinalFormSearchTextField.d.ts +0 -1
- package/lib/form/FinalFormSearchTextField.d.ts.map +1 -1
- package/lib/form/FinalFormSearchTextField.js +13 -31
- package/lib/form/FinalFormSelect.js +25 -31
- package/lib/form/FinalFormSelect.sc.d.ts +1 -3
- package/lib/form/FinalFormSelect.sc.d.ts.map +1 -1
- package/lib/form/FinalFormSelect.sc.js +5 -11
- package/lib/form/FinalFormToggleButtonGroup.js +12 -18
- package/lib/form/FormSection.d.ts +1 -1
- package/lib/form/FormSection.js +18 -24
- package/lib/form/Radio.js +4 -11
- package/lib/form/Switch.js +4 -11
- package/lib/form/fields/AsyncAutocompleteField.js +6 -12
- package/lib/form/fields/AsyncSelectField.js +6 -12
- package/lib/form/fields/AutocompleteField.js +6 -12
- package/lib/form/fields/CheckboxField.js +8 -14
- package/lib/form/fields/CheckboxListField.js +8 -14
- package/lib/form/fields/NumberField.js +6 -12
- package/lib/form/fields/RadioGroupField.js +9 -16
- package/lib/form/fields/SearchField.js +6 -12
- package/lib/form/fields/SelectField.js +11 -15
- package/lib/form/fields/SwitchField.js +8 -14
- package/lib/form/fields/TextAreaField.js +6 -12
- package/lib/form/fields/TextField.js +6 -12
- package/lib/form/fields/ToggleButtonGroupField.js +6 -12
- package/lib/form/file/FileDropzone.js +35 -41
- package/lib/form/file/FileSelect.d.ts +2 -3
- package/lib/form/file/FileSelect.d.ts.map +1 -1
- package/lib/form/file/FileSelect.js +38 -52
- package/lib/form/file/FileSelectListItem.js +59 -65
- package/lib/form/file/commonErrorMessages.js +6 -12
- package/lib/form/file/fileSelectItemTypes.js +1 -5
- package/lib/form/helpers/OnChangeField.js +7 -13
- package/lib/form/useAsyncAutocompleteOptionsProps.js +10 -16
- package/lib/fullPageAlert/FullPageAlert.js +26 -32
- package/lib/fullPageAlert/FullPageAlert.styles.d.ts +3 -9
- package/lib/fullPageAlert/FullPageAlert.styles.d.ts.map +1 -1
- package/lib/fullPageAlert/FullPageAlert.styles.js +19 -25
- package/lib/fullPageAlert/FullPageAlertBackground.js +44 -50
- package/lib/helpers/PrettyBytes.js +4 -10
- package/lib/helpers/ThemedComponentBaseProps.js +1 -5
- package/lib/helpers/createComponentSlot.d.ts +1 -1
- package/lib/helpers/createComponentSlot.d.ts.map +1 -1
- package/lib/helpers/createComponentSlot.js +11 -15
- package/lib/helpers/downloadFile.d.ts +7 -0
- package/lib/helpers/downloadFile.d.ts.map +1 -0
- package/lib/helpers/downloadFile.js +22 -0
- package/lib/helpers/useTopOffset.d.ts +1 -1
- package/lib/helpers/useTopOffset.d.ts.map +1 -1
- package/lib/helpers/useTopOffset.js +4 -10
- package/lib/helpers/useWindowSize.js +4 -10
- package/lib/hooks/useAsyncOptionsProps.js +6 -12
- package/lib/hooks/useElementIsOverflowing.d.ts +1 -1
- package/lib/hooks/useElementIsOverflowing.d.ts.map +1 -1
- package/lib/hooks/useElementIsOverflowing.js +4 -10
- package/lib/hooks/useStoredState.js +9 -12
- package/lib/index.d.ts +10 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +226 -1860
- package/lib/inlineAlert/InlineAlert.js +19 -25
- package/lib/inlineAlert/InlineAlert.sc.d.ts +2 -6
- package/lib/inlineAlert/InlineAlert.sc.d.ts.map +1 -1
- package/lib/inlineAlert/InlineAlert.sc.js +13 -19
- package/lib/inputWithPopper/InputWithPopper.d.ts +1 -1
- package/lib/inputWithPopper/InputWithPopper.d.ts.map +1 -1
- package/lib/inputWithPopper/InputWithPopper.js +19 -25
- package/lib/inputWithPopper/InputWithPopper.slots.d.ts +2 -4
- package/lib/inputWithPopper/InputWithPopper.slots.d.ts.map +1 -1
- package/lib/inputWithPopper/InputWithPopper.slots.js +9 -15
- package/lib/messages.js +2 -8
- package/lib/mui/MasterLayout.js +34 -40
- package/lib/mui/MasterLayoutContext.js +2 -8
- package/lib/mui/ThemeProvider.js +7 -13
- package/lib/mui/mainNavigation/CollapsibleItem.js +32 -38
- package/lib/mui/mainNavigation/CollapsibleItem.styles.d.ts +1 -3
- package/lib/mui/mainNavigation/CollapsibleItem.styles.d.ts.map +1 -1
- package/lib/mui/mainNavigation/CollapsibleItem.styles.js +12 -18
- package/lib/mui/mainNavigation/Context.js +8 -14
- package/lib/mui/mainNavigation/Item.d.ts.map +1 -1
- package/lib/mui/mainNavigation/Item.js +14 -21
- package/lib/mui/mainNavigation/Item.styles.d.ts +1 -3
- package/lib/mui/mainNavigation/Item.styles.d.ts.map +1 -1
- package/lib/mui/mainNavigation/Item.styles.js +7 -13
- package/lib/mui/mainNavigation/ItemAnchorLink.js +6 -12
- package/lib/mui/mainNavigation/ItemGroup.js +27 -33
- package/lib/mui/mainNavigation/ItemRouterLink.js +9 -15
- package/lib/mui/mainNavigation/MainNavigation.js +25 -31
- package/lib/mui/mainNavigation/MainNavigation.styles.js +13 -19
- package/lib/mui/mui-private-theming.d.js +0 -1
- package/lib/renderFinalFormChildren.js +3 -9
- package/lib/router/BrowserRouter.js +12 -16
- package/lib/router/ConfirmationDialog.js +42 -47
- package/lib/router/Context.d.ts +2 -2
- package/lib/router/Context.d.ts.map +1 -1
- package/lib/router/Context.js +2 -8
- package/lib/router/ForcePromptRoute.js +12 -19
- package/lib/router/MemoryRouter.js +12 -16
- package/lib/router/Prompt.js +18 -25
- package/lib/router/PromptHandler.d.ts +2 -2
- package/lib/router/PromptHandler.d.ts.map +1 -1
- package/lib/router/PromptHandler.js +17 -23
- package/lib/router/SubRoute.js +15 -23
- package/lib/rowActions/RowActionsIconItem.d.ts +2 -1
- package/lib/rowActions/RowActionsIconItem.d.ts.map +1 -1
- package/lib/rowActions/RowActionsIconItem.js +8 -14
- package/lib/rowActions/RowActionsItem.js +9 -15
- package/lib/rowActions/RowActionsListItem.js +10 -16
- package/lib/rowActions/RowActionsMenu.js +9 -15
- package/lib/rowActions/RowActionsSubMenu.js +17 -23
- package/lib/saveBoundary/SaveBoundary.js +32 -41
- package/lib/saveBoundary/SaveBoundarySaveButton.js +7 -13
- package/lib/section/SectionHeadline.d.ts +1 -1
- package/lib/section/SectionHeadline.js +30 -36
- package/lib/snackbar/SnackbarProvider.js +13 -19
- package/lib/snackbar/UndoSnackbar.js +12 -18
- package/lib/stack/Api.d.ts +1 -1
- package/lib/stack/Api.d.ts.map +1 -1
- package/lib/stack/Api.js +8 -16
- package/lib/stack/Breadcrumb.js +11 -17
- package/lib/stack/Page.js +3 -9
- package/lib/stack/Stack.js +22 -28
- package/lib/stack/StackLink.js +7 -13
- package/lib/stack/StackPageTitle.js +7 -14
- package/lib/stack/Switch.js +40 -49
- package/lib/stack/SwitchMeta.js +9 -15
- package/lib/stack/backbutton/StackBackButton.js +15 -21
- package/lib/stack/breadcrumbs/BreadcrumbLink.js +5 -11
- package/lib/stack/breadcrumbs/BreadcrumbsEntry.js +23 -29
- package/lib/stack/breadcrumbs/BreadcrumbsOverflow.js +20 -26
- package/lib/stack/breadcrumbs/StackBreadcrumbs.js +35 -42
- package/lib/stack/breadcrumbs/utils.js +11 -17
- package/lib/stack/useIsActiveStackSwitch.js +5 -11
- package/lib/table/AddButton.js +11 -17
- package/lib/table/DeleteButton.js +19 -25
- package/lib/table/ExcelExportButton.js +11 -17
- package/lib/table/LocalChangesToolbar.js +11 -17
- package/lib/table/Pagination.js +22 -29
- package/lib/table/Table.d.ts.map +1 -1
- package/lib/table/Table.js +51 -54
- package/lib/table/TableBodyRow.js +12 -17
- package/lib/table/TableDndOrder.js +32 -39
- package/lib/table/TableFilterFinalForm.js +23 -29
- package/lib/table/TableLocalChanges.js +11 -15
- package/lib/table/TableQuery.js +27 -33
- package/lib/table/TableQueryContext.js +2 -7
- package/lib/table/excelexport/IExportApi.js +1 -5
- package/lib/table/excelexport/applyDefaultStyling.js +1 -7
- package/lib/table/excelexport/createExcelExportDownload.js +15 -19
- package/lib/table/excelexport/useExportDisplayedTableData.js +5 -11
- package/lib/table/excelexport/useExportPagedTableQuery.js +8 -14
- package/lib/table/excelexport/useExportTableQuery.js +7 -13
- package/lib/table/filterbar/FilterBar.js +15 -20
- package/lib/table/filterbar/dirtyFieldsCount.js +3 -8
- package/lib/table/filterbar/filterBarActiveFilterBadge/FilterBarActiveFilterBadge.js +14 -19
- package/lib/table/filterbar/filterBarButton/FilterBarButton.js +24 -28
- package/lib/table/filterbar/filterBarMoreFilters/FilterBarMoreFilters.js +23 -28
- package/lib/table/filterbar/filterBarPopoverFilter/FilterBarPopoverFilter.js +44 -48
- package/lib/table/isVisible.js +1 -7
- package/lib/table/paging/IPagingInfo.d.ts +1 -1
- package/lib/table/paging/IPagingInfo.d.ts.map +1 -1
- package/lib/table/paging/IPagingInfo.js +1 -5
- package/lib/table/paging/createOffsetLimitPagingAction.js +1 -7
- package/lib/table/paging/createPagePagingActions.js +1 -7
- package/lib/table/paging/createRelayPagingActions.js +1 -7
- package/lib/table/paging/createRestPagingActions.js +3 -10
- package/lib/table/paging/createRestStartLimitPagingActions.js +1 -7
- package/lib/table/safeColumnGet.js +3 -8
- package/lib/table/usePersistedState.js +4 -10
- package/lib/table/usePersistedStateId.js +5 -11
- package/lib/table/useTableQuery.js +8 -13
- package/lib/table/useTableQueryFilter.js +13 -19
- package/lib/table/useTableQueryPaging.d.ts +1 -1
- package/lib/table/useTableQueryPaging.d.ts.map +1 -1
- package/lib/table/useTableQueryPaging.js +5 -10
- package/lib/table/useTableQuerySort.js +7 -11
- package/lib/table/withTableQueryContext.js +11 -13
- package/lib/tabs/RouterTabs.js +37 -44
- package/lib/tabs/TabScrollButton.js +14 -21
- package/lib/tabs/Tabs.js +27 -35
- package/lib/theme/breakpointsOptions.js +2 -8
- package/lib/theme/colors.js +7 -13
- package/lib/theme/componentsTheme/MuiAccordion.js +3 -9
- package/lib/theme/componentsTheme/MuiAlert.js +9 -15
- package/lib/theme/componentsTheme/MuiAlertTitle.js +3 -9
- package/lib/theme/componentsTheme/MuiAppBar.js +1 -7
- package/lib/theme/componentsTheme/MuiAutocomplete.js +8 -14
- package/lib/theme/componentsTheme/MuiBadge.js +3 -9
- package/lib/theme/componentsTheme/MuiButton.js +14 -20
- package/lib/theme/componentsTheme/MuiButtonGroup.js +8 -14
- package/lib/theme/componentsTheme/MuiCard.js +5 -11
- package/lib/theme/componentsTheme/MuiCardContent.js +3 -9
- package/lib/theme/componentsTheme/MuiCardHeader.js +3 -9
- package/lib/theme/componentsTheme/MuiCheckbox.js +16 -22
- package/lib/theme/componentsTheme/MuiChip.js +6 -12
- package/lib/theme/componentsTheme/MuiDataGrid.js +48 -54
- package/lib/theme/componentsTheme/MuiDialog.js +3 -9
- package/lib/theme/componentsTheme/MuiDialogActions.js +3 -9
- package/lib/theme/componentsTheme/MuiDialogContent.js +6 -12
- package/lib/theme/componentsTheme/MuiDialogContentText.js +3 -9
- package/lib/theme/componentsTheme/MuiDialogTitle.js +3 -9
- package/lib/theme/componentsTheme/MuiDrawer.js +3 -9
- package/lib/theme/componentsTheme/MuiFormControlLabel.js +3 -9
- package/lib/theme/componentsTheme/MuiFormHelperText.js +3 -9
- package/lib/theme/componentsTheme/MuiFormLabel.js +3 -9
- package/lib/theme/componentsTheme/MuiIconButton.js +3 -9
- package/lib/theme/componentsTheme/MuiInput.js +1 -7
- package/lib/theme/componentsTheme/MuiInputAdornment.js +3 -9
- package/lib/theme/componentsTheme/MuiInputBase.js +7 -13
- package/lib/theme/componentsTheme/MuiLinearProgress.js +3 -9
- package/lib/theme/componentsTheme/MuiLink.js +3 -9
- package/lib/theme/componentsTheme/MuiList.js +5 -11
- package/lib/theme/componentsTheme/MuiListItem.js +5 -11
- package/lib/theme/componentsTheme/MuiListItemAvatar.js +3 -9
- package/lib/theme/componentsTheme/MuiListItemButton.js +5 -11
- package/lib/theme/componentsTheme/MuiListItemIcon.js +3 -9
- package/lib/theme/componentsTheme/MuiListItemText.js +3 -9
- package/lib/theme/componentsTheme/MuiMenu.js +3 -9
- package/lib/theme/componentsTheme/MuiMenuItem.js +8 -14
- package/lib/theme/componentsTheme/MuiNativeSelect.js +8 -14
- package/lib/theme/componentsTheme/MuiPaper.js +3 -9
- package/lib/theme/componentsTheme/MuiPickersInputBase.js +17 -23
- package/lib/theme/componentsTheme/MuiPickersPopper.js +3 -9
- package/lib/theme/componentsTheme/MuiPickersTextField.js +1 -7
- package/lib/theme/componentsTheme/MuiPopover.js +1 -7
- package/lib/theme/componentsTheme/MuiRadio.js +13 -19
- package/lib/theme/componentsTheme/MuiSelect.js +10 -16
- package/lib/theme/componentsTheme/MuiSvgIcon.js +3 -9
- package/lib/theme/componentsTheme/MuiSwitch.js +14 -20
- package/lib/theme/componentsTheme/MuiTab.js +5 -11
- package/lib/theme/componentsTheme/MuiTableCell.js +5 -11
- package/lib/theme/componentsTheme/MuiTableFooter.js +3 -9
- package/lib/theme/componentsTheme/MuiTablePagination.js +5 -11
- package/lib/theme/componentsTheme/MuiTableRow.js +3 -9
- package/lib/theme/componentsTheme/MuiTabs.js +3 -9
- package/lib/theme/componentsTheme/MuiToggleButton.js +5 -11
- package/lib/theme/componentsTheme/MuiToggleButtonGroup.js +3 -9
- package/lib/theme/componentsTheme/MuiTooltip.js +1 -7
- package/lib/theme/componentsTheme/MuiTypography.js +3 -9
- package/lib/theme/componentsTheme/commonListStyles.js +1 -7
- package/lib/theme/componentsTheme/getCommonSelectTheme.js +8 -14
- package/lib/theme/componentsTheme/getComponentsTheme.js +115 -121
- package/lib/theme/createCometTheme.js +20 -26
- package/lib/theme/paletteOptions.js +16 -22
- package/lib/theme/shadows.js +1 -7
- package/lib/theme/typographyOptions.js +1 -7
- package/lib/theme/utils/mergeOverrideStyles.js +4 -9
- package/lib/translator/BaseTranslationDialog.d.ts +1 -0
- package/lib/translator/BaseTranslationDialog.d.ts.map +1 -1
- package/lib/translator/BaseTranslationDialog.js +28 -32
- package/lib/translator/ContentTranslationServiceContext.js +2 -8
- package/lib/translator/ContentTranslationServiceProvider.js +4 -10
- package/lib/translator/PlainTextTranslationDialog.js +7 -13
- package/lib/translator/useContentTranslationService.js +4 -10
- package/lib/utils/test-utils.js +22 -39
- package/lib/utils/useObservedWidth.d.ts +1 -1
- package/lib/utils/useObservedWidth.d.ts.map +1 -1
- package/lib/utils/useObservedWidth.js +7 -14
- package/lib/vendor.d.js +0 -1
- package/package.json +27 -25
- package/lib/form/file/getFilesInfoText.d.ts +0 -3
- package/lib/form/file/getFilesInfoText.d.ts.map +0 -1
- package/lib/form/file/getFilesInfoText.js +0 -55
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.TableLocalChangesToolbar = void 0;
|
|
7
|
-
var _material = require("@mui/material");
|
|
8
|
-
var _reactIntl = require("react-intl");
|
|
9
|
-
var _SaveButton = require("../common/buttons/SaveButton");
|
|
10
|
-
var _Loading = require("../common/Loading");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import { Toolbar } from "@mui/material";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import { SaveButton } from "../common/buttons/SaveButton";
|
|
4
|
+
import { Loading } from "../common/Loading";
|
|
5
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
6
|
/**
|
|
13
7
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
14
8
|
*/
|
|
15
|
-
var TableLocalChangesToolbar =
|
|
9
|
+
export var TableLocalChangesToolbar = function TableLocalChangesToolbar(_ref) {
|
|
16
10
|
var tableLocalChangesApi = _ref.tableLocalChangesApi,
|
|
17
11
|
localChangesCount = _ref.localChangesCount,
|
|
18
12
|
updateMutation = _ref.updateMutation,
|
|
@@ -20,13 +14,13 @@ var TableLocalChangesToolbar = exports.TableLocalChangesToolbar = function Table
|
|
|
20
14
|
var handleSaveClick = function handleSaveClick() {
|
|
21
15
|
tableLocalChangesApi.submitLocalDataChanges();
|
|
22
16
|
};
|
|
23
|
-
return /*#__PURE__*/(
|
|
24
|
-
children: loading ? /*#__PURE__*/(
|
|
17
|
+
return /*#__PURE__*/_jsx(Toolbar, {
|
|
18
|
+
children: loading ? /*#__PURE__*/_jsx(Loading, {
|
|
25
19
|
behavior: "fillParent"
|
|
26
|
-
}) : /*#__PURE__*/(
|
|
27
|
-
children: [/*#__PURE__*/(
|
|
20
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
|
+
children: [/*#__PURE__*/_jsx(SaveButton, {
|
|
28
22
|
onClick: handleSaveClick
|
|
29
|
-
}), /*#__PURE__*/(
|
|
23
|
+
}), /*#__PURE__*/_jsx(FormattedMessage, {
|
|
30
24
|
values: {
|
|
31
25
|
count: localChangesCount
|
|
32
26
|
},
|
package/lib/table/Pagination.js
CHANGED
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.TablePagination = void 0;
|
|
7
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
|
-
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
1
|
+
import { ChevronLeft, ChevronRight } from "@comet/admin-icons";
|
|
2
|
+
import { Grid, IconButton, Toolbar, Typography } from "@mui/material";
|
|
3
|
+
import TableCell from "@mui/material/TableCell";
|
|
4
|
+
import { FormattedMessage, FormattedNumber } from "react-intl";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
6
|
/**
|
|
14
7
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
15
8
|
*/
|
|
16
|
-
var TablePagination =
|
|
9
|
+
export var TablePagination = function TablePagination(_ref) {
|
|
17
10
|
var totalCount = _ref.totalCount,
|
|
18
11
|
pagingInfo = _ref.pagingInfo,
|
|
19
12
|
rowName = _ref.rowName;
|
|
20
13
|
if (typeof rowName === "function") {
|
|
21
14
|
rowName = rowName(totalCount);
|
|
22
15
|
}
|
|
23
|
-
return /*#__PURE__*/(
|
|
16
|
+
return /*#__PURE__*/_jsx(TableCell, {
|
|
24
17
|
colSpan: 1000,
|
|
25
|
-
children: /*#__PURE__*/(
|
|
26
|
-
children: /*#__PURE__*/(
|
|
18
|
+
children: /*#__PURE__*/_jsx(Toolbar, {
|
|
19
|
+
children: /*#__PURE__*/_jsxs(Grid, {
|
|
27
20
|
container: true,
|
|
28
21
|
justifyContent: "space-between",
|
|
29
22
|
alignItems: "center",
|
|
30
|
-
children: [/*#__PURE__*/(
|
|
31
|
-
children: /*#__PURE__*/(
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
|
24
|
+
children: /*#__PURE__*/_jsxs(Typography, {
|
|
32
25
|
color: "textPrimary",
|
|
33
26
|
variant: "body2",
|
|
34
|
-
children: [/*#__PURE__*/(
|
|
27
|
+
children: [/*#__PURE__*/_jsx(FormattedNumber, {
|
|
35
28
|
value: totalCount
|
|
36
29
|
}), " ", rowName]
|
|
37
30
|
})
|
|
38
|
-
}), /*#__PURE__*/(
|
|
39
|
-
children: /*#__PURE__*/(
|
|
31
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
32
|
+
children: /*#__PURE__*/_jsxs(Grid, {
|
|
40
33
|
container: true,
|
|
41
34
|
alignItems: "center",
|
|
42
35
|
spacing: 2,
|
|
43
|
-
children: [pagingInfo.totalPages && pagingInfo.currentPage && /*#__PURE__*/(
|
|
44
|
-
children: /*#__PURE__*/(
|
|
36
|
+
children: [pagingInfo.totalPages && pagingInfo.currentPage && /*#__PURE__*/_jsx(Grid, {
|
|
37
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
45
38
|
color: "textSecondary",
|
|
46
39
|
variant: "body2",
|
|
47
|
-
children: /*#__PURE__*/(
|
|
40
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
48
41
|
id: "comet.table.pagination.pageInfo",
|
|
49
42
|
values: {
|
|
50
43
|
total: pagingInfo.totalPages,
|
|
@@ -54,21 +47,21 @@ var TablePagination = exports.TablePagination = function TablePagination(_ref) {
|
|
|
54
47
|
description: "Pagination-info"
|
|
55
48
|
})
|
|
56
49
|
})
|
|
57
|
-
}), /*#__PURE__*/(
|
|
58
|
-
children: [/*#__PURE__*/(
|
|
50
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
59
52
|
disabled: !pagingInfo.fetchPreviousPage,
|
|
60
53
|
onClick: function onClick() {
|
|
61
54
|
return pagingInfo.fetchPreviousPage();
|
|
62
55
|
},
|
|
63
56
|
size: "large",
|
|
64
|
-
children: /*#__PURE__*/(
|
|
65
|
-
}), /*#__PURE__*/(
|
|
57
|
+
children: /*#__PURE__*/_jsx(ChevronLeft, {})
|
|
58
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
66
59
|
disabled: !pagingInfo.fetchNextPage,
|
|
67
60
|
onClick: function onClick() {
|
|
68
61
|
return pagingInfo.fetchNextPage();
|
|
69
62
|
},
|
|
70
63
|
size: "large",
|
|
71
|
-
children: /*#__PURE__*/(
|
|
64
|
+
children: /*#__PURE__*/_jsx(ChevronRight, {})
|
|
72
65
|
})]
|
|
73
66
|
})]
|
|
74
67
|
})
|
package/lib/table/Table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/table/Table.tsx"],"names":[],"mappings":"AAEA,OAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzE,OAAO,EAAE,SAAS,EAAiC,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAEjG,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,IAAI,SAAS,IAAI,IAAI,sBAAsB,CAAC,IAAI,C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;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAC5D,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IACpE,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,UAAU,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD;;GAEG;AACH,qBAAa,KAAK,CAAC,IAAI,SAAS,IAAI,CAAE,SAAQ,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACtE,OAAO,CAAC,MAAM,CAAqC;gBACvC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC;IAK7B,MAAM;IAgEb,OAAO,CAAC,WAAW,CAIjB;IAEF,OAAO,CAAC,aAAa,CAanB;IAEF,OAAO,CAAC,UAAU;CAGrB"}
|
package/lib/table/Table.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Table = void 0;
|
|
7
|
-
exports.TableColumns = TableColumns;
|
|
8
|
-
exports.TableHeadColumns = TableHeadColumns;
|
|
9
|
-
exports.VisibleType = void 0;
|
|
10
|
-
var _Table2 = _interopRequireDefault(require("@mui/material/Table"));
|
|
11
|
-
var _TableBody = _interopRequireDefault(require("@mui/material/TableBody"));
|
|
12
|
-
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
13
|
-
var _TableFooter = _interopRequireDefault(require("@mui/material/TableFooter"));
|
|
14
|
-
var _TableHead = _interopRequireDefault(require("@mui/material/TableHead"));
|
|
15
|
-
var _TableRow = _interopRequireDefault(require("@mui/material/TableRow"));
|
|
16
|
-
var _TableSortLabel = _interopRequireDefault(require("@mui/material/TableSortLabel"));
|
|
17
|
-
var _react = require("react");
|
|
18
|
-
var _isVisible = require("./isVisible");
|
|
19
|
-
var _Pagination = require("./Pagination");
|
|
20
|
-
var _safeColumnGet = require("./safeColumnGet");
|
|
21
|
-
var _TableBodyRow = require("./TableBodyRow");
|
|
22
|
-
var _useTableQuerySort = require("./useTableQuerySort");
|
|
23
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
25
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
26
2
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
27
3
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
@@ -37,14 +13,30 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
37
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
38
14
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
39
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
40
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
import MuiTable from "@mui/material/Table";
|
|
18
|
+
import TableBody from "@mui/material/TableBody";
|
|
19
|
+
import TableCell from "@mui/material/TableCell";
|
|
20
|
+
import TableFooter from "@mui/material/TableFooter";
|
|
21
|
+
import TableHead from "@mui/material/TableHead";
|
|
22
|
+
import TableRow from "@mui/material/TableRow";
|
|
23
|
+
import TableSortLabel from "@mui/material/TableSortLabel";
|
|
24
|
+
import { Component, createRef } from "react";
|
|
25
|
+
import { isVisible } from "./isVisible";
|
|
26
|
+
import { TablePagination } from "./Pagination";
|
|
27
|
+
import { safeColumnGet } from "./safeColumnGet";
|
|
28
|
+
import { TableBodyRow } from "./TableBodyRow";
|
|
29
|
+
import { SortDirection } from "./useTableQuerySort";
|
|
30
|
+
|
|
31
|
+
/**
|
|
41
32
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
42
33
|
*/
|
|
34
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
43
35
|
function DefaultHeadTableRow(_ref) {
|
|
44
36
|
var columns = _ref.columns,
|
|
45
37
|
sortApi = _ref.sortApi;
|
|
46
|
-
return /*#__PURE__*/(
|
|
47
|
-
children: /*#__PURE__*/(
|
|
38
|
+
return /*#__PURE__*/_jsx(TableRow, {
|
|
39
|
+
children: /*#__PURE__*/_jsx(TableHeadColumns, {
|
|
48
40
|
columns: columns,
|
|
49
41
|
sortApi: sortApi
|
|
50
42
|
})
|
|
@@ -59,23 +51,23 @@ function DefaultHeadTableRow(_ref) {
|
|
|
59
51
|
/**
|
|
60
52
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
61
53
|
*/
|
|
62
|
-
function TableHeadColumns(_ref2) {
|
|
54
|
+
export function TableHeadColumns(_ref2) {
|
|
63
55
|
var columns = _ref2.columns,
|
|
64
56
|
sortApi = _ref2.sortApi;
|
|
65
57
|
var handleSortClick = function handleSortClick(name, ev) {
|
|
66
58
|
if (sortApi) sortApi.changeSort(name);
|
|
67
59
|
};
|
|
68
|
-
return /*#__PURE__*/(
|
|
60
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
69
61
|
children: columns.map(function (column, colIndex) {
|
|
70
|
-
if (!
|
|
62
|
+
if (!isVisible(VisibleType.Browser, column.visible)) return null;
|
|
71
63
|
var name = column.name,
|
|
72
64
|
header = column.header,
|
|
73
65
|
sortable = column.sortable,
|
|
74
66
|
headerProps = column.headerProps;
|
|
75
|
-
return /*#__PURE__*/(
|
|
76
|
-
children: sortable ? /*#__PURE__*/(
|
|
67
|
+
return /*#__PURE__*/_jsx(TableCell, _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
68
|
+
children: sortable ? /*#__PURE__*/_jsx(TableSortLabel, {
|
|
77
69
|
active: sortApi && sortApi.current.columnName === name,
|
|
78
|
-
direction: sortApi && sortApi.current.direction ===
|
|
70
|
+
direction: sortApi && sortApi.current.direction === SortDirection.DESC ? "desc" : "asc",
|
|
79
71
|
onClick: handleSortClick.bind(null, name),
|
|
80
72
|
children: header
|
|
81
73
|
}) : header
|
|
@@ -92,14 +84,14 @@ function TableHeadColumns(_ref2) {
|
|
|
92
84
|
/**
|
|
93
85
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
94
86
|
*/
|
|
95
|
-
function TableColumns(_ref3) {
|
|
87
|
+
export function TableColumns(_ref3) {
|
|
96
88
|
var row = _ref3.row,
|
|
97
89
|
columns = _ref3.columns;
|
|
98
|
-
return /*#__PURE__*/(
|
|
90
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
99
91
|
children: columns.map(function (column, colIndex) {
|
|
100
|
-
if (!
|
|
101
|
-
return /*#__PURE__*/(
|
|
102
|
-
children: column.render ? column.render(row) :
|
|
92
|
+
if (!isVisible(VisibleType.Browser, column.visible)) return null;
|
|
93
|
+
return /*#__PURE__*/_jsx(TableCell, _objectSpread(_objectSpread({}, column.cellProps), {}, {
|
|
94
|
+
children: column.render ? column.render(row) : safeColumnGet(row, column.name)
|
|
103
95
|
}), colIndex);
|
|
104
96
|
})
|
|
105
97
|
});
|
|
@@ -107,10 +99,11 @@ function TableColumns(_ref3) {
|
|
|
107
99
|
/**
|
|
108
100
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
109
101
|
*/
|
|
102
|
+
|
|
110
103
|
/**
|
|
111
104
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
112
105
|
*/
|
|
113
|
-
var VisibleType =
|
|
106
|
+
export var VisibleType = /*#__PURE__*/function (VisibleType) {
|
|
114
107
|
VisibleType["Browser"] = "browser";
|
|
115
108
|
VisibleType["Export"] = "export";
|
|
116
109
|
return VisibleType;
|
|
@@ -118,21 +111,25 @@ var VisibleType = exports.VisibleType = /*#__PURE__*/function (VisibleType) {
|
|
|
118
111
|
/**
|
|
119
112
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
120
113
|
*/
|
|
114
|
+
|
|
121
115
|
/**
|
|
122
116
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
123
117
|
*/
|
|
118
|
+
|
|
124
119
|
/**
|
|
125
120
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
126
121
|
*/
|
|
122
|
+
|
|
127
123
|
/**
|
|
128
124
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
129
125
|
*/
|
|
126
|
+
|
|
130
127
|
function DefaultTableRow(_ref4) {
|
|
131
128
|
var columns = _ref4.columns,
|
|
132
129
|
row = _ref4.row,
|
|
133
130
|
rowProps = _ref4.rowProps;
|
|
134
|
-
return /*#__PURE__*/(
|
|
135
|
-
children: /*#__PURE__*/(
|
|
131
|
+
return /*#__PURE__*/_jsx(TableBodyRow, _objectSpread(_objectSpread({}, rowProps), {}, {
|
|
132
|
+
children: /*#__PURE__*/_jsx(TableColumns, {
|
|
136
133
|
columns: columns,
|
|
137
134
|
row: row
|
|
138
135
|
})
|
|
@@ -142,7 +139,7 @@ function DefaultTableRow(_ref4) {
|
|
|
142
139
|
/**
|
|
143
140
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
144
141
|
*/
|
|
145
|
-
var Table =
|
|
142
|
+
export var Table = /*#__PURE__*/function (_Component) {
|
|
146
143
|
function Table(props) {
|
|
147
144
|
var _this;
|
|
148
145
|
_classCallCheck(this, Table);
|
|
@@ -169,7 +166,7 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
168
|
});
|
|
172
|
-
_this.domRef = /*#__PURE__*/
|
|
169
|
+
_this.domRef = /*#__PURE__*/createRef();
|
|
173
170
|
return _this;
|
|
174
171
|
}
|
|
175
172
|
_inherits(Table, _Component);
|
|
@@ -182,7 +179,7 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
182
179
|
_this$props$exportApi = _this$props.exportApis,
|
|
183
180
|
exportApis = _this$props$exportApi === void 0 ? [] : _this$props$exportApi;
|
|
184
181
|
var renderHeadTableRow = this.props.renderHeadTableRow || function (props) {
|
|
185
|
-
return /*#__PURE__*/(
|
|
182
|
+
return /*#__PURE__*/_jsx(DefaultHeadTableRow, _objectSpread({}, props));
|
|
186
183
|
};
|
|
187
184
|
if (this.props.pagingInfo) {
|
|
188
185
|
this.props.pagingInfo.attachTableRef(this.domRef);
|
|
@@ -193,12 +190,12 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
193
190
|
var paginationPosition = this.props.paginationPosition || "bottom";
|
|
194
191
|
var shouldRenderTopPagination = paginationPosition === "top" || paginationPosition === "both";
|
|
195
192
|
var shouldRenderBottomPagination = paginationPosition === "bottom" || paginationPosition === "both";
|
|
196
|
-
return /*#__PURE__*/(
|
|
193
|
+
return /*#__PURE__*/_jsxs(MuiTable, {
|
|
197
194
|
ref: this.domRef,
|
|
198
195
|
className: this.props.className,
|
|
199
|
-
children: [!this.props.hideTableHead && /*#__PURE__*/(
|
|
200
|
-
children: [this.props.pagingInfo && shouldRenderTopPagination && /*#__PURE__*/(
|
|
201
|
-
children: /*#__PURE__*/(
|
|
196
|
+
children: [!this.props.hideTableHead && /*#__PURE__*/_jsxs(TableHead, {
|
|
197
|
+
children: [this.props.pagingInfo && shouldRenderTopPagination && /*#__PURE__*/_jsx(TableRow, {
|
|
198
|
+
children: /*#__PURE__*/_jsx(TablePagination, {
|
|
202
199
|
totalCount: this.props.totalCount,
|
|
203
200
|
pagingInfo: this.props.pagingInfo,
|
|
204
201
|
rowName: this.props.rowName
|
|
@@ -207,11 +204,11 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
207
204
|
columns: this.props.columns,
|
|
208
205
|
sortApi: this.props.sortApi
|
|
209
206
|
})]
|
|
210
|
-
}), /*#__PURE__*/(
|
|
207
|
+
}), /*#__PURE__*/_jsx(TableBody, {
|
|
211
208
|
children: data.map(function (row, index) {
|
|
212
209
|
var isSelected = _this2.isSelected(row.id);
|
|
213
210
|
var renderTableRow = _this2.props.renderTableRow || function (props) {
|
|
214
|
-
return /*#__PURE__*/(
|
|
211
|
+
return /*#__PURE__*/_jsx(DefaultTableRow, _objectSpread({}, props));
|
|
215
212
|
};
|
|
216
213
|
return renderTableRow({
|
|
217
214
|
index: index,
|
|
@@ -230,9 +227,9 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
230
227
|
}
|
|
231
228
|
});
|
|
232
229
|
})
|
|
233
|
-
}), this.props.pagingInfo && shouldRenderBottomPagination && /*#__PURE__*/(
|
|
234
|
-
children: /*#__PURE__*/(
|
|
235
|
-
children: /*#__PURE__*/(
|
|
230
|
+
}), this.props.pagingInfo && shouldRenderBottomPagination && /*#__PURE__*/_jsx(TableFooter, {
|
|
231
|
+
children: /*#__PURE__*/_jsx(TableRow, {
|
|
232
|
+
children: /*#__PURE__*/_jsx(TablePagination, {
|
|
236
233
|
totalCount: this.props.totalCount,
|
|
237
234
|
pagingInfo: this.props.pagingInfo,
|
|
238
235
|
rowName: this.props.rowName
|
|
@@ -247,4 +244,4 @@ var Table = exports.Table = /*#__PURE__*/function (_Component) {
|
|
|
247
244
|
return String(this.props.selectedId) === String(id); // as strings as selectedId might come from url
|
|
248
245
|
}
|
|
249
246
|
}]);
|
|
250
|
-
}(
|
|
247
|
+
}(Component);
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TableBodyRow = TableBodyRow;
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
|
-
var _styles = require("@mui/material/styles");
|
|
10
|
-
var _createComponentSlot = require("../helpers/createComponentSlot");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
2
|
var _excluded = ["title", "children", "index", "hideTableHead", "slotProps"];
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
15
|
-
*/
|
|
16
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -20,7 +7,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
20
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
22
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
23
|
-
|
|
10
|
+
import { TableRow } from "@mui/material";
|
|
11
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
12
|
+
import { createComponentSlot } from "../helpers/createComponentSlot";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
16
|
+
*/
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
var Root = createComponentSlot(TableRow)({
|
|
24
19
|
componentName: "TableBodyRow",
|
|
25
20
|
slotName: "root",
|
|
26
21
|
classesResolver: function classesResolver(ownerState) {
|
|
@@ -35,8 +30,8 @@ var Root = (0, _createComponentSlot.createComponentSlot)(_material.TableRow)({
|
|
|
35
30
|
/**
|
|
36
31
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
37
32
|
*/
|
|
38
|
-
function TableBodyRow(inProps) {
|
|
39
|
-
var _useThemeProps =
|
|
33
|
+
export function TableBodyRow(inProps) {
|
|
34
|
+
var _useThemeProps = useThemeProps({
|
|
40
35
|
props: inProps,
|
|
41
36
|
name: "CometAdminTableBodyRow"
|
|
42
37
|
}),
|
|
@@ -49,7 +44,7 @@ function TableBodyRow(inProps) {
|
|
|
49
44
|
var ownerState = {
|
|
50
45
|
isOdd: ((index || 0) + (hideTableHead ? 1 : 0)) % 2 === 1
|
|
51
46
|
};
|
|
52
|
-
return /*#__PURE__*/(
|
|
47
|
+
return /*#__PURE__*/_jsx(Root, _objectSpread(_objectSpread(_objectSpread({
|
|
53
48
|
ownerState: ownerState
|
|
54
49
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), {}, {
|
|
55
50
|
children: children
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TableDndOrder = TableDndOrder;
|
|
8
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
9
|
-
var _styles = require("@mui/material/styles");
|
|
10
|
-
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
11
|
-
var _TableRow = _interopRequireDefault(require("@mui/material/TableRow"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
-
var _reactDnd = require("react-dnd");
|
|
14
|
-
var _createComponentSlot = require("../helpers/createComponentSlot");
|
|
15
|
-
var _Table = require("./Table");
|
|
16
|
-
var _TableBodyRow = require("./TableBodyRow");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
2
|
var _excluded = ["moveRow", "onDragEnd", "dragHandleIcon", "slotProps"];
|
|
19
3
|
var _templateObject, _templateObject2;
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
21
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
22
5
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
23
6
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
@@ -32,14 +15,24 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
32
15
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
33
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
34
17
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
|
+
import { DragHandle } from "@comet/admin-icons";
|
|
19
|
+
import { css, useThemeProps } from "@mui/material/styles";
|
|
20
|
+
import TableCell from "@mui/material/TableCell";
|
|
21
|
+
import TableRow from "@mui/material/TableRow";
|
|
22
|
+
import { useCallback, useRef } from "react";
|
|
23
|
+
import { useDrag, useDrop } from "react-dnd";
|
|
24
|
+
import { createComponentSlot } from "../helpers/createComponentSlot";
|
|
25
|
+
import { Table, TableColumns, TableHeadColumns } from "./Table";
|
|
26
|
+
import { TableBodyRow } from "./TableBodyRow";
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
28
|
function DndOrderRow(props) {
|
|
36
29
|
var columns = props.columns,
|
|
37
30
|
row = props.row,
|
|
38
31
|
rowProps = props.rowProps,
|
|
39
32
|
slotProps = props.slotProps;
|
|
40
|
-
var refDragHandle =
|
|
41
|
-
var refRow =
|
|
42
|
-
var _useDrag =
|
|
33
|
+
var refDragHandle = useRef(null);
|
|
34
|
+
var refRow = useRef(null);
|
|
35
|
+
var _useDrag = useDrag({
|
|
43
36
|
type: "row",
|
|
44
37
|
// TODO: configurable? unique per table?
|
|
45
38
|
item: function item() {
|
|
@@ -63,7 +56,7 @@ function DndOrderRow(props) {
|
|
|
63
56
|
isDragging = _useDrag2[0].isDragging,
|
|
64
57
|
drag = _useDrag2[1],
|
|
65
58
|
dragPreview = _useDrag2[2];
|
|
66
|
-
var _useDrop =
|
|
59
|
+
var _useDrop = useDrop({
|
|
67
60
|
accept: "row",
|
|
68
61
|
hover: function hover(item, monitor) {
|
|
69
62
|
var _refRow$current;
|
|
@@ -121,57 +114,57 @@ function DndOrderRow(props) {
|
|
|
121
114
|
var opacity = isDragging ? 0 : 1;
|
|
122
115
|
drag(refDragHandle);
|
|
123
116
|
drop(dragPreview(refRow));
|
|
124
|
-
return /*#__PURE__*/(
|
|
117
|
+
return /*#__PURE__*/_jsxs(TableBodyRow, _objectSpread(_objectSpread({
|
|
125
118
|
ref: refRow
|
|
126
119
|
}, rowProps), {}, {
|
|
127
120
|
style: {
|
|
128
121
|
opacity: opacity
|
|
129
122
|
},
|
|
130
|
-
children: [/*#__PURE__*/(
|
|
123
|
+
children: [/*#__PURE__*/_jsx(DragCell, _objectSpread(_objectSpread({
|
|
131
124
|
ref: refDragHandle
|
|
132
125
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.dragCell), {}, {
|
|
133
|
-
children: /*#__PURE__*/(
|
|
126
|
+
children: /*#__PURE__*/_jsx(DragIconContainer, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.dragIconContainer), {}, {
|
|
134
127
|
children: props.dragHandleIcon
|
|
135
128
|
}))
|
|
136
|
-
})), /*#__PURE__*/(
|
|
129
|
+
})), /*#__PURE__*/_jsx(TableColumns, {
|
|
137
130
|
columns: columns,
|
|
138
131
|
row: row
|
|
139
132
|
})]
|
|
140
133
|
}));
|
|
141
134
|
}
|
|
142
|
-
var Root =
|
|
135
|
+
var Root = createComponentSlot(Table)({
|
|
143
136
|
componentName: "TableDndOrder",
|
|
144
137
|
slotName: "root"
|
|
145
138
|
})();
|
|
146
|
-
var DragCell =
|
|
139
|
+
var DragCell = createComponentSlot(TableCell)({
|
|
147
140
|
componentName: "TableDndOrder",
|
|
148
141
|
slotName: "dragCell"
|
|
149
|
-
})(
|
|
150
|
-
var DragIconContainer =
|
|
142
|
+
})(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: grab;\n width: 20px;\n padding-right: 0;\n"]))));
|
|
143
|
+
var DragIconContainer = createComponentSlot("div")({
|
|
151
144
|
componentName: "TableDndOrder",
|
|
152
145
|
slotName: "dragIconContainer"
|
|
153
|
-
})(
|
|
146
|
+
})(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n :after {\n // Increase clickable area to include the padding-left of the next cell.\n content: \"\";\n position: absolute;\n z-index: 1;\n top: 0;\n right: -20px;\n bottom: 0;\n left: 0;\n }\n"]))));
|
|
154
147
|
/**
|
|
155
148
|
* @deprecated Use MUI X Data Grid in combination with `useDataGridRemote` instead.
|
|
156
149
|
*/
|
|
157
|
-
function TableDndOrder(inProps) {
|
|
158
|
-
var _useThemeProps =
|
|
150
|
+
export function TableDndOrder(inProps) {
|
|
151
|
+
var _useThemeProps = useThemeProps({
|
|
159
152
|
props: inProps,
|
|
160
153
|
name: "CometAdminTableDndOrder"
|
|
161
154
|
}),
|
|
162
155
|
moveRow = _useThemeProps.moveRow,
|
|
163
156
|
onDragEnd = _useThemeProps.onDragEnd,
|
|
164
157
|
_useThemeProps$dragHa = _useThemeProps.dragHandleIcon,
|
|
165
|
-
dragHandleIcon = _useThemeProps$dragHa === void 0 ? /*#__PURE__*/(
|
|
158
|
+
dragHandleIcon = _useThemeProps$dragHa === void 0 ? /*#__PURE__*/_jsx(DragHandle, {}) : _useThemeProps$dragHa,
|
|
166
159
|
slotProps = _useThemeProps.slotProps,
|
|
167
160
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
168
|
-
var renderHeadTableRow =
|
|
169
|
-
return /*#__PURE__*/(
|
|
170
|
-
children: [/*#__PURE__*/(
|
|
161
|
+
var renderHeadTableRow = useCallback(function (ownProps) {
|
|
162
|
+
return /*#__PURE__*/_jsxs(TableRow, {
|
|
163
|
+
children: [/*#__PURE__*/_jsx(TableCell, {}), /*#__PURE__*/_jsx(TableHeadColumns, _objectSpread({}, ownProps))]
|
|
171
164
|
});
|
|
172
165
|
}, []);
|
|
173
|
-
var renderTableRow =
|
|
174
|
-
return /*#__PURE__*/(
|
|
166
|
+
var renderTableRow = useCallback(function (ownProps) {
|
|
167
|
+
return /*#__PURE__*/_jsx(DndOrderRow, _objectSpread({
|
|
175
168
|
dragHandleIcon: dragHandleIcon,
|
|
176
169
|
moveRow: moveRow,
|
|
177
170
|
onDragEnd: onDragEnd
|
|
@@ -181,5 +174,5 @@ function TableDndOrder(inProps) {
|
|
|
181
174
|
renderTableRow: renderTableRow,
|
|
182
175
|
renderHeadTableRow: renderHeadTableRow
|
|
183
176
|
};
|
|
184
|
-
return /*#__PURE__*/(
|
|
177
|
+
return /*#__PURE__*/_jsx(Root, _objectSpread(_objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), tableProps));
|
|
185
178
|
}
|