ywana-core8 0.0.819 → 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.819",
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}
@@ -453,8 +455,7 @@ const CollectionAdder = ({ item, onAdd }) => {
453
455
  function change(index, cellId, cellValue) {
454
456
  if (onAdd) {
455
457
  const next = Object.assign({}, form, { [cellId]: cellValue })
456
- delete next.actions
457
- setForm(structuredClone(next))
458
+ setForm(next)
458
459
  }
459
460
  }
460
461
 
@@ -484,15 +485,9 @@ const CollectionAdder = ({ item, onAdd }) => {
484
485
  */
485
486
  const TableEditor = (props) => {
486
487
 
487
- 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
488
489
  const [groupBy, setGroupBy] = useState(props.groupBy)
489
490
 
490
- function change(id, value) {
491
- const nextData = structuredClone(data)
492
- nextData[id] = value
493
- if (onChange) onChange(field.id, nextData)
494
- }
495
-
496
491
  function changeGroup(id, value) {
497
492
  setGroupBy(value)
498
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