ywana-core8 0.0.940 → 0.0.941
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 +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +5 -0
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +5 -0
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +3 -2
package/package.json
CHANGED
@@ -84,7 +84,7 @@ export const CollectionPage = (props) => {
|
|
84
84
|
{levels ? <CollectionTree schema={schema} icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} namer={namer} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} itemRenderer={listItemRenderer} sorter={sorter} />}
|
85
85
|
</menu>
|
86
86
|
<main key={id} className={`collection-page ${className}`}>
|
87
|
-
<CollectionEditor icon={icon} schema={schema} layout={editor} grouped={grouped} autosave={autosave} delay={delay} canDelete={canDelete} onReload={reloadSelection} patch={patch} onChange={onChange} actions={editorActions} title={editorTitle} validator={editValidator} />
|
87
|
+
<CollectionEditor icon={icon} schema={schema} layout={editor} grouped={grouped} autosave={autosave} delay={delay} canDelete={canDelete} onReload={reloadSelection} patch={patch} onChange={onChange} onClose={() => onSelect(null)} actions={editorActions} title={editorTitle} validator={editValidator} />
|
88
88
|
{children ? <article>{children}</article> : null}
|
89
89
|
<footer>
|
90
90
|
{footer}
|
@@ -356,7 +356,7 @@ const CollectionEditor = (props) => {
|
|
356
356
|
const site = useContext(SiteContext)
|
357
357
|
const [pageContext, setPageContext] = useContext(PageContext)
|
358
358
|
const { selected } = pageContext
|
359
|
-
const { icon, title, schema, layout, autosave = false, delay = 1000, canDelete, onReload, onChange, patch = false, actions, validator } = props
|
359
|
+
const { icon, title, schema, layout, autosave = false, delay = 1000, canDelete, onReload, onChange, onClose, patch = false, actions, validator } = props
|
360
360
|
const timer = useRef(null)
|
361
361
|
const [form, setForm] = useState(selected)
|
362
362
|
|
@@ -376,6 +376,7 @@ const CollectionEditor = (props) => {
|
|
376
376
|
function clear() {
|
377
377
|
pageContext.clear()
|
378
378
|
setPageContext(Object.assign({}, pageContext))
|
379
|
+
if (onClose) onClose()
|
379
380
|
}
|
380
381
|
|
381
382
|
async function remove() {
|