react-virtualized
Version:
React components for efficiently rendering large, scrollable lists and tabular data
1 lines • 13.3 kB
JavaScript
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():n.History=t()}(this,function(){return function(n){function t(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return n[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var e={};return t.m=n,t.c=e,t.p="",t(0)}([function(n,t,e){"use strict";function o(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0,t.createPath=t.parsePath=t.locationsAreEqual=t.createLocation=t.createMemoryHistory=t.createHashHistory=t.createBrowserHistory=void 0;var r=e(1);Object.defineProperty(t,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(2);Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(t,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(8),c=o(a),u=e(9),s=o(u),f=e(10),l=o(f);t.createBrowserHistory=c["default"],t.createHashHistory=s["default"],t.createMemoryHistory=l["default"]},function(n,t,e){"use strict";t.__esModule=!0,t.locationsAreEqual=t.createLocation=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},i=e(2),a=(t.createLocation=function(n,t,e){var o=void 0;return"string"==typeof n?(o=(0,i.parsePath)(n),o.state=t):(o=r({},n),o.pathname||(o.pathname="/"),o.search&&"?"!==o.search.charAt(0)&&(o.search="?"+o.search),o.hash&&"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash),void 0!==t&&void 0===o.state&&(o.state=t)),o.key=e,o},function c(n,t){if(null==n)return n==t;var e="undefined"==typeof n?"undefined":o(n),r="undefined"==typeof t?"undefined":o(t);if(e!==r)return!1;if(Array.isArray(n))return!(!Array.isArray(t)||n.length!==t.length)&&n.every(function(n,e){return c(n,t[e])});if("object"===e){var i=Object.keys(n),a=Object.keys(t);return i.length===a.length&&i.every(function(e){return c(n[e],t[e])})}return n===t});t.locationsAreEqual=function(n,t){return n.pathname===t.pathname&&n.search===t.search&&n.hash===t.hash&&n.key===t.key&&a(n.state,t.state)}},function(n,t){"use strict";t.__esModule=!0;t.addLeadingSlash=function(n){return"/"===n.charAt(0)?n:"/"+n},t.stripLeadingSlash=function(n){return"/"===n.charAt(0)?n.substr(1):n},t.stripPrefix=function(n,t){return 0===n.indexOf(t)?n.substr(t.length):n},t.parsePath=function(n){var t=n||"/",e="",o="",r=t.indexOf("#");r!==-1&&(o=t.substr(r),t=t.substr(0,r));var i=t.indexOf("?");return i!==-1&&(e=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===e?"":e,hash:"#"===o?"":o}},t.createPath=function(n){var t=n.pathname,e=n.search,o=n.hash,r=t||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(n,t,e){"use strict";var o=function(){};n.exports=o},function(n,t,e){"use strict";function o(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var r=e(3),i=(o(r),function(){var n=null,t=function(t){return n=t,function(){n===t&&(n=null)}},e=function(t,e,o,r){if(null!=n){var i="function"==typeof n?n(t,e):n;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(n){return o.push(n),function(){o=o.filter(function(t){return t!==n})}},i=function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return o.forEach(function(n){return n.apply(void 0,t)})};return{setPrompt:t,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});t["default"]=i},function(n,t){"use strict";t.__esModule=!0;t.addEventListener=function(n,t,e){return n.addEventListener?n.addEventListener(t,e,!1):n.attachEvent("on"+t,e)},t.removeEventListener=function(n,t,e){return n.removeEventListener?n.removeEventListener(t,e,!1):n.detachEvent("on"+t,e)},t.getConfirmation=function(n,t){return t(window.confirm(n))},t.supportsHistory=function(){var n=window.navigator.userAgent;return(n.indexOf("Android 2.")===-1&&n.indexOf("Android 4.0")===-1||n.indexOf("Mobile Safari")===-1||n.indexOf("Chrome")!==-1||n.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},t.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(n,t){"use strict";t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(n,t,e){"use strict";var o=function(n,t,e,o,r,i,a,c){if(!n){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,c],f=0;u=new Error(t.replace(/%s/g,function(){return s[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};n.exports=o},function(n,t,e){"use strict";function o(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}),i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="popstate",p="hashchange",y=function(){try{return window.history.state||{}}catch(n){return{}}},g=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=(0,h.supportsHistory)(),o=!(0,h.supportsPopStateOnHashChange)(),i=n.basename,a=void 0===i?"":i,f=n.forceRefresh,g=void 0!==f&&f,m=n.getUserConfirmation,w=void 0===m?h.getConfirmation:m,P=n.keyLength,b=void 0===P?6:P,O=function(n){var t=n||{},e=t.key,o=t.state,i=window.location,c=i.pathname,u=i.search,f=i.hash,l=c+u+f;return a&&(l=(0,s.stripPrefix)(l,a)),r({},(0,s.parsePath)(l),{state:o,key:e})},x=function(){return Math.random().toString(36).substr(2,b)},L=(0,l["default"])(),E=function(n){r(W,n),W.length=t.length,L.notifyListeners(W.location,W.action)},S=function(n){void 0!==n.state&&k(O(n.state))},_=function(){k(O(y()))},A=!1,k=function(n){A?(A=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,w,function(e){e?E({action:t,location:n}):M(n)})}()},M=function(n){var t=W.location,e=H.indexOf(t.key);e===-1&&(e=0);var o=H.indexOf(n.key);o===-1&&(o=0);var r=e-o;r&&(A=!0,U(r))},T=O(y()),H=[T.key],j=function(n,o){var r="PUSH",i=(0,u.createLocation)(n,o,x());L.confirmTransitionTo(i,r,w,function(n){if(n){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(t.pushState({key:c,state:u},null,o),g)window.location.href=o;else{var f=H.indexOf(W.location.key),l=H.slice(0,f===-1?0:f+1);l.push(i.key),H=l,E({action:r,location:i})}else window.location.href=o}})},C=function(n,o){var r="REPLACE",i=(0,u.createLocation)(n,o,x());L.confirmTransitionTo(i,r,w,function(n){if(n){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(t.replaceState({key:c,state:u},null,o),g)window.location.replace(o);else{var f=H.indexOf(W.location.key);f!==-1&&(H[f]=i.key),E({action:r,location:i})}else window.location.replace(o)}})},U=function(n){t.go(n)},q=function(){return U(-1)},R=function(){return U(1)},B=0,I=function(n){B+=n,1===B?((0,h.addEventListener)(window,v,S),o&&(0,h.addEventListener)(window,p,_)):0===B&&((0,h.removeEventListener)(window,v,S),o&&(0,h.removeEventListener)(window,p,_))},F=!1,D=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),t()}},G=function(n){var t=L.appendListener(n);return I(1),function(){return I(-1),t()}},W={length:t.length,action:"POP",location:T,push:j,replace:C,go:U,goBack:q,goForward:R,block:D,listen:G};return W};t["default"]=g},function(n,t,e){"use strict";function o(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var r=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n},i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="hashchange",p={hashbang:{encodePath:function(n){return"!"===n.charAt(0)?n:"!/"+(0,s.stripLeadingSlash)(n)},decodePath:function(n){return"!"===n.charAt(0)?n.substr(1):n}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},y=function(){var n=window.location.href,t=n.indexOf("#");return t===-1?"":n.substring(t+1)},g=function(n){return window.location.hash=n},m=function(n){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+n)},w=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),n.basename),o=void 0===e?"":e,i=n.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=n.hashType,w=void 0===f?"slash":f,P=p[w],b=P.encodePath,O=P.decodePath,x=function(){var n=O(y());return o&&(n=(0,s.stripPrefix)(n,o)),(0,s.parsePath)(n)},L=(0,l["default"])(),E=function(n){r(z,n),z.length=t.length,L.notifyListeners(z.location,z.action)},S=!1,_=null,A=function(){var n=y(),t=b(n);if(n!==t)m(t);else{var e=x(),o=z.location;if(!S&&(0,u.locationsAreEqual)(o,e))return;if(_===(0,s.createPath)(e))return;_=null,k(e)}},k=function(n){S?(S=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,a,function(e){e?E({action:t,location:n}):M(n)})}()},M=function(n){var t=z.location,e=C.lastIndexOf((0,s.createPath)(t));e===-1&&(e=0);var o=C.lastIndexOf((0,s.createPath)(n));o===-1&&(o=0);var r=e-o;r&&(S=!0,R(r))},T=y(),H=b(T);T!==H&&m(H);var j=x(),C=[(0,s.createPath)(j)],U=function(n,t){var e="PUSH",r=(0,u.createLocation)(n);L.confirmTransitionTo(r,e,a,function(n){if(n){var t=(0,s.createPath)(r),i=b(o+t),a=y()!==i;if(a){_=t,g(i);var c=C.lastIndexOf((0,s.createPath)(z.location)),u=C.slice(0,c===-1?0:c+1);u.push(t),C=u,E({action:e,location:r})}else E()}})},q=function(n,t){var e="REPLACE",r=(0,u.createLocation)(n);L.confirmTransitionTo(r,e,a,function(n){if(n){var t=(0,s.createPath)(r),i=b(o+t),a=y()!==i;a&&(_=t,m(i));var c=C.indexOf((0,s.createPath)(z.location));c!==-1&&(C[c]=t),E({action:e,location:r})}})},R=function(n){t.go(n)},B=function(){return R(-1)},I=function(){return R(1)},F=0,D=function(n){F+=n,1===F?(0,h.addEventListener)(window,v,A):0===F&&(0,h.removeEventListener)(window,v,A)},G=!1,W=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return G||(D(1),G=!0),function(){return G&&(G=!1,D(-1)),t()}},V=function(n){var t=L.appendListener(n);return D(1),function(){return D(-1),t()}},z={length:t.length,action:"POP",location:j,push:U,replace:q,go:R,goBack:B,goForward:I,block:W,listen:V};return z};t["default"]=w},function(n,t,e){"use strict";function o(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}),i=e(3),a=(o(i),e(1)),c=e(4),u=o(c),s=function(n,t,e){return Math.min(Math.max(n,t),e)},f=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=n.getUserConfirmation,e=n.initialEntries,o=void 0===e?["/"]:e,i=n.initialIndex,c=void 0===i?0:i,f=n.keyLength,l=void 0===f?6:f,d=(0,u["default"])(),h=function(n){r(E,n),E.length=E.entries.length,d.notifyListeners(E.location,E.action)},v=function(){return Math.random().toString(36).substr(2,l)},p=s(c,0,o.length-1),y=o.map(function(n,t){return"string"==typeof n?(0,a.createLocation)(n,t?v():void 0):n}),g=function(n,e){var o="PUSH",r=(0,a.createLocation)(n,e,v());d.confirmTransitionTo(r,o,t,function(n){if(n){var t=E.index,e=t+1,i=E.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),h({action:o,location:r,index:e,entries:i})}})},m=function(n,e){var o="REPLACE",r=(0,a.createLocation)(n,e,v());d.confirmTransitionTo(r,o,t,function(n){n&&(E.entries[E.index]=r,h({action:o,location:r}))})},w=function(n){var e=s(E.index+n,0,E.entries.length-1),o="POP",r=E.entries[e];d.confirmTransitionTo(r,o,t,function(n){n?h({action:o,location:r,index:e}):h()})},P=function(){return w(-1)},b=function(){return w(1)},O=function(n){var t=E.index+n;return t>=0&&t<E.entries.length},x=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return d.setPrompt(n)},L=function(n){return d.appendListener(n)},E={length:y.length,action:"POP",location:y[p],index:p,entries:y,push:g,replace:m,go:w,goBack:P,goForward:b,canGo:O,block:x,listen:L};return E};t["default"]=f}])});