@comet/admin 8.17.1 → 9.0.0-beta.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/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 +16 -22
- 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.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 +2 -2
- 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 +29 -35
- 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 +27 -32
- 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 +35 -43
- 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 +27 -32
- 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 +27 -33
- 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 +27 -32
- package/lib/dateTime/dateTimeRangePicker/DateTimeRangePicker.js +32 -40
- 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 +27 -32
- 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 +28 -34
- 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 +27 -32
- 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/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 +8 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +225 -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 +16 -33
- 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 +18 -14
- 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,15 +1,4 @@
|
|
|
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.FinalFormFileSelect = FinalFormFileSelect;
|
|
8
|
-
var _styles = require("@mui/material/styles");
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _commonErrorMessages = require("./file/commonErrorMessages");
|
|
11
|
-
var _FileSelect = require("./file/FileSelect");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
2
|
var _excluded = ["disabled", "maxFiles", "maxSize", "input", "meta"];
|
|
14
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; }
|
|
15
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; }
|
|
@@ -28,8 +17,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
28
17
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
29
18
|
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; }
|
|
30
19
|
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; }
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
21
|
+
import { useCallback, useState } from "react";
|
|
22
|
+
import { commonErrorMessages } from "./file/commonErrorMessages";
|
|
23
|
+
import { FileSelect } from "./file/FileSelect";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
export function FinalFormFileSelect(inProps) {
|
|
26
|
+
var _useThemeProps = useThemeProps({
|
|
33
27
|
props: inProps,
|
|
34
28
|
name: "CometAdminFinalFormFileSelect"
|
|
35
29
|
}),
|
|
@@ -42,16 +36,16 @@ function FinalFormFileSelect(inProps) {
|
|
|
42
36
|
multiple = _useThemeProps$input.multiple,
|
|
43
37
|
meta = _useThemeProps.meta,
|
|
44
38
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
45
|
-
var _useState =
|
|
39
|
+
var _useState = useState(false),
|
|
46
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
41
|
tooManyFilesSelected = _useState2[0],
|
|
48
42
|
setTooManyFilesSelected = _useState2[1];
|
|
49
|
-
var _useState3 =
|
|
43
|
+
var _useState3 = useState([]),
|
|
50
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
45
|
rejectedFiles = _useState4[0],
|
|
52
46
|
setRejectedFiles = _useState4[1];
|
|
53
47
|
var singleFile = !multiple && typeof maxFiles === "undefined" || maxFiles === 1;
|
|
54
|
-
var onDrop =
|
|
48
|
+
var onDrop = useCallback(function (acceptedFiles, fileRejections) {
|
|
55
49
|
setRejectedFiles(fileRejections.map(function (rejectedFile) {
|
|
56
50
|
var failedFile = {
|
|
57
51
|
name: rejectedFile.file.name,
|
|
@@ -60,12 +54,12 @@ function FinalFormFileSelect(inProps) {
|
|
|
60
54
|
if (rejectedFile.errors.some(function (error) {
|
|
61
55
|
return error.code === "file-too-large";
|
|
62
56
|
})) {
|
|
63
|
-
failedFile.error =
|
|
57
|
+
failedFile.error = commonErrorMessages.fileTooLarge;
|
|
64
58
|
}
|
|
65
59
|
if (rejectedFile.errors.some(function (error) {
|
|
66
60
|
return error.code === "file-invalid-type";
|
|
67
61
|
})) {
|
|
68
|
-
failedFile.error =
|
|
62
|
+
failedFile.error = commonErrorMessages.invalidFileType;
|
|
69
63
|
}
|
|
70
64
|
return failedFile;
|
|
71
65
|
}));
|
|
@@ -103,7 +97,7 @@ function FinalFormFileSelect(inProps) {
|
|
|
103
97
|
size: fieldValue.size
|
|
104
98
|
});
|
|
105
99
|
}
|
|
106
|
-
return /*#__PURE__*/(
|
|
100
|
+
return /*#__PURE__*/_jsx(FileSelect, _objectSpread({
|
|
107
101
|
files: [].concat(acceptedFiles, _toConsumableArray(rejectedFiles)),
|
|
108
102
|
onDrop: onDrop,
|
|
109
103
|
onRemove: function onRemove(fileToRemove) {
|
|
@@ -120,6 +114,6 @@ function FinalFormFileSelect(inProps) {
|
|
|
120
114
|
multiple: multiple,
|
|
121
115
|
maxFiles: maxFiles,
|
|
122
116
|
maxFileSize: maxSize,
|
|
123
|
-
error: typeof maxFiles !== "undefined" && tooManyFilesSelected ?
|
|
117
|
+
error: typeof maxFiles !== "undefined" && tooManyFilesSelected ? commonErrorMessages.tooManyFiles(maxFiles) : undefined
|
|
124
118
|
}, restProps));
|
|
125
119
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type InputBaseProps } from "@mui/material";
|
|
2
2
|
import { type FieldRenderProps } from "react-final-form";
|
|
3
3
|
export type FinalFormInputProps = InputBaseProps & {
|
|
4
|
-
clearable?: boolean;
|
|
5
4
|
disableContentTranslation?: boolean;
|
|
6
5
|
};
|
|
7
6
|
type FinalFormInputInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
|
8
|
-
export declare function FinalFormInput({ meta, input, innerRef, endAdornment,
|
|
7
|
+
export declare function FinalFormInput({ meta, input, innerRef, endAdornment, disableContentTranslation, required, disabled, readOnly, ...props }: FinalFormInputProps & FinalFormInputInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=FinalFormInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,
|
|
1
|
+
{"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAwDnD"}
|
|
@@ -1,20 +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
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.FinalFormInput = FinalFormInput;
|
|
8
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
var _reactIntl = require("react-intl");
|
|
12
|
-
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
13
|
-
var _Tooltip = require("../common/Tooltip");
|
|
14
|
-
var _PlainTextTranslationDialog = require("../translator/PlainTextTranslationDialog");
|
|
15
|
-
var _useContentTranslationService = require("../translator/useContentTranslationService");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["meta", "input", "innerRef", "endAdornment", "clearable", "disableContentTranslation"];
|
|
2
|
+
var _excluded = ["meta", "input", "innerRef", "endAdornment", "disableContentTranslation", "required", "disabled", "readOnly"];
|
|
18
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; }
|
|
19
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; }
|
|
20
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; }
|
|
@@ -32,44 +17,59 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
32
17
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
33
18
|
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; }
|
|
34
19
|
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; }
|
|
35
|
-
|
|
20
|
+
import { Translate } from "@comet/admin-icons";
|
|
21
|
+
import { IconButton, InputBase } from "@mui/material";
|
|
22
|
+
import { useState } from "react";
|
|
23
|
+
import { FormattedMessage } from "react-intl";
|
|
24
|
+
import { ClearInputAdornment } from "../common/ClearInputAdornment";
|
|
25
|
+
import { Tooltip } from "../common/Tooltip";
|
|
26
|
+
import { PlainTextTranslationDialog } from "../translator/PlainTextTranslationDialog";
|
|
27
|
+
import { useContentTranslationService } from "../translator/useContentTranslationService";
|
|
28
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
export function FinalFormInput(_ref) {
|
|
36
30
|
var _ref2, _props$type;
|
|
37
31
|
var meta = _ref.meta,
|
|
38
32
|
input = _ref.input,
|
|
39
33
|
innerRef = _ref.innerRef,
|
|
40
34
|
endAdornment = _ref.endAdornment,
|
|
41
|
-
clearable = _ref.clearable,
|
|
42
35
|
disableContentTranslation = _ref.disableContentTranslation,
|
|
36
|
+
required = _ref.required,
|
|
37
|
+
disabled = _ref.disabled,
|
|
38
|
+
readOnly = _ref.readOnly,
|
|
43
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
40
|
var type = (_ref2 = (_props$type = props.type) !== null && _props$type !== void 0 ? _props$type : input.type) !== null && _ref2 !== void 0 ? _ref2 : "text";
|
|
45
|
-
var _useContentTranslatio =
|
|
41
|
+
var _useContentTranslatio = useContentTranslationService(),
|
|
46
42
|
translationEnabled = _useContentTranslatio.enabled,
|
|
47
43
|
showApplyTranslationDialog = _useContentTranslatio.showApplyTranslationDialog,
|
|
48
44
|
translate = _useContentTranslatio.translate;
|
|
49
45
|
var isTranslatable = translationEnabled && !disableContentTranslation && type === "text" && !props.disabled;
|
|
50
|
-
var _useState =
|
|
46
|
+
var _useState = useState(false),
|
|
51
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
52
48
|
open = _useState2[0],
|
|
53
49
|
setOpen = _useState2[1];
|
|
54
|
-
var _useState3 =
|
|
50
|
+
var _useState3 = useState(undefined),
|
|
55
51
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
52
|
pendingTranslation = _useState4[0],
|
|
57
53
|
setPendingTranslation = _useState4[1];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
var clearable = !required && !disabled && !readOnly;
|
|
55
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
56
|
+
children: [/*#__PURE__*/_jsx(InputBase, _objectSpread(_objectSpread(_objectSpread({}, input), props), {}, {
|
|
57
|
+
required: required,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
readOnly: readOnly,
|
|
60
|
+
endAdornment: (endAdornment || clearable || isTranslatable) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
61
|
+
children: [clearable && /*#__PURE__*/_jsx(ClearInputAdornment, {
|
|
62
62
|
position: "end",
|
|
63
63
|
hasClearableContent: Boolean(input.value),
|
|
64
64
|
onClick: function onClick() {
|
|
65
65
|
return input.onChange("");
|
|
66
66
|
}
|
|
67
|
-
}), isTranslatable && /*#__PURE__*/(
|
|
68
|
-
title: /*#__PURE__*/(
|
|
67
|
+
}), isTranslatable && /*#__PURE__*/_jsx(Tooltip, {
|
|
68
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
69
69
|
id: "comet.translate",
|
|
70
70
|
defaultMessage: "Translate"
|
|
71
71
|
}),
|
|
72
|
-
children: /*#__PURE__*/(
|
|
72
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
73
73
|
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
74
74
|
var _t, _t2;
|
|
75
75
|
return _regenerator().w(function (_context) {
|
|
@@ -98,11 +98,11 @@ function FinalFormInput(_ref) {
|
|
|
98
98
|
}
|
|
99
99
|
}, _callee);
|
|
100
100
|
})),
|
|
101
|
-
children: /*#__PURE__*/(
|
|
101
|
+
children: /*#__PURE__*/_jsx(Translate, {})
|
|
102
102
|
})
|
|
103
103
|
}), endAdornment]
|
|
104
104
|
})
|
|
105
|
-
})), open && pendingTranslation && /*#__PURE__*/(
|
|
105
|
+
})), open && pendingTranslation && /*#__PURE__*/_jsx(PlainTextTranslationDialog, {
|
|
106
106
|
open: open,
|
|
107
107
|
onClose: function onClose() {
|
|
108
108
|
return setOpen(false);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type InputBaseProps } from "@mui/material";
|
|
2
2
|
import { type FieldRenderProps } from "react-final-form";
|
|
3
3
|
export type FinalFormNumberInputProps = InputBaseProps & {
|
|
4
|
-
clearable?: boolean;
|
|
5
4
|
decimals?: number;
|
|
6
5
|
};
|
|
7
6
|
type FinalFormNumberInputInternalProps = FieldRenderProps<number>;
|
|
@@ -10,6 +9,6 @@ type FinalFormNumberInputInternalProps = FieldRenderProps<number>;
|
|
|
10
9
|
*
|
|
11
10
|
* @see {@link NumberField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
12
11
|
*/
|
|
13
|
-
export declare function FinalFormNumberInput({ meta, input, innerRef,
|
|
12
|
+
export declare function FinalFormNumberInput({ meta, input, innerRef, endAdornment, required, disabled, readOnly, decimals, ...props }: FinalFormNumberInputProps & FinalFormNumberInputInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
|
15
14
|
//# sourceMappingURL=FinalFormNumberInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormNumberInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormNumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG;IACrD,
|
|
1
|
+
{"version":3,"file":"FinalFormNumberInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormNumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,iCAAiC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAY,EACZ,GAAG,KAAK,EACX,EAAE,yBAAyB,GAAG,iCAAiC,2CA2F/D"}
|
|
@@ -1,16 +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
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.FinalFormNumberInput = FinalFormNumberInput;
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
var _excluded = ["meta", "input", "innerRef", "clearable", "endAdornment", "decimals"];
|
|
2
|
+
var _excluded = ["meta", "input", "innerRef", "endAdornment", "required", "disabled", "readOnly", "decimals"];
|
|
14
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; }
|
|
15
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; }
|
|
16
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; }
|
|
@@ -24,26 +13,33 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
24
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
14
|
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; }
|
|
26
15
|
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; }
|
|
16
|
+
import { InputBase } from "@mui/material";
|
|
17
|
+
import { useCallback, useEffect, useState } from "react";
|
|
18
|
+
import { useIntl } from "react-intl";
|
|
19
|
+
import { ClearInputAdornment } from "../common/ClearInputAdornment";
|
|
20
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
21
|
/**
|
|
28
22
|
* Final Form-compatible NumberInput component.
|
|
29
23
|
*
|
|
30
24
|
* @see {@link NumberField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
31
25
|
*/
|
|
32
|
-
function FinalFormNumberInput(_ref) {
|
|
26
|
+
export function FinalFormNumberInput(_ref) {
|
|
33
27
|
var meta = _ref.meta,
|
|
34
28
|
input = _ref.input,
|
|
35
29
|
innerRef = _ref.innerRef,
|
|
36
|
-
clearable = _ref.clearable,
|
|
37
30
|
endAdornment = _ref.endAdornment,
|
|
31
|
+
required = _ref.required,
|
|
32
|
+
disabled = _ref.disabled,
|
|
33
|
+
readOnly = _ref.readOnly,
|
|
38
34
|
_ref$decimals = _ref.decimals,
|
|
39
35
|
decimals = _ref$decimals === void 0 ? 0 : _ref$decimals,
|
|
40
36
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
var intl =
|
|
42
|
-
var _useState =
|
|
37
|
+
var intl = useIntl();
|
|
38
|
+
var _useState = useState(""),
|
|
43
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
40
|
formattedNumberValue = _useState2[0],
|
|
45
41
|
setFormattedNumberValue = _useState2[1];
|
|
46
|
-
var getFormattedValue =
|
|
42
|
+
var getFormattedValue = useCallback(function (value) {
|
|
47
43
|
var formattedValue = value !== undefined ? intl.formatNumber(value, {
|
|
48
44
|
minimumFractionDigits: decimals,
|
|
49
45
|
maximumFractionDigits: decimals
|
|
@@ -54,7 +50,7 @@ function FinalFormNumberInput(_ref) {
|
|
|
54
50
|
var value = event.target.value;
|
|
55
51
|
setFormattedNumberValue(value);
|
|
56
52
|
};
|
|
57
|
-
var updateFormattedNumberValue =
|
|
53
|
+
var updateFormattedNumberValue = useCallback(function (inputValue) {
|
|
58
54
|
if (!inputValue && inputValue !== 0) {
|
|
59
55
|
input.onChange(undefined);
|
|
60
56
|
setFormattedNumberValue("");
|
|
@@ -86,15 +82,19 @@ function FinalFormNumberInput(_ref) {
|
|
|
86
82
|
updateFormattedNumberValue(inputValue);
|
|
87
83
|
}
|
|
88
84
|
};
|
|
89
|
-
|
|
85
|
+
useEffect(function () {
|
|
90
86
|
updateFormattedNumberValue(input.value);
|
|
91
87
|
}, [updateFormattedNumberValue, input]);
|
|
92
|
-
|
|
88
|
+
var clearable = !required && !disabled && !readOnly;
|
|
89
|
+
return /*#__PURE__*/_jsx(InputBase, _objectSpread(_objectSpread(_objectSpread({}, input), props), {}, {
|
|
90
|
+
required: required,
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
readOnly: readOnly,
|
|
93
93
|
value: formattedNumberValue,
|
|
94
94
|
onChange: handleChange,
|
|
95
95
|
onBlur: handleBlur,
|
|
96
|
-
endAdornment: (endAdornment || clearable) && /*#__PURE__*/(
|
|
97
|
-
children: [clearable && /*#__PURE__*/(
|
|
96
|
+
endAdornment: (endAdornment || clearable) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
97
|
+
children: [clearable && /*#__PURE__*/_jsx(ClearInputAdornment, {
|
|
98
98
|
position: "end",
|
|
99
99
|
hasClearableContent: typeof input.value === "number",
|
|
100
100
|
onClick: function onClick() {
|
|
@@ -1,16 +1,4 @@
|
|
|
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.FinalFormRangeInput = FinalFormRangeInput;
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
|
-
var _styles = require("@mui/material/styles");
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
var _reactIntl = require("react-intl");
|
|
12
|
-
var _createComponentSlot = require("../helpers/createComponentSlot");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
2
|
var _excluded = ["min", "max", "startAdornment", "endAdornment", "separator", "disableSlider", "sliderProps", "input", "slotProps", "disabled"];
|
|
15
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
16
4
|
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; }
|
|
@@ -27,7 +15,13 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
27
15
|
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; }
|
|
28
16
|
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; }
|
|
29
17
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
30
|
-
|
|
18
|
+
import { FormControl, InputBase, Slider } from "@mui/material";
|
|
19
|
+
import { css, useThemeProps } from "@mui/material/styles";
|
|
20
|
+
import { useEffect, useState } from "react";
|
|
21
|
+
import { FormattedMessage } from "react-intl";
|
|
22
|
+
import { createComponentSlot } from "../helpers/createComponentSlot";
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
var Root = createComponentSlot("div")({
|
|
31
25
|
componentName: "FinalFormRangeInput",
|
|
32
26
|
slotName: "root",
|
|
33
27
|
classesResolver: function classesResolver(_ref) {
|
|
@@ -35,34 +29,34 @@ var Root = (0, _createComponentSlot.createComponentSlot)("div")({
|
|
|
35
29
|
return [disableSlider && "disableSlider"];
|
|
36
30
|
}
|
|
37
31
|
})();
|
|
38
|
-
var InputsWrapper =
|
|
32
|
+
var InputsWrapper = createComponentSlot("div")({
|
|
39
33
|
componentName: "FinalFormRangeInput",
|
|
40
34
|
slotName: "inputsWrapper"
|
|
41
35
|
})(function (_ref2) {
|
|
42
36
|
var theme = _ref2.theme,
|
|
43
37
|
ownerState = _ref2.ownerState;
|
|
44
|
-
return
|
|
38
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n justify-content: space-between;\n align-items: center;\n display: flex;\n\n ", "\n "])), !ownerState.disableSlider && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n "])), theme.spacing(3)));
|
|
45
39
|
});
|
|
46
|
-
var InputFieldsSeparatorContainer =
|
|
40
|
+
var InputFieldsSeparatorContainer = createComponentSlot("div")({
|
|
47
41
|
componentName: "FinalFormRangeInput",
|
|
48
42
|
slotName: "inputFieldsSeparatorContainer"
|
|
49
43
|
})(function (_ref3) {
|
|
50
44
|
var theme = _ref3.theme;
|
|
51
|
-
return
|
|
45
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n text-align: center;\n padding-left: ", ";\n padding-right: ", ";\n "])), theme.spacing(2), theme.spacing(2));
|
|
52
46
|
});
|
|
53
|
-
var SliderWrapper =
|
|
47
|
+
var SliderWrapper = createComponentSlot("div")({
|
|
54
48
|
componentName: "FinalFormRangeInput",
|
|
55
49
|
slotName: "sliderWrapper"
|
|
56
50
|
})(function (_ref4) {
|
|
57
51
|
var theme = _ref4.theme;
|
|
58
|
-
return
|
|
52
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-left: ", ";\n padding-right: ", ";\n "])), theme.spacing(2), theme.spacing(2));
|
|
59
53
|
});
|
|
60
|
-
var InputFieldContainer =
|
|
54
|
+
var InputFieldContainer = createComponentSlot("div")({
|
|
61
55
|
componentName: "FinalFormRangeInput",
|
|
62
56
|
slotName: "inputFieldContainer"
|
|
63
|
-
})(
|
|
64
|
-
function FinalFormRangeInput(inProps) {
|
|
65
|
-
var _useThemeProps =
|
|
57
|
+
})(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n text-align: center;\n flex-basis: 0;\n flex-grow: 1;\n"]))));
|
|
58
|
+
export function FinalFormRangeInput(inProps) {
|
|
59
|
+
var _useThemeProps = useThemeProps({
|
|
66
60
|
props: inProps,
|
|
67
61
|
name: "CometAdminFinalFormRangeInput"
|
|
68
62
|
}),
|
|
@@ -71,7 +65,7 @@ function FinalFormRangeInput(inProps) {
|
|
|
71
65
|
startAdornment = _useThemeProps.startAdornment,
|
|
72
66
|
endAdornment = _useThemeProps.endAdornment,
|
|
73
67
|
_useThemeProps$separa = _useThemeProps.separator,
|
|
74
|
-
separator = _useThemeProps$separa === void 0 ? /*#__PURE__*/(
|
|
68
|
+
separator = _useThemeProps$separa === void 0 ? /*#__PURE__*/_jsx(FormattedMessage, {
|
|
75
69
|
id: "comet.rangeInput.separator",
|
|
76
70
|
defaultMessage: "to"
|
|
77
71
|
}) : _useThemeProps$separa,
|
|
@@ -84,11 +78,11 @@ function FinalFormRangeInput(inProps) {
|
|
|
84
78
|
slotProps = _useThemeProps.slotProps,
|
|
85
79
|
disabled = _useThemeProps.disabled,
|
|
86
80
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
87
|
-
var _useState =
|
|
81
|
+
var _useState = useState(fieldValue.min || undefined),
|
|
88
82
|
_useState2 = _slicedToArray(_useState, 2),
|
|
89
83
|
internalMinInput = _useState2[0],
|
|
90
84
|
setInternalMinInput = _useState2[1];
|
|
91
|
-
var _useState3 =
|
|
85
|
+
var _useState3 = useState(fieldValue.max || undefined),
|
|
92
86
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
93
87
|
internalMaxInput = _useState4[0],
|
|
94
88
|
setInternalMaxInput = _useState4[1];
|
|
@@ -101,7 +95,7 @@ function FinalFormRangeInput(inProps) {
|
|
|
101
95
|
var ownerState = {
|
|
102
96
|
disableSlider: Boolean(disableSlider)
|
|
103
97
|
};
|
|
104
|
-
|
|
98
|
+
useEffect(function () {
|
|
105
99
|
setInternalMinInput(fieldValue.min);
|
|
106
100
|
setInternalMaxInput(fieldValue.max);
|
|
107
101
|
}, [fieldValue]);
|
|
@@ -115,16 +109,16 @@ function FinalFormRangeInput(inProps) {
|
|
|
115
109
|
max: Math.min(maxValue, max)
|
|
116
110
|
});
|
|
117
111
|
};
|
|
118
|
-
return /*#__PURE__*/(
|
|
112
|
+
return /*#__PURE__*/_jsxs(Root, _objectSpread(_objectSpread(_objectSpread({
|
|
119
113
|
ownerState: ownerState
|
|
120
114
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), {}, {
|
|
121
|
-
children: [/*#__PURE__*/(
|
|
115
|
+
children: [/*#__PURE__*/_jsxs(InputsWrapper, _objectSpread(_objectSpread({
|
|
122
116
|
ownerState: ownerState
|
|
123
117
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputsWrapper), {}, {
|
|
124
|
-
children: [/*#__PURE__*/(
|
|
125
|
-
children: /*#__PURE__*/(
|
|
118
|
+
children: [/*#__PURE__*/_jsx(InputFieldContainer, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputFieldContainer), {}, {
|
|
119
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
126
120
|
fullWidth: true,
|
|
127
|
-
children: /*#__PURE__*/(
|
|
121
|
+
children: /*#__PURE__*/_jsx(InputBase, {
|
|
128
122
|
name: "".concat(name, ".min"),
|
|
129
123
|
inputProps: {
|
|
130
124
|
value: internalMinInput !== undefined ? internalMinInput : "",
|
|
@@ -150,12 +144,12 @@ function FinalFormRangeInput(inProps) {
|
|
|
150
144
|
}
|
|
151
145
|
})
|
|
152
146
|
})
|
|
153
|
-
})), /*#__PURE__*/(
|
|
147
|
+
})), /*#__PURE__*/_jsx(InputFieldsSeparatorContainer, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputFieldsSeparatorContainer), {}, {
|
|
154
148
|
children: separator
|
|
155
|
-
})), /*#__PURE__*/(
|
|
156
|
-
children: /*#__PURE__*/(
|
|
149
|
+
})), /*#__PURE__*/_jsx(InputFieldContainer, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputFieldContainer), {}, {
|
|
150
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
157
151
|
fullWidth: true,
|
|
158
|
-
children: /*#__PURE__*/(
|
|
152
|
+
children: /*#__PURE__*/_jsx(InputBase, {
|
|
159
153
|
name: "".concat(name, ".max"),
|
|
160
154
|
inputProps: {
|
|
161
155
|
value: internalMaxInput !== undefined ? internalMaxInput : "",
|
|
@@ -182,8 +176,8 @@ function FinalFormRangeInput(inProps) {
|
|
|
182
176
|
})
|
|
183
177
|
})
|
|
184
178
|
}))]
|
|
185
|
-
})), !disableSlider && /*#__PURE__*/(
|
|
186
|
-
children: /*#__PURE__*/(
|
|
179
|
+
})), !disableSlider && /*#__PURE__*/_jsx(SliderWrapper, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.sliderWrapper), {}, {
|
|
180
|
+
children: /*#__PURE__*/_jsx(Slider, _objectSpread(_objectSpread({
|
|
187
181
|
min: min,
|
|
188
182
|
max: max,
|
|
189
183
|
value: [fieldValue.min ? fieldValue.min : min, fieldValue.max ? fieldValue.max : max],
|
|
@@ -3,7 +3,6 @@ import type { FieldRenderProps } from "react-final-form";
|
|
|
3
3
|
import { type FinalFormInputProps } from "./FinalFormInput";
|
|
4
4
|
export interface FinalFormSearchTextFieldProps extends FinalFormInputProps {
|
|
5
5
|
icon?: ReactNode;
|
|
6
|
-
clearable?: boolean;
|
|
7
6
|
}
|
|
8
7
|
type FinalFormSearchTextFieldInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormSearchTextField.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormSearchTextField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"FinalFormSearchTextField.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormSearchTextField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACtE,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,KAAK,qCAAqC,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAE9G;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,6BAA6B,GAAG,qCAAqC,2CAgBtH;AAED,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,mBAAmB;QACzB,kCAAkC,EAAE,6BAA6B,CAAC;KACrE;IAED,UAAU,UAAU;QAChB,kCAAkC,CAAC,EAAE;YACjC,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,oCAAoC,CAAC,CAAC,CAAC;SACrF,CAAC;KACL;CACJ"}
|
|
@@ -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
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.FinalFormSearchTextField = FinalFormSearchTextField;
|
|
8
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _styles = require("@mui/material/styles");
|
|
11
|
-
var _reactIntl = require("react-intl");
|
|
12
|
-
var _ClearInputAdornment = require("../common/ClearInputAdornment");
|
|
13
|
-
var _FinalFormInput = require("./FinalFormInput");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["icon", "placeholder", "endAdornment", "clearable"];
|
|
2
|
+
var _excluded = ["icon", "placeholder"];
|
|
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,42 +7,37 @@ 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; }
|
|
10
|
+
import { Search } from "@comet/admin-icons";
|
|
11
|
+
import { InputAdornment } from "@mui/material";
|
|
12
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
13
|
+
import { useIntl } from "react-intl";
|
|
14
|
+
import { FinalFormInput } from "./FinalFormInput";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
16
|
/**
|
|
24
17
|
* Final Form-compatible SearchTextField component.
|
|
25
18
|
*
|
|
26
19
|
* @see {@link SearchField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
27
20
|
*/
|
|
28
|
-
function FinalFormSearchTextField(inProps) {
|
|
29
|
-
var _useThemeProps =
|
|
21
|
+
export function FinalFormSearchTextField(inProps) {
|
|
22
|
+
var _useThemeProps = useThemeProps({
|
|
30
23
|
props: inProps,
|
|
31
24
|
name: "CometAdminFinalFormSearchTextField"
|
|
32
25
|
}),
|
|
33
26
|
_useThemeProps$icon = _useThemeProps.icon,
|
|
34
|
-
icon = _useThemeProps$icon === void 0 ? /*#__PURE__*/(
|
|
27
|
+
icon = _useThemeProps$icon === void 0 ? /*#__PURE__*/_jsx(Search, {}) : _useThemeProps$icon,
|
|
35
28
|
placeholder = _useThemeProps.placeholder,
|
|
36
|
-
endAdornment = _useThemeProps.endAdornment,
|
|
37
|
-
clearable = _useThemeProps.clearable,
|
|
38
29
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
39
|
-
var intl =
|
|
40
|
-
return /*#__PURE__*/(
|
|
30
|
+
var intl = useIntl();
|
|
31
|
+
return /*#__PURE__*/_jsx(FinalFormInput, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
41
32
|
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : intl.formatMessage({
|
|
42
33
|
id: "comet.finalformsearchtextfield.default.placeholder",
|
|
43
34
|
defaultMessage: "Search"
|
|
44
35
|
}),
|
|
45
|
-
startAdornment: /*#__PURE__*/(
|
|
36
|
+
startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
|
46
37
|
position: "start",
|
|
47
38
|
disablePointerEvents: true,
|
|
48
39
|
children: icon
|
|
49
40
|
}),
|
|
50
|
-
endAdornment: clearable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
51
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClearInputAdornment.ClearInputAdornment, {
|
|
52
|
-
position: "end",
|
|
53
|
-
hasClearableContent: Boolean(restProps.input.value),
|
|
54
|
-
onClick: function onClick() {
|
|
55
|
-
return restProps.input.onChange("");
|
|
56
|
-
}
|
|
57
|
-
}), endAdornment]
|
|
58
|
-
}) : endAdornment,
|
|
59
41
|
disableContentTranslation: true
|
|
60
42
|
}));
|
|
61
43
|
}
|