@salesforce/design-system-react
Version:
Salesforce Lightning Design System for React
1,470 lines (1,294 loc) • 1.89 MB
JavaScript
/*!
* design-system-react
* v0.8.12
* Copyright (c) 2015-present, Salesforce.com, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Salesforce.com nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'object')
exports["design-system-react"] = factory(require("react"), require("react-dom"));
else
root["design-system-react"] = factory(root["React"], root["ReactDOM"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_12__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 76);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (false) {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(80)();
}
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// ## Components
var ACCORDION = exports.ACCORDION = 'SLDSAccordion';
var ACCORDION_PANEL = exports.ACCORDION_PANEL = 'SLDSAccordionPanel';
var ALERT = exports.ALERT = 'SLDSAlert';
var ALERT_CONTAINER = exports.ALERT_CONTAINER = 'SLDSAlertContainer';
var APP_LAUNCHER = exports.APP_LAUNCHER = 'SLDSAppLauncher';
var APP_LAUNCHER_SECTION = exports.APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';
var APP_LAUNCHER_TILE = exports.APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';
var APP_LAUNCHER_HEADER = exports.APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';
var AVATAR = exports.AVATAR = 'SLDSAvatar';
/* Remove at next breaking change */
var BREAD_CRUMB = exports.BREAD_CRUMB = 'SLDSBreadcrumb';
var BREADCRUMB = exports.BREADCRUMB = 'SLDSBreadcrumb';
var BUTTON = exports.BUTTON = 'SLDSButton';
var BUTTON_GROUP = exports.BUTTON_GROUP = 'SLDSButtonGroup';
var BUTTON_STATEFUL = exports.BUTTON_STATEFUL = 'SLDSButtonStateful';
var BUTTON_ICON = exports.BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon
var CARD = exports.CARD = 'SLDSCard';
var CARD_BODY = exports.CARD_BODY = 'SLDSCardBody';
var CARD_EMPTY = exports.CARD_EMPTY = 'SLDSCardEmpty';
var CARD_FILTER = exports.CARD_FILTER = 'SLDSCardFilter';
var CARD_FOOTER = exports.CARD_FOOTER = 'SLDSCardFooter';
var CARD_HEADER = exports.CARD_HEADER = 'SLDSCardHeader';
var COMBOBOX = exports.COMBOBOX = 'SLDSCombobox';
var DATA_TABLE = exports.DATA_TABLE = 'SLDSDataTable';
var DATA_TABLE_CELL = exports.DATA_TABLE_CELL = 'SLDSDataTableCell';
var DATA_TABLE_COLUMN = exports.DATA_TABLE_COLUMN = 'SLDSDataTableColumn';
var DATA_TABLE_HEAD = exports.DATA_TABLE_HEAD = 'SLDSDataTableHead';
var DATA_TABLE_HEADER_CELL = exports.DATA_TABLE_HEADER_CELL = 'SLDSDataTableHeaderCell';
var DATA_TABLE_ROW_ACTIONS = exports.DATA_TABLE_ROW_ACTIONS = 'SLDSDataTableRowActions';
var DATA_TABLE_ROW = exports.DATA_TABLE_ROW = 'SLDSDataTableRow';
var DATE_PICKER = exports.DATE_PICKER = 'SLDSDatePicker';
var DIALOG = exports.DIALOG = 'SLDSDialog';
var FILTER = exports.FILTER = 'SLDSFilter';
var FORMS_CHECKBOX = exports.FORMS_CHECKBOX = 'SLDSCheckbox';
var FORMS_INLINE_EDIT = exports.FORMS_INLINE_EDIT = 'SLDSInlineEdit';
var FORMS_INPUT = exports.FORMS_INPUT = 'SLDSInput';
var FORMS_TEXTAREA = exports.FORMS_TEXTAREA = 'SLDSTextarea';
var FORMS_SEARCH = exports.FORMS_SEARCH = 'SLDSSearch';
var GLOBAL_HEADER = exports.GLOBAL_HEADER = 'SLDSGlobalHeader';
var GLOBAL_HEADER_PROFILE = exports.GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';
var GLOBAL_HEADER_SEARCH = exports.GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';
var GLOBAL_HEADER_TOOL = exports.GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';
var GLOBAL_NAVIGATION_BAR = exports.GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';
var GLOBAL_NAVIGATION_BAR_BUTTON = exports.GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';
var GLOBAL_NAVIGATION_BAR_DROPDOWN = exports.GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';
var GLOBAL_NAVIGATION_BAR_LABEL = exports.GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';
var GLOBAL_NAVIGATION_BAR_LINK = exports.GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';
var GLOBAL_NAVIGATION_BAR_REGION = exports.GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';
var GLOBAL_NAVIGATION_BAR_APP_LAUNCHER = exports.GLOBAL_NAVIGATION_BAR_APP_LAUNCHER = 'SLDSGlobalNavigationBarAppLauncher';
var GRID = exports.GRID = 'SLDSGrid';
var HIGHLIGHTER = exports.HIGHLIGHTER = 'SLDSHighlighter';
var ICON = exports.ICON = 'SLDSIcon';
var ICON_SETTINGS = exports.ICON_SETTINGS = 'SLDSIconSettings';
var ICON_INPUT = exports.ICON_INPUT = 'SLDSIconInput';
var LIST = exports.LIST = 'SLDSList';
var LIST_ITEM = exports.LIST_ITEM = 'SLDSListItem';
var LIST_ITEM_LABEL = exports.LIST_ITEM_LABEL = 'SLDSListItemLabel';
var LOOKUP = exports.LOOKUP = 'SLDSLookup';
var MEDIA_OBJECT = exports.MEDIA_OBJECT = 'SLDSMediaObject';
var MENU_DROPDOWN = exports.MENU_DROPDOWN = 'SLDSMenuDropdown';
var MENU_DROPDOWN_TRIGGER = exports.MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';
var MENU_PICKLIST = exports.MENU_PICKLIST = 'SLDSMenuPicklist';
var MODAL = exports.MODAL = 'SLDSModal';
var NAVIGATION = exports.NAVIGATION = 'SLDSNavigation';
var NAVIGATION_ITEM = exports.NAVIGATION_ITEM = 'SLDSNavigationItem';
var NOTIFICATION = exports.NOTIFICATION = 'SLDSNotification';
var PANEL = exports.PANEL = 'SLDSPanel';
var PANEL_FILTER_GROUP = exports.PANEL_FILTER_GROUP = 'SLDSFilterGroup';
var PANEL_FILTER_LIST = exports.PANEL_FILTER_LIST = 'SLDSFilterList';
var PANEL_FILTER_LIST_HEADING = exports.PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';
var PAGE_HEADER = exports.PAGE_HEADER = 'SLDSPageHeader';
var PILL = exports.PILL = 'SLDSPill';
var POPOVER = exports.POPOVER = 'SLDSPopover';
var POPOVER_TOOLTIP = exports.POPOVER_TOOLTIP = 'SLDSPopoverTooltip';
var PROGRESS_INDICATOR = exports.PROGRESS_INDICATOR = 'SLDSProgressIndicator';
var PROGRESS_INDICATOR_PROGRESS = exports.PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';
var PROGRESS_INDICATOR_STEP = exports.PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';
var PROGRESS_RING = exports.PROGRESS_RING = 'SLDSProgressRing';
var SPINNER = exports.SPINNER = 'SLDSSpinner';
var SPLIT_VIEW = exports.SPLIT_VIEW = 'SLDSSplitView';
var SPLIT_VIEW_HEADER = exports.SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';
var SPLIT_VIEW_LISTBOX = exports.SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';
var RADIO = exports.RADIO = 'SLDSRadio';
var RADIO_GROUP = exports.RADIO_GROUP = 'SLDSRadioGroup';
var RADIO_BUTTON_GROUP = exports.RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';
var TAB = exports.TAB = 'SLDSTab';
var TAB_ITEM = exports.TAB_ITEM = 'SLDSTabItem';
var TAB_PANEL = exports.TAB_PANEL = 'SLDSTabPanel';
var TABS = exports.TABS = 'SLDSTabs';
var TABS_LIST = exports.TABS_LIST = 'SLDSTabsList';
var TABS_PANEL = exports.TABS_PANEL = 'SLDSTabsPanel';
var TIME_PICKER = exports.TIME_PICKER = 'SLDSTimepicker';
var TOAST = exports.TOAST = 'SLDSToast';
var TOAST_CONTAINER = exports.TOAST_CONTAINER = 'SLDSToastContainer';
var TREE = exports.TREE = 'SLDSTree';
var TREE_BRANCH = exports.TREE_BRANCH = 'SLDSTreeBranch';
var TREE_ITEM = exports.TREE_ITEM = 'SLDSTreeItem';
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.classNames = classNames;
}
}());
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var React = __webpack_require__(0);
var factory = __webpack_require__(87);
if (typeof React === 'undefined') {
throw Error(
'create-react-class could not find the React object. If you are using script tags, ' +
'make sure that React is being loaded before create-react-class.'
);
}
// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
ReactNoopUpdateQueue
);
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(94);
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
var EventUtil = {
trapEvent: function trapEvent(event) {
if (!event) return;
event.preventDefault();
event.stopPropagation();
if (event.nativeEvent && event.nativeEvent.preventDefault) {
event.nativeEvent.preventDefault();
}
if (event.nativeEvent && event.nativeEvent.stopPropagation) {
event.nativeEvent.stopPropagation();
}
},
trap: function trap(event) {
return EventUtil.trapEvent(event);
},
trapImmediate: function trapImmediate(event) {
if (event.stopImmediatePropagation) {
event.stopImmediatePropagation();
}
if (event.nativeEvent && event.nativeEvent.stopImmediatePropagation) {
event.nativeEvent.stopImmediatePropagation();
}
EventUtil.trap(event);
}
};
exports.default = EventUtil;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(4);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _buttonIcon = __webpack_require__(29);
var _buttonIcon2 = _interopRequireDefault(_buttonIcon);
var _popoverTooltip = __webpack_require__(32);
var _popoverTooltip2 = _interopRequireDefault(_popoverTooltip);
var _constants = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
// Implements the [Button design pattern](https://lightningdesignsystem.com/components/buttons/) in React.
// Based on SLDS v2.2.1
/**
* The Button component is the Lightning Design System Button component. The Button should be used for label buttons, icon buttons, or buttons that have both labels and icons.
* Either a <code>label</code> or <code>assistiveText</code> is required; see the Prop Details table below.
* For buttons that maintain selected/unselected states, use the <a href="#/button-stateful">ButtonStateful</a> component.
*/
var Button = (0, _createReactClass2.default)({
displayName: _constants.BUTTON,
propTypes: {
/**
* Used if the Button triggers a tooltip. The value should match the `id` of the element with `role="tooltip"`.
*/
'aria-describedby': _propTypes2.default.string,
/**
* Establishes a relationship between an interactive parent element and a child element to indicate which child element a parent element affects. Frequently used in cases where buttons or tabs are associated with exposing expandable regions.
*/
'aria-controls': _propTypes2.default.string,
/**
* Used if the Button triggers a menu or popup. Bool indicates if the menu or popup is open or closed.
*/
'aria-expanded': _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.string]),
/**
* True if Button triggers a menu or popup to open/close.
*/
'aria-haspopup': _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.string]),
/**
* Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means.
* If the button has an icon and a visible label, you can omit the <code>assistiveText</code> prop and use the <code>label</code> prop.
*/
assistiveText: _propTypes2.default.string,
/**
* Callback that passes in the DOM reference of the `<button>` DOM node within this component. Primary use is to allow `focus` to be called. You should still test if the node exists, since rendering is asynchronous. `buttonRef={(component) => { if(component) console.log(component); }}`
*/
buttonRef: _propTypes2.default.func,
/**
* CSS classes to be added to button.
*/
className: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object, _propTypes2.default.string]),
/**
* Disables the button and adds disabled styling.
*/
disabled: _propTypes2.default.bool,
/**
* Associates an icon button with another element on the page by changes the color of the SVG. Please reference <a href="http://www.lightningdesignsystem.com/components/buttons/#hint">Lightning Design System Buttons > Hint</a>.
*/
hint: _propTypes2.default.bool,
/**
* Name of the icon category. Visit <a href="http://www.lightningdesignsystem.com/resources/icons">Lightning Design System Icons</a> to reference icon categories.
*/
iconCategory: _propTypes2.default.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']),
/**
* CSS classes to be added to icon.
*/
iconClassName: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object, _propTypes2.default.string]),
/**
* Name of the icon. Visit <a href="http://www.lightningdesignsystem.com/resources/icons">Lightning Design System Icons</a> to reference icon names.
*/
iconName: _propTypes2.default.string,
/**
* Path to the icon. This will override any global icon settings.
*/
iconPath: _propTypes2.default.string,
/**
* If omitted, icon position is centered.
*/
iconPosition: _propTypes2.default.oneOf(['left', 'right']),
/**
* Determines the size of the icon.
*/
iconSize: _propTypes2.default.oneOf(['x-small', 'small', 'medium', 'large']),
/**
* For icon variants, please reference <a href="http://www.lightningdesignsystem.com/components/buttons/#icon">Lightning Design System Icons</a>.
*/
iconVariant: _propTypes2.default.oneOf(['bare', 'container', 'border', 'border-filled', 'more', 'global-header']),
/**
* Id string applied to button node.
*/
id: _propTypes2.default.string,
/**
* If true, button/icon is white. Meant for buttons or utility icons on dark backgrounds.
*/
inverse: _propTypes2.default.bool,
/**
* Visible label on the button. If the button is an icon button with no label, you must use the <code>assistiveText</code> prop.
*/
label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]),
/**
* Triggered when focus is removed.
*/
onBlur: _propTypes2.default.func,
/**
* Triggered when the button is clicked.
*/
onClick: _propTypes2.default.func,
/**
* Triggered when component is focused.
*/
onFocus: _propTypes2.default.func,
/**
* Triggered when a key is pressed down
*/
onKeyDown: _propTypes2.default.func,
/**
* Triggered when a key is pressed and released
*/
onKeyPress: _propTypes2.default.func,
/**
* Triggered when a key is released
*/
onKeyUp: _propTypes2.default.func,
/**
* Triggered when a mouse button is pressed down
*/
onMouseDown: _propTypes2.default.func,
/**
* Triggered when a mouse arrow hovers
*/
onMouseEnter: _propTypes2.default.func,
/**
* Triggered when a mouse arrow no longer hovers
*/
onMouseLeave: _propTypes2.default.func,
/**
* If true, button scales to 100% width on small form factors.
*/
responsive: _propTypes2.default.bool,
/**
* Write <code>"-1"</code> if you don't want the user to tab to the button.
*/
tabIndex: _propTypes2.default.string,
/**
* Button type
*/
type: _propTypes2.default.oneOf(['reset', 'submit', 'button']),
/**
* HTML title attribute
*/
title: _propTypes2.default.string,
/**
* [Deprecated] Tooltip on button. Button should be a child of `Tooltip` instead.
*/
tooltip: _propTypes2.default.node,
/**
* Different types of buttons
*/
variant: _propTypes2.default.oneOf(['base', 'link', 'neutral', 'brand', 'destructive', 'success', 'icon'])
},
getDefaultProps: function getDefaultProps() {
return {
disabled: false,
hint: false,
iconSize: 'medium',
iconCategory: 'utility',
responsive: false,
type: 'button',
variant: 'neutral'
};
},
getClassName: function getClassName() {
var _classNames;
var isIcon = this.props.variant === 'icon';
var iconVariant = this.props.iconVariant;
var iconMore = iconVariant === 'more';
var iconBorder = iconVariant === 'border';
var iconGlobalHeader = iconVariant === 'global-header';
var showButtonVariant = this.props.variant !== 'base' && !iconVariant && !this.props.inverse && this.props.variant !== 'link' || iconVariant === 'bare';
var plainInverseBtn = this.props.inverse && !isIcon;
var plainInverseIcon = this.props.inverse && isIcon && !iconMore && !iconBorder;
var moreInverseIcon = this.props.inverse && iconMore;
var borderInverseIcon = this.props.inverse && iconBorder;
// After hijacking `iconVariant` to let `Button` know it's in the header, we reset to container style for the actual button CSS.
if (iconVariant === 'global-header') {
iconVariant = 'container';
}
return (0, _classnames2.default)((_classNames = {
'slds-button': this.props.variant !== 'link'
}, _defineProperty(_classNames, 'slds-button--' + this.props.variant, showButtonVariant), _defineProperty(_classNames, 'slds-button--inverse', plainInverseBtn), _defineProperty(_classNames, 'slds-button--icon-inverse', plainInverseIcon || moreInverseIcon), _defineProperty(_classNames, 'slds-button--icon-border-inverse', borderInverseIcon), _defineProperty(_classNames, 'slds-button--icon-' + iconVariant, iconVariant && !borderInverseIcon), _defineProperty(_classNames, 'slds-global-header__button--icon', iconGlobalHeader), _defineProperty(_classNames, 'slds-button--icon-' + this.props.iconSize, iconVariant && this.props.iconSize !== 'medium'), _defineProperty(_classNames, 'slds-button--reset', this.props.variant === 'link'), _defineProperty(_classNames, 'slds-text-link', this.props.variant === 'link'), _classNames), this.props.className);
},
handleClick: function handleClick(event) {
if (this.props.onClick) {
this.props.onClick(event);
}
},
renderIcon: function renderIcon(name) {
var iconSize = this.props.iconSize === '' || this.props.iconVariant ? null : this.props.iconSize;
return _react2.default.createElement(_buttonIcon2.default, {
category: this.props.iconCategory,
className: (0, _classnames2.default)({
'slds-global-header__icon': this.props.iconVariant === 'global-header'
}, this.props.iconClassName),
hint: this.props.hint,
inverse: this.props.inverse,
name: name,
path: this.props.iconPath,
position: this.props.iconPosition,
size: iconSize
});
},
renderLabel: function renderLabel() {
var iconOnly = this.props.variant === 'icon';
return iconOnly && this.props.assistiveText ? _react2.default.createElement(
'span',
{ className: 'slds-assistive-text' },
this.props.assistiveText
) : this.props.label;
},
renderButton: function renderButton() {
var _this = this;
return _react2.default.createElement(
'button',
{
'aria-controls': this.props['aria-controls'],
'aria-describedby': this.props['aria-describedby'],
'aria-expanded': this.props['aria-expanded'],
'aria-haspopup': this.props['aria-haspopup'],
className: this.getClassName(),
disabled: this.props.disabled,
id: this.props.id,
onBlur: this.props.onBlur,
onClick: this.handleClick,
onFocus: this.props.onFocus,
onKeyDown: this.props.onKeyDown,
onKeyPress: this.props.onKeyPress,
onKeyUp: this.props.onKeyUp,
onMouseDown: this.props.onMouseDown,
onMouseEnter: this.props.onMouseEnter,
onMouseLeave: this.props.onMouseLeave,
ref: function ref(component) {
if (_this.props.buttonRef) {
_this.props.buttonRef(component);
}
},
tabIndex: this.props.tabIndex,
title: this.props.title,
type: this.props.type
},
this.props.iconPosition === 'right' ? this.renderLabel() : null,
this.props.iconName || this.props.iconPath ? this.renderIcon(this.props.iconName) : null,
this.props.iconVariant === 'more' ? _react2.default.createElement(_buttonIcon2.default, { category: 'utility', name: 'down', size: 'x-small' }) : null,
this.props.iconPosition === 'left' || !this.props.iconPosition ? this.renderLabel() : null,
this.props.children // eslint-disable-line react/prop-types
);
},
// This is present for backwards compatibility and should be removed at a future breaking change release. Please wrap a `Button` in a `PopoverTooltip` to achieve the same result. There will be an extra trigger `div` wrapping the `Button` though.
renderTooltip: function renderTooltip() {
return _react2.default.createElement(
_popoverTooltip2.default,
{ content: this.props.tooltip },
this.renderButton
);
},
render: function render() {
return this.props.tooltip ? this.renderTooltip() : this.renderButton();
}
});
exports.default = Button;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var keys = {
ENTER: 13,
ESCAPE: 27,
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
TAB: 9,
DELETE: 46,
BACKSPACE: 8
};
// Helpful for interaction/event tests. Use with simulate:
// `nodes.input.simulate('keyDown', keyObjects.DOWN);`
var keyObjects = {
ENTER: { key: 'Enter', keyCode: keys.ENTER, which: keys.ENTER },
ESCAPE: { key: 'Escape', keyCode: keys.ESCAPE, which: keys.ESCAPE },
SPACE: { key: 'Space', keyCode: keys.SPACE, which: keys.SPACE },
LEFT: { key: 'Left', keyCode: keys.LEFT, which: keys.LEFT },
UP: { key: 'Up', keyCode: keys.UP, which: keys.ESCAPE },
RIGHT: { key: 'Right', keyCode: keys.RIGHT, which: keys.RIGHT },
DOWN: { key: 'Down', keyCode: keys.DOWN, which: keys.DOWN },
TAB: { key: 'Tab', keyCode: keys.TAB, which: keys.TAB },
DELETE: { key: 'Delete', keyCode: keys.DELETE, which: keys.DELETE },
BACKSPACE: {
key: 'Backspace',
keyCode: keys.BACKSPACE,
which: keys.BACKSPACE
}
};
exports.default = keys;
exports.keyObjects = keyObjects;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classNames2 = __webpack_require__(21);
var _classNames3 = _interopRequireDefault(_classNames2);
var _utilityIcon = __webpack_require__(23);
var _utilityIcon2 = _interopRequireDefault(_utilityIcon);
var _constants = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
// # Icon Component
// Based on SLDS v2.1.0-rc.4
// ## Dependencies
// ### React
// ### classNames
// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)
// A simple javascript utility for conditionally joining classNames together.
// ## Children
// ## Constants
/**
* The Icon component is the Lightning Design System Icon component and should be used for naked icons. For icons that are buttons, use the <a href='/components/buttons/'>Button component</a> component with <code>variant='icon'</code>.
*/
var Icon = function Icon(_ref) {
var assistiveText = _ref.assistiveText,
category = _ref.category,
className = _ref.className,
containerClassName = _ref.containerClassName,
icon = _ref.icon,
inverse = _ref.inverse,
name = _ref.name,
path = _ref.path,
size = _ref.size,
style = _ref.style,
title = _ref.title;
var kababCaseName = name ? name.replace(/_/g, '-') : '';
return _react2.default.createElement(
'span',
{
className: (0, _classNames3.default)(_defineProperty({
'slds-icon_container': category !== 'utility',
'slds-icon_container--circle': category === 'action'
}, 'slds-icon-' + category + '-' + kababCaseName, category !== 'utility' && category !== 'doctype' && !path), containerClassName),
title: title
},
_react2.default.createElement(_utilityIcon2.default, {
'aria-hidden': 'true',
category: category,
className: (0, _classNames3.default)(className, 'slds-icon', {
'slds-icon--xx-small': size === 'xx-small',
'slds-icon--x-small': size === 'x-small',
'slds-icon--small': size === 'small',
// medium intentially not present
'slds-icon--large': size === 'large',
// if category is `utility` and `inverse` is false (default), icon will be dark // return true
// if category is `utility` and `inverse` is true, icon will be light // return false
// if category is NOT `utility` and `inverse` is false (default), icon will be light // return false
// if category is NOT `utility` and `inverse` is true, icon will be dark // return true
'slds-icon-text-default': category === 'utility' ? !inverse : inverse
}),
icon: icon,
name: name,
path: path,
style: style
}),
assistiveText ? _react2.default.createElement(
'span',
{ className: 'slds-assistive-text' },
assistiveText
) : ''
);
};
// ### Display Name
// Always use the canonical component name as the React display name.
Icon.displayName = _constants.ICON;
// ### Prop Types
Icon.propTypes = {
/**
* Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means.
* Naked icons must have assistive text, however, if you also have visible descriptive text with the icon,
* declare this prop as <code>assistiveText=''</code>.
*/
assistiveText: _propTypes2.default.string,
/**
* Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)
*/
category: _propTypes2.default.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']).isRequired,
/**
* CSS classes that are applied to the SVG.
*/
className: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object, _propTypes2.default.string]),
/**
* CSS classes that are applied to the span.
*/
containerClassName: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object, _propTypes2.default.string]),
/**
* Icon color variants
*/
colorVariant: _propTypes2.default.oneOf(['base', 'default', 'error', 'warning']),
/**
* A custom SVG object to use instead of the supplied SLDS icons, look in `design-system-react/icons` for examples and syntax.
*/
icon: _propTypes2.default.object,
/**
* Setting `inverse` to true will switch the color of the icon: light to dark, dark to light.
*/
inverse: _propTypes2.default.bool,
/**
* Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.
*/
name: _propTypes2.default.string,
/**
* Path to the icon. This will override any global icon settings
*/
path: _propTypes2.default.string,
/**
* Size of the icon. Visit [lightningdesignsystem.com/components/icons/#flavor-sizes](https://www.lightningdesignsystem.com/components/icons/#flavor-sizes)
*/
size: _propTypes2.default.oneOf(['xx-small', 'x-small', 'small', 'medium', 'large']),
/**
* Custom styles to be passed to the SVG. Could be used to change icon or background color.
*/
style: _propTypes2.default.object,
/**
* Title attribute for the icon container
*/
title: _propTypes2.default.string
};
Icon.defaultProps = {
category: 'standard',
size: 'medium'
};
exports.default = Icon;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
nullTag = '[object Null]',
proxyTag = '[object Proxy]',
undefinedTag = '[object Undefined]';
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol,
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isFunction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
/***/ }),
/* 11 */
/***/ (function(module, exports) {
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max;
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = array;
return apply(func, this, otherArgs);
};
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
assignValue(object, key, newValue === undefined ? source[key] : newValue);
}
return object;
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Retur