-
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
} | ||
|
||
return newMap; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isolating the map update logic - can be called for a single column update (user edits filter) or through header clear
and delete
column actions (which may impact multiple columns at the same time)
).join(' && '); | ||
|
||
setFilter(globalFilter, rawGlobalFilter, map); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea here, isolating the state update logic for both scenarios.
}; | ||
} | ||
clearColumnsFilter(map, affectedColumns, setFilter); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete and clear apply the same logic, only the action
changes
return typeof flag === 'boolean' ? | ||
flag : | ||
!!flag && flag[i]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamable, clearable, deletable all use the same logic to decide whether the action is available
}; | ||
|
||
const filterFactory = new FilterFactory(augmentedPropsFn); | ||
const headerFactory = new HeaderFactory(augmentedPropsFn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
headers now need access to map/setFilter too, generalize usage
- update changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great. I'd just like to see a percy test including both deletable and clearable to know a) what the Ø looks like in the default font, and b) how the two symbols look next to each other.
@alexcjohnson Good idea, adding a few visual tests. Keeping in mind that we have #495 as a follow up. |
Thanks for the visual tests! |
Action "icons" can now be overridden through css or the table's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! 💃
Closes #315.
Update CHANGELOG with information about the feature and ref to this PR/issue
New tests for the feature
Visual tests for the column actions
Documentation (
clearable
usage, action icon override through CSS & table css prop)Adds the ability to clear column (columns when merged) content without deleting the column itself.
When the
clear
action is done, the associated filters are also cleared. The behavior ofdelete
as been made the same as forclear
with regard to the fitlers.some code rework to share filter state between FilterFactory and HeaderFactory now that header actions tie in with filtering
Re-using the currently in review changes done by @alinastarkov to have a different behavior based on whether columns are merged or not (https://github.com/plotly/dash-table/blob/f69106e5a9639ab1f7831f4cdabb0860bd1579f0/src/dash-table/utils/actions.js)