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.
package/dist/cjs/index.js CHANGED
@@ -1188,7 +1188,7 @@ const ButtonInputGroup = (props) => {
1188
1188
  /*------------------------------------------------------------------------*/
1189
1189
  /* -------------- Props ------------- */
1190
1190
  // Destructure all props
1191
- const { label, minLabelWidth, children, className, } = props;
1191
+ const { label, minLabelWidth, children, className, wrapButtonsAndAddGaps, } = props;
1192
1192
  /*------------------------------------------------------------------------*/
1193
1193
  /* Render */
1194
1194
  /*------------------------------------------------------------------------*/
@@ -1207,7 +1207,9 @@ const ButtonInputGroup = (props) => {
1207
1207
  borderTopLeftRadius: 0,
1208
1208
  borderBottomLeftRadius: 0,
1209
1209
  borderLeftWidth: 0,
1210
- } }, children))));
1210
+ } }, wrapButtonsAndAddGaps
1211
+ ? (React__default["default"].createElement("div", { className: "d-flex gap-1 flex-wrap" }, children))
1212
+ : children))));
1211
1213
  };
1212
1214
 
1213
1215
  const monthNames = [
@@ -3027,8 +3029,45 @@ const genHumanReadableName = (machineReadableName) => {
3027
3029
  }
3028
3030
  humanReadableName += char;
3029
3031
  });
3030
- // Trim and return
3031
- return humanReadableName.trim();
3032
+ const words = (humanReadableName
3033
+ .trim()
3034
+ // Split into words
3035
+ .split(' ')
3036
+ // Filter out whitespace
3037
+ .filter((word) => {
3038
+ return (word.length > 0);
3039
+ })
3040
+ // Capitalize first letter
3041
+ .map((word) => {
3042
+ if (word.length <= 1) {
3043
+ return word;
3044
+ }
3045
+ return `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`;
3046
+ }));
3047
+ // Handle acronyms by piling words together
3048
+ const consolidatedWords = [];
3049
+ let acronym = '';
3050
+ words.forEach((word) => {
3051
+ if (word.length === 1) {
3052
+ // Add on to acronym
3053
+ acronym += word;
3054
+ }
3055
+ else {
3056
+ // Wrap up acronym
3057
+ if (acronym.length > 0) {
3058
+ consolidatedWords.push(acronym);
3059
+ acronym = '';
3060
+ }
3061
+ // Full word. Just add it
3062
+ consolidatedWords.push(word);
3063
+ }
3064
+ });
3065
+ // Add trailing acronym
3066
+ if (acronym.length > 0) {
3067
+ consolidatedWords.push(acronym);
3068
+ }
3069
+ // Return
3070
+ return consolidatedWords.join(' ');
3032
3071
  };
3033
3072
  /* ------------- Actions ------------ */
3034
3073
  // Types of actions
@@ -3556,30 +3595,28 @@ const LogReviewer = (props) => {
3556
3595
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
3557
3596
  (actionErrorFilterState.type === undefined
3558
3597
  || actionErrorFilterState.type === LogType$1.Action) && (React__default["default"].createElement(TabBox, { title: "Action Log Details" },
3559
- React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2" },
3560
- React__default["default"].createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys(LogAction$1)
3561
- .map((action) => {
3562
- const description = genHumanReadableName(action);
3563
- return (React__default["default"].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) => {
3564
- actionErrorFilterState.action[action] = checked;
3565
- dispatch({
3566
- type: ActionType.UpdateActionErrorFilterState,
3567
- actionErrorFilterState,
3568
- });
3569
- } }));
3570
- }))),
3571
- React__default["default"].createElement(ButtonInputGroup, { label: "Target" },
3572
- React__default["default"].createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys(targetMap)
3573
- .map((target) => {
3574
- const description = genHumanReadableName(target);
3575
- return (React__default["default"].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) => {
3576
- actionErrorFilterState.target[target] = checked;
3577
- dispatch({
3578
- type: ActionType.UpdateActionErrorFilterState,
3579
- actionErrorFilterState,
3580
- });
3581
- } }));
3582
- }))))),
3598
+ React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
3599
+ .map((action) => {
3600
+ const description = genHumanReadableName(action);
3601
+ return (React__default["default"].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) => {
3602
+ actionErrorFilterState.action[action] = checked;
3603
+ dispatch({
3604
+ type: ActionType.UpdateActionErrorFilterState,
3605
+ actionErrorFilterState,
3606
+ });
3607
+ } }));
3608
+ })),
3609
+ React__default["default"].createElement(ButtonInputGroup, { label: "Target", wrapButtonsAndAddGaps: true }, Object.keys(targetMap)
3610
+ .map((target) => {
3611
+ const description = genHumanReadableName(target);
3612
+ return (React__default["default"].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) => {
3613
+ actionErrorFilterState.target[target] = checked;
3614
+ dispatch({
3615
+ type: ActionType.UpdateActionErrorFilterState,
3616
+ actionErrorFilterState,
3617
+ });
3618
+ } }));
3619
+ })))),
3583
3620
  (actionErrorFilterState.type === undefined
3584
3621
  || actionErrorFilterState.type === LogType$1.Error) && (React__default["default"].createElement(TabBox, { title: "Error Log Details" },
3585
3622
  React__default["default"].createElement("div", { className: "input-group mb-2" },