You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/apps/user_status/js/user-status-modal.js

24 lines
19 KiB
JavaScript

(window.webpackJsonpUserStatus=window.webpackJsonpUserStatus||[]).push([[2],{593:function(n,t,e){"use strict";var s=e(98),a=e.n(s),i=e(99),r=e.n(i)()(a.a);r.push([n.i,'.predefined-status[data-v-2af0cabf]{display:flex;flex-wrap:nowrap;justify-content:flex-start;flex-basis:100%;border-radius:var(--border-radius);align-items:center;min-height:44px}.predefined-status[data-v-2af0cabf]:hover,.predefined-status[data-v-2af0cabf]:focus{background-color:var(--color-background-hover)}.predefined-status__icon[data-v-2af0cabf]{flex-basis:40px;text-align:center}.predefined-status__message[data-v-2af0cabf]{font-weight:bold;padding:0 6px}.predefined-status__clear-at[data-v-2af0cabf]{opacity:.7}.predefined-status__clear-at[data-v-2af0cabf]::before{content:" - "}',"",{version:3,sources:["webpack://./apps/user_status/src/components/PredefinedStatus.vue"],names:[],mappings:"AA8EA,oCACC,YAAA,CACA,gBAAA,CACA,0BAAA,CACA,eAAA,CACA,kCAAA,CACA,kBAAA,CACA,eAAA,CAEA,oFAEC,8CAAA,CAGD,0CACC,eAAA,CACA,iBAAA,CAGD,6CACC,gBAAA,CACA,aAAA,CAGD,8CACC,UAAA,CAEA,sDACC,aAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.predefined-status {\n\tdisplay: flex;\n\tflex-wrap: nowrap;\n\tjustify-content: flex-start;\n\tflex-basis: 100%;\n\tborder-radius: var(--border-radius);\n\talign-items: center;\n\tmin-height: 44px;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: var(--color-background-hover);\n\t}\n\n\t&__icon {\n\t\tflex-basis: 40px;\n\t\ttext-align: center;\n\t}\n\n\t&__message {\n\t\tfont-weight: bold;\n\t\tpadding: 0 6px;\n\t}\n\n\t&__clear-at {\n\t\topacity: .7;\n\n\t\t&::before {\n\t\t\tcontent: ' - ';\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),t.a=r},594:function(n,t,e){"use strict";var s=e(98),a=e.n(s),i=e(99),r=e.n(i)()(a.a);r.push([n.i,".predefined-statuses-list[data-v-3b99f880]{display:flex;flex-direction:column;margin-bottom:10px}","",{version:3,sources:["webpack://./apps/user_status/src/components/PredefinedStatusesList.vue"],names:[],mappings:"AAoFA,2CACC,YAAA,CACA,qBAAA,CACA,kBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.predefined-statuses-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-bottom: 10px;\n}\n"],sourceRoot:""}]),t.a=r},595:function(n,t,e){"use strict";var s=e(98),a=e.n(s),i=e(99),r=e.n(i)()(a.a);r.push([n.i,".custom-input__form[data-v-38e098a9]{flex-grow:1}.custom-input__form input[data-v-38e098a9]{width:100%;border-radius:0 var(--border-radius) var(--border-radius) 0}","",{version:3,sources:["webpack://./apps/user_status/src/components/CustomMessageInput.vue"],names:[],mappings:"AA0EA,qCACC,WAAA,CAEA,2CACC,UAAA,CACA,2DAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.custom-input__form {\n\tflex-grow: 1;\n\n\tinput {\n\t\twidth: 100%;\n\t\tborder-radius: 0 var(--border-radius) var(--border-radius) 0;\n\t}\n}\n"],sourceRoot:""}]),t.a=r},602:function(n,t,e){"use strict";var s=e(98),a=e.n(s),i=e(99),r=e.n(i)()(a.a);r.push([n.i,".clear-at-select[data-v-44cd4ace]{display:flex;margin-bottom:10px;align-items:center}.clear-at-select__label[data-v-44cd4ace]{margin-right:10px}.clear-at-select .multiselect[data-v-44cd4ace]{flex-grow:1}","",{version:3,sources:["webpack://./apps/user_status/src/components/ClearAtSelect.vue"],names:[],mappings:"AAwFA,kCACC,YAAA,CACA,kBAAA,CACA,kBAAA,CAEA,yCACC,iBAAA,CAGD,+CACC,WAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.clear-at-select {\n\tdisplay: flex;\n\tmargin-bottom: 10px;\n\talign-items: center;\n\n\t&__label {\n\t\tmargin-right: 10px;\n\t}\n\n\t.multiselect {\n\t\tflex-grow: 1;\n\t}\n}\n"],sourceRoot:""}]),t.a=r},603:function(n,t,e){"use strict";var s=e(9
/**
* @copyright Copyright (c) 2020 Georg Ehrke
*
* @author Georg Ehrke <oc.list@georgehrke.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const p=n=>{if(null===n)return Object(o.translate)("user_status","Don't clear");if("end-of"===n.type)switch(n.time){case"day":return Object(o.translate)("user_status","Today");case"week":return Object(o.translate)("user_status","This week");default:return null}if("period"===n.type)return d.a.duration(1e3*n.time).humanize();if("_time"===n.type){const t=d()(Object(A.a)()),e=d()(n.time,"X");return d.a.duration(t.diff(e)).humanize()}return null};var C={name:"PredefinedStatus",filters:{clearAtFilter:p},props:{messageId:{type:String,required:!0},icon:{type:String,required:!0},message:{type:String,required:!0},clearAt:{type:Object,required:!1,default:null}},methods:{select(){this.$emit("select")}}},m=e(97),b=e.n(m),h=e(593),_={insert:"head",singleton:!1},g=(b()(h.a,_),h.a.locals,e(100)),f=Object(g.a)(C,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"predefined-status",attrs:{tabindex:"0"},on:{keyup:[function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"enter",13,t.key,"Enter")?null:n.select(t)},function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:n.select(t)}],click:n.select}},[e("span",{staticClass:"predefined-status__icon"},[n._v("\n\t\t"+n._s(n.icon)+"\n\t")]),n._v(" "),e("span",{staticClass:"predefined-status__message"},[n._v("\n\t\t"+n._s(n.message)+"\n\t")]),n._v(" "),e("span",{staticClass:"predefined-status__clear-at"},[n._v("\n\t\t"+n._s(n._f("clearAtFilter")(n.clearAt))+"\n\t")])])}),[],!1,null,"2af0cabf",null).exports,v=e(258),x={name:"PredefinedStatusesList",components:{PredefinedStatus:f},computed:{...Object(v.b)({predefinedStatuses:n=>n.predefinedStatuses.predefinedStatuses}),hasLoaded(){return this.predefinedStatuses.length>0}},mounted(){this.$store.dispatch("loadAllPredefinedStatuses")},methods:{selectStatus(n){this.$emit("selectStatus",n)}}},y=e(594),S={insert:"head",singleton:!1},k=(b()(y.a,S),y.a.locals,Object(g.a)(x,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return n.hasLoaded?e("div",{staticClass:"predefined-statuses-list"},n._l(n.predefinedStatuses,(function(t){return e("PredefinedStatus",{key:t.id,attrs:{"message-id":t.id,icon:t.icon,message:t.message,"clear-at":t.clearAt},on:{select:function(e){return n.selectStatus(t)}}})})),1):e("div",{staticClass:"predefined-statuses-list"},[e("div",{staticClass:"icon icon-loading-small"})])}),[],!1,null,"3b99f880",null).exports),w={name:"CustomMessageInput",props:{message:{type:String,required:!0,default:()=>""},disabled:{type:Boolean,default:!1}},methods:{focus(){this.$refs.input.focus()},change(n){this.$emit("change",n.target.value)},submit(n){this.$emit("submit",n.target.value)}}},$=e(595),O={insert:"head",singleton:!1},j=(b()($.a,O),$.a.locals,Object(g.a)(w,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("form",{staticClass:"custom-input__form",on:{submit:function(n){n.preventDefault()}}},[e("input",{ref:"input",attrs:{maxlength:"80",disabled:n.disabled,placeholder:n.$t("user_status","What's your status?"),type:"text"},domProps:{value:n.message},on:{change:n.change,keyup:[n.change,function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"enter",13,t.key,"Enter")?null:n.submit(t)}],paste:n.change}})])}),[],!1,null,"38e098a9",null).exports),B=e(596);var E={name:"ClearAtSelect",components:{Multiselect:e.n(B).a},props:{clearAt:{type:Object,default:null}},data:()=>({options:[{label:Object(o.translate)("user_status","Don't clear"),clearAt:null},{label:Object(o.translate)("user_status","30 minutes"),clearAt:{type:"period",time:1800}},{label:Object(o.translate)("user_status","1 hour"),clearAt:{type:"period",time:3600}},{label:Object(o.translate)("user_status","4 hours"),clearAt:{type:"period",time:14400}},{label:Object(o.translate)("user_status","Today"),clearAt:{type:"end-of",time:"day"}},{label:Object(o.translate)("user_status","This week"),clearAt:{type:"end-of",time:"week"}}]}),computed:{option(){return{clearAt:this.clearAt,label:p(this.clearAt)}}},methods:{select(n){n&&this.$emit("selectClearAt",n.clearAt)}}},M=e(602),D={insert:"head",singleton:!1
//# sourceMappingURL=user-status-modal.js.map?v=6d4f0e58fea58eb5d227