Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3471 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3471 Rev 3475
Línea 2... Línea 2...
2
import { Controller, useFormContext } from 'react-hook-form';
2
import { Controller, useFormContext } from 'react-hook-form';
3
import { FormControl, FormLabel, Typography } from '@mui/material';
3
import { FormControl, FormLabel, Typography } from '@mui/material';
4
import { CKEditor } from '@ckeditor/ckeditor5-react';
4
import { CKEditor } from '@ckeditor/ckeditor5-react';
5
import Editor from '@components/common/ckeditor/ClassicEditor';
5
import Editor from '@components/common/ckeditor/ClassicEditor';
Línea 6... Línea 6...
6
 
6
 
7
export function FormRichEditor({
-
 
8
  id = '',
-
 
9
  label = '',
-
 
10
  name = '',
-
 
11
  disabled,
-
 
12
  rules,
-
 
13
  style = {},
-
 
14
  onReady = () => {}
-
 
15
}) {
7
export function FormRichEditor({ label = '', name = '', disabled, rules, onReady = () => {} }) {
Línea 16... Línea 8...
16
  const { control } = useFormContext();
8
  const { control } = useFormContext();
17
 
9
 
18
  return (
10
  return (
19
    <Controller
11
    <Controller
20
      name={name}
12
      name={name}
21
      control={control}
13
      control={control}
22
      disabled={disabled}
14
      disabled={disabled}
23
      rules={rules}
15
      rules={rules}
24
      render={({ field: { value, onChange, disabled }, fieldState: { error } }) => (
16
      render={({ field: { value, onChange, disabled }, fieldState: { error } }) => (
Línea 25... Línea 17...
25
        <FormControl variant='standard' fullWidth sx={style}>
17
        <FormControl variant='standard' fullWidth>
26
          {label && <FormLabel htmlFor={id}>{label}</FormLabel>}
18
          {label && <FormLabel>{label}</FormLabel>}
27
 
19
 
28
          <CKEditor
20
          <CKEditor
29
            editor={Editor}
21
            editor={Editor}
30
            onReady={onReady}
-
 
31
            data={value}
22
            onReady={onReady}
32
            onChange={(event, editor) => onChange(editor.getData())}
23
            data={value}
Línea 33... Línea 24...
33
            id={id}
24
            onChange={(event, editor) => onChange(editor.getData())}
34
            disabled={disabled}
25
            disabled={disabled}