dce-reactkit 3.2.2-beta.6 → 3.2.2-beta.8

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.
@@ -7,6 +7,7 @@ declare type Props = {
7
7
  label: string;
8
8
  minLabelWidth?: string;
9
9
  children: React.ReactNode;
10
+ className?: string;
10
11
  };
11
12
  declare const ButtonInputGroup: React.FC<Props>;
12
13
  export default ButtonInputGroup;
package/dist/esm/index.js CHANGED
@@ -1180,14 +1180,14 @@ const ButtonInputGroup = (props) => {
1180
1180
  /*------------------------------------------------------------------------*/
1181
1181
  /* -------------- Props ------------- */
1182
1182
  // Destructure all props
1183
- const { label, minLabelWidth, children, } = props;
1183
+ const { label, minLabelWidth, children, className, } = props;
1184
1184
  /*------------------------------------------------------------------------*/
1185
1185
  /* Render */
1186
1186
  /*------------------------------------------------------------------------*/
1187
1187
  /*----------------------------------------*/
1188
1188
  /* Main UI */
1189
1189
  /*----------------------------------------*/
1190
- return (React.createElement("div", { className: "input-group" },
1190
+ return (React.createElement("div", { className: `input-group ${className !== null && className !== void 0 ? className : ''}` },
1191
1191
  React.createElement("div", { className: "input-group-prepend d-flex w-100" },
1192
1192
  React.createElement("span", { className: "input-group-text", style: {
1193
1193
  minWidth: (minLabelWidth !== null && minLabelWidth !== void 0 ? minLabelWidth : undefined),
@@ -2389,9 +2389,9 @@ const IntelliTable = (props) => {
2389
2389
  // Create the cell UI
2390
2390
  return (React.createElement("th", { key: column.param, scope: "col", id: `IntelliTable-${id}-header-${column.param}` },
2391
2391
  React.createElement("div", { className: "d-flex align-items-center justify-content-center flex-row h-100" },
2392
- React.createElement("h4", { className: "m-0" }, column.title),
2392
+ React.createElement("span", { className: "text-nowrap" }, column.title),
2393
2393
  React.createElement("div", null,
2394
- React.createElement("button", { type: "button", className: "btn btn-light", "aria-label": sortButtonAriaLabel, onClick: () => {
2394
+ React.createElement("button", { type: "button", className: "btn btn-light btn-sm ms-1", "aria-label": sortButtonAriaLabel, onClick: () => {
2395
2395
  dispatch({
2396
2396
  type: ActionType$1.ToggleSortColumn,
2397
2397
  param: column.param,
@@ -2539,7 +2539,7 @@ const IntelliTable = (props) => {
2539
2539
  React.createElement("h3", { className: "m-0" }, title),
2540
2540
  React.createElement("div", { className: "flex-grow-1 text-end" },
2541
2541
  React.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: `${title}.csv`, csv: csv }),
2542
- React.createElement("button", { type: "button", className: "btn btn-secondary", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
2542
+ React.createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
2543
2543
  dispatch({
2544
2544
  type: ActionType$1.ToggleColVisCusModalVisibility,
2545
2545
  });
@@ -2603,6 +2603,11 @@ const style = `
2603
2603
  border: 0.05rem solid black;
2604
2604
  border-radius: 0.5rem;
2605
2605
  overflow: hidden;
2606
+ padding: 0.7rem;
2607
+
2608
+ /* Solid background */
2609
+ background-color: white;
2610
+ color: black;
2606
2611
 
2607
2612
  /* Place contents in flex column */
2608
2613
  flex-direction: column;
@@ -2629,6 +2634,18 @@ const style = `
2629
2634
  /* Vertical scroll */
2630
2635
  overflow-y: auto;
2631
2636
  }
2637
+
2638
+ .LogReviewer-header-close-button {
2639
+ border: 0 !important;
2640
+ background-color: transparent !important;
2641
+ padding-top: 0 !important;
2642
+ padding-bottom: 0 !important;
2643
+ margin: 0 !important;
2644
+ color: #333 !important;
2645
+ }
2646
+ .LogReviewer-header-close-button:hover {
2647
+ color: #000 !important;
2648
+ }
2632
2649
  `;
2633
2650
  /*------------------------------------------------------------------------*/
2634
2651
  /* Static Functions */
@@ -2648,7 +2665,7 @@ const genHumanReadableName = (machineReadableName) => {
2648
2665
  // Uppercase! Add a space before
2649
2666
  humanReadableName += ' ';
2650
2667
  }
2651
- humanReadableName += chars;
2668
+ humanReadableName += char;
2652
2669
  });
2653
2670
  // Trim and return
2654
2671
  return humanReadableName.trim();
@@ -2730,7 +2747,7 @@ const LogReviewer = (props) => {
2730
2747
  /*------------------------------------------------------------------------*/
2731
2748
  /* Setup */
2732
2749
  /*------------------------------------------------------------------------*/
2733
- var _a, _b, _c, _d, _e;
2750
+ var _a, _b, _c, _d, _e, _f;
2734
2751
  /* -------------- Props ------------- */
2735
2752
  // Destructure props
2736
2753
  const { LogMetadata, onClose, } = props;
@@ -2933,10 +2950,10 @@ const LogReviewer = (props) => {
2933
2950
  /* Filters */
2934
2951
  /*----------------------------------------*/
2935
2952
  // Filter toggle
2936
- const filterToggles = (React.createElement("div", { className: "LogReviewer-filter-toggles d-flex align-items-center justify-content-center" },
2953
+ const filterToggles = (React.createElement("div", { className: "LogReviewer-filter-toggles mb-2" },
2937
2954
  React.createElement("h3", { className: "m-0" }, "Filters:"),
2938
2955
  React.createElement("div", { className: "LogReviewer-filter-toggle-buttons" },
2939
- React.createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
2956
+ React.createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'secondary'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
2940
2957
  dispatch({
2941
2958
  type: ActionType.ToggleFilterDrawer,
2942
2959
  filterDrawer: FilterDrawer.Date,
@@ -2944,7 +2961,7 @@ const LogReviewer = (props) => {
2944
2961
  } },
2945
2962
  React.createElement(FontAwesomeIcon, { icon: faCalendar, className: "me-2" }),
2946
2963
  "Date"),
2947
- React.createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
2964
+ React.createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'secondary'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
2948
2965
  dispatch({
2949
2966
  type: ActionType.ToggleFilterDrawer,
2950
2967
  filterDrawer: FilterDrawer.Context,
@@ -2952,15 +2969,15 @@ const LogReviewer = (props) => {
2952
2969
  } },
2953
2970
  React.createElement(FontAwesomeIcon, { icon: faCircle, className: "me-2" }),
2954
2971
  "Context"),
2955
- React.createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
2972
+ (LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React.createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'secondary'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
2956
2973
  dispatch({
2957
2974
  type: ActionType.ToggleFilterDrawer,
2958
2975
  filterDrawer: FilterDrawer.Tag,
2959
2976
  });
2960
2977
  } },
2961
2978
  React.createElement(FontAwesomeIcon, { icon: faTag, className: "me-2" }),
2962
- "Tag"),
2963
- React.createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
2979
+ "Tag")),
2980
+ React.createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'secondary'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
2964
2981
  dispatch({
2965
2982
  type: ActionType.ToggleFilterDrawer,
2966
2983
  filterDrawer: FilterDrawer.Action,
@@ -2968,7 +2985,7 @@ const LogReviewer = (props) => {
2968
2985
  } },
2969
2986
  React.createElement(FontAwesomeIcon, { icon: faHammer, className: "me-2" }),
2970
2987
  "Action"),
2971
- React.createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer}`, "aria-label": "toggle advanced filter drawer", onClick: () => {
2988
+ React.createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'secondary'}`, "aria-label": "toggle advanced filter drawer", onClick: () => {
2972
2989
  dispatch({
2973
2990
  type: ActionType.ToggleFilterDrawer,
2974
2991
  filterDrawer: FilterDrawer.Advanced,
@@ -3092,7 +3109,7 @@ const LogReviewer = (props) => {
3092
3109
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
3093
3110
  (actionErrorFilterState.type === undefined
3094
3111
  || actionErrorFilterState.type === LogType$1.Action) && (React.createElement(TabBox, { title: "Action Log Details" },
3095
- React.createElement(ButtonInputGroup, { label: "Action" }, Object.keys(LogAction$1)
3112
+ React.createElement(ButtonInputGroup, { label: "Action", className: "mb-2" }, Object.keys(LogAction$1)
3096
3113
  .map((action, i) => {
3097
3114
  const description = genHumanReadableName(action);
3098
3115
  return (React.createElement(CheckboxButton, { id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: i === Object.keys(LogAction$1).length - 1, onChanged: (checked) => {
@@ -3103,18 +3120,20 @@ const LogReviewer = (props) => {
3103
3120
  });
3104
3121
  } }));
3105
3122
  })),
3106
- React.createElement(ButtonInputGroup, { label: "Target" }, Object.keys((_e = LogMetadata.Target) !== null && _e !== void 0 ? _e : {})
3107
- .map((target, i) => {
3108
- var _a;
3109
- const description = genHumanReadableName(target);
3110
- return (React.createElement(CheckboxButton, { id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, onChanged: (checked) => {
3111
- actionErrorFilterState.target[target] = checked;
3112
- dispatch({
3113
- type: ActionType.UpdateActionErrorFilterState,
3114
- actionErrorFilterState,
3115
- });
3116
- }, noMarginOnRight: i === Object.keys((_a = LogMetadata.Target) !== null && _a !== void 0 ? _a : {}).length - 1 }));
3117
- })))),
3123
+ React.createElement(ButtonInputGroup, { label: "Target" },
3124
+ (Object.keys((_e = LogMetadata.Target) !== null && _e !== void 0 ? _e : {})) && (React.createElement("div", null, "This app does not have any targets yet.")),
3125
+ Object.keys((_f = LogMetadata.Target) !== null && _f !== void 0 ? _f : {})
3126
+ .map((target, i) => {
3127
+ var _a;
3128
+ const description = genHumanReadableName(target);
3129
+ return (React.createElement(CheckboxButton, { id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, onChanged: (checked) => {
3130
+ actionErrorFilterState.target[target] = checked;
3131
+ dispatch({
3132
+ type: ActionType.UpdateActionErrorFilterState,
3133
+ actionErrorFilterState,
3134
+ });
3135
+ }, noMarginOnRight: i === Object.keys((_a = LogMetadata.Target) !== null && _a !== void 0 ? _a : {}).length - 1 }));
3136
+ })))),
3118
3137
  (actionErrorFilterState.type === undefined
3119
3138
  || actionErrorFilterState.type === LogType$1.Error) && (React.createElement(TabBox, { title: "Error Log Details" },
3120
3139
  React.createElement("div", { className: "input-group mb-2" },
@@ -3732,7 +3751,11 @@ const LogReviewer = (props) => {
3732
3751
  },
3733
3752
  ];
3734
3753
  // Create intelliTable
3735
- const dataTable = (React.createElement(IntelliTable, { title: "Matching Logs", id: "logs", data: logs, columns: columns }));
3754
+ const dataTable = (logs.length === 0
3755
+ ? (React.createElement("div", { className: "alert alert-warning" },
3756
+ React.createElement("h4", { className: "m-1" }, "No Logs to Show"),
3757
+ React.createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
3758
+ : (React.createElement(IntelliTable, { title: "Matching Logs", id: "logs", data: logs, columns: columns })));
3736
3759
  // Main body
3737
3760
  body = (React.createElement(React.Fragment, null,
3738
3761
  filters,
@@ -3744,13 +3767,8 @@ const LogReviewer = (props) => {
3744
3767
  React.createElement("div", { className: "LogReviewer-inner-container" },
3745
3768
  React.createElement("div", { className: "LogReviewer-header" },
3746
3769
  React.createElement("div", { className: "LogReviewer-header-title" },
3747
- React.createElement("h1", { className: "m-0" }, "Log Review Dashboard")),
3748
- React.createElement("button", { type: "button", className: "LogReviewer-header-close-button btn btn-lg", "aria-label": "close log reviewer panel", onClick: onClose, style: {
3749
- border: 0,
3750
- backgroundColor: 'transparent',
3751
- padding: 0,
3752
- margin: 0,
3753
- } },
3770
+ React.createElement("h3", { className: "m-0" }, "Log Review Dashboard")),
3771
+ React.createElement("button", { type: "button", className: "LogReviewer-header-close-button btn btn-dark btn-lg", "aria-label": "close log reviewer panel", onClick: onClose },
3754
3772
  React.createElement(FontAwesomeIcon, { icon: faTimes }))),
3755
3773
  React.createElement("div", { className: "LogReviewer-contents" }, body))));
3756
3774
  };