ywana-core8 0.0.46 → 0.0.50

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.46",
3
+ "version": "0.0.50",
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 } = 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 } = 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} />
114
+ <TableEditor icon={icon} title={name} schema={schema} delay={delay} editable={editable} groupBy={groupBy} filter={tableFilter} />
115
115
  </main>
116
116
  {renderAside()}
117
117
  </Fragment>
@@ -152,7 +152,6 @@ const TableFilters = (props) => {
152
152
  }
153
153
 
154
154
  const content = new Content(filterSchema, form)
155
- console.log(filterSchema, content)
156
155
  return (
157
156
  <Fragment>
158
157
  <Header title={<Text>Filtros</Text>} >
@@ -172,7 +171,7 @@ const TableEditor = (props) => {
172
171
 
173
172
  const [pageContext, setPageContext] = useContext(PageContext)
174
173
  const { all = [], filters } = pageContext
175
- const { icon, title, schema, editable } = props
174
+ const { icon, title, schema, editable, filter } = props
176
175
  const [groupBy, setGroupBy] = useState(props.groupBy)
177
176
 
178
177
  function changeGroup(id, value) {
@@ -206,7 +205,9 @@ const TableEditor = (props) => {
206
205
 
207
206
  function renderGroups() {
208
207
 
209
- const groups = all.reduce((groups, filter) => {
208
+ const items = filter ? filter(all) : all
209
+
210
+ const groups = items.reduce((groups, filter) => {
210
211
  const groupName = filter[groupBy]
211
212
  const group = groups[groupName]
212
213
  if (!group) groups[groupName] = []
@@ -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>