UNPKG

multreeselect

Version:

> This project is created to simplify the process of publishing a React component to npm. For a full tutorial on publishing React component to npm, please refer to [this guide](https://medium.com/groftware/how-to-publish-your-react-component-on-npm-9cf48d

1 lines 11.4 kB
module.exports=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=1)}([function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),a=(r=o)&&r.__esModule?r:{default:r};t.default=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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},o=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),i=l(a);n(3);var c=n(4);l(n(5));function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}n(6);var p=c.TreeSelect.SHOW_CHILD,f=c.TreeSelect.SHOW_ALL,d=function(e){function t(){var e,n,r;s(this,t);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.state={value:[]},r.onChange=function(e){r.setState({value:e},(function(){r.props.onChange(r.state.value)}))},u(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){var e=this.props.defaultChecked;this.setState({treeData:this.props.options,value:e||[]})}},{key:"componentDidUpdate",value:function(e){this.props.options!==e.options&&this.setState({treeData:this.props.options}),this.props.defaultChecked!==e.defaultChecked&&this.setState({value:this.props.defaultChecked})}},{key:"render",value:function(){var e=this.props,t=e.getChildValue,n=e.placeholder,o=e.width,l=e.showSearch,s=e.size,u={treeData:this.state.treeData,value:this.state.value,onChange:this.onChange,treeCheckable:!0,showCheckedStrategy:t?p:f,placeholder:n||"Please Select",style:{width:o||"47%"},showSearch:l||!0,dropdownMatchSelectWidth:!0,labelInValue:!0,treeNodeFilterProp:"title",size:s||"large"};return i.default.createElement(a.Fragment,null,i.default.createElement(c.TreeSelect,r({maxTagPlaceholder:this.state.value.length+" Selected",maxTagCount:0},u,u)))}}]),t}(i.default.Component);t.default=d},function(e,t){e.exports=require("antd/dist/antd.css")},function(e,t){e.exports=require("antd")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,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},a=n(0),i=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.styles;var t=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["styles"]);return i.default.createElement("svg",o({width:"10",height:"6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),i.default.createElement("defs",null,i.default.createElement("path",{id:"a",d:"M2 6.825L5.709 3 2-.825 3.142-2 8 3 3.142 8z"})),i.default.createElement("use",{fill:"#CFCFD4",fillRule:"nonzero",transform:"rotate(90 5 3)",xlinkHref:"#a"}))}},function(e,t,n){var r=n(7),o=n(8);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function c(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],o=0;o<e.length;o++){var a=e[o],l=t.base?a[0]+t.base:a[0],s=n[l]||0,u="".concat(l," ").concat(s);n[l]=s+1;var p=c(u),f={css:a[1],media:a[2],sourceMap:a[3]};-1!==p?(i[p].references++,i[p].updater(f)):i.push({identifier:u,updater:b(f,t),references:1}),r.push(u)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,p=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=p(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function d(e,t,n){var r=n.css,o=n.media,a=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,m=0;function b(e,t){var n,r,o;if(t.singleton){var a=m++;n=h||(h=s(t)),r=f.bind(null,n,a,!1),o=f.bind(null,n,a,!0)}else n=s(t),r=d.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=c(n[r]);i[o].references--}for(var a=l(e,t),s=0;s<n.length;s++){var u=c(n[s]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=a}}}},function(e,t,n){(t=n(9)(!1)).push([e.i,"body {\r\n margin: 0;\r\n font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;\r\n -webkit-font-smoothing: antialiased;\r\n line-height: normal;\r\n font-weight: normal;\r\n font-size: 14px;\r\n }\r\n \r\n.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner {\r\n background-color: #f1dca3 !important;\r\n border: 1.5px solid #dca849 !important;\r\n }\r\n \r\n .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner::after {\r\n border: 1.7px solid #dca849 !important;\r\n transform: rotate(45deg) scale(1.1) translate(-50%, -50%) !important;\r\n position: absolute !important;\r\n display: table !important;\r\n border-top: 0 !important;\r\n border-left: 0 !important;\r\n opacity: 1 !important;\r\n -webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s !important;\r\n transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s !important;\r\n }\r\n \r\n .ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner::after {\r\n background-color: white !important;\r\n }\r\n \r\n .ant-select-tree-checkbox-inner {\r\n width: 18px !important;\r\n height: 18px !important;\r\n border-radius: 4px !important;\r\n border: solid 2px #d8d8d8 !important;\r\n }\r\n \r\n .ant-select-tree-checkbox-checked::after{\r\n border: none !important;\r\n }\r\n \r\n .ant-select-selection {\r\n border: solid 1px #cfcfd4 !important;\r\n border-color: #cfcfd4 !important;\r\n }\r\n \r\n .ant-select-open .ant-select-selection {\r\n box-shadow: none !important;\r\n }\r\n \r\n .ant-select-focused .ant-select-selection {\r\n box-shadow: none !important;\r\n }\r\n\r\n .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active{\r\n background: #f6f6f7 !important;\r\n }\r\n \r\n .ant-select-selection--multiple .ant-select-selection__choice {\r\n background: none !important;\r\n border: none !important;\r\n padding: 0 0px 0 10px !important;\r\n margin-right: 0px !important;\r\n }\r\n \r\n .ant-select-selection--multiple .ant-select-selection__choice__remove svg {\r\n display: none !important;\r\n }\r\n \r\n .ant-select-sm\r\n .ant-select-selection--multiple\r\n .ant-select-selection__rendered\r\n li {\r\n height: 23px !important;\r\n line-height: 22px !important;\r\n }\r\n \r\n .ant-select-sm .ant-select-selection--multiple {\r\n min-height: 30px !important;\r\n height: 30px !important;\r\n }\r\n \r\n .ant-select-lg\r\n .ant-select-selection--multiple\r\n .ant-select-selection__rendered\r\n li {\r\n height: 30px !important;\r\n line-height: 29px !important;\r\n }\r\n \r\n .ant-select-lg .ant-select-selection--multiple {\r\n min-height: 36px !important;\r\n height: 36px !important;\r\n }\r\n \r\n .ant-select-dropdown {\r\n border-radius: 4px !important;\r\n box-shadow: rgb(229, 229, 230) 0px 3px 4px 0px !important;\r\n }\r\n\r\n\r\n ",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,c=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(l," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([o]).join("\n")}var i,c,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var c=0;c<e.length;c++){var l=[].concat(e[c]);r&&o[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}}]);