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 tslib_1 = require("tslib");

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

const exotic_1 = require("exotic");

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

function defaultRenderBulletItem(props, state) {
  const {
    index,
    bulletColor,
    bulletSize
  } = props;
  const bulletDimension = exotic_1.isSafe(bulletSize) && exotic_1.fromIshToNumber(bulletSize);
  const {
    position,
    goTo
  } = state;
  const isActive = index === position;

  const handleBulletClick = e => {
    const bulletIndex = e.target.getAttribute('data-key');
    goTo(exotic_1.toNumber(bulletIndex));
  };

  return react_1.default.createElement(styled_1.BulletIcon, {
    key: index,
    "data-key": index,
    bulletColor: bulletColor,
    bulletSize: bulletDimension,
    isActive: isActive,
    onClick: handleBulletClick,
    tabindex: 0,
    "aria-label": isActive ? 'Current slide' : `Go to slide ${index + 1}`
  });
}

exports.defaultRenderBulletItem = defaultRenderBulletItem;

function defaultRenderBulletList(props, state) {
  const {
    renderBulletItem
  } = props,
        remainingProps = tslib_1.__rest(props, ["renderBulletItem"]);

  const {
    slides
  } = state;
  const bulletsView = [];

  for (let index = 0; index < slides; index++) {
    const bullet = renderBulletItem(Object.assign({
      index
    }, remainingProps), state);
    bulletsView.push(bullet);
  }

  return react_1.default.createElement(styled_1.BulletsPanel, null, bulletsView);
}

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