@salesforce/design-system-react
Version:
Salesforce Lightning Design System for React
1,404 lines (1,231 loc) • 2.05 MB
JavaScript
/*!
* design-system-react
* v0.8.19
* 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_16__) {
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 = 83);
/******/ })
/************************************************************************/
/******/ ([
/* 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__(87)();
}
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TREE_ITEM = exports.TREE_BRANCH = exports.TREE = exports.TOAST_CONTAINER = exports.TOAST = exports.TIME_PICKER = exports.TABS_PANEL = exports.TABS_LIST = exports.TABS = exports.TAB_PANEL = exports.TAB_ITEM = exports.TAB = exports.RADIO_BUTTON_GROUP = exports.RADIO_GROUP = exports.RADIO = exports.SPLIT_VIEW_LISTBOX = exports.SPLIT_VIEW_HEADER = exports.SPLIT_VIEW = exports.SPINNER = exports.SLIDER = exports.PROGRESS_RING = exports.PROGRESS_INDICATOR_STEP = exports.PROGRESS_INDICATOR_PROGRESS = exports.PROGRESS_INDICATOR = exports.POPOVER_TOOLTIP = exports.POPOVER = exports.PILL = exports.PAGE_HEADER = exports.PANEL_FILTER_LIST_HEADING = exports.PANEL_FILTER_LIST = exports.PANEL_FILTER_GROUP = exports.PANEL = exports.NOTIFICATION = exports.NAVIGATION_ITEM = exports.NAVIGATION = exports.MODAL = exports.MENU_PICKLIST = exports.MENU_DROPDOWN_TRIGGER = exports.MENU_DROPDOWN = exports.MEDIA_OBJECT = exports.LOOKUP = exports.LIST_ITEM_LABEL = exports.LIST_ITEM = exports.LIST = exports.ILLUSTRATION = exports.ICON_INPUT = exports.ICON_SETTINGS = exports.ICON = exports.HIGHLIGHTER = exports.GRID = exports.GLOBAL_NAVIGATION_BAR_APP_LAUNCHER = exports.GLOBAL_NAVIGATION_BAR_REGION = exports.GLOBAL_NAVIGATION_BAR_LINK = exports.GLOBAL_NAVIGATION_BAR_LABEL = exports.GLOBAL_NAVIGATION_BAR_DROPDOWN = exports.GLOBAL_NAVIGATION_BAR_BUTTON = exports.GLOBAL_NAVIGATION_BAR = exports.GLOBAL_HEADER_TOOL = exports.GLOBAL_HEADER_SEARCH = exports.GLOBAL_HEADER_PROFILE = exports.GLOBAL_HEADER = exports.FORMS_SEARCH = exports.FORMS_TEXTAREA = exports.FORMS_INPUT = exports.FORMS_INLINE_EDIT = exports.FORMS_CHECKBOX = exports.FILTER = exports.DIALOG = exports.DATE_PICKER = exports.DATA_TABLE_ROW = exports.DATA_TABLE_ROW_ACTIONS = exports.DATA_TABLE_HEADER_CELL = exports.DATA_TABLE_HEAD = exports.DATA_TABLE_COLUMN = exports.DATA_TABLE_CELL = exports.DATA_TABLE = exports.COMBOBOX = exports.CARD_HEADER = exports.CARD_FOOTER = exports.CARD_FILTER = exports.CARD_EMPTY = exports.CARD_BODY = exports.CARD = exports.BUTTON_ICON = exports.BUTTON_STATEFUL = exports.BUTTON_GROUP = exports.BUTTON = exports.BREADCRUMB = exports.BREAD_CRUMB = exports.AVATAR = exports.APP_LAUNCHER_HEADER = exports.APP_LAUNCHER_TILE = exports.APP_LAUNCHER_SECTION = exports.APP_LAUNCHER = exports.ALERT_CONTAINER = exports.ALERT = exports.ACCORDION_PANEL = exports.ACCORDION = void 0;
// ## Components
var ACCORDION = 'SLDSAccordion';
exports.ACCORDION = ACCORDION;
var ACCORDION_PANEL = 'SLDSAccordionPanel';
exports.ACCORDION_PANEL = ACCORDION_PANEL;
var ALERT = 'SLDSAlert';
exports.ALERT = ALERT;
var ALERT_CONTAINER = 'SLDSAlertContainer';
exports.ALERT_CONTAINER = ALERT_CONTAINER;
var APP_LAUNCHER = 'SLDSAppLauncher';
exports.APP_LAUNCHER = APP_LAUNCHER;
var APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';
exports.APP_LAUNCHER_SECTION = APP_LAUNCHER_SECTION;
var APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';
exports.APP_LAUNCHER_TILE = APP_LAUNCHER_TILE;
var APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';
exports.APP_LAUNCHER_HEADER = APP_LAUNCHER_HEADER;
var AVATAR = 'SLDSAvatar';
/* Remove at next breaking change */
exports.AVATAR = AVATAR;
var BREAD_CRUMB = 'SLDSBreadcrumb';
exports.BREAD_CRUMB = BREAD_CRUMB;
var BREADCRUMB = 'SLDSBreadcrumb';
exports.BREADCRUMB = BREADCRUMB;
var BUTTON = 'SLDSButton';
exports.BUTTON = BUTTON;
var BUTTON_GROUP = 'SLDSButtonGroup';
exports.BUTTON_GROUP = BUTTON_GROUP;
var BUTTON_STATEFUL = 'SLDSButtonStateful';
exports.BUTTON_STATEFUL = BUTTON_STATEFUL;
var BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon
exports.BUTTON_ICON = BUTTON_ICON;
var CARD = 'SLDSCard';
exports.CARD = CARD;
var CARD_BODY = 'SLDSCardBody';
exports.CARD_BODY = CARD_BODY;
var CARD_EMPTY = 'SLDSCardEmpty';
exports.CARD_EMPTY = CARD_EMPTY;
var CARD_FILTER = 'SLDSCardFilter';
exports.CARD_FILTER = CARD_FILTER;
var CARD_FOOTER = 'SLDSCardFooter';
exports.CARD_FOOTER = CARD_FOOTER;
var CARD_HEADER = 'SLDSCardHeader';
exports.CARD_HEADER = CARD_HEADER;
var COMBOBOX = 'SLDSCombobox';
exports.COMBOBOX = COMBOBOX;
var DATA_TABLE = 'SLDSDataTable';
exports.DATA_TABLE = DATA_TABLE;
var DATA_TABLE_CELL = 'SLDSDataTableCell';
exports.DATA_TABLE_CELL = DATA_TABLE_CELL;
var DATA_TABLE_COLUMN = 'SLDSDataTableColumn';
exports.DATA_TABLE_COLUMN = DATA_TABLE_COLUMN;
var DATA_TABLE_HEAD = 'SLDSDataTableHead';
exports.DATA_TABLE_HEAD = DATA_TABLE_HEAD;
var DATA_TABLE_HEADER_CELL = 'SLDSDataTableHeaderCell';
exports.DATA_TABLE_HEADER_CELL = DATA_TABLE_HEADER_CELL;
var DATA_TABLE_ROW_ACTIONS = 'SLDSDataTableRowActions';
exports.DATA_TABLE_ROW_ACTIONS = DATA_TABLE_ROW_ACTIONS;
var DATA_TABLE_ROW = 'SLDSDataTableRow';
exports.DATA_TABLE_ROW = DATA_TABLE_ROW;
var DATE_PICKER = 'SLDSDatePicker';
exports.DATE_PICKER = DATE_PICKER;
var DIALOG = 'SLDSDialog';
exports.DIALOG = DIALOG;
var FILTER = 'SLDSFilter';
exports.FILTER = FILTER;
var FORMS_CHECKBOX = 'SLDSCheckbox';
exports.FORMS_CHECKBOX = FORMS_CHECKBOX;
var FORMS_INLINE_EDIT = 'SLDSInlineEdit';
exports.FORMS_INLINE_EDIT = FORMS_INLINE_EDIT;
var FORMS_INPUT = 'SLDSInput';
exports.FORMS_INPUT = FORMS_INPUT;
var FORMS_TEXTAREA = 'SLDSTextarea';
exports.FORMS_TEXTAREA = FORMS_TEXTAREA;
var FORMS_SEARCH = 'SLDSSearch';
exports.FORMS_SEARCH = FORMS_SEARCH;
var GLOBAL_HEADER = 'SLDSGlobalHeader';
exports.GLOBAL_HEADER = GLOBAL_HEADER;
var GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';
exports.GLOBAL_HEADER_PROFILE = GLOBAL_HEADER_PROFILE;
var GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';
exports.GLOBAL_HEADER_SEARCH = GLOBAL_HEADER_SEARCH;
var GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';
exports.GLOBAL_HEADER_TOOL = GLOBAL_HEADER_TOOL;
var GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';
exports.GLOBAL_NAVIGATION_BAR = GLOBAL_NAVIGATION_BAR;
var GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';
exports.GLOBAL_NAVIGATION_BAR_BUTTON = GLOBAL_NAVIGATION_BAR_BUTTON;
var GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';
exports.GLOBAL_NAVIGATION_BAR_DROPDOWN = GLOBAL_NAVIGATION_BAR_DROPDOWN;
var GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';
exports.GLOBAL_NAVIGATION_BAR_LABEL = GLOBAL_NAVIGATION_BAR_LABEL;
var GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';
exports.GLOBAL_NAVIGATION_BAR_LINK = GLOBAL_NAVIGATION_BAR_LINK;
var GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';
exports.GLOBAL_NAVIGATION_BAR_REGION = GLOBAL_NAVIGATION_BAR_REGION;
var GLOBAL_NAVIGATION_BAR_APP_LAUNCHER = 'SLDSGlobalNavigationBarAppLauncher';
exports.GLOBAL_NAVIGATION_BAR_APP_LAUNCHER = GLOBAL_NAVIGATION_BAR_APP_LAUNCHER;
var GRID = 'SLDSGrid';
exports.GRID = GRID;
var HIGHLIGHTER = 'SLDSHighlighter';
exports.HIGHLIGHTER = HIGHLIGHTER;
var ICON = 'SLDSIcon';
exports.ICON = ICON;
var ICON_SETTINGS = 'SLDSIconSettings';
exports.ICON_SETTINGS = ICON_SETTINGS;
var ICON_INPUT = 'SLDSIconInput';
exports.ICON_INPUT = ICON_INPUT;
var ILLUSTRATION = 'SLDSIllustration';
exports.ILLUSTRATION = ILLUSTRATION;
var LIST = 'SLDSList';
exports.LIST = LIST;
var LIST_ITEM = 'SLDSListItem';
exports.LIST_ITEM = LIST_ITEM;
var LIST_ITEM_LABEL = 'SLDSListItemLabel';
exports.LIST_ITEM_LABEL = LIST_ITEM_LABEL;
var LOOKUP = 'SLDSLookup';
exports.LOOKUP = LOOKUP;
var MEDIA_OBJECT = 'SLDSMediaObject';
exports.MEDIA_OBJECT = MEDIA_OBJECT;
var MENU_DROPDOWN = 'SLDSMenuDropdown';
exports.MENU_DROPDOWN = MENU_DROPDOWN;
var MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';
exports.MENU_DROPDOWN_TRIGGER = MENU_DROPDOWN_TRIGGER;
var MENU_PICKLIST = 'SLDSMenuPicklist';
exports.MENU_PICKLIST = MENU_PICKLIST;
var MODAL = 'SLDSModal';
exports.MODAL = MODAL;
var NAVIGATION = 'SLDSNavigation';
exports.NAVIGATION = NAVIGATION;
var NAVIGATION_ITEM = 'SLDSNavigationItem';
exports.NAVIGATION_ITEM = NAVIGATION_ITEM;
var NOTIFICATION = 'SLDSNotification';
exports.NOTIFICATION = NOTIFICATION;
var PANEL = 'SLDSPanel';
exports.PANEL = PANEL;
var PANEL_FILTER_GROUP = 'SLDSFilterGroup';
exports.PANEL_FILTER_GROUP = PANEL_FILTER_GROUP;
var PANEL_FILTER_LIST = 'SLDSFilterList';
exports.PANEL_FILTER_LIST = PANEL_FILTER_LIST;
var PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';
exports.PANEL_FILTER_LIST_HEADING = PANEL_FILTER_LIST_HEADING;
var PAGE_HEADER = 'SLDSPageHeader';
exports.PAGE_HEADER = PAGE_HEADER;
var PILL = 'SLDSPill';
exports.PILL = PILL;
var POPOVER = 'SLDSPopover';
exports.POPOVER = POPOVER;
var POPOVER_TOOLTIP = 'SLDSPopoverTooltip';
exports.POPOVER_TOOLTIP = POPOVER_TOOLTIP;
var PROGRESS_INDICATOR = 'SLDSProgressIndicator';
exports.PROGRESS_INDICATOR = PROGRESS_INDICATOR;
var PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';
exports.PROGRESS_INDICATOR_PROGRESS = PROGRESS_INDICATOR_PROGRESS;
var PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';
exports.PROGRESS_INDICATOR_STEP = PROGRESS_INDICATOR_STEP;
var PROGRESS_RING = 'SLDSProgressRing';
exports.PROGRESS_RING = PROGRESS_RING;
var SLIDER = 'SLDSSlider';
exports.SLIDER = SLIDER;
var SPINNER = 'SLDSSpinner';
exports.SPINNER = SPINNER;
var SPLIT_VIEW = 'SLDSSplitView';
exports.SPLIT_VIEW = SPLIT_VIEW;
var SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';
exports.SPLIT_VIEW_HEADER = SPLIT_VIEW_HEADER;
var SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';
exports.SPLIT_VIEW_LISTBOX = SPLIT_VIEW_LISTBOX;
var RADIO = 'SLDSRadio';
exports.RADIO = RADIO;
var RADIO_GROUP = 'SLDSRadioGroup';
exports.RADIO_GROUP = RADIO_GROUP;
var RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';
exports.RADIO_BUTTON_GROUP = RADIO_BUTTON_GROUP;
var TAB = 'SLDSTab';
exports.TAB = TAB;
var TAB_ITEM = 'SLDSTabItem';
exports.TAB_ITEM = TAB_ITEM;
var TAB_PANEL = 'SLDSTabPanel';
exports.TAB_PANEL = TAB_PANEL;
var TABS = 'SLDSTabs';
exports.TABS = TABS;
var TABS_LIST = 'SLDSTabsList';
exports.TABS_LIST = TABS_LIST;
var TABS_PANEL = 'SLDSTabsPanel';
exports.TABS_PANEL = TABS_PANEL;
var TIME_PICKER = 'SLDSTimepicker';
exports.TIME_PICKER = TIME_PICKER;
var TOAST = 'SLDSToast';
exports.TOAST = TOAST;
var TOAST_CONTAINER = 'SLDSToastContainer';
exports.TOAST_CONTAINER = TOAST_CONTAINER;
var TREE = 'SLDSTree';
exports.TREE = TREE;
var TREE_BRANCH = 'SLDSTreeBranch';
exports.TREE_BRANCH = TREE_BRANCH;
var TREE_ITEM = 'SLDSTreeItem';
exports.TREE_ITEM = TREE_ITEM;
/***/ }),
/* 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__(105);
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__(97);
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* 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);
}
};
var _default = EventUtil;
exports.default = _default;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.keyObjects = exports.default = void 0;
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.keyObjects = keyObjects;
var _default = keys;
exports.default = _default;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(__webpack_require__(0));
var _createReactClass = _interopRequireDefault(__webpack_require__(4));
var _reactRequiredIf = _interopRequireDefault(__webpack_require__(51));
var _propTypes = _interopRequireDefault(__webpack_require__(1));
var _classnames = _interopRequireDefault(__webpack_require__(3));
var _buttonIcon = _interopRequireDefault(__webpack_require__(29));
var _checkProps = _interopRequireDefault(__webpack_require__(116));
var _popoverTooltip = _interopRequireDefault(__webpack_require__(54));
var _constants = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
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; }
var defaultProps = {
assistiveText: {
icon: ''
},
disabled: false,
hint: false,
iconSize: 'medium',
responsive: false,
type: 'button',
variant: 'neutral'
};
/**
* 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.icon</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, _createReactClass.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': _propTypes.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': _propTypes.default.string,
/**
* Used if the Button triggers a menu or popup. Bool indicates if the menu or popup is open or closed.
*/
'aria-expanded': _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
/**
* True if Button triggers a menu or popup to open/close.
*/
'aria-haspopup': _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
/**
* **Assistive text for accessibility.**
* This object is merged with the default props object on every render.
* * `icon`: 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.icon</code> prop and use the <code>label</code> prop.
*/
assistiveText: _propTypes.default.shape({
icon: _propTypes.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: _propTypes.default.func,
/**
* CSS classes to be added to button.
*/
className: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.default.string]),
/**
* Disables the button and adds disabled styling.
*/
disabled: _propTypes.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: _propTypes.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: (0, _reactRequiredIf.default)(_propTypes.default.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']), function (props) {
return !!props.iconName;
}),
/**
* CSS classes to be added to icon.
*/
iconClassName: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.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: _propTypes.default.string,
/**
* Path to the icon. This will override any global icon settings.
*/
iconPath: _propTypes.default.string,
/**
* If omitted, icon position is centered.
*/
iconPosition: _propTypes.default.oneOf(['left', 'right']),
/**
* Determines the size of the icon.
*/
iconSize: _propTypes.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: _propTypes.default.oneOf(['bare', 'container', 'border', 'border-filled', 'more', 'global-header']),
/**
* Id string applied to button node.
*/
id: _propTypes.default.string,
/**
* If true, button/icon is white. Meant for buttons or utility icons on dark backgrounds.
*/
inverse: _propTypes.default.bool,
/**
* Visible label on the button. If the button is an icon button with no label, you must use the <code>assistiveText.icon</code> prop.
*/
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
/**
* Triggered when focus is removed.
*/
onBlur: _propTypes.default.func,
/**
* Triggered when the button is clicked.
*/
onClick: _propTypes.default.func,
/**
* Triggered when component is focused.
*/
onFocus: _propTypes.default.func,
/**
* Triggered when a key is pressed down
*/
onKeyDown: _propTypes.default.func,
/**
* Triggered when a key is pressed and released
*/
onKeyPress: _propTypes.default.func,
/**
* Triggered when a key is released
*/
onKeyUp: _propTypes.default.func,
/**
* Triggered when a mouse button is pressed down
*/
onMouseDown: _propTypes.default.func,
/**
* Triggered when a mouse arrow hovers
*/
onMouseEnter: _propTypes.default.func,
/**
* Triggered when a mouse arrow no longer hovers
*/
onMouseLeave: _propTypes.default.func,
/**
* If true, button scales to 100% width on small form factors.
*/
responsive: _propTypes.default.bool,
/**
* Write <code>"-1"</code> if you don't want the user to tab to the button.
*/
tabIndex: _propTypes.default.string,
/**
* Button type
*/
type: _propTypes.default.oneOf(['reset', 'submit', 'button']),
/**
* HTML title attribute
*/
title: _propTypes.default.string,
/**
* [Deprecated] Tooltip on button. Button should be a child of `Tooltip` instead.
*/
tooltip: _propTypes.default.node,
/**
* Different types of buttons
*/
variant: _propTypes.default.oneOf(['base', 'link', 'neutral', 'brand', 'destructive', 'success', 'icon'])
},
getDefaultProps: function getDefaultProps() {
return defaultProps;
},
componentWillMount: function componentWillMount() {
// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)
(0, _checkProps.default)(_constants.BUTTON, this.props);
},
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, _classnames.default)((_classNames = {
'slds-button': this.props.variant !== 'link'
}, _defineProperty(_classNames, "slds-button--".concat(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-".concat(iconVariant), iconVariant && !borderInverseIcon), _defineProperty(_classNames, 'slds-global-header__button--icon', iconGlobalHeader), _defineProperty(_classNames, "slds-button--icon-".concat(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 _react.default.createElement(_buttonIcon.default, {
category: this.props.iconCategory || 'utility' // BREAKING CHANGE we will introduce in 1.0. For the moment, set default prop here if none specified.
,
className: (0, _classnames.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.iconName || this.props.iconPath;
var assistiveTextIcon = typeof this.props.assistiveText === 'string' ? this.props.assistiveText : _objectSpread({}, defaultProps.assistiveText, this.props.assistiveText).icon;
return iconOnly && assistiveTextIcon ? _react.default.createElement("span", {
className: "slds-assistive-text"
}, assistiveTextIcon) : this.props.label;
},
renderButton: function renderButton() {
var _this = this;
return _react.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' ? _react.default.createElement(_buttonIcon.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 _react.default.createElement(_popoverTooltip.default, {
content: this.props.tooltip
}, this.renderButton);
},
render: function render() {
return this.props.tooltip ? this.renderTooltip() : this.renderButton();
}
});
var _default = Button;
exports.default = _default;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(__webpack_require__(0));
var _propTypes = _interopRequireDefault(__webpack_require__(1));
var _classNames2 = _interopRequireDefault(__webpack_require__(20));
var _utilityIcon = _interopRequireDefault(__webpack_require__(23));
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; }
/**
* 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 _react.default.createElement("span", {
className: (0, _classNames2.default)(_defineProperty({
'slds-icon_container': category !== 'utility',
'slds-icon_container--circle': category === 'action'
}, "slds-icon-".concat(category, "-").concat(kababCaseName), category !== 'utility' && category !== 'doctype' && !path), containerClassName),
title: title
}, _react.default.createElement(_utilityIcon.default, {
"aria-hidden": "true",
category: category,
className: (0, _classNames2.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 ? _react.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: _propTypes.default.string,
/**
* Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)
*/
category: _propTypes.default.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']).isRequired,
/**
* CSS classes that are applied to the SVG.
*/
className: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.default.string]),
/**
* CSS classes that are applied to the span.
*/
containerClassName: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.default.string]),
/**
* Icon color variants
*/
colorVariant: _propTypes.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: _propTypes.default.object,
/**
* Setting `inverse` to true will switch the color of the icon: light to dark, dark to light.
*/
inverse: _propTypes.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: _propTypes.default.string,
/**
* Path to the icon. This will override any global icon settings
*/
path: _propTypes.default.string,
/**
* Size of the icon. Visit [lightningdesignsystem.com/components/icons/#flavor-sizes](https://www.lightningdesignsystem.com/components/icons/#flavor-sizes)
*/
size: _propTypes.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: _propTypes.default.object,
/**
* Title attribute for the icon container
*/
title: _propTypes.default.string
};
Icon.defaultProps = {
category: 'standard',
size: 'medium'
};
var _default = Icon;
exports.default = _default;
/***/ }),
/* 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__(17)))
/***/ }),
/* 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