mirror of
https://github.com/atisawd/boxicons.git
synced 2024-11-15 19:04:57 +01:00
2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
|
webpackJsonp([1],{452:function(e,n,t){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function l(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}function o(e){return(0,f.bindActionCreators)({changeSideIcon:m.changeSideIcon,setSelectedIcon:m.setSelectedIcon},e)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(n,t,a){return t&&e(n.prototype,t),a&&e(n,a),n}}(),c=t(5),u=a(c),d=t(54),f=t(47),m=t(77),h=t(455),g=a(h),p=t(456),b=a(p),v=t(78),E=a(v),N=t(36);g.default.registerLanguage("xml",b.default);var C=function(e){function n(e){i(this,n);var t=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={color:"black",copied:!1,code:"<i class='bx bx-"+t.props.icon.name+"'></i>",colorChoiceDisplay:!1,animateChoiceDisplay:!1,rotate:0,animation:"none"},t.handleBoxClose=t.handleBoxClose.bind(t),t.handleColor=t.handleColor.bind(t),t.handleRotate=t.handleRotate.bind(t),t.copyCode=t.copyCode.bind(t),t.handleCurrentColor=t.handleCurrentColor.bind(t),t.handleAnimate=t.handleAnimate.bind(t),t.handleCurrentAnimation=t.handleCurrentAnimation.bind(t),t}return l(n,e),s(n,[{key:"componentDidMount",value:function(){document.querySelectorAll("code").forEach(function(e){g.default.highlightBlock(e)})}},{key:"componentDidUpdate",value:function(){document.querySelectorAll("code").forEach(function(e){g.default.highlightBlock(e)})}},{key:"componentWillReceiveProps",value:function(e){if(this.props.icon.name!==e.icon.name){var n="bx bx-"+e.icon.name;"none"!==this.state.animation&&(n+=" bx-"+this.state.animation),this.state.rotate>0&&(n+=" bx-rotate-"+this.state.rotate),this.setState({code:"<i class='"+n+"'></i>"})}}},{key:"handleRotate",value:function(){var e="bx bx-"+this.props.icon.name;"none"!==this.state.animation&&(e+=" bx-"+this.state.animation),this.state.rotate+90!==360?(this.setState({rotate:this.state.rotate+90}),e+=" bx-rotate-"+(this.state.rotate+90)):this.setState({rotate:0}),this.setState({code:"<i class='"+e+"'></i>"})}},{key:"handleAnimate",value:function(e){this.setState({animation:e}),this.setState({animateChoiceDisplay:!1});var n="bx bx-"+this.props.icon.name;"none"!==e&&(n+=" bx-"+e),this.state.rotate>0&&(n+=" bx-rotate-"+this.state.rotate),this.setState({code:"<i class='"+n+"'></i>"})}},{key:"handleColor",value:function(e){this.setState({color:e}),this.setState({colorChoiceDisplay:!1})}},{key:"handleCurrentColor",value:function(){this.setState({colorChoiceDisplay:!this.state.colorChoiceDisplay}),this.setState({animateChoiceDisplay:!1})}},{key:"handleCurrentAnimation",value:function(){this.setState({animateChoiceDisplay:!this.state.animateChoiceDisplay}),this.setState({colorChoiceDisplay:!1})}},{key:"copyCode",value:function(){document.querySelector("#code").select(),document.execCommand("copy"),this.setState({copied:!0}),setTimeout(function(){this.setState({copied:!1})}.bind(this),1e3)}},{key:"handleBoxClose",value:function(){this.props.changeSideIcon(!1),this.props.setSelectedIcon(null,null)}},{key:"render",value:function(){var e=this,n=(0,E.default)({active:this.state.copied,copied:!0}),t="/static/img/svg/"+this.props.icon.slug+".svg",a=this.props.icon;return u.default.createElement("div",{className:" "},u.default.createElement("div",{className:"icon "},u.default.createElement("div",{className:"box-bg "+this.state.color},u.default.createElement("i",{className:"bx bx-"+this.props.icon.slug+" bx-rota
|
||
|
//# sourceMappingURL=1.bundle.js.map
|