ywana-core8 0.1.9 → 0.1.11

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.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/table.js CHANGED
@@ -4,8 +4,9 @@ import { DropDown, TextField } from './textfield'
4
4
  import { CheckBox } from './checkbox'
5
5
  import { Icon } from './icon'
6
6
  import { Text } from './text'
7
- import './table.css'
7
+ import { EmptyMessage } from '../widgets'
8
8
  import { Uploader } from '../widgets/upload/Uploader'
9
+ import './table.css'
9
10
 
10
11
  const isFunction = value => value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
11
12
 
@@ -14,7 +15,7 @@ const isFunction = value => value && (Object.prototype.toString.call(value) ===
14
15
  */
15
16
  export const DataTable = (props) => {
16
17
 
17
- const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined, expanded = false, className, emptyMessage = "No Results Found", multisort = false, filterable = false, onClearFilters } = props
18
+ const { columns = [], rows = [], onRowSelection, onSort, onCheckAll, editable, outlined, expanded = false, className, emptyMessage = "No Results Found", emptyIcon="search_off", multisort = false, filterable = false, onClearFilters } = props
18
19
  const [sortDir, setSortDir] = useState({})
19
20
  const [allChecked, setAllChecked] = useState(false)
20
21
 
@@ -132,10 +133,7 @@ export const DataTable = (props) => {
132
133
  )) : (
133
134
  <tr>
134
135
  <td colSpan={1000}>
135
- <div className='empty-message'>
136
- <Icon icon="search_off" />
137
- <Text>{emptyMessage}</Text>
138
- </div>
136
+ <EmptyMessage icon={emptyIcon ? emptyIcon : "search_off"} text={emptyMessage} className="empty-message" />
139
137
  </td>
140
138
  </tr>
141
139
  )
@@ -167,11 +165,11 @@ const DataTableFiltersRow = ({ columns, onClear }) => {
167
165
 
168
166
  return (
169
167
  <tr className="filters-row">
170
- {columns.map(({ id, filterable, onFilter, options }) => {
168
+ {columns.map(({ id, filterable, onFilter, predictive=false, options }) => {
171
169
 
172
170
  const value = form[id] ? form[id] : ''
173
171
  const field = options ?
174
- <DropDown id={id} value={value} options={options} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
172
+ <DropDown id={id} value={value} options={options} predictive={predictive} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
175
173
  :
176
174
  <TextField id={id} value={value} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
177
175
  return (
@@ -222,7 +220,6 @@ const DataTableCell = ({ index, row, column, cell, editable }) => {
222
220
  const render = (type) => {
223
221
  const { id, disabled = false, min, max, onChange, format, options, item, action, maxDecimals } = column
224
222
 
225
-
226
223
  if (id === "checked") {
227
224
  return row.checkDisabled ? null : <CheckBox id={id} value={cell} onChange={(id, value) => onChange(row.id, id, value)} />
228
225
  } else if (editable && onChange) {