ywana-core8 0.0.243 → 0.0.244

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.243",
3
+ "version": "0.0.244",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@ export const Property = (props) => {
17
17
  }
18
18
 
19
19
  function clear() {
20
- if (onChange) onChange("")
20
+ if (onChange) onChange(id, "")
21
21
  }
22
22
 
23
23
  return (
@@ -1,11 +1,23 @@
1
- import React from 'react'
1
+ import React, { useState } from 'react'
2
+ import { FORMATS } from '../domain/ContentType'
2
3
  import { Property } from './property'
3
4
 
4
5
  const PropertyTest = (prop) => {
6
+
7
+ const [form, setForm] = useState({
8
+ name: 'John',
9
+ address: 'Porto Colon'
10
+ })
11
+
12
+ function change(id, value) {
13
+ const next = Object.assign({}, form, { [id] : value })
14
+ setForm(next)
15
+ }
16
+
5
17
  return (
6
18
  <>
7
- <Property label="Name" initial="John" value="Johnny" editable={true}/>
8
- <Property label="Address" initial="Porto Colon" value="Conchali 40" editable={true}/>
19
+ <Property id="name" label="Name" initial="John" value={form.name} editable={true} onChange={change}/>
20
+ <Property id="address" label="Address" initial="Porto Colon" value={form.address} editable={true} onChange={change}/>
9
21
  </>
10
22
  )
11
23
  }