@@ -11034,10 +11034,60 @@ return /******/ (function(modules) { // webpackBootstrap
1103411034
1103511035 'use strict';
1103611036
11037+ var _createClass = (function () {
11038+ function defineProperties(target, props) {
11039+ for (var i = 0; i < props.length; i++) {
11040+ var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
11041+ }
11042+ }return function (Constructor, protoProps, staticProps) {
11043+ if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
11044+ };
11045+ })();
11046+
11047+ var _get = function get(_x, _x2, _x3) {
11048+ var _again = true;_function: while (_again) {
11049+ var object = _x,
11050+ property = _x2,
11051+ receiver = _x3;desc = parent = getter = undefined;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) {
11052+ var parent = Object.getPrototypeOf(object);if (parent === null) {
11053+ return undefined;
11054+ } else {
11055+ _x = parent;_x2 = property;_x3 = receiver;_again = true;continue _function;
11056+ }
11057+ } else if ('value' in desc) {
11058+ return desc.value;
11059+ } else {
11060+ var getter = desc.get;if (getter === undefined) {
11061+ return undefined;
11062+ }return getter.call(receiver);
11063+ }
11064+ }
11065+ };
11066+
1103711067 function _interopRequireDefault(obj) {
1103811068 return obj && obj.__esModule ? obj : { 'default': obj };
1103911069 }
1104011070
11071+ function _defineProperty(obj, key, value) {
11072+ if (key in obj) {
11073+ Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
11074+ } else {
11075+ obj[key] = value;
11076+ }return obj;
11077+ }
11078+
11079+ function _classCallCheck(instance, Constructor) {
11080+ if (!(instance instanceof Constructor)) {
11081+ throw new TypeError('Cannot call a class as a function');
11082+ }
11083+ }
11084+
11085+ function _inherits(subClass, superClass) {
11086+ if (typeof superClass !== 'function' && superClass !== null) {
11087+ throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
11088+ }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
11089+ }
11090+
1104111091 var _react = __webpack_require__(2);
1104211092
1104311093 var _react2 = _interopRequireDefault(_react);
@@ -11046,129 +11096,152 @@ return /******/ (function(modules) { // webpackBootstrap
1104611096
1104711097 var _SLDSPopover2 = _interopRequireDefault(_SLDSPopover);
1104811098
11049- var _classnames = __webpack_require__(23);
11050-
11051- var _classnames2 = _interopRequireDefault(_classnames);
11052-
11053- module.exports = _react2['default'].createClass({
11099+ var classNames = __webpack_require__(23);
1105411100
11055- displayName: 'SLDSToolip',
11101+ var displayName = "SLDSTooltip";
11102+ var propTypes = {
11103+ align: _react2['default'].PropTypes.string,
11104+ children: _react2['default'].PropTypes.node,
11105+ content: _react2['default'].PropTypes.node,
11106+ hoverCloseDelay: _react2['default'].PropTypes.number,
11107+ openByDefault: _react2['default'].PropTypes.bool,
11108+ openOn: _react2['default'].PropTypes.string
11109+ };
11110+ var defaultProps = {
11111+ align: 'top',
11112+ content: _react2['default'].createElement('span', null, 'Tooltip'),
11113+ hoverCloseDelay: 350,
11114+ openByDefault: false,
11115+ openOn: 'hover'
11116+ };
1105611117
11057- propTypes: {
11058- align: _react.PropTypes.string,
11059- children: _react.PropTypes.node,
11060- content: _react.PropTypes.node,
11061- hoverCloseDelay: _react.PropTypes.number,
11062- openByDefault: _react.PropTypes.bool,
11063- openOn: _react.PropTypes.string
11064- },
11118+ var SLDSTooltip = (function (_React$Component) {
11119+ _inherits(SLDSTooltip, _React$Component);
1106511120
11066- getDefaultProps: function getDefaultProps() {
11067- return {
11068- align: 'top',
11069- content: _react2['default'].createElement('span', null, 'Tooltip'),
11070- hoverCloseDelay: 350,
11071- openByDefault: false,
11072- openOn: 'hover'
11073- };
11074- },
11121+ function SLDSTooltip(props) {
11122+ _classCallCheck(this, SLDSTooltip);
1107511123
11076- getInitialState: function getInitialState() {
11077- return {
11078- isOpen: this.props.openByDefault ,
11079- isClosing: false
11124+ _get(Object.getPrototypeOf(SLDSTooltip.prototype), 'constructor', this).call(this, props);
11125+ this.state = {
11126+ isClosing: false ,
11127+ isOpen: this.props.openByDefault
1108011128 };
11081- },
11082-
11083- componentDidMount: function componentDidMount() {},
11084-
11085- handleMouseClick: function handleMouseClick(event) {
11086- this.setState({
11087- isOpen: !this.state.isOpen,
11088- isClosing: !this.state.isOpen
11089- });
11090- },
11129+ }
1109111130
11092- handleMouseEnter: function handleMouseEnter(event) {
11093- this.setState({
11094- isOpen: true,
11095- isClosing: false
11096- });
11097- },
11131+ _createClass(SLDSTooltip, [{
11132+ key: 'componentDidMount',
11133+ value: function componentDidMount() {
11134+ this.setState({ isMounted: true });
11135+ }
11136+ }, {
11137+ key: 'componentWillUnmount',
11138+ value: function componentWillUnmount() {
11139+ this.setState({ isMounted: false });
11140+ }
11141+ }, {
11142+ key: 'handleMouseClick',
11143+ value: function handleMouseClick() {
11144+ this.setState({
11145+ isOpen: !this.state.isOpen,
11146+ isClosing: !this.state.isOpen
11147+ });
11148+ }
11149+ }, {
11150+ key: 'handleMouseEnter',
11151+ value: function handleMouseEnter() {
11152+ this.setState({
11153+ isOpen: true,
11154+ isClosing: false
11155+ });
11156+ }
11157+ }, {
11158+ key: 'handleMouseLeave',
11159+ value: function handleMouseLeave() {
11160+ var _this = this;
1109811161
11099- handleMouseLeave: function handleMouseLeave(event) {
11100- var _this = this;
11162+ this.setState({ isClosing: true });
1110111163
11102- this.setState({ isClosing: true });
11103- setTimeout(function () {
11104- if (_this.isMounted && _this.state.isClosing) {
11105- _this.setState({
11106- isOpen: false,
11107- isClosing: false
11108- });
11164+ setTimeout(function () {
11165+ if (_this.state.isMounted && _this.state.isClosing) {
11166+ _this.setState({
11167+ isOpen: false,
11168+ isClosing: false
11169+ });
11170+ }
11171+ }, this.props.hoverCloseDelay);
11172+ }
11173+ }, {
11174+ key: 'getTooltipContent',
11175+ value: function getTooltipContent() {
11176+ return _react2['default'].createElement('div', { className: 'slds-popover__body' }, this.props.content);
11177+ }
11178+ }, {
11179+ key: 'getHorizontalAlign',
11180+ value: function getHorizontalAlign() {
11181+ if (this.props.align === 'left') {
11182+ return 'left';
11183+ } else if (this.props.align === 'right') {
11184+ return 'right';
1110911185 }
11110- }, this.props.hoverCloseDelay);
11111- },
11112-
11113- getTooltipContent: function getTooltipContent() {
11114- return _react2['default'].createElement('div', { className: 'slds-popover__body' }, this.props.content);
11115- },
11116-
11117- getHorizontalAlign: function getHorizontalAlign() {
11118- if (this.props.align === 'left') {
11119- return 'left';
11120- } else if (this.props.align === 'right') {
11121- return 'right';
11186+ return 'center';
1112211187 }
11123- return 'center';
11124- },
11125-
11126- getVerticalAlign: function getVerticalAlign() {
11127- if (this.props.align === 'bottom') {
11128- return 'bottom';
11129- } else if (this.props.align === 'top') {
11130- return 'top';
11188+ }, {
11189+ key: 'getVerticalAlign',
11190+ value: function getVerticalAlign() {
11191+ if (this.props.align === 'bottom') {
11192+ return 'bottom';
11193+ } else if (this.props.align === 'top') {
11194+ return 'top';
11195+ }
11196+ return 'middle';
1113111197 }
11132- return 'middle';
11133- },
11134-
11135- handleCancel: function handleCancel() {
11136- this.setState({
11137- isOpen: false,
11138- isClosing: false
11139- });
11140- },
11198+ }, {
11199+ key: 'handleCancel',
11200+ value: function handleCancel() {
11201+ this.setState({
11202+ isOpen: false,
11203+ isClosing: false
11204+ });
11205+ }
11206+ }, {
11207+ key: 'getClassName',
11208+ value: function getClassName() {
11209+ var _classNames;
1114111210
11142- getTooltip: function getTooltip() {
11143- var style = {
11144- 'slds-popover': true,
11145- 'slds-popover--tooltip': true,
11146- 'slds-nubbin--top': this.props.align === 'bottom',
11147- 'slds-nubbin--bottom': this.props.align === 'top',
11148- 'slds-nubbin--left': this.props.align === 'right',
11149- 'slds-nubbin--right': this.props.align === 'left'
11150- };
11211+ return classNames(this.props.className, "slds-popover", (_classNames = {}, _defineProperty(_classNames, "slds-popover--tooltip", true), _defineProperty(_classNames, "slds-nubbin--top", this.props.align === 'bottom'), _defineProperty(_classNames, 'slds-nubbin--bottom', this.props.align === 'top'), _defineProperty(_classNames, 'slds-nubbin--left', this.props.align === 'right'), _defineProperty(_classNames, 'slds-nubbin--right', this.props.align === 'left'), _classNames));
11212+ }
11213+ }, {
11214+ key: 'getTooltip',
11215+ value: function getTooltip() {
11216+ return this.state.isOpen ? _react2['default'].createElement(_SLDSPopover2['default'], {
11217+ key: this.getHorizontalAlign() + ' ' + this.getVerticalAlign(),
11218+ targetElement: this.refs.tooltipTarget,
11219+ closeOnTabKey: true,
11220+ className: '',
11221+ marginTop: '1rem',
11222+ marginBottom: '1rem',
11223+ marginLeft: '1.5rem',
11224+ marginRight: '1.5rem',
11225+ horizontalAlign: this.getHorizontalAlign(),
11226+ verticalAlign: this.getVerticalAlign(),
11227+ flippable: false,
11228+ onClose: this.handleCancel.bind(this) }, _react2['default'].createElement('div', { className: this.getClassName(), role: 'tooltip' }, this.getTooltipContent())) : null;
11229+ }
11230+ }, {
11231+ key: 'render',
11232+ value: function render() {
11233+ return _react2['default'].createElement('span', { refs: 'tooltipTarget', onClick: this.props.openOn === 'click' ? this.handleMouseClick.bind(this) : null, onMouseEnter: this.props.openOn === 'hover' ? this.handleMouseEnter.bind(this) : null, onMouseLeave: this.props.openOn === 'hover' ? this.handleMouseLeave.bind(this) : null }, this.props.children, this.getTooltip());
11234+ }
11235+ }]);
1115111236
11152- return this.state.isOpen ? _react2['default'].createElement(_SLDSPopover2['default'], {
11153- key: this.getHorizontalAlign() + ' ' + this.getVerticalAlign(),
11154- targetElement: this.refs.tooltipTarget,
11155- closeOnTabKey: true,
11156- className: '',
11157- marginTop: '1rem',
11158- marginBottom: '1rem',
11159- marginLeft: '1.5rem',
11160- marginRight: '1.5rem',
11161- horizontalAlign: this.getHorizontalAlign(),
11162- verticalAlign: this.getVerticalAlign(),
11163- flippable: false,
11164- onClose: this.handleCancel }, _react2['default'].createElement('div', { className: (0, _classnames2['default'])(style) }, this.getTooltipContent())) : null;
11165- },
11237+ return SLDSTooltip;
11238+ })(_react2['default'].Component);
1116611239
11167- render: function render() {
11168- return _react2['default'].createElement('span', { refs: 'tooltipTarget', onClick: this.props.openOn === 'click' ? this.handleMouseClick : null, onMouseEnter: this.props.openOn === 'hover' ? this.handleMouseEnter : null, onMouseLeave: this.props.openOn === 'hover' ? this.handleMouseLeave : null }, this.props.children, this.getTooltip()) ;
11169- }
11240+ SLDSTooltip.displayName = displayName;
11241+ SLDSTooltip.propTypes = propTypes ;
11242+ SLDSTooltip.defaultProps = defaultProps;
1117011243
11171- }) ;
11244+ module.exports = SLDSTooltip ;
1117211245
1117311246/***/ },
1117411247/* 82 */
@@ -11333,7 +11406,7 @@ return /******/ (function(modules) { // webpackBootstrap
1133311406 style: { pointerEvents: 'inherit' },
1133411407 onClick: this.isPrompt() ? undefined : this.closeModal
1133511408 }, _react2['default'].createElement('div', {
11336- role: 'document ',
11409+ role: 'dialog ',
1133711410 className: 'slds-modal__container',
1133811411 onClick: this.handleModalClick
1133911412 }, this.headerComponent(), _react2['default'].createElement('div', { className: 'slds-modal__content' }, this.props.children), this.footerComponent()));
@@ -11629,7 +11702,6 @@ return /******/ (function(modules) { // webpackBootstrap
1162911702 variant: "icon-inverse",
1163011703 iconName: "close",
1163111704 iconSize: size,
11632- inverse: true,
1163311705 className: "slds-button slds-notify__close",
1163411706 onClick: that.onDismiss.bind(that)
1163511707 });
0 commit comments