react-checkbox-tree
Advanced tools
Comparing version 1.2.4 to 1.3.0
# CHANGELOG | ||
## [v1.3.0](https://github.com/jakezatecky/react-checkbox-tree/compare/v1.2.4...v1.3.0) (2018-09-05) | ||
### New Features | ||
* [#79]: Add `showExpandAll` property to give the user the ability to expand or collapse all nodes in the tree | ||
* [#96]: Add TypeScript definitions | ||
* [#102]: Add `icons` property to allow specification of icon components | ||
* [#103]: Add `title` node property and `showNodeTitle` tree property | ||
* [#108]: Add `lang` property for language customization | ||
### Bug Fixes | ||
* [#61]: Fix issue where disabled children would be checked if a parent node was checked | ||
### Other | ||
* [#91]: Prevent disconnection between Sass and Less files on build | ||
* [#97]: Some performance optimizations | ||
## [v1.2.4](https://github.com/jakezatecky/react-checkbox-tree/compare/v1.2.3...v1.2.4) (2018-08-29) | ||
@@ -4,0 +23,0 @@ |
@@ -9,2 +9,5 @@ const gulp = require('gulp'); | ||
const sass = require('gulp-sass'); | ||
const less = require('gulp-less'); | ||
const minify = require('gulp-clean-css'); | ||
const run = require('gulp-run'); | ||
const autoprefixer = require('gulp-autoprefixer'); | ||
@@ -20,3 +23,3 @@ const browserSync = require('browser-sync').create(); | ||
gulp.src([ | ||
'./examples/src/**.js', | ||
'./examples/src/**/*.js', | ||
'./src/**/*.js', | ||
@@ -50,3 +53,3 @@ './test/**/*.js', | ||
gulp.task('build-script-web', ['test'], () => ( | ||
gulp.task('build-script-web', ['build-script'], () => ( | ||
gulp.src(['./src/index.js']) | ||
@@ -69,6 +72,22 @@ .pipe(webpackStream(webpackConfig('web'), webpack)) | ||
.pipe(gulp.dest('./lib')) | ||
.pipe(minify()) | ||
.pipe(gulp.dest('./.css-compare/scss')) | ||
)); | ||
gulp.task('build', ['build-script', 'build-script-web', 'build-style']); | ||
gulp.task('build-style-less', () => ( | ||
gulp.src('./src/less/**/*.less') | ||
.pipe(less()) | ||
.pipe(autoprefixer({ | ||
browsers: ['last 2 versions'], | ||
})) | ||
.pipe(minify()) | ||
.pipe(gulp.dest('./.css-compare/less')) | ||
)); | ||
gulp.task('compare-css-output', ['build-style', 'build-style-less'], () => ( | ||
run('cmp .css-compare/less/react-checkbox-tree.css .css-compare/scss/react-checkbox-tree.css').exec() | ||
)); | ||
gulp.task('build', ['build-script-web', 'compare-css-output']); | ||
gulp.task('build-examples-style', () => ( | ||
@@ -75,0 +94,0 @@ gulp.src('./examples/src/scss/**/*.scss') |
@@ -1,3 +0,3 @@ | ||
/*! react-checkbox-tree - v1.2.4 | 2018 */ | ||
!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.ReactCheckboxTree=t(require("react")):e.ReactCheckboxTree=t(e.React)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){e.exports=n(96)()},function(t,n){t.exports=e},function(e,t,n){var r=n(16),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){var r=n(41),o=n(47);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(31),o=n(32),i=n(33),c=n(34),a=n(35);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=c,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(14);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(12),o=n(43),i=n(44),c="[object Null]",a="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?a:c:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(3)(Object,"create");e.exports=r},function(e,t,n){var r=n(56);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r; | ||
/*! react-checkbox-tree - v1.3.0 | 2018 */ | ||
!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.ReactCheckboxTree=t(require("react")):e.ReactCheckboxTree=t(e.React)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){e.exports=n(96)()},function(t,n){t.exports=e},function(e,t,n){var r=n(16),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){var r=n(41),o=n(47);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(31),o=n(32),a=n(33),i=n(34),c=n(35);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(14);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(12),o=n(43),a=n(44),i="[object Null]",c="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?c:i:u&&u in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(3)(Object,"create");e.exports=r},function(e,t,n){var r=n(56);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r; | ||
/*! | ||
@@ -13,2 +13,2 @@ Copyright (c) 2017 Jed Watson. | ||
*/ | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&e.push(c)}else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(6),o=n(17),i="[object AsyncFunction]",c="[object Function]",a="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==c||t==a||t==i||t==u}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(42))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(48),o=n(55),i=n(57),c=n(58),a=n(59);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=c,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(60),o=n(63),i=n(64),c=1,a=2;e.exports=function(e,t,n,u,s,l){var p=n&c,f=e.length,d=t.length;if(f!=d&&!(p&&d>f))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var b=-1,y=!0,v=n&a?new r:void 0;for(l.set(e,t),l.set(t,e);++b<f;){var x=e[b],m=t[b];if(u)var k=p?u(m,x,b,t,e,l):u(x,m,b,e,t,l);if(void 0!==k){if(k)continue;y=!1;break}if(v){if(!o(t,function(e,t){if(!i(v,t)&&(x===e||s(x,e,n,u,l)))return v.push(t)})){y=!1;break}}else if(x!==m&&!s(x,m,n,u,l)){y=!1;break}}return l.delete(e),l.delete(t),y}},function(e,t,n){(function(e){var r=n(2),o=n(81),i="object"==typeof t&&t&&!t.nodeType&&t,c=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=c&&c.exports===i?r.Buffer:void 0,u=(a?a.isBuffer:void 0)||o;e.exports=u}).call(this,n(22)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(83),o=n(84),i=n(85),c=i&&i.isTypedArray,a=c?o(c):r;e.exports=a},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(28);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=self.crypto||self.msCrypto;e.exports=function(e){e=e||21;for(var t="",n=r.getRandomValues(new Uint8Array(e));0<e--;)t+="_~getRandomVcryp0123456789bfhijklqsuvwxzABCDEFGHIJKLMNOPQSTUWXYZ"[63&n[e]];return t}},function(e,t,n){e.exports=n(98).default},function(e,t,n){var r=n(29),o=n(9);e.exports=function e(t,n,i,c,a){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,c,e,a))}},function(e,t,n){var r=n(30),o=n(20),i=n(65),c=n(69),a=n(91),u=n(13),s=n(21),l=n(23),p=1,f="[object Arguments]",d="[object Array]",h="[object Object]",b=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,x){var m=u(e),k=u(t),_=m?d:a(e),g=k?d:a(t),j=(_=_==f?h:_)==h,O=(g=g==f?h:g)==h,C=_==g;if(C&&s(e)){if(!s(t))return!1;m=!0,j=!1}if(C&&!j)return x||(x=new r),m||l(e)?o(e,t,n,y,v,x):i(e,t,_,n,y,v,x);if(!(n&p)){var w=j&&b.call(e,"__wrapped__"),E=O&&b.call(t,"__wrapped__");if(w||E){var P=w?e.value():e,S=E?t.value():t;return x||(x=new r),v(P,S,n,y,x)}}return!!C&&(x||(x=new r),c(e,t,n,y,v,x))}},function(e,t,n){var r=n(4),o=n(36),i=n(37),c=n(38),a=n(39),u=n(40);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=c,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(5),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(5);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(5);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(5);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(4);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(4),o=n(11),i=n(19),c=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<c-1)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),o=n(45),i=n(17),c=n(18),a=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:a).test(c(e))}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(12),o=Object.prototype,i=o.hasOwnProperty,c=o.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var o=c.call(e);return r&&(t?e[a]=n:delete e[a]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(46),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(49),o=n(4),i=n(11);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(50),o=n(51),i=n(52),c=n(53),a=n(54);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=c,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(7);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(7),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t,n){var r=n(8);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(8);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(19),o=n(61),i=n(62);function c(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}c.prototype.add=c.prototype.push=o,c.prototype.has=i,e.exports=c},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(12),o=n(66),i=n(14),c=n(20),a=n(67),u=n(68),s=1,l=2,p="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",b="[object Number]",y="[object RegExp]",v="[object Set]",x="[object String]",m="[object Symbol]",k="[object ArrayBuffer]",_="[object DataView]",g=r?r.prototype:void 0,j=g?g.valueOf:void 0;e.exports=function(e,t,n,r,g,O,C){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!O(new o(e),new o(t)));case p:case f:case b:return i(+e,+t);case d:return e.name==t.name&&e.message==t.message;case y:case x:return e==t+"";case h:var w=a;case v:var E=r&s;if(w||(w=u),e.size!=t.size&&!E)return!1;var P=C.get(e);if(P)return P==t;r|=l,C.set(e,t);var S=c(w(e),w(t),r,g,O,C);return C.delete(e),S;case m:if(j)return j.call(e)==j.call(t)}return!1}},function(e,t,n){var r=n(2).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(70),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,c,a,u){var s=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!s)return!1;for(var f=p;f--;){var d=l[f];if(!(s?d in t:i.call(t,d)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var b=!0;u.set(e,t),u.set(t,e);for(var y=s;++f<p;){var v=e[d=l[f]],x=t[d];if(c)var m=s?c(x,v,d,t,e,u):c(v,x,d,e,t,u);if(!(void 0===m?v===x||a(v,x,n,c,u):m)){b=!1;break}y||(y="constructor"==d)}if(b&&!y){var k=e.constructor,_=t.constructor;k!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof _&&_ instanceof _)&&(b=!1)}return u.delete(e),u.delete(t),b}},function(e,t,n){var r=n(71),o=n(73),i=n(76);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(72),o=n(13);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(74),o=n(75),i=Object.prototype.propertyIsEnumerable,c=Object.getOwnPropertySymbols,a=c?function(e){return null==e?[]:(e=Object(e),r(c(e),function(t){return i.call(e,t)}))}:o;e.exports=a},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var c=e[n];t(c,n,e)&&(i[o++]=c)}return i}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(77),o=n(86),i=n(90);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){var r=n(78),o=n(79),i=n(13),c=n(21),a=n(82),u=n(23),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&c(e),f=!n&&!l&&!p&&u(e),d=n||l||p||f,h=d?r(e.length,String):[],b=h.length;for(var y in e)!t&&!s.call(e,y)||d&&("length"==y||p&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,b))||h.push(y);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(80),o=n(9),i=Object.prototype,c=i.hasOwnProperty,a=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&c.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(6),o=n(9),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(6),o=n(24),i=n(9),c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c["[object Arguments]"]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c["[object Function]"]=c["[object Map]"]=c["[object Number]"]=c["[object Object]"]=c["[object RegExp]"]=c["[object Set]"]=c["[object String]"]=c["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!c[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(16),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===o&&r.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||c&&c.binding&&c.binding("util")}catch(e){}}();e.exports=a}).call(this,n(22)(e))},function(e,t,n){var r=n(87),o=n(88),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(89)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(15),o=n(24);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(92),o=n(11),i=n(93),c=n(94),a=n(95),u=n(6),s=n(18),l=s(r),p=s(o),f=s(i),d=s(c),h=s(a),b=u;(r&&"[object DataView]"!=b(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=b(new o)||i&&"[object Promise]"!=b(i.resolve())||c&&"[object Set]"!=b(new c)||a&&"[object WeakMap]"!=b(new a))&&(b=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=b},function(e,t,n){var r=n(3)(n(2),"DataView");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Promise");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Set");e.exports=r},function(e,t,n){var r=n(3)(n(2),"WeakMap");e.exports=r},function(e,t,n){"use strict";var r=n(97);function o(){}e.exports=function(){function e(e,t,n,o,i,c){if(c!==r){var a=new Error("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");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={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,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(10),o=n.n(r),i=n(25),c=n.n(i),a=n(0),u=n.n(a),s=n(1),l=n.n(s),p=n(26),f=n.n(p);function d(e){return(d="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})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,v(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(t,l.a.PureComponent),function(e,t,n){t&&b(e.prototype,t),n&&b(e,n)}(t,[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){m(e,t,n[t])})}return e}({},this.props);return delete t.indeterminate,l.a.createElement("input",h({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}]),t}();m(k,"propTypes",{indeterminate:u.a.bool}),m(k,"defaultProps",{indeterminate:!1});var _=k;function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j={label:u.a.node.isRequired,value:u.a.oneOfType([u.a.string,u.a.number]).isRequired,icon:u.a.node,showCheckbox:u.a.bool},O=u.a.oneOfType([u.a.shape(j),u.a.shape(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){g(e,t,n[t])})}return e}({},j,{children:u.a.arrayOf(j).isRequired}))]);function C(e){return(C="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?S(e):t}(this,E(t).call(this,e))).onCheck=n.onCheck.bind(S(S(n))),n.onClick=n.onClick.bind(S(S(n))),n.onExpand=n.onExpand.bind(S(S(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,l.a.Component),function(e,t,n){t&&w(e.prototype,t),n&&w(e,n)}(t,[{key:"onCheck",value:function(){var e=!1;0===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.props.onCheck({value:this.props.value,checked:e,children:this.props.rawChildren})}},{key:"onClick",value:function(){var e=!1;1===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.hasChildren()&&this.props.expandOnClick&&this.onExpand(),this.props.onClick({value:this.props.value,checked:e,children:this.props.rawChildren})}},{key:"onExpand",value:function(){this.props.onExpand({value:this.props.value,expanded:!this.props.expanded})}},{key:"hasChildren",value:function(){return null!==this.props.rawChildren}},{key:"renderCollapseButton",value:function(){var e=this.props.expandDisabled;return this.hasChildren()?l.a.createElement("button",{"aria-label":"Toggle",className:"rct-collapse rct-collapse-btn",disabled:e,title:"Toggle",type:"button",onClick:this.onExpand},this.renderCollapseIcon()):l.a.createElement("span",{className:"rct-collapse"},l.a.createElement("span",{className:"rct-icon"}))}},{key:"renderCollapseIcon",value:function(){return this.props.expanded?l.a.createElement("span",{className:"rct-icon rct-icon-expand-open"}):l.a.createElement("span",{className:"rct-icon rct-icon-expand-close"})}},{key:"renderCheckboxIcon",value:function(){return 0===this.props.checked?l.a.createElement("span",{className:"rct-icon rct-icon-uncheck"}):1===this.props.checked?l.a.createElement("span",{className:"rct-icon rct-icon-check"}):l.a.createElement("span",{className:"rct-icon rct-icon-half-check"})}},{key:"renderNodeIcon",value:function(){return null!==this.props.icon?this.props.icon:this.hasChildren()?this.props.expanded?l.a.createElement("span",{className:"rct-icon rct-icon-parent-open"}):l.a.createElement("span",{className:"rct-icon rct-icon-parent-close"}):l.a.createElement("span",{className:"rct-icon rct-icon-leaf"})}},{key:"renderBareLabel",value:function(e){var n=this.props.onClick.toString()!==t.defaultProps.onClick.toString();return l.a.createElement("span",{className:"rct-bare-label"},n?l.a.createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var n=this.props,r=n.checked,o=n.disabled,i=(n.label,n.treeId),c=n.value,a=n.onClick.toString()!==t.defaultProps.onClick.toString(),u="".concat(i,"-").concat(String(c).split(" ").join("_")),s=[l.a.createElement("label",{key:0,htmlFor:u},l.a.createElement(_,{checked:1===r,disabled:o,id:u,indeterminate:2===r,onChange:this.onCheck}),l.a.createElement("span",{className:"rct-checkbox"},this.renderCheckboxIcon()),a?null:e)];return a&&s.push(l.a.createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),s}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?l.a.createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,l.a.createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.disabled,r=o()({"rct-node":!0,"rct-node-parent":this.hasChildren(),"rct-node-leaf":!this.hasChildren(),"rct-disabled":n},t);return l.a.createElement("li",{className:r},l.a.createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}]),t}();N(T,"propTypes",{checked:u.a.number.isRequired,disabled:u.a.bool.isRequired,expandDisabled:u.a.bool.isRequired,expanded:u.a.bool.isRequired,label:u.a.node.isRequired,optimisticToggle:u.a.bool.isRequired,showNodeIcon:u.a.bool.isRequired,treeId:u.a.string.isRequired,value:u.a.oneOfType([u.a.string,u.a.number]).isRequired,onCheck:u.a.func.isRequired,onExpand:u.a.func.isRequired,children:u.a.node,className:u.a.string,expandOnClick:u.a.bool,icon:u.a.node,rawChildren:u.a.arrayOf(O),showCheckbox:u.a.bool,onClick:u.a.func}),N(T,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,rawChildren:null,showCheckbox:!0,onClick:function(){}});var A=T,I=u.a.oneOfType([u.a.arrayOf(u.a.string),u.a.arrayOf(u.a.number)]);function R(e){return(R="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})(e)}function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?q(e):t}(this,D(t).call(this,e))).id="rct-".concat(f()(7)),n.nodes={},n.flattenNodes(e.nodes),n.unserializeLists({checked:e.checked,expanded:e.expanded}),n.onCheck=n.onCheck.bind(q(q(n))),n.onExpand=n.onExpand.bind(q(q(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(t,l.a.Component),function(e,t,n){t&&z(e.prototype,t),n&&z(e,n)}(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.nodes,n=e.checked,r=e.expanded;c()(this.props.nodes,t)||this.flattenNodes(t),this.unserializeLists({checked:n,expanded:r})}},{key:"onCheck",value:function(e){var t=this.props,n=t.noCascade,r=t.onCheck;this.toggleChecked(e,e.checked,n),r(this.serializeList("checked"),e)}},{key:"onExpand",value:function(e){var t=this.props.onExpand;this.toggleNode("expanded",e,e.expanded),t(this.serializeList("expanded"),e)}},{key:"getFormattedNodes",value:function(e){var t=this;return e.map(function(e){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){F(e,t,n[t])})}return e}({},e);return n.checked=t.nodes[e.value].checked,n.expanded=t.nodes[e.value].expanded,n.showCheckbox=void 0===e.showCheckbox||e.showCheckbox,Array.isArray(e.children)&&e.children.length>0?n.children=t.getFormattedNodes(n.children):n.children=null,n})}},{key:"getCheckState",value:function(e,t){return null===e.children||t?e.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||(!(r||!t.disabled)||Boolean(e.disabled))}},{key:"toggleChecked",value:function(e,t,n){var r=this;null===e.children||n?this.toggleNode("checked",e,t):e.children.forEach(function(e){r.toggleChecked(e,t)})}},{key:"toggleNode",value:function(e,t,n){this.nodes[t.value][e]=n}},{key:"flattenNodes",value:function(e){var t=this;Array.isArray(e)&&0!==e.length&&e.forEach(function(e){t.nodes[e.value]={},t.flattenNodes(e.children)})}},{key:"unserializeLists",value:function(e){var t=this;Object.keys(this.nodes).forEach(function(n){Object.keys(e).forEach(function(e){t.nodes[n][e]=!1})}),Object.keys(e).forEach(function(n){e[n].forEach(function(e){void 0!==t.nodes[e]&&(t.nodes[e][n]=!0)})})}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.nodes).forEach(function(r){t.nodes[r][e]&&n.push(r)}),n}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every(function(e){return null!==e.children?t.isEveryChildChecked(e):e.checked})}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some(function(e){return null!==e.children?t.isSomeChildChecked(e):e.checked})}},{key:"renderTreeNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.props,o=r.disabled,i=r.expandDisabled,c=r.expandOnClick,a=r.noCascade,u=r.onlyLeafCheckboxes,s=r.optimisticToggle,p=r.showNodeIcon,f=r.onClick,d=e.map(function(e){var r="".concat(e.value),d=t.getCheckState(e,a),h=null===e.children,b=t.renderChildNodes(e),y=t.getDisabledState(e,n,o,a),v=u?h:e.showCheckbox;return l.a.createElement(A,{key:r,checked:d,className:e.className,disabled:y,expandDisabled:i,expandOnClick:c,expanded:e.expanded,icon:e.icon,label:e.label,optimisticToggle:s,rawChildren:e.children,showCheckbox:v,showNodeIcon:p,treeId:t.id,value:e.value,onCheck:t.onCheck,onClick:f,onExpand:t.onExpand},b)});return l.a.createElement("ol",null,d)}},{key:"renderChildNodes",value:function(e){return null!==e.children&&e.expanded?this.renderTreeNodes(e.children,e):null}},{key:"renderHiddenInput",value:function(){return void 0===this.props.name?null:this.props.nameAsArray?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this;return this.props.checked.map(function(t){var n="".concat(e.props.name,"[]");return l.a.createElement("input",{key:t,name:n,type:"hidden",value:t})})}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props.checked.join(",");return l.a.createElement("input",{name:this.props.name,type:"hidden",value:e})}},{key:"render",value:function(){var e=this.getFormattedNodes(this.props.nodes),t=this.renderTreeNodes(e),n=o()({"react-checkbox-tree":!0,"rct-disabled":this.props.disabled,"rct-native-display":this.props.nativeCheckboxes});return l.a.createElement("div",{className:n},this.renderHiddenInput(),t)}}]),t}();F(M,"propTypes",{nodes:u.a.arrayOf(O).isRequired,checked:I,disabled:u.a.bool,expandDisabled:u.a.bool,expandOnClick:u.a.bool,expanded:I,name:u.a.string,nameAsArray:u.a.bool,nativeCheckboxes:u.a.bool,noCascade:u.a.bool,onlyLeafCheckboxes:u.a.bool,optimisticToggle:u.a.bool,showNodeIcon:u.a.bool,onCheck:u.a.func,onClick:u.a.func,onExpand:u.a.func}),F(M,"defaultProps",{checked:[],disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showNodeIcon:!0,onCheck:function(){},onClick:function(){},onExpand:function(){}});t.default=M}])}); | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===a)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(6),o=n(17),a="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==i||t==c||t==a||t==u}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(42))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(48),o=n(55),a=n(57),i=n(58),c=n(59);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(60),o=n(63),a=n(64),i=1,c=2;e.exports=function(e,t,n,u,s,l){var p=n&i,f=e.length,d=t.length;if(f!=d&&!(p&&d>f))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var b=-1,y=!0,v=n&c?new r:void 0;for(l.set(e,t),l.set(t,e);++b<f;){var x=e[b],m=t[b];if(u)var k=p?u(m,x,b,t,e,l):u(x,m,b,e,t,l);if(void 0!==k){if(k)continue;y=!1;break}if(v){if(!o(t,function(e,t){if(!a(v,t)&&(x===e||s(x,e,n,u,l)))return v.push(t)})){y=!1;break}}else if(x!==m&&!s(x,m,n,u,l)){y=!1;break}}return l.delete(e),l.delete(t),y}},function(e,t,n){(function(e){var r=n(2),o=n(81),a="object"==typeof t&&t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===a?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;e.exports=u}).call(this,n(22)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(83),o=n(84),a=n(85),i=a&&a.isTypedArray,c=i?o(i):r;e.exports=c},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(28);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=self.crypto||self.msCrypto;e.exports=function(e){e=e||21;for(var t="",n=r.getRandomValues(new Uint8Array(e));0<e--;)t+="_~getRandomVcryp0123456789bfhijklqsuvwxzABCDEFGHIJKLMNOPQSTUWXYZ"[63&n[e]];return t}},function(e,t,n){e.exports=n(98).default},function(e,t,n){var r=n(29),o=n(9);e.exports=function e(t,n,a,i,c){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,c))}},function(e,t,n){var r=n(30),o=n(20),a=n(65),i=n(69),c=n(91),u=n(13),s=n(21),l=n(23),p=1,f="[object Arguments]",d="[object Array]",h="[object Object]",b=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,x){var m=u(e),k=u(t),g=m?d:c(e),_=k?d:c(t),j=(g=g==f?h:g)==h,O=(_=_==f?h:_)==h,w=g==_;if(w&&s(e)){if(!s(t))return!1;m=!0,j=!1}if(w&&!j)return x||(x=new r),m||l(e)?o(e,t,n,y,v,x):a(e,t,g,n,y,v,x);if(!(n&p)){var C=j&&b.call(e,"__wrapped__"),E=O&&b.call(t,"__wrapped__");if(C||E){var P=C?e.value():e,N=E?t.value():t;return x||(x=new r),v(P,N,n,y,x)}}return!!w&&(x||(x=new r),i(e,t,n,y,v,x))}},function(e,t,n){var r=n(4),o=n(36),a=n(37),i=n(38),c=n(39),u=n(40);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=a,s.prototype.get=i,s.prototype.has=c,s.prototype.set=u,e.exports=s},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(5),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(5);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(5);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(5);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(4);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(4),o=n(11),a=n(19),i=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!o||c.length<i-1)return c.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(c)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),o=n(45),a=n(17),i=n(18),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:c).test(i(e))}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(12),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(46),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(49),o=n(4),a=n(11);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},function(e,t,n){var r=n(50),o=n(51),a=n(52),i=n(53),c=n(54);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(7);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__",a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return a.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(7),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t,n){var r=n(8);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(8);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(19),o=n(61),a=n(62);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(12),o=n(66),a=n(14),i=n(20),c=n(67),u=n(68),s=1,l=2,p="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",b="[object Number]",y="[object RegExp]",v="[object Set]",x="[object String]",m="[object Symbol]",k="[object ArrayBuffer]",g="[object DataView]",_=r?r.prototype:void 0,j=_?_.valueOf:void 0;e.exports=function(e,t,n,r,_,O,w){switch(n){case g:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!O(new o(e),new o(t)));case p:case f:case b:return a(+e,+t);case d:return e.name==t.name&&e.message==t.message;case y:case x:return e==t+"";case h:var C=c;case v:var E=r&s;if(C||(C=u),e.size!=t.size&&!E)return!1;var P=w.get(e);if(P)return P==t;r|=l,w.set(e,t);var N=i(C(e),C(t),r,_,O,w);return w.delete(e),N;case m:if(j)return j.call(e)==j.call(t)}return!1}},function(e,t,n){var r=n(2).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(70),o=1,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,c,u){var s=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!s)return!1;for(var f=p;f--;){var d=l[f];if(!(s?d in t:a.call(t,d)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var b=!0;u.set(e,t),u.set(t,e);for(var y=s;++f<p;){var v=e[d=l[f]],x=t[d];if(i)var m=s?i(x,v,d,t,e,u):i(v,x,d,e,t,u);if(!(void 0===m?v===x||c(v,x,n,i,u):m)){b=!1;break}y||(y="constructor"==d)}if(b&&!y){var k=e.constructor,g=t.constructor;k!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof g&&g instanceof g)&&(b=!1)}return u.delete(e),u.delete(t),b}},function(e,t,n){var r=n(71),o=n(73),a=n(76);e.exports=function(e){return r(e,a,o)}},function(e,t,n){var r=n(72),o=n(13);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(74),o=n(75),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,c=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return a.call(e,t)}))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(77),o=n(86),a=n(90);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){var r=n(78),o=n(79),a=n(13),i=n(21),c=n(82),u=n(23),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),l=!n&&o(e),p=!n&&!l&&i(e),f=!n&&!l&&!p&&u(e),d=n||l||p||f,h=d?r(e.length,String):[],b=h.length;for(var y in e)!t&&!s.call(e,y)||d&&("length"==y||p&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||c(y,b))||h.push(y);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(80),o=n(9),a=Object.prototype,i=a.hasOwnProperty,c=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!c.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(6),o=n(9),a="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==a}},function(e,t){e.exports=function(){return!1}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(6),o=n(24),a=n(9),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(16),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,c=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,n(22)(e))},function(e,t,n){var r=n(87),o=n(88),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(89)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(15),o=n(24);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(92),o=n(11),a=n(93),i=n(94),c=n(95),u=n(6),s=n(18),l=s(r),p=s(o),f=s(a),d=s(i),h=s(c),b=u;(r&&"[object DataView]"!=b(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=b(new o)||a&&"[object Promise]"!=b(a.resolve())||i&&"[object Set]"!=b(new i)||c&&"[object WeakMap]"!=b(new c))&&(b=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=b},function(e,t,n){var r=n(3)(n(2),"DataView");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Promise");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Set");e.exports=r},function(e,t,n){var r=n(3)(n(2),"WeakMap");e.exports=r},function(e,t,n){"use strict";var r=n(97);function o(){}e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var c=new Error("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");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={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,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(10),o=n.n(r),a=n(25),i=n.n(a),c=n(26),u=n.n(c),s=n(0),l=n.n(s),p=n(1),f=n.n(p);function d(e){return(d="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})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),v(this,x(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,f.a.PureComponent),function(e,t,n){t&&y(e.prototype,t),n&&y(e,n)}(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.title,r=b(e,["children","title"]);return f.a.createElement("button",h({"aria-label":n,title:n,type:"button"},r),t)}}]),t}();k(g,"propTypes",{children:l.a.node.isRequired,title:l.a.string}),k(g,"defaultProps",{title:null});var _=g;function j(e){return(j="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})(e)}function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),C(this,E(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,f.a.PureComponent),function(e,t,n){t&&w(e.prototype,t),n&&w(e,n)}(t,[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){N(e,t,n[t])})}return e}({},this.props);return delete t.indeterminate,f.a.createElement("input",O({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}]),t}();N(S,"propTypes",{indeterminate:l.a.bool}),N(S,"defaultProps",{indeterminate:!1});var A=S,T=l.a.shape({check:l.a.node,uncheck:l.a.node,halfCheck:l.a.node,expandClose:l.a.node,expandOpen:l.a.node,parentClose:l.a.node,parentOpen:l.a.node,leaf:l.a.node}),R={collapseAll:l.a.string.isRequired,expandAll:l.a.string.isRequired,toggle:l.a.string.isRequired};function I(e){return(I="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})(e)}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var B=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?D(e):t}(this,z(t).call(this,e))).onCheck=n.onCheck.bind(D(D(n))),n.onClick=n.onClick.bind(D(D(n))),n.onExpand=n.onExpand.bind(D(D(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(t,f.a.Component),function(e,t,n){t&&L(e.prototype,t),n&&L(e,n)}(t,[{key:"onCheck",value:function(){var e=!1;0===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.props.onCheck({value:this.props.value,checked:e})}},{key:"onClick",value:function(){var e=this.props,t=e.checked,n=e.expandOnClick,r=e.isParent,o=e.optimisticToggle,a=e.value,i=e.onClick,c=!1;1===t&&(c=!0),2===t&&(c=o),r&&n&&this.onExpand(),i({value:a,checked:c})}},{key:"onExpand",value:function(){var e=this.props,t=e.expanded,n=e.value,r=e.onExpand;r({value:n,expanded:!t})}},{key:"renderCollapseButton",value:function(){var e=this.props,t=e.expandDisabled,n=e.isLeaf,r=e.lang;return n?f.a.createElement("span",{className:"rct-collapse"},f.a.createElement("span",{className:"rct-icon"})):f.a.createElement(_,{className:"rct-collapse rct-collapse-btn",disabled:t,title:r.toggle,onClick:this.onExpand},this.renderCollapseIcon())}},{key:"renderCollapseIcon",value:function(){var e=this.props,t=e.expanded,n=e.icons,r=n.expandClose,o=n.expandOpen;return t?o:r}},{key:"renderCheckboxIcon",value:function(){var e=this.props,t=e.checked,n=e.icons,r=n.uncheck,o=n.check,a=n.halfCheck;return 0===t?r:1===t?o:a}},{key:"renderNodeIcon",value:function(){var e=this.props,t=e.expanded,n=e.icon,r=e.icons,o=r.leaf,a=r.parentClose,i=r.parentOpen,c=e.isLeaf;return null!==n?n:c?o:t?i:a}},{key:"renderBareLabel",value:function(e){var n=this.props,r=n.onClick,o=n.title,a=r.toString()!==t.defaultProps.onClick.toString();return f.a.createElement("span",{className:"rct-bare-label",title:o},a?f.a.createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var n=this.props,r=n.checked,o=n.disabled,a=(n.label,n.title),i=n.treeId,c=n.value,u=n.onClick.toString()!==t.defaultProps.onClick.toString(),s="".concat(i,"-").concat(String(c).split(" ").join("_")),l=[f.a.createElement("label",{key:0,htmlFor:s,title:a},f.a.createElement(A,{checked:1===r,disabled:o,id:s,indeterminate:2===r,onChange:this.onCheck}),f.a.createElement("span",{className:"rct-checkbox"},this.renderCheckboxIcon()),u?null:e)];return u&&l.push(f.a.createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),l}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?f.a.createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,f.a.createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.disabled,r=e.isLeaf,a=o()({"rct-node":!0,"rct-node-leaf":r,"rct-node-parent":!r,"rct-disabled":n},t);return f.a.createElement("li",{className:a},f.a.createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}]),t}();M(B,"propTypes",{checked:l.a.number.isRequired,disabled:l.a.bool.isRequired,expandDisabled:l.a.bool.isRequired,expanded:l.a.bool.isRequired,icons:T.isRequired,isLeaf:l.a.bool.isRequired,isParent:l.a.bool.isRequired,label:l.a.node.isRequired,lang:R.isRequired,optimisticToggle:l.a.bool.isRequired,showNodeIcon:l.a.bool.isRequired,treeId:l.a.string.isRequired,value:l.a.oneOfType([l.a.string,l.a.number]).isRequired,onCheck:l.a.func.isRequired,onExpand:l.a.func.isRequired,children:l.a.node,className:l.a.string,expandOnClick:l.a.bool,icon:l.a.node,showCheckbox:l.a.bool,title:l.a.string,onClick:l.a.func}),M(B,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,showCheckbox:!0,title:null,onClick:function(){}});var F=B,U=l.a.oneOfType([l.a.arrayOf(l.a.string),l.a.arrayOf(l.a.number)]);function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V={label:l.a.node.isRequired,value:l.a.oneOfType([l.a.string,l.a.number]).isRequired,disabled:l.a.bool,icon:l.a.node,showCheckbox:l.a.bool,title:l.a.string},W=l.a.oneOfType([l.a.shape(V),l.a.shape(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){H(e,t,n[t])})}return e}({},V,{children:l.a.arrayOf(V).isRequired}))]);function $(e){return($="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})(e)}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){X(e,t,n[t])})}return e}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?Q(e):t}(this,G(t).call(this,e))).id="rct-".concat(u()(7)),n.flatNodes={},n.flattenNodes(e.nodes),n.deserializeLists({checked:e.checked,expanded:e.expanded}),n.onCheck=n.onCheck.bind(Q(Q(n))),n.onExpand=n.onExpand.bind(Q(Q(n))),n.onExpandAll=n.onExpandAll.bind(Q(Q(n))),n.onCollapseAll=n.onCollapseAll.bind(Q(Q(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(t,f.a.Component),function(e,t,n){t&&K(e.prototype,t),n&&K(e,n)}(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.nodes,n=e.checked,r=e.expanded;i()(this.props.nodes,t)||this.flattenNodes(t),this.deserializeLists({checked:n,expanded:r})}},{key:"onCheck",value:function(e){var t=this.props,n=t.noCascade,r=t.onCheck,o=this.flatNodes[e.value];this.toggleChecked(e,e.checked,n),r(this.serializeList("checked"),J({},e,{children:o.self.children}))}},{key:"onExpand",value:function(e){var t=this.props.onExpand,n=this.flatNodes[e.value];this.toggleNode(e.value,"expanded",e.expanded),t(this.serializeList("expanded"),J({},e,{children:n.self.children}))}},{key:"onExpandAll",value:function(){this.expandAllNodes()}},{key:"onCollapseAll",value:function(){this.expandAllNodes(!1)}},{key:"getShallowCheckState",value:function(e,t){var n=this.flatNodes[e.value];return n.isLeaf||t?n.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||(!(r||!t.disabled)||Boolean(e.disabled))}},{key:"nodeHasChildren",value:function(e){return Array.isArray(e.children)&&e.children.length>0}},{key:"expandAllNodes",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.props.onExpand;Object.keys(this.flatNodes).forEach(function(n){e.flatNodes[n].isParent&&(e.flatNodes[n].expanded=t)}),n(this.serializeList("expanded",null))}},{key:"toggleChecked",value:function(e,t,n){var r=this,o=this.flatNodes[e.value];if(o.isLeaf||n){if(e.disabled)return;this.toggleNode(e.value,"checked",t)}else o.self.children.forEach(function(e){r.toggleChecked(e,t,n)})}},{key:"toggleNode",value:function(e,t,n){this.flatNodes[e][t]=n}},{key:"flattenNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)&&0!==e.length){var r=this.props,o=r.disabled,a=r.noCascade;e.forEach(function(e){var r=t.nodeHasChildren(e);t.flatNodes[e.value]={self:e,parent:n,isParent:r,isLeaf:!r,showCheckbox:void 0===e.showCheckbox||e.showCheckbox,disabled:t.getDisabledState(e,n,o,a)},t.flattenNodes(e.children,e)})}}},{key:"deserializeLists",value:function(e){var t=this;Object.keys(this.flatNodes).forEach(function(n){Object.keys(e).forEach(function(e){t.flatNodes[n][e]=!1})}),Object.keys(e).forEach(function(n){e[n].forEach(function(e){void 0!==t.flatNodes[e]&&(t.flatNodes[e][n]=!0)})})}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.flatNodes).forEach(function(r){t.flatNodes[r][e]&&n.push(r)}),n}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every(function(e){return 1===t.flatNodes[e.value].checkState})}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some(function(e){return t.flatNodes[e.value].checkState>0})}},{key:"renderTreeNodes",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.props,a=o.expandDisabled,i=o.expandOnClick,c=o.icons,u=o.lang,s=o.noCascade,l=o.onlyLeafCheckboxes,p=o.optimisticToggle,d=o.showNodeTitle,h=o.showNodeIcon,b=o.onClick,y=t.defaultProps.icons,v=e.map(function(e){var t="".concat(e.value),o=n.flatNodes[e.value],v=o.isParent?n.renderTreeNodes(e.children,e):null;o.checkState=n.getShallowCheckState(e,s);var x=l?o.isLeaf:o.showCheckbox;return!r.value||n.flatNodes[r.value].expanded?f.a.createElement(F,{key:t,checked:o.checkState,className:e.className,disabled:o.disabled,expandDisabled:a,expandOnClick:i,expanded:o.expanded,icon:e.icon,icons:J({},y,c),label:e.label,lang:u,optimisticToggle:p,isLeaf:o.isLeaf,isParent:o.isParent,showCheckbox:x,showNodeIcon:h,title:d?e.title||e.label:e.title,treeId:n.id,value:e.value,onCheck:n.onCheck,onClick:b,onExpand:n.onExpand},v):null});return f.a.createElement("ol",null,v)}},{key:"renderExpandAll",value:function(){var e=this.props,t=e.icons,n=t.expandAll,r=t.collapseAll,o=e.lang;return e.showExpandAll?f.a.createElement("div",{className:"rct-options"},f.a.createElement(_,{className:"rct-option rct-option-expand-all",title:o.expandAll,onClick:this.onExpandAll},n),f.a.createElement(_,{className:"rct-option rct-option-collapse-all",title:o.collapseAll,onClick:this.onCollapseAll},r)):null}},{key:"renderHiddenInput",value:function(){var e=this.props,t=e.name,n=e.nameAsArray;return void 0===t?null:n?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name;return t.map(function(e){var t="".concat(n,"[]");return f.a.createElement("input",{key:e,name:t,type:"hidden",value:e})})}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name,r=t.join(",");return f.a.createElement("input",{name:n,type:"hidden",value:r})}},{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.nodes,r=e.nativeCheckboxes,a=this.renderTreeNodes(n),i=o()({"react-checkbox-tree":!0,"rct-disabled":t,"rct-native-display":r});return f.a.createElement("div",{className:i},this.renderExpandAll(),this.renderHiddenInput(),a)}}]),t}();X(Z,"propTypes",{nodes:l.a.arrayOf(W).isRequired,checked:U,disabled:l.a.bool,expandDisabled:l.a.bool,expandOnClick:l.a.bool,expanded:U,icons:T,lang:R,name:l.a.string,nameAsArray:l.a.bool,nativeCheckboxes:l.a.bool,noCascade:l.a.bool,onlyLeafCheckboxes:l.a.bool,optimisticToggle:l.a.bool,showExpandAll:l.a.bool,showNodeIcon:l.a.bool,showNodeTitle:l.a.bool,onCheck:l.a.func,onClick:l.a.func,onExpand:l.a.func}),X(Z,"defaultProps",{checked:[],disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:f.a.createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:f.a.createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:f.a.createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:f.a.createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:f.a.createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:f.a.createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:f.a.createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:f.a.createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:f.a.createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:f.a.createElement("span",{className:"rct-icon rct-icon-leaf"})},lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:function(){},onExpand:function(){}});t.default=Z}])}); |
@@ -1,3 +0,3 @@ | ||
/*! react-checkbox-tree - v1.2.4 | 2018 */ | ||
!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.ReactCheckboxTree=t(require("react")):e.ReactCheckboxTree=t(e.React)}(global,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){e.exports=n(95)()},function(t,n){t.exports=e},function(e,t,n){var r=n(16),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){var r=n(41),o=n(46);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(31),o=n(32),i=n(33),a=n(34),c=n(35);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(14);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(12),o=n(42),i=n(43),a="[object Null]",c="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?c:a:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(3)(Object,"create");e.exports=r},function(e,t,n){var r=n(55);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r; | ||
/*! react-checkbox-tree - v1.3.0 | 2018 */ | ||
!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.ReactCheckboxTree=t(require("react")):e.ReactCheckboxTree=t(e.React)}(global,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){e.exports=n(98)()},function(t,n){t.exports=e},function(e,t,n){var r=n(16),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){var r=n(41),o=n(46);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(31),o=n(32),a=n(33),i=n(34),c=n(35);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(14);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(12),o=n(42),a=n(43),i="[object Null]",c="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?c:i:u&&u in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(3)(Object,"create");e.exports=r},function(e,t,n){var r=n(55);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r; | ||
/*! | ||
@@ -13,2 +13,2 @@ Copyright (c) 2017 Jed Watson. | ||
*/ | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(6),o=n(17),i="[object AsyncFunction]",a="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==c||t==i||t==u}},function(e,t){var n="object"==typeof global&&global&&global.Object===Object&&global;e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(47),o=n(54),i=n(56),a=n(57),c=n(58);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(59),o=n(62),i=n(63),a=1,c=2;e.exports=function(e,t,n,u,s,l){var p=n&a,f=e.length,d=t.length;if(f!=d&&!(p&&d>f))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var b=-1,y=!0,v=n&c?new r:void 0;for(l.set(e,t),l.set(t,e);++b<f;){var x=e[b],m=t[b];if(u)var k=p?u(m,x,b,t,e,l):u(x,m,b,e,t,l);if(void 0!==k){if(k)continue;y=!1;break}if(v){if(!o(t,function(e,t){if(!i(v,t)&&(x===e||s(x,e,n,u,l)))return v.push(t)})){y=!1;break}}else if(x!==m&&!s(x,m,n,u,l)){y=!1;break}}return l.delete(e),l.delete(t),y}},function(e,t,n){(function(e){var r=n(2),o=n(80),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,c=a&&a.exports===i?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;e.exports=u}).call(this,n(22)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(82),o=n(83),i=n(84),a=i&&i.isTypedArray,c=a?o(a):r;e.exports=c},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(28);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=n(97),o=n(99);e.exports=function(e){for(var t="",n=r(e=e||21);0<e--;)t+=o[63&n[e]];return t}},function(e,t,n){e.exports=n(100).default},function(e,t,n){var r=n(29),o=n(9);e.exports=function e(t,n,i,a,c){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,c))}},function(e,t,n){var r=n(30),o=n(20),i=n(64),a=n(68),c=n(90),u=n(13),s=n(21),l=n(23),p=1,f="[object Arguments]",d="[object Array]",h="[object Object]",b=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,x){var m=u(e),k=u(t),_=m?d:c(e),g=k?d:c(t),j=(_=_==f?h:_)==h,O=(g=g==f?h:g)==h,C=_==g;if(C&&s(e)){if(!s(t))return!1;m=!0,j=!1}if(C&&!j)return x||(x=new r),m||l(e)?o(e,t,n,y,v,x):i(e,t,_,n,y,v,x);if(!(n&p)){var w=j&&b.call(e,"__wrapped__"),E=O&&b.call(t,"__wrapped__");if(w||E){var P=w?e.value():e,S=E?t.value():t;return x||(x=new r),v(P,S,n,y,x)}}return!!C&&(x||(x=new r),a(e,t,n,y,v,x))}},function(e,t,n){var r=n(4),o=n(36),i=n(37),a=n(38),c=n(39),u=n(40);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=c,s.prototype.set=u,e.exports=s},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(5),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(5);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(5);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(5);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(4);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(4),o=n(11),i=n(19),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!o||c.length<a-1)return c.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(c)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),o=n(44),i=n(17),a=n(18),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:c).test(a(e))}},function(e,t,n){var r=n(12),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(45),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(48),o=n(4),i=n(11);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(49),o=n(50),i=n(51),a=n(52),c=n(53);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(7);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(7),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t,n){var r=n(8);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(8);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(19),o=n(60),i=n(61);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(12),o=n(65),i=n(14),a=n(20),c=n(66),u=n(67),s=1,l=2,p="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",b="[object Number]",y="[object RegExp]",v="[object Set]",x="[object String]",m="[object Symbol]",k="[object ArrayBuffer]",_="[object DataView]",g=r?r.prototype:void 0,j=g?g.valueOf:void 0;e.exports=function(e,t,n,r,g,O,C){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!O(new o(e),new o(t)));case p:case f:case b:return i(+e,+t);case d:return e.name==t.name&&e.message==t.message;case y:case x:return e==t+"";case h:var w=c;case v:var E=r&s;if(w||(w=u),e.size!=t.size&&!E)return!1;var P=C.get(e);if(P)return P==t;r|=l,C.set(e,t);var S=a(w(e),w(t),r,g,O,C);return C.delete(e),S;case m:if(j)return j.call(e)==j.call(t)}return!1}},function(e,t,n){var r=n(2).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(69),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,c,u){var s=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!s)return!1;for(var f=p;f--;){var d=l[f];if(!(s?d in t:i.call(t,d)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var b=!0;u.set(e,t),u.set(t,e);for(var y=s;++f<p;){var v=e[d=l[f]],x=t[d];if(a)var m=s?a(x,v,d,t,e,u):a(v,x,d,e,t,u);if(!(void 0===m?v===x||c(v,x,n,a,u):m)){b=!1;break}y||(y="constructor"==d)}if(b&&!y){var k=e.constructor,_=t.constructor;k!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof _&&_ instanceof _)&&(b=!1)}return u.delete(e),u.delete(t),b}},function(e,t,n){var r=n(70),o=n(72),i=n(75);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(71),o=n(13);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(73),o=n(74),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,c=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(76),o=n(85),i=n(89);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){var r=n(77),o=n(78),i=n(13),a=n(21),c=n(81),u=n(23),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),f=!n&&!l&&!p&&u(e),d=n||l||p||f,h=d?r(e.length,String):[],b=h.length;for(var y in e)!t&&!s.call(e,y)||d&&("length"==y||p&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||c(y,b))||h.push(y);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(79),o=n(9),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!c.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(6),o=n(9),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(6),o=n(24),i=n(9),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(16),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,c=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=c}).call(this,n(22)(e))},function(e,t,n){var r=n(86),o=n(87),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(88)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(15),o=n(24);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(91),o=n(11),i=n(92),a=n(93),c=n(94),u=n(6),s=n(18),l=s(r),p=s(o),f=s(i),d=s(a),h=s(c),b=u;(r&&"[object DataView]"!=b(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=b(new o)||i&&"[object Promise]"!=b(i.resolve())||a&&"[object Set]"!=b(new a)||c&&"[object WeakMap]"!=b(new c))&&(b=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=b},function(e,t,n){var r=n(3)(n(2),"DataView");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Promise");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Set");e.exports=r},function(e,t,n){var r=n(3)(n(2),"WeakMap");e.exports=r},function(e,t,n){"use strict";var r=n(96);function o(){}e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var c=new Error("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");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={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,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){e.exports=n(98).randomBytes},function(e,t){e.exports=require("crypto")},function(e,t){e.exports="_~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"},function(e,t,n){"use strict";n.r(t);var r=n(10),o=n.n(r),i=n(25),a=n.n(i),c=n(0),u=n.n(c),s=n(1),l=n.n(s),p=n(26),f=n.n(p);function d(e){return(d="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})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,v(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(t,l.a.PureComponent),function(e,t,n){t&&b(e.prototype,t),n&&b(e,n)}(t,[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){m(e,t,n[t])})}return e}({},this.props);return delete t.indeterminate,l.a.createElement("input",h({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}]),t}();m(k,"propTypes",{indeterminate:u.a.bool}),m(k,"defaultProps",{indeterminate:!1});var _=k;function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j={label:u.a.node.isRequired,value:u.a.oneOfType([u.a.string,u.a.number]).isRequired,icon:u.a.node,showCheckbox:u.a.bool},O=u.a.oneOfType([u.a.shape(j),u.a.shape(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){g(e,t,n[t])})}return e}({},j,{children:u.a.arrayOf(j).isRequired}))]);function C(e){return(C="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?S(e):t}(this,E(t).call(this,e))).onCheck=n.onCheck.bind(S(S(n))),n.onClick=n.onClick.bind(S(S(n))),n.onExpand=n.onExpand.bind(S(S(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,l.a.Component),function(e,t,n){t&&w(e.prototype,t),n&&w(e,n)}(t,[{key:"onCheck",value:function(){var e=!1;0===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.props.onCheck({value:this.props.value,checked:e,children:this.props.rawChildren})}},{key:"onClick",value:function(){var e=!1;1===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.hasChildren()&&this.props.expandOnClick&&this.onExpand(),this.props.onClick({value:this.props.value,checked:e,children:this.props.rawChildren})}},{key:"onExpand",value:function(){this.props.onExpand({value:this.props.value,expanded:!this.props.expanded})}},{key:"hasChildren",value:function(){return null!==this.props.rawChildren}},{key:"renderCollapseButton",value:function(){var e=this.props.expandDisabled;return this.hasChildren()?l.a.createElement("button",{"aria-label":"Toggle",className:"rct-collapse rct-collapse-btn",disabled:e,title:"Toggle",type:"button",onClick:this.onExpand},this.renderCollapseIcon()):l.a.createElement("span",{className:"rct-collapse"},l.a.createElement("span",{className:"rct-icon"}))}},{key:"renderCollapseIcon",value:function(){return this.props.expanded?l.a.createElement("span",{className:"rct-icon rct-icon-expand-open"}):l.a.createElement("span",{className:"rct-icon rct-icon-expand-close"})}},{key:"renderCheckboxIcon",value:function(){return 0===this.props.checked?l.a.createElement("span",{className:"rct-icon rct-icon-uncheck"}):1===this.props.checked?l.a.createElement("span",{className:"rct-icon rct-icon-check"}):l.a.createElement("span",{className:"rct-icon rct-icon-half-check"})}},{key:"renderNodeIcon",value:function(){return null!==this.props.icon?this.props.icon:this.hasChildren()?this.props.expanded?l.a.createElement("span",{className:"rct-icon rct-icon-parent-open"}):l.a.createElement("span",{className:"rct-icon rct-icon-parent-close"}):l.a.createElement("span",{className:"rct-icon rct-icon-leaf"})}},{key:"renderBareLabel",value:function(e){var n=this.props.onClick.toString()!==t.defaultProps.onClick.toString();return l.a.createElement("span",{className:"rct-bare-label"},n?l.a.createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var n=this.props,r=n.checked,o=n.disabled,i=(n.label,n.treeId),a=n.value,c=n.onClick.toString()!==t.defaultProps.onClick.toString(),u="".concat(i,"-").concat(String(a).split(" ").join("_")),s=[l.a.createElement("label",{key:0,htmlFor:u},l.a.createElement(_,{checked:1===r,disabled:o,id:u,indeterminate:2===r,onChange:this.onCheck}),l.a.createElement("span",{className:"rct-checkbox"},this.renderCheckboxIcon()),c?null:e)];return c&&s.push(l.a.createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),s}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?l.a.createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,l.a.createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.disabled,r=o()({"rct-node":!0,"rct-node-parent":this.hasChildren(),"rct-node-leaf":!this.hasChildren(),"rct-disabled":n},t);return l.a.createElement("li",{className:r},l.a.createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}]),t}();N(T,"propTypes",{checked:u.a.number.isRequired,disabled:u.a.bool.isRequired,expandDisabled:u.a.bool.isRequired,expanded:u.a.bool.isRequired,label:u.a.node.isRequired,optimisticToggle:u.a.bool.isRequired,showNodeIcon:u.a.bool.isRequired,treeId:u.a.string.isRequired,value:u.a.oneOfType([u.a.string,u.a.number]).isRequired,onCheck:u.a.func.isRequired,onExpand:u.a.func.isRequired,children:u.a.node,className:u.a.string,expandOnClick:u.a.bool,icon:u.a.node,rawChildren:u.a.arrayOf(O),showCheckbox:u.a.bool,onClick:u.a.func}),N(T,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,rawChildren:null,showCheckbox:!0,onClick:function(){}});var A=T,I=u.a.oneOfType([u.a.arrayOf(u.a.string),u.a.arrayOf(u.a.number)]);function R(e){return(R="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})(e)}function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?q(e):t}(this,D(t).call(this,e))).id="rct-".concat(f()(7)),n.nodes={},n.flattenNodes(e.nodes),n.unserializeLists({checked:e.checked,expanded:e.expanded}),n.onCheck=n.onCheck.bind(q(q(n))),n.onExpand=n.onExpand.bind(q(q(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(t,l.a.Component),function(e,t,n){t&&z(e.prototype,t),n&&z(e,n)}(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.nodes,n=e.checked,r=e.expanded;a()(this.props.nodes,t)||this.flattenNodes(t),this.unserializeLists({checked:n,expanded:r})}},{key:"onCheck",value:function(e){var t=this.props,n=t.noCascade,r=t.onCheck;this.toggleChecked(e,e.checked,n),r(this.serializeList("checked"),e)}},{key:"onExpand",value:function(e){var t=this.props.onExpand;this.toggleNode("expanded",e,e.expanded),t(this.serializeList("expanded"),e)}},{key:"getFormattedNodes",value:function(e){var t=this;return e.map(function(e){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){B(e,t,n[t])})}return e}({},e);return n.checked=t.nodes[e.value].checked,n.expanded=t.nodes[e.value].expanded,n.showCheckbox=void 0===e.showCheckbox||e.showCheckbox,Array.isArray(e.children)&&e.children.length>0?n.children=t.getFormattedNodes(n.children):n.children=null,n})}},{key:"getCheckState",value:function(e,t){return null===e.children||t?e.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||(!(r||!t.disabled)||Boolean(e.disabled))}},{key:"toggleChecked",value:function(e,t,n){var r=this;null===e.children||n?this.toggleNode("checked",e,t):e.children.forEach(function(e){r.toggleChecked(e,t)})}},{key:"toggleNode",value:function(e,t,n){this.nodes[t.value][e]=n}},{key:"flattenNodes",value:function(e){var t=this;Array.isArray(e)&&0!==e.length&&e.forEach(function(e){t.nodes[e.value]={},t.flattenNodes(e.children)})}},{key:"unserializeLists",value:function(e){var t=this;Object.keys(this.nodes).forEach(function(n){Object.keys(e).forEach(function(e){t.nodes[n][e]=!1})}),Object.keys(e).forEach(function(n){e[n].forEach(function(e){void 0!==t.nodes[e]&&(t.nodes[e][n]=!0)})})}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.nodes).forEach(function(r){t.nodes[r][e]&&n.push(r)}),n}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every(function(e){return null!==e.children?t.isEveryChildChecked(e):e.checked})}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some(function(e){return null!==e.children?t.isSomeChildChecked(e):e.checked})}},{key:"renderTreeNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.props,o=r.disabled,i=r.expandDisabled,a=r.expandOnClick,c=r.noCascade,u=r.onlyLeafCheckboxes,s=r.optimisticToggle,p=r.showNodeIcon,f=r.onClick,d=e.map(function(e){var r="".concat(e.value),d=t.getCheckState(e,c),h=null===e.children,b=t.renderChildNodes(e),y=t.getDisabledState(e,n,o,c),v=u?h:e.showCheckbox;return l.a.createElement(A,{key:r,checked:d,className:e.className,disabled:y,expandDisabled:i,expandOnClick:a,expanded:e.expanded,icon:e.icon,label:e.label,optimisticToggle:s,rawChildren:e.children,showCheckbox:v,showNodeIcon:p,treeId:t.id,value:e.value,onCheck:t.onCheck,onClick:f,onExpand:t.onExpand},b)});return l.a.createElement("ol",null,d)}},{key:"renderChildNodes",value:function(e){return null!==e.children&&e.expanded?this.renderTreeNodes(e.children,e):null}},{key:"renderHiddenInput",value:function(){return void 0===this.props.name?null:this.props.nameAsArray?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this;return this.props.checked.map(function(t){var n="".concat(e.props.name,"[]");return l.a.createElement("input",{key:t,name:n,type:"hidden",value:t})})}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props.checked.join(",");return l.a.createElement("input",{name:this.props.name,type:"hidden",value:e})}},{key:"render",value:function(){var e=this.getFormattedNodes(this.props.nodes),t=this.renderTreeNodes(e),n=o()({"react-checkbox-tree":!0,"rct-disabled":this.props.disabled,"rct-native-display":this.props.nativeCheckboxes});return l.a.createElement("div",{className:n},this.renderHiddenInput(),t)}}]),t}();B(F,"propTypes",{nodes:u.a.arrayOf(O).isRequired,checked:I,disabled:u.a.bool,expandDisabled:u.a.bool,expandOnClick:u.a.bool,expanded:I,name:u.a.string,nameAsArray:u.a.bool,nativeCheckboxes:u.a.bool,noCascade:u.a.bool,onlyLeafCheckboxes:u.a.bool,optimisticToggle:u.a.bool,showNodeIcon:u.a.bool,onCheck:u.a.func,onClick:u.a.func,onExpand:u.a.func}),B(F,"defaultProps",{checked:[],disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showNodeIcon:!0,onCheck:function(){},onClick:function(){},onExpand:function(){}});t.default=F}])}); | ||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===a)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(6),o=n(17),a="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==i||t==c||t==a||t==u}},function(e,t){var n="object"==typeof global&&global&&global.Object===Object&&global;e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(47),o=n(54),a=n(56),i=n(57),c=n(58);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(59),o=n(62),a=n(63),i=1,c=2;e.exports=function(e,t,n,u,l,s){var p=n&i,f=e.length,d=t.length;if(f!=d&&!(p&&d>f))return!1;var h=s.get(e);if(h&&s.get(t))return h==t;var b=-1,y=!0,v=n&c?new r:void 0;for(s.set(e,t),s.set(t,e);++b<f;){var x=e[b],m=t[b];if(u)var g=p?u(m,x,b,t,e,s):u(x,m,b,e,t,s);if(void 0!==g){if(g)continue;y=!1;break}if(v){if(!o(t,function(e,t){if(!a(v,t)&&(x===e||l(x,e,n,u,s)))return v.push(t)})){y=!1;break}}else if(x!==m&&!l(x,m,n,u,s)){y=!1;break}}return s.delete(e),s.delete(t),y}},function(e,t,n){(function(e){var r=n(2),o=n(80),a="object"==typeof t&&t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===a?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;e.exports=u}).call(this,n(22)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(82),o=n(83),a=n(84),i=a&&a.isTypedArray,c=i?o(i):r;e.exports=c},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(28);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=n(95),o=n(97);e.exports=function(e){for(var t="",n=r(e=e||21);0<e--;)t+=o[63&n[e]];return t}},function(e,t,n){e.exports=n(100).default},function(e,t,n){var r=n(29),o=n(9);e.exports=function e(t,n,a,i,c){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,c))}},function(e,t,n){var r=n(30),o=n(20),a=n(64),i=n(68),c=n(90),u=n(13),l=n(21),s=n(23),p=1,f="[object Arguments]",d="[object Array]",h="[object Object]",b=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,y,v,x){var m=u(e),g=u(t),k=m?d:c(e),_=g?d:c(t),j=(k=k==f?h:k)==h,O=(_=_==f?h:_)==h,C=k==_;if(C&&l(e)){if(!l(t))return!1;m=!0,j=!1}if(C&&!j)return x||(x=new r),m||s(e)?o(e,t,n,y,v,x):a(e,t,k,n,y,v,x);if(!(n&p)){var w=j&&b.call(e,"__wrapped__"),E=O&&b.call(t,"__wrapped__");if(w||E){var P=w?e.value():e,N=E?t.value():t;return x||(x=new r),v(P,N,n,y,x)}}return!!C&&(x||(x=new r),i(e,t,n,y,v,x))}},function(e,t,n){var r=n(4),o=n(36),a=n(37),i=n(38),c=n(39),u=n(40);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=a,l.prototype.get=i,l.prototype.has=c,l.prototype.set=u,e.exports=l},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(5),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(5);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(5);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(5);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(4);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(4),o=n(11),a=n(19),i=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var c=n.__data__;if(!o||c.length<i-1)return c.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(c)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),o=n(44),a=n(17),i=n(18),c=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,s=u.toString,p=l.hasOwnProperty,f=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:c).test(i(e))}},function(e,t,n){var r=n(12),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(45),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(48),o=n(4),a=n(11);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},function(e,t,n){var r=n(49),o=n(50),a=n(51),i=n(52),c=n(53);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(7);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__",a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return a.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(7),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(7),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t,n){var r=n(8);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(8);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(8);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(19),o=n(60),a=n(61);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(12),o=n(65),a=n(14),i=n(20),c=n(66),u=n(67),l=1,s=2,p="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Map]",b="[object Number]",y="[object RegExp]",v="[object Set]",x="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",k="[object DataView]",_=r?r.prototype:void 0,j=_?_.valueOf:void 0;e.exports=function(e,t,n,r,_,O,C){switch(n){case k:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case g:return!(e.byteLength!=t.byteLength||!O(new o(e),new o(t)));case p:case f:case b:return a(+e,+t);case d:return e.name==t.name&&e.message==t.message;case y:case x:return e==t+"";case h:var w=c;case v:var E=r&l;if(w||(w=u),e.size!=t.size&&!E)return!1;var P=C.get(e);if(P)return P==t;r|=s,C.set(e,t);var N=i(w(e),w(t),r,_,O,C);return C.delete(e),N;case m:if(j)return j.call(e)==j.call(t)}return!1}},function(e,t,n){var r=n(2).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(69),o=1,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,c,u){var l=n&o,s=r(e),p=s.length;if(p!=r(t).length&&!l)return!1;for(var f=p;f--;){var d=s[f];if(!(l?d in t:a.call(t,d)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var b=!0;u.set(e,t),u.set(t,e);for(var y=l;++f<p;){var v=e[d=s[f]],x=t[d];if(i)var m=l?i(x,v,d,t,e,u):i(v,x,d,e,t,u);if(!(void 0===m?v===x||c(v,x,n,i,u):m)){b=!1;break}y||(y="constructor"==d)}if(b&&!y){var g=e.constructor,k=t.constructor;g!=k&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof k&&k instanceof k)&&(b=!1)}return u.delete(e),u.delete(t),b}},function(e,t,n){var r=n(70),o=n(72),a=n(75);e.exports=function(e){return r(e,a,o)}},function(e,t,n){var r=n(71),o=n(13);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(73),o=n(74),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,c=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return a.call(e,t)}))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(76),o=n(85),a=n(89);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){var r=n(77),o=n(78),a=n(13),i=n(21),c=n(81),u=n(23),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),s=!n&&o(e),p=!n&&!s&&i(e),f=!n&&!s&&!p&&u(e),d=n||s||p||f,h=d?r(e.length,String):[],b=h.length;for(var y in e)!t&&!l.call(e,y)||d&&("length"==y||p&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||c(y,b))||h.push(y);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(79),o=n(9),a=Object.prototype,i=a.hasOwnProperty,c=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!c.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(6),o=n(9),a="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==a}},function(e,t){e.exports=function(){return!1}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(6),o=n(24),a=n(9),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(16),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,c=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,n(22)(e))},function(e,t,n){var r=n(86),o=n(87),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(88)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(15),o=n(24);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(91),o=n(11),a=n(92),i=n(93),c=n(94),u=n(6),l=n(18),s=l(r),p=l(o),f=l(a),d=l(i),h=l(c),b=u;(r&&"[object DataView]"!=b(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=b(new o)||a&&"[object Promise]"!=b(a.resolve())||i&&"[object Set]"!=b(new i)||c&&"[object WeakMap]"!=b(new c))&&(b=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case s:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=b},function(e,t,n){var r=n(3)(n(2),"DataView");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Promise");e.exports=r},function(e,t,n){var r=n(3)(n(2),"Set");e.exports=r},function(e,t,n){var r=n(3)(n(2),"WeakMap");e.exports=r},function(e,t,n){e.exports=n(96).randomBytes},function(e,t){e.exports=require("crypto")},function(e,t){e.exports="_~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"},function(e,t,n){"use strict";var r=n(99);function o(){}e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var c=new Error("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");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={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,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(10),o=n.n(r),a=n(25),i=n.n(a),c=n(26),u=n.n(c),l=n(0),s=n.n(l),p=n(1),f=n.n(p);function d(e){return(d="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})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),v(this,x(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,f.a.PureComponent),function(e,t,n){t&&y(e.prototype,t),n&&y(e,n)}(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.title,r=b(e,["children","title"]);return f.a.createElement("button",h({"aria-label":n,title:n,type:"button"},r),t)}}]),t}();g(k,"propTypes",{children:s.a.node.isRequired,title:s.a.string}),g(k,"defaultProps",{title:null});var _=k;function j(e){return(j="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})(e)}function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),w(this,E(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,f.a.PureComponent),function(e,t,n){t&&C(e.prototype,t),n&&C(e,n)}(t,[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){N(e,t,n[t])})}return e}({},this.props);return delete t.indeterminate,f.a.createElement("input",O({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}]),t}();N(S,"propTypes",{indeterminate:s.a.bool}),N(S,"defaultProps",{indeterminate:!1});var A=S,T=s.a.shape({check:s.a.node,uncheck:s.a.node,halfCheck:s.a.node,expandClose:s.a.node,expandOpen:s.a.node,parentClose:s.a.node,parentOpen:s.a.node,leaf:s.a.node}),R={collapseAll:s.a.string.isRequired,expandAll:s.a.string.isRequired,toggle:s.a.string.isRequired};function I(e){return(I="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})(e)}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?D(e):t}(this,z(t).call(this,e))).onCheck=n.onCheck.bind(D(D(n))),n.onClick=n.onClick.bind(D(D(n))),n.onExpand=n.onExpand.bind(D(D(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(t,f.a.Component),function(e,t,n){t&&L(e.prototype,t),n&&L(e,n)}(t,[{key:"onCheck",value:function(){var e=!1;0===this.props.checked&&(e=!0),2===this.props.checked&&(e=this.props.optimisticToggle),this.props.onCheck({value:this.props.value,checked:e})}},{key:"onClick",value:function(){var e=this.props,t=e.checked,n=e.expandOnClick,r=e.isParent,o=e.optimisticToggle,a=e.value,i=e.onClick,c=!1;1===t&&(c=!0),2===t&&(c=o),r&&n&&this.onExpand(),i({value:a,checked:c})}},{key:"onExpand",value:function(){var e=this.props,t=e.expanded,n=e.value,r=e.onExpand;r({value:n,expanded:!t})}},{key:"renderCollapseButton",value:function(){var e=this.props,t=e.expandDisabled,n=e.isLeaf,r=e.lang;return n?f.a.createElement("span",{className:"rct-collapse"},f.a.createElement("span",{className:"rct-icon"})):f.a.createElement(_,{className:"rct-collapse rct-collapse-btn",disabled:t,title:r.toggle,onClick:this.onExpand},this.renderCollapseIcon())}},{key:"renderCollapseIcon",value:function(){var e=this.props,t=e.expanded,n=e.icons,r=n.expandClose,o=n.expandOpen;return t?o:r}},{key:"renderCheckboxIcon",value:function(){var e=this.props,t=e.checked,n=e.icons,r=n.uncheck,o=n.check,a=n.halfCheck;return 0===t?r:1===t?o:a}},{key:"renderNodeIcon",value:function(){var e=this.props,t=e.expanded,n=e.icon,r=e.icons,o=r.leaf,a=r.parentClose,i=r.parentOpen,c=e.isLeaf;return null!==n?n:c?o:t?i:a}},{key:"renderBareLabel",value:function(e){var n=this.props,r=n.onClick,o=n.title,a=r.toString()!==t.defaultProps.onClick.toString();return f.a.createElement("span",{className:"rct-bare-label",title:o},a?f.a.createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var n=this.props,r=n.checked,o=n.disabled,a=(n.label,n.title),i=n.treeId,c=n.value,u=n.onClick.toString()!==t.defaultProps.onClick.toString(),l="".concat(i,"-").concat(String(c).split(" ").join("_")),s=[f.a.createElement("label",{key:0,htmlFor:l,title:a},f.a.createElement(A,{checked:1===r,disabled:o,id:l,indeterminate:2===r,onChange:this.onCheck}),f.a.createElement("span",{className:"rct-checkbox"},this.renderCheckboxIcon()),u?null:e)];return u&&s.push(f.a.createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),s}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?f.a.createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,f.a.createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.disabled,r=e.isLeaf,a=o()({"rct-node":!0,"rct-node-leaf":r,"rct-node-parent":!r,"rct-disabled":n},t);return f.a.createElement("li",{className:a},f.a.createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}]),t}();B(M,"propTypes",{checked:s.a.number.isRequired,disabled:s.a.bool.isRequired,expandDisabled:s.a.bool.isRequired,expanded:s.a.bool.isRequired,icons:T.isRequired,isLeaf:s.a.bool.isRequired,isParent:s.a.bool.isRequired,label:s.a.node.isRequired,lang:R.isRequired,optimisticToggle:s.a.bool.isRequired,showNodeIcon:s.a.bool.isRequired,treeId:s.a.string.isRequired,value:s.a.oneOfType([s.a.string,s.a.number]).isRequired,onCheck:s.a.func.isRequired,onExpand:s.a.func.isRequired,children:s.a.node,className:s.a.string,expandOnClick:s.a.bool,icon:s.a.node,showCheckbox:s.a.bool,title:s.a.string,onClick:s.a.func}),B(M,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,showCheckbox:!0,title:null,onClick:function(){}});var F=M,H=s.a.oneOfType([s.a.arrayOf(s.a.string),s.a.arrayOf(s.a.number)]);function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var V={label:s.a.node.isRequired,value:s.a.oneOfType([s.a.string,s.a.number]).isRequired,disabled:s.a.bool,icon:s.a.node,showCheckbox:s.a.bool,title:s.a.string},W=s.a.oneOfType([s.a.shape(V),s.a.shape(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){U(e,t,n[t])})}return e}({},V,{children:s.a.arrayOf(V).isRequired}))]);function $(e){return($="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})(e)}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){X(e,t,n[t])})}return e}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==$(t)&&"function"!=typeof t?Q(e):t}(this,G(t).call(this,e))).id="rct-".concat(u()(7)),n.flatNodes={},n.flattenNodes(e.nodes),n.deserializeLists({checked:e.checked,expanded:e.expanded}),n.onCheck=n.onCheck.bind(Q(Q(n))),n.onExpand=n.onExpand.bind(Q(Q(n))),n.onExpandAll=n.onExpandAll.bind(Q(Q(n))),n.onCollapseAll=n.onCollapseAll.bind(Q(Q(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(t,f.a.Component),function(e,t,n){t&&K(e.prototype,t),n&&K(e,n)}(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.nodes,n=e.checked,r=e.expanded;i()(this.props.nodes,t)||this.flattenNodes(t),this.deserializeLists({checked:n,expanded:r})}},{key:"onCheck",value:function(e){var t=this.props,n=t.noCascade,r=t.onCheck,o=this.flatNodes[e.value];this.toggleChecked(e,e.checked,n),r(this.serializeList("checked"),J({},e,{children:o.self.children}))}},{key:"onExpand",value:function(e){var t=this.props.onExpand,n=this.flatNodes[e.value];this.toggleNode(e.value,"expanded",e.expanded),t(this.serializeList("expanded"),J({},e,{children:n.self.children}))}},{key:"onExpandAll",value:function(){this.expandAllNodes()}},{key:"onCollapseAll",value:function(){this.expandAllNodes(!1)}},{key:"getShallowCheckState",value:function(e,t){var n=this.flatNodes[e.value];return n.isLeaf||t?n.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||(!(r||!t.disabled)||Boolean(e.disabled))}},{key:"nodeHasChildren",value:function(e){return Array.isArray(e.children)&&e.children.length>0}},{key:"expandAllNodes",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.props.onExpand;Object.keys(this.flatNodes).forEach(function(n){e.flatNodes[n].isParent&&(e.flatNodes[n].expanded=t)}),n(this.serializeList("expanded",null))}},{key:"toggleChecked",value:function(e,t,n){var r=this,o=this.flatNodes[e.value];if(o.isLeaf||n){if(e.disabled)return;this.toggleNode(e.value,"checked",t)}else o.self.children.forEach(function(e){r.toggleChecked(e,t,n)})}},{key:"toggleNode",value:function(e,t,n){this.flatNodes[e][t]=n}},{key:"flattenNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)&&0!==e.length){var r=this.props,o=r.disabled,a=r.noCascade;e.forEach(function(e){var r=t.nodeHasChildren(e);t.flatNodes[e.value]={self:e,parent:n,isParent:r,isLeaf:!r,showCheckbox:void 0===e.showCheckbox||e.showCheckbox,disabled:t.getDisabledState(e,n,o,a)},t.flattenNodes(e.children,e)})}}},{key:"deserializeLists",value:function(e){var t=this;Object.keys(this.flatNodes).forEach(function(n){Object.keys(e).forEach(function(e){t.flatNodes[n][e]=!1})}),Object.keys(e).forEach(function(n){e[n].forEach(function(e){void 0!==t.flatNodes[e]&&(t.flatNodes[e][n]=!0)})})}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.flatNodes).forEach(function(r){t.flatNodes[r][e]&&n.push(r)}),n}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every(function(e){return 1===t.flatNodes[e.value].checkState})}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some(function(e){return t.flatNodes[e.value].checkState>0})}},{key:"renderTreeNodes",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.props,a=o.expandDisabled,i=o.expandOnClick,c=o.icons,u=o.lang,l=o.noCascade,s=o.onlyLeafCheckboxes,p=o.optimisticToggle,d=o.showNodeTitle,h=o.showNodeIcon,b=o.onClick,y=t.defaultProps.icons,v=e.map(function(e){var t="".concat(e.value),o=n.flatNodes[e.value],v=o.isParent?n.renderTreeNodes(e.children,e):null;o.checkState=n.getShallowCheckState(e,l);var x=s?o.isLeaf:o.showCheckbox;return!r.value||n.flatNodes[r.value].expanded?f.a.createElement(F,{key:t,checked:o.checkState,className:e.className,disabled:o.disabled,expandDisabled:a,expandOnClick:i,expanded:o.expanded,icon:e.icon,icons:J({},y,c),label:e.label,lang:u,optimisticToggle:p,isLeaf:o.isLeaf,isParent:o.isParent,showCheckbox:x,showNodeIcon:h,title:d?e.title||e.label:e.title,treeId:n.id,value:e.value,onCheck:n.onCheck,onClick:b,onExpand:n.onExpand},v):null});return f.a.createElement("ol",null,v)}},{key:"renderExpandAll",value:function(){var e=this.props,t=e.icons,n=t.expandAll,r=t.collapseAll,o=e.lang;return e.showExpandAll?f.a.createElement("div",{className:"rct-options"},f.a.createElement(_,{className:"rct-option rct-option-expand-all",title:o.expandAll,onClick:this.onExpandAll},n),f.a.createElement(_,{className:"rct-option rct-option-collapse-all",title:o.collapseAll,onClick:this.onCollapseAll},r)):null}},{key:"renderHiddenInput",value:function(){var e=this.props,t=e.name,n=e.nameAsArray;return void 0===t?null:n?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name;return t.map(function(e){var t="".concat(n,"[]");return f.a.createElement("input",{key:e,name:t,type:"hidden",value:e})})}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name,r=t.join(",");return f.a.createElement("input",{name:n,type:"hidden",value:r})}},{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.nodes,r=e.nativeCheckboxes,a=this.renderTreeNodes(n),i=o()({"react-checkbox-tree":!0,"rct-disabled":t,"rct-native-display":r});return f.a.createElement("div",{className:i},this.renderExpandAll(),this.renderHiddenInput(),a)}}]),t}();X(Z,"propTypes",{nodes:s.a.arrayOf(W).isRequired,checked:H,disabled:s.a.bool,expandDisabled:s.a.bool,expandOnClick:s.a.bool,expanded:H,icons:T,lang:R,name:s.a.string,nameAsArray:s.a.bool,nativeCheckboxes:s.a.bool,noCascade:s.a.bool,onlyLeafCheckboxes:s.a.bool,optimisticToggle:s.a.bool,showExpandAll:s.a.bool,showNodeIcon:s.a.bool,showNodeTitle:s.a.bool,onCheck:s.a.func,onClick:s.a.func,onExpand:s.a.func}),X(Z,"defaultProps",{checked:[],disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:f.a.createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:f.a.createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:f.a.createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:f.a.createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:f.a.createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:f.a.createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:f.a.createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:f.a.createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:f.a.createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:f.a.createElement("span",{className:"rct-icon rct-icon-leaf"})},lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:function(){},onExpand:function(){}});t.default=Z}])}); |
{ | ||
"name": "react-checkbox-tree", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "A simple and elegant checkbox tree for React.", | ||
"author": "Jake Zatecky", | ||
"license": "MIT", | ||
"types": "src/index.d.ts", | ||
"keywords": [ | ||
@@ -36,2 +37,3 @@ "react", | ||
"@babel/register": "^7.0.0", | ||
"@types/react": "^16.4.13", | ||
"babel-eslint": "^9.0.0", | ||
@@ -51,5 +53,8 @@ "babel-loader": "^8.0.0", | ||
"gulp-autoprefixer": "^6.0.0", | ||
"gulp-clean-css": "^3.10.0", | ||
"gulp-eslint": "^5.0.0", | ||
"gulp-header": "^2.0.5", | ||
"gulp-less": "^4.0.1", | ||
"gulp-mocha": "^6.0.0", | ||
"gulp-run": "^1.7.1", | ||
"gulp-sass": "^4.0.1", | ||
@@ -56,0 +61,0 @@ "gulp-scss-lint": "^0.7.0", |
@@ -90,22 +90,50 @@ # react-checkbox-tree | ||
#### Changing the Default Icons | ||
By default, **react-checkbox-tree** use Font Awesome for the various icons that appear in the tree. To change the defaults, simply pass in the `icons` property and override the defaults: | ||
``` jsx | ||
<CheckboxTree | ||
... | ||
icons={{ | ||
check: <span className="rct-icon rct-icon-check" />, | ||
uncheck: <span className="rct-icon rct-icon-uncheck" />, | ||
halfCheck: <span className="rct-icon rct-icon-half-check" />, | ||
expandClose: <span className="rct-icon rct-icon-expand-close" />, | ||
expandOpen: <span className="rct-icon rct-icon-expand-open" />, | ||
expandAll: <span className="rct-icon rct-icon-expand-all" />, | ||
collapseAll: <span className="rct-icon rct-icon-collapse-all" />, | ||
parentClose: <span className="rct-icon rct-icon-parent-close" />, | ||
parentOpen: <span className="rct-icon rct-icon-parent-open" />, | ||
leaf: <span className="rct-icon rct-icon-leaf" />, | ||
}} | ||
/> | ||
``` | ||
Note that you can override as many or as little icons as you like. | ||
### Properties | ||
| Property | Type | Description | Default | | ||
| -------------------- | -------- | ------------------------------------------------------------------------------------------------ | ----------- | | ||
| `nodes` | array | **Required**. Specifies the tree nodes and their children. | | | ||
| `checked` | array | An array of checked node values. | `[]` | | ||
| `disabled` | bool | If true, the component will be disabled and nodes cannot be checked. | `false` | | ||
| `expandDisabled` | bool | If true, the ability to expand nodes will be disabled. | `false` | | ||
| `expandOnClick` | bool | If true, nodes will be expanded by clicking on labels. Requires a non-empty `onClick` function. | `false` | | ||
| `expanded` | array | An array of expanded node values. | `[]` | | ||
| `name` | string | Optional name for the hidden `<input>` element. | `undefined` | | ||
| `nameAsArray` | bool | If true, the hidden `<input>` will encode its values as an array rather than a joined string. | `false` | | ||
| `nativeCheckboxes` | bool | If true, native browser checkboxes will be used instead of pseudo-checkbox icons. | `false` | | ||
| `noCascade` | bool | If true, toggling a parent node will **not** cascade its check state to its children. | `false` | | ||
| `onlyLeafCheckboxes` | bool | If true, checkboxes will only be shown for leaf nodes. | `false` | | ||
| `optimisticToggle` | bool | If true, toggling a partially-checked node will select all children. If false, it will deselect. | `true` | | ||
| `showNodeIcon` | bool | If true, each node will show a parent or leaf icon. | `true` | | ||
| `onCheck` | function | onCheck handler: `function(checked) {}` | `() => {}` | | ||
| `onClick` | function | onClick handler: `function(clicked) {}`. If set, it will be called when clicked on a node label. | `() => {}` | | ||
| `onExpand` | function | onExpand handler: `function(expanded) {}` | `() => {}` | | ||
| Property | Type | Description | Default | | ||
| -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | ----------- | | ||
| `nodes` | array | **Required**. Specifies the tree nodes and their children. | | | ||
| `checked` | array | An array of checked node values. | `[]` | | ||
| `disabled` | bool | If true, the component will be disabled and nodes cannot be checked. | `false` | | ||
| `expandDisabled` | bool | If true, the ability to expand nodes will be disabled. | `false` | | ||
| `expandOnClick` | bool | If true, nodes will be expanded by clicking on labels. Requires a non-empty `onClick` function. | `false` | | ||
| `icons` | object | An object containing the mappings for the various icons and their components. See **Changing the Default Icons**. | { ... } | | ||
| `expanded` | array | An array of expanded node values. | `[]` | | ||
| `lang` | object | An object containing the language mappings for the various text elements. | { ... } | | ||
| `name` | string | Optional name for the hidden `<input>` element. | `undefined` | | ||
| `nameAsArray` | bool | If true, the hidden `<input>` will encode its values as an array rather than a joined string. | `false` | | ||
| `nativeCheckboxes` | bool | If true, native browser checkboxes will be used instead of pseudo-checkbox icons. | `false` | | ||
| `noCascade` | bool | If true, toggling a parent node will **not** cascade its check state to its children. | `false` | | ||
| `onlyLeafCheckboxes` | bool | If true, checkboxes will only be shown for leaf nodes. | `false` | | ||
| `optimisticToggle` | bool | If true, toggling a partially-checked node will select all children. If false, it will deselect. | `true` | | ||
| `showExpandAll` | bool | If true, buttons for expanding and collapsing all parent nodes will appear in the tree. | `false` | | ||
| `showNodeIcon` | bool | If true, each node will show a parent or leaf icon. | `true` | | ||
| `showNodeTitle` | bool | If true, the `label` of each node will become the `title` of the resulting DOM node. Overridden by `node.title`. | `false` | | ||
| `onCheck` | function | onCheck handler: `function(checked) {}` | `() => {}` | | ||
| `onClick` | function | onClick handler: `function(clicked) {}`. If set, it will be called when clicked on a node label. | `() => {}` | | ||
| `onExpand` | function | onExpand handler: `function(expanded) {}` | `() => {}` | | ||
@@ -125,1 +153,2 @@ #### Node Properties | ||
| `showCheckbox` | bool | Whether the node should show a checkbox. | `true` | | ||
| `title` | string | A custom `title` attribute for the node. | `null` | |
import classNames from 'classnames'; | ||
import isEqual from 'lodash/isEqual'; | ||
import nanoid from 'nanoid'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import nanoid from 'nanoid'; | ||
import Button from './Button'; | ||
import TreeNode from './TreeNode'; | ||
import listShape from './listShape'; | ||
import nodeShape from './nodeShape'; | ||
import iconsShape from './shapes/iconsShape'; | ||
import languageShape from './shapes/languageShape'; | ||
import listShape from './shapes/listShape'; | ||
import nodeShape from './shapes/nodeShape'; | ||
@@ -20,2 +23,4 @@ class CheckboxTree extends React.Component { | ||
expanded: listShape, | ||
icons: iconsShape, | ||
lang: languageShape, | ||
name: PropTypes.string, | ||
@@ -27,3 +32,5 @@ nameAsArray: PropTypes.bool, | ||
optimisticToggle: PropTypes.bool, | ||
showExpandAll: PropTypes.bool, | ||
showNodeIcon: PropTypes.bool, | ||
showNodeTitle: PropTypes.bool, | ||
onCheck: PropTypes.func, | ||
@@ -40,2 +47,19 @@ onClick: PropTypes.func, | ||
expanded: [], | ||
icons: { | ||
check: <span className="rct-icon rct-icon-check" />, | ||
uncheck: <span className="rct-icon rct-icon-uncheck" />, | ||
halfCheck: <span className="rct-icon rct-icon-half-check" />, | ||
expandClose: <span className="rct-icon rct-icon-expand-close" />, | ||
expandOpen: <span className="rct-icon rct-icon-expand-open" />, | ||
expandAll: <span className="rct-icon rct-icon-expand-all" />, | ||
collapseAll: <span className="rct-icon rct-icon-collapse-all" />, | ||
parentClose: <span className="rct-icon rct-icon-parent-close" />, | ||
parentOpen: <span className="rct-icon rct-icon-parent-open" />, | ||
leaf: <span className="rct-icon rct-icon-leaf" />, | ||
}, | ||
lang: { | ||
collapseAll: 'Collapse all', | ||
expandAll: 'Expand all', | ||
toggle: 'Toggle', | ||
}, | ||
name: undefined, | ||
@@ -47,3 +71,5 @@ nameAsArray: false, | ||
optimisticToggle: true, | ||
showExpandAll: false, | ||
showNodeIcon: true, | ||
showNodeTitle: false, | ||
onCheck: () => {}, | ||
@@ -58,6 +84,6 @@ onClick: () => {}, | ||
this.id = `rct-${nanoid(7)}`; | ||
this.nodes = {}; | ||
this.flatNodes = {}; | ||
this.flattenNodes(props.nodes); | ||
this.unserializeLists({ | ||
this.deserializeLists({ | ||
checked: props.checked, | ||
@@ -69,2 +95,4 @@ expanded: props.expanded, | ||
this.onExpand = this.onExpand.bind(this); | ||
this.onExpandAll = this.onExpandAll.bind(this); | ||
this.onCollapseAll = this.onCollapseAll.bind(this); | ||
} | ||
@@ -77,40 +105,34 @@ | ||
this.unserializeLists({ checked, expanded }); | ||
this.deserializeLists({ checked, expanded }); | ||
} | ||
onCheck(node) { | ||
onCheck(nodeInfo) { | ||
const { noCascade, onCheck } = this.props; | ||
const node = this.flatNodes[nodeInfo.value]; | ||
this.toggleChecked(node, node.checked, noCascade); | ||
onCheck(this.serializeList('checked'), node); | ||
this.toggleChecked(nodeInfo, nodeInfo.checked, noCascade); | ||
onCheck(this.serializeList('checked'), { ...nodeInfo, children: node.self.children }); | ||
} | ||
onExpand(node) { | ||
onExpand(nodeInfo) { | ||
const { onExpand } = this.props; | ||
const node = this.flatNodes[nodeInfo.value]; | ||
this.toggleNode('expanded', node, node.expanded); | ||
onExpand(this.serializeList('expanded'), node); | ||
this.toggleNode(nodeInfo.value, 'expanded', nodeInfo.expanded); | ||
onExpand(this.serializeList('expanded'), { ...nodeInfo, children: node.self.children }); | ||
} | ||
getFormattedNodes(nodes) { | ||
return nodes.map((node) => { | ||
const formatted = { ...node }; | ||
onExpandAll() { | ||
this.expandAllNodes(); | ||
} | ||
formatted.checked = this.nodes[node.value].checked; | ||
formatted.expanded = this.nodes[node.value].expanded; | ||
formatted.showCheckbox = node.showCheckbox !== undefined ? node.showCheckbox : true; | ||
onCollapseAll() { | ||
this.expandAllNodes(false); | ||
} | ||
if (Array.isArray(node.children) && node.children.length > 0) { | ||
formatted.children = this.getFormattedNodes(formatted.children); | ||
} else { | ||
formatted.children = null; | ||
} | ||
getShallowCheckState(node, noCascade) { | ||
const flatNode = this.flatNodes[node.value]; | ||
return formatted; | ||
}); | ||
} | ||
getCheckState(node, noCascade) { | ||
if (node.children === null || noCascade) { | ||
return node.checked ? 1 : 0; | ||
if (flatNode.isLeaf || noCascade) { | ||
return flatNode.checked ? 1 : 0; | ||
} | ||
@@ -141,10 +163,32 @@ | ||
nodeHasChildren(node) { | ||
return Array.isArray(node.children) && node.children.length > 0; | ||
} | ||
expandAllNodes(expand = true) { | ||
const { onExpand } = this.props; | ||
Object.keys(this.flatNodes).forEach((value) => { | ||
if (this.flatNodes[value].isParent) { | ||
this.flatNodes[value].expanded = expand; | ||
} | ||
}); | ||
onExpand(this.serializeList('expanded', null)); | ||
} | ||
toggleChecked(node, isChecked, noCascade) { | ||
if (node.children === null || noCascade) { | ||
const flatNode = this.flatNodes[node.value]; | ||
if (flatNode.isLeaf || noCascade) { | ||
if (node.disabled) { | ||
return; | ||
} | ||
// Set the check status of a leaf node or an uncoupled parent | ||
this.toggleNode('checked', node, isChecked); | ||
this.toggleNode(node.value, 'checked', isChecked); | ||
} else { | ||
// Percolate check status down to all children | ||
node.children.forEach((child) => { | ||
this.toggleChecked(child, isChecked); | ||
flatNode.self.children.forEach((child) => { | ||
this.toggleChecked(child, isChecked, noCascade); | ||
}); | ||
@@ -154,7 +198,7 @@ } | ||
toggleNode(key, node, toggleValue) { | ||
this.nodes[node.value][key] = toggleValue; | ||
toggleNode(nodeValue, key, toggleValue) { | ||
this.flatNodes[nodeValue][key] = toggleValue; | ||
} | ||
flattenNodes(nodes) { | ||
flattenNodes(nodes, parent = {}) { | ||
if (!Array.isArray(nodes) || nodes.length === 0) { | ||
@@ -164,21 +208,32 @@ return; | ||
const { disabled, noCascade } = this.props; | ||
nodes.forEach((node) => { | ||
this.nodes[node.value] = {}; | ||
this.flattenNodes(node.children); | ||
const isParent = this.nodeHasChildren(node); | ||
this.flatNodes[node.value] = { | ||
self: node, | ||
parent, | ||
isParent, | ||
isLeaf: !isParent, | ||
showCheckbox: node.showCheckbox !== undefined ? node.showCheckbox : true, | ||
disabled: this.getDisabledState(node, parent, disabled, noCascade), | ||
}; | ||
this.flattenNodes(node.children, node); | ||
}); | ||
} | ||
unserializeLists(lists) { | ||
deserializeLists(lists) { | ||
// Reset values to false | ||
Object.keys(this.nodes).forEach((value) => { | ||
Object.keys(this.flatNodes).forEach((value) => { | ||
Object.keys(lists).forEach((listKey) => { | ||
this.nodes[value][listKey] = false; | ||
this.flatNodes[value][listKey] = false; | ||
}); | ||
}); | ||
// Unserialize values and set their nodes to true | ||
// Deserialize values and set their nodes to true | ||
Object.keys(lists).forEach((listKey) => { | ||
lists[listKey].forEach((value) => { | ||
if (this.nodes[value] !== undefined) { | ||
this.nodes[value][listKey] = true; | ||
if (this.flatNodes[value] !== undefined) { | ||
this.flatNodes[value][listKey] = true; | ||
} | ||
@@ -192,4 +247,4 @@ }); | ||
Object.keys(this.nodes).forEach((value) => { | ||
if (this.nodes[value][key]) { | ||
Object.keys(this.flatNodes).forEach((value) => { | ||
if (this.flatNodes[value][key]) { | ||
list.push(value); | ||
@@ -203,19 +258,7 @@ } | ||
isEveryChildChecked(node) { | ||
return node.children.every((child) => { | ||
if (child.children !== null) { | ||
return this.isEveryChildChecked(child); | ||
} | ||
return child.checked; | ||
}); | ||
return node.children.every(child => this.flatNodes[child.value].checkState === 1); | ||
} | ||
isSomeChildChecked(node) { | ||
return node.children.some((child) => { | ||
if (child.children !== null) { | ||
return this.isSomeChildChecked(child); | ||
} | ||
return child.checked; | ||
}); | ||
return node.children.some(child => this.flatNodes[child.value].checkState > 0); | ||
} | ||
@@ -225,35 +268,52 @@ | ||
const { | ||
disabled, | ||
expandDisabled, | ||
expandOnClick, | ||
icons, | ||
lang, | ||
noCascade, | ||
onlyLeafCheckboxes, | ||
optimisticToggle, | ||
showNodeTitle, | ||
showNodeIcon, | ||
onClick, | ||
} = this.props; | ||
const { icons: defaultIcons } = CheckboxTree.defaultProps; | ||
const treeNodes = nodes.map((node) => { | ||
const key = `${node.value}`; | ||
const checked = this.getCheckState(node, noCascade); | ||
const isLeaf = node.children === null; | ||
const children = this.renderChildNodes(node); | ||
const nodeDisabled = this.getDisabledState(node, parent, disabled, noCascade); | ||
const flatNode = this.flatNodes[node.value]; | ||
const children = flatNode.isParent ? this.renderTreeNodes(node.children, node) : null; | ||
// Get the check state after all children check states are determined | ||
flatNode.checkState = this.getShallowCheckState(node, noCascade); | ||
// Show checkbox only if this is a leaf node or showCheckbox is true | ||
const showCheckbox = onlyLeafCheckboxes ? isLeaf : node.showCheckbox; | ||
const showCheckbox = onlyLeafCheckboxes ? flatNode.isLeaf : flatNode.showCheckbox; | ||
// Render only if parent is expanded or if there is no root parent | ||
const parentExpanded = parent.value ? this.flatNodes[parent.value].expanded : true; | ||
if (!parentExpanded) { | ||
return null; | ||
} | ||
return ( | ||
<TreeNode | ||
key={key} | ||
checked={checked} | ||
checked={flatNode.checkState} | ||
className={node.className} | ||
disabled={nodeDisabled} | ||
disabled={flatNode.disabled} | ||
expandDisabled={expandDisabled} | ||
expandOnClick={expandOnClick} | ||
expanded={node.expanded} | ||
expanded={flatNode.expanded} | ||
icon={node.icon} | ||
icons={{ ...defaultIcons, ...icons }} | ||
label={node.label} | ||
lang={lang} | ||
optimisticToggle={optimisticToggle} | ||
rawChildren={node.children} | ||
isLeaf={flatNode.isLeaf} | ||
isParent={flatNode.isParent} | ||
showCheckbox={showCheckbox} | ||
showNodeIcon={showNodeIcon} | ||
title={showNodeTitle ? node.title || node.label : node.title} | ||
treeId={this.id} | ||
@@ -277,16 +337,37 @@ value={node.value} | ||
renderChildNodes(node) { | ||
if (node.children !== null && node.expanded) { | ||
return this.renderTreeNodes(node.children, node); | ||
renderExpandAll() { | ||
const { icons: { expandAll, collapseAll }, lang, showExpandAll } = this.props; | ||
if (!showExpandAll) { | ||
return null; | ||
} | ||
return null; | ||
return ( | ||
<div className="rct-options"> | ||
<Button | ||
className="rct-option rct-option-expand-all" | ||
title={lang.expandAll} | ||
onClick={this.onExpandAll} | ||
> | ||
{expandAll} | ||
</Button> | ||
<Button | ||
className="rct-option rct-option-collapse-all" | ||
title={lang.collapseAll} | ||
onClick={this.onCollapseAll} | ||
> | ||
{collapseAll} | ||
</Button> | ||
</div> | ||
); | ||
} | ||
renderHiddenInput() { | ||
if (this.props.name === undefined) { | ||
const { name, nameAsArray } = this.props; | ||
if (name === undefined) { | ||
return null; | ||
} | ||
if (this.props.nameAsArray) { | ||
if (nameAsArray) { | ||
return this.renderArrayHiddenInput(); | ||
@@ -299,5 +380,7 @@ } | ||
renderArrayHiddenInput() { | ||
return this.props.checked.map((value) => { | ||
const name = `${this.props.name}[]`; | ||
const { checked, name: inputName } = this.props; | ||
return checked.map((value) => { | ||
const name = `${inputName}[]`; | ||
return <input key={value} name={name} type="hidden" value={value} />; | ||
@@ -308,14 +391,16 @@ }); | ||
renderJoinedHiddenInput() { | ||
const checked = this.props.checked.join(','); | ||
const { checked, name } = this.props; | ||
const inputValue = checked.join(','); | ||
return <input name={this.props.name} type="hidden" value={checked} />; | ||
return <input name={name} type="hidden" value={inputValue} />; | ||
} | ||
render() { | ||
const nodes = this.getFormattedNodes(this.props.nodes); | ||
const { disabled, nodes, nativeCheckboxes } = this.props; | ||
const treeNodes = this.renderTreeNodes(nodes); | ||
const className = classNames({ | ||
'react-checkbox-tree': true, | ||
'rct-disabled': this.props.disabled, | ||
'rct-native-display': this.props.nativeCheckboxes, | ||
'rct-disabled': disabled, | ||
'rct-native-display': nativeCheckboxes, | ||
}); | ||
@@ -325,2 +410,3 @@ | ||
<div className={className}> | ||
{this.renderExpandAll()} | ||
{this.renderHiddenInput()} | ||
@@ -327,0 +413,0 @@ {treeNodes} |
@@ -5,4 +5,6 @@ import classNames from 'classnames'; | ||
import Button from './Button'; | ||
import NativeCheckbox from './NativeCheckbox'; | ||
import nodeShape from './nodeShape'; | ||
import iconsShape from './shapes/iconsShape'; | ||
import languageShape from './shapes/languageShape'; | ||
@@ -15,3 +17,7 @@ class TreeNode extends React.Component { | ||
expanded: PropTypes.bool.isRequired, | ||
icons: iconsShape.isRequired, | ||
isLeaf: PropTypes.bool.isRequired, | ||
isParent: PropTypes.bool.isRequired, | ||
label: PropTypes.node.isRequired, | ||
lang: languageShape.isRequired, | ||
optimisticToggle: PropTypes.bool.isRequired, | ||
@@ -31,4 +37,4 @@ showNodeIcon: PropTypes.bool.isRequired, | ||
icon: PropTypes.node, | ||
rawChildren: PropTypes.arrayOf(nodeShape), | ||
showCheckbox: PropTypes.bool, | ||
title: PropTypes.string, | ||
onClick: PropTypes.func, | ||
@@ -42,4 +48,4 @@ }; | ||
icon: null, | ||
rawChildren: null, | ||
showCheckbox: true, | ||
title: null, | ||
onClick: () => {}, | ||
@@ -72,3 +78,2 @@ }; | ||
checked: isChecked, | ||
children: this.props.rawChildren, | ||
}); | ||
@@ -78,5 +83,13 @@ } | ||
onClick() { | ||
const { | ||
checked, | ||
expandOnClick, | ||
isParent, | ||
optimisticToggle, | ||
value, | ||
onClick, | ||
} = this.props; | ||
let isChecked = false; | ||
if (this.props.checked === 1) { | ||
if (checked === 1) { | ||
isChecked = true; | ||
@@ -86,33 +99,24 @@ } | ||
// Get partial state based on cascade model | ||
if (this.props.checked === 2) { | ||
isChecked = this.props.optimisticToggle; | ||
if (checked === 2) { | ||
isChecked = optimisticToggle; | ||
} | ||
// Auto expand if enabled | ||
if (this.hasChildren() && this.props.expandOnClick) { | ||
if (isParent && expandOnClick) { | ||
this.onExpand(); | ||
} | ||
this.props.onClick({ | ||
value: this.props.value, | ||
checked: isChecked, | ||
children: this.props.rawChildren, | ||
}); | ||
onClick({ value, checked: isChecked }); | ||
} | ||
onExpand() { | ||
this.props.onExpand({ | ||
value: this.props.value, | ||
expanded: !this.props.expanded, | ||
}); | ||
} | ||
const { expanded, value, onExpand } = this.props; | ||
hasChildren() { | ||
return this.props.rawChildren !== null; | ||
onExpand({ value, expanded: !expanded }); | ||
} | ||
renderCollapseButton() { | ||
const { expandDisabled } = this.props; | ||
const { expandDisabled, isLeaf, lang } = this.props; | ||
if (!this.hasChildren()) { | ||
if (isLeaf) { | ||
return ( | ||
@@ -126,12 +130,10 @@ <span className="rct-collapse"> | ||
return ( | ||
<button | ||
aria-label="Toggle" | ||
<Button | ||
className="rct-collapse rct-collapse-btn" | ||
disabled={expandDisabled} | ||
title="Toggle" | ||
type="button" | ||
title={lang.toggle} | ||
onClick={this.onExpand} | ||
> | ||
{this.renderCollapseIcon()} | ||
</button> | ||
</Button> | ||
); | ||
@@ -141,44 +143,54 @@ } | ||
renderCollapseIcon() { | ||
if (!this.props.expanded) { | ||
return <span className="rct-icon rct-icon-expand-close" />; | ||
const { expanded, icons: { expandClose, expandOpen } } = this.props; | ||
if (!expanded) { | ||
return expandClose; | ||
} | ||
return <span className="rct-icon rct-icon-expand-open" />; | ||
return expandOpen; | ||
} | ||
renderCheckboxIcon() { | ||
if (this.props.checked === 0) { | ||
return <span className="rct-icon rct-icon-uncheck" />; | ||
const { checked, icons: { uncheck, check, halfCheck } } = this.props; | ||
if (checked === 0) { | ||
return uncheck; | ||
} | ||
if (this.props.checked === 1) { | ||
return <span className="rct-icon rct-icon-check" />; | ||
if (checked === 1) { | ||
return check; | ||
} | ||
return <span className="rct-icon rct-icon-half-check" />; | ||
return halfCheck; | ||
} | ||
renderNodeIcon() { | ||
if (this.props.icon !== null) { | ||
return this.props.icon; | ||
const { | ||
expanded, | ||
icon, | ||
icons: { leaf, parentClose, parentOpen }, | ||
isLeaf, | ||
} = this.props; | ||
if (icon !== null) { | ||
return icon; | ||
} | ||
if (!this.hasChildren()) { | ||
return <span className="rct-icon rct-icon-leaf" />; | ||
if (isLeaf) { | ||
return leaf; | ||
} | ||
if (!this.props.expanded) { | ||
return <span className="rct-icon rct-icon-parent-close" />; | ||
if (!expanded) { | ||
return parentClose; | ||
} | ||
return <span className="rct-icon rct-icon-parent-open" />; | ||
return parentOpen; | ||
} | ||
renderBareLabel(children) { | ||
const { onClick } = this.props; | ||
const { onClick, title } = this.props; | ||
const clickable = onClick.toString() !== TreeNode.defaultProps.onClick.toString(); | ||
return ( | ||
<span className="rct-bare-label"> | ||
<span className="rct-bare-label" title={title}> | ||
{clickable ? ( | ||
@@ -204,2 +216,3 @@ <span | ||
label, | ||
title, | ||
treeId, | ||
@@ -209,3 +222,2 @@ value, | ||
} = this.props; | ||
const clickable = onClick.toString() !== TreeNode.defaultProps.onClick.toString(); | ||
@@ -215,3 +227,3 @@ const inputId = `${treeId}-${String(value).split(' ').join('_')}`; | ||
const render = [( | ||
<label key={0} htmlFor={inputId}> | ||
<label key={0} htmlFor={inputId} title={title}> | ||
<NativeCheckbox | ||
@@ -251,3 +263,2 @@ checked={checked === 1} | ||
const { label, showCheckbox, showNodeIcon } = this.props; | ||
const labelChildren = [ | ||
@@ -280,7 +291,7 @@ showNodeIcon ? ( | ||
render() { | ||
const { className, disabled } = this.props; | ||
const { className, disabled, isLeaf } = this.props; | ||
const nodeClass = classNames({ | ||
'rct-node': true, | ||
'rct-node-parent': this.hasChildren(), | ||
'rct-node-leaf': !this.hasChildren(), | ||
'rct-node-leaf': isLeaf, | ||
'rct-node-parent': !isLeaf, | ||
'rct-disabled': disabled, | ||
@@ -287,0 +298,0 @@ }, className); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
461625
29
1122
153
35
5