UNPKG

@blueprintjs/core

Version:
55 lines (53 loc) 2.63 kB
/* * Copyright 2015 Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy * of the license at https://github.com/palantir/blueprint/blob/master/LICENSE * and https://github.com/palantir/blueprint/blob/master/PATENTS */ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var classNames = require("classnames"); var PureRender = require("pure-render-decorator"); var React = require("react"); var abstractComponent_1 = require("../../common/abstractComponent"); var Classes = require("../../common/classes"); var TabList = (function (_super) { __extends(TabList, _super); function TabList() { _super.apply(this, arguments); this.displayName = "Blueprint.TabList"; this.state = { shouldAnimate: false, }; } TabList.prototype.render = function () { return (React.createElement("ul", {className: classNames(Classes.TAB_LIST, this.props.className), role: "tablist"}, React.createElement("div", {className: classNames("pt-tab-indicator-wrapper", { "pt-no-animation": !this.state.shouldAnimate }), style: this.props.indicatorWrapperStyle}, React.createElement("div", {className: "pt-tab-indicator"}) ), this.props.children)); }; TabList.prototype.componentDidUpdate = function (prevProps) { var _this = this; if (prevProps.indicatorWrapperStyle == null) { this.setTimeout(function () { return _this.setState({ shouldAnimate: true }); }); } }; TabList = __decorate([ PureRender ], TabList); return TabList; }(abstractComponent_1.AbstractComponent)); exports.TabList = TabList; exports.TabListFactory = React.createFactory(TabList); //# sourceMappingURL=tabList.js.map