Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input label proptypes and DatagridInput imports #8019

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/ra-ui-materialui/src/input/DatagridInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import {
useChoicesContext,
useInput,
} from 'ra-core';
import {
CommonInputProps,
InputHelperText,
SupportCreateSuggestionOptions,
} from '.';
import { CommonInputProps } from './CommonInputProps';
import { InputHelperText } from './InputHelperText';
import { SupportCreateSuggestionOptions } from './useSupportCreateSuggestion';
import { Datagrid, DatagridProps } from '../list/datagrid';
import { FilterButton, FilterForm } from '../list/filter';
import { FilterContext } from '../list/FilterContext';
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export const DateInput = ({
};

DateInput.propTypes = {
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
resource: PropTypes.string,
source: PropTypes.string,
};
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/DateTimeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export const DateTimeInput = ({
};

DateTimeInput.propTypes = {
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
resource: PropTypes.string,
source: PropTypes.string,
};
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ FileInput.propTypes = {
className: PropTypes.string,
id: PropTypes.string,
isRequired: PropTypes.bool,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
labelMultiple: PropTypes.string,
labelSingle: PropTypes.string,
maxSize: PropTypes.number,
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/InputPropTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import PropTypes from 'prop-types';
* Common PropTypes for all react-admin inputs
*/
export const InputPropTypes = {
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
resource: PropTypes.string,
source: PropTypes.string,
};
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/NullableBooleanInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export const NullableBooleanInput = (props: NullableBooleanInputProps) => {
};

NullableBooleanInput.propTypes = {
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
resource: PropTypes.string,
source: PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ export const NumberInput = ({
};

NumberInput.propTypes = {
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
resource: PropTypes.string,
source: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ export const RadioButtonGroupInput = (props: RadioButtonGroupInputProps) => {

RadioButtonGroupInput.propTypes = {
choices: PropTypes.arrayOf(PropTypes.any),
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
optionText: PropTypes.oneOfType([
PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/SelectArrayInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ SelectArrayInput.propTypes = {
choices: PropTypes.arrayOf(PropTypes.object),
className: PropTypes.string,
children: PropTypes.node,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
optionText: PropTypes.oneOfType([
PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ SelectInput.propTypes = {
emptyValue: PropTypes.any,
choices: PropTypes.arrayOf(PropTypes.object),
className: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
optionText: PropTypes.oneOfType([
PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion packages/ra-ui-materialui/src/input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export const TextInput = (props: TextInputProps) => {

TextInput.propTypes = {
className: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.element,
]),
options: PropTypes.object,
resource: PropTypes.string,
source: PropTypes.string,
Expand Down