Pleroma/priv/static/packs/features/list_editor.js

2 lines
6.1 KiB
JavaScript
Raw Normal View History

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