From 6b5c55d133d65cd92103a17730647f9476003d54 Mon Sep 17 00:00:00 2001 From: Tim Phillips Date: Mon, 31 Oct 2016 20:17:23 -0700 Subject: [PATCH] add onSelectionChange and persist selectedRowIds across pages --- build/Griddle.js | 3681 +++++++++++++++++++++----------------- modules/gridRow.jsx.js | 253 +-- modules/gridTitle.jsx.js | 10 +- modules/griddle.jsx.js | 61 +- scripts/gridRow.jsx | 49 +- scripts/gridTitle.jsx | 14 +- scripts/griddle.jsx | 87 +- 7 files changed, 2312 insertions(+), 1843 deletions(-) mode change 100755 => 100644 scripts/gridTitle.jsx mode change 100755 => 100644 scripts/griddle.jsx diff --git a/build/Griddle.js b/build/Griddle.js index 3615c463..6b5d04fc 100644 --- a/build/Griddle.js +++ b/build/Griddle.js @@ -82,37 +82,38 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var GridTable = __webpack_require__(3); - var GridFilter = __webpack_require__(154); - var GridPagination = __webpack_require__(155); - var GridSettings = __webpack_require__(156); - var GridNoData = __webpack_require__(161); - var GridRow = __webpack_require__(162); - var GridRowContainer = __webpack_require__(148); - var CustomRowComponentContainer = __webpack_require__(179); - var CustomPaginationContainer = __webpack_require__(180); - var CustomFilterContainer = __webpack_require__(181); + var GridFilter = __webpack_require__(168); + var GridPagination = __webpack_require__(169); + var GridSettings = __webpack_require__(170); + var GridNoData = __webpack_require__(176); + var GridRow = __webpack_require__(177); + var GridRowContainer = __webpack_require__(160); + var CustomRowComponentContainer = __webpack_require__(193); + var CustomPaginationContainer = __webpack_require__(194); + var CustomFilterContainer = __webpack_require__(195); var ColumnProperties = __webpack_require__(5); - var RowProperties = __webpack_require__(152); - var deep = __webpack_require__(163); - - var drop = __webpack_require__(182); - var dropRight = __webpack_require__(184); - var find = __webpack_require__(117); - var first = __webpack_require__(185); - var forEach = __webpack_require__(164); - var initial = __webpack_require__(186); - var isArray = __webpack_require__(78); - var isEmpty = __webpack_require__(187); - var isNull = __webpack_require__(191); - var isUndefined = __webpack_require__(192); - var omit = __webpack_require__(193); + var RowProperties = __webpack_require__(166); + var deep = __webpack_require__(178); + + var drop = __webpack_require__(196); + var dropRight = __webpack_require__(198); + var find = __webpack_require__(123); + var first = __webpack_require__(199); + var forEach = __webpack_require__(179); + var initial = __webpack_require__(200); + var intersection = __webpack_require__(201); + var isArray = __webpack_require__(71); + var isEmpty = __webpack_require__(204); + var isNull = __webpack_require__(205); + var isUndefined = __webpack_require__(206); + var omit = __webpack_require__(207); var map = __webpack_require__(6); - var extend = __webpack_require__(144); - var _filter = __webpack_require__(114); + var extend = __webpack_require__(155); + var _filter = __webpack_require__(120); - var _orderBy = __webpack_require__(199); - var _property = __webpack_require__(106); - var _get = __webpack_require__(92); + var _orderBy = __webpack_require__(214); + var _property = __webpack_require__(111); + var _get = __webpack_require__(96); var Griddle = React.createClass({ displayName: 'Griddle', @@ -211,13 +212,15 @@ return /******/ (function(modules) { // webpackBootstrap "previousIconComponent": "", "isMultipleSelection": false, //currently does not support subgrids "selectedRowIds": [], - "uniqueIdentifier": "id" + "uniqueIdentifier": "id", + "onSelectionChange": null }; }, propTypes: { isMultipleSelection: React.PropTypes.bool, selectedRowIds: React.PropTypes.oneOfType([React.PropTypes.arrayOf(React.PropTypes.number), React.PropTypes.arrayOf(React.PropTypes.string)]), - uniqueIdentifier: React.PropTypes.string + uniqueIdentifier: React.PropTypes.string, + onSelectionChange: React.PropTypes.func }, defaultFilter: function defaultFilter(results, filter) { var that = this; @@ -381,10 +384,6 @@ return /******/ (function(modules) { // webpackBootstrap this.setState({ isSelectAllChecked: false }); - } else { - //When the paging is done on the server, the previously selected rows on a certain page might not - // coincide with the new rows on that exact page page, if moving back and forth. Better reset the selection - this._resetSelectedRows(); } }, setColumns: function setColumns(columns) { @@ -411,15 +410,15 @@ return /******/ (function(modules) { // webpackBootstrap return; } - if (this.props.useExternal) { - var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; - this.setState({ - sortColumn: column, - sortDirection: isAscending ? 'asc' : 'desc' - }); - this.props.externalChangeSort(column, isAscending); - return; - } + if (this.props.useExternal) { + var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; + this.setState({ + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' + }); + this.props.externalChangeSort(column, isAscending); + return; + } var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; var sortDirectionCycle = columnMeta.sortDirectionCycle ? columnMeta.sortDirectionCycle : [null, 'asc', 'desc']; var sortDirection = null; @@ -442,10 +441,6 @@ return /******/ (function(modules) { // webpackBootstrap }; this.setState(state); - - //When the sorting is done on the server, the previously selected rows might not correspond with the new ones. - //Better reset the selection - this._resetSelectedRows(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setMaxPage(nextProps.results); @@ -473,7 +468,7 @@ return /******/ (function(modules) { // webpackBootstrap } if (nextProps.selectedRowIds) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true); + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), @@ -659,9 +654,8 @@ return /******/ (function(modules) { // webpackBootstrap } return transformedData; }, - //this is the current results - getCurrentResults: function getCurrentResults() { - return this.state.filteredResults || this.props.results; + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; }, getCurrentPage: function getCurrentPage() { return this.props.externalCurrentPage || this.state.page; @@ -704,18 +698,27 @@ return /******/ (function(modules) { // webpackBootstrap isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _toggleSelectRow: function _toggleSelectRow(row, isChecked) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + this.setState({ - isSelectAllChecked: this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { @@ -739,23 +742,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { - var i, isFound; - - if (selectedRowIds.length !== visibleRowIds.length) { - return false; - } - - for (i = 0; i < selectedRowIds.length; i++) { - isFound = find(visibleRowIds, function (visibleRowId) { - return selectedRowIds[i] === visibleRowId; - }); - - if (isFound === undefined) { - return false; - } - } - - return true; + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; }, _getIsRowChecked: function _getIsRowChecked(row) { @@ -781,7 +768,6 @@ return /******/ (function(modules) { // webpackBootstrap }) ? false : this.props.isMultipleSelection, //does not support subgrids toggleSelectAll: this._toggleSelectAll, getIsSelectAllChecked: this._getIsSelectAllChecked, - toggleSelectRow: this._toggleSelectRow, getSelectedRowIds: this.getSelectedRowIds, getIsRowChecked: this._getIsRowChecked @@ -995,9 +981,9 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var GridTitle = __webpack_require__(4); - var GridRowContainer = __webpack_require__(148); + var GridRowContainer = __webpack_require__(160); var ColumnProperties = __webpack_require__(5); - var RowProperties = __webpack_require__(152); + var RowProperties = __webpack_require__(166); var GridTable = React.createClass({ displayName: 'GridTable', @@ -1290,7 +1276,7 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var ColumnProperties = __webpack_require__(5); - var assign = __webpack_require__(144); + var assign = __webpack_require__(155); var DefaultHeaderComponent = React.createClass({ displayName: 'DefaultHeaderComponent', @@ -1378,15 +1364,19 @@ return /******/ (function(modules) { // webpackBootstrap }; } titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); - return React.createElement('th', { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); }); if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { - nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles }, React.createElement('input', { type: 'checkbox', + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), - onChange: this.handleSelectionChange }))); + onChange: this.handleSelectionChange + }))); } //Get the row from the row settings. @@ -1411,10 +1401,10 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var map = __webpack_require__(6); - var filter = __webpack_require__(114); - var find = __webpack_require__(117); - var sortBy = __webpack_require__(124); - var difference = __webpack_require__(137); + var filter = __webpack_require__(120); + var find = __webpack_require__(123); + var sortBy = __webpack_require__(130); + var difference = __webpack_require__(147); var ColumnProperties = (function () { function ColumnProperties() { @@ -1514,8 +1504,8 @@ return /******/ (function(modules) { // webpackBootstrap var arrayMap = __webpack_require__(7), baseIteratee = __webpack_require__(8), - baseMap = __webpack_require__(108), - isArray = __webpack_require__(78); + baseMap = __webpack_require__(114), + isArray = __webpack_require__(71); /** * Creates an array of values by running each element in `collection` thru @@ -1536,8 +1526,7 @@ return /******/ (function(modules) { // webpackBootstrap * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -1600,10 +1589,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { var baseMatches = __webpack_require__(9), - baseMatchesProperty = __webpack_require__(91), - identity = __webpack_require__(105), - isArray = __webpack_require__(78), - property = __webpack_require__(106); + baseMatchesProperty = __webpack_require__(95), + identity = __webpack_require__(110), + isArray = __webpack_require__(71), + property = __webpack_require__(111); /** * The base implementation of `_.iteratee`. @@ -1637,8 +1626,8 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { var baseIsMatch = __webpack_require__(10), - getMatchData = __webpack_require__(88), - matchesStrictComparable = __webpack_require__(90); + getMatchData = __webpack_require__(92), + matchesStrictComparable = __webpack_require__(94); /** * The base implementation of `_.matches` which doesn't clone `source`. @@ -1665,7 +1654,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { var Stack = __webpack_require__(11), - baseIsEqual = __webpack_require__(52); + baseIsEqual = __webpack_require__(51); /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, @@ -1747,7 +1736,8 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { - this.__data__ = new ListCache(entries); + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } // Add methods to `Stack`. @@ -1811,6 +1801,7 @@ return /******/ (function(modules) { // webpackBootstrap */ function listCacheClear() { this.__data__ = []; + this.size = 0; } module.exports = listCacheClear; @@ -1850,6 +1841,7 @@ return /******/ (function(modules) { // webpackBootstrap } else { splice.call(data, index, 1); } + --this.size; return true; } @@ -1866,7 +1858,7 @@ return /******/ (function(modules) { // webpackBootstrap * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ @@ -1889,7 +1881,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static @@ -1901,8 +1893,8 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.eq(object, object); * // => true @@ -1994,6 +1986,7 @@ return /******/ (function(modules) { // webpackBootstrap index = assocIndexOf(data, key); if (index < 0) { + ++this.size; data.push([key, value]); } else { data[index][1] = value; @@ -2019,6 +2012,7 @@ return /******/ (function(modules) { // webpackBootstrap */ function stackClear() { this.__data__ = new ListCache; + this.size = 0; } module.exports = stackClear; @@ -2038,7 +2032,11 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - return this.__data__['delete'](key); + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; } module.exports = stackDelete; @@ -2089,7 +2087,8 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(12), - MapCache = __webpack_require__(25); + Map = __webpack_require__(25), + MapCache = __webpack_require__(36); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -2105,11 +2104,18 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { - cache = this.__data__ = new MapCache(cache.__data__); + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); } - cache.set(key, value); + data.set(key, value); + this.size = data.size; return this; } @@ -2120,142 +2126,21 @@ return /******/ (function(modules) { // webpackBootstrap /* 25 */ /***/ function(module, exports, __webpack_require__) { - var mapCacheClear = __webpack_require__(26), - mapCacheDelete = __webpack_require__(46), - mapCacheGet = __webpack_require__(49), - mapCacheHas = __webpack_require__(50), - mapCacheSet = __webpack_require__(51); - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - module.exports = MapCache; - - -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { - - var Hash = __webpack_require__(27), - ListCache = __webpack_require__(12), - Map = __webpack_require__(45); - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - module.exports = mapCacheClear; - - -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { - - var hashClear = __webpack_require__(28), - hashDelete = __webpack_require__(41), - hashGet = __webpack_require__(42), - hashHas = __webpack_require__(43), - hashSet = __webpack_require__(44); - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - module.exports = Hash; - - -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - var nativeCreate = __webpack_require__(29); - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } - - module.exports = hashClear; - - -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { - - var getNative = __webpack_require__(30); + var getNative = __webpack_require__(26), + root = __webpack_require__(32); /* Built-in method references that are verified to be native. */ - var nativeCreate = getNative(Object, 'create'); + var Map = getNative(root, 'Map'); - module.exports = nativeCreate; + module.exports = Map; /***/ }, -/* 30 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { - var baseIsNative = __webpack_require__(31), - getValue = __webpack_require__(40); + var baseIsNative = __webpack_require__(27), + getValue = __webpack_require__(35); /** * Gets the native function at `key` of `object`. @@ -2274,18 +2159,17 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 31 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { - var isFunction = __webpack_require__(32), - isHostObject = __webpack_require__(34), - isMasked = __webpack_require__(35), - isObject = __webpack_require__(33), - toSource = __webpack_require__(39); + var isFunction = __webpack_require__(28), + isMasked = __webpack_require__(30), + isObject = __webpack_require__(29), + toSource = __webpack_require__(34); /** * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; @@ -2293,10 +2177,11 @@ return /******/ (function(modules) { // webpackBootstrap var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ - var objectProto = Object.prototype; + var funcProto = Function.prototype, + objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; + var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; @@ -2319,7 +2204,7 @@ return /******/ (function(modules) { // webpackBootstrap if (!isObject(value) || isMasked(value)) { return false; } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } @@ -2327,21 +2212,22 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 32 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { - var isObject = __webpack_require__(33); + var isObject = __webpack_require__(29); /** `Object#toString` result references. */ var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -2354,8 +2240,7 @@ return /******/ (function(modules) { // webpackBootstrap * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -2366,22 +2251,21 @@ return /******/ (function(modules) { // webpackBootstrap */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } module.exports = isFunction; /***/ }, -/* 33 */ +/* 29 */ /***/ function(module, exports) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [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 @@ -2406,43 +2290,17 @@ return /******/ (function(modules) { // webpackBootstrap */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }, -/* 34 */ -/***/ function(module, exports) { - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - module.exports = isHostObject; - - -/***/ }, -/* 35 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { - var coreJsData = __webpack_require__(36); + var coreJsData = __webpack_require__(31); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { @@ -2465,10 +2323,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 36 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { - var root = __webpack_require__(37); + var root = __webpack_require__(32); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; @@ -2477,51 +2335,40 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 37 */ +/* 32 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(global) {var checkGlobal = __webpack_require__(38); - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(typeof global == 'object' && global); + var freeGlobal = __webpack_require__(33); /** Detect free variable `self`. */ - var freeSelf = checkGlobal(typeof self == 'object' && self); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(typeof this == 'object' && this); + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); + var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 38 */ +/* 33 */ /***/ function(module, exports) { - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } + /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - module.exports = checkGlobal; + module.exports = freeGlobal; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 39 */ +/* 34 */ /***/ function(module, exports) { + /** Used for built-in method references. */ + var funcProto = Function.prototype; + /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; + var funcToString = funcProto.toString; /** * Converts `func` to its source code. @@ -2546,7 +2393,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 40 */ +/* 35 */ /***/ function(module, exports) { /** @@ -2565,50 +2412,188 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 41 */ -/***/ function(module, exports) { +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + var mapCacheClear = __webpack_require__(37), + mapCacheDelete = __webpack_require__(45), + mapCacheGet = __webpack_require__(48), + mapCacheHas = __webpack_require__(49), + mapCacheSet = __webpack_require__(50); /** - * Removes `key` and its value from the hash. + * Creates a map cache object to store key-value pairs. * * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; + function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - module.exports = hashDelete; + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + module.exports = MapCache; /***/ }, -/* 42 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { - var nativeCreate = __webpack_require__(29); - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var Hash = __webpack_require__(38), + ListCache = __webpack_require__(12), + Map = __webpack_require__(25); /** - * Gets the hash value for `key`. + * Removes all key-value entries from the map. * * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + module.exports = mapCacheClear; + + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var hashClear = __webpack_require__(39), + hashDelete = __webpack_require__(41), + hashGet = __webpack_require__(42), + hashHas = __webpack_require__(43), + hashSet = __webpack_require__(44); + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + module.exports = Hash; + + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(40); + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + module.exports = hashClear; + + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(26); + + /* Built-in method references that are verified to be native. */ + var nativeCreate = getNative(Object, 'create'); + + module.exports = nativeCreate; + + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + module.exports = hashDelete; + + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + var nativeCreate = __webpack_require__(40); + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { @@ -2625,7 +2610,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 43 */ /***/ function(module, exports, __webpack_require__) { - var nativeCreate = __webpack_require__(29); + var nativeCreate = __webpack_require__(40); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -2654,7 +2639,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 44 */ /***/ function(module, exports, __webpack_require__) { - var nativeCreate = __webpack_require__(29); + var nativeCreate = __webpack_require__(40); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -2671,6 +2656,7 @@ return /******/ (function(modules) { // webpackBootstrap */ function hashSet(key, value) { var data = this.__data__; + this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } @@ -2682,20 +2668,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 45 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(30), - root = __webpack_require__(37); - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'); - - module.exports = Map; - - -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { - - var getMapData = __webpack_require__(47); + var getMapData = __webpack_require__(46); /** * Removes `key` and its value from the map. @@ -2707,17 +2680,19 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } module.exports = mapCacheDelete; /***/ }, -/* 47 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { - var isKeyable = __webpack_require__(48); + var isKeyable = __webpack_require__(47); /** * Gets the data for `map`. @@ -2738,7 +2713,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 48 */ +/* 47 */ /***/ function(module, exports) { /** @@ -2759,10 +2734,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { - var getMapData = __webpack_require__(47); + var getMapData = __webpack_require__(46); /** * Gets the map value for `key`. @@ -2781,10 +2756,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { - var getMapData = __webpack_require__(47); + var getMapData = __webpack_require__(46); /** * Checks if a map value for `key` exists. @@ -2803,10 +2778,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { - var getMapData = __webpack_require__(47); + var getMapData = __webpack_require__(46); /** * Sets the map `key` to `value`. @@ -2819,7 +2794,11 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } @@ -2827,12 +2806,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 52 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { - var baseIsEqualDeep = __webpack_require__(53), - isObject = __webpack_require__(33), - isObjectLike = __webpack_require__(77); + var baseIsEqualDeep = __webpack_require__(52), + isObject = __webpack_require__(29), + isObjectLike = __webpack_require__(70); /** * The base implementation of `_.isEqual` which supports partial comparisons @@ -2863,17 +2842,17 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 53 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { var Stack = __webpack_require__(11), - equalArrays = __webpack_require__(54), + equalArrays = __webpack_require__(53), equalByTag = __webpack_require__(59), equalObjects = __webpack_require__(64), - getTag = __webpack_require__(82), - isArray = __webpack_require__(78), - isHostObject = __webpack_require__(34), - isTypedArray = __webpack_require__(87); + getTag = __webpack_require__(86), + isArray = __webpack_require__(71), + isBuffer = __webpack_require__(72), + isTypedArray = __webpack_require__(76); /** Used to compose bitmasks for comparison styles. */ var PARTIAL_COMPARE_FLAG = 2; @@ -2918,10 +2897,17 @@ return /******/ (function(modules) { // webpackBootstrap othTag = getTag(other); othTag = othTag == argsTag ? objectTag : othTag; } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) @@ -2951,11 +2937,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 54 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { - var SetCache = __webpack_require__(55), - arraySome = __webpack_require__(58); + var SetCache = __webpack_require__(54), + arraySome = __webpack_require__(57), + cacheHas = __webpack_require__(58); /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, @@ -2985,7 +2972,7 @@ return /******/ (function(modules) { // webpackBootstrap } // Assume cyclic values are equal. var stacked = stack.get(array); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var index = -1, @@ -2993,6 +2980,7 @@ return /******/ (function(modules) { // webpackBootstrap seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; stack.set(array, other); + stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { @@ -3014,9 +3002,9 @@ return /******/ (function(modules) { // webpackBootstrap // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { - if (!seen.has(othIndex) && + if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - return seen.add(othIndex); + return seen.push(othIndex); } })) { result = false; @@ -3031,6 +3019,7 @@ return /******/ (function(modules) { // webpackBootstrap } } stack['delete'](array); + stack['delete'](other); return result; } @@ -3038,12 +3027,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 55 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { - var MapCache = __webpack_require__(25), - setCacheAdd = __webpack_require__(56), - setCacheHas = __webpack_require__(57); + var MapCache = __webpack_require__(36), + setCacheAdd = __webpack_require__(55), + setCacheHas = __webpack_require__(56); /** * @@ -3071,7 +3060,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 56 */ +/* 55 */ /***/ function(module, exports) { /** Used to stand-in for `undefined` hash values. */ @@ -3096,7 +3085,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 57 */ +/* 56 */ /***/ function(module, exports) { /** @@ -3116,7 +3105,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 58 */ +/* 57 */ /***/ function(module, exports) { /** @@ -3144,13 +3133,33 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = arraySome; +/***/ }, +/* 58 */ +/***/ function(module, exports) { + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + module.exports = cacheHas; + + /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(60), Uint8Array = __webpack_require__(61), - equalArrays = __webpack_require__(54), + eq = __webpack_require__(16), + equalArrays = __webpack_require__(53), mapToArray = __webpack_require__(62), setToArray = __webpack_require__(63); @@ -3213,22 +3222,18 @@ return /******/ (function(modules) { // webpackBootstrap case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and - // booleans to `1` or `0` treating invalid dates coerced to `NaN` as - // not equal. - return +object == +other; + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); @@ -3248,10 +3253,12 @@ return /******/ (function(modules) { // webpackBootstrap return stacked == other; } bitmask |= UNORDERED_COMPARE_FLAG; - stack.set(object, other); // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; case symbolTag: if (symbolValueOf) { @@ -3268,7 +3275,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 60 */ /***/ function(module, exports, __webpack_require__) { - var root = __webpack_require__(37); + var root = __webpack_require__(32); /** Built-in value references. */ var Symbol = root.Symbol; @@ -3280,7 +3287,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 61 */ /***/ function(module, exports, __webpack_require__) { - var root = __webpack_require__(37); + var root = __webpack_require__(32); /** Built-in value references. */ var Uint8Array = root.Uint8Array; @@ -3340,12 +3347,17 @@ return /******/ (function(modules) { // webpackBootstrap /* 64 */ /***/ function(module, exports, __webpack_require__) { - var baseHas = __webpack_require__(65), - keys = __webpack_require__(67); + var keys = __webpack_require__(65); /** Used to compose bitmasks for comparison styles. */ var PARTIAL_COMPARE_FLAG = 2; + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. @@ -3373,17 +3385,18 @@ return /******/ (function(modules) { // webpackBootstrap var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); + stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { @@ -3419,6 +3432,7 @@ return /******/ (function(modules) { // webpackBootstrap } } stack['delete'](object); + stack['delete'](other); return result; } @@ -3429,71 +3443,15 @@ return /******/ (function(modules) { // webpackBootstrap /* 65 */ /***/ function(module, exports, __webpack_require__) { - var getPrototype = __webpack_require__(66); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return object != null && - (hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null)); - } - - module.exports = baseHas; - - -/***/ }, -/* 66 */ -/***/ function(module, exports) { - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetPrototype = Object.getPrototypeOf; - - /** - * Gets the `[[Prototype]]` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {null|Object} Returns the `[[Prototype]]`. - */ - function getPrototype(value) { - return nativeGetPrototype(Object(value)); - } - - module.exports = getPrototype; - - -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { - - var baseHas = __webpack_require__(65), - baseKeys = __webpack_require__(68), - indexKeys = __webpack_require__(69), - isArrayLike = __webpack_require__(73), - isIndex = __webpack_require__(80), - isPrototype = __webpack_require__(81); + var arrayLikeKeys = __webpack_require__(66), + baseKeys = __webpack_require__(81), + isArrayLike = __webpack_require__(85); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static @@ -3518,82 +3476,69 @@ return /******/ (function(modules) { // webpackBootstrap * // => ['0', '1'] */ function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } module.exports = keys; /***/ }, -/* 68 */ -/***/ function(module, exports) { +/* 66 */ +/***/ function(module, exports, __webpack_require__) { - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = Object.keys; + var baseTimes = __webpack_require__(67), + isArguments = __webpack_require__(68), + isArray = __webpack_require__(71), + isBuffer = __webpack_require__(72), + isIndex = __webpack_require__(75), + isTypedArray = __webpack_require__(76); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @param {Object} object The object to query. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; - module.exports = baseKeys; - - -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { - - var baseTimes = __webpack_require__(70), - isArguments = __webpack_require__(71), - isArray = __webpack_require__(78), - isLength = __webpack_require__(76), - isString = __webpack_require__(79); - - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } } - return null; + return result; } - module.exports = indexKeys; + module.exports = arrayLikeKeys; /***/ }, -/* 70 */ +/* 67 */ /***/ function(module, exports) { /** @@ -3619,13 +3564,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 71 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { - var isArrayLikeObject = __webpack_require__(72); - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]'; + var baseIsArguments = __webpack_require__(69), + isObjectLike = __webpack_require__(70); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -3633,13 +3576,6 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; @@ -3651,7 +3587,7 @@ return /******/ (function(modules) { // webpackBootstrap * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -3661,323 +3597,463 @@ return /******/ (function(modules) { // webpackBootstrap * _.isArguments([1, 2, 3]); * // => false */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; module.exports = isArguments; /***/ }, -/* 72 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { - var isArrayLike = __webpack_require__(73), - isObjectLike = __webpack_require__(77); + var isObjectLike = __webpack_require__(70); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && objectToString.call(value) == argsTag; + } + + module.exports = baseIsArguments; + + +/***/ }, +/* 70 */ +/***/ function(module, exports) { + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * - * _.isArrayLikeObject([1, 2, 3]); + * _.isObjectLike({}); * // => true * - * _.isArrayLikeObject(document.body.children); + * _.isObjectLike([1, 2, 3]); * // => true * - * _.isArrayLikeObject('abc'); + * _.isObjectLike(_.noop); * // => false * - * _.isArrayLikeObject(_.noop); + * _.isObjectLike(null); * // => false */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function isObjectLike(value) { + return value != null && typeof value == 'object'; } - module.exports = isArrayLikeObject; + module.exports = isObjectLike; /***/ }, -/* 73 */ -/***/ function(module, exports, __webpack_require__) { - - var getLength = __webpack_require__(74), - isFunction = __webpack_require__(32), - isLength = __webpack_require__(76); +/* 71 */ +/***/ function(module, exports) { /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * - * _.isArrayLike([1, 2, 3]); + * _.isArray([1, 2, 3]); * // => true * - * _.isArrayLike(document.body.children); - * // => true + * _.isArray(document.body.children); + * // => false * - * _.isArrayLike('abc'); - * // => true + * _.isArray('abc'); + * // => false * - * _.isArrayLike(_.noop); + * _.isArray(_.noop); * // => false */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } + var isArray = Array.isArray; - module.exports = isArrayLike; + module.exports = isArray; /***/ }, -/* 74 */ +/* 72 */ /***/ function(module, exports, __webpack_require__) { - var baseProperty = __webpack_require__(75); + /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(32), + stubFalse = __webpack_require__(74); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** - * Gets the "length" property value of `object`. + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. + * _.isBuffer(new Buffer(2)); + * // => true * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * _.isBuffer(new Uint8Array(2)); + * // => false */ - var getLength = baseProperty('length'); + var isBuffer = nativeIsBuffer || stubFalse; - module.exports = getLength; + module.exports = isBuffer; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)(module))) /***/ }, -/* 75 */ +/* 73 */ /***/ function(module, exports) { - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; } - module.exports = baseProperty; - /***/ }, -/* 76 */ +/* 74 */ /***/ function(module, exports) { - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * This method returns `false`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. * @example * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false + * _.times(2, _.stubFalse); + * // => [false, false] */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + function stubFalse() { + return false; } - module.exports = isLength; + module.exports = stubFalse; /***/ }, -/* 77 */ +/* 75 */ /***/ function(module, exports) { + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Checks if `value` is a valid array-like index. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang + * @private * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false + * @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 isObjectLike(value) { - return !!value && typeof value == 'object'; + 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); } - module.exports = isObjectLike; + module.exports = isIndex; /***/ }, -/* 78 */ -/***/ function(module, exports) { +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsTypedArray = __webpack_require__(77), + baseUnary = __webpack_require__(79), + nodeUtil = __webpack_require__(80); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** - * Checks if `value` is classified as an `Array` object. + * Checks if `value` is classified as a typed array. * * @static * @memberOf _ - * @since 0.1.0 - * @type {Function} + * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * - * _.isArray([1, 2, 3]); + * _.isTypedArray(new Uint8Array); * // => true * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); + * _.isTypedArray([]); * // => false */ - var isArray = Array.isArray; + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - module.exports = isArray; + module.exports = isTypedArray; /***/ }, -/* 79 */ +/* 77 */ /***/ function(module, exports, __webpack_require__) { - var isArray = __webpack_require__(78), - isObjectLike = __webpack_require__(77); + var isLength = __webpack_require__(78), + isObjectLike = __webpack_require__(70); /** `Object#toString` result references. */ - var stringTag = '[object String]'; + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** - * Checks if `value` is classified as a `String` primitive or object. + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + + module.exports = baseIsTypedArray; + + +/***/ }, +/* 78 */ +/***/ function(module, exports) { + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static - * @since 0.1.0 * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * - * _.isString('abc'); + * _.isLength(3); * // => true * - * _.isString(1); + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); * // => false */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } - module.exports = isString; + module.exports = isLength; /***/ }, -/* 80 */ +/* 79 */ /***/ function(module, exports) { - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + module.exports = baseUnary; + + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(33); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} + }()); + + module.exports = nodeUtil; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)(module))) + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + var isPrototype = __webpack_require__(82), + nativeKeys = __webpack_require__(83); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `value` is a valid array-like index. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @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`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ - 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); + 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; } - module.exports = isIndex; + module.exports = baseKeys; /***/ }, -/* 81 */ +/* 82 */ /***/ function(module, exports) { /** Used for built-in method references. */ @@ -4001,15 +4077,88 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 82 */ +/* 83 */ /***/ function(module, exports, __webpack_require__) { - var DataView = __webpack_require__(83), - Map = __webpack_require__(45), - Promise = __webpack_require__(84), - Set = __webpack_require__(85), - WeakMap = __webpack_require__(86), - toSource = __webpack_require__(39); + var overArg = __webpack_require__(84); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + module.exports = nativeKeys; + + +/***/ }, +/* 84 */ +/***/ function(module, exports) { + + /** + * 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)); + }; + } + + module.exports = overArg; + + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + var isFunction = __webpack_require__(28), + isLength = __webpack_require__(78); + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + module.exports = isArrayLike; + + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + var DataView = __webpack_require__(87), + Map = __webpack_require__(25), + Promise = __webpack_require__(88), + Set = __webpack_require__(89), + WeakMap = __webpack_require__(90), + baseGetTag = __webpack_require__(91), + toSource = __webpack_require__(34); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -4025,7 +4174,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -4044,12 +4193,9 @@ return /******/ (function(modules) { // webpackBootstrap * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ - function getTag(value) { - return objectToString.call(value); - } + var getTag = baseGetTag; - // Fallback for data views, maps, sets, and weak maps in IE 11, - // for data views in Edge, and promises in Node.js. + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || @@ -4077,11 +4223,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 83 */ +/* 87 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(30), - root = __webpack_require__(37); + var getNative = __webpack_require__(26), + root = __webpack_require__(32); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); @@ -4090,11 +4236,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 84 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(30), - root = __webpack_require__(37); + var getNative = __webpack_require__(26), + root = __webpack_require__(32); /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); @@ -4103,11 +4249,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 85 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(30), - root = __webpack_require__(37); + var getNative = __webpack_require__(26), + root = __webpack_require__(32); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); @@ -4116,11 +4262,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 86 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { - var getNative = __webpack_require__(30), - root = __webpack_require__(37); + var getNative = __webpack_require__(26), + root = __webpack_require__(32); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); @@ -4129,97 +4275,39 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 87 */ -/***/ function(module, exports, __webpack_require__) { - - var isLength = __webpack_require__(76), - isObjectLike = __webpack_require__(77); - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; +/* 91 */ +/***/ function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true + * The base implementation of `getTag`. * - * _.isTypedArray([]); - * // => false + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + function baseGetTag(value) { + return objectToString.call(value); } - module.exports = isTypedArray; + module.exports = baseGetTag; /***/ }, -/* 88 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { - var isStrictComparable = __webpack_require__(89), - keys = __webpack_require__(67); + var isStrictComparable = __webpack_require__(93), + keys = __webpack_require__(65); /** * Gets the property names, values, and compare flags of `object`. @@ -4245,10 +4333,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 89 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { - var isObject = __webpack_require__(33); + var isObject = __webpack_require__(29); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. @@ -4266,7 +4354,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 90 */ +/* 94 */ /***/ function(module, exports) { /** @@ -4292,16 +4380,16 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 91 */ +/* 95 */ /***/ function(module, exports, __webpack_require__) { - var baseIsEqual = __webpack_require__(52), - get = __webpack_require__(92), - hasIn = __webpack_require__(102), - isKey = __webpack_require__(100), - isStrictComparable = __webpack_require__(89), - matchesStrictComparable = __webpack_require__(90), - toKey = __webpack_require__(101); + var baseIsEqual = __webpack_require__(51), + get = __webpack_require__(96), + hasIn = __webpack_require__(107), + isKey = __webpack_require__(105), + isStrictComparable = __webpack_require__(93), + matchesStrictComparable = __webpack_require__(94), + toKey = __webpack_require__(106); /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, @@ -4331,14 +4419,14 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 92 */ +/* 96 */ /***/ function(module, exports, __webpack_require__) { - var baseGet = __webpack_require__(93); + var baseGet = __webpack_require__(97); /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ @@ -4370,12 +4458,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 93 */ +/* 97 */ /***/ function(module, exports, __webpack_require__) { - var castPath = __webpack_require__(94), - isKey = __webpack_require__(100), - toKey = __webpack_require__(101); + var castPath = __webpack_require__(98), + isKey = __webpack_require__(105), + toKey = __webpack_require__(106); /** * The base implementation of `_.get` without support for default values. @@ -4401,11 +4489,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 94 */ +/* 98 */ /***/ function(module, exports, __webpack_require__) { - var isArray = __webpack_require__(78), - stringToPath = __webpack_require__(95); + var isArray = __webpack_require__(71), + stringToPath = __webpack_require__(99); /** * Casts `value` to a path array if it's not one. @@ -4422,14 +4510,15 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 95 */ +/* 99 */ /***/ function(module, exports, __webpack_require__) { - var memoize = __webpack_require__(96), - toString = __webpack_require__(97); + var memoizeCapped = __webpack_require__(100), + toString = __webpack_require__(102); /** Used to match property names within property paths. */ - var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g; + var reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; @@ -4441,9 +4530,14 @@ return /******/ (function(modules) { // webpackBootstrap * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - var stringToPath = memoize(function(string) { + var stringToPath = memoizeCapped(function(string) { + string = toString(string); + var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; @@ -4453,12 +4547,44 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 96 */ +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var memoize = __webpack_require__(101); + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + module.exports = memoizeCapped; + + +/***/ }, +/* 101 */ /***/ function(module, exports, __webpack_require__) { - var MapCache = __webpack_require__(25); + var MapCache = __webpack_require__(36); - /** Used as the `TypeError` message for "Functions" methods. */ + /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** @@ -4471,7 +4597,7 @@ return /******/ (function(modules) { // webpackBootstrap * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static @@ -4518,24 +4644,24 @@ return /******/ (function(modules) { // webpackBootstrap return cache.get(key); } var result = func.apply(this, args); - memoized.cache = cache.set(key, result); + memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } - // Assign cache to `_.memoize`. + // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; /***/ }, -/* 97 */ +/* 102 */ /***/ function(module, exports, __webpack_require__) { - var baseToString = __webpack_require__(98); + var baseToString = __webpack_require__(103); /** * Converts `value` to a string. An empty string is returned for `null` @@ -4545,8 +4671,8 @@ return /******/ (function(modules) { // webpackBootstrap * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); @@ -4566,11 +4692,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 98 */ +/* 103 */ /***/ function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(60), - isSymbol = __webpack_require__(99); + arrayMap = __webpack_require__(7), + isArray = __webpack_require__(71), + isSymbol = __webpack_require__(104); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; @@ -4592,6 +4720,10 @@ return /******/ (function(modules) { // webpackBootstrap if (typeof value == 'string') { return value; } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } @@ -4603,10 +4735,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 99 */ +/* 104 */ /***/ function(module, exports, __webpack_require__) { - var isObjectLike = __webpack_require__(77); + var isObjectLike = __webpack_require__(70); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; @@ -4616,7 +4748,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -4629,8 +4761,7 @@ return /******/ (function(modules) { // webpackBootstrap * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); @@ -4648,11 +4779,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 100 */ +/* 105 */ /***/ function(module, exports, __webpack_require__) { - var isArray = __webpack_require__(78), - isSymbol = __webpack_require__(99); + var isArray = __webpack_require__(71), + isSymbol = __webpack_require__(104); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, @@ -4683,10 +4814,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 101 */ +/* 106 */ /***/ function(module, exports, __webpack_require__) { - var isSymbol = __webpack_require__(99); + var isSymbol = __webpack_require__(104); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; @@ -4710,11 +4841,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 102 */ +/* 107 */ /***/ function(module, exports, __webpack_require__) { - var baseHasIn = __webpack_require__(103), - hasPath = __webpack_require__(104); + var baseHasIn = __webpack_require__(108), + hasPath = __webpack_require__(109); /** * Checks if `path` is a direct or inherited property of `object`. @@ -4750,7 +4881,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 103 */ +/* 108 */ /***/ function(module, exports) { /** @@ -4769,17 +4900,16 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 104 */ +/* 109 */ /***/ function(module, exports, __webpack_require__) { - var castPath = __webpack_require__(94), - isArguments = __webpack_require__(71), - isArray = __webpack_require__(78), - isIndex = __webpack_require__(80), - isKey = __webpack_require__(100), - isLength = __webpack_require__(76), - isString = __webpack_require__(79), - toKey = __webpack_require__(101); + var castPath = __webpack_require__(98), + isArguments = __webpack_require__(68), + isArray = __webpack_require__(71), + isIndex = __webpack_require__(75), + isKey = __webpack_require__(105), + isLength = __webpack_require__(78), + toKey = __webpack_require__(106); /** * Checks if `path` exists on `object`. @@ -4793,9 +4923,9 @@ return /******/ (function(modules) { // webpackBootstrap function hasPath(object, path, hasFunc) { path = isKey(path, object) ? [path] : castPath(path); - var result, - index = -1, - length = path.length; + var index = -1, + length = path.length, + result = false; while (++index < length) { var key = toKey(path[index]); @@ -4804,23 +4934,23 @@ return /******/ (function(modules) { // webpackBootstrap } object = object[key]; } - if (result) { + if (result || ++index != length) { return result; } - var length = object ? object.length : 0; + length = object ? object.length : 0; return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isString(object) || isArguments(object)); + (isArray(object) || isArguments(object)); } module.exports = hasPath; /***/ }, -/* 105 */ +/* 110 */ /***/ function(module, exports) { /** - * This method returns the first argument given to it. + * This method returns the first argument it receives. * * @static * @since 0.1.0 @@ -4830,7 +4960,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {*} Returns `value`. * @example * - * var object = { 'user': 'fred' }; + * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true @@ -4843,13 +4973,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 106 */ +/* 111 */ /***/ function(module, exports, __webpack_require__) { - var baseProperty = __webpack_require__(75), - basePropertyDeep = __webpack_require__(107), - isKey = __webpack_require__(100), - toKey = __webpack_require__(101); + var baseProperty = __webpack_require__(112), + basePropertyDeep = __webpack_require__(113), + isKey = __webpack_require__(105), + toKey = __webpack_require__(106); /** * Creates a function that returns the value at `path` of a given object. @@ -4881,10 +5011,30 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 107 */ +/* 112 */ +/***/ function(module, exports) { + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + module.exports = baseProperty; + + +/***/ }, +/* 113 */ /***/ function(module, exports, __webpack_require__) { - var baseGet = __webpack_require__(93); + var baseGet = __webpack_require__(97); /** * A specialized version of `baseProperty` which supports deep paths. @@ -4903,11 +5053,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 108 */ +/* 114 */ /***/ function(module, exports, __webpack_require__) { - var baseEach = __webpack_require__(109), - isArrayLike = __webpack_require__(73); + var baseEach = __webpack_require__(115), + isArrayLike = __webpack_require__(85); /** * The base implementation of `_.map` without support for iteratee shorthands. @@ -4931,11 +5081,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 109 */ +/* 115 */ /***/ function(module, exports, __webpack_require__) { - var baseForOwn = __webpack_require__(110), - createBaseEach = __webpack_require__(113); + var baseForOwn = __webpack_require__(116), + createBaseEach = __webpack_require__(119); /** * The base implementation of `_.forEach` without support for iteratee shorthands. @@ -4951,11 +5101,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 110 */ +/* 116 */ /***/ function(module, exports, __webpack_require__) { - var baseFor = __webpack_require__(111), - keys = __webpack_require__(67); + var baseFor = __webpack_require__(117), + keys = __webpack_require__(65); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. @@ -4973,10 +5123,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 111 */ +/* 117 */ /***/ function(module, exports, __webpack_require__) { - var createBaseFor = __webpack_require__(112); + var createBaseFor = __webpack_require__(118); /** * The base implementation of `baseForOwn` which iterates over `object` @@ -4995,7 +5145,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 112 */ +/* 118 */ /***/ function(module, exports) { /** @@ -5026,10 +5176,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 113 */ +/* 119 */ /***/ function(module, exports, __webpack_require__) { - var isArrayLike = __webpack_require__(73); + var isArrayLike = __webpack_require__(85); /** * Creates a `baseEach` or `baseEachRight` function. @@ -5064,25 +5214,27 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 114 */ +/* 120 */ /***/ function(module, exports, __webpack_require__) { - var arrayFilter = __webpack_require__(115), - baseFilter = __webpack_require__(116), + var arrayFilter = __webpack_require__(121), + baseFilter = __webpack_require__(122), baseIteratee = __webpack_require__(8), - isArray = __webpack_require__(78); + isArray = __webpack_require__(71); /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * + * **Note:** Unlike `_.remove`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject @@ -5117,7 +5269,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 115 */ +/* 121 */ /***/ function(module, exports) { /** @@ -5148,10 +5300,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 116 */ +/* 122 */ /***/ function(module, exports, __webpack_require__) { - var baseEach = __webpack_require__(109); + var baseEach = __webpack_require__(115); /** * The base implementation of `_.filter` without support for iteratee shorthands. @@ -5175,11 +5327,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 117 */ +/* 123 */ /***/ function(module, exports, __webpack_require__) { - var createFind = __webpack_require__(118), - findIndex = __webpack_require__(119); + var createFind = __webpack_require__(124), + findIndex = __webpack_require__(125); /** * Iterates over elements of `collection`, returning the first element @@ -5190,8 +5342,8 @@ return /******/ (function(modules) { // webpackBootstrap * @memberOf _ * @since 0.1.0 * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. @@ -5224,12 +5376,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 118 */ +/* 124 */ /***/ function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(8), - isArrayLike = __webpack_require__(73), - keys = __webpack_require__(67); + isArrayLike = __webpack_require__(85), + keys = __webpack_require__(65); /** * Creates a `_.find` or `_.findLast` function. @@ -5241,18 +5393,13 @@ return /******/ (function(modules) { // webpackBootstrap function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); - predicate = baseIteratee(predicate, 3); if (!isArrayLike(collection)) { - var props = keys(collection); + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } - var index = findIndexFunc(props || collection, function(value, key) { - if (props) { - key = value; - value = iterable[key]; - } - return predicate(value, key, iterable); - }, fromIndex); - return index > -1 ? collection[props ? props[index] : index] : undefined; + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } @@ -5260,12 +5407,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 119 */ +/* 125 */ /***/ function(module, exports, __webpack_require__) { - var baseFindIndex = __webpack_require__(120), + var baseFindIndex = __webpack_require__(126), baseIteratee = __webpack_require__(8), - toInteger = __webpack_require__(121); + toInteger = __webpack_require__(127); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -5278,8 +5425,8 @@ return /******/ (function(modules) { // webpackBootstrap * @memberOf _ * @since 1.1.0 * @category Array - * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -5322,7 +5469,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 120 */ +/* 126 */ /***/ function(module, exports) { /** @@ -5330,7 +5477,7 @@ return /******/ (function(modules) { // webpackBootstrap * support for iteratee shorthands. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. @@ -5352,16 +5499,16 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 121 */ +/* 127 */ /***/ function(module, exports, __webpack_require__) { - var toFinite = __webpack_require__(122); + var toFinite = __webpack_require__(128); /** * Converts `value` to an integer. * * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ @@ -5394,10 +5541,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 122 */ +/* 128 */ /***/ function(module, exports, __webpack_require__) { - var toNumber = __webpack_require__(123); + var toNumber = __webpack_require__(129); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, @@ -5442,12 +5589,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 123 */ +/* 129 */ /***/ function(module, exports, __webpack_require__) { - var isFunction = __webpack_require__(32), - isObject = __webpack_require__(33), - isSymbol = __webpack_require__(99); + var isObject = __webpack_require__(29), + isSymbol = __webpack_require__(104); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; @@ -5498,7 +5644,7 @@ return /******/ (function(modules) { // webpackBootstrap return NAN; } if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { @@ -5515,15 +5661,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 124 */ +/* 130 */ /***/ function(module, exports, __webpack_require__) { - var baseFlatten = __webpack_require__(125), - baseOrderBy = __webpack_require__(128), - isArray = __webpack_require__(78), - isFlattenableIteratee = __webpack_require__(133), - isIterateeCall = __webpack_require__(134), - rest = __webpack_require__(135); + var baseFlatten = __webpack_require__(131), + baseOrderBy = __webpack_require__(134), + baseRest = __webpack_require__(138), + isIterateeCall = __webpack_require__(146); /** * Creates an array of elements, sorted in ascending order by the results of @@ -5536,8 +5680,8 @@ return /******/ (function(modules) { // webpackBootstrap * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to sort by. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * @@ -5548,18 +5692,13 @@ return /******/ (function(modules) { // webpackBootstrap * { 'user': 'barney', 'age': 34 } * ]; * - * _.sortBy(users, function(o) { return o.user; }); + * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - var sortBy = rest(function(collection, iteratees) { + var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } @@ -5569,22 +5708,18 @@ return /******/ (function(modules) { // webpackBootstrap } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } - iteratees = (iteratees.length == 1 && isArray(iteratees[0])) - ? iteratees[0] - : baseFlatten(iteratees, 1, isFlattenableIteratee); - - return baseOrderBy(collection, iteratees, []); + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); module.exports = sortBy; /***/ }, -/* 125 */ +/* 131 */ /***/ function(module, exports, __webpack_require__) { - var arrayPush = __webpack_require__(126), - isFlattenable = __webpack_require__(127); + var arrayPush = __webpack_require__(132), + isFlattenable = __webpack_require__(133); /** * The base implementation of `_.flatten` with support for restricting flattening. @@ -5624,7 +5759,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 126 */ +/* 132 */ /***/ function(module, exports) { /** @@ -5650,11 +5785,15 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 127 */ +/* 133 */ /***/ function(module, exports, __webpack_require__) { - var isArguments = __webpack_require__(71), - isArray = __webpack_require__(78); + var Symbol = __webpack_require__(60), + isArguments = __webpack_require__(68), + isArray = __webpack_require__(71); + + /** Built-in value references. */ + var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. @@ -5664,23 +5803,24 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArray(value) || isArguments(value); + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); } module.exports = isFlattenable; /***/ }, -/* 128 */ +/* 134 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(7), baseIteratee = __webpack_require__(8), - baseMap = __webpack_require__(108), - baseSortBy = __webpack_require__(129), - baseUnary = __webpack_require__(130), - compareMultiple = __webpack_require__(131), - identity = __webpack_require__(105); + baseMap = __webpack_require__(114), + baseSortBy = __webpack_require__(135), + baseUnary = __webpack_require__(79), + compareMultiple = __webpack_require__(136), + identity = __webpack_require__(110); /** * The base implementation of `_.orderBy` without param guards. @@ -5711,7 +5851,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 129 */ +/* 135 */ /***/ function(module, exports) { /** @@ -5738,30 +5878,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 130 */ -/***/ function(module, exports) { - - /** - * The base implementation of `_.unary` without support for storing wrapper metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - module.exports = baseUnary; - - -/***/ }, -/* 131 */ +/* 136 */ /***/ function(module, exports, __webpack_require__) { - var compareAscending = __webpack_require__(132); + var compareAscending = __webpack_require__(137); /** * Used by `_.orderBy` to compare multiple properties of a value to another @@ -5808,10 +5928,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 132 */ +/* 137 */ /***/ function(module, exports, __webpack_require__) { - var isSymbol = __webpack_require__(99); + var isSymbol = __webpack_require__(104); /** * Compares values to sort them in ascending order. @@ -5855,106 +5975,48 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 133 */ -/***/ function(module, exports, __webpack_require__) { - - var isArray = __webpack_require__(78), - isFunction = __webpack_require__(32); - - /** - * Checks if `value` is a flattenable array and not a `_.matchesProperty` - * iteratee shorthand. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenableIteratee(value) { - return isArray(value) && !(value.length == 2 && !isFunction(value[0])); - } - - module.exports = isFlattenableIteratee; - - -/***/ }, -/* 134 */ +/* 138 */ /***/ function(module, exports, __webpack_require__) { - var eq = __webpack_require__(16), - isArrayLike = __webpack_require__(73), - isIndex = __webpack_require__(80), - isObject = __webpack_require__(33); + var identity = __webpack_require__(110), + overRest = __webpack_require__(139), + setToString = __webpack_require__(141); /** - * Checks if the given arguments are from an iteratee call. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @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`. + * @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 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; + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); } - module.exports = isIterateeCall; + module.exports = baseRest; /***/ }, -/* 135 */ +/* 139 */ /***/ function(module, exports, __webpack_require__) { - var apply = __webpack_require__(136), - toInteger = __webpack_require__(121); - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; + var apply = __webpack_require__(140); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). + * A specialized version of `baseRest` which transforms the rest array. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function + * @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. + * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, @@ -5964,26 +6026,21 @@ return /******/ (function(modules) { // webpackBootstrap while (++index < length) { array[index] = args[start + index]; } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); index = -1; + var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } - otherArgs[start] = array; + otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } - module.exports = rest; + module.exports = overRest; /***/ }, -/* 136 */ +/* 140 */ /***/ function(module, exports) { /** @@ -5997,8 +6054,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { - var length = args.length; - switch (length) { + 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]); @@ -6011,19 +6067,197 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 137 */ +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + var baseSetToString = __webpack_require__(142), + shortOut = __webpack_require__(145); + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + module.exports = setToString; + + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + var constant = __webpack_require__(143), + defineProperty = __webpack_require__(144), + identity = __webpack_require__(110); + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + module.exports = baseSetToString; + + +/***/ }, +/* 143 */ +/***/ function(module, exports) { + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + module.exports = constant; + + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(26); + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + module.exports = defineProperty; + + +/***/ }, +/* 145 */ +/***/ function(module, exports) { + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 500, + HOT_SPAN = 16; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeNow = Date.now; + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + module.exports = shortOut; + + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + var eq = __webpack_require__(16), + isArrayLike = __webpack_require__(85), + isIndex = __webpack_require__(75), + isObject = __webpack_require__(29); + + /** + * 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; + } + + module.exports = isIterateeCall; + + +/***/ }, +/* 147 */ /***/ function(module, exports, __webpack_require__) { - var baseDifference = __webpack_require__(138), - baseFlatten = __webpack_require__(125), - isArrayLikeObject = __webpack_require__(72), - rest = __webpack_require__(135); + var baseDifference = __webpack_require__(148), + baseFlatten = __webpack_require__(131), + baseRest = __webpack_require__(138), + isArrayLikeObject = __webpack_require__(154); /** - * Creates an array of unique `array` values not included in the other given - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. The order of result values is determined by the - * order they occur in the first array. + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ @@ -6038,7 +6272,7 @@ return /******/ (function(modules) { // webpackBootstrap * _.difference([2, 1], [2, 3]); * // => [1] */ - var difference = rest(function(array, values) { + var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; @@ -6048,15 +6282,15 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 138 */ +/* 148 */ /***/ function(module, exports, __webpack_require__) { - var SetCache = __webpack_require__(55), - arrayIncludes = __webpack_require__(139), - arrayIncludesWith = __webpack_require__(142), + var SetCache = __webpack_require__(54), + arrayIncludes = __webpack_require__(149), + arrayIncludesWith = __webpack_require__(153), arrayMap = __webpack_require__(7), - baseUnary = __webpack_require__(130), - cacheHas = __webpack_require__(143); + baseUnary = __webpack_require__(79), + cacheHas = __webpack_require__(58); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -6121,17 +6355,17 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 139 */ +/* 149 */ /***/ function(module, exports, __webpack_require__) { - var baseIndexOf = __webpack_require__(140); + var baseIndexOf = __webpack_require__(150); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private - * @param {Array} [array] The array to search. + * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ @@ -6144,76 +6378,87 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 140 */ +/* 150 */ /***/ function(module, exports, __webpack_require__) { - var indexOfNaN = __webpack_require__(141); + var baseFindIndex = __webpack_require__(126), + baseIsNaN = __webpack_require__(151), + strictIndexOf = __webpack_require__(152); /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } module.exports = baseIndexOf; /***/ }, -/* 141 */ +/* 151 */ +/***/ function(module, exports) { + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + module.exports = baseIsNaN; + + +/***/ }, +/* 152 */ /***/ function(module, exports) { /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { + while (++index < length) { + if (array[index] === value) { return index; } } return -1; } - module.exports = indexOfNaN; + module.exports = strictIndexOf; /***/ }, -/* 142 */ +/* 153 */ /***/ function(module, exports) { /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private - * @param {Array} [array] The array to search. + * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. @@ -6234,34 +6479,54 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 143 */ -/***/ function(module, exports) { +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + var isArrayLike = __webpack_require__(85), + isObjectLike = __webpack_require__(70); /** - * Checks if a cache value for `key` exists. + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false */ - function cacheHas(cache, key) { - return cache.has(key); + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } - module.exports = cacheHas; + module.exports = isArrayLikeObject; /***/ }, -/* 144 */ +/* 155 */ /***/ function(module, exports, __webpack_require__) { - var assignValue = __webpack_require__(145), - copyObject = __webpack_require__(146), - createAssigner = __webpack_require__(147), - isArrayLike = __webpack_require__(73), - isPrototype = __webpack_require__(81), - keys = __webpack_require__(67); + var assignValue = __webpack_require__(156), + copyObject = __webpack_require__(158), + createAssigner = __webpack_require__(159), + isArrayLike = __webpack_require__(85), + isPrototype = __webpack_require__(82), + keys = __webpack_require__(65); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -6269,12 +6534,6 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ - var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); - /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. @@ -6294,21 +6553,21 @@ return /******/ (function(modules) { // webpackBootstrap * @example * * function Foo() { - * this.c = 3; + * this.a = 1; * } * * function Bar() { - * this.e = 5; + * this.c = 3; * } * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { - if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } @@ -6323,10 +6582,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 145 */ +/* 156 */ /***/ function(module, exports, __webpack_require__) { - var eq = __webpack_require__(16); + var baseAssignValue = __webpack_require__(157), + eq = __webpack_require__(16); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -6336,7 +6596,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private @@ -6348,7 +6608,7 @@ return /******/ (function(modules) { // webpackBootstrap var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { - object[key] = value; + baseAssignValue(object, key, value); } } @@ -6356,10 +6616,42 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 146 */ +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + var defineProperty = __webpack_require__(144); + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @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 baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + module.exports = baseAssignValue; + + +/***/ }, +/* 158 */ /***/ function(module, exports, __webpack_require__) { - var assignValue = __webpack_require__(145); + var assignValue = __webpack_require__(156), + baseAssignValue = __webpack_require__(157); /** * Copies properties of `source` to `object`. @@ -6372,6 +6664,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { + var isNew = !object; object || (object = {}); var index = -1, @@ -6382,9 +6675,16 @@ return /******/ (function(modules) { // webpackBootstrap var newValue = customizer ? customizer(object[key], source[key], key, object, source) - : source[key]; + : undefined; - assignValue(object, key, newValue); + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } } return object; } @@ -6393,11 +6693,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 147 */ +/* 159 */ /***/ function(module, exports, __webpack_require__) { - var isIterateeCall = __webpack_require__(134), - rest = __webpack_require__(135); + var baseRest = __webpack_require__(138), + isIterateeCall = __webpack_require__(146); /** * Creates a function like `_.assign`. @@ -6407,7 +6707,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return rest(function(object, sources) { + return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, @@ -6436,7 +6736,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 148 */ +/* 160 */ /***/ function(module, exports, __webpack_require__) { /* @@ -6446,7 +6746,7 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var ColumnProperties = __webpack_require__(5); - var pick = __webpack_require__(149); + var pick = __webpack_require__(161); var GridRowContainer = React.createClass({ displayName: 'GridRowContainer', @@ -6566,14 +6866,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GridRowContainer; /***/ }, -/* 149 */ +/* 161 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(7), - baseFlatten = __webpack_require__(125), - basePick = __webpack_require__(150), - rest = __webpack_require__(135), - toKey = __webpack_require__(101); + basePick = __webpack_require__(162), + flatRest = __webpack_require__(164), + toKey = __webpack_require__(106); /** * Creates an object composed of the picked `object` properties. @@ -6592,18 +6891,18 @@ return /******/ (function(modules) { // webpackBootstrap * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); + var pick = flatRest(function(object, props) { + return object == null ? {} : basePick(object, arrayMap(props, toKey)); }); module.exports = pick; /***/ }, -/* 150 */ +/* 162 */ /***/ function(module, exports, __webpack_require__) { - var arrayReduce = __webpack_require__(151); + var basePickBy = __webpack_require__(163); /** * The base implementation of `_.pick` without support for individual @@ -6616,51 +6915,100 @@ return /******/ (function(modules) { // webpackBootstrap */ function basePick(object, props) { object = Object(object); - return arrayReduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); + return basePickBy(object, props, function(value, key) { + return key in object; + }); } module.exports = basePick; /***/ }, -/* 151 */ -/***/ function(module, exports) { +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + var baseAssignValue = __webpack_require__(157); /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. + * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick from. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. */ - function arrayReduce(array, iteratee, accumulator, initAccum) { + function basePickBy(object, props, predicate) { var index = -1, - length = array ? array.length : 0; + length = props.length, + result = {}; - if (initAccum && length) { - accumulator = array[++index]; - } while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); + var key = props[index], + value = object[key]; + + if (predicate(value, key)) { + baseAssignValue(result, key, value); + } } - return accumulator; + return result; } - module.exports = arrayReduce; + module.exports = basePickBy; /***/ }, -/* 152 */ +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + var flatten = __webpack_require__(165), + overRest = __webpack_require__(139), + setToString = __webpack_require__(141); + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + module.exports = flatRest; + + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(131); + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, 1) : []; + } + + module.exports = flatten; + + +/***/ }, +/* 166 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -6669,7 +7017,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _uniqueId = __webpack_require__(153); + var _uniqueId = __webpack_require__(167); var RowProperties = (function () { function RowProperties() { @@ -6736,10 +7084,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 153 */ +/* 167 */ /***/ function(module, exports, __webpack_require__) { - var toString = __webpack_require__(97); + var toString = __webpack_require__(102); /** Used to generate unique IDs. */ var idCounter = 0; @@ -6770,7 +7118,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 154 */ +/* 168 */ /***/ function(module, exports, __webpack_require__) { /* @@ -6799,7 +7147,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GridFilter; /***/ }, -/* 155 */ +/* 169 */ /***/ function(module, exports, __webpack_require__) { /* @@ -6808,7 +7156,7 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var React = __webpack_require__(2); - var assign = __webpack_require__(144); + var assign = __webpack_require__(155); //needs props maxPage, currentPage, nextFunction, prevFunction var GridPagination = React.createClass({ @@ -6871,7 +7219,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GridPagination; /***/ }, -/* 156 */ +/* 170 */ /***/ function(module, exports, __webpack_require__) { /* @@ -6880,9 +7228,9 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; var React = __webpack_require__(2); - var includes = __webpack_require__(157); - var without = __webpack_require__(160); - var find = __webpack_require__(117); + var includes = __webpack_require__(171); + var without = __webpack_require__(175); + var find = __webpack_require__(123); var GridSettings = React.createClass({ displayName: 'GridSettings', @@ -6951,14 +7299,14 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GridSettings; /***/ }, -/* 157 */ +/* 171 */ /***/ function(module, exports, __webpack_require__) { - var baseIndexOf = __webpack_require__(140), - isArrayLike = __webpack_require__(73), - isString = __webpack_require__(79), - toInteger = __webpack_require__(121), - values = __webpack_require__(158); + var baseIndexOf = __webpack_require__(150), + isArrayLike = __webpack_require__(85), + isString = __webpack_require__(172), + toInteger = __webpack_require__(127), + values = __webpack_require__(173); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -6966,7 +7314,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * @@ -6974,7 +7322,7 @@ return /******/ (function(modules) { // webpackBootstrap * @memberOf _ * @since 0.1.0 * @category Collection - * @param {Array|Object|string} collection The collection to search. + * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. @@ -6987,10 +7335,10 @@ return /******/ (function(modules) { // webpackBootstrap * _.includes([1, 2, 3], 1, 2); * // => false * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * - * _.includes('pebbles', 'eb'); + * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { @@ -7010,11 +7358,56 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 158 */ +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + var isArray = __webpack_require__(71), + isObjectLike = __webpack_require__(70); + + /** `Object#toString` result references. */ + var stringTag = '[object String]'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + } + + module.exports = isString; + + +/***/ }, +/* 173 */ /***/ function(module, exports, __webpack_require__) { - var baseValues = __webpack_require__(159), - keys = __webpack_require__(67); + var baseValues = __webpack_require__(174), + keys = __webpack_require__(65); /** * Creates an array of the own enumerable string keyed property values of `object`. @@ -7050,7 +7443,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 159 */ +/* 174 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(7); @@ -7075,18 +7468,20 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 160 */ +/* 175 */ /***/ function(module, exports, __webpack_require__) { - var baseDifference = __webpack_require__(138), - isArrayLikeObject = __webpack_require__(72), - rest = __webpack_require__(135); + var baseDifference = __webpack_require__(148), + baseRest = __webpack_require__(138), + isArrayLikeObject = __webpack_require__(154); /** * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * + * **Note:** Unlike `_.pull`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -7100,7 +7495,7 @@ return /******/ (function(modules) { // webpackBootstrap * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ - var without = rest(function(array, values) { + var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; @@ -7110,7 +7505,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 161 */ +/* 176 */ /***/ function(module, exports, __webpack_require__) { /* @@ -7138,7 +7533,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GridNoData; /***/ }, -/* 162 */ +/* 177 */ /***/ function(module, exports, __webpack_require__) { /* @@ -7148,149 +7543,178 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var ColumnProperties = __webpack_require__(5); - var deep = __webpack_require__(163); - var isFunction = __webpack_require__(32); - var zipObject = __webpack_require__(166); - var assign = __webpack_require__(144); - var defaults = __webpack_require__(168); - var toPairs = __webpack_require__(175); - var without = __webpack_require__(160); + var deep = __webpack_require__(178); + var isFunction = __webpack_require__(28); + var zipObject = __webpack_require__(181); + var assign = __webpack_require__(155); + var defaults = __webpack_require__(183); + var toPairs = __webpack_require__(189); + var without = __webpack_require__(175); var GridRow = React.createClass({ - displayName: 'GridRow', + displayName: 'GridRow', - getDefaultProps: function getDefaultProps() { - return { - "isChildRow": false, - "showChildren": false, - "data": {}, - "columnSettings": null, - "rowSettings": null, - "hasChildren": false, - "useGriddleStyles": true, - "useGriddleIcons": true, - "isSubGriddle": false, - "paddingHeight": null, - "rowHeight": null, - "parentRowCollapsedClassName": "parent-row", - "parentRowExpandedClassName": "parent-row expanded", - "parentRowCollapsedComponent": "▶", - "parentRowExpandedComponent": "▼", - "onRowClick": null, - "multipleSelectionSettings": null - }; - }, - handleClick: function handleClick(e) { - if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { - this.props.onRowClick(this, e); - } else if (this.props.hasChildren) { - this.props.toggleChildren(); - } - }, - handleSelectionChange: function handleSelectionChange(e) { - //hack to get around warning that's not super useful in this case - return; - }, - handleSelectClick: function handleSelectClick(e) { - if (this.props.multipleSelectionSettings.isMultipleSelection) { - if (e.target.type === "checkbox") { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); - } else { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); - } - } - }, - verifyProps: function verifyProps() { - if (this.props.columnSettings === null) { - console.error("gridRow: The columnSettings prop is null and it shouldn't be"); - } - }, - render: function render() { - var _this = this; + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "▶", + "parentRowExpandedComponent": "▼", + "onRowClick": null, + "multipleSelectionSettings": null + }; + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; - this.verifyProps(); - var that = this; - var columnStyles = null; - - if (this.props.useGriddleStyles) { - columnStyles = { - margin: "0px", - padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", - height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, - backgroundColor: "#FFF", - borderTopColor: "#DDD", - color: "#222" - }; - } + this.verifyProps(); + var that = this; + var columnStyles = null; - var columns = this.props.columnSettings.getColumns(); + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } - // make sure that all the columns we need have default empty values - // otherwise they will get clipped - var defaultValues = zipObject(columns, []); + var columns = this.props.columnSettings.getColumns(); - // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns - var dataView = assign({}, this.props.data); + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); - defaults(dataView, defaultValues); - var data = toPairs(deep.pick(dataView, without(columns, 'children'))); - var nodes = data.map(function (col, index) { - var returnValue = null; - var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); - //todo: Make this not as ridiculous looking - var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); - if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { - columnStyles = assign(columnStyles, { paddingLeft: 10 }); - } + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } + + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } + + return returnValue || React.createElement('td', { onClick: _this.handleClick, key: index, style: columnStyles }, firstColAppend, col[1]); + }); - if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { - if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { - var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; } else { - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, col[1]); + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } } - } - - return returnValue || React.createElement('td', { onClick: _this.handleClick, key: index, style: columnStyles }, firstColAppend, col[1]); - }); - if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { - var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } - nodes.unshift(React.createElement('td', { key: 'selection', style: columnStyles }, React.createElement('input', { - type: 'checkbox', - checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), - onChange: this.handleSelectionChange, - ref: 'selected' }))); - } + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; - //Get the row from the row settings. - var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } - if (that.props.isChildRow) { - className = "child-row"; - } else if (that.props.hasChildren) { - className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); } - return React.createElement('tr', { onClick: this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection ? this.handleSelectClick : null, className: className }, nodes); - } }); module.exports = GridRow; /***/ }, -/* 163 */ +/* 178 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var forEach = __webpack_require__(164); - var isObject = __webpack_require__(33); - var isArray = __webpack_require__(78); - var isFunction = __webpack_require__(32); + var forEach = __webpack_require__(179); + var isObject = __webpack_require__(29); + var isArray = __webpack_require__(71); + var isFunction = __webpack_require__(28); // Credits: https://github.com/documentcloud/underscore-contrib // Sub module: underscore.object.selectors @@ -7401,13 +7825,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 164 */ +/* 179 */ /***/ function(module, exports, __webpack_require__) { - var arrayEach = __webpack_require__(165), - baseEach = __webpack_require__(109), + var arrayEach = __webpack_require__(180), + baseEach = __webpack_require__(115), baseIteratee = __webpack_require__(8), - isArray = __webpack_require__(78); + isArray = __webpack_require__(71); /** * Iterates over elements of `collection` and invokes `iteratee` for each element. @@ -7429,7 +7853,7 @@ return /******/ (function(modules) { // webpackBootstrap * @see _.forEachRight * @example * - * _([1, 2]).forEach(function(value) { + * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. @@ -7448,7 +7872,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 165 */ +/* 180 */ /***/ function(module, exports) { /** @@ -7476,11 +7900,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 166 */ +/* 181 */ /***/ function(module, exports, __webpack_require__) { - var assignValue = __webpack_require__(145), - baseZipObject = __webpack_require__(167); + var assignValue = __webpack_require__(156), + baseZipObject = __webpack_require__(182); /** * This method is like `_.fromPairs` except that it accepts two arrays, @@ -7506,7 +7930,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 167 */ +/* 182 */ /***/ function(module, exports) { /** @@ -7535,13 +7959,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 168 */ +/* 183 */ /***/ function(module, exports, __webpack_require__) { - var apply = __webpack_require__(136), - assignInDefaults = __webpack_require__(169), - assignInWith = __webpack_require__(170), - rest = __webpack_require__(135); + var apply = __webpack_require__(140), + assignInDefaults = __webpack_require__(184), + assignInWith = __webpack_require__(185), + baseRest = __webpack_require__(138); /** * Assigns own and inherited enumerable string keyed properties of source @@ -7561,10 +7985,10 @@ return /******/ (function(modules) { // webpackBootstrap * @see _.defaultsDeep * @example * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var defaults = rest(function(args) { + var defaults = baseRest(function(args) { args.push(undefined, assignInDefaults); return apply(assignInWith, undefined, args); }); @@ -7573,7 +7997,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 169 */ +/* 184 */ /***/ function(module, exports, __webpack_require__) { var eq = __webpack_require__(16); @@ -7606,12 +8030,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 170 */ +/* 185 */ /***/ function(module, exports, __webpack_require__) { - var copyObject = __webpack_require__(146), - createAssigner = __webpack_require__(147), - keysIn = __webpack_require__(171); + var copyObject = __webpack_require__(158), + createAssigner = __webpack_require__(159), + keysIn = __webpack_require__(186); /** * This method is like `_.assignIn` except that it accepts `customizer` @@ -7650,19 +8074,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 171 */ +/* 186 */ /***/ function(module, exports, __webpack_require__) { - var baseKeysIn = __webpack_require__(172), - indexKeys = __webpack_require__(69), - isIndex = __webpack_require__(80), - isPrototype = __webpack_require__(81); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + var arrayLikeKeys = __webpack_require__(66), + baseKeysIn = __webpack_require__(187), + isArrayLike = __webpack_require__(85); /** * Creates an array of the own and inherited enumerable property names of `object`. @@ -7688,112 +8105,83 @@ return /******/ (function(modules) { // webpackBootstrap * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } module.exports = keysIn; /***/ }, -/* 172 */ +/* 187 */ /***/ function(module, exports, __webpack_require__) { - var Reflect = __webpack_require__(173), - iteratorToArray = __webpack_require__(174); + var isObject = __webpack_require__(29), + isPrototype = __webpack_require__(82), + nativeKeysIn = __webpack_require__(188); /** Used for built-in method references. */ var objectProto = Object.prototype; - /** Built-in value references. */ - var enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * The base implementation of `_.keysIn` 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 baseKeysIn(object) { - object = object == null ? object : Object(object); + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - var result = []; for (var key in object) { - result.push(key); + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } return result; } - // Fallback for IE < 9 with es6-shim. - if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; - } - module.exports = baseKeysIn; /***/ }, -/* 173 */ -/***/ function(module, exports, __webpack_require__) { - - var root = __webpack_require__(37); - - /** Built-in value references. */ - var Reflect = root.Reflect; - - module.exports = Reflect; - - -/***/ }, -/* 174 */ +/* 188 */ /***/ function(module, exports) { /** - * Converts `iterator` to an array. + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. * * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } } return result; } - module.exports = iteratorToArray; + module.exports = nativeKeysIn; /***/ }, -/* 175 */ +/* 189 */ /***/ function(module, exports, __webpack_require__) { - var createToPairs = __webpack_require__(176), - keys = __webpack_require__(67); + var createToPairs = __webpack_require__(190), + keys = __webpack_require__(65); /** * Creates an array of own enumerable string keyed-value pairs for `object` @@ -7825,13 +8213,13 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 176 */ +/* 190 */ /***/ function(module, exports, __webpack_require__) { - var baseToPairs = __webpack_require__(177), - getTag = __webpack_require__(82), + var baseToPairs = __webpack_require__(191), + getTag = __webpack_require__(86), mapToArray = __webpack_require__(62), - setToPairs = __webpack_require__(178); + setToPairs = __webpack_require__(192); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -7861,7 +8249,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 177 */ +/* 191 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(7); @@ -7885,7 +8273,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 178 */ +/* 192 */ /***/ function(module, exports) { /** @@ -7909,7 +8297,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 179 */ +/* 193 */ /***/ function(module, exports, __webpack_require__) { /* @@ -7955,7 +8343,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomRowComponentContainer; /***/ }, -/* 180 */ +/* 194 */ /***/ function(module, exports, __webpack_require__) { /* @@ -8007,7 +8395,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomPaginationContainer; /***/ }, -/* 181 */ +/* 195 */ /***/ function(module, exports, __webpack_require__) { /* @@ -8044,11 +8432,11 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomFilterContainer; /***/ }, -/* 182 */ +/* 196 */ /***/ function(module, exports, __webpack_require__) { - var baseSlice = __webpack_require__(183), - toInteger = __webpack_require__(121); + var baseSlice = __webpack_require__(197), + toInteger = __webpack_require__(127); /** * Creates a slice of `array` with `n` elements dropped from the beginning. @@ -8088,7 +8476,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 183 */ +/* 197 */ /***/ function(module, exports) { /** @@ -8125,11 +8513,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 184 */ +/* 198 */ /***/ function(module, exports, __webpack_require__) { - var baseSlice = __webpack_require__(183), - toInteger = __webpack_require__(121); + var baseSlice = __webpack_require__(197), + toInteger = __webpack_require__(127); /** * Creates a slice of `array` with `n` elements dropped from the end. @@ -8170,11 +8558,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 185 */ +/* 199 */ /***/ function(module, exports, __webpack_require__) { - var baseSlice = __webpack_require__(183), - toInteger = __webpack_require__(121); + var baseSlice = __webpack_require__(197), + toInteger = __webpack_require__(127); /** * Creates a slice of `array` with `n` elements taken from the beginning. @@ -8213,10 +8601,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 186 */ +/* 200 */ /***/ function(module, exports, __webpack_require__) { - var dropRight = __webpack_require__(184); + var baseSlice = __webpack_require__(197); /** * Gets all but the last element of `array`. @@ -8233,25 +8621,161 @@ return /******/ (function(modules) { // webpackBootstrap * // => [1, 2] */ function initial(array) { - return dropRight(array, 1); + var length = array ? array.length : 0; + return length ? baseSlice(array, 0, -1) : []; } module.exports = initial; /***/ }, -/* 187 */ +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(7), + baseIntersection = __webpack_require__(202), + baseRest = __webpack_require__(138), + castArrayLikeObject = __webpack_require__(203); + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + module.exports = intersection; + + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + var SetCache = __webpack_require__(54), + arrayIncludes = __webpack_require__(149), + arrayIncludesWith = __webpack_require__(153), + arrayMap = __webpack_require__(7), + baseUnary = __webpack_require__(79), + cacheHas = __webpack_require__(58); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMin = Math.min; + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + module.exports = baseIntersection; + + +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { + + var isArrayLikeObject = __webpack_require__(154); + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + module.exports = castArrayLikeObject; + + +/***/ }, +/* 204 */ /***/ function(module, exports, __webpack_require__) { - var getTag = __webpack_require__(82), - isArguments = __webpack_require__(71), - isArray = __webpack_require__(78), - isArrayLike = __webpack_require__(73), - isBuffer = __webpack_require__(188), - isFunction = __webpack_require__(32), - isObjectLike = __webpack_require__(77), - isString = __webpack_require__(79), - keys = __webpack_require__(67); + var baseKeys = __webpack_require__(81), + getTag = __webpack_require__(86), + isArguments = __webpack_require__(68), + isArray = __webpack_require__(71), + isArrayLike = __webpack_require__(85), + isBuffer = __webpack_require__(72), + isPrototype = __webpack_require__(82), + isTypedArray = __webpack_require__(76); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -8263,12 +8787,6 @@ return /******/ (function(modules) { // webpackBootstrap /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ - var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); - /** * Checks if `value` is an empty object, collection, map, or set. * @@ -8304,113 +8822,30 @@ return /******/ (function(modules) { // webpackBootstrap */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || - isArguments(value) || isBuffer(value))) { + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } - if (isObjectLike(value)) { - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } - return !(nonEnumShadows && keys(value).length); + return true; } module.exports = isEmpty; /***/ }, -/* 188 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(37), - stubFalse = __webpack_require__(190); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined; - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = !Buffer ? stubFalse : function(value) { - return value instanceof Buffer; - }; - - module.exports = isBuffer; - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(189)(module))) - -/***/ }, -/* 189 */ -/***/ function(module, exports) { - - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } - - -/***/ }, -/* 190 */ -/***/ function(module, exports) { - - /** - * A method that returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ - function stubFalse() { - return false; - } - - module.exports = stubFalse; - - -/***/ }, -/* 191 */ +/* 205 */ /***/ function(module, exports) { /** @@ -8438,7 +8873,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 192 */ +/* 206 */ /***/ function(module, exports) { /** @@ -8466,16 +8901,15 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 193 */ +/* 207 */ /***/ function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(7), - baseDifference = __webpack_require__(138), - baseFlatten = __webpack_require__(125), - basePick = __webpack_require__(150), - getAllKeysIn = __webpack_require__(194), - rest = __webpack_require__(135), - toKey = __webpack_require__(101); + baseDifference = __webpack_require__(148), + basePick = __webpack_require__(162), + flatRest = __webpack_require__(164), + getAllKeysIn = __webpack_require__(208), + toKey = __webpack_require__(106); /** * The opposite of `_.pick`; this method creates an object composed of the @@ -8496,11 +8930,11 @@ return /******/ (function(modules) { // webpackBootstrap * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = rest(function(object, props) { + var omit = flatRest(function(object, props) { if (object == null) { return {}; } - props = arrayMap(baseFlatten(props, 1), toKey); + props = arrayMap(props, toKey); return basePick(object, baseDifference(getAllKeysIn(object), props)); }); @@ -8508,12 +8942,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 194 */ +/* 208 */ /***/ function(module, exports, __webpack_require__) { - var baseGetAllKeys = __webpack_require__(195), - getSymbolsIn = __webpack_require__(196), - keysIn = __webpack_require__(171); + var baseGetAllKeys = __webpack_require__(209), + getSymbolsIn = __webpack_require__(210), + keysIn = __webpack_require__(186); /** * Creates an array of own and inherited enumerable property names and @@ -8531,11 +8965,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 195 */ +/* 209 */ /***/ function(module, exports, __webpack_require__) { - var arrayPush = __webpack_require__(126), - isArray = __webpack_require__(78); + var arrayPush = __webpack_require__(132), + isArray = __webpack_require__(71); /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses @@ -8557,15 +8991,16 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 196 */ +/* 210 */ /***/ function(module, exports, __webpack_require__) { - var arrayPush = __webpack_require__(126), - getPrototype = __webpack_require__(66), - getSymbols = __webpack_require__(197); + var arrayPush = __webpack_require__(132), + getPrototype = __webpack_require__(211), + getSymbols = __webpack_require__(212), + stubArray = __webpack_require__(213); - /** Built-in value references. */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own and inherited enumerable symbol properties @@ -8575,7 +9010,7 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); @@ -8588,13 +9023,26 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 197 */ +/* 211 */ /***/ function(module, exports, __webpack_require__) { - var stubArray = __webpack_require__(198); + var overArg = __webpack_require__(84); /** Built-in value references. */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var getPrototype = overArg(Object.getPrototypeOf, Object); + + module.exports = getPrototype; + + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + var overArg = __webpack_require__(84), + stubArray = __webpack_require__(213); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own enumerable symbol properties of `object`. @@ -8603,26 +9051,17 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - function getSymbols(object) { - // Coerce `object` to an object to avoid non-object errors in V8. - // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. - return getOwnPropertySymbols(Object(object)); - } - - // Fallback for IE < 11. - if (!getOwnPropertySymbols) { - getSymbols = stubArray; - } + var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; module.exports = getSymbols; /***/ }, -/* 198 */ +/* 213 */ /***/ function(module, exports) { /** - * A method that returns a new empty array. + * This method returns a new empty array. * * @static * @memberOf _ @@ -8647,11 +9086,11 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 199 */ +/* 214 */ /***/ function(module, exports, __webpack_require__) { - var baseOrderBy = __webpack_require__(128), - isArray = __webpack_require__(78); + var baseOrderBy = __webpack_require__(134), + isArray = __webpack_require__(71); /** * This method is like `_.sortBy` except that it allows specifying the sort diff --git a/modules/gridRow.jsx.js b/modules/gridRow.jsx.js index 98b5370a..58d02808 100644 --- a/modules/gridRow.jsx.js +++ b/modules/gridRow.jsx.js @@ -14,126 +14,155 @@ var toPairs = require('lodash/toPairs'); var without = require('lodash/without'); var GridRow = React.createClass({ - displayName: 'GridRow', - - getDefaultProps: function getDefaultProps() { - return { - "isChildRow": false, - "showChildren": false, - "data": {}, - "columnSettings": null, - "rowSettings": null, - "hasChildren": false, - "useGriddleStyles": true, - "useGriddleIcons": true, - "isSubGriddle": false, - "paddingHeight": null, - "rowHeight": null, - "parentRowCollapsedClassName": "parent-row", - "parentRowExpandedClassName": "parent-row expanded", - "parentRowCollapsedComponent": "▶", - "parentRowExpandedComponent": "▼", - "onRowClick": null, - "multipleSelectionSettings": null - }; - }, - handleClick: function handleClick(e) { - if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { - this.props.onRowClick(this, e); - } else if (this.props.hasChildren) { - this.props.toggleChildren(); - } - }, - handleSelectionChange: function handleSelectionChange(e) { - //hack to get around warning that's not super useful in this case - return; - }, - handleSelectClick: function handleSelectClick(e) { - if (this.props.multipleSelectionSettings.isMultipleSelection) { - if (e.target.type === "checkbox") { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); - } else { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); - } - } - }, - verifyProps: function verifyProps() { - if (this.props.columnSettings === null) { - console.error("gridRow: The columnSettings prop is null and it shouldn't be"); - } - }, - render: function render() { - var _this = this; - - this.verifyProps(); - var that = this; - var columnStyles = null; - - if (this.props.useGriddleStyles) { - columnStyles = { - margin: "0px", - padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", - height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, - backgroundColor: "#FFF", - borderTopColor: "#DDD", - color: "#222" - }; - } - - var columns = this.props.columnSettings.getColumns(); - - // make sure that all the columns we need have default empty values - // otherwise they will get clipped - var defaultValues = zipObject(columns, []); - - // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns - var dataView = assign({}, this.props.data); - - defaults(dataView, defaultValues); - var data = toPairs(deep.pick(dataView, without(columns, 'children'))); - var nodes = data.map(function (col, index) { - var returnValue = null; - var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); - - //todo: Make this not as ridiculous looking - var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; - - if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { - columnStyles = assign(columnStyles, { paddingLeft: 10 }); - } + displayName: 'GridRow', + + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "▶", + "parentRowExpandedComponent": "▼", + "onRowClick": null, + "multipleSelectionSettings": null + }; + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; + + this.verifyProps(); + var that = this; + var columnStyles = null; + + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } - if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { - if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { - var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + var columns = this.props.columnSettings.getColumns(); + + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); + + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); + + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); + + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; + + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } + + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } + + return returnValue || React.createElement('td', { onClick: _this.handleClick, key: index, style: columnStyles }, firstColAppend, col[1]); + }); + + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; } else { - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, col[1]); + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } } - } - return returnValue || React.createElement('td', { onClick: _this.handleClick, key: index, style: columnStyles }, firstColAppend, col[1]); - }); - - if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { - var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } - nodes.unshift(React.createElement('td', { key: 'selection', style: columnStyles }, React.createElement('input', { - type: 'checkbox', - checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), - onChange: this.handleSelectionChange, - ref: 'selected' }))); - } + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; - //Get the row from the row settings. - var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } - if (that.props.isChildRow) { - className = "child-row"; - } else if (that.props.hasChildren) { - className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); } - return React.createElement('tr', { onClick: this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection ? this.handleSelectClick : null, className: className }, nodes); - } }); module.exports = GridRow; diff --git a/modules/gridTitle.jsx.js b/modules/gridTitle.jsx.js index d981626b..e474c1c7 100644 --- a/modules/gridTitle.jsx.js +++ b/modules/gridTitle.jsx.js @@ -103,15 +103,19 @@ var GridTitle = React.createClass({ }; } titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); - return React.createElement('th', { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); }); if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { - nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles }, React.createElement('input', { type: 'checkbox', + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), - onChange: this.handleSelectionChange }))); + onChange: this.handleSelectionChange + }))); } //Get the row from the row settings. diff --git a/modules/griddle.jsx.js b/modules/griddle.jsx.js index c4d0aff1..7a373220 100644 --- a/modules/griddle.jsx.js +++ b/modules/griddle.jsx.js @@ -38,6 +38,7 @@ var find = require('lodash/find'); var first = require('lodash/take'); var forEach = require('lodash/forEach'); var initial = require('lodash/initial'); +var intersection = require('lodash/intersection'); var isArray = require('lodash/isArray'); var isEmpty = require('lodash/isEmpty'); var isNull = require('lodash/isNull'); @@ -148,13 +149,15 @@ var Griddle = React.createClass({ "previousIconComponent": "", "isMultipleSelection": false, //currently does not support subgrids "selectedRowIds": [], - "uniqueIdentifier": "id" + "uniqueIdentifier": "id", + "onSelectionChange": null }; }, propTypes: { isMultipleSelection: React.PropTypes.bool, selectedRowIds: React.PropTypes.oneOfType([React.PropTypes.arrayOf(React.PropTypes.number), React.PropTypes.arrayOf(React.PropTypes.string)]), - uniqueIdentifier: React.PropTypes.string + uniqueIdentifier: React.PropTypes.string, + onSelectionChange: React.PropTypes.func }, defaultFilter: function defaultFilter(results, filter) { var that = this; @@ -250,7 +253,6 @@ var Griddle = React.createClass({ this.props.externalSetPageSize(size); return; } - //make this better. this.state.resultsPerPage = size; this.setMaxPage(); @@ -319,10 +321,6 @@ var Griddle = React.createClass({ this.setState({ isSelectAllChecked: false }); - } else { - //When the paging is done on the server, the previously selected rows on a certain page might not - // coincide with the new rows on that exact page page, if moving back and forth. Better reset the selection - this._resetSelectedRows(); } }, setColumns: function setColumns(columns) { @@ -352,10 +350,10 @@ var Griddle = React.createClass({ if (this.props.useExternal) { var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; this.setState({ - sortColumn: column, - sortDirection: isAscending ? 'asc' : 'desc' + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' }); - this.props.externalChangeSort(column, isAscending); + this.props.externalChangeSort(column, isAscending); return; } var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; @@ -380,10 +378,6 @@ var Griddle = React.createClass({ }; this.setState(state); - - //When the sorting is done on the server, the previously selected rows might not correspond with the new ones. - //Better reset the selection - this._resetSelectedRows(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setMaxPage(nextProps.results); @@ -411,7 +405,7 @@ var Griddle = React.createClass({ } if (nextProps.selectedRowIds) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true); + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), @@ -597,9 +591,8 @@ var Griddle = React.createClass({ } return transformedData; }, - //this is the current results - getCurrentResults: function getCurrentResults() { - return this.state.filteredResults || this.props.results; + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; }, getCurrentPage: function getCurrentPage() { return this.props.externalCurrentPage || this.state.page; @@ -642,18 +635,27 @@ var Griddle = React.createClass({ isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _toggleSelectRow: function _toggleSelectRow(row, isChecked) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + this.setState({ - isSelectAllChecked: this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { @@ -677,23 +679,7 @@ var Griddle = React.createClass({ }, _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { - var i, isFound; - - if (selectedRowIds.length !== visibleRowIds.length) { - return false; - } - - for (i = 0; i < selectedRowIds.length; i++) { - isFound = find(visibleRowIds, function (visibleRowId) { - return selectedRowIds[i] === visibleRowId; - }); - - if (isFound === undefined) { - return false; - } - } - - return true; + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; }, _getIsRowChecked: function _getIsRowChecked(row) { @@ -719,7 +705,6 @@ var Griddle = React.createClass({ }) ? false : this.props.isMultipleSelection, //does not support subgrids toggleSelectAll: this._toggleSelectAll, getIsSelectAllChecked: this._getIsSelectAllChecked, - toggleSelectRow: this._toggleSelectRow, getSelectedRowIds: this.getSelectedRowIds, getIsRowChecked: this._getIsRowChecked diff --git a/scripts/gridRow.jsx b/scripts/gridRow.jsx index 455add4b..c0ee1bad 100644 --- a/scripts/gridRow.jsx +++ b/scripts/gridRow.jsx @@ -117,19 +117,41 @@ var GridRow = React.createClass({ return returnValue || ({firstColAppend}{col[1]}); }); - if(nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { - var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); - - nodes.unshift( - - - + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; + } else { + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } + } + + if(nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift( + + + ); - } + } //Get the row from the row settings. var className = that.props.rowSettings&&that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; @@ -139,7 +161,8 @@ var GridRow = React.createClass({ } else if (that.props.hasChildren){ className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; } - return ({nodes}); + + return ({nodes}); } }); diff --git a/scripts/gridTitle.jsx b/scripts/gridTitle.jsx old mode 100755 new mode 100644 index e7fe55f3..4cbda1ac --- a/scripts/gridTitle.jsx +++ b/scripts/gridTitle.jsx @@ -100,11 +100,15 @@ var GridTitle = React.createClass({ }); if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { - nodes.unshift( - - ); + nodes.unshift( + + + + ); } //Get the row from the row settings. diff --git a/scripts/griddle.jsx b/scripts/griddle.jsx old mode 100755 new mode 100644 index 23b485fd..1c2107c8 --- a/scripts/griddle.jsx +++ b/scripts/griddle.jsx @@ -26,6 +26,7 @@ var find = require('lodash/find'); var first = require('lodash/take'); var forEach = require('lodash/forEach'); var initial = require('lodash/initial'); +var intersection = require('lodash/intersection'); var isArray = require('lodash/isArray'); var isEmpty = require('lodash/isEmpty'); var isNull = require('lodash/isNull'); @@ -134,7 +135,8 @@ var Griddle = React.createClass({ "previousIconComponent":"", "isMultipleSelection": false, //currently does not support subgrids "selectedRowIds": [], - "uniqueIdentifier": "id" + "uniqueIdentifier": "id", + "onSelectionChange": null }; }, propTypes: { @@ -143,7 +145,8 @@ var Griddle = React.createClass({ React.PropTypes.arrayOf(React.PropTypes.number), React.PropTypes.arrayOf(React.PropTypes.string) ]), - uniqueIdentifier: React.PropTypes.string + uniqueIdentifier: React.PropTypes.string, + onSelectionChange: React.PropTypes.func }, defaultFilter: function(results, filter) { var that = this; @@ -319,9 +322,6 @@ var Griddle = React.createClass({ this.setState({ isSelectAllChecked: false }) - } else { //When the paging is done on the server, the previously selected rows on a certain page might not - // coincide with the new rows on that exact page page, if moving back and forth. Better reset the selection - this._resetSelectedRows(); } }, setColumns: function(columns){ @@ -373,10 +373,6 @@ var Griddle = React.createClass({ }; this.setState(state); - - //When the sorting is done on the server, the previously selected rows might not correspond with the new ones. - //Better reset the selection - this._resetSelectedRows(); }, componentWillReceiveProps: function(nextProps) { this.setMaxPage(nextProps.results); @@ -406,9 +402,8 @@ var Griddle = React.createClass({ this.columnSettings.filteredColumns = nextProps.columns; } - if(nextProps.selectedRowIds) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true); + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), @@ -427,8 +422,8 @@ var Griddle = React.createClass({ columnFilters: {}, resultsPerPage: this.props.resultsPerPage || 5, showColumnChooser: false, - isSelectAllChecked: false, - selectedRowIds: this.props.selectedRowIds + isSelectAllChecked: false, + selectedRowIds: this.props.selectedRowIds }; return state; }, @@ -471,7 +466,6 @@ var Griddle = React.createClass({ filteredColumns: this.columnSettings.filteredColumns }) } - }, //todo: clean these verify methods up verifyExternal: function(){ @@ -604,9 +598,8 @@ var Griddle = React.createClass({ } return transformedData; }, - //this is the current results - getCurrentResults: function(){ - return this.state.filteredResults || this.props.results; + getCurrentResults: function(results){ + return this.state.filteredResults || results || this.props.results; }, getCurrentPage: function(){ return this.props.externalCurrentPage||this.state.page; @@ -635,33 +628,42 @@ var Griddle = React.createClass({ sortDefaultComponent: this.props.sortDefaultComponent } }, - _toggleSelectAll: function () { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), + _toggleSelectAll: function () { + var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newIsSelectAllChecked = !this.state.isSelectAllChecked, - newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); var self = this; - forEach(visibleRows, function (row) { + forEach(visibleRows, function (row) { self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); - }, this); + }, this); - this.setState({ - isSelectAllChecked: newIsSelectAllChecked, - selectedRowIds: newSelectedRowIds - }); - }, - _toggleSelectRow: function (row, isChecked) { + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, + selectedRowIds: newSelectedRowIds + }); + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, + _toggleSelectRow: function (row, isChecked) { var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); - this.setState({ - isSelectAllChecked: this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + + this.setState({ + isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds - }); - }, + }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } + }, _updateSelectedRowIds: function (id, selectedRowIds, isChecked) { var isFound; @@ -684,23 +686,7 @@ var Griddle = React.createClass({ }, _getAreAllRowsChecked: function (selectedRowIds, visibleRowIds) { - var i, isFound; - - if(selectedRowIds.length !== visibleRowIds.length) { - return false; - } - - for(i = 0; i < selectedRowIds.length; i++) { - isFound = find(visibleRowIds, function (visibleRowId) { - return selectedRowIds[i] === visibleRowId; - }); - - if(isFound === undefined) { - return false; - } - } - - return true; + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; }, _getIsRowChecked: function (row) { @@ -724,10 +710,9 @@ var Griddle = React.createClass({ isMultipleSelection: find(this.props.results, function (result) { return 'children' in result}) ? false : this.props.isMultipleSelection, //does not support subgrids toggleSelectAll: this._toggleSelectAll, getIsSelectAllChecked: this._getIsSelectAllChecked, - toggleSelectRow: this._toggleSelectRow, getSelectedRowIds: this.getSelectedRowIds, - getIsRowChecked: this._getIsRowChecked + getIsRowChecked: this._getIsRowChecked } }, isInfiniteScrollEnabled: function(){