Current section
Files
Jump to
Current section
Files
priv/static/teal/js/6.a2d602d19075d7e474cf.chunk.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{W6Vu:function(e,r,t){"use strict";const s={props:{resourceName:{type:String,required:!0},resourceId:{type:[String,Number],required:!0},resource:{type:Object,required:!0},panel:{type:Object,required:!0}},methods:{actionExecuted(){this.$emit("actionExecuted")}}};t("xkGU"),t("mwIZ");var a=t("J2m7"),i=t.n(a);const u={props:{resourceName:{},field:{}},data:()=>({value:""}),mounted(){this.setInitialValue(),this.field.fill=this.fill,ExTeal.$on(this.field.attribute+"-value",e=>{this.value=e})},destroyed(){ExTeal.$off(this.field.attribute+"-value")},methods:{setInitialValue(){this.value=this.field.value||""},fill(e){e.append(this.field.attribute,String(this.value))},handleChange(e){this.value=e}}};var n=t("5YJQ");const o={props:{errors:{default:()=>new n.Errors}},data:()=>({errorClass:"border-danger"}),computed:{errorClasses(){return this.hasError?[this.errorClass]:[]},fieldAttribute(){return this.field.attribute},hasError(){return this.errors.has(this.fieldAttribute)},firstError(){if(this.hasError)return this.errors.first(this.fieldAttribute)}}},c=["1/2","1/3","2/3","1/4","3/4","1/5","2/5","3/5","4/5","1/6","5/6"];var d=t("k4Da"),l=t.n(d);const h={props:{loadCards:{type:Boolean,default:!0}},data:()=>({cards:[]}),created(){this.fetchCards()},watch:{cardsEndpoint(){this.fetchCards()}},methods:{async fetchCards(){if(this.loadCards){const{data:{cards:e}}=await ExTeal.request().get(this.cardsEndpoint,{params:this.extraCardParams});this.cards=e}}},computed:{shouldShowCards(){return this.cards.length>0},smallCards(){return l()(this.cards,e=>-1!==c.indexOf(e.width))},largeCards(){return l()(this.cards,e=>"full"==e.width)},extraCardParams:()=>null}};var f=t("la6v"),p=t.n(f);const m={methods:{updateQueryString(e){this.$router.push({query:p()(e,this.$route.query)})}}},g={computed:{resourceInformation(){return i()(ExTeal.config.resources,e=>e.uri==this.resourceName)},viaResourceInformation(){if(this.viaResource&&ExTeal.config.resources)return i()(ExTeal.config.resources,e=>e.uri==this.viaResource)}}},v={methods:{selectPreviousPage(){this.updateQueryString({[this.pageParameter]:this.currentPage-1})},selectNextPage(){this.updateQueryString({[this.pageParameter]:this.currentPage+1})}},computed:{currentPage(){return parseInt(this.$route.query[this.pageParameter]||1)}}};var P=t("sEfC");const b={data:()=>({search:"",selectedResource:"",availableResources:[]}),methods:{selectResource(e){this.selectedResource=e},handleSearchCleared(){this.availableResources=[]},clearSelection(){this.selectedResource="",this.availableResources=[]},performSearch(e){this.search=e;const r=e.trim();""!=r?this.debouncer(()=>{this.selectedResource="",this.getAvailableResources(r)},500):this.clearSelection()},debouncer:t.n(P)()(e=>e(),500)}},y={data:()=>({perPage:25}),methods:{initializePerPageFromQueryString(){this.perPage=this.currentPerPage},perPageChanged(){this.updateQueryString({[this.perPageParameter]:this.perPage})}},computed:{currentPerPage(){return this.$route.query[this.perPageParameter]||25}}},C={data:()=>({options:{}}),computed:{trueValue(){return this.options.true_value?this.options.true_value:"True"},falseValue(){return this.options.false_value?this.options.false_value:"False"},label(){return this.value?this.trueValue:this.falseValue}}};var E=t("bpYy"),w=t("gQMU");const x=t.n(w).a;function S(e,r=100){return Promise.all([e,new Promise(e=>{setTimeout(()=>e(),r)})]).then(e=>e[0])}function R(e,r){return e>1||0==e?E.Inflector.pluralize(r):E.Inflector.singularize(r)}t.d(r,"a",function(){return s}),t.d(r,"d",function(){return u}),t.d(r,"e",function(){return o}),t.d(r,"f",function(){return h}),t.d(r,"h",function(){return m}),t.d(r,"i",function(){return g}),t.d(r,"k",function(){return v}),t.d(r,"m",function(){return b}),t.d(r,"l",function(){return y}),t.d(r,"n",function(){return C}),t.d(r,"g",function(){return E.Inflector}),t.d(r,"b",function(){return x}),t.d(r,"c",function(){return n.Errors}),t.d(r,"j",function(){return S}),t.d(r,"o",function(){return R})}}]);