ywana-core8 0.0.820 → 0.0.821

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.820",
3
+ "version": "0.0.821",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -388,11 +388,7 @@ const CollectionEditor = (props) => {
388
388
  }
389
389
 
390
390
  function change(next) {
391
- console.log("CHANGEA", next)
392
- setForm((prev) => {
393
- console.log("CHANGEB", prev, next)
394
- return next
395
- })
391
+ setForm(next)
396
392
  }
397
393
 
398
394
  function canSave() {
@@ -402,7 +398,6 @@ const CollectionEditor = (props) => {
402
398
  }
403
399
 
404
400
  async function save() {
405
- console.log("SAVE", form)
406
401
  if (patch) {
407
402
  await pageContext.patch(form.id, form)
408
403
  } else {
@@ -428,7 +428,9 @@ export const CollectionEditor = ({ field, value = [], onChange, onReload }) => {
428
428
  {
429
429
  Renderer ?
430
430
  <Renderer field={field} value={value} onRemove={remove} onChange={onChange} onReload={reload} />
431
- : <TableEditor field={field} icon={"info"} title={label} data={value} schema={item} groupBy={groupBy} canDelete={true} remove={remove} editable={editable} onChange={onChange} />
431
+ // : <DataTable {...table} editable={editable} />
432
+ : <TableEditor icon={"info"} title={label} data={value} schema={item} groupBy={groupBy} canDelete={true} remove={remove} />
433
+
432
434
  }
433
435
  <footer>
434
436
  {Feeder ? <Feeder onAdd={add} onReload={reload} /> : null}
@@ -451,14 +453,14 @@ const CollectionAdder = ({ item, onAdd }) => {
451
453
  }
452
454
 
453
455
  function change(index, cellId, cellValue) {
454
- const next = Object.assign({}, form, { [cellId]: cellValue })
455
- setForm(next)
456
+ if (onAdd) {
457
+ const next = Object.assign({}, form, { [cellId]: cellValue })
458
+ setForm(next)
459
+ }
456
460
  }
457
461
 
458
462
  function save() {
459
- const next = Object.assign({}, form )
460
- delete next.actions
461
- if (onAdd) onAdd([next])
463
+ if (onAdd) onAdd([form])
462
464
  toggle()
463
465
  }
464
466
 
@@ -483,15 +485,9 @@ const CollectionAdder = ({ item, onAdd }) => {
483
485
  */
484
486
  const TableEditor = (props) => {
485
487
 
486
- const { field, data = [], icon, title, schema, editable, canDelete, remove, filter, actions, className, onChange } = props
488
+ const { data = [], icon, title, schema, editable, canDelete, remove, filter, actions, className } = props
487
489
  const [groupBy, setGroupBy] = useState(props.groupBy)
488
490
 
489
- function change(id, value) {
490
- const nextData = structuredClone(data)
491
- nextData[id] = value
492
- if (onChange) onChange(field.id, nextData)
493
- }
494
-
495
491
  function changeGroup(id, value) {
496
492
  setGroupBy(value)
497
493
  }
@@ -54,7 +54,7 @@ export const TextField = (props) => {
54
54
 
55
55
  return (
56
56
  <div className={`${style} ${id}`} onClick={onClick}>
57
- <input id={id} type={type} placeholder={placeholder} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} onBlur={blur} readOnly={readOnly} />
57
+ <input id={id} type={type} placeholder={placeholder} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} onBlur={blur} readOnly={readOnly} step={any} />
58
58
  {readOnly === false && canClear && value && value.length > 0 ? <Icon icon="close" clickable size="small" action={clear} /> : null}
59
59
  <span className="bar"></span>
60
60
  {label ? <label>{labelTxt}</label> : null}
File without changes