{"version":3,"file":"column-DHylhpKT.js","sources":["../../../app/javascript/dashboards/components/common/ButtonIcon.jsx","../../../app/javascript/dashboards/components/common/ActionButton.jsx","../../../app/javascript/dashboards/components/common/ActionMenu.jsx","../../../app/javascript/dashboards/utils/column.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Button } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst ButtonIcon = ({\n icon,\n iconAlign,\n iconClassName,\n transform,\n children,\n ...rest\n}) => (\n \n);\n\nButtonIcon.propTypes = {\n ...Button.propTypes,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\n children: PropTypes.any,\n iconAlign: PropTypes.oneOf(['left', 'right']),\n iconClassName: PropTypes.string,\n transform: PropTypes.string,\n};\n\nButtonIcon.defaultProps = {\n iconAlign: 'left',\n children: null,\n transform: '',\n iconClassName: '',\n};\n\nexport default ButtonIcon;\n","import React from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport PropTypes from 'prop-types';\nimport { DropdownItem, Button } from 'reactstrap';\nimport IconButton from './IconButton';\nimport ButtonIcon from './ButtonIcon';\n\nconst ActionButton = (props) => {\n const {\n buttonText,\n buttonType,\n buttonIcon,\n buttonColor,\n ...buttonProps\n } = props;\n\n if (buttonType === 'plain') {\n return (\n \n );\n }\n if (buttonType === 'dropdown-item') {\n return (\n \n {buttonIcon}\n {buttonText}\n \n );\n }\n if (buttonType === 'link') {\n return {buttonText};\n }\n if (buttonType === 'button-icon') {\n return (\n \n {buttonText}\n \n );\n }\n if (buttonType === 'icon-button') {\n return (\n \n );\n }\n if (buttonType === 'icon') {\n return (\n \n );\n }\n return (\n \n );\n};\n\nActionButton.defaultProps = {\n buttonType: 'button',\n className: '',\n buttonIcon: '',\n buttonText: '',\n buttonColor: 'falcon-default',\n onClick: () => {},\n};\n\nActionButton.propTypes = {\n buttonType: PropTypes.oneOf([\n 'plain',\n 'dropdown-item',\n 'button',\n 'link',\n 'button-icon',\n 'icon',\n 'icon-button',\n ]),\n buttonIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n buttonText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n className: PropTypes.string,\n buttonColor: PropTypes.string,\n onClick: PropTypes.func,\n};\n\nexport default ActionButton;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport { UncontrolledDropdown, DropdownToggle, DropdownMenu } from 'reactstrap';\n\nimport ActionsSvg from '../../../css/icons/Actions';\n\nconst ActionMenu = (props) => {\n const {\n className,\n dropdownTag,\n children,\n inNavbar,\n direction,\n disabled,\n buttonClass,\n buttonText,\n buttonColor,\n spacing,\n container,\n menuClass,\n modalIsParentEl,\n } = props;\n\n const wrapClass = cx(className, spacing);\n const buttonClasses = cx(buttonClass, { disabled });\n const menuProps = {\n right: direction === 'right',\n className: `${menuClass} ${\n modalIsParentEl ? 'adapt-modal-reactstrap-menu' : ''\n }`,\n };\n if (container) {\n menuProps.container = container;\n }\n\n return (\n \n \n {buttonText || }\n \n {children}\n \n );\n};\n\nActionMenu.defaultProps = {\n inNavbar: true,\n children: null,\n className: 'dropdown-button-wrapper',\n direction: 'left',\n disabled: false,\n buttonClass: 'btn-reveal',\n menuClass: 'dropdown-menu-wrapper',\n buttonColor: 'link',\n buttonText: undefined,\n dropdownTag: 'div',\n spacing: '',\n modalIsParentEl: false,\n container: undefined,\n};\n\nActionMenu.propTypes = {\n className: PropTypes.string,\n menuClass: PropTypes.string,\n children: PropTypes.node,\n inNavbar: PropTypes.bool,\n disabled: PropTypes.bool,\n buttonClass: PropTypes.string,\n buttonColor: PropTypes.string,\n dropdownTag: PropTypes.string,\n spacing: PropTypes.string,\n buttonText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),\n container: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n modalIsParentEl: PropTypes.bool,\n};\n\nexport default ActionMenu;\n","import React from 'react';\nimport { Icon } from '@angellist/adapt';\nimport { alphaNumericSortFunc } from '.';\nimport { Money } from '../../graphql';\nimport {\n formatMoneyObject,\n formatNumber,\n formatNumberText,\n formatTitle,\n formatBoolean,\n} from '../helpers/utils';\nimport { formatDate, formatDateTime, formatDateTimeHuman } from './date';\nimport StatusTag from '../components/common/StatusTag';\n\nexport const csvOnlyColumn = (text: any, dataField: string, options = {}) => ({\n dataField,\n text,\n isDummyField: true,\n csvExport: true,\n csvFormatter: (value: any) => value || '',\n hidden: true,\n ...options,\n});\n\nexport const filterOnlyColumn = (dataField: string, options = {}) => ({\n dataField,\n text: '',\n isDummyField: true,\n csvExport: false,\n hidden: true,\n ...options,\n});\n\nenum ALIGIN {\n RIGHT = 'right',\n}\n\nexport const RIGHT_ALIGN_COLUMN_ATTRIBUTES = {\n align: ALIGIN.RIGHT,\n headerAlign: ALIGIN.RIGHT,\n classes: 'right-align-column',\n headerClasses: 'right-align-column',\n};\n\nconst defaultMoneyColumnConfig = {\n sort: true,\n headerStyle: { minWidth: 120 },\n ...RIGHT_ALIGN_COLUMN_ATTRIBUTES,\n};\n\nexport const COLUMN_ATTRIBUTES = {\n ACTION: {\n dataField: '',\n text: 'Actions',\n isDummyField: true,\n classes: 'action-dropdown-container',\n align: 'left',\n csvExport: false,\n },\n ADAPT_ACTION: {\n dataField: '',\n text: '',\n isDummyField: true,\n csvExport: false,\n classes: 'adapt-cell-dropdown-container',\n },\n NUMBER: {\n formatter: (number?: number) => formatNumber(number),\n csvFormatter: (number?: number) => formatNumber(number),\n sort: true,\n headerStyle: { minWidth: 120 },\n sortFunc: alphaNumericSortFunc,\n searchValue: (number?: number) => `${number}_or_${formatNumber(number)}`,\n },\n NUMBER_TEXT: {\n formatter: (number?: number) => formatNumberText(number),\n csvFormatter: (number?: number) => formatNumberText(number, '–'),\n sort: true,\n headerStyle: { minWidth: 120 },\n searchValue: (number?: number) => `${number}_or_${formatNumber(number)}`,\n },\n DATE: {\n formatter: (date?: string) => formatDate(date, '–'),\n csvFormatter: (date?: string) => formatDate(date, '–'),\n sort: true,\n headerStyle: { minWidth: 125 },\n },\n DATETIME: {\n formatter: (date?: string) => formatDateTimeHuman(date, '–'),\n searchValue: (date?: string) => formatDateTimeHuman(date, '–'),\n csvFormatter: (date?: string) => formatDateTime(date, '–'),\n sort: true,\n headerStyle: { minWidth: 130 },\n },\n ACTUAL_DATETIME: {\n formatter: (date?: string) => formatDateTimeHuman(date, '–'),\n searchValue: (date?: string) => formatDateTimeHuman(date, '–'),\n csvFormatter: (date?: string) => formatDateTime(date, '–'),\n sort: true,\n headerStyle: { minWidth: 130 },\n },\n TEXT: {\n formatter: (text?: string) => text || '–',\n csvFormatter: (text?: string) => text || '–',\n sort: true,\n headerStyle: { minWidth: 110 },\n },\n TITLE: {\n formatter: (text?: string) => formatTitle(text),\n csvFormatter: (text?: string) => formatTitle(text),\n searchValue: (text?: string) => formatTitle(text),\n filterValue: (text?: string) => text,\n sort: true,\n headerStyle: { minWidth: 120 },\n },\n MONEY: {\n formatter: (moneyObj: Money) => formatMoneyObject(moneyObj),\n csvFormatter: (moneyObj: Money) => formatMoneyObject(moneyObj),\n sortValue: (moneyObj: Money) => (moneyObj ? Number(moneyObj.dollars) : 0),\n searchValue: (moneyObj: Money) => (moneyObj ? Number(moneyObj.dollars) : 0),\n ...defaultMoneyColumnConfig,\n },\n BETTER_MONEY: {\n formatter: (moneyObj: Money) => (moneyObj ? moneyObj.betterFormat : '—'),\n csvFormatter: (moneyObj: Money) => (moneyObj ? moneyObj.betterFormat : '—'),\n sortValue: (moneyObj: Money) =>\n moneyObj ? Number(moneyObj.fractional) : 0,\n searchValue: (moneyObj: Money) =>\n moneyObj ? Number(moneyObj.fractional) : 0,\n ...defaultMoneyColumnConfig,\n },\n FORMAT_MONEY: {\n formatter: (moneyObj: Money) => (moneyObj ? moneyObj.format : '—'),\n csvFormatter: (moneyObj: Money) => (moneyObj ? moneyObj.format : '—'),\n sortValue: (moneyObj: Money) =>\n moneyObj ? Number(moneyObj.fractional) : 0,\n searchValue: (moneyObj: Money) =>\n moneyObj ? Number(moneyObj.fractional) : 0,\n ...defaultMoneyColumnConfig,\n },\n STATUS_TAG: {\n formatter: (status?: string) => ,\n csvFormatter: (status?: string) => formatTitle(status),\n searchValue: (status?: string) => formatTitle(status),\n filterValue: (status?: string) => status,\n sort: true,\n headerStyle: { minWidth: 110 },\n },\n BOOLEAN: {\n formatter: (boolean: string | boolean) => formatBoolean(boolean),\n csvFormatter: (boolean: string | boolean) => formatBoolean(boolean),\n sort: true,\n headerStyle: { minWidth: 120 },\n },\n BOOLEAN_Y_N: {\n formatter: (boolean: boolean) => {\n if (boolean === null) return '—';\n if (boolean === true) return ;\n if (boolean === false) return ;\n return '';\n },\n csvFormatter: (boolean: boolean) => boolean,\n sort: true,\n headerStyle: { minWidth: 80 },\n classes: 'text-center',\n },\n};\n"],"names":["ButtonIcon","icon","iconAlign","iconClassName","transform","children","rest","jsxs","Button","jsx","FontAwesomeIcon","classNames","PropTypes","ActionButton","props","buttonText","buttonType","buttonIcon","buttonColor","buttonProps","DropdownItem","IconButton","ActionMenu","className","dropdownTag","inNavbar","direction","disabled","buttonClass","spacing","container","menuClass","modalIsParentEl","wrapClass","cx","buttonClasses","menuProps","UncontrolledDropdown","DropdownToggle","ActionsSvg","DropdownMenu","csvOnlyColumn","text","dataField","options","value","filterOnlyColumn","RIGHT_ALIGN_COLUMN_ATTRIBUTES","defaultMoneyColumnConfig","COLUMN_ATTRIBUTES","number","formatNumber","alphaNumericSortFunc","formatNumberText","date","formatDate","formatDateTimeHuman","formatDateTime","formatTitle","moneyObj","formatMoneyObject","status","StatusTag","boolean","formatBoolean","Icon"],"mappings":"0gBAMA,MAAMA,EAAa,CAAC,CAClB,KAAAC,EACA,UAAAC,EACA,cAAAC,EACA,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IACEC,EAAA,KAACC,EAAQ,CAAA,GAAGF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