dce-reactkit 3.2.2-beta.32 → 3.2.2-beta.33
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/dist/cjs/index.js +23 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +23 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/IntelliTable.tsx +5 -1
- package/src/components/LogReviewer.tsx +1 -1
- package/src/helpers/genCSV.ts +18 -1
- package/src/helpers/genRouteHandler.ts +1 -1
package/package.json
CHANGED
|
@@ -272,12 +272,14 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
272
272
|
// Custom info based on current sort type
|
|
273
273
|
let sortButtonAriaLabel;
|
|
274
274
|
let sortIcon = faSort;
|
|
275
|
+
let sortingByThisColumn = false;
|
|
275
276
|
if (!sortColumnParam) {
|
|
276
277
|
// Not being sorted yet
|
|
277
278
|
sortButtonAriaLabel = `sort ascending by ${column.title}`;
|
|
278
279
|
sortIcon = faSort;
|
|
279
280
|
} else if (column.param === sortColumnParam) {
|
|
280
281
|
// Already sorted by this column
|
|
282
|
+
sortingByThisColumn = true;
|
|
281
283
|
if (sortType === SortType.Ascending) {
|
|
282
284
|
// Sorted ascending
|
|
283
285
|
sortButtonAriaLabel = `sort descending by ${column.title}`;
|
|
@@ -299,6 +301,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
299
301
|
key={column.param}
|
|
300
302
|
scope="col"
|
|
301
303
|
id={`IntelliTable-${id}-header-${column.param}`}
|
|
304
|
+
className="text-start"
|
|
302
305
|
>
|
|
303
306
|
<div className="d-flex align-items-center justify-content-center flex-row h-100">
|
|
304
307
|
{/* Title */}
|
|
@@ -309,7 +312,8 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
309
312
|
<div>
|
|
310
313
|
<button
|
|
311
314
|
type="button"
|
|
312
|
-
|
|
315
|
+
id={`IntelliTable-${id}-sort-by-${column.param}-button`}
|
|
316
|
+
className={`btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`}
|
|
313
317
|
aria-label={sortButtonAriaLabel}
|
|
314
318
|
onClick={() => {
|
|
315
319
|
dispatch({
|
package/src/helpers/genCSV.ts
CHANGED
|
@@ -46,7 +46,24 @@ const genCSV = (
|
|
|
46
46
|
csv += (
|
|
47
47
|
columns
|
|
48
48
|
.map((column) => {
|
|
49
|
-
|
|
49
|
+
let contents: string;
|
|
50
|
+
const cell = datum[column.param];
|
|
51
|
+
if (
|
|
52
|
+
typeof cell === 'string'
|
|
53
|
+
|| typeof cell === 'number'
|
|
54
|
+
) {
|
|
55
|
+
contents = String(cell);
|
|
56
|
+
} else if (
|
|
57
|
+
typeof cell === 'undefined'
|
|
58
|
+
|| cell === null
|
|
59
|
+
) {
|
|
60
|
+
contents = '';
|
|
61
|
+
} else if (typeof cell === 'object') {
|
|
62
|
+
contents = JSON.stringify(cell);
|
|
63
|
+
} else {
|
|
64
|
+
contents = '';
|
|
65
|
+
}
|
|
66
|
+
return escapeCellText(contents);
|
|
50
67
|
})
|
|
51
68
|
.join(',')
|
|
52
69
|
);
|