ywana-core8 0.0.946 → 0.0.947

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.946",
3
+ "version": "0.0.947",
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
@@ -159,6 +159,7 @@ const DataTableFiltersRow = ({ columns }) => {
159
159
 
160
160
  function clear() {
161
161
  setForm({})
162
+ if (onFilter) onFilter({})
162
163
  }
163
164
 
164
165
  const dirty = Object.keys(form).length > 0 // dirty if there are filters set
@@ -166,10 +167,12 @@ const DataTableFiltersRow = ({ columns }) => {
166
167
  return (
167
168
  <tr className="filters-row">
168
169
  {columns.map(({ id, filterable, onFilter, options }) => {
170
+
171
+ const value = form[id] ? form[id] : ''
169
172
  const field = options ?
170
- <DropDown id={id} value={form[id]} options={options} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
173
+ <DropDown id={id} value={value} options={options} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
171
174
  :
172
- <TextField id={id} value={form[id]} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
175
+ <TextField id={id} value={value} onChange={(id, value) => changeFilter(id, value, onFilter)} outlined />
173
176
  return (
174
177
  <td className='filter-cell'>
175
178
  {filterable ? field : null}