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 CHANGED
@@ -2291,7 +2291,8 @@ const CSVDownloadButton = (props) => {
2291
2291
  ? `Click to download ${filename}`
2292
2292
  : ariaLabel), style: style, onClick: onClick },
2293
2293
  !children && (React__default["default"].createElement(React__default["default"].Fragment, null,
2294
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCloudDownloadAlt, className: "mr-2" }),
2294
+ React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCloudDownloadAlt }),
2295
+ ' ',
2295
2296
  "Download CSV")),
2296
2297
  children));
2297
2298
  };
@@ -2379,20 +2380,28 @@ const IntelliTable = (props) => {
2379
2380
  const [state, dispatch] = React.useReducer(reducer$1, initialState);
2380
2381
  // Destructure common state
2381
2382
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2383
+ /*------------------------------------------------------------------------*/
2384
+ /* Render */
2385
+ /*------------------------------------------------------------------------*/
2386
+ /*----------------------------------------*/
2387
+ /* Modal */
2388
+ /*----------------------------------------*/
2389
+ // Modal that may be defined
2390
+ let modal;
2382
2391
  /* ------- Col Vis Customization Modal ------ */
2383
2392
  if (columnVisibilityCustomizationModalVisible) {
2384
2393
  // Create modal
2385
- (React__default["default"].createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
2394
+ modal = (React__default["default"].createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
2386
2395
  dispatch({
2387
2396
  type: ActionType$1.ToggleColVisCusModalVisibility,
2388
2397
  });
2389
- } }, columns.map((column) => {
2390
- return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, text: column.title, onChanged: () => {
2398
+ }, okayVariant: Variant$1.Light }, columns.map((column) => {
2399
+ return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: () => {
2391
2400
  dispatch({
2392
2401
  type: ActionType$1.ToggleColumnVisibility,
2393
2402
  param: column.param,
2394
2403
  });
2395
- }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column` }));
2404
+ }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
2396
2405
  })));
2397
2406
  }
2398
2407
  /*----------------------------------------*/
@@ -2433,8 +2442,11 @@ const IntelliTable = (props) => {
2433
2442
  sortIcon = freeSolidSvgIcons.faSort;
2434
2443
  }
2435
2444
  // Create the cell UI
2436
- return (React__default["default"].createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}`, className: "text-start" },
2437
- React__default["default"].createElement("div", { className: "d-flex align-items-center justify-content-center flex-row h-100" },
2445
+ return (React__default["default"].createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}`, className: "text-start", style: {
2446
+ borderRight: '0.05rem solid #555',
2447
+ borderLeft: '0.05rem solid #555',
2448
+ } },
2449
+ React__default["default"].createElement("div", { className: "d-flex align-items-center justify-content-start flex-row h-100" },
2438
2450
  React__default["default"].createElement("span", { className: "text-nowrap" }, column.title),
2439
2451
  React__default["default"].createElement("div", null,
2440
2452
  React__default["default"].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: () => {
@@ -2457,6 +2469,22 @@ const IntelliTable = (props) => {
2457
2469
  sortedData.sort((a, b) => {
2458
2470
  const aVal = a[sortColumnParam];
2459
2471
  const bVal = b[sortColumnParam];
2472
+ // Auto-sort undefined and null to end of list
2473
+ if ((aVal === undefined || aVal === null)
2474
+ || (bVal === undefined || bVal === null)) {
2475
+ // At least one was undefined
2476
+ if ((aVal === undefined || aVal === null)
2477
+ && (bVal === undefined || bVal === null)) {
2478
+ // Both undefined
2479
+ return 0;
2480
+ }
2481
+ if (aVal === undefined || aVal === null) {
2482
+ // First was undefined
2483
+ return 1;
2484
+ }
2485
+ // Second was undefined
2486
+ return -1;
2487
+ }
2460
2488
  // Sort differently based on the data type
2461
2489
  // > Boolean
2462
2490
  if (paramType === ParamType$1.Boolean) {
@@ -2478,10 +2506,10 @@ const IntelliTable = (props) => {
2478
2506
  // > String
2479
2507
  if (paramType === ParamType$1.String) {
2480
2508
  if (aVal < bVal) {
2481
- return (descending ? -1 : 1);
2509
+ return (descending ? 1 : -1);
2482
2510
  }
2483
2511
  if (aVal > bVal) {
2484
- return (descending ? 1 : -1);
2512
+ return (descending ? -1 : 1);
2485
2513
  }
2486
2514
  return 0;
2487
2515
  }
@@ -2545,7 +2573,9 @@ const IntelliTable = (props) => {
2545
2573
  }
2546
2574
  else if (column.type === ParamType$1.String) {
2547
2575
  fullValue = String(value).trim();
2548
- const noValue = (String(fullValue).trim().length === 0);
2576
+ const noValue = (value === undefined
2577
+ || value === null
2578
+ || String(fullValue).trim().length === 0);
2549
2579
  visibleValue = (noValue
2550
2580
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2551
2581
  : fullValue);
@@ -2561,7 +2591,10 @@ const IntelliTable = (props) => {
2561
2591
  : fullValue);
2562
2592
  }
2563
2593
  // Create UI
2564
- return (React__default["default"].createElement("td", { key: `${datum.id}-${column.param}`, title: title }, visibleValue));
2594
+ return (React__default["default"].createElement("td", { key: `${datum.id}-${column.param}`, title: title, style: {
2595
+ borderRight: '0.05rem solid #555',
2596
+ borderLeft: '0.05rem solid #555',
2597
+ } }, visibleValue));
2565
2598
  }));
2566
2599
  // Add cells to a row
2567
2600
  return (React__default["default"].createElement("tr", { key: datum.id }, cells));
@@ -2581,7 +2614,8 @@ const IntelliTable = (props) => {
2581
2614
  const csv = genCSV(data, columns);
2582
2615
  // Build main UI
2583
2616
  return (React__default["default"].createElement("div", { className: `IntelliTable-container-${id}` },
2584
- React__default["default"].createElement("div", { className: "d-flex align-items-center justify-content-center" },
2617
+ modal,
2618
+ React__default["default"].createElement("div", { className: "d-flex align-items-center justify-content-start" },
2585
2619
  React__default["default"].createElement("h3", { className: "m-0" }, title),
2586
2620
  React__default["default"].createElement("div", { className: "flex-grow-1 text-end" },
2587
2621
  React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: `${title}.csv`, csv: csv }),
@@ -2597,7 +2631,7 @@ const IntelliTable = (props) => {
2597
2631
  numHiddenCols,
2598
2632
  ' ',
2599
2633
  "hidden)"))))),
2600
- React__default["default"].createElement("div", { className: `IntelliTable-table-${id}`, style: {
2634
+ React__default["default"].createElement("div", { className: `IntelliTable-table-${id} mt-2`, style: {
2601
2635
  overflowX: 'auto',
2602
2636
  } }, table)));
2603
2637
  };
@@ -2814,7 +2848,7 @@ const LogReviewer = (props) => {
2814
2848
  /*------------------------------------------------------------------------*/
2815
2849
  /* Setup */
2816
2850
  /*------------------------------------------------------------------------*/
2817
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2851
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2818
2852
  /* -------------- Props ------------- */
2819
2853
  // Destructure props
2820
2854
  const { LogMetadata, onClose, } = props;
@@ -2884,8 +2918,8 @@ const LogReviewer = (props) => {
2884
2918
  });
2885
2919
  // Create initial tag filter state
2886
2920
  const initTagFilterState = {};
2887
- Object.values((_e = LogMetadata.Tag) !== null && _e !== void 0 ? _e : {}).forEach((tagValue) => {
2888
- initTagFilterState[tagValue] = false;
2921
+ Object.keys((_e = LogMetadata.Tag) !== null && _e !== void 0 ? _e : {}).forEach((tag) => {
2922
+ initTagFilterState[tag] = false;
2889
2923
  });
2890
2924
  // Create advanced filter state
2891
2925
  const initAdvancedFilterState = {
@@ -3184,7 +3218,7 @@ const LogReviewer = (props) => {
3184
3218
  }
3185
3219
  else if (expandedFilterDrawer === FilterDrawer.Tag) {
3186
3220
  // Create filter UI
3187
- filterDrawer = (React__default["default"].createElement(TabBox, { title: "Tags" }, Object.keys(tagFilterState)
3221
+ filterDrawer = (React__default["default"].createElement(TabBox, { title: "Tags" }, Object.keys((_h = LogMetadata.Tag) !== null && _h !== void 0 ? _h : {})
3188
3222
  .map((tag, i) => {
3189
3223
  const description = genHumanReadableName(tag);
3190
3224
  return (React__default["default"].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) => {
@@ -3231,8 +3265,8 @@ const LogReviewer = (props) => {
3231
3265
  } }));
3232
3266
  })),
3233
3267
  React__default["default"].createElement(ButtonInputGroup, { label: "Target" },
3234
- (Object.keys((_h = LogMetadata.Target) !== null && _h !== void 0 ? _h : {}).length === 0) && (React__default["default"].createElement("div", null, "This app does not have any targets yet.")),
3235
- Object.keys((_j = LogMetadata.Target) !== null && _j !== void 0 ? _j : {})
3268
+ (Object.keys((_j = LogMetadata.Target) !== null && _j !== void 0 ? _j : {}).length === 0) && (React__default["default"].createElement("div", null, "This app does not have any targets yet.")),
3269
+ Object.keys((_k = LogMetadata.Target) !== null && _k !== void 0 ? _k : {})
3236
3270
  .map((target, i) => {
3237
3271
  var _a;
3238
3272
  const description = genHumanReadableName(target);
@@ -3738,13 +3772,13 @@ const LogReviewer = (props) => {
3738
3772
  type: ParamType$1.Boolean,
3739
3773
  },
3740
3774
  {
3741
- title: 'Teaching Staff',
3775
+ title: 'Teaching Staff?',
3742
3776
  param: 'isTTM',
3743
3777
  type: ParamType$1.Boolean,
3744
3778
  startsHidden: true,
3745
3779
  },
3746
3780
  {
3747
- title: 'Admin',
3781
+ title: 'Admin?',
3748
3782
  param: 'isAdmin',
3749
3783
  type: ParamType$1.Boolean,
3750
3784
  startsHidden: true,
@@ -3779,7 +3813,7 @@ const LogReviewer = (props) => {
3779
3813
  startsHidden: true,
3780
3814
  },
3781
3815
  {
3782
- title: 'Mobile',
3816
+ title: 'Mobile?',
3783
3817
  param: 'device.isMobile',
3784
3818
  type: ParamType$1.Boolean,
3785
3819
  startsHidden: true,