spc-pleroma/priv/static/packs/features/list_editor.js

2 lines
6.2 KiB
JavaScript
Raw Normal View History

2020-05-20 05:55:14 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{843:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return T}));var a,c,i,o=n(0),r=(n(9),n(6),n(8)),s=n(1),u=n(3),d=n.n(u),l=n(5),b=n.n(l),p=n(16),f=n.n(p),j=n(15),v=n(21),O=n(7),h=n(31),m=n(210),g=n(115),C=n(122),_=n(53);var y,I=Object(O.f)({remove:{id:"lists.account.remove",defaultMessage:"Remove from list"},add:{id:"lists.account.add",defaultMessage:"Add to list"}}),R=Object(j.connect)((function(){var e=Object(m.d)();return function(t,n){var a=n.accountId,c=n.added;return{account:e(t,a),added:void 0===c?t.getIn(["listEditor","accounts","items"]).includes(a):c}}}),(function(e,t){var n=t.accountId;return{onRemove:function(){return e(Object(h.K)(n))},onAdd:function(){return e(Object(h.B)(n))}}}))(a=Object(O.g)((i=c=function(e){Object(r.a)(n,e);var t;t=n;function n(){return e.apply(this,arguments)||this}return n.prototype.render=function(){var e,t=this.props,n=t.account,a=t.intl,c=t.onRemove,i=t.onAdd;return e=t.added?Object(o.a)(_.a,{icon:"times",title:a.formatMessage(I.remove),onClick:c}):Object(o.a)(_.a,{icon:"plus",title:a.formatMessage(I.add),onClick:i}),Object(o.a)("div",{className:"account"},void 0,Object(o.a)("div",{className:"account__wrapper"},void 0,Object(o.a)("div",{className:"account__display-name"},void 0,Object(o.a)("div",{className:"account__avatar-wrapper"},void 0,Object(o.a)(g.a,{account:n,size:36})),Object(o.a)(C.a,{account:n})),Object(o.a)("div",{className:"account__relationship"},void 0,e)))},n}(v.a),Object(s.a)(c,"propTypes",{account:f.a.map.isRequired,intl:b.a.object.isRequired,onRemove:b.a.func.isRequired,onAdd:b.a.func.isRequired,added:b.a.bool}),Object(s.a)(c,"defaultProps",{added:!1}),a=i))||a)||a,N=n(2),w=n(14),k=n.n(w),q=n(27);var M,S=Object(O.f)({search:{id:"lists.search",defaultMessage:"Search among people you follow"}}),A=Object(j.connect)((function(e){return{value:e.getIn(["listEditor","suggestions","value"])}}),(function(e){return{onSubmit:function(t){return e(Object(h.H)(t))},onClear:function(){return e(Object(h.E)())},onChange:function(t){return e(Object(h.D)(t))}}}))(y=Object(O.g)(y=function(e){Object(r.a)(n,e);var t;t=n;function n(){for(var t,n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];return t=e.call.apply(e,[this].concat(a))||this,Object(s.a)(Object(N.a)(t),"handleChange",(function(e){t.props.onChange(e.target.value)})),Object(s.a)(Object(N.a)(t),"handleKeyUp",(function(e){13===e.keyCode&&t.props.onSubmit(t.props.value)})),Object(s.a)(Object(N.a)(t),"handleClear",(function(){t.props.onClear()})),t}return n.prototype.render=function(){var e=this.props,t=e.value,n=e.intl,a=t.length>0;return Object(o.a)("div",{className:"list-editor__search search"},void 0,Object(o.a)("label",{},void 0,Object(o.a)("span",{style:{display:"none"}},void 0,n.formatMessage(S.search)),Object(o.a)("input",{className:"search__input",type:"text",value:t,onChange:this.handleChange,onKeyUp:this.handleKeyUp,placeholder:n.formatMessage(S.search)})),Object(o.a)("div",{role:"button",tabIndex:"0",className:"search__icon",onClick:this.handleClear},void 0,Object(o.a)(q.a,{id:"search",className:k()({active:!a})}),Object(o.a)(q.a,{id:"times-circle","aria-label":n.formatMessage(S.search),className:k()({active:a})})))},n}(d.a.PureComponent))||y)||y;var E,x,z,K=Object(O.f)({title:{id:"lists.edit.submit",defaultMessage:"Change title"}}),P=Object(j.connect)((function(e){return{value:e.getIn(["listEditor","title"]),disabled:!e.getIn(["listEditor","isChanged"])||!e.getIn(["listEditor","title"])}}),(function(e){return{onChange:function(t){return e(Object(h.C)(t))},onSubmit:function(){return e(Object(h.P)(!1))}}}))(M=Object(O.g)(M=function(e){Object(r.a)(n,e);var t;t=n;function n(){for(var t,n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];return t=e.call.apply(e,[this].concat(a))||this,Object(s.a)(Object(N.a)(t),"handleChange",(function(e){t.props.onChange(e.target.value)})),Object(s.a)(Object(N.a)(t),"handleSubmit",(function(e){e.preventDefault(),t.props.onSubmit()})),Object(s.a)(Object(N.a)(t),"handleClick",(function()
//# sourceMappingURL=list_editor.js.map