dce-reactkit 3.2.4 → 3.2.6

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.
@@ -8,6 +8,7 @@ declare type Props = {
8
8
  minLabelWidth?: string;
9
9
  children: React.ReactNode;
10
10
  className?: string;
11
+ wrapButtonsAndAddGaps?: boolean;
11
12
  };
12
13
  declare const ButtonInputGroup: React.FC<Props>;
13
14
  export default ButtonInputGroup;
package/dist/esm/index.js CHANGED
@@ -1180,7 +1180,7 @@ const ButtonInputGroup = (props) => {
1180
1180
  /*------------------------------------------------------------------------*/
1181
1181
  /* -------------- Props ------------- */
1182
1182
  // Destructure all props
1183
- const { label, minLabelWidth, children, className, } = props;
1183
+ const { label, minLabelWidth, children, className, wrapButtonsAndAddGaps, } = props;
1184
1184
  /*------------------------------------------------------------------------*/
1185
1185
  /* Render */
1186
1186
  /*------------------------------------------------------------------------*/
@@ -1199,7 +1199,9 @@ const ButtonInputGroup = (props) => {
1199
1199
  borderTopLeftRadius: 0,
1200
1200
  borderBottomLeftRadius: 0,
1201
1201
  borderLeftWidth: 0,
1202
- } }, children))));
1202
+ } }, wrapButtonsAndAddGaps
1203
+ ? (React.createElement("div", { className: "d-flex gap-1 flex-wrap" }, children))
1204
+ : children))));
1203
1205
  };
1204
1206
 
1205
1207
  const monthNames = [
@@ -3019,8 +3021,45 @@ const genHumanReadableName = (machineReadableName) => {
3019
3021
  }
3020
3022
  humanReadableName += char;
3021
3023
  });
3022
- // Trim and return
3023
- return humanReadableName.trim();
3024
+ const words = (humanReadableName
3025
+ .trim()
3026
+ // Split into words
3027
+ .split(' ')
3028
+ // Filter out whitespace
3029
+ .filter((word) => {
3030
+ return (word.length > 0);
3031
+ })
3032
+ // Capitalize first letter
3033
+ .map((word) => {
3034
+ if (word.length <= 1) {
3035
+ return word;
3036
+ }
3037
+ return `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`;
3038
+ }));
3039
+ // Handle acronyms by piling words together
3040
+ const consolidatedWords = [];
3041
+ let acronym = '';
3042
+ words.forEach((word) => {
3043
+ if (word.length === 1) {
3044
+ // Add on to acronym
3045
+ acronym += word;
3046
+ }
3047
+ else {
3048
+ // Wrap up acronym
3049
+ if (acronym.length > 0) {
3050
+ consolidatedWords.push(acronym);
3051
+ acronym = '';
3052
+ }
3053
+ // Full word. Just add it
3054
+ consolidatedWords.push(word);
3055
+ }
3056
+ });
3057
+ // Add trailing acronym
3058
+ if (acronym.length > 0) {
3059
+ consolidatedWords.push(acronym);
3060
+ }
3061
+ // Return
3062
+ return consolidatedWords.join(' ');
3024
3063
  };
3025
3064
  /* ------------- Actions ------------ */
3026
3065
  // Types of actions
@@ -3548,30 +3587,28 @@ const LogReviewer = (props) => {
3548
3587
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
3549
3588
  (actionErrorFilterState.type === undefined
3550
3589
  || actionErrorFilterState.type === LogType$1.Action) && (React.createElement(TabBox, { title: "Action Log Details" },
3551
- React.createElement(ButtonInputGroup, { label: "Action", className: "mb-2" },
3552
- React.createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys(LogAction$1)
3553
- .map((action) => {
3554
- const description = genHumanReadableName(action);
3555
- return (React.createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
3556
- actionErrorFilterState.action[action] = checked;
3557
- dispatch({
3558
- type: ActionType.UpdateActionErrorFilterState,
3559
- actionErrorFilterState,
3560
- });
3561
- } }));
3562
- }))),
3563
- React.createElement(ButtonInputGroup, { label: "Target" },
3564
- React.createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys(targetMap)
3565
- .map((target) => {
3566
- const description = genHumanReadableName(target);
3567
- return (React.createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
3568
- actionErrorFilterState.target[target] = checked;
3569
- dispatch({
3570
- type: ActionType.UpdateActionErrorFilterState,
3571
- actionErrorFilterState,
3572
- });
3573
- } }));
3574
- }))))),
3590
+ React.createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
3591
+ .map((action) => {
3592
+ const description = genHumanReadableName(action);
3593
+ return (React.createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
3594
+ actionErrorFilterState.action[action] = checked;
3595
+ dispatch({
3596
+ type: ActionType.UpdateActionErrorFilterState,
3597
+ actionErrorFilterState,
3598
+ });
3599
+ } }));
3600
+ })),
3601
+ React.createElement(ButtonInputGroup, { label: "Target", wrapButtonsAndAddGaps: true }, Object.keys(targetMap)
3602
+ .map((target) => {
3603
+ const description = genHumanReadableName(target);
3604
+ return (React.createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
3605
+ actionErrorFilterState.target[target] = checked;
3606
+ dispatch({
3607
+ type: ActionType.UpdateActionErrorFilterState,
3608
+ actionErrorFilterState,
3609
+ });
3610
+ } }));
3611
+ })))),
3575
3612
  (actionErrorFilterState.type === undefined
3576
3613
  || actionErrorFilterState.type === LogType$1.Error) && (React.createElement(TabBox, { title: "Error Log Details" },
3577
3614
  React.createElement("div", { className: "input-group mb-2" },