diff --git a/client/package.json b/client/package.json index 573bd48..20e6b9e 100644 --- a/client/package.json +++ b/client/package.json @@ -56,6 +56,7 @@ "i18next-browser-languagedetector": "^8.0.0", "install": "^0.13.0", "joi": "^17.13.3", + "lodash": "^4.17.21", "lucide-react": "^0.427.0", "print-js": "^1.6.0", "react": "^18.2.0", @@ -86,13 +87,13 @@ "@testing-library/react": "^16.0.0", "@testing-library/react-hooks": "^8.0.1", "@types/jest": "^29.5.12", + "@types/lodash": "^4.17.16", "@types/node": "^20.14.0", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", "@vitejs/plugin-react": "^4.2.1", - "@welldone-software/why-did-you-render": "^8.0.3", "autoprefixer": "^10.4.20", "clsx": "^2.1.1", "eslint": "^8.57.0", diff --git a/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx b/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx index b857d52..457ca7a 100644 --- a/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx +++ b/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx @@ -31,13 +31,7 @@ export const QuoteDetailsCardEditor = ({ defaultValues: Readonly<{ [x: string]: any }> | undefined; }) => { const { toast } = useToast(); - const { - control, - register, - watch, - setValue, - formState: { isDirty }, - } = useFormContext(); + const { control, register } = useFormContext(); const [pickerMode] = useState<"dialog" | "panel">("dialog"); diff --git a/client/src/components/Forms/FormCurrencyField.tsx b/client/src/components/Forms/FormCurrencyField.tsx index 0bac51e..06531f0 100644 --- a/client/src/components/Forms/FormCurrencyField.tsx +++ b/client/src/components/Forms/FormCurrencyField.tsx @@ -44,7 +44,7 @@ export type FormCurrencyFieldProps< }; export const FormCurrencyField = React.forwardRef( - (props, ref) => { + (props /*ref*/) => { const { name, label, diff --git a/client/src/components/Forms/FormPercentageField.tsx b/client/src/components/Forms/FormPercentageField.tsx index b24882b..92f12b2 100644 --- a/client/src/components/Forms/FormPercentageField.tsx +++ b/client/src/components/Forms/FormPercentageField.tsx @@ -45,7 +45,7 @@ export type FormPercentageFieldProps< export const FormPercentageField = React.forwardRef< HTMLDivElement, React.HTMLAttributes & FormPercentageFieldProps ->((props, ref) => { +>((props /*ref*/) => { const { name, label, diff --git a/client/src/components/Forms/FormQuantityField.tsx b/client/src/components/Forms/FormQuantityField.tsx index 960cdf8..d7d70d9 100644 --- a/client/src/components/Forms/FormQuantityField.tsx +++ b/client/src/components/Forms/FormQuantityField.tsx @@ -42,7 +42,7 @@ export type FormQuantityFieldProps< }; export const FormQuantityField = React.forwardRef( - (props, ref) => { + (props /*ref*/) => { const { name, label, diff --git a/client/src/components/Forms/FormTextAreaField.tsx b/client/src/components/Forms/FormTextAreaField.tsx index db4b3bb..26bc79f 100644 --- a/client/src/components/Forms/FormTextAreaField.tsx +++ b/client/src/components/Forms/FormTextAreaField.tsx @@ -50,65 +50,64 @@ export const FormTextAreaField = React.forwardRef< HTMLDivElement, React.TextareaHTMLAttributes & FormTextAreaFieldProps >( - ( + ({ + name, + label, + hint, + placeholder, + description, + + required, + className, + + autoSize, + variant, + + ...props + }) => + /*ref*/ { - name, - label, - hint, - placeholder, - description, + const { control } = useFormContext(); + return ( + ( + + {label && } + + {autoSize ? ( + + ) : ( +