From be4b4567ccc1732465343c5c2f5869de56142e24 Mon Sep 17 00:00:00 2001 From: Nastya Date: Tue, 9 Jan 2024 06:52:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=B8=D0=BD=D0=BF=D1=83=D1=82=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D0=BA=D0=B0=D0=B5=D1=82=20=D0=B1=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D1=88=D0=B5=20=D1=83=D0=BA=D0=B0=D0=B7=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BE=D0=BB=D0=B8=D1=87=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B0=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BranchingMap/style/stylesheet.ts | 1 - src/ui_kit/CustomSlider.tsx | 4 +-- src/ui_kit/CustomTextField.tsx | 30 +++++++++++-------- src/ui_kit/LabeledDatePicker.tsx | 6 ++-- .../QuizPreviewQuestionTypes/Emoji.tsx | 5 ++-- .../QuizPreviewQuestionTypes/File.tsx | 7 +++-- .../QuizPreviewQuestionTypes/Images.tsx | 2 +- .../QuizPreviewQuestionTypes/Number.tsx | 6 ++-- .../QuizPreviewQuestionTypes/Rating.tsx | 2 +- .../QuizPreviewQuestionTypes/Text.tsx | 6 ++-- .../QuizPreviewQuestionTypes/Variant.tsx | 5 ++-- .../QuizPreviewQuestionTypes/Varimg.tsx | 2 +- 12 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/pages/Questions/BranchingMap/style/stylesheet.ts b/src/pages/Questions/BranchingMap/style/stylesheet.ts index 6bd36d67..53e264fa 100644 --- a/src/pages/Questions/BranchingMap/style/stylesheet.ts +++ b/src/pages/Questions/BranchingMap/style/stylesheet.ts @@ -16,7 +16,6 @@ export const stylesheet: Stylesheet[] = [ "text-wrap": "wrap", "text-max-width": "130px", "text-overflow-wrap": "anywhere", - }, }, { diff --git a/src/ui_kit/CustomSlider.tsx b/src/ui_kit/CustomSlider.tsx index 206d7648..763d9e0f 100644 --- a/src/ui_kit/CustomSlider.tsx +++ b/src/ui_kit/CustomSlider.tsx @@ -24,7 +24,7 @@ export const CustomSlider = ({ onChange, onChangeCommitted, sx, - className + className, }: CustomSliderProps) => { // const handleChange = ({ type }: Event, newValue: number | number[]) => { // // Для корректной работы слайдера в FireFox @@ -36,7 +36,7 @@ export const CustomSlider = ({ return ( ; type?: string; rows?: number; - className?:string; + className?: string; } export default function CustomTextField({ @@ -44,8 +44,7 @@ export default function CustomTextField({ type = "", rows = 0, sxForm, - className - + className, }: CustomTextFieldProps) { const theme = useTheme(); @@ -57,16 +56,18 @@ export default function CustomTextField({ }, [value]); const handleInputChange = (event: React.ChangeEvent) => { - const inputValue = event.target.value; + if (event.target.value.length <= maxLength) { + const inputValue = event.target.value; - if (type === "number") { - setInputValue(inputValue.replace(/\D/g, "")); - } else { - setInputValue(inputValue); - } + if (type === "number") { + setInputValue(inputValue.replace(/\D/g, "")); + } else { + setInputValue(inputValue); + } - if (onChange) { - onChange(event); + if (onChange) { + onChange(event); + } } }; @@ -83,7 +84,12 @@ export default function CustomTextField({ }; return ( - + {error && ( ; value?: Dayjs | null; onChange?: (value: Dayjs | null) => void; - className?: string + className?: string; } export default function LabeledDatePicker({ @@ -27,7 +27,7 @@ export default function LabeledDatePicker({ sx, sxIcon, sxDate, - className + className, }: Props) { const theme = useTheme(); const upLg = useMediaQuery(theme.breakpoints.up("md")); @@ -52,7 +52,7 @@ export default function LabeledDatePicker({ )} + {question.title} -