File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
src/components/form/input Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,7 @@ import { mdiDelete, mdiTablePlus } from "@mdi/js";
5
5
import { FormContext } from "../Form" ;
6
6
import { Button } from "../../layout/button" ;
7
7
import Translation from "../../localization/translation.component" ;
8
-
9
- function createUUID ( ) {
10
- return crypto . randomUUID ( )
11
- }
8
+ import { Resolver } from "../../../core" ;
12
9
13
10
export class ComplexTypeInput extends React . Component {
14
11
static contextType = FormContext
@@ -28,13 +25,15 @@ export class ComplexTypeInput extends React.Component {
28
25
29
26
registerField ( ) {
30
27
this . context . addField ( {
31
- field : this . props ,
32
- value : this . props . value ?. map ( el => {
33
- return {
34
- ...el ,
35
- _uuid : createUUID ( )
36
- }
37
- } )
28
+ field : {
29
+ ...this . props ,
30
+ value : this . props . value ?. map ( el => {
31
+ return {
32
+ ...el ,
33
+ _uuid : Resolver . uuid ( ) ,
34
+ }
35
+ } )
36
+ }
38
37
} )
39
38
}
40
39
@@ -59,7 +58,7 @@ export class ComplexTypeInput extends React.Component {
59
58
const field = this . context . fields [ id ] || { value : [ ] } ;
60
59
61
60
field . value . push ( {
62
- _uuid : createUUID ( ) ,
61
+ _uuid : Resolver . uuid ( ) ,
63
62
...blankEntity } )
64
63
65
64
this . onChange ( field . value )
You can’t perform that action at this time.
0 commit comments