Comparing version 7.10.0 to 7.10.1
{ | ||
"name": "ka-table", | ||
"version": "7.10.0", | ||
"version": "7.10.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "github:komarovalexander/ka-table", |
@@ -1,7 +0,7 @@ | ||
import { ITableProps } from '../'; | ||
import { DataType } from '../enums'; | ||
import { FilterFunc, FormatFunc, SearchFunc } from '../types'; | ||
import { Column } from '../Models/Column'; | ||
import { EditableCell } from '../Models/EditableCell'; | ||
import { FilterOperator } from '../Models/FilterOperator'; | ||
import { FilterFunc, FormatFunc, SearchFunc } from '../types'; | ||
import { ITableProps } from '../'; | ||
export declare const getRowEditableCells: (rowKeyValue: any, editableCells: EditableCell[]) => EditableCell[]; | ||
@@ -8,0 +8,0 @@ export declare const searchData: (columns: Column[], data: any[], searchText: string, search?: SearchFunc) => any[]; |
@@ -16,7 +16,7 @@ "use strict"; | ||
exports.filterByHeaderFilter = exports.predefinedFilterOperators = exports.getDefaultOperatorForType = exports.filterData = exports.filterAndSearchData = exports.searchData = exports.getRowEditableCells = void 0; | ||
var enums_1 = require("../enums"); | ||
var TypeUtils_1 = require("./TypeUtils"); | ||
var defaultOptions_1 = __importDefault(require("../defaultOptions")); | ||
var enums_1 = require("../enums"); | ||
var DataUtils_1 = require("./DataUtils"); | ||
var CommonUtils_1 = require("./CommonUtils"); | ||
var DataUtils_1 = require("./DataUtils"); | ||
var TypeUtils_1 = require("./TypeUtils"); | ||
var getRowEditableCells = function (rowKeyValue, editableCells) { | ||
@@ -75,7 +75,8 @@ return editableCells.filter(function (c) { return c.rowKeyValue === rowKeyValue; }); | ||
} | ||
var compare = (filter === null || filter === void 0 ? void 0 : filter({ column: column })) || getCompare(column); | ||
var customFilter = filter === null || filter === void 0 ? void 0 : filter({ column: column }); | ||
var compare = customFilter || getCompare(column); | ||
return initialData.filter(function (d) { | ||
var fieldValue = (0, DataUtils_1.getValueByColumn)(d, column); | ||
var conditionValue = column.filterRowValue; | ||
if (column.dataType === enums_1.DataType.Date) { | ||
if (column.dataType === enums_1.DataType.Date && !customFilter) { | ||
fieldValue = fieldValue == null ? fieldValue : new Date(fieldValue).setHours(0, 0, 0, 0); | ||
@@ -82,0 +83,0 @@ conditionValue = conditionValue == null ? conditionValue : new Date(conditionValue).setHours(0, 0, 0, 0); |
359808
7309