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/dist/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +17 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +11 -1
- package/src/site/dialog.js +2 -1
package/package.json
CHANGED
@@ -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
|
-
{
|
433
|
+
{renderActions()}
|
424
434
|
</Header>
|
425
435
|
{renderEditor()}
|
426
436
|
</Fragment>
|
package/src/site/dialog.js
CHANGED
@@ -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 {
|