@kaizen/draft-table
Advanced tools
Comparing version 5.8.1 to 5.9.0
@@ -78,3 +78,3 @@ import React, { HTMLAttributes } from "react"; | ||
*/ | ||
export type TableCardProps = { | ||
export type TableCardProps = OverrideClassName<HTMLAttributes<HTMLElement>> & { | ||
onClick?: ButtonClickEvent | AnchorClickEvent; | ||
@@ -87,3 +87,3 @@ expanded?: boolean; | ||
}; | ||
export declare const TableCard: ({ children, expanded, expandedStyle, onClick, href, forceHoverState, ...otherProps }: TableCardProps) => JSX.Element; | ||
export declare const TableCard: ({ children, expanded, expandedStyle, onClick, href, forceHoverState, classNameOverride, ...otherProps }: TableCardProps) => JSX.Element; | ||
/** | ||
@@ -93,8 +93,8 @@ * Aria roles like aria-rowindex can be added from | ||
* | ||
* @param {*} { children, ...otherProps } | ||
* @param {*} { children, classNameOverride, ...otherProps } | ||
*/ | ||
export type TableRowProps = { | ||
export type TableRowProps = OverrideClassName<HTMLAttributes<HTMLElement>> & { | ||
children?: React.ReactNode; | ||
}; | ||
export declare const TableRow: ({ children, ...otherProps }: TableRowProps) => JSX.Element; | ||
export declare const TableRow: ({ children, classNameOverride, ...otherProps }: TableRowProps) => JSX.Element; | ||
/** | ||
@@ -101,0 +101,0 @@ * @param width value between 1 and 0, to be calculated as a percentage |
@@ -138,4 +138,5 @@ "use strict"; | ||
var TableCard = function (_a) { | ||
var children = _a.children, expanded = _a.expanded, _b = _a.expandedStyle, expandedStyle = _b === void 0 ? "well" : _b, onClick = _a.onClick, href = _a.href, _c = _a.forceHoverState, forceHoverState = _c === void 0 ? false : _c, otherProps = __rest(_a, ["children", "expanded", "expandedStyle", "onClick", "href", "forceHoverState"]); | ||
var className = (0, classnames_1["default"])(Table_module_scss_1["default"].card, expanded && Table_module_scss_1["default"].expanded, expanded && Table_module_scss_1["default"][expandedStyle], (forceHoverState || onClick != null || href != null) && Table_module_scss_1["default"].hasHoverState); | ||
var children = _a.children, expanded = _a.expanded, _b = _a.expandedStyle, expandedStyle = _b === void 0 ? "well" : _b, onClick = _a.onClick, href = _a.href, _c = _a.forceHoverState, forceHoverState = _c === void 0 ? false : _c, classNameOverride = _a.classNameOverride, otherProps = __rest(_a, ["children", "expanded", "expandedStyle", "onClick", "href", "forceHoverState", "classNameOverride"]); | ||
var className = (0, classnames_1["default"])(Table_module_scss_1["default"].card, expanded && Table_module_scss_1["default"].expanded, expanded && Table_module_scss_1["default"][expandedStyle], (forceHoverState || onClick != null || href != null) && | ||
Table_module_scss_1["default"].hasHoverState, classNameOverride); | ||
return href != null ? (react_1["default"].createElement("a", __assign({ href: href, className: className, onClick: onClick }, otherProps), children)) : onClick ? (react_1["default"].createElement("button", __assign({ type: "button", className: className, onClick: onClick }, otherProps), children)) : (react_1["default"].createElement("div", __assign({ className: className }, otherProps), children)); | ||
@@ -145,4 +146,4 @@ }; | ||
var TableRow = function (_a) { | ||
var children = _a.children, otherProps = __rest(_a, ["children"]); | ||
return (react_1["default"].createElement("div", __assign({ className: Table_module_scss_1["default"].row, role: "row" }, otherProps), children)); | ||
var children = _a.children, classNameOverride = _a.classNameOverride, otherProps = __rest(_a, ["children", "classNameOverride"]); | ||
return (react_1["default"].createElement("div", __assign({ className: (0, classnames_1["default"])(Table_module_scss_1["default"].row, classNameOverride), role: "row" }, otherProps), children)); | ||
}; | ||
@@ -149,0 +150,0 @@ exports.TableRow = TableRow; |
{ | ||
"name": "@kaizen/draft-table", | ||
"version": "5.8.1", | ||
"version": "5.9.0", | ||
"description": "The draft Table component", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
34748