@patternfly/react-table 4.29.73 → 4.30.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/esm/components/Table/Body.d.ts +2 -2
- package/dist/esm/components/Table/Body.d.ts.map +1 -1
- package/dist/esm/components/Table/Body.js +11 -1
- package/dist/esm/components/Table/Body.js.map +1 -1
- package/dist/esm/components/Table/RowWrapper.d.ts.map +1 -1
- package/dist/esm/components/Table/RowWrapper.js +2 -2
- package/dist/esm/components/Table/RowWrapper.js.map +1 -1
- package/dist/esm/components/Table/TableTypes.d.ts +2 -0
- package/dist/esm/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/esm/components/Table/utils/decorators/treeRow.d.ts.map +1 -1
- package/dist/esm/components/Table/utils/decorators/treeRow.js +6 -6
- package/dist/esm/components/Table/utils/decorators/treeRow.js.map +1 -1
- package/dist/esm/components/TableComposable/Tr.d.ts +7 -1
- package/dist/esm/components/TableComposable/Tr.d.ts.map +1 -1
- package/dist/esm/components/TableComposable/Tr.js +11 -2
- package/dist/esm/components/TableComposable/Tr.js.map +1 -1
- package/dist/js/components/Table/Body.d.ts +2 -2
- package/dist/js/components/Table/Body.d.ts.map +1 -1
- package/dist/js/components/Table/Body.js +11 -1
- package/dist/js/components/Table/Body.js.map +1 -1
- package/dist/js/components/Table/RowWrapper.d.ts.map +1 -1
- package/dist/js/components/Table/RowWrapper.js +2 -2
- package/dist/js/components/Table/RowWrapper.js.map +1 -1
- package/dist/js/components/Table/TableTypes.d.ts +2 -0
- package/dist/js/components/Table/TableTypes.d.ts.map +1 -1
- package/dist/js/components/Table/utils/decorators/treeRow.d.ts.map +1 -1
- package/dist/js/components/Table/utils/decorators/treeRow.js +6 -6
- package/dist/js/components/Table/utils/decorators/treeRow.js.map +1 -1
- package/dist/js/components/TableComposable/Tr.d.ts +7 -1
- package/dist/js/components/TableComposable/Tr.d.ts.map +1 -1
- package/dist/js/components/TableComposable/Tr.js +11 -2
- package/dist/js/components/TableComposable/Tr.js.map +1 -1
- package/dist/umd/react-table.css +14800 -14800
- package/dist/umd/react-table.js +30 -11
- package/dist/umd/react-table.min.css +13589 -13589
- package/dist/umd/react-table.min.js +2 -2
- package/package.json +3 -3
- package/src/components/Table/Body.tsx +21 -6
- package/src/components/Table/RowWrapper.tsx +3 -1
- package/src/components/Table/TableTypes.ts +2 -0
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +1568 -784
- package/src/components/Table/examples/Table.md +111 -94
- package/src/components/Table/utils/decorators/treeRow.tsx +12 -6
- package/src/components/TableComposable/Tr.tsx +25 -1
- package/src/components/TableComposable/examples/ComposableTable.md +68 -7
|
@@ -13,6 +13,12 @@ export interface TrProps extends React.HTMLProps<HTMLTableRowElement>, OUIAProps
|
|
|
13
13
|
isExpanded?: boolean;
|
|
14
14
|
/** Only applicable to Tr within the Tbody: Whether the row is editable */
|
|
15
15
|
isEditable?: boolean;
|
|
16
|
+
/** Flag which adds hover styles for the table row */
|
|
17
|
+
isHoverable?: boolean;
|
|
18
|
+
/** Flag indicating the row is selected - adds selected styling */
|
|
19
|
+
isRowSelected?: boolean;
|
|
20
|
+
/** An event handler for the row */
|
|
21
|
+
onRowClick?: (event?: React.KeyboardEvent | React.MouseEvent) => void;
|
|
16
22
|
}
|
|
17
|
-
export declare const Tr: React.ForwardRefExoticComponent<Pick<TrProps, "span" | "
|
|
23
|
+
export declare const Tr: React.ForwardRefExoticComponent<Pick<TrProps, "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "onClick" | "children" | "className" | "href" | "tabIndex" | "autoFocus" | "role" | "id" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "ouiaId" | "ouiaSafe" | "isExpanded" | "isEditable" | "isHidden" | "isHoverable" | "isRowSelected" | "innerRef" | "onRowClick"> & React.RefAttributes<HTMLTableRowElement>>;
|
|
18
24
|
//# sourceMappingURL=Tr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr.d.ts","sourceRoot":"","sources":["../../../../src/components/TableComposable/Tr.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKjE,MAAM,WAAW,OAAQ,SAAQ,KAAK,CAAC,SA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IAAI,CAAC;CACvE;AAkDD,eAAO,MAAM,EAAE,07LAEb,CAAC"}
|
|
@@ -8,9 +8,18 @@ const table_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/co
|
|
|
8
8
|
const inline_edit_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/InlineEdit/inline-edit"));
|
|
9
9
|
const react_styles_1 = require("@patternfly/react-styles");
|
|
10
10
|
const TrBase = (_a) => {
|
|
11
|
-
var { children, className, isExpanded, isEditable, isHidden = false, innerRef, ouiaId, ouiaSafe = true } = _a, props = tslib_1.__rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "innerRef", "ouiaId", "ouiaSafe"]);
|
|
11
|
+
var { children, className, isExpanded, isEditable, isHidden = false, isHoverable = false, isRowSelected = false, innerRef, ouiaId, ouiaSafe = true, onRowClick } = _a, props = tslib_1.__rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "innerRef", "ouiaId", "ouiaSafe", "onRowClick"]);
|
|
12
12
|
const ouiaProps = react_core_1.useOUIAProps('TableRow', ouiaId, ouiaSafe);
|
|
13
|
-
|
|
13
|
+
let onKeyDown = null;
|
|
14
|
+
if (onRowClick) {
|
|
15
|
+
onKeyDown = (e) => {
|
|
16
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
17
|
+
onRowClick(e);
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement("tr", Object.assign({ className: react_styles_1.css(className, isExpanded !== undefined && table_1.default.tableExpandableRow, isExpanded && table_1.default.modifiers.expanded, isEditable && inline_edit_1.default.modifiers.inlineEditable, isHoverable && table_1.default.modifiers.hoverable, isRowSelected && table_1.default.modifiers.selected), hidden: isHidden || (isExpanded !== undefined && !isExpanded) }, (isHoverable && { tabIndex: 0 }), { ref: innerRef }, (onRowClick && { onClick: onRowClick, onKeyDown }), ouiaProps, props), children));
|
|
14
23
|
};
|
|
15
24
|
exports.Tr = React.forwardRef((props, ref) => (React.createElement(TrBase, Object.assign({}, props, { innerRef: ref }))));
|
|
16
25
|
exports.Tr.displayName = 'Tr';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr.js","sourceRoot":"","sources":["../../../../src/components/TableComposable/Tr.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,uDAAiE;AACjE,wGAAyE;AACzE,yHAA0F;AAC1F,2DAA+C;
|
|
1
|
+
{"version":3,"file":"Tr.js","sourceRoot":"","sources":["../../../../src/components/TableComposable/Tr.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,uDAAiE;AACjE,wGAAyE;AACzE,yHAA0F;AAC1F,2DAA+C;AAuB/C,MAAM,MAAM,GAAqC,CAAC,EAaxC,EAAE,EAAE;QAboC,EAChD,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,EACrB,QAAQ,EACR,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,UAAU,OAEF,EADL,KAAK,sBAZwC,iJAajD,CADS;IAER,MAAM,SAAS,GAAG,yBAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAE7D,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,IAAI,UAAU,EAAE;QACd,SAAS,GAAG,CAAC,CAAsB,EAAE,EAAE;YACrC,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;gBACtC,UAAU,CAAC,CAAC,CAAC,CAAC;gBACd,CAAC,CAAC,cAAc,EAAE,CAAC;aACpB;QACH,CAAC,CAAC;KACH;IAED,OAAO,CACL,0CACE,SAAS,EAAE,kBAAG,CACZ,SAAS,EACT,UAAU,KAAK,SAAS,IAAI,eAAM,CAAC,kBAAkB,EACrD,UAAU,IAAI,eAAM,C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