ywana-core8 0.0.818 → 0.0.820

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.818",
3
+ "version": "0.0.820",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -451,14 +451,14 @@ const CollectionAdder = ({ item, onAdd }) => {
451
451
  }
452
452
 
453
453
  function change(index, cellId, cellValue) {
454
- if (onAdd) {
455
- const next = Object.assign({}, form, { [cellId]: cellValue })
456
- setForm(next)
457
- }
454
+ const next = Object.assign({}, form, { [cellId]: cellValue })
455
+ setForm(next)
458
456
  }
459
457
 
460
458
  function save() {
461
- if (onAdd) onAdd([form])
459
+ const next = Object.assign({}, form )
460
+ delete next.actions
461
+ if (onAdd) onAdd([next])
462
462
  toggle()
463
463
  }
464
464
 
@@ -487,15 +487,8 @@ const TableEditor = (props) => {
487
487
  const [groupBy, setGroupBy] = useState(props.groupBy)
488
488
 
489
489
  function change(id, value) {
490
- const nextData = data.map(row => {
491
- if (row.id === id) {
492
- delete row.actions
493
- const clonedRow = structuredClone(row)
494
- return Object.assign({}, clonedRow, { [id]: value })
495
- } else {
496
- return row
497
- }
498
- })
490
+ const nextData = structuredClone(data)
491
+ nextData[id] = value
499
492
  if (onChange) onChange(field.id, nextData)
500
493
  }
501
494