@laerdal/life-react-components 3.2.1-dev.12.full → 3.2.1-dev.14

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.
Files changed (61) hide show
  1. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs +4 -0
  2. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs.map +1 -1
  3. package/dist/Card/HorizontalCard/HorizontalCardActions.js +4 -0
  4. package/dist/Card/HorizontalCard/HorizontalCardActions.js.map +1 -1
  5. package/dist/Card/HorizontalCard/types.cjs.map +1 -1
  6. package/dist/Card/HorizontalCard/types.d.ts +8 -2
  7. package/dist/Card/HorizontalCard/types.js.map +1 -1
  8. package/dist/InputFields/Checkbox.cjs +5 -2
  9. package/dist/InputFields/Checkbox.cjs.map +1 -1
  10. package/dist/InputFields/Checkbox.js +5 -2
  11. package/dist/InputFields/Checkbox.js.map +1 -1
  12. package/dist/InputFields/DatepickerField.cjs +3 -4
  13. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  14. package/dist/InputFields/DatepickerField.js +3 -4
  15. package/dist/InputFields/DatepickerField.js.map +1 -1
  16. package/dist/InputFields/DatepickerFieldHeader.cjs +2 -0
  17. package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
  18. package/dist/InputFields/DatepickerFieldHeader.js +2 -0
  19. package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
  20. package/dist/InputFields/RichTextField.cjs +9 -4
  21. package/dist/InputFields/RichTextField.cjs.map +1 -1
  22. package/dist/InputFields/RichTextField.js +10 -5
  23. package/dist/InputFields/RichTextField.js.map +1 -1
  24. package/dist/InputFields/Textarea.cjs +2 -2
  25. package/dist/InputFields/Textarea.cjs.map +1 -1
  26. package/dist/InputFields/Textarea.js +2 -2
  27. package/dist/InputFields/Textarea.js.map +1 -1
  28. package/dist/Modals/ModalContent.cjs +1 -1
  29. package/dist/Modals/ModalContent.cjs.map +1 -1
  30. package/dist/Modals/ModalContent.js +1 -1
  31. package/dist/Modals/ModalContent.js.map +1 -1
  32. package/dist/Table/TableBody.cjs +18 -6
  33. package/dist/Table/TableBody.cjs.map +1 -1
  34. package/dist/Table/TableBody.js +21 -9
  35. package/dist/Table/TableBody.js.map +1 -1
  36. package/dist/Table/TableStyles.cjs +20 -12
  37. package/dist/Table/TableStyles.cjs.map +1 -1
  38. package/dist/Table/TableStyles.d.ts +7 -1
  39. package/dist/Table/TableStyles.js +17 -11
  40. package/dist/Table/TableStyles.js.map +1 -1
  41. package/dist/Table/TableTypes.cjs.map +1 -1
  42. package/dist/Table/TableTypes.d.ts +1 -0
  43. package/dist/Table/TableTypes.js.map +1 -1
  44. package/dist/Tag/Tag.cjs.map +1 -1
  45. package/dist/Tag/Tag.d.ts +1 -1
  46. package/dist/Tag/Tag.js.map +1 -1
  47. package/dist/Tag/index.cjs.map +1 -1
  48. package/dist/Tag/index.d.ts +1 -1
  49. package/dist/Tag/index.js.map +1 -1
  50. package/dist/Tile/TileHeader.cjs +17 -6
  51. package/dist/Tile/TileHeader.cjs.map +1 -1
  52. package/dist/Tile/TileHeader.js +17 -6
  53. package/dist/Tile/TileHeader.js.map +1 -1
  54. package/dist/Tile/TileTypes.cjs.map +1 -1
  55. package/dist/Tile/TileTypes.d.ts +2 -0
  56. package/dist/Tile/TileTypes.js.map +1 -1
  57. package/dist/styles/global.cjs +3 -1
  58. package/dist/styles/global.cjs.map +1 -1
  59. package/dist/styles/global.js +3 -1
  60. package/dist/styles/global.js.map +1 -1
  61. package/package.json +1 -1
@@ -35,9 +35,9 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
35
35
  var TextareaWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n ", "\n"])), function (props) {
36
36
  return props.margin ? "margin: ".concat(props.margin, ";") : '';
37
37
  });
38
- var TextArea = styled.textarea(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: block;\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin-bottom: 4px;\n padding: 16px;\n border: none;\n box-shadow: inset 0 0 0 1px ", ";\n\n resize: ", ";\n\n ", "\n &.small {\n ", "\n width: 304px;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n width: 344px;\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.focus-visible {\n ", "\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.active {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:read-only:not(:disabled) {\n ", "\n }\n\n &:disabled {\n cursor: not-allowed;\n border: 1px solid ", ";\n box-shadow: none !important;\n color: ", " !important;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n ", "\n }\n"])), COLORS.white, COLORS.neutral_400, function (props) {
38
+ var TextArea = styled.textarea(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: block;\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin-bottom: 4px;\n padding: 16px;\n border: none;\n box-shadow: inset 0 0 0 1px ", ";\n\n resize: ", ";\n\n ", "\n &.small {\n ", "\n width: 304px;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n &::placeholder {\n ", "\n }\n width: 344px;\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.focus-visible {\n ", "\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.valid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.active {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:read-only:not(:disabled) {\n ", "\n }\n\n &:disabled {\n cursor: not-allowed;\n border: 1px solid ", ";\n box-shadow: none !important;\n color: ", " !important;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n ", "\n }\n"])), COLORS.white, COLORS.neutral_400, function (props) {
39
39
  return props.autoHeight ? 'none' : '';
40
- }, ComponentMStyling(ComponentTextStyle.Italic, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Italic, COLORS.black), COLORS.primary_800, focusStyles, COLORS.critical_500, COLORS.correct_500, COLORS.primary_700, COLORS.primary_800, readOnlyState, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500));
40
+ }, ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.primary_800, focusStyles, COLORS.critical_500, COLORS.correct_500, COLORS.primary_700, COLORS.primary_800, readOnlyState, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500));
41
41
  var Textarea = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
42
42
  var id = _ref.id,
43
43
  placeholder = _ref.placeholder,
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","names":["React","COLORS","ComponentSStyling","focusStyles","NoteMessage","readOnlyState","ValidationMessage","States","SystemIcons","styled","ComponentMStyling","ComponentTextStyle","useFocusVisibleRef","TextareaWrapper","div","props","margin","TextArea","textarea","white","neutral_400","autoHeight","Italic","black","neutral_500","primary_800","critical_500","correct_500","primary_700","neutral_100","neutral_300","Textarea","forwardRef","ref","id","placeholder","state","value","size","disabled","validationMessage","onChange","note","required","className","dataTestId","rest","elementRef","useImperativeHandle","current","cls","Invalid","undefined","e","target","Valid","correct_400","critical_400","icon","message"],"sources":["../../src/InputFields/Textarea.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n\n/**\n * Import custom styles.\n */\nimport {COLORS, ComponentSStyling, focusStyles} from '../styles';\nimport {NoteMessage, readOnlyState, ValidationMessage} from './styling';\nimport { States } from '../types';\n\n/**\n * Import custom components.\n */\nimport { SystemIcons } from '../icons';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles';\nimport { TextareaProps, TextFieldNote } from './types';\nimport {useFocusVisibleRef} from \"../common\";\n\n// Add component-specific styles.\nconst TextareaWrapper = styled.div<{ margin?: string }>`\n width: 100%;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\nconst TextArea = styled.textarea<{ autoHeight?: boolean }>`\n display: block;\n background: ${COLORS.white};\n border-radius: 4px;\n outline: none;\n margin-bottom: 4px;\n padding: 16px;\n border: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n\n resize: ${(props) => (props.autoHeight ? 'none' : '')};\n\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.black)}\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.black)}\n width: 304px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.black)}\n width: 344px;\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &.focus-visible {\n ${focusStyles}\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n &.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n &.active {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &:read-only:not(:disabled) {\n ${readOnlyState}\n }\n\n &:disabled {\n cursor: not-allowed;\n border: 1px solid ${COLORS.neutral_100};\n box-shadow: none !important;\n color: ${COLORS.neutral_300} !important;\n\n &::placeholder {\n color: ${COLORS.neutral_300};\n }\n }\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n`;\n\nconst Textarea = React.forwardRef<any, TextareaProps>(({\n id,\n placeholder,\n state,\n value,\n size,\n disabled,\n validationMessage,\n onChange,\n margin,\n autoHeight,\n note,\n required,\n className,\n dataTestId,\n ...rest\n}: TextareaProps, ref) => {\n\n const elementRef = useFocusVisibleRef();\n\n React.useImperativeHandle(ref, () => elementRef.current, [elementRef]);\n\n const cls = `${size} ${state || (validationMessage ? States.Invalid : '')} ${className || ''}`;\n return (\n <TextareaWrapper>\n <TextArea\n id={id}\n data-testid={dataTestId}\n ref={elementRef}\n value={value}\n placeholder={disabled ? undefined : placeholder}\n autoHeight={autoHeight}\n className={cls}\n disabled={disabled}\n onChange={(e: any) => onChange && onChange(e?.target?.value || '')}\n required={required}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {state === States.Valid ? <SystemIcons.CheckMark color={COLORS.correct_400} /> : <SystemIcons.TechnicalWarning color={COLORS.critical_400} />}\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </TextareaWrapper>\n );\n});\n\nexport default Textarea;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAG9B;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,iBAAiB,EAAEC,WAAW,QAAO,WAAW;AAChE,SAAQC,WAAW,EAAEC,aAAa,EAAEC,iBAAiB,QAAO,WAAW;AACvE,SAASC,MAAM,QAAQ,UAAU;;AAEjC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,UAAU;;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AEF,IAAI,IAAI,EAAG;MAAC,IAAI,EAAEF,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI7B,MAAM,CAAC4C,OAAQ;MAAA,WACrEf,KAAK,KAAK7B,MAAM,CAACgD,KAAK,gBAAG,KAAC,WAAW,CAAC,SAAS;QAAC,KAAK,EAAEtD,MAAM,CAACuD;MAAY,EAAG,gBAAG,KAAC,WAAW,CAAC,gBAAgB;QAAC,KAAK,EAAEvD,MAAM,CAACwD;MAAa,EAAG,eAC7I;QAAA,UAAOjB;MAAiB,EAAQ;IAAA,EAEnC,EACAE,IAAI,IAAI,CAACH,QAAQ,iBAChB,MAAC,WAAW;MAAC,SAAS,EAAED,IAAK;MAAA,WAC1BI,IAAI,CAACgB,IAAI,eACV;QAAA,UAAOhB,IAAI,CAACiB;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACe;AAEtB,CAAC,CAAC;AAEF,eAAe5B,QAAQ"}
1
+ {"version":3,"file":"Textarea.js","names":["React","COLORS","ComponentSStyling","focusStyles","NoteMessage","readOnlyState","ValidationMessage","States","SystemIcons","styled","ComponentMStyling","ComponentTextStyle","useFocusVisibleRef","TextareaWrapper","div","props","margin","TextArea","textarea","white","neutral_400","autoHeight","Regular","black","Italic","neutral_500","primary_800","critical_500","correct_500","primary_700","neutral_100","neutral_300","Textarea","forwardRef","ref","id","placeholder","state","value","size","disabled","validationMessage","onChange","note","required","className","dataTestId","rest","elementRef","useImperativeHandle","current","cls","Invalid","undefined","e","target","Valid","correct_400","critical_400","icon","message"],"sources":["../../src/InputFields/Textarea.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n\n/**\n * Import custom styles.\n */\nimport {COLORS, ComponentSStyling, focusStyles} from '../styles';\nimport {NoteMessage, readOnlyState, ValidationMessage} from './styling';\nimport { States } from '../types';\n\n/**\n * Import custom components.\n */\nimport { SystemIcons } from '../icons';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles';\nimport { TextareaProps, TextFieldNote } from './types';\nimport {useFocusVisibleRef} from \"../common\";\n\n// Add component-specific styles.\nconst TextareaWrapper = styled.div<{ margin?: string }>`\n width: 100%;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\nconst TextArea = styled.textarea<{ autoHeight?: boolean }>`\n display: block;\n background: ${COLORS.white};\n border-radius: 4px;\n outline: none;\n margin-bottom: 4px;\n padding: 16px;\n border: none;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n\n resize: ${(props) => (props.autoHeight ? 'none' : '')};\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n width: 304px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n width: 344px;\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &.focus-visible {\n ${focusStyles}\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_500};\n }\n\n &.valid {\n box-shadow: inset 0 0 0 2px ${COLORS.correct_500};\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_700};\n }\n\n &.active {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &:read-only:not(:disabled) {\n ${readOnlyState}\n }\n\n &:disabled {\n cursor: not-allowed;\n border: 1px solid ${COLORS.neutral_100};\n box-shadow: none !important;\n color: ${COLORS.neutral_300} !important;\n\n &::placeholder {\n color: ${COLORS.neutral_300};\n }\n }\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n`;\n\nconst Textarea = React.forwardRef<any, TextareaProps>(({\n id,\n placeholder,\n state,\n value,\n size,\n disabled,\n validationMessage,\n onChange,\n margin,\n autoHeight,\n note,\n required,\n className,\n dataTestId,\n ...rest\n}: TextareaProps, ref) => {\n\n const elementRef = useFocusVisibleRef();\n\n React.useImperativeHandle(ref, () => elementRef.current, [elementRef]);\n\n const cls = `${size} ${state || (validationMessage ? States.Invalid : '')} ${className || ''}`;\n return (\n <TextareaWrapper>\n <TextArea\n id={id}\n data-testid={dataTestId}\n ref={elementRef}\n value={value}\n placeholder={disabled ? undefined : placeholder}\n autoHeight={autoHeight}\n className={cls}\n disabled={disabled}\n onChange={(e: any) => onChange && onChange(e?.target?.value || '')}\n required={required}\n {...rest}\n />\n {validationMessage && (\n <ValidationMessage className={size || ''} type={state ?? States.Invalid}>\n {state === States.Valid ? <SystemIcons.CheckMark color={COLORS.correct_400} /> : <SystemIcons.TechnicalWarning color={COLORS.critical_400} />}\n <span>{validationMessage}</span>\n </ValidationMessage>\n )}\n {note && !disabled && (\n <NoteMessage className={size}>\n {note.icon}\n <span>{note.message}</span>\n </NoteMessage>\n )}\n </TextareaWrapper>\n );\n});\n\nexport default Textarea;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAG9B;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,iBAAiB,EAAEC,WAAW,QAAO,WAAW;AAChE,SAAQC,WAAW,EAAEC,aAAa,EAAEC,iBAAiB,QAAO,WAAW;AACvE,SAASC,MAAM,QAAQ,UAAU;;AAEjC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,UAAU;;AAEtC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,WAAW;AAEjE,SAAQC,kBAAkB,QAAO,WAAW;;AAE5C;AAAA;AAAA;AACA,IAAMC,eAAe,GAAGJ,MAAM,CAACK,GAAG,gGAE9B,UAACC,KAAK;EAAA,OA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K,gBAAG,KAAC,WAAW,CAAC,SAAS;QAAC,KAAK,EAAEvD,MAAM,CAACwD;MAAY,EAAG,gBAAG,KAAC,WAAW,CAAC,gBAAgB;QAAC,KAAK,EAAExD,MAAM,CAACyD;MAAa,EAAG,eAC7I;QAAA,UAAOjB;MAAiB,EAAQ;IAAA,EAEnC,EACAE,IAAI,IAAI,CAACH,QAAQ,iBAChB,MAAC,WAAW;MAAC,SAAS,EAAED,IAAK;MAAA,WAC1BI,IAAI,CAACgB,IAAI,eACV;QAAA,UAAOhB,IAAI,CAACiB;MAAO,EAAQ;IAAA,EAE9B;EAAA,EACe;AAEtB,CAAC,CAAC;AAEF,eAAe5B,QAAQ"}
@@ -34,7 +34,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
34
34
  var HeaderText = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n"])));
35
35
  var HeaderTitle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Bold, _styles.COLORS.black));
36
36
  var HeaderActions = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n"])));
37
- var HeaderWithImageActions = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n justify-self: flex-end;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n"])));
37
+ var HeaderWithImageActions = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n margin-left: auto;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n"])));
38
38
  var HeaderWithImage = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n"])));
39
39
  var Header = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ", " {\n height: max-content;\n }\n"])), _Tooltips.TooltipContainer);
40
40
  var Content = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ", "\n"])), (0, _styles.scrollBarStyling)(_types.Size.Small));
@@ -1 +1 @@
1
- {"version":3,"file":"ModalContent.cjs","names":["HeaderText","styled","div","HeaderTitle","ComponentMStyling","ComponentTextStyle","Bold","COLORS","black","HeaderActions","HeaderWithImageActions","HeaderWithImage","Header","TooltipContainer","Content","scrollBarStyling","Size","Small","FooterLeftContainer","FooterLeftNote","ComponentXXSStyling","neutral_600","FooterLeftLink","ComponentSStyling","primary_500","FooterRightContainer","Footer","Wrapper","ComponentLStyling","ComponentXSStyling","ComponentXLStyling","ModalContent","props","tooltip","XSmall","cursor","headerActions","map","action","index","componentType","icon","rest","id","size","getLeftActionIconElement","leftFooterAction","React","cloneElement","Large","actionType","text","variant","e","preventDefault","isModalOpen","closeAction","Medium","image","onBack","title","note","children","footerActions","item","a","key","zIndex"],"sources":["../../src/Modals/ModalContent.tsx"],"sourcesContent":["import React from 'react';\nimport {Size} from '../types';\nimport {\n ButtonAction,\n ModalHeaderIconButton,\n LeftFooterAction,\n LeftFooterButton,\n LeftFooterHyperlink,\n ModalHeaderButtons\n} from './ModalTypes';\nimport {ModalContainer} from './index';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentLStyling,\n ComponentMStyling, ComponentSStyling,\n ComponentTextStyle, ComponentXLStyling,\n ComponentXSStyling,\n ComponentXXSStyling, Note,\n scrollBarStyling\n} from '../styles';\nimport {TooltipContainer, TooltipWrapper} from '../Tooltips';\nimport {Button, IconButton} from '../Button';\nimport {SystemIcons} from '../icons';\nimport {HyperLink} from '../HyperLink';\nimport {ImageWithFallbacksProps} from \"../Image/ImageWithFallbacks\";\nimport {DropdownButton} from \"../Dropdown\";\nimport {ToggleButton} from \"../Toggles\";\nimport {ImageWithFallbacks} from \"../Image\";\n\nconst HeaderText = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n`;\nconst HeaderTitle = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.black)}\n`;\n\nconst HeaderActions = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nconst HeaderWithImageActions = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n justify-self: flex-end;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n`;\n\nconst HeaderWithImage = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n`;\n\nconst Header = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ${TooltipContainer} {\n height: max-content;\n }\n`;\n\nconst Content = styled.div`\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst FooterLeftContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst FooterLeftNote = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n ${ComponentXXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n`;\n\nconst FooterLeftLink = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.primary_500)}\n a {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n`;\n\nconst FooterRightContainer = styled.div`\n gap: 8px;\n margin-left: auto;\n`\n\nconst Footer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 8px 16px;\n`;\n\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: max-content;\n\n max-height: calc(100vh - 32px);\n max-width: calc(100vw - 32px);\n\n &.medium {\n max-height: calc(100vh - 64px);\n max-width: calc(100vw - 64px);\n\n ${Header} {\n padding: 12px 12px 4px 12px;\n\n ${HeaderText} {\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n ${HeaderTitle} {\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 16px 0 24px;\n }\n\n ${Footer} {\n padding: 12px 24px 20px 24px;\n\n ${FooterLeftNote} {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n gap: 6px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 6px;\n }\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 8px;\n }\n }\n }\n\n &.large {\n max-height: calc(100vh - 112px);\n max-width: calc(100vw - 112px);\n\n ${Header} {\n padding: 20px 20px 4px 20px;\n\n ${HeaderText} {\n padding: 10px 0 10px 12px;\n gap: 8px;\n\n ${HeaderTitle} {\n ${ComponentXLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 24px 0 32px;\n }\n\n ${Footer} {\n padding: 16px 32px 32px 32px;\n\n ${FooterLeftNote} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n gap: 8px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 8px;\n }\n\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 16px;\n }\n }\n }\n`;\n\n\ninterface ModalContentProps {\n size?: Size.Small | Size.Medium | Size.Large;\n isModalOpen: boolean;\n closeAction: () => void;\n onBack?: () => void;\n title: string;\n note?: string;\n image?: ImageWithFallbacksProps;\n headerActions?: ModalHeaderButtons[];\n footerActions?: ButtonAction[];\n leftFooterAction?: LeftFooterAction;\n tooltip?: string;\n zIndex?: number;\n children?: React.ReactNode;\n}\n\nconst ModalContent: React.FC<ModalContentProps> = (props) => {\n\n const tooltip = () =>\n !!props.tooltip &&\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"bottom\" withArrow={false}\n label={props.tooltip}>\n <IconButton variant=\"secondary\" shape=\"circular\" style={{cursor: 'help'}} action={() => {\n }}>\n <SystemIcons.Help size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </TooltipWrapper>;\n\n const headerActions = () => props.headerActions?.map((action, index) => {\n switch (action.componentType) {\n case 'icon': {\n const {icon, componentType, ...rest} = action;\n return <IconButton key={action.id || index}\n {...rest}>\n {icon}\n </IconButton>\n }\n case 'dropdown': {\n const {componentType, ...rest} = action;\n return <DropdownButton type={'icon'} size={props.size} {...rest}/>\n }\n case 'toggle': {\n const {componentType, ...rest} = action;\n return <ToggleButton {...rest}/>\n }\n }\n }\n );\n\n const getLeftActionIconElement = () =>\n !!props.leftFooterAction?.icon &&\n React.cloneElement(props.leftFooterAction?.icon as React.ReactElement, {\n size:\n props.size === Size.Small\n ? '20px'\n : props.size === Size.Large\n ? '28px'\n : '24px'\n });\n\n const leftFooterAction = () => {\n if (!props.leftFooterAction) return null;\n\n switch (props.leftFooterAction.actionType) {\n case 'button': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterButton;\n return (\n <Button{...rest}\n size={props.size}\n onClick={action}\n variant={variant ?? 'secondary'}>\n {text}\n </Button>\n );\n }\n case 'hyperlink': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterHyperlink;\n return (\n <FooterLeftLink>\n <HyperLink {...rest}\n variant={variant ?? 'default'}\n onClick={(e) => {\n if (action) {\n e.preventDefault();\n action(e);\n }\n }}>\n {text}\n {getLeftActionIconElement()}\n </HyperLink>\n </FooterLeftLink>\n );\n\n }\n case 'note': {\n const {text} = props.leftFooterAction;\n return (\n <FooterLeftNote>\n {getLeftActionIconElement()}\n <span>{text}</span>\n </FooterLeftNote>\n );\n }\n }\n };\n\n\n return (\n <ModalContainer showModal={props.isModalOpen} closeModal={props.closeAction}>\n <Wrapper className={props.size ?? Size.Medium}>\n {\n props.image &&\n <HeaderWithImage>\n <ImageWithFallbacks {...props.image}/>\n <HeaderWithImageActions>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n\n }\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderWithImageActions>\n\n <Header>\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n </HeaderActions>\n </Header>\n </HeaderWithImage>\n }\n {\n !props.image &&\n <Header>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderActions>\n </Header>\n }\n <Content>\n {props.children}\n </Content>\n <Footer>\n <FooterLeftContainer>\n {leftFooterAction()}\n </FooterLeftContainer>\n <FooterRightContainer>\n {props.footerActions?.map((item, index) => {\n const {action, text, ...rest} = item;\n return <Button key={rest.id || index}\n {...rest}\n onClick={action}\n size={props.size}\n onKeyDown={a => (a.key === 'Enter' || a.key === ' ') && action!(a)}>\n {text}\n </Button>\n }\n )}\n </FooterRightContainer>\n </Footer>\n </Wrapper>\n </ModalContainer>\n );\n};\n\nexport default ModalContent;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AASA;AACA;AACA;AASA;AACA;AACA;AACA;AAEA;AACA;AACA;AAA4C;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA;AAAA;AAE5C,IAAMA,UAAU,GAAGC,yBAAM,CAACC,GAAG,0RAa5B;AACD,IAAMC,WAAW,GAAGF,yBAAM,CAACC,GAAG,gGAC1B,IAAAE,yBAAiB,EAACC,0BAAkB,CAACC,IAAI,EAAEC,cAAM,CAACC,KAAK,CAAC,CAC3D;AAED,IAAMC,aAAa,GAAGR,yBAAM,CAACC,GAAG,iIAG/B;AAED,IAAMQ,sBAAsB,GAAGT,yBAAM,CAACC,GAAG,mbAyBxC;AAED,IAAMS,eAAe,GAAGV,yBAAM,CAACC,GAAG,yaAwBjC;AAED,IAAMU,MAAM,GAAGX,yBAAM,CAACC,GAAG,8LA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;cAAC,IAAI,EAAC,MAAM;cAAC,KAAK,EAAEjD,cAAM,CAACc;YAAY;UAAE,EAChD;QAAA,EACC;MAAA,EACT,eAEX,qBAAC,OAAO;QAAA,UACLW,KAAK,CAAC8B;MAAQ,EACP,eACV,sBAAC,MAAM;QAAA,wBACL,qBAAC,mBAAmB;UAAA,UACjBhB,gBAAgB;QAAE,EACC,eACtB,qBAAC,oBAAoB;UAAA,kCAClBd,KAAK,CAAC+B,aAAa,yDAAnB,qBAAqB1B,GAAG,CAAC,UAAC2B,IAAI,EAAEzB,KAAK,EAAK;YACvC,IAAOD,MAAM,GAAmB0B,IAAI,CAA7B1B,MAAM;cAAEa,IAAI,GAAaa,IAAI,CAArBb,IAAI;cAAKT,IAAI,0CAAIsB,IAAI;YACpC,oBAAO,qBAAC,cAAM,kCACKtB,IAAI;cACR,OAAO,EAAEJ,MAAO;cAChB,IAAI,EAAEN,KAAK,CAACY,IAAK;cACjB,SAAS,EAAE,mBAAAqB,CAAC;gBAAA,OAAI,CAACA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAID,CAAC,CAACC,GAAG,KAAK,GAAG,KAAK5B,MAAM,CAAE2B,CAAC,CAAC;cAAA,CAAC;cAAA,UAC/Ed;YAAI,IALaT,IAAI,CAACC,EAAE,IAAIJ,KAAK,CAM3B;UACX,CAAC;QACF,EACoB;MAAA,EAChB;IAAA;EACD,EACK;AAErB,CAAC;AAAC;EA7LAgB,WAAW;EACXC,WAAW;EACXG,MAAM;EACNC,KAAK;EACLC,IAAI;EAEJzB,aAAa;EACb2B,aAAa;EAEb9B,OAAO;EACPkC,MAAM;EACNL,QAAQ;AAAA;AAAA,eAoLK/B,YAAY;AAAA"}
1
+ {"version":3,"file":"ModalContent.cjs","names":["HeaderText","styled","div","HeaderTitle","ComponentMStyling","ComponentTextStyle","Bold","COLORS","black","HeaderActions","HeaderWithImageActions","HeaderWithImage","Header","TooltipContainer","Content","scrollBarStyling","Size","Small","FooterLeftContainer","FooterLeftNote","ComponentXXSStyling","neutral_600","FooterLeftLink","ComponentSStyling","primary_500","FooterRightContainer","Footer","Wrapper","ComponentLStyling","ComponentXSStyling","ComponentXLStyling","ModalContent","props","tooltip","XSmall","cursor","headerActions","map","action","index","componentType","icon","rest","id","size","getLeftActionIconElement","leftFooterAction","React","cloneElement","Large","actionType","text","variant","e","preventDefault","isModalOpen","closeAction","Medium","image","onBack","title","note","children","footerActions","item","a","key","zIndex"],"sources":["../../src/Modals/ModalContent.tsx"],"sourcesContent":["import React from 'react';\nimport {Size} from '../types';\nimport {\n ButtonAction,\n ModalHeaderIconButton,\n LeftFooterAction,\n LeftFooterButton,\n LeftFooterHyperlink,\n ModalHeaderButtons\n} from './ModalTypes';\nimport {ModalContainer} from './index';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentLStyling,\n ComponentMStyling, ComponentSStyling,\n ComponentTextStyle, ComponentXLStyling,\n ComponentXSStyling,\n ComponentXXSStyling, Note,\n scrollBarStyling\n} from '../styles';\nimport {TooltipContainer, TooltipWrapper} from '../Tooltips';\nimport {Button, IconButton} from '../Button';\nimport {SystemIcons} from '../icons';\nimport {HyperLink} from '../HyperLink';\nimport {ImageWithFallbacksProps} from \"../Image/ImageWithFallbacks\";\nimport {DropdownButton} from \"../Dropdown\";\nimport {ToggleButton} from \"../Toggles\";\nimport {ImageWithFallbacks} from \"../Image\";\n\nconst HeaderText = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n`;\nconst HeaderTitle = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.black)}\n`;\n\nconst HeaderActions = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nconst HeaderWithImageActions = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n margin-left: auto;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n`;\n\nconst HeaderWithImage = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n`;\n\nconst Header = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ${TooltipContainer} {\n height: max-content;\n }\n`;\n\nconst Content = styled.div`\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst FooterLeftContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst FooterLeftNote = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n ${ComponentXXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n`;\n\nconst FooterLeftLink = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.primary_500)}\n a {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n`;\n\nconst FooterRightContainer = styled.div`\n gap: 8px;\n margin-left: auto;\n`\n\nconst Footer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 8px 16px;\n`;\n\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: max-content;\n\n max-height: calc(100vh - 32px);\n max-width: calc(100vw - 32px);\n\n &.medium {\n max-height: calc(100vh - 64px);\n max-width: calc(100vw - 64px);\n\n ${Header} {\n padding: 12px 12px 4px 12px;\n\n ${HeaderText} {\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n ${HeaderTitle} {\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 16px 0 24px;\n }\n\n ${Footer} {\n padding: 12px 24px 20px 24px;\n\n ${FooterLeftNote} {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n gap: 6px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 6px;\n }\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 8px;\n }\n }\n }\n\n &.large {\n max-height: calc(100vh - 112px);\n max-width: calc(100vw - 112px);\n\n ${Header} {\n padding: 20px 20px 4px 20px;\n\n ${HeaderText} {\n padding: 10px 0 10px 12px;\n gap: 8px;\n\n ${HeaderTitle} {\n ${ComponentXLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 24px 0 32px;\n }\n\n ${Footer} {\n padding: 16px 32px 32px 32px;\n\n ${FooterLeftNote} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n gap: 8px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 8px;\n }\n\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 16px;\n }\n }\n }\n`;\n\n\ninterface ModalContentProps {\n size?: Size.Small | Size.Medium | Size.Large;\n isModalOpen: boolean;\n closeAction: () => void;\n onBack?: () => void;\n title: string;\n note?: string;\n image?: ImageWithFallbacksProps;\n headerActions?: ModalHeaderButtons[];\n footerActions?: ButtonAction[];\n leftFooterAction?: LeftFooterAction;\n tooltip?: string;\n zIndex?: number;\n children?: React.ReactNode;\n}\n\nconst ModalContent: React.FC<ModalContentProps> = (props) => {\n\n const tooltip = () =>\n !!props.tooltip &&\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"bottom\" withArrow={false}\n label={props.tooltip}>\n <IconButton variant=\"secondary\" shape=\"circular\" style={{cursor: 'help'}} action={() => {\n }}>\n <SystemIcons.Help size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </TooltipWrapper>;\n\n const headerActions = () => props.headerActions?.map((action, index) => {\n switch (action.componentType) {\n case 'icon': {\n const {icon, componentType, ...rest} = action;\n return <IconButton key={action.id || index}\n {...rest}>\n {icon}\n </IconButton>\n }\n case 'dropdown': {\n const {componentType, ...rest} = action;\n return <DropdownButton type={'icon'} size={props.size} {...rest}/>\n }\n case 'toggle': {\n const {componentType, ...rest} = action;\n return <ToggleButton {...rest}/>\n }\n }\n }\n );\n\n const getLeftActionIconElement = () =>\n !!props.leftFooterAction?.icon &&\n React.cloneElement(props.leftFooterAction?.icon as React.ReactElement, {\n size:\n props.size === Size.Small\n ? '20px'\n : props.size === Size.Large\n ? '28px'\n : '24px'\n });\n\n const leftFooterAction = () => {\n if (!props.leftFooterAction) return null;\n\n switch (props.leftFooterAction.actionType) {\n case 'button': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterButton;\n return (\n <Button{...rest}\n size={props.size}\n onClick={action}\n variant={variant ?? 'secondary'}>\n {text}\n </Button>\n );\n }\n case 'hyperlink': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterHyperlink;\n return (\n <FooterLeftLink>\n <HyperLink {...rest}\n variant={variant ?? 'default'}\n onClick={(e) => {\n if (action) {\n e.preventDefault();\n action(e);\n }\n }}>\n {text}\n {getLeftActionIconElement()}\n </HyperLink>\n </FooterLeftLink>\n );\n\n }\n case 'note': {\n const {text} = props.leftFooterAction;\n return (\n <FooterLeftNote>\n {getLeftActionIconElement()}\n <span>{text}</span>\n </FooterLeftNote>\n );\n }\n }\n };\n\n\n return (\n <ModalContainer showModal={props.isModalOpen} closeModal={props.closeAction}>\n <Wrapper className={props.size ?? Size.Medium}>\n {\n props.image &&\n <HeaderWithImage>\n <ImageWithFallbacks {...props.image}/>\n <HeaderWithImageActions>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n\n }\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderWithImageActions>\n\n <Header>\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n </HeaderActions>\n </Header>\n </HeaderWithImage>\n }\n {\n !props.image &&\n <Header>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderActions>\n </Header>\n }\n <Content>\n {props.children}\n </Content>\n <Footer>\n <FooterLeftContainer>\n {leftFooterAction()}\n </FooterLeftContainer>\n <FooterRightContainer>\n {props.footerActions?.map((item, index) => {\n const {action, text, ...rest} = item;\n return <Button key={rest.id || index}\n {...rest}\n onClick={action}\n size={props.size}\n onKeyDown={a => (a.key === 'Enter' || a.key === ' ') && action!(a)}>\n {text}\n </Button>\n }\n )}\n </FooterRightContainer>\n </Footer>\n </Wrapper>\n </ModalContainer>\n );\n};\n\nexport default ModalContent;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AASA;AACA;AACA;AASA;AACA;AACA;AACA;AAEA;AACA;AACA;AAA4C;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA;AAAA;AAE5C,IAAMA,UAAU,GAAGC,yBAAM,CAACC,GAAG,0RAa5B;AACD,IAAMC,WAAW,GAAGF,yBAAM,CAACC,GAAG,gGAC1B,IAAAE,yBAAiB,EAACC,0BAAkB,CAACC,IAAI,EAAEC,cAAM,CAACC,K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ACNL,QAAQ;AAAA;AAAA,eAoLK/B,YAAY;AAAA"}
@@ -28,7 +28,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
28
28
  var HeaderText = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n"])));
29
29
  var HeaderTitle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), ComponentMStyling(ComponentTextStyle.Bold, COLORS.black));
30
30
  var HeaderActions = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n"])));
31
- var HeaderWithImageActions = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n justify-self: flex-end;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n"])));
31
+ var HeaderWithImageActions = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n margin-left: auto;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n"])));
32
32
  var HeaderWithImage = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n"])));
33
33
  var Header = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ", " {\n height: max-content;\n }\n"])), TooltipContainer);
34
34
  var Content = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ", "\n"])), scrollBarStyling(Size.Small));
@@ -1 +1 @@
1
- {"version":3,"file":"ModalContent.js","names":["React","Size","ModalContainer","styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXLStyling","ComponentXSStyling","ComponentXXSStyling","Note","scrollBarStyling","TooltipContainer","TooltipWrapper","Button","IconButton","SystemIcons","HyperLink","DropdownButton","ToggleButton","ImageWithFallbacks","HeaderText","div","HeaderTitle","Bold","black","HeaderActions","HeaderWithImageActions","HeaderWithImage","Header","Content","Small","FooterLeftContainer","FooterLeftNote","neutral_600","FooterLeftLink","primary_500","FooterRightContainer","Footer","Wrapper","ModalContent","props","tooltip","XSmall","cursor","headerActions","map","action","index","componentType","icon","rest","id","size","getLeftActionIconElement","leftFooterAction","cloneElement","Large","actionType","text","variant","e","preventDefault","isModalOpen","closeAction","Medium","image","onBack","title","note","children","footerActions","item","a","key","zIndex"],"sources":["../../src/Modals/ModalContent.tsx"],"sourcesContent":["import React from 'react';\nimport {Size} from '../types';\nimport {\n ButtonAction,\n ModalHeaderIconButton,\n LeftFooterAction,\n LeftFooterButton,\n LeftFooterHyperlink,\n ModalHeaderButtons\n} from './ModalTypes';\nimport {ModalContainer} from './index';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentLStyling,\n ComponentMStyling, ComponentSStyling,\n ComponentTextStyle, ComponentXLStyling,\n ComponentXSStyling,\n ComponentXXSStyling, Note,\n scrollBarStyling\n} from '../styles';\nimport {TooltipContainer, TooltipWrapper} from '../Tooltips';\nimport {Button, IconButton} from '../Button';\nimport {SystemIcons} from '../icons';\nimport {HyperLink} from '../HyperLink';\nimport {ImageWithFallbacksProps} from \"../Image/ImageWithFallbacks\";\nimport {DropdownButton} from \"../Dropdown\";\nimport {ToggleButton} from \"../Toggles\";\nimport {ImageWithFallbacks} from \"../Image\";\n\nconst HeaderText = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n`;\nconst HeaderTitle = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.black)}\n`;\n\nconst HeaderActions = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nconst HeaderWithImageActions = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n justify-self: flex-end;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n`;\n\nconst HeaderWithImage = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n`;\n\nconst Header = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ${TooltipContainer} {\n height: max-content;\n }\n`;\n\nconst Content = styled.div`\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst FooterLeftContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst FooterLeftNote = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n ${ComponentXXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n`;\n\nconst FooterLeftLink = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.primary_500)}\n a {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n`;\n\nconst FooterRightContainer = styled.div`\n gap: 8px;\n margin-left: auto;\n`\n\nconst Footer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 8px 16px;\n`;\n\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: max-content;\n\n max-height: calc(100vh - 32px);\n max-width: calc(100vw - 32px);\n\n &.medium {\n max-height: calc(100vh - 64px);\n max-width: calc(100vw - 64px);\n\n ${Header} {\n padding: 12px 12px 4px 12px;\n\n ${HeaderText} {\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n ${HeaderTitle} {\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 16px 0 24px;\n }\n\n ${Footer} {\n padding: 12px 24px 20px 24px;\n\n ${FooterLeftNote} {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n gap: 6px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 6px;\n }\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 8px;\n }\n }\n }\n\n &.large {\n max-height: calc(100vh - 112px);\n max-width: calc(100vw - 112px);\n\n ${Header} {\n padding: 20px 20px 4px 20px;\n\n ${HeaderText} {\n padding: 10px 0 10px 12px;\n gap: 8px;\n\n ${HeaderTitle} {\n ${ComponentXLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 24px 0 32px;\n }\n\n ${Footer} {\n padding: 16px 32px 32px 32px;\n\n ${FooterLeftNote} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n gap: 8px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 8px;\n }\n\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 16px;\n }\n }\n }\n`;\n\n\ninterface ModalContentProps {\n size?: Size.Small | Size.Medium | Size.Large;\n isModalOpen: boolean;\n closeAction: () => void;\n onBack?: () => void;\n title: string;\n note?: string;\n image?: ImageWithFallbacksProps;\n headerActions?: ModalHeaderButtons[];\n footerActions?: ButtonAction[];\n leftFooterAction?: LeftFooterAction;\n tooltip?: string;\n zIndex?: number;\n children?: React.ReactNode;\n}\n\nconst ModalContent: React.FC<ModalContentProps> = (props) => {\n\n const tooltip = () =>\n !!props.tooltip &&\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"bottom\" withArrow={false}\n label={props.tooltip}>\n <IconButton variant=\"secondary\" shape=\"circular\" style={{cursor: 'help'}} action={() => {\n }}>\n <SystemIcons.Help size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </TooltipWrapper>;\n\n const headerActions = () => props.headerActions?.map((action, index) => {\n switch (action.componentType) {\n case 'icon': {\n const {icon, componentType, ...rest} = action;\n return <IconButton key={action.id || index}\n {...rest}>\n {icon}\n </IconButton>\n }\n case 'dropdown': {\n const {componentType, ...rest} = action;\n return <DropdownButton type={'icon'} size={props.size} {...rest}/>\n }\n case 'toggle': {\n const {componentType, ...rest} = action;\n return <ToggleButton {...rest}/>\n }\n }\n }\n );\n\n const getLeftActionIconElement = () =>\n !!props.leftFooterAction?.icon &&\n React.cloneElement(props.leftFooterAction?.icon as React.ReactElement, {\n size:\n props.size === Size.Small\n ? '20px'\n : props.size === Size.Large\n ? '28px'\n : '24px'\n });\n\n const leftFooterAction = () => {\n if (!props.leftFooterAction) return null;\n\n switch (props.leftFooterAction.actionType) {\n case 'button': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterButton;\n return (\n <Button{...rest}\n size={props.size}\n onClick={action}\n variant={variant ?? 'secondary'}>\n {text}\n </Button>\n );\n }\n case 'hyperlink': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterHyperlink;\n return (\n <FooterLeftLink>\n <HyperLink {...rest}\n variant={variant ?? 'default'}\n onClick={(e) => {\n if (action) {\n e.preventDefault();\n action(e);\n }\n }}>\n {text}\n {getLeftActionIconElement()}\n </HyperLink>\n </FooterLeftLink>\n );\n\n }\n case 'note': {\n const {text} = props.leftFooterAction;\n return (\n <FooterLeftNote>\n {getLeftActionIconElement()}\n <span>{text}</span>\n </FooterLeftNote>\n );\n }\n }\n };\n\n\n return (\n <ModalContainer showModal={props.isModalOpen} closeModal={props.closeAction}>\n <Wrapper className={props.size ?? Size.Medium}>\n {\n props.image &&\n <HeaderWithImage>\n <ImageWithFallbacks {...props.image}/>\n <HeaderWithImageActions>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n\n }\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderWithImageActions>\n\n <Header>\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n </HeaderActions>\n </Header>\n </HeaderWithImage>\n }\n {\n !props.image &&\n <Header>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderActions>\n </Header>\n }\n <Content>\n {props.children}\n </Content>\n <Footer>\n <FooterLeftContainer>\n {leftFooterAction()}\n </FooterLeftContainer>\n <FooterRightContainer>\n {props.footerActions?.map((item, index) => {\n const {action, text, ...rest} = item;\n return <Button key={rest.id || index}\n {...rest}\n onClick={action}\n size={props.size}\n onKeyDown={a => (a.key === 'Enter' || a.key === ' ') && action!(a)}>\n {text}\n </Button>\n }\n )}\n </FooterRightContainer>\n </Footer>\n </Wrapper>\n </ModalContainer>\n );\n};\n\nexport default ModalContent;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,UAAU;AAS7B,SAAQC,cAAc,QAAO,SAAS;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SACEC,MAAM,EACNC,iBAAiB,EACjBC,iBAAiB,EAAEC,iBAAiB,EACpCC,kBAAkB,EAAEC,kBAAkB,EACtCC,kBAAkB,EAClBC,mBAAmB,EAAEC,IAAI,EACzBC,gBAAgB,QACX,WAAW;AAClB,SAAQC,gBAAgB,EAAEC,cAAc,QAAO,aAAa;AAC5D,SAAQC,MAAM,EAAEC,UAAU,QAAO,WAAW;AAC5C,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,SAAS,QAAO,cAAc;AAEtC,SAAQC,cAAc,QAAO,aAAa;AAC1C,SAAQC,YAAY,QAAO,YAAY;AACvC,SAAQC,kBAAkB,QAAO,UAAU;AAAC;AAAA;AAE5C,IAAMC,UAAU,GAAGpB,MAAM,CAACqB,GAAG,4QAa5B;AACD,IAAMC,WAAW,GAAGtB,MAAM,CAACqB,GAAG,kFAC1BlB,iBAAiB,CAACE,kBAAkB,CAACkB,IAAI,EAAEtB,MAAM,CAACuB,KAAK,CAAC,CAC3D;AAED,IAAMC,aAAa,GAAGzB,MAAM,CAACqB,GAAG,mHAG/B;AAED,IAAMK,sBAAsB,GAAG1B,MAAM,CAACqB,GAAG,qaAyBxC;AAED,IAAMM,eAAe,GAAG3B,MAAM,CAACqB,GAAG,2ZAwBjC;AAED,IAAMO,MAAM,GAAG5B,MAAM,CAACqB,GAAG,gLAKrBV,gBAAgB,CAGnB;AAED,IAA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6B;MAAQ,EACP,eACV,MAAC,MAAM;QAAA,wBACL,KAAC,mBAAmB;UAAA,UACjBf,gBAAgB;QAAE,EACC,eACtB,KAAC,oBAAoB;UAAA,kCAClBd,KAAK,CAAC8B,aAAa,yDAAnB,qBAAqBzB,GAAG,CAAC,UAAC0B,IAAI,EAAExB,KAAK,EAAK;YACvC,IAAOD,MAAM,GAAmByB,IAAI,CAA7BzB,MAAM;cAAEY,IAAI,GAAaa,IAAI,CAArBb,IAAI;cAAKR,IAAI,4BAAIqB,IAAI;YACpC,oBAAO,KAAC,MAAM,kCACKrB,IAAI;cACR,OAAO,EAAEJ,MAAO;cAChB,IAAI,EAAEN,KAAK,CAACY,IAAK;cACjB,SAAS,EAAE,mBAAAoB,CAAC;gBAAA,OAAI,CAACA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAID,CAAC,CAACC,GAAG,KAAK,GAAG,KAAK3B,MAAM,CAAE0B,CAAC,CAAC;cAAA,CAAC;cAAA,UAC/Ed;YAAI,IALaR,IAAI,CAACC,EAAE,IAAIJ,KAAK,CAM3B;UACX,CAAC;QACF,EACoB;MAAA,EAChB;IAAA;EACD,EACK;AAErB,CAAC;AAAC;EA7LAe,WAAW;EACXC,WAAW;EACXG,MAAM;EACNC,KAAK;EACLC,IAAI;EAEJxB,aAAa;EACb0B,aAAa;EAEb7B,OAAO;EACPiC,MAAM;EACNL,QAAQ;AAAA;AAoLV,eAAe9B,YAAY"}
1
+ {"version":3,"file":"ModalContent.js","names":["React","Size","ModalContainer","styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXLStyling","ComponentXSStyling","ComponentXXSStyling","Note","scrollBarStyling","TooltipContainer","TooltipWrapper","Button","IconButton","SystemIcons","HyperLink","DropdownButton","ToggleButton","ImageWithFallbacks","HeaderText","div","HeaderTitle","Bold","black","HeaderActions","HeaderWithImageActions","HeaderWithImage","Header","Content","Small","FooterLeftContainer","FooterLeftNote","neutral_600","FooterLeftLink","primary_500","FooterRightContainer","Footer","Wrapper","ModalContent","props","tooltip","XSmall","cursor","headerActions","map","action","index","componentType","icon","rest","id","size","getLeftActionIconElement","leftFooterAction","cloneElement","Large","actionType","text","variant","e","preventDefault","isModalOpen","closeAction","Medium","image","onBack","title","note","children","footerActions","item","a","key","zIndex"],"sources":["../../src/Modals/ModalContent.tsx"],"sourcesContent":["import React from 'react';\nimport {Size} from '../types';\nimport {\n ButtonAction,\n ModalHeaderIconButton,\n LeftFooterAction,\n LeftFooterButton,\n LeftFooterHyperlink,\n ModalHeaderButtons\n} from './ModalTypes';\nimport {ModalContainer} from './index';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentLStyling,\n ComponentMStyling, ComponentSStyling,\n ComponentTextStyle, ComponentXLStyling,\n ComponentXSStyling,\n ComponentXXSStyling, Note,\n scrollBarStyling\n} from '../styles';\nimport {TooltipContainer, TooltipWrapper} from '../Tooltips';\nimport {Button, IconButton} from '../Button';\nimport {SystemIcons} from '../icons';\nimport {HyperLink} from '../HyperLink';\nimport {ImageWithFallbacksProps} from \"../Image/ImageWithFallbacks\";\nimport {DropdownButton} from \"../Dropdown\";\nimport {ToggleButton} from \"../Toggles\";\nimport {ImageWithFallbacks} from \"../Image\";\n\nconst HeaderText = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n &:not(:first-child) {\n padding-left: 0 !important;\n }\n\n`;\nconst HeaderTitle = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.black)}\n`;\n\nconst HeaderActions = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nconst HeaderWithImageActions = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: absolute;\n\n button:only-child {\n margin-left: auto;\n }\n\n top: 4px;\n left: 4px;\n right: 4px;\n\n .medium & {\n top: 12px;\n left: 12px;\n right: 12px;\n }\n\n .large & {\n top: 20px;\n left: 20px;\n right: 20px;\n }\n`;\n\nconst HeaderWithImage = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n\n img {\n object-fit: cover;\n width: 100%;\n height: 160px;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n }\n\n .medium & {\n img {\n height: 200px;\n }\n }\n\n .large & {\n img {\n height: 240px;\n }\n }\n`;\n\nconst Header = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px;\n\n ${TooltipContainer} {\n height: max-content;\n }\n`;\n\nconst Content = styled.div`\n margin-right: 8px;\n padding: 0 8px 0 16px;\n overflow: auto;\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst FooterLeftContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst FooterLeftNote = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n\n ${ComponentXXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n`;\n\nconst FooterLeftLink = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.primary_500)}\n a {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n`;\n\nconst FooterRightContainer = styled.div`\n gap: 8px;\n margin-left: auto;\n`\n\nconst Footer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 8px 16px;\n`;\n\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: max-content;\n\n max-height: calc(100vh - 32px);\n max-width: calc(100vw - 32px);\n\n &.medium {\n max-height: calc(100vh - 64px);\n max-width: calc(100vw - 64px);\n\n ${Header} {\n padding: 12px 12px 4px 12px;\n\n ${HeaderText} {\n padding: 12px 0 12px 12px;\n gap: 4px;\n\n ${HeaderTitle} {\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 16px 0 24px;\n }\n\n ${Footer} {\n padding: 12px 24px 20px 24px;\n\n ${FooterLeftNote} {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n gap: 6px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 6px;\n }\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 8px;\n }\n }\n }\n\n &.large {\n max-height: calc(100vh - 112px);\n max-width: calc(100vw - 112px);\n\n ${Header} {\n padding: 20px 20px 4px 20px;\n\n ${HeaderText} {\n padding: 10px 0 10px 12px;\n gap: 8px;\n\n ${HeaderTitle} {\n ${ComponentXLStyling(ComponentTextStyle.Bold, null)}\n }\n }\n }\n\n ${Content} {\n padding: 0 24px 0 32px;\n }\n\n ${Footer} {\n padding: 16px 32px 32px 32px;\n\n ${FooterLeftNote} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n gap: 8px;\n }\n\n ${FooterLeftLink} {\n a {\n gap: 8px;\n }\n\n ${ComponentLStyling(ComponentTextStyle.Bold, null)}\n }\n\n ${FooterRightContainer} {\n gap: 16px;\n }\n }\n }\n`;\n\n\ninterface ModalContentProps {\n size?: Size.Small | Size.Medium | Size.Large;\n isModalOpen: boolean;\n closeAction: () => void;\n onBack?: () => void;\n title: string;\n note?: string;\n image?: ImageWithFallbacksProps;\n headerActions?: ModalHeaderButtons[];\n footerActions?: ButtonAction[];\n leftFooterAction?: LeftFooterAction;\n tooltip?: string;\n zIndex?: number;\n children?: React.ReactNode;\n}\n\nconst ModalContent: React.FC<ModalContentProps> = (props) => {\n\n const tooltip = () =>\n !!props.tooltip &&\n <TooltipWrapper delay=\"0s\" size={Size.XSmall} align=\"center\" position=\"bottom\" withArrow={false}\n label={props.tooltip}>\n <IconButton variant=\"secondary\" shape=\"circular\" style={{cursor: 'help'}} action={() => {\n }}>\n <SystemIcons.Help size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </TooltipWrapper>;\n\n const headerActions = () => props.headerActions?.map((action, index) => {\n switch (action.componentType) {\n case 'icon': {\n const {icon, componentType, ...rest} = action;\n return <IconButton key={action.id || index}\n {...rest}>\n {icon}\n </IconButton>\n }\n case 'dropdown': {\n const {componentType, ...rest} = action;\n return <DropdownButton type={'icon'} size={props.size} {...rest}/>\n }\n case 'toggle': {\n const {componentType, ...rest} = action;\n return <ToggleButton {...rest}/>\n }\n }\n }\n );\n\n const getLeftActionIconElement = () =>\n !!props.leftFooterAction?.icon &&\n React.cloneElement(props.leftFooterAction?.icon as React.ReactElement, {\n size:\n props.size === Size.Small\n ? '20px'\n : props.size === Size.Large\n ? '28px'\n : '24px'\n });\n\n const leftFooterAction = () => {\n if (!props.leftFooterAction) return null;\n\n switch (props.leftFooterAction.actionType) {\n case 'button': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterButton;\n return (\n <Button{...rest}\n size={props.size}\n onClick={action}\n variant={variant ?? 'secondary'}>\n {text}\n </Button>\n );\n }\n case 'hyperlink': {\n const {text, variant, action, ...rest} = props.leftFooterAction as LeftFooterHyperlink;\n return (\n <FooterLeftLink>\n <HyperLink {...rest}\n variant={variant ?? 'default'}\n onClick={(e) => {\n if (action) {\n e.preventDefault();\n action(e);\n }\n }}>\n {text}\n {getLeftActionIconElement()}\n </HyperLink>\n </FooterLeftLink>\n );\n\n }\n case 'note': {\n const {text} = props.leftFooterAction;\n return (\n <FooterLeftNote>\n {getLeftActionIconElement()}\n <span>{text}</span>\n </FooterLeftNote>\n );\n }\n }\n };\n\n\n return (\n <ModalContainer showModal={props.isModalOpen} closeModal={props.closeAction}>\n <Wrapper className={props.size ?? Size.Medium}>\n {\n props.image &&\n <HeaderWithImage>\n <ImageWithFallbacks {...props.image}/>\n <HeaderWithImageActions>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n\n }\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderWithImageActions>\n\n <Header>\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n </HeaderActions>\n </Header>\n </HeaderWithImage>\n }\n {\n !props.image &&\n <Header>\n {\n props.onBack &&\n <IconButton variant=\"secondary\" shape=\"circular\" action={props.onBack}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n <HeaderText>\n <HeaderTitle>{props.title}</HeaderTitle>\n {!!props.note && <Note>{props.note}</Note>}\n </HeaderText>\n <HeaderActions>\n {tooltip()}\n {headerActions()}\n <IconButton dataTestId={'content-modal-close-button'} id={'content-modal-close-button'}\n variant=\"secondary\"\n shape=\"circular\"\n action={props.closeAction}>\n <SystemIcons.Close size=\"24px\" color={COLORS.neutral_600}/>\n </IconButton>\n </HeaderActions>\n </Header>\n }\n <Content>\n {props.children}\n </Content>\n <Footer>\n <FooterLeftContainer>\n {leftFooterAction()}\n </FooterLeftContainer>\n <FooterRightContainer>\n {props.footerActions?.map((item, index) => {\n const {action, text, ...rest} = item;\n return <Button key={rest.id || index}\n {...rest}\n onClick={action}\n size={props.size}\n onKeyDown={a => (a.key === 'Enter' || a.key === ' ') && action!(a)}>\n {text}\n </Button>\n }\n )}\n </FooterRightContainer>\n </Footer>\n </Wrapper>\n </ModalContainer>\n );\n};\n\nexport default ModalContent;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,UAAU;AAS7B,SAAQC,cAAc,QAAO,SAAS;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SACEC,MAAM,EACNC,iBAAiB,EACjBC,iBAAiB,EAAEC,iBAAiB,EACpCC,kBAAkB,EAAEC,kBAAkB,EACtCC,kBAAkB,EAClBC,mBAAmB,EAAEC,IAAI,EACzBC,gBAAgB,QACX,WAAW;AAClB,SAAQC,gBAAgB,EAAEC,cAAc,QAAO,aAAa;AAC5D,SAAQC,MAAM,EAAEC,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A,UAC/Ed;YAAI,IALaR,IAAI,CAACC,EAAE,IAAIJ,KAAK,CAM3B;UACX,CAAC;QACF,EACoB;MAAA,EAChB;IAAA;EACD,EACK;AAErB,CAAC;AAAC;EA7LAe,WAAW;EACXC,WAAW;EACXG,MAAM;EACNC,KAAK;EACLC,IAAI;EAEJxB,aAAa;EACb0B,aAAa;EAEb7B,OAAO;EACPiC,MAAM;EACNL,QAAQ;AAAA;AAoLV,eAAe9B,YAAY"}
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _Button = require("../Button");
13
14
  var _types = require("../types");
@@ -19,11 +20,14 @@ var _TableStyles = require("./TableStyles");
19
20
  var _common = require("../common");
20
21
  var _icons = require("../icons");
21
22
  var _rooks = require("rooks");
23
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
22
24
  var _jsxRuntime = require("react/jsx-runtime");
25
+ var _templateObject;
23
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
28
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
29
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
30
+ var ColumnLabel = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])));
27
31
  var TableBody = function TableBody(props) {
28
32
  var _props$noRowsLabel;
29
33
  var _useDimensionsRef = (0, _rooks.useDimensionsRef)({
@@ -114,8 +118,15 @@ var TableBody = function TableBody(props) {
114
118
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
115
119
  children: [column.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellIcon, {
116
120
  children: column.icon
117
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellText, {
118
- children: row[column.key]
121
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableCellTextWrapper, {
122
+ textWrap: !column.shortenText,
123
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellText, {
124
+ children: row[column.key]
125
+ }), Boolean(column.noteKey) && Boolean(row[column.noteKey]) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
126
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellNoteText, {
127
+ children: row[column.noteKey]
128
+ })
129
+ })]
119
130
  })]
120
131
  });
121
132
  }
@@ -164,13 +175,13 @@ var TableBody = function TableBody(props) {
164
175
  tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
165
176
  className: "".concat(!!column.sortable ? 'sortable' : '', " ").concat(column.key === ((_props$sortProps6 = props.sortProps) === null || _props$sortProps6 === void 0 ? void 0 : _props$sortProps6.column) && !!((_props$sortProps7 = props.sortProps) !== null && _props$sortProps7 !== void 0 && _props$sortProps7.direction) ? 'sorted' : '', " ").concat(column.justify || ''),
166
177
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TableStyles.StyledTableHeaderColumnContent, {
167
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
178
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ColumnLabel, {
168
179
  children: column.name
169
180
  }), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableHeaderColumnSortDirection, {
170
181
  children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineUp, {
171
- size: '24px'
182
+ size: '20px'
172
183
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ArrowLineDown, {
173
- size: '24px'
184
+ size: '20px'
174
185
  })
175
186
  })]
176
187
  })
@@ -203,8 +214,9 @@ var TableBody = function TableBody(props) {
203
214
  style: {
204
215
  maxWidth: column.width
205
216
  },
206
- title: column.shortenText && row[column.key],
217
+ title: column.shortenText ? "".concat(row[column.key], " \n ").concat(column.noteKey ? row[column.noteKey] : '') : '',
207
218
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TableStyles.StyledTableCellContent, {
219
+ withNote: Boolean(column.noteKey),
208
220
  className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
209
221
  style: {
210
222
  color: column.colorFn && column.colorFn(row, column.key)
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.cjs","names":["TableBody","props","useDimensionsRef","updateOnResize","scrollContainerRef","dimensions","node","React","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","defaultOnMouseDownHandler","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","shortenText","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import {TableColumn, TableProps} from './TableTypes';\nimport {Button} from '../Button';\nimport {Size} from '../types';\nimport * as React from 'react';\nimport {Checkbox} from '../InputFields';\nimport {ButtonProps} from '../Button/Button';\nimport IconButton, {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\nimport {HyperLink} from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection,\n} from './TableStyles';\nimport {defaultOnMouseDownHandler} from '../common';\nimport {SystemIcons} from \"../icons\";\nimport {useDimensionsRef} from \"rooks\";\n\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({updateOnResize: true});\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = ({\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as HyperlinkProps;\n return (\n <HyperLink style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = ({\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps\n }) as IconButtonProps;\n return <IconButton {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n }\n case 'button': {\n const tmp = ({\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps\n }) as ButtonProps;\n return <Button style={column.colorFn && {color: column.colorFn(row, column.key)}}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true}/>;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {\n column.icon &&\n <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>\n }\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n </>\n );\n }\n }\n\n const isSelected = (row: any) => {\n return (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row));\n }\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {\n props.multiSelect &&\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}/>\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column)\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? \n (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending' ) \n : undefined}\n style={{width: column.width}}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${column.justify || ''}`}>\n <StyledTableHeaderColumnContent>\n <span>\n {column.name}\n </span>\n {\n column.key === props.sortProps?.column &&\n (\n <StyledTableHeaderColumnSortDirection>\n {\n props.sortProps?.direction === 'asc'\n ? <SystemIcons.ArrowLineUp size={'24px'}/>\n : <SystemIcons.ArrowLineDown size={'24px'}/>\n }\n </StyledTableHeaderColumnSortDirection>\n )\n }\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {\n props.multiSelect &&\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)}/>\n </StyledTableCellContent>\n </StyledTableCell>\n }\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`}\n style={{maxWidth: column.width}}\n title={column.shortenText && row[column.key]}>\n <StyledTableCellContent\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>\n {props.noRowsLabel ?? 'There are no rows to display'}\n </StyledTableCellContent>\n </StyledTableCell>\n </Styled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BAAK,CAAE;gBAChC,KAAK,EAAEvC,MAAM,CAACgD,WAAW,IAAI/C,GAAG,CAACD,MAAM,CAACW,GAAG,CAAE;gBAAA,uBAC5D,qBAAC,mCAAsB;kBACrB,SAAS,YAAKX,MAAM,CAACgD,WAAW,qBAAqB,EAAE,cAAIhD,MAAM,CAACwC,OAAO,IAAI,EAAE,CAAG;kBAClF,KAAK,EAAE;oBACL9B,KAAK,EAAEV,MAAM,CAACS,OAAO,IAAIT,MAAM,CAACS,OAAO,CAACR,GAAG,EAAED,MAAM,CAACW,GAAG;kBACzD,CAAE;kBAAA,UACDZ,cAAc,CAACC,MAAM,EAAEC,GAAG;gBAAC;cACL,iBATE2C,KAAK,cAAI5C,MAAM,CAACW,GAAG,EAU9B;YAAA,CACnB,CAAC;UAAA,iBA/B4BiC,KAAK,EAgChB;QAAA,CACtB,CAAC,gBAEF,qBAAC,sCAAyB;UAAC,eAAY,oBAAoB;UAAA,uBACzD,qBAAC,4BAAe;YAAC,OAAO,EAAE5D,KAAK,CAACa,OAAO,CAAC8C,MAAM,IAAI3D,KAAK,CAACyC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAA,uBAC3E,qBAAC,mCAAsB;cAAC,SAAS,EAAE,QAAS;cAAA,gCACzCzC,KAAK,CAACiE,WAAW,mEAAI;YAA8B;UAC7B;QACT;MAErB,EAEe;IAAA;EACN,EACS;AAE7B,CAAC;AACF;EA3MCP,eAAe;EACfI,UAAU;EACVpB,QAAQ;EACRS,YAAY;EACZJ,gBAAgB;EAChBD,cAAc,4BAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AAAA,eAwM1B/C,SAAS;AAAA"}
1
+ {"version":3,"file":"TableBody.cjs","names":["ColumnLabel","styled","span","TableBody","props","useDimensionsRef","updateOnResize","scrollContainerRef","dimensions","node","React","useState","scrollable","setScrollable","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","colorFn","color","key","e","preventDefault","stopPropagation","action","iconColor","shape","useTransparentBackground","icon","size","Size","Small","customContent","shortenText","Boolean","noteKey","isSelected","multiSelect","selected","indexOf","keyExpr","layout","selectAllState","onSelectAllClick","map","defaultOnMouseDownHandler","sortable","sortByColumn","sortProps","direction","undefined","width","justify","name","currentPageRows","length","index","selectable","onRowClick","maxWidth","noRowsLabel"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\nimport { Button } from '../Button';\nimport { Size } from '../types';\nimport * as React from 'react';\nimport { Checkbox } from '../InputFields';\nimport { ButtonProps } from '../Button/Button';\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { HyperLink } from '../HyperLink';\nimport {\n StyledTableBody,\n StyledTableBodyRow,\n StyledTableCell,\n StyledTableCellContent,\n StyledTableCellIcon,\n StyledTableCellText,\n StyledTableHeaderColumn,\n StyledTableHeaderColumnContent,\n StyledTableHeaderColumns,\n StyledTableNoRowsLabelRow,\n StyledTable,\n StyledTableBodyWrapper,\n StyledTableHeaderRow,\n StyledTableHeaderColumnSortDirection,\n StyledTableCellNoteText,\n StyledTableCellTextWrapper,\n} from './TableStyles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { SystemIcons } from '../icons';\nimport { useDimensionsRef } from 'rooks';\nimport styled from 'styled-components';\n\ninterface TableBodyProps extends TableProps {\n currentPageRows: any[];\n onRowClick?: (row: any) => void;\n selected?: any | any[];\n sortByColumn: (column: TableColumn) => void;\n onSelectAllClick: () => void;\n selectAllState: 'all' | 'some' | 'none';\n}\n\nconst ColumnLabel = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nconst TableBody: React.FC<TableBodyProps> = (props) => {\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\n const [scrollable, setScrollable] = React.useState(false);\n\n React.useEffect(() => {\n const clientWidth = node?.clientWidth ?? 0;\n const scrollWidth = node?.scrollWidth ?? 0;\n setScrollable(scrollWidth > clientWidth);\n }, [dimensions, node, props.columns, props.rows]);\n\n const renderCellBody = (column: TableColumn, row: any) => {\n switch (column.type) {\n case 'link': {\n const tmp = {\n variant: 'default',\n href: '#',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as HyperlinkProps;\n return (\n <HyperLink\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </HyperLink>\n );\n }\n case 'icon': {\n const tmp = {\n iconColor: column.colorFn && column.colorFn(row, column.key),\n variant: 'secondary',\n shape: 'circular',\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n useTransparentBackground: true,\n ...column.additionalProps,\n } as IconButtonProps;\n return (\n <IconButton\n {...tmp}\n action={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {column.icon}\n </IconButton>\n );\n }\n case 'button': {\n const tmp = {\n variant: 'tertiary',\n size: Size.Small,\n tabIndex: props.showLoadingIndicator ? -1 : 0,\n ...column.additionalProps,\n } as ButtonProps;\n return (\n <Button\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\n {...tmp}\n onClick={(e) => {\n e?.stopPropagation();\n column.action && column.action(row, e);\n }}>\n {row[column.key]}\n </Button>\n );\n }\n case 'boolean':\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\n case 'custom':\n return column.customContent && column.customContent(row, column.key);\n case 'number':\n case 'text':\n default:\n return (\n <>\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\n <StyledTableCellTextWrapper textWrap={!column.shortenText}>\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\n <>\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\n </>\n )}\n </StyledTableCellTextWrapper>\n </>\n );\n }\n };\n\n const isSelected = (row: any) => {\n return (\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\n );\n };\n\n return (\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\n <StyledTableHeaderRow>\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\n {props.multiSelect && (\n <StyledTableHeaderColumn>\n <StyledTableHeaderColumnContent>\n <Checkbox\n selected={props.selectAllState === 'all'}\n disabled={props.showLoadingIndicator}\n semiSelected={props.selectAllState === 'some'}\n select={props.onSelectAllClick}\n />\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableHeaderColumn\n key={column.key}\n onMouseDown={defaultOnMouseDownHandler}\n onClick={(e) => column.sortable && props.sortByColumn(column)}\n onKeyPress={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n column.sortable && props.sortByColumn(column);\n }\n }}\n aria-pressed={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\n style={{ width: column.width }}\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\n column.justify || ''\n }`}>\n <StyledTableHeaderColumnContent>\n <ColumnLabel>{column.name}</ColumnLabel>\n {column.key === props.sortProps?.column && (\n <StyledTableHeaderColumnSortDirection>\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\n </StyledTableHeaderColumnSortDirection>\n )}\n </StyledTableHeaderColumnContent>\n </StyledTableHeaderColumn>\n ))}\n </StyledTableHeaderColumns>\n </StyledTableHeaderRow>\n <StyledTableBody>\n {props.currentPageRows.length > 0 ? (\n props.currentPageRows.map((row: any, index: number) => (\n <StyledTableBodyRow\n key={`row_${index}`}\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\n onClick={() => props.onRowClick && props.onRowClick(row)}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n props.onRowClick && props.onRowClick(row);\n }\n }}\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\n data-testid=\"TestTableDataRow\">\n {props.multiSelect && (\n <StyledTableCell>\n <StyledTableCellContent>\n <Checkbox selected={isSelected(row)} />\n </StyledTableCellContent>\n </StyledTableCell>\n )}\n {props.columns.map((column: TableColumn) => (\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\n <StyledTableCellContent\n withNote={Boolean(column.noteKey)}\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\n style={{\n color: column.colorFn && column.colorFn(row, column.key),\n }}>\n {renderCellBody(column, row)}\n </StyledTableCellContent>\n </StyledTableCell>\n ))}\n </StyledTableBodyRow>\n ))\n ) : (\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\n </StyledTableCell>\n </StyledTableNoRowsLabelRow>\n )}\n </StyledTableBody>\n </StyledTable>\n </StyledTableBodyWrapper>\n );\n};\nexport default TableBody;\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAkBA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AA;EACN,EACS;AAE7B,CAAC;AAAC;EAhNAN,eAAe;EACfI,UAAU;EACVpB,QAAQ;EACRS,YAAY;EACZJ,gBAAgB;EAChBD,cAAc,4BAAE,KAAK,EAAG,MAAM,EAAG,MAAM;AAAA;AAAA,eA4M1BlD,SAAS;AAAA"}
@@ -1,6 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
3
4
  import _pt from "prop-types";
5
+ var _templateObject;
4
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
8
  import { Button } from '../Button';
@@ -9,13 +11,15 @@ import * as React from 'react';
9
11
  import { Checkbox } from '../InputFields';
10
12
  import IconButton from '../Button/Iconbutton';
11
13
  import { HyperLink } from '../HyperLink';
12
- import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection } from './TableStyles';
14
+ import { StyledTableBody, StyledTableBodyRow, StyledTableCell, StyledTableCellContent, StyledTableCellIcon, StyledTableCellText, StyledTableHeaderColumn, StyledTableHeaderColumnContent, StyledTableHeaderColumns, StyledTableNoRowsLabelRow, StyledTable, StyledTableBodyWrapper, StyledTableHeaderRow, StyledTableHeaderColumnSortDirection, StyledTableCellNoteText, StyledTableCellTextWrapper } from './TableStyles';
13
15
  import { defaultOnMouseDownHandler } from '../common';
14
- import { SystemIcons } from "../icons";
15
- import { useDimensionsRef } from "rooks";
16
+ import { SystemIcons } from '../icons';
17
+ import { useDimensionsRef } from 'rooks';
18
+ import styled from 'styled-components';
16
19
  import { jsx as _jsx } from "react/jsx-runtime";
17
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
18
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ var ColumnLabel = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])));
19
23
  var TableBody = function TableBody(props) {
20
24
  var _props$noRowsLabel;
21
25
  var _useDimensionsRef = useDimensionsRef({
@@ -106,8 +110,15 @@ var TableBody = function TableBody(props) {
106
110
  return /*#__PURE__*/_jsxs(_Fragment, {
107
111
  children: [column.icon && /*#__PURE__*/_jsx(StyledTableCellIcon, {
108
112
  children: column.icon
109
- }), /*#__PURE__*/_jsx(StyledTableCellText, {
110
- children: row[column.key]
113
+ }), /*#__PURE__*/_jsxs(StyledTableCellTextWrapper, {
114
+ textWrap: !column.shortenText,
115
+ children: [/*#__PURE__*/_jsx(StyledTableCellText, {
116
+ children: row[column.key]
117
+ }), Boolean(column.noteKey) && Boolean(row[column.noteKey]) && /*#__PURE__*/_jsx(_Fragment, {
118
+ children: /*#__PURE__*/_jsx(StyledTableCellNoteText, {
119
+ children: row[column.noteKey]
120
+ })
121
+ })]
111
122
  })]
112
123
  });
113
124
  }
@@ -156,13 +167,13 @@ var TableBody = function TableBody(props) {
156
167
  tabIndex: column.sortable && !props.showLoadingIndicator ? 0 : -1,
157
168
  className: "".concat(!!column.sortable ? 'sortable' : '', " ").concat(column.key === ((_props$sortProps6 = props.sortProps) === null || _props$sortProps6 === void 0 ? void 0 : _props$sortProps6.column) && !!((_props$sortProps7 = props.sortProps) !== null && _props$sortProps7 !== void 0 && _props$sortProps7.direction) ? 'sorted' : '', " ").concat(column.justify || ''),
158
169
  children: /*#__PURE__*/_jsxs(StyledTableHeaderColumnContent, {
159
- children: [/*#__PURE__*/_jsx("span", {
170
+ children: [/*#__PURE__*/_jsx(ColumnLabel, {
160
171
  children: column.name
161
172
  }), column.key === ((_props$sortProps8 = props.sortProps) === null || _props$sortProps8 === void 0 ? void 0 : _props$sortProps8.column) && /*#__PURE__*/_jsx(StyledTableHeaderColumnSortDirection, {
162
173
  children: ((_props$sortProps9 = props.sortProps) === null || _props$sortProps9 === void 0 ? void 0 : _props$sortProps9.direction) === 'asc' ? /*#__PURE__*/_jsx(SystemIcons.ArrowLineUp, {
163
- size: '24px'
174
+ size: '20px'
164
175
  }) : /*#__PURE__*/_jsx(SystemIcons.ArrowLineDown, {
165
- size: '24px'
176
+ size: '20px'
166
177
  })
167
178
  })]
168
179
  })
@@ -195,8 +206,9 @@ var TableBody = function TableBody(props) {
195
206
  style: {
196
207
  maxWidth: column.width
197
208
  },
198
- title: column.shortenText && row[column.key],
209
+ title: column.shortenText ? "".concat(row[column.key], " \n ").concat(column.noteKey ? row[column.noteKey] : '') : '',
199
210
  children: /*#__PURE__*/_jsx(StyledTableCellContent, {
211
+ withNote: Boolean(column.noteKey),
200
212
  className: "".concat(column.shortenText ? "truncate-text" : '', " ").concat(column.justify || ''),
201
213
  style: {
202
214
  color: column.colorFn && column.colorFn(row, column.key)