ywana-core8 0.0.428 → 0.0.431

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.428",
3
+ "version": "0.0.431",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -45,7 +45,7 @@ export const ContentViewer = (props) => {
45
45
  const FieldViewer = (props) => {
46
46
 
47
47
  const { field, value } = props
48
- const { type, label, visible = true } = field
48
+ const { type, item, label, visible = true } = field
49
49
 
50
50
  if (!visible) return null
51
51
 
@@ -55,7 +55,7 @@ const FieldViewer = (props) => {
55
55
  case TYPES.ENTITY:
56
56
  return <EntityViewer field={field} value={value} />
57
57
  case TYPES.ARRAY:
58
- return value.map(v=> <FieldViewer field={field} value={v} />)
58
+ return <ArrayViewer item={item} value={value} />
59
59
  default:
60
60
  return <div>{label}</div>
61
61
  }
@@ -64,7 +64,7 @@ const FieldViewer = (props) => {
64
64
  /**
65
65
  * EntityViewer
66
66
  */
67
- const EntityViewer = (props) => {
67
+ const EntityViewer = (props) => {
68
68
  const { field, value } = props
69
69
  const { item, label } = field
70
70
  const content = new Content(item, value)
@@ -81,3 +81,24 @@ const EntityViewer = (props) => {
81
81
  </div>
82
82
  )
83
83
  }
84
+
85
+
86
+ /**
87
+ * Array Viewer
88
+ */
89
+ const ArrayViewer = (props) => {
90
+ const { item, value } = props
91
+ const columns = Object.keys(item).map(key => item[key]["label"])
92
+ return (
93
+ <div className="array-viewer">
94
+ <table>
95
+ <thead>
96
+ { columns.map(column => <th>{column.name}</th>)}
97
+ </thead>
98
+ <tbody>
99
+ ...
100
+ </tbody>
101
+ </table>
102
+ </div>
103
+ )
104
+ }
package/src/html/table.js CHANGED
@@ -184,7 +184,6 @@ const DataTableCell = ({ row, column, cell, editable }) => {
184
184
  * @returns
185
185
  */
186
186
  const EntityCellViewer = ({ id, item, value }) => {
187
- console.log(id, item, value)
188
187
  const fields = Object.values(item).filter(field => field.column === true)
189
188
  return fields.map( field => {
190
189
  return (<td key={field.id} className={`entity-cell ${field.id}`} >{value[field.id]}</td>)
@@ -1,7 +1,5 @@
1
1
  async function fetchAsync(method, URL, body = null, token, headers) {
2
2
 
3
- console.log('FETCH', method, URL)
4
-
5
3
  const requestHeaders = Object.assign({}, {
6
4
  "Accept": "application/json",
7
5
  "Content-Type": "application/json",
@@ -15,8 +13,6 @@ async function fetchAsync(method, URL, body = null, token, headers) {
15
13
  body
16
14
  }
17
15
 
18
- console.log("HTTP Client", request)
19
-
20
16
  if (headers) request.headers = request.headers
21
17
 
22
18
  try {