Comparing version 8.4.0 to 8.4.1
@@ -51,4 +51,4 @@ "use strict"; | ||
}, props, childComponents === null || childComponents === void 0 ? void 0 : childComponents.headFilterButton), 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" })))); | ||
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; |
@@ -62,3 +62,2 @@ "use strict"; | ||
dispatch({ type: enums_1.ActionType.ComponentDidMount }); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
@@ -65,0 +64,0 @@ React.useEffect(function () { |
@@ -69,4 +69,4 @@ "use strict"; | ||
}; | ||
var controlledPropsKeys = (0, utils_1.getControlledPropsKeys)(props); | ||
React.useEffect(function () { | ||
var controlledPropsKeys = (0, utils_1.getControlledPropsKeys)(props); | ||
var propsToOverride = (0, utils_1.getPropsToOverride)(controlledPropsKeys, props, tableProps); | ||
@@ -79,4 +79,3 @@ if (Object.keys(propsToOverride).length) { | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [props]); | ||
}, controlledPropsKeys.map(function (k) { return props[k]; })); | ||
var contextTable = props.table || (0, UseTable_1.getTable)(); | ||
@@ -83,0 +82,0 @@ contextTable.props = tableProps; |
import { ControlledPropsKeys } from '../../types'; | ||
import { ITableProps } from '../Table/Table'; | ||
export declare const getDefaultControlledPropsKeys: (settings?: { | ||
loadingEnabled?: boolean; | ||
}) => ControlledPropsKeys; | ||
export declare const getControlledPropsKeys: (props: ITableProps) => ControlledPropsKeys; | ||
export declare const getPropsToOverride: (controlledPropsKeys: ControlledPropsKeys, props: ITableProps, tableProps: ITableProps) => any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPropsToOverride = exports.getControlledPropsKeys = void 0; | ||
exports.getPropsToOverride = exports.getControlledPropsKeys = exports.getDefaultControlledPropsKeys = void 0; | ||
var getDefaultControlledPropsKeys = function (settings) { | ||
return (settings === null || settings === void 0 ? void 0 : settings.loadingEnabled) | ||
? ['searchText', 'loading'] | ||
: ['searchText', 'loading', 'data', 'paging', 'selectedRows']; | ||
}; | ||
exports.getDefaultControlledPropsKeys = getDefaultControlledPropsKeys; | ||
var getControlledPropsKeys = function (props) { | ||
@@ -8,5 +14,3 @@ var _a; | ||
props.controlledPropsKeys | ||
: ((_a = props.loading) === null || _a === void 0 ? void 0 : _a.enabled) | ||
? ['searchText', 'loading'] | ||
: ['searchText', 'loading', 'data', 'paging', 'selectedRows']; | ||
: (0, exports.getDefaultControlledPropsKeys)({ loadingEnabled: (_a = props.loading) === null || _a === void 0 ? void 0 : _a.enabled }); | ||
return controlledPropsKeys; | ||
@@ -13,0 +17,0 @@ }; |
23
enums.js
@@ -9,11 +9,14 @@ "use strict"; | ||
PagingPosition["TopAndBottom"] = "topAndBottom"; | ||
})(PagingPosition = exports.PagingPosition || (exports.PagingPosition = {})); | ||
})(PagingPosition || (exports.PagingPosition = PagingPosition = {})); | ||
var DataType; | ||
(function (DataType) { | ||
// eslint-disable-next-line | ||
DataType["Boolean"] = "boolean"; | ||
DataType["Date"] = "date"; | ||
// eslint-disable-next-line | ||
DataType["Number"] = "number"; | ||
DataType["Object"] = "object"; | ||
// eslint-disable-next-line | ||
DataType["String"] = "string"; | ||
})(DataType = exports.DataType || (exports.DataType = {})); | ||
})(DataType || (exports.DataType = DataType = {})); | ||
var EditingMode; | ||
@@ -23,3 +26,3 @@ (function (EditingMode) { | ||
EditingMode["Cell"] = "cell"; | ||
})(EditingMode = exports.EditingMode || (exports.EditingMode = {})); | ||
})(EditingMode || (exports.EditingMode = EditingMode = {})); | ||
var ActionType; | ||
@@ -92,3 +95,3 @@ (function (ActionType) { | ||
ActionType["Validate"] = "Validate"; | ||
})(ActionType = exports.ActionType || (exports.ActionType = {})); | ||
})(ActionType || (exports.ActionType = ActionType = {})); | ||
var KeyboardEnum; | ||
@@ -98,3 +101,3 @@ (function (KeyboardEnum) { | ||
KeyboardEnum[KeyboardEnum["Enter"] = 13] = "Enter"; | ||
})(KeyboardEnum = exports.KeyboardEnum || (exports.KeyboardEnum = {})); | ||
})(KeyboardEnum || (exports.KeyboardEnum = KeyboardEnum = {})); | ||
var SortDirection; | ||
@@ -104,3 +107,3 @@ (function (SortDirection) { | ||
SortDirection["Descend"] = "descend"; | ||
})(SortDirection = exports.SortDirection || (exports.SortDirection = {})); | ||
})(SortDirection || (exports.SortDirection = SortDirection = {})); | ||
var SortingMode; | ||
@@ -115,3 +118,3 @@ (function (SortingMode) { | ||
SortingMode["MultipleTripleStateRemote"] = "multipleTripleStateRemote"; | ||
})(SortingMode = exports.SortingMode || (exports.SortingMode = {})); | ||
})(SortingMode || (exports.SortingMode = SortingMode = {})); | ||
var FilteringMode; | ||
@@ -122,3 +125,3 @@ (function (FilteringMode) { | ||
FilteringMode["HeaderFilter"] = "headerFilter"; | ||
})(FilteringMode = exports.FilteringMode || (exports.FilteringMode = {})); | ||
})(FilteringMode || (exports.FilteringMode = FilteringMode = {})); | ||
var FilterOperatorName; | ||
@@ -134,3 +137,3 @@ (function (FilterOperatorName) { | ||
FilterOperatorName["IsNotEmpty"] = "IsNotEmpty"; | ||
})(FilterOperatorName = exports.FilterOperatorName || (exports.FilterOperatorName = {})); | ||
})(FilterOperatorName || (exports.FilterOperatorName = FilterOperatorName = {})); | ||
var InsertRowPosition; | ||
@@ -140,2 +143,2 @@ (function (InsertRowPosition) { | ||
InsertRowPosition["after"] = "after"; | ||
})(InsertRowPosition = exports.InsertRowPosition || (exports.InsertRowPosition = {})); | ||
})(InsertRowPosition || (exports.InsertRowPosition = InsertRowPosition = {})); |
import React from 'react'; | ||
export declare function useOuterClick(callback: () => void): React.MutableRefObject<HTMLDivElement>; | ||
export declare const useOuterClick: (callback: () => void) => React.MutableRefObject<HTMLDivElement>; |
@@ -8,3 +8,3 @@ "use strict"; | ||
var react_1 = __importDefault(require("react")); | ||
function useOuterClick(callback) { | ||
var useOuterClick = function (callback) { | ||
var callbackRef = react_1.default.useRef(function (event) { }); | ||
@@ -16,12 +16,12 @@ var innerRef = react_1.default.useRef(document.createElement('div')); | ||
react_1.default.useEffect(function () { | ||
document.addEventListener('click', handleClick); | ||
return function () { return document.removeEventListener('click', handleClick); }; | ||
function handleClick(event) { | ||
var handleClick = function (event) { | ||
if (innerRef.current && callbackRef.current && | ||
!innerRef.current.contains(event.target)) | ||
callbackRef.current(event); | ||
} | ||
}; | ||
document.addEventListener('click', handleClick); | ||
return function () { return document.removeEventListener('click', handleClick); }; | ||
}, []); | ||
return innerRef; | ||
} | ||
}; | ||
exports.useOuterClick = useOuterClick; |
@@ -9,3 +9,3 @@ "use strict"; | ||
if (!(context === null || context === void 0 ? void 0 : context.changeProps)) { | ||
// tslint:disable-next-line:no-console | ||
// eslint-disable-next-line | ||
console.warn('useTableInstance warning: ka-table is not initialized, instanse is empty because: table is not rendered yet OR controlled mode is used'); | ||
@@ -12,0 +12,0 @@ } |
import React from 'react'; | ||
export declare const CollapsedIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const CollapsedIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
import React from 'react'; | ||
export declare const CrossIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const CrossIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
import React from 'react'; | ||
export declare const DownIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const DownIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
import React from 'react'; | ||
export declare const ExpandedIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const ExpandedIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
import React from 'react'; | ||
export declare const FilterIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const FilterIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
import React from 'react'; | ||
export declare const UpIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element; | ||
export declare const UpIcon: (props: React.SVGProps<SVGSVGElement>) => React.JSX.Element; |
{ | ||
"name": "ka-table", | ||
"version": "8.4.0", | ||
"version": "8.4.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "github:komarovalexander/ka-table", |
@@ -52,3 +52,3 @@ The customizable, extendable, lightweight and free React Table Component | ||
const OverviewDemo: React.FC = () => { | ||
const OverviewDemo = () => { | ||
return ( | ||
@@ -55,0 +55,0 @@ <Table |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
386945
7946