ywana-core8 0.0.692 → 0.0.694

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.692",
3
+ "version": "0.0.694",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -401,6 +401,16 @@ const CollectionEditor = (props) => {
401
401
  }
402
402
  }
403
403
 
404
+ function renderActions() {
405
+ if (actions) {
406
+ return actions.map(action => {
407
+ // clone React action
408
+ const action2 = React.cloneElement(action, { form })
409
+ return action2
410
+ })
411
+ }
412
+ }
413
+
404
414
  function renderEditor() {
405
415
  const content = new Content(schema, form)
406
416
  switch (layout) {
@@ -420,7 +430,7 @@ const CollectionEditor = (props) => {
420
430
  </Menu>
421
431
  </MenuIcon>
422
432
  {autosave === true ? null : <Button icon="save" label="Guardar Cambios" raised disabled={!canSave()} action={save} />}
423
- {actions ? actions : null}
433
+ {renderActions()}
424
434
  </Header>
425
435
  {renderEditor()}
426
436
  </Fragment>
@@ -11,9 +11,10 @@ import './dialog.css'
11
11
  export const Dialog = (props) => {
12
12
 
13
13
  const site = useContext(SiteContext)
14
- const { icon, title = "Dialog", toolbar, children, actions, className } = props
14
+ const { icon, title = "Dialog", toolbar, children, actions, className, onClose } = props
15
15
 
16
16
  function close() {
17
+ if (onClose) onClose()
17
18
  if (className === "prompt") {
18
19
  site.closePromptDialog()
19
20
  } else {