@dcodegroup-au/dsg-vue 0.1.14 → 0.1.15
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.
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-OVnCsiAi.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-B3Ew3xM2.cjs} +1196 -1196
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-ByEZd_XB.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-Dq7AM0nW.js} +10341 -10679
- package/dist/components/Elements/DsgDatepicker.vue.d.ts +3 -0
- package/dist/dsg-vue.cjs +12 -12
- package/dist/dsg-vue.css +2 -2
- package/dist/dsg-vue.esm.js +2163 -2132
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +21 -21
- package/dist/dsg-vue.tailwind.cjs +1 -1
- package/dist/dsg-vue.tailwind.esm.js +6 -6
- package/package.json +17 -17
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"),P=require("./DsgTablePerPage.vue_vue_type_style_index_0_lang-OVnCsiAi.cjs"),W=require("./dsg-vue.helpers-string.cjs"),O=require("./dsg-vue.helpers-object.cjs"),ke={class:"dsg-table--pagination"},he=["disabled"],ye=["disabled"],pe=["onClick","innerHTML"],we=["onClick","innerHTML"],Be=["disabled"],Ce=["disabled"],J=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:u}){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),c=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=u,l=B=>{f("dsg-table:change-page",B)},d=B=>B===i.value?.current_page;return S({loadPage:l}),(B,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",ke,[t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:p[0]||(p[0]=C=>l(t.firstPage)),class:e.normalizeClass([[c.value?"disabled":""],"dsg-table--pagination-link"]),disabled:c.value,title:"First","aria-label":"First"},[e.createVNode(P._sfc_main,{icon:t.firstIcon,size:"sm"},null,8,["icon"])],10,he)):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:p[1]||(p[1]=C=>l("prev")),class:e.normalizeClass([[c.value?"disabled":""],"dsg-table--pagination-link"]),disabled:c.value,title:"Previous","aria-label":"Previous"},[e.createVNode(P._sfc_main,{icon:t.prevIcon,size:"sm"},null,8,["icon"])],10,ye),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,pe))),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:p[2]||(p[2]=C=>l("next")),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Next","aria-label":"Next"},[e.createVNode(P._sfc_main,{icon:t.nextIcon,size:"sm"},null,8,["icon"])],10,Be),t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:3,onClick:p[3]||(p[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(P._sfc_main,{icon:t.lastIcon,size:"sm"},null,8,["icon"])],10,Ce)):e.createCommentVNode("",!0)],512)),[[e.vShow,i.value&&v.value>t.firstPage]])}}),Ee=["innerHTML"],X=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"),u=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:u.value},null,8,Ee))}}),Pe={class:"dsg-table--actions",ref:"dsgTableActions"},De={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"},Z=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 u=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),c=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,c.value);break;case"view":y("dsg-table:action-view",d,c.value);break;case"delete":y("dsg-table:action-delete",d,c.value);break;case"archive":y("dsg-table:action-archive",d,c.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,c.value)},y=S;return(f,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(P.kt),{triggers:[],placement:t.placement,"handle-resize":!0,strategy:"absolute",shown:u.value,class:"dsg-table--actions__popper",onHide:l[1]||(l[1]=d=>u.value=!1),ref:"floatingVueFilterDropdown"},{popper:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[["edit","view","delete","archive"].includes(String(B))?(e.openBlock(),e.createElementBlock("a",{key:B,href:m.value?.link,target:m.value?.target||"_self",onClick:p=>F(d,String(B),p)},[e.createElementVNode("div",{class:e.normalizeClass(["dsg-table--actions-menu-item",String(B)])},[e.createVNode(P._sfc_main,{icon:b(String(B)),size:"sm"},null,8,["icon"]),e.createElementVNode("span",{class:"flex-1",textContent:e.toDisplayString(e.unref(W.ucfirst)(String(B)))},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:B=>V(d,B)},[d.icon?(e.openBlock(),e.createBlock(P._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",De,[e.createElementVNode("button",{type:"button",class:"dsg-table--actions-button","aria-expanded":"false","aria-haspopup":"true",onClick:l[0]||(l[0]=d=>u.value=!u.value)},[e.renderSlot(f.$slots,"dsg-table-action-button-content",{},()=>[e.createVNode(P._sfc_main,{icon:"dots-vertical",size:"sm"})])])])]),_:3},8,["placement","shown"])])),[[e.unref(P.vOnClickOutside),()=>u.value=!1]])}}),Me={class:"dsg-table--search"},_=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 u=e.ref("");e.onMounted(()=>{const c=new URL(window.location.href).searchParams.get("term");c&&(u.value=c,i("dsg-table:term-changed",c))});const i=S,m=P.useDebounceFn(v=>{if(u.value=v,t.replaceState){const c=new URL(window.location.href);u.value?c.searchParams.set("term",u.value):c.searchParams.delete("term"),window.history.pushState({},"",c.toString())}i("dsg-table:term-changed",u.value)},300);return(v,c)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(P._sfc_main$4,{modelValue:u.value,"onUpdate:modelValue":c[0]||(c[0]=b=>u.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:c[1]||(c[1]=b=>e.unref(m)(b)),onEnterPressed:c[2]||(c[2]=b=>e.unref(m)(b)),onOnClear:c[3]||(c[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"],ee=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 u=e.useModel(t,"sortField"),i=e.useModel(t,"selectedRows"),m=e.useModel(t,"hasSelected"),v=e.ref("17px"),c=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+"-"+W.toSnakeCase(String(f?.name)),f.titleClass||"",{sortable:f.sortable},{"sort-active":u.value?.name===f.name}],V=y=>{y.sortable&&(u.value={name:String(y?.name),field:String(y?.sortField),direction:u.value?.name===y.name&&u.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(P._sfc_main$2,{modelValue:m.value,"onUpdate:modelValue":[f[0]||(f[0]=l=>m.value=l),c],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:B=>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&&u.value?.name!==l.name?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"chevron-selector-vertical",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&u.value?.name===l.name&&u.value?.direction==="asc"?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"chevron-down",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&u.value?.name===l.name&&u.value?.direction==="desc"?(e.openBlock(),e.createBlock(P._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(W.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:u}){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),c=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),B=e.ref(null),p=e.ref(0),C=e.useModel(t,"filterParams"),N=e.useModel(t,"perPage"),$=e.ref([]),z=e.ref(!1),x=e.computed(()=>t.tableHeight!=null),M=e.computed(()=>m.value.filter(a=>a.visible).length);e.watch(()=>$.value.length,a=>{z.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=>{L()},{deep:!0}),e.watch(()=>N.value,()=>{L()}),e.watch(()=>t.apiUrl,(a,n)=>{t.apiMode&&a!==n&&a&&L()});const T=u,A=(a,n)=>a.formatter&&typeof a.formatter=="function"?a.formatter(a,n):O.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 E={};if(typeof t.rowClass=="function"){const k=t.rowClass(a,n);typeof k=="string"?k.split(" ").forEach(D=>{D.trim()&&(E[D.trim()]=!0)}):Array.isArray(k)?k.forEach(D=>{typeof D=="string"&&D.trim()&&(E[D.trim()]=!0)}):typeof k=="object"&&k!==null&&(E=k)}else typeof t.rowClass=="string"&&t.rowClass.split(" ").forEach(k=>{k.trim()&&(E[k.trim()]=!0)});return{...r,...E}},R=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)}},U=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!0}),$.value=v.value?.filter(a=>a.selected)??[],T("dsg-table:rows-selected",$.value))},s=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!1}),$.value=[],T("dsg-table:rows-selected",$.value))},o=a=>{v.value=Array.isArray(a)?a:[],t.selectable&&v.value.forEach(n=>{n.selected=n.selected??!1})},g=()=>v.value??[],h=a=>{a==="prev"?b.value>t.firstPage&&b.value--:a==="next"?b.value<(c.value?.last_page??0)&&b.value++:a!=b.value&&a>=t.firstPage&&a<=(c.value?.last_page??0)&&(b.value=a),L()},w=()=>({[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}),I=()=>{B.value&&(B.value.abort(),B.value=null)},de=(a,n)=>{I(),p.value++;const r=p.value,E=new AbortController;return n.signal=E.signal,B.value=E,(t.httpMethod.toLowerCase()==="get"?P.axios.get(a,n):(()=>{const D=n.params;return delete n.params,P.axios.post(a,D,n)})()).then(D=>({...D,_requestId:r,_apiUrl:a}),D=>{throw D.name==="AbortError"||D.code==="ERR_CANCELED"?{...D,_requestId:r,_cancelled:!0}:{...D,_requestId:r}})},j=a=>{if(a._requestId&&a._requestId!==p.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=O.data_get(n,t.dataPath,null),t.selectable&&v.value?.forEach(r=>{r.selected=r.selected??!1}),c.value=O.data_get(n,t.paginationPath,null)??null,f.value=v.value?.length?v.value[0].order:f,c.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="".`),B.value=null,T("dsg-table:pagination-data",c.value),b.value>(c.value?.to||0)&&(b.value=t.initialPage),T("dsg-table:loaded"),l.value=!1},K=a=>{a._requestId&&a._requestId!==p.value||a._apiUrl&&a._apiUrl!==t.apiUrl||a._cancelled||(console.error("load-error",a),B.value=null,T("dsg-table:load-error",a),T("dsg-table:loaded"),l.value=!1)},Q=()=>{if(t.data!==null&&Array.isArray(t.data)){o(t.data),l.value=!1;return}if(t.dataManager&&typeof t.dataManager=="function"){const a=t.dataManager();o(a),l.value=!1}else o(t.data),l.value=!1},L=(a=j,n=K,r={})=>{const E=a||j,k=n||K;if(!t.apiMode){Q();return}return l.value=!0,T("dsg-table:loading",l.value),t.httpOptions.params={...w(),...C.value},de(t.apiUrl,t.httpOptions).then(E).catch(D=>k(D))},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,E)=>{},fe=(a,n,r,E)=>{},ve=(a,n,r,E)=>{},be=(a,n,r)=>{};e.onMounted(()=>{t.apiMode===!0?L():Q()});const Y=()=>{t.apiMode&&($.value=[],I(),L())};return S({changePage:h,reload:Y,getData:g,setData:o,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,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r?.visible?(e.openBlock(),e.createElementBlock("col",{key:E,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(ee,{fields:m.value,"has-select-all":t.selectable,"selected-rows":$.value,"onUpdate:selectedRows":n[0]||(n[0]=r=>$.value=r),"has-selected":z.value,"onUpdate:hasSelected":n[1]||(n[1]=r=>z.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=>Y()),"onDsgTable:onSelectAll":U,"onDsgTable:onDeselectAll":s},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(P._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,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[e.createElementVNode("tr",{class:e.normalizeClass(["dsg-table--tbody-row",q(r,E)]),onClick:k=>ce(k,E,r),onDblclick:k=>ue(k,E,r),onMouseover:k=>ge()},[t.selectable?(e.openBlock(),e.createElementBlock("td",Ye,[e.createVNode(P._sfc_main$2,{modelValue:r.selected,"onUpdate:modelValue":[k=>r.selected=k,k=>R(r)]},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[k.visible?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["dsg-table--tbody-cell",k.dataClass]),style:e.normalizeStyle({width:k.width||void 0}),onClick:G=>me(),onDblclick:G=>fe(),onContextmenu:G=>ve()},[e.renderSlot(a.$slots,H(k),{rowData:r,rowIndex:E,rowField:k},()=>[e.createElementVNode("span",{innerHTML:A(k,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:k=>be()},[e.createElementVNode("td",{colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-detail-row",{rowData:r,rowIndex:E,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"},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:u}){const i=s=>{B.value=s},m=e.ref(t.apiMode&&!!(t.filterEntity||t.filterEndpoint||t.getUrl)),v=()=>{if(m.value){let s={};return P.getQueryStrings().forEach(o=>{if(o.key.startsWith("filter[")){const g=o.key.replace("filter[","").replace("]",""),h=o.value;s[`filter[${g}]`]=h.join(",")}}),s}else return{}},c=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}),B=e.ref(20),p=e.ref({...v(),...t.initialFilters}),C=u,N=s=>{l.value?.changePage(s)},$=s=>{f.value=s},z=({data:s})=>{V.value=s,C("dsg-table:data-loaded",s)},x=()=>{l.value?.reload()},M=s=>{l.value?.setLoading(s)},T=s=>{const o=l.value?.getData?.()??[];l.value?.setData(o.map(g=>g.id===s.id?s:g))},A=s=>{const o=l.value?.getData?.()??[];l.value?.setData([...o,s])},H=s=>{const o=l.value?.getData?.()??[];l.value?.setData(o.filter(g=>g.id!==s.id))},q=s=>{p.value=s},R=s=>{const o={...p.value};!s||s.trim()===""?delete o["filter[term]"]:o["filter[term]"]=s,p.value=o,e.nextTick(()=>{x()}),C("dsg-table:term-changed",s)},U=(s,o,g)=>{const h=Object.keys(s).length===0;let w;h?(w={},p.value["filter[term]"]&&(w["filter[term]"]=p.value["filter[term]"])):w={...p.value,...s},p.value=w,e.nextTick(()=>{x()}),C("dsg-table:filter-updated",p.value,o,g)};return S({reloadTable:x,updateRowTable:T,addRowTable:A,deleteRowTable:H,termChanged:R,setFilters:q,setLoading:M}),(s,o)=>(e.openBlock(),e.createElementBlock("div",lt,[t.hasHeader?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(s.$slots,"dsg-table--pre-header",{},()=>[e.createElementVNode("div",ot,[e.renderSlot(s.$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(s.$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(s.$slots,"dsg-table--search-header",{data:V.value},()=>[e.createVNode(_,{name:"term","onDsgTable:termChanged":o[0]||(o[0]=g=>R(g))}),e.createVNode(P._sfc_main$7,{entity:t.filterEntity,"filter-endpoint":t.filterEndpoint,"search-endpoint":t.filterSearchEndpoint,filters:t.filters,"onDsgTable:filterUpdated":o[1]||(o[1]=(g,h,w)=>U(g,h,w))},null,8,["entity","filter-endpoint","search-endpoint","filters"]),e.renderSlot(s.$slots,"dsg-table--search-actions",{data:V.value})])]),e.renderSlot(s.$slots,"dsg-table--search-navigation")],512)):e.createCommentVNode("",!0),e.createVNode(at,{ref:"dsgTable","api-url":t.getUrl,"filter-params":p.value,"onUpdate:filterParams":o[7]||(o[7]=g=>p.value=g),"per-page":B.value,"onUpdate:perPage":o[8]||(o[8]=g=>B.value=g),fields:t.fields,"load-on-start":t.loadOnStart,"pagination-path":"meta",selectable:t.selectable,"track-by":t.trackBy,"table-layout":t.tableLayout,css:c.value,data:t.data,"row-class":t.rowClass,"api-mode":m.value,"onDsgTable:loading":o[9]||(o[9]=g=>F.value=!0),"onDsgTable:loaded":o[10]||(o[10]=g=>F.value=!1),"onDsgTable:paginationData":$,"onDsgTable:loadSuccess":z,"onDsgTable:rowsSelected":o[11]||(o[11]=g=>C("dsg-table:rows-selected",g)),"onDsgTable:rowClicked":o[12]||(o[12]=(g,h,w)=>C("dsg-table:row-clicked",g,h,w)),"onDsgTable:rowHover":o[13]||(o[13]=(g,h,w)=>C("dsg-table:row-hover",g,h,w)),"onDsgTable:rowDblclick":o[14]||(o[14]=(g,h,w)=>C("dsg-table:row-dblclick",g,h,w))},e.createSlots({"dsg-field--actions":e.withCtx(g=>[e.renderSlot(s.$slots,"dsg-table-actions",{data:g},()=>[(e.openBlock(),e.createBlock(Z,{key:g.rowIndex,data:g,"onDsgTable:actionEdit":o[2]||(o[2]=(h,w)=>C("dsg-table:action-edit",h,w)),"onDsgTable:actionView":o[3]||(o[3]=(h,w)=>C("dsg-table:action-view",h,w)),"onDsgTable:actionDelete":o[4]||(o[4]=(h,w)=>C("dsg-table:action-delete",h,w)),"onDsgTable:actionArchive":o[5]||(o[5]=(h,w)=>C("dsg-table:action-archive",h,w)),"onDsgTable:linkClicked":o[6]||(o[6]=(h,w,I)=>C("dsg-table:link-clicked",h,w,I))},null,8,["data"]))])]),_:2},[e.renderList(e.unref(b),(g,h)=>({name:h,fn:e.withCtx(w=>[String(h)!=="dsg-field--actions"?e.renderSlot(s.$slots,h,e.normalizeProps(e.mergeProps({key:0},w))):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(s.$slots,"dsg-table--footer-left",{data:f.value,perPage:d.value},()=>[e.createVNode(X,{ref:"paginationInfoStart",pagination:f.value,"onUpdate:pagination":o[15]||(o[15]=g=>f.value=g),"info-template":y.value},null,8,["pagination","info-template"]),e.renderSlot(s.$slots,"dsg-table--footer-left-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",gt,[e.renderSlot(s.$slots,"dsg-table--footer-center",{data:f.value,perPage:d.value},()=>[e.renderSlot(s.$slots,"dsg-table--footer-center-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",mt,[e.renderSlot(s.$slots,"dsg-table--footer-right",{data:f.value,perPage:d.value},()=>[F.value===!1?(e.openBlock(),e.createBlock(J,{key:0,ref:"pagination",pagination:f.value,"onUpdate:pagination":o[16]||(o[16]=g=>f.value=g),"onDsgTable:changePage":N},null,8,["pagination"])):e.createCommentVNode("",!0),e.renderSlot(s.$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,u)=>(e.openBlock(),e.createElementBlock("div",vt,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=i=>t.perPage.perPage=i),class:"dsg-table--per-page-select",onChange:u[1]||(u[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]])]))}}),te=ft,ae=Z,le=kt,ne=P._sfc_main$7,oe=J,se=X,re=_,ie=ee,ht={DsgTable:te,DsgTableActions:ae,DsgTablePerPage:le,DsgTableFilter:ne,DsgTablePagination:oe,DsgTablePaginationInfo:se,DsgTableSearch:re,DsgTableRowHeader:ie};exports.DsgTable=te;exports.DsgTableActions=ae;exports.DsgTableFilter=ne;exports.DsgTablePagination=oe;exports.DsgTablePaginationInfo=se;exports.DsgTablePerPage=le;exports.DsgTableRowHeader=ie;exports.DsgTableSearch=re;exports.default=ht;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),P=require("./DsgTablePerPage.vue_vue_type_style_index_0_lang-B3Ew3xM2.cjs"),W=require("./dsg-vue.helpers-string.cjs"),O=require("./dsg-vue.helpers-object.cjs"),ke={class:"dsg-table--pagination"},he=["disabled"],ye=["disabled"],pe=["onClick","innerHTML"],we=["onClick","innerHTML"],Be=["disabled"],Ce=["disabled"],J=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:u}){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),c=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=u,l=B=>{f("dsg-table:change-page",B)},d=B=>B===i.value?.current_page;return S({loadPage:l}),(B,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",ke,[t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:p[0]||(p[0]=C=>l(t.firstPage)),class:e.normalizeClass([[c.value?"disabled":""],"dsg-table--pagination-link"]),disabled:c.value,title:"First","aria-label":"First"},[e.createVNode(P._sfc_main,{icon:t.firstIcon,size:"sm"},null,8,["icon"])],10,he)):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:p[1]||(p[1]=C=>l("prev")),class:e.normalizeClass([[c.value?"disabled":""],"dsg-table--pagination-link"]),disabled:c.value,title:"Previous","aria-label":"Previous"},[e.createVNode(P._sfc_main,{icon:t.prevIcon,size:"sm"},null,8,["icon"])],10,ye),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,pe))),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:p[2]||(p[2]=C=>l("next")),class:e.normalizeClass([[b.value?"disabled":""],"dsg-table--pagination-link"]),disabled:b.value,title:"Next","aria-label":"Next"},[e.createVNode(P._sfc_main,{icon:t.nextIcon,size:"sm"},null,8,["icon"])],10,Be),t.showFirstLast?(e.openBlock(),e.createElementBlock("a",{key:3,onClick:p[3]||(p[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(P._sfc_main,{icon:t.lastIcon,size:"sm"},null,8,["icon"])],10,Ce)):e.createCommentVNode("",!0)],512)),[[e.vShow,i.value&&v.value>t.firstPage]])}}),Ee=["innerHTML"],X=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"),u=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:u.value},null,8,Ee))}}),Pe={class:"dsg-table--actions",ref:"dsgTableActions"},De={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"},Z=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 u=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),c=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,c.value);break;case"view":y("dsg-table:action-view",d,c.value);break;case"delete":y("dsg-table:action-delete",d,c.value);break;case"archive":y("dsg-table:action-archive",d,c.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,c.value)},y=S;return(f,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(P.kt),{triggers:[],placement:t.placement,"handle-resize":!0,strategy:"absolute",shown:u.value,class:"dsg-table--actions__popper",onHide:l[1]||(l[1]=d=>u.value=!1),ref:"floatingVueFilterDropdown"},{popper:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[["edit","view","delete","archive"].includes(String(B))?(e.openBlock(),e.createElementBlock("a",{key:B,href:m.value?.link,target:m.value?.target||"_self",onClick:p=>F(d,String(B),p)},[e.createElementVNode("div",{class:e.normalizeClass(["dsg-table--actions-menu-item",String(B)])},[e.createVNode(P._sfc_main,{icon:b(String(B)),size:"sm"},null,8,["icon"]),e.createElementVNode("span",{class:"flex-1",textContent:e.toDisplayString(e.unref(W.ucfirst)(String(B)))},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:B=>V(d,B)},[d.icon?(e.openBlock(),e.createBlock(P._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",De,[e.createElementVNode("button",{type:"button",class:"dsg-table--actions-button","aria-expanded":"false","aria-haspopup":"true",onClick:l[0]||(l[0]=d=>u.value=!u.value)},[e.renderSlot(f.$slots,"dsg-table-action-button-content",{},()=>[e.createVNode(P._sfc_main,{icon:"dots-vertical",size:"sm"})])])])]),_:3},8,["placement","shown"])])),[[e.unref(P.vOnClickOutside),()=>u.value=!1]])}}),Me={class:"dsg-table--search"},_=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 u=e.ref("");e.onMounted(()=>{const c=new URL(window.location.href).searchParams.get("term");c&&(u.value=c,i("dsg-table:term-changed",c))});const i=S,m=P.useDebounceFn(v=>{if(u.value=v,t.replaceState){const c=new URL(window.location.href);u.value?c.searchParams.set("term",u.value):c.searchParams.delete("term"),window.history.pushState({},"",c.toString())}i("dsg-table:term-changed",u.value)},300);return(v,c)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(P._sfc_main$4,{modelValue:u.value,"onUpdate:modelValue":c[0]||(c[0]=b=>u.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:c[1]||(c[1]=b=>e.unref(m)(b)),onEnterPressed:c[2]||(c[2]=b=>e.unref(m)(b)),onOnClear:c[3]||(c[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"],ee=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 u=e.useModel(t,"sortField"),i=e.useModel(t,"selectedRows"),m=e.useModel(t,"hasSelected"),v=e.ref("17px"),c=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+"-"+W.toSnakeCase(String(f?.name)),f.titleClass||"",{sortable:f.sortable},{"sort-active":u.value?.name===f.name}],V=y=>{y.sortable&&(u.value={name:String(y?.name),field:String(y?.sortField),direction:u.value?.name===y.name&&u.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(P._sfc_main$2,{modelValue:m.value,"onUpdate:modelValue":[f[0]||(f[0]=l=>m.value=l),c],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:B=>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&&u.value?.name!==l.name?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"chevron-selector-vertical",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&u.value?.name===l.name&&u.value?.direction==="asc"?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"chevron-down",class:"inline-flex",size:"xs"})):e.createCommentVNode("",!0),l.sortable&&u.value?.name===l.name&&u.value?.direction==="desc"?(e.openBlock(),e.createBlock(P._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(W.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:u}){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),c=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),B=e.ref(null),p=e.ref(0),C=e.useModel(t,"filterParams"),N=e.useModel(t,"perPage"),$=e.ref([]),z=e.ref(!1),x=e.computed(()=>t.tableHeight!=null),M=e.computed(()=>m.value.filter(a=>a.visible).length);e.watch(()=>$.value.length,a=>{z.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=>{L()},{deep:!0}),e.watch(()=>N.value,()=>{L()}),e.watch(()=>t.apiUrl,(a,n)=>{t.apiMode&&a!==n&&a&&L()});const T=u,A=(a,n)=>a.formatter&&typeof a.formatter=="function"?a.formatter(a,n):O.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 E={};if(typeof t.rowClass=="function"){const k=t.rowClass(a,n);typeof k=="string"?k.split(" ").forEach(D=>{D.trim()&&(E[D.trim()]=!0)}):Array.isArray(k)?k.forEach(D=>{typeof D=="string"&&D.trim()&&(E[D.trim()]=!0)}):typeof k=="object"&&k!==null&&(E=k)}else typeof t.rowClass=="string"&&t.rowClass.split(" ").forEach(k=>{k.trim()&&(E[k.trim()]=!0)});return{...r,...E}},R=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)}},U=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!0}),$.value=v.value?.filter(a=>a.selected)??[],T("dsg-table:rows-selected",$.value))},s=()=>{t.selectable&&(v.value?.forEach(a=>{a.selected=!1}),$.value=[],T("dsg-table:rows-selected",$.value))},o=a=>{v.value=Array.isArray(a)?a:[],t.selectable&&v.value.forEach(n=>{n.selected=n.selected??!1})},g=()=>v.value??[],h=a=>{a==="prev"?b.value>t.firstPage&&b.value--:a==="next"?b.value<(c.value?.last_page??0)&&b.value++:a!=b.value&&a>=t.firstPage&&a<=(c.value?.last_page??0)&&(b.value=a),L()},w=()=>({[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}),I=()=>{B.value&&(B.value.abort(),B.value=null)},de=(a,n)=>{I(),p.value++;const r=p.value,E=new AbortController;return n.signal=E.signal,B.value=E,(t.httpMethod.toLowerCase()==="get"?P.axios.get(a,n):(()=>{const D=n.params;return delete n.params,P.axios.post(a,D,n)})()).then(D=>({...D,_requestId:r,_apiUrl:a}),D=>{throw D.name==="AbortError"||D.code==="ERR_CANCELED"?{...D,_requestId:r,_cancelled:!0}:{...D,_requestId:r}})},j=a=>{if(a._requestId&&a._requestId!==p.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=O.data_get(n,t.dataPath,null),t.selectable&&v.value?.forEach(r=>{r.selected=r.selected??!1}),c.value=O.data_get(n,t.paginationPath,null)??null,f.value=v.value?.length?v.value[0].order:f,c.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="".`),B.value=null,T("dsg-table:pagination-data",c.value),b.value>(c.value?.last_page||0)&&v.value?.length===0&&(b.value=t.initialPage,L()),T("dsg-table:loaded"),l.value=!1},K=a=>{a._requestId&&a._requestId!==p.value||a._apiUrl&&a._apiUrl!==t.apiUrl||a._cancelled||(console.error("load-error",a),B.value=null,T("dsg-table:load-error",a),T("dsg-table:loaded"),l.value=!1)},Q=()=>{if(t.data!==null&&Array.isArray(t.data)){o(t.data),l.value=!1;return}if(t.dataManager&&typeof t.dataManager=="function"){const a=t.dataManager();o(a),l.value=!1}else o(t.data),l.value=!1},L=(a=j,n=K,r={})=>{const E=a||j,k=n||K;if(!t.apiMode){Q();return}return l.value=!0,T("dsg-table:loading",l.value),t.httpOptions.params={...w(),...C.value},de(t.apiUrl,t.httpOptions).then(E).catch(D=>k(D))},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,E)=>{},fe=(a,n,r,E)=>{},ve=(a,n,r,E)=>{},be=(a,n,r)=>{};e.onMounted(()=>{t.apiMode===!0?L():Q()});const Y=()=>{t.apiMode&&($.value=[],I(),L())};return S({changePage:h,reload:Y,getData:g,setData:o,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,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r?.visible?(e.openBlock(),e.createElementBlock("col",{key:E,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(ee,{fields:m.value,"has-select-all":t.selectable,"selected-rows":$.value,"onUpdate:selectedRows":n[0]||(n[0]=r=>$.value=r),"has-selected":z.value,"onUpdate:hasSelected":n[1]||(n[1]=r=>z.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=>Y()),"onDsgTable:onSelectAll":U,"onDsgTable:onDeselectAll":s},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(P._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,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[e.createElementVNode("tr",{class:e.normalizeClass(["dsg-table--tbody-row",q(r,E)]),onClick:k=>ce(k,E,r),onDblclick:k=>ue(k,E,r),onMouseover:k=>ge()},[t.selectable?(e.openBlock(),e.createElementBlock("td",Ye,[e.createVNode(P._sfc_main$2,{modelValue:r.selected,"onUpdate:modelValue":[k=>r.selected=k,k=>R(r)]},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[k.visible?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["dsg-table--tbody-cell",k.dataClass]),style:e.normalizeStyle({width:k.width||void 0}),onClick:G=>me(),onDblclick:G=>fe(),onContextmenu:G=>ve()},[e.renderSlot(a.$slots,H(k),{rowData:r,rowIndex:E,rowField:k},()=>[e.createElementVNode("span",{innerHTML:A(k,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:k=>be()},[e.createElementVNode("td",{colspan:M.value},[e.renderSlot(a.$slots,"dsg-table-detail-row",{rowData:r,rowIndex:E,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"},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:u}){const i=s=>{B.value=s},m=e.ref(t.apiMode&&!!(t.filterEntity||t.filterEndpoint||t.getUrl)),v=()=>{if(m.value){let s={};return P.getQueryStrings().forEach(o=>{if(o.key.startsWith("filter[")){const g=o.key.replace("filter[","").replace("]",""),h=o.value;s[`filter[${g}]`]=h.join(",")}}),s}else return{}},c=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}),B=e.ref(20),p=e.ref({...v(),...t.initialFilters}),C=u,N=s=>{l.value?.changePage(s)},$=s=>{f.value=s},z=({data:s})=>{V.value=s,C("dsg-table:data-loaded",s)},x=()=>{l.value?.reload()},M=s=>{l.value?.setLoading(s)},T=s=>{const o=l.value?.getData?.()??[];l.value?.setData(o.map(g=>g.id===s.id?s:g))},A=s=>{const o=l.value?.getData?.()??[];l.value?.setData([...o,s])},H=s=>{const o=l.value?.getData?.()??[];l.value?.setData(o.filter(g=>g.id!==s.id))},q=s=>{p.value=s},R=s=>{const o={...p.value};!s||s.trim()===""?delete o["filter[term]"]:o["filter[term]"]=s,p.value=o,e.nextTick(()=>{x()}),C("dsg-table:term-changed",s)},U=(s,o,g)=>{const h=Object.keys(s).length===0;let w;h?(w={},p.value["filter[term]"]&&(w["filter[term]"]=p.value["filter[term]"])):w={...p.value,...s},p.value=w,e.nextTick(()=>{x()}),C("dsg-table:filter-updated",p.value,o,g)};return S({reloadTable:x,updateRowTable:T,addRowTable:A,deleteRowTable:H,termChanged:R,setFilters:q,setLoading:M}),(s,o)=>(e.openBlock(),e.createElementBlock("div",lt,[t.hasHeader?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(s.$slots,"dsg-table--pre-header",{},()=>[e.createElementVNode("div",ot,[e.renderSlot(s.$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(s.$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(s.$slots,"dsg-table--search-header",{data:V.value},()=>[e.createVNode(_,{name:"term","onDsgTable:termChanged":o[0]||(o[0]=g=>R(g))}),e.createVNode(P._sfc_main$7,{entity:t.filterEntity,"filter-endpoint":t.filterEndpoint,"search-endpoint":t.filterSearchEndpoint,filters:t.filters,"onDsgTable:filterUpdated":o[1]||(o[1]=(g,h,w)=>U(g,h,w))},null,8,["entity","filter-endpoint","search-endpoint","filters"]),e.renderSlot(s.$slots,"dsg-table--search-actions",{data:V.value})])]),e.renderSlot(s.$slots,"dsg-table--search-navigation")],512)):e.createCommentVNode("",!0),e.createVNode(at,{ref:"dsgTable","api-url":t.getUrl,"filter-params":p.value,"onUpdate:filterParams":o[7]||(o[7]=g=>p.value=g),"per-page":B.value,"onUpdate:perPage":o[8]||(o[8]=g=>B.value=g),fields:t.fields,"load-on-start":t.loadOnStart,"pagination-path":"meta",selectable:t.selectable,"track-by":t.trackBy,"table-layout":t.tableLayout,css:c.value,data:t.data,"row-class":t.rowClass,"api-mode":m.value,"onDsgTable:loading":o[9]||(o[9]=g=>F.value=!0),"onDsgTable:loaded":o[10]||(o[10]=g=>F.value=!1),"onDsgTable:paginationData":$,"onDsgTable:loadSuccess":z,"onDsgTable:rowsSelected":o[11]||(o[11]=g=>C("dsg-table:rows-selected",g)),"onDsgTable:rowClicked":o[12]||(o[12]=(g,h,w)=>C("dsg-table:row-clicked",g,h,w)),"onDsgTable:rowHover":o[13]||(o[13]=(g,h,w)=>C("dsg-table:row-hover",g,h,w)),"onDsgTable:rowDblclick":o[14]||(o[14]=(g,h,w)=>C("dsg-table:row-dblclick",g,h,w))},e.createSlots({"dsg-field--actions":e.withCtx(g=>[e.renderSlot(s.$slots,"dsg-table-actions",{data:g},()=>[(e.openBlock(),e.createBlock(Z,{key:g.rowIndex,data:g,"onDsgTable:actionEdit":o[2]||(o[2]=(h,w)=>C("dsg-table:action-edit",h,w)),"onDsgTable:actionView":o[3]||(o[3]=(h,w)=>C("dsg-table:action-view",h,w)),"onDsgTable:actionDelete":o[4]||(o[4]=(h,w)=>C("dsg-table:action-delete",h,w)),"onDsgTable:actionArchive":o[5]||(o[5]=(h,w)=>C("dsg-table:action-archive",h,w)),"onDsgTable:linkClicked":o[6]||(o[6]=(h,w,I)=>C("dsg-table:link-clicked",h,w,I))},null,8,["data"]))])]),_:2},[e.renderList(e.unref(b),(g,h)=>({name:h,fn:e.withCtx(w=>[String(h)!=="dsg-field--actions"?e.renderSlot(s.$slots,h,e.normalizeProps(e.mergeProps({key:0},w))):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(s.$slots,"dsg-table--footer-left",{data:f.value,perPage:d.value},()=>[e.createVNode(X,{ref:"paginationInfoStart",pagination:f.value,"onUpdate:pagination":o[15]||(o[15]=g=>f.value=g),"info-template":y.value},null,8,["pagination","info-template"]),e.renderSlot(s.$slots,"dsg-table--footer-left-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",gt,[e.renderSlot(s.$slots,"dsg-table--footer-center",{data:f.value,perPage:d.value},()=>[e.renderSlot(s.$slots,"dsg-table--footer-center-extras",{data:f.value,perPage:d.value})])]),e.createElementVNode("div",mt,[e.renderSlot(s.$slots,"dsg-table--footer-right",{data:f.value,perPage:d.value},()=>[F.value===!1?(e.openBlock(),e.createBlock(J,{key:0,ref:"pagination",pagination:f.value,"onUpdate:pagination":o[16]||(o[16]=g=>f.value=g),"onDsgTable:changePage":N},null,8,["pagination"])):e.createCommentVNode("",!0),e.renderSlot(s.$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,u)=>(e.openBlock(),e.createElementBlock("div",vt,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=i=>t.perPage.perPage=i),class:"dsg-table--per-page-select",onChange:u[1]||(u[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]])]))}}),te=ft,ae=Z,le=kt,ne=P._sfc_main$7,oe=J,se=X,re=_,ie=ee,ht={DsgTable:te,DsgTableActions:ae,DsgTablePerPage:le,DsgTableFilter:ne,DsgTablePagination:oe,DsgTablePaginationInfo:se,DsgTableSearch:re,DsgTableRowHeader:ie};exports.DsgTable=te;exports.DsgTableActions=ae;exports.DsgTableFilter=ne;exports.DsgTablePagination=oe;exports.DsgTablePaginationInfo=se;exports.DsgTablePerPage=le;exports.DsgTableRowHeader=ie;exports.DsgTableSearch=re;exports.default=ht;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as K, mergeModels as
|
|
2
|
-
import { _ as z, k as We, v as je, f as Ke, u as Qe, c as we, e as he, i as ke, j as Ye } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { defineComponent as K, mergeModels as J, useModel as G, computed as V, withDirectives as re, createElementBlock as o, openBlock as l, createCommentVNode as p, createElementVNode as w, normalizeClass as B, createVNode as R, Fragment as I, renderList as N, vShow as Re, ref as k, useTemplateRef as me, useAttrs as Ie, unref as O, withCtx as ee, renderSlot as F, toDisplayString as te, createBlock as j, resolveDynamicComponent as Ae, onMounted as ye, normalizeStyle as X, watch as _, Transition as He, createTextVNode as Ue, useSlots as qe, createSlots as Ve, normalizeProps as ze, mergeProps as Oe, nextTick as fe, vModelSelect as Ne } from "vue";
|
|
2
|
+
import { _ as z, k as We, v as je, f as Ke, u as Qe, c as we, e as he, i as ke, j as Ye } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-Dq7AM0nW.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 de } from "./dsg-vue.helpers-object.esm.js";
|
|
5
5
|
const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disabled"], tt = ["onClick", "innerHTML"], at = ["onClick", "innerHTML"], lt = ["disabled"], st = ["disabled"], Pe = /* @__PURE__ */ K({
|
|
6
6
|
__name: "DsgTablePagination",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ J({
|
|
8
8
|
onEachSide: { default: 3 },
|
|
9
9
|
firstPage: { default: 1 },
|
|
10
10
|
showFirstLast: { type: Boolean, default: !0 },
|
|
@@ -16,9 +16,9 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
16
16
|
pagination: { default: null },
|
|
17
17
|
paginationModifiers: {}
|
|
18
18
|
}),
|
|
19
|
-
emits: /* @__PURE__ */
|
|
19
|
+
emits: /* @__PURE__ */ J(["dsg-table:change-page"], ["update:pagination"]),
|
|
20
20
|
setup(e, { expose: L, emit: g }) {
|
|
21
|
-
const r =
|
|
21
|
+
const r = G(e, "pagination"), b = V(() => r.value === null ? 0 : r.value?.last_page - e.firstPage + 1), h = V(() => r.value === null ? 0 : r.value?.last_page), c = 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(() => b.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 >= b.value - e.onEachSide ? b.value - e.onEachSide * 2 : r.value?.current_page - e.onEachSide), f = g, a = (T) => {
|
|
22
22
|
f("dsg-table:change-page", T);
|
|
23
23
|
}, u = (T) => T === r.value?.current_page;
|
|
24
24
|
return L({
|
|
@@ -91,7 +91,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
91
91
|
}
|
|
92
92
|
}), nt = ["innerHTML"], pe = /* @__PURE__ */ K({
|
|
93
93
|
__name: "DsgTablePaginationInfo",
|
|
94
|
-
props: /* @__PURE__ */
|
|
94
|
+
props: /* @__PURE__ */ J({
|
|
95
95
|
infoTemplate: { default: "Displaying {from} to {to} of {total} items" },
|
|
96
96
|
noDataTemplate: { default: "No relevant data" }
|
|
97
97
|
}, {
|
|
@@ -100,7 +100,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
100
100
|
}),
|
|
101
101
|
emits: ["update:pagination"],
|
|
102
102
|
setup(e) {
|
|
103
|
-
const L =
|
|
103
|
+
const L = G(e, "pagination"), g = V(() => L.value == null || L.value.total == 0 ? e.noDataTemplate : e.infoTemplate.replace("{from}", (L.value?.from || 0).toString()).replace("{to}", (L.value?.to || 0).toString()).replace("{total}", (L.value?.total || 0).toString()));
|
|
104
104
|
return (r, b) => (l(), o("div", {
|
|
105
105
|
class: "dsg-table--pagination-info",
|
|
106
106
|
innerHTML: g.value
|
|
@@ -299,7 +299,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
299
299
|
class: "dsg-table--th-sort-icon"
|
|
300
300
|
}, Pt = ["innerHTML"], pt = ["innerHTML"], $e = /* @__PURE__ */ K({
|
|
301
301
|
__name: "DsgTableRowHeader",
|
|
302
|
-
props: /* @__PURE__ */
|
|
302
|
+
props: /* @__PURE__ */ J({
|
|
303
303
|
fields: {},
|
|
304
304
|
scrollVisible: { type: Boolean },
|
|
305
305
|
hasSelectAll: { type: Boolean, default: !1 },
|
|
@@ -313,9 +313,9 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
313
313
|
hasSelected: { type: Boolean, default: !1 },
|
|
314
314
|
hasSelectedModifiers: {}
|
|
315
315
|
}),
|
|
316
|
-
emits: /* @__PURE__ */
|
|
316
|
+
emits: /* @__PURE__ */ J(["dsg-table:sort-field", "dsg-table:on-select-all", "dsg-table:on-deselect-all"], ["update:sortField", "update:selectedRows", "update:hasSelected"]),
|
|
317
317
|
setup(e, { emit: L }) {
|
|
318
|
-
const g =
|
|
318
|
+
const g = G(e, "sortField"), r = G(e, "selectedRows"), b = G(e, "hasSelected"), h = k("17px"), c = (C) => {
|
|
319
319
|
b.value && r.value.length > 0 && r.value.length !== e.tableDataLength ? (b.value = !0, m("dsg-table:on-select-all")) : !b.value && r.value.length === 0 ? (b.value = !1, m("dsg-table:on-select-all")) : m("dsg-table:on-deselect-all");
|
|
320
320
|
}, m = L, q = (C, f) => [
|
|
321
321
|
C,
|
|
@@ -398,7 +398,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
398
398
|
class: "dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"
|
|
399
399
|
}, Mt = ["onClick", "onDblclick", "onContextmenu"], Lt = ["innerHTML"], Et = ["onClick"], Bt = ["colspan"], Rt = { key: 2 }, It = ["colspan"], At = { class: "dsg-table--footer" }, Ht = /* @__PURE__ */ K({
|
|
400
400
|
__name: "DsgTableComponent",
|
|
401
|
-
props: /* @__PURE__ */
|
|
401
|
+
props: /* @__PURE__ */ J({
|
|
402
402
|
fields: { default: () => [] },
|
|
403
403
|
isDraggable: { type: Boolean, default: !1 },
|
|
404
404
|
dragApi: { default: "" },
|
|
@@ -454,7 +454,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
454
454
|
perPage: { default: 20 },
|
|
455
455
|
perPageModifiers: {}
|
|
456
456
|
}),
|
|
457
|
-
emits: /* @__PURE__ */
|
|
457
|
+
emits: /* @__PURE__ */ J(["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
458
|
setup(e, { expose: L, emit: g }) {
|
|
459
459
|
const r = (t) => t.map((s, d) => ({
|
|
460
460
|
field: s.field || "",
|
|
@@ -468,7 +468,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
468
468
|
sortable: s.sortField,
|
|
469
469
|
formatter: s.formatter || null,
|
|
470
470
|
$_index: d
|
|
471
|
-
})), b = k(r(e.fields)), h = k(e.data), c = k(null), m = k(e.initialPage), q = k("17px"), A = k(!1), C = k({}), f = k(0), a = k(!0), u = k(null), T = k(null), D = k(0), S =
|
|
471
|
+
})), b = k(r(e.fields)), h = k(e.data), c = k(null), m = k(e.initialPage), q = k("17px"), A = k(!1), C = k({}), f = k(0), a = k(!0), u = k(null), T = k(null), D = k(0), S = G(e, "filterParams"), U = G(e, "perPage"), E = k([]), Z = k(!1), W = V(() => e.tableHeight != null), Q = V(() => b.value.filter((t) => t.visible).length);
|
|
472
472
|
_(
|
|
473
473
|
() => E.value.length,
|
|
474
474
|
(t) => {
|
|
@@ -484,18 +484,18 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
484
484
|
), _(
|
|
485
485
|
() => S.value,
|
|
486
486
|
(t) => {
|
|
487
|
-
|
|
487
|
+
Y();
|
|
488
488
|
},
|
|
489
489
|
{ deep: !0 }
|
|
490
490
|
), _(
|
|
491
491
|
() => U.value,
|
|
492
492
|
() => {
|
|
493
|
-
|
|
493
|
+
Y();
|
|
494
494
|
}
|
|
495
495
|
), _(
|
|
496
496
|
() => e.apiUrl,
|
|
497
497
|
(t, s) => {
|
|
498
|
-
e.apiMode && t !== s && t &&
|
|
498
|
+
e.apiMode && t !== s && t && Y();
|
|
499
499
|
}
|
|
500
500
|
);
|
|
501
501
|
const H = g, se = (t, s) => t.formatter && typeof t.formatter == "function" ? t.formatter(t, s) : de(s, String(t?.name), ""), ne = (t) => "dsg-field--" + t.name?.toLowerCase().replaceAll(/[_ ]/g, "-"), oe = (t, s) => {
|
|
@@ -541,7 +541,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
541
541
|
s.selected = s.selected ?? !1;
|
|
542
542
|
});
|
|
543
543
|
}, v = () => h.value ?? [], P = (t) => {
|
|
544
|
-
t === "prev" ? m.value > e.firstPage && m.value-- : t === "next" ? m.value < (c.value?.last_page ?? 0) && m.value++ : t != m.value && t >= e.firstPage && t <= (c.value?.last_page ?? 0) && (m.value = t),
|
|
544
|
+
t === "prev" ? m.value > e.firstPage && m.value-- : t === "next" ? m.value < (c.value?.last_page ?? 0) && m.value++ : t != m.value && t >= e.firstPage && t <= (c.value?.last_page ?? 0) && (m.value = t), Y();
|
|
545
545
|
}, $ = () => ({
|
|
546
546
|
[e.queryParams?.sort]: u.value ? (u.value?.direction === "desc" ? "-" : "") + u.value?.field : void 0,
|
|
547
547
|
[e.queryParams?.order]: u.value?.direction,
|
|
@@ -571,7 +571,7 @@ const Ze = { class: "dsg-table--pagination" }, _e = ["disabled"], et = ["disable
|
|
|
571
571
|
}), c.value = de(s, e.paginationPath, null) ?? null, f.value = h.value?.length ? h.value[0].order : f, c.value === null && console.warn(
|
|
572
572
|
'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
573
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
574
|
-
), T.value = null, H("dsg-table:pagination-data", c.value), m.value > (c.value?.
|
|
574
|
+
), T.value = null, H("dsg-table:pagination-data", c.value), m.value > (c.value?.last_page || 0) && h.value?.length === 0 && (m.value = e.initialPage, Y()), H("dsg-table:loaded"), a.value = !1;
|
|
575
575
|
}, ce = (t) => {
|
|
576
576
|
t._requestId && t._requestId !== D.value || t._apiUrl && t._apiUrl !== e.apiUrl || t._cancelled || (console.error("load-error", t), T.value = null, H("dsg-table:load-error", t), H("dsg-table:loaded"), a.value = !1);
|
|
577
577
|
}, ge = () => {
|
|
@@ -584,7 +584,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
584
584
|
n(t), a.value = !1;
|
|
585
585
|
} else
|
|
586
586
|
n(e.data), a.value = !1;
|
|
587
|
-
},
|
|
587
|
+
}, Y = (t = ue, s = ce, d = {}) => {
|
|
588
588
|
const x = t || ue, y = s || ce;
|
|
589
589
|
if (!e.apiMode) {
|
|
590
590
|
ge();
|
|
@@ -605,10 +605,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
605
605
|
}, Be = (t, s, d) => {
|
|
606
606
|
};
|
|
607
607
|
ye(() => {
|
|
608
|
-
e.apiMode === !0 ?
|
|
608
|
+
e.apiMode === !0 ? Y() : ge();
|
|
609
609
|
});
|
|
610
610
|
const ve = () => {
|
|
611
|
-
e.apiMode && (E.value = [], le(),
|
|
611
|
+
e.apiMode && (E.value = [], le(), Y());
|
|
612
612
|
};
|
|
613
613
|
return L({
|
|
614
614
|
changePage: P,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./_commonjsHelpers-DwGv2jUC.cjs"),a=require("./DsgColoursConfig-D7UiFGB5.cjs");var x={},d={},m;function T(){return m||(m=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});function r(n,l){return{handler:n,config:l}}r.withOptions=function(n,l=()=>({})){const i=function(p){return{__options:p,handler:n(p),config:l(p)}};return i.__isOptionsFunction=!0,i.__pluginFunction=n,i.__configFunction=l,i};const o=r})(d)),d}var y;function H(){return y||(y=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const r=o(T());function o(l){return l&&l.__esModule?l:{default:l}}const n=r.default})(x)),x}var u,b;function z(){if(b)return u;b=1;let e=H();return u=(e.__esModule?e:{default:e}).default,u}var G=z();const s=R.getDefaultExportFromCjs(G),g={"display-2xl":{fontSize:"4.5rem",lineHeight:"5.625rem",letterSpacing:"-0.09rem"},"display-xl":{fontSize:"3.75rem",lineHeight:"4.5rem",letterSpacing:"-0.075rem"},"display-lg":{fontSize:"3rem",lineHeight:"3.75rem",letterSpacing:"-0.06rem"},"display-md":{fontSize:"2.25rem",lineHeight:"2.75rem",letterSpacing:"-0.045rem"},"display-sm":{fontSize:"1.875rem",lineHeight:"2.375rem"},"display-xs":{fontSize:"1.5rem",lineHeight:"2rem"}},t={xl:{fontSize:"1.125rem",lineHeight:"1.75rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},md:{fontSize:"1rem",lineHeight:"1.5rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},xs:{fontSize:"0.75rem",lineHeight:"1.125rem"}},A=[{classNames:["display-2xl","h1","heading-1"],styles:{...g["display-2xl"]}},{classNames:["display-xl","h2","heading-2"],styles:{...g["display-xl"]}},{classNames:["display-lg","h3","heading-3"],styles:{...g["display-lg"]}},{classNames:["display-md","h4","heading-4"],styles:{...g["display-md"]}},{classNames:["display-sm","h5","heading-5"],styles:{...g["display-sm"]}},{classNames:["display-xs","h6","heading-6"],styles:{...g["display-xs"]}},{classNames:["body-xl","text-xl","lead-1"],styles:{...t.xl}},{classNames:["body-lg","text-lg","lead-2"],styles:{...t.lg}},{classNames:["body-md","text-md","body","text-base"],styles:{...t.md}},{classNames:["body-sm","text-sm","caption"],styles:{...t.sm}},{classNames:["body-xs","text-xs","legal","text-legal"],styles:{...t.xs}}];let C={};A.forEach(e=>{e.classNames.forEach(r=>{C["."+r]=e.styles})});const h=s(function({addComponents:e}){return e(C)}),f=s(()=>{},{theme:{extend:{borderRadius:{none:"0rem",xxs:"0.125rem",xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.625rem",xl:"0.75rem","2xl":"1rem","3xl":"1.25rem","4xl":"1.5rem",full:"9999px"}}}}),q=[{className:"gradient-gray-1",colors:[a.ColoursConfig.gray[600],"#FFFFFF"],angle:"0deg",type:"linear"},{className:"gradient-gray-2",colors:[a.ColoursConfig.gray[600],a.ColoursConfig.gray[500]],angle:"90deg",type:"linear"},{className:"gradient-gray-3",colors:[a.ColoursConfig.gray[700],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-gray-4",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-gray-5",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[600]],angle:"90deg",type:"linear"},{className:"gradient-gray-6",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[700]],angle:"26.5deg",type:"linear"},{className:"gradient-gray-7",colors:[a.ColoursConfig.gray[900],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-1",colors:[a.ColoursConfig.brand[600],"#FFFFFF"],angle:"0deg",type:"linear"},{className:"gradient-brand-2",colors:[a.ColoursConfig.brand[600],a.ColoursConfig.brand[500]],angle:"90deg",type:"linear"},{className:"gradient-brand-3",colors:[a.ColoursConfig.brand[700],a.ColoursConfig.brand[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-4",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-5",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[600]],angle:"90deg",type:"linear"},{className:"gradient-brand-6",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[700]],angle:"26.5deg",type:"linear"},{className:"gradient-brand-7",colors:[a.ColoursConfig.brand[900],a.ColoursConfig.brand[700]],angle:"45deg",type:"linear"},{className:"gradient-gray-neutral-1",colors:["#FFFFFF","#F3F5F7"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-2",colors:["#F9FAFB","#EDF0F3"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-3",colors:["#EDF0F3","#E7EBEF"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-4",colors:["#F3F5F7","#E0E5EB"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-5",colors:["#EDF0F3","#D4DBE2"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-6",colors:["#E7EBEF","#C8D1DA"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-7",colors:["#E7EBEF","#C8D1DA"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-1",colors:["#FFFFFF","#F5F5F5"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-2",colors:["#FAFAFA","#F0F0F0"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-3",colors:["#FAFAFA","#EBEBEB"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-4",colors:["#F5F5F5","#E5E5E5"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-5",colors:["#F0F0F0","#DBDBDB"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-6",colors:["#EBEBEB","#D1D1D1"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-7",colors:["#E5E5E5","#C2C2C2"],angle:"180deg",type:"linear"}];let F={};q.forEach(e=>{const r=e.type==="linear"?"linear-gradient":"radial-gradient",o=e.colors.join(", ");let n=r+"("+e.angle+", "+o+")";F["."+e.className]={backgroundImage:n}});const N=s(({addComponents:e})=>{e(F)}),V=[{className:"backdrop-blur-light-sm",background:"rgba(255, 255, 255, 0.60)",blur:"4px"},{className:"backdrop-blur-light-md",background:"rgba(255, 255, 255, 0.60)",blur:"8px"},{className:"backdrop-blur-light-lg",background:"rgba(255, 255, 255, 0.60)",blur:"12px"},{className:"backdrop-blur-light-xl",background:"rgba(255, 255, 255, 0.60)",blur:"20px"},{className:"backdrop-blur-dark-sm",background:"rgba(0, 0, 0, 0.60)",blur:"4px"},{className:"backdrop-blur-dark-md",background:"rgba(0, 0, 0, 0.60)",blur:"8px"},{className:"backdrop-blur-dark-lg",background:"rgba(0, 0, 0, 0.60)",blur:"12px"},{className:"backdrop-blur-dark-xl",background:"rgba(0, 0, 0, 0.60)",blur:"20px"}];let S={};V.forEach(e=>{S["."+e.className]={backdropFilter:"blur("+e.blur+")",background:e.background}});const P=s(({addComponents:e})=>{e(S)}),O=[{className:"shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05)",textShadowValue:"0px 1px 2px rgba(16, 24, 40, 0.05)"},{className:"shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06)",textShadowValue:"0px 1px 3px rgba(16, 24, 40, 0.10)"},{className:"shadow-md",value:"0px 4px 8px -2px rgba(16, 24, 40, 0.10), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)",textShadowValue:"0px 4px 8px rgba(16, 24, 40, 0.10)"},{className:"shadow-lg",value:"0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03)",textShadowValue:"0px 12px 16px rgba(16, 24, 40, 0.12)"},{className:"shadow-xl",value:"0px 16px 32px -8px rgba(16, 24, 40, 0.18)",textShadowValue:"0px 16px 32px rgba(16, 24, 40, 0.18)"},{className:"shadow-2xl",value:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)",textShadowValue:"0px 24px 48px rgba(16, 24, 40, 0.18)"},{className:"shadow-3xl",value:"0px 32px 64px -12px rgba(16, 24, 40, 0.14)",textShadowValue:"0px 32px 64px rgba(16, 24, 40, 0.14)"}];let c={};O.forEach(e=>{c["."+e.className]={boxShadow:e.value},c[".text-"+e.className]={textShadow:e.textShadowValue}});const B=s(({addComponents:e})=>{e(c)});function j(e){const r={brandColor:e?.brandColor||a.ColoursConfig.brand[500],grayColor:e?.grayColor||a.ColoursConfig.gray[400],errorColor:e?.errorColor||a.ColoursConfig.error[500]},o=[{className:"ring-brand",value:"0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-gray",value:"0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-gray-secondary",value:"0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.2)},{className:"ring-error",value:"0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)},{className:"ring-brand-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-brand-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-gray-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-gray-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-error-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)},{className:"ring-error-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)}];let n={};return o.forEach(l=>{n["."+l.className]={boxShadow:l.value}}),s(({addComponents:l})=>{l(n)})}const D=j,E=s(({addBase:e,theme:r})=>{},{theme:{extend:{container:{center:!0,padding:{DEFAULT:"2rem",md:"1rem"}}}}}),v=s(({addBase:e,theme:r})=>{},{theme:{extend:{height:{xxs:"0.5rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.75rem"}}}}),w=s(({addBase:e,theme:r})=>{},{theme:{extend:{screens:{"max-xl":{max:"1279px"},"max-lg":{max:"1023px"},"max-md":{max:"768px"},"max-sm":{max:"639px"},"max-xs":{max:"413px"},sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1600px"}}}}),k=s(({addBase:e,theme:r})=>{},{theme:{extend:{spacing:{"3xlSpace":"96px","2xlSpace":"64px",xlSpace:"32px",lgSpace:"24px",mdSpace:"16px",smSpace:"12px",xsSpace:"8px","2xsSpace":"4px","3xsSpace":"2px"}}}}),_=s(({addBase:e,theme:r})=>{},{theme:{extend:{width:{"2xs":"0.5rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.75rem"}}}}),M=[f,h,N,P,B,D(),E,v,w,k,_],$={brand:["Inter","Source Sans Pro","Helvetica Neue","Roboto","Arial","sans-serif"],inter:["Inter","Source Sans Pro","Helvetica Neue","Roboto","Arial","sans-serif"]},W=M,L=a.ColoursConfig,U=a.ColoursConfig,J=$;exports.DsgBackdropBlurPlugin=P;exports.DsgColorConfig=U;exports.DsgColourConfig=L;exports.DsgContainerPlugin=E;exports.DsgFocusRingsPlugin=D;exports.DsgFontFamilyConfig=J;exports.DsgGradientPlugin=N;exports.DsgHeightPlugin=v;exports.DsgRadiusPlugin=f;exports.DsgScreenPlugin=w;exports.DsgShadowsPlugin=B;exports.DsgSpacingPlugin=k;exports.DsgTailwindPlugin=W;exports.DsgTypographyPlugin=h;exports.DsgWidthPlugin=_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./_commonjsHelpers-DwGv2jUC.cjs"),a=require("./DsgColoursConfig-D7UiFGB5.cjs");var x={},d={},m;function T(){return m||(m=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});function r(n,l){return{handler:n,config:l}}r.withOptions=function(n,l=()=>({})){const i=function(p){return{__options:p,handler:n(p),config:l(p)}};return i.__isOptionsFunction=!0,i.__pluginFunction=n,i.__configFunction=l,i};const o=r})(d)),d}var y;function H(){return y||(y=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const r=o(T());function o(l){return l&&l.__esModule?l:{default:l}}const n=r.default})(x)),x}var u,b;function z(){if(b)return u;b=1;let e=H();return u=(e.__esModule?e:{default:e}).default,u}var G=z();const s=R.getDefaultExportFromCjs(G),g={"display-2xl":{fontSize:"4.5rem",lineHeight:"5.625rem",letterSpacing:"-0.09rem"},"display-xl":{fontSize:"3.75rem",lineHeight:"4.5rem",letterSpacing:"-0.075rem"},"display-lg":{fontSize:"3rem",lineHeight:"3.75rem",letterSpacing:"-0.06rem"},"display-md":{fontSize:"2.25rem",lineHeight:"2.75rem",letterSpacing:"-0.045rem"},"display-sm":{fontSize:"1.875rem",lineHeight:"2.375rem"},"display-xs":{fontSize:"1.5rem",lineHeight:"2rem"}},t={xl:{fontSize:"1.125rem",lineHeight:"1.75rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},md:{fontSize:"1rem",lineHeight:"1.5rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},xs:{fontSize:"0.75rem",lineHeight:"1.125rem"}},A=[{classNames:["display-2xl","h1","heading-1"],styles:{...g["display-2xl"]}},{classNames:["display-xl","h2","heading-2"],styles:{...g["display-xl"]}},{classNames:["display-lg","h3","heading-3"],styles:{...g["display-lg"]}},{classNames:["display-md","h4","heading-4"],styles:{...g["display-md"]}},{classNames:["display-sm","h5","heading-5"],styles:{...g["display-sm"]}},{classNames:["display-xs","h6","heading-6"],styles:{...g["display-xs"]}},{classNames:["body-xl","text-xl","lead-1"],styles:{...t.xl}},{classNames:["body-lg","text-lg","lead-2"],styles:{...t.lg}},{classNames:["body-md","text-md","body","text-base"],styles:{...t.md}},{classNames:["body-sm","text-sm","caption"],styles:{...t.sm}},{classNames:["body-xs","text-xs","legal","text-legal"],styles:{...t.xs}}];let C={};A.forEach(e=>{e.classNames.forEach(r=>{C["."+r]=e.styles})});const h=s(function({addComponents:e}){return e(C)}),f=s(()=>{},{theme:{extend:{borderRadius:{none:"0rem",xxs:"0.125rem",xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.625rem",xl:"0.75rem","2xl":"1rem","3xl":"1.25rem","4xl":"1.5rem",full:"9999px"}}}}),q=[{className:"gradient-gray-1",colors:[a.ColoursConfig.gray[600],"#FFFFFF"],angle:"0deg",type:"linear"},{className:"gradient-gray-2",colors:[a.ColoursConfig.gray[600],a.ColoursConfig.gray[500]],angle:"90deg",type:"linear"},{className:"gradient-gray-3",colors:[a.ColoursConfig.gray[700],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-gray-4",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-gray-5",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[600]],angle:"90deg",type:"linear"},{className:"gradient-gray-6",colors:[a.ColoursConfig.gray[800],a.ColoursConfig.gray[700]],angle:"26.5deg",type:"linear"},{className:"gradient-gray-7",colors:[a.ColoursConfig.gray[900],a.ColoursConfig.gray[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-1",colors:[a.ColoursConfig.brand[600],"#FFFFFF"],angle:"0deg",type:"linear"},{className:"gradient-brand-2",colors:[a.ColoursConfig.brand[600],a.ColoursConfig.brand[500]],angle:"90deg",type:"linear"},{className:"gradient-brand-3",colors:[a.ColoursConfig.brand[700],a.ColoursConfig.brand[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-4",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[600]],angle:"45deg",type:"linear"},{className:"gradient-brand-5",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[600]],angle:"90deg",type:"linear"},{className:"gradient-brand-6",colors:[a.ColoursConfig.brand[800],a.ColoursConfig.brand[700]],angle:"26.5deg",type:"linear"},{className:"gradient-brand-7",colors:[a.ColoursConfig.brand[900],a.ColoursConfig.brand[700]],angle:"45deg",type:"linear"},{className:"gradient-gray-neutral-1",colors:["#FFFFFF","#F3F5F7"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-2",colors:["#F9FAFB","#EDF0F3"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-3",colors:["#EDF0F3","#E7EBEF"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-4",colors:["#F3F5F7","#E0E5EB"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-5",colors:["#EDF0F3","#D4DBE2"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-6",colors:["#E7EBEF","#C8D1DA"],angle:"180deg",type:"linear"},{className:"gradient-gray-neutral-7",colors:["#E7EBEF","#C8D1DA"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-1",colors:["#FFFFFF","#F5F5F5"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-2",colors:["#FAFAFA","#F0F0F0"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-3",colors:["#FAFAFA","#EBEBEB"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-4",colors:["#F5F5F5","#E5E5E5"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-5",colors:["#F0F0F0","#DBDBDB"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-6",colors:["#EBEBEB","#D1D1D1"],angle:"180deg",type:"linear"},{className:"gradient-gray-true-7",colors:["#E5E5E5","#C2C2C2"],angle:"180deg",type:"linear"}];let F={};q.forEach(e=>{const r=e.type==="linear"?"linear-gradient":"radial-gradient",o=e.colors.join(", ");let n=r+"("+e.angle+", "+o+")";F["."+e.className]={backgroundImage:n}});const N=s(({addComponents:e})=>{e(F)}),V=[{className:"backdrop-blur-light-sm",background:"rgba(255, 255, 255, 0.60)",blur:"4px"},{className:"backdrop-blur-light-md",background:"rgba(255, 255, 255, 0.60)",blur:"8px"},{className:"backdrop-blur-light-lg",background:"rgba(255, 255, 255, 0.60)",blur:"12px"},{className:"backdrop-blur-light-xl",background:"rgba(255, 255, 255, 0.60)",blur:"20px"},{className:"backdrop-blur-dark-sm",background:"rgba(0, 0, 0, 0.60)",blur:"4px"},{className:"backdrop-blur-dark-md",background:"rgba(0, 0, 0, 0.60)",blur:"8px"},{className:"backdrop-blur-dark-lg",background:"rgba(0, 0, 0, 0.60)",blur:"12px"},{className:"backdrop-blur-dark-xl",background:"rgba(0, 0, 0, 0.60)",blur:"20px"}];let S={};V.forEach(e=>{S["."+e.className]={backdropFilter:"blur("+e.blur+")",background:e.background}});const P=s(({addComponents:e})=>{e(S)}),O=[{className:"shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05)",textShadowValue:"0px 1px 2px rgba(16, 24, 40, 0.05)"},{className:"shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06)",textShadowValue:"0px 1px 3px rgba(16, 24, 40, 0.10)"},{className:"shadow-md",value:"0px 4px 8px -2px rgba(16, 24, 40, 0.10), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)",textShadowValue:"0px 4px 8px rgba(16, 24, 40, 0.10)"},{className:"shadow-lg",value:"0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03)",textShadowValue:"0px 12px 16px rgba(16, 24, 40, 0.12)"},{className:"shadow-xl",value:"0px 16px 32px -8px rgba(16, 24, 40, 0.18)",textShadowValue:"0px 16px 32px rgba(16, 24, 40, 0.18)"},{className:"shadow-2xl",value:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)",textShadowValue:"0px 24px 48px rgba(16, 24, 40, 0.18)"},{className:"shadow-3xl",value:"0px 32px 64px -12px rgba(16, 24, 40, 0.14)",textShadowValue:"0px 32px 64px rgba(16, 24, 40, 0.14)"}];let c={};O.forEach(e=>{c["."+e.className]={boxShadow:e.value},c[".text-"+e.className]={textShadow:e.textShadowValue}});const B=s(({addComponents:e})=>{e(c)});function j(e){const r={brandColor:e?.brandColor||a.ColoursConfig.brand[500],grayColor:e?.grayColor||a.ColoursConfig.gray[400],errorColor:e?.errorColor||a.ColoursConfig.error[500]},o=[{className:"ring-brand",value:"0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-gray",value:"0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-gray-secondary",value:"0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.2)},{className:"ring-error",value:"0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)},{className:"ring-brand-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-brand-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.brandColor,.24)},{className:"ring-gray-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-gray-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.grayColor,.14)},{className:"ring-error-shadow-xs",value:"0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)},{className:"ring-error-shadow-sm",value:"0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06), 0px 0px 0px 4px "+a.hexToRGB(r.errorColor,.24)}];let n={};return o.forEach(l=>{n["."+l.className]={boxShadow:l.value}}),s(({addComponents:l})=>{l(n)})}const D=j,E=s(({addBase:e,theme:r})=>{},{theme:{extend:{container:{center:!0,padding:{DEFAULT:"2rem",md:"1rem"}}}}}),v=s(({addBase:e,theme:r})=>{},{theme:{extend:{height:{xxs:"0.5rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.75rem"}}}}),w=s(({addBase:e,theme:r})=>{},{theme:{extend:{screens:{"max-xl":{max:"1279px"},"max-lg":{max:"1023px"},"max-md":{max:"768px"},"max-sm":{max:"639px"},"max-xs":{max:"413px"},sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1600px"}}}}),k=s(({addBase:e,theme:r})=>{},{theme:{extend:{spacing:{"3xlSpace":"96px","2xlSpace":"64px",xlSpace:"32px",lgSpace:"24px",mdSpace:"16px",smSpace:"12px",xsSpace:"8px","2xsSpace":"4px","3xsSpace":"2px"}}}}),_=s(({addBase:e,theme:r})=>{},{theme:{extend:{width:{"2xs":"0.5rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.75rem"}}}}),M=[f,h,N,P,B,D(),E,v,w,k,_],W={brand:["Inter","Source Sans Pro","Helvetica Neue","Roboto","Arial","sans-serif"],inter:["Inter","Source Sans Pro","Helvetica Neue","Roboto","Arial","sans-serif"]},$=M,L=a.ColoursConfig,U=a.ColoursConfig,J=W;exports.DsgBackdropBlurPlugin=P;exports.DsgColorConfig=U;exports.DsgColourConfig=L;exports.DsgContainerPlugin=E;exports.DsgFocusRingsPlugin=D;exports.DsgFontFamilyConfig=J;exports.DsgGradientPlugin=N;exports.DsgHeightPlugin=v;exports.DsgRadiusPlugin=f;exports.DsgScreenPlugin=w;exports.DsgShadowsPlugin=B;exports.DsgSpacingPlugin=k;exports.DsgTailwindPlugin=$;exports.DsgTypographyPlugin=h;exports.DsgWidthPlugin=_;
|
|
@@ -559,7 +559,7 @@ const T = V, q = n(({ addBase: e, theme: r }) => {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
}),
|
|
562
|
+
}), j = n(({ addBase: e, theme: r }) => {
|
|
563
563
|
}, {
|
|
564
564
|
theme: {
|
|
565
565
|
extend: {
|
|
@@ -575,7 +575,7 @@ const T = V, q = n(({ addBase: e, theme: r }) => {
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
}),
|
|
578
|
+
}), W = [
|
|
579
579
|
k,
|
|
580
580
|
v,
|
|
581
581
|
_,
|
|
@@ -586,11 +586,11 @@ const T = V, q = n(({ addBase: e, theme: r }) => {
|
|
|
586
586
|
O,
|
|
587
587
|
G,
|
|
588
588
|
M,
|
|
589
|
-
|
|
590
|
-
],
|
|
589
|
+
j
|
|
590
|
+
], $ = {
|
|
591
591
|
brand: ["Inter", "Source Sans Pro", "Helvetica Neue", "Roboto", "Arial", "sans-serif"],
|
|
592
592
|
inter: ["Inter", "Source Sans Pro", "Helvetica Neue", "Roboto", "Arial", "sans-serif"]
|
|
593
|
-
}, J =
|
|
593
|
+
}, J = W, K = a, Q = a, X = $;
|
|
594
594
|
export {
|
|
595
595
|
H as DsgBackdropBlurPlugin,
|
|
596
596
|
Q as DsgColorConfig,
|
|
@@ -606,5 +606,5 @@ export {
|
|
|
606
606
|
M as DsgSpacingPlugin,
|
|
607
607
|
J as DsgTailwindPlugin,
|
|
608
608
|
v as DsgTypographyPlugin,
|
|
609
|
-
|
|
609
|
+
j as DsgWidthPlugin
|
|
610
610
|
};
|
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.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -103,50 +103,50 @@
|
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@eslint/eslintrc": "^3.3.1",
|
|
106
|
-
"@eslint/js": "^9.
|
|
106
|
+
"@eslint/js": "^9.39.1",
|
|
107
107
|
"@testing-library/vue": "^8.1.0",
|
|
108
108
|
"@types/eslint": "^9.6.1",
|
|
109
|
-
"@types/node": "^22.
|
|
109
|
+
"@types/node": "^22.19.1",
|
|
110
110
|
"@types/uuid": "^10.0.0",
|
|
111
111
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
112
112
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
113
113
|
"@vue/test-utils": "^2.4.6",
|
|
114
|
-
"@vuepic/vue-datepicker": "^11.0.
|
|
114
|
+
"@vuepic/vue-datepicker": "^11.0.3",
|
|
115
115
|
"@vueuse/components": "^13.9.0",
|
|
116
116
|
"@vueuse/core": "^13.9.0",
|
|
117
117
|
"@vueuse/integrations": "^13.9.0",
|
|
118
|
-
"axios": "^1.
|
|
118
|
+
"axios": "^1.13.2",
|
|
119
119
|
"card-validator": "^10.0.3",
|
|
120
|
-
"
|
|
121
|
-
"eslint": "^9.
|
|
120
|
+
"date-fns": "^4.1.0",
|
|
121
|
+
"eslint": "^9.39.1",
|
|
122
122
|
"eslint-config-prettier": "^10.1.8",
|
|
123
123
|
"eslint-plugin-prettier": "^5.5.4",
|
|
124
124
|
"eslint-plugin-storybook": "^0.12.0",
|
|
125
|
-
"eslint-plugin-vue": "^10.5.
|
|
125
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
126
126
|
"floating-vue": "^5.2.2",
|
|
127
|
-
"globals": "^16.
|
|
127
|
+
"globals": "^16.5.0",
|
|
128
128
|
"hotkeys-js": "^3.13.15",
|
|
129
129
|
"jest": "^29.7.0",
|
|
130
|
-
"jiti": "^2.6.
|
|
130
|
+
"jiti": "^2.6.1",
|
|
131
131
|
"jsdom": "^26.1.0",
|
|
132
132
|
"only-allow": "^1.2.1",
|
|
133
133
|
"phone": "^3.1.67",
|
|
134
134
|
"prettier": "^3.6.2",
|
|
135
|
-
"sass": "^1.
|
|
135
|
+
"sass": "^1.94.0",
|
|
136
136
|
"semantic-release": "^24.2.9",
|
|
137
137
|
"storybook": "^8.6.14",
|
|
138
|
-
"tailwindcss": "^3.4.
|
|
139
|
-
"typescript": "^5.9.
|
|
140
|
-
"typescript-eslint": "^8.
|
|
141
|
-
"ua-parser-js": "^2.0.
|
|
138
|
+
"tailwindcss": "^3.4.18",
|
|
139
|
+
"typescript": "^5.9.3",
|
|
140
|
+
"typescript-eslint": "^8.46.4",
|
|
141
|
+
"ua-parser-js": "^2.0.6",
|
|
142
142
|
"uuid": "^11.1.0",
|
|
143
143
|
"vditor": "^3.11.2",
|
|
144
|
-
"vite": "^6.
|
|
144
|
+
"vite": "^6.4.1",
|
|
145
145
|
"vite-plugin-dts": "^4.5.4",
|
|
146
146
|
"vite-svg-loader": "^5.1.0",
|
|
147
147
|
"vitest": "^3.2.4",
|
|
148
148
|
"vue-barcode-reader": "^1.0.3",
|
|
149
|
-
"vue-multiselect": "^3.
|
|
149
|
+
"vue-multiselect": "^3.4.0",
|
|
150
150
|
"vue-tsc": "^2.2.12",
|
|
151
151
|
"vue3-toastify": "^0.2.8"
|
|
152
152
|
},
|