ywana-core8 0.0.265 → 0.0.266

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.265",
3
+ "version": "0.0.266",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@ export const TablePage = (props) => {
21
21
  icon, title, name,
22
22
  schema, url, field,
23
23
  autosave = true, delay = 1000,
24
- editable,
24
+ editable,
25
25
  actions = [], dev = false, tableActions, selectionActions = [],
26
26
  canFilter = false, canQuery = false, canAdd = true, canDelete = true, canEdit = true,
27
27
  groupBy, validator, scenario,
@@ -97,7 +97,7 @@ export const TablePage = (props) => {
97
97
  if (rowSelected || rowChecked) {
98
98
  return (
99
99
  <aside className="table-page">
100
- {rowSelected ? <TableRowEditor content={new Content(schema, form)} filter={editorFilter} onChange={change} onClose={closeAside} editable={canEdit}/> : null}
100
+ {rowSelected ? <TableRowEditor content={new Content(schema, form)} filter={editorFilter} onChange={change} onClose={closeAside} editable={canEdit} /> : null}
101
101
  {rowChecked ? <TableSelector schema={schema} actions={selectionActions} /> : null}
102
102
  </aside>
103
103
  )
@@ -108,7 +108,7 @@ export const TablePage = (props) => {
108
108
  function renderActions() {
109
109
  return actions.map(element => {
110
110
  const action = () => element.props.action(pageContext)
111
- const clone = React.cloneElement(element, { action })
111
+ const clone = React.cloneElement(element, { action })
112
112
  return clone
113
113
  })
114
114
  }
@@ -124,10 +124,12 @@ export const TablePage = (props) => {
124
124
  ) : null}
125
125
  {renderActions()}
126
126
  </Header>
127
- <menu className="table-page">
128
- {canQuery ? <TableQueries schema={schema} /> : null}
129
- {canFilter ? <TableFilters schema={schema} /> : null}
130
- </menu>
127
+ {canQuery || canFilter ? (
128
+ <menu className="table-page">
129
+ {canQuery ? <TableQueries schema={schema} /> : null}
130
+ {canFilter ? <TableFilters schema={schema} /> : null}
131
+ </menu>
132
+ ) : null)}
131
133
  <main key={id} className="table-page">
132
134
  <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} canDelete={canDelete} />
133
135
  </main>
@@ -147,7 +149,7 @@ const TableRowEditor = (props) => {
147
149
  <Icon icon="close" clickable action={onClose} />
148
150
  </Header>
149
151
  <main>
150
- { editable ? <ContentEditor content={content} onChange={onChange} filter={filter} /> : <ContentViewer content={content} /> }
152
+ {editable ? <ContentEditor content={content} onChange={onChange} filter={filter} /> : <ContentViewer content={content} />}
151
153
  </main>
152
154
  </div>
153
155
  )
@@ -313,12 +315,12 @@ export const TableEditor = (props) => {
313
315
  function renderGroupLabel(groupName) {
314
316
  const grouper = schema[groupBy]
315
317
 
316
- if (!groupName || !grouper) return ""
318
+ if (!groupName || !grouper) return ""
317
319
 
318
320
  if (grouper.options) {
319
321
  const options = CHECK['isFunction'](grouper.options) ? grouper.options() : grouper.options
320
322
  const option = options.find(option => option.value === groupName)
321
- console.log(groupName, options, option )
323
+ console.log(groupName, options, option)
322
324
  return option ? option.label : groupName
323
325
  } else {
324
326
  return groupName