ywana-core8 0.0.318 → 0.0.319

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.318",
3
+ "version": "0.0.319",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -100,7 +100,7 @@ const CollectionList = (props) => {
100
100
  /**
101
101
  * Collection Tree
102
102
  */
103
- const CollectionTree = (props) => {
103
+ export const CollectionTree = (props) => {
104
104
 
105
105
  const { levels, onSelect } = props
106
106
  const [pageContext, setPageContext] = useContext(PageContext)
@@ -34,6 +34,7 @@ export const TablePage = (props) => {
34
34
  const { selected } = pageContext
35
35
  const timer = useRef(null)
36
36
  const [form, setForm] = useState(selected)
37
+ const [showChildren, setShowChildren] = useState(true)
37
38
 
38
39
  useEffect(() => {
39
40
  setForm(selected)
@@ -127,9 +128,14 @@ export const TablePage = (props) => {
127
128
  })
128
129
  }
129
130
 
131
+ function toggleChildren() {
132
+ setShowChildren(!showChildren)
133
+ }
134
+
130
135
  return (
131
136
  <Fragment>
132
137
  <Header className="table-page" title={<Text>{title}</Text>}>
138
+ {children ? <Icon icon="info" clickable action={toggleChildren} /> : null}
133
139
  {canAdd ? <Button icon="add" label="Añadir" action={add} raised /> : null}
134
140
  {dev ? (
135
141
  <MenuIcon align="alignRight">
@@ -145,7 +151,7 @@ export const TablePage = (props) => {
145
151
  </menu>
146
152
  ) : null}
147
153
  <main key={id} className="table-page">
148
- {children ? <article>{children}</article> : null}
154
+ {children && showChildren ? <article>{children}</article> : null}
149
155
  <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} />
150
156
  </main>
151
157
  {renderAside()}
@@ -3,5 +3,5 @@ export { ContentForm } from './ContentForm'
3
3
  export { ContentEditor, TabbedContentEditor, CollectionEditor, TreededContentEditor, FieldEditor, ListEditor } from './ContentEditor'
4
4
  export { CreateContentDialog } from './CreateContentDialog'
5
5
  export { EditContentDialog } from './EditContentDialog'
6
- export { CollectionPage, CollectionContext } from './CollectionPage'
6
+ export { CollectionPage, CollectionContext, CollectionTree } from './CollectionPage'
7
7
  export { TablePage, TableEditor } from './TablePage'