ywana-core8 0.0.84 → 0.0.88

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.84",
3
+ "version": "0.0.88",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -15,24 +15,27 @@ export const ContentEditor = ({ content, filter, onChange }) => {
15
15
  }
16
16
 
17
17
  const sections = content.sections()
18
+
18
19
  return (
19
20
  <div className='content-editor'>
20
21
  {sections
21
- .filter(section => section.fields && 0 < section.fields.length)
22
- .map((section) => {
23
- const { title, fields } = section
24
- return (
25
- <section key={title}>
26
- <header>{title}</header>
27
- <main>
28
- {fields
29
- .filter(field => field.id !== 'id')
30
- .filter(field => filter ? filter(field, content) : true)
31
- .map((field) => <FieldEditor key={field.id} field={field} onChange={change} outlined={true} />)}
32
- </main>
33
- </section>
34
- )
35
- })}
22
+ .map((section) => {
23
+ const { title, fields } = section
24
+
25
+ const filtered = fields
26
+ .filter(field => field.id !== 'id')
27
+ .filter(field => filter ? filter(field, content) : true)
28
+
29
+ return filtered.length > 0 ? (
30
+ <section key={title}>
31
+ <header>{title}</header>
32
+ <main>
33
+ {filtered.map((field) => <FieldEditor key={field.id} field={field} onChange={change} outlined={true} />)}
34
+ </main>
35
+ </section>
36
+ ) : null
37
+
38
+ })}
36
39
  </div>
37
40
  )
38
41
  }
@@ -414,7 +417,7 @@ const CollectionAdder = ({ item, onAdd }) => {
414
417
 
415
418
  return (
416
419
  <div className="collection-adder">
417
- {edit ? <DataTable {...table} editable={true} /> : <Button icon='add' label='Add' action={toggle} />}
420
+ {edit ? <DataTable {...table} editable={true} /> : <Button icon='add' label='Añadir' action={toggle} />}
418
421
  </div>
419
422
  )
420
423
  }
package/src/html/list.js CHANGED
@@ -31,9 +31,9 @@ const GroupedList = (props) => {
31
31
  const { items = [], children, onSelect, groupBy } = props
32
32
 
33
33
  const groups = items.reduce((groups, item) => {
34
- let group = groups.find(g => g.name === item.content[groupBy])
34
+ let group = groups.find(g => g.name === item[groupBy])
35
35
  if (!group) {
36
- group = { name: item.content[groupBy], items: []}
36
+ group = { name: item[groupBy], items: []}
37
37
  groups.push(group)
38
38
  }
39
39
  group.items.push(item)