ehscan-react-components 0.1.41 → 0.1.42
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/README.md +27 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,39 +19,36 @@ The component is fully controlled — the parent manages the state and receives
|
|
|
19
19
|
|
|
20
20
|
### Implementation
|
|
21
21
|
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
```jsx
|
|
23
|
+
import { useEffect, useState } from "react";
|
|
24
|
+
import { AddBox, useChangeAddBox } from 'ehscan-react-components';
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const Elements = () => {
|
|
27
27
|
|
|
28
28
|
const [inValue, setInValue] = useState({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default Elements;
|
|
29
|
+
add: [
|
|
30
|
+
{ id: 0, title: "first Entry" },
|
|
31
|
+
{ id: 1, title: "second Entry" },
|
|
32
|
+
{ id: 2, title: "last Entry" }
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
console.log(inValue); //use ValueChanges on save
|
|
38
|
+
},[inValue])
|
|
39
|
+
|
|
40
|
+
const changeAddBox = useChangeAddBox(inValue, setInValue, "add"); //change on specific tag
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<div className="element-wrapper"> {/* ✏️ Put custom styling overrides here */}
|
|
45
|
+
<AddBox title="Element-Title" value={inValue.add} onChange={(value, id) => changeAddBox(value, id)} />
|
|
46
|
+
</div>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default Elements;
|
|
55
52
|
```
|
|
56
53
|
|
|
57
54
|
### Styling
|