@dcodegroup-au/dsg-vue 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,7 @@ export interface DsgTableProps {
|
|
|
9
9
|
getUrl: string;
|
|
10
10
|
fields: any;
|
|
11
11
|
loadOnStart?: boolean;
|
|
12
|
+
displaySearch?: boolean;
|
|
12
13
|
displayPaginationInfo?: boolean;
|
|
13
14
|
reloadOnChangeTimer?: boolean;
|
|
14
15
|
selectable?: boolean;
|
|
@@ -28,6 +29,8 @@ export interface DsgTableProps {
|
|
|
28
29
|
}[] | null;
|
|
29
30
|
hasHeader?: boolean;
|
|
30
31
|
hasFooter?: boolean;
|
|
32
|
+
perPage?: number;
|
|
33
|
+
paginationPath?: string;
|
|
31
34
|
css?: {
|
|
32
35
|
[key: string]: string;
|
|
33
36
|
};
|
package/dist/dsg-vue.table.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("./DsgTablePerPage.vue_vue_type_style_index_0_lang-DU5GAN6E.cjs"),Q=require("./dsg-vue.helpers-string.cjs"),K=require("./dsg-vue.helpers-object.cjs"),ke={class:"dsg-table--pagination"},he=["disabled"],pe=["disabled"],ye=["onClick","innerHTML"],we=["onClick","innerHTML"],Be=["disabled"],Ce=["disabled"],X=e.defineComponent({__name:"DsgTablePagination",props:e.mergeModels({onEachSide:{default:3},firstPage:{default:1},showFirstLast:{type:Boolean,default:!0},firstIcon:{default:"chevron-left-double"},lastIcon:{default:"chevron-right-double"},prevIcon:{default:"chevron-left"},nextIcon:{default:"chevron-right"}},{pagination:{default:null},paginationModifiers:{}}),emits:e.mergeModels(["dsg-table:change-page"],["update:pagination"]),setup(t,{expose:S,emit:g}){const i=e.useModel(t,"pagination"),m=e.computed(()=>i.value===null?0:i.value?.last_page-t.firstPage+1),v=e.computed(()=>i.value===null?0:i.value?.last_page),u=e.computed(()=>i.value===null?!1:i.value?.current_page===t.firstPage),b=e.computed(()=>i.value===null?!1:i.value?.current_page===v.value),F=e.computed(()=>m.value<t.onEachSide*2+4),V=e.computed(()=>t.onEachSide*2+1),y=e.computed(()=>!i.value||i.value?.current_page<=t.onEachSide?1:i.value?.current_page>=m.value-t.onEachSide?m.value-t.onEachSide*2:i.value?.current_page-t.onEachSide),f=g,l=w=>{f("dsg-table:change-page",w)},d=w=>w===i.value?.current_page;return S({loadPage:l}),(w,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",ke,[t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:B[0]||(B[0]=C=>l(t.firstPage)),class:e.normalizeClass([[u.value?"disabled":""],"dsg-table--pagination-link"]),disabled:u.value,title:"First","aria-label":"First"},[e.createVNode(E._sfc_main,{icon:t.firstIcon,size:"sm"},null,8,["icon"])],10,he)):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:B[1]||(B[1]=C=>l("prev")),class:e.normalizeClass([[u.value?"disabled":""],"dsg-table--pagination-link"]),disabled:u.value,title:"Previous","aria-label":"Previous"},[e.createVNode(E._sfc_main,{icon:t.prevIcon,size:"sm"},null,8,["icon"])],10,pe),F.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(m.value,(C,N)=>(e.openBlock(),e.createElementBlock("a",{key:N,onClick:$=>l(N+t.firstPage),class:e.normalizeClass([[d(N+t.firstPage)?"active":""],"dsg-table--pagination-link"]),innerHTML:C},null,10,ye))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(V.value,(C,N)=>(e.openBlock(),e.createElementBlock("a",{key:N,onClick:$=>l(y.value+N+t.firstPage-1),class:e.normalizeClass([[d(y.value+N+t.firstPage-1)?"active":""],"dsg-table--pagination-link"]),innerHTML:y.value+C-1},null,10,we))),128)),e.createElementVNode("a",{onClick:B[2]||(B[2]=C=>l("next")),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Next","aria-label":"Next"},[e.createVNode(E._sfc_main,{icon:t.nextIcon,size:"sm"},null,8,["icon"])],10,Be),t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:3,onClick:B[3]||(B[3]=C=>l(v.value)),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Last","aria-label":"Last"},[e.createVNode(E._sfc_main,{icon:t.lastIcon,size:"sm"},null,8,["icon"])],10,Ce)):e.createCommentVNode("",!0)],512)),[[e.vShow,i.value&&v.value>t.firstPage]])}}),De=["innerHTML"],Z=e.defineComponent({__name:"DsgTablePaginationInfo",props:e.mergeModels({infoTemplate:{default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{default:"No relevant data"}},{pagination:{default:null},paginationModifiers:{}}),emits:["update:pagination"],setup(t){const S=e.useModel(t,"pagination"),g=e.computed(()=>S.value==null||S.value.total==0?t.noDataTemplate:t.infoTemplate.replace("{from}",(S.value?.from||0).toString()).replace("{to}",(S.value?.to||0).toString()).replace("{total}",(S.value?.total||0).toString()));return(i,m)=>(e.openBlock(),e.createElementBlock("div",{class:"dsg-table--pagination-info",innerHTML:g.value},null,8,De))}}),Ee={class:"dsg-table--actions",ref:"dsgTableActions"},Pe={class:"dsg-table--action-trigger"},Se={key:0,class:"dsg-table--actions-menu-wrapper"},$e=["href","target","onClick"],Ve=["textContent"],Te={key:0},Ne={key:1},Fe=["href","target","onClick"],xe={class:"flex-1"},_=e.defineComponent({__name:"DsgTableActions",props:{placement:{default:"auto"}},emits:["dsg-table:action-edit","dsg-table:action-view","dsg-table:action-delete","dsg-table:action-archive","dsg-table:link-clicked"],setup(t,{emit:S}){const g=e.ref(!1);e.useTemplateRef("dsgTableActions");const i=e.useAttrs(),m=e.ref(i.data.rowData?.actions??null),v=e.ref(i.data.rowData?.links??null),u=e.ref(i.data.rowData??null),b=f=>{switch(f){case"edit":return"edit-05";case"view":return"eye";case"delete":return"trash-01";case"archive":return"eye-off";default:return"dots-horizontal"}},F=(f,l,d)=>{switch(l){case"edit":y("dsg-table:action-edit",d,u.value);break;case"view":y("dsg-table:action-view",d,u.value);break;case"delete":y("dsg-table:action-delete",d,u.value);break;case"archive":y("dsg-table:action-archive",d,u.value);break}},V=(f,l)=>{const d=f.actionId||f.label.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-");y("dsg-table:link-clicked",l,d,u.value)},y=S;return(f,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(E.kt),{triggers:[],placement:t.placement,"handle-resize":!0,strategy:"absolute",shown:g.value,class:"dsg-table--actions__popper",onHide:l[1]||(l[1]=d=>g.value=!1),ref:"floatingVueFilterDropdown"},{popper:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[["edit","view","delete","archive"].includes(String(w))?(e.openBlock(),e.createElementBlock("a",{key:w,href:m.value?.link,target:m.value?.target||"_self",onClick:B=>F(d,String(w),B)},[e.createElementVNode("div",{class:e.normalizeClass(["dsg-table--actions-menu-item",String(w)])},[e.createVNode(E._sfc_main,{icon:b(String(w)),size:"sm"},null,8,["icon"]),e.createElementVNode("span",{class:"flex-1",textContent:e.toDisplayString(e.unref(Q.ucfirst)(String(w)))},null,8,Ve)],2)],8,$e)):e.createCommentVNode("",!0)],64))),256)),m.value&&v.value?(e.openBlock(),e.createElementBlock("hr",Te)):e.createCommentVNode("",!0),v.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(v.value,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.label},[d.hasOwnProperty("component")?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.component),{key:0,quote:e.unref(i).data.data.rowData,"row-data":e.unref(i).data.data.rowData},null,8,["quote","row-data"])):d.hasOwnProperty("type")&&d.type=="break"?(e.openBlock(),e.createElementBlock("hr",Ne)):(e.openBlock(),e.createElementBlock("a",{key:2,href:d.link,target:d.target||"_self",class:e.normalizeClass(["dsg-table--actions-menu-item",d.class]),onClick:w=>V(d,w)},[d.icon?(e.openBlock(),e.createBlock(E._sfc_main,{key:0,icon:d.icon,size:"sm"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("span",xe,e.toDisplayString(d.label),1)],10,Fe))],64))),128)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createElementVNode("button",{type:"button",class:"dsg-table--actions-button","aria-expanded":"false","aria-haspopup":"true",onClick:l[0]||(l[0]=d=>g.value=!g.value)},[e.renderSlot(f.$slots,"dsg-table-action-button-content",{},()=>[e.createVNode(E._sfc_main,{icon:"dots-vertical",size:"sm"})])])])]),_:3},8,["placement","shown"])])),[[e.unref(E.vOnClickOutside),()=>g.value=!1]])}}),Me={class:"dsg-table--search"},ee=e.defineComponent({__name:"DsgTableSearch",props:{name:{},id:{},placeholder:{default:"Search"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1},extraClasses:{},eventName:{},replaceState:{type:Boolean,default:!0}},emits:["dsg-table:term-changed"],setup(t,{emit:S}){const g=e.ref("");e.onMounted(()=>{const u=new URL(window.location.href).searchParams.get("term");u&&(g.value=u,i("dsg-table:term-changed",u))});const i=S,m=E.useDebounceFn(v=>{if(g.value=v,t.replaceState){const u=new URL(window.location.href);g.value?u.searchParams.set("term",g.value):u.searchParams.delete("term"),window.history.pushState({},"",u.toString())}i("dsg-table:term-changed",g.value)},300);return(v,u)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(E._sfc_main$4,{modelValue:g.value,"onUpdate:modelValue":u[0]||(u[0]=b=>g.value=b),name:t.name,id:t.id||t.name,placeholder:t.placeholder,disabled:t.disabled,required:t.required,readonly:t.readonly,hidden:t.hidden,"has-clear-button":!0,autocomplete:"off",size:"sm",icon:"search-sm","icon-clickable":!0,onIconClicked:u[1]||(u[1]=b=>e.unref(m)(b)),onEnterPressed:u[2]||(u[2]=b=>e.unref(m)(b)),onOnClear:u[3]||(u[3]=()=>e.unref(m)(""))},null,8,["modelValue","name","id","placeholder","disabled","required","readonly","hidden"])]))}}),Le={class:"dsg-table--header-row"},ze={key:0,class:"dsg-table--th dsg-table--th-checkbox",scope:"col"},Re={key:1,class:"dsg-table--th dsg-table--th-expand-detail",scope:"col"},Ie=["title","id","onClick"],Ae={key:0,class:"dsg-table--th-sort-icon"},He=["innerHTML"],qe=["innerHTML"],te=e.defineComponent({__name:"DsgTableRowHeader",props:e.mergeModels({fields:{},scrollVisible:{type:Boolean},hasSelectAll:{type:Boolean,default:!1},showExpandDetail:{type:Boolean,default:!0},tableDataLength:{default:0}},{sortField:{default:null},sortFieldModifiers:{},selectedRows:{default:[]},selectedRowsModifiers:{},hasSelected:{type:Boolean,default:!1},hasSelectedModifiers:{}}),emits:e.mergeModels(["dsg-table:sort-field","dsg-table:on-select-all","dsg-table:on-deselect-all"],["update:sortField","update:selectedRows","update:hasSelected"]),setup(t,{emit:S}){const g=e.useModel(t,"sortField"),i=e.useModel(t,"selectedRows"),m=e.useModel(t,"hasSelected"),v=e.ref("17px"),u=y=>{m.value&&i.value.length>0&&i.value.length!==t.tableDataLength?(m.value=!0,b("dsg-table:on-select-all")):!m.value&&i.value.length===0?(m.value=!1,b("dsg-table:on-select-all")):b("dsg-table:on-deselect-all")},b=S,F=(y,f)=>[y,y+"-"+Q.toSnakeCase(String(f?.name)),f.titleClass||"",{sortable:f.sortable},{"sort-active":g.value?.name===f.name}],V=y=>{y.sortable&&(g.value={name:String(y?.name),field:String(y?.sortField),direction:g.value?.name===y.name&&g.value?.direction==="asc"?"desc":"asc"},b("dsg-table:sort-field",y))};return(y,f)=>(e.openBlock(),e.createElementBlock("tr",Le,[t.hasSelectAll?(e.openBlock(),e.createElementBlock("th",ze,[e.createVNode(E._sfc_main$2,{modelValue:m.value,"onUpdate:modelValue":[f[0]||(f[0]=l=>m.value=l),u],indeterminate:i.value.length>0&&i.value.length!==t.tableDataLength},null,8,["modelValue","indeterminate"])])):e.createCommentVNode("",!0),t.showExpandDetail?(e.openBlock(),e.createElementBlock("th",Re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,(l,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l?.visible?(e.openBlock(),e.createElementBlock("th",{key:d,class:e.normalizeClass(F("dsg-table--th",l)),style:e.normalizeStyle([{width:l.width||void 0},l.style]),title:l.title+(l.sortable?" Sort":""),id:"_"+l.name,onClick:w=>V(l),scope:"col"},[l.sortable?(e.openBlock(),e.createElementBlock("div",Ae,[l.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dsg-table--th-title",innerHTML:l.title},null,8,He)):e.createCommentVNode("",!0),l.sortable&&g.value?.name!==l.name?(e.openBlock(),e.createBlock(E._sfc_main,{key:1,icon:"chevron-selector-vertical",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&g.value?.name===l.name&&g.value?.direction==="asc"?(e.openBlock(),e.createBlock(E._sfc_main,{key:2,icon:"chevron-down",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&g.value?.name===l.name&&g.value?.direction==="desc"?(e.openBlock(),e.createBlock(E._sfc_main,{key:3,icon:"chevron-up",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"dsg-table--th-title",innerHTML:e.unref(Q.ucwords)(String(l?.title))},null,8,qe))],14,Ie)):e.createCommentVNode("",!0)],64))),256)),t.scrollVisible?(e.openBlock(),e.createElementBlock("th",{key:2,style:e.normalizeStyle({width:v.value}),class:"dsg-table--th-col-gutter"},null,4)):e.createCommentVNode("",!0)]))}}),Ue={class:"dsg-table--wrapper"},Oe=["span"],We={key:0,class:"dsg-table--loading"},je=["colspan"],Ke=["colspan"],Qe=["onClick","onDblclick","onMouseover"],Ye={key:0,class:"dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"},Ge=["onClick","onDblclick","onContextmenu"],Je=["innerHTML"],Xe=["onClick"],Ze=["colspan"],_e={key:2},et=["colspan"],tt={class:"dsg-table--footer"},at=e.defineComponent({__name:"DsgTableComponent",props:e.mergeModels({fields:{default:()=>[]},isDraggable:{type:Boolean,default:!1},dragApi:{default:""},loadOnStart:{type:Boolean,default:!0},apiUrl:{default:""},httpMethod:{default:"get"},reactiveApiUrl:{type:Boolean,default:!0},apiMode:{type:Boolean,default:!0},data:{default:null},dataManager:{type:[Function,null],default:null},dataPath:{default:"data"},tableLayout:{default:"fixed"},paginationPath:{default:"links.pagination"},queryParams:{default:()=>({sort:"sort",order:"order",page:"page",perPage:"per_page"})},httpOptions:{default:()=>({})},hasDetailRow:{type:Boolean,default:!1},showExpandDetail:{type:Boolean,default:!0},initialPage:{default:1},firstPage:{default:1},sortOrder:{default:()=>[]},multiSort:{type:Boolean},tableHeight:{default:null},multiSortKey:{},rowClass:{type:[String,Function],default:""},detailRowComponent:{},detailRowTransition:{default:"fade"},detailRowClass:{type:[String,Function]},detailRowOptions:{default:()=>({})},trackBy:{default:"id"},css:{default:()=>({tableWrapper:"dsg-table-wrapper",thead:"dsg-table-thead",tbody:"dsg-table-tbody",table:"dsg-table-component"})},minRows:{default:0},noDataTemplate:{default:"No Data Available"},showSortIcons:{type:Boolean},headerRows:{},transform:{type:[Function,null],default:null},sortParams:{type:[Function,null],default:null},fieldPrefix:{},eventPrefix:{},selectable:{type:Boolean,default:!1}},{filterParams:{default:{}},filterParamsModifiers:{},perPage:{default:20},perPageModifiers:{}}),emits:e.mergeModels(["dsg-table:loading","dsg-table:loaded","dsg-table:load-success","dsg-table:load-error","dsg-table:pagination-data","dsg-table:rows-selected","dsg-table:row-clicked","dsg-table:row-hover","dsg-table:row-dblclick"],["update:filterParams","update:perPage"]),setup(t,{expose:S,emit:g}){const i=a=>a.map((n,r)=>({field:n.field||"",title:n.title||"",name:n.name||"",titleClass:n.titleClass||"",dataClass:n.dataClass||"",visible:n.visible??!0,width:n.width||void 0,sortField:n.sortField||null,sortable:n.sortField,formatter:n.formatter||null,$_index:r})),m=e.ref(i(t.fields)),v=e.ref(t.data),u=e.ref(null),b=e.ref(t.initialPage),F=e.ref("17px"),V=e.ref(!1),y=e.ref({}),f=e.ref(0),l=e.ref(!0),d=e.ref(null),w=e.ref(null),B=e.ref(0),C=e.useModel(t,"filterParams"),N=e.useModel(t,"perPage"),$=e.ref([]),R=e.ref(!1),x=e.computed(()=>t.tableHeight!=null),M=e.computed(()=>m.value.filter(a=>a.visible).length);e.watch(()=>$.value.length,a=>{R.value=t.selectable&&a>0},{immediate:!0}),e.watch(()=>t.fields,a=>{m.value=i(a)},{immediate:!0,deep:!0}),e.watch(()=>C.value,a=>{z()},{deep:!0}),e.watch(()=>N.value,()=>{z()}),e.watch(()=>t.apiUrl,(a,n)=>{t.apiMode&&a!==n&&a&&z()});const T=g,A=(a,n)=>a.formatter&&typeof a.formatter=="function"?a.formatter(a,n):K.data_get(n,String(a?.name),""),H=a=>"dsg-field--"+a.name?.toLowerCase().replaceAll(/[_ ]/g,"-"),q=(a,n)=>{const r={odd:n%2===0,even:n%2!==0,"row-selected":a.selected};if(!t.rowClass)return r;let D={};if(typeof t.rowClass=="function"){const h=t.rowClass(a,n);typeof h=="string"?h.split(" ").forEach(P=>{P.trim()&&(D[P.trim()]=!0)}):Array.isArray(h)?h.forEach(P=>{typeof P=="string"&&P.trim()&&(D[P.trim()]=!0)}):typeof h=="object"&&h!==null&&(D=h)}else typeof t.rowClass=="string"&&t.rowClass.split(" ").forEach(h=>{h.trim()&&(D[h.trim()]=!0)});return{...r,...D}},U=a=>{if(t.selectable){if(a.selected)$.value.push(a);else{const n=$.value.findIndex(r=>r[t.trackBy]===a[t.trackBy]);n!==-1&&$.value.splice(n,1)}T("dsg-table:rows-selected",$.value)}},O=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!0}),$.value=v.value?.filter(a=>a.selected)??[],T("dsg-table:rows-selected",$.value))},W=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!1}),$.value=[],T("dsg-table:rows-selected",$.value))},L=a=>{v.value=Array.isArray(a)?a:[],t.selectable&&v.value.forEach(n=>{n.selected=n.selected??!1})},j=()=>v.value??[],o=a=>{a==="prev"?b.value>t.firstPage&&b.value--:a==="next"?b.value<(u.value?.last_page??0)&&b.value++:a!=b.value&&a>=t.firstPage&&a<=(u.value?.last_page??0)&&(b.value=a),z()},s=()=>({[t.queryParams?.sort]:d.value?(d.value?.direction==="desc"?"-":"")+d.value?.field:void 0,[t.queryParams?.order]:d.value?.direction,[t.queryParams?.page]:b.value,[t.queryParams?.perPage]:N.value}),c=()=>{w.value&&(w.value.abort(),w.value=null)},k=(a,n)=>{c(),B.value++;const r=B.value,D=new AbortController;return n.signal=D.signal,w.value=D,(t.httpMethod.toLowerCase()==="get"?E.axios.get(a,n):(()=>{const P=n.params;return delete n.params,E.axios.post(a,P,n)})()).then(P=>({...P,_requestId:r,_apiUrl:a}),P=>{throw P.name==="AbortError"||P.code==="ERR_CANCELED"?{...P,_requestId:r,_cancelled:!0}:{...P,_requestId:r}})},p=a=>{if(a._requestId&&a._requestId!==B.value||a._apiUrl&&a._apiUrl!==t.apiUrl)return;T("dsg-table:load-success",a);const n=t.transform?t.transform(a.data):a.data;v.value=K.data_get(n,t.dataPath,null),t.selectable&&v.value?.forEach(r=>{r.selected=r.selected??!1}),u.value=K.data_get(n,t.paginationPath,null)??null,f.value=v.value?.length?v.value[0].order:f,u.value===null&&console.warn('DsgTable: pagination-path "'+t.paginationPath+`" not found. It looks like the data returned from the server does not have pagination information or you may have set it incorrectly.
|
|
2
|
-
You can explicitly suppress this warning by setting pagination-path="".`),w.value=null,T("dsg-table:pagination-data",u.value),b.value>(u.value?.last_page||0)&&v.value?.length===0&&(b.value=t.initialPage,z()),T("dsg-table:loaded"),l.value=!1},I=a=>{a._requestId&&a._requestId!==B.value||a._apiUrl&&a._apiUrl!==t.apiUrl||a._cancelled||(console.error("load-error",a),w.value=null,T("dsg-table:load-error",a),T("dsg-table:loaded"),l.value=!1)},Y=()=>{if(t.data!==null&&Array.isArray(t.data)){L(t.data),l.value=!1;return}if(t.dataManager&&typeof t.dataManager=="function"){const a=t.dataManager();L(a),l.value=!1}else L(t.data),l.value=!1},z=(a=p,n=I,r={})=>{const D=a||p,h=n||I;if(!t.apiMode){Y();return}return l.value=!0,T("dsg-table:loading",l.value),t.httpOptions.params={...s(),...C.value},k(t.apiUrl,t.httpOptions).then(D).catch(P=>h(P))},ce=(a,n,r)=>{T("dsg-table:row-clicked",a,n,r)},ue=(a,n,r)=>{T("dsg-table:row-dblclick",a,n,r)},ge=(a,n,r)=>{},me=(a,n,r,D)=>{},fe=(a,n,r,D)=>{},ve=(a,n,r,D)=>{},be=(a,n,r)=>{};e.onMounted(()=>{t.apiMode===!0?z():Y()});const G=()=>{t.apiMode&&($.value=[],c(),z())};return S({changePage:o,reload:G,getData:j,setData:L,setLoading:a=>{l.value=a,T("dsg-table:loading",l.value)}}),(a,n)=>(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",{ref:"dsgTableBodyWrapper",class:e.normalizeClass(["dsg-table-body-wrapper",{"fixed-header":x.value}]),style:e.normalizeStyle({height:t.tableHeight||void 0})},[e.createElementVNode("table",{class:e.normalizeClass(["dsg-table-main",x.value?"fixed-header":"",y.value.table,"table-"+t.tableLayout])},[e.createElementVNode("colgroup",{span:M.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r?.visible?(e.openBlock(),e.createElementBlock("col",{key:D,style:e.normalizeStyle({width:r.width||void 0}),class:e.normalizeClass("dsg-table--col-"+r.name+" "+r.titleClass)},null,6)):e.createCommentVNode("",!0)],64))),256)),!x.value&&V.value?(e.openBlock(),e.createElementBlock("col",{key:0,style:e.normalizeStyle({width:F.value}),class:"dsg-table--col-gutter"},null,4)):e.createCommentVNode("",!0)],8,Oe),e.createElementVNode("thead",{class:e.normalizeClass([[y.value.thead,{sticky:x.value,"top-0":x.value}],"dsg-table--head"])},[e.renderSlot(a.$slots,"tableHeader",{fields:m.value},()=>[e.createVNode(te,{fields:m.value,"has-select-all":t.selectable,"selected-rows":$.value,"onUpdate:selectedRows":n[0]||(n[0]=r=>$.value=r),"has-selected":R.value,"onUpdate:hasSelected":n[1]||(n[1]=r=>R.value=r),"scroll-visible":V.value,"show-expand-detail":t.hasDetailRow&&t.showExpandDetail,"table-data-length":v.value?.length,"sort-field":d.value,"onUpdate:sortField":n[2]||(n[2]=r=>d.value=r),"onDsgTable:sortField":n[3]||(n[3]=r=>G()),"onDsgTable:onSelectAll":O,"onDsgTable:onDeselectAll":W},null,8,["fields","has-select-all","selected-rows","has-selected","scroll-visible","show-expand-detail","table-data-length","sort-field"])])],2),e.createElementVNode("tbody",{class:e.normalizeClass(["dsg-table--body",y.value.tbody])},[l.value?(e.openBlock(),e.createElementBlock("tr",We,[e.createElementVNode("td",{colspan:M.value},[e.createElementVNode("div",{"aria-label":"Loading...",role:"status",class:"flex items-center space-x-3 h-12 w-full justify-center",colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-loading",{},()=>[e.createVNode(E._sfc_main,{icon:"loading-02",class:"animate-spin"}),n[4]||(n[4]=e.createElementVNode("span",{class:"text-xs font-medium text-gray-500"},"Loading...",-1))])],8,Ke)],8,je)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(v.value,(r,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[e.createElementVNode("tr",{class:e.normalizeClass(["dsg-table--tbody-row",q(r,D)]),onClick:h=>ce(h,D,r),onDblclick:h=>ue(h,D,r),onMouseover:h=>ge()},[t.selectable?(e.openBlock(),e.createElementBlock("td",Ye,[e.createVNode(E._sfc_main$2,{modelValue:r.selected,"onUpdate:modelValue":[h=>r.selected=h,h=>U(r)]},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(h,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[h.visible?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["dsg-table--tbody-cell",h.dataClass]),style:e.normalizeStyle({width:h.width||void 0}),onClick:J=>me(),onDblclick:J=>fe(),onContextmenu:J=>ve()},[e.renderSlot(a.$slots,H(h),{rowData:r,rowIndex:D,rowField:h},()=>[e.createElementVNode("span",{innerHTML:A(h,r)},null,8,Je)])],46,Ge)):e.createCommentVNode("",!0)],64))),128))],42,Qe),t.hasDetailRow?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:t.detailRowTransition},{default:e.withCtx(()=>[e.createElementVNode("tr",{class:"dsg-table--tbody-detail-row",onClick:h=>be()},[e.createElementVNode("td",{colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-detail-row",{rowData:r,rowIndex:D,options:t.detailRowOptions})],8,Ze)],8,Xe)]),_:2},1032,["name"])):e.createCommentVNode("",!0)],64))),128)),!l.value&&!v.value?.length&&t.noDataTemplate.length?(e.openBlock(),e.createElementBlock("tr",_e,[e.createElementVNode("td",{colspan:M.value,class:"dsg-table--empty-result"},[e.renderSlot(a.$slots,"dsg-table-empty-result",{},()=>[e.createTextVNode(e.toDisplayString(t.noDataTemplate),1)])],8,et)])):e.createCommentVNode("",!0)],2),e.createElementVNode("tfoot",tt,[e.renderSlot(a.$slots,"dsg-table-footer",{fields:m.value,data:v.value})])],2)],6)]))}}),lt={class:"dsg-table"},nt={key:0,class:"dsg-table--pre-header"},ot={class:"dsg-table--pre-header-left"},st=["textContent"],rt={class:"dsg-table--pre-header-right"},it={key:1,class:"dsg-table--search-header",ref:"dsgTableSearchHeaderEl"},dt={class:"dsg-table--search-top"},ct={key:2,class:"dsg-table--footer",ref:"dsgTableFooterEl"},ut={class:"dsg-table--footer-left"},gt={class:"dsg-table--footer-center"},mt={class:"dsg-table--footer-right"},ft=e.defineComponent({__name:"DsgTable",props:{getUrl:{},fields:{},loadOnStart:{type:Boolean,default:!0},displayPaginationInfo:{type:Boolean,default:!0},reloadOnChangeTimer:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},trackBy:{default:"id"},title:{default:""},filters:{default:()=>{}},initialFilters:{default:()=>({})},filterEntity:{default:""},filterEndpoint:{default:""},filterSearchEndpoint:{default:""},tableLayout:{default:"fixed"},autoSortFilters:{type:Boolean,default:!0},data:{default:null},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},css:{default:()=>({tableWrapper:"border-b"})},rowClass:{type:[String,Function],default:void 0},apiMode:{type:Boolean,default:!0}},emits:["dsg-table:action-edit","dsg-table:action-view","dsg-table:action-delete","dsg-table:action-archive","dsg-table:link-clicked","dsg-table:rows-selected","dsg-table:row-clicked","dsg-table:row-hover","dsg-table:row-dblclick","dsg-table:filter-updated","dsg-table:term-changed","dsg-table:data-loaded"],setup(t,{expose:S,emit:g}){const i=o=>{w.value=o},m=e.ref(t.apiMode&&!!(t.filterEntity||t.filterEndpoint||t.getUrl)),v=()=>{if(m.value){let o={};return E.getQueryStrings().forEach(s=>{if(s.key.startsWith("filter[")){const c=s.key.replace("filter[","").replace("]",""),k=s.value;o[`filter[${c}]`]=k.join(",")}}),o}else return{}},u=e.computed(()=>({...t.css,tableWrapper:"border-b "+(t.css?.tableWrapper||"")})),b=e.useSlots(),F=e.ref(!0),V=e.ref(null),y=e.ref("<p>Showing {from} to {to} of {total}</p>"),f=e.ref(null),l=e.useTemplateRef("dsgTable"),d=e.ref({perPage:20,change:i}),w=e.ref(20),B=e.ref({...v(),...t.initialFilters}),C=g,N=o=>{l.value?.changePage(o)},$=o=>{f.value=o},R=({data:o})=>{V.value=o,C("dsg-table:data-loaded",o)},x=()=>{l.value?.reload()},M=o=>{l.value?.setLoading(o)},T=o=>{const s=l.value?.getData?.()??[];l.value?.setData(s.map(c=>c.id===o.id?o:c))},A=o=>{const s=l.value?.getData?.()??[];l.value?.setData([...s,o])},H=o=>{const s=l.value?.getData?.()??[];l.value?.setData(s.filter(c=>c.id!==o.id))},q=o=>{l.value?.setData(o)},U=()=>l.value?.getData()??[],O=o=>{const s=l.value?.getData()??[],c=o(s);c&&l.value?.setData(c)},W=o=>{B.value=o},L=o=>{const s={...B.value};!o||o.trim()===""?delete s["filter[term]"]:s["filter[term]"]=o,B.value=s,e.nextTick(()=>{x()}),C("dsg-table:term-changed",o)},j=(o,s,c)=>{let k={};B.value["filter[term]"]&&(k["filter[term]"]=B.value["filter[term]"]),Object.keys(o).forEach(p=>{o[p]!==null&&o[p]!==void 0&&o[p]!==""&&(k[p]=o[p])}),B.value=k,e.nextTick(()=>{x()}),C("dsg-table:filter-updated",B.value,s,c)};return S({reloadTable:x,updateRowTable:T,addRowTable:A,deleteRowTable:H,setData:q,getData:U,mutateData:O,termChanged:L,setFilters:W,setLoading:M}),(o,s)=>(e.openBlock(),e.createElementBlock("div",lt,[t.hasHeader?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(o.$slots,"dsg-table--pre-header",{},()=>[e.createElementVNode("div",ot,[e.renderSlot(o.$slots,"dsg-table--page-title",{data:V.value,title:t.title},()=>[t.title.length>0?(e.openBlock(),e.createElementBlock("h1",{key:0,class:"dsg-table--title",textContent:e.toDisplayString(t.title)},null,8,st)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",rt,[e.renderSlot(o.$slots,"dsg-table--page-actions",{data:V.value})])])])):e.createCommentVNode("",!0),t.displayPaginationInfo?(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",dt,[e.renderSlot(o.$slots,"dsg-table--search-header",{data:V.value},()=>[e.createVNode(ee,{name:"term","onDsgTable:termChanged":s[0]||(s[0]=c=>L(c))}),e.createVNode(E._sfc_main$7,{entity:t.filterEntity,"filter-endpoint":t.filterEndpoint,"search-endpoint":t.filterSearchEndpoint,"auto-sort":t.autoSortFilters,filters:t.filters,"onDsgTable:filterUpdated":s[1]||(s[1]=(c,k,p)=>j(c,k,p))},null,8,["entity","filter-endpoint","search-endpoint","auto-sort","filters"]),e.renderSlot(o.$slots,"dsg-table--search-actions",{data:V.value})])]),e.renderSlot(o.$slots,"dsg-table--search-navigation")],512)):e.createCommentVNode("",!0),e.createVNode(at,{ref:"dsgTable","api-url":t.getUrl,"filter-params":B.value,"onUpdate:filterParams":s[7]||(s[7]=c=>B.value=c),"per-page":w.value,"onUpdate:perPage":s[8]||(s[8]=c=>w.value=c),fields:t.fields,"load-on-start":t.loadOnStart,"pagination-path":"meta",selectable:t.selectable,"track-by":t.trackBy,"table-layout":t.tableLayout,css:u.value,data:t.data,"row-class":t.rowClass,"api-mode":m.value,"onDsgTable:loading":s[9]||(s[9]=c=>F.value=!0),"onDsgTable:loaded":s[10]||(s[10]=c=>F.value=!1),"onDsgTable:paginationData":$,"onDsgTable:loadSuccess":R,"onDsgTable:rowsSelected":s[11]||(s[11]=c=>C("dsg-table:rows-selected",c)),"onDsgTable:rowClicked":s[12]||(s[12]=(c,k,p)=>C("dsg-table:row-clicked",c,k,p)),"onDsgTable:rowHover":s[13]||(s[13]=(c,k,p)=>C("dsg-table:row-hover",c,k,p)),"onDsgTable:rowDblclick":s[14]||(s[14]=(c,k,p)=>C("dsg-table:row-dblclick",c,k,p))},e.createSlots({"dsg-field--actions":e.withCtx(c=>[e.renderSlot(o.$slots,"dsg-table-actions",{data:c},()=>[(e.openBlock(),e.createBlock(_,{key:c.rowIndex,data:c,"onDsgTable:actionEdit":s[2]||(s[2]=(k,p)=>C("dsg-table:action-edit",k,p)),"onDsgTable:actionView":s[3]||(s[3]=(k,p)=>C("dsg-table:action-view",k,p)),"onDsgTable:actionDelete":s[4]||(s[4]=(k,p)=>C("dsg-table:action-delete",k,p)),"onDsgTable:actionArchive":s[5]||(s[5]=(k,p)=>C("dsg-table:action-archive",k,p)),"onDsgTable:linkClicked":s[6]||(s[6]=(k,p,I)=>C("dsg-table:link-clicked",k,p,I))},null,8,["data"]))])]),_:2},[e.renderList(e.unref(b),(c,k)=>({name:k,fn:e.withCtx(p=>[String(k)!=="dsg-field--actions"?e.renderSlot(o.$slots,k,e.normalizeProps(e.mergeProps({key:0},p))):e.createCommentVNode("",!0)])}))]),1032,["api-url","filter-params","per-page","fields","load-on-start","selectable","track-by","table-layout","css","data","row-class","api-mode"]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",ut,[e.renderSlot(o.$slots,"dsg-table--footer-left",{data:f.value,perPage:d.value},()=>[e.createVNode(Z,{ref:"paginationInfoStart",pagination:f.value,"onUpdate:pagination":s[15]||(s[15]=c=>f.value=c),"info-template":y.value},null,8,["pagination","info-template"]),e.renderSlot(o.$slots,"dsg-table--footer-left-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",gt,[e.renderSlot(o.$slots,"dsg-table--footer-center",{data:f.value,perPage:d.value},()=>[e.renderSlot(o.$slots,"dsg-table--footer-center-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",mt,[e.renderSlot(o.$slots,"dsg-table--footer-right",{data:f.value,perPage:d.value},()=>[F.value===!1?(e.openBlock(),e.createBlock(X,{key:0,ref:"pagination",pagination:f.value,"onUpdate:pagination":s[16]||(s[16]=c=>f.value=c),"onDsgTable:changePage":N},null,8,["pagination"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"dsg-table--footer-right-extras",{data:f.value,perPage:d.value})])])],512)):e.createCommentVNode("",!0)]))}}),vt={class:"dsg-table--per-page"},bt=["value","textContent"],kt=e.defineComponent({__name:"DsgTablePerPage",props:{perPageOptions:{default:()=>[10,20,30,50,100]},perPage:{}},setup(t){return(S,g)=>(e.openBlock(),e.createElementBlock("div",vt,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[0]||(g[0]=i=>t.perPage.perPage=i),class:"dsg-table--per-page-select",onChange:g[1]||(g[1]=i=>t.perPage.change(t.perPage.perPage))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.perPageOptions,i=>(e.openBlock(),e.createElementBlock("option",{key:i,value:i,textContent:e.toDisplayString(i)},null,8,bt))),128))],544),[[e.vModelSelect,t.perPage.perPage]])]))}}),ae=ft,le=_,ne=kt,oe=E._sfc_main$7,se=X,re=Z,ie=ee,de=te,ht={DsgTable:ae,DsgTableActions:le,DsgTablePerPage:ne,DsgTableFilter:oe,DsgTablePagination:se,DsgTablePaginationInfo:re,DsgTableSearch:ie,DsgTableRowHeader:de};exports.DsgTable=ae;exports.DsgTableActions=le;exports.DsgTableFilter=oe;exports.DsgTablePagination=se;exports.DsgTablePaginationInfo=re;exports.DsgTablePerPage=ne;exports.DsgTableRowHeader=de;exports.DsgTableSearch=ie;exports.default=ht;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("./DsgTablePerPage.vue_vue_type_style_index_0_lang-DU5GAN6E.cjs"),Q=require("./dsg-vue.helpers-string.cjs"),K=require("./dsg-vue.helpers-object.cjs"),ke=require("./dsg-vue.helpers.cjs"),he={class:"dsg-table--pagination"},ye=["disabled"],pe=["disabled"],we=["onClick","innerHTML"],Be=["onClick","innerHTML"],Ce=["disabled"],Pe=["disabled"],X=e.defineComponent({__name:"DsgTablePagination",props:e.mergeModels({onEachSide:{default:3},firstPage:{default:1},showFirstLast:{type:Boolean,default:!0},firstIcon:{default:"chevron-left-double"},lastIcon:{default:"chevron-right-double"},prevIcon:{default:"chevron-left"},nextIcon:{default:"chevron-right"}},{pagination:{default:null},paginationModifiers:{}}),emits:e.mergeModels(["dsg-table:change-page"],["update:pagination"]),setup(t,{expose:S,emit:g}){const i=e.useModel(t,"pagination"),m=e.computed(()=>i.value===null?0:i.value?.last_page-t.firstPage+1),v=e.computed(()=>i.value===null?0:i.value?.last_page),u=e.computed(()=>i.value===null?!1:i.value?.current_page===t.firstPage),b=e.computed(()=>i.value===null?!1:i.value?.current_page===v.value),F=e.computed(()=>m.value<t.onEachSide*2+4),V=e.computed(()=>t.onEachSide*2+1),p=e.computed(()=>!i.value||i.value?.current_page<=t.onEachSide?1:i.value?.current_page>=m.value-t.onEachSide?m.value-t.onEachSide*2:i.value?.current_page-t.onEachSide),f=g,l=w=>{f("dsg-table:change-page",w)},d=w=>w===i.value?.current_page;return S({loadPage:l}),(w,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",he,[t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:B[0]||(B[0]=C=>l(t.firstPage)),class:e.normalizeClass([[u.value?"disabled":""],"dsg-table--pagination-link"]),disabled:u.value,title:"First","aria-label":"First"},[e.createVNode(D._sfc_main,{icon:t.firstIcon,size:"sm"},null,8,["icon"])],10,ye)):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:B[1]||(B[1]=C=>l("prev")),class:e.normalizeClass([[u.value?"disabled":""],"dsg-table--pagination-link"]),disabled:u.value,title:"Previous","aria-label":"Previous"},[e.createVNode(D._sfc_main,{icon:t.prevIcon,size:"sm"},null,8,["icon"])],10,pe),F.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(m.value,(C,N)=>(e.openBlock(),e.createElementBlock("a",{key:N,onClick:$=>l(N+t.firstPage),class:e.normalizeClass([[d(N+t.firstPage)?"active":""],"dsg-table--pagination-link"]),innerHTML:C},null,10,we))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(V.value,(C,N)=>(e.openBlock(),e.createElementBlock("a",{key:N,onClick:$=>l(p.value+N+t.firstPage-1),class:e.normalizeClass([[d(p.value+N+t.firstPage-1)?"active":""],"dsg-table--pagination-link"]),innerHTML:p.value+C-1},null,10,Be))),128)),e.createElementVNode("a",{onClick:B[2]||(B[2]=C=>l("next")),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Next","aria-label":"Next"},[e.createVNode(D._sfc_main,{icon:t.nextIcon,size:"sm"},null,8,["icon"])],10,Ce),t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:3,onClick:B[3]||(B[3]=C=>l(v.value)),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Last","aria-label":"Last"},[e.createVNode(D._sfc_main,{icon:t.lastIcon,size:"sm"},null,8,["icon"])],10,Pe)):e.createCommentVNode("",!0)],512)),[[e.vShow,i.value&&v.value>t.firstPage]])}}),De=["innerHTML"],Z=e.defineComponent({__name:"DsgTablePaginationInfo",props:e.mergeModels({infoTemplate:{default:"Displaying {from} to {to} of {total} items"},noDataTemplate:{default:"No relevant data"}},{pagination:{default:null},paginationModifiers:{}}),emits:["update:pagination"],setup(t){const S=e.useModel(t,"pagination"),g=e.computed(()=>S.value==null||S.value.total==0?t.noDataTemplate:t.infoTemplate.replace("{from}",(S.value?.from||0).toString()).replace("{to}",(S.value?.to||0).toString()).replace("{total}",(S.value?.total||0).toString()));return(i,m)=>(e.openBlock(),e.createElementBlock("div",{class:"dsg-table--pagination-info",innerHTML:g.value},null,8,De))}}),Ee={class:"dsg-table--actions",ref:"dsgTableActions"},Se={class:"dsg-table--action-trigger"},$e={key:0,class:"dsg-table--actions-menu-wrapper"},Ve=["href","target","onClick"],Te=["textContent"],Ne={key:0},Fe={key:1},xe=["href","target","onClick"],Me={class:"flex-1"},_=e.defineComponent({__name:"DsgTableActions",props:{placement:{default:"auto"}},emits:["dsg-table:action-edit","dsg-table:action-view","dsg-table:action-delete","dsg-table:action-archive","dsg-table:link-clicked"],setup(t,{emit:S}){const g=e.ref(!1);e.useTemplateRef("dsgTableActions");const i=e.useAttrs(),m=e.ref(i.data.rowData?.actions??null),v=e.ref(i.data.rowData?.links??null),u=e.ref(i.data.rowData??null),b=f=>{switch(f){case"edit":return"edit-05";case"view":return"eye";case"delete":return"trash-01";case"archive":return"eye-off";default:return"dots-horizontal"}},F=(f,l,d)=>{switch(l){case"edit":p("dsg-table:action-edit",d,u.value);break;case"view":p("dsg-table:action-view",d,u.value);break;case"delete":p("dsg-table:action-delete",d,u.value);break;case"archive":p("dsg-table:action-archive",d,u.value);break}},V=(f,l)=>{const d=f.actionId||f.label.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-");p("dsg-table:link-clicked",l,d,u.value)},p=S;return(f,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(D.kt),{triggers:[],placement:t.placement,"handle-resize":!0,strategy:"absolute",shown:g.value,class:"dsg-table--actions__popper",onHide:l[1]||(l[1]=d=>g.value=!1),ref:"floatingVueFilterDropdown"},{popper:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[["edit","view","delete","archive"].includes(String(w))?(e.openBlock(),e.createElementBlock("a",{key:w,href:m.value?.link,target:m.value?.target||"_self",onClick:B=>F(d,String(w),B)},[e.createElementVNode("div",{class:e.normalizeClass(["dsg-table--actions-menu-item",String(w)])},[e.createVNode(D._sfc_main,{icon:b(String(w)),size:"sm"},null,8,["icon"]),e.createElementVNode("span",{class:"flex-1",textContent:e.toDisplayString(e.unref(Q.ucfirst)(String(w)))},null,8,Te)],2)],8,Ve)):e.createCommentVNode("",!0)],64))),256)),m.value&&v.value?(e.openBlock(),e.createElementBlock("hr",Ne)):e.createCommentVNode("",!0),v.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(v.value,d=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d.label},[d.hasOwnProperty("component")?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.component),{key:0,quote:e.unref(i).data.data.rowData,"row-data":e.unref(i).data.data.rowData},null,8,["quote","row-data"])):d.hasOwnProperty("type")&&d.type=="break"?(e.openBlock(),e.createElementBlock("hr",Fe)):(e.openBlock(),e.createElementBlock("a",{key:2,href:d.link,target:d.target||"_self",class:e.normalizeClass(["dsg-table--actions-menu-item",d.class]),onClick:w=>V(d,w)},[d.icon?(e.openBlock(),e.createBlock(D._sfc_main,{key:0,icon:d.icon,size:"sm"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("span",Me,e.toDisplayString(d.label),1)],10,xe))],64))),128)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",Se,[e.createElementVNode("button",{type:"button",class:"dsg-table--actions-button","aria-expanded":"false","aria-haspopup":"true",onClick:l[0]||(l[0]=d=>g.value=!g.value)},[e.renderSlot(f.$slots,"dsg-table-action-button-content",{},()=>[e.createVNode(D._sfc_main,{icon:"dots-vertical",size:"sm"})])])])]),_:3},8,["placement","shown"])])),[[e.unref(D.vOnClickOutside),()=>g.value=!1]])}}),Le={class:"dsg-table--search"},ee=e.defineComponent({__name:"DsgTableSearch",props:{name:{},id:{},placeholder:{default:"Search"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1},extraClasses:{},eventName:{},replaceState:{type:Boolean,default:!0}},emits:["dsg-table:term-changed"],setup(t,{emit:S}){const g=e.ref("");e.onMounted(()=>{const u=new URL(window.location.href).searchParams.get("term");u&&(g.value=u,i("dsg-table:term-changed",u))});const i=S,m=D.useDebounceFn(v=>{if(g.value=v,t.replaceState){const u=new URL(window.location.href);g.value?u.searchParams.set("term",g.value):u.searchParams.delete("term"),window.history.pushState({},"",u.toString())}i("dsg-table:term-changed",g.value)},300);return(v,u)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(D._sfc_main$4,{modelValue:g.value,"onUpdate:modelValue":u[0]||(u[0]=b=>g.value=b),name:t.name,id:t.id||t.name,placeholder:t.placeholder,disabled:t.disabled,required:t.required,readonly:t.readonly,hidden:t.hidden,"has-clear-button":!0,autocomplete:"off",size:"sm",icon:"search-sm","icon-clickable":!0,onIconClicked:u[1]||(u[1]=b=>e.unref(m)(b)),onEnterPressed:u[2]||(u[2]=b=>e.unref(m)(b)),onOnClear:u[3]||(u[3]=()=>e.unref(m)(""))},null,8,["modelValue","name","id","placeholder","disabled","required","readonly","hidden"])]))}}),ze={class:"dsg-table--header-row"},Re={key:0,class:"dsg-table--th dsg-table--th-checkbox",scope:"col"},Ie={key:1,class:"dsg-table--th dsg-table--th-expand-detail",scope:"col"},Ae=["title","id","onClick"],qe={key:0,class:"dsg-table--th-sort-icon"},He=["innerHTML"],Ue=["innerHTML"],te=e.defineComponent({__name:"DsgTableRowHeader",props:e.mergeModels({fields:{},scrollVisible:{type:Boolean},hasSelectAll:{type:Boolean,default:!1},showExpandDetail:{type:Boolean,default:!0},tableDataLength:{default:0}},{sortField:{default:null},sortFieldModifiers:{},selectedRows:{default:[]},selectedRowsModifiers:{},hasSelected:{type:Boolean,default:!1},hasSelectedModifiers:{}}),emits:e.mergeModels(["dsg-table:sort-field","dsg-table:on-select-all","dsg-table:on-deselect-all"],["update:sortField","update:selectedRows","update:hasSelected"]),setup(t,{emit:S}){const g=e.useModel(t,"sortField"),i=e.useModel(t,"selectedRows"),m=e.useModel(t,"hasSelected"),v=e.ref("17px"),u=p=>{m.value&&i.value.length>0&&i.value.length!==t.tableDataLength?(m.value=!0,b("dsg-table:on-select-all")):!m.value&&i.value.length===0?(m.value=!1,b("dsg-table:on-select-all")):b("dsg-table:on-deselect-all")},b=S,F=(p,f)=>[p,p+"-"+Q.toSnakeCase(String(f?.name)),f.titleClass||"",{sortable:f.sortable},{"sort-active":g.value?.name===f.name}],V=p=>{p.sortable&&(g.value={name:String(p?.name),field:String(p?.sortField),direction:g.value?.name===p.name&&g.value?.direction==="asc"?"desc":"asc"},b("dsg-table:sort-field",p))};return(p,f)=>(e.openBlock(),e.createElementBlock("tr",ze,[t.hasSelectAll?(e.openBlock(),e.createElementBlock("th",Re,[e.createVNode(D._sfc_main$2,{modelValue:m.value,"onUpdate:modelValue":[f[0]||(f[0]=l=>m.value=l),u],indeterminate:i.value.length>0&&i.value.length!==t.tableDataLength},null,8,["modelValue","indeterminate"])])):e.createCommentVNode("",!0),t.showExpandDetail?(e.openBlock(),e.createElementBlock("th",Ie)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,(l,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l?.visible?(e.openBlock(),e.createElementBlock("th",{key:d,class:e.normalizeClass(F("dsg-table--th",l)),style:e.normalizeStyle([{width:l.width||void 0},l.style]),title:l.title+(l.sortable?" Sort":""),id:"_"+l.name,onClick:w=>V(l),scope:"col"},[l.sortable?(e.openBlock(),e.createElementBlock("div",qe,[l.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dsg-table--th-title",innerHTML:l.title},null,8,He)):e.createCommentVNode("",!0),l.sortable&&g.value?.name!==l.name?(e.openBlock(),e.createBlock(D._sfc_main,{key:1,icon:"chevron-selector-vertical",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&g.value?.name===l.name&&g.value?.direction==="asc"?(e.openBlock(),e.createBlock(D._sfc_main,{key:2,icon:"chevron-down",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&g.value?.name===l.name&&g.value?.direction==="desc"?(e.openBlock(),e.createBlock(D._sfc_main,{key:3,icon:"chevron-up",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"dsg-table--th-title",innerHTML:e.unref(Q.ucwords)(String(l?.title))},null,8,Ue))],14,Ae)):e.createCommentVNode("",!0)],64))),256)),t.scrollVisible?(e.openBlock(),e.createElementBlock("th",{key:2,style:e.normalizeStyle({width:v.value}),class:"dsg-table--th-col-gutter"},null,4)):e.createCommentVNode("",!0)]))}}),Oe={class:"dsg-table--wrapper"},We=["span"],je={key:0,class:"dsg-table--loading"},Ke=["colspan"],Qe=["colspan"],Ye=["onClick","onDblclick","onMouseover"],Ge={key:0,class:"dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"},Je=["onClick","onDblclick","onContextmenu"],Xe=["innerHTML"],Ze=["onClick"],_e=["colspan"],et={key:2},tt=["colspan"],at={class:"dsg-table--footer"},lt=e.defineComponent({__name:"DsgTableComponent",props:e.mergeModels({fields:{default:()=>[]},isDraggable:{type:Boolean,default:!1},dragApi:{default:""},loadOnStart:{type:Boolean,default:!0},apiUrl:{default:""},httpMethod:{default:"get"},reactiveApiUrl:{type:Boolean,default:!0},apiMode:{type:Boolean,default:!0},data:{default:null},dataManager:{type:[Function,null],default:null},dataPath:{default:"data"},tableLayout:{default:"fixed"},paginationPath:{default:"links.pagination"},queryParams:{default:()=>({sort:"sort",order:"order",page:"page",perPage:"per_page"})},httpOptions:{default:()=>({})},hasDetailRow:{type:Boolean,default:!1},showExpandDetail:{type:Boolean,default:!0},initialPage:{default:1},firstPage:{default:1},sortOrder:{default:()=>[]},multiSort:{type:Boolean},tableHeight:{default:null},multiSortKey:{},rowClass:{type:[String,Function],default:""},detailRowComponent:{},detailRowTransition:{default:"fade"},detailRowClass:{type:[String,Function]},detailRowOptions:{default:()=>({})},trackBy:{default:"id"},css:{default:()=>({tableWrapper:"dsg-table-wrapper",thead:"dsg-table-thead",tbody:"dsg-table-tbody",table:"dsg-table-component"})},minRows:{default:0},noDataTemplate:{default:"No Data Available"},showSortIcons:{type:Boolean},headerRows:{},transform:{type:[Function,null],default:null},sortParams:{type:[Function,null],default:null},fieldPrefix:{},eventPrefix:{},selectable:{type:Boolean,default:!1}},{filterParams:{default:{}},filterParamsModifiers:{},perPage:{default:20},perPageModifiers:{}}),emits:e.mergeModels(["dsg-table:loading","dsg-table:loaded","dsg-table:load-success","dsg-table:load-error","dsg-table:pagination-data","dsg-table:rows-selected","dsg-table:row-clicked","dsg-table:row-hover","dsg-table:row-dblclick"],["update:filterParams","update:perPage"]),setup(t,{expose:S,emit:g}){const i=a=>a.map((n,r)=>({field:n.field||"",title:n.title||"",name:n.name||"",titleClass:n.titleClass||"",dataClass:n.dataClass||"",visible:n.visible??!0,width:n.width||void 0,sortField:n.sortField||null,sortable:n.sortField,formatter:n.formatter||null,$_index:r})),m=e.ref(i(t.fields)),v=e.ref(t.data),u=e.ref(null),b=e.ref(t.initialPage),F=e.ref("17px"),V=e.ref(!1),p=e.ref({}),f=e.ref(0),l=e.ref(!0),d=e.ref(null),w=e.ref(null),B=e.ref(0),C=e.useModel(t,"filterParams"),N=e.useModel(t,"perPage"),$=e.ref([]),R=e.ref(!1),x=e.computed(()=>t.tableHeight!=null),M=e.computed(()=>m.value.filter(a=>a.visible).length);e.watch(()=>$.value.length,a=>{R.value=t.selectable&&a>0},{immediate:!0}),e.watch(()=>t.fields,a=>{m.value=i(a)},{immediate:!0,deep:!0}),e.watch(()=>C.value,a=>{z()},{deep:!0}),e.watch(()=>N.value,()=>{z()}),e.watch(()=>t.apiUrl,(a,n)=>{t.apiMode&&a!==n&&a&&z()});const T=g,A=(a,n)=>a.formatter&&typeof a.formatter=="function"?a.formatter(a,n):K.data_get(n,String(a?.name),""),q=a=>"dsg-field--"+a.name?.toLowerCase().replaceAll(/[_ ]/g,"-"),H=(a,n)=>{const r={odd:n%2===0,even:n%2!==0,"row-selected":a.selected};if(!t.rowClass)return r;let P={};if(typeof t.rowClass=="function"){const h=t.rowClass(a,n);typeof h=="string"?h.split(" ").forEach(E=>{E.trim()&&(P[E.trim()]=!0)}):Array.isArray(h)?h.forEach(E=>{typeof E=="string"&&E.trim()&&(P[E.trim()]=!0)}):typeof h=="object"&&h!==null&&(P=h)}else typeof t.rowClass=="string"&&t.rowClass.split(" ").forEach(h=>{h.trim()&&(P[h.trim()]=!0)});return{...r,...P}},U=a=>{if(t.selectable){if(a.selected)$.value.push(a);else{const n=$.value.findIndex(r=>r[t.trackBy]===a[t.trackBy]);n!==-1&&$.value.splice(n,1)}T("dsg-table:rows-selected",$.value)}},O=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!0}),$.value=v.value?.filter(a=>a.selected)??[],T("dsg-table:rows-selected",$.value))},W=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!1}),$.value=[],T("dsg-table:rows-selected",$.value))},L=a=>{v.value=Array.isArray(a)?a:[],t.selectable&&v.value.forEach(n=>{n.selected=n.selected??!1})},j=()=>v.value??[],o=a=>{a==="prev"?b.value>t.firstPage&&b.value--:a==="next"?b.value<(u.value?.last_page??0)&&b.value++:a!=b.value&&a>=t.firstPage&&a<=(u.value?.last_page??0)&&(b.value=a),z()},s=()=>({[t.queryParams?.sort]:d.value?(d.value?.direction==="desc"?"-":"")+d.value?.field:void 0,[t.queryParams?.order]:d.value?.direction,[t.queryParams?.page]:b.value,[t.queryParams?.perPage]:N.value}),c=()=>{w.value&&(w.value.abort(),w.value=null)},k=(a,n)=>{c(),B.value++;const r=B.value,P=new AbortController;return n.signal=P.signal,w.value=P,(t.httpMethod.toLowerCase()==="get"?D.axios.get(a,n):(()=>{const E=n.params;return delete n.params,D.axios.post(a,E,n)})()).then(E=>({...E,_requestId:r,_apiUrl:a}),E=>{throw E.name==="AbortError"||E.code==="ERR_CANCELED"?{...E,_requestId:r,_cancelled:!0}:{...E,_requestId:r}})},y=a=>{if(a._requestId&&a._requestId!==B.value||a._apiUrl&&a._apiUrl!==t.apiUrl)return;T("dsg-table:load-success",a);const n=t.transform?t.transform(a.data):a.data;v.value=K.data_get(n,t.dataPath,null),t.selectable&&v.value?.forEach(r=>{r.selected=r.selected??!1}),u.value=K.data_get(n,t.paginationPath,null)??null,f.value=v.value?.length?v.value[0].order:f,!ke.isEmpty(t.paginationPath)&&u.value===null&&console.warn('DsgTable: pagination-path "'+t.paginationPath+`" not found. It looks like the data returned from the server does not have pagination information or you may have set it incorrectly.
|
|
2
|
+
You can explicitly suppress this warning by setting pagination-path="".`),w.value=null,T("dsg-table:pagination-data",u.value),u.value&&b.value>(u.value?.last_page||0)&&v.value?.length===0&&(b.value=t.initialPage,z()),T("dsg-table:loaded"),l.value=!1},I=a=>{a._requestId&&a._requestId!==B.value||a._apiUrl&&a._apiUrl!==t.apiUrl||a._cancelled||(console.error("load-error",a),w.value=null,T("dsg-table:load-error",a),T("dsg-table:loaded"),l.value=!1)},Y=()=>{if(t.data!==null&&Array.isArray(t.data)){L(t.data),l.value=!1;return}if(t.dataManager&&typeof t.dataManager=="function"){const a=t.dataManager();L(a),l.value=!1}else L(t.data),l.value=!1},z=(a=y,n=I,r={})=>{const P=a||y,h=n||I;if(!t.apiMode){Y();return}return l.value=!0,T("dsg-table:loading",l.value),t.httpOptions.params={...s(),...C.value},k(t.apiUrl,t.httpOptions).then(P).catch(E=>h(E))},ce=(a,n,r)=>{T("dsg-table:row-clicked",a,n,r)},ue=(a,n,r)=>{T("dsg-table:row-dblclick",a,n,r)},ge=(a,n,r)=>{},me=(a,n,r,P)=>{},fe=(a,n,r,P)=>{},ve=(a,n,r,P)=>{},be=(a,n,r)=>{};e.onMounted(()=>{t.apiMode===!0?z():Y()});const G=()=>{t.apiMode&&($.value=[],c(),z())};return S({changePage:o,reload:G,getData:j,setData:L,setLoading:a=>{l.value=a,T("dsg-table:loading",l.value)}}),(a,n)=>(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",{ref:"dsgTableBodyWrapper",class:e.normalizeClass(["dsg-table-body-wrapper",{"fixed-header":x.value}]),style:e.normalizeStyle({height:t.tableHeight||void 0})},[e.createElementVNode("table",{class:e.normalizeClass(["dsg-table-main",x.value?"fixed-header":"",p.value.table,"table-"+t.tableLayout])},[e.createElementVNode("colgroup",{span:M.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r?.visible?(e.openBlock(),e.createElementBlock("col",{key:P,style:e.normalizeStyle({width:r.width||void 0}),class:e.normalizeClass("dsg-table--col-"+r.name+" "+r.titleClass)},null,6)):e.createCommentVNode("",!0)],64))),256)),!x.value&&V.value?(e.openBlock(),e.createElementBlock("col",{key:0,style:e.normalizeStyle({width:F.value}),class:"dsg-table--col-gutter"},null,4)):e.createCommentVNode("",!0)],8,We),e.createElementVNode("thead",{class:e.normalizeClass([[p.value.thead,{sticky:x.value,"top-0":x.value}],"dsg-table--head"])},[e.renderSlot(a.$slots,"tableHeader",{fields:m.value},()=>[e.createVNode(te,{fields:m.value,"has-select-all":t.selectable,"selected-rows":$.value,"onUpdate:selectedRows":n[0]||(n[0]=r=>$.value=r),"has-selected":R.value,"onUpdate:hasSelected":n[1]||(n[1]=r=>R.value=r),"scroll-visible":V.value,"show-expand-detail":t.hasDetailRow&&t.showExpandDetail,"table-data-length":v.value?.length,"sort-field":d.value,"onUpdate:sortField":n[2]||(n[2]=r=>d.value=r),"onDsgTable:sortField":n[3]||(n[3]=r=>G()),"onDsgTable:onSelectAll":O,"onDsgTable:onDeselectAll":W},null,8,["fields","has-select-all","selected-rows","has-selected","scroll-visible","show-expand-detail","table-data-length","sort-field"])])],2),e.createElementVNode("tbody",{class:e.normalizeClass(["dsg-table--body",p.value.tbody])},[l.value?(e.openBlock(),e.createElementBlock("tr",je,[e.createElementVNode("td",{colspan:M.value},[e.createElementVNode("div",{"aria-label":"Loading...",role:"status",class:"flex items-center space-x-3 h-12 w-full justify-center",colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-loading",{},()=>[e.createVNode(D._sfc_main,{icon:"loading-02",class:"animate-spin"}),n[4]||(n[4]=e.createElementVNode("span",{class:"text-xs font-medium text-gray-500"},"Loading...",-1))])],8,Qe)],8,Ke)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(v.value,(r,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[e.createElementVNode("tr",{class:e.normalizeClass(["dsg-table--tbody-row",H(r,P)]),onClick:h=>ce(h,P,r),onDblclick:h=>ue(h,P,r),onMouseover:h=>ge()},[t.selectable?(e.openBlock(),e.createElementBlock("td",Ge,[e.createVNode(D._sfc_main$2,{modelValue:r.selected,"onUpdate:modelValue":[h=>r.selected=h,h=>U(r)]},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(h,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[h.visible?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["dsg-table--tbody-cell",h.dataClass]),style:e.normalizeStyle({width:h.width||void 0}),onClick:J=>me(),onDblclick:J=>fe(),onContextmenu:J=>ve()},[e.renderSlot(a.$slots,q(h),{rowData:r,rowIndex:P,rowField:h},()=>[e.createElementVNode("span",{innerHTML:A(h,r)},null,8,Xe)])],46,Je)):e.createCommentVNode("",!0)],64))),128))],42,Ye),t.hasDetailRow?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:t.detailRowTransition},{default:e.withCtx(()=>[e.createElementVNode("tr",{class:"dsg-table--tbody-detail-row",onClick:h=>be()},[e.createElementVNode("td",{colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-detail-row",{rowData:r,rowIndex:P,options:t.detailRowOptions})],8,_e)],8,Ze)]),_:2},1032,["name"])):e.createCommentVNode("",!0)],64))),128)),!l.value&&!v.value?.length&&t.noDataTemplate.length?(e.openBlock(),e.createElementBlock("tr",et,[e.createElementVNode("td",{colspan:M.value,class:"dsg-table--empty-result"},[e.renderSlot(a.$slots,"dsg-table-empty-result",{},()=>[e.createTextVNode(e.toDisplayString(t.noDataTemplate),1)])],8,tt)])):e.createCommentVNode("",!0)],2),e.createElementVNode("tfoot",at,[e.renderSlot(a.$slots,"dsg-table-footer",{fields:m.value,data:v.value})])],2)],6)]))}}),nt={class:"dsg-table"},ot={key:0,class:"dsg-table--pre-header"},st={class:"dsg-table--pre-header-left"},rt=["textContent"],it={class:"dsg-table--pre-header-right"},dt={key:1,class:"dsg-table--search-header",ref:"dsgTableSearchHeaderEl"},ct={class:"dsg-table--search-top"},ut={key:2,class:"dsg-table--footer",ref:"dsgTableFooterEl"},gt={class:"dsg-table--footer-left"},mt={class:"dsg-table--footer-center"},ft={class:"dsg-table--footer-right"},vt=e.defineComponent({__name:"DsgTable",props:{getUrl:{},fields:{},loadOnStart:{type:Boolean,default:!0},displaySearch:{type:Boolean,default:!0},displayPaginationInfo:{type:Boolean,default:!0},reloadOnChangeTimer:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},trackBy:{default:"id"},title:{default:""},filters:{default:()=>{}},initialFilters:{default:()=>({})},filterEntity:{default:""},filterEndpoint:{default:""},filterSearchEndpoint:{default:""},tableLayout:{default:"fixed"},autoSortFilters:{type:Boolean,default:!0},data:{default:null},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},perPage:{default:20},paginationPath:{default:"meta"},css:{default:()=>({tableWrapper:"border-b"})},rowClass:{type:[String,Function],default:void 0},apiMode:{type:Boolean,default:!0}},emits:["dsg-table:action-edit","dsg-table:action-view","dsg-table:action-delete","dsg-table:action-archive","dsg-table:link-clicked","dsg-table:rows-selected","dsg-table:row-clicked","dsg-table:row-hover","dsg-table:row-dblclick","dsg-table:filter-updated","dsg-table:term-changed","dsg-table:data-loaded"],setup(t,{expose:S,emit:g}){const i=o=>{w.value=o},m=e.ref(t.apiMode&&!!(t.filterEntity||t.filterEndpoint||t.getUrl)),v=()=>{if(m.value){let o={};return D.getQueryStrings().forEach(s=>{if(s.key.startsWith("filter[")){const c=s.key.replace("filter[","").replace("]",""),k=s.value;o[`filter[${c}]`]=k.join(",")}}),o}else return{}},u=e.computed(()=>({...t.css,tableWrapper:"border-b "+(t.css?.tableWrapper||"")})),b=e.useSlots(),F=e.ref(!0),V=e.ref(null),p=e.ref("<p>Showing {from} to {to} of {total}</p>"),f=e.ref(null),l=e.useTemplateRef("dsgTable"),d=e.ref({perPage:t.perPage,change:i}),w=e.ref(t.perPage),B=e.ref({...v(),...t.initialFilters}),C=g,N=o=>{l.value?.changePage(o)},$=o=>{f.value=o},R=({data:o})=>{V.value=o,C("dsg-table:data-loaded",o)},x=()=>{l.value?.reload()},M=o=>{l.value?.setLoading(o)},T=o=>{const s=l.value?.getData?.()??[];l.value?.setData(s.map(c=>c.id===o.id?o:c))},A=o=>{const s=l.value?.getData?.()??[];l.value?.setData([...s,o])},q=o=>{const s=l.value?.getData?.()??[];l.value?.setData(s.filter(c=>c.id!==o.id))},H=o=>{l.value?.setData(o)},U=()=>l.value?.getData()??[],O=o=>{const s=l.value?.getData()??[],c=o(s);c&&l.value?.setData(c)},W=o=>{B.value=o},L=o=>{const s={...B.value};!o||o.trim()===""?delete s["filter[term]"]:s["filter[term]"]=o,B.value=s,e.nextTick(()=>{x()}),C("dsg-table:term-changed",o)},j=(o,s,c)=>{let k={};B.value["filter[term]"]&&(k["filter[term]"]=B.value["filter[term]"]),Object.keys(o).forEach(y=>{o[y]!==null&&o[y]!==void 0&&o[y]!==""&&(k[y]=o[y])}),B.value=k,e.nextTick(()=>{x()}),C("dsg-table:filter-updated",B.value,s,c)};return S({reloadTable:x,updateRowTable:T,addRowTable:A,deleteRowTable:q,setData:H,getData:U,mutateData:O,termChanged:L,setFilters:W,setLoading:M}),(o,s)=>(e.openBlock(),e.createElementBlock("div",nt,[t.hasHeader?(e.openBlock(),e.createElementBlock("div",ot,[e.renderSlot(o.$slots,"dsg-table--pre-header",{},()=>[e.createElementVNode("div",st,[e.renderSlot(o.$slots,"dsg-table--page-title",{data:V.value,title:t.title},()=>[t.title.length>0?(e.openBlock(),e.createElementBlock("h1",{key:0,class:"dsg-table--title",textContent:e.toDisplayString(t.title)},null,8,rt)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",it,[e.renderSlot(o.$slots,"dsg-table--page-actions",{data:V.value})])])])):e.createCommentVNode("",!0),t.displaySearch?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ct,[e.renderSlot(o.$slots,"dsg-table--search-header",{data:V.value},()=>[e.createVNode(ee,{name:"term","onDsgTable:termChanged":s[0]||(s[0]=c=>L(c))}),e.createVNode(D._sfc_main$7,{entity:t.filterEntity,"filter-endpoint":t.filterEndpoint,"search-endpoint":t.filterSearchEndpoint,"auto-sort":t.autoSortFilters,filters:t.filters,"onDsgTable:filterUpdated":s[1]||(s[1]=(c,k,y)=>j(c,k,y))},null,8,["entity","filter-endpoint","search-endpoint","auto-sort","filters"]),e.renderSlot(o.$slots,"dsg-table--search-actions",{data:V.value})])]),e.renderSlot(o.$slots,"dsg-table--search-navigation")],512)):e.createCommentVNode("",!0),e.createVNode(lt,{ref:"dsgTable","api-url":t.getUrl,"filter-params":B.value,"onUpdate:filterParams":s[7]||(s[7]=c=>B.value=c),"per-page":w.value,"onUpdate:perPage":s[8]||(s[8]=c=>w.value=c),fields:t.fields,"load-on-start":t.loadOnStart,"pagination-path":t.paginationPath,selectable:t.selectable,"track-by":t.trackBy,"table-layout":t.tableLayout,css:u.value,data:t.data,"row-class":t.rowClass,"api-mode":m.value,"onDsgTable:loading":s[9]||(s[9]=c=>F.value=!0),"onDsgTable:loaded":s[10]||(s[10]=c=>F.value=!1),"onDsgTable:paginationData":$,"onDsgTable:loadSuccess":R,"onDsgTable:rowsSelected":s[11]||(s[11]=c=>C("dsg-table:rows-selected",c)),"onDsgTable:rowClicked":s[12]||(s[12]=(c,k,y)=>C("dsg-table:row-clicked",c,k,y)),"onDsgTable:rowHover":s[13]||(s[13]=(c,k,y)=>C("dsg-table:row-hover",c,k,y)),"onDsgTable:rowDblclick":s[14]||(s[14]=(c,k,y)=>C("dsg-table:row-dblclick",c,k,y))},e.createSlots({"dsg-field--actions":e.withCtx(c=>[e.renderSlot(o.$slots,"dsg-table-actions",{data:c},()=>[(e.openBlock(),e.createBlock(_,{key:c.rowIndex,data:c,"onDsgTable:actionEdit":s[2]||(s[2]=(k,y)=>C("dsg-table:action-edit",k,y)),"onDsgTable:actionView":s[3]||(s[3]=(k,y)=>C("dsg-table:action-view",k,y)),"onDsgTable:actionDelete":s[4]||(s[4]=(k,y)=>C("dsg-table:action-delete",k,y)),"onDsgTable:actionArchive":s[5]||(s[5]=(k,y)=>C("dsg-table:action-archive",k,y)),"onDsgTable:linkClicked":s[6]||(s[6]=(k,y,I)=>C("dsg-table:link-clicked",k,y,I))},null,8,["data"]))])]),_:2},[e.renderList(e.unref(b),(c,k)=>({name:k,fn:e.withCtx(y=>[String(k)!=="dsg-field--actions"?e.renderSlot(o.$slots,k,e.normalizeProps(e.mergeProps({key:0},y))):e.createCommentVNode("",!0)])}))]),1032,["api-url","filter-params","per-page","fields","load-on-start","pagination-path","selectable","track-by","table-layout","css","data","row-class","api-mode"]),t.hasFooter?(e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("div",gt,[e.renderSlot(o.$slots,"dsg-table--footer-left",{data:f.value,perPage:d.value},()=>[t.displayPaginationInfo?(e.openBlock(),e.createBlock(Z,{key:0,ref:"paginationInfoStart",pagination:f.value,"onUpdate:pagination":s[15]||(s[15]=c=>f.value=c),"info-template":p.value},null,8,["pagination","info-template"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"dsg-table--footer-left-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",mt,[e.renderSlot(o.$slots,"dsg-table--footer-center",{data:f.value,perPage:d.value},()=>[e.renderSlot(o.$slots,"dsg-table--footer-center-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",ft,[e.renderSlot(o.$slots,"dsg-table--footer-right",{data:f.value,perPage:d.value},()=>[F.value===!1&&t.displayPaginationInfo?(e.openBlock(),e.createBlock(X,{key:0,ref:"pagination",pagination:f.value,"onUpdate:pagination":s[16]||(s[16]=c=>f.value=c),"onDsgTable:changePage":N},null,8,["pagination"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"dsg-table--footer-right-extras",{data:f.value,perPage:d.value})])])],512)):e.createCommentVNode("",!0)]))}}),bt={class:"dsg-table--per-page"},kt=["value","textContent"],ht=e.defineComponent({__name:"DsgTablePerPage",props:{perPageOptions:{default:()=>[10,20,30,50,100]},perPage:{}},setup(t){return(S,g)=>(e.openBlock(),e.createElementBlock("div",bt,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[0]||(g[0]=i=>t.perPage.perPage=i),class:"dsg-table--per-page-select",onChange:g[1]||(g[1]=i=>t.perPage.change(t.perPage.perPage))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.perPageOptions,i=>(e.openBlock(),e.createElementBlock("option",{key:i,value:i,textContent:e.toDisplayString(i)},null,8,kt))),128))],544),[[e.vModelSelect,t.perPage.perPage]])]))}}),ae=vt,le=_,ne=ht,oe=D._sfc_main$7,se=X,re=Z,ie=ee,de=te,yt={DsgTable:ae,DsgTableActions:le,DsgTablePerPage:ne,DsgTableFilter:oe,DsgTablePagination:se,DsgTablePaginationInfo:re,DsgTableSearch:ie,DsgTableRowHeader:de};exports.DsgTable=ae;exports.DsgTableActions=le;exports.DsgTableFilter=oe;exports.DsgTablePagination=se;exports.DsgTablePaginationInfo=re;exports.DsgTablePerPage=ne;exports.DsgTableRowHeader=de;exports.DsgTableSearch=ie;exports.default=yt;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as K, mergeModels as X, useModel as J, computed as V, withDirectives as ge, createElementBlock as i, openBlock as l, createCommentVNode as
|
|
1
|
+
import { defineComponent as K, mergeModels as X, useModel as J, computed as V, withDirectives as ge, createElementBlock as i, openBlock as l, createCommentVNode as D, createElementVNode as P, normalizeClass as B, createVNode as I, Fragment as R, renderList as N, vShow as Re, ref as p, useTemplateRef as ye, useAttrs as Ie, unref as O, withCtx as te, renderSlot as F, toDisplayString as ae, createBlock as j, resolveDynamicComponent as Ae, onMounted as we, normalizeStyle as Z, watch as ee, Transition as He, createTextVNode as Ue, useSlots as qe, createSlots as Ve, normalizeProps as ze, mergeProps as Oe, nextTick as he, vModelSelect as Ne } from "vue";
|
|
2
2
|
import { _ as z, k as We, v as je, f as Ke, u as Qe, c as ke, e as me, i as Pe, j as Ye } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-BIxdsbw_.js";
|
|
3
3
|
import { ucfirst as Ge, ucwords as Je, toSnakeCase as Xe } from "./dsg-vue.helpers-string.esm.js";
|
|
4
4
|
import { data_get as ce } from "./dsg-vue.helpers-object.esm.js";
|
|
5
|
-
|
|
5
|
+
import { isEmpty as Ze } from "./dsg-vue.helpers.esm.js";
|
|
6
|
+
const _e = { class: "dsg-table--pagination" }, et = ["disabled"], tt = ["disabled"], at = ["onClick", "innerHTML"], lt = ["onClick", "innerHTML"], st = ["disabled"], nt = ["disabled"], pe = /* @__PURE__ */ K({
|
|
6
7
|
__name: "DsgTablePagination",
|
|
7
8
|
props: /* @__PURE__ */ X({
|
|
8
9
|
onEachSide: { default: 3 },
|
|
@@ -17,13 +18,13 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
17
18
|
paginationModifiers: {}
|
|
18
19
|
}),
|
|
19
20
|
emits: /* @__PURE__ */ X(["dsg-table:change-page"], ["update:pagination"]),
|
|
20
|
-
setup(e, { expose:
|
|
21
|
-
const r = J(e, "pagination"),
|
|
22
|
-
|
|
21
|
+
setup(e, { expose: E, emit: v }) {
|
|
22
|
+
const r = J(e, "pagination"), f = V(() => r.value === null ? 0 : r.value?.last_page - e.firstPage + 1), h = V(() => r.value === null ? 0 : r.value?.last_page), g = V(() => r.value === null ? !1 : r.value?.current_page === e.firstPage), m = V(() => r.value === null ? !1 : r.value?.current_page === h.value), q = V(() => f.value < e.onEachSide * 2 + 4), A = V(() => e.onEachSide * 2 + 1), C = V(() => !r.value || r.value?.current_page <= e.onEachSide ? 1 : r.value?.current_page >= f.value - e.onEachSide ? f.value - e.onEachSide * 2 : r.value?.current_page - e.onEachSide), b = v, a = ($) => {
|
|
23
|
+
b("dsg-table:change-page", $);
|
|
23
24
|
}, u = ($) => $ === r.value?.current_page;
|
|
24
|
-
return
|
|
25
|
+
return E({
|
|
25
26
|
loadPage: a
|
|
26
|
-
}), ($, T) => ge((l(), i("div",
|
|
27
|
+
}), ($, T) => ge((l(), i("div", _e, [
|
|
27
28
|
e.showFirstLast ? (l(), i("a", {
|
|
28
29
|
key: 0,
|
|
29
30
|
onClick: T[0] || (T[0] = (S) => a(e.firstPage)),
|
|
@@ -32,11 +33,11 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
32
33
|
title: "First",
|
|
33
34
|
"aria-label": "First"
|
|
34
35
|
}, [
|
|
35
|
-
|
|
36
|
+
I(z, {
|
|
36
37
|
icon: e.firstIcon,
|
|
37
38
|
size: "sm"
|
|
38
39
|
}, null, 8, ["icon"])
|
|
39
|
-
], 10,
|
|
40
|
+
], 10, et)) : D("", !0),
|
|
40
41
|
P("a", {
|
|
41
42
|
onClick: T[1] || (T[1] = (S) => a("prev")),
|
|
42
43
|
class: B([[g.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
@@ -44,22 +45,22 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
44
45
|
title: "Previous",
|
|
45
46
|
"aria-label": "Previous"
|
|
46
47
|
}, [
|
|
47
|
-
|
|
48
|
+
I(z, {
|
|
48
49
|
icon: e.prevIcon,
|
|
49
50
|
size: "sm"
|
|
50
51
|
}, null, 8, ["icon"])
|
|
51
|
-
], 10,
|
|
52
|
-
q.value ? (l(!0), i(
|
|
52
|
+
], 10, tt),
|
|
53
|
+
q.value ? (l(!0), i(R, { key: 1 }, N(f.value, (S, U) => (l(), i("a", {
|
|
53
54
|
key: U,
|
|
54
|
-
onClick: (
|
|
55
|
+
onClick: (L) => a(U + e.firstPage),
|
|
55
56
|
class: B([[u(U + e.firstPage) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
56
57
|
innerHTML: S
|
|
57
|
-
}, null, 10,
|
|
58
|
+
}, null, 10, at))), 128)) : (l(!0), i(R, { key: 2 }, N(A.value, (S, U) => (l(), i("a", {
|
|
58
59
|
key: U,
|
|
59
|
-
onClick: (
|
|
60
|
+
onClick: (L) => a(C.value + U + e.firstPage - 1),
|
|
60
61
|
class: B([[u(C.value + U + e.firstPage - 1) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
61
62
|
innerHTML: C.value + S - 1
|
|
62
|
-
}, null, 10,
|
|
63
|
+
}, null, 10, lt))), 128)),
|
|
63
64
|
P("a", {
|
|
64
65
|
onClick: T[2] || (T[2] = (S) => a("next")),
|
|
65
66
|
class: B([[m.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
@@ -67,11 +68,11 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
67
68
|
title: "Next",
|
|
68
69
|
"aria-label": "Next"
|
|
69
70
|
}, [
|
|
70
|
-
|
|
71
|
+
I(z, {
|
|
71
72
|
icon: e.nextIcon,
|
|
72
73
|
size: "sm"
|
|
73
74
|
}, null, 8, ["icon"])
|
|
74
|
-
], 10,
|
|
75
|
+
], 10, st),
|
|
75
76
|
e.showFirstLast ? (l(), i("a", {
|
|
76
77
|
key: 3,
|
|
77
78
|
onClick: T[3] || (T[3] = (S) => a(h.value)),
|
|
@@ -80,16 +81,16 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
80
81
|
title: "Last",
|
|
81
82
|
"aria-label": "Last"
|
|
82
83
|
}, [
|
|
83
|
-
|
|
84
|
+
I(z, {
|
|
84
85
|
icon: e.lastIcon,
|
|
85
86
|
size: "sm"
|
|
86
87
|
}, null, 8, ["icon"])
|
|
87
|
-
], 10,
|
|
88
|
+
], 10, nt)) : D("", !0)
|
|
88
89
|
], 512)), [
|
|
89
90
|
[Re, r.value && h.value > e.firstPage]
|
|
90
91
|
]);
|
|
91
92
|
}
|
|
92
|
-
}),
|
|
93
|
+
}), ot = ["innerHTML"], De = /* @__PURE__ */ K({
|
|
93
94
|
__name: "DsgTablePaginationInfo",
|
|
94
95
|
props: /* @__PURE__ */ X({
|
|
95
96
|
infoTemplate: { default: "Displaying {from} to {to} of {total} items" },
|
|
@@ -100,29 +101,29 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
100
101
|
}),
|
|
101
102
|
emits: ["update:pagination"],
|
|
102
103
|
setup(e) {
|
|
103
|
-
const
|
|
104
|
-
return (r,
|
|
104
|
+
const E = J(e, "pagination"), v = V(() => E.value == null || E.value.total == 0 ? e.noDataTemplate : e.infoTemplate.replace("{from}", (E.value?.from || 0).toString()).replace("{to}", (E.value?.to || 0).toString()).replace("{total}", (E.value?.total || 0).toString()));
|
|
105
|
+
return (r, f) => (l(), i("div", {
|
|
105
106
|
class: "dsg-table--pagination-info",
|
|
106
107
|
innerHTML: v.value
|
|
107
|
-
}, null, 8,
|
|
108
|
+
}, null, 8, ot));
|
|
108
109
|
}
|
|
109
|
-
}),
|
|
110
|
+
}), it = {
|
|
110
111
|
class: "dsg-table--actions",
|
|
111
112
|
ref: "dsgTableActions"
|
|
112
|
-
},
|
|
113
|
+
}, dt = { class: "dsg-table--action-trigger" }, rt = {
|
|
113
114
|
key: 0,
|
|
114
115
|
class: "dsg-table--actions-menu-wrapper"
|
|
115
|
-
},
|
|
116
|
+
}, ut = ["href", "target", "onClick"], ct = ["textContent"], gt = { key: 0 }, vt = { key: 1 }, ft = ["href", "target", "onClick"], bt = { class: "flex-1" }, Ce = /* @__PURE__ */ K({
|
|
116
117
|
__name: "DsgTableActions",
|
|
117
118
|
props: {
|
|
118
119
|
placement: { default: "auto" }
|
|
119
120
|
},
|
|
120
121
|
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:action-archive", "dsg-table:link-clicked"],
|
|
121
|
-
setup(e, { emit:
|
|
122
|
-
const v =
|
|
122
|
+
setup(e, { emit: E }) {
|
|
123
|
+
const v = p(!1);
|
|
123
124
|
ye("dsgTableActions");
|
|
124
|
-
const r = Ie(),
|
|
125
|
-
switch (
|
|
125
|
+
const r = Ie(), f = p(r.data.rowData?.actions ?? null), h = p(r.data.rowData?.links ?? null), g = p(r.data.rowData ?? null), m = (b) => {
|
|
126
|
+
switch (b) {
|
|
126
127
|
case "edit":
|
|
127
128
|
return "edit-05";
|
|
128
129
|
case "view":
|
|
@@ -134,7 +135,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
134
135
|
default:
|
|
135
136
|
return "dots-horizontal";
|
|
136
137
|
}
|
|
137
|
-
}, q = (
|
|
138
|
+
}, q = (b, a, u) => {
|
|
138
139
|
switch (a) {
|
|
139
140
|
case "edit":
|
|
140
141
|
C("dsg-table:action-edit", u, g.value);
|
|
@@ -149,12 +150,12 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
149
150
|
C("dsg-table:action-archive", u, g.value);
|
|
150
151
|
break;
|
|
151
152
|
}
|
|
152
|
-
}, A = (
|
|
153
|
-
const u =
|
|
153
|
+
}, A = (b, a) => {
|
|
154
|
+
const u = b.actionId || b.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
154
155
|
C("dsg-table:link-clicked", a, u, g.value);
|
|
155
|
-
}, C =
|
|
156
|
-
return (
|
|
157
|
-
|
|
156
|
+
}, C = E;
|
|
157
|
+
return (b, a) => ge((l(), i("div", it, [
|
|
158
|
+
I(O(We), {
|
|
158
159
|
triggers: [],
|
|
159
160
|
placement: e.placement,
|
|
160
161
|
"handle-resize": !0,
|
|
@@ -165,37 +166,37 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
165
166
|
ref: "floatingVueFilterDropdown"
|
|
166
167
|
}, {
|
|
167
168
|
popper: te(() => [
|
|
168
|
-
v.value ? (l(), i("div",
|
|
169
|
-
(l(!0), i(
|
|
169
|
+
v.value ? (l(), i("div", rt, [
|
|
170
|
+
(l(!0), i(R, null, N(f.value, (u, $) => (l(), i(R, null, [
|
|
170
171
|
["edit", "view", "delete", "archive"].includes(String($)) ? (l(), i("a", {
|
|
171
172
|
key: $,
|
|
172
|
-
href:
|
|
173
|
-
target:
|
|
173
|
+
href: f.value?.link,
|
|
174
|
+
target: f.value?.target || "_self",
|
|
174
175
|
onClick: (T) => q(u, String($), T)
|
|
175
176
|
}, [
|
|
176
177
|
P("div", {
|
|
177
178
|
class: B(["dsg-table--actions-menu-item", String($)])
|
|
178
179
|
}, [
|
|
179
|
-
|
|
180
|
+
I(z, {
|
|
180
181
|
icon: m(String($)),
|
|
181
182
|
size: "sm"
|
|
182
183
|
}, null, 8, ["icon"]),
|
|
183
184
|
P("span", {
|
|
184
185
|
class: "flex-1",
|
|
185
186
|
textContent: ae(O(Ge)(String($)))
|
|
186
|
-
}, null, 8,
|
|
187
|
+
}, null, 8, ct)
|
|
187
188
|
], 2)
|
|
188
|
-
], 8,
|
|
189
|
+
], 8, ut)) : D("", !0)
|
|
189
190
|
], 64))), 256)),
|
|
190
|
-
|
|
191
|
-
h.value ? (l(!0), i(
|
|
191
|
+
f.value && h.value ? (l(), i("hr", gt)) : D("", !0),
|
|
192
|
+
h.value ? (l(!0), i(R, { key: 1 }, N(h.value, (u) => (l(), i(R, {
|
|
192
193
|
key: u.label
|
|
193
194
|
}, [
|
|
194
195
|
u.hasOwnProperty("component") ? (l(), j(Ae(u.component), {
|
|
195
196
|
key: 0,
|
|
196
197
|
quote: O(r).data.data.rowData,
|
|
197
198
|
"row-data": O(r).data.data.rowData
|
|
198
|
-
}, null, 8, ["quote", "row-data"])) : u.hasOwnProperty("type") && u.type == "break" ? (l(), i("hr",
|
|
199
|
+
}, null, 8, ["quote", "row-data"])) : u.hasOwnProperty("type") && u.type == "break" ? (l(), i("hr", vt)) : (l(), i("a", {
|
|
199
200
|
key: 2,
|
|
200
201
|
href: u.link,
|
|
201
202
|
target: u.target || "_self",
|
|
@@ -206,14 +207,14 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
206
207
|
key: 0,
|
|
207
208
|
icon: u.icon,
|
|
208
209
|
size: "sm"
|
|
209
|
-
}, null, 8, ["icon"])) :
|
|
210
|
+
}, null, 8, ["icon"])) : D("", !0),
|
|
210
211
|
P("span", bt, ae(u.label), 1)
|
|
211
|
-
], 10,
|
|
212
|
-
], 64))), 128)) :
|
|
213
|
-
])) :
|
|
212
|
+
], 10, ft))
|
|
213
|
+
], 64))), 128)) : D("", !0)
|
|
214
|
+
])) : D("", !0)
|
|
214
215
|
]),
|
|
215
216
|
default: te(() => [
|
|
216
|
-
P("div",
|
|
217
|
+
P("div", dt, [
|
|
217
218
|
P("button", {
|
|
218
219
|
type: "button",
|
|
219
220
|
class: "dsg-table--actions-button",
|
|
@@ -221,8 +222,8 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
221
222
|
"aria-haspopup": "true",
|
|
222
223
|
onClick: a[0] || (a[0] = (u) => v.value = !v.value)
|
|
223
224
|
}, [
|
|
224
|
-
F(
|
|
225
|
-
|
|
225
|
+
F(b.$slots, "dsg-table-action-button-content", {}, () => [
|
|
226
|
+
I(z, {
|
|
226
227
|
icon: "dots-vertical",
|
|
227
228
|
size: "sm"
|
|
228
229
|
})
|
|
@@ -236,7 +237,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
236
237
|
[O(je), () => v.value = !1]
|
|
237
238
|
]);
|
|
238
239
|
}
|
|
239
|
-
}),
|
|
240
|
+
}), ht = { class: "dsg-table--search" }, $e = /* @__PURE__ */ K({
|
|
240
241
|
__name: "DsgTableSearch",
|
|
241
242
|
props: {
|
|
242
243
|
name: {},
|
|
@@ -251,21 +252,21 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
251
252
|
replaceState: { type: Boolean, default: !0 }
|
|
252
253
|
},
|
|
253
254
|
emits: ["dsg-table:term-changed"],
|
|
254
|
-
setup(e, { emit:
|
|
255
|
-
const v =
|
|
255
|
+
setup(e, { emit: E }) {
|
|
256
|
+
const v = p("");
|
|
256
257
|
we(() => {
|
|
257
258
|
const g = new URL(window.location.href).searchParams.get("term");
|
|
258
259
|
g && (v.value = g, r("dsg-table:term-changed", g));
|
|
259
260
|
});
|
|
260
|
-
const r =
|
|
261
|
+
const r = E, f = Qe((h) => {
|
|
261
262
|
if (v.value = h, e.replaceState) {
|
|
262
263
|
const g = new URL(window.location.href);
|
|
263
264
|
v.value ? g.searchParams.set("term", v.value) : g.searchParams.delete("term"), window.history.pushState({}, "", g.toString());
|
|
264
265
|
}
|
|
265
266
|
r("dsg-table:term-changed", v.value);
|
|
266
267
|
}, 300);
|
|
267
|
-
return (h, g) => (l(), i("div",
|
|
268
|
-
|
|
268
|
+
return (h, g) => (l(), i("div", ht, [
|
|
269
|
+
I(Ke, {
|
|
269
270
|
modelValue: v.value,
|
|
270
271
|
"onUpdate:modelValue": g[0] || (g[0] = (m) => v.value = m),
|
|
271
272
|
name: e.name,
|
|
@@ -280,24 +281,24 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
280
281
|
size: "sm",
|
|
281
282
|
icon: "search-sm",
|
|
282
283
|
"icon-clickable": !0,
|
|
283
|
-
onIconClicked: g[1] || (g[1] = (m) => O(
|
|
284
|
-
onEnterPressed: g[2] || (g[2] = (m) => O(
|
|
285
|
-
onOnClear: g[3] || (g[3] = () => O(
|
|
284
|
+
onIconClicked: g[1] || (g[1] = (m) => O(f)(m)),
|
|
285
|
+
onEnterPressed: g[2] || (g[2] = (m) => O(f)(m)),
|
|
286
|
+
onOnClear: g[3] || (g[3] = () => O(f)(""))
|
|
286
287
|
}, null, 8, ["modelValue", "name", "id", "placeholder", "disabled", "required", "readonly", "hidden"])
|
|
287
288
|
]));
|
|
288
289
|
}
|
|
289
|
-
}),
|
|
290
|
+
}), mt = { class: "dsg-table--header-row" }, yt = {
|
|
290
291
|
key: 0,
|
|
291
292
|
class: "dsg-table--th dsg-table--th-checkbox",
|
|
292
293
|
scope: "col"
|
|
293
|
-
},
|
|
294
|
+
}, wt = {
|
|
294
295
|
key: 1,
|
|
295
296
|
class: "dsg-table--th dsg-table--th-expand-detail",
|
|
296
297
|
scope: "col"
|
|
297
|
-
},
|
|
298
|
+
}, kt = ["title", "id", "onClick"], Pt = {
|
|
298
299
|
key: 0,
|
|
299
300
|
class: "dsg-table--th-sort-icon"
|
|
300
|
-
},
|
|
301
|
+
}, pt = ["innerHTML"], Dt = ["innerHTML"], Te = /* @__PURE__ */ K({
|
|
301
302
|
__name: "DsgTableRowHeader",
|
|
302
303
|
props: /* @__PURE__ */ X({
|
|
303
304
|
fields: {},
|
|
@@ -314,15 +315,15 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
314
315
|
hasSelectedModifiers: {}
|
|
315
316
|
}),
|
|
316
317
|
emits: /* @__PURE__ */ X(["dsg-table:sort-field", "dsg-table:on-select-all", "dsg-table:on-deselect-all"], ["update:sortField", "update:selectedRows", "update:hasSelected"]),
|
|
317
|
-
setup(e, { emit:
|
|
318
|
-
const v = J(e, "sortField"), r = J(e, "selectedRows"),
|
|
319
|
-
|
|
320
|
-
}, m =
|
|
318
|
+
setup(e, { emit: E }) {
|
|
319
|
+
const v = J(e, "sortField"), r = J(e, "selectedRows"), f = J(e, "hasSelected"), h = p("17px"), g = (C) => {
|
|
320
|
+
f.value && r.value.length > 0 && r.value.length !== e.tableDataLength ? (f.value = !0, m("dsg-table:on-select-all")) : !f.value && r.value.length === 0 ? (f.value = !1, m("dsg-table:on-select-all")) : m("dsg-table:on-deselect-all");
|
|
321
|
+
}, m = E, q = (C, b) => [
|
|
321
322
|
C,
|
|
322
|
-
C + "-" + Xe(String(
|
|
323
|
-
|
|
324
|
-
{ sortable:
|
|
325
|
-
{ "sort-active": v.value?.name ===
|
|
323
|
+
C + "-" + Xe(String(b?.name)),
|
|
324
|
+
b.titleClass || "",
|
|
325
|
+
{ sortable: b.sortable },
|
|
326
|
+
{ "sort-active": v.value?.name === b.name }
|
|
326
327
|
], A = (C) => {
|
|
327
328
|
C.sortable && (v.value = {
|
|
328
329
|
name: String(C?.name),
|
|
@@ -330,19 +331,19 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
330
331
|
direction: v.value?.name === C.name && v.value?.direction === "asc" ? "desc" : "asc"
|
|
331
332
|
}, m("dsg-table:sort-field", C));
|
|
332
333
|
};
|
|
333
|
-
return (C,
|
|
334
|
-
e.hasSelectAll ? (l(), i("th",
|
|
335
|
-
|
|
336
|
-
modelValue:
|
|
334
|
+
return (C, b) => (l(), i("tr", mt, [
|
|
335
|
+
e.hasSelectAll ? (l(), i("th", yt, [
|
|
336
|
+
I(ke, {
|
|
337
|
+
modelValue: f.value,
|
|
337
338
|
"onUpdate:modelValue": [
|
|
338
|
-
|
|
339
|
+
b[0] || (b[0] = (a) => f.value = a),
|
|
339
340
|
g
|
|
340
341
|
],
|
|
341
342
|
indeterminate: r.value.length > 0 && r.value.length !== e.tableDataLength
|
|
342
343
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
343
|
-
])) :
|
|
344
|
-
e.showExpandDetail ? (l(), i("th",
|
|
345
|
-
(l(!0), i(
|
|
344
|
+
])) : D("", !0),
|
|
345
|
+
e.showExpandDetail ? (l(), i("th", wt)) : D("", !0),
|
|
346
|
+
(l(!0), i(R, null, N(e.fields, (a, u) => (l(), i(R, null, [
|
|
346
347
|
a?.visible ? (l(), i("th", {
|
|
347
348
|
key: u,
|
|
348
349
|
class: B(q("dsg-table--th", a)),
|
|
@@ -352,51 +353,51 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
352
353
|
onClick: ($) => A(a),
|
|
353
354
|
scope: "col"
|
|
354
355
|
}, [
|
|
355
|
-
a.sortable ? (l(), i("div",
|
|
356
|
+
a.sortable ? (l(), i("div", Pt, [
|
|
356
357
|
a.title ? (l(), i("span", {
|
|
357
358
|
key: 0,
|
|
358
359
|
class: "dsg-table--th-title",
|
|
359
360
|
innerHTML: a.title
|
|
360
|
-
}, null, 8,
|
|
361
|
+
}, null, 8, pt)) : D("", !0),
|
|
361
362
|
a.sortable && v.value?.name !== a.name ? (l(), j(z, {
|
|
362
363
|
key: 1,
|
|
363
364
|
icon: "chevron-selector-vertical",
|
|
364
365
|
class: "inline-flex",
|
|
365
366
|
size: "xs"
|
|
366
|
-
})) :
|
|
367
|
+
})) : D("", !0),
|
|
367
368
|
a.sortable && v.value?.name === a.name && v.value?.direction === "asc" ? (l(), j(z, {
|
|
368
369
|
key: 2,
|
|
369
370
|
icon: "chevron-down",
|
|
370
371
|
class: "inline-flex",
|
|
371
372
|
size: "xs"
|
|
372
|
-
})) :
|
|
373
|
+
})) : D("", !0),
|
|
373
374
|
a.sortable && v.value?.name === a.name && v.value?.direction === "desc" ? (l(), j(z, {
|
|
374
375
|
key: 3,
|
|
375
376
|
icon: "chevron-up",
|
|
376
377
|
class: "inline-flex",
|
|
377
378
|
size: "xs"
|
|
378
|
-
})) :
|
|
379
|
+
})) : D("", !0)
|
|
379
380
|
])) : (l(), i("span", {
|
|
380
381
|
key: 1,
|
|
381
382
|
class: "dsg-table--th-title",
|
|
382
383
|
innerHTML: O(Je)(String(a?.title))
|
|
383
384
|
}, null, 8, Dt))
|
|
384
|
-
], 14,
|
|
385
|
+
], 14, kt)) : D("", !0)
|
|
385
386
|
], 64))), 256)),
|
|
386
387
|
e.scrollVisible ? (l(), i("th", {
|
|
387
388
|
key: 2,
|
|
388
389
|
style: Z({ width: h.value }),
|
|
389
390
|
class: "dsg-table--th-col-gutter"
|
|
390
|
-
}, null, 4)) :
|
|
391
|
+
}, null, 4)) : D("", !0)
|
|
391
392
|
]));
|
|
392
393
|
}
|
|
393
|
-
}),
|
|
394
|
+
}), Ct = { class: "dsg-table--wrapper" }, $t = ["span"], Tt = {
|
|
394
395
|
key: 0,
|
|
395
396
|
class: "dsg-table--loading"
|
|
396
|
-
},
|
|
397
|
+
}, St = ["colspan"], xt = ["colspan"], Ft = ["onClick", "onDblclick", "onMouseover"], Mt = {
|
|
397
398
|
key: 0,
|
|
398
399
|
class: "dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"
|
|
399
|
-
},
|
|
400
|
+
}, Et = ["onClick", "onDblclick", "onContextmenu"], Lt = ["innerHTML"], Bt = ["onClick"], Rt = ["colspan"], It = { key: 2 }, At = ["colspan"], Ht = { class: "dsg-table--footer" }, Ut = /* @__PURE__ */ K({
|
|
400
401
|
__name: "DsgTableComponent",
|
|
401
402
|
props: /* @__PURE__ */ X({
|
|
402
403
|
fields: { default: () => [] },
|
|
@@ -455,7 +456,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
455
456
|
perPageModifiers: {}
|
|
456
457
|
}),
|
|
457
458
|
emits: /* @__PURE__ */ X(["dsg-table:loading", "dsg-table:loaded", "dsg-table:load-success", "dsg-table:load-error", "dsg-table:pagination-data", "dsg-table:rows-selected", "dsg-table:row-clicked", "dsg-table:row-hover", "dsg-table:row-dblclick"], ["update:filterParams", "update:perPage"]),
|
|
458
|
-
setup(e, { expose:
|
|
459
|
+
setup(e, { expose: E, emit: v }) {
|
|
459
460
|
const r = (t) => t.map((s, d) => ({
|
|
460
461
|
field: s.field || "",
|
|
461
462
|
title: s.title || "",
|
|
@@ -468,9 +469,9 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
468
469
|
sortable: s.sortField,
|
|
469
470
|
formatter: s.formatter || null,
|
|
470
471
|
$_index: d
|
|
471
|
-
})),
|
|
472
|
+
})), f = p(r(e.fields)), h = p(e.data), g = p(null), m = p(e.initialPage), q = p("17px"), A = p(!1), C = p({}), b = p(0), a = p(!0), u = p(null), $ = p(null), T = p(0), S = J(e, "filterParams"), U = J(e, "perPage"), L = p([]), _ = p(!1), W = V(() => e.tableHeight != null), Q = V(() => f.value.filter((t) => t.visible).length);
|
|
472
473
|
ee(
|
|
473
|
-
() =>
|
|
474
|
+
() => L.value.length,
|
|
474
475
|
(t) => {
|
|
475
476
|
_.value = e.selectable && t > 0;
|
|
476
477
|
},
|
|
@@ -478,7 +479,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
478
479
|
), ee(
|
|
479
480
|
() => e.fields,
|
|
480
481
|
(t) => {
|
|
481
|
-
|
|
482
|
+
f.value = r(t);
|
|
482
483
|
},
|
|
483
484
|
{ immediate: !0, deep: !0 }
|
|
484
485
|
), ee(
|
|
@@ -521,21 +522,21 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
521
522
|
}, ie = (t) => {
|
|
522
523
|
if (e.selectable) {
|
|
523
524
|
if (t.selected)
|
|
524
|
-
|
|
525
|
+
L.value.push(t);
|
|
525
526
|
else {
|
|
526
|
-
const s =
|
|
527
|
-
s !== -1 &&
|
|
527
|
+
const s = L.value.findIndex((d) => d[e.trackBy] === t[e.trackBy]);
|
|
528
|
+
s !== -1 && L.value.splice(s, 1);
|
|
528
529
|
}
|
|
529
|
-
H("dsg-table:rows-selected",
|
|
530
|
+
H("dsg-table:rows-selected", L.value);
|
|
530
531
|
}
|
|
531
532
|
}, de = () => {
|
|
532
533
|
e.selectable && (h.value?.forEach((t) => {
|
|
533
534
|
t.selected = !0;
|
|
534
|
-
}),
|
|
535
|
+
}), L.value = h.value?.filter((t) => t.selected) ?? [], H("dsg-table:rows-selected", L.value));
|
|
535
536
|
}, re = () => {
|
|
536
537
|
e.selectable && (h.value?.forEach((t) => {
|
|
537
538
|
t.selected = !1;
|
|
538
|
-
}),
|
|
539
|
+
}), L.value = [], H("dsg-table:rows-selected", L.value));
|
|
539
540
|
}, Y = (t) => {
|
|
540
541
|
h.value = Array.isArray(t) ? t : [], e.selectable && h.value.forEach((s) => {
|
|
541
542
|
s.selected = s.selected ?? !1;
|
|
@@ -568,10 +569,10 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
568
569
|
const s = e.transform ? e.transform(t.data) : t.data;
|
|
569
570
|
h.value = ce(s, e.dataPath, null), e.selectable && h.value?.forEach((d) => {
|
|
570
571
|
d.selected = d.selected ?? !1;
|
|
571
|
-
}), g.value = ce(s, e.paginationPath, null) ?? null,
|
|
572
|
+
}), g.value = ce(s, e.paginationPath, null) ?? null, b.value = h.value?.length ? h.value[0].order : b, !Ze(e.paginationPath) && g.value === null && console.warn(
|
|
572
573
|
'DsgTable: pagination-path "' + e.paginationPath + `" not found. It looks like the data returned from the server does not have pagination information or you may have set it incorrectly.
|
|
573
574
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
574
|
-
), $.value = null, H("dsg-table:pagination-data", g.value), m.value > (g.value?.last_page || 0) && h.value?.length === 0 && (m.value = e.initialPage, G()), H("dsg-table:loaded"), a.value = !1;
|
|
575
|
+
), $.value = null, H("dsg-table:pagination-data", g.value), g.value && m.value > (g.value?.last_page || 0) && h.value?.length === 0 && (m.value = e.initialPage, G()), H("dsg-table:loaded"), a.value = !1;
|
|
575
576
|
}, le = (t) => {
|
|
576
577
|
t._requestId && t._requestId !== T.value || t._apiUrl && t._apiUrl !== e.apiUrl || t._cancelled || (console.error("load-error", t), $.value = null, H("dsg-table:load-error", t), H("dsg-table:loaded"), a.value = !1);
|
|
577
578
|
}, ve = () => {
|
|
@@ -600,25 +601,25 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
600
601
|
H("dsg-table:row-dblclick", t, s, d);
|
|
601
602
|
}, Fe = (t, s, d) => {
|
|
602
603
|
}, Me = (t, s, d, x) => {
|
|
603
|
-
}, Le = (t, s, d, x) => {
|
|
604
604
|
}, Ee = (t, s, d, x) => {
|
|
605
|
+
}, Le = (t, s, d, x) => {
|
|
605
606
|
}, Be = (t, s, d) => {
|
|
606
607
|
};
|
|
607
608
|
we(() => {
|
|
608
609
|
e.apiMode === !0 ? G() : ve();
|
|
609
610
|
});
|
|
610
|
-
const
|
|
611
|
-
e.apiMode && (
|
|
611
|
+
const fe = () => {
|
|
612
|
+
e.apiMode && (L.value = [], c(), G());
|
|
612
613
|
};
|
|
613
|
-
return
|
|
614
|
+
return E({
|
|
614
615
|
changePage: n,
|
|
615
|
-
reload:
|
|
616
|
+
reload: fe,
|
|
616
617
|
getData: ue,
|
|
617
618
|
setData: Y,
|
|
618
619
|
setLoading: (t) => {
|
|
619
620
|
a.value = t, H("dsg-table:loading", a.value);
|
|
620
621
|
}
|
|
621
|
-
}), (t, s) => (l(), i("div",
|
|
622
|
+
}), (t, s) => (l(), i("div", Ct, [
|
|
622
623
|
P("div", {
|
|
623
624
|
ref: "dsgTableBodyWrapper",
|
|
624
625
|
class: B(["dsg-table-body-wrapper", { "fixed-header": W.value }]),
|
|
@@ -628,28 +629,28 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
628
629
|
class: B(["dsg-table-main", W.value ? "fixed-header" : "", C.value.table, "table-" + e.tableLayout])
|
|
629
630
|
}, [
|
|
630
631
|
P("colgroup", { span: Q.value }, [
|
|
631
|
-
(l(!0), i(
|
|
632
|
+
(l(!0), i(R, null, N(f.value, (d, x) => (l(), i(R, null, [
|
|
632
633
|
d?.visible ? (l(), i("col", {
|
|
633
634
|
key: x,
|
|
634
635
|
style: Z({ width: d.width || void 0 }),
|
|
635
636
|
class: B("dsg-table--col-" + d.name + " " + d.titleClass)
|
|
636
|
-
}, null, 6)) :
|
|
637
|
+
}, null, 6)) : D("", !0)
|
|
637
638
|
], 64))), 256)),
|
|
638
639
|
!W.value && A.value ? (l(), i("col", {
|
|
639
640
|
key: 0,
|
|
640
641
|
style: Z({ width: q.value }),
|
|
641
642
|
class: "dsg-table--col-gutter"
|
|
642
|
-
}, null, 4)) :
|
|
643
|
-
], 8,
|
|
643
|
+
}, null, 4)) : D("", !0)
|
|
644
|
+
], 8, $t),
|
|
644
645
|
P("thead", {
|
|
645
646
|
class: B([[C.value.thead, { sticky: W.value, "top-0": W.value }], "dsg-table--head"])
|
|
646
647
|
}, [
|
|
647
|
-
F(t.$slots, "tableHeader", { fields:
|
|
648
|
-
|
|
649
|
-
fields:
|
|
648
|
+
F(t.$slots, "tableHeader", { fields: f.value }, () => [
|
|
649
|
+
I(Te, {
|
|
650
|
+
fields: f.value,
|
|
650
651
|
"has-select-all": e.selectable,
|
|
651
|
-
"selected-rows":
|
|
652
|
-
"onUpdate:selectedRows": s[0] || (s[0] = (d) =>
|
|
652
|
+
"selected-rows": L.value,
|
|
653
|
+
"onUpdate:selectedRows": s[0] || (s[0] = (d) => L.value = d),
|
|
653
654
|
"has-selected": _.value,
|
|
654
655
|
"onUpdate:hasSelected": s[1] || (s[1] = (d) => _.value = d),
|
|
655
656
|
"scroll-visible": A.value,
|
|
@@ -657,7 +658,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
657
658
|
"table-data-length": h.value?.length,
|
|
658
659
|
"sort-field": u.value,
|
|
659
660
|
"onUpdate:sortField": s[2] || (s[2] = (d) => u.value = d),
|
|
660
|
-
"onDsgTable:sortField": s[3] || (s[3] = (d) =>
|
|
661
|
+
"onDsgTable:sortField": s[3] || (s[3] = (d) => fe()),
|
|
661
662
|
"onDsgTable:onSelectAll": de,
|
|
662
663
|
"onDsgTable:onDeselectAll": re
|
|
663
664
|
}, null, 8, ["fields", "has-select-all", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
@@ -666,7 +667,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
666
667
|
P("tbody", {
|
|
667
668
|
class: B(["dsg-table--body", C.value.tbody])
|
|
668
669
|
}, [
|
|
669
|
-
a.value ? (l(), i("tr",
|
|
670
|
+
a.value ? (l(), i("tr", Tt, [
|
|
670
671
|
P("td", { colspan: Q.value }, [
|
|
671
672
|
P("div", {
|
|
672
673
|
"aria-label": "Loading...",
|
|
@@ -675,35 +676,35 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
675
676
|
colspan: Q.value
|
|
676
677
|
}, [
|
|
677
678
|
F(t.$slots, "dsg-table-loading", {}, () => [
|
|
678
|
-
|
|
679
|
+
I(z, {
|
|
679
680
|
icon: "loading-02",
|
|
680
681
|
class: "animate-spin"
|
|
681
682
|
}),
|
|
682
683
|
s[4] || (s[4] = P("span", { class: "text-xs font-medium text-gray-500" }, "Loading...", -1))
|
|
683
684
|
])
|
|
684
|
-
], 8,
|
|
685
|
-
], 8,
|
|
686
|
-
])) : (l(!0), i(
|
|
685
|
+
], 8, xt)
|
|
686
|
+
], 8, St)
|
|
687
|
+
])) : (l(!0), i(R, { key: 1 }, N(h.value, (d, x) => (l(), i(R, { key: x }, [
|
|
687
688
|
P("tr", {
|
|
688
689
|
class: B(["dsg-table--tbody-row", oe(d, x)]),
|
|
689
690
|
onClick: (w) => Se(w, x, d),
|
|
690
691
|
onDblclick: (w) => xe(w, x, d),
|
|
691
692
|
onMouseover: (w) => Fe()
|
|
692
693
|
}, [
|
|
693
|
-
e.selectable ? (l(), i("td",
|
|
694
|
-
|
|
694
|
+
e.selectable ? (l(), i("td", Mt, [
|
|
695
|
+
I(ke, {
|
|
695
696
|
modelValue: d.selected,
|
|
696
697
|
"onUpdate:modelValue": [(w) => d.selected = w, (w) => ie(d)]
|
|
697
698
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
698
|
-
])) :
|
|
699
|
-
(l(!0), i(
|
|
699
|
+
])) : D("", !0),
|
|
700
|
+
(l(!0), i(R, null, N(f.value, (w, M) => (l(), i(R, { key: M }, [
|
|
700
701
|
w.visible ? (l(), i("td", {
|
|
701
702
|
key: 0,
|
|
702
703
|
class: B(["dsg-table--tbody-cell", w.dataClass]),
|
|
703
704
|
style: Z({ width: w.width || void 0 }),
|
|
704
|
-
onClick: (
|
|
705
|
-
onDblclick: (
|
|
706
|
-
onContextmenu: (
|
|
705
|
+
onClick: (be) => Me(),
|
|
706
|
+
onDblclick: (be) => Ee(),
|
|
707
|
+
onContextmenu: (be) => Le()
|
|
707
708
|
}, [
|
|
708
709
|
F(t.$slots, ne(w), {
|
|
709
710
|
rowData: d,
|
|
@@ -714,9 +715,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
714
715
|
innerHTML: se(w, d)
|
|
715
716
|
}, null, 8, Lt)
|
|
716
717
|
])
|
|
717
|
-
], 46,
|
|
718
|
+
], 46, Et)) : D("", !0)
|
|
718
719
|
], 64))), 128))
|
|
719
|
-
], 42,
|
|
720
|
+
], 42, Ft),
|
|
720
721
|
e.hasDetailRow ? (l(), j(He, {
|
|
721
722
|
key: 0,
|
|
722
723
|
name: e.detailRowTransition
|
|
@@ -732,13 +733,13 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
732
733
|
rowIndex: x,
|
|
733
734
|
options: e.detailRowOptions
|
|
734
735
|
})
|
|
735
|
-
], 8,
|
|
736
|
-
], 8,
|
|
736
|
+
], 8, Rt)
|
|
737
|
+
], 8, Bt)
|
|
737
738
|
]),
|
|
738
739
|
_: 2
|
|
739
|
-
}, 1032, ["name"])) :
|
|
740
|
+
}, 1032, ["name"])) : D("", !0)
|
|
740
741
|
], 64))), 128)),
|
|
741
|
-
!a.value && !h.value?.length && e.noDataTemplate.length ? (l(), i("tr",
|
|
742
|
+
!a.value && !h.value?.length && e.noDataTemplate.length ? (l(), i("tr", It, [
|
|
742
743
|
P("td", {
|
|
743
744
|
colspan: Q.value,
|
|
744
745
|
class: "dsg-table--empty-result"
|
|
@@ -746,12 +747,12 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
746
747
|
F(t.$slots, "dsg-table-empty-result", {}, () => [
|
|
747
748
|
Ue(ae(e.noDataTemplate), 1)
|
|
748
749
|
])
|
|
749
|
-
], 8,
|
|
750
|
-
])) :
|
|
750
|
+
], 8, At)
|
|
751
|
+
])) : D("", !0)
|
|
751
752
|
], 2),
|
|
752
|
-
P("tfoot",
|
|
753
|
+
P("tfoot", Ht, [
|
|
753
754
|
F(t.$slots, "dsg-table-footer", {
|
|
754
|
-
fields:
|
|
755
|
+
fields: f.value,
|
|
755
756
|
data: h.value
|
|
756
757
|
})
|
|
757
758
|
])
|
|
@@ -759,23 +760,24 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
759
760
|
], 6)
|
|
760
761
|
]));
|
|
761
762
|
}
|
|
762
|
-
}),
|
|
763
|
+
}), qt = { class: "dsg-table" }, Vt = {
|
|
763
764
|
key: 0,
|
|
764
765
|
class: "dsg-table--pre-header"
|
|
765
|
-
},
|
|
766
|
+
}, zt = { class: "dsg-table--pre-header-left" }, Ot = ["textContent"], Nt = { class: "dsg-table--pre-header-right" }, Wt = {
|
|
766
767
|
key: 1,
|
|
767
768
|
class: "dsg-table--search-header",
|
|
768
769
|
ref: "dsgTableSearchHeaderEl"
|
|
769
|
-
},
|
|
770
|
+
}, jt = { class: "dsg-table--search-top" }, Kt = {
|
|
770
771
|
key: 2,
|
|
771
772
|
class: "dsg-table--footer",
|
|
772
773
|
ref: "dsgTableFooterEl"
|
|
773
|
-
},
|
|
774
|
+
}, Qt = { class: "dsg-table--footer-left" }, Yt = { class: "dsg-table--footer-center" }, Gt = { class: "dsg-table--footer-right" }, Jt = /* @__PURE__ */ K({
|
|
774
775
|
__name: "DsgTable",
|
|
775
776
|
props: {
|
|
776
777
|
getUrl: {},
|
|
777
778
|
fields: {},
|
|
778
779
|
loadOnStart: { type: Boolean, default: !0 },
|
|
780
|
+
displaySearch: { type: Boolean, default: !0 },
|
|
779
781
|
displayPaginationInfo: { type: Boolean, default: !0 },
|
|
780
782
|
reloadOnChangeTimer: { type: Boolean, default: !1 },
|
|
781
783
|
selectable: { type: Boolean, default: !1 },
|
|
@@ -792,16 +794,18 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
792
794
|
data: { default: null },
|
|
793
795
|
hasHeader: { type: Boolean, default: !0 },
|
|
794
796
|
hasFooter: { type: Boolean, default: !0 },
|
|
797
|
+
perPage: { default: 20 },
|
|
798
|
+
paginationPath: { default: "meta" },
|
|
795
799
|
css: { default: () => ({ tableWrapper: "border-b" }) },
|
|
796
800
|
rowClass: { type: [String, Function], default: void 0 },
|
|
797
801
|
apiMode: { type: Boolean, default: !0 }
|
|
798
802
|
},
|
|
799
803
|
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:action-archive", "dsg-table:link-clicked", "dsg-table:rows-selected", "dsg-table:row-clicked", "dsg-table:row-hover", "dsg-table:row-dblclick", "dsg-table:filter-updated", "dsg-table:term-changed", "dsg-table:data-loaded"],
|
|
800
|
-
setup(e, { expose:
|
|
804
|
+
setup(e, { expose: E, emit: v }) {
|
|
801
805
|
const r = (n) => {
|
|
802
806
|
$.value = n;
|
|
803
|
-
},
|
|
804
|
-
if (
|
|
807
|
+
}, f = p(e.apiMode && !!(e.filterEntity || e.filterEndpoint || e.getUrl)), h = () => {
|
|
808
|
+
if (f.value) {
|
|
805
809
|
let n = {};
|
|
806
810
|
return Ye().forEach((o) => {
|
|
807
811
|
if (o.key.startsWith("filter[")) {
|
|
@@ -814,10 +818,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
814
818
|
}, g = V(() => ({
|
|
815
819
|
...e.css,
|
|
816
820
|
tableWrapper: "border-b " + (e.css?.tableWrapper || "")
|
|
817
|
-
})), m = qe(), q =
|
|
821
|
+
})), m = qe(), q = p(!0), A = p(null), C = p("<p>Showing {from} to {to} of {total}</p>"), b = p(null), a = ye("dsgTable"), u = p({ perPage: e.perPage, change: r }), $ = p(e.perPage), T = p({ ...h(), ...e.initialFilters }), S = v, U = (n) => {
|
|
818
822
|
a.value?.changePage(n);
|
|
819
|
-
},
|
|
820
|
-
|
|
823
|
+
}, L = (n) => {
|
|
824
|
+
b.value = n;
|
|
821
825
|
}, _ = ({ data: n }) => {
|
|
822
826
|
A.value = n, S("dsg-table:data-loaded", n);
|
|
823
827
|
}, W = () => {
|
|
@@ -853,7 +857,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
853
857
|
W();
|
|
854
858
|
}), S("dsg-table:filter-updated", T.value, o, c);
|
|
855
859
|
};
|
|
856
|
-
return
|
|
860
|
+
return E({
|
|
857
861
|
reloadTable: W,
|
|
858
862
|
updateRowTable: H,
|
|
859
863
|
addRowTable: se,
|
|
@@ -864,10 +868,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
864
868
|
termChanged: Y,
|
|
865
869
|
setFilters: re,
|
|
866
870
|
setLoading: Q
|
|
867
|
-
}), (n, o) => (l(), i("div",
|
|
868
|
-
e.hasHeader ? (l(), i("div",
|
|
871
|
+
}), (n, o) => (l(), i("div", qt, [
|
|
872
|
+
e.hasHeader ? (l(), i("div", Vt, [
|
|
869
873
|
F(n.$slots, "dsg-table--pre-header", {}, () => [
|
|
870
|
-
P("div",
|
|
874
|
+
P("div", zt, [
|
|
871
875
|
F(n.$slots, "dsg-table--page-title", {
|
|
872
876
|
data: A.value,
|
|
873
877
|
title: e.title
|
|
@@ -876,22 +880,22 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
876
880
|
key: 0,
|
|
877
881
|
class: "dsg-table--title",
|
|
878
882
|
textContent: ae(e.title)
|
|
879
|
-
}, null, 8,
|
|
883
|
+
}, null, 8, Ot)) : D("", !0)
|
|
880
884
|
])
|
|
881
885
|
]),
|
|
882
|
-
P("div",
|
|
886
|
+
P("div", Nt, [
|
|
883
887
|
F(n.$slots, "dsg-table--page-actions", { data: A.value })
|
|
884
888
|
])
|
|
885
889
|
])
|
|
886
|
-
])) :
|
|
887
|
-
e.
|
|
888
|
-
P("div",
|
|
890
|
+
])) : D("", !0),
|
|
891
|
+
e.displaySearch ? (l(), i("div", Wt, [
|
|
892
|
+
P("div", jt, [
|
|
889
893
|
F(n.$slots, "dsg-table--search-header", { data: A.value }, () => [
|
|
890
|
-
|
|
894
|
+
I($e, {
|
|
891
895
|
name: "term",
|
|
892
896
|
"onDsgTable:termChanged": o[0] || (o[0] = (c) => Y(c))
|
|
893
897
|
}),
|
|
894
|
-
|
|
898
|
+
I(Pe, {
|
|
895
899
|
entity: e.filterEntity,
|
|
896
900
|
"filter-endpoint": e.filterEndpoint,
|
|
897
901
|
"search-endpoint": e.filterSearchEndpoint,
|
|
@@ -903,8 +907,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
903
907
|
])
|
|
904
908
|
]),
|
|
905
909
|
F(n.$slots, "dsg-table--search-navigation")
|
|
906
|
-
], 512)) :
|
|
907
|
-
|
|
910
|
+
], 512)) : D("", !0),
|
|
911
|
+
I(Ut, {
|
|
908
912
|
ref: "dsgTable",
|
|
909
913
|
"api-url": e.getUrl,
|
|
910
914
|
"filter-params": T.value,
|
|
@@ -913,17 +917,17 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
913
917
|
"onUpdate:perPage": o[8] || (o[8] = (c) => $.value = c),
|
|
914
918
|
fields: e.fields,
|
|
915
919
|
"load-on-start": e.loadOnStart,
|
|
916
|
-
"pagination-path":
|
|
920
|
+
"pagination-path": e.paginationPath,
|
|
917
921
|
selectable: e.selectable,
|
|
918
922
|
"track-by": e.trackBy,
|
|
919
923
|
"table-layout": e.tableLayout,
|
|
920
924
|
css: g.value,
|
|
921
925
|
data: e.data,
|
|
922
926
|
"row-class": e.rowClass,
|
|
923
|
-
"api-mode":
|
|
927
|
+
"api-mode": f.value,
|
|
924
928
|
"onDsgTable:loading": o[9] || (o[9] = (c) => q.value = !0),
|
|
925
929
|
"onDsgTable:loaded": o[10] || (o[10] = (c) => q.value = !1),
|
|
926
|
-
"onDsgTable:paginationData":
|
|
930
|
+
"onDsgTable:paginationData": L,
|
|
927
931
|
"onDsgTable:loadSuccess": _,
|
|
928
932
|
"onDsgTable:rowsSelected": o[11] || (o[11] = (c) => S("dsg-table:rows-selected", c)),
|
|
929
933
|
"onDsgTable:rowClicked": o[12] || (o[12] = (c, y, k) => S("dsg-table:row-clicked", c, y, k)),
|
|
@@ -948,101 +952,102 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
948
952
|
N(O(m), (c, y) => ({
|
|
949
953
|
name: y,
|
|
950
954
|
fn: te((k) => [
|
|
951
|
-
String(y) !== "dsg-field--actions" ? F(n.$slots, y, ze(Oe({ key: 0 }, k))) :
|
|
955
|
+
String(y) !== "dsg-field--actions" ? F(n.$slots, y, ze(Oe({ key: 0 }, k))) : D("", !0)
|
|
952
956
|
])
|
|
953
957
|
}))
|
|
954
|
-
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout", "css", "data", "row-class", "api-mode"]),
|
|
955
|
-
e.hasFooter ? (l(), i("div",
|
|
956
|
-
P("div",
|
|
958
|
+
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "pagination-path", "selectable", "track-by", "table-layout", "css", "data", "row-class", "api-mode"]),
|
|
959
|
+
e.hasFooter ? (l(), i("div", Kt, [
|
|
960
|
+
P("div", Qt, [
|
|
957
961
|
F(n.$slots, "dsg-table--footer-left", {
|
|
958
|
-
data:
|
|
962
|
+
data: b.value,
|
|
959
963
|
perPage: u.value
|
|
960
964
|
}, () => [
|
|
961
|
-
|
|
965
|
+
e.displayPaginationInfo ? (l(), j(De, {
|
|
966
|
+
key: 0,
|
|
962
967
|
ref: "paginationInfoStart",
|
|
963
|
-
pagination:
|
|
964
|
-
"onUpdate:pagination": o[15] || (o[15] = (c) =>
|
|
968
|
+
pagination: b.value,
|
|
969
|
+
"onUpdate:pagination": o[15] || (o[15] = (c) => b.value = c),
|
|
965
970
|
"info-template": C.value
|
|
966
|
-
}, null, 8, ["pagination", "info-template"]),
|
|
971
|
+
}, null, 8, ["pagination", "info-template"])) : D("", !0),
|
|
967
972
|
F(n.$slots, "dsg-table--footer-left-extras", {
|
|
968
|
-
data:
|
|
973
|
+
data: b.value,
|
|
969
974
|
perPage: u.value
|
|
970
975
|
})
|
|
971
976
|
])
|
|
972
977
|
]),
|
|
973
|
-
P("div",
|
|
978
|
+
P("div", Yt, [
|
|
974
979
|
F(n.$slots, "dsg-table--footer-center", {
|
|
975
|
-
data:
|
|
980
|
+
data: b.value,
|
|
976
981
|
perPage: u.value
|
|
977
982
|
}, () => [
|
|
978
983
|
F(n.$slots, "dsg-table--footer-center-extras", {
|
|
979
|
-
data:
|
|
984
|
+
data: b.value,
|
|
980
985
|
perPage: u.value
|
|
981
986
|
})
|
|
982
987
|
])
|
|
983
988
|
]),
|
|
984
|
-
P("div",
|
|
989
|
+
P("div", Gt, [
|
|
985
990
|
F(n.$slots, "dsg-table--footer-right", {
|
|
986
|
-
data:
|
|
991
|
+
data: b.value,
|
|
987
992
|
perPage: u.value
|
|
988
993
|
}, () => [
|
|
989
|
-
q.value === !1 ? (l(), j(
|
|
994
|
+
q.value === !1 && e.displayPaginationInfo ? (l(), j(pe, {
|
|
990
995
|
key: 0,
|
|
991
996
|
ref: "pagination",
|
|
992
|
-
pagination:
|
|
993
|
-
"onUpdate:pagination": o[16] || (o[16] = (c) =>
|
|
997
|
+
pagination: b.value,
|
|
998
|
+
"onUpdate:pagination": o[16] || (o[16] = (c) => b.value = c),
|
|
994
999
|
"onDsgTable:changePage": U
|
|
995
|
-
}, null, 8, ["pagination"])) :
|
|
1000
|
+
}, null, 8, ["pagination"])) : D("", !0),
|
|
996
1001
|
F(n.$slots, "dsg-table--footer-right-extras", {
|
|
997
|
-
data:
|
|
1002
|
+
data: b.value,
|
|
998
1003
|
perPage: u.value
|
|
999
1004
|
})
|
|
1000
1005
|
])
|
|
1001
1006
|
])
|
|
1002
|
-
], 512)) :
|
|
1007
|
+
], 512)) : D("", !0)
|
|
1003
1008
|
]));
|
|
1004
1009
|
}
|
|
1005
|
-
}),
|
|
1010
|
+
}), Xt = { class: "dsg-table--per-page" }, Zt = ["value", "textContent"], _t = /* @__PURE__ */ K({
|
|
1006
1011
|
__name: "DsgTablePerPage",
|
|
1007
1012
|
props: {
|
|
1008
1013
|
perPageOptions: { default: () => [10, 20, 30, 50, 100] },
|
|
1009
1014
|
perPage: {}
|
|
1010
1015
|
},
|
|
1011
1016
|
setup(e) {
|
|
1012
|
-
return (
|
|
1017
|
+
return (E, v) => (l(), i("div", Xt, [
|
|
1013
1018
|
ge(P("select", {
|
|
1014
1019
|
"onUpdate:modelValue": v[0] || (v[0] = (r) => e.perPage.perPage = r),
|
|
1015
1020
|
class: "dsg-table--per-page-select",
|
|
1016
1021
|
onChange: v[1] || (v[1] = (r) => e.perPage.change(e.perPage.perPage))
|
|
1017
1022
|
}, [
|
|
1018
|
-
(l(!0), i(
|
|
1023
|
+
(l(!0), i(R, null, N(e.perPageOptions, (r) => (l(), i("option", {
|
|
1019
1024
|
key: r,
|
|
1020
1025
|
value: r,
|
|
1021
1026
|
textContent: ae(r)
|
|
1022
|
-
}, null, 8,
|
|
1027
|
+
}, null, 8, Zt))), 128))
|
|
1023
1028
|
], 544), [
|
|
1024
1029
|
[Ne, e.perPage.perPage]
|
|
1025
1030
|
])
|
|
1026
1031
|
]));
|
|
1027
1032
|
}
|
|
1028
|
-
}),
|
|
1029
|
-
DsgTable:
|
|
1030
|
-
DsgTableActions:
|
|
1031
|
-
DsgTablePerPage:
|
|
1032
|
-
DsgTableFilter:
|
|
1033
|
-
DsgTablePagination:
|
|
1034
|
-
DsgTablePaginationInfo:
|
|
1035
|
-
DsgTableSearch:
|
|
1036
|
-
DsgTableRowHeader:
|
|
1033
|
+
}), ea = Jt, ta = Ce, aa = _t, la = Pe, sa = pe, na = De, oa = $e, ia = Te, fa = {
|
|
1034
|
+
DsgTable: ea,
|
|
1035
|
+
DsgTableActions: ta,
|
|
1036
|
+
DsgTablePerPage: aa,
|
|
1037
|
+
DsgTableFilter: la,
|
|
1038
|
+
DsgTablePagination: sa,
|
|
1039
|
+
DsgTablePaginationInfo: na,
|
|
1040
|
+
DsgTableSearch: oa,
|
|
1041
|
+
DsgTableRowHeader: ia
|
|
1037
1042
|
};
|
|
1038
1043
|
export {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1044
|
+
ea as DsgTable,
|
|
1045
|
+
ta as DsgTableActions,
|
|
1046
|
+
la as DsgTableFilter,
|
|
1047
|
+
sa as DsgTablePagination,
|
|
1048
|
+
na as DsgTablePaginationInfo,
|
|
1049
|
+
aa as DsgTablePerPage,
|
|
1050
|
+
ia as DsgTableRowHeader,
|
|
1051
|
+
oa as DsgTableSearch,
|
|
1052
|
+
fa as default
|
|
1048
1053
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcodegroup-au/dsg-vue",
|
|
3
3
|
"description": "Front-end Vue/Tailwind DSG for UntitledUI.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.19",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -132,10 +132,10 @@
|
|
|
132
132
|
"only-allow": "^1.2.2",
|
|
133
133
|
"phone": "^3.1.68",
|
|
134
134
|
"prettier": "^3.7.4",
|
|
135
|
-
"sass": "^1.
|
|
135
|
+
"sass": "^1.96.0",
|
|
136
136
|
"semantic-release": "^24.2.9",
|
|
137
137
|
"storybook": "^8.6.14",
|
|
138
|
-
"tailwindcss": "^3.4.
|
|
138
|
+
"tailwindcss": "^3.4.19",
|
|
139
139
|
"typescript": "^5.9.3",
|
|
140
140
|
"typescript-eslint": "^8.49.0",
|
|
141
141
|
"ua-parser-js": "^2.0.7",
|