diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f4bdcfe9..a630a83fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout - node/install: install-yarn: true - node-version: '16.13' + node-version: '20' - run: name: install-deps command: yarn @@ -40,7 +40,7 @@ jobs: at: ~/react-forms - node/install: install-yarn: true - node-version: '16.13' + node-version: '20' - run: name: Release new version command: | @@ -55,7 +55,7 @@ jobs: at: ~/react-forms - node/install: install-yarn: true - node-version: '16.13' + node-version: '20' - run: name: Predeploy demo command: | diff --git a/.eslintrc.json b/.eslintrc.json index 94eaf55f8..fb830d1c5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -79,7 +79,7 @@ "no-unused-vars": "error", "react/no-unused-prop-types": "error", "react-hooks/rules-of-hooks": "error", - "react/prop-types": "error", + "react/prop-types": "off", "react/no-unescaped-entities": "error", "no-prototype-builtins": "error", "no-mixed-operators": "error", diff --git a/package.json b/package.json index 1b4b53fda..8e9617c17 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "testEnvironment": "jest-environment-jsdom", "verbose": true, "testPathIgnorePatterns": [ - "/node_modules/" + "/node_modules/", + "packages/suir-component-mapper/" ], "setupFilesAfterEnv": [ "/config/jest.setup.js" @@ -41,6 +42,7 @@ "/packages/**/src/**/*.ts", "!/packages/**/src/**/*.d.ts", "!/packages/react-renderer-demo/**/*.js", + "!/packages/suir-component-mapper/**/*.js", "!/packages/**/dist", "!/templates/**/*.js", "!/packages/**/src/**/index.js", @@ -76,8 +78,8 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.4.3", - "@types/react": "^18.0.18", - "@types/react-dom": "^18.0.6", + "@types/react": "^19.1.2", + "@types/react-dom": "^19.1.3", "@typescript-eslint/eslint-plugin": "^4.31.1", "babel-eslint": "^10.1.0", "babel-jest": "^27.4.6", @@ -106,9 +108,8 @@ "ncp": "^2.0.0", "sass": "^1.77.8", "prettier": "^2.5.1", - "prop-types": "^15.8.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^19.1.0", + "react-dom": "^19.1.0", "regenerator-runtime": "^0.13.9", "replace-in-file": "^6.3.2", "sass-loader": "^12.4.0", diff --git a/packages/ant-component-mapper/package.json b/packages/ant-component-mapper/package.json index 1390083e3..65fb461bd 100644 --- a/packages/ant-component-mapper/package.json +++ b/packages/ant-component-mapper/package.json @@ -31,8 +31,8 @@ "peerDependencies": { "@data-driven-forms/react-form-renderer": "*", "antd": "^4.2.0", - "react": "^16.13.1 || ^17.0.2 || ^18.0.0", - "react-dom": "^16.13.1 || ^17.0.2 || ^18.0.0" + "react": "^17.0.2 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0" }, "dependencies": { "@data-driven-forms/common": "*", diff --git a/packages/ant-component-mapper/src/checkbox/checkbox.js b/packages/ant-component-mapper/src/checkbox/checkbox.js index 199347416..37eb7dc90 100644 --- a/packages/ant-component-mapper/src/checkbox/checkbox.js +++ b/packages/ant-component-mapper/src/checkbox/checkbox.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Checkbox as AntCheckbox } from 'antd'; import MultipleChoiceList from '../multiple-choice-list/multiple-choice-list'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -37,21 +36,6 @@ export const SingleCheckbox = (props) => { ); }; -SingleCheckbox.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - description: PropTypes.node, - validateOnMount: PropTypes.bool, - FormItemProps: PropTypes.object, -}; - const Checkbox = ({ options, ...props }) => (options ? : ); -Checkbox.propTypes = { - options: PropTypes.array, -}; - export default Checkbox; diff --git a/packages/ant-component-mapper/src/date-picker/date-picker.js b/packages/ant-component-mapper/src/date-picker/date-picker.js index fac269f0f..c9d438045 100644 --- a/packages/ant-component-mapper/src/date-picker/date-picker.js +++ b/packages/ant-component-mapper/src/date-picker/date-picker.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { DatePicker as AntDatePicker } from 'antd'; import { validationError } from '../validation-error/validation-error'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -37,17 +36,4 @@ const DatePicker = ({ placeholder = 'Select date', ...props }) => { ); }; -DatePicker.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - placeholder: PropTypes.node, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - locale: PropTypes.string, - description: PropTypes.node, - FormItemProps: PropTypes.object, -}; - export default DatePicker; diff --git a/packages/ant-component-mapper/src/field-array/field-array.js b/packages/ant-component-mapper/src/field-array/field-array.js index 6d4ada922..64f1a39c8 100644 --- a/packages/ant-component-mapper/src/field-array/field-array.js +++ b/packages/ant-component-mapper/src/field-array/field-array.js @@ -1,6 +1,5 @@ import React, { memo, useReducer } from 'react'; import isEqual from 'lodash/isEqual'; -import PropTypes from 'prop-types'; import { useFieldApi, useFormApi, FieldArray } from '@data-driven-forms/react-form-renderer'; import { Row, Col, Button, Typography, Space } from 'antd'; import { UndoOutlined, RedoOutlined } from '@ant-design/icons'; @@ -44,20 +43,6 @@ const ArrayItem = memo( ({ remove: _prevRemove, ...prev }, { remove: _nextRemove, ...next }) => isEqual(prev, next) ); -ArrayItem.propTypes = { - name: PropTypes.string, - fieldIndex: PropTypes.number.isRequired, - fields: PropTypes.arrayOf(PropTypes.object), - remove: PropTypes.func.isRequired, - length: PropTypes.number, - minItems: PropTypes.number, - removeLabel: PropTypes.node.isRequired, - ArrayItemProps: PropTypes.object.isRequired, - FieldsContainerProps: PropTypes.object.isRequired, - RemoveContainerProps: PropTypes.object.isRequired, - RemoveButtonProps: PropTypes.object.isRequired, -}; - const defaultButtonLabels = { add: 'ADD', remove: 'REMOVE', @@ -247,32 +232,4 @@ const DynamicArray = ({ ...props }) => { ); }; -DynamicArray.propTypes = { - label: PropTypes.node, - description: PropTypes.node, - fields: PropTypes.arrayOf(PropTypes.object).isRequired, - defaultItem: PropTypes.any, - minItems: PropTypes.number, - maxItems: PropTypes.number, - noItemsMessage: PropTypes.node, - buttonLabels: PropTypes.object, - // customization props - FormItemProps: PropTypes.object, - ArrayItemProps: PropTypes.object, - FieldsContainerProps: PropTypes.object, - RemoveContainerProps: PropTypes.object, - RemoveButtonProps: PropTypes.object, - FieldArrayRowProps: PropTypes.object, - FieldArrayRowCol: PropTypes.object, - FieldArrayHeaderProps: PropTypes.object, - FieldArrayLabelProps: PropTypes.object, - FieldArrayButtonsProps: PropTypes.object, - UndoButtonProps: PropTypes.object, - RedoButtonProps: PropTypes.object, - AddButtonProps: PropTypes.object, - FieldArrayDescriptionProps: PropTypes.object, - NoItemsMessageProps: PropTypes.object, - ErrorMessageProps: PropTypes.object, -}; - export default DynamicArray; diff --git a/packages/ant-component-mapper/src/form-group/form-group.js b/packages/ant-component-mapper/src/form-group/form-group.js index 20514e268..c2b0ce497 100644 --- a/packages/ant-component-mapper/src/form-group/form-group.js +++ b/packages/ant-component-mapper/src/form-group/form-group.js @@ -1,9 +1,7 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Form } from 'antd'; import { validationError } from '../validation-error/'; -import { childrenPropTypes } from '@data-driven-forms/common/prop-types-templates'; const FormGroup = ({ label, children, isRequired, FormItemProps, meta, validateOnMount, helperText, description, hideLabel, input }) => { const invalid = validationError(meta, validateOnMount); @@ -24,19 +22,4 @@ const FormGroup = ({ label, children, isRequired, FormItemProps, meta, validateO ); }; -FormGroup.propTypes = { - label: PropTypes.string, - children: childrenPropTypes, - help: PropTypes.string, - isRequired: PropTypes.bool, - invalid: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]), - FormItemProps: PropTypes.object, - meta: PropTypes.object, - validateOnMount: PropTypes.bool, - helperText: PropTypes.node, - description: PropTypes.node, - hideLabel: PropTypes.bool, - input: PropTypes.object, -}; - export default FormGroup; diff --git a/packages/ant-component-mapper/src/form-template/form-template.js b/packages/ant-component-mapper/src/form-template/form-template.js index 47e502895..38d3d185c 100644 --- a/packages/ant-component-mapper/src/form-template/form-template.js +++ b/packages/ant-component-mapper/src/form-template/form-template.js @@ -1,8 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Button, Typography, Form as AntForm } from 'antd'; import FormTemplate from '@data-driven-forms/common/form-template'; -import { childrenPropTypes } from '@data-driven-forms/common/prop-types-templates'; const { Title, Paragraph } = Typography; @@ -12,56 +10,30 @@ const Form = ({ children, onSubmit, layout = 'vertical', ...props }) => ( ); -Form.propTypes = { - layout: PropTypes.string, - onSubmit: PropTypes.func, - children: childrenPropTypes, -}; - const Description = ({ children, ...props }) => ( {children} ); -Description.propTypes = { - children: childrenPropTypes, -}; - const TitleComponent = ({ children, ...props }) => ( {children} ); -TitleComponent.propTypes = { - children: childrenPropTypes, -}; - const ButtonGroup = ({ children, ...props }) => (
{children}
); -ButtonGroup.propTypes = { - children: childrenPropTypes, -}; - const ButtonComponent = ({ label, variant, children, buttonType, ...props }) => ( ); -ButtonComponent.propTypes = { - children: childrenPropTypes, - label: PropTypes.node, - variant: PropTypes.string, - buttonType: PropTypes.string, - type: PropTypes.string, -}; - const AntFormTemplate = ({ layout, formWrapperProps, ...props }) => ( ( /> ); -AntFormTemplate.propTypes = { - layout: PropTypes.string, - formWrapperProps: PropTypes.object, -}; - export default AntFormTemplate; diff --git a/packages/ant-component-mapper/src/is-required/is-required.js b/packages/ant-component-mapper/src/is-required/is-required.js index 35df225eb..d20871249 100644 --- a/packages/ant-component-mapper/src/is-required/is-required.js +++ b/packages/ant-component-mapper/src/is-required/is-required.js @@ -1,5 +1,4 @@ import React from 'react'; -import { childrenPropTypes } from '@data-driven-forms/common/prop-types-templates'; import './is-required.css'; @@ -12,8 +11,4 @@ const IsRequired = ({ children }) => ( ); -IsRequired.propTypes = { - children: childrenPropTypes, -}; - export default IsRequired; diff --git a/packages/ant-component-mapper/src/multiple-choice-list/multiple-choice-list.js b/packages/ant-component-mapper/src/multiple-choice-list/multiple-choice-list.js index 2e7f2eebf..a56f01bfa 100644 --- a/packages/ant-component-mapper/src/multiple-choice-list/multiple-choice-list.js +++ b/packages/ant-component-mapper/src/multiple-choice-list/multiple-choice-list.js @@ -1,8 +1,7 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Checkbox as AntCheckbox } from 'antd'; -import MultipleChoiceListCommon, { wrapperProps } from '@data-driven-forms/common/multiple-choice-list'; +import MultipleChoiceListCommon from '@data-driven-forms/common/multiple-choice-list'; import FormGroup from '../form-group'; const FinalCheckbox = ({ isDisabled, label, ...props }) => ( @@ -11,11 +10,6 @@ const FinalCheckbox = ({ isDisabled, label, ...props }) => ( ); -FinalCheckbox.propTypes = { - isDisabled: PropTypes.bool, - label: PropTypes.node, -}; - const Wrapper = ({ label, isRequired, children, meta, input, validateOnMount, helperText, description, FormItemProps }) => ( ); -Wrapper.propTypes = { - ...wrapperProps, -}; - const MultipleChoiceList = (props) => ; -MultipleChoiceList.propTypes = { - input: PropTypes.shape({ - name: PropTypes.string.isRequired, - }), -}; - export default MultipleChoiceList; diff --git a/packages/ant-component-mapper/src/plain-text/plain-text.js b/packages/ant-component-mapper/src/plain-text/plain-text.js index a47073c30..0cdf2fb6e 100644 --- a/packages/ant-component-mapper/src/plain-text/plain-text.js +++ b/packages/ant-component-mapper/src/plain-text/plain-text.js @@ -1,6 +1,5 @@ import React from 'react'; import { Typography } from 'antd'; -import PropTypes from 'prop-types'; const { Paragraph } = Typography; @@ -14,10 +13,4 @@ const PlainText = ({ label, name, TypographyProps, ...rest }) => ( ); -PlainText.propTypes = { - label: PropTypes.string.isRequired, - name: PropTypes.string.isRequired, - TypographyProps: PropTypes.object, -}; - export default PlainText; diff --git a/packages/ant-component-mapper/src/radio/radio.js b/packages/ant-component-mapper/src/radio/radio.js index 6670b143d..40a8edfb8 100644 --- a/packages/ant-component-mapper/src/radio/radio.js +++ b/packages/ant-component-mapper/src/radio/radio.js @@ -1,7 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Radio as AntRadio } from 'antd'; -import { wrapperProps } from '@data-driven-forms/common/multiple-choice-list'; import FormGroup from '../form-group'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -11,11 +9,6 @@ const RadioOption = ({ name, option: { label, value, ...rest } }) => ( ); -RadioOption.propTypes = { - name: PropTypes.string.isRequired, - option: PropTypes.shape({ label: PropTypes.string.isRequired, value: PropTypes.any.isRequired }).isRequired, -}; - const Radio = ({ name, component, ...props }) => { const { options = [], @@ -54,20 +47,4 @@ const Radio = ({ name, component, ...props }) => { ); }; -Radio.propTypes = { - ...wrapperProps, - options: PropTypes.arrayOf( - PropTypes.shape({ - value: PropTypes.any, - label: PropTypes.node, - }) - ), - label: PropTypes.node.isRequired, - isDisabled: PropTypes.bool, - isReadOnly: PropTypes.bool, - description: PropTypes.node, - FormItemProps: PropTypes.object, - component: PropTypes.string, -}; - export default Radio; diff --git a/packages/ant-component-mapper/src/select/select.js b/packages/ant-component-mapper/src/select/select.js index a8a6de170..8d7482090 100644 --- a/packages/ant-component-mapper/src/select/select.js +++ b/packages/ant-component-mapper/src/select/select.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import FormGroup from '../form-group'; import { Select as AntSelect } from 'antd'; @@ -69,20 +68,4 @@ const Select = (props) => { ); }; -Select.propTypes = { - isReadOnly: PropTypes.bool, - isClearable: PropTypes.bool, - isDisabled: PropTypes.bool, - placeholder: PropTypes.node, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - isSearchable: PropTypes.bool, - options: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.any.isRequired, label: PropTypes.node.isRequired })).isRequired, - description: PropTypes.node, - FormItemProps: PropTypes.object, - isMulti: PropTypes.bool, -}; - export default Select; diff --git a/packages/ant-component-mapper/src/sub-form/sub-form.js b/packages/ant-component-mapper/src/sub-form/sub-form.js index 533d1268c..9e732f208 100644 --- a/packages/ant-component-mapper/src/sub-form/sub-form.js +++ b/packages/ant-component-mapper/src/sub-form/sub-form.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Typography, Row, Col } from 'antd'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; @@ -51,20 +50,4 @@ const SubForm = ({ ); }; -SubForm.propTypes = { - fields: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired, - title: PropTypes.node, - description: PropTypes.node, - TitleRowProps: PropTypes.object, - TitleColProps: PropTypes.object, - TitleProps: PropTypes.object, - DescriptionColProps: PropTypes.object, - DescriptionProps: PropTypes.object, - DescriptionRowProps: PropTypes.object, - RowProps: PropTypes.object, - ColProps: PropTypes.object, - component: PropTypes.string, - name: PropTypes.string, -}; - export default SubForm; diff --git a/packages/ant-component-mapper/src/switch/switch.js b/packages/ant-component-mapper/src/switch/switch.js index 0f1225b36..fcc4490ad 100644 --- a/packages/ant-component-mapper/src/switch/switch.js +++ b/packages/ant-component-mapper/src/switch/switch.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Switch as AntSwitch } from 'antd'; import FormGroup from '../form-group'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -52,17 +51,4 @@ export const Switch = (props) => { ); }; -Switch.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - onText: PropTypes.node, - offText: PropTypes.node, - description: PropTypes.node, - FormItemProps: PropTypes.object, -}; - export default Switch; diff --git a/packages/ant-component-mapper/src/tabs/tabs.js b/packages/ant-component-mapper/src/tabs/tabs.js index 9867f37e5..6540d897f 100644 --- a/packages/ant-component-mapper/src/tabs/tabs.js +++ b/packages/ant-component-mapper/src/tabs/tabs.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; import { Tabs } from 'antd'; @@ -19,8 +18,4 @@ const FormTabs = ({ fields, ...rest }) => { ); }; -FormTabs.propTypes = { - fields: PropTypes.array.isRequired, -}; - export default FormTabs; diff --git a/packages/ant-component-mapper/src/text-field/text-field.js b/packages/ant-component-mapper/src/text-field/text-field.js index 43bcfd4d6..2f5519f26 100644 --- a/packages/ant-component-mapper/src/text-field/text-field.js +++ b/packages/ant-component-mapper/src/text-field/text-field.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Input /* Typography */ } from 'antd'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -33,16 +32,4 @@ const TextField = (props) => { ); }; -TextField.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - placeholder: PropTypes.node, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - description: PropTypes.node, - FormItemProps: PropTypes.object, -}; - export default TextField; diff --git a/packages/ant-component-mapper/src/textarea/textarea.js b/packages/ant-component-mapper/src/textarea/textarea.js index dbc9af9ea..09cabc484 100644 --- a/packages/ant-component-mapper/src/textarea/textarea.js +++ b/packages/ant-component-mapper/src/textarea/textarea.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Input } from 'antd'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -35,16 +34,4 @@ const Textarea = (props) => { ); }; -Textarea.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - placeholder: PropTypes.node, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - description: PropTypes.node, - FormItemProps: PropTypes.object, -}; - export default Textarea; diff --git a/packages/ant-component-mapper/src/time-picker/time-picker.js b/packages/ant-component-mapper/src/time-picker/time-picker.js index 67e58d700..0e6c60ee1 100644 --- a/packages/ant-component-mapper/src/time-picker/time-picker.js +++ b/packages/ant-component-mapper/src/time-picker/time-picker.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { TimePicker as AntTimePicker } from 'antd'; import { validationError } from '../validation-error/validation-error'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -51,17 +50,4 @@ const TimePicker = (props) => { ); }; -TimePicker.propTypes = { - isReadOnly: PropTypes.bool, - isDisabled: PropTypes.bool, - placeholder: PropTypes.node, - isRequired: PropTypes.bool, - label: PropTypes.node, - helperText: PropTypes.node, - validateOnMount: PropTypes.bool, - locale: PropTypes.string, - description: PropTypes.node, - FormItemProps: PropTypes.object, -}; - export default TimePicker; diff --git a/packages/ant-component-mapper/src/wizard/step-buttons.js b/packages/ant-component-mapper/src/wizard/step-buttons.js index 29e56409d..ee1bc5637 100644 --- a/packages/ant-component-mapper/src/wizard/step-buttons.js +++ b/packages/ant-component-mapper/src/wizard/step-buttons.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Button } from 'antd'; import selectNext from '@data-driven-forms/common/wizard/select-next'; @@ -29,23 +28,6 @@ const NextButton = ({ ); }; -NextButton.propTypes = { - nextStep: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]), - handleSubmit: PropTypes.func.isRequired, - valid: PropTypes.bool, - handleNext: PropTypes.func.isRequired, - getState: PropTypes.func.isRequired, - buttonLabels: PropTypes.shape({ - submit: PropTypes.node.isRequired, - cancel: PropTypes.node.isRequired, - back: PropTypes.node.isRequired, - next: PropTypes.node.isRequired, - }).isRequired, - NextButtonProps: PropTypes.object, - SubmitButtonProps: PropTypes.object, - conditionalSubmitFlag: PropTypes.string.isRequired, -}; - const WizardStepButtons = ({ disableBack, handlePrev, @@ -81,27 +63,4 @@ const WizardStepButtons = ({ ); -WizardStepButtons.propTypes = { - disableBack: PropTypes.bool, - handlePrev: PropTypes.func.isRequired, - handleNext: PropTypes.func.isRequired, - conditionalSubmitFlag: PropTypes.string.isRequired, - nextStep: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.shape({ - when: PropTypes.string.isRequired, - stepMapper: PropTypes.object.isRequired, - }), - ]), - buttonLabels: PropTypes.object.isRequired, - formOptions: PropTypes.shape({ - onCancel: PropTypes.func.isRequired, - }).isRequired, - ButtonProps: PropTypes.object, - NextButtonProps: PropTypes.object, - BackButtonProps: PropTypes.object, - CancelButtonProps: PropTypes.object, - SubmitButtonProps: PropTypes.object, -}; - export default WizardStepButtons; diff --git a/packages/ant-component-mapper/src/wizard/wizard-step.js b/packages/ant-component-mapper/src/wizard/wizard-step.js index a9b6d5ab6..a8c07e08d 100644 --- a/packages/ant-component-mapper/src/wizard/wizard-step.js +++ b/packages/ant-component-mapper/src/wizard/wizard-step.js @@ -1,5 +1,4 @@ import React, { Fragment } from 'react'; -import PropTypes from 'prop-types'; import FormSpy from '@data-driven-forms/react-form-renderer/form-spy'; import WizardStepButtons from './step-buttons'; @@ -14,12 +13,4 @@ const WizardStep = ({ fields = [], formOptions, WizardStepProps, ...rest }) => ( ); -WizardStep.propTypes = { - fields: PropTypes.array, - formOptions: PropTypes.shape({ - renderForm: PropTypes.func.isRequired, - }).isRequired, - WizardStepProps: PropTypes.object, -}; - export default WizardStep; diff --git a/packages/ant-component-mapper/src/wizard/wizard.js b/packages/ant-component-mapper/src/wizard/wizard.js index 24c6dd1e4..31a58e40e 100644 --- a/packages/ant-component-mapper/src/wizard/wizard.js +++ b/packages/ant-component-mapper/src/wizard/wizard.js @@ -1,6 +1,5 @@ import React, { useContext } from 'react'; import WizardStep from './wizard-step'; -import PropTypes from 'prop-types'; import { Steps, Modal } from 'antd'; import Wizard from '@data-driven-forms/common/wizard/wizard'; import { WizardContext } from '@data-driven-forms/react-form-renderer'; @@ -60,28 +59,8 @@ const WizardInternal = ({ ); }; -WizardInternal.propTypes = { - title: PropTypes.string, - buttonLabels: PropTypes.object, - stepsInfo: PropTypes.array, - WizardProps: PropTypes.object, - TitleProps: PropTypes.object, - StepProps: PropTypes.object, - WizardStepProps: PropTypes.object, - ButtonProps: PropTypes.object, - NextButtonProps: PropTypes.object, - BackButtonProps: PropTypes.object, - CancelButtonProps: PropTypes.object, - SubmitButtonProps: PropTypes.object, - conditionalSubmitFlag: PropTypes.string.isRequired, -}; - const WizardFinal = ({ buttonLabels, ...props }) => ( ); -WizardFinal.propTypes = { - buttonLabels: PropTypes.object, -}; - export default WizardFinal; diff --git a/packages/blueprint-component-mapper/package.json b/packages/blueprint-component-mapper/package.json index 266f1d15b..7eea1dc54 100644 --- a/packages/blueprint-component-mapper/package.json +++ b/packages/blueprint-component-mapper/package.json @@ -37,14 +37,13 @@ "@blueprintjs/core": "^4.2.1", "@blueprintjs/datetime": "^4.1.4", "@blueprintjs/select": "^4.1.4", - "react": "^16.13.1 || ^17.0.2 || ^18.0.0", - "react-dom": "^16.13.1 || ^17.0.2 || ^18.0.0" + "react": "^17.0.2 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0" }, "dependencies": { "@data-driven-forms/common": "*", "clsx": "^1.1.0", "lodash": "^4.17.21", - "prop-types": "^15.7.2", "react-jss": "^10.5.0" } } diff --git a/packages/blueprint-component-mapper/src/checkbox/checkbox.js b/packages/blueprint-component-mapper/src/checkbox/checkbox.js index cc40dfe09..ee10ed860 100644 --- a/packages/blueprint-component-mapper/src/checkbox/checkbox.js +++ b/packages/blueprint-component-mapper/src/checkbox/checkbox.js @@ -1,5 +1,4 @@ import React, { useContext } from 'react'; -import PropTypes from 'prop-types'; import MultipleChoiceList from '@data-driven-forms/common/multiple-choice-list'; import { Checkbox, FormGroup, Intent } from '@blueprintjs/core'; @@ -24,15 +23,6 @@ const SingleCheckbox = ({ input, isDisabled, disabled, label, providerRequired, /> ); -SingleCheckbox.propTypes = { - input: PropTypes.object, - isDisabled: PropTypes.bool, - label: PropTypes.node, - isRequired: PropTypes.bool, - providerRequired: PropTypes.node, - disabled: PropTypes.bool, -}; - const Wrapper = ({ children, isRequired, showError, error, validateOnMount, ...props }) => { const { required } = useContext(BlueprintContext); @@ -47,14 +37,6 @@ const Wrapper = ({ children, isRequired, showError, error, validateOnMount, ...p ); }; -Wrapper.propTypes = { - children: PropTypes.node, - isRequired: PropTypes.bool, - showError: PropTypes.bool, - error: PropTypes.string, - validateOnMount: PropTypes.bool, -}; - const WrapperCheckbox = (props) => props.options ? ( @@ -62,8 +44,4 @@ const WrapperCheckbox = (props) => ); -WrapperCheckbox.propTypes = { - options: PropTypes.array, -}; - export default WrapperCheckbox; diff --git a/packages/blueprint-component-mapper/src/date-picker/date-picker.js b/packages/blueprint-component-mapper/src/date-picker/date-picker.js index 24a1cff2f..77467bb5b 100644 --- a/packages/blueprint-component-mapper/src/date-picker/date-picker.js +++ b/packages/blueprint-component-mapper/src/date-picker/date-picker.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Popover, Button } from '@blueprintjs/core'; import { DatePicker as BDatePicker } from '@blueprintjs/datetime'; @@ -22,15 +21,6 @@ const DatePicker = ({ ); -DatePicker.propTypes = { - input: PropTypes.object, - disabled: PropTypes.bool, - placeholder: PropTypes.node, - valueRenderer: PropTypes.func, - PopoverProps: PropTypes.object, - ButtonProps: PropTypes.object, -}; - const WrapperDatePicker = (props) => ; export default WrapperDatePicker; diff --git a/packages/blueprint-component-mapper/src/dual-list-select/dual-list-select.js b/packages/blueprint-component-mapper/src/dual-list-select/dual-list-select.js index d9036552d..b4e5cfa5f 100644 --- a/packages/blueprint-component-mapper/src/dual-list-select/dual-list-select.js +++ b/packages/blueprint-component-mapper/src/dual-list-select/dual-list-select.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import DualListSelectCommon from '@data-driven-forms/common/dual-list-select'; import { Menu, MenuItem, ButtonGroup, Button, ControlGroup, InputGroup } from '@blueprintjs/core'; @@ -49,23 +48,6 @@ const List = ({ value = [], optionClick, noOptionsTitle, filterValue, filterValu ); }; -List.propTypes = { - value: PropTypes.arrayOf( - PropTypes.shape({ - value: PropTypes.string.isRequired, - label: PropTypes.string.isRequired, - }) - ), - optionClick: PropTypes.func.isRequired, - noOptionsTitle: PropTypes.node, - filterValue: PropTypes.string, - filterValueText: PropTypes.node, - selectedValues: PropTypes.array, - checkboxVariant: PropTypes.bool, - MenuProps: PropTypes.object, - MenuItemProps: PropTypes.object, -}; - const Toolbar = ({ sortTitle, onFilter, @@ -83,18 +65,6 @@ const Toolbar = ({ ); -Toolbar.propTypes = { - sortTitle: PropTypes.node, - onFilter: PropTypes.func.isRequired, - onSort: PropTypes.func.isRequired, - sortDirection: PropTypes.bool, - value: PropTypes.string, - placeholder: PropTypes.string, - ControlGroupProps: PropTypes.object, - InputGroupProps: PropTypes.object, - ButtonProps: PropTypes.object, -}; - const DualListInternal = ({ allToRight = true, allToLeft = true, @@ -234,57 +204,6 @@ const DualListInternal = ({ ); }; -DualListInternal.propTypes = { - leftTitle: PropTypes.node, - rightTitle: PropTypes.node, - moveLeftTitle: PropTypes.node, - moveRightTitle: PropTypes.node, - allToLeft: PropTypes.bool, - allToRight: PropTypes.bool, - validateOnMount: PropTypes.bool, - moveAllLeftTitle: PropTypes.node, - moveAllRightTitle: PropTypes.node, - noValueTitle: PropTypes.node, - noOptionsTitle: PropTypes.node, - filterOptionsTitle: PropTypes.node, - filterValueTitle: PropTypes.node, - filterValueText: PropTypes.node, - filterOptionsText: PropTypes.node, - state: PropTypes.object, - sortOptions: PropTypes.func, - filterOptions: PropTypes.func, - handleOptionsClick: PropTypes.func, - leftValues: PropTypes.array, - handleMoveRight: PropTypes.func, - handleMoveLeft: PropTypes.func, - handleClearLeftValues: PropTypes.func, - handleClearRightValues: PropTypes.func, - sortValues: PropTypes.func, - filterValues: PropTypes.func, - rightValues: PropTypes.array, - handleValuesClick: PropTypes.func, - WrapperProps: PropTypes.object, - LeftWrapperProps: PropTypes.object, - RightWrapperProps: PropTypes.object, - ButtonGroupProps: PropTypes.object, - ToRightButtonProps: PropTypes.object, - AllToRightButtonProps: PropTypes.object, - AllToLeftButtonProps: PropTypes.object, - ToLeftButtonProps: PropTypes.object, - LeftControlGroupProps: PropTypes.object, - LeftInputGroupProps: PropTypes.object, - LeftButtonProps: PropTypes.object, - RightControlGroupProps: PropTypes.object, - RightInputGroupProps: PropTypes.object, - RightButtonProps: PropTypes.object, - LeftMenuProps: PropTypes.object, - LeftMenuItemProps: PropTypes.object, - RightMenuProps: PropTypes.object, - RightMenuItemProps: PropTypes.object, - leftSortTitle: PropTypes.string, - rightSortTitle: PropTypes.string, -}; - const DualListWrapper = (props) => ; const DualListSelect = (props) => ; diff --git a/packages/blueprint-component-mapper/src/field-array/field-array.js b/packages/blueprint-component-mapper/src/field-array/field-array.js index b34208e0f..b3d9d1406 100644 --- a/packages/blueprint-component-mapper/src/field-array/field-array.js +++ b/packages/blueprint-component-mapper/src/field-array/field-array.js @@ -1,5 +1,4 @@ import React, { memo, useContext } from 'react'; -import PropTypes from 'prop-types'; import isEqual from 'lodash/isEqual'; import clsx from 'clsx'; import { useFieldApi, useFormApi, FieldArray as FieldArrayFF } from '@data-driven-forms/react-form-renderer'; @@ -48,16 +47,6 @@ const ArrayItem = memo( ({ remove: _prevRemove, ...prev }, { remove: _nextRemove, ...next }) => isEqual(prev, next) ); -ArrayItem.propTypes = { - remove: PropTypes.func, - fields: PropTypes.array, - name: PropTypes.string, - removeLabel: PropTypes.node, - ArrayItemProps: PropTypes.object, - RemoveButtonProps: PropTypes.object, - disabledRemove: PropTypes.bool, -}; - const FieldArray = (props) => { const { defaultItem, @@ -134,25 +123,4 @@ const FieldArray = (props) => { ); }; -FieldArray.propTypes = { - name: PropTypes.string, - defaultItem: PropTypes.any, - fields: PropTypes.array, - label: PropTypes.node, - description: PropTypes.node, - buttonLabels: PropTypes.object, - AddContainerProps: PropTypes.object, - AddButtonProps: PropTypes.object, - RemoveButtonProps: PropTypes.object, - ArrayItemProps: PropTypes.object, - FormGroupProps: PropTypes.object, - FieldArrayProps: PropTypes.object, - noItemsMessage: PropTypes.node, - validateOnMount: PropTypes.bool, - helperText: PropTypes.node, - isRequired: PropTypes.bool, - maxItems: PropTypes.number, - minItems: PropTypes.number, -}; - export default FieldArray; diff --git a/packages/blueprint-component-mapper/src/form-group/form-group.js b/packages/blueprint-component-mapper/src/form-group/form-group.js index 99aa9899b..0ffb21e34 100644 --- a/packages/blueprint-component-mapper/src/form-group/form-group.js +++ b/packages/blueprint-component-mapper/src/form-group/form-group.js @@ -1,5 +1,4 @@ import React, { useContext } from 'react'; -import PropTypes from 'prop-types'; import { FormGroup, Intent } from '@blueprintjs/core'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; @@ -46,21 +45,6 @@ export const FormGroupInternal = ({ ); }; -FormGroupInternal.propTypes = { - isDisabled: PropTypes.bool, - isReadOnly: PropTypes.bool, - isRequired: PropTypes.bool, - Component: PropTypes.any, - helperText: PropTypes.node, - label: PropTypes.node, - validateOnMount: PropTypes.bool, - description: PropTypes.node, - FormGroupProps: PropTypes.object, - hideLabel: PropTypes.bool, - meta: PropTypes.object, - input: PropTypes.object, -}; - const FormGroupWrapper = (props) => { const rest = useFieldApi(props); diff --git a/packages/blueprint-component-mapper/src/form-template/form-template.js b/packages/blueprint-component-mapper/src/form-template/form-template.js index 0ea11a116..32e69584f 100644 --- a/packages/blueprint-component-mapper/src/form-template/form-template.js +++ b/packages/blueprint-component-mapper/src/form-template/form-template.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { createUseStyles } from 'react-jss'; import FormTemplate from '@data-driven-forms/common/form-template'; @@ -12,10 +11,6 @@ const Form = ({ children, ...props }) => ( ); -Form.propTypes = { - children: PropTypes.node, -}; - const useStyles = createUseStyles({ buttonGroup: { marginTop: 16, @@ -36,42 +31,20 @@ const ButtonGroup = ({ children, ...props }) => { ); }; -ButtonGroup.propTypes = { - children: PropTypes.node, -}; - const Title = ({ children, ...props }) =>

{children}

; -Title.propTypes = { - children: PropTypes.node, -}; - const Description = ({ children, ...props }) =>

{children}

; -Description.propTypes = { - children: PropTypes.node, -}; - const InnerButton = ({ label, buttonType, ...props }) => ( ); -InnerButton.propTypes = { - children: PropTypes.node, - label: PropTypes.node, - buttonType: PropTypes.string, -}; - const BlueprintFormTemplate = ({ requiredLabelInfo, ...props }) => ( (required) }}> ); -BlueprintFormTemplate.propTypes = { - requiredLabelInfo: PropTypes.node, -}; - export default BlueprintFormTemplate; diff --git a/packages/blueprint-component-mapper/src/plain-text/plain-text.js b/packages/blueprint-component-mapper/src/plain-text/plain-text.js index 2fa6f1c2c..a7468dbe3 100644 --- a/packages/blueprint-component-mapper/src/plain-text/plain-text.js +++ b/packages/blueprint-component-mapper/src/plain-text/plain-text.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Text } from '@blueprintjs/core'; @@ -7,10 +6,4 @@ const PlainText = ({ component, label, name, ...props }) => { return {label}; }; -PlainText.propTypes = { - component: PropTypes.string, - label: PropTypes.node, - name: PropTypes.string, -}; - export default PlainText; diff --git a/packages/blueprint-component-mapper/src/radio/radio.js b/packages/blueprint-component-mapper/src/radio/radio.js index 593364a31..c473153f1 100644 --- a/packages/blueprint-component-mapper/src/radio/radio.js +++ b/packages/blueprint-component-mapper/src/radio/radio.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { RadioGroup } from '@blueprintjs/core'; @@ -23,13 +22,6 @@ const Radio = ({ input, label, isRequired, providerRequired, ...props }) => ( /> ); -Radio.propTypes = { - input: PropTypes.object, - label: PropTypes.node, - isRequired: PropTypes.bool, - providerRequired: PropTypes.node, -}; - const WrapperRadio = (props) => ; export default WrapperRadio; diff --git a/packages/blueprint-component-mapper/src/select/select.js b/packages/blueprint-component-mapper/src/select/select.js index fd21ecb72..464cba222 100644 --- a/packages/blueprint-component-mapper/src/select/select.js +++ b/packages/blueprint-component-mapper/src/select/select.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import FormGroupWrapper from '../form-group/form-group'; @@ -78,17 +77,6 @@ const Select = ({ ); }; -Select.propTypes = { - input: PropTypes.object, - options: PropTypes.array, - placeholder: PropTypes.node, - isSearchable: PropTypes.bool, - noOptionsMessage: PropTypes.node, - tagInputProps: PropTypes.object, - isMulti: PropTypes.bool, - disabled: PropTypes.bool, -}; - const WrapperSelect = (props) => ; export default WrapperSelect; diff --git a/packages/blueprint-component-mapper/src/slider/slider.js b/packages/blueprint-component-mapper/src/slider/slider.js index e7e5d4709..e73f35028 100644 --- a/packages/blueprint-component-mapper/src/slider/slider.js +++ b/packages/blueprint-component-mapper/src/slider/slider.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import FormGroupWrapper from '../form-group/form-group'; @@ -8,11 +7,6 @@ import propsCatcher from '../props-catcher/props-catcher'; const Slider = ({ input, step, ...props }) => ; -Slider.propTypes = { - input: PropTypes.object, - step: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), -}; - const WrapperSlider = (props) => ; export default WrapperSlider; diff --git a/packages/blueprint-component-mapper/src/sub-form/sub-form.js b/packages/blueprint-component-mapper/src/sub-form/sub-form.js index 6b5970051..580e227e0 100644 --- a/packages/blueprint-component-mapper/src/sub-form/sub-form.js +++ b/packages/blueprint-component-mapper/src/sub-form/sub-form.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; import { H3, H4 } from '@blueprintjs/core'; @@ -18,10 +17,4 @@ const SubForm = ({ title, description, fields, ...props }) => { ); }; -SubForm.propTypes = { - title: PropTypes.node, - description: PropTypes.node, - fields: PropTypes.array, -}; - export default SubForm; diff --git a/packages/blueprint-component-mapper/src/switch/switch.js b/packages/blueprint-component-mapper/src/switch/switch.js index df0c60d14..d99e6f649 100644 --- a/packages/blueprint-component-mapper/src/switch/switch.js +++ b/packages/blueprint-component-mapper/src/switch/switch.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Switch as BSwitch } from '@blueprintjs/core'; @@ -21,15 +20,6 @@ const Switch = ({ input, isRequired, label, onText, offText, providerRequired, . /> ); -Switch.propTypes = { - input: PropTypes.object, - isRequired: PropTypes.bool, - label: PropTypes.node, - onText: PropTypes.node, - offText: PropTypes.node, - providerRequired: PropTypes.node, -}; - const WrapperSwitch = (props) => ; export default WrapperSwitch; diff --git a/packages/blueprint-component-mapper/src/tabs/tabs.js b/packages/blueprint-component-mapper/src/tabs/tabs.js index fadd3ac51..a1fa7d8ab 100644 --- a/packages/blueprint-component-mapper/src/tabs/tabs.js +++ b/packages/blueprint-component-mapper/src/tabs/tabs.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { Tab, Tabs as BTabs } from '@blueprintjs/core'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; @@ -16,10 +15,4 @@ const Tabs = ({ component, name, fields, ...props }) => { ); }; -Tabs.propTypes = { - component: PropTypes.string, - name: PropTypes.string, - fields: PropTypes.array, -}; - export default Tabs; diff --git a/packages/blueprint-component-mapper/src/text-field/text-field.js b/packages/blueprint-component-mapper/src/text-field/text-field.js index ec1dac5bf..ecd98357a 100644 --- a/packages/blueprint-component-mapper/src/text-field/text-field.js +++ b/packages/blueprint-component-mapper/src/text-field/text-field.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import FormGroupWrapper from '../form-group/form-group'; @@ -8,10 +7,6 @@ import propsCatcher from '../props-catcher/props-catcher'; const TextField = ({ input, ...props }) => ; -TextField.propTypes = { - input: PropTypes.object, -}; - const WrapperTextField = (props) => ; export default WrapperTextField; diff --git a/packages/blueprint-component-mapper/src/textarea/textarea.js b/packages/blueprint-component-mapper/src/textarea/textarea.js index fab55706e..ec09b90db 100644 --- a/packages/blueprint-component-mapper/src/textarea/textarea.js +++ b/packages/blueprint-component-mapper/src/textarea/textarea.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { TextArea } from '@blueprintjs/core'; import FormGroupWrapper from '../form-group/form-group'; @@ -7,10 +6,6 @@ import propsCatcher from '../props-catcher/props-catcher'; const Textarea = ({ input, ...props }) =>