UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

102 lines (97 loc) 3.63 kB
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/forbid-component-props */ /**** Libraries ****/ import React, { Component } from 'react'; import { AccountName_defaultProps } from "./props/defaultProps"; import { AccountName_propTypes } from "./props/propTypes"; /**** Components ****/ import { Container, Box } from '@zohodesk/components/es/Layout'; import Typography from '@zohodesk/components/es/Typography/Typography'; import { DUMMY_OBJECT } from '@zohodesk/components/es/utils/Common'; import Link from "../../Link/Link"; /**** CSS ****/ import style from "./SecondaryText.module.css"; export default class AccountName extends Component { render() { let { dataTitle, dataId, urlName, urlData, onClick, isLink, className, text, href, notAccessible = false, fontWeight, secondaryAccountHref, secondaryAccountClick, secondaryAccountText, highlightData, isHighlighted, customProps } = this.props; let { LinkProps = {}, TextProps = {}, SecondaryTextProps = {} } = customProps; return /*#__PURE__*/React.createElement(Container, { alignBox: "row", align: "baseline", isCover: false, "data-title": dataTitle, dataId: dataId }, /*#__PURE__*/React.createElement(Box, { flexible: true }, /*#__PURE__*/React.createElement(Container, { alignBox: "row", align: "baseline", isCover: false, className: style.primaryAccountNameCnt }, /*#__PURE__*/React.createElement(Box, { className: style.primaryAccountName, shrink: true }, isLink ? /*#__PURE__*/React.createElement(Link, _extends({ href: href, urlName: urlName, urlData: urlData, onClick: onClick, dataId: `${dataId}_link`, className: style.link }, LinkProps, { ariaLabel: `Account Name ${text}` }), /*#__PURE__*/React.createElement(Typography, { $tagAttributes_text: TextProps, $ui_size: "12", $flag_dotted: true, $ui_className: `${style.linkWithText} ${className ? className : ''}`, $ui_weight: fontWeight, $ui_highlightConfig: isHighlighted ? highlightData : DUMMY_OBJECT }, text)) : /*#__PURE__*/React.createElement(Typography, { $tagAttributes_text: TextProps, $ui_size: "12", $flag_dotted: true, $ui_className: `${style.secondaryText} ${className ? className : ''} ${notAccessible ? style.disable : ''}`, $ui_highlightConfig: isHighlighted ? highlightData : DUMMY_OBJECT }, text)), secondaryAccountText && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Link, { href: secondaryAccountHref, onClick: secondaryAccountClick, className: style.link }, /*#__PURE__*/React.createElement(Typography, { $tagAttributes_text: SecondaryTextProps, $ui_size: "12", $flag_dotted: true, $ui_weight: fontWeight, $ui_className: `${style.linkWithText} ${className ? className : ''}` }, secondaryAccountText)))))); } } AccountName.propTypes = AccountName_propTypes; AccountName.defaultProps = AccountName_defaultProps; // if (__DOCS__) { // AccountName.docs = { // folderName: 'List', // componentGroup: 'AccountName' // }; // }