@absreim/react-bootstrap-data-grid 1.2.1 → 1.2.2
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/{ColHeaderCell.jsx → ColHeaderCell.js} +5 -7
- package/FilterOptionsTable/{DateFilterRow.jsx → DateFilterRow.js} +2 -24
- package/FilterOptionsTable/{FilterOptionsTable.jsx → FilterOptionsTable.js} +5 -20
- package/FilterOptionsTable/{NumberFilterRow.jsx → NumberFilterRow.js} +2 -17
- package/FilterOptionsTable/{StringFilterRow.jsx → StringFilterRow.js} +2 -17
- package/{Grid.jsx → Grid.js} +20 -43
- package/{ToggleButton.jsx → ToggleButton.js} +2 -3
- package/icons/arrowPlaceholder.d.ts +1 -1
- package/icons/arrowPlaceholder.js +7 -0
- package/icons/deselectAll.d.ts +1 -1
- package/icons/deselectAll.js +3 -0
- package/icons/downArrow.d.ts +1 -1
- package/icons/downArrow.js +3 -0
- package/icons/selectAll.d.ts +1 -1
- package/icons/selectAll.js +3 -0
- package/icons/upArrow.d.ts +1 -1
- package/icons/upArrow.js +13 -0
- package/package.json +1 -1
- package/pagination/{PageSelector.jsx → PageSelector.js} +23 -50
- package/pagination/PageSizeSelector.js +15 -0
- package/pagination/{Pagination.jsx → Pagination.js} +2 -4
- package/selection/{SelectAllHeaderCell.jsx → SelectAllHeaderCell.js} +4 -5
- package/selection/{SelectionInput.jsx → SelectionInput.js} +3 -2
- package/style.css +1 -0
- package/style.scss +41 -0
- package/icons/arrowPlaceholder.jsx +0 -10
- package/icons/deselectAll.jsx +0 -5
- package/icons/downArrow.jsx +0 -9
- package/icons/selectAll.jsx +0 -6
- package/icons/upArrow.jsx +0 -21
- package/pagination/PageSizeSelector.jsx +0 -20
- /package/hooks/{useControlledHover.jsx → useControlledHover.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import downArrow from "./icons/downArrow";
|
|
3
4
|
import upArrow from "./icons/upArrow";
|
|
4
5
|
import arrowPlaceholder from "./icons/arrowPlaceholder";
|
|
@@ -44,14 +45,11 @@ var ColHeaderCell = function (_a) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
return (
|
|
48
|
-
"
|
|
48
|
+
return (_jsxs("th", { className: classNames({
|
|
49
|
+
"rbdg-clickable-grid-header-cell": sortModel,
|
|
49
50
|
"table-active": sortModel === null || sortModel === void 0 ? void 0 : sortModel.sortOrder,
|
|
50
|
-
})
|
|
51
|
+
}), onClick: sortModel && handleClick, onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, "aria-description": sortModel
|
|
51
52
|
? "Column header"
|
|
52
|
-
: "Column header that can be clicked to change the sorting mode"
|
|
53
|
-
{label}
|
|
54
|
-
{getSortSymbol()}
|
|
55
|
-
</th>);
|
|
53
|
+
: "Column header that can be clicked to change the sorting mode", "aria-colindex": ariaColIndex, children: [label, getSortSymbol()] }));
|
|
56
54
|
};
|
|
57
55
|
export default ColHeaderCell;
|
|
@@ -9,6 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useMemo } from "react";
|
|
13
14
|
import { dateFilterSchemeNames, dateFilterSchemes, } from "../types";
|
|
14
15
|
import { nanoid } from "nanoid/non-secure";
|
|
@@ -39,29 +40,6 @@ var DateFilterRow = function (_a) {
|
|
|
39
40
|
var opSelectLabel = "".concat(columnLabel, " Column Filter Operator Selection");
|
|
40
41
|
var startDateInputLabel = "".concat(columnLabel, " Column Filter Start Date");
|
|
41
42
|
var endDateInputLabel = "".concat(columnLabel, " Column Filter End Date");
|
|
42
|
-
return (
|
|
43
|
-
<td>
|
|
44
|
-
<input name={checkboxLabel} aria-label={checkboxLabel} type="checkbox" checked={enabled} onChange={handleEnabledChange}/>
|
|
45
|
-
</td>
|
|
46
|
-
<td>{columnLabel}</td>
|
|
47
|
-
<td>{filterState.type === "date" ? "Date" : "Datetime"}</td>
|
|
48
|
-
<td>
|
|
49
|
-
<select name={opSelectLabel} aria-label={opSelectLabel} disabled={!enabled} className="form-select" value={scheme} onChange={handleOpChange}>
|
|
50
|
-
{dateFilterSchemes.map(function (scheme) { return (<option key={scheme} value={scheme}>
|
|
51
|
-
{dateFilterSchemeNames[scheme]}
|
|
52
|
-
</option>); })}
|
|
53
|
-
</select>
|
|
54
|
-
</td>
|
|
55
|
-
<td>
|
|
56
|
-
{scheme !== "endAt" && (<>
|
|
57
|
-
{scheme === "between" && (<label htmlFor={startDateInputId}>Start Date</label>)}
|
|
58
|
-
<input id={startDateInputId} className="form-control" type={inputType} required={enabled} disabled={!enabled} value={startDate} onChange={handleStartValueChange} aria-label={startDateInputLabel}/>
|
|
59
|
-
</>)}
|
|
60
|
-
{scheme !== "startFrom" && (<>
|
|
61
|
-
{scheme === "between" && (<label htmlFor={endDateInputId}>End Date</label>)}
|
|
62
|
-
<input id={endDateInputId} className="form-control" type={inputType} required={enabled} disabled={!enabled} value={endDate} onChange={handleEndValueChange} aria-label={endDateInputLabel}/>
|
|
63
|
-
</>)}
|
|
64
|
-
</td>
|
|
65
|
-
</tr>);
|
|
43
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("input", { name: checkboxLabel, "aria-label": checkboxLabel, type: "checkbox", checked: enabled, onChange: handleEnabledChange }) }), _jsx("td", { children: columnLabel }), _jsx("td", { children: filterState.type === "date" ? "Date" : "Datetime" }), _jsx("td", { children: _jsx("select", { name: opSelectLabel, "aria-label": opSelectLabel, disabled: !enabled, className: "form-select", value: scheme, onChange: handleOpChange, children: dateFilterSchemes.map(function (scheme) { return (_jsx("option", { value: scheme, children: dateFilterSchemeNames[scheme] }, scheme)); }) }) }), _jsxs("td", { children: [scheme !== "endAt" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: startDateInputId, children: "Start Date" })), _jsx("input", { id: startDateInputId, className: "form-control", type: inputType, required: enabled, disabled: !enabled, value: startDate, onChange: handleStartValueChange, "aria-label": startDateInputLabel })] })), scheme !== "startFrom" && (_jsxs(_Fragment, { children: [scheme === "between" && (_jsx("label", { htmlFor: endDateInputId, children: "End Date" })), _jsx("input", { id: endDateInputId, className: "form-control", type: inputType, required: enabled, disabled: !enabled, value: endDate, onChange: handleEndValueChange, "aria-label": endDateInputLabel })] }))] })] }));
|
|
66
44
|
};
|
|
67
45
|
export default DateFilterRow;
|
|
@@ -9,6 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useState } from "react";
|
|
13
14
|
import StringFilterRow from "./StringFilterRow";
|
|
14
15
|
import NumberFilterRow from "./NumberFilterRow";
|
|
@@ -76,14 +77,14 @@ var FilterOptionsTable = function (_a) {
|
|
|
76
77
|
var colFilterState = formState[colName];
|
|
77
78
|
switch (colFilterState.type) {
|
|
78
79
|
case "string": {
|
|
79
|
-
return (
|
|
80
|
+
return (_jsx(StringFilterRow, { columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName) }, colName));
|
|
80
81
|
}
|
|
81
82
|
case "number": {
|
|
82
|
-
return (
|
|
83
|
+
return (_jsx(NumberFilterRow, { columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName) }, colName));
|
|
83
84
|
}
|
|
84
85
|
default: {
|
|
85
86
|
// date or datetime
|
|
86
|
-
return (
|
|
87
|
+
return (_jsx(DateFilterRow, { includeTime: colFilterState.type === "datetime", columnLabel: colLabel, filterState: colFilterState, setFilterState: getColStateSetter(colName) }, colName));
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
});
|
|
@@ -93,22 +94,6 @@ var FilterOptionsTable = function (_a) {
|
|
|
93
94
|
var editableTableFilterState = convertFilterFormStateToEditableState(formState);
|
|
94
95
|
setFilterState(editableTableFilterState);
|
|
95
96
|
};
|
|
96
|
-
return (
|
|
97
|
-
<table className="table">
|
|
98
|
-
<thead>
|
|
99
|
-
<tr>
|
|
100
|
-
<th>Enabled</th>
|
|
101
|
-
<th>Column</th>
|
|
102
|
-
<th>Type</th>
|
|
103
|
-
<th>Operator</th>
|
|
104
|
-
<th>Value</th>
|
|
105
|
-
</tr>
|
|
106
|
-
</thead>
|
|
107
|
-
<tbody>{getRows()}</tbody>
|
|
108
|
-
</table>
|
|
109
|
-
<button className="btn btn-secondary" type="submit">
|
|
110
|
-
Submit
|
|
111
|
-
</button>
|
|
112
|
-
</form>);
|
|
97
|
+
return (_jsxs("form", { onSubmit: onSubmit, children: [_jsxs("table", { className: "table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Enabled" }), _jsx("th", { children: "Column" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Operator" }), _jsx("th", { children: "Value" })] }) }), _jsx("tbody", { children: getRows() })] }), _jsx("button", { className: "btn btn-secondary", type: "submit", children: "Submit" })] }));
|
|
113
98
|
};
|
|
114
99
|
export default FilterOptionsTable;
|
|
@@ -9,6 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { numberFilterSchemeNames, numberFilterSchemes, } from "../types";
|
|
13
14
|
var NumberFilterRow = function (_a) {
|
|
14
15
|
var columnLabel = _a.columnLabel, filterState = _a.filterState, setFilterState = _a.setFilterState;
|
|
@@ -28,22 +29,6 @@ var NumberFilterRow = function (_a) {
|
|
|
28
29
|
var checkboxLabel = "".concat(columnLabel, " Column Filter Toggle");
|
|
29
30
|
var opSelectLabel = "".concat(columnLabel, " Column Filter Operator Selection");
|
|
30
31
|
var valueInputLabel = "".concat(columnLabel, " Column Filter Value");
|
|
31
|
-
return (
|
|
32
|
-
<td>
|
|
33
|
-
<input name={checkboxLabel} aria-label={checkboxLabel} type="checkbox" checked={enabled} onChange={handleEnabledChange}/>
|
|
34
|
-
</td>
|
|
35
|
-
<td>{columnLabel}</td>
|
|
36
|
-
<td>Number</td>
|
|
37
|
-
<td>
|
|
38
|
-
<select name={opSelectLabel} aria-label={opSelectLabel} disabled={!enabled} className="form-select" value={scheme} onChange={handleOpChange}>
|
|
39
|
-
{numberFilterSchemes.map(function (scheme) { return (<option key={scheme} value={scheme}>
|
|
40
|
-
{numberFilterSchemeNames[scheme]}
|
|
41
|
-
</option>); })}
|
|
42
|
-
</select>
|
|
43
|
-
</td>
|
|
44
|
-
<td>
|
|
45
|
-
<input name={valueInputLabel} aria-label={valueInputLabel} className="form-control" type="number" required={enabled} disabled={!enabled} value={inputValue} onChange={handleNumInputValueChange}/>
|
|
46
|
-
</td>
|
|
47
|
-
</tr>);
|
|
32
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("input", { name: checkboxLabel, "aria-label": checkboxLabel, type: "checkbox", checked: enabled, onChange: handleEnabledChange }) }), _jsx("td", { children: columnLabel }), _jsx("td", { children: "Number" }), _jsx("td", { children: _jsx("select", { name: opSelectLabel, "aria-label": opSelectLabel, disabled: !enabled, className: "form-select", value: scheme, onChange: handleOpChange, children: numberFilterSchemes.map(function (scheme) { return (_jsx("option", { value: scheme, children: numberFilterSchemeNames[scheme] }, scheme)); }) }) }), _jsx("td", { children: _jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: "form-control", type: "number", required: enabled, disabled: !enabled, value: inputValue, onChange: handleNumInputValueChange }) })] }));
|
|
48
33
|
};
|
|
49
34
|
export default NumberFilterRow;
|
|
@@ -9,6 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { stringFilterSchemeNames, stringFilterSchemes, } from "../types";
|
|
13
14
|
var StringFilterRow = function (_a) {
|
|
14
15
|
var columnLabel = _a.columnLabel, filterState = _a.filterState, setFilterState = _a.setFilterState;
|
|
@@ -28,22 +29,6 @@ var StringFilterRow = function (_a) {
|
|
|
28
29
|
var checkboxLabel = "".concat(columnLabel, " Column Filter Toggle");
|
|
29
30
|
var opSelectLabel = "".concat(columnLabel, " Column Filter Operator Selection");
|
|
30
31
|
var valueInputLabel = "".concat(columnLabel, " Column Filter Value");
|
|
31
|
-
return (
|
|
32
|
-
<td>
|
|
33
|
-
<input name={checkboxLabel} aria-label={checkboxLabel} type="checkbox" checked={enabled} onChange={handleEnabledChange}/>
|
|
34
|
-
</td>
|
|
35
|
-
<td>{columnLabel}</td>
|
|
36
|
-
<td>String</td>
|
|
37
|
-
<td>
|
|
38
|
-
<select name={opSelectLabel} aria-label={opSelectLabel} disabled={!enabled} className="form-select" value={scheme} onChange={handleOpChange}>
|
|
39
|
-
{stringFilterSchemes.map(function (scheme) { return (<option key={scheme} value={scheme}>
|
|
40
|
-
{stringFilterSchemeNames[scheme]}
|
|
41
|
-
</option>); })}
|
|
42
|
-
</select>
|
|
43
|
-
</td>
|
|
44
|
-
<td>
|
|
45
|
-
<input name={valueInputLabel} aria-label={valueInputLabel} className="form-control" required={enabled} disabled={!enabled} value={searchString} onChange={handleSearchStringChange}/>
|
|
46
|
-
</td>
|
|
47
|
-
</tr>);
|
|
32
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("input", { name: checkboxLabel, "aria-label": checkboxLabel, type: "checkbox", checked: enabled, onChange: handleEnabledChange }) }), _jsx("td", { children: columnLabel }), _jsx("td", { children: "String" }), _jsx("td", { children: _jsx("select", { name: opSelectLabel, "aria-label": opSelectLabel, disabled: !enabled, className: "form-select", value: scheme, onChange: handleOpChange, children: stringFilterSchemes.map(function (scheme) { return (_jsx("option", { value: scheme, children: stringFilterSchemeNames[scheme] }, scheme)); }) }) }), _jsx("td", { children: _jsx("input", { name: valueInputLabel, "aria-label": valueInputLabel, className: "form-control", required: enabled, disabled: !enabled, value: searchString, onChange: handleSearchStringChange }) })] }));
|
|
48
33
|
};
|
|
49
34
|
export default StringFilterRow;
|
package/{Grid.jsx → Grid.js}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useMemo, useState } from "react";
|
|
3
4
|
import ColHeaderCell from "./ColHeaderCell";
|
|
4
5
|
import useFilter from "./hooks/useFilter";
|
|
@@ -124,48 +125,24 @@ var Grid = function (_a) {
|
|
|
124
125
|
// Once this component implements selection state, and if such interactivity is enabled, (conditionally) change the
|
|
125
126
|
// aria role to "grid".
|
|
126
127
|
// TODO: implement the above described features: conditionally changing aria role to grid
|
|
127
|
-
return (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
setSortOrder: function (order) {
|
|
147
|
-
sortModel.setSortColDef(order && { name: name, order: order });
|
|
148
|
-
},
|
|
149
|
-
}
|
|
150
|
-
: undefined;
|
|
151
|
-
return (<ColHeaderCell key={name} label={label} sortModel={colSortModel} ariaColIndex={index + 1 + (showSelectCol ? 1 : 0)}/>);
|
|
152
|
-
})}
|
|
153
|
-
</tr>
|
|
154
|
-
</thead>
|
|
155
|
-
<tbody>
|
|
156
|
-
{displayRows.map(function (row, index) { return (<tr onClick={getRowClickHandler(row.origIndex)} className={classNames({
|
|
157
|
-
"table-active": selectedSet.has(row.origIndex),
|
|
158
|
-
})} key={row.origIndex} aria-rowindex={index + 2} data-rowindex={row.origIndex} aria-selected={getAriaSelectedValue(row.origIndex)}>
|
|
159
|
-
{showSelectCol && (<td>
|
|
160
|
-
<SelectionInput selected={selectedSet.has(row.origIndex)} selectionInputModel={getSelectInputModel(row.origIndex, selectModel)} selectCallback={getSelectHandler(row.origIndex)}/>
|
|
161
|
-
</td>)}
|
|
162
|
-
{row.contents.map(function (value, index) { return (<td key={index} aria-colindex={index + 1 + (showSelectCol ? 1 : 0)}>
|
|
163
|
-
{value}
|
|
164
|
-
</td>); })}
|
|
165
|
-
</tr>); })}
|
|
166
|
-
</tbody>
|
|
167
|
-
</table>
|
|
168
|
-
{pagination && (<Pagination componentSize={pagination.componentSize || "medium"} pageSizeOptions={pagination.pageSizeOptions} pageSizeIndex={pagination.pageSizeIndex} handleSetPageSizeIndex={pagination.setPageSizeIndex} handleSetPageNum={pagination.setCurrentPage} prePagingNumRows={sortedRows.length} maxPageButtons={pagination.maxPageButtons} currentPage={pagination.currentPage}/>)}
|
|
169
|
-
</div>);
|
|
128
|
+
return (_jsxs("div", { children: [filterState && filterModel && (_jsxs("div", { children: [_jsx(ToggleButton, { isActive: filterOptionsVisible, label: "".concat(filterOptionsVisible ? "Hide" : "Show ", " Filter Options"), onClick: handleToggleFilterOptions }), filterOptionsVisible && (_jsx(FilterOptionsTable, { filterState: filterState, setFilterState: filterModel.setTableFilterState }))] })), _jsxs("table", { className: classNames("table", {
|
|
129
|
+
"table-hover": rowsAreSelectable,
|
|
130
|
+
}), "aria-rowcount": filteredRows.length + 1, children: [_jsx("thead", { children: _jsxs("tr", { "aria-rowindex": 1, children: [showSelectCol && (_jsx(SelectAllHeaderCell, { selectType: selectModel.type, onClick: selectAllOnClick, selectionExists: selectionExists })), cols.map(function (_a, index) {
|
|
131
|
+
var _b;
|
|
132
|
+
var name = _a.name, label = _a.label, sortable = _a.sortable;
|
|
133
|
+
var colSortModel = sortModel && sortable
|
|
134
|
+
? {
|
|
135
|
+
sortOrder: ((_b = sortModel.sortColDef) === null || _b === void 0 ? void 0 : _b.name) === name
|
|
136
|
+
? sortModel.sortColDef.order
|
|
137
|
+
: null,
|
|
138
|
+
setSortOrder: function (order) {
|
|
139
|
+
sortModel.setSortColDef(order && { name: name, order: order });
|
|
140
|
+
},
|
|
141
|
+
}
|
|
142
|
+
: undefined;
|
|
143
|
+
return (_jsx(ColHeaderCell, { label: label, sortModel: colSortModel, ariaColIndex: index + 1 + (showSelectCol ? 1 : 0) }, name));
|
|
144
|
+
})] }) }), _jsx("tbody", { children: displayRows.map(function (row, index) { return (_jsxs("tr", { onClick: getRowClickHandler(row.origIndex), className: classNames({
|
|
145
|
+
"table-active": selectedSet.has(row.origIndex),
|
|
146
|
+
}), "aria-rowindex": index + 2, "data-rowindex": row.origIndex, "aria-selected": getAriaSelectedValue(row.origIndex), children: [showSelectCol && (_jsx("td", { children: _jsx(SelectionInput, { selected: selectedSet.has(row.origIndex), selectionInputModel: getSelectInputModel(row.origIndex, selectModel), selectCallback: getSelectHandler(row.origIndex) }) })), row.contents.map(function (value, index) { return (_jsx("td", { "aria-colindex": index + 1 + (showSelectCol ? 1 : 0), children: value }, index)); })] }, row.origIndex)); }) })] }), pagination && (_jsx(Pagination, { componentSize: pagination.componentSize || "medium", pageSizeOptions: pagination.pageSizeOptions, pageSizeIndex: pagination.pageSizeIndex, handleSetPageSizeIndex: pagination.setPageSizeIndex, handleSetPageNum: pagination.setCurrentPage, prePagingNumRows: sortedRows.length, maxPageButtons: pagination.maxPageButtons, currentPage: pagination.currentPage }))] }));
|
|
170
147
|
};
|
|
171
148
|
export default Grid;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import classNames from "classnames";
|
|
3
4
|
var ToggleButton = function (_a) {
|
|
4
5
|
var isActive = _a.isActive, label = _a.label, onClick = _a.onClick;
|
|
@@ -6,8 +7,6 @@ var ToggleButton = function (_a) {
|
|
|
6
7
|
var variableClasses = {
|
|
7
8
|
active: isActive,
|
|
8
9
|
};
|
|
9
|
-
return (
|
|
10
|
-
{label}
|
|
11
|
-
</button>);
|
|
10
|
+
return (_jsx("button", { type: "button", className: classNames(baseClasses, variableClasses), "aria-pressed": isActive, onClick: onClick, children: label }));
|
|
12
11
|
};
|
|
13
12
|
export default ToggleButton;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const arrowPlaceholder: import("react").JSX.Element;
|
|
1
|
+
declare const arrowPlaceholder: import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default arrowPlaceholder;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Temporary solution to prevent column widths from changing when hovering over
|
|
3
|
+
// columns with a mouse.
|
|
4
|
+
// More ideal permanent solution would be to fix column widths based on preset
|
|
5
|
+
// values.
|
|
6
|
+
var arrowPlaceholder = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: _jsx("desc", { children: "Empty transparent square for styling purposes" }) }));
|
|
7
|
+
export default arrowPlaceholder;
|
package/icons/deselectAll.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const deselectAll: import("react").JSX.Element;
|
|
1
|
+
declare const deselectAll: import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default deselectAll;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
var deselectAll = (_jsxs("svg", { className: "rdbg-svg-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "16", height: "16", fill: "currentColor", children: [_jsx("desc", { children: "Minus sign inside a square" }), _jsx("rect", { className: "rdbg-svg-icon-foreground", x: "3.5", y: "7.5", width: "9", height: "1" })] }));
|
|
3
|
+
export default deselectAll;
|
package/icons/downArrow.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const downArrow: import("react").JSX.Element;
|
|
1
|
+
declare const downArrow: import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default downArrow;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
var downArrow = (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16", children: [_jsx("title", { children: "(sorted descending)" }), _jsx("desc", { children: "Down arrow indicating that the column is being sorted in an descending manner" }), _jsx("path", { fillRule: "evenodd", d: "M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1" })] }));
|
|
3
|
+
export default downArrow;
|
package/icons/selectAll.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const selectAll: import("react").JSX.Element;
|
|
1
|
+
declare const selectAll: import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default selectAll;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
var selectAll = (_jsxs("svg", { className: "rdbg-svg-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "16", height: "16", fill: "currentColor", children: [_jsx("desc", { children: "Plus sign inside a square" }), _jsx("rect", { className: "rdbg-svg-icon-foreground", x: "3.5", y: "7.5", width: "9", height: "1" }), _jsx("rect", { className: "rdbg-svg-icon-foreground", x: "3.5", y: "7.5", width: "9", height: "1", transform: "translate(0 16) rotate(-90)" })] }));
|
|
3
|
+
export default selectAll;
|
package/icons/upArrow.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const upArrow: (grayed: boolean) => import("react").JSX.Element;
|
|
1
|
+
declare const upArrow: (grayed: boolean) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default upArrow;
|
package/icons/upArrow.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import classNames from "classnames";
|
|
12
|
+
var upArrow = function (grayed) { return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", className: classNames(__spreadArray([], (grayed ? ["text-body-secondary"] : []), true)), viewBox: "0 0 16 16", children: [!grayed && (_jsxs(_Fragment, { children: [_jsx("title", { children: "(sorted ascending)" }), _jsx("desc", { children: "Up arrow indicating that the column is being sorted in an ascending manner" })] })), _jsx("path", { fillRule: "evenodd", d: "M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5" })] })); };
|
|
13
|
+
export default upArrow;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absreim/react-bootstrap-data-grid",
|
|
3
3
|
"description": "Data grid UI component for use with web apps using React and Bootstrap",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Brook Li",
|
|
7
7
|
"homepage": "https://react-bootstrap-data-grid.vercel.app/",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useMemo } from "react";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
/**
|
|
@@ -47,73 +48,45 @@ var PageSelector = function (_a) {
|
|
|
47
48
|
if (lowerBound === 1) {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
|
-
return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}}>
|
|
55
|
-
<span aria-hidden="true"><<</span>
|
|
56
|
-
</a>
|
|
57
|
-
</li>);
|
|
51
|
+
return (_jsx("li", { className: "page-item", children: _jsx("a", { className: "page-link", href: "#", "aria-label": "First", onClick: function (event) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
setPageNum(1);
|
|
54
|
+
}, children: _jsx("span", { "aria-hidden": "true", children: "<<" }) }) }));
|
|
58
55
|
}
|
|
59
56
|
function getPrevArrowButton() {
|
|
60
57
|
if (pageNum === 1) {
|
|
61
58
|
return null;
|
|
62
59
|
}
|
|
63
|
-
return (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}}>
|
|
68
|
-
<span aria-hidden="true"><</span>
|
|
69
|
-
</a>
|
|
70
|
-
</li>);
|
|
60
|
+
return (_jsx("li", { className: "page-item", children: _jsx("a", { className: "page-link", href: "#", "aria-label": "Previous", onClick: function (event) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
setPageNum(pageNum - 1);
|
|
63
|
+
}, children: _jsx("span", { "aria-hidden": "true", children: "<" }) }) }));
|
|
71
64
|
}
|
|
72
65
|
function getNextArrowButton() {
|
|
73
66
|
if (pageNum === numPages) {
|
|
74
67
|
return null;
|
|
75
68
|
}
|
|
76
|
-
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}}>
|
|
81
|
-
<span aria-hidden="true">></span>
|
|
82
|
-
</a>
|
|
83
|
-
</li>);
|
|
69
|
+
return (_jsx("li", { className: "page-item", children: _jsx("a", { className: "page-link", href: "#", "aria-label": "Next", onClick: function (event) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
setPageNum(pageNum + 1);
|
|
72
|
+
}, children: _jsx("span", { "aria-hidden": "true", children: ">" }) }) }));
|
|
84
73
|
}
|
|
85
74
|
function getLastArrowButton() {
|
|
86
75
|
if (upperBound === numPages) {
|
|
87
76
|
return null;
|
|
88
77
|
}
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}}>
|
|
94
|
-
<span aria-hidden="true">>></span>
|
|
95
|
-
</a>
|
|
96
|
-
</li>);
|
|
78
|
+
return (_jsx("li", { className: "page-item", children: _jsx("a", { className: "page-link", href: "#", "aria-label": "Last", onClick: function (event) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
setPageNum(numPages);
|
|
81
|
+
}, children: _jsx("span", { "aria-hidden": "true", children: ">>" }) }) }));
|
|
97
82
|
}
|
|
98
|
-
var indexButtons = buttonIndices.map(function (buttonIndex) { return (
|
|
83
|
+
var indexButtons = buttonIndices.map(function (buttonIndex) { return (_jsx("li", { className: classNames({
|
|
99
84
|
"page-item": true,
|
|
100
85
|
active: pageNum === buttonIndex,
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{buttonIndex}
|
|
107
|
-
</a>
|
|
108
|
-
</li>); });
|
|
109
|
-
return (<nav aria-label={ariaLabel}>
|
|
110
|
-
<ul className={classNames(ulClasses)}>
|
|
111
|
-
{getFirstArrowButton()}
|
|
112
|
-
{getPrevArrowButton()}
|
|
113
|
-
{indexButtons}
|
|
114
|
-
{getNextArrowButton()}
|
|
115
|
-
{getLastArrowButton()}
|
|
116
|
-
</ul>
|
|
117
|
-
</nav>);
|
|
86
|
+
}), "aria-current": pageNum === buttonIndex ? "page" : undefined, children: _jsx("a", { className: "page-link", href: "#", onClick: function (event) {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
setPageNum(buttonIndex);
|
|
89
|
+
}, children: buttonIndex }) }, buttonIndex)); });
|
|
90
|
+
return (_jsx("nav", { "aria-label": ariaLabel, children: _jsxs("ul", { className: classNames(ulClasses), children: [getFirstArrowButton(), getPrevArrowButton(), indexButtons, getNextArrowButton(), getLastArrowButton()] }) }));
|
|
118
91
|
};
|
|
119
92
|
export default PageSelector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
var PageSizeSelector = function (_a) {
|
|
4
|
+
var componentSize = _a.componentSize, pageSizeOptions = _a.pageSizeOptions, pageSizeIndex = _a.pageSizeIndex, handleSetPageSize = _a.handleSetPageSize;
|
|
5
|
+
var onChange = function (event) {
|
|
6
|
+
var pageSizeIndex = Number(event.target.value);
|
|
7
|
+
handleSetPageSize(pageSizeIndex);
|
|
8
|
+
};
|
|
9
|
+
return (_jsx("div", { children: _jsx("select", { className: classNames({
|
|
10
|
+
"form-select": true,
|
|
11
|
+
"form-select-lg": componentSize === "large",
|
|
12
|
+
"form-select-sm": componentSize === "small",
|
|
13
|
+
}), value: pageSizeIndex, "aria-label": "Number of Rows per Page", onChange: onChange, children: pageSizeOptions.map(function (numRows, index) { return (_jsx("option", { value: index, children: numRows }, index)); }) }) }));
|
|
14
|
+
};
|
|
15
|
+
export default PageSizeSelector;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import PageSizeSelector from "./PageSizeSelector";
|
|
2
3
|
import PageSelector from "./PageSelector";
|
|
3
4
|
var Pagination = function (_a) {
|
|
@@ -14,9 +15,6 @@ var Pagination = function (_a) {
|
|
|
14
15
|
handleSetPageNum(maxPages);
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
|
-
return (
|
|
18
|
-
<PageSizeSelector componentSize={componentSize} pageSizeOptions={pageSizeOptions} pageSizeIndex={pageSizeIndex} handleSetPageSize={pageIndexAwarePageSizeSetter}/>
|
|
19
|
-
<PageSelector numPages={numPages} pageNum={currentPage} numButtons={maxPageButtons} setPageNum={handleSetPageNum} size={componentSize}/>
|
|
20
|
-
</div>);
|
|
18
|
+
return (_jsxs("div", { className: "d-flex justify-content-end gap-2", children: [_jsx(PageSizeSelector, { componentSize: componentSize, pageSizeOptions: pageSizeOptions, pageSizeIndex: pageSizeIndex, handleSetPageSize: pageIndexAwarePageSizeSetter }), _jsx(PageSelector, { numPages: numPages, pageNum: currentPage, numButtons: maxPageButtons, setPageNum: handleSetPageNum, size: componentSize })] }));
|
|
21
19
|
};
|
|
22
20
|
export default Pagination;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import deselectAll from "../icons/deselectAll";
|
|
2
3
|
import selectAll from "../icons/selectAll";
|
|
3
4
|
import arrowPlaceholder from "../icons/arrowPlaceholder";
|
|
@@ -33,10 +34,8 @@ var SelectAllHeaderCell = function (_a) {
|
|
|
33
34
|
var onClick = _a.onClick, selectType = _a.selectType, selectionExists = _a.selectionExists;
|
|
34
35
|
var disabled = selectType === "single" && !selectionExists;
|
|
35
36
|
var description = getCellAriaDescription(selectType, selectionExists);
|
|
36
|
-
return (
|
|
37
|
-
"
|
|
38
|
-
})
|
|
39
|
-
{getSelectIcon(selectType, selectionExists)}
|
|
40
|
-
</th>);
|
|
37
|
+
return (_jsx("th", { "aria-colindex": 1, title: description, "aria-description": description, className: classNames("rbdg-select-header-cell", "btn-primary", {
|
|
38
|
+
"rbdg-clickable-grid-header-cell": !disabled,
|
|
39
|
+
}), onClick: onClick, children: getSelectIcon(selectType, selectionExists) }));
|
|
41
40
|
};
|
|
42
41
|
export default SelectAllHeaderCell;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
var SelectionInput = function (_a) {
|
|
2
3
|
var selectionInputModel = _a.selectionInputModel, selected = _a.selected, selectCallback = _a.selectCallback;
|
|
3
4
|
var type = selectionInputModel.type;
|
|
@@ -14,8 +15,8 @@ var SelectionInput = function (_a) {
|
|
|
14
15
|
selectCallback();
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
|
-
return (
|
|
18
|
+
return (_jsx("input", { "aria-description": "input to select the current row", onClick: function (event) {
|
|
18
19
|
event.stopPropagation();
|
|
19
|
-
}
|
|
20
|
+
}, type: type, checked: selected, onChange: onChange, name: selectionInputModel.name }));
|
|
20
21
|
};
|
|
21
22
|
export default SelectionInput;
|
package/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.rbdg-clickable-grid-header-cell{cursor:pointer}.rbdg-select-header-cell .rdbg-svg-icon{background-color:var(--bs-btn-bg)}.rbdg-select-header-cell .rdbg-svg-icon-foreground{color:var(--bs-btn-color)}.rbdg-select-header-cell:hover .rdbg-svg-icon{background-color:var(--bs-btn-hover-bg)}.rbdg-select-header-cell:hover .rdbg-svg-icon-foreground{color:var(--bs-btn-hover-color)}.rbdg-grid{display:table}.rbdg-grid-head{display:table-header-group}.rbdg-grid-body{display:table-row-group}.rbdg-grid-row{display:table-row}.rbdg-grid-cell{display:table-cell}
|
package/style.scss
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.rbdg-clickable-grid-header-cell {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rbdg-select-header-cell {
|
|
6
|
+
.rdbg-svg-icon {
|
|
7
|
+
background-color: var(--bs-btn-bg)
|
|
8
|
+
}
|
|
9
|
+
.rdbg-svg-icon-foreground {
|
|
10
|
+
color: var(--bs-btn-color)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
.rdbg-svg-icon {
|
|
15
|
+
background-color: var(--bs-btn-hover-bg)
|
|
16
|
+
}
|
|
17
|
+
.rdbg-svg-icon-foreground {
|
|
18
|
+
color: var(--bs-btn-hover-color)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rbdg-grid {
|
|
24
|
+
display: table;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rbdg-grid-head {
|
|
28
|
+
display: table-header-group;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rbdg-grid-body {
|
|
32
|
+
display: table-row-group;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rbdg-grid-row {
|
|
36
|
+
display: table-row;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rbdg-grid-cell {
|
|
40
|
+
display: table-cell;
|
|
41
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Temporary solution to prevent column widths from changing when hovering over
|
|
2
|
-
// columns with a mouse.
|
|
3
|
-
// More ideal permanent solution would be to fix column widths based on preset
|
|
4
|
-
// values.
|
|
5
|
-
var arrowPlaceholder = (<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
|
6
|
-
<desc>
|
|
7
|
-
Empty transparent square for styling purposes
|
|
8
|
-
</desc>
|
|
9
|
-
</svg>);
|
|
10
|
-
export default arrowPlaceholder;
|
package/icons/deselectAll.jsx
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var deselectAll = (<svg className="svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor">
|
|
2
|
-
<desc>Minus sign inside a square</desc>
|
|
3
|
-
<rect className="svg-icon-foreground" x="3.5" y="7.5" width="9" height="1"/>
|
|
4
|
-
</svg>);
|
|
5
|
-
export default deselectAll;
|
package/icons/downArrow.jsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var downArrow = (<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
|
2
|
-
<title>(sorted descending)</title>
|
|
3
|
-
<desc>
|
|
4
|
-
Down arrow indicating that the column is being sorted in an descending
|
|
5
|
-
manner
|
|
6
|
-
</desc>
|
|
7
|
-
<path fillRule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/>
|
|
8
|
-
</svg>);
|
|
9
|
-
export default downArrow;
|
package/icons/selectAll.jsx
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var selectAll = (<svg className="svg-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor">
|
|
2
|
-
<desc>Plus sign inside a square</desc>
|
|
3
|
-
<rect className="svg-icon-foreground" x="3.5" y="7.5" width="9" height="1"/>
|
|
4
|
-
<rect className="svg-icon-foreground" x="3.5" y="7.5" width="9" height="1" transform="translate(0 16) rotate(-90)"/>
|
|
5
|
-
</svg>);
|
|
6
|
-
export default selectAll;
|
package/icons/upArrow.jsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import classNames from "classnames";
|
|
11
|
-
var upArrow = function (grayed) { return (<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className={classNames(__spreadArray([], (grayed ? ["text-body-secondary"] : []), true))} viewBox="0 0 16 16">
|
|
12
|
-
{!grayed && (<>
|
|
13
|
-
<title>(sorted ascending)</title>
|
|
14
|
-
<desc>
|
|
15
|
-
Up arrow indicating that the column is being sorted in an ascending
|
|
16
|
-
manner
|
|
17
|
-
</desc>
|
|
18
|
-
</>)}
|
|
19
|
-
<path fillRule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"/>
|
|
20
|
-
</svg>); };
|
|
21
|
-
export default upArrow;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
var PageSizeSelector = function (_a) {
|
|
3
|
-
var componentSize = _a.componentSize, pageSizeOptions = _a.pageSizeOptions, pageSizeIndex = _a.pageSizeIndex, handleSetPageSize = _a.handleSetPageSize;
|
|
4
|
-
var onChange = function (event) {
|
|
5
|
-
var pageSizeIndex = Number(event.target.value);
|
|
6
|
-
handleSetPageSize(pageSizeIndex);
|
|
7
|
-
};
|
|
8
|
-
return (<div>
|
|
9
|
-
<select className={classNames({
|
|
10
|
-
"form-select": true,
|
|
11
|
-
"form-select-lg": componentSize === "large",
|
|
12
|
-
"form-select-sm": componentSize === "small",
|
|
13
|
-
})} value={pageSizeIndex} aria-label="Number of Rows per Page" onChange={onChange}>
|
|
14
|
-
{pageSizeOptions.map(function (numRows, index) { return (<option key={index} value={index}>
|
|
15
|
-
{numRows}
|
|
16
|
-
</option>); })}
|
|
17
|
-
</select>
|
|
18
|
-
</div>);
|
|
19
|
-
};
|
|
20
|
-
export default PageSizeSelector;
|
|
File without changes
|