aefis-core-ui 2.6.0-rc65 → 2.6.0-rc67

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.
@@ -4282,7 +4282,7 @@ if (process.env.NODE_ENV !== 'production') {
4282
4282
  FocusTrap['propTypes' + ''] = exactProp(FocusTrap.propTypes);
4283
4283
  }
4284
4284
 
4285
- const booleanOrFunction = (field, data) => field === undefined || typeof field === "function" && field(data) || typeof field === "boolean" && field;
4285
+ const booleanOrFunction$1 = (field, data) => field === undefined || typeof field === "function" && field(data) || typeof field === "boolean" && field;
4286
4286
  const renderIcon = Icon => {
4287
4287
  return /*#__PURE__*/jsx(Icon, {});
4288
4288
  };
@@ -4316,7 +4316,7 @@ const ActionMenuButton = ({
4316
4316
  action.onClick && action.onClick(e, data);
4317
4317
  };
4318
4318
  const isHidden = (action, data) => {
4319
- return booleanOrFunction(action.hidden || false, data);
4319
+ return booleanOrFunction$1(action.hidden || false, data);
4320
4320
  };
4321
4321
  return (actions == null ? void 0 : actions.length) === 0 || (actions == null ? void 0 : actions.length) === 1 && /*#__PURE__*/jsx(Fragment, {
4322
4322
  children: isMobile ? /*#__PURE__*/jsx(Tooltip$1, {
@@ -4395,7 +4395,7 @@ const ActionMenuButton = ({
4395
4395
  autoFocusItem: true,
4396
4396
  children: actions == null ? void 0 : actions.map((action, index) => isHidden(action, data) === false && /*#__PURE__*/jsxs(MenuItem$1, {
4397
4397
  selected: index === selectedIndex,
4398
- disabled: booleanOrFunction(action.disabled || false, data),
4398
+ disabled: booleanOrFunction$1(action.disabled || false, data),
4399
4399
  sx: action.divider ? {
4400
4400
  borderTop: "1px solid #dddddd",
4401
4401
  marginTop: 1,
@@ -4621,6 +4621,9 @@ const MenuButton = /*#__PURE__*/forwardRef(function MenuButton(_ref, ref) {
4621
4621
  setAnchorEl(null);
4622
4622
  action && action(data);
4623
4623
  };
4624
+ const isHidden = (action, data) => {
4625
+ return booleanOrFunction(action.hidden || false, data);
4626
+ };
4624
4627
  const id = useUID();
4625
4628
  const buttonId = `content-box-menu-button-${id}`;
4626
4629
  const menuId = `content-box-menu-${id}`;
@@ -4677,7 +4680,7 @@ const MenuButton = /*#__PURE__*/forwardRef(function MenuButton(_ref, ref) {
4677
4680
  MenuListProps: {
4678
4681
  "aria-labelledby": buttonId
4679
4682
  },
4680
- children: menuConfiguration == null ? void 0 : menuConfiguration.map((item, index) => /*#__PURE__*/jsxs(MenuItem$1, {
4683
+ children: menuConfiguration == null ? void 0 : menuConfiguration.map((item, index) => isHidden(item, data) === false && /*#__PURE__*/jsxs(MenuItem$1, {
4681
4684
  onClick: () => handleMenuClick(item.onClick, data),
4682
4685
  disabled: item.disabled || false,
4683
4686
  sx: {
@@ -4854,7 +4857,10 @@ const Drawer$1 = props => {
4854
4857
  if (action.render) {
4855
4858
  return action.render();
4856
4859
  }
4857
- return action.hidden === false ? /*#__PURE__*/jsxs(Button, {
4860
+ if (action.hidden && action.hidden === true) {
4861
+ return "";
4862
+ }
4863
+ return /*#__PURE__*/jsxs(Button, {
4858
4864
  variant: "contained",
4859
4865
  style: {
4860
4866
  marginLeft: 8
@@ -4870,7 +4876,7 @@ const Drawer$1 = props => {
4870
4876
  marginRight: 8
4871
4877
  }
4872
4878
  }), action.name]
4873
- }, action.id) : "";
4879
+ }, action.id);
4874
4880
  }), props.menu && /*#__PURE__*/jsx(MenuButton, {
4875
4881
  name: `${props.title} options menu`,
4876
4882
  menuConfiguration: props.menu,
@@ -4980,7 +4986,8 @@ Drawer$1.propTypes = {
4980
4986
  displayType: PropTypes.oneOf(["primary", "secondary"]),
4981
4987
  name: PropTypes.string,
4982
4988
  disabled: PropTypes.bool,
4983
- iconName: PropTypes.string
4989
+ iconName: PropTypes.string,
4990
+ hidden: PropTypes.bool
4984
4991
  })),
4985
4992
  /** Offset of the drawer from the top of the page based on no menu, a primary menu, or secondary (and primary) menu. */
4986
4993
  menuPositionOffset: PropTypes.oneOf(["none", "primaryMenu", "secondaryMenu"]),
@@ -19447,8 +19454,8 @@ const SentimentScale = ({
19447
19454
  value,
19448
19455
  roundValue: _roundValue = true,
19449
19456
  labelArray: _labelArray = ["Very Negative", "Negative", "Neutral", "Positive", "Very Positive"],
19450
- showLabel: _showLabel = true,
19451
- showTitle: _showTitle = true
19457
+ showLabel: _showLabel = false,
19458
+ showTitle: _showTitle = false
19452
19459
  }) => {
19453
19460
  const seededKeyValue = useUIDSeed();
19454
19461
  const uid = useUID();
@@ -19486,7 +19493,7 @@ const SentimentScale = ({
19486
19493
  })
19487
19494
  }, `sentiment-scale-item-${seededKeyValue(index)}`))
19488
19495
  })
19489
- }), processedValue && _showLabel && /*#__PURE__*/jsxs(Box$2, {
19496
+ }), processedValue > 0 && _showLabel && /*#__PURE__*/jsxs(Box$2, {
19490
19497
  sx: {
19491
19498
  textAlign: "center",
19492
19499
  mt: _showTitle ? -1 : 0
@@ -23027,8 +23034,8 @@ const SurveyThemes = ({
23027
23034
  avatarBackgroundColor: blue[800],
23028
23035
  autoTruncateDescription: false,
23029
23036
  size: "full",
23030
- titleContent: emotionValue ? /*#__PURE__*/jsx(SentimentScale, {
23031
- value: emotionValue,
23037
+ titleContent: emotionValue !== undefined ? /*#__PURE__*/jsx(SentimentScale, {
23038
+ value: emotionValue ? parseFloat(emotionValue) : 0,
23032
23039
  showTitle: false,
23033
23040
  showLabel: false
23034
23041
  }) : undefined,
@@ -23204,11 +23211,11 @@ const processIncomingAIResponse = data => {
23204
23211
  const answers = (data == null ? void 0 : data.Answer) || (data == null ? void 0 : data.answer) || [];
23205
23212
  if ((answers == null ? void 0 : answers.length) > 0) {
23206
23213
  return answers.map(item => {
23207
- var _item$emotion, _item$Emotion, _item$emotion2, _item$emotion3, _item$Emotion2;
23214
+ var _item$emotion, _item$emotion2;
23208
23215
  const theme = item.theme || item.Theme;
23209
23216
  const responses = item.responses || item.Responses || item.text_response;
23210
23217
  const responseCount = item.ResponseCount || item.responseCount || "unknown";
23211
- const emotionValue = ((_item$emotion = item.emotion) == null ? void 0 : _item$emotion.value) || ((_item$Emotion = item.Emotion) == null ? void 0 : _item$Emotion.Value) || ((_item$emotion2 = item.emotion) == null ? void 0 : _item$emotion2.averageValue) || ((_item$emotion3 = item.emotion) == null ? void 0 : _item$emotion3.AverageValue) || ((_item$Emotion2 = item.Emotion) == null ? void 0 : _item$Emotion2.AverageValue);
23218
+ const emotionValue = ((_item$emotion = item.emotion) == null ? void 0 : _item$emotion.averageValue) || ((_item$emotion2 = item.emotion) == null ? void 0 : _item$emotion2.AverageValue);
23212
23219
  return {
23213
23220
  theme,
23214
23221
  responses,