ywana-core8 0.0.541 → 0.0.542

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.541",
3
+ "version": "0.0.542",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -481,7 +481,7 @@ export const TableEditor = (props) => {
481
481
  return (
482
482
  <Fragment>
483
483
  <Header icon={icon} title={<Text>{title}</Text>}>
484
- <DropDown id="groupBy" label="Agrupar Por" value={groupBy} options={buildGroupOptions(schema)} onChange={changeGroup} />
484
+ { groupBy ? <DropDown id="groupBy" label="Agrupar Por" value={groupBy} options={buildGroupOptions(schema)} onChange={changeGroup} /> : null }
485
485
  </Header>
486
486
  <main className="table-editor">
487
487
  {renderGroups()}
package/src/site/view.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Icon, MenuIcon } from '../html'
2
+ import { Icon, MenuIcon, Tabs, Tab, Stack } from '../html'
3
3
  import './view.css'
4
4
 
5
5
  /**
@@ -32,4 +32,25 @@ export const View = (props) => {
32
32
  {info ? <footer>{info}</footer> : null}
33
33
  </section>
34
34
  )
35
+ }
36
+
37
+ export const TabbedView = (props) => {
38
+
39
+ const { title, className } = props
40
+ const [tab, setTab] = useState(0)
41
+ const children = React.Children.toArray(props.children);
42
+ const tabs = children.map(child => <Tab key={child.props.label} label={child.props.label}></Tab>)
43
+
44
+ const toolbar = (
45
+ <Tabs selected={tab} onChange={tab => setTab(tab)}>
46
+ {tabs}
47
+ </Tabs>
48
+ )
49
+ return (
50
+ <View title={title} toolbar={toolbar} className={className}>
51
+ <Stack selected={tab}>
52
+ {children}
53
+ </Stack>
54
+ </View>
55
+ )
35
56
  }