ywana-core8 0.0.47 → 0.0.51

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.47",
3
+ "version": "0.0.51",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -16,7 +16,7 @@ const http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
16
16
  export const TablePage = (props) => {
17
17
 
18
18
  const site = useContext(SiteContext)
19
- const { id = "table", icon, title, name = "table 1", schema, url, field, delay = 1000, actions, editable, canAdd = true, dev = false, autosave = true, groupBy, validator, scenario, formFilter, tableFilter } = props
19
+ const { id = "table", icon, title, name = "table 1", schema, url, field, delay = 1000, actions, editable, canAdd = true, dev = false, autosave = true, groupBy, validator, scenario, formFilter, tableFilter, tableActions } = props
20
20
  const [pageContext, setPageContext] = useContext(PageContext)
21
21
  const { selected } = pageContext
22
22
  const timer = useRef(null)
@@ -111,7 +111,7 @@ export const TablePage = (props) => {
111
111
  <TableFilters schema={schema} />
112
112
  </menu>
113
113
  <main key={id} className="table-page">
114
- <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} />
114
+ <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} actions={tableActions} />
115
115
  </main>
116
116
  {renderAside()}
117
117
  </Fragment>
@@ -171,7 +171,7 @@ const TableEditor = (props) => {
171
171
 
172
172
  const [pageContext, setPageContext] = useContext(PageContext)
173
173
  const { all = [], filters } = pageContext
174
- const { icon, title, schema, editable, filter } = props
174
+ const { icon, title, schema, editable, filter, actions } = props
175
175
  const [groupBy, setGroupBy] = useState(props.groupBy)
176
176
 
177
177
  function changeGroup(id, value) {
@@ -236,7 +236,8 @@ const TableEditor = (props) => {
236
236
  }),
237
237
  rows: groups[groupName]
238
238
  .map(item => {
239
- item.actions = [<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />]
239
+ item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() => { action.action(item.id) }}/>) : []
240
+ item.actions.push(<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />)
240
241
  return item
241
242
  })
242
243
  }
@@ -8,6 +8,8 @@
8
8
  overflow: hidden;
9
9
  text-overflow: ellipsis;
10
10
  white-space: nowrap;
11
+ padding: .5rem 0 .5rem .5rem;
12
+
11
13
  }
12
14
 
13
15
  .property-value {
@@ -15,4 +17,5 @@
15
17
  overflow: hidden;
16
18
  text-overflow: ellipsis;
17
19
  white-space: nowrap;
20
+ padding: .5rem .5rem .5rem 0
18
21
  }
@@ -6,11 +6,11 @@ import './property.css'
6
6
  */
7
7
  export const Property = (props) => {
8
8
 
9
- const { name, value} = props
9
+ const { label, name, value} = props
10
10
 
11
11
  return (
12
12
  <div className="property">
13
- <div className="property-name">{name}</div>
13
+ <div className="property-name">{name || label}</div>
14
14
  <div className="property-value">{value}</div>
15
15
  </div>
16
16
  )
@@ -21,7 +21,7 @@ export const Section = (props) => {
21
21
 
22
22
  return (
23
23
  <section className={`section2 ${className}`}>
24
- <Header icon={{ icon }} title={title}>
24
+ <Header icon={icon} title={title}>
25
25
  {actions}
26
26
  {canCollapse ? <Icon icon="expand_more" onIcon="expand_less" clickable action={toggle} /> : ''}
27
27
  </Header>