dce-reactkit 3.2.2-beta.33 → 3.2.2-beta.35
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 +56 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +56 -22
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CSVDownloadButton.tsx +1 -1
- package/src/components/IntelliTable.tsx +46 -6
- package/src/components/LogReviewer.tsx +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -2283,7 +2283,8 @@ const CSVDownloadButton = (props) => {
|
|
|
2283
2283
|
? `Click to download ${filename}`
|
|
2284
2284
|
: ariaLabel), style: style, onClick: onClick },
|
|
2285
2285
|
!children && (React.createElement(React.Fragment, null,
|
|
2286
|
-
React.createElement(FontAwesomeIcon, { icon: faCloudDownloadAlt
|
|
2286
|
+
React.createElement(FontAwesomeIcon, { icon: faCloudDownloadAlt }),
|
|
2287
|
+
' ',
|
|
2287
2288
|
"Download CSV")),
|
|
2288
2289
|
children));
|
|
2289
2290
|
};
|
|
@@ -2371,20 +2372,28 @@ const IntelliTable = (props) => {
|
|
|
2371
2372
|
const [state, dispatch] = useReducer(reducer$1, initialState);
|
|
2372
2373
|
// Destructure common state
|
|
2373
2374
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2375
|
+
/*------------------------------------------------------------------------*/
|
|
2376
|
+
/* Render */
|
|
2377
|
+
/*------------------------------------------------------------------------*/
|
|
2378
|
+
/*----------------------------------------*/
|
|
2379
|
+
/* Modal */
|
|
2380
|
+
/*----------------------------------------*/
|
|
2381
|
+
// Modal that may be defined
|
|
2382
|
+
let modal;
|
|
2374
2383
|
/* ------- Col Vis Customization Modal ------ */
|
|
2375
2384
|
if (columnVisibilityCustomizationModalVisible) {
|
|
2376
2385
|
// Create modal
|
|
2377
|
-
(React.createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
|
|
2386
|
+
modal = (React.createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
|
|
2378
2387
|
dispatch({
|
|
2379
2388
|
type: ActionType$1.ToggleColVisCusModalVisibility,
|
|
2380
2389
|
});
|
|
2381
|
-
} }, columns.map((column) => {
|
|
2382
|
-
return (React.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, text: column.title, onChanged: () => {
|
|
2390
|
+
}, okayVariant: Variant$1.Light }, columns.map((column) => {
|
|
2391
|
+
return (React.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: () => {
|
|
2383
2392
|
dispatch({
|
|
2384
2393
|
type: ActionType$1.ToggleColumnVisibility,
|
|
2385
2394
|
param: column.param,
|
|
2386
2395
|
});
|
|
2387
|
-
}, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column
|
|
2396
|
+
}, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
|
|
2388
2397
|
})));
|
|
2389
2398
|
}
|
|
2390
2399
|
/*----------------------------------------*/
|
|
@@ -2425,8 +2434,11 @@ const IntelliTable = (props) => {
|
|
|
2425
2434
|
sortIcon = faSort;
|
|
2426
2435
|
}
|
|
2427
2436
|
// Create the cell UI
|
|
2428
|
-
return (React.createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}`, className: "text-start"
|
|
2429
|
-
|
|
2437
|
+
return (React.createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}`, className: "text-start", style: {
|
|
2438
|
+
borderRight: '0.05rem solid #555',
|
|
2439
|
+
borderLeft: '0.05rem solid #555',
|
|
2440
|
+
} },
|
|
2441
|
+
React.createElement("div", { className: "d-flex align-items-center justify-content-start flex-row h-100" },
|
|
2430
2442
|
React.createElement("span", { className: "text-nowrap" }, column.title),
|
|
2431
2443
|
React.createElement("div", null,
|
|
2432
2444
|
React.createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
|
|
@@ -2449,6 +2461,22 @@ const IntelliTable = (props) => {
|
|
|
2449
2461
|
sortedData.sort((a, b) => {
|
|
2450
2462
|
const aVal = a[sortColumnParam];
|
|
2451
2463
|
const bVal = b[sortColumnParam];
|
|
2464
|
+
// Auto-sort undefined and null to end of list
|
|
2465
|
+
if ((aVal === undefined || aVal === null)
|
|
2466
|
+
|| (bVal === undefined || bVal === null)) {
|
|
2467
|
+
// At least one was undefined
|
|
2468
|
+
if ((aVal === undefined || aVal === null)
|
|
2469
|
+
&& (bVal === undefined || bVal === null)) {
|
|
2470
|
+
// Both undefined
|
|
2471
|
+
return 0;
|
|
2472
|
+
}
|
|
2473
|
+
if (aVal === undefined || aVal === null) {
|
|
2474
|
+
// First was undefined
|
|
2475
|
+
return 1;
|
|
2476
|
+
}
|
|
2477
|
+
// Second was undefined
|
|
2478
|
+
return -1;
|
|
2479
|
+
}
|
|
2452
2480
|
// Sort differently based on the data type
|
|
2453
2481
|
// > Boolean
|
|
2454
2482
|
if (paramType === ParamType$1.Boolean) {
|
|
@@ -2470,10 +2498,10 @@ const IntelliTable = (props) => {
|
|
|
2470
2498
|
// > String
|
|
2471
2499
|
if (paramType === ParamType$1.String) {
|
|
2472
2500
|
if (aVal < bVal) {
|
|
2473
|
-
return (descending ?
|
|
2501
|
+
return (descending ? 1 : -1);
|
|
2474
2502
|
}
|
|
2475
2503
|
if (aVal > bVal) {
|
|
2476
|
-
return (descending ? 1 :
|
|
2504
|
+
return (descending ? -1 : 1);
|
|
2477
2505
|
}
|
|
2478
2506
|
return 0;
|
|
2479
2507
|
}
|
|
@@ -2537,7 +2565,9 @@ const IntelliTable = (props) => {
|
|
|
2537
2565
|
}
|
|
2538
2566
|
else if (column.type === ParamType$1.String) {
|
|
2539
2567
|
fullValue = String(value).trim();
|
|
2540
|
-
const noValue = (
|
|
2568
|
+
const noValue = (value === undefined
|
|
2569
|
+
|| value === null
|
|
2570
|
+
|| String(fullValue).trim().length === 0);
|
|
2541
2571
|
visibleValue = (noValue
|
|
2542
2572
|
? (React.createElement(FontAwesomeIcon, { icon: faMinus }))
|
|
2543
2573
|
: fullValue);
|
|
@@ -2553,7 +2583,10 @@ const IntelliTable = (props) => {
|
|
|
2553
2583
|
: fullValue);
|
|
2554
2584
|
}
|
|
2555
2585
|
// Create UI
|
|
2556
|
-
return (React.createElement("td", { key: `${datum.id}-${column.param}`, title: title
|
|
2586
|
+
return (React.createElement("td", { key: `${datum.id}-${column.param}`, title: title, style: {
|
|
2587
|
+
borderRight: '0.05rem solid #555',
|
|
2588
|
+
borderLeft: '0.05rem solid #555',
|
|
2589
|
+
} }, visibleValue));
|
|
2557
2590
|
}));
|
|
2558
2591
|
// Add cells to a row
|
|
2559
2592
|
return (React.createElement("tr", { key: datum.id }, cells));
|
|
@@ -2573,7 +2606,8 @@ const IntelliTable = (props) => {
|
|
|
2573
2606
|
const csv = genCSV(data, columns);
|
|
2574
2607
|
// Build main UI
|
|
2575
2608
|
return (React.createElement("div", { className: `IntelliTable-container-${id}` },
|
|
2576
|
-
|
|
2609
|
+
modal,
|
|
2610
|
+
React.createElement("div", { className: "d-flex align-items-center justify-content-start" },
|
|
2577
2611
|
React.createElement("h3", { className: "m-0" }, title),
|
|
2578
2612
|
React.createElement("div", { className: "flex-grow-1 text-end" },
|
|
2579
2613
|
React.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: `${title}.csv`, csv: csv }),
|
|
@@ -2589,7 +2623,7 @@ const IntelliTable = (props) => {
|
|
|
2589
2623
|
numHiddenCols,
|
|
2590
2624
|
' ',
|
|
2591
2625
|
"hidden)"))))),
|
|
2592
|
-
React.createElement("div", { className: `IntelliTable-table-${id}`, style: {
|
|
2626
|
+
React.createElement("div", { className: `IntelliTable-table-${id} mt-2`, style: {
|
|
2593
2627
|
overflowX: 'auto',
|
|
2594
2628
|
} }, table)));
|
|
2595
2629
|
};
|
|
@@ -2806,7 +2840,7 @@ const LogReviewer = (props) => {
|
|
|
2806
2840
|
/*------------------------------------------------------------------------*/
|
|
2807
2841
|
/* Setup */
|
|
2808
2842
|
/*------------------------------------------------------------------------*/
|
|
2809
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2843
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2810
2844
|
/* -------------- Props ------------- */
|
|
2811
2845
|
// Destructure props
|
|
2812
2846
|
const { LogMetadata, onClose, } = props;
|
|
@@ -2876,8 +2910,8 @@ const LogReviewer = (props) => {
|
|
|
2876
2910
|
});
|
|
2877
2911
|
// Create initial tag filter state
|
|
2878
2912
|
const initTagFilterState = {};
|
|
2879
|
-
Object.
|
|
2880
|
-
initTagFilterState[
|
|
2913
|
+
Object.keys((_e = LogMetadata.Tag) !== null && _e !== void 0 ? _e : {}).forEach((tag) => {
|
|
2914
|
+
initTagFilterState[tag] = false;
|
|
2881
2915
|
});
|
|
2882
2916
|
// Create advanced filter state
|
|
2883
2917
|
const initAdvancedFilterState = {
|
|
@@ -3176,7 +3210,7 @@ const LogReviewer = (props) => {
|
|
|
3176
3210
|
}
|
|
3177
3211
|
else if (expandedFilterDrawer === FilterDrawer.Tag) {
|
|
3178
3212
|
// Create filter UI
|
|
3179
|
-
filterDrawer = (React.createElement(TabBox, { title: "Tags" }, Object.keys(
|
|
3213
|
+
filterDrawer = (React.createElement(TabBox, { title: "Tags" }, Object.keys((_h = LogMetadata.Tag) !== null && _h !== void 0 ? _h : {})
|
|
3180
3214
|
.map((tag, i) => {
|
|
3181
3215
|
const description = genHumanReadableName(tag);
|
|
3182
3216
|
return (React.createElement(CheckboxButton, { id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, noMarginOnRight: i === Object.keys(tagFilterState).length - 1, checked: tagFilterState[tag], onChanged: (checked) => {
|
|
@@ -3223,8 +3257,8 @@ const LogReviewer = (props) => {
|
|
|
3223
3257
|
} }));
|
|
3224
3258
|
})),
|
|
3225
3259
|
React.createElement(ButtonInputGroup, { label: "Target" },
|
|
3226
|
-
(Object.keys((
|
|
3227
|
-
Object.keys((
|
|
3260
|
+
(Object.keys((_j = LogMetadata.Target) !== null && _j !== void 0 ? _j : {}).length === 0) && (React.createElement("div", null, "This app does not have any targets yet.")),
|
|
3261
|
+
Object.keys((_k = LogMetadata.Target) !== null && _k !== void 0 ? _k : {})
|
|
3228
3262
|
.map((target, i) => {
|
|
3229
3263
|
var _a;
|
|
3230
3264
|
const description = genHumanReadableName(target);
|
|
@@ -3730,13 +3764,13 @@ const LogReviewer = (props) => {
|
|
|
3730
3764
|
type: ParamType$1.Boolean,
|
|
3731
3765
|
},
|
|
3732
3766
|
{
|
|
3733
|
-
title: 'Teaching Staff',
|
|
3767
|
+
title: 'Teaching Staff?',
|
|
3734
3768
|
param: 'isTTM',
|
|
3735
3769
|
type: ParamType$1.Boolean,
|
|
3736
3770
|
startsHidden: true,
|
|
3737
3771
|
},
|
|
3738
3772
|
{
|
|
3739
|
-
title: 'Admin',
|
|
3773
|
+
title: 'Admin?',
|
|
3740
3774
|
param: 'isAdmin',
|
|
3741
3775
|
type: ParamType$1.Boolean,
|
|
3742
3776
|
startsHidden: true,
|
|
@@ -3771,7 +3805,7 @@ const LogReviewer = (props) => {
|
|
|
3771
3805
|
startsHidden: true,
|
|
3772
3806
|
},
|
|
3773
3807
|
{
|
|
3774
|
-
title: 'Mobile',
|
|
3808
|
+
title: 'Mobile?',
|
|
3775
3809
|
param: 'device.isMobile',
|
|
3776
3810
|
type: ParamType$1.Boolean,
|
|
3777
3811
|
startsHidden: true,
|