PageSourceSearch

https://justiceforronankanda.org/assets/TmlFileBrowser.009ee46c.js

js justiceforronankanda.org collected 2026-09-28 12:43:50 UTC 12,182 bytes, 2 lines download raw bytes

1import{_ as O,A as E,ag as N,bk as R,a6 as q,aS as M,bE as Q}from"./index.b39fe1b1.js";import{f as H}from"./faSlidersH.ad74e57e.js";import L from"./TmlInput.c5c24787.js";import A from"./TmlSelect.ec091cee.js";import U from"./TmlTag.0b5c6816.js";import j from"./TmlPopup.747e1faa.js";import J from"./TmlDataTable.d8e33502.js";import z from"./TmlDataTableHeadCell.58492411.js";import W from"./TmlDataTableBodyCell.b2d07a16.js";import{N as c,D as l,E as o,W as S,U as u,S as v,H as I,f,Q as d,F as y,a2 as g,a4 as C,a0 as T,G as x,X as G,R as X}from"./vue.00f7c436.js";import{d as K}from"./debounce.41ca9a8b.js";import{g as Y}from"./getUniqueString.f5e9fc19.js";import"./sentry.09480738.js";import"./faCheck.dd6ba410.js";import"./faTimes.9e2515d7.js";import"./faPlus.b7ccafa3.js";import"./faMinus.5dd9ea58.js";import"./faArrowRight.97fd3c4b.js";import"./faUndo.a98f3c90.js";import"./vue-scrollto.2fdf075e.js";import"./faArrowLeft.6cc18110.js";import"./TmlCloseButton.9b361013.js";import"./faCircle.3254bab0.js";import"./TmlDataTableFooter.7f402728.js";import"./faCaretRight.c8698758.js";const Z={name:"TmlFileBrowser",components:{TmlForm:E,TmlInput:L,TmlSelect:A,TmlTag:U,TmlPopup:j,TmlButton:N,TmlGrid:R,TmlDataTable:J,TmlDataTableHeadCell:z,TmlDataTableBodyCell:W},props:{items:{type:[Array,Object],default:null},request:{type:Object},maxHeight:String,noSearch:Boolean,sortMethods:Array,noPadding:Boolean,searchBy:String,headings:Array,defaultDisplay:Boolean,customDisplay:Boolean,gridDisplay:Boolean,noDisplay:Boolean,gridBreakpoints:Object,noneFoundText:String,gridSpacing:{type:String,default:"1em"},rowsPerPage:Number,persistent:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search"},accessPoint:String,hideTableWithoutFilters:{type:Boolean,default:!1},filters:{type:Array,default(){return[]}},filterable:{type:Boolean,default:!1},onlyShowQueriedData:{type:Boolean,default:!1},sortableColumns:Array,formName:{type:String},displayHeader:{type:Boolean,default:!0},onItemSelect:{type:String},ignoreQueryParams:{type:Boolean,required:!1},focusInput:Boolean,autoComplete:{type:[Boolean,String],default:!0}},data(){return{tags:[],faSearch:q.faSearch,faSlidersH:H.faSlidersH,timeout:"",searchField:"",errorMessage:"",sortIndex:null,searching:!1,appliedFilters:[],sortDirection:null,tableSearchTerm:"",upToDateFilters:[],dataTableVersion:0,activeFilterCount:0,activeSortMethod:!1,formattedItems:this.items,uniqueString:Y(),onDebounceSearch:()=>{}}},computed:{defaultListItems(){return this.formattedItems},internalFormName(){return this.formName?this.formName:`form-${this.uniqueString}`},isSearchFieldSet(){return this.searchField&&this.searchField.length}},watch:{items(){this.onSearch()},activeSortMethod(){this.formattedItems.sort(this.sortMethods[this.activeSortMethod].function)},$route(){this.ignoreQueryParams||this.applyQueryParams()}},created(){this.applyQueryParams(),this.onSearch(),this.onDebounceSearch=K(this.onSearch,500,{trailing:!0})},methods:{applyRouteQuery(e,s){Object.keys(this.$route.query).forEach(t=>{!(t in e)&&!s.includes(t)&&(e[t]=this.$route.query[t])}),M(e)||this.$router.replace({query:e}).catch(()=>{})},getQueryParamValue(e){return this.$route.query[e]},onSearch(){const e=this.isSearchFieldSet?this.searchField.toLowerCase():"";this.emitSearchTerm(e),this.items&&this.items.length?this.searchItems():this.accessPoint?this.tableSearchTerm=e:this.request&&this.requestSearch()},searchItems(){if(this.isSearchFieldSet&&this.searchBy){if(this.activeFilterCount=1,typeof this.items.filter=="function"){const e=this.items.filter(s=>s[this.searchBy].toString().toLowerCase().includes(this.searchField.toLowerCase()));this.formattedItems=e,this.$emit("search-result",e)}}else this.activeFilterCount=0,this.formattedItems=this.items},searchRequest(){this.searching||(this.searching=!0,this.isSearchFieldSet?this.activeFilterCount=1:this.activeFilterCount=0,this.runRequest().then(e=>{if(e.data.error){this.errorMessage=e.data.error,this.formattedItems=[],this.resetTimeout();return}this.formattedItems=e.data,this.noDisplay&&this.$emit("searchResult"),this.resetTimeout()}))},resetTimeout(){setTimeout(()=>{this.searching=!1},100)},emitNativeValue(e){this.$emit("select-item",e)},async runRequest(){return new Promise(e=>{this.axios.post(this.request.url,{query:this.searchField,searchBy:this.searchBy,filters:this.upToDateFilters}).then(s=>{this.$emit("queryResults",s.data),e(s)})})},getSortMethodOptions(){const e=[];return this.sortMethods.forEach((s,t)=>{e.push({text:s.name,value:t})}),e},additiveCallback(){this.additive.callback&&this.additive.callback.call(this)},updateFilters(){this.upToDateFilters=JSON.parse(JSON.stringify(this.filters)),this.applyFilters(),this.request&&this.runRequest().then(e=>{e.data.error?(this.errorMessage=e.data.error,this.formattedItems=[]):(this.formattedItems=e.data,this.noDisplay&&this.$emit("searchResult")),this.resetTimeout()})},applyFilters(){const e=[],s={},t=[];let h=0;this.isSearchFieldSet?(h+=1,s["search-term"]=this.searchField):t.push("search-term"),this.sortIndex&&this.sortDirection?(s.sort=this.sortIndex,s.direction=this.sortDirection):(t.push("sort"),t.push("direction")),this.upToDateFilters.forEac
1h(i=>{i.selected?i.options.forEach(a=>{a.value===i.selected?(h+=1,s[i.field.text.toLowerCase().replace(" ","-")]=a.text.toLowerCase().replace(" ","-"),e.push(`${i.field.text}: ${a.text}`)):t.push(i.field.text.toLowerCase().replace(" ","-"))}):t.push(i.field.text.toLowerCase().replace(" ","-"))}),this.tags=e,this.applyRouteQuery(s,t),this.activeFilterCount=h,this.$store.dispatch("overlayElements/close","filters-popup"),this.emitAppliedFilters(this.upToDateFilters),this.dataTableVersion+=1},applyQueryParams(){const e=[];let s=0;const t=this.getQueryParamValue("sort"),h=this.getQueryParamValue("direction"),i=this.getQueryParamValue("search-term");typeof i<"u"&&(this.searchField=i),this.isSearchFieldSet&&(s+=1),typeof t<"u"&&typeof h<"u"&&(this.sortIndex=t,this.sortDirection=h),this.filters.forEach((a,b)=>{const F=a.field.text.toLowerCase().replace(" ","-"),_=this.getQueryParamValue(F);typeof _<"u"&&a.options.forEach(p=>{p.text.toLowerCase().replace(" ","-")===_&&(s+=1,this.filters[b].enabled=!0,this.filters[b].selected=p.value,e.push(`${a.field.text}: ${p.text}`))})}),this.tags=e,this.tableSearchTerm=this.searchField,this.activeFilterCount=s,this.upToDateFilters=JSON.parse(JSON.stringify(this.filters)),this.emitAppliedFilters(this.upToDateFilters)},removeFilter(e){const s=this.tags[e],t=s.substr(0,s.indexOf(":"));this.tags.splice(e,1),this.filters.forEach((h,i)=>{h.field.text===t&&(this.filters[i].enabled=!1,this.filters[i].selected=null,this.upToDateFilters[i].enabled=!1,this.upToDateFilters[i].selected=null)}),this.applyFilters()},emitRowCount(e){this.$emit("row-count",e)},emitAppliedFilters(e){const s=[];e.forEach(t=>{t.selected&&s.push(t)}),this.appliedFilters=s,this.$emit("applied-filters",s)},emitSearchTerm(e){this.$emit("search-term",e)},showTable(){return this.hideTableWithoutFilters&&!this.appliedFilters.length&&this.tableSearchTerm===""?(this.emitRowCount(0),this.emitSearchTerm(""),!1):!0},isColumnSortable(e){return!!(this.sortableColumns&&this.sortableColumns.length&&this.sortableColumns.includes(e))},setTableSortOrder(e,s){this.sortIndex=e,this.sortDirection=s,this.applyFilters()},enableToggle(e){this.filters.forEach((s,t)=>{s.field.value===e&&(this.filters[t].enabled=!0)})},getOptionIndexFromValue(e,s){let t=null;return this.filters[s].options.forEach((h,i)=>{h.value===e&&(t=i)}),t},getOnItemSelectHref(e){let s={},t=null;if(this.onItemSelect){const h=/:([^/]+)(?:\/|$)/;if(s=this.onItemSelect.match(h),s&&s[1]&&(t=e[s[1]],t))return this.onItemSelect.replace(`:${s[1]}`,t)}return null},getValue(e,s){return Q(e,s)}}},$={class:"row"},ee={key:0,class:"col-md-4"},te={key:1,class:"tag-list pb-6 pl-4"},se={key:1,class:"display"},ie=["onClick"],re={key:1,style:{overflow:"hidden"}},ae=["onClick"],le={key:2,class:"list"};function oe(e,s,t,h,i,a){const b=c("tml-input"),F=c("tml-select"),_=c("tml-tag"),p=c("tml-form"),D=c("tml-button"),k=c("tml-popup"),w=c("tml-grid"),B=c("tml-data-table-head-cell"),V=c("tml-data-table-body-cell"),P=c("tml-data-table");return l(),o("div",{class:I(["file-browser",{"no-padding":t.noPadding}]),style:X({"max-height":t.maxHeight})},[t.noSearch?d("",!0):(l(),S(p,{key:0,"form-name":a.internalFormName,persistent:t.persistent},{default:u(()=>[v("div",$,[v("div",{class:I([t.sortMethods?"col-md-8":"col-md-12"])},[f(b,{modelValue:i.searchField,"onUpdate:modelValue":s[0]||(s[0]=r=>i.searchField=r),class:"file-browser-search mb-6",icon:i.faSearch,placeholder:t.searchPlaceholder,type:"text","field-name":"search","focus-input":t.focusInput,"auto-complete":t.autoComplete,"right-icon":t.filterable?i.faSlidersH:null,onInput:i.onDebounceSearch,onRightIconClick:s[1]||(s[1]=r=>e.$store.dispatch("overlayElements/open","filters-popup"))},null,8,["modelValue","icon","placeholder","focus-input","auto-complete","right-icon","onInput"])],2),t.sortMethods?(l(),o("div",ee,[f(F,{modelValue:i.activeSortMethod,"onUpdate:modelValue":s[2]||(s[2]=r=>i.activeSortMethod=r),class:"mb-6","field-name":"ExampleSelect",label:"Sort By",options:a.getSortMethodOptions(),"max-height":"200"},null,8,["modelValue","options"])])):d("",!0),t.filterable?(l(),o("div",te,[(l(!0),o(y,null,g(i.tags,(r,n)=>(l(),S(_,{key:r,class:"tag",value:r,onClose:m=>a.removeFilter(n),onClick:s[3]||(s[3]=m=>e.$store.dispatch("overlayElements/open","filters-popup"))},{default:u(()=>[C(T(r),1)]),_:2},1032,["value","onClose"]))),128)),f(k,{name:"filters-popup",title:"Filters"},{content:u(()=>[f(p,{"form-name":a.internalFormName,persistent:"",style:{"min-height":"460px"}},{default:u(()=>[(l(!0),o(y,null,g(t.filters,(r,n)=>(l(),o("div",{key:n},[f(F,{modelValue:r.selected,"onUpdate:modelValue":m=>r.selected=m,"field-name":`${r.field.value}_options`,options:r.options,label:r.field.text,"pre-selected":a.getOptionIndexFromValue(i.upToDateFilters[n].selected,n)},{option:u(m=>[v("span",null,[v("b",null,T(m.option.text),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","field-name","options","label","pre-selected"])]))),128))]),_:1},8,["form-name"])]),footer:u(()=>[f(D,{fill:"",primary:"",text:"Apply",onClick:s[4]||(s[4]=r=>a.updateFilters())})]),_:1})])):d("",!0)])]),_:1},8,["form-name","persistent"])),t.noDisplay?d("",!0):(l(),o("div",se,[t.customDisplay?(l(!0),o(y,{key:0},g(i.formattedItems,(r,n)=>(l(),o("div",{key:n,class:"custom-display",onClick:m=>a.emitNativeValue(r)},[x(e.$slots,"default",{item:r},void 0,!0)],8,ie))),128)):d("",!0),t.gridDisplay?(l(),o("div",re,[f(w,{class:"pods","min-item-size":300,breakpoints:t.gridBreakpoints,spacing:t.gridSpacing},{default:u(()=>[x(e.$slots,"listPrefix",{},void 0,!0),(l(!0),o(y,null,g(i.formattedItems,(r,n)=>(l(),o("div",{key:n,onClick:m=>a.emitNativeValue(r)},[x(e.$slots,"item",{item:r},void 0,!0)],8,ae))),128))]),_:3},8,["breakpoints","spacing"])])):d("",!0),t.defaultDisplay&&a.showTable()?(l(),o("div",le,[!t.onlyShowQueriedData||i.activeFilterCount?(l(),S(P,{key:0,"default-sort":{index:i.sortIndex,direction:i.sortDirection},"post-access-point":t.accessPoint,"table-data":a.defaultListItems,"search-term":i.tableSearchTerm,"rows-per-page":t.rowsPerPage,filters:i.upToDateFilters,clickable:"",alternate:"",padded:"",onSortOrder:a.setTableSortOrder,onRowCount:a.emitRowCount},G({"table-body":u(r=>[(l(!0),o(y,null,g(t.headings,(n,m)=>(l(),S(V,{key:m,href:a.getOnItemSelectHref(r.data),index:n,onClick:ne=>a.emitNativeValue(r.data)},{default:u(()=>[C(T(a.getValue(r.data,n)),1)]),_:2},1032,["href","index","onClick"]))),128))]),_:2},[t.displayHeader?{name:"table-head",fn:u(()=>[(l(!0),o(y,null,g(t.headings,(r,n)=>(l(),S(B,{key:n,index:r,sortable:a.isColumnSortable(r)},{default:u(()=>[C(T(e.ucFirst(r.replace(/_|\./," "))),1)]),_:2},1032,["index","sortable"]))),128))]),key:"0"}:void 0]),1032,["default-sort","post-access-point","table-data","search-term","rows-per-page","filters","onSortOrder","onRowCount"])):d("",!0)])):d("",!0)]))],6)}const Ee=O(Z,[["render",oe],["__scopeId","data-v-8555d0d2"]]);export{Ee as default};
2//# sourceMappingURL=TmlFileBrowser.009ee46c.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.