diff --git a/demo/js/demo.bundle.js b/demo/js/demo.bundle.js index 6b8828d37..b81dc574a 100644 --- a/demo/js/demo.bundle.js +++ b/demo/js/demo.bundle.js @@ -1,4 +1,4 @@ -require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1) return classes + classes.push(className) + el.className = classes.join(' ') + return classes +} + +ElementClass.prototype.remove = function(className) { + var el = this.el + if (!el) return + if (el.className === "") return + var classes = el.className.split(' ') + var idx = indexOf(classes, className) + if (idx > -1) classes.splice(idx, 1) + el.className = classes.join(' ') + return classes +} + +ElementClass.prototype.has = function(className) { + var el = this.el + if (!el) return + var classes = el.className.split(' ') + return indexOf(classes, className) > -1 +} + +ElementClass.prototype.toggle = function(className) { + var el = this.el + if (!el) return + if (this.has(className)) this.remove(className) + else this.add(className) +} + +},{}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/events/events.js":[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -430,20135 +541,20565 @@ function isUndefined(arg) { return arg === void 0; } -},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; +},{}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js":[function(require,module,exports){ +(function (process){ +'use strict'; -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @typechecks + */ -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; +var emptyFunction = require('./emptyFunction'); - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } +/** + * Upstream version of event listener. Does not take into account specific + * nature of platform. + */ +var EventListener = { + /** + * Listen to DOM events during the bubble phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + listen: function listen(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, false); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, false); } - queueIndex = -1; - len = queue.length; + }; + } else if (target.attachEvent) { + target.attachEvent('on' + eventType, callback); + return { + remove: function remove() { + target.detachEvent('on' + eventType, callback); + } + }; } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} + }, -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; + /** + * Listen to DOM events during the capture phase. + * + * @param {DOMEventTarget} target DOM element to register listener on. + * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. + * @param {function} callback Callback function. + * @return {object} Object with a `remove` method. + */ + capture: function capture(target, eventType, callback) { + if (target.addEventListener) { + target.addEventListener(eventType, callback, true); + return { + remove: function remove() { + target.removeEventListener(eventType, callback, true); } + }; + } else { + if (process.env.NODE_ENV !== 'production') { + console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); + } + return { + remove: emptyFunction + }; } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } -}; + }, -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); + registerDefault: function registerDefault() {} }; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; -function noop() {} +module.exports = EventListener; +}).call(this,require('_process')) -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; +},{"./emptyFunction":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","_process":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/process/browser.js"}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js":[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; +'use strict'; -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js":[function(require,module,exports){ -/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ +/** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ +var ExecutionEnvironment = { -(function () { - 'use strict'; + canUseDOM: canUseDOM, - var hasOwn = {}.hasOwnProperty; + canUseWorkers: typeof Worker !== 'undefined', - function classNames () { - var classes = []; + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; + canUseViewport: canUseDOM && !!window.screen, - var argType = typeof arg; + isInWorker: !canUseDOM // For now, this is true - might change in the future. - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); - } +}; - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { - // register as 'classnames', consistent with npm package name - define('classnames', [], function () { - return classNames; - }); - } else { - window.classNames = classNames; - } -}()); +module.exports = ExecutionEnvironment; +},{}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/camelize.js":[function(require,module,exports){ +"use strict"; -},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/CSSCore.js":[function(require,module,exports){ -(function (process){ /** - * Copyright 2013-2015, Facebook, Inc. + * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule CSSCore * @typechecks */ -'use strict'; +var _hyphenPattern = /-(.)/g; -var invariant = require('./invariant'); +/** + * Camelcases a hyphenated string, for example: + * + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ +function camelize(string) { + return string.replace(_hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); +} +module.exports = camelize; +},{}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/camelizeStyleName.js":[function(require,module,exports){ /** - * The CSSCore module specifies the API (and implements most of the methods) - * that should be used when dealing with the display of elements (via their - * CSS classes and visibility on screen. It is an API focused on mutating the - * display and not reading it as no logical state should be encoded in the - * display of elements. + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @typechecks */ -var CSSCore = { +'use strict'; - /** - * Adds the class passed in to the element if it doesn't already have it. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - addClass: function (element, className) { - !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined; +var camelize = require('./camelize'); - if (className) { - if (element.classList) { - element.classList.add(className); - } else if (!CSSCore.hasClass(element, className)) { - element.className = element.className + ' ' + className; - } - } - return element; - }, +var msPattern = /^-ms-/; - /** - * Removes the class passed in from the element - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @return {DOMElement} the element passed in - */ - removeClass: function (element, className) { - !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined; +/** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ +function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); +} - if (className) { - if (element.classList) { - element.classList.remove(className); - } else if (CSSCore.hasClass(element, className)) { - element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one - .replace(/^\s*|\s*$/g, ''); // trim the ends - } - } - return element; - }, +module.exports = camelizeStyleName; +},{"./camelize":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/camelize.js"}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js":[function(require,module,exports){ +'use strict'; - /** - * Helper to add or remove a class from an element based on a condition. - * - * @param {DOMElement} element the element to set the class on - * @param {string} className the CSS className - * @param {*} bool condition to whether to add or remove the class - * @return {DOMElement} the element passed in - */ - conditionClass: function (element, className, bool) { - return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); - }, +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ - /** - * Tests whether the element has the class specified. - * - * @param {DOMNode|DOMWindow} element the element to set the class on - * @param {string} className the CSS className - * @return {boolean} true if the element has the class, false if not - */ - hasClass: function (element, className) { - !!/\s/.test(className) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : undefined; - if (element.classList) { - return !!className && element.classList.contains(className); - } - return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; - } +var isTextNode = require('./isTextNode'); -}; +/*eslint-disable no-bitwise */ -module.exports = CSSCore; -}).call(this,require('_process')) +/** + * Checks if a given DOM node contains or is another DOM node. + */ +function containsNode(outerNode, innerNode) { + if (!outerNode || !innerNode) { + return false; + } else if (outerNode === innerNode) { + return true; + } else if (isTextNode(outerNode)) { + return false; + } else if (isTextNode(innerNode)) { + return containsNode(outerNode, innerNode.parentNode); + } else if ('contains' in outerNode) { + return outerNode.contains(innerNode); + } else if (outerNode.compareDocumentPosition) { + return !!(outerNode.compareDocumentPosition(innerNode) & 16); + } else { + return false; + } +} -},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","_process":"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js":[function(require,module,exports){ +module.exports = containsNode; +},{"./isTextNode":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/isTextNode.js"}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/createArrayFromMixed.js":[function(require,module,exports){ (function (process){ +'use strict'; + /** - * Copyright 2013-2015, Facebook, Inc. + * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule invariant + * @typechecks */ -'use strict'; +var invariant = require('./invariant'); /** - * Use invariant() to assert state which your program assumes to be true. + * Convert array-like objects to arrays. * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. + * This API assumes the caller knows the contents of the data type. For less + * well defined inputs use createArrayFromMixed. * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. + * @param {object|function|filelist} obj + * @return {array} */ +function toArray(obj) { + var length = obj.length; -function invariant(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); + // Some browsers builtin objects can report typeof 'function' (e.g. NodeList + // in old versions of Safari). + !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; + + !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; + + !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; + + !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; + + // Old IE doesn't give collections access to hasOwnProperty. Assume inputs + // without method will throw during the slice call and skip straight to the + // fallback. + if (obj.hasOwnProperty) { + try { + return Array.prototype.slice.call(obj); + } catch (e) { + // IE < 9 does not support Array#slice on collections objects } } - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } + // Fall back to copying key by key. This assumes all keys have a value, + // so will not preserve sparsely populated inputs. + var ret = Array(length); + for (var ii = 0; ii < length; ii++) { + ret[ii] = obj[ii]; + } + return ret; +} - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; +/** + * Perform a heuristic test to determine if an object is "array-like". + * + * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" + * Joshu replied: "Mu." + * + * This function determines if its argument has "array nature": it returns + * true if the argument is an actual array, an `arguments' object, or an + * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). + * + * It will return false for other array-like objects like Filelist. + * + * @param {*} obj + * @return {boolean} + */ +function hasArrayNature(obj) { + return( + // not null/false + !!obj && ( + // arrays are objects, NodeLists are functions in Safari + typeof obj == 'object' || typeof obj == 'function') && + // quacks like an array + 'length' in obj && + // not window + !('setInterval' in obj) && + // no DOM node should be considered an array-like + // a 'select' element has 'length' and 'item' properties on IE8 + typeof obj.nodeType != 'number' && ( + // a real array + Array.isArray(obj) || + // arguments + 'callee' in obj || + // HTMLCollection/NodeList + 'item' in obj) + ); +} + +/** + * Ensure that the argument is an array by wrapping it in an array if it is not. + * Creates a copy of the argument if it is already an array. + * + * This is mostly useful idiomatically: + * + * var createArrayFromMixed = require('createArrayFromMixed'); + * + * function takesOneOrMoreThings(things) { + * things = createArrayFromMixed(things); + * ... + * } + * + * This allows you to treat `things' as an array, but accept scalars in the API. + * + * If you need to convert an array-like object, like `arguments`, into an array + * use toArray instead. + * + * @param {*} obj + * @return {array} + */ +function createArrayFromMixed(obj) { + if (!hasArrayNature(obj)) { + return [obj]; + } else if (Array.isArray(obj)) { + return obj.slice(); + } else { + return toArray(obj); } } -module.exports = invariant; +module.exports = createArrayFromMixed; }).call(this,require('_process')) -},{"_process":"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-dom/index.js":[function(require,module,exports){ +},{"./invariant":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","_process":"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/process/browser.js"}],"/Users/zacharyryansmith/Code/OSS/react-bootstrap-table/node_modules/fbjs/lib/createNodesFromMarkup.js":[function(require,module,exports){ +(function (process){ 'use strict'; -module.exports = require('react/lib/ReactDOM'); +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @typechecks + */ -},{"react/lib/ReactDOM":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastContainer.js":[function(require,module,exports){ -"use strict"; +/*eslint-disable fb-www/unsafe-html*/ -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; +var ExecutionEnvironment = require('./ExecutionEnvironment'); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require("react"); +var createArrayFromMixed = require('./createArrayFromMixed'); +var getMarkupWrap = require('./getMarkupWrap'); +var invariant = require('./invariant'); -var _react2 = _interopRequireDefault(_react); +/** + * Dummy container used to render all markup. + */ +var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; -var _reactAddonsUpdate = require("react-addons-update"); +/** + * Pattern used by `getNodeName`. + */ +var nodeNamePattern = /^\s*<(\w+)/; -var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate); +/** + * Extracts the `nodeName` of the first element in a string of markup. + * + * @param {string} markup String of markup. + * @return {?string} Node name of the supplied markup. + */ +function getNodeName(markup) { + var nodeNameMatch = markup.match(nodeNamePattern); + return nodeNameMatch && nodeNameMatch[1].toLowerCase(); +} -var _ToastMessage = require("./ToastMessage"); +/** + * Creates an array containing the nodes rendered from the supplied markup. The + * optionally supplied `handleScript` function will be invoked once for each + *