Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

const exotic_1 = require("exotic");

const utils_1 = require("@skava/utils");

const renderProps_1 = require("./renderProps");

const fixture_1 = require("./fixture"); // alias


function toTelephoneNumber(props) {
  return props.phoneNo || props.phoneno || props.telephone || props.value || props.number;
}

exports.toTelephoneNumber = toTelephoneNumber;

function toAttributes(props) {
  const {
    shouldFormat,
    shouldUseIcon
  } = props;
  const telephoneNumber = toTelephoneNumber(props);
  const attributes = {
    className: fixture_1.classes.telephoneNumberButton,
    isLink: true,
    to: `tel:${telephoneNumber}`,
    shouldUseIcon
  };
  const telephone = shouldFormat ? utils_1.formatPhoneNumber(telephoneNumber) : telephoneNumber;
  const render = toRender(props);
  return {
    renderIcon: props.renderIcon || renderProps_1.renderIcon,
    render,
    shouldUseIcon,
    attributes,
    telephone
  };
}

exports.toAttributes = toAttributes;
/**
 * @todo generic toRender functon...
 */

function toRender(props) {
  return exotic_1.isFunction(props.children) ? props.children : props.render || props.renderValue || renderProps_1.renderValue;
}

exports.toRender = toRender; //# sourceMappingURL=deps.js.map