@griddo/ax 11.0.1 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.0.
|
|
4
|
+
"version": "11.0.2",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -229,5 +229,5 @@
|
|
|
229
229
|
"publishConfig": {
|
|
230
230
|
"access": "public"
|
|
231
231
|
},
|
|
232
|
-
"gitHead": "
|
|
232
|
+
"gitHead": "52234fea5357b3aea22140b23a681c50e8255962"
|
|
233
233
|
}
|
|
@@ -9,19 +9,18 @@ import ArrayFieldInline from "./ArrayFieldInline";
|
|
|
9
9
|
import * as S from "./style";
|
|
10
10
|
|
|
11
11
|
const ArrayFieldGroup = (props: IProps): JSX.Element => {
|
|
12
|
-
const { value, name, innerFields, onChange, divider, arrayType, site, disabled } = props;
|
|
12
|
+
const { value, name, innerFields, onChange, divider, arrayType, site, disabled, editorID } = props;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const initialValueMapped = initialValue.map((val: any) => {
|
|
16
|
-
return val.id ? val : { id: uuidv4(), ...val };
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const [items, setItems] = useState(initialValueMapped);
|
|
14
|
+
const [items, setItems] = useState<any[]>([]);
|
|
20
15
|
const [isOpen, setIsOpen] = useState<number | null>(null);
|
|
21
16
|
|
|
22
17
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const initialValue = value ? Object.values(value) : [];
|
|
19
|
+
const initialValueMapped = initialValue.map((val: any) => {
|
|
20
|
+
return val.id ? val : { id: uuidv4(), ...val };
|
|
21
|
+
});
|
|
22
|
+
setItems(initialValueMapped);
|
|
23
|
+
}, [editorID]);
|
|
25
24
|
|
|
26
25
|
const handleClick = () => {
|
|
27
26
|
const newItems = [...items, { id: uuidv4() }];
|
|
@@ -102,6 +101,7 @@ export interface IProps {
|
|
|
102
101
|
arrayType: string;
|
|
103
102
|
site: ISite | null;
|
|
104
103
|
disabled?: boolean;
|
|
104
|
+
editorID: number;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export default ArrayFieldGroup;
|