PostsTable.90e4b8cc.js 6.22 KB
import{a,c as n,m as l}from"./vuex.esm.8fdeb4b6.js";import{W as c}from"./WpTable.ee9185a7.js";import"./default-i18n.3a91e0e5.js";import"./constants.0d8c074c.js";import{n as r}from"./_plugin-vue2_normalizer.61652a7c.js";import"./index.ec9852b3.js";import"./SaveChanges.e40a9083.js";import{P as p}from"./PostTypes.9ab32454.js";import{S as u,T as d}from"./Table.8887cc77.js";import{C as f}from"./ScoreButton.392b731e.js";import{C as h}from"./Table.e3a46b6a.js";import{C as _}from"./Index.235069bb.js";const m={};var g=function(){var t=this,e=t._self._c;return e("div")},b=[],y=r(m,g,b,!1,null,null,null,null);const v=y.exports;const $={components:{CoreScoreButton:f,CoreWpTable:h,Cta:_,PostActions:v,Statistic:u},mixins:[p,c,d],data(){return{tableId:"aioseo-search-statistics-post-table",changeItemsPerPageSlug:"searchStatisticsSeoStatistics",showUpsell:!1,strings:{ctaButtonText:this.$t.__("Upgrade to Pro and Unlock Access Control",this.$td),ctaHeader:this.$t.sprintf(this.$t.__("Access Control is only available for licensed %1$s %2$s users.",this.$td),"AIOSEO","Pro")}}},props:{posts:Object,showHeader:{type:Boolean,default(){return!0}},showTableFooter:Boolean,showItemsPerPage:Boolean,disableSorting:Boolean,columns:{type:Array,default(){return["post_title","seo_score","clicks","impressions","position"]}},appendColumns:{type:Object,default(){return{}}},initialFilter:{type:String,default(){return""}}},computed:{...a("search-statistics",["data","loading"]),...n(["isUnlicensed"]),allColumns(){var e,s;const i=this.columns,t=((s=(e=this.posts)==null?void 0:e.filters)==null?void 0:s.find(o=>o.active))||{};return this.appendColumns[t.slug||"all"]&&i.push(this.appendColumns[t.slug||"all"]),i},tableColumns(){return[{slug:"row",label:"#",width:"40px"},{slug:"post_title",label:this.$t.__("Title",this.$td),width:"100%",sortDir:this.orderBy==="post_title"?this.orderDir:"asc",sorted:this.orderBy==="post_title"},{slug:"seo_score",label:this.$t.__("TruSEO Score",this.$td),width:"130px",sortDir:this.orderBy==="seo_score"?this.orderDir:"asc",sorted:this.orderBy==="seo_score"},{slug:"clicks",label:this.$t.__("Clicks",this.$td),width:"80px",sortable:this.isSortable,sortDir:this.orderBy==="clicks"?this.orderDir:"asc",sorted:this.orderBy==="clicks"},{slug:"impressions",label:this.$t.__("Impressions",this.$td),width:"110px",sortable:this.isSortable,sortDir:this.orderBy==="impressions"?this.orderDir:"asc",sorted:this.orderBy==="impressions"},{slug:"position",label:this.$t.__("Position",this.$td),width:"90px",sortable:this.isSortable,sortDir:this.orderBy==="position"?this.orderDir:"asc",sorted:this.orderBy==="position"},{slug:"diffDecay",label:this.$t.__("Diff",this.$tdPro),width:"95px"},{slug:"diffPosition",label:this.$t.__("Diff",this.$tdPro),width:"80px"}].filter(i=>this.allColumns.includes(i.slug))},isSortable(){return this.disableSorting?!1:this.filter==="all"&&this.$isPro&&!this.isUnlicensed}},methods:{...l("search-statistics",{fetchData:"updateSeoStatistics"}),resetSelectedFilters(){this.selectedFilters["post-type"]="",this.processAdditionaFilterOptionSelected({name:"post-type",selectedValue:""})}},mounted(){this.initialFilter&&this.processFilter({slug:this.initialFilter})}};var P=function(){var t=this,e=t._self._c;return e("div",{staticClass:"aioseo-search-statistics-post-table"},[e("core-wp-table",{ref:"table",staticClass:"posts-table",attrs:{id:t.tableId,columns:t.tableColumns,rows:Object.values(t.posts.rows),totals:t.posts.totals,filters:t.posts.filters,"selected-filters":t.selectedFilters,loading:t.loading.seoStatistics,"initial-page-number":t.pageNumber,"initial-search-term":t.searchTerm,"initial-items-per-page":t.$aioseo.settings.tablePagination[t.changeItemsPerPageSlug],"show-header":t.showHeader,"show-bulk-actions":!1,"show-table-footer":t.showTableFooter,"show-items-per-page":t.showItemsPerPage,"show-pagination":"","blur-rows":t.showUpsell},on:{"filter-table":t.processFilter,"process-additional-filters":t.processAdditionalFilters,"additional-filter-option-selected":t.processAdditionaFilterOptionSelected,paginate:t.processPagination,"process-change-items-per-page":t.processChangeItemsPerPage,search:t.processSearch,"sort-column":t.processSort},scopedSlots:t._u([{key:"row",fn:function({index:s}){return[e("div",{staticClass:"post-row"},[t._v(" "+t._s(s+1)+" ")])]}},{key:"post_title",fn:function({row:s}){return[e("div",{staticClass:"post-title"},[s.postId?e("a",{attrs:{href:"#"},on:{click:function(o){return t.openPostDetail(s)}}},[t._v(" "+t._s(s.postTitle)+" ")]):e("span",{staticClass:"post-title"},[t._v(" "+t._s(s.postTitle)+" ")])]),e("post-actions",{attrs:{row:s}}),s.postId?e("div",{staticClass:"row-actions"},[e("span",[e("a",{staticClass:"view",attrs:{href:s.context.permalink,target:"_blank"}},[e("span",[t._v(t._s(t.viewPost(s.context.postType.singular)))])]),t._v(" | ")]),e("span",[e("a",{staticClass:"edit",attrs:{href:s.context.editLink,target:"_blank"}},[e("span",[t._v(t._s(t.editPost(s.context.postType.singular)))])])])]):t._e()]}},{key:"seo_score",fn:function({row:s}){return[s.seoScore?e("core-score-button",{staticClass:"table-score-button",attrs:{score:s.seoScore}}):t._e()]}},{key:"clicks",fn:function({row:s}){return[t._v(" "+t._s(t.$numbers.compactNumber(s.clicks))+" ")]}},{key:"impressions",fn:function({row:s}){return[t._v(" "+t._s(t.$numbers.compactNumber(s.impressions))+" ")]}},{key:"position",fn:function({row:s}){return[t._v(" "+t._s(Math.round(s.position).toFixed(0))+" ")]}},{key:"diffPosition",fn:function({row:s}){return[s.difference.comparison?e("statistic",{attrs:{type:"position","show-original":!1,difference:s.difference.position,"tooltip-offset":"-100px,0"}}):t._e()]}},{key:"diffDecay",fn:function({row:s}){return[s.difference.comparison?e("statistic",{attrs:{type:"decay","show-original":!1,difference:s.difference.decay,"tooltip-offset":"-100px,0"}}):t._e()]}},{key:"cta",fn:function(){return[t.showUpsell?e("cta",{attrs:{"cta-link":t.$links.getPricingUrl("search-statistics","search-statistics-upsell"),"button-text":t.strings.ctaButtonText,"learn-more-link":t.$links.getUpsellUrl("search-statistics","search-statistics-upsell","home")},scopedSlots:t._u([{key:"header-text",fn:function(){return[t._v(" "+t._s(t.strings.ctaHeader)+" ")]},proxy:!0}],null,!1,765703614)}):t._e()]},proxy:!0}])})],1)},S=[],x=r($,P,S,!1,null,null,null,null);const j=x.exports;export{j as P};