forked from Gitlink/forgeplus
1 line
26 KiB
JavaScript
1 line
26 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[57],{"+nTR":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n("W9HT")),a=h(n("NUBc")),o=h(n("jsC+")),l=h(n("CtXQ")),i=h(n("BvKs")),s=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},c=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}}();n("04bd"),n("YQTV"),n("aIZi"),n("2oDE"),n("2WkQ");var u=n("q1tI"),f=h(u),p=n("eO8H");n("6JOy");var d=n("spEH"),m=h(n("aqs5")),y=h(n("2CTR")),b=h(n("GqXi")),v=h(n("vDqi"));function h(e){return e&&e.__esModule?e:{default:e}}function _(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(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentDidMount=function(){n.getSelectList();var e=n.state.page;n.getIssueList(e)},n.getSelectList=function(){var e=n.props.match.params,t=e.projectsId,r="/"+e.owner+"/"+t+"/issues/index_chosen.json";v.default.get(r).then((function(e){e&&n.setState({issue_chosen:e.data.issue_chosen})})).catch((function(e){console.log(e)}))},n.deletedetail=function(e){var t=n.props.match.params,r=t.projectsId,a="/"+t.owner+"/"+r+"/issues/"+e+".json";v.default.delete(a,{data:{project_id:r,id:e}}).then((function(e){if(e){var t=n.state.page;n.getIssueList(t);var r=n.props.getDetail;r&&r()}})).catch((function(e){console.log(e)}))},n.getIssueList=function(e,t,r,a,o,l){var i=n.props.match.params,s=i.projectsId,c=i.meilid,u=i.owner,f=n.state,p=f.limit,d=f.order_name,m=f.order_type,y=f.issue_tag_id,b=f.author_id,h=f.assigned_to_id,g=f.tracker_id,E=f.status_id,O=f.done_ratio,k=f.status_type,C="/"+u+"/"+s+"/milestones/"+c+".json",w=a?{page:e,limit:p,order_name:r,order_type:o,issue_tag_id:y,author_id:b,assigned_to_id:h,tracker_id:g,status_id:E,done_ratio:O,status_type:l||k}:_({page:e,limit:p,order_name:d,order_type:m,issue_tag_id:y,author_id:b,assigned_to_id:h,tracker_id:g,status_id:E,done_ratio:O,status_type:l||k},t,r);v.default.get(C,{params:w}).then((function(e){e&&n.setState({data:e.data,issues:e.data.issues,search_count:"1"===w.status_type?e.data.open_issues_count:e.data.close_issues_count,isSpin:!1})})).catch((function(e){console.log(e)}))},n.getOption=function(e,t,r){var a;"created_on"===e.key?"desc"===e.item.props.value?n.setState({paix:"最新创建"}):n.setState({paix:"最早创建"}):"updated_on"===e.key&&("desc"===e.item.props.value?n.setState({paix:"最新更新"}):n.setState({paix:"最早更新"})),n.setState((_(a={},t,e.key),_(a,t+"s",r),_(a,"page",1),a)),"created_on"===e.key||"updated_on"===e.key?(n.setState({order_name:e.key,order_type:e.item.props.value}),n.getIssueList(1,t,e.key,!0,e.item.props.value)):n.getIssueList(1,t,e.key)},n.renderMenu=function(e,t,r){return f.default.createElement(i.default,{className:"orderCondition"},f.default.createElement(i.default.Item,{key:"all",onClick:function(e){return n.getOption(e,r,t)}},t),e&&e.length>0&&e.map((function(e,t){return f.default.createElement(i.default.Item,{key:e.id,onClick:function(t){return n.getOption(t,r,e.name)}},e.name)})))},n.ChangePage=function(e){n.setState({page:e,isSpin:!0}),n.getIssueList(e)},n.openorder=function(e){n.setState({status_type:e,issue_tag_id:void 0,author_id:void 0,tracker_id:void 0,done_ratio:void 0,status_id:void 0,assigned_to_id:void 0,issue_tag_ids:"标记",tracker_ids:"类型",author_ids:"发布人",assigned_to_ids:"负责人",status_ids:"状态",done_ratios:"完成度",paix:"排序"},(function(){n.getIssueList(1,void 0,void 0,void 0,void 0,e)}))},n.state={issue_chosen:void 0,data:void 0,issues:void 0,isSpin:!0,author_id:void 0,status_id:void 0,assigned_to_id:void 0,limit:15,page:1,search_count:void 0,issue_type:void 0,status_type:"1",issue_tag_ids:"标记",tracker_ids:"类型",author_ids:"发布人",assigned_to_ids:"负责人",status_ids:"状态",done_ratios:"完成度",paix:"排序"},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),c(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.issue_chosen,c=t.issues,u=t.limit,v=t.page,h=t.search_count,_=t.data,g=t.isSpin,E=t.status_type,O=this.props.match.params,k=O.projectsId,C=O.meilid,w=O.owner,j=f.default.createElement(i.default,{onClick:function(t){return e.getOption(t)}},f.default.createElement(i.default.Item,{key:"created_on",value:"desc"},"最新创建"),f.default.createElement(i.default.Item,{key:"created_on",value:"asc"},"最早创建"),f.default.createElement(i.default.Item,{key:"updated_on",value:"desc"},"最新更新"),f.default.createElement(i.default.Item,{key:"updated_on",value:"asc"},"最早更新"));return f.default.createElement("div",{className:"main",style:{padding:"0px"}},f.default.createElement("div",{className:"miledetail"},f.default.createElement("p",{className:"font-20"},_&&_.name),f.default.createElement(d.FlexAJ,null,f.default.createElement("span",{className:"mt7"},f.default.createElement("span",{className:"mr10"},f.default.createElement("i",{className:"iconfont icon-rili font-14 mr5"}),_&&_.effective_date?f.default.createElement("span",null,_&&_.effective_date):f.default.createElement("span",null,"暂无截止时间")),f.default.createElement("span",{className:"font-weight-bold"},_&&_.percent&&_.percent.toFixed(2),"%完成 ")),f.default.createElement("div",{className:"milepostdiv"},f.default.createElement(p.Link,{to:"/"+w+"/"+k+"/milestones/"+C+"/edit",className:"topWrapper_btn",style:{marginRight:15}},"编辑里程碑"),f.default.createElement(m.default,s({},this.props,{sureFunc:function(){e.props.history.push("/"+w+"/"+k+"/issues/"+C+"/new")},className:"topWrapper_btn"}),"创建易修")))),f.default.createElement(r.default,{spinning:g},f.default.createElement("div",{className:"pl20 pr20"},f.default.createElement("div",{className:"f-wrap-between pt15 pb15 bor-bottom-greyE"},f.default.createElement("ul",{className:"topWrapper_type_infos"},f.default.createElement("li",{className:"1"===E?"active":"",onClick:function(){return e.openorder("1")}},_&&_.open_issues_count,"个开启中"),f.default.createElement("li",{className:"2"===E?"active":"",onClick:function(){return e.openorder("2")}},_&&_.close_issues_count,"个已关闭")),f.default.createElement("ul",{className:"topWrapper_select"},f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.issue_tag,"标记","issue_tag_id"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.issue_tag_ids,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.assign_user,"发布人","author_id"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.author_ids,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.assign_user,"负责人","assigned_to_id"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.assigned_to_ids,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.tracker,"类型","tracker_id"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.tracker_ids,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.issue_status,"状态","status_id"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.status_ids,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:this.renderMenu(n&&n.done_ratio,"完成度","done_ratio"),trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.done_ratios,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))),f.default.createElement("li",null,f.default.createElement(o.default,{className:"topWrapperSelect",overlay:j,trigger:["click"],placement:"bottomCenter"},f.default.createElement("span",null,this.state.paix,f.default.createElement(l.default,{type:"caret-down",className:"ml5"})))))),f.default.createElement("div",{className:"setItemStyle"},0===h?f.default.createElement(y.default,{_html:"暂时还没有相关数据!"}):c&&c.length>0&&c.map((function(t,n){return f.default.createElement(b.default,s({key:n,mile:!0,item:t,search_count:h,page:v,limit:u},e.props,e.state,{deletedetail:e.deletedetail}))}))),h>u?f.default.createElement("div",{className:"mt30 pb30 edu-txt-center"},f.default.createElement(a.default,{simple:!0,current:v,total:h,pageSize:u,onChange:this.ChangePage})):"")))}}]),t}(u.Component);t.default=g},"0lcf":function(e,t,n){"use strict";n.r(t);n("SchZ"),n("u3En")},"6JOy":function(e,t,n){},D5tj:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n("mr32"));t.TagInfo=function(e,t){var n="#e74c3c";n="高"===e?"#e67e22":"正常"===e?"#28be6c":"低"===e?"#1abc9c":"#e74c3c";return a.default.createElement(r.default,{color:n,className:t,style:{height:"25px",lineHeight:"23px"}},e)},n("0lcf");var a=o(n("q1tI"));function o(e){return e&&e.__esModule?e:{default:e}}},GqXi:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n("NJEC")),a=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}}();n("k994");var o=n("q1tI"),l=c(o),i=n("eO8H"),s=n("D5tj");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.set_issue_tags=function(e){return e&&e.length>0?e.map((function(e,t){return l.default.createElement("span",{className:"mr10",key:t},e.name)})):"--"},n.deletedetail=function(e){n.props.deletedetail(e)},n.onMouseMove=function(e){n.setState({isdisplay:!0,orderid:e})},n.onMouseOut=function(){n.setState({isdisplay:!1})},n.state={isdisplay:!1,orderid:""},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),a(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.item,a=t.checkbox,o=t.mile,c=t.user_admin_or_member,u=this.props.match.params,f=u.projectsId,p=u.owner,d=this.state,m=d.orderid,y=d.isdisplay,b=this.props.current_user;return n&&l.default.createElement("div",{className:"issueItem"},b&&b.login&&a,l.default.createElement("div",{className:"flex-1"},l.default.createElement("p",{className:"mb10 df",style:{alignItems:"center"}},l.default.createElement(i.Link,{to:"/"+p+"/"+f+"/issues/"+n.id,target:"_blank",title:n.name,className:"hide-1 font-16 color-grey-3 lineh-30 mr10",style:{maxWidth:"370px"}},n.name),(0,s.TagInfo)(n.priority,"mr10")),l.default.createElement("p",{className:"color-grey-6 font-12"},l.default.createElement("span",null,n.format_time),l.default.createElement("span",{className:"ml5"},"发布"),n.updated_at===n.format_time?"":l.default.createElement("span",{className:"ml20"},l.default.createElement("span",null,n.updated_at),l.default.createElement("span",{className:"ml5"},"更新")))),l.default.createElement("ul",{className:"topWrapper_select no-cursor",onMouseMove:function(){return e.onMouseMove(n.id)},onMouseOut:function(){return e.onMouseOut()}},l.default.createElement("li",null,this.set_issue_tags(n.issue_tags)),l.default.createElement("li",null,n.author_name?l.default.createElement(i.Link,{to:"/"+n.author_login,className:"show-user-link"},n.author_name):"--"),l.default.createElement("li",null,n.assign_user_name?l.default.createElement(i.Link,{to:"/"+n.assign_user_login,className:"show-user-link"},n.assign_user_name):"--"),l.default.createElement("li",null,n.tracker||"--"),o?"":l.default.createElement("li",null,n.version||"--"),l.default.createElement("li",null,n.issue_status||"--"),l.default.createElement("li",{style:{color:"100%"===n.done_ratio?"#28BD6C":"#F73030"}},n.done_ratio||"--"),l.default.createElement("li",null,l.default.createElement("div",{className:"milepostleft"},l.default.createElement(i.Link,{to:"/"+p+"/"+f+"/issues/"+n.id},l.default.createElement("i",{className:"iconfont icon-pinglun1 mr3 font-16"}),n.journals_count),c?l.default.createElement("div",{style:{display:m===n.id&&y?"flex":"none"}},l.default.createElement("div",{className:"mr8 ml8 color-grey-9"},l.default.createElement(i.Link,{to:"/"+p+"/"+f+"/issues/"+n.id+"/updatedetail",className:"color-grey-9"},l.default.createElement("i",{className:"iconfont icon-bianji3 font-14 mr5"}))),l.default.createElement("div",{className:"color-grey-9"},l.default.createElement(r.default,{placement:"bottom",overlayClassName:m===n.id&&y?"overlayBox":"overlayBox hideOverlay",title:"您确定要删除当前易修吗?",okText:"是",cancelText:"否",onConfirm:function(){return e.deletedetail(n.id)}},l.default.createElement("i",{className:"iconfont icon-yiguanbi1 font-14"})))):""))))}}]),t}(o.Component);t.default=u},NJEC:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("VCL8"),o=n("3S7+"),l=n("CtXQ"),i=n("2/Rp"),s=n("YMnH"),c=n("ZvpZ"),u=n("H84U");function f(e){return(f="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 p(){return(p=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 d(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 m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var a=h(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?v(e):t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},g=function(e){!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)}(f,e);var t,n,a,l=y(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=l.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(v(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(v(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var a=t.props,o=a.okButtonProps,l=a.cancelButtonProps,s=a.title,c=a.cancelText,u=a.okText,f=a.okType,d=a.icon;return r.createElement("div",null,r.createElement("div",{className:"".concat(e,"-inner-content")},r.createElement("div",{className:"".concat(e,"-message")},d,r.createElement("div",{className:"".concat(e,"-message-title")},s)),r.createElement("div",{className:"".concat(e,"-buttons")},r.createElement(i.default,p({onClick:t.onCancel,size:"small"},l),c||n.cancelText),r.createElement(i.default,p({onClick:t.onConfirm,type:f,size:"small"},o),u||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,a=t.props,l=a.prefixCls,i=a.placement,u=_(a,["prefixCls","placement"]),f=n("popover",l),d=r.createElement(s.a,{componentName:"Popconfirm",defaultLocale:c.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return r.createElement(o.default,p({},u,{prefixCls:f,placement:i,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,a=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var r=n.onVisibleChange;r&&r(e,t)}},{key:"render",value:function(){return r.createElement(u.a,null,this.renderConfirm)}}])&&d(t.prototype,n),a&&d(t,a),f}(r.Component);g.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:r.createElement(l.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(a.polyfill)(g),t.default=g},k994:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("Aosp"),n("L/Qf")},mr32:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("TSYQ"),o=n.n(a),l=n("BGR+"),i=n("VCL8"),s=n("CtXQ"),c=n("H84U");function u(e){return(u="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 f(){return(f=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 p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(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(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var a=h(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==u(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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},g=function(e){!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)}(i,e);var t,n,a,l=b(i);function i(){var e;return d(this,i),(e=l.apply(this,arguments)).handleClick=function(){var t=e.props,n=t.checked,r=t.onChange;r&&r(!n)},e.renderCheckableTag=function(t){var n,a=t.getPrefixCls,l=e.props,i=l.prefixCls,s=l.className,c=l.checked,u=_(l,["prefixCls","className","checked"]),d=a("tag",i),m=o()(d,(p(n={},"".concat(d,"-checkable"),!0),p(n,"".concat(d,"-checkable-checked"),c),n),s);return delete u.onChange,r.createElement("span",f({},u,{className:m,onClick:e.handleClick}))},e}return t=i,(n=[{key:"render",value:function(){return r.createElement(c.a,null,this.renderCheckableTag)}}])&&m(t.prototype,n),a&&m(t,a),i}(r.Component),E=n("09Wf"),O=n("6CfX"),k=n("g0mS");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,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){return(j=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 N(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 S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=T(e);if(t){var a=T(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return x(this,n)}}function x(e,t){return!t||"object"!==C(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 T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},R=new RegExp("^(".concat(E.a.join("|"),")(-inverse)?$")),M=function(e){!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&&S(e,t)}(u,e);var t,n,a,i=P(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=i.call(this,e)).state={visible:!0},t.handleIconClick=function(e){e.stopPropagation(),t.setVisible(!1,e)},t.renderTag=function(e){var n=t.props,a=n.children,o=I(n,["children"]),i="onClick"in o||a&&"a"===a.type,s=Object(l.a)(o,["onClose","afterClose","color","visible","closable","prefixCls"]);return i?r.createElement(k.a,null,r.createElement("span",j({},s,{className:t.getTagClassName(e),style:t.getTagStyle()}),a,t.renderCloseIcon())):r.createElement("span",j({},s,{className:t.getTagClassName(e),style:t.getTagStyle()}),a,t.renderCloseIcon())},Object(O.a)(!("afterClose"in e),"Tag","'afterClose' will be deprecated, please use 'onClose', we will remove this in the next version."),t}return t=u,a=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:null}}],(n=[{key:"getTagStyle",value:function(){var e=this.props,t=e.color,n=e.style,r=this.isPresetColor();return j({backgroundColor:t&&!r?t:void 0},n)}},{key:"getTagClassName",value:function(e){var t,n=e.getPrefixCls,r=this.props,a=r.prefixCls,l=r.className,i=r.color,s=this.state.visible,c=this.isPresetColor(),u=n("tag",a);return o()(u,(w(t={},"".concat(u,"-").concat(i),c),w(t,"".concat(u,"-has-color"),i&&!c),w(t,"".concat(u,"-hidden"),!s),t),l)}},{key:"setVisible",value:function(e,t){var n=this.props,r=n.onClose,a=n.afterClose;r&&r(t),a&&!r&&a(),t.defaultPrevented||"visible"in this.props||this.setState({visible:e})}},{key:"isPresetColor",value:function(){var e=this.props.color;return!!e&&R.test(e)}},{key:"renderCloseIcon",value:function(){return this.props.closable?r.createElement(s.default,{type:"close",onClick:this.handleIconClick}):null}},{key:"render",value:function(){return r.createElement(c.a,null,this.renderTag)}}])&&N(t.prototype,n),a&&N(t,a),u}(r.Component);M.CheckableTag=g,M.defaultProps={closable:!1},Object(i.polyfill)(M);t.default=M},u3En:function(e,t,n){}}]); |