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    
@skava/ui / dist / components / presets / B2B / Approval / ApprovalStatus / renderProps.js
Size: Mime:
"use strict";

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

const tslib_1 = require("tslib");

const react_1 = tslib_1.__importDefault(require("react"));

const exotic_1 = require("exotic");

const words_1 = require("../../../../../words");

const Empty_1 = require("../../../../atoms/Empty");

const MaterialIcon_1 = require("../../../../atoms/MaterialIcon");

const styled_1 = require("./styled");

function renderIconItem(props) {
  return react_1.default.createElement(MaterialIcon_1.MaterialIcon, {
    type: "down"
  });
}

function defaultRenderListHeading() {
  return react_1.default.createElement(Empty_1.Empty, null);
}

function defaultRenderButton(props) {
  const handleState = exotic_1.isSafe(props.state) && props.state.handleToggle;
  const showHideContent = exotic_1.isSafe(props.state) ? props.state.isExpanded ? words_1.wording.hideDetailsLabel : words_1.wording.showDetailsLabel : words_1.wording.showDetailsLabel;
  return react_1.default.createElement(styled_1.StyledButtonWithIcon, {
    text: showHideContent,
    breedType: "icon-with-text",
    iconAlignType: 'suffix',
    renderIcon: renderIconItem,
    onClick: handleState
  });
}

exports.defaultRenderButton = defaultRenderButton;

function defaultRenderOrderInformation(props) {
  const {
    item
  } = props;
  const isDesktop = item.dateRequestedLabel;
  const isTabletOrMobile = item.dateRequestedLabel.split(' ')[1];
  return react_1.default.createElement(styled_1.StyledOrderInformation, null, react_1.default.createElement(styled_1.HeadingWrapper, null, react_1.default.createElement(styled_1.OrderInformationHeadingLabel, {
    isDesktop: isDesktop,
    isTabletOrMobile: isTabletOrMobile
  }), react_1.default.createElement(styled_1.StyledHeadingValue, null, item.dateRequestedValue)), react_1.default.createElement(styled_1.StyledDetailedlistRequest, {
    list: item.statusInformation,
    renderListHeading: defaultRenderListHeading
  }));
}

exports.defaultRenderOrderInformation = defaultRenderOrderInformation;

function defaultRenderUserInformation(props) {
  const {
    item,
    onUserName
  } = props;

  const handleOnClick = event => {
    if (exotic_1.isFunction(onUserName)) {
      const changeArgs = {
        event
      };
      onUserName(changeArgs);
    }
  };

  return react_1.default.createElement(styled_1.StyledUserInformation, null, react_1.default.createElement(styled_1.HeadingWrapper, null, react_1.default.createElement(styled_1.UserInformationHeadingLabel, null, item.userIdLabel, ":"), react_1.default.createElement(styled_1.StyledHeadingValue, null, item.userIdValue)), react_1.default.createElement(styled_1.StyledUserInformation, null, react_1.default.createElement(styled_1.StyledDetailedlist, {
    list: item.userInformation,
    renderListHeading: defaultRenderListHeading
  }), react_1.default.createElement(styled_1.UserInformationList, null, react_1.default.createElement(styled_1.UserInformationLabel, null, item.userName.label, " : "), react_1.default.createElement(styled_1.UserNameValue, {
    onClick: handleOnClick
  }, item.userName.value))));
}

exports.defaultRenderUserInformation = defaultRenderUserInformation; //# sourceMappingURL=renderProps.js.map