관리-도구
편집 파일: Table.jd7cflkg.js
import{n as j}from"./numbers.busvl4mt.js";import{C as J,b as Q,d as X}from"./Caret.hnvbzqgq.js";import"./translations.lf9cwm9a.js";import{o as s,c as n,F as m,J as p,a as i,t as d,Q as I,_ as q,k as h,l as v,x as A,G as g,E as C,q as S,S as W,H as D,v as y,C as R,b as r,m as N,j as Y,B as Z,$ as L}from"./runtime-dom.esm-bundler.h3clfjuw.js";import{_ as B}from"./_plugin-vue_export-helper.oebm7xum.js";import{_ as P}from"./default-i18n.hohxoesu.js";import{C as x}from"./Tooltip.jx4casvt.js";import{T as $}from"./Slide.dop8j51m.js";const ee="all-in-one-seo-pack",te={emits:["process-additional-filters","change"],props:{additionalFilters:{type:Array,required:!0},selectedFilters:{type:Object,default(){return{}}}},data(){return{strings:{filter:P("Filter",ee)}}},methods:{setInitialOptions(){this.additionalFilters.forEach(t=>{this.selectedFilters[t.name]||(this.selectedFilters[t.name]=t.options[0].value)})}},beforeMount(){this.setInitialOptions()},updated(){this.setInitialOptions()}},se={class:"aioseo-wp-additional-filters alignleft actions"},le={class:"screen-reader-text"},ae=["name","onUpdate:modelValue","onChange"],ne=["value"];function oe(t,a,e,w,o,u){return s(),n("div",se,[(s(!0),n(m,null,p(e.additionalFilters,(c,k)=>(s(),n(m,{key:k},[i("label",le,d(c.label),1),I(i("select",{name:c.name,"onUpdate:modelValue":f=>e.selectedFilters[c.name]=f,onChange:f=>t.$emit("change",{name:c.name,selectedValue:f.target.value})},[(s(!0),n(m,null,p(c.options,(f,O)=>(s(),n("option",{key:O,value:f.value},d(f.label),9,ne))),128))],40,ae),[[q,e.selectedFilters[c.name]]])],64))),128)),i("button",{class:"button action",onClick:a[0]||(a[0]=c=>t.$emit("process-additional-filters",e.selectedFilters))},d(o.strings.filter),1)])}const ie=B(te,[["render",oe]]),M="all-in-one-seo-pack",re={emits:["process-bulk-action"],props:{bulkOptions:{type:Array,required:!0},disableTable:Boolean},data(){return{bulkAction:"-1",strings:{bulkActions:P("Bulk Actions",M),apply:P("Apply",M)}}},watch:{bulkOptions(t){t.find(a=>a.value===this.bulkAction)===void 0&&(this.bulkAction="-1")}}},ue={class:"aioseo-wp-bulk-actions alignleft actions bulkactions"},ce=["disabled"],de={value:"-1"},be=["value"],me=["disabled"];function he(t,a,e,w,o,u){return s(),n("div",ue,[I(i("select",{"onUpdate:modelValue":a[0]||(a[0]=c=>o.bulkAction=c),disabled:e.disableTable},[i("option",de,d(o.strings.bulkActions),1),(s(!0),n(m,null,p(e.bulkOptions,(c,k)=>(s(),n("option",{key:k,value:c.value},d(c.label),9,be))),128))],8,ce),[[q,o.bulkAction]]),i("button",{class:"button action",onClick:a[1]||(a[1]=c=>o.bulkAction!=="-1"?t.$emit("process-bulk-action",o.bulkAction):null),disabled:e.disableTable},d(o.strings.apply),9,me)])}const ge=B(re,[["render",he]]),_e="all-in-one-seo-pack",pe={props:{modelValue:Number,disableTable:Boolean},data(){return{items:[5,10,20,25,50,100],itemsPerPage:20,strings:{itemsPerPage:P("items per page",_e)}}},watch:{itemsPerPage(t){this.$emit("update:modelValue",t)}},mounted(){this.itemsPerPage=this.modelValue}},ke={class:"aioseo-wp-items-per-page alignleft"},fe=["disabled"],ye=["value"];function ve(t,a,e,w,o,u){return s(),n("div",ke,[i("label",null,[I(i("select",{"onUpdate:modelValue":a[0]||(a[0]=c=>o.itemsPerPage=c),disabled:e.disableTable},[(s(!0),n(m,null,p(o.items,(c,k)=>(s(),n("option",{key:k,value:c},d(c),9,ye))),128))],8,fe),[[q,o.itemsPerPage]]),i("span",null,d(o.strings.itemsPerPage),1)])])}const Pe=B(pe,[["render",ve]]),U="all-in-one-seo-pack",we={emits:["paginate"],props:{totals:{type:Object,required:!0},initialPageNumber:{type:Number,default(){return 1}},disableTable:Boolean},data(){return{numbers:j,pageNumber:1,strings:{of:P("of",U),items:P("items",U)}}},watch:{initialPageNumber(t){t!==this.pageNumber&&(this.pageNumber=t)}},methods:{toPage(t){this.pageNumber=t,this.$emit("paginate",parseInt(t))}},created(){this.pageNumber=this.initialPageNumber}},Te={class:"tablenav-pages pagination"},Ne={class:"displaying-num"},Ae={class:"pagination-links"},Ce={class:"paging-input"},Fe=["max","disabled"],Be={class:"tablenav-paging-text"};function Se(t,a,e,w,o,u){return s(),n("div",Te,[i("span",Ne,d(o.numbers.numberFormat(e.totals.total))+" "+d(o.strings.items),1),i("span",Ae,[(s(),h(S(o.pageNumber===1?"span":"a"),{href:"#",class:g(o.pageNumber===1?"tablenav-pages-navspan button disabled":"first-page button"),onClick:a[0]||(a[0]=C(c=>o.pageNumber===1?null:u.toPage(1),["prevent"]))},{default:v(()=>[A(" « ")]),_:1},8,["class"])),(s(),h(S(o.pageNumber===1?"span":"a"),{href:"#",class:g(o.pageNumber===1?"tablenav-pages-navspan button disabled":"prev-page button"),onClick:a[1]||(a[1]=C(c=>o.pageNumber===1?null:u.toPage(o.pageNumber-1),["prevent"]))},{default:v(()=>[A(" ‹ ")]),_:1},8,["class"])),i("span",Ce,[I(i("input",{class:"current-page",type:"number",name:"paged","onUpdate:modelValue":a[2]||(a[2]=c=>o.pageNumber=c),size:"2",min:1,max:e.totals.pages||1,step:1,"aria-describedby":"table-paging",onKeyup:a[3]||(a[3]=D(c=>u.toPage(o.pageNumber),["enter"])),disabled:!e.totals.pages||e.disableTable},null,40,Fe),[[W,o.pageNumber]]),i("span",Be,d(o.strings.of)+" "+d(e.totals.pages||0),1)]),(s(),h(S(o.pageNumber===e.totals.pages||!e.totals.pages?"span":"a"),{href:"#",class:g(o.pageNumber===e.totals.pages||!e.totals.pages?"tablenav-pages-navspan button disabled":"next-page button"),onClick:a[4]||(a[4]=C(c=>o.pageNumber===e.totals.pages||!e.totals.pages?null:u.toPage(o.pageNumber+1),["prevent"]))},{default:v(()=>[A(" › ")]),_:1},8,["class"])),(s(),h(S(o.pageNumber===e.totals.pages||!e.totals.pages?"span":"a"),{href:"#",class:g(o.pageNumber===e.totals.pages||!e.totals.pages?"tablenav-pages-navspan button disabled":"last-page button"),onClick:a[5]||(a[5]=C(c=>o.pageNumber===e.totals.pages||!e.totals.pages?null:u.toPage(e.totals.pages),["prevent"]))},{default:v(()=>[A(" » ")]),_:1},8,["class"]))])])}const Re=B(we,[["render",Se]]),Ie={emits:["sort-column"],components:{CoreTooltip:x},props:{column:{type:Object,required:!0},disableTable:Boolean,allowTooltipIcon:Boolean}},Oe={key:0,class:"aioseo-table-header-tooltip-icon"},Ve=i("span",{class:"sorting-indicator"},null,-1);function qe(t,a,e,w,o,u){const c=y("core-tooltip");return s(),n("th",{scope:"col",style:Y({width:e.column.width}),class:g(["aioseo-manage-column manage-column",[{sortable:!e.disableTable&&e.column.sortable,asc:e.column.sortDir==="asc"&&e.column.sortable,desc:e.column.sortDir==="desc"&&e.column.sortable,sorted:e.column.sortable&&e.column.sorted},e.column.slug]])},[e.allowTooltipIcon&&e.column.tooltipIcon?(s(),n("div",Oe,[R(c,{class:"action",type:"action"},{tooltip:v(()=>[A(d(e.column.label),1)]),default:v(()=>[(s(),h(S(e.column.tooltipIcon)))]),_:1})])):r("",!0),!e.allowTooltipIcon||!e.column.tooltipIcon?(s(),n(m,{key:1},[e.column.sortable?(s(),n("a",{key:0,href:"#",onClick:a[0]||(a[0]=C(k=>t.$emit("sort-column",e.column,k),["prevent"]))},[i("span",null,d(e.column.label),1),Ve])):r("",!0),e.column.sortable?r("",!0):(s(),n(m,{key:1},[t.$slots.headerFooter?N(t.$slots,"headerFooter",{key:0}):r("",!0),t.$slots.headerFooter?r("",!0):(s(),n(m,{key:1},[A(d(e.column.label),1)],64))],64))],64)):r("",!0)],6)}const He=B(Ie,[["render",qe]]),V="all-in-one-seo-pack",Le={emits:["sort-column","process-bulk-action","paginate","search","filter-table","process-change-items-per-page","process-additional-filters","additional-filter-option-selected"],components:{CoreAlert:J,CoreLoader:Q,CoreWpAdditionalFilters:ie,CoreWpBulkActions:ge,CoreWpItemsPerPage:Pe,CoreWpPagination:Re,CoreWpTableHeaderFooter:He,TransitionSlide:$},props:{columns:{type:Array,required:!0},rows:{type:Array,required:!0},filters:{type:Array,required:!1},totals:{type:Object,required:!1},loading:Boolean,showSearch:{type:Boolean,default(){return!0}},showBulkActions:{type:Boolean,default(){return!0}},showPagination:{type:Boolean,default(){return!0}},showTableFooter:{type:Boolean,default(){return!0}},showHeader:{type:Boolean,default(){return!0}},searchLabel:{type:String,default(){return P("Search",V)}},initialPageNumber:{type:Number,default(){return 1}},initialItemsPerPage:{type:Number,default(){return 20}},initialSearchTerm:{type:String,default(){return""}},noResultsLabel:{type:String},bulkOptions:Array,additionalFilters:Array,selectedFilters:Object,itemsPerPageFilter:String,blurRows:Boolean,disableTable:Boolean,showItemsPerPage:Boolean},data(){return{numbers:j,itemsPerPage:null,searchTerm:"",pageNumber:1,activeRow:null,strings:{items:P("items",V),noResults:P("No items found.",V)}}},watch:{initialPageNumber(t){this.pageNumber=t},pageNumber(t){if(Math.abs(t)!==t){this.pageNumber=Math.floor(t);return}if(this.totals&&t>this.totals.pages){this.pageNumber=this.totals.pages;return}1>t&&(this.pageNumber=1)},itemsPerPage(t,a){a!==null&&this.processChangeItemsPerPage()}},computed:{filteredColumns(){return this.columns.filter(t=>"show"in t?t.show:!0)},noResults(){return this.noResultsLabel||this.strings.noResults}},methods:{showFilterCount(t){return Object.prototype.hasOwnProperty.call(t,"count")},editRow(t){if(t===null||this.activeRow===t){this.activeRow=null;return}this.activeRow=t},processSearch(){X(()=>{this.editRow(-1),this.$emit("search",this.searchTerm)},100)},processChangeItemsPerPage(){this.$emit("process-change-items-per-page",this.itemsPerPage)},processBulkAction(t){this.$emit("process-bulk-action",{action:t,selectedRows:this.selectedItems()}),this.editRow(-1),!this.bulkOptions.find(a=>a.value===t&&(a==null?void 0:a.resetSelection)===!1)&&this.resetSelectedItems()},processPaginate(t){this.pageNumber=t,this.editRow(-1),this.$emit("paginate",t,this.searchTerm)},processFilter(t){this.pageNumber=1,this.searchTerm="",this.editRow(-1),this.$emit("filter-table",t)},processAdditionalFilters(t){this.pageNumber=1,this.searchTerm="",this.editRow(-1),this.$emit("process-additional-filters",{filters:t,searchTerm:this.searchTerm,pageNumber:this.pageNumber})},selectedItems(){const t=this.$refs.table.querySelectorAll("tbody tr.main-row"),a=[];return t.forEach(e=>{const w=e.querySelector("th.check-column input");w&&w.checked&&a.push(e.dataset.rowId)}),a},resetSelectedItems(){const t=this.$refs.table.querySelectorAll(".check-column input:checked");t&&t.forEach(a=>a.checked=!1)}},created(){this.pageNumber=this.initialPageNumber,this.searchTerm=this.initialSearchTerm,this.itemsPerPage=this.initialItemsPerPage}},Me={class:"aioseo-wp-table"},Ue={key:0,class:"aioseo-wp-table-header"},je={key:0,class:"subsubsub"},We=["onClick"],De={key:0},Ee={key:0},ze={key:0,class:"separator"},Ke={key:1,class:"search-box"},Ge=["disabled"],Je=["value","disabled"],Qe={class:"tablenav top"},Xe={key:2,class:"alignleft"},Ye=["onClick","tabindex"],Ze=i("br",{class:"clear"},null,-1),xe={class:"wp-table"},$e={key:0,class:"manage-column column-cb check-column"},et=["disabled"],tt={key:0,id:"the-list"},st={key:0,class:"loader-overlay-table"},lt={key:0},at=["colspan"],nt=["data-row-id","data-row-index"],ot={key:0,scope:"row",class:"check-column"},it=["disabled"],rt=["colspan"],ut={key:1},ct=["colspan"],dt={class:"border"},bt={key:1},mt=["colspan"],ht=["colspan"],gt={class:"no-results"},_t={key:0},pt={key:1},kt={key:0,class:"manage-column column-cb check-column"},ft=["disabled"],yt={key:1,class:"tablenav bottom"},vt=i("div",{class:"alignleft actions"},null,-1),Pt=i("br",{class:"clear"},null,-1);function wt(t,a,e,w,o,u){const c=y("core-wp-bulk-actions"),k=y("core-wp-additional-filters"),f=y("core-wp-pagination"),O=y("core-wp-table-header-footer"),E=y("core-loader"),H=y("core-alert"),z=y("transition-slide"),K=y("core-wp-items-per-page");return s(),n("div",Me,[e.showHeader?(s(),n("div",Ue,[t.$slots.filters?r("",!0):(s(),n("ul",je,[(s(!0),n(m,null,p(e.filters,(l,b)=>(s(),n("li",{key:b,class:g(l.slug)},[i("span",{class:g(["name",{active:l.active}])},[!l.active&&!e.disableTable?(s(),n("a",{key:0,href:"#",onClick:C(T=>u.processFilter(l),["prevent"])},[A(d(l.name)+" ",1),u.showFilterCount(l)?(s(),n("span",De," ("+d(o.numbers.numberFormat(l.count))+")",1)):r("",!0)],8,We)):r("",!0),l.active||e.disableTable?(s(),n(m,{key:1},[A(d(l.name)+" ",1),u.showFilterCount(l)?(s(),n("span",Ee," ("+d(o.numbers.numberFormat(l.count))+")",1)):r("",!0)],64)):r("",!0)],2),b+1<e.filters.length?(s(),n("span",ze,"|")):r("",!0)],2))),128))])),e.showSearch?(s(),n("p",Ke,[I(i("input",{type:"search",id:"post-search-input",name:"s","onUpdate:modelValue":a[0]||(a[0]=l=>o.searchTerm=l),onKeyup:a[1]||(a[1]=D((...l)=>u.processSearch&&u.processSearch(...l),["enter"])),onSearch:a[2]||(a[2]=(...l)=>u.processSearch&&u.processSearch(...l)),disabled:e.disableTable},null,40,Ge),[[W,o.searchTerm]]),i("input",{type:"submit",id:"search-submit",class:"button",value:e.searchLabel,onClick:a[3]||(a[3]=C((...l)=>u.processSearch&&u.processSearch(...l),["prevent"])),disabled:e.disableTable},null,8,Je)])):r("",!0),i("div",Qe,[N(t.$slots,"tablenav"),e.showBulkActions&&e.bulkOptions&&e.bulkOptions.length?(s(),h(c,{key:0,"bulk-options":e.bulkOptions,onProcessBulkAction:u.processBulkAction,"disable-table":e.disableTable},null,8,["bulk-options","onProcessBulkAction","disable-table"])):r("",!0),e.additionalFilters&&e.additionalFilters.length?(s(),h(k,{key:1,"additional-filters":e.additionalFilters,"selected-filters":e.selectedFilters,onChange:a[4]||(a[4]=l=>t.$emit("additional-filter-option-selected",l)),onProcessAdditionalFilters:u.processAdditionalFilters},null,8,["additional-filters","selected-filters","onProcessAdditionalFilters"])):r("",!0),t.$slots.filters&&e.filters.length?(s(),n("div",Xe,[(s(!0),n(m,null,p(e.filters,(l,b)=>(s(),n("a",{key:b,onClick:C(T=>u.processFilter(l),["prevent","stop"]),href:"#",tabindex:l.active?-1:0},[N(t.$slots,"filters",Z({ref_for:!0},l))],8,Ye))),128))])):r("",!0),e.showPagination?(s(),h(f,{key:3,totals:e.totals,"initial-page-number":o.pageNumber,"disable-table":e.disableTable,onPaginate:u.processPaginate},null,8,["totals","initial-page-number","disable-table","onPaginate"])):r("",!0),Ze])])):r("",!0),i("div",xe,[i("table",{class:g(["wp-list-table widefat fixed",{blurred:e.blurRows}]),ref:"table",cellpadding:"0",cellspacing:"0","aria-label":"Paginated Table"},[i("thead",null,[i("tr",null,[e.showBulkActions?(s(),n("td",$e,[i("input",{type:"checkbox",disabled:e.loading||e.disableTable},null,8,et)])):r("",!0),(s(!0),n(m,null,p(e.columns,(l,b)=>(s(),h(O,{key:b,column:l,"disable-table":e.disableTable,onSortColumn:(T,F)=>t.$emit("sort-column",T,F),"allow-tooltip-icon":""},L({_:2},[t.$slots[l.slug+"HeaderFooter"]?{name:"headerFooter",fn:v(()=>[N(t.$slots,l.slug+"HeaderFooter",{area:"header"})]),key:"0"}:void 0]),1032,["column","disable-table","onSortColumn"]))),128))])]),e.rows?(s(),n("tbody",tt,[e.loading?(s(),n("div",st,[R(E)])):r("",!0),(s(!0),n(m,null,p(e.rows,(l,b)=>{var T,F;return s(),n(m,{key:b},[l.alert&&((T=l.alert)==null?void 0:T.position)==="top"?(s(),n("tr",lt,[i("td",{colspan:u.filteredColumns.length+1},[R(H,{type:l.alert.color||"blue",innerHTML:l.alert.description},null,8,["type","innerHTML"])],8,at)])):r("",!0),i("tr",{class:g(["main-row",{even:b%2===0,enabled:l.enabled||!l.hasOwnProperty("enabled")}]),"data-row-id":l.rowIndex&&l[l.rowIndex]||l.id||l.url||b,"data-row-index":b},[e.showBulkActions?(s(),n("th",ot,[l.preventBulkAction?r("",!0):(s(),n("input",{key:0,type:"checkbox",disabled:e.disableTable},null,8,it))])):r("",!0),(s(!0),n(m,null,p(u.filteredColumns,(_,G)=>(s(),n("td",{class:g(["manage-column",_.slug]),key:G,colspan:_!=null&&_.colspan?_.colspan:1},[t.$slots[_.slug]?N(t.$slots,_.slug,{key:0,row:l,column:l[_.slug],editRow:u.editRow,index:b,editRowActive:o.activeRow===b}):r("",!0),t.$slots[_.slug]?r("",!0):(s(),n("span",ut,d(l[_.slug]),1))],10,rt))),128))],10,nt),i("tr",{class:g(["edit-row",{even:b%2===0}])},[i("td",{colspan:e.showBulkActions?e.columns.length+1:e.columns.length,class:"edit-row-content"},[R(z,{tag:"div",class:"wrapper",active:b===o.activeRow},{default:v(()=>[i("div",dt,[N(t.$slots,"edit-row",{row:l,index:b,editRow:u.editRow})])]),_:2},1032,["active"])],8,ct)],2),l.alert&&((F=l.alert)==null?void 0:F.position)==="bottom"?(s(),n("tr",bt,[i("td",{colspan:u.filteredColumns.length+1},[R(H,{type:l.alert.color||"blue",innerHTML:l.alert.description},null,8,["type","innerHTML"])],8,mt)])):r("",!0)],64)}),128)),e.rows.length?r("",!0):(s(),n("td",{key:1,colspan:e.showBulkActions?e.columns.length+1:e.columns.length},[i("div",gt,[e.loading?r("",!0):(s(),n("span",_t,d(u.noResults),1))])],8,ht))])):r("",!0),e.showTableFooter?(s(),n("tfoot",pt,[i("tr",null,[e.showBulkActions?(s(),n("td",kt,[i("input",{type:"checkbox",disabled:e.loading||e.disableTable},null,8,ft)])):r("",!0),(s(!0),n(m,null,p(e.columns,(l,b)=>(s(),h(O,{key:b,column:l,"disable-table":e.disableTable,onSortColumn:(T,F)=>t.$emit("sort-column",T,F)},L({_:2},[t.$slots[l.slug+"HeaderFooter"]?{name:"headerFooter",fn:v(()=>[N(t.$slots,l.slug+"HeaderFooter",{area:"footer"})]),key:"0"}:void 0]),1032,["column","disable-table","onSortColumn"]))),128))])])):r("",!0)],2),N(t.$slots,"cta")]),e.showTableFooter?(s(),n("div",yt,[e.showBulkActions&&e.bulkOptions&&e.bulkOptions.length?(s(),h(c,{key:0,"bulk-options":e.bulkOptions,onProcessBulkAction:u.processBulkAction,"disable-table":e.disableTable},null,8,["bulk-options","onProcessBulkAction","disable-table"])):r("",!0),e.showItemsPerPage?(s(),h(K,{key:1,modelValue:o.itemsPerPage,"onUpdate:modelValue":a[5]||(a[5]=l=>o.itemsPerPage=l),"disable-table":e.disableTable},null,8,["modelValue","disable-table"])):r("",!0),vt,e.showPagination?(s(),h(f,{key:2,totals:e.totals,"initial-page-number":o.pageNumber,"disable-table":e.disableTable,onPaginate:u.processPaginate},null,8,["totals","initial-page-number","disable-table","onPaginate"])):r("",!0),Pt])):r("",!0)])}const It=B(Le,[["render",wt]]);export{It as C};