Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-bootstrap-table2-filter

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-table2-filter - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

2

dist/react-bootstrap-table2-filter.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactBootstrapTable2Filter=t(require("react")):e.ReactBootstrapTable2Filter=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LIKE="LIKE",t.EQ="=",t.NE="!=",t.GT=">",t.GE=">=",t.LT="<",t.LE="<="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILTER_TYPE={TEXT:"TEXT",SELECT:"SELECT",MULTISELECT:"MULTISELECT",NUMBER:"NUMBER",DATE:"DATE"},t.FILTER_DELAY=500},function(t,r){t.exports=e},function(e,t,r){e.exports=r(6)()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.customFilter=t.dateFilter=t.numberFilter=t.multiSelectFilter=t.selectFilter=t.textFilter=t.Comparator=t.FILTER_TYPES=void 0;var o=r(5),a=n(o),l=r(10),i=n(l),u=r(11),s=n(u),c=r(12),p=n(c),f=r(13),d=n(f),m=r(14),h=n(m),y=r(0),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(y),b=r(1);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{createContext:h.default,options:e}};t.FILTER_TYPES=b.FILTER_TYPE,t.Comparator=v,t.textFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:a.default,props:e}},t.selectFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:i.default,props:e}},t.multiSelectFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:s.default,props:e}},t.numberFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:p.default,props:e}},t.dateFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:d.default,props:e}},t.customFilter=function(){return{props:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}},function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(2),c=function(e){return e&&e.__esModule?e:{default:e}}(s),p=r(3),f=r(0),d=r(1),m=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.filter=r.filter.bind(r),r.handleClick=r.handleClick.bind(r),r.timeout=null,r.state={value:e.defaultValue},r}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.onFilter,n=t.getFilter,o=t.column,a=this.input.value;a&&r(this.props.column,d.FILTER_TYPE.TEXT,!0)(a),n&&n(function(t){e.setState(function(){return{value:t}}),r(o,d.FILTER_TYPE.TEXT)(t)})}},{key:"componentWillReceiveProps",value:function(e){e.defaultValue!==this.props.defaultValue&&this.applyFilter(e.defaultValue)}},{key:"componentWillUnmount",value:function(){this.cleanTimer()}},{key:"filter",value:function(e){var t=this;e.stopPropagation(),this.cleanTimer();var r=e.target.value;this.setState(function(){return{value:r}}),this.timeout=setTimeout(function(){t.props.onFilter(t.props.column,d.FILTER_TYPE.TEXT)(r)},this.props.delay)}},{key:"cleanTimer",value:function(){this.timeout&&clearTimeout(this.timeout)}},{key:"cleanFiltered",value:function(){var e=this.props.defaultValue;this.setState(function(){return{value:e}}),this.props.onFilter(this.props.column,d.FILTER_TYPE.TEXT)(e)}},{key:"applyFilter",value:function(e){this.setState(function(){return{value:e}}),this.props.onFilter(this.props.column,d.FILTER_TYPE.TEXT)(e)}},{key:"handleClick",value:function(e){e.stopPropagation(),this.props.onClick&&this.props.onClick(e)}},{key:"render",value:function(){var e=this,t=this.props,r=t.placeholder,o=t.column.text,a=t.style,l=t.className,u=(t.onFilter,t.caseSensitive,t.defaultValue,t.getFilter,n(t,["placeholder","column","style","className","onFilter","caseSensitive","defaultValue","getFilter"]));return c.default.createElement("label",{className:"filter-label",htmlFor:"text-filter-column-"+o},c.default.createElement("span",{className:"sr-only"},"Filter by ",o),c.default.createElement("input",i({},u,{ref:function(t){return e.input=t},type:"text",id:"text-filter-column-"+o,className:"filter text-filter form-control "+l,style:a,onChange:this.filter,onClick:this.handleClick,placeholder:r||"Enter "+o+"...",value:this.state.value})))}}]),t}(s.Component);m.propTypes={onFilter:p.PropTypes.func.isRequired,column:p.PropTypes.object.isRequired,comparator:p.PropTypes.oneOf([f.LIKE,f.EQ]),defaultValue:p.PropTypes.string,delay:p.PropTypes.number,placeholder:p.PropTypes.string,style:p.PropTypes.object,className:p.PropTypes.string,caseSensitive:p.PropTypes.bool,getFilter:p.PropTypes.func},m.defaultProps={delay:d.FILTER_DELAY,defaultValue:"",caseSensitive:!1},t.default=m},function(e,t,r){"use strict";var n=r(7),o=r(8),a=r(9);e.exports=function(){function e(e,t,r,n,l,i){i!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n,a,l,i,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,l,i,u],p=0;s=new Error(t.replace(/%s/g,function(){return c[p++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){if(Array.isArray(e)){if(e.length===t.length){for(var r=0;r<e.length;r+=1)if(e[r].value!==t[r].value||e[r].label!==t[r].label)return!1;return!0}return!1}for(var n=Object.keys(e),o=0;o<n.length;o+=1)if(e[n[o]]!==t[n[o]])return!1;return Object.keys(e).length===Object.keys(t).length}function s(e,t){if(Array.isArray(e)){return e.filter(function(e){return e.label===t}).map(function(e){return e.value})[0]}return e[t]}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(2),d=n(f),m=r(3),h=n(m),y=r(0),v=r(1),b=function(e){function t(e){a(this,t);var r=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.filter=r.filter.bind(r);var n=void 0!==s(e.options,e.defaultValue);return r.state={isSelected:n},r}return i(t,e),p(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.column,n=t.onFilter,o=t.getFilter,a=this.selectInput.value;a&&""!==a&&n(r,v.FILTER_TYPE.SELECT,!0)(a),o&&o(function(t){e.setState(function(){return{isSelected:""!==t}}),e.selectInput.value=t,n(r,v.FILTER_TYPE.SELECT)(t)})}},{key:"componentDidUpdate",value:function(e){var t=!1;if(this.props.defaultValue!==e.defaultValue?t=!0:u(this.props.options,e.options)||(t=!0),t){var r=this.selectInput.value;r&&this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(r)}}},{key:"getOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.placeholder,o=t.column;return t.withoutEmptyOption||e.push(d.default.createElement("option",{key:"-1",value:""},n||"Select "+o.text+"...")),Array.isArray(r)?r.forEach(function(t){var r=t.value,n=t.label;return e.push(d.default.createElement("option",{key:r,value:r},n))}):Object.keys(r).forEach(function(t){return e.push(d.default.createElement("option",{key:t,value:t},r[t]))}),e}},{key:"cleanFiltered",value:function(){var e=void 0!==this.props.defaultValue?this.props.defaultValue:"";this.setState(function(){return{isSelected:""!==e}}),this.selectInput.value=e,this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(e)}},{key:"applyFilter",value:function(e){this.selectInput.value=e,this.setState(function(){return{isSelected:""!==e}}),this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(e)}},{key:"filter",value:function(e){var t=e.target.value;this.setState(function(){return{isSelected:""!==t}}),this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(t)}},{key:"render",value:function(){var e=this,t=this.props,r=t.style,n=t.className,a=t.defaultValue,l=(t.onFilter,t.column),i=(t.options,t.comparator,t.withoutEmptyOption,t.caseSensitive,t.getFilter,o(t,["style","className","defaultValue","onFilter","column","options","comparator","withoutEmptyOption","caseSensitive","getFilter"])),u="filter select-filter form-control "+n+" "+(this.state.isSelected?"":"placeholder-selected");return d.default.createElement("label",{className:"filter-label",htmlFor:"select-filter-column-"+l.text},d.default.createElement("span",{className:"sr-only"},"Filter by ",l.text),d.default.createElement("select",c({},i,{ref:function(t){return e.selectInput=t},id:"select-filter-column-"+l.text,style:r,className:u,onChange:this.filter,onClick:function(e){return e.stopPropagation()},defaultValue:void 0!==a?a:""}),this.getOptions()))}}]),t}(f.Component);b.propTypes={onFilter:h.default.func.isRequired,column:h.default.object.isRequired,options:h.default.oneOfType([h.default.object,h.default.array]).isRequired,comparator:h.default.oneOf([y.LIKE,y.EQ]),placeholder:h.default.string,style:h.default.object,className:h.default.string,withoutEmptyOption:h.default.bool,defaultValue:h.default.any,caseSensitive:h.default.bool,getFilter:h.default.func},b.defaultProps={defaultValue:"",className:"",withoutEmptyOption:!1,comparator:y.EQ,caseSensitive:!0},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){for(var r=Object.keys(e),n=0;n<r.length;n+=1)if(e[r[n]]!==t[r[n]])return!1;return Object.keys(e).length===Object.keys(t).length}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),p=r(2),f=n(p),d=r(3),m=n(d),h=r(0),y=r(1),v=function(e){return Array.from(e.selectedOptions).map(function(e){return e.value})},b=function(e){function t(e){a(this,t);var r=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.filter=r.filter.bind(r),r.applyFilter=r.applyFilter.bind(r);var n=e.defaultValue.map(function(t){return e.options[t]}).length>0;return r.state={isSelected:n},r}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.getFilter,r=v(this.selectInput);r&&r.length>0&&this.applyFilter(r),t&&t(function(t){e.selectInput.value=t,e.applyFilter(t)})}},{key:"componentDidUpdate",value:function(e){var t=!1;this.props.defaultValue!==e.defaultValue?t=!0:u(this.props.options,e.options)||(t=!0),t&&this.applyFilter(this.selectInput.value)}},{key:"getOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.placeholder,o=t.column;return t.withoutEmptyOption||e.push(f.default.createElement("option",{key:"-1",value:""},n||"Select "+o.text+"...")),Object.keys(r).forEach(function(t){return e.push(f.default.createElement("option",{key:t,value:t},r[t]))}),e}},{key:"cleanFiltered",value:function(){var e=void 0!==this.props.defaultValue?this.props.defaultValue:[];this.selectInput.value=e,this.applyFilter(e)}},{key:"applyFilter",value:function(e){1===e.length&&""===e[0]&&(e=[]),this.setState(function(){return{isSelected:e.length>0}}),this.props.onFilter(this.props.column,y.FILTER_TYPE.MULTISELECT)(e)}},{key:"filter",value:function(e){var t=v(e.target);this.applyFilter(t)}},{key:"render",value:function(){var e=this,t=this.props,r=t.style,n=t.className,a=t.defaultValue,l=(t.onFilter,t.column),i=(t.options,t.comparator,t.withoutEmptyOption,t.caseSensitive,t.getFilter,o(t,["style","className","defaultValue","onFilter","column","options","comparator","withoutEmptyOption","caseSensitive","getFilter"])),u="filter select-filter form-control "+n+" "+(this.state.isSelected?"":"placeholder-selected");return f.default.createElement("label",{className:"filter-label",htmlFor:"multiselect-filter-column-"+l.text},f.default.createElement("span",{className:"sr-only"},"Filter by ",l.text),f.default.createElement("select",s({},i,{ref:function(t){return e.selectInput=t},id:"multiselect-filter-column-"+l.text,style:r,multiple:!0,className:u,onChange:this.filter,onClick:function(e){return e.stopPropagation()},defaultValue:void 0!==a?a:""}),this.getOptions()))}}]),t}(p.Component);b.propTypes={onFilter:m.default.func.isRequired,column:m.default.object.isRequired,options:m.default.object.isRequired,comparator:m.default.oneOf([h.LIKE,h.EQ]),placeholder:m.default.string,style:m.default.object,className:m.default.string,withoutEmptyOption:m.default.bool,defaultValue:m.default.array,caseSensitive:m.default.bool,getFilter:m.default.func},b.defaultProps={defaultValue:[],className:"",withoutEmptyOption:!1,comparator:h.EQ,caseSensitive:!0},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=n(u),c=r(3),p=n(c),f=r(0),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),m=r(1),h=[d.EQ,d.NE,d.GT,d.GE,d.LT,d.LE],y=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.comparators=e.comparators||h,r.timeout=null;var n=void 0!==e.defaultValue&&void 0!==e.defaultValue.number;return e.options&&n&&(n=e.options.indexOf(e.defaultValue.number)>-1),r.state={isSelected:n},r.onChangeNumber=r.onChangeNumber.bind(r),r.onChangeNumberSet=r.onChangeNumberSet.bind(r),r.onChangeComparator=r.onChangeComparator.bind(r),r}return l(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.column,n=t.onFilter,o=t.getFilter,a=this.numberFilterComparator.value,l=this.numberFilter.value;a&&l&&n(r,m.FILTER_TYPE.NUMBER,!0)({number:l,comparator:a}),o&&o(function(t){e.setState(function(){return{isSelected:""!==t}}),e.numberFilterComparator.value=t.comparator,e.numberFilter.value=t.number,n(r,m.FILTER_TYPE.NUMBER)({number:t.number,comparator:t.comparator})})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"onChangeNumber",value:function(e){var t=this.props,r=t.delay,n=t.column,o=t.onFilter,a=this.numberFilterComparator.value;if(""!==a){this.timeout&&clearTimeout(this.timeout);var l=e.target.value;this.timeout=setTimeout(function(){o(n,m.FILTER_TYPE.NUMBER)({number:l,comparator:a})},r)}}},{key:"onChangeNumberSet",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=this.numberFilterComparator.value,a=e.target.value;this.setState(function(){return{isSelected:""!==a}}),n(r,m.FILTER_TYPE.NUMBER)({number:a,comparator:o})}},{key:"onChangeComparator",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=this.numberFilter.value,a=e.target.value;n(r,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"getComparatorOptions",value:function(){var e=[];this.props.withoutEmptyComparatorOption||e.push(s.default.createElement("option",{key:"-1"}));for(var t=0;t<this.comparators.length;t+=1)e.push(s.default.createElement("option",{key:t,value:this.comparators[t]},this.comparators[t]));return e}},{key:"getNumberOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.column;t.withoutEmptyNumberOption||e.push(s.default.createElement("option",{key:"-1",value:""},this.props.placeholder||"Select "+n.text+"..."));for(var o=0;o<r.length;o+=1)e.push(s.default.createElement("option",{key:o,value:r[o]},r[o]));return e}},{key:"applyFilter",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=e.number,a=e.comparator;this.setState(function(){return{isSelected:""!==o}}),this.numberFilterComparator.value=a,this.numberFilter.value=o,n(r,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"cleanFiltered",value:function(){var e=this.props,t=e.column,r=e.onFilter,n=e.defaultValue,o=n?n.number:"",a=n?n.comparator:"";this.setState(function(){return{isSelected:""!==o}}),this.numberFilterComparator.value=a,this.numberFilter.value=o,r(t,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"render",value:function(){var e=this,t=this.state.isSelected,r=this.props,n=r.defaultValue,o=r.column,a=r.options,l=r.style,i=r.className,u=r.numberStyle,c=r.numberClassName,p=r.comparatorStyle,f=r.comparatorClassName,d=r.placeholder,m="\n select-filter \n number-filter-input \n form-control \n "+c+" \n "+(t?"":"placeholder-selected")+"\n ";return s.default.createElement("div",{onClick:function(e){return e.stopPropagation()},className:"filter number-filter "+i,style:l},s.default.createElement("label",{className:"filter-label",htmlFor:"number-filter-comparator-"+o.text},s.default.createElement("span",{className:"sr-only"},"Filter comparator"),s.default.createElement("select",{ref:function(t){return e.numberFilterComparator=t},style:p,id:"number-filter-comparator-"+o.text,className:"number-filter-comparator form-control "+f,onChange:this.onChangeComparator,defaultValue:n?n.comparator:""},this.getComparatorOptions())),a?s.default.createElement("label",{className:"filter-label",htmlFor:"number-filter-column-"+o.text},s.default.createElement("span",{className:"sr-only"},"Select "+o.text),s.default.createElement("select",{ref:function(t){return e.numberFilter=t},id:"number-filter-column-"+o.text,style:u,className:m,onChange:this.onChangeNumberSet,defaultValue:n?n.number:""},this.getNumberOptions())):s.default.createElement("label",{htmlFor:"number-filter-column-"+o.text},s.default.createElement("span",{className:"sr-only"},"Enter "+o.text),s.default.createElement("input",{ref:function(t){return e.numberFilter=t},id:"number-filter-column-"+o.text,type:"number",style:u,className:"number-filter-input form-control "+c,placeholder:d||"Enter "+o.text+"...",onChange:this.onChangeNumber,defaultValue:n?n.number:""})))}}]),t}(u.Component);y.propTypes={onFilter:p.default.func.isRequired,column:p.default.object.isRequired,options:p.default.arrayOf(p.default.number),defaultValue:p.default.shape({number:p.default.oneOfType([p.default.string,p.default.number]),comparator:p.default.oneOf([].concat(h,[""]))}),delay:p.default.number,comparators:function(e,t){if(e[t])for(var r=0;r<e[t].length;r+=1){for(var n=!1,o=0;o<h.length;o+=1)if(h[o]===e[t][r]||""===e[t][r]){n=!0;break}if(!n)return new Error("Number comparator provided is not supported.\n Use only "+h)}},placeholder:p.default.string,withoutEmptyComparatorOption:p.default.bool,withoutEmptyNumberOption:p.default.bool,style:p.default.object,className:p.default.string,comparatorStyle:p.default.object,comparatorClassName:p.default.string,numberStyle:p.default.object,numberClassName:p.default.string,getFilter:p.default.func},y.defaultProps={delay:m.FILTER_DELAY,options:void 0,defaultValue:{number:void 0,comparator:""},withoutEmptyComparatorOption:!1,withoutEmptyNumberOption:!1,comparators:h,placeholder:void 0,style:void 0,className:"",comparatorStyle:void 0,comparatorClassName:"",numberStyle:void 0,numberClassName:""},t.default=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){return e.getUTCFullYear()+"-"+("0"+(e.getUTCMonth()+1)).slice(-2)+"-"+("0"+e.getUTCDate()).slice(-2)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=r(3),p=r(0),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(p),d=r(1),m=[f.EQ,f.NE,f.GT,f.GE,f.LT,f.LE],h=function(e){function t(e){n(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.timeout=null,r.comparators=e.comparators||m,r.applyFilter=r.applyFilter.bind(r),r.onChangeDate=r.onChangeDate.bind(r),r.onChangeComparator=r.onChangeComparator.bind(r),r}return a(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.getFilter,r=this.dateFilterComparator.value,n=this.inputDate.value;r&&n&&this.applyFilter(n,r,!0),t&&t(function(t){var r=t||{date:null,comparator:null};e.dateFilterComparator.value=r.comparator,e.inputDate.value=r.date?l(r.date):null,e.applyFilter(r.date,r.comparator)})}},{key:"componentWillUnmount",value:function(){this.timeout&&clearTimeout(this.timeout)}},{key:"onChangeDate",value:function(e){var t=this.dateFilterComparator.value,r=e.target.value;this.applyFilter(r,t)}},{key:"onChangeComparator",value:function(e){var t=this.inputDate.value,r=e.target.value;this.applyFilter(t,r)}},{key:"getComparatorOptions",value:function(){var e=[];this.props.withoutEmptyComparatorOption||e.push(s.default.createElement("option",{key:"-1"}));for(var t=0;t<this.comparators.length;t+=1)e.push(s.default.createElement("option",{key:t,value:this.comparators[t]},this.comparators[t]));return e}},{key:"getDefaultDate",value:function(){var e="",t=this.props.defaultValue;return t&&t.date&&(e=l(new Date(t.date))),e}},{key:"applyFilter",value:function(e,t,r){var n=this.props,o=n.column,a=n.onFilter,l=n.delay,i=function(){var n=""===e?null:new Date(e);a(o,d.FILTER_TYPE.DATE,r)({date:n,comparator:t})};l?this.timeout=setTimeout(function(){i()},l):i()}},{key:"render",value:function(){var e=this,t=this.props,r=t.placeholder,n=t.column.text,o=t.style,a=t.comparatorStyle,l=t.dateStyle,i=t.className,u=t.comparatorClassName,c=t.dateClassName,p=t.defaultValue;return s.default.createElement("div",{onClick:function(e){return e.stopPropagation()},className:"filter date-filter "+i,style:o},s.default.createElement("label",{className:"filter-label",htmlFor:"date-filter-comparator-"+n},s.default.createElement("span",{className:"sr-only"},"Filter comparator"),s.default.createElement("select",{ref:function(t){return e.dateFilterComparator=t},id:"date-filter-comparator-"+n,style:a,className:"date-filter-comparator form-control "+u,onChange:this.onChangeComparator,defaultValue:p?p.comparator:""},this.getComparatorOptions())),s.default.createElement("label",{htmlFor:"date-filter-column-"+n},s.default.createElement("span",{className:"sr-only"},"Enter $",n),s.default.createElement("input",{ref:function(t){return e.inputDate=t},id:"date-filter-column-"+n,className:"filter date-filter-input form-control "+c,style:l,type:"date",onChange:this.onChangeDate,placeholder:r||"Enter "+n+"...",defaultValue:this.getDefaultDate()})))}}]),t}(u.Component);h.propTypes={onFilter:c.PropTypes.func.isRequired,column:c.PropTypes.object.isRequired,delay:c.PropTypes.number,defaultValue:c.PropTypes.shape({date:c.PropTypes.oneOfType([c.PropTypes.object]),comparator:c.PropTypes.oneOf([].concat(m,[""]))}),comparators:function(e,t){if(e[t])for(var r=0;r<e[t].length;r+=1){for(var n=!1,o=0;o<m.length;o+=1)if(m[o]===e[t][r]||""===e[t][r]){n=!0;break}if(!n)return new Error("Date comparator provided is not supported.\n Use only "+m)}},placeholder:c.PropTypes.string,withoutEmptyComparatorOption:c.PropTypes.bool,style:c.PropTypes.object,comparatorStyle:c.PropTypes.object,dateStyle:c.PropTypes.object,className:c.PropTypes.string,comparatorClassName:c.PropTypes.string,dateClassName:c.PropTypes.string,getFilter:c.PropTypes.func},h.defaultProps={delay:0,defaultValue:{date:void 0,comparator:""},withoutEmptyComparatorOption:!1,comparators:m,placeholder:void 0,style:void 0,className:"",comparatorStyle:void 0,comparatorClassName:"",dateStyle:void 0,dateClassName:""},t.default=h},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=n(u),c=r(3),p=n(c),f=r(15),d=r(0),m=r(1);t.default=function(e,t,r){var n=s.default.createContext(),u=function(u){function c(e){o(this,c);var t=a(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,e));return t.currFilters={},t.onFilter=t.onFilter.bind(t),t.doFilter=t.doFilter.bind(t),t.onExternalFilter=t.onExternalFilter.bind(t),t.data=e.data,t.isEmitDataChange=!1,t}return l(c,u),i(c,[{key:"componentDidMount",value:function(){t()&&Object.keys(this.currFilters).length>0&&r(this.currFilters)}},{key:"componentWillReceiveProps",value:function(r){t()||e.isEqual(r.data,this.data)?this.data=r.data:this.doFilter(r,void 0,this.isEmitDataChange)}},{key:"onFilter",value:function(n,o){var a=this,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i){var u=Object.assign({},a.currFilters),s=n.dataField,c=n.filter;if(e.isDefined(i)&&""!==i&&0!==i.length){var p=c.props,f=p.comparator,h=void 0===f?o===m.FILTER_TYPE.SELECT?d.EQ:d.LIKE:f,y=p.caseSensitive,v=void 0!==y&&y;u[s]={filterVal:i,filterType:o,comparator:h,caseSensitive:v}}else delete u[s];if(a.currFilters=u,t())return void(l||r(a.currFilters));var b=void 0;c.props.onFilter&&(b=c.props.onFilter(i)),a.doFilter(a.props,b)}}},{key:"onExternalFilter",value:function(e,t){var r=this;return function(n){r.onFilter(e,t)(n)}}},{key:"getFiltered",value:function(){return this.data}},{key:"doFilter",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r,a=t.dataChangeListener,l=t.data,i=t.columns;o=o||(0,f.filters)(l,i,e)(this.currFilters),this.data=o,a&&!n?(this.isEmitDataChange=!0,a.emit("filterChanged",o.length)):(this.isEmitDataChange=!1,this.forceUpdate())}},{key:"render",value:function(){return s.default.createElement(n.Provider,{value:{data:this.data,onFilter:this.onFilter,onExternalFilter:this.onExternalFilter}},this.props.children)}}]),c}(s.default.Component);return u.propTypes={data:p.default.array.isRequired,columns:p.default.array.isRequired,dataChangeListener:p.default.object},{Provider:u,Consumer:n.Consumer}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filters=t.filterFactory=t.filterByArray=t.filterByDate=t.filterByNumber=t.filterByText=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(1),a=r(0),l=t.filterByText=function(e){return function(t,r,n,o){var l=n.filterVal,i=void 0===l?"":l,u=n.comparator,s=void 0===u?a.LIKE:u,c=n.caseSensitive,p=i.toString();return t.filter(function(t){var n=e.get(t,r);o&&(n=o(n,t));var l=e.isDefined(n)?n.toString():"";return s===a.EQ?l===p:c?l.includes(p):-1!==l.toLocaleUpperCase().indexOf(p.toLocaleUpperCase())})}},i=t.filterByNumber=function(e){return function(t,r,n,o){var l=n.filterVal,i=l.comparator,u=l.number;return t.filter(function(t){if(""===u||!i)return!0;var n=!0,l=e.get(t,r);switch(o&&(l=o(l,t)),i){case a.EQ:l!=u&&(n=!1);break;case a.GT:l<=u&&(n=!1);break;case a.GE:l<u&&(n=!1);break;case a.LT:l>=u&&(n=!1);break;case a.LE:l>u&&(n=!1);break;case a.NE:l==u&&(n=!1);break;default:console.error("Number comparator provided is not supported")}return n})}},u=t.filterByDate=function(e){return function(t,r,o,l){var i=o.filterVal,u=i.comparator,s=i.date;if(!s||!u)return t;var c=s.getUTCDate(),p=s.getUTCMonth(),f=s.getUTCFullYear();return t.filter(function(t){var o=!0,i=e.get(t,r);l&&(i=l(i,t)),"object"!==(void 0===i?"undefined":n(i))&&(i=new Date(i));var d=i.getUTCDate(),m=i.getUTCMonth(),h=i.getUTCFullYear();switch(u){case a.EQ:c===d&&p===m&&f===h||(o=!1);break;case a.GT:i<=s&&(o=!1);break;case a.GE:h<f?o=!1:h===f&&m<p?o=!1:h===f&&m===p&&d<c&&(o=!1);break;case a.LT:i>=s&&(o=!1);break;case a.LE:h>f?o=!1:h===f&&m>p?o=!1:h===f&&m===p&&d>c&&(o=!1);break;case a.NE:c===d&&p===m&&f===h&&(o=!1);break;default:console.error("Date comparator provided is not supported")}return o})}},s=t.filterByArray=function(e){return function(t,r,n){var o=n.filterVal,l=n.comparator;if(0===o.length)return t;var i=o.filter(function(t){return e.isDefined(t)}).map(function(e){return e.toString()});return t.filter(function(t){var n=e.get(t,r),o=e.isDefined(n)?n.toString():"";return l===a.EQ?-1!==i.indexOf(o):(o=o.toLocaleUpperCase(),i.some(function(e){return-1!==o.indexOf(e.toLocaleUpperCase())}))})}},c=t.filterFactory=function(e){return function(t){var r=void 0;switch(t){case o.FILTER_TYPE.TEXT:case o.FILTER_TYPE.SELECT:r=l(e);break;case o.FILTER_TYPE.MULTISELECT:r=s(e);break;case o.FILTER_TYPE.NUMBER:r=i(e);break;case o.FILTER_TYPE.DATE:r=u(e);break;default:r=l(e)}return r}};t.filters=function(e,t,r){return function(n){var o=c(r),a=e,l=void 0;return Object.keys(n).forEach(function(e){var r=n[e];l=o(r.filterType);for(var i=void 0,u=0;u<t.length;u+=1)if(t[u].dataField===e){i=t[u].filterValue;break}a=l(a,e,r,i)}),a}}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactBootstrapTable2Filter=t(require("react")):e.ReactBootstrapTable2Filter=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LIKE="LIKE",t.EQ="=",t.NE="!=",t.GT=">",t.GE=">=",t.LT="<",t.LE="<="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILTER_TYPE={TEXT:"TEXT",SELECT:"SELECT",MULTISELECT:"MULTISELECT",NUMBER:"NUMBER",DATE:"DATE"},t.FILTER_DELAY=500},function(t,r){t.exports=e},function(e,t,r){e.exports=r(6)()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.customFilter=t.dateFilter=t.numberFilter=t.multiSelectFilter=t.selectFilter=t.textFilter=t.Comparator=t.FILTER_TYPES=void 0;var o=r(5),a=n(o),l=r(10),i=n(l),u=r(11),s=n(u),c=r(12),p=n(c),f=r(13),d=n(f),m=r(14),h=n(m),y=r(0),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(y),b=r(1);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{createContext:h.default,options:e}};t.FILTER_TYPES=b.FILTER_TYPE,t.Comparator=v,t.textFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:a.default,props:e}},t.selectFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:i.default,props:e}},t.multiSelectFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:s.default,props:e}},t.numberFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:p.default,props:e}},t.dateFilter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{Filter:d.default,props:e}},t.customFilter=function(){return{props:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}},function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(2),c=function(e){return e&&e.__esModule?e:{default:e}}(s),p=r(3),f=r(0),d=r(1),m=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.filter=r.filter.bind(r),r.handleClick=r.handleClick.bind(r),r.timeout=null,r.state={value:e.defaultValue},r}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.onFilter,n=t.getFilter,o=t.column,a=this.input.value;a&&r(this.props.column,d.FILTER_TYPE.TEXT,!0)(a),n&&n(function(t){e.setState(function(){return{value:t}}),r(o,d.FILTER_TYPE.TEXT)(t)})}},{key:"componentWillReceiveProps",value:function(e){e.defaultValue!==this.props.defaultValue&&this.applyFilter(e.defaultValue)}},{key:"componentWillUnmount",value:function(){this.cleanTimer()}},{key:"filter",value:function(e){var t=this;e.stopPropagation(),this.cleanTimer();var r=e.target.value;this.setState(function(){return{value:r}}),this.timeout=setTimeout(function(){t.props.onFilter(t.props.column,d.FILTER_TYPE.TEXT)(r)},this.props.delay)}},{key:"cleanTimer",value:function(){this.timeout&&clearTimeout(this.timeout)}},{key:"cleanFiltered",value:function(){var e=this.props.defaultValue;this.setState(function(){return{value:e}}),this.props.onFilter(this.props.column,d.FILTER_TYPE.TEXT)(e)}},{key:"applyFilter",value:function(e){this.setState(function(){return{value:e}}),this.props.onFilter(this.props.column,d.FILTER_TYPE.TEXT)(e)}},{key:"handleClick",value:function(e){e.stopPropagation(),this.props.onClick&&this.props.onClick(e)}},{key:"render",value:function(){var e=this,t=this.props,r=t.placeholder,o=t.column.text,a=t.style,l=t.className,u=(t.onFilter,t.caseSensitive,t.defaultValue,t.getFilter,n(t,["placeholder","column","style","className","onFilter","caseSensitive","defaultValue","getFilter"]));return c.default.createElement("label",{className:"filter-label",htmlFor:"text-filter-column-"+o},c.default.createElement("span",{className:"sr-only"},"Filter by ",o),c.default.createElement("input",i({},u,{ref:function(t){return e.input=t},type:"text",id:"text-filter-column-"+o,className:"filter text-filter form-control "+l,style:a,onChange:this.filter,onClick:this.handleClick,placeholder:r||"Enter "+o+"...",value:this.state.value})))}}]),t}(s.Component);m.propTypes={onFilter:p.PropTypes.func.isRequired,column:p.PropTypes.object.isRequired,comparator:p.PropTypes.oneOf([f.LIKE,f.EQ]),defaultValue:p.PropTypes.string,delay:p.PropTypes.number,placeholder:p.PropTypes.string,style:p.PropTypes.object,className:p.PropTypes.string,caseSensitive:p.PropTypes.bool,getFilter:p.PropTypes.func},m.defaultProps={delay:d.FILTER_DELAY,defaultValue:"",caseSensitive:!1},t.default=m},function(e,t,r){"use strict";var n=r(7),o=r(8),a=r(9);e.exports=function(){function e(e,t,r,n,l,i){i!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n,a,l,i,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,l,i,u],p=0;s=new Error(t.replace(/%s/g,function(){return c[p++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){if(Array.isArray(e)){if(e.length===t.length){for(var r=0;r<e.length;r+=1)if(e[r].value!==t[r].value||e[r].label!==t[r].label)return!1;return!0}return!1}for(var n=Object.keys(e),o=0;o<n.length;o+=1)if(e[n[o]]!==t[n[o]])return!1;return Object.keys(e).length===Object.keys(t).length}function s(e,t){if(Array.isArray(e)){return e.filter(function(e){return e.label===t}).map(function(e){return e.value})[0]}return e[t]}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(2),d=n(f),m=r(3),h=n(m),y=r(0),v=r(1),b=function(e){function t(e){a(this,t);var r=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.filter=r.filter.bind(r);var n=void 0!==s(e.options,e.defaultValue);return r.state={isSelected:n},r}return i(t,e),p(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.column,n=t.onFilter,o=t.getFilter,a=this.selectInput.value;a&&""!==a&&n(r,v.FILTER_TYPE.SELECT,!0)(a),o&&o(function(t){e.setState(function(){return{isSelected:""!==t}}),e.selectInput.value=t,n(r,v.FILTER_TYPE.SELECT)(t)})}},{key:"componentDidUpdate",value:function(e){var t=!1;if(this.props.defaultValue!==e.defaultValue?t=!0:u(this.props.options,e.options)||(t=!0),t){var r=this.selectInput.value;r&&this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(r)}}},{key:"getOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.placeholder,o=t.column;return t.withoutEmptyOption||e.push(d.default.createElement("option",{key:"-1",value:""},n||"Select "+o.text+"...")),Array.isArray(r)?r.forEach(function(t){var r=t.value,n=t.label;return e.push(d.default.createElement("option",{key:r,value:r},n))}):Object.keys(r).forEach(function(t){return e.push(d.default.createElement("option",{key:t,value:t},r[t]))}),e}},{key:"cleanFiltered",value:function(){var e=void 0!==this.props.defaultValue?this.props.defaultValue:"";this.setState(function(){return{isSelected:""!==e}}),this.selectInput.value=e,this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(e)}},{key:"applyFilter",value:function(e){this.selectInput.value=e,this.setState(function(){return{isSelected:""!==e}}),this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(e)}},{key:"filter",value:function(e){var t=e.target.value;this.setState(function(){return{isSelected:""!==t}}),this.props.onFilter(this.props.column,v.FILTER_TYPE.SELECT)(t)}},{key:"render",value:function(){var e=this,t=this.props,r=t.style,n=t.className,a=t.defaultValue,l=(t.onFilter,t.column),i=(t.options,t.comparator,t.withoutEmptyOption,t.caseSensitive,t.getFilter,o(t,["style","className","defaultValue","onFilter","column","options","comparator","withoutEmptyOption","caseSensitive","getFilter"])),u="filter select-filter form-control "+n+" "+(this.state.isSelected?"":"placeholder-selected");return d.default.createElement("label",{className:"filter-label",htmlFor:"select-filter-column-"+l.text},d.default.createElement("span",{className:"sr-only"},"Filter by ",l.text),d.default.createElement("select",c({},i,{ref:function(t){return e.selectInput=t},id:"select-filter-column-"+l.text,style:r,className:u,onChange:this.filter,onClick:function(e){return e.stopPropagation()},defaultValue:void 0!==a?a:""}),this.getOptions()))}}]),t}(f.Component);b.propTypes={onFilter:h.default.func.isRequired,column:h.default.object.isRequired,options:h.default.oneOfType([h.default.object,h.default.array]).isRequired,comparator:h.default.oneOf([y.LIKE,y.EQ]),placeholder:h.default.string,style:h.default.object,className:h.default.string,withoutEmptyOption:h.default.bool,defaultValue:h.default.any,caseSensitive:h.default.bool,getFilter:h.default.func},b.defaultProps={defaultValue:"",className:"",withoutEmptyOption:!1,comparator:y.EQ,caseSensitive:!0},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){for(var r=Object.keys(e),n=0;n<r.length;n+=1)if(e[r[n]]!==t[r[n]])return!1;return Object.keys(e).length===Object.keys(t).length}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),p=r(2),f=n(p),d=r(3),m=n(d),h=r(0),y=r(1),v=function(e){if(e.selectedOptions)return Array.from(e.selectedOptions).map(function(e){return e.value});for(var t=[],r=e.options.length,n=0;n<r;n+=1){var o=e.options.item(n);o.selected&&t.push(o.value)}return t},b=function(e){function t(e){a(this,t);var r=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.filter=r.filter.bind(r),r.applyFilter=r.applyFilter.bind(r);var n=e.defaultValue.map(function(t){return e.options[t]}).length>0;return r.state={isSelected:n},r}return i(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.getFilter,r=v(this.selectInput);r&&r.length>0&&this.applyFilter(r),t&&t(function(t){e.selectInput.value=t,e.applyFilter(t)})}},{key:"componentDidUpdate",value:function(e){var t=!1;this.props.defaultValue!==e.defaultValue?t=!0:u(this.props.options,e.options)||(t=!0),t&&this.applyFilter(this.selectInput.value)}},{key:"getOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.placeholder,o=t.column;return t.withoutEmptyOption||e.push(f.default.createElement("option",{key:"-1",value:""},n||"Select "+o.text+"...")),Object.keys(r).forEach(function(t){return e.push(f.default.createElement("option",{key:t,value:t},r[t]))}),e}},{key:"cleanFiltered",value:function(){var e=void 0!==this.props.defaultValue?this.props.defaultValue:[];this.selectInput.value=e,this.applyFilter(e)}},{key:"applyFilter",value:function(e){1===e.length&&""===e[0]&&(e=[]),this.setState(function(){return{isSelected:e.length>0}}),this.props.onFilter(this.props.column,y.FILTER_TYPE.MULTISELECT)(e)}},{key:"filter",value:function(e){var t=v(e.target);this.applyFilter(t)}},{key:"render",value:function(){var e=this,t=this.props,r=t.style,n=t.className,a=t.defaultValue,l=(t.onFilter,t.column),i=(t.options,t.comparator,t.withoutEmptyOption,t.caseSensitive,t.getFilter,o(t,["style","className","defaultValue","onFilter","column","options","comparator","withoutEmptyOption","caseSensitive","getFilter"])),u="filter select-filter form-control "+n+" "+(this.state.isSelected?"":"placeholder-selected");return f.default.createElement("label",{className:"filter-label",htmlFor:"multiselect-filter-column-"+l.text},f.default.createElement("span",{className:"sr-only"},"Filter by ",l.text),f.default.createElement("select",s({},i,{ref:function(t){return e.selectInput=t},id:"multiselect-filter-column-"+l.text,style:r,multiple:!0,className:u,onChange:this.filter,onClick:function(e){return e.stopPropagation()},defaultValue:void 0!==a?a:""}),this.getOptions()))}}]),t}(p.Component);b.propTypes={onFilter:m.default.func.isRequired,column:m.default.object.isRequired,options:m.default.object.isRequired,comparator:m.default.oneOf([h.LIKE,h.EQ]),placeholder:m.default.string,style:m.default.object,className:m.default.string,withoutEmptyOption:m.default.bool,defaultValue:m.default.array,caseSensitive:m.default.bool,getFilter:m.default.func},b.defaultProps={defaultValue:[],className:"",withoutEmptyOption:!1,comparator:h.EQ,caseSensitive:!0},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=n(u),c=r(3),p=n(c),f=r(0),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(f),m=r(1),h=[d.EQ,d.NE,d.GT,d.GE,d.LT,d.LE],y=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.comparators=e.comparators||h,r.timeout=null;var n=void 0!==e.defaultValue&&void 0!==e.defaultValue.number;return e.options&&n&&(n=e.options.indexOf(e.defaultValue.number)>-1),r.state={isSelected:n},r.onChangeNumber=r.onChangeNumber.bind(r),r.onChangeNumberSet=r.onChangeNumberSet.bind(r),r.onChangeComparator=r.onChangeComparator.bind(r),r}return l(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,r=t.column,n=t.onFilter,o=t.getFilter,a=this.numberFilterComparator.value,l=this.numberFilter.value;a&&l&&n(r,m.FILTER_TYPE.NUMBER,!0)({number:l,comparator:a}),o&&o(function(t){e.setState(function(){return{isSelected:""!==t}}),e.numberFilterComparator.value=t.comparator,e.numberFilter.value=t.number,n(r,m.FILTER_TYPE.NUMBER)({number:t.number,comparator:t.comparator})})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"onChangeNumber",value:function(e){var t=this.props,r=t.delay,n=t.column,o=t.onFilter,a=this.numberFilterComparator.value;if(""!==a){this.timeout&&clearTimeout(this.timeout);var l=e.target.value;this.timeout=setTimeout(function(){o(n,m.FILTER_TYPE.NUMBER)({number:l,comparator:a})},r)}}},{key:"onChangeNumberSet",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=this.numberFilterComparator.value,a=e.target.value;this.setState(function(){return{isSelected:""!==a}}),n(r,m.FILTER_TYPE.NUMBER)({number:a,comparator:o})}},{key:"onChangeComparator",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=this.numberFilter.value,a=e.target.value;n(r,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"getComparatorOptions",value:function(){var e=[];this.props.withoutEmptyComparatorOption||e.push(s.default.createElement("option",{key:"-1"}));for(var t=0;t<this.comparators.length;t+=1)e.push(s.default.createElement("option",{key:t,value:this.comparators[t]},this.comparators[t]));return e}},{key:"getNumberOptions",value:function(){var e=[],t=this.props,r=t.options,n=t.column;t.withoutEmptyNumberOption||e.push(s.default.createElement("option",{key:"-1",value:""},this.props.placeholder||"Select "+n.text+"..."));for(var o=0;o<r.length;o+=1)e.push(s.default.createElement("option",{key:o,value:r[o]},r[o]));return e}},{key:"applyFilter",value:function(e){var t=this.props,r=t.column,n=t.onFilter,o=e.number,a=e.comparator;this.setState(function(){return{isSelected:""!==o}}),this.numberFilterComparator.value=a,this.numberFilter.value=o,n(r,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"cleanFiltered",value:function(){var e=this.props,t=e.column,r=e.onFilter,n=e.defaultValue,o=n?n.number:"",a=n?n.comparator:"";this.setState(function(){return{isSelected:""!==o}}),this.numberFilterComparator.value=a,this.numberFilter.value=o,r(t,m.FILTER_TYPE.NUMBER)({number:o,comparator:a})}},{key:"render",value:function(){var e=this,t=this.state.isSelected,r=this.props,n=r.defaultValue,o=r.column,a=r.options,l=r.style,i=r.className,u=r.numberStyle,c=r.numberClassName,p=r.comparatorStyle,f=r.comparatorClassName,d=r.placeholder,m="\n select-filter \n number-filter-input \n form-control \n "+c+" \n "+(t?"":"placeholder-selected")+"\n ";return s.default.createElement("div",{onClick:function(e){return e.stopPropagation()},className:"filter number-filter "+i,style:l},s.default.createElement("label",{className:"filter-label",htmlFor:"number-filter-comparator-"+o.text},s.default.createElement("span",{className:"sr-only"},"Filter comparator"),s.default.createElement("select",{ref:function(t){return e.numberFilterComparator=t},style:p,id:"number-filter-comparator-"+o.text,className:"number-filter-comparator form-control "+f,onChange:this.onChangeComparator,defaultValue:n?n.comparator:""},this.getComparatorOptions())),a?s.default.createElement("label",{className:"filter-label",htmlFor:"number-filter-column-"+o.text},s.default.createElement("span",{className:"sr-only"},"Select "+o.text),s.default.createElement("select",{ref:function(t){return e.numberFilter=t},id:"number-filter-column-"+o.text,style:u,className:m,onChange:this.onChangeNumberSet,defaultValue:n?n.number:""},this.getNumberOptions())):s.default.createElement("label",{htmlFor:"number-filter-column-"+o.text},s.default.createElement("span",{className:"sr-only"},"Enter "+o.text),s.default.createElement("input",{ref:function(t){return e.numberFilter=t},id:"number-filter-column-"+o.text,type:"number",style:u,className:"number-filter-input form-control "+c,placeholder:d||"Enter "+o.text+"...",onChange:this.onChangeNumber,defaultValue:n?n.number:""})))}}]),t}(u.Component);y.propTypes={onFilter:p.default.func.isRequired,column:p.default.object.isRequired,options:p.default.arrayOf(p.default.number),defaultValue:p.default.shape({number:p.default.oneOfType([p.default.string,p.default.number]),comparator:p.default.oneOf([].concat(h,[""]))}),delay:p.default.number,comparators:function(e,t){if(e[t])for(var r=0;r<e[t].length;r+=1){for(var n=!1,o=0;o<h.length;o+=1)if(h[o]===e[t][r]||""===e[t][r]){n=!0;break}if(!n)return new Error("Number comparator provided is not supported.\n Use only "+h)}},placeholder:p.default.string,withoutEmptyComparatorOption:p.default.bool,withoutEmptyNumberOption:p.default.bool,style:p.default.object,className:p.default.string,comparatorStyle:p.default.object,comparatorClassName:p.default.string,numberStyle:p.default.object,numberClassName:p.default.string,getFilter:p.default.func},y.defaultProps={delay:m.FILTER_DELAY,options:void 0,defaultValue:{number:void 0,comparator:""},withoutEmptyComparatorOption:!1,withoutEmptyNumberOption:!1,comparators:h,placeholder:void 0,style:void 0,className:"",comparatorStyle:void 0,comparatorClassName:"",numberStyle:void 0,numberClassName:""},t.default=y},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){return e.getUTCFullYear()+"-"+("0"+(e.getUTCMonth()+1)).slice(-2)+"-"+("0"+e.getUTCDate()).slice(-2)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=r(3),p=r(0),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(p),d=r(1),m=[f.EQ,f.NE,f.GT,f.GE,f.LT,f.LE],h=function(e){function t(e){n(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.timeout=null,r.comparators=e.comparators||m,r.applyFilter=r.applyFilter.bind(r),r.onChangeDate=r.onChangeDate.bind(r),r.onChangeComparator=r.onChangeComparator.bind(r),r}return a(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props.getFilter,r=this.dateFilterComparator.value,n=this.inputDate.value;r&&n&&this.applyFilter(n,r,!0),t&&t(function(t){var r=t||{date:null,comparator:null};e.dateFilterComparator.value=r.comparator,e.inputDate.value=r.date?l(r.date):null,e.applyFilter(r.date,r.comparator)})}},{key:"componentWillUnmount",value:function(){this.timeout&&clearTimeout(this.timeout)}},{key:"onChangeDate",value:function(e){var t=this.dateFilterComparator.value,r=e.target.value;this.applyFilter(r,t)}},{key:"onChangeComparator",value:function(e){var t=this.inputDate.value,r=e.target.value;this.applyFilter(t,r)}},{key:"getComparatorOptions",value:function(){var e=[];this.props.withoutEmptyComparatorOption||e.push(s.default.createElement("option",{key:"-1"}));for(var t=0;t<this.comparators.length;t+=1)e.push(s.default.createElement("option",{key:t,value:this.comparators[t]},this.comparators[t]));return e}},{key:"getDefaultDate",value:function(){var e="",t=this.props.defaultValue;return t&&t.date&&(e=l(new Date(t.date))),e}},{key:"applyFilter",value:function(e,t,r){var n=this.props,o=n.column,a=n.onFilter,l=n.delay,i=function(){var n=""===e?null:new Date(e);a(o,d.FILTER_TYPE.DATE,r)({date:n,comparator:t})};l?this.timeout=setTimeout(function(){i()},l):i()}},{key:"render",value:function(){var e=this,t=this.props,r=t.placeholder,n=t.column.text,o=t.style,a=t.comparatorStyle,l=t.dateStyle,i=t.className,u=t.comparatorClassName,c=t.dateClassName,p=t.defaultValue;return s.default.createElement("div",{onClick:function(e){return e.stopPropagation()},className:"filter date-filter "+i,style:o},s.default.createElement("label",{className:"filter-label",htmlFor:"date-filter-comparator-"+n},s.default.createElement("span",{className:"sr-only"},"Filter comparator"),s.default.createElement("select",{ref:function(t){return e.dateFilterComparator=t},id:"date-filter-comparator-"+n,style:a,className:"date-filter-comparator form-control "+u,onChange:this.onChangeComparator,defaultValue:p?p.comparator:""},this.getComparatorOptions())),s.default.createElement("label",{htmlFor:"date-filter-column-"+n},s.default.createElement("span",{className:"sr-only"},"Enter $",n),s.default.createElement("input",{ref:function(t){return e.inputDate=t},id:"date-filter-column-"+n,className:"filter date-filter-input form-control "+c,style:l,type:"date",onChange:this.onChangeDate,placeholder:r||"Enter "+n+"...",defaultValue:this.getDefaultDate()})))}}]),t}(u.Component);h.propTypes={onFilter:c.PropTypes.func.isRequired,column:c.PropTypes.object.isRequired,delay:c.PropTypes.number,defaultValue:c.PropTypes.shape({date:c.PropTypes.oneOfType([c.PropTypes.object]),comparator:c.PropTypes.oneOf([].concat(m,[""]))}),comparators:function(e,t){if(e[t])for(var r=0;r<e[t].length;r+=1){for(var n=!1,o=0;o<m.length;o+=1)if(m[o]===e[t][r]||""===e[t][r]){n=!0;break}if(!n)return new Error("Date comparator provided is not supported.\n Use only "+m)}},placeholder:c.PropTypes.string,withoutEmptyComparatorOption:c.PropTypes.bool,style:c.PropTypes.object,comparatorStyle:c.PropTypes.object,dateStyle:c.PropTypes.object,className:c.PropTypes.string,comparatorClassName:c.PropTypes.string,dateClassName:c.PropTypes.string,getFilter:c.PropTypes.func},h.defaultProps={delay:0,defaultValue:{date:void 0,comparator:""},withoutEmptyComparatorOption:!1,comparators:m,placeholder:void 0,style:void 0,className:"",comparatorStyle:void 0,comparatorClassName:"",dateStyle:void 0,dateClassName:""},t.default=h},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),s=n(u),c=r(3),p=n(c),f=r(15),d=r(0),m=r(1);t.default=function(e,t,r){var n=s.default.createContext(),u=function(u){function c(e){o(this,c);var t=a(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,e));return t.currFilters={},t.onFilter=t.onFilter.bind(t),t.doFilter=t.doFilter.bind(t),t.onExternalFilter=t.onExternalFilter.bind(t),t.data=e.data,t.isEmitDataChange=!1,t}return l(c,u),i(c,[{key:"componentDidMount",value:function(){t()&&Object.keys(this.currFilters).length>0&&r(this.currFilters)}},{key:"componentWillReceiveProps",value:function(r){t()||e.isEqual(r.data,this.data)?this.data=r.data:this.doFilter(r,void 0,this.isEmitDataChange)}},{key:"onFilter",value:function(n,o){var a=this,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i){var u=Object.assign({},a.currFilters),s=n.dataField,c=n.filter;if(e.isDefined(i)&&""!==i&&0!==i.length){var p=c.props,f=p.comparator,h=void 0===f?o===m.FILTER_TYPE.SELECT?d.EQ:d.LIKE:f,y=p.caseSensitive,v=void 0!==y&&y;u[s]={filterVal:i,filterType:o,comparator:h,caseSensitive:v}}else delete u[s];if(a.currFilters=u,t())return void(l||r(a.currFilters));var b=void 0;c.props.onFilter&&(b=c.props.onFilter(i)),a.doFilter(a.props,b)}}},{key:"onExternalFilter",value:function(e,t){var r=this;return function(n){r.onFilter(e,t)(n)}}},{key:"getFiltered",value:function(){return this.data}},{key:"doFilter",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r,a=t.dataChangeListener,l=t.data,i=t.columns;o=o||(0,f.filters)(l,i,e)(this.currFilters),this.data=o,a&&!n?(this.isEmitDataChange=!0,a.emit("filterChanged",o.length)):(this.isEmitDataChange=!1,this.forceUpdate())}},{key:"render",value:function(){return s.default.createElement(n.Provider,{value:{data:this.data,onFilter:this.onFilter,onExternalFilter:this.onExternalFilter}},this.props.children)}}]),c}(s.default.Component);return u.propTypes={data:p.default.array.isRequired,columns:p.default.array.isRequired,dataChangeListener:p.default.object},{Provider:u,Consumer:n.Consumer}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filters=t.filterFactory=t.filterByArray=t.filterByDate=t.filterByNumber=t.filterByText=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(1),a=r(0),l=t.filterByText=function(e){return function(t,r,n,o){var l=n.filterVal,i=void 0===l?"":l,u=n.comparator,s=void 0===u?a.LIKE:u,c=n.caseSensitive,p=i.toString();return t.filter(function(t){var n=e.get(t,r);o&&(n=o(n,t));var l=e.isDefined(n)?n.toString():"";return s===a.EQ?l===p:c?l.includes(p):-1!==l.toLocaleUpperCase().indexOf(p.toLocaleUpperCase())})}},i=t.filterByNumber=function(e){return function(t,r,n,o){var l=n.filterVal,i=l.comparator,u=l.number;return t.filter(function(t){if(""===u||!i)return!0;var n=!0,l=e.get(t,r);switch(o&&(l=o(l,t)),i){case a.EQ:l!=u&&(n=!1);break;case a.GT:l<=u&&(n=!1);break;case a.GE:l<u&&(n=!1);break;case a.LT:l>=u&&(n=!1);break;case a.LE:l>u&&(n=!1);break;case a.NE:l==u&&(n=!1);break;default:console.error("Number comparator provided is not supported")}return n})}},u=t.filterByDate=function(e){return function(t,r,o,l){var i=o.filterVal,u=i.comparator,s=i.date;if(!s||!u)return t;var c=s.getUTCDate(),p=s.getUTCMonth(),f=s.getUTCFullYear();return t.filter(function(t){var o=!0,i=e.get(t,r);l&&(i=l(i,t)),"object"!==(void 0===i?"undefined":n(i))&&(i=new Date(i));var d=i.getUTCDate(),m=i.getUTCMonth(),h=i.getUTCFullYear();switch(u){case a.EQ:c===d&&p===m&&f===h||(o=!1);break;case a.GT:i<=s&&(o=!1);break;case a.GE:h<f?o=!1:h===f&&m<p?o=!1:h===f&&m===p&&d<c&&(o=!1);break;case a.LT:i>=s&&(o=!1);break;case a.LE:h>f?o=!1:h===f&&m>p?o=!1:h===f&&m===p&&d>c&&(o=!1);break;case a.NE:c===d&&p===m&&f===h&&(o=!1);break;default:console.error("Date comparator provided is not supported")}return o})}},s=t.filterByArray=function(e){return function(t,r,n){var o=n.filterVal,l=n.comparator;if(0===o.length)return t;var i=o.filter(function(t){return e.isDefined(t)}).map(function(e){return e.toString()});return t.filter(function(t){var n=e.get(t,r),o=e.isDefined(n)?n.toString():"";return l===a.EQ?-1!==i.indexOf(o):(o=o.toLocaleUpperCase(),i.some(function(e){return-1!==o.indexOf(e.toLocaleUpperCase())}))})}},c=t.filterFactory=function(e){return function(t){var r=void 0;switch(t){case o.FILTER_TYPE.TEXT:case o.FILTER_TYPE.SELECT:r=l(e);break;case o.FILTER_TYPE.MULTISELECT:r=s(e);break;case o.FILTER_TYPE.NUMBER:r=i(e);break;case o.FILTER_TYPE.DATE:r=u(e);break;default:r=l(e)}return r}};t.filters=function(e,t,r){return function(n){var o=c(r),a=e,l=void 0;return Object.keys(n).forEach(function(e){var r=n[e];l=o(r.filterType);for(var i=void 0,u=0;u<t.length;u+=1)if(t[u].dataField===e){i=t[u].filterValue;break}a=l(a,e,r,i)}),a}}}])});

@@ -48,5 +48,14 @@ 'use strict';

var getSelections = function getSelections(container) {
return Array.from(container.selectedOptions).map(function (item) {
return item.value;
});
if (container.selectedOptions) {
return Array.from(container.selectedOptions).map(function (item) {
return item.value;
});
}
var selections = [];
var totalLen = container.options.length;
for (var i = 0; i < totalLen; i += 1) {
var option = container.options.item(i);
if (option.selected) selections.push(option.value);
}
return selections;
};

@@ -53,0 +62,0 @@

{
"name": "react-bootstrap-table2-filter",
"version": "1.1.9",
"version": "1.1.10",
"description": "it's a column filter addon for react-bootstrap-table2",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc