@xeplr/ui-table 1.1.0 → 1.1.1
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/README.md +1 -0
- package/package.json +1 -1
- package/src/XeplrTable.jsx +6 -0
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ The package ships its `src/` as ES modules with JSX and imports its own styleshe
|
|
|
52
52
|
| `childDisplay` | `'popup'` | `'popup'` or `'inner'` — how level-1 children show |
|
|
53
53
|
| `pageSize` | `20` | initial page size (the page-size menu offers 100, 200, 500, 1000) |
|
|
54
54
|
| `enableSorting`, `enableFiltering`, `enablePagination` | `true` | |
|
|
55
|
+
| `showToolbar` | `true` | `false` leaves the toolbar row out (a small table that offers no filtering or sorting). Editing tables keep it for Add/Delete/Commit. |
|
|
55
56
|
| `minDetectionRows` | `10` | non-empty samples a column needs before its detected type is final |
|
|
56
57
|
| `sorting`, `onSortingChange` | — | controlled sort (`[{ id, desc }]`) — see Sorting |
|
|
57
58
|
| `onHeaderClick` | — | `(columnKey, isGroupHeader)` — **replaces** sort-on-click |
|
package/package.json
CHANGED
package/src/XeplrTable.jsx
CHANGED
|
@@ -49,6 +49,10 @@ var CHILD_DISPLAY = { POPUP: 'popup', INNER: 'inner' };
|
|
|
49
49
|
* @param {Function} [props.onSortingChange] - Called with the next sort state.
|
|
50
50
|
* @param {boolean} [props.enableFiltering] - Default: true
|
|
51
51
|
* @param {boolean} [props.enablePagination] - Default: true
|
|
52
|
+
* @param {boolean} [props.showToolbar] - Default: true. False
|
|
53
|
+
* leaves the toolbar row out entirely — for a small table on a dashboard
|
|
54
|
+
* that offers no filtering or sorting, where an empty bar with a Clear Sort
|
|
55
|
+
* button is clutter. Editing (Add/Delete/Commit) keeps it whatever this says.
|
|
52
56
|
* @param {Function} [props.rowClassName] - (row) => string|falsy. Extra
|
|
53
57
|
* CSS class per row, so a host can mark rows that mean something to IT.
|
|
54
58
|
* @param {Function} [props.toolbarActions] - (ctx) => ReactNode.
|
|
@@ -363,6 +367,7 @@ export default function XeplrTable(props) {
|
|
|
363
367
|
|
|
364
368
|
return (
|
|
365
369
|
<div className={'xeplr-table-container' + (props.className ? ' ' + props.className : '')}>
|
|
370
|
+
{(props.showToolbar !== false || actions.hasSave || actions.hasDelete || actions.hasPending) && (
|
|
366
371
|
<div className="xeplr-table-toolbar">
|
|
367
372
|
{actions.hasSave && (
|
|
368
373
|
<button type="button" className="xeplr-table-toolbar-btn xeplr-table-toolbar-btn-add" onClick={actions.openAdd}>
|
|
@@ -422,6 +427,7 @@ export default function XeplrTable(props) {
|
|
|
422
427
|
</>
|
|
423
428
|
)}
|
|
424
429
|
</div>
|
|
430
|
+
)}
|
|
425
431
|
|
|
426
432
|
<div className="xeplr-table-scroll" ref={widths.scrollRef}>
|
|
427
433
|
{/* When sized to content the table stops at the width it needs; the
|