morse-react-tables
Advanced tools
Comparing version 2.1.1 to 2.2.2
@@ -45,2 +45,7 @@ import React from "react"; | ||
predicate?: (value: T[K], itemUnderTest: T) => boolean; | ||
/** | ||
* By default a strict equality check is applied to determine if a given | ||
* item is disabled. Supply a predicate to override this behaviour. | ||
*/ | ||
disabledPredicate?: (value: T[K], itemUnderTest: T) => boolean; | ||
canSelectAll?: boolean; | ||
@@ -47,0 +52,0 @@ /** |
@@ -68,4 +68,4 @@ "use strict"; | ||
var selected = pluginConfig.selectedValues.some(function (selectedValue) { | ||
if (pluginConfig.predicate) { | ||
return pluginConfig.predicate(selectedValue, item); | ||
if (pluginConfig.disabledPredicate) { | ||
return pluginConfig.disabledPredicate(selectedValue, item); | ||
} | ||
@@ -76,3 +76,10 @@ else { | ||
}); | ||
var isDisabled = (_b = pluginConfig.disabledValues) === null || _b === void 0 ? void 0 : _b.includes(value); | ||
var isDisabled = (_b = pluginConfig.disabledValues) === null || _b === void 0 ? void 0 : _b.some(function (disabledValue) { | ||
if (pluginConfig.predicate) { | ||
return pluginConfig.predicate(disabledValue, item); | ||
} | ||
else { | ||
return disabledValue === value; | ||
} | ||
}); | ||
var handleOnClick = function (e) { | ||
@@ -79,0 +86,0 @@ e.stopPropagation(); |
{ | ||
"name": "morse-react-tables", | ||
"version": "2.1.1", | ||
"version": "2.2.2", | ||
"description": "Patterns for building tables", | ||
@@ -20,4 +20,4 @@ "repository": { | ||
"@types/react-dom": "^17.0.0", | ||
"morse-css": "2.1.0", | ||
"morse-react": "2.1.1", | ||
"morse-css": "2.2.2", | ||
"morse-react": "2.2.2", | ||
"react": "^17.0.0", | ||
@@ -45,3 +45,3 @@ "react-dom": "^17.0.0", | ||
], | ||
"gitHead": "1f64684ad64c4586f2a5493e87e188b5c2e42f88" | ||
"gitHead": "1ff416bdfa769b0304fdb21e20a3a0881d2a5d33" | ||
} |
Sorry, the diff of this file is not supported yet
53571
856