ywana-core8 0.0.269 → 0.0.270

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.269",
3
+ "version": "0.0.270",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
package/src/html/table.js CHANGED
@@ -13,7 +13,7 @@ const isFunction = value => value && (Object.prototype.toString.call(value) ===
13
13
  */
14
14
  export const DataTable = (props) => {
15
15
 
16
- const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined } = props
16
+ const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined, expanded = false } = props
17
17
  const [sortDir, setSortDir] = useState({})
18
18
 
19
19
  function multiSort(array, sortObject = {}) {
@@ -103,7 +103,7 @@ export const DataTable = (props) => {
103
103
  <tbody>
104
104
  {
105
105
  multiSort(rows, sortDir).map(row => (
106
- <DataTableRow key={row.id} row={row} columns={columns} onSelect={select} onDrop={sort} editable={editable} />
106
+ <DataTableRow key={row.id} row={row} columns={columns} onSelect={select} onDrop={sort} editable={editable} expanded={expanded} />
107
107
  ))
108
108
  }
109
109
  </tbody>
@@ -117,9 +117,9 @@ export const DataTable = (props) => {
117
117
  */
118
118
  const DataTableRow = (props) => {
119
119
 
120
- const { row, columns = [], onSelect, editable } = props
120
+ const { row, columns = [], onSelect, editable, expanded = false } = props
121
121
  const { className} = row
122
- const [isInfoOpen, toggleInfo] = useState(false)
122
+ const [isInfoOpen, toggleInfo] = useState(expanded)
123
123
  const infoIcon = isInfoOpen ? 'expand_more' : 'expand_less'
124
124
 
125
125
  return (