Comparing version 10.0.0 to 11.0.0
@@ -26,2 +26,7 @@ import { ActionType, InsertRowPosition } from './enums'; | ||
}; | ||
export declare const updateHeaderFilterSearchValue: (columnKey: string, headerFilterSearchValue: string) => { | ||
columnKey: string; | ||
headerFilterSearchValue: string; | ||
type: ActionType; | ||
}; | ||
export declare const updateFilterRowOperator: (columnKey: string, filterRowOperator: string) => { | ||
@@ -28,0 +33,0 @@ columnKey: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loadData = exports.hideColumn = exports.showColumn = exports.moveColumnToIndex = exports.insertColumn = exports.moveColumnBefore = exports.reorderColumns = exports.reorderRows = exports.resizeColumn = exports.updatePagesCount = exports.updatePageSize = exports.updatePageIndex = exports.updateRow = exports.saveRowEditors = exports.closeRowEditors = exports.openRowEditors = exports.saveNewRow = exports.hideDetailsRow = exports.showDetailsRow = exports.hideNewRow = exports.showNewRow = exports.hideLoading = exports.showLoading = exports.updateData = exports.updateGroupsExpanded = exports.selectRowsRange = exports.selectRows = exports.selectRow = exports.selectSingleRow = exports.selectAllVisibleRows = exports.selectAllFilteredRows = exports.selectAllRows = exports.search = exports.openEditor = exports.deselectRows = exports.deselectRow = exports.deselectAllVisibleRows = exports.deselectAllFilteredRows = exports.deselectAllRows = exports.deleteRow = exports.closeEditor = exports.updateSortDirection = exports.updateCellValue = exports.updateEditorValue = exports.clearAllFilters = exports.updateFilterRowOperator = exports.updateFilterRowValue = exports.updateHeaderFilterPopupState = exports.updatePopupPosition = exports.updateHeaderFilterValues = void 0; | ||
exports.ungroupColumn = exports.groupColumn = exports.insertRow = exports.saveAllEditors = exports.openAllEditors = exports.validate = exports.updateTreeGroupsExpanded = exports.moveFocusedDown = exports.moveFocusedUp = exports.moveFocusedLeft = exports.moveFocusedRight = exports.setFocused = exports.clearFocused = exports.setSingleAction = exports.clearSingleAction = void 0; | ||
exports.hideColumn = exports.showColumn = exports.moveColumnToIndex = exports.insertColumn = exports.moveColumnBefore = exports.reorderColumns = exports.reorderRows = exports.resizeColumn = exports.updatePagesCount = exports.updatePageSize = exports.updatePageIndex = exports.updateRow = exports.saveRowEditors = exports.closeRowEditors = exports.openRowEditors = exports.saveNewRow = exports.hideDetailsRow = exports.showDetailsRow = exports.hideNewRow = exports.showNewRow = exports.hideLoading = exports.showLoading = exports.updateData = exports.updateGroupsExpanded = exports.selectRowsRange = exports.selectRows = exports.selectRow = exports.selectSingleRow = exports.selectAllVisibleRows = exports.selectAllFilteredRows = exports.selectAllRows = exports.search = exports.openEditor = exports.deselectRows = exports.deselectRow = exports.deselectAllVisibleRows = exports.deselectAllFilteredRows = exports.deselectAllRows = exports.deleteRow = exports.closeEditor = exports.updateSortDirection = exports.updateCellValue = exports.updateEditorValue = exports.clearAllFilters = exports.updateFilterRowOperator = exports.updateHeaderFilterSearchValue = exports.updateFilterRowValue = exports.updateHeaderFilterPopupState = exports.updatePopupPosition = exports.updateHeaderFilterValues = void 0; | ||
exports.ungroupColumn = exports.groupColumn = exports.insertRow = exports.saveAllEditors = exports.openAllEditors = exports.validate = exports.updateTreeGroupsExpanded = exports.moveFocusedDown = exports.moveFocusedUp = exports.moveFocusedLeft = exports.moveFocusedRight = exports.setFocused = exports.clearFocused = exports.setSingleAction = exports.clearSingleAction = exports.loadData = void 0; | ||
var enums_1 = require("./enums"); | ||
@@ -30,2 +30,8 @@ var updateHeaderFilterValues = function (columnKey, item, checked) { return ({ | ||
exports.updateFilterRowValue = updateFilterRowValue; | ||
var updateHeaderFilterSearchValue = function (columnKey, headerFilterSearchValue) { return ({ | ||
columnKey: columnKey, | ||
headerFilterSearchValue: headerFilterSearchValue, | ||
type: enums_1.ActionType.UpdateHeaderFilterSearchValue, | ||
}); }; | ||
exports.updateHeaderFilterSearchValue = updateHeaderFilterSearchValue; | ||
var updateFilterRowOperator = function (columnKey, filterRowOperator) { return ({ | ||
@@ -32,0 +38,0 @@ columnKey: columnKey, |
@@ -0,4 +1,4 @@ | ||
import { IFilterRowEditorProps } from '../../props'; | ||
import React from 'react'; | ||
import { IFilterRowEditorProps } from '../../props'; | ||
declare const FilterRowBoolean: React.FunctionComponent<IFilterRowEditorProps>; | ||
export default FilterRowBoolean; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,9 +18,14 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var react_1 = __importDefault(require("react")); | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var ComponentUtils_1 = require("../../Utils/ComponentUtils"); | ||
var CommonUtils_1 = require("../../Utils/CommonUtils"); | ||
var FilterRowBoolean = function (_a) { | ||
var column = _a.column, dispatch = _a.dispatch; | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var FilterRowBoolean = function (props) { | ||
var column = props.column, dispatch = props.dispatch, childComponents = props.childComponents; | ||
var value = column.filterRowValue; | ||
return (react_1.default.createElement("input", { className: defaultOptions_1.default.css.checkbox, type: 'checkbox', ref: function (elem) { return elem && (elem.indeterminate = (0, CommonUtils_1.isEmpty)(value)); }, checked: value || false, onChange: function (event) { | ||
var _a = (0, ComponentUtils_1.getElementCustomization)({ | ||
className: defaultOptions_1.default.css.checkbox, | ||
type: 'checkbox', | ||
checked: value || false, | ||
onChange: function (event) { | ||
var filterRowValue = event.currentTarget.checked; | ||
@@ -22,4 +38,6 @@ if (value === false) { | ||
dispatch((0, actionCreators_1.updateFilterRowValue)(column.key, filterRowValue)); | ||
} })); | ||
} | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.filterRowCellInput), elementAttributes = _a.elementAttributes, content = _a.content; | ||
return (content || (react_1.default.createElement("input", __assign({ ref: function (elem) { return elem && (elem.indeterminate = (0, CommonUtils_1.isEmpty)(value)); } }, elementAttributes)))); | ||
}; | ||
exports.default = FilterRowBoolean; |
@@ -0,4 +1,4 @@ | ||
import { IFilterRowEditorProps } from '../../props'; | ||
import React from 'react'; | ||
import { IFilterRowEditorProps } from '../../props'; | ||
declare const FilterRowDate: React.FunctionComponent<IFilterRowEditorProps>; | ||
export default FilterRowDate; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,15 +18,22 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var react_1 = __importDefault(require("react")); | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var DateUtils_1 = require("../../Utils/DateUtils"); | ||
var FilterRowDate = function (_a) { | ||
var column = _a.column, dispatch = _a.dispatch; | ||
var ComponentUtils_1 = require("../../Utils/ComponentUtils"); | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var FilterRowDate = function (props) { | ||
var column = props.column, dispatch = props.dispatch, childComponents = props.childComponents; | ||
var fieldValue = column.filterRowValue; | ||
var value = fieldValue && (0, DateUtils_1.getDateInputValue)(fieldValue); | ||
return (react_1.default.createElement("input", { className: defaultOptions_1.default.css.dateInput, type: 'date', value: value || '', onChange: function (event) { | ||
var _a = (0, ComponentUtils_1.getElementCustomization)({ | ||
className: defaultOptions_1.default.css.dateInput, | ||
type: 'date', | ||
value: value || '', | ||
onChange: function (event) { | ||
var targetValue = event.currentTarget.value; | ||
var filterRowValue = targetValue ? new Date(targetValue) : null; | ||
dispatch((0, actionCreators_1.updateFilterRowValue)(column.key, filterRowValue)); | ||
} })); | ||
} | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.filterRowCellInput), elementAttributes = _a.elementAttributes, content = _a.content; | ||
return (content || (react_1.default.createElement("input", __assign({}, elementAttributes)))); | ||
}; | ||
exports.default = FilterRowDate; |
@@ -0,4 +1,4 @@ | ||
import { IFilterRowEditorProps } from '../../props'; | ||
import React from 'react'; | ||
import { IFilterRowEditorProps } from '../../props'; | ||
declare const FilterRowNumber: React.FunctionComponent<IFilterRowEditorProps>; | ||
export default FilterRowNumber; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,12 +18,19 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var react_1 = __importDefault(require("react")); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var ComponentUtils_1 = require("../../Utils/ComponentUtils"); | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var FilterRowNumber = function (_a) { | ||
var column = _a.column, dispatch = _a.dispatch; | ||
var FilterRowNumber = function (props) { | ||
var column = props.column, dispatch = props.dispatch, childComponents = props.childComponents; | ||
var value = column.filterRowValue; | ||
return (react_1.default.createElement("input", { className: defaultOptions_1.default.css.numberInput, type: 'number', value: value === null || value === undefined ? '' : value, onChange: function (event) { | ||
var _a = (0, ComponentUtils_1.getElementCustomization)({ | ||
className: defaultOptions_1.default.css.numberInput, | ||
type: 'number', | ||
value: value === null || value === undefined ? '' : value, | ||
onChange: function (event) { | ||
var filterRowValue = event.currentTarget.value !== '' ? Number(event.currentTarget.value) : null; | ||
dispatch((0, actionCreators_1.updateFilterRowValue)(column.key, filterRowValue)); | ||
} })); | ||
} | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.filterRowCellInput), elementAttributes = _a.elementAttributes, content = _a.content; | ||
return (content || (react_1.default.createElement("input", __assign({}, elementAttributes)))); | ||
}; | ||
exports.default = FilterRowNumber; |
@@ -0,4 +1,4 @@ | ||
import { IFilterRowEditorProps } from '../../props'; | ||
import React from 'react'; | ||
import { IFilterRowEditorProps } from '../../props'; | ||
declare const FilterRowString: React.FunctionComponent<IFilterRowEditorProps>; | ||
export default FilterRowString; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,10 +18,17 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var react_1 = __importDefault(require("react")); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var ComponentUtils_1 = require("../../Utils/ComponentUtils"); | ||
var actionCreators_1 = require("../../actionCreators"); | ||
var defaultOptions_1 = __importDefault(require("../../defaultOptions")); | ||
var FilterRowString = function (_a) { | ||
var column = _a.column, dispatch = _a.dispatch; | ||
return (react_1.default.createElement("input", { type: 'text', className: defaultOptions_1.default.css.textInput, value: column.filterRowValue || '', onChange: function (event) { | ||
var FilterRowString = function (props) { | ||
var column = props.column, dispatch = props.dispatch, childComponents = props.childComponents; | ||
var _a = (0, ComponentUtils_1.getElementCustomization)({ | ||
className: defaultOptions_1.default.css.textInput, | ||
type: 'search', | ||
value: column.filterRowValue || '', | ||
onChange: function (event) { | ||
dispatch((0, actionCreators_1.updateFilterRowValue)(column.key, event.currentTarget.value)); | ||
} })); | ||
} | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.filterRowCellInput), elementAttributes = _a.elementAttributes, content = _a.content; | ||
return (content || (react_1.default.createElement("input", __assign({}, elementAttributes)))); | ||
}; | ||
exports.default = FilterRowString; |
@@ -50,5 +50,5 @@ "use strict"; | ||
} | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.headFilterButton), elementAttributes = _b.elementAttributes, content = _b.content; | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.headerFilterButton), elementAttributes = _b.elementAttributes, content = _b.content; | ||
return (React.createElement("span", __assign({}, elementAttributes), content || (React.createElement(FilterIcon_1.FilterIcon, { className: 'ka-icon ka-icon-filter ka-pointer ka-header-filter-button-icon' })))); | ||
}; | ||
exports.default = HeaderFilterButton; |
@@ -45,3 +45,3 @@ "use strict"; | ||
var Loading_1 = __importDefault(require("../Loading/Loading")); | ||
var Popup_1 = __importDefault(require("../Popup/Popup")); | ||
var HeaderFilterPopup_1 = __importDefault(require("../HeaderFilterPopup/HeaderFilterPopup")); | ||
var TablePaging_1 = require("../TablePaging/TablePaging"); | ||
@@ -79,5 +79,5 @@ var TableWrapper_1 = require("../TableWrapper/TableWrapper"); | ||
return column.isHeaderFilterPopupShown | ||
&& (React.createElement(Popup_1.default, { key: column.key, column: column, childComponents: childComponents, data: data, dispatch: dispatch, format: format })); | ||
&& (React.createElement(HeaderFilterPopup_1.default, { key: column.key, column: column, childComponents: childComponents, data: data, dispatch: dispatch, format: format })); | ||
})))))); | ||
}; | ||
exports.TableControlled = TableControlled; |
@@ -75,2 +75,3 @@ export declare enum PagingPosition { | ||
UpdateGroupsExpanded = "UpdateGroupsExpanded", | ||
UpdateHeaderFilterSearchValue = "UpdateHeaderFilterSearchValue", | ||
UpdateHeaderFilterValues = "UpdateHeaderFilterValues", | ||
@@ -77,0 +78,0 @@ UpdateHeaderFilterPopupState = "UpdateHeaderFilterPopupState", |
@@ -85,2 +85,3 @@ "use strict"; | ||
ActionType["UpdateGroupsExpanded"] = "UpdateGroupsExpanded"; | ||
ActionType["UpdateHeaderFilterSearchValue"] = "UpdateHeaderFilterSearchValue"; | ||
ActionType["UpdateHeaderFilterValues"] = "UpdateHeaderFilterValues"; | ||
@@ -87,0 +88,0 @@ ActionType["UpdateHeaderFilterPopupState"] = "UpdateHeaderFilterPopupState"; |
@@ -1,2 +0,2 @@ | ||
import { ICellEditorProps, ICellProps, ICellTextProps, IDataRowProps, IEmptyCellProps, IFilterRowEditorProps, IGroupPanelCellProps, IGroupPanelProps, IGroupRowProps, IGroupSummaryCellProps, IGroupSummaryRowProps, IHeadCellProps, IHeadCellResizeProps, IHeadRowProps, IHeaderFilterButtonProps, ILoadingProps, INoDataRowProps, IPagingIndexProps, IPagingProps, IPagingSizeProps, IPopupContentItemProps, IPopupContentProps, ISortIconProps, ISummaryCellProps, ISummaryRowProps, ITableBodyProps, ITableFootProps, ITableHeadProps } from '../props'; | ||
import { ICellEditorProps, ICellProps, ICellTextProps, IDataRowProps, IEmptyCellProps, IFilterRowEditorProps, IGroupPanelCellProps, IGroupPanelProps, IGroupRowProps, IGroupSummaryCellProps, IGroupSummaryRowProps, IHeadCellProps, IHeadCellResizeProps, IHeadRowProps, IHeaderFilterButtonProps, ILoadingProps, INoDataRowProps, IPagingIndexProps, IPagingProps, IPagingSizeProps, IPopupContentProps, ISortIconProps, ISummaryCellProps, ISummaryRowProps, ITableBodyProps, ITableFootProps, ITableHeadProps } from '../props'; | ||
import { ChildComponent } from './ChildComponent'; | ||
@@ -14,17 +14,22 @@ import { ITableProps } from '../'; | ||
filterRowCell?: ChildComponent<IFilterRowEditorProps>; | ||
filterRowCellInput?: ChildComponent<IFilterRowEditorProps>; | ||
groupCell?: ChildComponent<IGroupRowProps<TData>>; | ||
groupExpandButton?: ChildComponent<IGroupRowProps<TData>>; | ||
groupPanel?: ChildComponent<IGroupPanelProps>; | ||
groupPanelCell?: ChildComponent<IGroupPanelCellProps>; | ||
groupExpandButton?: ChildComponent<IGroupRowProps<TData>>; | ||
groupCell?: ChildComponent<IGroupRowProps<TData>>; | ||
groupRow?: ChildComponent<IGroupRowProps<TData>>; | ||
groupSummaryCell?: ChildComponent<IGroupSummaryCellProps<TData>>; | ||
groupSummaryRow?: ChildComponent<IGroupSummaryRowProps<TData>>; | ||
groupSummaryCell?: ChildComponent<IGroupSummaryCellProps<TData>>; | ||
headFilterButton?: ChildComponent<IHeaderFilterButtonProps>; | ||
headCell?: ChildComponent<IHeadCellProps>; | ||
headCellContent?: ChildComponent<IHeadCellProps>; | ||
headCellResize?: ChildComponent<IHeadCellResizeProps>; | ||
headerFilterButton?: ChildComponent<IHeaderFilterButtonProps>; | ||
headerFilterPopupContent?: ChildComponent<IPopupContentProps<TData>>; | ||
headerFilterPopupRow?: ChildComponent<IDataRowProps>; | ||
headerFilterPopupSearchInput?: ChildComponent<IFilterRowEditorProps>; | ||
headerFilterPopupTextCell?: ChildComponent<ICellProps>; | ||
headRow?: ChildComponent<IHeadRowProps>; | ||
loading?: ChildComponent<ILoadingProps>; | ||
noDataCell?: ChildComponent<INoDataRowProps>; | ||
noDataRow?: ChildComponent<INoDataRowProps>; | ||
noDataCell?: ChildComponent<INoDataRowProps>; | ||
paging?: ChildComponent<IPagingProps>; | ||
@@ -35,5 +40,2 @@ pagingIndex?: ChildComponent<IPagingIndexProps>; | ||
pagingSizes?: ChildComponent<IPagingProps>; | ||
popupContent?: ChildComponent<IPopupContentProps<TData>>; | ||
popupContentItem?: ChildComponent<IPopupContentItemProps>; | ||
popupContentItemText?: ChildComponent<IPopupContentItemProps>; | ||
rootDiv?: ChildComponent<ITableProps<TData>>; | ||
@@ -40,0 +42,0 @@ sortIcon?: ChildComponent<ISortIconProps>; |
@@ -11,9 +11,12 @@ /// <reference types="react" /> | ||
filterRowValue?: any; | ||
headerFilterValues?: any[]; | ||
headerFilterValues?: string[]; | ||
headerFilterPopupPosition?: PopupPosition; | ||
headerFilterListItems?: (props: { | ||
data?: TData[]; | ||
}) => any[]; | ||
filter?: (value: any, filterValue: any, rowData?: TData) => boolean; | ||
}) => string[]; | ||
headerFilterSearchValue?: any; | ||
headerFilterSearch?: (value: any, searchValue: any, rowData?: any) => boolean; | ||
filter?: (value: any, filterValue: any, rowData?: any) => boolean; | ||
isHeaderFilterPopupShown?: boolean; | ||
isHeaderFilterSearchable?: boolean; | ||
isEditable?: boolean; | ||
@@ -20,0 +23,0 @@ isFilterable?: boolean; |
@@ -46,4 +46,2 @@ export declare class CssClasses { | ||
pagingSizes: string; | ||
popupContent: string; | ||
popupContentItem: string; | ||
iconGroupArrowCollapsed: string; | ||
@@ -50,0 +48,0 @@ iconGroupArrowExpanded: string; |
@@ -50,4 +50,2 @@ "use strict"; | ||
this.pagingSizes = 'ka-paging-sizes'; | ||
this.popupContent = 'ka-popup-content'; | ||
this.popupContentItem = 'ka-popup-content-item'; | ||
this.iconGroupArrowCollapsed = 'ka-icon ka-icon-group-arrow-collapsed'; | ||
@@ -54,0 +52,0 @@ this.iconGroupArrowExpanded = 'ka-icon ka-icon-group-arrow-expanded'; |
{ | ||
"name": "ka-table", | ||
"version": "10.0.0", | ||
"version": "11.0.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "github:komarovalexander/ka-table", |
@@ -292,3 +292,3 @@ import { ChildComponents, Column, EditableCell, Group, VirtualScrolling } from './models'; | ||
} | ||
export interface IPopupProps { | ||
export interface IHeaderFilterPopupProps { | ||
column: Column; | ||
@@ -295,0 +295,0 @@ childComponents?: ChildComponents; |
@@ -37,2 +37,3 @@ "use strict"; | ||
var const_1 = require("../const"); | ||
var ColumnUtils_1 = require("../Utils/ColumnUtils"); | ||
var kaReducer = function (props, action) { | ||
@@ -115,11 +116,17 @@ var _a; | ||
case enums_1.ActionType.ShowColumn: { | ||
var newColumns = __spreadArray([], columns, true); | ||
var columnIndex = newColumns.findIndex(function (c) { return c.key === action.columnKey; }); | ||
newColumns[columnIndex] = __assign(__assign({}, newColumns[columnIndex]), { visible: true }); | ||
var newColumns = (0, ColumnUtils_1.replaceColumnValue)({ | ||
columns: columns, | ||
columnKey: action.columnKey, | ||
replacedOption: 'visible', | ||
replacedValue: true | ||
}); | ||
return __assign(__assign({}, props), { columns: newColumns }); | ||
} | ||
case enums_1.ActionType.HideColumn: { | ||
var newColumns = __spreadArray([], columns, true); | ||
var columnIndex = newColumns.findIndex(function (c) { return c.key === action.columnKey; }); | ||
newColumns[columnIndex] = __assign(__assign({}, newColumns[columnIndex]), { visible: false }); | ||
var newColumns = (0, ColumnUtils_1.replaceColumnValue)({ | ||
columns: columns, | ||
columnKey: action.columnKey, | ||
replacedOption: 'visible', | ||
replacedValue: false | ||
}); | ||
return __assign(__assign({}, props), { columns: newColumns }); | ||
@@ -217,11 +224,26 @@ } | ||
case enums_1.ActionType.UpdateFilterRowValue: { | ||
var column = columns.find(function (c) { return c.key === action.columnKey; }); | ||
var newColumn = __assign(__assign({}, column), { filterRowValue: action.filterRowValue }); | ||
var newColumns = (0, ArrayUtils_1.getCopyOfArrayAndInsertOrReplaceItem)(newColumn, 'key', columns); | ||
var newColumns = (0, ColumnUtils_1.replaceColumnValue)({ | ||
columns: columns, | ||
columnKey: action.columnKey, | ||
replacedOption: 'filterRowValue', | ||
replacedValue: action.filterRowValue | ||
}); | ||
return __assign(__assign({}, props), { columns: newColumns }); | ||
} | ||
case enums_1.ActionType.UpdateHeaderFilterSearchValue: { | ||
var newColumns = (0, ColumnUtils_1.replaceColumnValue)({ | ||
columns: columns, | ||
columnKey: action.columnKey, | ||
replacedOption: 'headerFilterSearchValue', | ||
replacedValue: action.headerFilterSearchValue | ||
}); | ||
return __assign(__assign({}, props), { columns: newColumns }); | ||
} | ||
case enums_1.ActionType.UpdateFilterRowOperator: { | ||
var column = columns.find(function (c) { return c.key === action.columnKey; }); | ||
var newColumn = __assign(__assign({}, column), { filterRowOperator: action.filterRowOperator }); | ||
var newColumns = (0, ArrayUtils_1.getCopyOfArrayAndInsertOrReplaceItem)(newColumn, 'key', columns); | ||
var newColumns = (0, ColumnUtils_1.replaceColumnValue)({ | ||
columns: columns, | ||
columnKey: action.columnKey, | ||
replacedOption: 'filterRowOperator', | ||
replacedValue: action.filterRowOperator | ||
}); | ||
return __assign(__assign({}, props), { columns: newColumns }); | ||
@@ -228,0 +250,0 @@ } |
@@ -8,1 +8,7 @@ import { Column } from '../models'; | ||
export declare const getLastFieldParents: (field: Field) => Field[]; | ||
export declare const replaceColumnValue: ({ columns, columnKey, replacedOption, replacedValue }: { | ||
columns: Column[]; | ||
columnKey: any; | ||
replacedOption: string; | ||
replacedValue: any; | ||
}) => any[]; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,4 +17,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLastFieldParents = exports.getFieldParts = exports.getLastField = exports.getField = exports.getColumn = void 0; | ||
exports.replaceColumnValue = exports.getLastFieldParents = exports.getFieldParts = exports.getLastField = exports.getField = exports.getColumn = void 0; | ||
var defaultOptions_1 = __importDefault(require("../defaultOptions")); | ||
var ArrayUtils_1 = require("./ArrayUtils"); | ||
var getColumn = function (columns, columnKey) { return columns.find(function (c) { return c.key === columnKey; }); }; | ||
@@ -35,1 +47,10 @@ exports.getColumn = getColumn; | ||
exports.getLastFieldParents = getLastFieldParents; | ||
var replaceColumnValue = function (_a) { | ||
var _b; | ||
var columns = _a.columns, columnKey = _a.columnKey, replacedOption = _a.replacedOption, replacedValue = _a.replacedValue; | ||
var column = columns.find(function (c) { return c.key === columnKey; }); | ||
var newColumn = __assign(__assign({}, column), (_b = {}, _b[replacedOption] = replacedValue, _b)); | ||
var newArray = (0, ArrayUtils_1.getCopyOfArrayAndInsertOrReplaceItem)(newColumn, 'key', columns); | ||
return newArray; | ||
}; | ||
exports.replaceColumnValue = replaceColumnValue; |
@@ -11,9 +11,12 @@ /// <reference types="react" /> | ||
filterRowValue?: any; | ||
headerFilterValues?: any[]; | ||
headerFilterValues?: string[]; | ||
headerFilterPopupPosition?: import("../Models/PopupPosition").PopupPosition; | ||
headerFilterListItems?: (props: { | ||
data?: any[]; | ||
}) => any[]; | ||
}) => string[]; | ||
headerFilterSearchValue?: any; | ||
headerFilterSearch?: (value: any, searchValue: any, rowData?: any) => boolean; | ||
filter?: (value: any, filterValue: any, rowData?: any) => boolean; | ||
isHeaderFilterPopupShown?: boolean; | ||
isHeaderFilterSearchable?: boolean; | ||
isEditable?: boolean; | ||
@@ -20,0 +23,0 @@ isFilterable?: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
395415
8103
244