@prairielearn/ui 1.9.0 → 1.10.0
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 +17 -0
- package/dist/components/CategoricalColumnFilter.d.ts.map +1 -1
- package/dist/components/CategoricalColumnFilter.js +4 -4
- package/dist/components/CategoricalColumnFilter.js.map +1 -1
- package/dist/components/ColumnManager.js +7 -7
- package/dist/components/ColumnManager.js.map +1 -1
- package/dist/components/MultiSelectColumnFilter.js +2 -2
- package/dist/components/MultiSelectColumnFilter.js.map +1 -1
- package/dist/components/NumericInputColumnFilter.d.ts.map +1 -1
- package/dist/components/NumericInputColumnFilter.js +5 -9
- package/dist/components/NumericInputColumnFilter.js.map +1 -1
- package/dist/components/PresetFilterDropdown.js +3 -3
- package/dist/components/PresetFilterDropdown.js.map +1 -1
- package/dist/components/TanstackTable.js +13 -13
- package/dist/components/TanstackTable.js.map +1 -1
- package/dist/components/TanstackTableDownloadButton.js +1 -1
- package/dist/components/TanstackTableDownloadButton.js.map +1 -1
- package/dist/components/TanstackTableHeaderCell.js +8 -8
- package/dist/components/TanstackTableHeaderCell.js.map +1 -1
- package/dist/components/useAutoSizeColumns.js +1 -1
- package/dist/components/useAutoSizeColumns.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CategoricalColumnFilter.tsx +25 -22
- package/src/components/ColumnManager.tsx +19 -19
- package/src/components/MultiSelectColumnFilter.tsx +12 -12
- package/src/components/NumericInputColumnFilter.tsx +13 -16
- package/src/components/PresetFilterDropdown.tsx +3 -3
- package/src/components/TanstackTable.tsx +25 -25
- package/src/components/TanstackTableDownloadButton.tsx +11 -11
- package/src/components/TanstackTableHeaderCell.tsx +11 -11
- package/src/components/useAutoSizeColumns.tsx +1 -1
|
@@ -5,11 +5,11 @@ import type { JSX } from 'preact/jsx-runtime';
|
|
|
5
5
|
|
|
6
6
|
function SortIcon({ sortMethod }: { sortMethod: false | SortDirection }) {
|
|
7
7
|
if (sortMethod === 'asc') {
|
|
8
|
-
return <i
|
|
8
|
+
return <i className="bi bi-sort-up-alt" aria-hidden="true" />;
|
|
9
9
|
} else if (sortMethod === 'desc') {
|
|
10
|
-
return <i
|
|
10
|
+
return <i className="bi bi-sort-down" aria-hidden="true" />;
|
|
11
11
|
} else {
|
|
12
|
-
return <i
|
|
12
|
+
return <i className="bi bi-arrow-down-up opacity-75 text-muted" aria-hidden="true" />;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -50,7 +50,7 @@ function ResizeHandle<RowDataModel>({
|
|
|
50
50
|
: header.column.id;
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<div
|
|
53
|
+
<div className="py-1 h-100" style={{ position: 'absolute', right: 0, top: 0, width: '4px' }}>
|
|
54
54
|
{/* separator role is focusable, so these jsx-a11y-x rules are false positives.
|
|
55
55
|
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/separator_role#focusable_separator
|
|
56
56
|
*/}
|
|
@@ -65,7 +65,7 @@ function ResizeHandle<RowDataModel>({
|
|
|
65
65
|
aria-valuenow={header.getSize()}
|
|
66
66
|
// eslint-disable-next-line jsx-a11y-x/no-noninteractive-tabindex
|
|
67
67
|
tabIndex={0}
|
|
68
|
-
|
|
68
|
+
className="h-100"
|
|
69
69
|
style={{
|
|
70
70
|
background: header.column.getIsResizing() ? 'var(--bs-primary)' : 'var(--bs-gray-400)',
|
|
71
71
|
cursor: 'col-resize',
|
|
@@ -139,13 +139,13 @@ export function TanstackTableHeaderCell<RowDataModel>({
|
|
|
139
139
|
<th
|
|
140
140
|
key={header.id}
|
|
141
141
|
data-column-id={header.column.id}
|
|
142
|
-
|
|
142
|
+
className={clsx(isPinned === 'left' && 'bg-light')}
|
|
143
143
|
style={style}
|
|
144
144
|
aria-sort={canSort ? getAriaSort(sortDirection) : undefined}
|
|
145
145
|
role="columnheader"
|
|
146
146
|
>
|
|
147
147
|
<div
|
|
148
|
-
|
|
148
|
+
className={clsx(
|
|
149
149
|
'd-flex align-items-center flex-grow-1',
|
|
150
150
|
isNormalColumn ? 'justify-content-between' : 'justify-content-center',
|
|
151
151
|
)}
|
|
@@ -154,7 +154,7 @@ export function TanstackTableHeaderCell<RowDataModel>({
|
|
|
154
154
|
}}
|
|
155
155
|
>
|
|
156
156
|
<div
|
|
157
|
-
|
|
157
|
+
className={clsx(
|
|
158
158
|
'text-nowrap text-start',
|
|
159
159
|
// e.g. checkboxes
|
|
160
160
|
!isNormalColumn && 'd-flex align-items-center justify-content-center',
|
|
@@ -172,16 +172,16 @@ export function TanstackTableHeaderCell<RowDataModel>({
|
|
|
172
172
|
? null
|
|
173
173
|
: flexRender(header.column.columnDef.header, header.getContext())}
|
|
174
174
|
{canSort && (
|
|
175
|
-
<span
|
|
175
|
+
<span className="visually-hidden">, {getAriaSort(sortDirection)}, click to sort</span>
|
|
176
176
|
)}
|
|
177
177
|
</div>
|
|
178
178
|
|
|
179
179
|
{(canSort || canFilter) && (
|
|
180
|
-
<div
|
|
180
|
+
<div className="d-flex align-items-center" style={{ flexShrink: 0 }}>
|
|
181
181
|
{canSort && (
|
|
182
182
|
<button
|
|
183
183
|
type="button"
|
|
184
|
-
|
|
184
|
+
className="btn btn-link text-muted p-0"
|
|
185
185
|
aria-label={`Sort ${columnName.toLowerCase()}, current sort is ${getAriaSort(sortDirection)}`}
|
|
186
186
|
title={`Sort ${columnName.toLowerCase()}`}
|
|
187
187
|
onClick={header.column.getToggleSortingHandler()}
|
|
@@ -27,7 +27,7 @@ function HiddenMeasurementHeader<TData>({
|
|
|
27
27
|
top: '-9999px',
|
|
28
28
|
}}
|
|
29
29
|
>
|
|
30
|
-
<table
|
|
30
|
+
<table className="table table-hover mb-0" style={{ display: 'grid', tableLayout: 'fixed' }}>
|
|
31
31
|
<thead style={{ display: 'grid' }}>
|
|
32
32
|
<tr style={{ display: 'flex' }}>
|
|
33
33
|
{columnsToMeasure.map((col) => {
|