Skip to content

Commit

Permalink
Merge pull request #182 from komarovalexander/dev
Browse files Browse the repository at this point in the history
Rename checkbox to checked
  • Loading branch information
komarovalexander authored Oct 5, 2021
2 parents c2b3097 + b96dadd commit 51d8bc1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ka-table",
"version": "7.1.3",
"version": "7.2.0",
"license": "MIT",
"repository": "github:komarovalexander/ka-table",
"homepage": "https://komarovalexander.github.io/ka-table/#/overview",
Expand Down
4 changes: 2 additions & 2 deletions src/Demos/MenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class MenuItem {
public isActive?: boolean;
}

const newItems: string[] = ['GroupedColumnsDemo'];
const updateItems: string[] = ['Grouping'];
const newItems: string[] = ['HeaderFilterDemo'];
const updateItems: string[] = ['Filtering'];

const MenuItems: React.FC<{ items: MenuItem[] }> = ({ items }) => {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Components/PopupContentItem/PopupContentItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PopupContentItem: React.FC<IPopupContentItemProps> = (props) => {
const checked: boolean = column.headerFilterValues?.includes(item) ?? false;

const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
dispatch(updateHeaderFilterValues(column.key, event.currentTarget.checked, item));
dispatch(updateHeaderFilterValues(column.key, item, event.currentTarget.checked));
}

const { elementAttributes, content } = getElementCustomization({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Reducers/kaReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const kaReducer: any = (props: ITableProps, action: any): ITableProps => {
const newColumns = columns.map((c: Column) => {
if (c.key === action.columnKey) {
let headerFilterValues = c.headerFilterValues;
if (action.checkbox) {
if (action.checked) {
if (headerFilterValues === undefined) {
headerFilterValues = [];
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/actionCreators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Focused } from './Models/Focused';
import { PopupPosition } from './Models/PopupPosition';
import { IMoveFocusedSettings } from './Utils/NavigationUtils';

export const updateHeaderFilterValues = (columnKey: string, checkbox: boolean, item: any) => ({
export const updateHeaderFilterValues = (columnKey: string, item: any, checked: boolean) => ({
columnKey,
checkbox,
checked,
item,
type: ActionType.UpdateHeaderFilterValues
});
Expand All @@ -15,7 +15,7 @@ export const updatePopupPosition = (popupPosition: PopupPosition) => ({
type: ActionType.UpdatePopupPosition
});

export const updateHeaderFilterPopupState = (columnKey: string, isHeaderFilterPopupShown: boolean | undefined) => ({
export const updateHeaderFilterPopupState = (columnKey: string, isHeaderFilterPopupShown?: boolean) => ({
columnKey,
isHeaderFilterPopupShown,
type: ActionType.UpdateHeaderFilterPopupState
Expand Down

0 comments on commit 51d8bc1

Please sign in to comment.