ywana-core8 0.0.939 → 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 +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +3 -2
- package/src/html/textfield.js +2 -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() {
|
package/src/html/textfield.js
CHANGED
@@ -118,7 +118,7 @@ export const TextArea = (props) => {
|
|
118
118
|
export const DropDown = (props) => {
|
119
119
|
|
120
120
|
const site = useContext(SiteContext)
|
121
|
-
const { id, options = [], value, onChange, predictive = false, readOnly = false, verbose = true, editable = false, onBlur, position="bottom"} = props
|
121
|
+
const { id, options = [], value, onChange, predictive = false, readOnly = false, verbose = true, editable = false, onBlur, position="bottom", className} = props
|
122
122
|
const [open, setOpen] = useState(false)
|
123
123
|
const [label, setLabel] = useState()
|
124
124
|
|
@@ -193,7 +193,7 @@ export const DropDown = (props) => {
|
|
193
193
|
|
194
194
|
const title = editable ? <div className='row'>{props.label}<Icon className="decorator" icon="edit" size="small" /></div> : props.label
|
195
195
|
return (
|
196
|
-
<div className=
|
196
|
+
<div className={`dropdown ${className}`}>
|
197
197
|
<TextField {...props} label={title} onClick={onFocus} value={label} onChange={change} onBlur={blur} readOnly={!predictive && !editable} />
|
198
198
|
{!readOnly ? <Icon icon="expand_more" clickable size="small" action={toggle} /> : null}
|
199
199
|
{renderOptions()}
|